Changes in / [d078c9b9:4c3602c4] in mainline
- Files:
-
- 80 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
rd078c9b9 r4c3602c4 137 137 ! [PLATFORM=mips32&(MACHINE=bmalta|MACHINE=lmalta)] PROCESSOR (choice) 138 138 139 % Kernel memory model 140 @ "kernel" Kernel 141 @ "large" Large 142 ! [PLATFORM=amd64] MEMORY_MODEL (choice) 143 139 144 % RAM disk format 140 145 @ "tmpfs" TMPFS image -
defaults/amd64/Makefile.config
rd078c9b9 r4c3602c4 1 1 # Platform 2 2 PLATFORM = amd64 3 4 # Kernel memory model 5 MEMORY_MODEL = kernel 3 6 4 7 # Ramdisk format -
kernel/arch/amd64/Makefile.inc
rd078c9b9 r4c3602c4 32 32 33 33 FPU_NO_CFLAGS = -mno-sse -mno-sse2 34 CMN1 = -m64 -mcmodel= kernel-mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer34 CMN1 = -m64 -mcmodel=$(MEMORY_MODEL) -mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer 35 35 GCC_CFLAGS += $(CMN1) 36 36 ICC_CFLAGS += $(CMN1) -
kernel/arch/amd64/include/arch/mm/km.h
rd078c9b9 r4c3602c4 38 38 #include <typedefs.h> 39 39 40 #define KM_AMD64_IDENTITY_START UINT64_C(0xffffffff80000000) 41 #define KM_AMD64_IDENTITY_SIZE UINT64_C(0x0000000080000000) 40 #ifdef MEMORY_MODEL_kernel 42 41 43 #define KM_AMD64_NON_IDENTITY_START UINT64_C(0xffff800000000000) 44 #define KM_AMD64_NON_IDENTITY_SIZE UINT64_C(0x00007fff80000000) 42 #define KM_AMD64_IDENTITY_START UINT64_C(0xffffffff80000000) 43 #define KM_AMD64_IDENTITY_SIZE UINT64_C(0x0000000080000000) 44 45 #define KM_AMD64_NON_IDENTITY_START UINT64_C(0xffff800000000000) 46 #define KM_AMD64_NON_IDENTITY_SIZE UINT64_C(0x00007fff80000000) 47 48 #endif /* MEMORY_MODEL_kernel */ 49 50 #ifdef MEMORY_MODEL_large 51 52 #define KM_AMD64_IDENTITY_START UINT64_C(0xffff800000000000) 53 #define KM_AMD64_IDENTITY_SIZE UINT64_C(0x0000400000000000) 54 55 #define KM_AMD64_NON_IDENTITY_START UINT64_C(0xffffc00000000000) 56 #define KM_AMD64_NON_IDENTITY_SIZE UINT64_C(0x0000400000000000) 57 58 #endif /* MEMORY_MODEL_large */ 45 59 46 60 extern void km_identity_arch_init(void); -
kernel/arch/amd64/include/arch/mm/page.h
rd078c9b9 r4c3602c4 42 42 #define PAGE_SIZE FRAME_SIZE 43 43 44 #ifdef MEMORY_MODEL_kernel 45 44 46 #ifndef __ASM__ 45 47 … … 53 55 54 56 #endif /* __ASM__ */ 57 58 #endif /* MEMORY_MODEL_kernel */ 59 60 #ifdef MEMORY_MODEL_large 61 62 #ifndef __ASM__ 63 64 #define KA2PA(x) (((uintptr_t) (x)) - UINT64_C(0xffff800000000000)) 65 #define PA2KA(x) (((uintptr_t) (x)) + UINT64_C(0xffff800000000000)) 66 67 #else /* __ASM__ */ 68 69 #define KA2PA(x) ((x) - 0xffff800000000000) 70 #define PA2KA(x) ((x) + 0xffff800000000000) 71 72 #endif /* __ASM__ */ 73 74 #endif /* MEMORY_MODEL_large */ 55 75 56 76 /* Number of entries in each level. */ -
kernel/arch/amd64/src/boot/multiboot.S
rd078c9b9 r4c3602c4 430 430 movl multiboot_eax, %edi 431 431 movl multiboot_ebx, %esi 432 433 #ifdef MEMORY_MODEL_large 434 movabsq $amd64_pre_main, %rax 435 callq *%rax 436 #else 432 437 callq amd64_pre_main 433 438 #endif 439 434 440 long_status $status_main 435 441 436 442 /* Call main_bsp() */ 437 callq main_bsp 443 #ifdef MEMORY_MODEL_large 444 movabsq $main_bsp, %rax 445 callq *%rax 446 #else 447 callq main_bsp 448 #endif 438 449 439 450 /* Not reached */ … … 622 633 ptl2gen 512 7 623 634 635 #ifdef MEMORY_MODEL_kernel 624 636 .align 4096 625 637 ptl_1: … … 638 650 .quad ptl_2_1g + (PTL_WRITABLE | PTL_PRESENT) 639 651 640 641 652 .align 4096 642 653 SYMBOL(ptl_0) … … 644 655 .fill 510, 8, 0 645 656 .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT) 657 #endif 658 659 #ifdef MEMORY_MODEL_large 660 .align 4096 661 ptl_1: 662 /* Identity mapping for [0; 8G) */ 663 .quad ptl_2_0g + (PTL_WRITABLE | PTL_PRESENT) 664 .quad ptl_2_1g + (PTL_WRITABLE | PTL_PRESENT) 665 .quad ptl_2_2g + (PTL_WRITABLE | PTL_PRESENT) 666 .quad ptl_2_3g + (PTL_WRITABLE | PTL_PRESENT) 667 .quad ptl_2_4g + (PTL_WRITABLE | PTL_PRESENT) 668 .quad ptl_2_5g + (PTL_WRITABLE | PTL_PRESENT) 669 .quad ptl_2_6g + (PTL_WRITABLE | PTL_PRESENT) 670 .quad ptl_2_7g + (PTL_WRITABLE | PTL_PRESENT) 671 .fill 504, 8, 0 672 673 .align 4096 674 SYMBOL(ptl_0) 675 .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT) 676 .fill 255, 8, 0 677 .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT) 678 .fill 255, 8, 0 679 #endif 646 680 647 681 .section K_DATA_START, "aw", @progbits -
kernel/arch/amd64/src/boot/multiboot2.S
rd078c9b9 r4c3602c4 253 253 movl multiboot_eax, %edi 254 254 movl multiboot_ebx, %esi 255 callq amd64_pre_main 255 256 #ifdef MEMORY_MODEL_large 257 movabsq $amd64_pre_main, %rax 258 callq *%rax 259 #else 260 callq amd64_pre_main 261 #endif 256 262 257 263 /* Call main_bsp() */ 258 callq main_bsp 264 #ifdef MEMORY_MODEL_large 265 movabsq $main_bsp, %rax 266 callq *%rax 267 #else 268 callq main_bsp 269 #endif 259 270 260 271 /* Not reached */ -
kernel/arch/amd64/src/context.S
rd078c9b9 r4c3602c4 50 50 movq %r14, CONTEXT_OFFSET_R14(%rdi) 51 51 movq %r15, CONTEXT_OFFSET_R15(%rdi) 52 52 53 #ifdef MEMORY_MODEL_large 54 movabsq $vreg_ptr, %rsi 55 movq (%rsi), %rsi 56 #else 53 57 movq vreg_ptr, %rsi 58 #endif 54 59 movq %fs:VREG_TP(%rsi), %rsi 55 60 movq %rsi, CONTEXT_OFFSET_TP(%rdi) … … 79 84 movq %rdx, (%rsp) 80 85 81 movq CONTEXT_OFFSET_TP(%rdi), %rcx 86 movq CONTEXT_OFFSET_TP(%rdi), %rcx 87 #ifdef MEMORY_MODEL_large 88 movabsq $vreg_ptr, %rsi 89 movq (%rsi), %rsi 90 #else 82 91 movq vreg_ptr, %rsi 92 #endif 83 93 movq %rcx, %fs:VREG_TP(%rsi) 84 94
Note:
See TracChangeset
for help on using the changeset viewer.