segments.h (43340) | segments.h (46129) |
---|---|
1/*- 2 * Copyright (c) 1989, 1990 William F. Jolitz 3 * Copyright (c) 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * William Jolitz. 8 * --- 21 unchanged lines hidden (view full) --- 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * from: @(#)segments.h 7.1 (Berkeley) 5/9/91 | 1/*- 2 * Copyright (c) 1989, 1990 William F. Jolitz 3 * Copyright (c) 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * William Jolitz. 8 * --- 21 unchanged lines hidden (view full) --- 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * from: @(#)segments.h 7.1 (Berkeley) 5/9/91 |
38 * $Id: segments.h,v 1.17 1997/08/21 06:32:49 charnier Exp $ | 38 * $Id: segments.h,v 1.18 1999/01/28 11:45:49 newton Exp $ |
39 */ 40 41#ifndef _MACHINE_SEGMENTS_H_ 42#define _MACHINE_SEGMENTS_H_ 43 | 39 */ 40 41#ifndef _MACHINE_SEGMENTS_H_ 42#define _MACHINE_SEGMENTS_H_ 43 |
44#include <machine/globals.h> 45 |
|
44/* 45 * 386 Segmentation Data Structures and definitions 46 * William F. Jolitz (william@ernie.berkeley.edu) 6/20/1989 47 */ 48 49/* 50 * Selectors 51 */ --- 150 unchanged lines hidden (view full) --- 202#define NRSVIDT 32 /* reserved entries for cpu exceptions */ 203 204/* 205 * Entries in the Global Descriptor Table (GDT) 206 */ 207#define GNULL_SEL 0 /* Null Descriptor */ 208#define GCODE_SEL 1 /* Kernel Code Descriptor */ 209#define GDATA_SEL 2 /* Kernel Data Descriptor */ | 46/* 47 * 386 Segmentation Data Structures and definitions 48 * William F. Jolitz (william@ernie.berkeley.edu) 6/20/1989 49 */ 50 51/* 52 * Selectors 53 */ --- 150 unchanged lines hidden (view full) --- 204#define NRSVIDT 32 /* reserved entries for cpu exceptions */ 205 206/* 207 * Entries in the Global Descriptor Table (GDT) 208 */ 209#define GNULL_SEL 0 /* Null Descriptor */ 210#define GCODE_SEL 1 /* Kernel Code Descriptor */ 211#define GDATA_SEL 2 /* Kernel Data Descriptor */ |
210#define GLDT_SEL 3 /* LDT - eventually one per process */ 211#define GTGATE_SEL 4 /* Process task switch gate */ 212#define GPANIC_SEL 5 /* Task state to consider panic from */ 213#define GPROC0_SEL 6 /* Task state process slot zero and up */ 214#define GUSERLDT_SEL 7 /* User LDT */ 215#define GAPMCODE32_SEL 8 /* APM BIOS 32-bit interface (32bit Code) */ 216#define GAPMCODE16_SEL 9 /* APM BIOS 32-bit interface (16bit Code) */ 217#define GAPMDATA_SEL 10 /* APM BIOS 32-bit interface (Data) */ | 212#define GPRIV_SEL 3 /* SMP Per-Processor Private Data */ 213#define GPROC0_SEL 4 /* Task state process slot zero and up */ 214#define GLDT_SEL 5 /* LDT - eventually one per process */ 215#define GUSERLDT_SEL 6 /* User LDT */ 216#define GTGATE_SEL 7 /* Process task switch gate */ 217#define GPANIC_SEL 8 /* Task state to consider panic from */ 218#define GAPMCODE32_SEL 9 /* APM BIOS 32-bit interface (32bit Code) */ 219#define GAPMCODE16_SEL 10 /* APM BIOS 32-bit interface (16bit Code) */ 220#define GAPMDATA_SEL 11 /* APM BIOS 32-bit interface (Data) */ |
218 219#ifdef BDE_DEBUGGER 220#define NGDT 18 /* some of 11-17 are reserved for debugger */ 221#else | 221 222#ifdef BDE_DEBUGGER 223#define NGDT 18 /* some of 11-17 are reserved for debugger */ 224#else |
222#define NGDT (GAPMDATA_SEL + 1) | 225#define NGDT 12 |
223#endif 224 225/* 226 * Entries in the Local Descriptor Table (LDT) 227 */ 228#define LSYS5CALLS_SEL 0 /* forced by intel BCS */ 229#define LSYS5SIGR_SEL 1 230#define L43BSDCALLS_SEL 2 /* notyet */ 231#define LUCODE_SEL 3 232#define LSOL26CALLS_SEL 4 /* Solaris >= 2.6 system call gate */ 233#define LUDATA_SEL 5 234/* separate stack, es,fs,gs sels ? */ 235/* #define LPOSIXCALLS_SEL 5*/ /* notyet */ 236#define LBSDICALLS_SEL 16 /* BSDI system call gate */ 237#define NLDT (LBSDICALLS_SEL + 1) 238 239#ifdef KERNEL | 226#endif 227 228/* 229 * Entries in the Local Descriptor Table (LDT) 230 */ 231#define LSYS5CALLS_SEL 0 /* forced by intel BCS */ 232#define LSYS5SIGR_SEL 1 233#define L43BSDCALLS_SEL 2 /* notyet */ 234#define LUCODE_SEL 3 235#define LSOL26CALLS_SEL 4 /* Solaris >= 2.6 system call gate */ 236#define LUDATA_SEL 5 237/* separate stack, es,fs,gs sels ? */ 238/* #define LPOSIXCALLS_SEL 5*/ /* notyet */ 239#define LBSDICALLS_SEL 16 /* BSDI system call gate */ 240#define NLDT (LBSDICALLS_SEL + 1) 241 242#ifdef KERNEL |
243#ifndef currentldt |
|
240extern int currentldt; | 244extern int currentldt; |
245#endif |
|
241extern int _default_ldt; 242extern union descriptor gdt[]; 243extern struct soft_segment_descriptor gdt_segs[]; 244extern struct gate_descriptor idt[NIDT]; 245extern union descriptor ldt[NLDT]; 246 247void lgdt __P((struct region_descriptor *rdp)); 248void lidt __P((struct region_descriptor *rdp)); 249void lldt __P((u_short sel)); 250void sdtossd __P((struct segment_descriptor *sdp, 251 struct soft_segment_descriptor *ssdp)); 252void ssdtosd __P((struct soft_segment_descriptor *ssdp, 253 struct segment_descriptor *sdp)); 254#endif /* KERNEL */ 255 256#endif /* !_MACHINE_SEGMENTS_H_ */ | 246extern int _default_ldt; 247extern union descriptor gdt[]; 248extern struct soft_segment_descriptor gdt_segs[]; 249extern struct gate_descriptor idt[NIDT]; 250extern union descriptor ldt[NLDT]; 251 252void lgdt __P((struct region_descriptor *rdp)); 253void lidt __P((struct region_descriptor *rdp)); 254void lldt __P((u_short sel)); 255void sdtossd __P((struct segment_descriptor *sdp, 256 struct soft_segment_descriptor *ssdp)); 257void ssdtosd __P((struct soft_segment_descriptor *ssdp, 258 struct segment_descriptor *sdp)); 259#endif /* KERNEL */ 260 261#endif /* !_MACHINE_SEGMENTS_H_ */ |