pcb.h revision 4
14Srgrimes/*-
24Srgrimes * Copyright (c) 1990 The Regents of the University of California.
34Srgrimes * All rights reserved.
44Srgrimes *
54Srgrimes * This code is derived from software contributed to Berkeley by
64Srgrimes * William Jolitz.
74Srgrimes *
84Srgrimes * Redistribution and use in source and binary forms, with or without
94Srgrimes * modification, are permitted provided that the following conditions
104Srgrimes * are met:
114Srgrimes * 1. Redistributions of source code must retain the above copyright
124Srgrimes *    notice, this list of conditions and the following disclaimer.
134Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
144Srgrimes *    notice, this list of conditions and the following disclaimer in the
154Srgrimes *    documentation and/or other materials provided with the distribution.
164Srgrimes * 3. All advertising materials mentioning features or use of this software
174Srgrimes *    must display the following acknowledgement:
184Srgrimes *	This product includes software developed by the University of
194Srgrimes *	California, Berkeley and its contributors.
204Srgrimes * 4. Neither the name of the University nor the names of its contributors
214Srgrimes *    may be used to endorse or promote products derived from this software
224Srgrimes *    without specific prior written permission.
234Srgrimes *
244Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
254Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
264Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
274Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
284Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
294Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
304Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
314Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
324Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
334Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
344Srgrimes * SUCH DAMAGE.
354Srgrimes *
364Srgrimes *	@(#)pcb.h	5.10 (Berkeley) 5/12/91
374Srgrimes *
384Srgrimes * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
394Srgrimes * --------------------         -----   ----------------------
404Srgrimes * CURRENT PATCH LEVEL:         1       00154
414Srgrimes * --------------------         -----   ----------------------
424Srgrimes *
434Srgrimes * 20 Apr 93	Bruce Evans		New npx-0.5 code
444Srgrimes *
454Srgrimes */
464Srgrimes
474Srgrimes/*
484Srgrimes * Intel 386 process control block
494Srgrimes */
504Srgrimes#include "machine/tss.h"
514Srgrimes#include "machine/npx.h"
524Srgrimes
534Srgrimesstruct pcb {
544Srgrimes	struct	i386tss pcb_tss;
554Srgrimes#define	pcb_ksp	pcb_tss.tss_esp0
564Srgrimes#define	pcb_ptd	pcb_tss.tss_cr3
574Srgrimes#define	pcb_cr3	pcb_ptd
584Srgrimes#define	pcb_pc	pcb_tss.tss_eip
594Srgrimes#define	pcb_psl	pcb_tss.tss_eflags
604Srgrimes#define	pcb_usp	pcb_tss.tss_esp
614Srgrimes#define	pcb_fp	pcb_tss.tss_ebp
624Srgrimes#ifdef	notyet
634Srgrimes	u_char	pcb_iomap[NPORT/sizeof(u_char)]; /* i/o port bitmap */
644Srgrimes#endif
654Srgrimes	struct	save87	pcb_savefpu;	/* floating point state for 287/387 */
664Srgrimes	struct	emcsts	pcb_saveemc;	/* Cyrix EMC state */
674Srgrimes/*
684Srgrimes * Software pcb (extension)
694Srgrimes */
704Srgrimes	int	pcb_flags;
714Srgrimes#ifdef notused
724Srgrimes#define	FP_WASUSED	0x01	/* process has used fltng pnt hardware */
734Srgrimes#define	FP_NEEDSSAVE	0x02	/* ... that needs save on next context switch */
744Srgrimes#define	FP_NEEDSRESTORE	0x04	/* ... that needs restore on next DNA fault */
754Srgrimes#endif
764Srgrimes#define	FP_USESEMC	0x08	/* process uses EMC memory-mapped mode */
774Srgrimes#define	FM_TRAP		0x10	/* process entered kernel on a trap frame */
784Srgrimes#define	FP_SOFTFP	0x20	/* process using software fltng pnt emulator */
794Srgrimes	short	pcb_iml;	/* interrupt mask level */
804Srgrimes	caddr_t	pcb_onfault;	/* copyin/out fault recovery */
814Srgrimes	long	pcb_sigc[8];	/* XXX signal code trampoline */
824Srgrimes	int	pcb_cmap2;	/* XXX temporary PTE - will prefault instead */
834Srgrimes};
844Srgrimes
854Srgrimes#ifdef KERNEL
864Srgrimesstruct pcb *curpcb;		/* our current running pcb */
874Srgrimes#endif
88