diff options
author | julian <julian@FreeBSD.org> | 2003-08-04 19:11:56 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2003-08-04 19:11:56 +0000 |
commit | cbe160350057824430b62fc3ae5bff27495319cb (patch) | |
tree | cd8e26feaafebaa1b868633281fba8c7ede7cc02 /sys | |
parent | c11e824db2cb5d85e2b6caee93e18e122dc667b7 (diff) | |
download | FreeBSD-src-cbe160350057824430b62fc3ae5bff27495319cb.zip FreeBSD-src-cbe160350057824430b62fc3ae5bff27495319cb.tar.gz |
Allow foot shooting as Linux emulation needs it.
Also change "Auto mode" to use a "special" value
instead of 0, and define and document it.
I had thought libpthread had already been switched to use auto mode but
it appears that patch hasn't been committed yet.
Discussed with: Davidxu
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/i386/sys_machdep.c | 8 | ||||
-rw-r--r-- | sys/i386/include/sysarch.h | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index a3330cf..f595b5e 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -464,7 +464,7 @@ i386_set_ldt(td, args) return (0); } - if (!(uap->start == 0 && uap->num == 1)) { + if (!(uap->start == LDT_AUTO_ALLOC && uap->num == 1)) { #ifdef DEBUG /* complain a for a while if using old methods */ if (ldt_warnings++ < NUM_LDT_WARNINGS) { @@ -475,7 +475,7 @@ i386_set_ldt(td, args) #endif /* verify range of descriptors to modify */ largest_ld = uap->start + uap->num; - if (uap->start <= LUDATA_SEL || uap->start >= MAX_LD || + if (uap->start >= MAX_LD || uap->num < 0 || largest_ld > MAX_LD) { return (EINVAL); } @@ -560,7 +560,7 @@ i386_set_ldt(td, args) } } - if (uap->start == 0 && uap->num == 1) { + if (uap->start == LDT_AUTO_ALLOC && uap->num == 1) { /* Allocate a free slot */ pldt = mdp->md_ldt; if (pldt == NULL) { @@ -574,11 +574,11 @@ i386_set_ldt(td, args) } again: mtx_lock_spin(&sched_lock); - dp = &((union descriptor *)(pldt->ldt_base))[NLDT]; /* * start scanning a bit up to leave room for NVidia and * Wine, which still user the "Blat" method of allocation. */ + dp = &((union descriptor *)(pldt->ldt_base))[NLDT]; for (i = NLDT; i < pldt->ldt_len; ++i) { if (dp->sd.sd_type == SDT_SYSNULL) break; diff --git a/sys/i386/include/sysarch.h b/sys/i386/include/sysarch.h index c5574ff..6b237c0 100644 --- a/sys/i386/include/sysarch.h +++ b/sys/i386/include/sysarch.h @@ -41,6 +41,7 @@ #define I386_GET_LDT 0 #define I386_SET_LDT 1 +#define LDT_AUTO_ALLOC 0xffffffff /* I386_IOPL */ #define I386_GET_IOPERM 3 #define I386_SET_IOPERM 4 |