Change 215043 by rwatson@rwatson_svr_ctsrd_mipsbuild on 2012/07/28 11:54:48
Clarify a comment in FreeBSD/mips's low-level exception handling:
the SAVE_CPU() and RESTORE_CPU() macros are used only when taking
an exception in kernel model, in which case they place the kernel
register frame on the stack for further processing (and restore
it before continuing).
Annotate that one case of SAVE_CPU() is used to save the kernel
frame before entering the kernel debugger on a stack overflow.
In the future we might want to do something with CP2 EPCC here.
No action is required in the mean time, however.
- * Save CPU and CP0 register state.
+ * Save CPU and CP0 register state when taking an exception in kernel mode.
* This is straightforward except for saving the exception program
* counter. The ddb backtrace code looks for the first instruction
@@ -1035,6 +1035,12 @@
REG_S zero, CALLFRAME_SP(sp)
move ra, k0
+ * XXXCHERI: This SAVE_CPU preserves a kernel register frame before
+ * entering the kernel debugger on kernel stack overflow. In the
+ * future, we may want to do something with CP2 EPCC here (e.g., save
+ * it?).