Line | |
---|
1 | /* |
---|
2 | * include/asm-i386/i387.h |
---|
3 | * |
---|
4 | * Copyright (C) 1994 Linus Torvalds |
---|
5 | * |
---|
6 | * Pentium III FXSR, SSE support |
---|
7 | * General FPU state handling cleanups |
---|
8 | * Gareth Hughes <gareth@valinux.com>, May 2000 |
---|
9 | */ |
---|
10 | |
---|
11 | #ifndef __ASM_I386_I387_H |
---|
12 | #define __ASM_I386_I387_H |
---|
13 | |
---|
14 | #include <xen/sched.h> |
---|
15 | #include <asm/processor.h> |
---|
16 | |
---|
17 | extern void init_fpu(void); |
---|
18 | extern void save_init_fpu(struct vcpu *v); |
---|
19 | extern void restore_fpu(struct vcpu *v); |
---|
20 | |
---|
21 | #define unlazy_fpu(v) do { \ |
---|
22 | if ( (v)->fpu_dirtied ) \ |
---|
23 | save_init_fpu(v); \ |
---|
24 | } while ( 0 ) |
---|
25 | |
---|
26 | #define load_mxcsr(val) do { \ |
---|
27 | unsigned long __mxcsr = ((unsigned long)(val) & 0xffbf); \ |
---|
28 | __asm__ __volatile__ ( "ldmxcsr %0" : : "m" (__mxcsr) ); \ |
---|
29 | } while ( 0 ) |
---|
30 | |
---|
31 | static inline void setup_fpu(struct vcpu *v) |
---|
32 | { |
---|
33 | /* Avoid recursion. */ |
---|
34 | clts(); |
---|
35 | |
---|
36 | if ( !v->fpu_dirtied ) |
---|
37 | { |
---|
38 | v->fpu_dirtied = 1; |
---|
39 | if ( v->fpu_initialised ) |
---|
40 | restore_fpu(v); |
---|
41 | else |
---|
42 | init_fpu(); |
---|
43 | } |
---|
44 | } |
---|
45 | |
---|
46 | #endif /* __ASM_I386_I387_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.