Commit 9b8c7d1e authored by Vineet Gupta's avatar Vineet Gupta

ARC: entry.S: FAKE_RET_FROM_EXCPN can always use r9

Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
parent a615b47d
...@@ -331,14 +331,14 @@ ...@@ -331,14 +331,14 @@
* Look at EV_ProtV to see how this is actually used * Look at EV_ProtV to see how this is actually used
*-------------------------------------------------------------*/ *-------------------------------------------------------------*/
.macro FAKE_RET_FROM_EXCPN reg .macro FAKE_RET_FROM_EXCPN
ld \reg, [sp, PT_status32] ld r9, [sp, PT_status32]
bic \reg, \reg, (STATUS_U_MASK|STATUS_DE_MASK) bic r9, r9, (STATUS_U_MASK|STATUS_DE_MASK)
bset \reg, \reg, STATUS_L_BIT bset r9, r9, STATUS_L_BIT
sr \reg, [erstatus] sr r9, [erstatus]
mov \reg, 55f mov r9, 55f
sr \reg, [eret] sr r9, [eret]
rtie rtie
55: 55:
......
...@@ -261,7 +261,7 @@ ENTRY(instr_service) ...@@ -261,7 +261,7 @@ ENTRY(instr_service)
lr r0, [efa] lr r0, [efa]
mov r1, sp mov r1, sp
FAKE_RET_FROM_EXCPN r9 FAKE_RET_FROM_EXCPN
bl do_insterror_or_kprobe bl do_insterror_or_kprobe
b ret_from_exception b ret_from_exception
...@@ -278,7 +278,7 @@ ENTRY(mem_service) ...@@ -278,7 +278,7 @@ ENTRY(mem_service)
lr r0, [efa] lr r0, [efa]
mov r1, sp mov r1, sp
FAKE_RET_FROM_EXCPN r9 FAKE_RET_FROM_EXCPN
bl do_memory_error bl do_memory_error
b ret_from_exception b ret_from_exception
...@@ -330,12 +330,11 @@ ENTRY(EV_TLBProtV) ...@@ -330,12 +330,11 @@ ENTRY(EV_TLBProtV)
lr r2, [ecr] lr r2, [ecr]
lr r0, [efa] ; Faulting Data address lr r0, [efa] ; Faulting Data address
; --------(4) Return from CPU Exception Mode --------- ; Exception auto-disables further Intr/exceptions.
; Fake a rtie, but rtie to next label ; Re-enable them by pretending to return from exception
; That way, subsequently, do_page_fault ( ) executes in pure kernel ; (so rest of handler executes in pure K mode)
; mode with further Exceptions enabled
FAKE_RET_FROM_EXCPN r9 FAKE_RET_FROM_EXCPN
mov r1, sp mov r1, sp
...@@ -377,7 +376,7 @@ ENTRY(call_do_page_fault) ...@@ -377,7 +376,7 @@ ENTRY(call_do_page_fault)
EXCEPTION_PROLOGUE EXCEPTION_PROLOGUE
lr r0, [efa] ; Faulting Data address lr r0, [efa] ; Faulting Data address
mov r1, sp mov r1, sp
FAKE_RET_FROM_EXCPN r9 FAKE_RET_FROM_EXCPN
mov blink, ret_from_exception mov blink, ret_from_exception
b do_page_fault b do_page_fault
...@@ -394,7 +393,7 @@ ENTRY(EV_PrivilegeV) ...@@ -394,7 +393,7 @@ ENTRY(EV_PrivilegeV)
lr r0, [efa] lr r0, [efa]
mov r1, sp mov r1, sp
FAKE_RET_FROM_EXCPN r9 FAKE_RET_FROM_EXCPN
bl do_privilege_fault bl do_privilege_fault
b ret_from_exception b ret_from_exception
...@@ -410,7 +409,7 @@ ENTRY(EV_Extension) ...@@ -410,7 +409,7 @@ ENTRY(EV_Extension)
lr r0, [efa] lr r0, [efa]
mov r1, sp mov r1, sp
FAKE_RET_FROM_EXCPN r9 FAKE_RET_FROM_EXCPN
bl do_extension_fault bl do_extension_fault
b ret_from_exception b ret_from_exception
...@@ -472,7 +471,7 @@ trap_with_param: ...@@ -472,7 +471,7 @@ trap_with_param:
; Now that we have read EFA, it is safe to do "fake" rtie ; Now that we have read EFA, it is safe to do "fake" rtie
; and get out of CPU exception mode ; and get out of CPU exception mode
FAKE_RET_FROM_EXCPN r11 FAKE_RET_FROM_EXCPN
; Save callee regs in case gdb wants to have a look ; Save callee regs in case gdb wants to have a look
; SP will grow up by size of CALLEE Reg-File ; SP will grow up by size of CALLEE Reg-File
...@@ -512,8 +511,7 @@ ENTRY(EV_Trap) ...@@ -512,8 +511,7 @@ ENTRY(EV_Trap)
; ======= (5a) Trap is due to System Call ======== ; ======= (5a) Trap is due to System Call ========
; Before doing anything, return from CPU Exception Mode FAKE_RET_FROM_EXCPN
FAKE_RET_FROM_EXCPN r11
; If syscall tracing ongoing, invoke pre-pos-hooks ; If syscall tracing ongoing, invoke pre-pos-hooks
GET_CURR_THR_INFO_FLAGS r10 GET_CURR_THR_INFO_FLAGS r10
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment