diff options
| author | Ada Christine <adachristine18@gmail.com> | 2026-05-26 21:32:27 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2026-05-26 21:32:27 +0000 |
| commit | a10aabfcd52f702057316018cd7847ab2bfe4aa1 (patch) | |
| tree | cc4652d2b602798934e8a48b4939cfb20eda1989 /api/bits | |
| parent | 90c29fdde317c39384011a6ba97077c138f13ad6 (diff) | |
we're bringing kjarna back and not doing the crazy stuff with trying to have task management during efi. that was a bit extra.kjarna
Diffstat (limited to 'api/bits')
| -rw-r--r-- | api/bits/x86_64/descriptor.h | 30 | ||||
| -rw-r--r-- | api/bits/x86_64/msr.h | 20 |
2 files changed, 45 insertions, 5 deletions
diff --git a/api/bits/x86_64/descriptor.h b/api/bits/x86_64/descriptor.h index c0c00f6..c55a493 100644 --- a/api/bits/x86_64/descriptor.h +++ b/api/bits/x86_64/descriptor.h @@ -1,3 +1,5 @@ +#pragma once + #include <stdint.h> struct descriptor_table_register_long @@ -16,3 +18,31 @@ struct segment_descriptor uint8_t base24; } __attribute__((packed, aligned(8))); +struct system_segment_descrptor_long +{ + struct segment_descriptor segment; + uint32_t base32; + uint32_t r0; +} __attribute__((packed, aligned(8))); + +struct gate_descriptor +{ + uint16_t offset0; + uint16_t selector; + uint8_t ist; + uint8_t access; + uint16_t offset16; + uint64_t offset32; +} __attribute__((packed, aligned(8))); + +struct task_state_segment_long +{ + uint32_t r0; + uint64_t rsp[3]; + uint64_t r1; + uint64_t ist[7]; + uint64_t r2; + uint16_t r3; + uint16_t iomap_base; +} __attribute__((packed, aligned(8))); + diff --git a/api/bits/x86_64/msr.h b/api/bits/x86_64/msr.h index a25af7d..95486cc 100644 --- a/api/bits/x86_64/msr.h +++ b/api/bits/x86_64/msr.h @@ -1,13 +1,13 @@ +#pragma once + #include <stdint.h> #define MSR_INDEX_EFER 0xc0000080 #define MSR_INDEX_STAR 0xc0000081 #define MSR_INDEX_LSTAR 0xc0000082 - -union msr_efer -{ - uint64_t value; -}; +#define MSR_INDEX_SFMASK 0xc0000084 +#define MSR_INDEX_KERNELGSBASE 0xc0000102 +#define MSR_EFER_SCE 1 union msr_star { @@ -27,3 +27,13 @@ union msr_lstar uint64_t value; }; +union msr_sfmask +{ + struct + { + uint32_t mask; + uint32_t reserved; + }; + uint64_t value; +}; + |
