Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2071 | Rev 2082 | ||
---|---|---|---|
Line 41... | Line 41... | ||
41 | 41 | ||
42 | static fpu_context_function fpu_save, fpu_restore; |
42 | static fpu_context_function fpu_save, fpu_restore; |
43 | 43 | ||
44 | static void fpu_context_f_save(fpu_context_t *fctx) |
44 | static void fpu_context_f_save(fpu_context_t *fctx) |
45 | { |
45 | { |
46 | __asm__ volatile ( |
46 | asm volatile ( |
47 | "fnsave %0" |
47 | "fnsave %0" |
48 | : "=m"(*fctx) |
48 | : "=m"(*fctx) |
49 | ); |
49 | ); |
50 | } |
50 | } |
51 | 51 | ||
52 | static void fpu_context_f_restore(fpu_context_t *fctx) |
52 | static void fpu_context_f_restore(fpu_context_t *fctx) |
53 | { |
53 | { |
54 | __asm__ volatile ( |
54 | asm volatile ( |
55 | "frstor %0" |
55 | "frstor %0" |
56 | : "=m"(*fctx) |
56 | : "=m"(*fctx) |
57 | ); |
57 | ); |
58 | } |
58 | } |
59 | 59 | ||
60 | static void fpu_context_fx_save(fpu_context_t *fctx) |
60 | static void fpu_context_fx_save(fpu_context_t *fctx) |
61 | { |
61 | { |
62 | __asm__ volatile ( |
62 | asm volatile ( |
63 | "fxsave %0" |
63 | "fxsave %0" |
64 | : "=m"(*fctx) |
64 | : "=m"(*fctx) |
65 | ); |
65 | ); |
66 | } |
66 | } |
67 | 67 | ||
68 | static void fpu_context_fx_restore(fpu_context_t *fctx) |
68 | static void fpu_context_fx_restore(fpu_context_t *fctx) |
69 | { |
69 | { |
70 | __asm__ volatile ( |
70 | asm volatile ( |
71 | "fxrstor %0" |
71 | "fxrstor %0" |
72 | : "=m"(*fctx) |
72 | : "=m"(*fctx) |
73 | ); |
73 | ); |
74 | } |
74 | } |
75 | 75 | ||
Line 101... | Line 101... | ||
101 | } |
101 | } |
102 | 102 | ||
103 | void fpu_init() |
103 | void fpu_init() |
104 | { |
104 | { |
105 | uint32_t help0 = 0, help1 = 0; |
105 | uint32_t help0 = 0, help1 = 0; |
106 | __asm__ volatile ( |
106 | asm volatile ( |
107 | "fninit;\n" |
107 | "fninit;\n" |
108 | "stmxcsr %0\n" |
108 | "stmxcsr %0\n" |
109 | "mov %0,%1;\n" |
109 | "mov %0,%1;\n" |
110 | "or %2,%1;\n" |
110 | "or %2,%1;\n" |
111 | "mov %1,%0;\n" |
111 | "mov %1,%0;\n" |