Changes in kernel/arch/amd64/src/smp/ap.S [9d58539:4928165] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/smp/ap.S
r9d58539 r4928165 32 32 # 33 33 34 #include <abi/asmtool.h> 34 35 #include <arch/boot/boot.h> 35 36 #include <arch/boot/memmap.h> … … 38 39 #include <arch/cpu.h> 39 40 #include <arch/cpuid.h> 41 #include <arch/context_struct.h> 40 42 41 43 .section K_TEXT_START, "ax" 42 44 43 45 #ifdef CONFIG_SMP 44 45 .global unmapped_ap_boot46 46 47 47 # This piece of code is real-mode and is meant to be alligned at 4K boundary. … … 50 50 51 51 .align 4096 52 unmapped_ap_boot: 52 SYMBOL(unmapped_ap_boot) 53 53 .code16 54 54 cli … … 59 59 60 60 movl %cr0, %eax 61 orl $ 1, %eax61 orl $CR0_PE, %eax 62 62 movl %eax, %cr0 # switch to protected mode 63 63 jmpl $GDT_SELECTOR(KTEXT32_DES), $jump_to_kernel - BOOT_OFFSET + AP_BOOT_OFFSET … … 76 76 77 77 movl %cr4, %eax 78 btsl $5, %eax78 orl $CR4_PAE, %eax 79 79 movl %eax, %cr4 80 80 … … 83 83 84 84 # Enable long mode 85 movl $ EFER_MSR_NUM, %ecx # EFER MSR number85 movl $AMD_MSR_EFER, %ecx # EFER MSR number 86 86 rdmsr # Read EFER 87 btsl $AMD_LME_FLAG, %eax# Set LME=187 orl $AMD_LME, %eax # Set LME=1 88 88 wrmsr # Write EFER 89 89 90 90 # Enable paging to activate long mode (set CR0.PG = 1) 91 91 movl %cr0, %eax 92 btsl $31, %eax92 orl $CR0_PG, %eax 93 93 movl %eax, %cr0 94 94 … … 99 99 start64: 100 100 movabsq $ctx, %rsp 101 movq (%rsp), %rsp101 movq CONTEXT_OFFSET_SP(%rsp), %rsp 102 102 103 103 pushq $0 … … 113 113 #ifdef CONFIG_SMP 114 114 115 .global unmapped_ap_gdtr 116 unmapped_ap_gdtr: 115 SYMBOL(unmapped_ap_gdtr) 117 116 .word 0 118 117 .long 0
Note:
See TracChangeset
for help on using the changeset viewer.