? userldt.diff ? compile/DL360 ? compile/UP360 ? i386/conf/DL360 ? i386/conf/UP360 ? i386/i386/patch1 ? i386/i386/patch2 Index: conf/options.i386 =================================================================== RCS file: /home/ncvs/src/sys/conf/options.i386,v retrieving revision 1.145 diff -u -r1.145 options.i386 --- conf/options.i386 2001/01/29 08:19:02 1.145 +++ conf/options.i386 2001/02/23 00:48:15 @@ -2,7 +2,6 @@ DISABLE_PSE IDE_DELAY -USER_LDT MATH_EMULATE opt_math_emulate.h GPL_MATH_EMULATE opt_math_emulate.h PMAP_SHPGPERPROC opt_pmap.h Index: conf/options.pc98 =================================================================== RCS file: /home/ncvs/src/sys/conf/options.pc98,v retrieving revision 1.116 diff -u -r1.116 options.pc98 --- conf/options.pc98 2001/01/29 08:19:02 1.116 +++ conf/options.pc98 2001/02/23 00:48:15 @@ -2,7 +2,6 @@ DISABLE_PSE IDE_DELAY -USER_LDT MATH_EMULATE opt_math_emulate.h GPL_MATH_EMULATE opt_math_emulate.h PMAP_SHPGPERPROC opt_pmap.h Index: i386/conf/NOTES =================================================================== RCS file: /home/ncvs/src/sys/i386/conf/NOTES,v retrieving revision 1.890 diff -u -r1.890 NOTES --- i386/conf/NOTES 2001/02/22 10:03:04 1.890 +++ i386/conf/NOTES 2001/02/23 00:48:17 @@ -284,13 +284,6 @@ options COMPAT_43 # -# Allow user-mode programs to manipulate their local descriptor tables. -# This option is required for the WINE Windows(tm) emulator, and is -# not used by anything else (that we know of). -# -options USER_LDT #allow user-level control of i386 ldt - -# # These three options provide support for System V Interface # Definition-style interprocess communication, in the form of shared # memory, semaphores, and message queues, respectively. Index: i386/i386/genassym.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/genassym.c,v retrieving revision 1.106 diff -u -r1.106 genassym.c --- i386/i386/genassym.c 2001/02/20 05:26:13 1.106 +++ i386/i386/genassym.c 2001/02/23 00:48:17 @@ -37,8 +37,6 @@ * $FreeBSD: src/sys/i386/i386/genassym.c,v 1.106 2001/02/20 05:26:13 jhb Exp $ */ -#include "opt_user_ldt.h" - #include #include #include @@ -115,9 +113,7 @@ ASSYM(PCB_EIP, offsetof(struct pcb, pcb_eip)); ASSYM(TSS_ESP0, offsetof(struct i386tss, tss_esp0)); -#ifdef USER_LDT ASSYM(PCB_USERLDT, offsetof(struct pcb, pcb_ldt)); -#endif ASSYM(PCB_GS, offsetof(struct pcb, pcb_gs)); ASSYM(PCB_DR0, offsetof(struct pcb, pcb_dr0)); @@ -177,10 +173,7 @@ ASSYM(GD_SWITCHTICKS, offsetof(struct globaldata, gd_switchticks)); ASSYM(GD_COMMON_TSSD, offsetof(struct globaldata, gd_common_tssd)); ASSYM(GD_TSS_GDT, offsetof(struct globaldata, gd_tss_gdt)); - -#ifdef USER_LDT ASSYM(GD_CURRENTLDT, offsetof(struct globaldata, gd_currentldt)); -#endif ASSYM(GD_WITNESS_SPIN_CHECK, offsetof(struct globaldata, gd_witness_spin_check)); Index: i386/i386/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.441 diff -u -r1.441 machdep.c --- i386/i386/machdep.c 2001/02/20 05:26:13 1.441 +++ i386/i386/machdep.c 2001/02/23 00:48:20 @@ -49,7 +49,6 @@ #include "opt_msgbuf.h" #include "opt_npx.h" #include "opt_perfmon.h" -#include "opt_user_ldt.h" #include "opt_userconfig.h" #include @@ -1048,10 +1047,8 @@ struct trapframe *regs = p->p_md.md_regs; struct pcb *pcb = &p->p_addr->u_pcb; -#ifdef USER_LDT - /* was i386_user_cleanup() in NetBSD */ - user_ldt_free(pcb); -#endif + if (pcb->pcb_ldt) + user_ldt_free(pcb); bzero((char *)regs, sizeof(struct trapframe)); regs->tf_eip = entry; @@ -1939,9 +1936,7 @@ _default_ldt = GSEL(GLDT_SEL, SEL_KPL); lldt(_default_ldt); -#ifdef USER_LDT PCPU_SET(currentldt, _default_ldt); -#endif /* exceptions */ for (x = 0; x < NIDT; x++) Index: i386/i386/mp_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/mp_machdep.c,v retrieving revision 1.146 diff -u -r1.146 mp_machdep.c --- i386/i386/mp_machdep.c 2001/02/09 16:13:57 1.146 +++ i386/i386/mp_machdep.c 2001/02/23 00:48:21 @@ -26,7 +26,6 @@ */ #include "opt_cpu.h" -#include "opt_user_ldt.h" #ifdef SMP #include @@ -521,9 +520,7 @@ lidt(&r_idt); lldt(_default_ldt); -#ifdef USER_LDT PCPU_SET(currentldt, _default_ldt); -#endif gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); gdt[myid * NGDT + GPROC0_SEL].sd.sd_type = SDT_SYS386TSS; Index: i386/i386/pmap.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/pmap.c,v retrieving revision 1.272 diff -u -r1.272 pmap.c --- i386/i386/pmap.c 2001/01/30 00:35:34 1.272 +++ i386/i386/pmap.c 2001/02/23 00:48:21 @@ -71,7 +71,6 @@ #include "opt_disable_pse.h" #include "opt_pmap.h" #include "opt_msgbuf.h" -#include "opt_user_ldt.h" #include #include Index: i386/i386/swtch.s =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/swtch.s,v retrieving revision 1.110 diff -u -r1.110 swtch.s --- i386/i386/swtch.s 2001/02/20 05:26:14 1.110 +++ i386/i386/swtch.s 2001/02/23 00:48:21 @@ -37,7 +37,6 @@ */ #include "opt_npx.h" -#include "opt_user_ldt.h" #include #include @@ -241,7 +240,6 @@ /* XXX FIXME: we should be restoring the local APIC TPR */ #endif /* SMP */ -#ifdef USER_LDT cmpl $0, PCB_USERLDT(%edx) jnz 1f movl __default_ldt,%eax @@ -254,7 +252,6 @@ call _set_user_ldt popl %edx 2: -#endif /* This must be done after loading the user LDT. */ .globl cpu_switch_load_gs Index: i386/i386/sys_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/sys_machdep.c,v retrieving revision 1.52 diff -u -r1.52 sys_machdep.c --- i386/i386/sys_machdep.c 2001/01/10 04:43:46 1.52 +++ i386/i386/sys_machdep.c 2001/02/23 00:48:21 @@ -35,8 +35,6 @@ * */ -#include "opt_user_ldt.h" - #include #include #include @@ -68,10 +66,8 @@ -#ifdef USER_LDT static int i386_get_ldt __P((struct proc *, char *)); static int i386_set_ldt __P((struct proc *, char *)); -#endif static int i386_get_ioperm __P((struct proc *, char *)); static int i386_set_ioperm __P((struct proc *, char *)); int i386_extend_pcb __P((struct proc *)); @@ -91,7 +87,6 @@ int error = 0; switch(uap->op) { -#ifdef USER_LDT case I386_GET_LDT: error = i386_get_ldt(p, uap->parms); break; @@ -99,7 +94,6 @@ case I386_SET_LDT: error = i386_set_ldt(p, uap->parms); break; -#endif case I386_GET_IOPERM: error = i386_get_ioperm(p, uap->parms); break; @@ -242,10 +236,9 @@ return (error); } -#ifdef USER_LDT /* * Update the GDT entry pointing to the LDT to point to the LDT of the - * current process. Do not staticize. + * current process. */ void set_user_ldt(struct pcb *pcb) @@ -499,4 +492,3 @@ splx(s); return(error); } -#endif /* USER_LDT */ Index: i386/i386/vm_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/vm_machdep.c,v retrieving revision 1.152 diff -u -r1.152 vm_machdep.c --- i386/i386/vm_machdep.c 2001/02/20 05:26:14 1.152 +++ i386/i386/vm_machdep.c 2001/02/23 00:48:21 @@ -42,7 +42,6 @@ */ #include "opt_npx.h" -#include "opt_user_ldt.h" #ifdef PC98 #include "opt_pc98.h" #endif @@ -126,7 +125,6 @@ struct pcb *pcb2; if ((flags & RFPROC) == 0) { -#ifdef USER_LDT if ((flags & RFMEM) == 0) { /* unshare user LDT */ struct pcb *pcb1 = &p1->p_addr->u_pcb; @@ -138,7 +136,6 @@ set_user_ldt(pcb1); } } -#endif return; } @@ -188,7 +185,6 @@ */ pcb2->pcb_ext = 0; -#ifdef USER_LDT /* Copy the LDT, if necessary. */ if (pcb2->pcb_ldt != 0) { if (flags & RFMEM) { @@ -198,7 +194,6 @@ pcb2->pcb_ldt->ldt_len); } } -#endif /* * Now, cpu_switch() can schedule the new process. @@ -249,9 +244,8 @@ ctob(IOPAGES + 1)); pcb->pcb_ext = 0; } -#ifdef USER_LDT - user_ldt_free(pcb); -#endif + if (pcb->pcb_ldt) + user_ldt_free(pcb); if (pcb->pcb_flags & PCB_DBREGS) { /* * disable all hardware breakpoints Index: i386/include/globaldata.h =================================================================== RCS file: /home/ncvs/src/sys/i386/include/globaldata.h,v retrieving revision 1.23 diff -u -r1.23 globaldata.h --- i386/include/globaldata.h 2001/02/10 02:20:33 1.23 +++ i386/include/globaldata.h 2001/02/23 00:48:21 @@ -60,7 +60,7 @@ int gd_switchticks; struct segment_descriptor gd_common_tssd; struct segment_descriptor *gd_tss_gdt; - int gd_currentldt; /* only used for USER_LDT */ + int gd_currentldt; u_int gd_cpuid; u_int gd_other_cpus; SLIST_ENTRY(globaldata) gd_allcpu; Index: i386/include/pcb.h =================================================================== RCS file: /home/ncvs/src/sys/i386/include/pcb.h,v retrieving revision 1.35 diff -u -r1.35 pcb.h --- i386/include/pcb.h 2001/02/20 05:26:14 1.35 +++ i386/include/pcb.h 2001/02/23 00:48:21 @@ -61,11 +61,7 @@ int pcb_dr6; int pcb_dr7; -#ifdef USER_LDT struct pcb_ldt *pcb_ldt; /* per process (user) LDT */ -#else - struct pcb_ldt *pcb_ldt_dontuse; -#endif struct save87 pcb_savefpu; /* floating point state for 287/387 */ u_char pcb_flags; #define FP_SOFTFP 0x01 /* process using software fltng pnt emulator */ Index: i386/include/pcb_ext.h =================================================================== RCS file: /home/ncvs/src/sys/i386/include/pcb_ext.h,v retrieving revision 1.4 diff -u -r1.4 pcb_ext.h --- i386/include/pcb_ext.h 1999/12/29 04:33:04 1.4 +++ i386/include/pcb_ext.h 2001/02/23 00:48:21 @@ -53,11 +53,9 @@ #ifdef _KERNEL -#ifdef USER_LDT void set_user_ldt __P((struct pcb *)); struct pcb_ldt *user_ldt_alloc __P((struct pcb *, int)); void user_ldt_free __P((struct pcb *)); -#endif #endif Index: i386/svr4/svr4_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/svr4/svr4_machdep.c,v retrieving revision 1.16 diff -u -r1.16 svr4_machdep.c --- i386/svr4/svr4_machdep.c 2001/01/24 00:24:57 1.16 +++ i386/svr4/svr4_machdep.c 2001/02/23 00:48:21 @@ -503,7 +503,7 @@ struct svr4_sys_sysarch_args *v; { struct svr4_sys_sysarch_args *uap = v; -#ifdef USER_LDT +#if 0 /* USER_LDT */ #if defined(__NetBSD__) caddr_t sg = stackgap_init(p->p_emul); #else @@ -511,12 +511,13 @@ #endif int error; #endif + switch (uap->op) { case SVR4_SYSARCH_FPHW: return 0; case SVR4_SYSARCH_DSCR: -#ifdef USER_LDT +#if 0 /* USER_LDT */ #warning "USER_LDT doesn't work - are you sure you want this?" { struct i386_set_ldt_args sa, *sap; Index: pc98/i386/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/pc98/i386/machdep.c,v retrieving revision 1.206 diff -u -r1.206 machdep.c --- pc98/i386/machdep.c 2001/02/21 10:20:11 1.206 +++ pc98/i386/machdep.c 2001/02/23 00:48:26 @@ -49,7 +49,6 @@ #include "opt_msgbuf.h" #include "opt_npx.h" #include "opt_perfmon.h" -#include "opt_user_ldt.h" #include "opt_userconfig.h" #include @@ -1061,10 +1060,8 @@ struct trapframe *regs = p->p_md.md_regs; struct pcb *pcb = &p->p_addr->u_pcb; -#ifdef USER_LDT - /* was i386_user_cleanup() in NetBSD */ - user_ldt_free(pcb); -#endif + if (pcb->pcb_ldt) + user_ldt_free(pcb); bzero((char *)regs, sizeof(struct trapframe)); regs->tf_eip = entry; @@ -2248,9 +2245,7 @@ _default_ldt = GSEL(GLDT_SEL, SEL_KPL); lldt(_default_ldt); -#ifdef USER_LDT PCPU_SET(currentldt, _default_ldt); -#endif /* exceptions */ for (x = 0; x < NIDT; x++)