Changeset 8a1afd2 in mainline
- Timestamp:
- 2018-10-17T22:51:33Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1d18bbc0, d723a80
- Parents:
- 7900e5d
- Location:
- kernel
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/abs32le/_link.ld.in
r7900e5d r8a1afd2 1 1 SECTIONS { 2 2 .text : { 3 kernel_load_address = .; 3 4 ktext_start = .; 4 5 *(.text); … … 8 9 kdata_start = .; 9 10 *(.data); /* initialized data */ 10 hardcoded_ktext_size = .;11 LONG(ktext_end - ktext_start);12 hardcoded_kdata_size = .;13 LONG(kdata_end - kdata_start);14 hardcoded_load_address = .;15 LONG(hardcoded_load_address);16 11 *(.bss); /* uninitialized static variables */ 17 12 *(COMMON); /* global variables */ -
kernel/arch/abs32le/src/mm/frame.c
r7900e5d r8a1afd2 42 42 #include <print.h> 43 43 44 size_t hardcoded_unmapped_ktext_size = 0;45 size_t hardcoded_unmapped_kdata_size = 0;46 47 44 void physmem_print(void) 48 45 { -
kernel/arch/amd64/_link.ld.in
r7900e5d r8a1afd2 13 13 14 14 SECTIONS { 15 kernel_load_address = PA2KA(BOOT_OFFSET); 16 15 17 .unmapped BOOT_OFFSET: AT (0) { 16 18 unmapped_ktext_start = .; … … 32 34 *(.data); /* initialized data */ 33 35 *(.rodata .rodata.*); /* string literals */ 34 hardcoded_load_address = .;35 QUAD(PA2KA(BOOT_OFFSET));36 hardcoded_ktext_size = .;37 QUAD(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start));38 hardcoded_kdata_size = .;39 QUAD(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start));40 hardcoded_unmapped_ktext_size = .;41 QUAD(unmapped_ktext_end - unmapped_ktext_start);42 hardcoded_unmapped_kdata_size = .;43 QUAD(unmapped_kdata_end - unmapped_kdata_start);44 36 *(COMMON); /* global variables */ 45 37 … … 71 63 72 64 #ifdef CONFIG_SMP 73 _hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start);74 65 ap_boot = unmapped_ap_boot - BOOT_OFFSET + AP_BOOT_OFFSET; 75 66 ap_gdtr = unmapped_ap_gdtr - BOOT_OFFSET + AP_BOOT_OFFSET; -
kernel/arch/amd64/include/arch/boot/boot.h
r7900e5d r8a1afd2 42 42 #ifndef __ASSEMBLER__ 43 43 44 #ifdef CONFIG_SMP 45 46 /* This is only a symbol so the type is dummy. Obtain the value using &. */ 47 extern int _hardcoded_unmapped_size; 48 49 #endif /* CONFIG_SMP */ 44 extern uint8_t unmapped_kdata_end[]; 50 45 51 46 #endif /* __ASSEMBLER__ */ -
kernel/arch/amd64/src/amd64.c
r7900e5d r8a1afd2 94 94 95 95 #ifdef CONFIG_SMP 96 size_t unmapped_size = (uintptr_t) unmapped_kdata_end - BOOT_OFFSET; 96 97 /* Copy AP bootstrap routines below 1 MB. */ 97 memcpy((void *) AP_BOOT_OFFSET, (void *) BOOT_OFFSET, 98 (size_t) &_hardcoded_unmapped_size); 98 memcpy((void *) AP_BOOT_OFFSET, (void *) BOOT_OFFSET, unmapped_size); 99 99 #endif 100 100 } -
kernel/arch/arm32/_link.ld.in
r7900e5d r8a1afd2 24 24 SECTIONS { 25 25 . = KERNEL_LOAD_ADDRESS; 26 kernel_load_address = .; 26 27 .text : { 27 28 ktext_start = .; … … 32 33 kdata_start = .; 33 34 *(.data); /* initialized data */ 34 hardcoded_ktext_size = .;35 LONG(ktext_end - ktext_start);36 hardcoded_kdata_size = .;37 LONG(kdata_end - kdata_start);38 hardcoded_load_address = .;39 LONG(KERNEL_LOAD_ADDRESS);40 35 *(.bss); /* uninitialized static variables */ 41 36 *(COMMON); /* global variables */ -
kernel/arch/ia32/_link.ld.in
r7900e5d r8a1afd2 13 13 14 14 SECTIONS { 15 kernel_load_address = PA2KA(BOOT_OFFSET); 16 15 17 .unmapped BOOT_OFFSET: AT (0) { 16 18 unmapped_ktext_start = .; … … 32 34 *(.rodata .rodata.*); /* string literals */ 33 35 *(COMMON); /* global variables */ 34 hardcoded_load_address = .;35 LONG(PA2KA(BOOT_OFFSET));36 hardcoded_ktext_size = .;37 LONG((ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start));38 hardcoded_kdata_size = .;39 LONG((kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start));40 hardcoded_unmapped_ktext_size = .;41 LONG(unmapped_ktext_end - unmapped_ktext_start);42 hardcoded_unmapped_kdata_size = .;43 LONG(unmapped_kdata_end - unmapped_kdata_start);44 36 . = ALIGN(8); 45 37 symbol_table = .; … … 68 60 #ifdef CONFIG_SMP 69 61 70 _hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start);71 62 ap_boot = unmapped_ap_boot - BOOT_OFFSET + AP_BOOT_OFFSET; 72 63 ap_gdtr = unmapped_ap_gdtr - BOOT_OFFSET + AP_BOOT_OFFSET; -
kernel/arch/ia32/include/arch/boot/boot.h
r7900e5d r8a1afd2 44 44 #ifdef CONFIG_SMP 45 45 46 /* This is only a symbol so the type is dummy. Obtain the value using &. */ 47 extern int _hardcoded_unmapped_size; 46 extern uint8_t unmapped_kdata_end[]; 48 47 49 48 #endif /* CONFIG_SMP */ -
kernel/arch/ia32/src/boot/multiboot.S
r7900e5d r8a1afd2 285 285 /** Calculate unmapped address of the end of the kernel. */ 286 286 calc_kernel_end: 287 movl $KA2PA(hardcoded_load_address), %edi 288 movl (%edi), %esi 289 leal KA2PA(0)(%esi), %esi 290 291 movl $KA2PA(hardcoded_ktext_size), %edi 292 addl (%edi), %esi 293 leal KA2PA(0)(%esi), %esi 294 295 movl $KA2PA(hardcoded_kdata_size), %edi 296 addl (%edi), %esi 297 leal KA2PA(0)(%esi), %esi 298 movl %esi, kernel_end 299 287 movl $KA2PA(kdata_end), %edi 288 movl %edi, kernel_end 300 289 ret 301 290 -
kernel/arch/ia32/src/ia32.c
r7900e5d r8a1afd2 94 94 95 95 #ifdef CONFIG_SMP 96 size_t unmapped_size = (uintptr_t) unmapped_kdata_end - BOOT_OFFSET; 96 97 /* Copy AP bootstrap routines below 1 MB. */ 97 memcpy((void *) AP_BOOT_OFFSET, (void *) BOOT_OFFSET, 98 (size_t) &_hardcoded_unmapped_size); 98 memcpy((void *) AP_BOOT_OFFSET, (void *) BOOT_OFFSET, unmapped_size); 99 99 #endif 100 100 } -
kernel/arch/ia32/src/mm/frame.c
r7900e5d r8a1afd2 47 47 48 48 #define PHYSMEM_LIMIT32 UINT64_C(0x100000000) 49 50 size_t hardcoded_unmapped_ktext_size = 0;51 size_t hardcoded_unmapped_kdata_size = 0;52 49 53 50 static void init_e820_memory(pfn_t minconf, bool low) … … 155 152 156 153 #ifdef CONFIG_SMP 154 size_t unmapped_size = 155 (uintptr_t) unmapped_kdata_end - BOOT_OFFSET; 156 157 157 minconf = max(minconf, 158 ADDR2PFN(AP_BOOT_OFFSET + hardcoded_unmapped_ktext_size + 159 hardcoded_unmapped_kdata_size)); 158 ADDR2PFN(AP_BOOT_OFFSET + unmapped_size)); 160 159 #endif 161 160 … … 168 167 /* Reserve AP real mode bootstrap memory */ 169 168 frame_mark_unavailable(AP_BOOT_OFFSET >> FRAME_WIDTH, 170 (hardcoded_unmapped_ktext_size + 171 hardcoded_unmapped_kdata_size) >> FRAME_WIDTH); 169 unmapped_size >> FRAME_WIDTH); 172 170 #endif 173 171 } -
kernel/arch/ia64/_link.ld.in
r7900e5d r8a1afd2 13 13 14 14 SECTIONS { 15 kernel_load_address = LOAD_ADDRESS_V; 16 15 17 .image LOAD_ADDRESS_V: AT (LOAD_ADDRESS_P) { 16 18 ktext_start = .; … … 24 26 *(.opd) 25 27 *(.data .data.*) 26 hardcoded_load_address = .;27 QUAD(LOAD_ADDRESS_V);28 hardcoded_ktext_size = .;29 QUAD(ktext_end - ktext_start);30 hardcoded_kdata_size = .;31 QUAD(kdata_end - kdata_start);32 28 __gp = .; 33 29 *(.got .got.*) -
kernel/arch/mips32/_link.ld.in
r7900e5d r8a1afd2 23 23 SECTIONS { 24 24 . = KERNEL_LOAD_ADDRESS; 25 kernel_load_address = .; 26 25 27 .text : { 26 28 ktext_start = .; … … 31 33 kdata_start = .; 32 34 *(.data); /* initialized data */ 33 hardcoded_ktext_size = .;34 LONG(ktext_end - ktext_start);35 hardcoded_kdata_size = .;36 LONG(kdata_end - kdata_start);37 hardcoded_load_address = .;38 LONG(KERNEL_LOAD_ADDRESS);39 35 *(.rodata*); 40 36 *(.sdata); -
kernel/arch/ppc32/_link.ld.in
r7900e5d r8a1afd2 18 18 19 19 SECTIONS { 20 kernel_load_address = PA2KA(0); 21 20 22 .unmapped 0: AT (0) { 21 23 unmapped_ktext_start = .; … … 41 43 *(.sdata2); 42 44 *(.sbss); 43 hardcoded_ktext_size = .;44 LONG(ktext_end - ktext_start);45 hardcoded_kdata_size = .;46 LONG(kdata_end - kdata_start);47 hardcoded_load_address = .;48 LONG(PA2KA(BOOT_OFFSET));49 45 *(.bss); /* uninitialized static variables */ 50 46 *(COMMON); /* global variables */ -
kernel/arch/riscv64/_link.ld.in
r7900e5d r8a1afd2 14 14 15 15 SECTIONS { 16 kernel_load_address = PA2KA(BOOT_OFFSET); 17 16 18 .image (PA2KA(BOOT_OFFSET)) : AT (0) { 17 19 ktext_start = .; … … 23 25 *(.data); /* initialized data */ 24 26 *(.rodata*); 25 hardcoded_load_address = .;26 QUAD(PA2KA(BOOT_OFFSET));27 hardcoded_ktext_size = .;28 QUAD(ktext_end - ktext_start);29 hardcoded_kdata_size = .;30 QUAD(kdata_end - kdata_start);31 27 *(.sdata); 32 28 *(.reginfo); -
kernel/arch/sparc64/_link.ld.in
r7900e5d r8a1afd2 13 13 SECTIONS { 14 14 .image VMA: AT (LMA) { 15 kernel_load_address = .; 16 15 17 ktext_start = .; 16 18 *(K_TEXT_START) … … 26 28 *(.sbss); 27 29 . = ALIGN(8); 28 hardcoded_ktext_size = .;29 QUAD(ktext_end - ktext_start);30 hardcoded_kdata_size = .;31 QUAD(kdata_end - kdata_start);32 hardcoded_load_address = .;33 QUAD(VMA);34 30 *(.bss); /* uninitialized static variables */ 35 31 *(COMMON); /* global variables */ -
kernel/generic/include/main/main.h
r7900e5d r8a1afd2 38 38 #include <typedefs.h> 39 39 40 extern size_t hardcoded_kdata_size; 41 extern size_t hardcoded_ktext_size; 42 extern uintptr_t hardcoded_load_address; 40 /* Address of the start of the kernel image. */ 41 extern uint8_t kernel_load_address[]; 42 /* Address of the end of kernel. */ 43 extern uint8_t kdata_end[]; 44 43 45 extern uintptr_t stack_safe; 44 46 -
kernel/generic/src/main/main.c
r7900e5d r8a1afd2 168 168 config.cpu_active = 1; 169 169 170 config.base = hardcoded_load_address; 171 config.kernel_size = ALIGN_UP(hardcoded_ktext_size + 172 hardcoded_kdata_size, PAGE_SIZE); 170 config.base = (uintptr_t) kernel_load_address; 171 172 config.kernel_size = 173 ALIGN_UP((uintptr_t) kdata_end - config.base, PAGE_SIZE); 173 174 config.stack_size = STACK_SIZE; 174 175
Note:
See TracChangeset
for help on using the changeset viewer.