fp.h revision 86530
181147Stmm/*-
281147Stmm * Copyright 2001 by Thomas Moestl <tmm@FreeBSD.org>.  All rights reserved.
381147Stmm *
481147Stmm * Redistribution and use in source and binary forms, with or without
581147Stmm * modification, are permitted provided that the following conditions
681147Stmm * are met:
781147Stmm * 1. Redistributions of source code must retain the above copyright
881147Stmm *    notice, this list of conditions and the following disclaimer.
981147Stmm * 2. Redistributions in binary form must reproduce the above copyright
1081147Stmm *    notice, this list of conditions and the following disclaimer in the
1181147Stmm *    documentation and/or other materials provided with the distribution.
1281147Stmm *
1381392Sjake * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1481147Stmm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1581147Stmm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1681392Sjake * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
1781147Stmm * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1881147Stmm * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1981147Stmm * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2081147Stmm * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2181147Stmm * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
2281147Stmm * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2381147Stmm *
2481147Stmm * $FreeBSD: head/sys/sparc64/include/fp.h 86530 2001-11-18 04:00:22Z jake $
2581147Stmm */
2681147Stmm
2781147Stmm#ifndef	_MACHINE_FP_H_
2881147Stmm#define	_MACHINE_FP_H_
2981147Stmm
3081147Stmm/* A block of 8 double-precision (16 single-precision) FP registers. */
3183053Sobrienstruct fpblock {
3281147Stmm	u_long	fpq_l[8];
3381147Stmm};
3481147Stmm
3583053Sobrienstruct fpstate {
3681147Stmm	struct	fpblock fp_fb[4];
3781147Stmm	u_long	fp_fsr;
3881147Stmm	u_long	fp_fprs;
3981147Stmm};
4081147Stmm
4186530Sjake#ifdef _KERNEL
4286530Sjake
4386530Sjakestruct pcb;
4486530Sjakestruct thread;
4586530Sjake
4683366Sjulianvoid	fp_init_thread(struct pcb *);
4786530Sjakeint	fp_enable_thread(struct thread *, struct trapframe *);
4886530Sjakeint	fp_exception_other(struct thread *, struct trapframe *);
4981147Stmm/*
5081147Stmm * Note: The pointers passed to the next two functions must be aligned on
5181147Stmm * 64 byte boundaries.
5281147Stmm */
5381147Stmmvoid	savefpctx(struct fpstate *);
5481147Stmmvoid	restorefpctx(struct fpstate *);
5581147Stmm
5686530Sjake#endif /* _KERNEL */
5781147Stmm#endif /* !_MACHINE_FP_H_ */
58