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
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.
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]
23 * Copyright (c) 1990 by Sun Microsystems, Inc.
26 #ifndef _SYS_MACHPCB_H
27 #define _SYS_MACHPCB_H
29 #include <sys/stack.h>
30 #include <sys/regset.h>
31 #include <sys/privregs.h>
38 * This file is machine dependent.
42 * Machine dependent per-thread data.
44 #define MAXWIN 8 /* max # of windows currently supported */
47 * The system actually supports one more than the above number.
48 * There is always one window reserved for trap handlers that
49 * never has to be saved into the pcb struct.
53 * Distance from beginning of thread stack (t_stk) to saved regs struct.
55 #define REGOFF MINFRAME
60 * The struct machpcb is always allocated stack aligned.
62 typedef struct machpcb
{
63 char mpcb_frame
[REGOFF
];
64 struct regs mpcb_regs
; /* user's saved registers */
65 struct rwindow mpcb_wbuf
[MAXWIN
]; /* user window save buffer */
66 caddr_t mpcb_spbuf
[MAXWIN
]; /* sp's for each wbuf */
67 struct rwindow mpcb_rwin
[2]; /* windows used while doing watchpoints */
68 caddr_t mpcb_rsp
[2]; /* sp's for pcb_rwin[] */
69 int mpcb_uwm
; /* user window mask */
70 int mpcb_swm
; /* shared user/kernel window mask */
71 int mpcb_wbcnt
; /* number of saved windows in pcb_wbuf */
72 struct _fpu mpcb_fpu
; /* fpu state */
73 struct _fq mpcb_fpu_q
[_MAXFPQ
]; /* fpu exception queue */
74 int mpcb_flags
; /* various state flags */
75 int mpcb_wocnt
; /* window overflow count */
76 int mpcb_wucnt
; /* window underflow count */
77 kthread_t
*mpcb_thread
; /* associated thread */
82 #define CLEAN_WINDOWS 0x01 /* keep user regs clean */
83 #define FP_TRAPPED 0x02 /* fp_traps call caused by fp queue */
84 #define GOTO_SYS_RTT 0x04 /* return from syscall via sys_rtt */
88 * We can use lwp_regs to find the mpcb base.
91 #define lwptompcb(lwp) ((struct machpcb *) \
92 ((caddr_t)(lwp)->lwp_regs - REGOFF))
99 #endif /* _SYS_MACHPCB_H */