aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2024-12-09 22:23:10 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-12-09 22:23:10 +0100
commit39c64a75878480ca96b2ed61d89c51c199ade21a (patch)
tree9786ecb65a05866a426b775bfce6bf75ad8f58d9
parentae3597fe2e07bae7dea9cd6278a0fcf7dbb1df7b (diff)
downloadgnumach-39c64a75878480ca96b2ed61d89c51c199ade21a.tar.gz
gnumach-39c64a75878480ca96b2ed61d89c51c199ade21a.tar.bz2
gnumach-39c64a75878480ca96b2ed61d89c51c199ade21a.zip
Comment on the reason for the different CPU_NUMBER versions
-rw-r--r--i386/i386/cpu_number.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/i386/i386/cpu_number.h b/i386/i386/cpu_number.h
index 67c19e9b..547e0498 100644
--- a/i386/i386/cpu_number.h
+++ b/i386/i386/cpu_number.h
@@ -41,12 +41,14 @@
#define CX(addr, reg) addr(,reg,8)
#endif
+/* Slow version, always works */
#define CPU_NUMBER_NO_STACK(reg) \
movl %cs:lapic, reg ;\
movl %cs:APIC_ID(reg), reg ;\
shrl $24, reg ;\
movl %cs:CX(cpu_id_lut, reg), reg ;\
+/* Fast version, requires a stack */
#ifdef __i386__
/* Never call CPU_NUMBER_NO_GS(%esi) */
#define CPU_NUMBER_NO_GS(reg) \
@@ -86,6 +88,7 @@
popq %rsi
#endif
+/* Fastest version, requires gs being set up */
#define CPU_NUMBER(reg) \
movl MY(CPU_ID), reg;