21 #include "pedigree/kernel/processor/Processor.h" 22 #include "pedigree/kernel/processor/VirtualAddressSpace.h" 23 #include "pedigree/kernel/utilities/utility.h" 28 static char g_SafeStack[8192] = {0};
54 NOTICE(
"Setting up TSS segment for CPU #" <<
Dec << i <<
Hex <<
".");
60 ProcessorInformation *processorInfo = *it;
61 processorInfo->setTss(Tss);
62 processorInfo->setTssSelector((i + 5) << 3);
66 processorInfo->setTlsSelector((i + 6) << 3);
76 processorInfo.setTss(Tss);
77 processorInfo.setTssSelector(5 << 3);
78 processorInfo.setTlsSelector(6 << 3);
96 asm volatile(
"lgdt %0" ::
"m"(gdtr));
102 asm volatile(
"jmp $0x8, $.flush; \ 121 #ifdef MULTIPROCESSOR 132 size_t index, uint32_t base, uint32_t limit, uint8_t flags, uint8_t flags2)
153 uint32_t offset : 12;
162 extern uintptr_t interrupt_handler_array[];
168 pTss->ss0 = pTss->ss = 0x10;
169 pTss->esp0 = pTss->esp = pTss->esp1 = pTss->esp2 =
170 reinterpret_cast<uint32_t
>(g_SafeStack) + 8192;
174 pTss->eip =
static_cast<uint32_t
>(interrupt_handler_array[8]);
177 pTss->ds = pTss->es = pTss->fs = pTss->gs = 0x10;
186 NOTICE(
"CR3 1 = " << Processor::readCr3());
188 NOTICE(
"CR3 2 = " << Processor::readCr3());
189 pTss->cr3 = Processor::readCr3();
192 pTss->cr3 = Processor::readCr3();
static X86GdtManager m_Instance
static void initialiseProcessor() INITIALISATION_ONLY
static EXPORTED_PUBLIC VirtualAddressSpace & getKernelAddressSpace()
static ProcessorInformation & information()
static void switchAddressSpace(VirtualAddressSpace &AddressSpace)
void setTssDescriptor(size_t index, uint32_t base) INITIALISATION_ONLY
void setTlsBase(uintptr_t base)
void initialiseTss(struct X86TaskStateSegment *pTss) INITIALISATION_ONLY
void initialise(size_t processorCount) INITIALISATION_ONLY
X86GdtManager() INITIALISATION_ONLY
void initialiseDoubleFaultTss(X86TaskStateSegment *pTss) INITIALISATION_ONLY
static ProcessorInformation m_ProcessorInformation
virtual VirtualAddressSpace * clone(bool copyOnWrite=true)=0
void setSegmentDescriptor(size_t index, uint32_t base, uint32_t limit, uint8_t flags, uint8_t flags2)
segment_descriptor * m_Gdt