Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/support.S
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | ENTRY(casueword32) | ||||
b.cs fsu_fault_nopcb | b.cs fsu_fault_nopcb | ||||
adr x6, fsu_fault /* Load the fault handler */ | adr x6, fsu_fault /* Load the fault handler */ | ||||
SET_FAULT_HANDLER(x6, x4) /* And set it */ | SET_FAULT_HANDLER(x6, x4) /* And set it */ | ||||
ENTER_USER_ACCESS(w6, x4) | ENTER_USER_ACCESS(w6, x4) | ||||
1: ldxr w4, [x0] /* Load-exclusive the data */ | 1: ldxr w4, [x0] /* Load-exclusive the data */ | ||||
cmp w4, w1 /* Compare */ | cmp w4, w1 /* Compare */ | ||||
b.ne 2f /* Not equal, exit */ | b.ne 2f /* Not equal, exit */ | ||||
stxr w5, w3, [x0] /* Store the new data */ | stxr w5, w3, [x0] /* Store the new data */ | ||||
cbnz w5, 1b /* Retry on failure */ | |||||
2: EXIT_USER_ACCESS(w6) | 2: EXIT_USER_ACCESS(w6) | ||||
SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ | SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ | ||||
str w4, [x2] /* Store the read data */ | str w4, [x2] /* Store the read data */ | ||||
mov x0, #0 /* Success */ | mov w0, w5 /* Result same as store status */ | ||||
jilles: Hmm, is the value in w5 overwritten by SET_FAULT_HANDLER? | |||||
Done Inline ActionsI think w5's contents are uninitialized if we follow the branch to label 2. markj: I think w5's contents are uninitialized if we follow the branch to label 2. | |||||
ret /* Return */ | ret /* Return */ | ||||
END(casueword32) | END(casueword32) | ||||
Done Inline ActionsExtra newline andrew: Extra newline | |||||
/* | /* | ||||
* int casueword(volatile u_long *, u_long, u_long *, u_long) | * int casueword(volatile u_long *, u_long, u_long *, u_long) | ||||
*/ | */ | ||||
ENTRY(casueword) | ENTRY(casueword) | ||||
ldr x4, =(VM_MAXUSER_ADDRESS-7) | ldr x4, =(VM_MAXUSER_ADDRESS-7) | ||||
cmp x0, x4 | cmp x0, x4 | ||||
b.cs fsu_fault_nopcb | b.cs fsu_fault_nopcb | ||||
adr x6, fsu_fault /* Load the fault handler */ | adr x6, fsu_fault /* Load the fault handler */ | ||||
SET_FAULT_HANDLER(x6, x4) /* And set it */ | SET_FAULT_HANDLER(x6, x4) /* And set it */ | ||||
ENTER_USER_ACCESS(w6, x4) | ENTER_USER_ACCESS(w6, x4) | ||||
1: ldxr x4, [x0] /* Load-exclusive the data */ | 1: ldxr x4, [x0] /* Load-exclusive the data */ | ||||
cmp x4, x1 /* Compare */ | cmp x4, x1 /* Compare */ | ||||
b.ne 2f /* Not equal, exit */ | b.ne 2f /* Not equal, exit */ | ||||
stxr w5, x3, [x0] /* Store the new data */ | stxr w5, x3, [x0] /* Store the new data */ | ||||
cbnz w5, 1b /* Retry on failure */ | |||||
2: EXIT_USER_ACCESS(w6) | 2: EXIT_USER_ACCESS(w6) | ||||
SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ | SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ | ||||
str x4, [x2] /* Store the read data */ | str x4, [x2] /* Store the read data */ | ||||
mov x0, #0 /* Success */ | mov w0, w5 /* Result same as store status */ | ||||
Not Done Inline ActionsSame here. markj: Same here. | |||||
ret /* Return */ | ret /* Return */ | ||||
END(casueword) | END(casueword) | ||||
/* | /* | ||||
* int fubyte(volatile const void *) | * int fubyte(volatile const void *) | ||||
*/ | */ | ||||
ENTRY(fubyte) | ENTRY(fubyte) | ||||
ldr x1, =VM_MAXUSER_ADDRESS | ldr x1, =VM_MAXUSER_ADDRESS | ||||
▲ Show 20 Lines • Show All 190 Lines • Show Last 20 Lines |
Hmm, is the value in w5 overwritten by SET_FAULT_HANDLER?