Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359143
b: refs/heads/master
c: 2d6f82f
h: refs/heads/master
i:
  359141: 7a1494c
  359139: 5b0cccb
  359135: 9a530c5
v: v3
  • Loading branch information
Max Filippov authored and Chris Zankel committed Feb 24, 2013
1 parent fd43cc4 commit ac7d363
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 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: b6c7e873daf765e41233b9752083b66442703b7a
refs/heads/master: 2d6f82fee45a52359012948306587eba704cf35b
24 changes: 24 additions & 0 deletions trunk/arch/xtensa/include/asm/traps.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,28 @@
extern void * __init trap_set_handler(int cause, void *handler);
extern void do_unhandled(struct pt_regs *regs, unsigned long exccause);

static inline void spill_registers(void)
{
unsigned int a0, ps;

__asm__ __volatile__ (
"movi a14, " __stringify(PS_EXCM_BIT | LOCKLEVEL) "\n\t"
"mov a12, a0\n\t"
"rsr a13, sar\n\t"
"xsr a14, ps\n\t"
"movi a0, _spill_registers\n\t"
"rsync\n\t"
"callx0 a0\n\t"
"mov a0, a12\n\t"
"wsr a13, sar\n\t"
"wsr a14, ps\n\t"
: : "a" (&a0), "a" (&ps)
#if defined(CONFIG_FRAME_POINTER)
: "a2", "a3", "a4", "a11", "a12", "a13", "a14", "a15",
#else
: "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15",
#endif
"memory");
}

#endif /* _XTENSA_TRAPS_H */
21 changes: 1 addition & 20 deletions trunk/arch/xtensa/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/processor.h>
#include <asm/traps.h>

#ifdef CONFIG_KGDB
extern int gdb_enter;
Expand Down Expand Up @@ -413,26 +414,6 @@ static __always_inline unsigned long *stack_pointer(struct task_struct *task)
return sp;
}

static inline void spill_registers(void)
{
unsigned int a0, ps;

__asm__ __volatile__ (
"movi a14, " __stringify(PS_EXCM_BIT | LOCKLEVEL) "\n\t"
"mov a12, a0\n\t"
"rsr a13, sar\n\t"
"xsr a14, ps\n\t"
"movi a0, _spill_registers\n\t"
"rsync\n\t"
"callx0 a0\n\t"
"mov a0, a12\n\t"
"wsr a13, sar\n\t"
"wsr a14, ps\n\t"
:: "a" (&a0), "a" (&ps)
: "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15",
"memory");
}

void show_trace(struct task_struct *task, unsigned long *sp)
{
unsigned long a0, a1, pc;
Expand Down

0 comments on commit ac7d363

Please sign in to comment.