PatchworkOS
Loading...
Searching...
No Matches
tss.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <kernel/defs.h>
6#include <stdint.h>
7
36
40#define TSS_IST_EXCEPTION TSS_IST1
41
45#define TSS_IST_DOUBLE_FAULT TSS_IST2
46
50#define TSS_IST_INTERRUPT TSS_IST3
51
99
105extern void tss_load(void);
106
112void tss_init(tss_t* tss);
113
122
void tss_ist_load(tss_t *tss, tss_ist_t ist, stack_pointer_t *stack)
Load a stack into an IST entry.
Definition tss.c:21
void tss_init(tss_t *tss)
Initialize a TSS structure.
Definition tss.c:5
tss_ist_t
Interrupt Stack Table indices.
Definition tss.h:25
void tss_load(void)
Load the TSS.
@ TSS_IST_COUNT
Definition tss.h:34
@ TSS_IST7
Definition tss.h:33
@ TSS_IST3
Definition tss.h:29
@ TSS_IST2
Definition tss.h:28
@ TSS_IST5
Definition tss.h:31
@ TSS_IST_NONE
Definition tss.h:26
@ TSS_IST6
Definition tss.h:32
@ TSS_IST1
Definition tss.h:27
@ TSS_IST4
Definition tss.h:30
#define PACKED
GCC packed attribute.
Definition defs.h:32
static pmm_stack_t stack
Definition pmm.c:36
__UINT32_TYPE__ uint32_t
Definition stdint.h:15
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
__UINT16_TYPE__ uint16_t
Definition stdint.h:13
Structure to define a stack in memory.
Task State Segment structure.
Definition tss.h:88
uint32_t reserved1
Definition tss.h:89
uint64_t reserved2
Definition tss.h:93
uint64_t rsp1
Stack pointer to load when switching to ring 1, unused.
Definition tss.h:91
uint16_t iopb
Offset to the I/O permission bitmap, we set this to the size of the TSS to disable the bitmap.
Definition tss.h:97
uint64_t rsp0
Stack pointer to load when switching to ring 0, unused.
Definition tss.h:90
uint64_t reserved3
Definition tss.h:95
uint64_t rsp2
Stack pointer to load when switching to ring 2, unused.
Definition tss.h:92
uint16_t reserved4
Definition tss.h:96