aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp47
1 files changed, 5 insertions, 42 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 4a1559291..e479dacde 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -99,13 +99,6 @@ struct KernelCore::Impl {
RegisterHostThread(nullptr);
}
- void InitializeCores() {
- for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) {
- cores[core_id]->Initialize((*application_process).Is64Bit());
- system.ApplicationMemory().SetCurrentPageTable(*application_process, core_id);
- }
- }
-
void TerminateApplicationProcess() {
application_process.load()->Terminate();
}
@@ -142,7 +135,6 @@ struct KernelCore::Impl {
obj = nullptr;
}
};
- CleanupObject(hid_shared_mem);
CleanupObject(font_shared_mem);
CleanupObject(irs_shared_mem);
CleanupObject(time_shared_mem);
@@ -205,7 +197,7 @@ struct KernelCore::Impl {
const s32 core{static_cast<s32>(i)};
schedulers[i] = std::make_unique<Kernel::KScheduler>(system.Kernel());
- cores[i] = std::make_unique<Kernel::PhysicalCore>(i, system, *schedulers[i]);
+ cores[i] = std::make_unique<Kernel::PhysicalCore>(system.Kernel(), i);
auto* main_thread{Kernel::KThread::Create(system.Kernel())};
main_thread->SetCurrentCore(core);
@@ -751,22 +743,16 @@ struct KernelCore::Impl {
void InitializeHackSharedMemory(KernelCore& kernel) {
// Setup memory regions for emulated processes
// TODO(bunnei): These should not be hardcoded regions initialized within the kernel
- constexpr std::size_t hid_size{0x40000};
constexpr std::size_t font_size{0x1100000};
constexpr std::size_t irs_size{0x8000};
constexpr std::size_t time_size{0x1000};
constexpr std::size_t hidbus_size{0x1000};
- hid_shared_mem = KSharedMemory::Create(system.Kernel());
font_shared_mem = KSharedMemory::Create(system.Kernel());
irs_shared_mem = KSharedMemory::Create(system.Kernel());
time_shared_mem = KSharedMemory::Create(system.Kernel());
hidbus_shared_mem = KSharedMemory::Create(system.Kernel());
- hid_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None,
- Svc::MemoryPermission::Read, hid_size);
- KSharedMemory::Register(kernel, hid_shared_mem);
-
font_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None,
Svc::MemoryPermission::Read, font_size);
KSharedMemory::Register(kernel, font_shared_mem);
@@ -880,10 +866,6 @@ void KernelCore::Initialize() {
impl->Initialize(*this);
}
-void KernelCore::InitializeCores() {
- impl->InitializeCores();
-}
-
void KernelCore::Shutdown() {
impl->Shutdown();
}
@@ -993,21 +975,6 @@ const KAutoObjectWithListContainer& KernelCore::ObjectListContainer() const {
return *impl->global_object_list_container;
}
-void KernelCore::InvalidateAllInstructionCaches() {
- for (auto& physical_core : impl->cores) {
- physical_core->ArmInterface().ClearInstructionCache();
- }
-}
-
-void KernelCore::InvalidateCpuInstructionCacheRange(KProcessAddress addr, std::size_t size) {
- for (auto& physical_core : impl->cores) {
- if (!physical_core->IsInitialized()) {
- continue;
- }
- physical_core->ArmInterface().InvalidateCacheRange(GetInteger(addr), size);
- }
-}
-
void KernelCore::PrepareReschedule(std::size_t id) {
// TODO: Reimplement, this
}
@@ -1216,14 +1183,6 @@ const KSystemResource& KernelCore::GetSystemSystemResource() const {
return *impl->sys_system_resource;
}
-Kernel::KSharedMemory& KernelCore::GetHidSharedMem() {
- return *impl->hid_shared_mem;
-}
-
-const Kernel::KSharedMemory& KernelCore::GetHidSharedMem() const {
- return *impl->hid_shared_mem;
-}
-
Kernel::KSharedMemory& KernelCore::GetFontSharedMem() {
return *impl->font_shared_mem;
}
@@ -1366,6 +1325,7 @@ struct KernelCore::SlabHeapContainer {
KSlabHeap<KProcess> process;
KSlabHeap<KResourceLimit> resource_limit;
KSlabHeap<KSession> session;
+ KSlabHeap<KLightSession> light_session;
KSlabHeap<KSharedMemory> shared_memory;
KSlabHeap<KSharedMemoryInfo> shared_memory_info;
KSlabHeap<KThread> thread;
@@ -1396,6 +1356,8 @@ KSlabHeap<T>& KernelCore::SlabHeap() {
return slab_heap_container->resource_limit;
} else if constexpr (std::is_same_v<T, KSession>) {
return slab_heap_container->session;
+ } else if constexpr (std::is_same_v<T, KLightSession>) {
+ return slab_heap_container->light_session;
} else if constexpr (std::is_same_v<T, KSharedMemory>) {
return slab_heap_container->shared_memory;
} else if constexpr (std::is_same_v<T, KSharedMemoryInfo>) {
@@ -1433,6 +1395,7 @@ template KSlabHeap<KPort>& KernelCore::SlabHeap();
template KSlabHeap<KProcess>& KernelCore::SlabHeap();
template KSlabHeap<KResourceLimit>& KernelCore::SlabHeap();
template KSlabHeap<KSession>& KernelCore::SlabHeap();
+template KSlabHeap<KLightSession>& KernelCore::SlabHeap();
template KSlabHeap<KSharedMemory>& KernelCore::SlabHeap();
template KSlabHeap<KSharedMemoryInfo>& KernelCore::SlabHeap();
template KSlabHeap<KThread>& KernelCore::SlabHeap();