summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/asmacros.h
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/include/asmacros.h
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/include/asmacros.h')
-rw-r--r--sys/amd64/include/asmacros.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/amd64/include/asmacros.h b/sys/amd64/include/asmacros.h
index c2d89b8..0931404 100644
--- a/sys/amd64/include/asmacros.h
+++ b/sys/amd64/include/asmacros.h
@@ -69,10 +69,10 @@
#define NON_GPROF_ENTRY(name) GEN_ENTRY(name)
#define NON_GPROF_RET .byte 0xc3 /* opcode for `ret' */
-#ifdef SMP
+#ifdef LOCORE
#define PCPU(member) %fs:GD_ ## member
-#else
-#define PCPU(member) CNAME(globaldata) + GD_ ## member
+#define PCPU_ADDR(member, reg) movl %fs:GD_PRVSPACE,reg; \
+ addl $GD_ ## member,reg
#endif
#ifdef GPROF
OpenPOWER on IntegriCloud