pcb.h revision 557
1178476Sjb/*-
2178476Sjb * Copyright (c) 1990 The Regents of the University of California.
3178476Sjb * All rights reserved.
4178476Sjb *
5178476Sjb * This code is derived from software contributed to Berkeley by
6178476Sjb * William Jolitz.
7178476Sjb *
8178476Sjb * Redistribution and use in source and binary forms, with or without
9178476Sjb * modification, are permitted provided that the following conditions
10178476Sjb * are met:
11178476Sjb * 1. Redistributions of source code must retain the above copyright
12178476Sjb *    notice, this list of conditions and the following disclaimer.
13178476Sjb * 2. Redistributions in binary form must reproduce the above copyright
14178476Sjb *    notice, this list of conditions and the following disclaimer in the
15178476Sjb *    documentation and/or other materials provided with the distribution.
16178476Sjb * 3. All advertising materials mentioning features or use of this software
17178476Sjb *    must display the following acknowledgement:
18178476Sjb *	This product includes software developed by the University of
19178476Sjb *	California, Berkeley and its contributors.
20178476Sjb * 4. Neither the name of the University nor the names of its contributors
21178476Sjb *    may be used to endorse or promote products derived from this software
22178476Sjb *    without specific prior written permission.
23178476Sjb *
24178476Sjb * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25178476Sjb * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26178476Sjb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27178476Sjb * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28178476Sjb * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29178476Sjb * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30178476Sjb * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31178476Sjb * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32178476Sjb * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33178476Sjb * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34178476Sjb * SUCH DAMAGE.
35178476Sjb *
36178476Sjb *	from: @(#)pcb.h	5.10 (Berkeley) 5/12/91
37178476Sjb *	$Id$
38178476Sjb */
39178476Sjb
40178476Sjb#ifndef _I386_PCB_H_
41178476Sjb#define _I386_PCB_H_
42178476Sjb
43178476Sjb/*
44178476Sjb * Intel 386 process control block
45178476Sjb */
46178476Sjb#include "machine/tss.h"
47178476Sjb#include "machine/npx.h"
48178476Sjb
49178476Sjbstruct pcb {
50178476Sjb	struct	i386tss pcb_tss;
51178476Sjb#define	pcb_ksp	pcb_tss.tss_esp0
52178476Sjb#define	pcb_ptd	pcb_tss.tss_cr3
53178476Sjb#define	pcb_cr3	pcb_ptd
54178476Sjb#define	pcb_pc	pcb_tss.tss_eip
55178476Sjb#define	pcb_psl	pcb_tss.tss_eflags
56178476Sjb#define	pcb_usp	pcb_tss.tss_esp
57178476Sjb#define	pcb_fp	pcb_tss.tss_ebp
58178476Sjb#ifdef	notyet
59178476Sjb	u_char	pcb_iomap[NPORT/sizeof(u_char)]; /* i/o port bitmap */
60178476Sjb#endif
61178476Sjb	caddr_t	pcb_ldt;		/* per process (user) LDT */
62178476Sjb	int	pcb_ldt_len;		/* number of LDT entries */
63178476Sjb	struct	save87	pcb_savefpu;	/* floating point state for 287/387 */
64178476Sjb	struct	emcsts	pcb_saveemc;	/* Cyrix EMC state */
65178476Sjb/*
66178476Sjb * Software pcb (extension)
67178476Sjb */
68178476Sjb	int	pcb_flags;
69178476Sjb#ifdef notused
70178476Sjb#define	FP_WASUSED	0x01	/* process has used fltng pnt hardware */
71178476Sjb#define	FP_NEEDSSAVE	0x02	/* ... that needs save on next context switch */
72178476Sjb#define	FP_NEEDSRESTORE	0x04	/* ... that needs restore on next DNA fault */
73178476Sjb#endif
74178476Sjb#define	FP_USESEMC	0x08	/* process uses EMC memory-mapped mode */
75178476Sjb#define	FM_TRAP		0x10	/* process entered kernel on a trap frame */
76178476Sjb#define	FP_SOFTFP	0x20	/* process using software fltng pnt emulator */
77178476Sjb	short	pcb_iml;	/* interrupt mask level */
78178476Sjb	caddr_t	pcb_onfault;	/* copyin/out fault recovery */
79178476Sjb	long	pcb_sigc[8];	/* XXX signal code trampoline */
80178476Sjb	int	pcb_cmap2;	/* XXX temporary PTE - will prefault instead */
81178476Sjb};
82211545Srpaulo
83#ifdef KERNEL
84struct pcb *curpcb;		/* our current running pcb */
85#endif
86
87#endif /* _I386_PCB_H_ */
88