Changeset add04f7 in mainline for kernel/arch/ia32/src/cpu/cpu.c
- Timestamp:
- 2009-03-03T15:20:49Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f24d300
- Parents:
- deca67b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/cpu/cpu.c
rdeca67b radd04f7 49 49 * Contains only non-MP-Specification specific SMP code. 50 50 */ 51 #define AMD_CPUID_EBX 52 #define AMD_CPUID_ECX 53 #define AMD_CPUID_EDX 51 #define AMD_CPUID_EBX 0x68747541 52 #define AMD_CPUID_ECX 0x444d4163 53 #define AMD_CPUID_EDX 0x69746e65 54 54 55 #define INTEL_CPUID_EBX 56 #define INTEL_CPUID_ECX 0x6c65746e57 #define INTEL_CPUID_EDX 0x49656e6955 #define INTEL_CPUID_EBX 0x756e6547 56 #define INTEL_CPUID_ECX 0x6c65746e 57 #define INTEL_CPUID_EDX 0x49656e69 58 58 59 59 60 60 enum vendor { 61 VendorUnknown =0,61 VendorUnknown = 0, 62 62 VendorAMD, 63 63 VendorIntel … … 73 73 { 74 74 asm volatile ( 75 "mov %%cr0,%%eax;" 76 "or $8,%%eax;" 77 "mov %%eax,%%cr0;" 78 : 79 : 80 : "%eax" 75 "mov %%cr0, %%eax\n" 76 "or $8, %%eax\n" 77 "mov %%eax, %%cr0\n" 78 ::: "%eax" 81 79 ); 82 80 } … … 85 83 { 86 84 asm volatile ( 87 "mov %%cr0,%%eax;" 88 "and $0xffFFffF7,%%eax;" 89 "mov %%eax,%%cr0;" 90 : 91 : 92 : "%eax" 93 ); 85 "mov %%cr0, %%eax\n" 86 "and $0xffFFffF7, %%eax\n" 87 "mov %%eax,%%cr0\n" 88 ::: "%eax" 89 ); 94 90 } 95 91 … … 103 99 CPU->arch.tss = tss_p; 104 100 CPU->arch.tss->iomap_base = &CPU->arch.tss->iomap[0] - ((uint8_t *) CPU->arch.tss); 105 101 106 102 CPU->fpu_owner = NULL; 107 103 108 104 cpuid(1, &info); 109 105 110 106 fi.word = info.cpuid_edx; 111 107 efi.word = info.cpuid_ecx; … … 114 110 fpu_fxsr(); 115 111 else 116 fpu_fsr(); 112 fpu_fsr(); 117 113 118 114 if (fi.bits.sse) { 119 115 asm volatile ( 120 "mov %%cr4, %0\n"121 "or % 1,%0\n"122 "mov % 0,%%cr4\n"123 : "+r" (help)124 : "i" (CR4_OSFXSR_MASK|(1<<10))116 "mov %%cr4, %[help]\n" 117 "or %[mask], %[help]\n" 118 "mov %[help], %%cr4\n" 119 : [help] "+r" (help) 120 : [mask] "i" (CR4_OSFXSR_MASK | (1 << 10)) 125 121 ); 126 122 }
Note:
See TracChangeset
for help on using the changeset viewer.