From db8830bc2df63d901372f95b64e88e5acca62a62 Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 29 Jun 2005 23:15:36 +0000 Subject: Clean out the leftovers from the i386_set_gsbase() TLS conversion. Like on libthr, there is an i386_set_gsbase() stub implementation here to avoid libc.so.5 issues. This should likely be a weak symbol and I expect this will be fixed soon. Approved by: re --- lib/libc/i386/gen/_set_tp.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/i386/gen/_set_tp.c b/lib/libc/i386/gen/_set_tp.c index 9b76fa2..110e7e4 100644 --- a/lib/libc/i386/gen/_set_tp.c +++ b/lib/libc/i386/gen/_set_tp.c @@ -28,28 +28,11 @@ #include #include -#include #include void _set_tp(void *tp) { - union descriptor ldt; - int error, sel; - error = i386_set_gsbase(tp); - if (error == 0) - return; - 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)); + i386_set_gsbase(tp); } -- cgit v1.1