* linux/arch/unicore32/kernel/entry.S
* Code specific to PKUnity SoC and UniCore ISA
* Copyright (C) 2001-2010 GUAN Xue-tao
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
* Low-level vector interface routines
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/thread_info.h>
#include <generated/asm-offsets.h>
@ Most of the stack format comes from struct pt_regs, but with
@ the addition of 8 bytes for storing syscall args 5 and 6.
* The SWI code relies on the fact that R0 is at the bottom of the stack
* (due to slow/fast restore user regs).
#ifdef CONFIG_FRAME_POINTER
.macro alignment_trap, rtemp
#ifdef CONFIG_ALIGNMENT_TRAP
.macro load_user_sp_lr, rd, rtemp, offset = 0
xor \rtemp, \rtemp, #(PRIV_MODE ^ SUSR_MODE)
mov.a asr, \rtemp @ switch to the SUSR mode
ldw sp, [\rd+], #\offset @ load sp_user
ldw lr, [\rd+], #\offset + 4 @ load lr_user
xor \rtemp, \rtemp, #(PRIV_MODE ^ SUSR_MODE)
mov.a asr, \rtemp @ switch back to the PRIV mode