summaryrefslogtreecommitdiffstats
path: root/sys/amd64/isa
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2001-01-06 17:40:04 +0000
committerjake <jake@FreeBSD.org>2001-01-06 17:40:04 +0000
commit56e99b7d35d909eaef84dafc091867116a08e54f (patch)
tree20d39cad65f882504f37dd6b22616271e30bec7b /sys/amd64/isa
parentc269c9fb36040d129558f61fa26bf3745100a4ff (diff)
downloadFreeBSD-src-56e99b7d35d909eaef84dafc091867116a08e54f.zip
FreeBSD-src-56e99b7d35d909eaef84dafc091867116a08e54f.tar.gz
Use %fs to access per-cpu variables in uni-processor kernels the same
as multi-processor kernels. The old way made it difficult for kernel modules to be portable between uni-processor and multi-processor kernels. It is no longer necessary to jump through hoops. - always load %fs with the private segment on entry to the kernel - change the type of the self referntial pointer from struct privatespace to struct globaldata - make the globaldata symbol have value 0 in all cases, so the symbols in globals.s are always offsets, not aliases for fields in globaldata - define the globaldata space used for uniprocessor kernels in C, rather than assembler - change the assmebly language accessors to use %fs, add a macro PCPU_ADDR(member, reg), which loads the register reg with the address of the per-cpu variable member
Diffstat (limited to 'sys/amd64/isa')
-rw-r--r--sys/amd64/isa/atpic_vector.S2
-rw-r--r--sys/amd64/isa/icu_vector.S2
-rw-r--r--sys/amd64/isa/icu_vector.s2
3 files changed, 6 insertions, 0 deletions
diff --git a/sys/amd64/isa/atpic_vector.S b/sys/amd64/isa/atpic_vector.S
index e28c375..635d2ad 100644
--- a/sys/amd64/isa/atpic_vector.S
+++ b/sys/amd64/isa/atpic_vector.S
@@ -58,6 +58,7 @@ IDTVEC(vec_name) ; \
mov $KDSEL,%ax ; \
mov %ax,%ds ; \
mov %ax,%es ; \
+ mov $KPSEL,%ax ; \
mov %ax,%fs ; \
FAKE_MCOUNT((12+ACTUALLY_PUSHED)*4(%esp)) ; \
incb PCPU(INTR_NESTING_LEVEL) ; \
@@ -93,6 +94,7 @@ IDTVEC(vec_name) ; \
mov $KDSEL,%ax ; /* load kernel ds, es and fs */ \
mov %ax,%ds ; \
mov %ax,%es ; \
+ mov $KPSEL,%ax ; \
mov %ax,%fs ; \
maybe_extra_ipending ; \
movb _imen + IRQ_BYTE(irq_num),%al ; \
diff --git a/sys/amd64/isa/icu_vector.S b/sys/amd64/isa/icu_vector.S
index e28c375..635d2ad 100644
--- a/sys/amd64/isa/icu_vector.S
+++ b/sys/amd64/isa/icu_vector.S
@@ -58,6 +58,7 @@ IDTVEC(vec_name) ; \
mov $KDSEL,%ax ; \
mov %ax,%ds ; \
mov %ax,%es ; \
+ mov $KPSEL,%ax ; \
mov %ax,%fs ; \
FAKE_MCOUNT((12+ACTUALLY_PUSHED)*4(%esp)) ; \
incb PCPU(INTR_NESTING_LEVEL) ; \
@@ -93,6 +94,7 @@ IDTVEC(vec_name) ; \
mov $KDSEL,%ax ; /* load kernel ds, es and fs */ \
mov %ax,%ds ; \
mov %ax,%es ; \
+ mov $KPSEL,%ax ; \
mov %ax,%fs ; \
maybe_extra_ipending ; \
movb _imen + IRQ_BYTE(irq_num),%al ; \
diff --git a/sys/amd64/isa/icu_vector.s b/sys/amd64/isa/icu_vector.s
index e28c375..635d2ad 100644
--- a/sys/amd64/isa/icu_vector.s
+++ b/sys/amd64/isa/icu_vector.s
@@ -58,6 +58,7 @@ IDTVEC(vec_name) ; \
mov $KDSEL,%ax ; \
mov %ax,%ds ; \
mov %ax,%es ; \
+ mov $KPSEL,%ax ; \
mov %ax,%fs ; \
FAKE_MCOUNT((12+ACTUALLY_PUSHED)*4(%esp)) ; \
incb PCPU(INTR_NESTING_LEVEL) ; \
@@ -93,6 +94,7 @@ IDTVEC(vec_name) ; \
mov $KDSEL,%ax ; /* load kernel ds, es and fs */ \
mov %ax,%ds ; \
mov %ax,%es ; \
+ mov $KPSEL,%ax ; \
mov %ax,%fs ; \
maybe_extra_ipending ; \
movb _imen + IRQ_BYTE(irq_num),%al ; \
OpenPOWER on IntegriCloud