xref: /illumos-gate/usr/src/uts/sparc/sys/fpu/fpusystm.h (revision 2428aad8462660fad2b105777063fea6f4192308)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_FPU_FPUSYSTM_H
28 #define	_SYS_FPU_FPUSYSTM_H
29 
30 /*
31  * ISA-dependent FPU interfaces
32  */
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 #ifdef _KERNEL
39 
40 struct _fpu;
41 struct regs;
42 
43 #if !defined(DEBUG) && !defined(NEED_FPU_EXISTS)
44 #define	fpu_exists 1
45 #else
46 extern int fpu_exists;
47 #endif
48 
49 extern int fpu_version;
50 extern int fpdispr;
51 
52 extern void fpu_probe(void);
53 extern void fp_disable(void);
54 extern void fp_disabled(struct regs *);
55 extern void fp_clearregs(kfpu_t *);
56 extern void fp_enable(void);
57 extern void fp_fksave(kfpu_t *);
58 extern void fp_runq(struct regs *);
59 extern void fp_load(kfpu_t *);
60 extern void fp_save(kfpu_t *);
61 extern void fp_restore(kfpu_t *);
62 extern void run_fpq(klwp_t *, fpregset_t *);
63 extern void syncfpu(void);
64 extern void _fp_read_pfsr(uint64_t *fsr);
65 extern void _fp_write_pfsr(uint64_t *);
66 extern void _fp_read_pfreg(uint32_t *, uint_t);
67 extern void _fp_write_pfreg(uint32_t *, uint_t);
68 extern void fp_free(kfpu_t *, int);
69 extern void fp_fork(klwp_t *, klwp_t *);
70 extern void fp_v8_load(kfpu_t *);
71 extern void fp_v8p_load(kfpu_t *);
72 extern void fp_v8_fksave(kfpu_t *);
73 extern void fp_v8p_fksave(kfpu_t *);
74 extern uint32_t _fp_read_fprs(void);
75 extern void _fp_write_fprs(uint32_t);
76 extern void save_gsr(kfpu_t *);
77 extern void restore_gsr(kfpu_t *);
78 extern uint64_t get_gsr(kfpu_t *);
79 extern void set_gsr(uint64_t, kfpu_t *);
80 extern uint64_t _fp_read_pgsr(kfpu_t *);
81 extern void _fp_write_pgsr(uint64_t, kfpu_t *);
82 extern void _fp_read_pdreg(uint64_t *, uint_t);
83 extern void _fp_write_pdreg(uint64_t *, uint_t);
84 
85 #endif	/* _KERNEL */
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif	/* _SYS_FPU_FPUSYSTM_H */
92