proc.h revision 1.21 1 /* $NetBSD: proc.h,v 1.21 2012/02/06 02:14:13 matt Exp $ */
2
3 /*
4 * Copyright (c) 1994, 1995 Carnegie-Mellon University.
5 * All rights reserved.
6 *
7 * Author: Chris G. Demetriou
8 *
9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation.
14 *
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 *
19 * Carnegie Mellon requests users of this software to return to
20 *
21 * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
22 * School of Computer Science
23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890
25 *
26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes.
28 */
29
30 #ifndef _ALPHA_PROC_H
31 #define _ALPHA_PROC_H
32
33 #include <machine/frame.h>
34 #include <machine/pcb.h>
35
36 /*
37 * Machine-dependent part of the lwp struct for the Alpha.
38 */
39 struct mdlwp {
40 u_long md_flags; /* see below */
41 struct trapframe *md_tf; /* trap/syscall registers */
42 struct pcb *md_pcbpaddr; /* phys addr of the pcb */
43 volatile int md_astpending; /* AST pending for this thread */
44 };
45
46 /*
47 * md_flags usage
48 * --------------
49 * MDLWP_FPUSED
50 * A largely unused bit indicating the presence of FPU history.
51 * Cleared on exec. Set but not used by the fpu context switcher
52 * itself.
53 *
54 * MDLWP_FP_C
55 * The architected FP Control word. It should forever begin at bit 1,
56 * as the bits are AARM specified and this way it doesn't need to be
57 * shifted.
58 *
59 * Until C99 there was never an IEEE 754 API, making most of the
60 * standard useless. Because of overlapping AARM, OSF/1, NetBSD, and
61 * C99 API's, the use of the MDLWP_FP_C bits is defined variously in
62 * ieeefp.h and fpu.h.
63 */
64 #define MDLWP_FPUSED 0x00000001 /* LWP used the FPU */
65 #define MDLWP_FP_C 0x007ffffe /* Extended FP_C Quadword bits */
66 #define MDLWP_FPACTIVE __BIT(63) /* FPU is active on LWP's PCU CPU */
67
68 /*
69 * Machine-dependent part of the proc struct for the Alpha.
70 */
71 struct lwp;
72 struct mdproc {
73 /* this process's syscall vector */
74 void (*md_syscall)(struct lwp *, uint64_t, struct trapframe *);
75 };
76
77 #ifdef _KERNEL
78 #define fpu_used_p(l) (((l)->l_md.md_flags & MDLWP_FPUSED) != 0)
79 #define fpu_mark_used(l) ((void)((l)->l_md.md_flags |= MDLWP_FPUSED))
80 #endif
81
82
83 #endif /* !_ALPHA_PROC_H_ */
84