aboutsummaryrefslogtreecommitdiff
path: root/sys/include/arch/amd64/tss.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2023-12-13 12:47:10 -0500
committerIan Moffett <ian@osmora.org>2023-12-13 12:47:10 -0500
commite4988a569cdbbbdc70187e80309d496e46225b73 (patch)
treef2d476aa0e1263b722d4f88c34eac32f82fe1385 /sys/include/arch/amd64/tss.h
parent9eb956111bed4f414345f936af83395044f719b0 (diff)
kernel/amd64: tss: Add TSS stack helpers
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/arch/amd64/tss.h')
-rw-r--r--sys/include/arch/amd64/tss.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/include/arch/amd64/tss.h b/sys/include/arch/amd64/tss.h
index 90f6289..bca572e 100644
--- a/sys/include/arch/amd64/tss.h
+++ b/sys/include/arch/amd64/tss.h
@@ -100,6 +100,20 @@ struct __packed tss_desc {
uint32_t reserved;
};
+/*
+ * Holds the address of the address pointing
+ * to the top of an interrupt stack.
+ */
+union tss_stack {
+ struct {
+ uint32_t top_lo;
+ uint32_t top_hi;
+ };
+ uint64_t top;
+};
+
+int tss_alloc_stack(union tss_stack *entry_out, size_t size);
+int tss_update_ist(struct cpu_info *ci, union tss_stack stack, uint8_t istno);
void write_tss(struct cpu_info *cpu, struct tss_desc *desc);
void tss_load(void); /* In tss.S */