Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 6e5252a in mainline for kernel/arch/amd64/_link.ld.in


Ignore:
Timestamp:
2018-11-13T20:22:20Z (3 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
156bae23
Parents:
2214382
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-10-23 21:48:41)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-13 20:22:20)
Message:

Place AP bootstrap correctly via linker script instead of manual copy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/_link.ld.in

    r2214382 r6e5252a  
    1414ENTRY(multiboot_image_start)
    1515
     16PHDRS {
     17        ap_boot PT_LOAD ;
     18        unmapped PT_LOAD ;
     19        mapped PT_LOAD ;
     20}
     21
    1622SECTIONS {
    1723        kernel_load_address = PA2KA(BOOT_OFFSET);
    1824
    19         .unmapped (BOOT_OFFSET + SIZEOF_HEADERS): AT (BOOT_OFFSET + SIZEOF_HEADERS) {
     25        .ap_bootstrap (AP_BOOT_OFFSET): AT (AP_BOOT_OFFSET) {
     26                ap_bootstrap_start = .;
     27
     28                /* Must be first. */
     29                *(.multiboot);
     30
     31                *(K_AP_TEXT_START);
     32                *(K_AP_DATA_START);
     33                ap_bootstrap_end = .;
     34        } :ap_boot
     35
     36        .unmapped (BOOT_OFFSET): AT (BOOT_OFFSET) {
    2037                unmapped_start = .;
    2138                *(K_TEXT_START);
     
    2340                *(K_INI_PTLS);
    2441                unmapped_end = .;
    25         }
     42        } :unmapped
    2643
    27         .mapped (PA2KA(BOOT_OFFSET) + SIZEOF_HEADERS + SIZEOF(.unmapped)) : AT (BOOT_OFFSET + SIZEOF_HEADERS + SIZEOF(.unmapped)) {
     44        .mapped (PA2KA(BOOT_OFFSET) + SIZEOF(.unmapped)) : AT (BOOT_OFFSET + SIZEOF(.unmapped)) {
    2845                ktext_start = .;
    2946                *(.text .text.*);
     
    4360
    4461                kdata_end = .;
    45         }
     62        } :mapped
    4663
    4764#ifdef CONFIG_LINE_DEBUG
     
    6380
    6481#ifdef CONFIG_SMP
    65         ap_boot = unmapped_ap_boot - BOOT_OFFSET + AP_BOOT_OFFSET;
    66         ap_gdtr = unmapped_ap_gdtr - BOOT_OFFSET + AP_BOOT_OFFSET;
    6782        protected_ap_gdtr = PA2KA(ap_gdtr);
    6883#endif /* CONFIG_SMP */
Note: See TracChangeset for help on using the changeset viewer.