Rev 625 | Rev 806 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 625 | Rev 803 | ||
---|---|---|---|
Line 186... | Line 186... | ||
186 | __u64 v; |
186 | __u64 v; |
187 | __asm__ volatile ("movq %%cr3,%0" : "=r" (v)); |
187 | __asm__ volatile ("movq %%cr3,%0" : "=r" (v)); |
188 | return v; |
188 | return v; |
189 | } |
189 | } |
190 | 190 | ||
- | 191 | /** Write to MSR */ |
|
- | 192 | static inline void write_msr(__u32 msr, __u64 value) |
|
- | 193 | { |
|
- | 194 | __asm__ volatile ( |
|
- | 195 | "wrmsr;" : : "c" (msr), |
|
- | 196 | "a" ((__u32)(value)), |
|
- | 197 | "d" ((__u32)(value >> 32)) |
|
- | 198 | ); |
|
- | 199 | } |
|
- | 200 | ||
- | 201 | static inline __native read_msr(__u32 msr) |
|
- | 202 | { |
|
- | 203 | __u32 ax, dx; |
|
- | 204 | ||
- | 205 | __asm__ volatile ( |
|
- | 206 | "rdmsr;" : "=a"(ax), "=d"(dx) : "c" (msr) |
|
- | 207 | ); |
|
- | 208 | return ((__u64)dx << 32) | ax; |
|
- | 209 | } |
|
- | 210 | ||
191 | 211 | ||
192 | /** Enable local APIC |
212 | /** Enable local APIC |
193 | * |
213 | * |
194 | * Enable local APIC in MSR. |
214 | * Enable local APIC in MSR. |
195 | */ |
215 | */ |