Changes in kernel/arch/amd64/src/amd64.c [811770c:af9dd1e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/amd64.c
r811770c raf9dd1e 64 64 #endif 65 65 66 /** Disable I/O on non-privileged levels 67 * 68 * Clean IOPL(12,13) and NT(14) flags in EFLAGS register 69 */ 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 check 83 * 84 * Clean AM(18) flag in CR0 register 85 */ 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 66 96 /** Perform amd64-specific initialization before main_bsp() is called. 67 97 * … … 86 116 { 87 117 /* Enable no-execute pages */ 88 write_msr(AMD_MSR_EFER, read_msr(AMD_MSR_EFER) | AMD_NXE);118 set_efer_flag(AMD_NXE_FLAG); 89 119 /* Enable FPU */ 90 120 cpu_setup_fpu(); … … 93 123 pm_init(); 94 124 95 /* Disable I/O on nonprivileged levels, clear the nested-thread flag */ 96 write_rflags(read_rflags() & ~(RFLAGS_IOPL | RFLAGS_NT)); 125 /* Disable I/O on nonprivileged levels 126 * clear the NT (nested-thread) flag 127 */ 128 clean_IOPL_NT_flags(); 97 129 /* Disable alignment check */ 98 write_cr0(read_cr0() & ~CR0_AM);130 clean_AM_flag(); 99 131 100 132 if (config.cpu_active == 1) {
Note:
See TracChangeset
for help on using the changeset viewer.