12#include <sys/kassert.h>
13#include <sys/kdebug.h>
16#include <sys/spinlock.h>
19#include <machine/amd64.h>
20#include <machine/pmap.h>
23#define FREEPAGE_MAGIC_FREE 0x4652454550414745ULL
25#define FREEPAGE_MAGIC_INUSE 0x414c4c4f43415445ULL
77 Panic(
"Cannot back pageInfoTable!");
98 Panic(
"Region start is not page aligned!");
100 Panic(
"Region length is not page aligned!");
144 Panic(
"Cannot allocate XMem region!");
155 pg = (
void *)(start + i);
int kprintf(const char *fmt,...)
#define REGISTER_DBGCMD(_NAME, _DESC, _FUNC)
void PAlloc_Retain(void *pg)
void PAlloc_Release(void *pg)
#define FREEPAGE_MAGIC_FREE
void * PAlloc_AllocPage()
static void PAllocFreePage(void *region)
static PageInfo * PAllocGetInfo(void *pg)
#define FREEPAGE_MAGIC_INUSE
void PAlloc_AddRegion(uintptr_t start, uintptr_t len)
static void Debug_PAllocDump(int argc, const char *argv[])
static void Debug_PAllocStats(int argc, const char *argv[])
#define LIST_REMOVE(elm, field)
#define LIST_FOREACH(var, head, field)
#define LIST_INSERT_HEAD(head, elm, field)
#define LIST_HEAD(name, type)
void Spinlock_Unlock(Spinlock *lock) __UNLOCK_EX(*lock)
#define SPINLOCK_TYPE_NORMAL
void Spinlock_Lock(Spinlock *lock) __LOCK_EX(*lock)
void Spinlock_Init(Spinlock *lock, const char *name, uint64_t type)
void * memset(void *dst, int c, size_t len)
void * memcpy(void *dst, const void *src, size_t len)
void Panic(const char *str)
bool XMem_Allocate(XMem *xmem, uintptr_t length)
uintptr_t XMem_GetBase(XMem *xmem)