pcb.h revision 1.48.8.1 1 1.48.8.1 yamt /* $NetBSD: pcb.h,v 1.48.8.1 2014/05/22 11:39:52 yamt Exp $ */
2 1.24 mycroft
3 1.24 mycroft /*-
4 1.47 ad * Copyright (c) 1998, 2009 The NetBSD Foundation, Inc.
5 1.24 mycroft * All rights reserved.
6 1.24 mycroft *
7 1.24 mycroft * This code is derived from software contributed to The NetBSD Foundation
8 1.47 ad * by Charles M. Hannum, and by Andrew Doran.
9 1.24 mycroft *
10 1.24 mycroft * Redistribution and use in source and binary forms, with or without
11 1.24 mycroft * modification, are permitted provided that the following conditions
12 1.24 mycroft * are met:
13 1.24 mycroft * 1. Redistributions of source code must retain the above copyright
14 1.24 mycroft * notice, this list of conditions and the following disclaimer.
15 1.24 mycroft * 2. Redistributions in binary form must reproduce the above copyright
16 1.24 mycroft * notice, this list of conditions and the following disclaimer in the
17 1.24 mycroft * documentation and/or other materials provided with the distribution.
18 1.24 mycroft *
19 1.24 mycroft * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.24 mycroft * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.24 mycroft * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.24 mycroft * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.24 mycroft * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.24 mycroft * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.24 mycroft * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.24 mycroft * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.24 mycroft * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.24 mycroft * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.24 mycroft * POSSIBILITY OF SUCH DAMAGE.
30 1.24 mycroft */
31 1.12 cgd
32 1.1 cgd /*-
33 1.1 cgd * Copyright (c) 1990 The Regents of the University of California.
34 1.1 cgd * All rights reserved.
35 1.1 cgd *
36 1.1 cgd * This code is derived from software contributed to Berkeley by
37 1.1 cgd * William Jolitz.
38 1.1 cgd *
39 1.1 cgd * Redistribution and use in source and binary forms, with or without
40 1.1 cgd * modification, are permitted provided that the following conditions
41 1.1 cgd * are met:
42 1.1 cgd * 1. Redistributions of source code must retain the above copyright
43 1.1 cgd * notice, this list of conditions and the following disclaimer.
44 1.1 cgd * 2. Redistributions in binary form must reproduce the above copyright
45 1.1 cgd * notice, this list of conditions and the following disclaimer in the
46 1.1 cgd * documentation and/or other materials provided with the distribution.
47 1.34 agc * 3. Neither the name of the University nor the names of its contributors
48 1.1 cgd * may be used to endorse or promote products derived from this software
49 1.1 cgd * without specific prior written permission.
50 1.1 cgd *
51 1.1 cgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
52 1.1 cgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
53 1.1 cgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
54 1.1 cgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
55 1.1 cgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
56 1.1 cgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
57 1.1 cgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
58 1.1 cgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
59 1.1 cgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
60 1.1 cgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
61 1.1 cgd * SUCH DAMAGE.
62 1.1 cgd *
63 1.12 cgd * @(#)pcb.h 5.10 (Berkeley) 5/12/91
64 1.1 cgd */
65 1.1 cgd
66 1.14 mycroft /*
67 1.14 mycroft * Intel 386 process control block
68 1.14 mycroft */
69 1.14 mycroft
70 1.6 andrew #ifndef _I386_PCB_H_
71 1.6 andrew #define _I386_PCB_H_
72 1.6 andrew
73 1.36 tsutsui #if defined(_KERNEL_OPT)
74 1.32 fvdl #include "opt_multiprocessor.h"
75 1.32 fvdl #endif
76 1.32 fvdl
77 1.14 mycroft #include <machine/segments.h>
78 1.48.8.1 yamt #include <x86/cpu_extended_state.h>
79 1.1 cgd
80 1.1 cgd struct pcb {
81 1.42 yamt int pcb_esp0; /* ring0 esp */
82 1.42 yamt int pcb_esp; /* kernel esp */
83 1.42 yamt int pcb_ebp; /* kernel ebp */
84 1.16 mycroft int pcb_cr0; /* saved image of CR0 */
85 1.30 christos int pcb_cr2; /* page fault address (CR2) */
86 1.42 yamt int pcb_cr3; /* page directory pointer */
87 1.43 yamt int pcb_iopl; /* i/o privilege level */
88 1.42 yamt
89 1.48 joerg struct segment_descriptor pcb_fsd; /* %fs descriptor */
90 1.48 joerg struct segment_descriptor pcb_gsd; /* %gs descriptor */
91 1.48.8.1 yamt void *pcb_onfault; /* copyin/out fault recovery */
92 1.21 mycroft int vm86_eflags; /* virtual eflags for vm86 mode */
93 1.21 mycroft int vm86_flagmask; /* flag mask for vm86 mode */
94 1.21 mycroft void *vm86_userp; /* XXX performance hack */
95 1.42 yamt char *pcb_iomap; /* I/O permission bitmap */
96 1.1 cgd
97 1.48.8.1 yamt int not_used[15];
98 1.48.8.1 yamt
99 1.48.8.1 yamt /* floating point state */
100 1.48.8.1 yamt struct cpu_info *pcb_fpcpu; /* cpu holding our fp state. */
101 1.48.8.1 yamt union savefpu pcb_savefpu __aligned(64);
102 1.48.8.1 yamt /* **** DO NOT ADD ANYTHING HERE **** */
103 1.48.8.1 yamt
104 1.48.8.1 yamt };
105 1.48.8.1 yamt #ifndef __lint__
106 1.48.8.1 yamt /* This doesn't really matter, but there is a lot of implied padding */
107 1.48.8.1 yamt __CTASSERT(sizeof(struct pcb) - sizeof (union savefpu) == 128);
108 1.48.8.1 yamt #endif
109 1.6 andrew
110 1.6 andrew #endif /* _I386_PCB_H_ */
111