Rev 799 | Rev 825 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 799 | Rev 803 | ||
|---|---|---|---|
| Line 43... | Line 43... | ||
| 43 | #include <print.h> |
43 | #include <print.h> |
| 44 | #include <arch/cpuid.h> |
44 | #include <arch/cpuid.h> |
| 45 | #include <genarch/acpi/acpi.h> |
45 | #include <genarch/acpi/acpi.h> |
| 46 | #include <panic.h> |
46 | #include <panic.h> |
| 47 | #include <interrupt.h> |
47 | #include <interrupt.h> |
| - | 48 | #include <arch/syscall.h> |
|
| 48 | 49 | ||
| 49 | /** Disable I/O on non-privileged levels |
50 | /** Disable I/O on non-privileged levels |
| 50 | * |
51 | * |
| 51 | * Clean IOPL(12,13) and NT(14) flags in EFLAGS register |
52 | * Clean IOPL(12,13) and NT(14) flags in EFLAGS register |
| 52 | */ |
53 | */ |
| Line 97... | Line 98... | ||
| 97 | if (! (cpuid_s.cpuid_edx & (1<<INTEL_SSE2))) |
98 | if (! (cpuid_s.cpuid_edx & (1<<INTEL_SSE2))) |
| 98 | panic("Processor does not support SSE2 instructions.\n"); |
99 | panic("Processor does not support SSE2 instructions.\n"); |
| 99 | 100 | ||
| 100 | /* Enable No-execute pages */ |
101 | /* Enable No-execute pages */ |
| 101 | set_efer_flag(AMD_NXE_FLAG); |
102 | set_efer_flag(AMD_NXE_FLAG); |
| 102 | /* Enable SYSCALL/SYSRET */ |
- | |
| 103 | set_efer_flag(AMD_SCE_FLAG); |
- | |
| 104 | /* Enable FPU */ |
103 | /* Enable FPU */ |
| 105 | cpu_setup_fpu(); |
104 | cpu_setup_fpu(); |
| - | 105 | ||
| 106 | /* Initialize segmentation */ |
106 | /* Initialize segmentation */ |
| 107 | pm_init(); |
107 | pm_init(); |
| 108 | 108 | ||
| 109 | /* Disable I/O on nonprivileged levels |
109 | /* Disable I/O on nonprivileged levels |
| 110 | * clear the NT(nested-thread) flag |
110 | * clear the NT(nested-thread) flag |
| 111 | */ |
111 | */ |
| 112 | clean_IOPL_NT_flags(); |
112 | clean_IOPL_NT_flags(); |
| 113 | /* Disable alignment check */ |
113 | /* Disable alignment check */ |
| 114 | clean_AM_flag(); |
114 | clean_AM_flag(); |
| 115 | - | ||
| 116 | 115 | ||
| 117 | if (config.cpu_active == 1) { |
116 | if (config.cpu_active == 1) { |
| 118 | bios_init(); |
117 | bios_init(); |
| 119 | i8259_init(); /* PIC */ |
118 | i8259_init(); /* PIC */ |
| 120 | i8254_init(); /* hard clock */ |
119 | i8254_init(); /* hard clock */ |
| Line 130... | Line 129... | ||
| 130 | void arch_post_mm_init(void) |
129 | void arch_post_mm_init(void) |
| 131 | { |
130 | { |
| 132 | if (config.cpu_active == 1) { |
131 | if (config.cpu_active == 1) { |
| 133 | ega_init(); /* video */ |
132 | ega_init(); /* video */ |
| 134 | } |
133 | } |
| - | 134 | /* Setup fast SYSCALL/SYSRET */ |
|
| - | 135 | syscall_setup_cpu(); |
|
| - | 136 | ||
| 135 | } |
137 | } |
| 136 | 138 | ||
| 137 | void arch_pre_smp_init(void) |
139 | void arch_pre_smp_init(void) |
| 138 | { |
140 | { |
| 139 | if (config.cpu_active == 1) { |
141 | if (config.cpu_active == 1) { |