Changeset 42edee68 in mainline for arch/amd64/src/smp/ap.S
- Timestamp:
- 2006-01-08T19:33:17Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0c0410b
- Parents:
- 46d26ee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/smp/ap.S
r46d26ee r42edee68 1 1 # 2 2 # Copyright (C) 2001-2004 Jakub Jermar 3 # Copyright (C) 2005-2006 Martin Decky 3 4 # All rights reserved. 4 5 # … … 32 33 33 34 #include <arch/boot/boot.h> 35 #include <arch/boot/memmap.h> 36 #include <arch/mm/page.h> 34 37 #include <arch/pm.h> 35 38 #include <arch/cpu.h> 36 39 #include <arch/cpuid.h> 37 #include <arch/mm/page.h> 38 39 .section K_TEXT_START_2, "ax" 40 41 .section K_TEXT_START, "ax" 40 42 41 43 #ifdef CONFIG_SMP 42 44 43 .global ap_boot45 .global unmapped_ap_boot 44 46 45 47 # This piece of code is real-mode and is meant to be alligned at 4K boundary. … … 48 50 49 51 .align 4096 50 ap_boot:52 unmapped_ap_boot: 51 53 .code16 52 54 cli … … 54 56 movw %ax, %ds 55 57 56 lgdt real_bootstrap_gdtr_boot# initialize Global Descriptor Table register58 lgdt ap_gdtr # initialize Global Descriptor Table register 57 59 58 60 movl %cr0, %eax 59 61 orl $1, %eax 60 movl %eax, %cr0 # switch to protected mode 62 movl %eax, %cr0 # switch to protected mode 63 jmpl $gdtselector(KTEXT32_DES), $jump_to_kernel - BOOT_OFFSET + AP_BOOT_OFFSET 61 64 62 jmpl $gdtselector(KTEXT32_DES), $now_in_prot 63 64 .code32 65 now_in_prot: 65 jump_to_kernel: 66 .code32 66 67 movw $gdtselector(KDATA_DES), %ax 67 68 movw %ax, %ds 69 movw %ax, %es 68 70 movw %ax, %ss 69 71 70 71 72 # Enable 64-bit page transaltion entries - CR4.PAE = 1. 72 73 # Paging is not enabled until after long mode is enabled 74 73 75 movl %cr4, %eax 74 76 btsl $5, %eax 75 77 movl %eax, %cr4 76 78 77 # Set up NEW paging tables, that are 78 # already moved BOOT_OFFSET up 79 leal ptl_0+BOOT_OFFSET, %eax 79 leal ptl_0, %eax 80 80 movl %eax, %cr3 81 81 … … 92 92 93 93 # At this point we are in compatibility mode 94 jmpl $gdtselector(KTEXT_DES), $start64 94 jmpl $gdtselector(KTEXT_DES), $start64 - BOOT_OFFSET + AP_BOOT_OFFSET 95 95 96 96 .code64 97 97 start64: 98 98 movq (ctx), %rsp 99 call main_ap # never returns 100 101 99 call main_ap - AP_BOOT_OFFSET + BOOT_OFFSET # never returns 100 102 101 #endif /* CONFIG_SMP */ 102 103 .section K_DATA_START, "ax" 104 105 #ifdef CONFIG_SMP 106 107 .global unmapped_ap_gdtr 108 109 unmapped_ap_gdtr: 110 .word 0 111 .long 0 112 113 #endif /* CONFIG_SMP */
Note:
See TracChangeset
for help on using the changeset viewer.