20 #include "pedigree/kernel/processor/Processor.h" 21 #include "../x86_common/PhysicalMemoryManager.h" 22 #include "InterruptManager.h" 23 #include "VirtualAddressSpace.h" 25 #include "pedigree/kernel/process/initialiseMultitasking.h" 26 #include "pedigree/kernel/processor/IoPortManager.h" 27 #include "pedigree/kernel/processor/NMFaultHandler.h" 28 #include "pedigree/kernel/processor/PageFaultHandler.h" 29 #include <SlabAllocator.h> 32 #if defined(MULTIPROCESSOR) 33 #include "../x86_common/Multiprocessor.h" 41 #define PAT_UCMINUS 0x07 81 processorInformation.setVirtualAddressSpace(AddressSpace);
85 physical_uintptr_t Processor::readCr3()
87 physical_uintptr_t cr3;
88 asm volatile(
"mov %%cr3, %0" :
"=r"(cr3));
127 uint32_t pat_lo, pat_hi;
128 asm volatile(
"rdmsr" :
"=a"(pat_lo),
"=d"(pat_hi) :
"c"(0x277));
131 p.x = pat_lo | (
static_cast<uint64_t
>(pat_hi) << 32ULL);
135 p.s.pa2 = PAT_UCMINUS;
139 p.s.pa6 = PAT_UCMINUS;
141 pat_lo =
static_cast<uint32_t
>(p.x);
142 pat_hi =
static_cast<uint32_t
>(p.x >> 32ULL);
144 asm volatile(
"wrmsr" ::
"a"(pat_lo),
"d"(pat_hi),
"c"(0x277));
152 #if defined(MULTIPROCESSOR) 160 initialiseMultitasking();
166 #if defined(MULTIPROCESSOR) 167 if (m_nProcessors != 1)
174 uint32_t eax, ebx, ecx, edx;
176 cpuid(0, 0, eax, ebx, ecx, edx);
177 MemoryCopy(ident, &ebx, 4);
178 MemoryCopy(&ident[4], &edx, 4);
179 MemoryCopy(&ident[8], &ecx, 4);
191 asm volatile(
"mov %0, %%bx; mov %%bx, %%fs; mov %%bx, %%gs" ::
"r"(newseg)
Bootstrap structure passed to the kernel entry point.
static X86CommonPhysicalMemoryManager & instance()
static void initialiseProcessor() INITIALISATION_ONLY
static void setTlsBase(uintptr_t newBase)
static void initialise2(const BootstrapStruct_t &Info) INITIALISATION_ONLY
second/last stage in the initialisation of the processor-specific interface
static IoPortManager & instance()
static ProcessorInformation & information()
static void switchAddressSpace(VirtualAddressSpace &AddressSpace)
void setTlsBase(uintptr_t base)
Manages hardware I/O port (de)allocations.
static PageFaultHandler & instance()
static size_t initialise1() INITIALISATION_ONLY
void initialise(io_port_t ioPortBase, size_t size) INITIALISATION_ONLY
static void initialise1(const BootstrapStruct_t &Info) INITIALISATION_ONLY
first stage in the initialisation of the processor-specific interface
void initialise(size_t processorCount) INITIALISATION_ONLY
static void initialise2() INITIALISATION_ONLY
static void initialiseProcessor() INITIALISATION_ONLY
static NMFaultHandler & instance()
static void setInterrupts(bool bEnable)
static void identify(HugeStaticString &str)
void initialise(const BootstrapStruct_t &Info) INITIALISATION_ONLY
Implementation of the PhysicalMemoryManager for common x86.
static X86GdtManager & instance()
physical_uintptr_t m_PhysicalPageDirectory