20 #include "pedigree/kernel/process/InfoBlock.h" 21 #include "pedigree/kernel/Log.h" 22 #include "pedigree/kernel/Version.h" 23 #include "pedigree/kernel/compiler.h" 24 #include "pedigree/kernel/machine/Machine.h" 25 #include "pedigree/kernel/machine/Timer.h" 26 #include "pedigree/kernel/machine/TimerHandler.h" 27 #include "pedigree/kernel/processor/PhysicalMemoryManager.h" 28 #include "pedigree/kernel/processor/VirtualAddressSpace.h" 29 #include "pedigree/kernel/processor/state_forward.h" 30 #include "pedigree/kernel/processor/types.h" 31 #include "pedigree/kernel/time/Time.h" 32 #include "pedigree/kernel/utilities/utility.h" 34 InfoBlockManager InfoBlockManager::m_Instance;
36 InfoBlockManager::InfoBlockManager()
41 InfoBlockManager::~InfoBlockManager()
43 Machine::instance().
getTimer()->unregisterHandler(
this);
46 InfoBlockManager &InfoBlockManager::instance()
51 bool InfoBlockManager::initialise()
60 "InfoBlockManager: Setting up global info block at " <<
Hex 65 va.
map(page, infoBlock, 0);
69 reinterpret_cast<InfoBlock *
>(adjust_pointer(infoBlock, 0x1000));
75 ByteSet(m_pInfoBlock, 0,
sizeof(
InfoBlock));
76 StringCopy(m_pInfoBlock->sysname,
"Pedigree");
77 StringCopy(m_pInfoBlock->release,
"Foster");
78 StringCopy(m_pInfoBlock->version, g_pBuildRevision);
80 StringCopy(m_pInfoBlock->machine, g_pBuildTarget);
83 m_bInitialised =
true;
84 return Machine::instance().
getTimer()->registerHandler(
this);
87 void InfoBlockManager::timer(uint64_t, InterruptState &)
90 m_pInfoBlock->now = Time::getTimeNanoseconds();
91 m_pInfoBlock->now_s = Time::getTime();
94 void InfoBlockManager::setPid(
size_t value)
96 if (
LIKELY(m_bInitialised))
97 m_pInfoBlock->pid = value;
static PhysicalMemoryManager & instance()
virtual Timer * getTimer()=0
virtual physical_uintptr_t allocatePage(size_t pageConstraints=0)=0
virtual bool map(physical_uintptr_t physicalAddress, void *virtualAddress, size_t flags)=0
static EXPORTED_PUBLIC VirtualAddressSpace & getKernelAddressSpace()
static const size_t Write
static const size_t KernelMode
virtual uintptr_t getGlobalInfoBlock() const