xref: /csrg-svn/sys/i386/include/pcb.h (revision 65797)
141058Swilliam /*-
2*65797Sbostic  * Copyright (c) 1993
3*65797Sbostic  *	The Regents of the University of California.  All rights reserved.
441058Swilliam  *
541058Swilliam  * This code is derived from software contributed to Berkeley by
641058Swilliam  * William Jolitz.
741058Swilliam  *
863360Sbostic  * %sccs.include.redist.c%
941058Swilliam  *
10*65797Sbostic  *	@(#)pcb.h	8.2 (Berkeley) 01/21/94
1141058Swilliam  */
1241058Swilliam 
1340463Sbill /*
1440463Sbill  * Intel 386 process control block
1540463Sbill  */
1656512Sbostic #include <machine/tss.h>
1756512Sbostic #include <machine/npx.h>
1840463Sbill 
1940463Sbill struct pcb {
2049523Swilliam 	struct	i386tss pcb_tss;
2149523Swilliam #define	pcb_ksp	pcb_tss.tss_esp0
2249523Swilliam #define	pcb_ptd	pcb_tss.tss_cr3
2345964Swilliam #define	pcb_cr3	pcb_ptd
2449523Swilliam #define	pcb_pc	pcb_tss.tss_eip
2549523Swilliam #define	pcb_psl	pcb_tss.tss_eflags
2649523Swilliam #define	pcb_usp	pcb_tss.tss_esp
2749523Swilliam #define	pcb_fp	pcb_tss.tss_ebp
2849523Swilliam #ifdef	notyet
2949523Swilliam 	u_char	pcb_iomap[NPORT/sizeof(u_char)]; /* i/o port bitmap */
3049523Swilliam #endif
3149523Swilliam 	struct	save87	pcb_savefpu;	/* floating point state for 287/387 */
3249523Swilliam 	struct	emcsts	pcb_saveemc;	/* Cyrix EMC state */
3340463Sbill /*
3440463Sbill  * Software pcb (extension)
3540463Sbill  */
3645964Swilliam 	int	pcb_flags;
3749523Swilliam #define	FP_WASUSED	0x01	/* floating point has been used in this proc */
3849523Swilliam #define	FP_NEEDSSAVE	0x02	/* needs save on next context switch */
3949523Swilliam #define	FP_NEEDSRESTORE	0x04	/* need restore on next DNA fault */
4049523Swilliam #define	FP_USESEMC	0x08	/* process uses EMC memory-mapped mode */
4149523Swilliam #define	FM_TRAP		0x10	/* process entered kernel on a trap frame */
4249523Swilliam 	short	pcb_iml;	/* interrupt mask level */
4349523Swilliam 	caddr_t	pcb_onfault;	/* copyin/out fault recovery */
4449523Swilliam 	long	pcb_sigc[8];	/* XXX signal code trampoline */
4549523Swilliam 	int	pcb_cmap2;	/* XXX temporary PTE - will prefault instead */
4640463Sbill };
4749523Swilliam 
4863175Scgd /*
4963175Scgd  * The pcb is augmented with machine-dependent additional data for
5063175Scgd  * core dumps. For the i386: ???
5163175Scgd  */
5263175Scgd struct md_coredump {
5363175Scgd         int     pad;		/* XXX? -- cgd */
5463175Scgd };
5563175Scgd 
5649701Swilliam #ifdef KERNEL
5749523Swilliam struct pcb *curpcb;		/* our current running pcb */
5849701Swilliam #endif
59