Date: Tue, 14 Jun 2005 02:12:05 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 78509 for review Message-ID: <200506140212.j5E2C5jG043249@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=78509 Change 78509 by peter@peter_melody on 2005/06/14 02:11:50 clean up tls goop Affected files ... .. //depot/projects/hammer/lib/libc/i386/gen/_set_tp.c#7 edit Differences ... ==== //depot/projects/hammer/lib/libc/i386/gen/_set_tp.c#7 (text+ko) ==== @@ -28,28 +28,11 @@ #include <string.h> #include <stdint.h> -#include <machine/segments.h> #include <machine/sysarch.h> 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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200506140212.j5E2C5jG043249>