From 60932d1427a047cf0a9a12245323799f0fc1bae6 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Tue, 9 Jan 2018 12:06:04 -0800 Subject: [PATCH] xtensa: Add hook to do register window spills This macro was already available add an external symbol so C code can access it (via CALL0 -- it's not and can't be an actual function). Signed-off-by: Andy Ross --- arch/xtensa/core/xtensa-asm2-util.S | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/xtensa/core/xtensa-asm2-util.S b/arch/xtensa/core/xtensa-asm2-util.S index 4fe936483a8..2febda46803 100644 --- a/arch/xtensa/core/xtensa-asm2-util.S +++ b/arch/xtensa/core/xtensa-asm2-util.S @@ -6,6 +6,22 @@ #include #include +/* + * xtensa_spill_reg_windows + * + * Globally visible symbol to do register spills. Useful for unit + * testing, or maybe as part of a debug/watchdog/error handler. Not a + * C function, call this via CALL0 (so you probably have to save off + * A0, but no other registers need to be spilled). On return, all + * registers not part of the current function will be spilled to + * memory. + */ +.global xtensa_spill_reg_windows +.align 4 +xtensa_spill_reg_windows: + SPILL_ALL_WINDOWS + ret + /* * xtensa_save_high_regs * @@ -117,7 +133,6 @@ _high_restore_done: * from switch or an interrupt exit. Interrupts must be disabled, * and register windows should have been spilled. * - * Note that exit from the restore is done with the RFI instruction, * using the EPCn/EPSn registers. Those will have been saved already * by any interrupt entry so they are save to use. Note that EPC1 and