169039Sben/* $NetBSD: proc.h,v 1.20 2011/06/07 00:48:31 matt Exp $ */
269039Sben
369039Sben/*
469039Sben * Copyright (c) 1994, 1995 Carnegie-Mellon University.
569039Sben * All rights reserved.
669039Sben *
769039Sben * Author: Chris G. Demetriou
869039Sben *
969039Sben * Permission to use, copy, modify and distribute this software and
1069039Sben * its documentation is hereby granted, provided that both the copyright
1169039Sben * notice and this permission notice appear in all copies of the
1269039Sben * software, derivative works or modified versions, and any portions
1369039Sben * thereof, and that both notices appear in supporting documentation.
1469039Sben *
1569039Sben * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
1669039Sben * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
1769039Sben * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
1869039Sben *
1969039Sben * Carnegie Mellon requests users of this software to return to
2069039Sben *
2169039Sben *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
2269039Sben *  School of Computer Science
2369039Sben *  Carnegie Mellon University
2469039Sben *  Pittsburgh PA 15213-3890
2569039Sben *
2669039Sben * any improvements or extensions that they make and grant Carnegie the
27276675Sngie * rights to redistribute these changes.
2869039Sben */
2979538Sru
3069039Sben#ifndef _ALPHA_PROC_H
3169039Sben#define _ALPHA_PROC_H
3275670Sru
3369039Sben#include <machine/frame.h>
34153116Sjkoshy#include <machine/pcb.h>
3570017Sru
36153116Sjkoshy/*
3769039Sben * Machine-dependent part of the lwp struct for the Alpha.
3869039Sben */
3969039Sbenstruct mdlwp {
4069039Sben	u_long md_flags;		/* see below */
4169039Sben	struct trapframe *md_tf;	/* trap/syscall registers */
42237655Swblock	struct pcb *md_pcbpaddr;	/* phys addr of the pcb */
43268759Sgavin	volatile int md_astpending;	/* AST pending for this thread */
44237655Swblock};
45238008Swblock
46153116Sjkoshy/*
4769039Sben * md_flags usage
4869039Sben * --------------
4969039Sben * MDLWP_FPUSED
5069039Sben * 	A largely unused bit indicating the presence of FPU history.
5169039Sben * 	Cleared on exec. Set but not used by the fpu context switcher
52153116Sjkoshy * 	itself.
5369039Sben *
5469039Sben * MDLWP_FP_C
5569039Sben * 	The architected FP Control word. It should forever begin at bit 1,
56153116Sjkoshy * 	as the bits are AARM specified and this way it doesn't need to be
5769039Sben * 	shifted.
58153116Sjkoshy *
5969039Sben * 	Until C99 there was never an IEEE 754 API, making most of the
60153116Sjkoshy * 	standard useless.  Because of overlapping AARM, OSF/1, NetBSD, and
61153116Sjkoshy * 	C99 API's, the use of the MDLWP_FP_C bits is defined variously in
6269039Sben * 	ieeefp.h and fpu.h.
6369039Sben */
6469039Sben#define	MDLWP_FPUSED	0x00000001	/* LWP used the FPU */
6569039Sben#define	MDLWP_FP_C	0x007ffffe	/* Extended FP_C Quadword bits */
6692798Sru#define	MDLWP_FPACTIVE	__BIT(63)	/* FPU is active on LWP's PCU CPU */
6792798Sru
6892798Sru/*
6992798Sru * Machine-dependent part of the proc struct for the Alpha.
7069039Sben */
7192798Srustruct lwp;
7292798Srustruct mdproc {
73153116Sjkoshy					/* this process's syscall vector */
74153116Sjkoshy	void	(*md_syscall)(struct lwp *, uint64_t, struct trapframe *);
75153116Sjkoshy};
76153116Sjkoshy
77153116Sjkoshy#ifdef _KERNEL
78153116Sjkoshy#define	fpu_used_p(l)		(((l)->l_md.md_flags & MDLWP_FPUSED) != 0)
79153116Sjkoshy#define	fpu_mark_used(l)	((void)((l)->l_md.md_flags |= MDLWP_FPUSED))
80153116Sjkoshy#endif
81153116Sjkoshy
82153116Sjkoshy
83153116Sjkoshy#endif /* !_ALPHA_PROC_H_ */
84153116Sjkoshy