20#include "pedigree/kernel/debugger/commands/MappingCommand.h"
21#include "pedigree/kernel/processor/PhysicalMemoryManager.h"
22#include "pedigree/kernel/processor/Processor.h"
23#include "pedigree/kernel/processor/ProcessorInformation.h"
24#include "pedigree/kernel/processor/VirtualAddressSpace.h"
25#include "pedigree/kernel/processor/types.h"
38 uintptr_t address = 0;
39 if (!(input ==
"mapping"))
42 address = input.intValue();
47 output =
"Not a valid address: `";
53 output =
"Usage: mapping <effective address>";
62 void* vAddr =
reinterpret_cast<void*
>(address);
65 output.append(address, 16);
70 physical_uintptr_t phys;
72 output +=
" Mapped to ";
73 output.append(phys, 16);
75 output.append(flags, 16);
76 output +=
") in this address space.\n";
78 output +=
" Not mapped in this address space.\n";
82 physical_uintptr_t phys;
84 output +=
" Mapped to ";
85 output.append(phys, 16);
87 output.append(flags, 16);
88 output +=
") in the kernel address space.\n";
90 output +=
" Not mapped in the kernel address space.\n";
bool execute(const HugeStaticString &input, HugeStaticString &output, InterruptState &state, DebuggerIO *screen)
void autocomplete(const HugeStaticString &input, HugeStaticString &output)
static constexpr size_t getPageSize() PURE
static ProcessorInformation & information()
virtual bool isMapped(void *virtualAddress)=0
virtual bool getMapping(void *virtualAddress, physical_uintptr_t &physicalAddress, size_t &flags)=0
static EXPORTED_PUBLIC VirtualAddressSpace & getKernelAddressSpace()