20#include "pedigree/kernel/Archive.h"
21#include "pedigree/kernel/Log.h"
22#include "pedigree/kernel/panic.h"
23#include "pedigree/kernel/processor/PhysicalMemoryManager.h"
24#include "pedigree/kernel/processor/VirtualAddressSpace.h"
25#include "pedigree/kernel/utilities/StaticString.h"
26#include "pedigree/kernel/utilities/utility.h"
30 if ((
reinterpret_cast<physical_uintptr_t
>(pPhys) &
32 panic(
"Archive: Alignment issues");
39 reinterpret_cast<physical_uintptr_t
>(pPhys)) ==
false) {
40 ERROR(
"Archive: allocateRegion failed.");
56 pFile = getNext(pFile);
64 return str.intValue(8);
72 return reinterpret_cast<uintptr_t*
>(
reinterpret_cast<uintptr_t
>(get(n)) + 512);
77 return reinterpret_cast<ArchiveFile*
>(m_pBase);
86 size_t size = str.intValue(8);
87 size_t nBlocks = (size + 511) / 512;
88 pFile = adjust_pointer(pFile, 512 * (nBlocks + 1));
89 if (pFile->name[0] ==
'\0')
95 ArchiveFile* pFile = getFirst();
96 for (
size_t i = 0; i < n; i++)
97 pFile = getNext(pFile);
Archive(uint8_t *pPhys, size_t sSize)
uintptr_t * getFile(size_t n)
char * getFileName(size_t n)
size_t getFileSize(size_t n)
void * virtualAddress() const
static const size_t continuous
static PhysicalMemoryManager & instance()
static constexpr size_t getPageSize() PURE
static const size_t KernelMode
void EXPORTED_PUBLIC panic(const char *msg) NORETURN