summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-07-18 02:55:48 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-08-16 06:03:43 +0200
commitb9a9ad9742d3d47375526949d5ddb48280e6c952 (patch)
tree7fa10d9ebae362e81c89d325687e6be92b6363dd /src/core
parentVMManager: Change block offsets to size_t (diff)
downloadyuzu-b9a9ad9742d3d47375526949d5ddb48280e6c952.tar
yuzu-b9a9ad9742d3d47375526949d5ddb48280e6c952.tar.gz
yuzu-b9a9ad9742d3d47375526949d5ddb48280e6c952.tar.bz2
yuzu-b9a9ad9742d3d47375526949d5ddb48280e6c952.tar.lz
yuzu-b9a9ad9742d3d47375526949d5ddb48280e6c952.tar.xz
yuzu-b9a9ad9742d3d47375526949d5ddb48280e6c952.tar.zst
yuzu-b9a9ad9742d3d47375526949d5ddb48280e6c952.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/process.cpp2
-rw-r--r--src/core/hle/kernel/vm_manager.cpp16
-rw-r--r--src/core/hle/kernel/vm_manager.h2
3 files changed, 15 insertions, 5 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index a7892c652..ad953cdbf 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -113,7 +113,7 @@ void Process::Run(s32 main_thread_priority, u32 stack_size) {
MapSegment(codeset->rodata, VMAPermission::Read, MemoryState::Code);
MapSegment(codeset->data, VMAPermission::ReadWrite, MemoryState::Private);
- address_space->LogLayout();
+ address_space->LogLayout(Log::Level::Debug);
Kernel::SetupMainThread(codeset->entrypoint, main_thread_priority);
}
diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp
index e5e567de1..adce9a1ee 100644
--- a/src/core/hle/kernel/vm_manager.cpp
+++ b/src/core/hle/kernel/vm_manager.cpp
@@ -11,6 +11,15 @@
namespace Kernel {
+static const char* GetMemoryStateName(MemoryState state) {
+ static const char* names[] = {
+ "Free", "Reserved", "IO", "Static", "Code", "Private", "Shared", "Continuous", "Aliased",
+ "Alias", "AliasCode", "Locked",
+ };
+
+ return names[(int)state];
+}
+
bool VirtualMemoryArea::CanBeMergedWith(const VirtualMemoryArea& next) const {
ASSERT(base + size == next.base);
if (permissions != next.permissions ||
@@ -134,13 +143,14 @@ void VMManager::Reprotect(VMAHandle vma_handle, VMAPermission new_perms) {
MergeAdjacent(iter);
}
-void VMManager::LogLayout() const {
+void VMManager::LogLayout(Log::Level log_level) const {
for (const auto& p : vma_map) {
const VirtualMemoryArea& vma = p.second;
- LOG_DEBUG(Kernel, "%08X - %08X size: %8X %c%c%c", vma.base, vma.base + vma.size, vma.size,
+ LOG_GENERIC(Log::Class::Kernel, log_level, "%08X - %08X size: %8X %c%c%c %s",
+ vma.base, vma.base + vma.size, vma.size,
(u8)vma.permissions & (u8)VMAPermission::Read ? 'R' : '-',
(u8)vma.permissions & (u8)VMAPermission::Write ? 'W' : '-',
- (u8)vma.permissions & (u8)VMAPermission::Execute ? 'X' : '-');
+ (u8)vma.permissions & (u8)VMAPermission::Execute ? 'X' : '-', GetMemoryStateName(vma.meminfo_state));
}
}
diff --git a/src/core/hle/kernel/vm_manager.h b/src/core/hle/kernel/vm_manager.h
index a8cf0d0d4..99cc28689 100644
--- a/src/core/hle/kernel/vm_manager.h
+++ b/src/core/hle/kernel/vm_manager.h
@@ -170,7 +170,7 @@ public:
void Reprotect(VMAHandle vma, VMAPermission new_perms);
/// Dumps the address space layout to the log, for debugging
- void LogLayout() const;
+ void LogLayout(Log::Level log_level) const;
private:
using VMAIter = decltype(vma_map)::iterator;