Cleanup LDT/GDT defines

This commit is contained in:
brezak 1993-10-26 15:53:54 +00:00
parent 5be77b1847
commit b92626678c
3 changed files with 48 additions and 41 deletions

View File

@ -639,6 +639,12 @@ boot(arghowto)
printf("giving up\n");
else
printf("done\n");
/*
* If we've been adjusting the clock, the todr
* will be out of synch; adjust it now.
*/
resettodr();
DELAY(10000); /* wait for printf to finish */
}
splhigh();
@ -798,36 +804,12 @@ setregs(p, entry, stack, retval)
*/
/*
* Initialize segments & interrupt table
* Initialize segments and descriptor tables
*/
#define GNULL_SEL 0 /* Null Descriptor */
#define GCODE_SEL 1 /* Kernel Code Descriptor */
#define GDATA_SEL 2 /* Kernel Data Descriptor */
#define GLDT_SEL 3 /* LDT - eventually one per process */
#define GTGATE_SEL 4 /* Process task switch gate */
#define GPANIC_SEL 5 /* Task state to consider panic from */
#define GPROC0_SEL 6 /* Task state process slot zero and up */
#define GUSERLDT_SEL 7 /* User LDT */
#define NGDT GUSERLDT_SEL+1
union descriptor gdt[NGDT];
/* interrupt descriptor table */
struct gate_descriptor idt[NIDT];
/* local descriptor table */
#define LSYS5CALLS_SEL 0 /* forced by intel BCS */
#define LSYS5SIGR_SEL 1
#define L43BSDCALLS_SEL 2 /* notyet */
#define LUCODE_SEL 3
#define LUDATA_SEL 4
/* seperate stack, es,fs,gs sels ? */
/* #define LPOSIXCALLS_SEL 5 /* notyet */
#define NLDT LUDATA_SEL+1
union descriptor ldt[NLDT];
union descriptor gdt[NGDT];
struct gate_descriptor idt[NIDT];
union descriptor ldt[NLDT];
int _default_ldt, currentldt;

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91
* $Id: sys_machdep.c,v 1.4 1993/10/15 13:47:22 cgd Exp $
* $Id: sys_machdep.c,v 1.5 1993/10/26 15:54:22 brezak Exp $
*/
#include "npx.h"
@ -62,16 +62,7 @@
#include "vm/vm_map.h"
#include "machine/sysarch.h"
#define LUDATA_SEL 4
#define NLDT LUDATA_SEL+1
#define GUSERLDT_SEL 7 /* User LDT */
#define NGDT GUSERLDT_SEL+1
extern vm_map_t kernel_map;
extern int currentldt;
extern union descriptor gdt[NGDT];
extern union descriptor ldt[NLDT];
extern struct soft_segment_descriptor gdt_segs[];
#ifdef TRACE
int nvualarm;

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)segments.h 7.1 (Berkeley) 5/9/91
* $Id: segments.h,v 1.3 1993/05/22 08:00:37 cgd Exp $
* $Id: segments.h,v 1.4 1993/10/26 15:53:54 brezak Exp $
*/
/*
@ -194,12 +194,46 @@ struct region_descriptor {
#define SEGEX_IDX(s) ((s)>>3)&0x1fff)
/*
* Size of IDT table
* Entries in the Interrupt Descriptor Table (IDT)
*/
#define NIDT 256
#define NRSVIDT 32 /* reserved entries for cpu exceptions */
/*
* Entries in the Global Descriptor Table (GDT)
*/
#define GNULL_SEL 0 /* Null Descriptor */
#define GCODE_SEL 1 /* Kernel Code Descriptor */
#define GDATA_SEL 2 /* Kernel Data Descriptor */
#define GLDT_SEL 3 /* LDT - eventually one per process */
#define GTGATE_SEL 4 /* Process task switch gate */
#define GPANIC_SEL 5 /* Task state to consider panic from */
#define GPROC0_SEL 6 /* Task state process slot zero and up */
#define GUSERLDT_SEL 7 /* User LDT */
#define NGDT GUSERLDT_SEL+1
/*
/*
* Entries in the Local Descriptor Table (LDT)
*/
#define LSYS5CALLS_SEL 0 /* forced by intel BCS */
#define LSYS5SIGR_SEL 1
#define L43BSDCALLS_SEL 2 /* notyet */
#define LUCODE_SEL 3
#define LUDATA_SEL 4
#if 0
/* seperate stack, es,fs,gs sels ? */
#define LPOSIXCALLS_SEL 5 /* notyet */
#endif
#define NLDT LUDATA_SEL+1
#ifdef KERNEL
extern int currentldt;
extern union descriptor gdt[NGDT];
extern union descriptor ldt[NLDT];
extern struct soft_segment_descriptor gdt_segs[];
#endif
#if __GNUC__ >= 2
#pragma pack(4)
#endif