mirror of
https://github.com/apache/nuttx.git
synced 2026-08-29 21:30:44 +00:00
arm64: add the interrupt status in the syscall
Set interrupt status flag in tpidr_el1 register (bit 0 set to 1) when entering syscall handler to indicate IRQ-in-progress state, and clear it when exiting to properly track kernel execution context across all code paths. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
54ff28a47f
commit
ac8a61d70b
1 changed files with 12 additions and 0 deletions
|
|
@ -164,6 +164,10 @@ uint64_t *arm64_syscall(uint64_t *regs)
|
|||
uint64_t spsr;
|
||||
#endif
|
||||
|
||||
/* Set irq flag */
|
||||
|
||||
write_sysreg((uintptr_t)tcb | 1, tpidr_el1);
|
||||
|
||||
/* Nested interrupts are not supported */
|
||||
|
||||
DEBUGASSERT(regs);
|
||||
|
|
@ -314,6 +318,10 @@ uint64_t *arm64_syscall(uint64_t *regs)
|
|||
default:
|
||||
{
|
||||
svcerr("ERROR: Bad SYS call: 0x%" PRIx64 "\n", cmd);
|
||||
|
||||
/* Clear irq flag */
|
||||
|
||||
write_sysreg((uintptr_t)tcb & ~1ul, tpidr_el1);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
|
@ -326,5 +334,9 @@ uint64_t *arm64_syscall(uint64_t *regs)
|
|||
*/
|
||||
|
||||
(*running_task)->xcp.regs = NULL;
|
||||
|
||||
/* Clear irq flag */
|
||||
|
||||
write_sysreg((uintptr_t)tcb & ~1ul, tpidr_el1);
|
||||
return regs;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue