Kernel: Add more infrastructure to support different memory layouts

This adds some structures necessary to support multiple memory regions
in the future. It also adds support for different system memory types
and the new linear heap mapping at 0x30000000.
This commit is contained in:
Yuri Kunde Schlesner 2015-08-05 21:26:52 -03:00
parent cbc7419408
commit e34643a3e4
10 changed files with 148 additions and 28 deletions

View file

@ -7,11 +7,14 @@
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/hle/config_mem.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/resource_limit.h"
#include "core/hle/kernel/memory.h"
#include "core/hle/kernel/process.h"
#include "core/hle/kernel/resource_limit.h"
#include "core/hle/kernel/thread.h"
#include "core/hle/kernel/timer.h"
#include "core/hle/shared_page.h"
namespace Kernel {
@ -119,6 +122,13 @@ void HandleTable::Clear() {
/// Initialize the kernel
void Init() {
ConfigMem::Init();
SharedPage::Init();
// TODO(yuriks): The memory type parameter needs to be determined by the ExHeader field instead
// For now it defaults to the one with a largest allocation to the app
Kernel::MemoryInit(2); // Allocates 96MB to the application
Kernel::ResourceLimitsInit();
Kernel::ThreadingInit();
Kernel::TimersInit();
@ -131,11 +141,14 @@ void Init() {
/// Shutdown the kernel
void Shutdown() {
g_handle_table.Clear(); // Free all kernel objects
Kernel::ThreadingShutdown();
g_current_process = nullptr;
Kernel::TimersShutdown();
Kernel::ResourceLimitsShutdown();
g_handle_table.Clear(); // Free all kernel objects
g_current_process = nullptr;
Kernel::MemoryShutdown();
}
} // namespace