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
35extern "C" {
36#endif
37
38#ifdef _KERNEL
39
40struct _fpu;
41struct regs;
42
43#if !defined(DEBUG) && !defined(NEED_FPU_EXISTS)
44#define	fpu_exists 1
45#else
46extern int fpu_exists;
47#endif
48
49extern int fpu_version;
50extern int fpdispr;
51
52extern void fpu_probe(void);
53extern void fp_disable(void);
54extern void fp_disabled(struct regs *);
55extern void fp_clearregs(kfpu_t *);
56extern void fp_enable(void);
57extern void fp_fksave(kfpu_t *);
58extern void fp_runq(struct regs *);
59extern void fp_load(kfpu_t *);
60extern void fp_save(kfpu_t *);
61extern void fp_restore(kfpu_t *);
62extern void run_fpq(klwp_t *, fpregset_t *);
63extern void syncfpu(void);
64extern void _fp_read_pfsr(uint64_t *fsr);
65extern void _fp_write_pfsr(uint64_t *);
66extern void _fp_read_pfreg(uint32_t *, uint_t);
67extern void _fp_write_pfreg(uint32_t *, uint_t);
68extern void fp_free(kfpu_t *, int);
69extern void fp_fork(klwp_t *, klwp_t *);
70extern void fp_v8_load(kfpu_t *);
71extern void fp_v8p_load(kfpu_t *);
72extern void fp_v8_fksave(kfpu_t *);
73extern void fp_v8p_fksave(kfpu_t *);
74extern uint32_t _fp_read_fprs(void);
75extern void _fp_write_fprs(uint32_t);
76extern void save_gsr(kfpu_t *);
77extern void restore_gsr(kfpu_t *);
78extern uint64_t get_gsr(kfpu_t *);
79extern void set_gsr(uint64_t, kfpu_t *);
80extern uint64_t _fp_read_pgsr(kfpu_t *);
81extern void _fp_write_pgsr(uint64_t, kfpu_t *);
82extern void _fp_read_pdreg(uint64_t *, uint_t);
83extern 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