Rev 4017 | Rev 4026 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4017 | Rev 4022 | ||
---|---|---|---|
Line 37... | Line 37... | ||
37 | #include <arch/types.h> |
37 | #include <arch/types.h> |
38 | 38 | ||
39 | #include <config.h> |
39 | #include <config.h> |
40 | 40 | ||
41 | #include <proc/thread.h> |
41 | #include <proc/thread.h> |
- | 42 | #include <genarch/multiboot/multiboot.h> |
|
42 | #include <genarch/drivers/legacy/ia32/io.h> |
43 | #include <genarch/drivers/legacy/ia32/io.h> |
43 | #include <genarch/drivers/ega/ega.h> |
44 | #include <genarch/drivers/ega/ega.h> |
44 | #include <arch/drivers/vesa.h> |
45 | #include <arch/drivers/vesa.h> |
45 | #include <genarch/kbd/i8042.h> |
46 | #include <genarch/kbd/i8042.h> |
46 | #include <arch/drivers/i8254.h> |
47 | #include <arch/drivers/i8254.h> |
47 | #include <arch/drivers/i8259.h> |
48 | #include <arch/drivers/i8259.h> |
- | 49 | #include <arch/boot/boot.h> |
|
48 | 50 | ||
49 | #ifdef CONFIG_SMP |
51 | #ifdef CONFIG_SMP |
50 | #include <arch/smp/apic.h> |
52 | #include <arch/smp/apic.h> |
51 | #endif |
53 | #endif |
52 | 54 | ||
Line 63... | Line 65... | ||
63 | #include <console/console.h> |
65 | #include <console/console.h> |
64 | #include <ddi/irq.h> |
66 | #include <ddi/irq.h> |
65 | #include <ddi/device.h> |
67 | #include <ddi/device.h> |
66 | #include <sysinfo/sysinfo.h> |
68 | #include <sysinfo/sysinfo.h> |
67 | 69 | ||
68 | - | ||
69 | /** Disable I/O on non-privileged levels |
70 | /** Disable I/O on non-privileged levels |
70 | * |
71 | * |
71 | * Clean IOPL(12,13) and NT(14) flags in EFLAGS register |
72 | * Clean IOPL(12,13) and NT(14) flags in EFLAGS register |
72 | */ |
73 | */ |
73 | static void clean_IOPL_NT_flags(void) |
74 | static void clean_IOPL_NT_flags(void) |
Line 94... | Line 95... | ||
94 | "mov %%rax, %%cr0\n" |
95 | "mov %%rax, %%cr0\n" |
95 | ::: "%rax" |
96 | ::: "%rax" |
96 | ); |
97 | ); |
97 | } |
98 | } |
98 | 99 | ||
- | 100 | /** Perform amd64-specific initialization before main_bsp() is called. |
|
- | 101 | * |
|
- | 102 | * @param signature Should contain the multiboot signature. |
|
- | 103 | * @param mi Pointer to the multiboot information structure. |
|
- | 104 | */ |
|
- | 105 | void arch_pre_main(uint32_t signature, const multiboot_info_t *mi) |
|
- | 106 | { |
|
- | 107 | /* Parse multiboot information obtained from the bootloader. */ |
|
- | 108 | multiboot_info_parse(signature, mi); |
|
- | 109 | ||
- | 110 | #ifdef CONFIG_SMP |
|
- | 111 | /* Copy AP bootstrap routines below 1 MB. */ |
|
- | 112 | memcpy((void *) AP_BOOT_OFFSET, (void *) BOOT_OFFSET, |
|
- | 113 | (size_t) &_hardcoded_unmapped_size); |
|
- | 114 | #endif |
|
- | 115 | } |
|
- | 116 | ||
99 | void arch_pre_mm_init(void) |
117 | void arch_pre_mm_init(void) |
100 | { |
118 | { |
101 | /* Enable no-execute pages */ |
119 | /* Enable no-execute pages */ |
102 | set_efer_flag(AMD_NXE_FLAG); |
120 | set_efer_flag(AMD_NXE_FLAG); |
103 | /* Enable FPU */ |
121 | /* Enable FPU */ |