Changeset f56e897f in mainline for kernel/arch/amd64/src/boot/boot.S


Ignore:
Timestamp:
2010-06-29T17:43:38Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6473d41
Parents:
e4a4b44 (diff), 793cf029 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainlnie changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/boot/boot.S

    re4a4b44 rf56e897f  
    3131#include <arch/boot/boot.h>
    3232#include <arch/boot/memmap.h>
    33 #include <arch/mm/page.h>       
     33#include <arch/mm/page.h>
    3434#include <arch/mm/ptl.h>
    3535#include <arch/pm.h>
     
    172172        xorq %rsi, %rsi
    173173        movl grub_ebx, %esi
    174         call arch_pre_main
     174       
     175        movabsq $arch_pre_main, %rax
     176        callq *%rax
    175177       
    176178        # create the first stack frame
    177179        pushq $0
    178180        movq %rsp, %rbp
    179 
    180         call main_bsp
     181       
     182        movabsq $main_bsp, %rax
     183        call *%rax
    181184       
    182185        # not reached
     
    256259#
    257260# Macro for generating initial page table contents.
    258 # @param cnt Number of entries to generat. Must be multiple of 8.
     261# @param cnt Number of entries to generate. Must be multiple of 8.
    259262# @param g   Number of GB that will be added to the mapping.
    260263#
    261 .macro ptl2gen cnt g 
    262 .if \cnt
    263         ptl2gen "\cnt - 8" \g
    264         .quad ((\cnt - 8) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
    265         .quad ((\cnt - 7) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
    266         .quad ((\cnt - 6) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
    267         .quad ((\cnt - 5) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
    268         .quad ((\cnt - 4) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
    269         .quad ((\cnt - 3) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
    270         .quad ((\cnt - 2) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
    271         .quad ((\cnt - 1) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
    272 .endif
     264.macro ptl2gen cnt g
     265        .if \cnt
     266                ptl2gen "\cnt - 8" \g
     267                .quad ((\cnt - 8) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
     268                .quad ((\cnt - 7) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
     269                .quad ((\cnt - 6) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
     270                .quad ((\cnt - 5) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
     271                .quad ((\cnt - 4) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
     272                .quad ((\cnt - 3) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
     273                .quad ((\cnt - 2) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
     274                .quad ((\cnt - 1) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE)
     275        .endif
    273276.endm
    274277
    275 # Page table for pages in the first gigabyte.
    276 .align 4096
    277 .global ptl_2_0g
    278 ptl_2_0g:       
     278# Page table for pages in the 1st gigabyte.
     279.align 4096
     280ptl_2_0g:
    279281        ptl2gen 512 0
    280282
    281 # Page table for pages in the second gigabyte.
    282 .align 4096
    283 .global ptl_2_1g
     283# Page table for pages in the 2nd gigabyte.
     284.align 4096
    284285ptl_2_1g:
    285286        ptl2gen 512 1
    286287
    287 # Page table for pages in the third gigabyte.
    288 .align 4096
    289 .global ptl_2_2g
     288# Page table for pages in the 3rd gigabyte.
     289.align 4096
    290290ptl_2_2g:
    291291        ptl2gen 512 2
    292292
    293 # Page table for pages in the fourth gigabyte.
    294 .align 4096
    295 .global ptl_2_3g
     293# Page table for pages in the 4th gigabyte.
     294.align 4096
    296295ptl_2_3g:
    297296        ptl2gen 512 3
    298297
    299 .align 4096
    300 .global ptl_1
     298# Page table for pages in the 5th gigabyte.
     299.align 4096
     300ptl_2_4g:
     301        ptl2gen 512 3
     302
     303# Page table for pages in the 6th gigabyte.
     304.align 4096
     305ptl_2_5g:
     306        ptl2gen 512 3
     307
     308# Page table for pages in the 7th gigabyte.
     309.align 4096
     310ptl_2_6g:
     311        ptl2gen 512 3
     312
     313# Page table for pages in the 8th gigabyte.
     314.align 4096
     315ptl_2_7g:
     316        ptl2gen 512 3
     317
     318.align 4096
    301319ptl_1:
    302         # Identity mapping for [0; 4G)
     320        # Identity mapping for [0; 8G)
    303321        .quad ptl_2_0g + (PTL_WRITABLE | PTL_PRESENT)
    304         .quad ptl_2_1g + (PTL_WRITABLE | PTL_PRESENT) 
     322        .quad ptl_2_1g + (PTL_WRITABLE | PTL_PRESENT)
    305323        .quad ptl_2_2g + (PTL_WRITABLE | PTL_PRESENT)
    306324        .quad ptl_2_3g + (PTL_WRITABLE | PTL_PRESENT)
    307         .fill 506, 8, 0
    308         # Mapping of [0; 1G) at -2G
    309         .quad ptl_2_0g + (PTL_WRITABLE | PTL_PRESENT)
    310         .fill 1, 8, 0
     325        .quad ptl_2_4g + (PTL_WRITABLE | PTL_PRESENT)
     326        .quad ptl_2_5g + (PTL_WRITABLE | PTL_PRESENT)
     327        .quad ptl_2_6g + (PTL_WRITABLE | PTL_PRESENT)
     328        .quad ptl_2_7g + (PTL_WRITABLE | PTL_PRESENT)
     329        .fill 504, 8, 0
    311330
    312331.align 4096
     
    314333ptl_0:
    315334        .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT)
    316         .fill 255,8,0
     335        .fill 255, 8, 0
    317336        .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT)
    318         .fill 254,8,0
    319         .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT)
     337        .fill 255, 8, 0
    320338
    321339.section K_DATA_START, "aw", @progbits
Note: See TracChangeset for help on using the changeset viewer.