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>
21
#include <asm/thread_info.h>
27
###############################################################################
29
# build a stack frame from the registers
30
# - the caller has subtracted 4 from SP before coming here
32
###############################################################################
34
add -4,sp # next exception frame ptr save area
37
mov a1,(sp) # USP in MOVM[other] dummy slot
38
movm [d2,d3,a2,a3,exreg0,exreg1,exother],(sp)
39
mov sp,fp # FRAME pointer in A3
40
add -12,sp # allow for calls to be made
42
# push the exception frame onto the front of the list
48
# disable the FPU inside the kernel
51
# we may be holding current in E2
52
#ifdef CONFIG_MN10300_CURRENT_IN_E2
57
###############################################################################
59
# restore the registers from a stack frame
61
###############################################################################
63
# peel back the stack to the calling frame
64
# - this permits execve() to discard extra frames due to kernel syscalls
69
mov d0,(TI_frame,a0) # userspace has regs->next == 0
71
#ifndef CONFIG_MN10300_USING_JTAG
83
movm (sp),[d2,d3,a2,a3,exreg0,exreg1,exother]
85
# must restore usp even if returning to kernel space,
86
# when CONFIG_PREEMPT is enabled.
87
mov (sp),a1 # USP in MOVM[other] dummy slot
97
#endif /* _ASM_FRAME_INC */