diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/init/kern_k_init_page_table.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/init/kern_k_init_page_table.hpp index 330ce9c59..bfa6528ce 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/init/kern_k_init_page_table.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/init/kern_k_init_page_table.hpp @@ -20,7 +20,7 @@ #include #include -namespace ams::kern::arm64::init { +namespace ams::kern::arch::arm64::init { class KInitialPageTable { public: diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_cpu.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_cpu.hpp index 136f06f39..1ae915f1a 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_cpu.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_cpu.hpp @@ -17,7 +17,7 @@ #include #include -namespace ams::kern::arm64::cpu { +namespace ams::kern::arch::arm64::cpu { #if defined(ATMOSPHERE_CPU_ARM_CORTEX_A57) || defined(ATMOSPHERE_CPU_ARM_CORTEX_A53) constexpr inline size_t InstructionCacheLineSize = 0x40; diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_cpu_system_registers.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_cpu_system_registers.hpp index cf7ca4b9e..7912bea3f 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_cpu_system_registers.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_cpu_system_registers.hpp @@ -16,7 +16,7 @@ #pragma once #include -namespace ams::kern::arm64::cpu { +namespace ams::kern::arch::arm64::cpu { #define MESOSPHERE_CPU_GET_SYSREG(name) \ ({ \ diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_debug.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_debug.hpp index fccf30c88..8bf3c8f6f 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_debug.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_debug.hpp @@ -25,7 +25,7 @@ namespace ams::kern { } -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { class KDebug final : public KAutoObjectWithSlabHeapAndContainer { MESOSPHERE_AUTOOBJECT_TRAITS(KDebug, KSynchronizationObject); diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_exception_context.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_exception_context.hpp index 714741086..9d99e334c 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_exception_context.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_exception_context.hpp @@ -16,7 +16,7 @@ #pragma once #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { struct KExceptionContext { u64 x[(30 - 0) + 1]; diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_hardware_timer.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_hardware_timer.hpp index 9b9ee533f..f69e55891 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_hardware_timer.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_hardware_timer.hpp @@ -17,7 +17,7 @@ #include #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { namespace impl { diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_controller.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_controller.hpp index 14f054de6..6467333d5 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_controller.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_controller.hpp @@ -18,7 +18,7 @@ #include #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { struct GicDistributor { u32 ctlr; diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_manager.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_manager.hpp index 26e5cc705..c6c0d1d4d 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_manager.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_manager.hpp @@ -20,7 +20,7 @@ #include #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { class KInterruptManager { NON_COPYABLE(KInterruptManager); diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_name.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_name.hpp index abadf78f4..5902b11d4 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_name.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_name.hpp @@ -15,7 +15,7 @@ */ #pragma once -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { namespace interrupt_name { diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_page_table.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_page_table.hpp index c0911554f..fdf59b815 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_page_table.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_page_table.hpp @@ -20,7 +20,7 @@ #include #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { class KPageTable : public KPageTableBase { NON_COPYABLE(KPageTable); diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_page_table_entry.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_page_table_entry.hpp index 74e7c7e18..5a4e88dcf 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_page_table_entry.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_page_table_entry.hpp @@ -18,7 +18,7 @@ #include #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { constexpr size_t L1BlockSize = 1_GB; constexpr size_t L2BlockSize = 2_MB; diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_page_table_impl.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_page_table_impl.hpp index 6ed2e2113..113c4777e 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_page_table_impl.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_page_table_impl.hpp @@ -20,7 +20,7 @@ #include #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { /* TODO: This seems worse than KInitialPageTable. Can we fulfill Nintendo's API using KInitialPageTable? */ /* KInitialPageTable is significantly nicer, but doesn't have KPageTableImpl's traversal semantics. */ diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_process_page_table.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_process_page_table.hpp index 78ca53722..54a2164a6 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_process_page_table.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_process_page_table.hpp @@ -17,7 +17,7 @@ #include #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { class KProcessPageTable { diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_spin_lock.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_spin_lock.hpp index 303a3702a..909d504b2 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_spin_lock.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_spin_lock.hpp @@ -17,7 +17,7 @@ #include #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { class KNotAlignedSpinLock { private: diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_supervisor_page_table.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_supervisor_page_table.hpp index e79faf6ca..c33069681 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_supervisor_page_table.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_supervisor_page_table.hpp @@ -18,7 +18,7 @@ #include #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { class KSupervisorPageTable { private: diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_thread_context.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_thread_context.hpp index c257879d8..6d950d700 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_thread_context.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_thread_context.hpp @@ -23,7 +23,7 @@ namespace ams::kern { } -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { class KThreadContext { public: diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_userspace_memory_access.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_userspace_memory_access.hpp index 5bd1d8d3f..20627edab 100644 --- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_userspace_memory_access.hpp +++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_userspace_memory_access.hpp @@ -16,7 +16,7 @@ #pragma once #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { void UserspaceMemoryAccessFunctionAreaBegin(); diff --git a/libraries/libmesosphere/include/mesosphere/init/kern_init_page_table_select.hpp b/libraries/libmesosphere/include/mesosphere/init/kern_init_page_table_select.hpp index 7a22b33cc..aa9cb5df4 100644 --- a/libraries/libmesosphere/include/mesosphere/init/kern_init_page_table_select.hpp +++ b/libraries/libmesosphere/include/mesosphere/init/kern_init_page_table_select.hpp @@ -20,9 +20,9 @@ #include namespace ams::kern::init { - using ams::kern::arm64::PageTableEntry; - using ams::kern::arm64::init::KInitialPageTable; - using ams::kern::arm64::init::KInitialPageAllocator; + using ams::kern::arch::arm64::PageTableEntry; + using ams::kern::arch::arm64::init::KInitialPageTable; + using ams::kern::arch::arm64::init::KInitialPageAllocator; } #else #error "Unknown architecture for KInitialPageTable" diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_exception_context.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_exception_context.hpp index 3edace7de..aceefcd8e 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_exception_context.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_exception_context.hpp @@ -19,7 +19,7 @@ #include namespace ams::kern { - using ams::kern::arm64::KExceptionContext; + using ams::kern::arch::arm64::KExceptionContext; } #else #error "Unknown board for KExceptionContext" diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_spin_lock.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_spin_lock.hpp index 3dec44cdf..ce8fcb3b8 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_spin_lock.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_spin_lock.hpp @@ -21,9 +21,9 @@ #include namespace ams::kern { - using ams::kern::arm64::KAlignedSpinLock; - using ams::kern::arm64::KNotAlignedSpinLock; - using ams::kern::arm64::KSpinLock; + using ams::kern::arch::arm64::KAlignedSpinLock; + using ams::kern::arch::arm64::KNotAlignedSpinLock; + using ams::kern::arch::arm64::KSpinLock; } #else diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_thread_context.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_thread_context.hpp index e6c695c1a..a675d5184 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_thread_context.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_thread_context.hpp @@ -19,7 +19,7 @@ #include namespace ams::kern { - using ams::kern::arm64::KThreadContext; + using ams::kern::arch::arm64::KThreadContext; } #else #error "Unknown board for KThreadContext" diff --git a/libraries/libmesosphere/include/mesosphere/kern_kernel.hpp b/libraries/libmesosphere/include/mesosphere/kern_kernel.hpp index 8f12783c9..29c5a0a20 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_kernel.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_kernel.hpp @@ -39,10 +39,10 @@ namespace ams::kern { #if defined(ATMOSPHERE_ARCH_ARM64) - namespace arm64 { + namespace arch::arm64 { class KSupervisorPageTable; } - using ams::kern::arm64::KSupervisorPageTable; + using ams::kern::arch::arm64::KSupervisorPageTable; #else diff --git a/libraries/libmesosphere/include/mesosphere/kern_select_cpu.hpp b/libraries/libmesosphere/include/mesosphere/kern_select_cpu.hpp index aec84c580..276ed1439 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_select_cpu.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_select_cpu.hpp @@ -21,7 +21,7 @@ namespace ams::kern::cpu { - using namespace ams::kern::arm64::cpu; + using namespace ams::kern::arch::arm64::cpu; } diff --git a/libraries/libmesosphere/include/mesosphere/kern_select_debug.hpp b/libraries/libmesosphere/include/mesosphere/kern_select_debug.hpp index ba18f4459..607c43db1 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_select_debug.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_select_debug.hpp @@ -20,7 +20,7 @@ #include namespace ams::kern { - using ams::kern::arm64::KDebug; + using ams::kern::arch::arm64::KDebug; } #else diff --git a/libraries/libmesosphere/include/mesosphere/kern_select_hardware_timer.hpp b/libraries/libmesosphere/include/mesosphere/kern_select_hardware_timer.hpp index bf5fedd70..e9c04cecc 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_select_hardware_timer.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_select_hardware_timer.hpp @@ -20,7 +20,7 @@ #include namespace ams::kern { - using ams::kern::arm64::KHardwareTimer; + using ams::kern::arch::arm64::KHardwareTimer; } #else diff --git a/libraries/libmesosphere/include/mesosphere/kern_select_interrupt_controller.hpp b/libraries/libmesosphere/include/mesosphere/kern_select_interrupt_controller.hpp index 4db18584e..605fa3fcd 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_select_interrupt_controller.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_select_interrupt_controller.hpp @@ -21,7 +21,7 @@ #include namespace ams::kern { - using ams::kern::arm64::KInterruptController; + using ams::kern::arch::arm64::KInterruptController; } #else diff --git a/libraries/libmesosphere/include/mesosphere/kern_select_interrupt_manager.hpp b/libraries/libmesosphere/include/mesosphere/kern_select_interrupt_manager.hpp index 4eb85bdc7..53790958d 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_select_interrupt_manager.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_select_interrupt_manager.hpp @@ -21,7 +21,7 @@ #include namespace ams::kern { - using ams::kern::arm64::KInterruptManager; + using ams::kern::arch::arm64::KInterruptManager; } #else diff --git a/libraries/libmesosphere/include/mesosphere/kern_select_interrupt_name.hpp b/libraries/libmesosphere/include/mesosphere/kern_select_interrupt_name.hpp index 45df006a1..8be3a7b4f 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_select_interrupt_name.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_select_interrupt_name.hpp @@ -20,7 +20,7 @@ #include namespace ams::kern { - using namespace ams::kern::arm64::interrupt_name; + using namespace ams::kern::arch::arm64::interrupt_name; } #else diff --git a/libraries/libmesosphere/include/mesosphere/kern_select_page_table.hpp b/libraries/libmesosphere/include/mesosphere/kern_select_page_table.hpp index 694f32d1f..28210ff38 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_select_page_table.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_select_page_table.hpp @@ -22,9 +22,9 @@ #include #include namespace ams::kern { - using ams::kern::arm64::KPageTable; - using ams::kern::arm64::KSupervisorPageTable; - using ams::kern::arm64::KProcessPageTable; + using ams::kern::arch::arm64::KPageTable; + using ams::kern::arch::arm64::KSupervisorPageTable; + using ams::kern::arch::arm64::KProcessPageTable; } #else diff --git a/libraries/libmesosphere/include/mesosphere/kern_select_page_table_impl.hpp b/libraries/libmesosphere/include/mesosphere/kern_select_page_table_impl.hpp index 90f4c33e0..4d6858b00 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_select_page_table_impl.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_select_page_table_impl.hpp @@ -20,7 +20,7 @@ #include namespace ams::kern { - using ams::kern::arm64::KPageTableImpl; + using ams::kern::arch::arm64::KPageTableImpl; } #else diff --git a/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp b/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp index c2ddc5ed3..25afa811b 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_cpu.cpp @@ -15,7 +15,7 @@ */ #include -namespace ams::kern::arm64::cpu { +namespace ams::kern::arch::arm64::cpu { /* Declare prototype to be implemented in asm. */ void SynchronizeAllCoresImpl(s32 *sync_var, s32 num_cores); diff --git a/libraries/libmesosphere/source/arch/arm64/kern_cpu_asm.s b/libraries/libmesosphere/source/arch/arm64/kern_cpu_asm.s index 4adb36b21..e3f2f8b4b 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_cpu_asm.s +++ b/libraries/libmesosphere/source/arch/arm64/kern_cpu_asm.s @@ -14,11 +14,11 @@ * along with this program. If not, see . */ -/* ams::kern::arm64::cpu::SynchronizeAllCoresImpl(int *sync_var, int num_cores) */ -.section .text._ZN3ams4kern5arm643cpu23SynchronizeAllCoresImplEPii, "ax", %progbits -.global _ZN3ams4kern5arm643cpu23SynchronizeAllCoresImplEPii -.type _ZN3ams4kern5arm643cpu23SynchronizeAllCoresImplEPii, %function -_ZN3ams4kern5arm643cpu23SynchronizeAllCoresImplEPii: +/* ams::kern::arch::arm64::cpu::SynchronizeAllCoresImpl(int *sync_var, int num_cores) */ +.section .text._ZN3ams4kern4arch5arm643cpu23SynchronizeAllCoresImplEPii, "ax", %progbits +.global _ZN3ams4kern4arch5arm643cpu23SynchronizeAllCoresImplEPii +.type _ZN3ams4kern4arch5arm643cpu23SynchronizeAllCoresImplEPii, %function +_ZN3ams4kern4arch5arm643cpu23SynchronizeAllCoresImplEPii: /* Loop until the sync var is less than num cores. */ sevl 1: @@ -63,11 +63,11 @@ _ZN3ams4kern5arm643cpu23SynchronizeAllCoresImplEPii: ret -/* ams::kern::arm64::cpu::ClearPageToZero(void *) */ -.section .text._ZN3ams4kern5arm643cpu19ClearPageToZeroImplEPv, "ax", %progbits -.global _ZN3ams4kern5arm643cpu19ClearPageToZeroImplEPv -.type _ZN3ams4kern5arm643cpu19ClearPageToZeroImplEPv, %function -_ZN3ams4kern5arm643cpu19ClearPageToZeroImplEPv: +/* ams::kern::arch::arm64::cpu::ClearPageToZero(void *) */ +.section .text._ZN3ams4kern4arch5arm643cpu19ClearPageToZeroImplEPv, "ax", %progbits +.global _ZN3ams4kern4arch5arm643cpu19ClearPageToZeroImplEPv +.type _ZN3ams4kern4arch5arm643cpu19ClearPageToZeroImplEPv, %function +_ZN3ams4kern4arch5arm643cpu19ClearPageToZeroImplEPv: /* Efficiently clear the page using dc zva. */ dc zva, x0 add x8, x0, #0x040 diff --git a/libraries/libmesosphere/source/arch/arm64/kern_exception_handlers.cpp b/libraries/libmesosphere/source/arch/arm64/kern_exception_handlers.cpp index 0ae846a34..d284e3987 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_exception_handlers.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_exception_handlers.cpp @@ -15,7 +15,7 @@ */ #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { namespace { diff --git a/libraries/libmesosphere/source/arch/arm64/kern_k_hardware_timer.cpp b/libraries/libmesosphere/source/arch/arm64/kern_k_hardware_timer.cpp index 5b50195d2..5a1630758 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_k_hardware_timer.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_k_hardware_timer.cpp @@ -15,7 +15,7 @@ */ #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { namespace impl { diff --git a/libraries/libmesosphere/source/arch/arm64/kern_k_interrupt_controller.cpp b/libraries/libmesosphere/source/arch/arm64/kern_k_interrupt_controller.cpp index 244395ac2..5cce0c31f 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_k_interrupt_controller.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_k_interrupt_controller.cpp @@ -15,7 +15,7 @@ */ #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { void KInterruptController::SetupInterruptLines(s32 core_id) const { const size_t ITLines = (core_id == 0) ? 32 * ((this->gicd->typer & 0x1F) + 1) : NumLocalInterrupts; diff --git a/libraries/libmesosphere/source/arch/arm64/kern_k_interrupt_manager.cpp b/libraries/libmesosphere/source/arch/arm64/kern_k_interrupt_manager.cpp index b9631e2cd..3b866be8e 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_k_interrupt_manager.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_k_interrupt_manager.cpp @@ -15,7 +15,7 @@ */ #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { /* Instantiate static members in specific translation unit. */ KSpinLock KInterruptManager::s_lock; diff --git a/libraries/libmesosphere/source/arch/arm64/kern_k_page_table.cpp b/libraries/libmesosphere/source/arch/arm64/kern_k_page_table.cpp index 5add50a5c..581daef31 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_k_page_table.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_k_page_table.cpp @@ -15,7 +15,7 @@ */ #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { void KPageTable::Initialize(s32 core_id) { /* Nothing actually needed here. */ diff --git a/libraries/libmesosphere/source/arch/arm64/kern_k_page_table_impl.cpp b/libraries/libmesosphere/source/arch/arm64/kern_k_page_table_impl.cpp index f27562bc0..a97266d3c 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_k_page_table_impl.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_k_page_table_impl.cpp @@ -15,7 +15,7 @@ */ #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { void KPageTableImpl::InitializeForKernel(void *tb, KVirtualAddress start, KVirtualAddress end) { this->table = static_cast(tb); diff --git a/libraries/libmesosphere/source/arch/arm64/kern_k_supervisor_page_table.cpp b/libraries/libmesosphere/source/arch/arm64/kern_k_supervisor_page_table.cpp index 60a27ea66..7539cb041 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_k_supervisor_page_table.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_k_supervisor_page_table.cpp @@ -15,7 +15,7 @@ */ #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { void KSupervisorPageTable::Initialize(s32 core_id) { /* Get the identity mapping ttbr0. */ diff --git a/libraries/libmesosphere/source/arch/arm64/kern_k_thread_context.cpp b/libraries/libmesosphere/source/arch/arm64/kern_k_thread_context.cpp index 08bf99918..327a588a5 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_k_thread_context.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_k_thread_context.cpp @@ -15,7 +15,7 @@ */ #include -namespace ams::kern::arm64 { +namespace ams::kern::arch::arm64 { /* These are implemented elsewhere (asm). */ void UserModeThreadStarter(); @@ -96,7 +96,7 @@ namespace ams::kern::arm64 { /* Determine LR and SP. */ if (is_user) { /* Usermode thread. */ - this->lr = reinterpret_cast(::ams::kern::arm64::UserModeThreadStarter); + this->lr = reinterpret_cast(::ams::kern::arch::arm64::UserModeThreadStarter); this->sp = SetupStackForUserModeThreadStarter(u_pc, k_sp, u_sp, arg, is_64_bit); } else { /* Kernel thread. */ @@ -108,7 +108,7 @@ namespace ams::kern::arm64 { this->sp = GetInteger(k_sp); } else { /* Generic Kernel thread. */ - this->lr = reinterpret_cast(::ams::kern::arm64::SupervisorModeThreadStarter); + this->lr = reinterpret_cast(::ams::kern::arch::arm64::SupervisorModeThreadStarter); this->sp = SetupStackForSupervisorModeThreadStarter(u_pc, k_sp, arg); } } diff --git a/libraries/libmesosphere/source/arch/arm64/svc/kern_svc_handlers_asm.s b/libraries/libmesosphere/source/arch/arm64/svc/kern_svc_handlers_asm.s index dc037f365..b3106e0b2 100644 --- a/libraries/libmesosphere/source/arch/arm64/svc/kern_svc_handlers_asm.s +++ b/libraries/libmesosphere/source/arch/arm64/svc/kern_svc_handlers_asm.s @@ -14,11 +14,11 @@ * along with this program. If not, see . */ -/* ams::kern::arm64::SvcHandler64() */ -.section .text._ZN3ams4kern5arm6412SvcHandler64Ev, "ax", %progbits -.global _ZN3ams4kern5arm6412SvcHandler64Ev -.type _ZN3ams4kern5arm6412SvcHandler64Ev, %function -_ZN3ams4kern5arm6412SvcHandler64Ev: +/* ams::kern::arch::arm64::SvcHandler64() */ +.section .text._ZN3ams4kern4arch5arm6412SvcHandler64Ev, "ax", %progbits +.global _ZN3ams4kern4arch5arm6412SvcHandler64Ev +.type _ZN3ams4kern4arch5arm6412SvcHandler64Ev, %function +_ZN3ams4kern4arch5arm6412SvcHandler64Ev: /* Create a KExceptionContext for the exception. */ sub sp, sp, #0x120 @@ -126,10 +126,10 @@ _ZN3ams4kern5arm6412SvcHandler64Ev: stp x26, x27, [sp, #(8 * 26)] stp x28, x29, [sp, #(8 * 28)] - /* Call ams::kern::arm64::HandleException(ams::kern::arm64::KExceptionContext *) */ + /* Call ams::kern::arch::arm64::HandleException(ams::kern::arch::arm64::KExceptionContext *) */ mrs x18, tpidr_el1 mov x0, sp - bl _ZN3ams4kern5arm6415HandleExceptionEPNS1_17KExceptionContextE + bl _ZN3ams4kern4arch5arm6415HandleExceptionEPNS2_17KExceptionContextE /* Restore registers. */ ldp x30, x8, [sp, #(8 * 30)] @@ -189,11 +189,11 @@ _ZN3ams4kern5arm6412SvcHandler64Ev: add sp, sp, #0x120 eret -/* ams::kern::arm64::SvcHandler32() */ -.section .text._ZN3ams4kern5arm6412SvcHandler32Ev, "ax", %progbits -.global _ZN3ams4kern5arm6412SvcHandler32Ev -.type _ZN3ams4kern5arm6412SvcHandler32Ev, %function -_ZN3ams4kern5arm6412SvcHandler32Ev: +/* ams::kern::arch::arm64::SvcHandler32() */ +.section .text._ZN3ams4kern4arch5arm6412SvcHandler32Ev, "ax", %progbits +.global _ZN3ams4kern4arch5arm6412SvcHandler32Ev +.type _ZN3ams4kern4arch5arm6412SvcHandler32Ev, %function +_ZN3ams4kern4arch5arm6412SvcHandler32Ev: /* Ensure that our registers are 32-bit. */ mov w0, w0 mov w1, w1 @@ -299,10 +299,10 @@ _ZN3ams4kern5arm6412SvcHandler32Ev: stp xzr, xzr, [sp, #(8 * 28)] stp xzr, xzr, [sp, #(8 * 30)] - /* Call ams::kern::arm64::HandleException(ams::kern::arm64::KExceptionContext *) */ + /* Call ams::kern::arch::arm64::HandleException(ams::kern::arch::arm64::KExceptionContext *) */ mrs x18, tpidr_el1 mov x0, sp - bl _ZN3ams4kern5arm6415HandleExceptionEPNS1_17KExceptionContextE + bl _ZN3ams4kern4arch5arm6415HandleExceptionEPNS2_17KExceptionContextE /* Restore registers. */ ldp x17, x20, [sp, #(8 * 32)] diff --git a/mesosphere/kernel/source/arch/arm64/exception_vectors.s b/mesosphere/kernel/source/arch/arm64/exception_vectors.s index 12fc17086..df50f6067 100644 --- a/mesosphere/kernel/source/arch/arm64/exception_vectors.s +++ b/mesosphere/kernel/source/arch/arm64/exception_vectors.s @@ -98,11 +98,11 @@ vector_entry serror_sp0 /* Current EL, SPx */ vector_entry synch_spx clrex - b _ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv + b _ZN3ams4kern4arch5arm6430EL1SynchronousExceptionHandlerEv check_vector_size synch_spx vector_entry irq_spx - b _ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv + b _ZN3ams4kern4arch5arm6422EL1IrqExceptionHandlerEv check_vector_size irq_spx vector_entry fiq_spx @@ -114,18 +114,18 @@ vector_entry fiq_spx vector_entry serror_spx clrex nop - b _ZN3ams4kern5arm6421EL1SystemErrorHandlerEv + b _ZN3ams4kern4arch5arm6421EL1SystemErrorHandlerEv check_vector_size serror_spx /* Lower EL, A64 */ vector_entry synch_a64 clrex - b _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv + b _ZN3ams4kern4arch5arm6430EL0SynchronousExceptionHandlerEv check_vector_size synch_a64 vector_entry irq_a64 clrex - b _ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv + b _ZN3ams4kern4arch5arm6422EL0IrqExceptionHandlerEv check_vector_size irq_a64 vector_entry fiq_a64 @@ -137,18 +137,18 @@ vector_entry fiq_a64 vector_entry serror_a64 clrex nop - b _ZN3ams4kern5arm6421EL0SystemErrorHandlerEv + b _ZN3ams4kern4arch5arm6421EL0SystemErrorHandlerEv check_vector_size serror_a64 /* Lower EL, A32 */ vector_entry synch_a32 clrex - b _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv + b _ZN3ams4kern4arch5arm6430EL0SynchronousExceptionHandlerEv check_vector_size synch_a32 vector_entry irq_a32 clrex - b _ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv + b _ZN3ams4kern4arch5arm6422EL0IrqExceptionHandlerEv check_vector_size irq_a32 vector_entry fiq_a32 @@ -160,5 +160,5 @@ vector_entry fiq_a32 vector_entry serror_a32 clrex nop - b _ZN3ams4kern5arm6421EL0SystemErrorHandlerEv + b _ZN3ams4kern4arch5arm6421EL0SystemErrorHandlerEv check_vector_size serror_a32 diff --git a/mesosphere/kernel/source/arch/arm64/init/kern_init_core.cpp b/mesosphere/kernel/source/arch/arm64/init/kern_init_core.cpp index 722649bb2..60c59ea20 100644 --- a/mesosphere/kernel/source/arch/arm64/init/kern_init_core.cpp +++ b/mesosphere/kernel/source/arch/arm64/init/kern_init_core.cpp @@ -90,7 +90,7 @@ namespace ams::kern::init { g_initial_page_allocator.Initialize(initial_page_allocator_state); /* Ensure that the T1SZ is correct (and what we expect). */ - MESOSPHERE_INIT_ABORT_UNLESS((cpu::TranslationControlRegisterAccessor().GetT1Size() / arm64::L1BlockSize) == arm64::MaxPageTableEntries); + MESOSPHERE_INIT_ABORT_UNLESS((cpu::TranslationControlRegisterAccessor().GetT1Size() / arch::arm64::L1BlockSize) == arch::arm64::MaxPageTableEntries); /* Create page table object for use during initialization. */ KInitialPageTable ttbr1_table(util::AlignDown(cpu::GetTtbr1El1(), PageSize), KInitialPageTable::NoClear{}); diff --git a/mesosphere/kernel/source/arch/arm64/init/start.s b/mesosphere/kernel/source/arch/arm64/init/start.s index e769e7c14..d8fdbd97c 100644 --- a/mesosphere/kernel/source/arch/arm64/init/start.s +++ b/mesosphere/kernel/source/arch/arm64/init/start.s @@ -215,7 +215,7 @@ _ZN3ams4kern4init16JumpFromEL2ToEL1Ev: msr elr_el2, x30 /* Flush the entire data cache and invalidate the entire TLB. */ - bl _ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv + bl _ZN3ams4kern4arch5arm643cpu32FlushEntireDataCacheWithoutStackEv /* Setup system registers for deprivileging. */ /* ACTLR_EL2: */ @@ -262,7 +262,7 @@ _ZN3ams4kern4init19DisableMmuAndCachesEv: mov x22, x30 /* Flush the entire data cache and invalidate the entire TLB. */ - bl _ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv + bl _ZN3ams4kern4arch5arm643cpu32FlushEntireDataCacheWithoutStackEv /* Invalidate the instruction cache, and ensure instruction consistency. */ ic ialluis @@ -282,22 +282,22 @@ _ZN3ams4kern4init19DisableMmuAndCachesEv: mov x30, x22 ret -/* ams::kern::arm64::cpu::FlushEntireDataCacheWithoutStack() */ -.section .crt0.text._ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv, "ax", %progbits -.global _ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv -.type _ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv, %function -_ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv: +/* ams::kern::arch::arm64::cpu::FlushEntireDataCacheWithoutStack() */ +.section .crt0.text._ZN3ams4kern4arch5arm643cpu32FlushEntireDataCacheWithoutStackEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm643cpu32FlushEntireDataCacheWithoutStackEv +.type _ZN3ams4kern4arch5arm643cpu32FlushEntireDataCacheWithoutStackEv, %function +_ZN3ams4kern4arch5arm643cpu32FlushEntireDataCacheWithoutStackEv: /* The stack isn't set up, so we'll need to trash a register. */ mov x23, x30 /* Ensure that the cache is coherent. */ - bl _ZN3ams4kern5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv + bl _ZN3ams4kern4arch5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv dsb sy - bl _ZN3ams4kern5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv + bl _ZN3ams4kern4arch5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv dsb sy - bl _ZN3ams4kern5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv + bl _ZN3ams4kern4arch5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv dsb sy /* Invalidate the entire TLB, and ensure instruction consistency. */ @@ -308,11 +308,11 @@ _ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv: mov x30, x23 ret -/* ams::kern::arm64::cpu::FlushEntireDataCacheLocalWithoutStack() */ -.section .crt0.text._ZN3ams4kern5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv, "ax", %progbits -.global _ZN3ams4kern5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv -.type _ZN3ams4kern5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv, %function -_ZN3ams4kern5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv: +/* ams::kern::arch::arm64::cpu::FlushEntireDataCacheLocalWithoutStack() */ +.section .crt0.text._ZN3ams4kern4arch5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv +.type _ZN3ams4kern4arch5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv, %function +_ZN3ams4kern4arch5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv: /* The stack isn't set up, so we'll need to trash a register. */ mov x24, x30 @@ -331,7 +331,7 @@ begin_flush_cache_local_loop: /* FlushEntireDataCacheImplWithoutStack(level); */ mov w0, w9 - bl _ZN3ams4kern5arm643cpu36FlushEntireDataCacheImplWithoutStackEv + bl _ZN3ams4kern4arch5arm643cpu36FlushEntireDataCacheImplWithoutStackEv /* level--; */ sub w9, w9, #1 @@ -343,11 +343,11 @@ done_flush_cache_local_loop: mov x30, x24 ret -/* ams::kern::arm64::cpu::FlushEntireDataCacheSharedWithoutStack() */ -.section .crt0.text._ZN3ams4kern5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv, "ax", %progbits -.global _ZN3ams4kern5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv -.type _ZN3ams4kern5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv, %function -_ZN3ams4kern5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv: +/* ams::kern::arch::arm64::cpu::FlushEntireDataCacheSharedWithoutStack() */ +.section .crt0.text._ZN3ams4kern4arch5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv +.type _ZN3ams4kern4arch5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv, %function +_ZN3ams4kern4arch5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv: /* The stack isn't set up, so we'll need to trash a register. */ mov x24, x30 @@ -367,7 +367,7 @@ begin_flush_cache_shared_loop: /* FlushEntireDataCacheImplWithoutStack(level); */ mov w0, w9 - bl _ZN3ams4kern5arm643cpu36FlushEntireDataCacheImplWithoutStackEv + bl _ZN3ams4kern4arch5arm643cpu36FlushEntireDataCacheImplWithoutStackEv /* level--; */ sub w9, w9, #1 @@ -379,11 +379,11 @@ done_flush_cache_shared_loop: mov x30, x24 ret -/* ams::kern::arm64::cpu::FlushEntireDataCacheImplWithoutStack() */ -.section .crt0.text._ZN3ams4kern5arm643cpu36FlushEntireDataCacheImplWithoutStackEv, "ax", %progbits -.global _ZN3ams4kern5arm643cpu36FlushEntireDataCacheImplWithoutStackEv -.type _ZN3ams4kern5arm643cpu36FlushEntireDataCacheImplWithoutStackEv, %function -_ZN3ams4kern5arm643cpu36FlushEntireDataCacheImplWithoutStackEv: +/* ams::kern::arch::arm64::cpu::FlushEntireDataCacheImplWithoutStack() */ +.section .crt0.text._ZN3ams4kern4arch5arm643cpu36FlushEntireDataCacheImplWithoutStackEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm643cpu36FlushEntireDataCacheImplWithoutStackEv +.type _ZN3ams4kern4arch5arm643cpu36FlushEntireDataCacheImplWithoutStackEv, %function +_ZN3ams4kern4arch5arm643cpu36FlushEntireDataCacheImplWithoutStackEv: /* const u64 level_sel_value = static_cast(level << 1); */ lsl w6, w0, #1 sxtw x6, w6 diff --git a/mesosphere/kernel/source/arch/arm64/kern_exception_handlers_asm.s b/mesosphere/kernel/source/arch/arm64/kern_exception_handlers_asm.s index 68983e504..ccfce293e 100644 --- a/mesosphere/kernel/source/arch/arm64/kern_exception_handlers_asm.s +++ b/mesosphere/kernel/source/arch/arm64/kern_exception_handlers_asm.s @@ -14,11 +14,11 @@ * along with this program. If not, see . */ -/* ams::kern::arm64::EL1IrqExceptionHandler() */ -.section .text._ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv, "ax", %progbits -.global _ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv -.type _ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv, %function -_ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv: +/* ams::kern::arch::arm64::EL1IrqExceptionHandler() */ +.section .text._ZN3ams4kern4arch5arm6422EL1IrqExceptionHandlerEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm6422EL1IrqExceptionHandlerEv +.type _ZN3ams4kern4arch5arm6422EL1IrqExceptionHandlerEv, %function +_ZN3ams4kern4arch5arm6422EL1IrqExceptionHandlerEv: /* Save registers that need saving. */ sub sp, sp, #(8 * 24) @@ -43,7 +43,7 @@ _ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv: /* Invoke KInterruptManager::HandleInterrupt(bool user_mode). */ mrs x18, tpidr_el1 mov x0, #0 - bl _ZN3ams4kern5arm6417KInterruptManager15HandleInterruptEb + bl _ZN3ams4kern4arch5arm6417KInterruptManager15HandleInterruptEb /* Restore registers that we saved. */ msr sp_el0, x19 @@ -68,11 +68,11 @@ _ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv: /* Return from the exception. */ eret -/* ams::kern::arm64::EL0IrqExceptionHandler() */ -.section .text._ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv, "ax", %progbits -.global _ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv -.type _ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv, %function -_ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv: +/* ams::kern::arch::arm64::EL0IrqExceptionHandler() */ +.section .text._ZN3ams4kern4arch5arm6422EL0IrqExceptionHandlerEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm6422EL0IrqExceptionHandlerEv +.type _ZN3ams4kern4arch5arm6422EL0IrqExceptionHandlerEv, %function +_ZN3ams4kern4arch5arm6422EL0IrqExceptionHandlerEv: /* Save registers that need saving. */ sub sp, sp, #(8 * 36) @@ -104,7 +104,7 @@ _ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv: /* Invoke KInterruptManager::HandleInterrupt(bool user_mode). */ mrs x18, tpidr_el1 mov x0, #1 - bl _ZN3ams4kern5arm6417KInterruptManager15HandleInterruptEb + bl _ZN3ams4kern4arch5arm6417KInterruptManager15HandleInterruptEb /* Restore state from the context. */ ldp x30, x20, [sp, #(8 * 30)] @@ -134,11 +134,11 @@ _ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv: /* Return from the exception. */ eret -/* ams::kern::arm64::EL0SynchronousExceptionHandler() */ -.section .text._ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv, "ax", %progbits -.global _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv -.type _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv, %function -_ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv: +/* ams::kern::arch::arm64::EL0SynchronousExceptionHandler() */ +.section .text._ZN3ams4kern4arch5arm6430EL0SynchronousExceptionHandlerEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm6430EL0SynchronousExceptionHandlerEv +.type _ZN3ams4kern4arch5arm6430EL0SynchronousExceptionHandlerEv, %function +_ZN3ams4kern4arch5arm6430EL0SynchronousExceptionHandlerEv: /* Save x16 and x17, so that we can use them as scratch. */ stp x16, x17, [sp, #-16]! @@ -198,10 +198,10 @@ _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv: stp x21, x22, [sp, #(8 * 32)] str x23, [sp, #(8 * 34)] - /* Call ams::kern::arm64::HandleException(ams::kern::arm64::KExceptionContext *) */ + /* Call ams::kern::arch::arm64::HandleException(ams::kern::arch::arm64::KExceptionContext *) */ mrs x18, tpidr_el1 mov x0, sp - bl _ZN3ams4kern5arm6415HandleExceptionEPNS1_17KExceptionContextE + bl _ZN3ams4kern4arch5arm6415HandleExceptionEPNS2_17KExceptionContextE /* Restore state from the context. */ ldp x30, x20, [sp, #(8 * 30)] @@ -233,15 +233,15 @@ _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv: 2: /* SVC from aarch32. */ ldp x16, x17, [sp], 16 - b _ZN3ams4kern5arm6412SvcHandler32Ev + b _ZN3ams4kern4arch5arm6412SvcHandler32Ev 3: /* SVC from aarch64. */ ldp x16, x17, [sp], 16 - b _ZN3ams4kern5arm6412SvcHandler64Ev + b _ZN3ams4kern4arch5arm6412SvcHandler64Ev 4: /* FPU exception. */ ldp x16, x17, [sp], 16 - b _ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv + b _ZN3ams4kern4arch5arm6425FpuAccessExceptionHandlerEv 5: /* Check if there's a TLB conflict that caused the abort. */ and x17, x16, #0x3F @@ -278,11 +278,11 @@ _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv: eret -/* ams::kern::arm64::EL1SynchronousExceptionHandler() */ -.section .text._ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv, "ax", %progbits -.global _ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv -.type _ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv, %function -_ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv: +/* ams::kern::arch::arm64::EL1SynchronousExceptionHandler() */ +.section .text._ZN3ams4kern4arch5arm6430EL1SynchronousExceptionHandlerEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm6430EL1SynchronousExceptionHandlerEv +.type _ZN3ams4kern4arch5arm6430EL1SynchronousExceptionHandlerEv, %function +_ZN3ams4kern4arch5arm6430EL1SynchronousExceptionHandlerEv: /* Nintendo uses the "unused" virtual timer compare value as a scratch register. */ msr cntv_cval_el0, x0 @@ -324,10 +324,10 @@ _ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv: /* Data abort. Check if it was from trying to access userspace memory. */ mrs x1, elr_el1 - adr x0, _ZN3ams4kern5arm6438UserspaceMemoryAccessFunctionAreaBeginEv + adr x0, _ZN3ams4kern4arch5arm6438UserspaceMemoryAccessFunctionAreaBeginEv cmp x1, x0 b.lo 3f - adr x0, _ZN3ams4kern5arm6436UserspaceMemoryAccessFunctionAreaEndEv + adr x0, _ZN3ams4kern4arch5arm6436UserspaceMemoryAccessFunctionAreaEndEv cmp x1, x0 b.hs 3f @@ -387,10 +387,10 @@ _ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv: stp x21, x22, [sp, #(8 * 32)] str x23, [sp, #(8 * 34)] - /* Call ams::kern::arm64::HandleException(ams::kern::arm64::KExceptionContext *) */ + /* Call ams::kern::arch::arm64::HandleException(ams::kern::arch::arm64::KExceptionContext *) */ mrs x18, tpidr_el1 mov x0, sp - bl _ZN3ams4kern5arm6415HandleExceptionEPNS1_17KExceptionContextE + bl _ZN3ams4kern4arch5arm6415HandleExceptionEPNS2_17KExceptionContextE 4: /* HandleException should never return. The best we can do is infinite loop. */ b 4b @@ -434,11 +434,11 @@ _ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv: eret -/* ams::kern::arm64::FpuAccessExceptionHandler() */ -.section .text._ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv, "ax", %progbits -.global _ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv -.type _ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv, %function -_ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv: +/* ams::kern::arch::arm64::FpuAccessExceptionHandler() */ +.section .text._ZN3ams4kern4arch5arm6425FpuAccessExceptionHandlerEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm6425FpuAccessExceptionHandlerEv +.type _ZN3ams4kern4arch5arm6425FpuAccessExceptionHandlerEv, %function +_ZN3ams4kern4arch5arm6425FpuAccessExceptionHandlerEv: /* Save registers that need saving. */ sub sp, sp, #(8 * 24) @@ -461,7 +461,7 @@ _ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv: mrs x21, spsr_el1 /* Invoke the FPU context switch handler. */ - bl _ZN3ams4kern5arm6423FpuContextSwitchHandlerEv + bl _ZN3ams4kern4arch5arm6423FpuContextSwitchHandlerEv /* Restore registers that we saved. */ msr sp_el0, x19 @@ -486,11 +486,11 @@ _ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv: /* Return from the exception. */ eret -/* ams::kern::arm64::EL1SystemErrorHandler() */ -.section .text._ZN3ams4kern5arm6421EL1SystemErrorHandlerEv, "ax", %progbits -.global _ZN3ams4kern5arm6421EL1SystemErrorHandlerEv -.type _ZN3ams4kern5arm6421EL1SystemErrorHandlerEv, %function -_ZN3ams4kern5arm6421EL1SystemErrorHandlerEv: +/* ams::kern::arch::arm64::EL1SystemErrorHandler() */ +.section .text._ZN3ams4kern4arch5arm6421EL1SystemErrorHandlerEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm6421EL1SystemErrorHandlerEv +.type _ZN3ams4kern4arch5arm6421EL1SystemErrorHandlerEv, %function +_ZN3ams4kern4arch5arm6421EL1SystemErrorHandlerEv: /* Nintendo uses the "unused" virtual timer compare value as a scratch register. */ msr cntv_cval_el0, x0 @@ -533,10 +533,10 @@ _ZN3ams4kern5arm6421EL1SystemErrorHandlerEv: stp x21, x22, [sp, #(8 * 32)] str x23, [sp, #(8 * 34)] - /* Invoke ams::kern::arm64::HandleException(ams::kern::arm64::KExceptionContext *). */ + /* Invoke ams::kern::arch::arm64::HandleException(ams::kern::arch::arm64::KExceptionContext *). */ mrs x18, tpidr_el1 mov x0, sp - bl _ZN3ams4kern5arm6415HandleExceptionEPNS1_17KExceptionContextE + bl _ZN3ams4kern4arch5arm6415HandleExceptionEPNS2_17KExceptionContextE 1: /* HandleException should never return. The best we can do is infinite loop. */ b 1b @@ -544,11 +544,11 @@ _ZN3ams4kern5arm6421EL1SystemErrorHandlerEv: /* Return from the exception. */ eret -/* ams::kern::arm64::EL0SystemErrorHandler() */ -.section .text._ZN3ams4kern5arm6421EL0SystemErrorHandlerEv, "ax", %progbits -.global _ZN3ams4kern5arm6421EL0SystemErrorHandlerEv -.type _ZN3ams4kern5arm6421EL0SystemErrorHandlerEv, %function -_ZN3ams4kern5arm6421EL0SystemErrorHandlerEv: +/* ams::kern::arch::arm64::EL0SystemErrorHandler() */ +.section .text._ZN3ams4kern4arch5arm6421EL0SystemErrorHandlerEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm6421EL0SystemErrorHandlerEv +.type _ZN3ams4kern4arch5arm6421EL0SystemErrorHandlerEv, %function +_ZN3ams4kern4arch5arm6421EL0SystemErrorHandlerEv: /* Create a KExceptionContext to pass to HandleException. */ sub sp, sp, #0x120 stp x0, x1, [sp, #(8 * 0)] @@ -575,10 +575,10 @@ _ZN3ams4kern5arm6421EL0SystemErrorHandlerEv: stp x21, x22, [sp, #(8 * 32)] str x23, [sp, #(8 * 34)] - /* Invoke ams::kern::arm64::HandleException(ams::kern::arm64::KExceptionContext *). */ + /* Invoke ams::kern::arch::arm64::HandleException(ams::kern::arch::arm64::KExceptionContext *). */ mrs x18, tpidr_el1 mov x0, sp - bl _ZN3ams4kern5arm6415HandleExceptionEPNS1_17KExceptionContextE + bl _ZN3ams4kern4arch5arm6415HandleExceptionEPNS2_17KExceptionContextE /* Restore state from the context. */ ldp x30, x20, [sp, #(8 * 30)] diff --git a/mesosphere/kernel/source/arch/arm64/kern_k_thread_context_asm.s b/mesosphere/kernel/source/arch/arm64/kern_k_thread_context_asm.s index 730712bf1..2d34cf704 100644 --- a/mesosphere/kernel/source/arch/arm64/kern_k_thread_context_asm.s +++ b/mesosphere/kernel/source/arch/arm64/kern_k_thread_context_asm.s @@ -14,11 +14,11 @@ * along with this program. If not, see . */ -/* ams::kern::arm64::UserModeThreadStarter() */ -.section .text._ZN3ams4kern5arm6421UserModeThreadStarterEv, "ax", %progbits -.global _ZN3ams4kern5arm6421UserModeThreadStarterEv -.type _ZN3ams4kern5arm6421UserModeThreadStarterEv, %function -_ZN3ams4kern5arm6421UserModeThreadStarterEv: +/* ams::kern::arch::arm64::UserModeThreadStarter() */ +.section .text._ZN3ams4kern4arch5arm6421UserModeThreadStarterEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm6421UserModeThreadStarterEv +.type _ZN3ams4kern4arch5arm6421UserModeThreadStarterEv, %function +_ZN3ams4kern4arch5arm6421UserModeThreadStarterEv: /* NOTE: Stack layout on entry looks like following: */ /* SP */ /* | */ @@ -28,8 +28,8 @@ _ZN3ams4kern5arm6421UserModeThreadStarterEv: /* Clear the disable count for this thread's stack parameters. */ str wzr, [sp, #(0x120 + 0x18)] - /* Call ams::kern::arm64::OnThreadStart() */ - bl _ZN3ams4kern5arm6413OnThreadStartEv + /* Call ams::kern::arch::arm64::OnThreadStart() */ + bl _ZN3ams4kern4arch5arm6413OnThreadStartEv /* Restore thread state from the KExceptionContext on stack */ ldp x30, x19, [sp, #(8 * 30)] /* x30 = lr, x19 = sp */ @@ -63,11 +63,11 @@ _ZN3ams4kern5arm6421UserModeThreadStarterEv: /* Return to EL0 */ eret -/* ams::kern::arm64::SupervisorModeThreadStarter() */ -.section .text._ZN3ams4kern5arm6427SupervisorModeThreadStarterEv, "ax", %progbits -.global _ZN3ams4kern5arm6427SupervisorModeThreadStarterEv -.type _ZN3ams4kern5arm6427SupervisorModeThreadStarterEv, %function -_ZN3ams4kern5arm6427SupervisorModeThreadStarterEv: +/* ams::kern::arch::arm64::SupervisorModeThreadStarter() */ +.section .text._ZN3ams4kern4arch5arm6427SupervisorModeThreadStarterEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm6427SupervisorModeThreadStarterEv +.type _ZN3ams4kern4arch5arm6427SupervisorModeThreadStarterEv, %function +_ZN3ams4kern4arch5arm6427SupervisorModeThreadStarterEv: /* NOTE: Stack layout on entry looks like following: */ /* SP */ /* | */ @@ -88,11 +88,11 @@ _ZN3ams4kern5arm6427SupervisorModeThreadStarterEv: eret -/* ams::kern::arm64::KThreadContext::RestoreFpuRegisters64(const KThreadContext &) */ -.section .text._ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_, "ax", %progbits -.global _ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_ -.type _ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_, %function -_ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_: +/* ams::kern::arch::arm64::KThreadContext::RestoreFpuRegisters64(const KThreadContext &) */ +.section .text._ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_, "ax", %progbits +.global _ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_ +.type _ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_, %function +_ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_: /* Load and restore FPCR and FPSR from the context. */ ldr x1, [x0, #0x70] msr fpcr, x1 @@ -119,11 +119,11 @@ _ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_: ret -/* ams::kern::arm64::KThreadContext::RestoreFpuRegisters32(const KThreadContext &) */ -.section .text._ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_, "ax", %progbits -.global _ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_ -.type _ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_, %function -_ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_: +/* ams::kern::arch::arm64::KThreadContext::RestoreFpuRegisters32(const KThreadContext &) */ +.section .text._ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_, "ax", %progbits +.global _ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_ +.type _ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_, %function +_ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_: /* Load and restore FPCR and FPSR from the context. */ ldr x1, [x0, #0x70] msr fpcr, x1 diff --git a/mesosphere/kernel/source/arch/arm64/kern_userspace_memory_access_asm.s b/mesosphere/kernel/source/arch/arm64/kern_userspace_memory_access_asm.s index 3f7deae0b..a2ad76d5d 100644 --- a/mesosphere/kernel/source/arch/arm64/kern_userspace_memory_access_asm.s +++ b/mesosphere/kernel/source/arch/arm64/kern_userspace_memory_access_asm.s @@ -14,11 +14,11 @@ * along with this program. If not, see . */ -/* ams::kern::arm64::UserspaceMemoryAccessFunctionAreaBegin() */ -.section .text._ZN3ams4kern5arm6438UserspaceMemoryAccessFunctionAreaBeginEv, "ax", %progbits -.global _ZN3ams4kern5arm6438UserspaceMemoryAccessFunctionAreaBeginEv -.type _ZN3ams4kern5arm6438UserspaceMemoryAccessFunctionAreaBeginEv, %function -_ZN3ams4kern5arm6438UserspaceMemoryAccessFunctionAreaBeginEv: +/* ams::kern::arch::arm64::UserspaceMemoryAccessFunctionAreaBegin() */ +.section .text._ZN3ams4kern4arch5arm6438UserspaceMemoryAccessFunctionAreaBeginEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm6438UserspaceMemoryAccessFunctionAreaBeginEv +.type _ZN3ams4kern4arch5arm6438UserspaceMemoryAccessFunctionAreaBeginEv, %function +_ZN3ams4kern4arch5arm6438UserspaceMemoryAccessFunctionAreaBeginEv: /* NOTE: This is not a real function, and only exists as a label for safety. */ /* ================ All Userspace Memory Functions after this line. ================ */ @@ -27,9 +27,9 @@ _ZN3ams4kern5arm6438UserspaceMemoryAccessFunctionAreaBeginEv: /* ================ All Userspace Memory Functions before this line. ================ */ -/* ams::kern::arm64::UserspaceMemoryAccessFunctionAreaEnd() */ -.section .text._ZN3ams4kern5arm6436UserspaceMemoryAccessFunctionAreaEndEv, "ax", %progbits -.global _ZN3ams4kern5arm6436UserspaceMemoryAccessFunctionAreaEndEv -.type _ZN3ams4kern5arm6436UserspaceMemoryAccessFunctionAreaEndEv, %function -_ZN3ams4kern5arm6436UserspaceMemoryAccessFunctionAreaEndEv: +/* ams::kern::arch::arm64::UserspaceMemoryAccessFunctionAreaEnd() */ +.section .text._ZN3ams4kern4arch5arm6436UserspaceMemoryAccessFunctionAreaEndEv, "ax", %progbits +.global _ZN3ams4kern4arch5arm6436UserspaceMemoryAccessFunctionAreaEndEv +.type _ZN3ams4kern4arch5arm6436UserspaceMemoryAccessFunctionAreaEndEv, %function +_ZN3ams4kern4arch5arm6436UserspaceMemoryAccessFunctionAreaEndEv: /* NOTE: This is not a real function, and only exists as a label for safety. */ \ No newline at end of file