aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/visasm.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-sparc64/visasm.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-sparc64/visasm.h')
-rw-r--r--include/asm-sparc64/visasm.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/include/asm-sparc64/visasm.h b/include/asm-sparc64/visasm.h
new file mode 100644
index 000000000000..a74078551e0f
--- /dev/null
+++ b/include/asm-sparc64/visasm.h
@@ -0,0 +1,63 @@
1/* $Id: visasm.h,v 1.5 2001/04/24 01:09:12 davem Exp $ */
2#ifndef _SPARC64_VISASM_H
3#define _SPARC64_VISASM_H
4
5/* visasm.h: FPU saving macros for VIS routines
6 *
7 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
8 */
9
10#include <asm/pstate.h>
11#include <asm/ptrace.h>
12
13/* Clobbers %o5, %g1, %g2, %g3, %g7, %icc, %xcc */
14
15#define VISEntry \
16 rd %fprs, %o5; \
17 andcc %o5, (FPRS_FEF|FPRS_DU), %g0; \
18 be,pt %icc, 297f; \
19 sethi %hi(297f), %g7; \
20 sethi %hi(VISenter), %g1; \
21 jmpl %g1 + %lo(VISenter), %g0; \
22 or %g7, %lo(297f), %g7; \
23297: wr %g0, FPRS_FEF, %fprs; \
24
25#define VISExit \
26 wr %g0, 0, %fprs;
27
28/* Clobbers %o5, %g1, %g2, %g3, %g7, %icc, %xcc.
29 * Must preserve %o5 between VISEntryHalf and VISExitHalf */
30
31#define VISEntryHalf \
32 rd %fprs, %o5; \
33 andcc %o5, FPRS_FEF, %g0; \
34 be,pt %icc, 297f; \
35 sethi %hi(298f), %g7; \
36 sethi %hi(VISenterhalf), %g1; \
37 jmpl %g1 + %lo(VISenterhalf), %g0; \
38 or %g7, %lo(298f), %g7; \
39 clr %o5; \
40297: wr %o5, FPRS_FEF, %fprs; \
41298:
42
43#define VISExitHalf \
44 wr %o5, 0, %fprs;
45
46#ifndef __ASSEMBLY__
47static __inline__ void save_and_clear_fpu(void) {
48 __asm__ __volatile__ (
49" rd %%fprs, %%o5\n"
50" andcc %%o5, %0, %%g0\n"
51" be,pt %%icc, 299f\n"
52" sethi %%hi(298f), %%g7\n"
53" sethi %%hi(VISenter), %%g1\n"
54" jmpl %%g1 + %%lo(VISenter), %%g0\n"
55" or %%g7, %%lo(298f), %%g7\n"
56" 298: wr %%g0, 0, %%fprs\n"
57" 299:\n"
58" " : : "i" (FPRS_FEF|FPRS_DU) :
59 "o5", "g1", "g2", "g3", "g7", "cc");
60}
61#endif
62
63#endif /* _SPARC64_ASI_H */