Index: libexec/rtld-elf/i386/reloc.c =================================================================== RCS file: /home/ncvs/src/libexec/rtld-elf/i386/reloc.c,v retrieving revision 1.13.2.1 diff -u -r1.13.2.1 reloc.c --- libexec/rtld-elf/i386/reloc.c 26 Nov 2004 19:30:06 -0000 1.13.2.1 +++ libexec/rtld-elf/i386/reloc.c 25 Apr 2005 22:50:02 -0000 @@ -327,10 +327,6 @@ allocate_initial_tls(Obj_Entry *objs) { void* tls; -#ifndef COMPAT_32BIT - union descriptor ldt; - int sel; -#endif /* * Fix the size of the static TLS block by using the maximum @@ -340,22 +336,7 @@ tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA; tls = allocate_tls(objs, NULL, 2*sizeof(Elf_Addr), sizeof(Elf_Addr)); -#ifndef COMPAT_32BIT - memset(&ldt, 0, sizeof(ldt)); - ldt.sd.sd_lolimit = 0xffff; /* 4G limit */ - ldt.sd.sd_lobase = ((Elf_Addr)tls) & 0xffffff; - ldt.sd.sd_type = SDT_MEMRWA; - ldt.sd.sd_dpl = SEL_UPL; - ldt.sd.sd_p = 1; /* present */ - ldt.sd.sd_hilimit = 0xf; /* 4G limit */ - ldt.sd.sd_def32 = 1; /* 32 bit */ - ldt.sd.sd_gran = 1; /* limit in pages */ - ldt.sd.sd_hibase = (((Elf_Addr)tls) >> 24) & 0xff; - sel = i386_set_ldt(LDT_AUTO_ALLOC, &ldt, 1); - __asm __volatile("movl %0,%%gs" : : "rm" ((sel << 3) | 7)); -#else - _amd64_set_gsbase(tls); -#endif + i386_set_gsbase(tls); } /* GNU ABI */ Index: lib/libc/i386/gen/_set_tp.c =================================================================== RCS file: /home/ncvs/src/lib/libc/i386/gen/_set_tp.c,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 _set_tp.c --- lib/libc/i386/gen/_set_tp.c 26 Nov 2004 19:28:10 -0000 1.1.2.1 +++ lib/libc/i386/gen/_set_tp.c 25 Apr 2005 22:49:06 -0000 @@ -34,23 +34,5 @@ void _set_tp(void *tp) { -#ifndef COMPAT_32BIT - union descriptor ldt; - int sel; - - memset(&ldt, 0, sizeof(ldt)); - ldt.sd.sd_lolimit = 0xffff; /* 4G limit */ - ldt.sd.sd_lobase = ((uintptr_t)tp) & 0xffffff; - ldt.sd.sd_type = SDT_MEMRWA; - ldt.sd.sd_dpl = SEL_UPL; - ldt.sd.sd_p = 1; /* present */ - ldt.sd.sd_hilimit = 0xf; /* 4G limit */ - ldt.sd.sd_def32 = 1; /* 32 bit */ - ldt.sd.sd_gran = 1; /* limit in pages */ - ldt.sd.sd_hibase = (((uintptr_t)tp) >> 24) & 0xff; - sel = i386_set_ldt(LDT_AUTO_ALLOC, &ldt, 1); - __asm __volatile("movl %0,%%gs" : : "rm" ((sel << 3) | 7)); -#else - _amd64_set_gsbase(tp); -#endif + i386_set_gsbase(tp); } Index: lib/libpthread/arch/i386/i386/pthread_md.c =================================================================== RCS file: /home/ncvs/src/lib/libpthread/arch/i386/i386/pthread_md.c,v retrieving revision 1.3.2.1 diff -u -r1.3.2.1 pthread_md.c --- lib/libpthread/arch/i386/i386/pthread_md.c 4 Feb 2005 16:17:54 -0000 1.3.2.1 +++ lib/libpthread/arch/i386/i386/pthread_md.c 26 Apr 2005 18:33:35 -0000 @@ -76,9 +76,6 @@ struct kcb * _kcb_ctor(struct kse *kse) { -#ifndef COMPAT_32BIT - union descriptor ldt; -#endif struct kcb *kcb; kcb = malloc(sizeof(struct kcb)); @@ -86,23 +83,6 @@ bzero(kcb, sizeof(struct kcb)); kcb->kcb_self = kcb; kcb->kcb_kse = kse; -#ifndef COMPAT_32BIT - ldt.sd.sd_hibase = (unsigned int)kcb >> 24; - ldt.sd.sd_lobase = (unsigned int)kcb & 0xFFFFFF; - ldt.sd.sd_hilimit = (sizeof(struct kcb) >> 16) & 0xF; - ldt.sd.sd_lolimit = sizeof(struct kcb) & 0xFFFF; - ldt.sd.sd_type = SDT_MEMRWA; - ldt.sd.sd_dpl = SEL_UPL; - ldt.sd.sd_p = 1; - ldt.sd.sd_xx = 0; - ldt.sd.sd_def32 = 1; - ldt.sd.sd_gran = 0; /* no more than 1M */ - kcb->kcb_ldt = i386_set_ldt(LDT_AUTO_ALLOC, &ldt, 1); - if (kcb->kcb_ldt < 0) { - free(kcb); - return (NULL); - } -#endif } return (kcb); } @@ -110,11 +90,6 @@ void _kcb_dtor(struct kcb *kcb) { -#ifndef COMPAT_32BIT - if (kcb->kcb_ldt >= 0) { - i386_set_ldt(kcb->kcb_ldt, NULL, 1); - kcb->kcb_ldt = -1; /* just in case */ - } -#endif + free(kcb); } Index: lib/libpthread/arch/i386/include/pthread_md.h =================================================================== RCS file: /home/ncvs/src/lib/libpthread/arch/i386/include/pthread_md.h,v retrieving revision 1.10.2.1 diff -u -r1.10.2.1 pthread_md.h --- lib/libpthread/arch/i386/include/pthread_md.h 4 Feb 2005 16:17:55 -0000 1.10.2.1 +++ lib/libpthread/arch/i386/include/pthread_md.h 25 Apr 2005 23:31:35 -0000 @@ -152,14 +152,7 @@ static __inline void _kcb_set(struct kcb *kcb) { -#ifndef COMPAT_32BIT - int val; - - val = (kcb->kcb_ldt << 3) | 7; - __asm __volatile("movl %0, %%gs" : : "r" (val)); -#else - _amd64_set_gsbase(kcb); -#endif + i386_set_gsbase(kcb); }