summaryrefslogtreecommitdiffstats
path: root/include/arch/x86_64/processor.h
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2025-08-17 14:16:55 -0400
committerJon Santmyer <jon@jonsantmyer.com>2025-08-17 14:16:55 -0400
commit7ee9347560768641096df68c545ac085a20233e4 (patch)
tree5b567f2e98cd9e6aeee33eeecd7fbf6f2fafdeab /include/arch/x86_64/processor.h
parentf466364b8a3858e7b3f19258d142851cb4a7e6d6 (diff)
downloadjove-kernel-7ee9347560768641096df68c545ac085a20233e4.tar.gz
jove-kernel-7ee9347560768641096df68c545ac085a20233e4.tar.bz2
jove-kernel-7ee9347560768641096df68c545ac085a20233e4.zip
working usermode pager. fix usermode interrupts
Diffstat (limited to 'include/arch/x86_64/processor.h')
-rw-r--r--include/arch/x86_64/processor.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/include/arch/x86_64/processor.h b/include/arch/x86_64/processor.h
index f8a93ce..1afa6cc 100644
--- a/include/arch/x86_64/processor.h
+++ b/include/arch/x86_64/processor.h
@@ -18,13 +18,22 @@
typedef struct jove_TSS
{
uint32_t resv0;
- uint64_t rsp[3];
- uint32_t resv1;
- uint64_t ist[8];
- uint32_t resv2[2];
- uint16_t resv3;
+ uint64_t rsp0;
+ uint64_t rsp1;
+ uint64_t rsp2;
+ uint64_t resv1;
+ uint64_t resv2;
+ uint64_t ist1;
+ uint64_t ist2;
+ uint64_t ist3;
+ uint64_t ist4;
+ uint64_t ist5;
+ uint64_t ist6;
+ uint64_t ist7;
+ uint64_t resv3;
+ uint16_t resv4;
uint16_t iopb;
-} tss_t;
+} __attribute__((packed)) tss_t;
enum
{
@@ -39,6 +48,12 @@ enum
GDT_ENTRY_COUNT
};
+#define GDT_OFFSET_KERNEL_CODE (GDT_ENTRY_KERNEL_CODE * sizeof(segment_descriptor_t))
+#define GDT_OFFSET_KERNEL_DATA (GDT_ENTRY_KERNEL_DATA * sizeof(segment_descriptor_t))
+#define GDT_OFFSET_USER_DATA (GDT_ENTRY_USER_DATA * sizeof(segment_descriptor_t))
+#define GDT_OFFSET_USER_CODE (GDT_ENTRY_USER_CODE * sizeof(segment_descriptor_t))
+#define GDT_OFFSET_TSS (GDT_ENTRY_TSS_LOW * sizeof(segment_descriptor_t))
+
typedef struct jove_Processor
{
physptr_t pdir;