Changes in kernel/arch/amd64/src/smp/ap.S [4928165:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified kernel/arch/amd64/src/smp/ap.S ¶
r4928165 r9d58539 32 32 # 33 33 34 #include <abi/asmtool.h>35 34 #include <arch/boot/boot.h> 36 35 #include <arch/boot/memmap.h> … … 39 38 #include <arch/cpu.h> 40 39 #include <arch/cpuid.h> 41 #include <arch/context_struct.h>42 40 43 41 .section K_TEXT_START, "ax" 44 42 45 43 #ifdef CONFIG_SMP 44 45 .global unmapped_ap_boot 46 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 SYMBOL(unmapped_ap_boot) 52 unmapped_ap_boot: 53 53 .code16 54 54 cli … … 59 59 60 60 movl %cr0, %eax 61 orl $ CR0_PE, %eax61 orl $1, %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 orl $CR4_PAE, %eax78 btsl $5, %eax 79 79 movl %eax, %cr4 80 80 … … 83 83 84 84 # Enable long mode 85 movl $ AMD_MSR_EFER, %ecx # EFER MSR number85 movl $EFER_MSR_NUM, %ecx # EFER MSR number 86 86 rdmsr # Read EFER 87 orl $AMD_LME, %eax# Set LME=187 btsl $AMD_LME_FLAG, %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 orl $CR0_PG, %eax92 btsl $31, %eax 93 93 movl %eax, %cr0 94 94 … … 99 99 start64: 100 100 movabsq $ctx, %rsp 101 movq CONTEXT_OFFSET_SP(%rsp), %rsp101 movq (%rsp), %rsp 102 102 103 103 pushq $0 … … 113 113 #ifdef CONFIG_SMP 114 114 115 SYMBOL(unmapped_ap_gdtr) 115 .global unmapped_ap_gdtr 116 unmapped_ap_gdtr: 116 117 .word 0 117 118 .long 0
Note:
See TracChangeset
for help on using the changeset viewer.