Skip to content

Commit 67acf0d

Browse files
committed
use and in SVC instruction
1 parent ad77bd8 commit 67acf0d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sys/kern/src/arch/arm_m.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,8 @@ cfg_if::cfg_if! {
862862
SVCall:
863863
@ Inspect LR to figure out the caller's mode.
864864
mov r0, lr
865-
ldr r1, =0xFFFFFFF3
866-
bics r0, r0, r1
865+
movs r1, #0xC
866+
ands r0, r1
867867
@ Is the call coming from thread mode + main stack, i.e.
868868
@ from the kernel startup routine?
869869
cmp r0, #0x8
@@ -939,8 +939,7 @@ cfg_if::cfg_if! {
939939
SVCall:
940940
@ Inspect LR to figure out the caller's mode.
941941
mov r0, lr
942-
mov r1, #0xFFFFFFF3
943-
bic r0, r1
942+
and r0, r0, #0xC
944943
@ Is the call coming from thread mode + main stack, i.e.
945944
@ from the kernel startup routine?
946945
cmp r0, #0x8

0 commit comments

Comments
 (0)