summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornewton <newton@FreeBSD.org>1999-01-28 11:45:49 +0000
committernewton <newton@FreeBSD.org>1999-01-28 11:45:49 +0000
commit4532b2c24c57afebb7138390eb595a5937ec424e (patch)
tree540862bc1f1970e803eb6da2e4acbfca18bed03a
parentdddbbc64795e2657bb640d89695102019733f7aa (diff)
downloadFreeBSD-src-4532b2c24c57afebb7138390eb595a5937ec424e.zip
FreeBSD-src-4532b2c24c57afebb7138390eb595a5937ec424e.tar.gz
Sun Bug ID 1251858 (on http://sunsolve1.sun.com) discusses the way that
Sun implemented iBCS2 compatibility on Solaris >= 2.6: The emulator runs in user-mode, patching the LDT so that client programs making syscalls through the old iBCS2 call gate get handled by the emulator process. Unemulated syscalls therefore need their own call-gate that bypasses the emulator. Sun chose LDT entry 4 to implement this, which is what we've been using as LUDATA_SEL, so we need to change LUDATA_SEL if we want to run Solaris executables. Discussed with: Mike Smith
-rw-r--r--sys/amd64/amd64/machdep.c12
-rw-r--r--sys/amd64/include/segments.h5
-rw-r--r--sys/i386/i386/machdep.c12
-rw-r--r--sys/i386/include/segments.h5
4 files changed, 28 insertions, 6 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 1bd6f6c..6e65e1e 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.321 1999/01/09 15:41:49 bde Exp $
+ * $Id: machdep.c,v 1.322 1999/01/15 17:24:05 msmith Exp $
*/
#include "apm.h"
@@ -1069,6 +1069,15 @@ static struct soft_segment_descriptor ldt_segs[] = {
0, 0,
1, /* default 32 vs 16 bit size */
1 /* limit granularity (byte/page units)*/ },
+ /* Null Descriptor - overwritten by call gate */
+{ 0x0, /* segment base address */
+ 0x0, /* length - all address space */
+ 0, /* segment type */
+ 0, /* segment descriptor priority level */
+ 0, /* segment descriptor present */
+ 0, 0,
+ 0, /* default 32 vs 16 bit size */
+ 0 /* limit granularity (byte/page units)*/ },
/* Data Descriptor for user */
{ 0x0, /* segment base address */
0xfffff, /* length - all address space */
@@ -1587,6 +1596,7 @@ init386(first)
/* XXX does this work? */
ldt[LBSDICALLS_SEL] = ldt[LSYS5CALLS_SEL];
+ ldt[LSOL26CALLS_SEL] = ldt[LSYS5CALLS_SEL];
/* transfer to user mode */
diff --git a/sys/amd64/include/segments.h b/sys/amd64/include/segments.h
index 894e6c5..674b0f3 100644
--- a/sys/amd64/include/segments.h
+++ b/sys/amd64/include/segments.h
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)segments.h 7.1 (Berkeley) 5/9/91
- * $Id: segments.h,v 1.16 1997/08/18 06:58:31 charnier Exp $
+ * $Id: segments.h,v 1.17 1997/08/21 06:32:49 charnier Exp $
*/
#ifndef _MACHINE_SEGMENTS_H_
@@ -229,7 +229,8 @@ struct region_descriptor {
#define LSYS5SIGR_SEL 1
#define L43BSDCALLS_SEL 2 /* notyet */
#define LUCODE_SEL 3
-#define LUDATA_SEL 4
+#define LSOL26CALLS_SEL 4 /* Solaris >= 2.6 system call gate */
+#define LUDATA_SEL 5
/* separate stack, es,fs,gs sels ? */
/* #define LPOSIXCALLS_SEL 5*/ /* notyet */
#define LBSDICALLS_SEL 16 /* BSDI system call gate */
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 1bd6f6c..6e65e1e 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.321 1999/01/09 15:41:49 bde Exp $
+ * $Id: machdep.c,v 1.322 1999/01/15 17:24:05 msmith Exp $
*/
#include "apm.h"
@@ -1069,6 +1069,15 @@ static struct soft_segment_descriptor ldt_segs[] = {
0, 0,
1, /* default 32 vs 16 bit size */
1 /* limit granularity (byte/page units)*/ },
+ /* Null Descriptor - overwritten by call gate */
+{ 0x0, /* segment base address */
+ 0x0, /* length - all address space */
+ 0, /* segment type */
+ 0, /* segment descriptor priority level */
+ 0, /* segment descriptor present */
+ 0, 0,
+ 0, /* default 32 vs 16 bit size */
+ 0 /* limit granularity (byte/page units)*/ },
/* Data Descriptor for user */
{ 0x0, /* segment base address */
0xfffff, /* length - all address space */
@@ -1587,6 +1596,7 @@ init386(first)
/* XXX does this work? */
ldt[LBSDICALLS_SEL] = ldt[LSYS5CALLS_SEL];
+ ldt[LSOL26CALLS_SEL] = ldt[LSYS5CALLS_SEL];
/* transfer to user mode */
diff --git a/sys/i386/include/segments.h b/sys/i386/include/segments.h
index 894e6c5..674b0f3 100644
--- a/sys/i386/include/segments.h
+++ b/sys/i386/include/segments.h
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)segments.h 7.1 (Berkeley) 5/9/91
- * $Id: segments.h,v 1.16 1997/08/18 06:58:31 charnier Exp $
+ * $Id: segments.h,v 1.17 1997/08/21 06:32:49 charnier Exp $
*/
#ifndef _MACHINE_SEGMENTS_H_
@@ -229,7 +229,8 @@ struct region_descriptor {
#define LSYS5SIGR_SEL 1
#define L43BSDCALLS_SEL 2 /* notyet */
#define LUCODE_SEL 3
-#define LUDATA_SEL 4
+#define LSOL26CALLS_SEL 4 /* Solaris >= 2.6 system call gate */
+#define LUDATA_SEL 5
/* separate stack, es,fs,gs sels ? */
/* #define LPOSIXCALLS_SEL 5*/ /* notyet */
#define LBSDICALLS_SEL 16 /* BSDI system call gate */
OpenPOWER on IntegriCloud