| 1 |
// |
| 2 |
// os/unix/arm/fpu/fpu.h |
| 3 |
// |
| 4 |
// Extern declarations for host FPU functions. |
| 5 |
// |
| 6 |
// This file is subject to the terms and conditions defined in |
| 7 |
// 'LICENSE', which is part of this source code package. |
| 8 |
// |
| 9 |
|
| 10 |
#ifndef __os_fpu_h__ |
| 11 |
#define __os_fpu_h__ |
| 12 |
#include "common.h" |
| 13 |
|
| 14 |
#include "arch/arm/fpu/fpu.h" |
| 15 |
|
| 16 |
static inline fpu_state_t fpu_get_state(void) { |
| 17 |
fpu_state_t state; |
| 18 |
|
| 19 |
__asm__ __volatile__("mrc p10, 7, %0, cr1, cr0, 0\n\t" : "=r"(state)); |
| 20 |
return state; |
| 21 |
} |
| 22 |
|
| 23 |
static inline void fpu_set_state(fpu_state_t state) { |
| 24 |
__asm__ __volatile__("mcr p10, 7, %0, cr1, cr0, 0\n\t" :: "r"(state)); |
| 25 |
} |
| 26 |
|
| 27 |
#endif |
| 28 |
|