Rev 1019 | Rev 1705 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1019 | Rev 1187 | ||
---|---|---|---|
Line 85... | Line 85... | ||
85 | : |
85 | : |
86 | :"%eax" |
86 | :"%eax" |
87 | ); |
87 | ); |
88 | } |
88 | } |
89 | 89 | ||
90 | - | ||
91 | - | ||
92 | - | ||
93 | void cpu_arch_init(void) |
90 | void cpu_arch_init(void) |
94 | { |
91 | { |
- | 92 | cpuid_feature_info fi; |
|
- | 93 | cpuid_extended_feature_info efi; |
|
- | 94 | cpu_info_t info; |
|
95 | __u32 help=0; |
95 | __u32 help = 0; |
96 | 96 | ||
97 | CPU->arch.tss = tss_p; |
97 | CPU->arch.tss = tss_p; |
98 | CPU->fpu_owner=NULL; |
98 | CPU->arch.tss->iomap_base = &CPU->arch.tss->iomap[0] - ((__u8 *) CPU->arch.tss); |
99 | 99 | ||
100 | cpuid_feature_info fi; |
100 | CPU->fpu_owner = NULL; |
101 | cpuid_extended_feature_info efi; |
- | |
102 | 101 | ||
103 | cpu_info_t info; |
- | |
104 | cpuid(1, &info); |
102 | cpuid(1, &info); |
105 | 103 | ||
106 | fi.word=info.cpuid_edx; |
104 | fi.word = info.cpuid_edx; |
107 | efi.word=info.cpuid_ecx; |
105 | efi.word = info.cpuid_ecx; |
108 | 106 | ||
109 | if(fi.bits.fxsr) fpu_fxsr(); |
107 | if (fi.bits.fxsr) |
110 | else fpu_fsr(); |
108 | fpu_fxsr(); |
111 | 109 | else |
|
112 | if(fi.bits.sse) asm volatile ( |
- | |
113 | "mov %%cr4,%0;\n" |
- | |
114 | "or %1,%0;\n" |
- | |
115 | "mov %0,%%cr4;\n" |
- | |
116 | :"+r"(help) |
110 | fpu_fsr(); |
117 | :"i"(CR4_OSFXSR_MASK|(1<<10)) |
- | |
118 | ); |
- | |
119 | 111 | ||
- | 112 | if (fi.bits.sse) { |
|
- | 113 | asm volatile ( |
|
- | 114 | "mov %%cr4,%0\n" |
|
- | 115 | "or %1,%0\n" |
|
- | 116 | "mov %0,%%cr4\n" |
|
- | 117 | : "+r" (help) |
|
- | 118 | : "i" (CR4_OSFXSR_MASK|(1<<10)) |
|
- | 119 | ); |
|
- | 120 | } |
|
120 | } |
121 | } |
121 | 122 | ||
122 | - | ||
123 | void cpu_identify(void) |
123 | void cpu_identify(void) |
124 | { |
124 | { |
125 | cpu_info_t info; |
125 | cpu_info_t info; |
126 | 126 | ||
127 | CPU->arch.vendor = VendorUnknown; |
127 | CPU->arch.vendor = VendorUnknown; |