mirror of
https://github.com/apache/nuttx.git
synced 2026-08-04 13:49:06 +00:00
arm64/syscall: (Re-)enable interrupts only if they were previously enabled
Don't change the CPU state unexpectedly
This commit is contained in:
parent
498275ca43
commit
87d9dac817
1 changed files with 6 additions and 0 deletions
|
|
@ -222,7 +222,13 @@ SECTION_FUNC(text, arm64_sync_exc)
|
|||
|
||||
/* Call dispatch_syscall() on the kernel stack with interrupts enabled */
|
||||
|
||||
mrs x10, spsr_el1
|
||||
and x10, x10, #IRQ_SPSR_MASK
|
||||
cmp x10, xzr
|
||||
bne 1f
|
||||
msr daifclr, #IRQ_DAIF_MASK /* Re-enable interrupts */
|
||||
|
||||
1:
|
||||
bl dispatch_syscall
|
||||
msr daifset, #IRQ_DAIF_MASK /* Disable interrupts */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue