Changeset View
Changeset View
Standalone View
Standalone View
head/sys/arm64/arm64/swtch.S
Show First 20 Lines • Show All 235 Lines • ▼ Show 20 Lines | |||||
ENTRY(fork_trampoline) | ENTRY(fork_trampoline) | ||||
mov x0, x8 | mov x0, x8 | ||||
mov x1, x9 | mov x1, x9 | ||||
mov x2, sp | mov x2, sp | ||||
mov fp, #0 /* Stack traceback stops here. */ | mov fp, #0 /* Stack traceback stops here. */ | ||||
bl _C_LABEL(fork_exit) | bl _C_LABEL(fork_exit) | ||||
/* Restore sp and lr */ | |||||
ldp x0, x1, [sp] | |||||
msr sp_el0, x0 | |||||
mov lr, x1 | |||||
/* Restore the registers other than x0 and x1 */ | /* Restore the registers other than x0 and x1 */ | ||||
ldp x2, x3, [sp, #TF_X + 2 * 8] | ldp x2, x3, [sp, #TF_X + 2 * 8] | ||||
ldp x4, x5, [sp, #TF_X + 4 * 8] | ldp x4, x5, [sp, #TF_X + 4 * 8] | ||||
ldp x6, x7, [sp, #TF_X + 6 * 8] | ldp x6, x7, [sp, #TF_X + 6 * 8] | ||||
ldp x8, x9, [sp, #TF_X + 8 * 8] | ldp x8, x9, [sp, #TF_X + 8 * 8] | ||||
ldp x10, x11, [sp, #TF_X + 10 * 8] | ldp x10, x11, [sp, #TF_X + 10 * 8] | ||||
ldp x12, x13, [sp, #TF_X + 12 * 8] | ldp x12, x13, [sp, #TF_X + 12 * 8] | ||||
ldp x14, x15, [sp, #TF_X + 14 * 8] | ldp x14, x15, [sp, #TF_X + 14 * 8] | ||||
ldp x16, x17, [sp, #TF_X + 16 * 8] | ldp x16, x17, [sp, #TF_X + 16 * 8] | ||||
ldr x19, [sp, #TF_X + 19 * 8] | ldr x19, [sp, #TF_X + 19 * 8] | ||||
ldp x20, x21, [sp, #TF_X + 20 * 8] | ldp x20, x21, [sp, #TF_X + 20 * 8] | ||||
ldp x22, x23, [sp, #TF_X + 22 * 8] | ldp x22, x23, [sp, #TF_X + 22 * 8] | ||||
ldp x24, x25, [sp, #TF_X + 24 * 8] | ldp x24, x25, [sp, #TF_X + 24 * 8] | ||||
ldp x26, x27, [sp, #TF_X + 26 * 8] | ldp x26, x27, [sp, #TF_X + 26 * 8] | ||||
ldp x28, x29, [sp, #TF_X + 28 * 8] | ldp x28, x29, [sp, #TF_X + 28 * 8] | ||||
/* Skip x30 as it was restored above as lr */ | |||||
/* | /* | ||||
* Disable interrupts to avoid | * Disable interrupts to avoid | ||||
* overwriting spsr_el1 by an IRQ exception. | * overwriting spsr_el1 and sp_el0 by an IRQ exception. | ||||
*/ | */ | ||||
msr daifset, #2 | msr daifset, #2 | ||||
/* Restore sp and lr */ | |||||
ldp x0, x1, [sp] | |||||
msr sp_el0, x0 | |||||
mov lr, x1 | |||||
/* Restore elr and spsr */ | /* Restore elr and spsr */ | ||||
ldp x0, x1, [sp, #16] | ldp x0, x1, [sp, #16] | ||||
msr elr_el1, x0 | msr elr_el1, x0 | ||||
msr spsr_el1, x1 | msr spsr_el1, x1 | ||||
/* Finally x0 and x1 */ | /* Finally x0 and x1 */ | ||||
ldp x0, x1, [sp, #TF_X + 0 * 8] | ldp x0, x1, [sp, #TF_X + 0 * 8] | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |