Home | History | Annotate | Line # | Download | only in include
pcb.h revision 1.10.2.2
      1  1.10.2.2  mycroft /*-
      2  1.10.2.2  mycroft  * Copyright (c) 1990 The Regents of the University of California.
      3  1.10.2.2  mycroft  * All rights reserved.
      4  1.10.2.2  mycroft  *
      5  1.10.2.2  mycroft  * This code is derived from software contributed to Berkeley by
      6  1.10.2.2  mycroft  * William Jolitz.
      7  1.10.2.2  mycroft  *
      8  1.10.2.2  mycroft  * Redistribution and use in source and binary forms, with or without
      9  1.10.2.2  mycroft  * modification, are permitted provided that the following conditions
     10  1.10.2.2  mycroft  * are met:
     11  1.10.2.2  mycroft  * 1. Redistributions of source code must retain the above copyright
     12  1.10.2.2  mycroft  *    notice, this list of conditions and the following disclaimer.
     13  1.10.2.2  mycroft  * 2. Redistributions in binary form must reproduce the above copyright
     14  1.10.2.2  mycroft  *    notice, this list of conditions and the following disclaimer in the
     15  1.10.2.2  mycroft  *    documentation and/or other materials provided with the distribution.
     16  1.10.2.2  mycroft  * 3. All advertising materials mentioning features or use of this software
     17  1.10.2.2  mycroft  *    must display the following acknowledgement:
     18  1.10.2.2  mycroft  *	This product includes software developed by the University of
     19  1.10.2.2  mycroft  *	California, Berkeley and its contributors.
     20  1.10.2.2  mycroft  * 4. Neither the name of the University nor the names of its contributors
     21  1.10.2.2  mycroft  *    may be used to endorse or promote products derived from this software
     22  1.10.2.2  mycroft  *    without specific prior written permission.
     23  1.10.2.2  mycroft  *
     24  1.10.2.2  mycroft  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     25  1.10.2.2  mycroft  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     26  1.10.2.2  mycroft  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     27  1.10.2.2  mycroft  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     28  1.10.2.2  mycroft  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     29  1.10.2.2  mycroft  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     30  1.10.2.2  mycroft  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     31  1.10.2.2  mycroft  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     32  1.10.2.2  mycroft  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     33  1.10.2.2  mycroft  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     34  1.10.2.2  mycroft  * SUCH DAMAGE.
     35  1.10.2.2  mycroft  *
     36  1.10.2.2  mycroft  *	from: @(#)pcb.h	5.10 (Berkeley) 5/12/91
     37  1.10.2.2  mycroft  *	pcb.h,v 1.6 1993/06/27 04:50:12 andrew Exp
     38  1.10.2.2  mycroft  */
     39  1.10.2.2  mycroft 
     40  1.10.2.2  mycroft #ifndef _I386_PCB_H_
     41  1.10.2.2  mycroft #define _I386_PCB_H_
     42  1.10.2.2  mycroft 
     43  1.10.2.2  mycroft /*
     44  1.10.2.2  mycroft  * Intel 386 process control block
     45  1.10.2.2  mycroft  */
     46  1.10.2.2  mycroft #include "machine/tss.h"
     47  1.10.2.2  mycroft #include "machine/npx.h"
     48  1.10.2.2  mycroft 
     49  1.10.2.2  mycroft struct pcb {
     50  1.10.2.2  mycroft 	struct	i386tss pcb_tss;
     51  1.10.2.2  mycroft #define	pcb_ksp	pcb_tss.tss_esp0
     52  1.10.2.2  mycroft #define	pcb_ptd	pcb_tss.tss_cr3
     53  1.10.2.2  mycroft #define	pcb_cr3	pcb_ptd
     54  1.10.2.2  mycroft #define	pcb_pc	pcb_tss.tss_eip
     55  1.10.2.2  mycroft #define	pcb_psl	pcb_tss.tss_eflags
     56  1.10.2.2  mycroft #define	pcb_usp	pcb_tss.tss_esp
     57  1.10.2.2  mycroft #define	pcb_fp	pcb_tss.tss_ebp
     58  1.10.2.2  mycroft #ifdef	notyet
     59  1.10.2.2  mycroft 	u_char	pcb_iomap[NPORT/sizeof(u_char)]; /* i/o port bitmap */
     60  1.10.2.2  mycroft #endif
     61  1.10.2.2  mycroft         caddr_t	pcb_ldt;		/* per process (user) LDT */
     62  1.10.2.2  mycroft         int	pcb_ldt_len;		/*      number of LDT entries */
     63  1.10.2.2  mycroft 	struct	save87	pcb_savefpu;	/* floating point state for 287/387 */
     64  1.10.2.2  mycroft 	struct	emcsts	pcb_saveemc;	/* Cyrix EMC state */
     65  1.10.2.2  mycroft /*
     66  1.10.2.2  mycroft  * Software pcb (extension)
     67  1.10.2.2  mycroft  */
     68  1.10.2.2  mycroft 	int	pcb_flags;
     69  1.10.2.2  mycroft #ifdef notused
     70  1.10.2.2  mycroft #define	FP_WASUSED	0x01	/* process has used fltng pnt hardware */
     71  1.10.2.2  mycroft #define	FP_NEEDSSAVE	0x02	/* ... that needs save on next context switch */
     72  1.10.2.2  mycroft #define	FP_NEEDSRESTORE	0x04	/* ... that needs restore on next DNA fault */
     73  1.10.2.2  mycroft #endif
     74  1.10.2.2  mycroft #define	FP_USESEMC	0x08	/* process uses EMC memory-mapped mode */
     75  1.10.2.2  mycroft #define	FP_SOFTFP	0x20	/* process using software fltng pnt emulator */
     76  1.10.2.2  mycroft 	int	pcb_iml;	/* interrupt mask level */
     77  1.10.2.2  mycroft 	caddr_t	pcb_onfault;	/* copyin/out fault recovery */
     78  1.10.2.2  mycroft };
     79  1.10.2.2  mycroft 
     80  1.10.2.2  mycroft #ifdef KERNEL
     81  1.10.2.2  mycroft struct pcb *curpcb;		/* our current running pcb */
     82  1.10.2.2  mycroft #endif
     83  1.10.2.2  mycroft 
     84  1.10.2.2  mycroft #endif /* _I386_PCB_H_ */
     85