Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57452
b: refs/heads/master
c: 29c4dfd
h: refs/heads/master
v: v3
  • Loading branch information
Chris Zankel committed Jun 1, 2007
1 parent 8dc766f commit e9a7906
Show file tree
Hide file tree
Showing 9 changed files with 351 additions and 525 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: adba09f01577ea441a761a85aacb1e43b58d35c4
refs/heads/master: 29c4dfd92edc26c2cd2c0c64c9201d5b91d6418e
1 change: 1 addition & 0 deletions trunk/arch/xtensa/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ int main(void)
DEFINE(PT_LEND, offsetof (struct pt_regs, lend));
DEFINE(PT_LCOUNT, offsetof (struct pt_regs, lcount));
DEFINE(PT_SAR, offsetof (struct pt_regs, sar));
DEFINE(PT_ICOUNTLEVEL, offsetof (struct pt_regs, icountlevel));
DEFINE(PT_SYSCALL, offsetof (struct pt_regs, syscall));
DEFINE(PT_AREG, offsetof (struct pt_regs, areg[0]));
DEFINE(PT_AREG0, offsetof (struct pt_regs, areg[0]));
Expand Down
36 changes: 14 additions & 22 deletions trunk/arch/xtensa/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ _user_exception:

movi a2, 0
rsr a3, SAR
wsr a2, ICOUNTLEVEL
xsr a2, ICOUNTLEVEL
s32i a3, a1, PT_SAR
s32i a2, a1, PT_ICOUNTLEVEL

/* Rotate ws so that the current windowbase is at bit0. */
/* Assume ws = xxwww1yyyy. Rotate ws right, so that a2 = yyyyxxwww1 */
Expand Down Expand Up @@ -276,8 +277,9 @@ _kernel_exception:

movi a2, 0
rsr a3, SAR
wsr a2, ICOUNTLEVEL
xsr a2, ICOUNTLEVEL
s32i a3, a1, PT_SAR
s32i a2, a1, PT_ICOUNTLEVEL

/* Rotate ws so that the current windowbase is at bit0. */
/* Assume ws = xxwww1yyyy. Rotate ws right, so that a2 = yyyyxxwww1 */
Expand Down Expand Up @@ -330,14 +332,16 @@ _kernel_exception:

common_exception:

/* Save EXCVADDR, DEBUGCAUSE, and PC, and clear LCOUNT */
/* Save some registers, disable loops and clear the syscall flag. */

rsr a2, DEBUGCAUSE
rsr a3, EPC_1
s32i a2, a1, PT_DEBUGCAUSE
s32i a3, a1, PT_PC

movi a2, -1
rsr a3, EXCVADDR
s32i a2, a1, PT_SYSCALL
movi a2, 0
s32i a3, a1, PT_EXCVADDR
xsr a2, LCOUNT
Expand Down Expand Up @@ -450,27 +454,8 @@ common_exception_return:

/* Restore the state of the task and return from the exception. */


/* If we are returning from a user exception, and the process
* to run next has PT_SINGLESTEP set, we want to setup
* ICOUNT and ICOUNTLEVEL to step one instruction.
* PT_SINGLESTEP is set by sys_ptrace (ptrace.c)
*/

4: /* a2 holds GET_CURRENT(a2,a1) */

l32i a3, a2, TI_TASK
l32i a3, a3, TASK_PTRACE
bbci.l a3, PT_SINGLESTEP_BIT, 1f # jump if single-step flag is not set

movi a3, -2 # PT_SINGLESTEP flag is set,
movi a4, 1 # icountlevel of 1 means it won't
wsr a3, ICOUNT # start counting until after rfe
wsr a4, ICOUNTLEVEL # so setup icount & icountlevel.
isync

1:

#if XCHAL_EXTRA_SA_SIZE

/* For user exceptions, restore the extra state from the user's TCB. */
Expand Down Expand Up @@ -665,6 +650,13 @@ common_exception_exit:
wsr a3, LEND
wsr a2, LCOUNT

/* We control single stepping through the ICOUNTLEVEL register. */

l32i a2, a1, PT_ICOUNTLEVEL
movi a3, -2
wsr a2, ICOUNTLEVEL
wsr a3, ICOUNT

/* Check if it was double exception. */

l32i a0, a1, PT_DEPC
Expand Down
Loading

0 comments on commit e9a7906

Please sign in to comment.