Просмотр исходного кода

vm_manager: Stub out a bunch of interfaces used by svcGetInfo.

bunnei 8 лет назад
Родитель
Сommit
e9710a2cf7
2 измененных файлов с 51 добавлено и 1 удалено
  1. 33 1
      src/core/hle/kernel/vm_manager.cpp
  2. 18 0
      src/core/hle/kernel/vm_manager.h

+ 33 - 1
src/core/hle/kernel/vm_manager.cpp

@@ -4,6 +4,7 @@
 
 
 #include <iterator>
 #include <iterator>
 #include "common/assert.h"
 #include "common/assert.h"
+#include "common/logging/log.h"
 #include "core/arm/arm_interface.h"
 #include "core/arm/arm_interface.h"
 #include "core/hle/kernel/errors.h"
 #include "core/hle/kernel/errors.h"
 #include "core/hle/kernel/vm_manager.h"
 #include "core/hle/kernel/vm_manager.h"
@@ -62,7 +63,7 @@ void VMManager::Reset() {
     page_table.attributes.fill(Memory::PageType::Unmapped);
     page_table.attributes.fill(Memory::PageType::Unmapped);
     page_table.cached_res_count.fill(0);
     page_table.cached_res_count.fill(0);
 
 
-    //UpdatePageTableForVMA(initial_vma);
+    UpdatePageTableForVMA(initial_vma);
 }
 }
 
 
 VMManager::VMAHandle VMManager::FindVMA(VAddr target) const {
 VMManager::VMAHandle VMManager::FindVMA(VAddr target) const {
@@ -352,4 +353,35 @@ void VMManager::UpdatePageTableForVMA(const VirtualMemoryArea& vma) {
         break;
         break;
     }
     }
 }
 }
+
+u64 VMManager::GetTotalMemoryUsage() {
+    LOG_WARNING(Kernel, "(STUBBED) called");
+    return 0x400000;
+}
+
+u64 VMManager::GetTotalHeapUsage() {
+    LOG_WARNING(Kernel, "(STUBBED) called");
+    return 0x10000;
+}
+
+VAddr VMManager::GetAddressSpaceBaseAddr() {
+    LOG_WARNING(Kernel, "(STUBBED) called");
+    return 0x8000000;
+}
+
+u64 VMManager::GetAddressSpaceSize() {
+    LOG_WARNING(Kernel, "(STUBBED) called");
+    return MAX_ADDRESS;
+}
+
+VAddr VMManager::GetNewMapRegionBaseAddr() {
+    LOG_WARNING(Kernel, "(STUBBED) called");
+    return 0x8000000;
 }
 }
+
+u64 VMManager::GetNewMapRegionSize() {
+    LOG_WARNING(Kernel, "(STUBBED) called");
+    return 0x8000000;
+}
+
+} // namespace Kernel

+ 18 - 0
src/core/hle/kernel/vm_manager.h

@@ -181,6 +181,24 @@ public:
     /// Dumps the address space layout to the log, for debugging
     /// Dumps the address space layout to the log, for debugging
     void LogLayout(Log::Level log_level) const;
     void LogLayout(Log::Level log_level) const;
 
 
+    /// Gets the total memory usage, used by svcGetInfo
+    u64 GetTotalMemoryUsage();
+
+    /// Gets the total heap usage, used by svcGetInfo
+    u64 GetTotalHeapUsage();
+
+    /// Gets the total address space base address, used by svcGetInfo
+    VAddr GetAddressSpaceBaseAddr();
+
+    /// Gets the total address space address size, used by svcGetInfo
+    u64 GetAddressSpaceSize();
+
+    /// Gets the base address for a new memory region, used by svcGetInfo
+    VAddr GetNewMapRegionBaseAddr();
+
+    /// Gets the size for a new memory region, used by svcGetInfo
+    u64 GetNewMapRegionSize();
+
     /// Each VMManager has its own page table, which is set as the main one when the owning process
     /// Each VMManager has its own page table, which is set as the main one when the owning process
     /// is scheduled.
     /// is scheduled.
     Memory::PageTable page_table;
     Memory::PageTable page_table;