Changeset 49a39c2 in mainline for arch/amd64/src/amd64.c
- Timestamp:
- 2006-02-06T21:14:29Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8a1da55
- Parents:
- 7febdde5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/amd64.c
r7febdde5 r49a39c2 47 47 #include <interrupt.h> 48 48 49 /** Disable I/O on non-privileged levels 50 * 51 * Clean IOPL(12,13) and NT(14) flags in EFLAGS register 52 */ 53 static void clean_IOPL_NT_flags(void) 54 { 55 asm 56 ( 57 "pushfq;" 58 "pop %%rax;" 59 "and $~(0x7000),%%rax;" 60 "pushq %%rax;" 61 "popfq;" 62 : 63 : 64 :"%rax" 65 ); 66 } 67 68 /** Disable alignment check 69 * 70 * Clean AM(18) flag in CR0 register 71 */ 72 static void clean_AM_flag(void) 73 { 74 asm 75 ( 76 "mov %%cr0,%%rax;" 77 "and $~(0x40000),%%rax;" 78 "mov %%rax,%%cr0;" 79 : 80 : 81 :"%rax" 82 ); 83 } 84 49 85 void arch_pre_mm_init(void) 50 86 { … … 64 100 /* Enable No-execute pages */ 65 101 set_efer_flag(AMD_NXE_FLAG); 102 /* Enable SYSCALL/SYSRET */ 103 set_efer_flag(AMD_SCE_FLAG); 66 104 /* Enable FPU */ 67 105 cpu_setup_fpu(); 106 /* Initialize segmentation */ 107 pm_init(); 68 108 69 pm_init(); 109 /* Disable I/O on nonprivileged levels 110 * clear the NT(nested-thread) flag 111 */ 112 clean_IOPL_NT_flags(); 113 /* Disable alignment check */ 114 clean_AM_flag(); 115 70 116 71 117 if (config.cpu_active == 1) { … … 74 120 i8254_init(); /* hard clock */ 75 121 76 exc_register(VECTOR_SYSCALL, "syscall", syscall);77 78 122 #ifdef CONFIG_SMP 79 123 exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown",
Note:
See TracChangeset
for help on using the changeset viewer.