141058Swilliam /*- 241058Swilliam * Copyright (c) 1990 The Regents of the University of California. 341058Swilliam * All rights reserved. 441058Swilliam * 541058Swilliam * This code is derived from software contributed to Berkeley by 641058Swilliam * William Jolitz. 741058Swilliam * 8*63175Scgd * Redistribution and use in source and binary forms, with or without 9*63175Scgd * modification, are permitted provided that the following conditions 10*63175Scgd * are met: 11*63175Scgd * 1. Redistributions of source code must retain the above copyright 12*63175Scgd * notice, this list of conditions and the following disclaimer. 13*63175Scgd * 2. Redistributions in binary form must reproduce the above copyright 14*63175Scgd * notice, this list of conditions and the following disclaimer in the 15*63175Scgd * documentation and/or other materials provided with the distribution. 16*63175Scgd * 3. All advertising materials mentioning features or use of this software 17*63175Scgd * must display the following acknowledgement: 18*63175Scgd * This product includes software developed by the University of 19*63175Scgd * California, Berkeley and its contributors. 20*63175Scgd * 4. Neither the name of the University nor the names of its contributors 21*63175Scgd * may be used to endorse or promote products derived from this software 22*63175Scgd * without specific prior written permission. 2341058Swilliam * 24*63175Scgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25*63175Scgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26*63175Scgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27*63175Scgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28*63175Scgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29*63175Scgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30*63175Scgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31*63175Scgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32*63175Scgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33*63175Scgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34*63175Scgd * SUCH DAMAGE. 35*63175Scgd * 3656512Sbostic * @(#)pcb.h 5.11 (Berkeley) 10/11/92 3741058Swilliam */ 3841058Swilliam 3940463Sbill /* 4040463Sbill * Intel 386 process control block 4140463Sbill */ 4256512Sbostic #include <machine/tss.h> 4356512Sbostic #include <machine/npx.h> 4440463Sbill 4540463Sbill struct pcb { 4649523Swilliam struct i386tss pcb_tss; 4749523Swilliam #define pcb_ksp pcb_tss.tss_esp0 4849523Swilliam #define pcb_ptd pcb_tss.tss_cr3 4945964Swilliam #define pcb_cr3 pcb_ptd 5049523Swilliam #define pcb_pc pcb_tss.tss_eip 5149523Swilliam #define pcb_psl pcb_tss.tss_eflags 5249523Swilliam #define pcb_usp pcb_tss.tss_esp 5349523Swilliam #define pcb_fp pcb_tss.tss_ebp 5449523Swilliam #ifdef notyet 5549523Swilliam u_char pcb_iomap[NPORT/sizeof(u_char)]; /* i/o port bitmap */ 5649523Swilliam #endif 5749523Swilliam struct save87 pcb_savefpu; /* floating point state for 287/387 */ 5849523Swilliam struct emcsts pcb_saveemc; /* Cyrix EMC state */ 5940463Sbill /* 6040463Sbill * Software pcb (extension) 6140463Sbill */ 6245964Swilliam int pcb_flags; 6349523Swilliam #define FP_WASUSED 0x01 /* floating point has been used in this proc */ 6449523Swilliam #define FP_NEEDSSAVE 0x02 /* needs save on next context switch */ 6549523Swilliam #define FP_NEEDSRESTORE 0x04 /* need restore on next DNA fault */ 6649523Swilliam #define FP_USESEMC 0x08 /* process uses EMC memory-mapped mode */ 6749523Swilliam #define FM_TRAP 0x10 /* process entered kernel on a trap frame */ 6849523Swilliam short pcb_iml; /* interrupt mask level */ 6949523Swilliam caddr_t pcb_onfault; /* copyin/out fault recovery */ 7049523Swilliam long pcb_sigc[8]; /* XXX signal code trampoline */ 7149523Swilliam int pcb_cmap2; /* XXX temporary PTE - will prefault instead */ 7240463Sbill }; 7349523Swilliam 74*63175Scgd /* 75*63175Scgd * The pcb is augmented with machine-dependent additional data for 76*63175Scgd * core dumps. For the i386: ??? 77*63175Scgd */ 78*63175Scgd struct md_coredump { 79*63175Scgd int pad; /* XXX? -- cgd */ 80*63175Scgd }; 81*63175Scgd 8249701Swilliam #ifdef KERNEL 8349523Swilliam struct pcb *curpcb; /* our current running pcb */ 8449701Swilliam #endif 85