mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
arm/armv7-a/r: unified syscall registers dump
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
22e71e2d71
commit
d398ffb930
@@ -44,6 +44,32 @@
|
|||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: dump_syscall
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Dump the syscall registers
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
static void dump_syscall(const char *tag, uint32_t cmd, const uint32_t *regs)
|
||||||
|
{
|
||||||
|
/* The SVCall software interrupt is called with R0 = system call command
|
||||||
|
* and R1..R7 = variable number of arguments depending on the system call.
|
||||||
|
*/
|
||||||
|
|
||||||
|
svcinfo("SYSCALL %s: regs: %p cmd: %" PRId32 "\n", tag, regs, cmd);
|
||||||
|
svcinfo(" R0: %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
|
||||||
|
" %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n",
|
||||||
|
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||||
|
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||||
|
svcinfo(" R8: %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
|
||||||
|
" %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n",
|
||||||
|
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||||
|
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||||
|
svcinfo("CPSR: %08" PRIx32 "\n", regs[REG_CPSR]);
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: dispatch_syscall
|
* Name: dispatch_syscall
|
||||||
*
|
*
|
||||||
@@ -103,10 +129,6 @@ static void dispatch_syscall(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -142,16 +164,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||||||
* and R1..R7 = variable number of arguments depending on the system call.
|
* and R1..R7 = variable number of arguments depending on the system call.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
svcinfo("SYSCALL Entry: regs: %p cmd: %" PRId32 "\n", regs, cmd);
|
dump_syscall("Entry", cmd, regs);
|
||||||
svcinfo(" R0: %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
|
|
||||||
" %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n",
|
|
||||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
|
||||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
|
||||||
svcinfo(" R8: %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
|
|
||||||
" %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n",
|
|
||||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
|
||||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
|
||||||
svcinfo("CPSR: %08" PRIx32 "\n", regs[REG_CPSR]);
|
|
||||||
|
|
||||||
/* Handle the SVCall according to the command in R0 */
|
/* Handle the SVCall according to the command in R0 */
|
||||||
|
|
||||||
@@ -512,16 +525,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||||||
|
|
||||||
/* Report what happened */
|
/* Report what happened */
|
||||||
|
|
||||||
svcinfo("SYSCALL Exit: regs: %p\n", regs);
|
dump_syscall("Exit", cmd, regs);
|
||||||
svcinfo(" R0: %" PRIx32 " %" PRIx32 " %" PRIx32 " %" PRIx32
|
|
||||||
" %" PRIx32 " %" PRIx32 " %" PRIx32 " %" PRIx32 "\n",
|
|
||||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
|
||||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
|
||||||
svcinfo(" R8: %" PRIx32 " %" PRIx32 " %" PRIx32 " %" PRIx32
|
|
||||||
" %" PRIx32 " %" PRIx32 " %" PRIx32 " %" PRIx32 "\n",
|
|
||||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
|
||||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
|
||||||
svcinfo("CPSR: %08" PRIx32 "\n", regs[REG_CPSR]);
|
|
||||||
|
|
||||||
/* Return the last value of curent_regs. This supports context switches
|
/* Return the last value of curent_regs. This supports context switches
|
||||||
* on return from the exception. That capability is only used with the
|
* on return from the exception. That capability is only used with the
|
||||||
|
|||||||
@@ -41,6 +41,32 @@
|
|||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: dump_syscall
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Dump the syscall registers
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
static void dump_syscall(const char *tag, uint32_t cmd, const uint32_t *regs)
|
||||||
|
{
|
||||||
|
/* The SVCall software interrupt is called with R0 = system call command
|
||||||
|
* and R1..R7 = variable number of arguments depending on the system call.
|
||||||
|
*/
|
||||||
|
|
||||||
|
svcinfo("SYSCALL %s: regs: %p cmd: %" PRId32 "\n", tag, regs, cmd);
|
||||||
|
svcinfo(" R0: %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
|
||||||
|
" %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n",
|
||||||
|
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||||
|
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||||
|
svcinfo(" R8: %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
|
||||||
|
" %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n",
|
||||||
|
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||||
|
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||||
|
svcinfo("CPSR: %08" PRIx32 "\n", regs[REG_CPSR]);
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: dispatch_syscall
|
* Name: dispatch_syscall
|
||||||
*
|
*
|
||||||
@@ -100,10 +126,6 @@ static void dispatch_syscall(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -139,14 +161,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||||||
* and R1..R7 = variable number of arguments depending on the system call.
|
* and R1..R7 = variable number of arguments depending on the system call.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
svcinfo("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd);
|
dump_syscall("Entry", cmd, regs);
|
||||||
svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
|
||||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
|
||||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
|
||||||
svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
|
||||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
|
||||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
|
||||||
svcinfo("CPSR: %08x\n", regs[REG_CPSR]);
|
|
||||||
|
|
||||||
/* Handle the SVCall according to the command in R0 */
|
/* Handle the SVCall according to the command in R0 */
|
||||||
|
|
||||||
@@ -507,14 +522,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||||||
|
|
||||||
/* Report what happened */
|
/* Report what happened */
|
||||||
|
|
||||||
svcinfo("SYSCALL Exit: regs: %p\n", regs);
|
dump_syscall("Exit", cmd, regs);
|
||||||
svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
|
||||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
|
||||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
|
||||||
svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
|
||||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
|
||||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
|
||||||
svcinfo("CPSR: %08x\n", regs[REG_CPSR]);
|
|
||||||
|
|
||||||
/* Return the last value of curent_regs. This supports context switches
|
/* Return the last value of curent_regs. This supports context switches
|
||||||
* on return from the exception. That capability is only used with the
|
* on return from the exception. That capability is only used with the
|
||||||
|
|||||||
Reference in New Issue
Block a user