kern: implement memory debug
This commit is contained in:
@@ -271,6 +271,12 @@ namespace ams::kern::arch::arm64 {
|
||||
|
||||
size_t GetNormalMemorySize() const { return this->page_table.GetNormalMemorySize(); }
|
||||
|
||||
size_t GetCodeSize() const { return this->page_table.GetCodeSize(); }
|
||||
size_t GetCodeDataSize() const { return this->page_table.GetCodeDataSize(); }
|
||||
|
||||
size_t GetAliasCodeSize() const { return this->page_table.GetAliasCodeSize(); }
|
||||
size_t GetAliasCodeDataSize() const { return this->page_table.GetAliasCodeDataSize(); }
|
||||
|
||||
u32 GetAllocateOption() const { return this->page_table.GetAllocateOption(); }
|
||||
|
||||
KPhysicalAddress GetHeapPhysicalAddress(KVirtualAddress address) const {
|
||||
|
||||
@@ -63,6 +63,14 @@ namespace ams::kern::arch::arm64 {
|
||||
|
||||
constexpr u64 GetIdentityMapTtbr0(s32 core_id) const { return this->ttbr0_identity[core_id]; }
|
||||
|
||||
void DumpMemoryBlocks() const {
|
||||
return this->page_table.DumpMemoryBlocks();
|
||||
}
|
||||
|
||||
void DumpPageTable() const {
|
||||
return this->page_table.DumpPageTable();
|
||||
}
|
||||
|
||||
size_t CountPageTables() const {
|
||||
return this->page_table.CountPageTables();
|
||||
}
|
||||
|
||||
@@ -30,6 +30,10 @@ namespace ams::kern::KDumpObject {
|
||||
void DumpHandle();
|
||||
void DumpHandle(u64 process_id);
|
||||
|
||||
void DumpKernelMemory();
|
||||
void DumpMemory();
|
||||
void DumpMemory(u64 process_id);
|
||||
|
||||
void DumpProcess();
|
||||
void DumpProcess(u64 process_id);
|
||||
|
||||
|
||||
@@ -301,6 +301,8 @@ namespace ams::kern {
|
||||
Result SetupForIpcClient(PageLinkedList *page_list, size_t *out_blocks_needed, KProcessAddress address, size_t size, KMemoryPermission test_perm, KMemoryState dst_state);
|
||||
Result SetupForIpcServer(KProcessAddress *out_addr, size_t size, KProcessAddress src_addr, KMemoryPermission test_perm, KMemoryState dst_state, KPageTableBase &src_page_table, bool send);
|
||||
void CleanupForIpcClientOnServerSetupFailure(PageLinkedList *page_list, KProcessAddress address, size_t size, KMemoryPermission prot_perm);
|
||||
|
||||
size_t GetSize(KMemoryState state) const;
|
||||
public:
|
||||
bool GetPhysicalAddress(KPhysicalAddress *out, KProcessAddress virt_addr) const {
|
||||
return this->GetImpl().GetPhysicalAddress(out, virt_addr);
|
||||
@@ -423,6 +425,11 @@ namespace ams::kern {
|
||||
return (this->current_heap_end - this->heap_region_start) + this->mapped_physical_memory_size;
|
||||
}
|
||||
|
||||
size_t GetCodeSize() const;
|
||||
size_t GetCodeDataSize() const;
|
||||
size_t GetAliasCodeSize() const;
|
||||
size_t GetAliasCodeDataSize() const;
|
||||
|
||||
u32 GetAllocateOption() const { return this->allocate_option; }
|
||||
public:
|
||||
static ALWAYS_INLINE KVirtualAddress GetLinearMappedVirtualAddress(KPhysicalAddress addr) {
|
||||
|
||||
@@ -170,6 +170,8 @@ namespace ams::kern {
|
||||
|
||||
constexpr KProcessAddress GetEntryPoint() const { return this->code_address; }
|
||||
|
||||
constexpr size_t GetMainStackSize() const { return this->main_thread_stack_size; }
|
||||
|
||||
constexpr KMemoryManager::Pool GetMemoryPool() const { return this->memory_pool; }
|
||||
|
||||
constexpr u64 GetRandomEntropy(size_t i) const { return this->entropy[i]; }
|
||||
|
||||
Reference in New Issue
Block a user