aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorLuoqi Chen <luoqi@FreeBSD.org>1999-05-12 21:39:07 +0000
committerLuoqi Chen <luoqi@FreeBSD.org>1999-05-12 21:39:07 +0000
commit0f0fe5a4c55952c578443898f839ad985c5b7612 (patch)
treee93b032a8903410d70ff7fbd94ea78543308451c /sys
parent2ee16532b6c34e1b24c309d99a395bd94b5887d0 (diff)
Unbreak VESA on SMP.
Notes
Notes: svn path=/head/; revision=47081
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/cpu_switch.S17
-rw-r--r--sys/amd64/amd64/genassym.c3
-rw-r--r--sys/amd64/amd64/machdep.c7
-rw-r--r--sys/amd64/amd64/mp_machdep.c5
-rw-r--r--sys/amd64/amd64/mptable.c5
-rw-r--r--sys/amd64/amd64/swtch.s17
-rw-r--r--sys/amd64/include/mptable.h5
-rw-r--r--sys/amd64/include/pcpu.h3
-rw-r--r--sys/i386/i386/genassym.c3
-rw-r--r--sys/i386/i386/globals.s8
-rw-r--r--sys/i386/i386/machdep.c7
-rw-r--r--sys/i386/i386/mp_machdep.c5
-rw-r--r--sys/i386/i386/mptable.c5
-rw-r--r--sys/i386/i386/swtch.s17
-rw-r--r--sys/i386/i386/vm86.c5
-rw-r--r--sys/i386/i386/vm86bios.s12
-rw-r--r--sys/i386/include/asnames.h3
-rw-r--r--sys/i386/include/globaldata.h3
-rw-r--r--sys/i386/include/globals.h4
-rw-r--r--sys/i386/include/mptable.h5
-rw-r--r--sys/i386/include/pcpu.h3
-rw-r--r--sys/kern/subr_smp.c5
-rw-r--r--sys/pc98/i386/machdep.c7
-rw-r--r--sys/pc98/pc98/machdep.c7
24 files changed, 84 insertions, 77 deletions
diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S
index f86a29d6353e..f3d767144c17 100644
--- a/sys/amd64/amd64/cpu_switch.S
+++ b/sys/amd64/amd64/cpu_switch.S
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: swtch.s,v 1.79 1999/04/28 01:03:25 luoqi Exp $
+ * $Id: swtch.s,v 1.80 1999/05/06 09:44:49 bde Exp $
*/
#include "npx.h"
@@ -282,17 +282,16 @@ _idle:
btrl %esi, _private_tss
jae 1f
- movl $GPROC0_SEL, %esi
movl $gd_common_tssd, %edi
addl %fs:0, %edi
/* move correct tss descriptor into GDT slot, then reload tr */
- leal _gdt(,%esi,8), %ebx /* entry in GDT */
+ movl _tss_gdt, %ebx /* entry in GDT */
movl 0(%edi), %eax
movl %eax, 0(%ebx)
movl 4(%edi), %eax
movl %eax, 4(%ebx)
- shll $3, %esi /* GSEL(entry, SEL_KPL) */
+ movl $GPROC0_SEL*8, %esi /* GSEL(entry, SEL_KPL) */
ltr %si
1:
#endif /* VM86 */
@@ -403,16 +402,15 @@ idle_loop:
btrl %esi, _private_tss
jae 1f
- movl $GPROC0_SEL, %esi
movl $_common_tssd, %edi
/* move correct tss descriptor into GDT slot, then reload tr */
- leal _gdt(,%esi,8), %ebx /* entry in GDT */
+ movl _tss_gdt, %ebx /* entry in GDT */
movl 0(%edi), %eax
movl %eax, 0(%ebx)
movl 4(%edi), %eax
movl %eax, 4(%ebx)
- shll $3, %esi /* GSEL(entry, SEL_KPL) */
+ movl $GPROC0_SEL*8, %esi /* GSEL(entry, SEL_KPL) */
ltr %si
1:
#endif /* VM86 */
@@ -665,14 +663,13 @@ swtch_com:
movl $_common_tssd, %edi
#endif
2:
- movl $GPROC0_SEL, %esi
/* move correct tss descriptor into GDT slot, then reload tr */
- leal _gdt(,%esi,8), %ebx /* entry in GDT */
+ movl _tss_gdt, %ebx /* entry in GDT */
movl 0(%edi), %eax
movl %eax, 0(%ebx)
movl 4(%edi), %eax
movl %eax, 4(%ebx)
- shll $3, %esi /* GSEL(entry, SEL_KPL) */
+ movl $GPROC0_SEL*8, %esi /* GSEL(entry, SEL_KPL) */
ltr %si
3:
#endif /* VM86 */
diff --git a/sys/amd64/amd64/genassym.c b/sys/amd64/amd64/genassym.c
index e2e772347923..ed1ecb071122 100644
--- a/sys/amd64/amd64/genassym.c
+++ b/sys/amd64/amd64/genassym.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)genassym.c 5.11 (Berkeley) 5/10/91
- * $Id: genassym.c,v 1.67 1999/05/11 16:04:39 luoqi Exp $
+ * $Id: genassym.c,v 1.68 1999/05/12 21:30:49 luoqi Exp $
*/
#include "opt_vm86.h"
@@ -203,6 +203,7 @@ main()
printf("#define\tGD_SWITCHTICKS %#x\n", OS(globaldata, gd_switchticks));
#ifdef VM86
printf("#define\tGD_COMMON_TSSD %#x\n", OS(globaldata, gd_common_tssd));
+ printf("#define\tGD_TSS_GDT %#x\n", OS(globaldata, gd_tss_gdt));
#endif
#ifdef USER_LDT
printf("#define\tGD_CURRENTLDT %#x\n", OS(globaldata, gd_currentldt));
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index c8ca257ed2ed..2dd2ad4230df 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.333 1999/05/06 00:38:41 luoqi Exp $
+ * $Id: machdep.c,v 1.334 1999/05/06 00:54:44 luoqi Exp $
*/
#include "apm.h"
@@ -904,7 +904,7 @@ struct region_descriptor r_gdt, r_idt;
#ifdef VM86
#ifndef SMP
-extern struct segment_descriptor common_tssd;
+extern struct segment_descriptor common_tssd, *tss_gdt;
#endif
int private_tss; /* flag indicating private tss */
#endif /* VM86 */
@@ -1297,7 +1297,8 @@ init386(first)
ltr(gsel_tss);
#ifdef VM86
private_tss = 0;
- common_tssd = gdt[GPROC0_SEL].sd;
+ tss_gdt = &gdt[GPROC0_SEL].sd;
+ common_tssd = *tss_gdt;
#endif
dblfault_tss.tss_esp = dblfault_tss.tss_esp0 = dblfault_tss.tss_esp1 =
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 4c8c946597d6..ad9e6c6bd892 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.99 1999/04/30 22:09:40 msmith Exp $
+ * $Id: mp_machdep.c,v 1.100 1999/05/08 17:48:22 peter Exp $
*/
#include "opt_smp.h"
@@ -483,7 +483,8 @@ init_secondary(void)
common_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL);
common_tss.tss_ioopt = (sizeof common_tss) << 16;
#ifdef VM86
- common_tssd = gdt[myid * NGDT + GPROC0_SEL].sd;
+ tss_gdt = &gdt[myid * NGDT + GPROC0_SEL].sd;
+ common_tssd = *tss_gdt;
#endif
ltr(gsel_tss);
diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c
index 4c8c946597d6..ad9e6c6bd892 100644
--- a/sys/amd64/amd64/mptable.c
+++ b/sys/amd64/amd64/mptable.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.99 1999/04/30 22:09:40 msmith Exp $
+ * $Id: mp_machdep.c,v 1.100 1999/05/08 17:48:22 peter Exp $
*/
#include "opt_smp.h"
@@ -483,7 +483,8 @@ init_secondary(void)
common_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL);
common_tss.tss_ioopt = (sizeof common_tss) << 16;
#ifdef VM86
- common_tssd = gdt[myid * NGDT + GPROC0_SEL].sd;
+ tss_gdt = &gdt[myid * NGDT + GPROC0_SEL].sd;
+ common_tssd = *tss_gdt;
#endif
ltr(gsel_tss);
diff --git a/sys/amd64/amd64/swtch.s b/sys/amd64/amd64/swtch.s
index f86a29d6353e..f3d767144c17 100644
--- a/sys/amd64/amd64/swtch.s
+++ b/sys/amd64/amd64/swtch.s
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: swtch.s,v 1.79 1999/04/28 01:03:25 luoqi Exp $
+ * $Id: swtch.s,v 1.80 1999/05/06 09:44:49 bde Exp $
*/
#include "npx.h"
@@ -282,17 +282,16 @@ _idle:
btrl %esi, _private_tss
jae 1f
- movl $GPROC0_SEL, %esi
movl $gd_common_tssd, %edi
addl %fs:0, %edi
/* move correct tss descriptor into GDT slot, then reload tr */
- leal _gdt(,%esi,8), %ebx /* entry in GDT */
+ movl _tss_gdt, %ebx /* entry in GDT */
movl 0(%edi), %eax
movl %eax, 0(%ebx)
movl 4(%edi), %eax
movl %eax, 4(%ebx)
- shll $3, %esi /* GSEL(entry, SEL_KPL) */
+ movl $GPROC0_SEL*8, %esi /* GSEL(entry, SEL_KPL) */
ltr %si
1:
#endif /* VM86 */
@@ -403,16 +402,15 @@ idle_loop:
btrl %esi, _private_tss
jae 1f
- movl $GPROC0_SEL, %esi
movl $_common_tssd, %edi
/* move correct tss descriptor into GDT slot, then reload tr */
- leal _gdt(,%esi,8), %ebx /* entry in GDT */
+ movl _tss_gdt, %ebx /* entry in GDT */
movl 0(%edi), %eax
movl %eax, 0(%ebx)
movl 4(%edi), %eax
movl %eax, 4(%ebx)
- shll $3, %esi /* GSEL(entry, SEL_KPL) */
+ movl $GPROC0_SEL*8, %esi /* GSEL(entry, SEL_KPL) */
ltr %si
1:
#endif /* VM86 */
@@ -665,14 +663,13 @@ swtch_com:
movl $_common_tssd, %edi
#endif
2:
- movl $GPROC0_SEL, %esi
/* move correct tss descriptor into GDT slot, then reload tr */
- leal _gdt(,%esi,8), %ebx /* entry in GDT */
+ movl _tss_gdt, %ebx /* entry in GDT */
movl 0(%edi), %eax
movl %eax, 0(%ebx)
movl 4(%edi), %eax
movl %eax, 4(%ebx)
- shll $3, %esi /* GSEL(entry, SEL_KPL) */
+ movl $GPROC0_SEL*8, %esi /* GSEL(entry, SEL_KPL) */
ltr %si
3:
#endif /* VM86 */
diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h
index 4c8c946597d6..ad9e6c6bd892 100644
--- a/sys/amd64/include/mptable.h
+++ b/sys/amd64/include/mptable.h
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.99 1999/04/30 22:09:40 msmith Exp $
+ * $Id: mp_machdep.c,v 1.100 1999/05/08 17:48:22 peter Exp $
*/
#include "opt_smp.h"
@@ -483,7 +483,8 @@ init_secondary(void)
common_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL);
common_tss.tss_ioopt = (sizeof common_tss) << 16;
#ifdef VM86
- common_tssd = gdt[myid * NGDT + GPROC0_SEL].sd;
+ tss_gdt = &gdt[myid * NGDT + GPROC0_SEL].sd;
+ common_tssd = *tss_gdt;
#endif
ltr(gsel_tss);
diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h
index f1d4fdd0ffa1..456c502f6369 100644
--- a/sys/amd64/include/pcpu.h
+++ b/sys/amd64/include/pcpu.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: globaldata.h,v 1.7 1999/02/22 15:13:34 bde Exp $
+ * $Id: globaldata.h,v 1.8 1999/04/28 01:04:00 luoqi Exp $
*/
/*
@@ -48,6 +48,7 @@ struct globaldata {
int gd_switchticks;
#ifdef VM86
struct segment_descriptor gd_common_tssd;
+ struct segment_descriptor *gd_tss_gdt;
#endif
#ifdef USER_LDT
int gd_currentldt;
diff --git a/sys/i386/i386/genassym.c b/sys/i386/i386/genassym.c
index e2e772347923..ed1ecb071122 100644
--- a/sys/i386/i386/genassym.c
+++ b/sys/i386/i386/genassym.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)genassym.c 5.11 (Berkeley) 5/10/91
- * $Id: genassym.c,v 1.67 1999/05/11 16:04:39 luoqi Exp $
+ * $Id: genassym.c,v 1.68 1999/05/12 21:30:49 luoqi Exp $
*/
#include "opt_vm86.h"
@@ -203,6 +203,7 @@ main()
printf("#define\tGD_SWITCHTICKS %#x\n", OS(globaldata, gd_switchticks));
#ifdef VM86
printf("#define\tGD_COMMON_TSSD %#x\n", OS(globaldata, gd_common_tssd));
+ printf("#define\tGD_TSS_GDT %#x\n", OS(globaldata, gd_tss_gdt));
#endif
#ifdef USER_LDT
printf("#define\tGD_CURRENTLDT %#x\n", OS(globaldata, gd_currentldt));
diff --git a/sys/i386/i386/globals.s b/sys/i386/i386/globals.s
index 92811d560666..bcc5bda62319 100644
--- a/sys/i386/i386/globals.s
+++ b/sys/i386/i386/globals.s
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: globals.s,v 1.9 1999/02/22 15:13:34 bde Exp $
+ * $Id: globals.s,v 1.10 1999/04/28 01:03:19 luoqi Exp $
*/
#include "opt_vm86.h"
@@ -72,8 +72,9 @@ globaldata:
.set gd_switchticks,globaldata + GD_SWITCHTICKS
#ifdef VM86
- .globl gd_common_tssd
+ .globl gd_common_tssd, gd_tss_gdt
.set gd_common_tssd,globaldata + GD_COMMON_TSSD
+ .set gd_tss_gdt,globaldata + GD_TSS_GDT
#endif
#ifdef USER_LDT
@@ -92,8 +93,9 @@ globaldata:
.set _switchticks,globaldata + GD_SWITCHTICKS
#ifdef VM86
- .globl _common_tssd
+ .globl _common_tssd, _tss_gdt
.set _common_tssd,globaldata + GD_COMMON_TSSD
+ .set _tss_gdt,globaldata + GD_TSS_GDT
#endif
#ifdef USER_LDT
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index c8ca257ed2ed..2dd2ad4230df 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.333 1999/05/06 00:38:41 luoqi Exp $
+ * $Id: machdep.c,v 1.334 1999/05/06 00:54:44 luoqi Exp $
*/
#include "apm.h"
@@ -904,7 +904,7 @@ struct region_descriptor r_gdt, r_idt;
#ifdef VM86
#ifndef SMP
-extern struct segment_descriptor common_tssd;
+extern struct segment_descriptor common_tssd, *tss_gdt;
#endif
int private_tss; /* flag indicating private tss */
#endif /* VM86 */
@@ -1297,7 +1297,8 @@ init386(first)
ltr(gsel_tss);
#ifdef VM86
private_tss = 0;
- common_tssd = gdt[GPROC0_SEL].sd;
+ tss_gdt = &gdt[GPROC0_SEL].sd;
+ common_tssd = *tss_gdt;
#endif
dblfault_tss.tss_esp = dblfault_tss.tss_esp0 = dblfault_tss.tss_esp1 =
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index 4c8c946597d6..ad9e6c6bd892 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.99 1999/04/30 22:09:40 msmith Exp $
+ * $Id: mp_machdep.c,v 1.100 1999/05/08 17:48:22 peter Exp $
*/
#include "opt_smp.h"
@@ -483,7 +483,8 @@ init_secondary(void)
common_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL);
common_tss.tss_ioopt = (sizeof common_tss) << 16;
#ifdef VM86
- common_tssd = gdt[myid * NGDT + GPROC0_SEL].sd;
+ tss_gdt = &gdt[myid * NGDT + GPROC0_SEL].sd;
+ common_tssd = *tss_gdt;
#endif
ltr(gsel_tss);
diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c
index 4c8c946597d6..ad9e6c6bd892 100644
--- a/sys/i386/i386/mptable.c
+++ b/sys/i386/i386/mptable.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.99 1999/04/30 22:09:40 msmith Exp $
+ * $Id: mp_machdep.c,v 1.100 1999/05/08 17:48:22 peter Exp $
*/
#include "opt_smp.h"
@@ -483,7 +483,8 @@ init_secondary(void)
common_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL);
common_tss.tss_ioopt = (sizeof common_tss) << 16;
#ifdef VM86
- common_tssd = gdt[myid * NGDT + GPROC0_SEL].sd;
+ tss_gdt = &gdt[myid * NGDT + GPROC0_SEL].sd;
+ common_tssd = *tss_gdt;
#endif
ltr(gsel_tss);
diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s
index f86a29d6353e..f3d767144c17 100644
--- a/sys/i386/i386/swtch.s
+++ b/sys/i386/i386/swtch.s
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: swtch.s,v 1.79 1999/04/28 01:03:25 luoqi Exp $
+ * $Id: swtch.s,v 1.80 1999/05/06 09:44:49 bde Exp $
*/
#include "npx.h"
@@ -282,17 +282,16 @@ _idle:
btrl %esi, _private_tss
jae 1f
- movl $GPROC0_SEL, %esi
movl $gd_common_tssd, %edi
addl %fs:0, %edi
/* move correct tss descriptor into GDT slot, then reload tr */
- leal _gdt(,%esi,8), %ebx /* entry in GDT */
+ movl _tss_gdt, %ebx /* entry in GDT */
movl 0(%edi), %eax
movl %eax, 0(%ebx)
movl 4(%edi), %eax
movl %eax, 4(%ebx)
- shll $3, %esi /* GSEL(entry, SEL_KPL) */
+ movl $GPROC0_SEL*8, %esi /* GSEL(entry, SEL_KPL) */
ltr %si
1:
#endif /* VM86 */
@@ -403,16 +402,15 @@ idle_loop:
btrl %esi, _private_tss
jae 1f
- movl $GPROC0_SEL, %esi
movl $_common_tssd, %edi
/* move correct tss descriptor into GDT slot, then reload tr */
- leal _gdt(,%esi,8), %ebx /* entry in GDT */
+ movl _tss_gdt, %ebx /* entry in GDT */
movl 0(%edi), %eax
movl %eax, 0(%ebx)
movl 4(%edi), %eax
movl %eax, 4(%ebx)
- shll $3, %esi /* GSEL(entry, SEL_KPL) */
+ movl $GPROC0_SEL*8, %esi /* GSEL(entry, SEL_KPL) */
ltr %si
1:
#endif /* VM86 */
@@ -665,14 +663,13 @@ swtch_com:
movl $_common_tssd, %edi
#endif
2:
- movl $GPROC0_SEL, %esi
/* move correct tss descriptor into GDT slot, then reload tr */
- leal _gdt(,%esi,8), %ebx /* entry in GDT */
+ movl _tss_gdt, %ebx /* entry in GDT */
movl 0(%edi), %eax
movl %eax, 0(%ebx)
movl 4(%edi), %eax
movl %eax, 4(%ebx)
- shll $3, %esi /* GSEL(entry, SEL_KPL) */
+ movl $GPROC0_SEL*8, %esi /* GSEL(entry, SEL_KPL) */
ltr %si
3:
#endif /* VM86 */
diff --git a/sys/i386/i386/vm86.c b/sys/i386/i386/vm86.c
index 96e4bf2f504a..c62a84c22754 100644
--- a/sys/i386/i386/vm86.c
+++ b/sys/i386/i386/vm86.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vm86.c,v 1.23 1999/03/18 18:43:03 jlemon Exp $
+ * $Id: vm86.c,v 1.24 1999/04/28 01:03:27 luoqi Exp $
*/
#include "opt_vm86.h"
@@ -49,9 +49,6 @@
#include <machine/specialreg.h>
extern int i386_extend_pcb __P((struct proc *));
-#ifndef SMP
-extern struct segment_descriptor common_tssd;
-#endif
extern int vm86paddr, vm86pa;
extern struct pcb *vm86pcb;
diff --git a/sys/i386/i386/vm86bios.s b/sys/i386/i386/vm86bios.s
index 59accf717bef..6916c58cb80b 100644
--- a/sys/i386/i386/vm86bios.s
+++ b/sys/i386/i386/vm86bios.s
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vm86bios.s,v 1.11 1999/05/11 16:04:40 luoqi Exp $
+ * $Id: vm86bios.s,v 1.12 1999/05/12 21:30:51 luoqi Exp $
*/
#include "opt_vm86.h"
@@ -98,8 +98,7 @@ ENTRY(vm86_bioscall)
pushl %eax /* save curpcb */
movl %edx,_curpcb /* set curpcb to vm86pcb */
- movl $GPROC0_SEL,%esi
- leal _gdt(,%esi,8),%ebx /* entry in GDT */
+ movl _tss_gdt,%ebx /* entry in GDT */
movl 0(%ebx),%eax
movl %eax,SCR_TSS0(%edx) /* save first word */
movl 4(%ebx),%eax
@@ -111,7 +110,7 @@ ENTRY(vm86_bioscall)
movl %eax,0(%ebx)
movl 4(%edi),%eax
movl %eax,4(%ebx)
- shll $3,%esi /* GSEL(entry, SEL_KPL) */
+ movl $GPROC0_SEL*8,%esi /* GSEL(entry, SEL_KPL) */
ltr %si
movl %cr3,%eax
@@ -176,13 +175,12 @@ ENTRY(vm86_biosret)
movl $0,_in_vm86call /* reset trapflag */
- movl $GPROC0_SEL,%esi
- leal _gdt(,%esi,8),%ebx /* entry in GDT */
+ movl _tss_gdt,%ebx /* entry in GDT */
movl SCR_TSS0(%edx),%eax
movl %eax,0(%ebx) /* restore first word */
movl SCR_TSS1(%edx),%eax
movl %eax,4(%ebx) /* restore second word */
- shll $3,%esi /* GSEL(entry, SEL_KPL) */
+ movl $GPROC0_SEL*8,%esi /* GSEL(entry, SEL_KPL) */
ltr %si
popl _curpcb /* restore curpcb/curproc */
diff --git a/sys/i386/include/asnames.h b/sys/i386/include/asnames.h
index 6f79186254aa..aeca73987fea 100644
--- a/sys/i386/include/asnames.h
+++ b/sys/i386/include/asnames.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: asnames.h,v 1.33 1999/05/06 09:44:52 bde Exp $
+ * $Id: asnames.h,v 1.34 1999/05/09 19:01:47 peter Exp $
*/
#ifndef _MACHINE_ASNAMES_H_
@@ -400,6 +400,7 @@
#define _ss_eflags FS(ss_eflags)
#define _switchticks FS(switchticks)
#define _switchtime FS(switchtime)
+#define _tss_gdt FS(tss_gdt)
#define _idlestack FS(idlestack)
#define _idlestack_top FS(idlestack_top)
diff --git a/sys/i386/include/globaldata.h b/sys/i386/include/globaldata.h
index f1d4fdd0ffa1..456c502f6369 100644
--- a/sys/i386/include/globaldata.h
+++ b/sys/i386/include/globaldata.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: globaldata.h,v 1.7 1999/02/22 15:13:34 bde Exp $
+ * $Id: globaldata.h,v 1.8 1999/04/28 01:04:00 luoqi Exp $
*/
/*
@@ -48,6 +48,7 @@ struct globaldata {
int gd_switchticks;
#ifdef VM86
struct segment_descriptor gd_common_tssd;
+ struct segment_descriptor *gd_tss_gdt;
#endif
#ifdef USER_LDT
int gd_currentldt;
diff --git a/sys/i386/include/globals.h b/sys/i386/include/globals.h
index 5a770f16f078..f502dfd6306d 100644
--- a/sys/i386/include/globals.h
+++ b/sys/i386/include/globals.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: globals.h,v 1.1 1999/04/28 01:04:01 luoqi Exp $
*/
#ifndef _MACHINE_GLOBALS_H_
@@ -90,6 +90,7 @@
#ifdef VM86
#define common_tssd GLOBAL_LVALUE(common_tssd, struct segment_descriptor)
+#define tss_gdt GLOBAL_LVALUE(tss_gdt, struct segment_descriptor *)
#endif
#ifdef USER_LDT
@@ -120,6 +121,7 @@ GLOBAL_FUNC(switchticks)
#ifdef VM86
GLOBAL_FUNC(common_tssd)
+GLOBAL_FUNC(tss_gdt)
#endif
#ifdef USER_LDT
diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h
index 4c8c946597d6..ad9e6c6bd892 100644
--- a/sys/i386/include/mptable.h
+++ b/sys/i386/include/mptable.h
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.99 1999/04/30 22:09:40 msmith Exp $
+ * $Id: mp_machdep.c,v 1.100 1999/05/08 17:48:22 peter Exp $
*/
#include "opt_smp.h"
@@ -483,7 +483,8 @@ init_secondary(void)
common_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL);
common_tss.tss_ioopt = (sizeof common_tss) << 16;
#ifdef VM86
- common_tssd = gdt[myid * NGDT + GPROC0_SEL].sd;
+ tss_gdt = &gdt[myid * NGDT + GPROC0_SEL].sd;
+ common_tssd = *tss_gdt;
#endif
ltr(gsel_tss);
diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h
index f1d4fdd0ffa1..456c502f6369 100644
--- a/sys/i386/include/pcpu.h
+++ b/sys/i386/include/pcpu.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: globaldata.h,v 1.7 1999/02/22 15:13:34 bde Exp $
+ * $Id: globaldata.h,v 1.8 1999/04/28 01:04:00 luoqi Exp $
*/
/*
@@ -48,6 +48,7 @@ struct globaldata {
int gd_switchticks;
#ifdef VM86
struct segment_descriptor gd_common_tssd;
+ struct segment_descriptor *gd_tss_gdt;
#endif
#ifdef USER_LDT
int gd_currentldt;
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
index 4c8c946597d6..ad9e6c6bd892 100644
--- a/sys/kern/subr_smp.c
+++ b/sys/kern/subr_smp.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.99 1999/04/30 22:09:40 msmith Exp $
+ * $Id: mp_machdep.c,v 1.100 1999/05/08 17:48:22 peter Exp $
*/
#include "opt_smp.h"
@@ -483,7 +483,8 @@ init_secondary(void)
common_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL);
common_tss.tss_ioopt = (sizeof common_tss) << 16;
#ifdef VM86
- common_tssd = gdt[myid * NGDT + GPROC0_SEL].sd;
+ tss_gdt = &gdt[myid * NGDT + GPROC0_SEL].sd;
+ common_tssd = *tss_gdt;
#endif
ltr(gsel_tss);
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c
index 4befffd92798..3effcf966fd2 100644
--- a/sys/pc98/i386/machdep.c
+++ b/sys/pc98/i386/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.115 1999/05/06 00:39:00 luoqi Exp $
+ * $Id: machdep.c,v 1.116 1999/05/06 00:54:54 luoqi Exp $
*/
#include "apm.h"
@@ -917,7 +917,7 @@ struct region_descriptor r_gdt, r_idt;
#ifdef VM86
#ifndef SMP
-extern struct segment_descriptor common_tssd;
+extern struct segment_descriptor common_tssd, *tss_gdt;
#endif
int private_tss; /* flag indicating private tss */
#endif /* VM86 */
@@ -1317,7 +1317,8 @@ init386(first)
ltr(gsel_tss);
#ifdef VM86
private_tss = 0;
- common_tssd = gdt[GPROC0_SEL].sd;
+ tss_gdt = &gdt[GPROC0_SEL].sd;
+ common_tssd = *tss_gdt;
#endif
dblfault_tss.tss_esp = dblfault_tss.tss_esp0 = dblfault_tss.tss_esp1 =
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index 4befffd92798..3effcf966fd2 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.115 1999/05/06 00:39:00 luoqi Exp $
+ * $Id: machdep.c,v 1.116 1999/05/06 00:54:54 luoqi Exp $
*/
#include "apm.h"
@@ -917,7 +917,7 @@ struct region_descriptor r_gdt, r_idt;
#ifdef VM86
#ifndef SMP
-extern struct segment_descriptor common_tssd;
+extern struct segment_descriptor common_tssd, *tss_gdt;
#endif
int private_tss; /* flag indicating private tss */
#endif /* VM86 */
@@ -1317,7 +1317,8 @@ init386(first)
ltr(gsel_tss);
#ifdef VM86
private_tss = 0;
- common_tssd = gdt[GPROC0_SEL].sd;
+ tss_gdt = &gdt[GPROC0_SEL].sd;
+ common_tssd = *tss_gdt;
#endif
dblfault_tss.tss_esp = dblfault_tss.tss_esp0 = dblfault_tss.tss_esp1 =