Changeset 45b4300 in mainline
- Timestamp:
- 2013-05-30T22:00:56Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2b903ca
- Parents:
- 95e370f8
- Location:
- kernel/arch/ia32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/include/arch/cpu.h
r95e370f8 r45b4300 41 41 #define EFLAGS_RF (1 << 16) 42 42 43 #define CR4_OSFXSR_MASK (1<<9) 43 #define CR4_OSFXSR_MASK (1 << 9) 44 #define CR4_OSXMMEXCPT_MASK (1 << 10) 44 45 45 46 /* Support for SYSENTER and SYSEXIT */ … … 59 60 unsigned int model; 60 61 unsigned int stepping; 61 cpuid_feature_info fi;62 62 cpuid_feature_info_t fi; 63 63 64 tss_t *tss; 64 65 -
kernel/arch/ia32/include/arch/cpuid.h
r95e370f8 r45b4300 50 50 uint32_t cpuid_ecx; 51 51 uint32_t cpuid_edx; 52 } __attribute__ 52 } __attribute__((packed)) cpu_info_t; 53 53 54 struct __cpuid_extended_feature_info {55 unsigned sse3 :1;56 unsigned 57 } __attribute__ 54 struct cpuid_extended_feature_info { 55 unsigned int sse3 : 1; 56 unsigned int : 31; 57 } __attribute__((packed)); 58 58 59 typedef union cpuid_extended_feature_info{60 struct __cpuid_extended_feature_info bits;59 typedef union { 60 struct cpuid_extended_feature_info bits; 61 61 uint32_t word; 62 } cpuid_extended_feature_info ;62 } cpuid_extended_feature_info_t; 63 63 64 struct __cpuid_feature_info {65 unsigned 66 unsigned sep :1;67 unsigned 68 unsigned mmx :1;69 unsigned fxsr :1;70 unsigned sse :1;71 unsigned sse2 :1;72 unsigned :5;73 } __attribute__ 64 struct cpuid_feature_info { 65 unsigned int : 11; 66 unsigned int sep : 1; 67 unsigned int : 11; 68 unsigned int mmx : 1; 69 unsigned int fxsr : 1; 70 unsigned int sse : 1; 71 unsigned int sse2 : 1; 72 unsigned int : 5; 73 } __attribute__((packed)); 74 74 75 typedef union cpuid_feature_info{76 struct __cpuid_feature_info bits;75 typedef union { 76 struct cpuid_feature_info bits; 77 77 uint32_t word; 78 } cpuid_feature_info; 79 78 } cpuid_feature_info_t; 80 79 81 80 static inline uint32_t has_cpuid(void) 82 81 { 83 uint32_t val, ret; 82 uint32_t val; 83 uint32_t ret; 84 84 85 85 asm volatile ( -
kernel/arch/ia32/src/cpu/cpu.c
r95e370f8 r45b4300 115 115 "mov %[help], %%cr4\n" 116 116 : [help] "+r" (help) 117 : [mask] "i" (CR4_OSFXSR_MASK | (1 << 10))117 : [mask] "i" (CR4_OSFXSR_MASK | CR4_OSXMMEXCPT_MASK) 118 118 ); 119 119 } 120 120 121 121 #ifndef PROCESSOR_i486 122 122 if (CPU->arch.fi.bits.sep) { -
kernel/arch/ia32/src/fpu_context.c
r95e370f8 r45b4300 27 27 */ 28 28 29 /** @addtogroup ia32 29 /** @addtogroup ia32 30 30 * @{ 31 31 */ … … 37 37 #include <arch.h> 38 38 #include <cpu.h> 39 40 39 41 40 /** x87 FPU scr values (P3+ MMX2) */ … … 60 59 X87_DENORMAL_EXC_FLAG = (1 << 1), 61 60 X87_INVALID_OP_EXC_FLAG = (1 << 0), 62 61 63 62 X87_ALL_MASK = X87_PRECISION_MASK | X87_UNDERFLOW_MASK | X87_OVERFLOW_MASK | X87_ZERO_DIV_MASK | X87_DENORMAL_OP_MASK | X87_INVALID_OP_MASK, 64 63 }; 65 64 66 67 65 typedef void (*fpu_context_function)(fpu_context_t *fctx); 68 66 69 static fpu_context_function fpu_save, fpu_restore; 67 static fpu_context_function fpu_save; 68 static fpu_context_function fpu_restore; 70 69 71 70 static void fpu_context_f_save(fpu_context_t *fctx) … … 104 103 void fpu_fxsr(void) 105 104 { 106 fpu_save =fpu_context_fx_save;107 fpu_restore =fpu_context_fx_restore;105 fpu_save = fpu_context_fx_save; 106 fpu_restore = fpu_context_fx_restore; 108 107 } 109 108
Note:
See TracChangeset
for help on using the changeset viewer.