|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [PATCH v3 22/43] arm64: implement the __arch_switch_threads
Hi Shijie, On 16/04/18 07:32, Huang Shijie wrote: Some documentation about the layout of the structure in memory would be useful. + */ +ENTRY(__arch_switch_threads) + /* Store the callee-saved registers to prev's struct thread */ AFAICT, you don't store the callee-saved registers in struct thread but on the stack. Am I right? + mov x2, sp + + sub x2, x2, #(CALLEE_SAVED_REGISTERS * 8) > + stp x19, x20, [x2, #16 * 0] + stp x21, x22, [x2, #16 * 1] + stp x23, x24, [x2, #16 * 2] + stp x25, x26, [x2, #16 * 3] + stp x27, x28, [x2, #16 * 4] + str x29, [x2, #16 * 5] + + /* Store current sp/ip to prev's struct thread */ + stp x2, x30, [x0] + + /* Load the sp/ip from next's struct thread */ + ldp x2, x30, [x1] + + /* Restore the callee-saved registers */ + ldp x19, x20, [x2, #16 * 0] + ldp x21, x22, [x2, #16 * 1] + ldp x23, x24, [x2, #16 * 2] + ldp x25, x26, [x2, #16 * 3] + ldp x27, x28, [x2, #16 * 4] + ldr x29, [x2, #16 * 5] + + add x2, x2, #(CALLEE_SAVED_REGISTERS * 8) + mov sp, x2 + + br x30 +ENDPROC(__arch_switch_threads) diff --git a/include/arm/arm64/os.h b/include/arm/arm64/os.h index 89b4002..2d55023 100644 --- a/include/arm/arm64/os.h +++ b/include/arm/arm64/os.h @@ -1,6 +1,8 @@ #ifndef _ARM64_OS_H_ #define _ARM64_OS_H_+#ifndef __ASSEMBLY__ Cheers, -- Julien Grall _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |