print memory types enum value

This commit is contained in:
georgemoralis 2023-08-03 11:13:08 +03:00
parent c0e1ace5fc
commit 0f85cbe54f
2 changed files with 10 additions and 4 deletions

View File

@ -6,6 +6,9 @@
constexpr u64 SCE_KERNEL_MAIN_DMEM_SIZE = 5376_MB; // ~ 6GB constexpr u64 SCE_KERNEL_MAIN_DMEM_SIZE = 5376_MB; // ~ 6GB
// memory types // memory types
constexpr int SCE_KERNEL_WB_ONION = 0; // write - back mode (Onion bus)
constexpr int SCE_KERNEL_WC_GARLIC = 3; // write - combining mode (Garlic bus) typedef enum : int {
constexpr int SCE_KERNEL_WB_GARLIC = 10; // write - back mode (Garlic bus) SCE_KERNEL_WB_ONION = 0, // write - back mode (Onion bus)
SCE_KERNEL_WC_GARLIC = 3, // write - combining mode (Garlic bus)
SCE_KERNEL_WB_GARLIC = 10 // write - back mode (Garlic bus)
} memory_types;

View File

@ -1,6 +1,7 @@
#include "MemoryManagement.h" #include "MemoryManagement.h"
#include <bit> #include <bit>
#include <magic_enum.hpp>
#include "../../../../Debug.h" #include "../../../../Debug.h"
#include "../../../../Util/Log.h" #include "../../../../Util/Log.h"
@ -41,11 +42,13 @@ int PS4_SYSV_ABI sceKernelAllocateDirectMemory(s64 searchStart, s64 searchEnd, u
// TODO debug logging // TODO debug logging
return SCE_KERNEL_ERROR_EINVAL; return SCE_KERNEL_ERROR_EINVAL;
} }
auto memtype = magic_enum::enum_cast<memory_types>(memoryType);
LOG_INFO_IF(true, "search_start = {:#018x}\n", searchStart); LOG_INFO_IF(true, "search_start = {:#018x}\n", searchStart);
LOG_INFO_IF(true, "search_end = {:#018x}\n", searchEnd); LOG_INFO_IF(true, "search_end = {:#018x}\n", searchEnd);
LOG_INFO_IF(true, "len = {:#018x}\n", len); LOG_INFO_IF(true, "len = {:#018x}\n", len);
LOG_INFO_IF(true, "alignment = {:#018x}\n", alignment); LOG_INFO_IF(true, "alignment = {:#018x}\n", alignment);
LOG_INFO_IF(true, "memory_type = {}\n", memoryType); LOG_INFO_IF(true, "memory_type = {}\n", magic_enum::enum_name(memtype.value()));
u64 physical_addr = 0; u64 physical_addr = 0;
auto* physical_memory = Singleton<HLE::Kernel::Objects::PhysicalMemory>::Instance(); auto* physical_memory = Singleton<HLE::Kernel::Objects::PhysicalMemory>::Instance();