1 /* MN10300 Microcontroller core system register definitions -*- asm -*-
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
11 #ifndef _ASM_FRAME_INC
12 #define _ASM_FRAME_INC
15 #error not for use in C files
18 #ifndef __ASM_OFFSETS_H__
19 #include <asm/asm-offsets.h>
26 ###############################################################################
28 # build a stack frame from the registers
29 # - the caller has subtracted 4 from SP before coming here
31 ###############################################################################
33 add -4,sp # next exception frame ptr save area
36 mov a1,(sp) # USP in MOVM[other] dummy slot
37 movm [d2,d3,a2,a3,exreg0,exreg1,exother],(sp)
38 mov sp,fp # FRAME pointer in A3
39 add -12,sp # allow for calls to be made
44 and ~EPSW_FE,epsw # disable the FPU inside the kernel
46 # we may be holding current in E2
47 #ifdef CONFIG_MN10300_CURRENT_IN_E2
52 ###############################################################################
54 # restore the registers from a stack frame
56 ###############################################################################
58 # peel back the stack to the calling frame
59 # - this permits execve() to discard extra frames due to kernel syscalls
62 mov (REG_NEXT,fp),d0 # userspace has regs->next == 0
65 #ifndef CONFIG_MN10300_USING_JTAG
77 movm (sp),[d2,d3,a2,a3,exreg0,exreg1,exother]
79 # must restore usp even if returning to kernel space,
80 # when CONFIG_PREEMPT is enabled.
81 mov (sp),a1 # USP in MOVM[other] dummy slot
91 #endif /* _ASM_FRAME_INC */