blob: cc463fec806fc4c7e6cbdb5197b92233d52c4c84 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* fpumacro.h: FPU related macros.
2 *
3 * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
4 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
5 */
6
7#ifndef _SPARC64_FPUMACRO_H
8#define _SPARC64_FPUMACRO_H
9
10#include <asm/asi.h>
11#include <asm/visasm.h>
12
13struct fpustate {
14 u32 regs[64];
15};
16
17#define FPUSTATE (struct fpustate *)(current_thread_info()->fpregs)
18
David S. Millerd979f172007-10-27 00:13:04 -070019static inline unsigned long fprs_read(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070020{
21 unsigned long retval;
22
23 __asm__ __volatile__("rd %%fprs, %0" : "=r" (retval));
24
25 return retval;
26}
27
David S. Millerd979f172007-10-27 00:13:04 -070028static inline void fprs_write(unsigned long val)
Linus Torvalds1da177e2005-04-16 15:20:36 -070029{
30 __asm__ __volatile__("wr %0, 0x0, %%fprs" : : "r" (val));
31}
32
33#endif /* !(_SPARC64_FPUMACRO_H) */