Changeset 0aee9b4 in mainline
- Timestamp:
- 2014-09-02T20:31:13Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b3222a3
- Parents:
- 4dc7a84
- Location:
- kernel/arch/amd64
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/Makefile.inc
r4dc7a84 r0aee9b4 88 88 89 89 ARCH_AUTOGENS_AG = \ 90 arch/$(KARCH)/include/arch/istate_struct.ag 90 arch/$(KARCH)/include/arch/istate_struct.ag \ 91 arch/$(KARCH)/include/arch/context_struct.ag 91 92 -
kernel/arch/amd64/include/arch/context.h
r4dc7a84 r0aee9b4 36 36 #define KERN_amd64_CONTEXT_H_ 37 37 38 #include < typedefs.h>38 #include <arch/context_struct.h> 39 39 40 40 /* … … 52 52 } while (0) 53 53 54 /* We include only registers that must be preserved55 * during function call56 */57 typedef struct {58 uintptr_t sp;59 uintptr_t pc;60 61 uint64_t rbx;62 uint64_t rbp;63 64 uint64_t r12;65 uint64_t r13;66 uint64_t r14;67 uint64_t r15;68 69 ipl_t ipl;70 } __attribute__ ((packed)) context_t;71 72 54 #endif 73 55 -
kernel/arch/amd64/src/context.S
r4dc7a84 r0aee9b4 32 32 .global context_restore_arch 33 33 34 #include <arch/context_ offset.h>34 #include <arch/context_struct.h> 35 35 36 36 ## Save current CPU context … … 43 43 44 44 # 1st argument passed in %edi 45 CONTEXT_SAVE_ARCH_CORE %rdi %rdx 45 movq %rdx, CONTEXT_OFFSET_PC(%rdi) 46 movq %rsp, CONTEXT_OFFSET_SP(%rdi) 47 48 movq %rbx, CONTEXT_OFFSET_RBX(%rdi) 49 movq %rbp, CONTEXT_OFFSET_RBP(%rdi) 50 movq %r12, CONTEXT_OFFSET_R12(%rdi) 51 movq %r13, CONTEXT_OFFSET_R13(%rdi) 52 movq %r14, CONTEXT_OFFSET_R14(%rdi) 53 movq %r15, CONTEXT_OFFSET_R15(%rdi) 46 54 47 55 xorl %eax, %eax # context_save returns 1 … … 56 64 # 57 65 context_restore_arch: 58 CONTEXT_RESTORE_ARCH_CORE %rdi %rdx 66 movq CONTEXT_OFFSET_R15(%rdi), %r15 67 movq CONTEXT_OFFSET_R14(%rdi), %r14 68 movq CONTEXT_OFFSET_R13(%rdi), %r13 69 movq CONTEXT_OFFSET_R12(%rdi), %r12 70 movq CONTEXT_OFFSET_RBP(%rdi), %rbp 71 movq CONTEXT_OFFSET_RBX(%rdi), %rbx 72 73 movq CONTEXT_OFFSET_SP(%rdi), %rsp # ctx->sp -> %rsp 74 75 movq CONTEXT_OFFSET_PC(%rdi), %rdx 59 76 60 77 movq %rdx, (%rsp) … … 62 79 xorl %eax, %eax # context_restore returns 0 63 80 ret 81
Note:
See TracChangeset
for help on using the changeset viewer.