1 /* $OpenBSD: pcb.h,v 1.20 2016/03/24 04:56:08 guenther Exp $ */ 2 /* $NetBSD: pcb.h,v 1.21 1996/01/08 13:51:42 mycroft Exp $ */ 3 4 /*- 5 * Copyright (c) 1995 Charles M. Hannum. All rights reserved. 6 * Copyright (c) 1990 The Regents of the University of California. 7 * All rights reserved. 8 * 9 * This code is derived from software contributed to Berkeley by 10 * William Jolitz. 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 * 1. Redistributions of source code must retain the above copyright 16 * notice, this list of conditions and the following disclaimer. 17 * 2. Redistributions in binary form must reproduce the above copyright 18 * notice, this list of conditions and the following disclaimer in the 19 * documentation and/or other materials provided with the distribution. 20 * 3. Neither the name of the University nor the names of its contributors 21 * may be used to endorse or promote products derived from this software 22 * without specific prior written permission. 23 * 24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)pcb.h 5.10 (Berkeley) 5/12/91 37 */ 38 39 /* 40 * Intel 386 process control block 41 */ 42 43 #ifndef _MACHINE_PCB_H_ 44 #define _MACHINE_PCB_H_ 45 46 #include <sys/signal.h> 47 48 #include <machine/segments.h> 49 #include <machine/tss.h> 50 #include <machine/npx.h> 51 #include <machine/sysarch.h> 52 53 struct pcb { 54 struct i386tss pcb_tss; 55 #define pcb_cr3 pcb_tss.tss_cr3 56 #define pcb_esp pcb_tss.tss_esp 57 #define pcb_ebp pcb_tss.tss_ebp 58 #define pcb_cs pcb_tss.tss_cs 59 int pcb_cr0; /* saved image of CR0 */ 60 caddr_t pcb_onfault; /* copyin/out fault recovery */ 61 union savefpu pcb_savefpu; /* floating point state for FPU */ 62 struct segment_descriptor pcb_threadsegs[2]; 63 /* per-thread descriptors */ 64 int vm86_eflags; /* virtual eflags for vm86 mode */ 65 int vm86_flagmask; /* flag mask for vm86 mode */ 66 void *vm86_userp; /* XXX performance hack */ 67 struct pmap *pcb_pmap; /* back pointer to our pmap */ 68 struct cpu_info *pcb_fpcpu; /* cpu holding our fpu state */ 69 int pcb_flags; 70 #define PCB_SAVECTX 0x00000001 71 }; 72 73 /* the indexes of the %fs/%gs segments in pcb_threadsegs */ 74 #define TSEG_FS 0 75 #define TSEG_GS 1 76 77 #endif /* _MACHINE_PCB_H_ */ 78