Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified kernel/arch/amd64/src/smp/ap.S

    r4928165 r9d58539  
    3232#
    3333
    34 #include <abi/asmtool.h>
    3534#include <arch/boot/boot.h>
    3635#include <arch/boot/memmap.h>
     
    3938#include <arch/cpu.h>
    4039#include <arch/cpuid.h>
    41 #include <arch/context_struct.h>
    4240
    4341.section K_TEXT_START, "ax"
    4442
    4543#ifdef CONFIG_SMP
     44
     45.global unmapped_ap_boot
    4646
    4747# This piece of code is real-mode and is meant to be alligned at 4K boundary.
     
    5050
    5151.align 4096
    52 SYMBOL(unmapped_ap_boot)
     52unmapped_ap_boot:
    5353.code16
    5454        cli
     
    5959       
    6060        movl %cr0, %eax
    61         orl $CR0_PE, %eax
     61        orl $1, %eax
    6262        movl %eax, %cr0     # switch to protected mode
    6363        jmpl $GDT_SELECTOR(KTEXT32_DES), $jump_to_kernel - BOOT_OFFSET + AP_BOOT_OFFSET
     
    7676       
    7777        movl %cr4, %eax
    78         orl $CR4_PAE, %eax
     78        btsl $5, %eax
    7979        movl %eax, %cr4
    8080       
     
    8383       
    8484        # Enable long mode
    85         movl $AMD_MSR_EFER, %ecx  # EFER MSR number
     85        movl $EFER_MSR_NUM, %ecx  # EFER MSR number
    8686        rdmsr                     # Read EFER
    87         orl $AMD_LME, %eax        # Set LME=1
     87        btsl $AMD_LME_FLAG, %eax  # Set LME=1
    8888        wrmsr                     # Write EFER
    8989       
    9090        # Enable paging to activate long mode (set CR0.PG = 1)
    9191        movl %cr0, %eax
    92         orl $CR0_PG, %eax
     92        btsl $31, %eax
    9393        movl %eax, %cr0
    9494       
     
    9999start64:
    100100        movabsq $ctx, %rsp
    101         movq CONTEXT_OFFSET_SP(%rsp), %rsp
     101        movq (%rsp), %rsp
    102102       
    103103        pushq $0
     
    113113#ifdef CONFIG_SMP
    114114
    115 SYMBOL(unmapped_ap_gdtr)
     115.global unmapped_ap_gdtr
     116unmapped_ap_gdtr:
    116117        .word 0
    117118        .long 0
Note: See TracChangeset for help on using the changeset viewer.