Changes in kernel/arch/amd64/src/amd64.c [af9dd1e:811770c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/amd64.c
raf9dd1e r811770c 64 64 #endif 65 65 66 /** Disable I/O on non-privileged levels67 *68 * Clean IOPL(12,13) and NT(14) flags in EFLAGS register69 */70 static void clean_IOPL_NT_flags(void)71 {72 asm volatile (73 "pushfq\n"74 "pop %%rax\n"75 "and $~(0x7000), %%rax\n"76 "pushq %%rax\n"77 "popfq\n"78 ::: "%rax"79 );80 }81 82 /** Disable alignment check83 *84 * Clean AM(18) flag in CR0 register85 */86 static void clean_AM_flag(void)87 {88 asm volatile (89 "mov %%cr0, %%rax\n"90 "and $~(0x40000), %%rax\n"91 "mov %%rax, %%cr0\n"92 ::: "%rax"93 );94 }95 96 66 /** Perform amd64-specific initialization before main_bsp() is called. 97 67 * … … 116 86 { 117 87 /* Enable no-execute pages */ 118 set_efer_flag(AMD_NXE_FLAG);88 write_msr(AMD_MSR_EFER, read_msr(AMD_MSR_EFER) | AMD_NXE); 119 89 /* Enable FPU */ 120 90 cpu_setup_fpu(); … … 123 93 pm_init(); 124 94 125 /* Disable I/O on nonprivileged levels 126 * clear the NT (nested-thread) flag 127 */ 128 clean_IOPL_NT_flags(); 95 /* Disable I/O on nonprivileged levels, clear the nested-thread flag */ 96 write_rflags(read_rflags() & ~(RFLAGS_IOPL | RFLAGS_NT)); 129 97 /* Disable alignment check */ 130 clean_AM_flag();98 write_cr0(read_cr0() & ~CR0_AM); 131 99 132 100 if (config.cpu_active == 1) {
Note:
See TracChangeset
for help on using the changeset viewer.