21 #include "pedigree/kernel/Log.h" 22 #include "pedigree/kernel/processor/Processor.h" 23 #include "pedigree/kernel/processor/ProcessorInformation.h" 24 #include "pedigree/kernel/processor/x64/tss.h" 25 #include "pedigree/kernel/stddef.h" 26 #include "pedigree/kernel/utilities/Vector.h" 27 #include "pedigree/kernel/utilities/utility.h" 30 #define SAFE_STACK_SIZE 8192 31 static char g_SafeStack[SAFE_STACK_SIZE] = {0};
61 NOTICE(
"Setting up TSS segment for CPU #" <<
Dec << i <<
Hex <<
".");
67 ProcessorInformation *processorInfo = *it;
68 processorInfo->setTss(Tss);
69 processorInfo->setTssSelector((i + 7) << 3);
70 processorInfo->setTlsSelector((i + 8) << 3);
79 processorInfo.setTss(Tss);
80 processorInfo.setTssSelector(7 << 3);
81 processorInfo.setTlsSelector(8 << 3);
96 asm volatile(
"lgdt %0" ::
"m"(gdtr));
110 size_t index, uint64_t base, uint32_t limit, uint8_t flags, uint8_t flags2)
124 Tss->
base3 = (base >> 32) & 0xFFFFFFFF;
131 pTss->ist[1] =
reinterpret_cast<uint64_t
>(g_SafeStack) + SAFE_STACK_SIZE;
void initialiseTss(X64TaskStateSegment *pTss) INITIALISATION_ONLY
void setSegmentDescriptor(size_t index, uint64_t base, uint32_t limit, uint8_t flags, uint8_t flags2)
void initialise(size_t processorCount) INITIALISATION_ONLY
X64GdtManager() INITIALISATION_ONLY
static ProcessorInformation & information()
static X64GdtManager m_Instance
void setTssDescriptor(size_t index, uint64_t base) INITIALISATION_ONLY
static void loadSegmentRegisters()
static ProcessorInformation m_ProcessorInformation
static void initialiseProcessor() INITIALISATION_ONLY
segment_descriptor * m_Gdt