summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorian <ian>2023-07-08 00:02:21 +0000
committerian <ian>2023-07-08 00:02:21 +0000
commitc7aa4d882ff6b1eb1e3c19bdfd772057817ff10c (patch)
treec6e7e6a9b82299b6e475dfbf01fdcdfa66d49674 /sys/include
parent5f66cd9e42a92638cd215fe28e9dcf4ff30cb402 (diff)
kernel/amd64: Abstract architecture specifics
git-svn-id: https://svn.vegaa.systems/svn/vega-Vega/trunk@9 a8a8aea2-181d-ee11-89e8-15fd0e089fc4
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/machdep.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/sys/include/sys/machdep.h b/sys/include/sys/machdep.h
index 5f2112c..f98b123 100644
--- a/sys/include/sys/machdep.h
+++ b/sys/include/sys/machdep.h
@@ -39,9 +39,35 @@
#if defined(_KERNEL)
-struct processor {
+/*
+ * Arch specifics go here
+ * along with an #if defined(...)
+ *
+ * XXX: When porting more architectures this
+ * may get messy. Figure out a way to
+ * seperate this into a different header.
+ */
+struct processor_machdep {
+#if defined(__x86_64__)
struct gdtr *gdtr;
struct gdt_entry *gdt;
+#endif /* defined(__x86_64__) */
+};
+
+/*
+ * Sets arch specifics to their
+ * defaults.
+ */
+#if defined(__x86_64__)
+#define DEFAULT_PROCESSOR_MACHDEP \
+ { \
+ .gdtr = &g_early_gdtr, \
+ .gdt = &g_dmmy_gdt[0] \
+ }
+#endif /* defined(__x86_64__) */
+
+struct processor {
+ struct processor_machdep machdep;
};
__weak void processor_init(struct processor *processor);