summaryrefslogtreecommitdiffstats
path: root/sys/i386/apm
diff options
context:
space:
mode:
authorluoqi <luoqi@FreeBSD.org>1999-05-06 01:07:03 +0000
committerluoqi <luoqi@FreeBSD.org>1999-05-06 01:07:03 +0000
commitf9fddff55a23a710ca8bc2013b1f87e6f278e8bb (patch)
tree8b24a88c5501cb99b7b387d7ea165bfbf04f1f37 /sys/i386/apm
parent0d146f2c923a9670917ec2219554abe1a94cd314 (diff)
downloadFreeBSD-src-f9fddff55a23a710ca8bc2013b1f87e6f278e8bb.zip
FreeBSD-src-f9fddff55a23a710ca8bc2013b1f87e6f278e8bb.tar.gz
Now that each cpu has its own gdt table, we need to setup apm gdt entries in
all the tables.
Diffstat (limited to 'sys/i386/apm')
-rw-r--r--sys/i386/apm/apm.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c
index d97b51b..25bef84 100644
--- a/sys/i386/apm/apm.c
+++ b/sys/i386/apm/apm.c
@@ -15,11 +15,12 @@
*
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*
- * $Id: apm.c,v 1.79 1999/04/18 15:10:58 dfr Exp $
+ * $Id: apm.c,v 1.80 1999/04/21 07:57:55 imp Exp $
*/
#include "opt_devfs.h"
#include "opt_vm86.h"
+#include "opt_smp.h"
#include <sys/param.h>
#include <sys/conf.h>
@@ -45,6 +46,10 @@
#include <machine/vm86.h>
#endif
+#ifdef SMP
+#include <machine/smp.h>
+#endif
+
static int apm_display __P((int newstate));
static int apm_int __P((u_long *eax, u_long *ebx, u_long *ecx, u_long *edx));
static void apm_resume __P((void));
@@ -92,6 +97,10 @@ static struct cdevsw apm_cdevsw =
static void
setup_apm_gdt(u_int code32_base, u_int code16_base, u_int data_base, u_int code32_limit, u_int code16_limit, u_int data_limit)
{
+#ifdef SMP
+ int x;
+#endif
+
/* setup 32bit code segment */
gdt_segs[GAPMCODE32_SEL].ssd_base = code32_base;
gdt_segs[GAPMCODE32_SEL].ssd_limit = code32_limit;
@@ -108,6 +117,14 @@ setup_apm_gdt(u_int code32_base, u_int code16_base, u_int data_base, u_int code3
ssdtosd(gdt_segs + GAPMCODE32_SEL, &gdt[GAPMCODE32_SEL].sd);
ssdtosd(gdt_segs + GAPMCODE16_SEL, &gdt[GAPMCODE16_SEL].sd);
ssdtosd(gdt_segs + GAPMDATA_SEL , &gdt[GAPMDATA_SEL ].sd);
+
+#ifdef SMP
+ for (x = 1; x < NCPU; x++) {
+ gdt[x * NGDT + GAPMCODE32_SEL].sd = gdt[GAPMCODE32_SEL].sd;
+ gdt[x * NGDT + GAPMCODE16_SEL].sd = gdt[GAPMCODE16_SEL].sd;
+ gdt[x * NGDT + GAPMDATA_SEL ].sd = gdt[GAPMDATA_SEL ].sd;
+ }
+#endif
}
/* 48bit far pointer. Do not staticize - used from apm_setup.s */
OpenPOWER on IntegriCloud