aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/armdebug/Debugger/debug_macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'AT91SAM7S256/armdebug/Debugger/debug_macros.h')
-rw-r--r--AT91SAM7S256/armdebug/Debugger/debug_macros.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/AT91SAM7S256/armdebug/Debugger/debug_macros.h b/AT91SAM7S256/armdebug/Debugger/debug_macros.h
index 3fcc78c..d6786d5 100644
--- a/AT91SAM7S256/armdebug/Debugger/debug_macros.h
+++ b/AT91SAM7S256/armdebug/Debugger/debug_macros.h
@@ -223,6 +223,20 @@
_asciiz r0, r1
.endm
+/* _regenum2index
+ * Convert register enum to debugger stack index
+ *
+ * On entry:
+ * indexenum: enum representing Register to access
+ * indexreg: register to be used to store the debugger stack index value (0-max index)
+ * On exit:
+ * indexreg contains debugger stack index value (0-max index)
+ */
+ .macro _regenum2index indexenum, indexreg
+ mov \indexreg, #indexenum
+ add \indexreg, \indexreg, #DBGSTACK_USERREG_INDEX /* Convert register index to Debug Stack index, keep in R1 */
+ .endm
+
/* _getdbgregisterfromindex
* Retrieve register contents from debugger stack given index
*