aboutsummaryrefslogtreecommitdiff
path: root/x86_64
diff options
context:
space:
mode:
authorLuca Dariz <luca@orpolo.org>2024-03-09 15:02:42 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-03-09 18:41:55 +0100
commit346a380129e3ac30c1e86089a12ca63eec81e5e7 (patch)
tree7027b6f3fb95e7405642b30062773b7451bd5f30 /x86_64
parent46e5b87263932fe49ec7c6261e0a20b7dbc1bbc0 (diff)
downloadgnumach-346a380129e3ac30c1e86089a12ca63eec81e5e7.tar.gz
gnumach-346a380129e3ac30c1e86089a12ca63eec81e5e7.tar.bz2
gnumach-346a380129e3ac30c1e86089a12ca63eec81e5e7.zip
x86_64: split SET_KERNEL_SEGMENTS() for NCPU > 1
This allows 32on64 to work again. Also, it's a clearer indication of a missing part. Message-ID: <20240309140244.347835-1-luca@orpolo.org>
Diffstat (limited to 'x86_64')
-rw-r--r--x86_64/locore.S10
1 files changed, 7 insertions, 3 deletions
diff --git a/x86_64/locore.S b/x86_64/locore.S
index 806762bb..8f39a677 100644
--- a/x86_64/locore.S
+++ b/x86_64/locore.S
@@ -163,17 +163,21 @@
#define POP_SEGMENTS_ISR(reg)
#endif
+#if NCPUS > 1
+#define SET_KERNEL_SEGMENTS(reg) \
+ ud2 /* TODO: use swapgs or similar */
+#else // NCPUS > 1
#ifdef USER32
#define SET_KERNEL_SEGMENTS(reg) \
mov %ss,reg /* switch to kernel segments */ ;\
mov reg,%ds /* (same as kernel stack segment) */ ;\
mov reg,%es ;\
mov reg,%fs ;\
- mov $(PERCPU_DS),reg ;\
mov reg,%gs
-#else
+#else // USER32
#define SET_KERNEL_SEGMENTS(reg)
-#endif
+#endif // USER32
+#endif // NCPUS > 1
/*
* Fault recovery.