Date: Mon, 14 Nov 1994 06:19:56 -0800 From: Bruce Evans <bde> To: CVS-commiters, cvs-other Subject: cvs commit: /home/ncvs/src/sys/i386/i386 machdep.c Message-ID: <199411141419.GAA00315@freefall.cdrom.com>
next in thread | raw e-mail | index | archive | help
bde 94/11/14 06:19:55 Modified: home/ncvs/src/sys/i386/include segments.h Log: Remove 1.5+K of bloat for unused idt entries. Partly support BDE_DEBUGGER. Still broken by conflict with APM. Does nothing if BDE_DEBUGGER is not defined. Clean up prototypes and data declarations. Declare most of the segment functions that are implemented in support.s. Make data private in machdep.c if possible. Parenthesize expressions in macros properly! ${Uniformize idempotency ifdef}. Modified: home/ncvs/src/sys/i386/isa isa.h Log: Move declarations of atdevbase and rtcin() to cpufunc.h (a less wrong place). Fix spelling error. Uniformize idempotency ifdef. Modified: home/ncvs/src/sys/i386/i386 machdep.c Log: diff -c2 src/sys/i386/i386/machdep.c~ src/sys/i386/i386/machdep.c *** src/sys/i386/i386/machdep.c~ Tue Nov 8 10:40:34 1994 --- src/sys/i386/i386/machdep.c Tue Nov 8 10:42:23 1994 *************** *** 161,164 **** --- 161,166 ---- #define offsetof(type, member) ((size_t)(&((type *)0)->member)) + static union descriptor ldt[NLDT]; /* local descriptor table */ + void cpu_startup() *************** *** 343,346 **** --- 345,349 ---- for (i = 1; i < ncallout; i++) callout[i-1].c_next = &callout[i]; + if (boothowto & RB_CONFIG) userconfig(); *************** *** 930,939 **** */ ! union descriptor gdt[NGDT]; ! union descriptor ldt[NLDT]; /* local descriptor table */ struct gate_descriptor idt[NIDT]; /* interrupt descriptor table */ - int _default_ldt, currentldt; - struct i386tss tss, panic_tss; --- 933,939 ---- */ ! union descriptor gdt[NGDT]; /* global descriptor table */ struct gate_descriptor idt[NIDT]; /* interrupt descriptor table */ struct i386tss tss, panic_tss; *************** *** 941,945 **** /* software prototypes -- in more palatable form */ ! struct soft_segment_descriptor gdt_segs[] = { /* GNULL_SEL 0 Null Descriptor */ { 0x0, /* segment base address */ --- 941,945 ---- /* software prototypes -- in more palatable form */ ! static struct soft_segment_descriptor gdt_segs[] = { /* GNULL_SEL 0 Null Descriptor */ { 0x0, /* segment base address */ *************** *** 1093,1097 **** setidt(idx, func, typ, dpl) int idx; ! void (*func)(); int typ; int dpl; --- 1093,1097 ---- setidt(idx, func, typ, dpl) int idx; ! inthand_t *func; int typ; int dpl; *************** *** 1110,1116 **** #define IDTVEC(name) __CONCAT(X,name) - typedef void idtvec_t(); ! extern idtvec_t IDTVEC(div), IDTVEC(dbg), IDTVEC(nmi), IDTVEC(bpt), IDTVEC(ofl), IDTVEC(bnd), IDTVEC(ill), IDTVEC(dna), IDTVEC(dble), IDTVEC(fpusegm), --- 1110,1115 ---- #define IDTVEC(name) __CONCAT(X,name) ! extern inthand_t IDTVEC(div), IDTVEC(dbg), IDTVEC(nmi), IDTVEC(bpt), IDTVEC(ofl), IDTVEC(bnd), IDTVEC(ill), IDTVEC(dna), IDTVEC(dble), IDTVEC(fpusegm), *************** *** 1122,1129 **** IDTVEC(rsvd13), IDTVEC(rsvd14), IDTVEC(syscall); ! int _gsel_tss; ! ! /* added sdtossd() by HOSOKAWA Tatsumi <hosokawa@mt.cs.keio.ac.jp> */ ! int sdtossd(sd, ssd) struct segment_descriptor *sd; --- 1121,1125 ---- IDTVEC(rsvd13), IDTVEC(rsvd14), IDTVEC(syscall); ! void sdtossd(sd, ssd) struct segment_descriptor *sd; *************** *** 1137,1141 **** ssd->ssd_def32 = sd->sd_def32; ssd->ssd_gran = sd->sd_gran; - return 0; } --- 1133,1136 ---- *************** *** 1144,1151 **** int first; { ! extern lgdt(), lidt(), lldt(); int x; unsigned biosbasemem, biosextmem; struct gate_descriptor *gdp; extern int sigcode,szsigcode; /* table descriptors - used to load tables by microp */ --- 1139,1147 ---- int first; { ! extern char etext[]; int x; unsigned biosbasemem, biosextmem; struct gate_descriptor *gdp; + int gsel_tss; extern int sigcode,szsigcode; /* table descriptors - used to load tables by microp */ *************** *** 1169,1175 **** * the address space */ ! gdt_segs[GCODE_SEL].ssd_limit = i386_btop(0) - 1 /* i386_btop(i386_round_page(&etext)) - 1 */; gdt_segs[GDATA_SEL].ssd_limit = i386_btop(0) - 1; ! for (x=0; x < NGDT; x++) ssdtosd(gdt_segs+x, gdt+x); /* make ldt memory segments */ --- 1165,1176 ---- * the address space */ ! /* ! * XXX text protection is temporarily (?) disabled. The limit was ! * i386_btop(i386_round_page(etext)) - 1. ! */ ! gdt_segs[GCODE_SEL].ssd_limit = i386_btop(0) - 1; gdt_segs[GDATA_SEL].ssd_limit = i386_btop(0) - 1; ! for (x = 0; x < NGDT; x++) ! ssdtosd(&gdt_segs[x], &gdt[x].sd); /* make ldt memory segments */ *************** *** 1195,1199 **** ldt_segs[LUDATA_SEL].ssd_limit = i386_btop(VM_END_USER_RW_ADDRESS) - 1; /* Note. eventually want private ldts per process */ ! for (x=0; x < 5; x++) ssdtosd(ldt_segs+x, ldt+x); /* exceptions */ --- 1196,1201 ---- ldt_segs[LUDATA_SEL].ssd_limit = i386_btop(VM_END_USER_RW_ADDRESS) - 1; /* Note. eventually want private ldts per process */ ! for (x = 0; x < NLDT; x++) ! ssdtosd(&ldt_segs[x], &ldt[x].sd); /* exceptions */ *************** *** 1244,1250 **** lidt(&r_idt); ! _default_ldt = GSEL(GLDT_SEL, SEL_KPL); ! lldt(_default_ldt); ! currentldt = _default_ldt; #ifdef DDB --- 1246,1250 ---- lidt(&r_idt); ! lldt(GSEL(GLDT_SEL, SEL_KPL)); #ifdef DDB *************** *** 1399,1408 **** proc0.p_addr->u_pcb.pcb_tss.tss_esp0 = (int) kstack + UPAGES*NBPG; proc0.p_addr->u_pcb.pcb_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL) ; ! _gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); ((struct i386tss *)gdt_segs[GPROC0_SEL].ssd_base)->tss_ioopt = (sizeof(tss))<<16; ! ltr(_gsel_tss); /* make a call gate to reenter kernel with */ --- 1399,1408 ---- proc0.p_addr->u_pcb.pcb_tss.tss_esp0 = (int) kstack + UPAGES*NBPG; proc0.p_addr->u_pcb.pcb_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL) ; ! gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); ((struct i386tss *)gdt_segs[GPROC0_SEL].ssd_base)->tss_ioopt = (sizeof(tss))<<16; ! ltr(gsel_tss); /* make a call gate to reenter kernel with */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199411141419.GAA00315>