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" 47 uintptr_t address = 0;
48 if (!(input ==
"mapping"))
51 address = input.intValue();
57 output =
"Not a valid address: `";
65 output =
"Usage: mapping <effective address>";
76 void *vAddr =
reinterpret_cast<void *
>(address);
79 output.append(address, 16);
86 output +=
" Mapped to ";
87 output.append(phys, 16);
89 output.append(flags, 16);
90 output +=
") in this address space.\n";
93 output +=
" Not mapped in this address space.\n";
95 #ifdef KERNEL_NEEDS_ADDRESS_SPACE_SWITCH 103 output +=
" Mapped to ";
104 output.append(phys, 16);
105 output +=
" (flags ";
106 output.append(flags, 16);
107 output +=
") in the kernel address space.\n";
110 output +=
" Not mapped in the kernel address space.\n";
112 #ifdef KERNEL_NEEDS_ADDRESS_SPACE_SWITCH static size_t getPageSize() PURE
bool execute(const HugeStaticString &input, HugeStaticString &output, InterruptState &state, DebuggerIO *screen)
virtual void getMapping(void *virtualAddress, physical_uintptr_t &physicalAddress, size_t &flags)=0
virtual bool isMapped(void *virtualAddress)=0
static EXPORTED_PUBLIC VirtualAddressSpace & getKernelAddressSpace()
static ProcessorInformation & information()
static void switchAddressSpace(VirtualAddressSpace &AddressSpace)
void autocomplete(const HugeStaticString &input, HugeStaticString &output)