kern: kern::arm64 -> kern::arch::arm64

This commit is contained in:
Michael Scire 2020-02-14 18:22:55 -08:00
parent 11f70759ce
commit 20b5268e90
47 changed files with 192 additions and 192 deletions

View file

@ -20,7 +20,7 @@
#include <mesosphere/kern_select_cpu.hpp> #include <mesosphere/kern_select_cpu.hpp>
#include <mesosphere/arch/arm64/kern_k_page_table_entry.hpp> #include <mesosphere/arch/arm64/kern_k_page_table_entry.hpp>
namespace ams::kern::arm64::init { namespace ams::kern::arch::arm64::init {
class KInitialPageTable { class KInitialPageTable {
public: public:

View file

@ -17,7 +17,7 @@
#include <vapours.hpp> #include <vapours.hpp>
#include <mesosphere/arch/arm64/kern_cpu_system_registers.hpp> #include <mesosphere/arch/arm64/kern_cpu_system_registers.hpp>
namespace ams::kern::arm64::cpu { namespace ams::kern::arch::arm64::cpu {
#if defined(ATMOSPHERE_CPU_ARM_CORTEX_A57) || defined(ATMOSPHERE_CPU_ARM_CORTEX_A53) #if defined(ATMOSPHERE_CPU_ARM_CORTEX_A57) || defined(ATMOSPHERE_CPU_ARM_CORTEX_A53)
constexpr inline size_t InstructionCacheLineSize = 0x40; constexpr inline size_t InstructionCacheLineSize = 0x40;

View file

@ -16,7 +16,7 @@
#pragma once #pragma once
#include <vapours.hpp> #include <vapours.hpp>
namespace ams::kern::arm64::cpu { namespace ams::kern::arch::arm64::cpu {
#define MESOSPHERE_CPU_GET_SYSREG(name) \ #define MESOSPHERE_CPU_GET_SYSREG(name) \
({ \ ({ \

View file

@ -25,7 +25,7 @@ namespace ams::kern {
} }
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
class KDebug final : public KAutoObjectWithSlabHeapAndContainer<KDebug, KDebugBase> { class KDebug final : public KAutoObjectWithSlabHeapAndContainer<KDebug, KDebugBase> {
MESOSPHERE_AUTOOBJECT_TRAITS(KDebug, KSynchronizationObject); MESOSPHERE_AUTOOBJECT_TRAITS(KDebug, KSynchronizationObject);

View file

@ -16,7 +16,7 @@
#pragma once #pragma once
#include <mesosphere/kern_common.hpp> #include <mesosphere/kern_common.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
struct KExceptionContext { struct KExceptionContext {
u64 x[(30 - 0) + 1]; u64 x[(30 - 0) + 1];

View file

@ -17,7 +17,7 @@
#include <mesosphere/kern_select_cpu.hpp> #include <mesosphere/kern_select_cpu.hpp>
#include <mesosphere/kern_k_hardware_timer_base.hpp> #include <mesosphere/kern_k_hardware_timer_base.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
namespace impl { namespace impl {

View file

@ -18,7 +18,7 @@
#include <mesosphere/kern_select_cpu.hpp> #include <mesosphere/kern_select_cpu.hpp>
#include <mesosphere/kern_k_typed_address.hpp> #include <mesosphere/kern_k_typed_address.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
struct GicDistributor { struct GicDistributor {
u32 ctlr; u32 ctlr;

View file

@ -20,7 +20,7 @@
#include <mesosphere/kern_k_interrupt_task.hpp> #include <mesosphere/kern_k_interrupt_task.hpp>
#include <mesosphere/kern_select_interrupt_controller.hpp> #include <mesosphere/kern_select_interrupt_controller.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
class KInterruptManager { class KInterruptManager {
NON_COPYABLE(KInterruptManager); NON_COPYABLE(KInterruptManager);

View file

@ -15,7 +15,7 @@
*/ */
#pragma once #pragma once
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
namespace interrupt_name { namespace interrupt_name {

View file

@ -20,7 +20,7 @@
#include <mesosphere/kern_k_page_group.hpp> #include <mesosphere/kern_k_page_group.hpp>
#include <mesosphere/kern_k_page_table_manager.hpp> #include <mesosphere/kern_k_page_table_manager.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
class KPageTable : public KPageTableBase { class KPageTable : public KPageTableBase {
NON_COPYABLE(KPageTable); NON_COPYABLE(KPageTable);

View file

@ -18,7 +18,7 @@
#include <mesosphere/kern_select_cpu.hpp> #include <mesosphere/kern_select_cpu.hpp>
#include <mesosphere/kern_k_typed_address.hpp> #include <mesosphere/kern_k_typed_address.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
constexpr size_t L1BlockSize = 1_GB; constexpr size_t L1BlockSize = 1_GB;
constexpr size_t L2BlockSize = 2_MB; constexpr size_t L2BlockSize = 2_MB;

View file

@ -20,7 +20,7 @@
#include <mesosphere/kern_k_memory_layout.hpp> #include <mesosphere/kern_k_memory_layout.hpp>
#include <mesosphere/arch/arm64/kern_k_page_table_entry.hpp> #include <mesosphere/arch/arm64/kern_k_page_table_entry.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
/* TODO: This seems worse than KInitialPageTable. Can we fulfill Nintendo's API using KInitialPageTable? */ /* 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. */ /* KInitialPageTable is significantly nicer, but doesn't have KPageTableImpl's traversal semantics. */

View file

@ -17,7 +17,7 @@
#include <mesosphere/kern_common.hpp> #include <mesosphere/kern_common.hpp>
#include <mesosphere/arch/arm64/kern_k_page_table.hpp> #include <mesosphere/arch/arm64/kern_k_page_table.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
class KProcessPageTable { class KProcessPageTable {

View file

@ -17,7 +17,7 @@
#include <vapours.hpp> #include <vapours.hpp>
#include <mesosphere/kern_select_cpu.hpp> #include <mesosphere/kern_select_cpu.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
class KNotAlignedSpinLock { class KNotAlignedSpinLock {
private: private:

View file

@ -18,7 +18,7 @@
#include <mesosphere/kern_select_cpu.hpp> #include <mesosphere/kern_select_cpu.hpp>
#include <mesosphere/arch/arm64/kern_k_page_table.hpp> #include <mesosphere/arch/arm64/kern_k_page_table.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
class KSupervisorPageTable { class KSupervisorPageTable {
private: private:

View file

@ -23,7 +23,7 @@ namespace ams::kern {
} }
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
class KThreadContext { class KThreadContext {
public: public:

View file

@ -16,7 +16,7 @@
#pragma once #pragma once
#include <mesosphere/kern_common.hpp> #include <mesosphere/kern_common.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
void UserspaceMemoryAccessFunctionAreaBegin(); void UserspaceMemoryAccessFunctionAreaBegin();

View file

@ -20,9 +20,9 @@
#include <mesosphere/arch/arm64/init/kern_k_init_page_table.hpp> #include <mesosphere/arch/arm64/init/kern_k_init_page_table.hpp>
namespace ams::kern::init { namespace ams::kern::init {
using ams::kern::arm64::PageTableEntry; using ams::kern::arch::arm64::PageTableEntry;
using ams::kern::arm64::init::KInitialPageTable; using ams::kern::arch::arm64::init::KInitialPageTable;
using ams::kern::arm64::init::KInitialPageAllocator; using ams::kern::arch::arm64::init::KInitialPageAllocator;
} }
#else #else
#error "Unknown architecture for KInitialPageTable" #error "Unknown architecture for KInitialPageTable"

View file

@ -19,7 +19,7 @@
#include <mesosphere/arch/arm64/kern_k_exception_context.hpp> #include <mesosphere/arch/arm64/kern_k_exception_context.hpp>
namespace ams::kern { namespace ams::kern {
using ams::kern::arm64::KExceptionContext; using ams::kern::arch::arm64::KExceptionContext;
} }
#else #else
#error "Unknown board for KExceptionContext" #error "Unknown board for KExceptionContext"

View file

@ -21,9 +21,9 @@
#include <mesosphere/arch/arm64/kern_k_spin_lock.hpp> #include <mesosphere/arch/arm64/kern_k_spin_lock.hpp>
namespace ams::kern { namespace ams::kern {
using ams::kern::arm64::KAlignedSpinLock; using ams::kern::arch::arm64::KAlignedSpinLock;
using ams::kern::arm64::KNotAlignedSpinLock; using ams::kern::arch::arm64::KNotAlignedSpinLock;
using ams::kern::arm64::KSpinLock; using ams::kern::arch::arm64::KSpinLock;
} }
#else #else

View file

@ -19,7 +19,7 @@
#include <mesosphere/arch/arm64/kern_k_thread_context.hpp> #include <mesosphere/arch/arm64/kern_k_thread_context.hpp>
namespace ams::kern { namespace ams::kern {
using ams::kern::arm64::KThreadContext; using ams::kern::arch::arm64::KThreadContext;
} }
#else #else
#error "Unknown board for KThreadContext" #error "Unknown board for KThreadContext"

View file

@ -39,10 +39,10 @@ namespace ams::kern {
#if defined(ATMOSPHERE_ARCH_ARM64) #if defined(ATMOSPHERE_ARCH_ARM64)
namespace arm64 { namespace arch::arm64 {
class KSupervisorPageTable; class KSupervisorPageTable;
} }
using ams::kern::arm64::KSupervisorPageTable; using ams::kern::arch::arm64::KSupervisorPageTable;
#else #else

View file

@ -21,7 +21,7 @@
namespace ams::kern::cpu { namespace ams::kern::cpu {
using namespace ams::kern::arm64::cpu; using namespace ams::kern::arch::arm64::cpu;
} }

View file

@ -20,7 +20,7 @@
#include <mesosphere/arch/arm64/kern_k_debug.hpp> #include <mesosphere/arch/arm64/kern_k_debug.hpp>
namespace ams::kern { namespace ams::kern {
using ams::kern::arm64::KDebug; using ams::kern::arch::arm64::KDebug;
} }
#else #else

View file

@ -20,7 +20,7 @@
#include <mesosphere/arch/arm64/kern_k_hardware_timer.hpp> #include <mesosphere/arch/arm64/kern_k_hardware_timer.hpp>
namespace ams::kern { namespace ams::kern {
using ams::kern::arm64::KHardwareTimer; using ams::kern::arch::arm64::KHardwareTimer;
} }
#else #else

View file

@ -21,7 +21,7 @@
#include <mesosphere/arch/arm64/kern_k_interrupt_controller.hpp> #include <mesosphere/arch/arm64/kern_k_interrupt_controller.hpp>
namespace ams::kern { namespace ams::kern {
using ams::kern::arm64::KInterruptController; using ams::kern::arch::arm64::KInterruptController;
} }
#else #else

View file

@ -21,7 +21,7 @@
#include <mesosphere/arch/arm64/kern_k_interrupt_manager.hpp> #include <mesosphere/arch/arm64/kern_k_interrupt_manager.hpp>
namespace ams::kern { namespace ams::kern {
using ams::kern::arm64::KInterruptManager; using ams::kern::arch::arm64::KInterruptManager;
} }
#else #else

View file

@ -20,7 +20,7 @@
#include <mesosphere/arch/arm64/kern_k_interrupt_name.hpp> #include <mesosphere/arch/arm64/kern_k_interrupt_name.hpp>
namespace ams::kern { namespace ams::kern {
using namespace ams::kern::arm64::interrupt_name; using namespace ams::kern::arch::arm64::interrupt_name;
} }
#else #else

View file

@ -22,9 +22,9 @@
#include <mesosphere/arch/arm64/kern_k_supervisor_page_table.hpp> #include <mesosphere/arch/arm64/kern_k_supervisor_page_table.hpp>
#include <mesosphere/arch/arm64/kern_k_process_page_table.hpp> #include <mesosphere/arch/arm64/kern_k_process_page_table.hpp>
namespace ams::kern { namespace ams::kern {
using ams::kern::arm64::KPageTable; using ams::kern::arch::arm64::KPageTable;
using ams::kern::arm64::KSupervisorPageTable; using ams::kern::arch::arm64::KSupervisorPageTable;
using ams::kern::arm64::KProcessPageTable; using ams::kern::arch::arm64::KProcessPageTable;
} }
#else #else

View file

@ -20,7 +20,7 @@
#include <mesosphere/arch/arm64/kern_k_page_table_impl.hpp> #include <mesosphere/arch/arm64/kern_k_page_table_impl.hpp>
namespace ams::kern { namespace ams::kern {
using ams::kern::arm64::KPageTableImpl; using ams::kern::arch::arm64::KPageTableImpl;
} }
#else #else

View file

@ -15,7 +15,7 @@
*/ */
#include <mesosphere.hpp> #include <mesosphere.hpp>
namespace ams::kern::arm64::cpu { namespace ams::kern::arch::arm64::cpu {
/* Declare prototype to be implemented in asm. */ /* Declare prototype to be implemented in asm. */
void SynchronizeAllCoresImpl(s32 *sync_var, s32 num_cores); void SynchronizeAllCoresImpl(s32 *sync_var, s32 num_cores);

View file

@ -14,11 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* ams::kern::arm64::cpu::SynchronizeAllCoresImpl(int *sync_var, int num_cores) */ /* ams::kern::arch::arm64::cpu::SynchronizeAllCoresImpl(int *sync_var, int num_cores) */
.section .text._ZN3ams4kern5arm643cpu23SynchronizeAllCoresImplEPii, "ax", %progbits .section .text._ZN3ams4kern4arch5arm643cpu23SynchronizeAllCoresImplEPii, "ax", %progbits
.global _ZN3ams4kern5arm643cpu23SynchronizeAllCoresImplEPii .global _ZN3ams4kern4arch5arm643cpu23SynchronizeAllCoresImplEPii
.type _ZN3ams4kern5arm643cpu23SynchronizeAllCoresImplEPii, %function .type _ZN3ams4kern4arch5arm643cpu23SynchronizeAllCoresImplEPii, %function
_ZN3ams4kern5arm643cpu23SynchronizeAllCoresImplEPii: _ZN3ams4kern4arch5arm643cpu23SynchronizeAllCoresImplEPii:
/* Loop until the sync var is less than num cores. */ /* Loop until the sync var is less than num cores. */
sevl sevl
1: 1:
@ -63,11 +63,11 @@ _ZN3ams4kern5arm643cpu23SynchronizeAllCoresImplEPii:
ret ret
/* ams::kern::arm64::cpu::ClearPageToZero(void *) */ /* ams::kern::arch::arm64::cpu::ClearPageToZero(void *) */
.section .text._ZN3ams4kern5arm643cpu19ClearPageToZeroImplEPv, "ax", %progbits .section .text._ZN3ams4kern4arch5arm643cpu19ClearPageToZeroImplEPv, "ax", %progbits
.global _ZN3ams4kern5arm643cpu19ClearPageToZeroImplEPv .global _ZN3ams4kern4arch5arm643cpu19ClearPageToZeroImplEPv
.type _ZN3ams4kern5arm643cpu19ClearPageToZeroImplEPv, %function .type _ZN3ams4kern4arch5arm643cpu19ClearPageToZeroImplEPv, %function
_ZN3ams4kern5arm643cpu19ClearPageToZeroImplEPv: _ZN3ams4kern4arch5arm643cpu19ClearPageToZeroImplEPv:
/* Efficiently clear the page using dc zva. */ /* Efficiently clear the page using dc zva. */
dc zva, x0 dc zva, x0
add x8, x0, #0x040 add x8, x0, #0x040

View file

@ -15,7 +15,7 @@
*/ */
#include <mesosphere.hpp> #include <mesosphere.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
namespace { namespace {

View file

@ -15,7 +15,7 @@
*/ */
#include <mesosphere.hpp> #include <mesosphere.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
namespace impl { namespace impl {

View file

@ -15,7 +15,7 @@
*/ */
#include <mesosphere.hpp> #include <mesosphere.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
void KInterruptController::SetupInterruptLines(s32 core_id) const { void KInterruptController::SetupInterruptLines(s32 core_id) const {
const size_t ITLines = (core_id == 0) ? 32 * ((this->gicd->typer & 0x1F) + 1) : NumLocalInterrupts; const size_t ITLines = (core_id == 0) ? 32 * ((this->gicd->typer & 0x1F) + 1) : NumLocalInterrupts;

View file

@ -15,7 +15,7 @@
*/ */
#include <mesosphere.hpp> #include <mesosphere.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
/* Instantiate static members in specific translation unit. */ /* Instantiate static members in specific translation unit. */
KSpinLock KInterruptManager::s_lock; KSpinLock KInterruptManager::s_lock;

View file

@ -15,7 +15,7 @@
*/ */
#include <mesosphere.hpp> #include <mesosphere.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
void KPageTable::Initialize(s32 core_id) { void KPageTable::Initialize(s32 core_id) {
/* Nothing actually needed here. */ /* Nothing actually needed here. */

View file

@ -15,7 +15,7 @@
*/ */
#include <mesosphere.hpp> #include <mesosphere.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
void KPageTableImpl::InitializeForKernel(void *tb, KVirtualAddress start, KVirtualAddress end) { void KPageTableImpl::InitializeForKernel(void *tb, KVirtualAddress start, KVirtualAddress end) {
this->table = static_cast<L1PageTableEntry *>(tb); this->table = static_cast<L1PageTableEntry *>(tb);

View file

@ -15,7 +15,7 @@
*/ */
#include <mesosphere.hpp> #include <mesosphere.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
void KSupervisorPageTable::Initialize(s32 core_id) { void KSupervisorPageTable::Initialize(s32 core_id) {
/* Get the identity mapping ttbr0. */ /* Get the identity mapping ttbr0. */

View file

@ -15,7 +15,7 @@
*/ */
#include <mesosphere.hpp> #include <mesosphere.hpp>
namespace ams::kern::arm64 { namespace ams::kern::arch::arm64 {
/* These are implemented elsewhere (asm). */ /* These are implemented elsewhere (asm). */
void UserModeThreadStarter(); void UserModeThreadStarter();
@ -96,7 +96,7 @@ namespace ams::kern::arm64 {
/* Determine LR and SP. */ /* Determine LR and SP. */
if (is_user) { if (is_user) {
/* Usermode thread. */ /* Usermode thread. */
this->lr = reinterpret_cast<uintptr_t>(::ams::kern::arm64::UserModeThreadStarter); this->lr = reinterpret_cast<uintptr_t>(::ams::kern::arch::arm64::UserModeThreadStarter);
this->sp = SetupStackForUserModeThreadStarter(u_pc, k_sp, u_sp, arg, is_64_bit); this->sp = SetupStackForUserModeThreadStarter(u_pc, k_sp, u_sp, arg, is_64_bit);
} else { } else {
/* Kernel thread. */ /* Kernel thread. */
@ -108,7 +108,7 @@ namespace ams::kern::arm64 {
this->sp = GetInteger(k_sp); this->sp = GetInteger(k_sp);
} else { } else {
/* Generic Kernel thread. */ /* Generic Kernel thread. */
this->lr = reinterpret_cast<uintptr_t>(::ams::kern::arm64::SupervisorModeThreadStarter); this->lr = reinterpret_cast<uintptr_t>(::ams::kern::arch::arm64::SupervisorModeThreadStarter);
this->sp = SetupStackForSupervisorModeThreadStarter(u_pc, k_sp, arg); this->sp = SetupStackForSupervisorModeThreadStarter(u_pc, k_sp, arg);
} }
} }

View file

@ -14,11 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* ams::kern::arm64::SvcHandler64() */ /* ams::kern::arch::arm64::SvcHandler64() */
.section .text._ZN3ams4kern5arm6412SvcHandler64Ev, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6412SvcHandler64Ev, "ax", %progbits
.global _ZN3ams4kern5arm6412SvcHandler64Ev .global _ZN3ams4kern4arch5arm6412SvcHandler64Ev
.type _ZN3ams4kern5arm6412SvcHandler64Ev, %function .type _ZN3ams4kern4arch5arm6412SvcHandler64Ev, %function
_ZN3ams4kern5arm6412SvcHandler64Ev: _ZN3ams4kern4arch5arm6412SvcHandler64Ev:
/* Create a KExceptionContext for the exception. */ /* Create a KExceptionContext for the exception. */
sub sp, sp, #0x120 sub sp, sp, #0x120
@ -126,10 +126,10 @@ _ZN3ams4kern5arm6412SvcHandler64Ev:
stp x26, x27, [sp, #(8 * 26)] stp x26, x27, [sp, #(8 * 26)]
stp x28, x29, [sp, #(8 * 28)] 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 mrs x18, tpidr_el1
mov x0, sp mov x0, sp
bl _ZN3ams4kern5arm6415HandleExceptionEPNS1_17KExceptionContextE bl _ZN3ams4kern4arch5arm6415HandleExceptionEPNS2_17KExceptionContextE
/* Restore registers. */ /* Restore registers. */
ldp x30, x8, [sp, #(8 * 30)] ldp x30, x8, [sp, #(8 * 30)]
@ -189,11 +189,11 @@ _ZN3ams4kern5arm6412SvcHandler64Ev:
add sp, sp, #0x120 add sp, sp, #0x120
eret eret
/* ams::kern::arm64::SvcHandler32() */ /* ams::kern::arch::arm64::SvcHandler32() */
.section .text._ZN3ams4kern5arm6412SvcHandler32Ev, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6412SvcHandler32Ev, "ax", %progbits
.global _ZN3ams4kern5arm6412SvcHandler32Ev .global _ZN3ams4kern4arch5arm6412SvcHandler32Ev
.type _ZN3ams4kern5arm6412SvcHandler32Ev, %function .type _ZN3ams4kern4arch5arm6412SvcHandler32Ev, %function
_ZN3ams4kern5arm6412SvcHandler32Ev: _ZN3ams4kern4arch5arm6412SvcHandler32Ev:
/* Ensure that our registers are 32-bit. */ /* Ensure that our registers are 32-bit. */
mov w0, w0 mov w0, w0
mov w1, w1 mov w1, w1
@ -299,10 +299,10 @@ _ZN3ams4kern5arm6412SvcHandler32Ev:
stp xzr, xzr, [sp, #(8 * 28)] stp xzr, xzr, [sp, #(8 * 28)]
stp xzr, xzr, [sp, #(8 * 30)] 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 mrs x18, tpidr_el1
mov x0, sp mov x0, sp
bl _ZN3ams4kern5arm6415HandleExceptionEPNS1_17KExceptionContextE bl _ZN3ams4kern4arch5arm6415HandleExceptionEPNS2_17KExceptionContextE
/* Restore registers. */ /* Restore registers. */
ldp x17, x20, [sp, #(8 * 32)] ldp x17, x20, [sp, #(8 * 32)]

View file

@ -98,11 +98,11 @@ vector_entry serror_sp0
/* Current EL, SPx */ /* Current EL, SPx */
vector_entry synch_spx vector_entry synch_spx
clrex clrex
b _ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv b _ZN3ams4kern4arch5arm6430EL1SynchronousExceptionHandlerEv
check_vector_size synch_spx check_vector_size synch_spx
vector_entry irq_spx vector_entry irq_spx
b _ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv b _ZN3ams4kern4arch5arm6422EL1IrqExceptionHandlerEv
check_vector_size irq_spx check_vector_size irq_spx
vector_entry fiq_spx vector_entry fiq_spx
@ -114,18 +114,18 @@ vector_entry fiq_spx
vector_entry serror_spx vector_entry serror_spx
clrex clrex
nop nop
b _ZN3ams4kern5arm6421EL1SystemErrorHandlerEv b _ZN3ams4kern4arch5arm6421EL1SystemErrorHandlerEv
check_vector_size serror_spx check_vector_size serror_spx
/* Lower EL, A64 */ /* Lower EL, A64 */
vector_entry synch_a64 vector_entry synch_a64
clrex clrex
b _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv b _ZN3ams4kern4arch5arm6430EL0SynchronousExceptionHandlerEv
check_vector_size synch_a64 check_vector_size synch_a64
vector_entry irq_a64 vector_entry irq_a64
clrex clrex
b _ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv b _ZN3ams4kern4arch5arm6422EL0IrqExceptionHandlerEv
check_vector_size irq_a64 check_vector_size irq_a64
vector_entry fiq_a64 vector_entry fiq_a64
@ -137,18 +137,18 @@ vector_entry fiq_a64
vector_entry serror_a64 vector_entry serror_a64
clrex clrex
nop nop
b _ZN3ams4kern5arm6421EL0SystemErrorHandlerEv b _ZN3ams4kern4arch5arm6421EL0SystemErrorHandlerEv
check_vector_size serror_a64 check_vector_size serror_a64
/* Lower EL, A32 */ /* Lower EL, A32 */
vector_entry synch_a32 vector_entry synch_a32
clrex clrex
b _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv b _ZN3ams4kern4arch5arm6430EL0SynchronousExceptionHandlerEv
check_vector_size synch_a32 check_vector_size synch_a32
vector_entry irq_a32 vector_entry irq_a32
clrex clrex
b _ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv b _ZN3ams4kern4arch5arm6422EL0IrqExceptionHandlerEv
check_vector_size irq_a32 check_vector_size irq_a32
vector_entry fiq_a32 vector_entry fiq_a32
@ -160,5 +160,5 @@ vector_entry fiq_a32
vector_entry serror_a32 vector_entry serror_a32
clrex clrex
nop nop
b _ZN3ams4kern5arm6421EL0SystemErrorHandlerEv b _ZN3ams4kern4arch5arm6421EL0SystemErrorHandlerEv
check_vector_size serror_a32 check_vector_size serror_a32

View file

@ -90,7 +90,7 @@ namespace ams::kern::init {
g_initial_page_allocator.Initialize(initial_page_allocator_state); g_initial_page_allocator.Initialize(initial_page_allocator_state);
/* Ensure that the T1SZ is correct (and what we expect). */ /* 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. */ /* Create page table object for use during initialization. */
KInitialPageTable ttbr1_table(util::AlignDown(cpu::GetTtbr1El1(), PageSize), KInitialPageTable::NoClear{}); KInitialPageTable ttbr1_table(util::AlignDown(cpu::GetTtbr1El1(), PageSize), KInitialPageTable::NoClear{});

View file

@ -215,7 +215,7 @@ _ZN3ams4kern4init16JumpFromEL2ToEL1Ev:
msr elr_el2, x30 msr elr_el2, x30
/* Flush the entire data cache and invalidate the entire TLB. */ /* Flush the entire data cache and invalidate the entire TLB. */
bl _ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv bl _ZN3ams4kern4arch5arm643cpu32FlushEntireDataCacheWithoutStackEv
/* Setup system registers for deprivileging. */ /* Setup system registers for deprivileging. */
/* ACTLR_EL2: */ /* ACTLR_EL2: */
@ -262,7 +262,7 @@ _ZN3ams4kern4init19DisableMmuAndCachesEv:
mov x22, x30 mov x22, x30
/* Flush the entire data cache and invalidate the entire TLB. */ /* Flush the entire data cache and invalidate the entire TLB. */
bl _ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv bl _ZN3ams4kern4arch5arm643cpu32FlushEntireDataCacheWithoutStackEv
/* Invalidate the instruction cache, and ensure instruction consistency. */ /* Invalidate the instruction cache, and ensure instruction consistency. */
ic ialluis ic ialluis
@ -282,22 +282,22 @@ _ZN3ams4kern4init19DisableMmuAndCachesEv:
mov x30, x22 mov x30, x22
ret ret
/* ams::kern::arm64::cpu::FlushEntireDataCacheWithoutStack() */ /* ams::kern::arch::arm64::cpu::FlushEntireDataCacheWithoutStack() */
.section .crt0.text._ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv, "ax", %progbits .section .crt0.text._ZN3ams4kern4arch5arm643cpu32FlushEntireDataCacheWithoutStackEv, "ax", %progbits
.global _ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv .global _ZN3ams4kern4arch5arm643cpu32FlushEntireDataCacheWithoutStackEv
.type _ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv, %function .type _ZN3ams4kern4arch5arm643cpu32FlushEntireDataCacheWithoutStackEv, %function
_ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv: _ZN3ams4kern4arch5arm643cpu32FlushEntireDataCacheWithoutStackEv:
/* The stack isn't set up, so we'll need to trash a register. */ /* The stack isn't set up, so we'll need to trash a register. */
mov x23, x30 mov x23, x30
/* Ensure that the cache is coherent. */ /* Ensure that the cache is coherent. */
bl _ZN3ams4kern5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv bl _ZN3ams4kern4arch5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv
dsb sy dsb sy
bl _ZN3ams4kern5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv bl _ZN3ams4kern4arch5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv
dsb sy dsb sy
bl _ZN3ams4kern5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv bl _ZN3ams4kern4arch5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv
dsb sy dsb sy
/* Invalidate the entire TLB, and ensure instruction consistency. */ /* Invalidate the entire TLB, and ensure instruction consistency. */
@ -308,11 +308,11 @@ _ZN3ams4kern5arm643cpu32FlushEntireDataCacheWithoutStackEv:
mov x30, x23 mov x30, x23
ret ret
/* ams::kern::arm64::cpu::FlushEntireDataCacheLocalWithoutStack() */ /* ams::kern::arch::arm64::cpu::FlushEntireDataCacheLocalWithoutStack() */
.section .crt0.text._ZN3ams4kern5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv, "ax", %progbits .section .crt0.text._ZN3ams4kern4arch5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv, "ax", %progbits
.global _ZN3ams4kern5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv .global _ZN3ams4kern4arch5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv
.type _ZN3ams4kern5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv, %function .type _ZN3ams4kern4arch5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv, %function
_ZN3ams4kern5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv: _ZN3ams4kern4arch5arm643cpu37FlushEntireDataCacheLocalWithoutStackEv:
/* The stack isn't set up, so we'll need to trash a register. */ /* The stack isn't set up, so we'll need to trash a register. */
mov x24, x30 mov x24, x30
@ -331,7 +331,7 @@ begin_flush_cache_local_loop:
/* FlushEntireDataCacheImplWithoutStack(level); */ /* FlushEntireDataCacheImplWithoutStack(level); */
mov w0, w9 mov w0, w9
bl _ZN3ams4kern5arm643cpu36FlushEntireDataCacheImplWithoutStackEv bl _ZN3ams4kern4arch5arm643cpu36FlushEntireDataCacheImplWithoutStackEv
/* level--; */ /* level--; */
sub w9, w9, #1 sub w9, w9, #1
@ -343,11 +343,11 @@ done_flush_cache_local_loop:
mov x30, x24 mov x30, x24
ret ret
/* ams::kern::arm64::cpu::FlushEntireDataCacheSharedWithoutStack() */ /* ams::kern::arch::arm64::cpu::FlushEntireDataCacheSharedWithoutStack() */
.section .crt0.text._ZN3ams4kern5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv, "ax", %progbits .section .crt0.text._ZN3ams4kern4arch5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv, "ax", %progbits
.global _ZN3ams4kern5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv .global _ZN3ams4kern4arch5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv
.type _ZN3ams4kern5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv, %function .type _ZN3ams4kern4arch5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv, %function
_ZN3ams4kern5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv: _ZN3ams4kern4arch5arm643cpu38FlushEntireDataCacheSharedWithoutStackEv:
/* The stack isn't set up, so we'll need to trash a register. */ /* The stack isn't set up, so we'll need to trash a register. */
mov x24, x30 mov x24, x30
@ -367,7 +367,7 @@ begin_flush_cache_shared_loop:
/* FlushEntireDataCacheImplWithoutStack(level); */ /* FlushEntireDataCacheImplWithoutStack(level); */
mov w0, w9 mov w0, w9
bl _ZN3ams4kern5arm643cpu36FlushEntireDataCacheImplWithoutStackEv bl _ZN3ams4kern4arch5arm643cpu36FlushEntireDataCacheImplWithoutStackEv
/* level--; */ /* level--; */
sub w9, w9, #1 sub w9, w9, #1
@ -379,11 +379,11 @@ done_flush_cache_shared_loop:
mov x30, x24 mov x30, x24
ret ret
/* ams::kern::arm64::cpu::FlushEntireDataCacheImplWithoutStack() */ /* ams::kern::arch::arm64::cpu::FlushEntireDataCacheImplWithoutStack() */
.section .crt0.text._ZN3ams4kern5arm643cpu36FlushEntireDataCacheImplWithoutStackEv, "ax", %progbits .section .crt0.text._ZN3ams4kern4arch5arm643cpu36FlushEntireDataCacheImplWithoutStackEv, "ax", %progbits
.global _ZN3ams4kern5arm643cpu36FlushEntireDataCacheImplWithoutStackEv .global _ZN3ams4kern4arch5arm643cpu36FlushEntireDataCacheImplWithoutStackEv
.type _ZN3ams4kern5arm643cpu36FlushEntireDataCacheImplWithoutStackEv, %function .type _ZN3ams4kern4arch5arm643cpu36FlushEntireDataCacheImplWithoutStackEv, %function
_ZN3ams4kern5arm643cpu36FlushEntireDataCacheImplWithoutStackEv: _ZN3ams4kern4arch5arm643cpu36FlushEntireDataCacheImplWithoutStackEv:
/* const u64 level_sel_value = static_cast<u64>(level << 1); */ /* const u64 level_sel_value = static_cast<u64>(level << 1); */
lsl w6, w0, #1 lsl w6, w0, #1
sxtw x6, w6 sxtw x6, w6

View file

@ -14,11 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* ams::kern::arm64::EL1IrqExceptionHandler() */ /* ams::kern::arch::arm64::EL1IrqExceptionHandler() */
.section .text._ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6422EL1IrqExceptionHandlerEv, "ax", %progbits
.global _ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv .global _ZN3ams4kern4arch5arm6422EL1IrqExceptionHandlerEv
.type _ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv, %function .type _ZN3ams4kern4arch5arm6422EL1IrqExceptionHandlerEv, %function
_ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv: _ZN3ams4kern4arch5arm6422EL1IrqExceptionHandlerEv:
/* Save registers that need saving. */ /* Save registers that need saving. */
sub sp, sp, #(8 * 24) sub sp, sp, #(8 * 24)
@ -43,7 +43,7 @@ _ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv:
/* Invoke KInterruptManager::HandleInterrupt(bool user_mode). */ /* Invoke KInterruptManager::HandleInterrupt(bool user_mode). */
mrs x18, tpidr_el1 mrs x18, tpidr_el1
mov x0, #0 mov x0, #0
bl _ZN3ams4kern5arm6417KInterruptManager15HandleInterruptEb bl _ZN3ams4kern4arch5arm6417KInterruptManager15HandleInterruptEb
/* Restore registers that we saved. */ /* Restore registers that we saved. */
msr sp_el0, x19 msr sp_el0, x19
@ -68,11 +68,11 @@ _ZN3ams4kern5arm6422EL1IrqExceptionHandlerEv:
/* Return from the exception. */ /* Return from the exception. */
eret eret
/* ams::kern::arm64::EL0IrqExceptionHandler() */ /* ams::kern::arch::arm64::EL0IrqExceptionHandler() */
.section .text._ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6422EL0IrqExceptionHandlerEv, "ax", %progbits
.global _ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv .global _ZN3ams4kern4arch5arm6422EL0IrqExceptionHandlerEv
.type _ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv, %function .type _ZN3ams4kern4arch5arm6422EL0IrqExceptionHandlerEv, %function
_ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv: _ZN3ams4kern4arch5arm6422EL0IrqExceptionHandlerEv:
/* Save registers that need saving. */ /* Save registers that need saving. */
sub sp, sp, #(8 * 36) sub sp, sp, #(8 * 36)
@ -104,7 +104,7 @@ _ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv:
/* Invoke KInterruptManager::HandleInterrupt(bool user_mode). */ /* Invoke KInterruptManager::HandleInterrupt(bool user_mode). */
mrs x18, tpidr_el1 mrs x18, tpidr_el1
mov x0, #1 mov x0, #1
bl _ZN3ams4kern5arm6417KInterruptManager15HandleInterruptEb bl _ZN3ams4kern4arch5arm6417KInterruptManager15HandleInterruptEb
/* Restore state from the context. */ /* Restore state from the context. */
ldp x30, x20, [sp, #(8 * 30)] ldp x30, x20, [sp, #(8 * 30)]
@ -134,11 +134,11 @@ _ZN3ams4kern5arm6422EL0IrqExceptionHandlerEv:
/* Return from the exception. */ /* Return from the exception. */
eret eret
/* ams::kern::arm64::EL0SynchronousExceptionHandler() */ /* ams::kern::arch::arm64::EL0SynchronousExceptionHandler() */
.section .text._ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6430EL0SynchronousExceptionHandlerEv, "ax", %progbits
.global _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv .global _ZN3ams4kern4arch5arm6430EL0SynchronousExceptionHandlerEv
.type _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv, %function .type _ZN3ams4kern4arch5arm6430EL0SynchronousExceptionHandlerEv, %function
_ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv: _ZN3ams4kern4arch5arm6430EL0SynchronousExceptionHandlerEv:
/* Save x16 and x17, so that we can use them as scratch. */ /* Save x16 and x17, so that we can use them as scratch. */
stp x16, x17, [sp, #-16]! stp x16, x17, [sp, #-16]!
@ -198,10 +198,10 @@ _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv:
stp x21, x22, [sp, #(8 * 32)] stp x21, x22, [sp, #(8 * 32)]
str x23, [sp, #(8 * 34)] 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 mrs x18, tpidr_el1
mov x0, sp mov x0, sp
bl _ZN3ams4kern5arm6415HandleExceptionEPNS1_17KExceptionContextE bl _ZN3ams4kern4arch5arm6415HandleExceptionEPNS2_17KExceptionContextE
/* Restore state from the context. */ /* Restore state from the context. */
ldp x30, x20, [sp, #(8 * 30)] ldp x30, x20, [sp, #(8 * 30)]
@ -233,15 +233,15 @@ _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv:
2: /* SVC from aarch32. */ 2: /* SVC from aarch32. */
ldp x16, x17, [sp], 16 ldp x16, x17, [sp], 16
b _ZN3ams4kern5arm6412SvcHandler32Ev b _ZN3ams4kern4arch5arm6412SvcHandler32Ev
3: /* SVC from aarch64. */ 3: /* SVC from aarch64. */
ldp x16, x17, [sp], 16 ldp x16, x17, [sp], 16
b _ZN3ams4kern5arm6412SvcHandler64Ev b _ZN3ams4kern4arch5arm6412SvcHandler64Ev
4: /* FPU exception. */ 4: /* FPU exception. */
ldp x16, x17, [sp], 16 ldp x16, x17, [sp], 16
b _ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv b _ZN3ams4kern4arch5arm6425FpuAccessExceptionHandlerEv
5: /* Check if there's a TLB conflict that caused the abort. */ 5: /* Check if there's a TLB conflict that caused the abort. */
and x17, x16, #0x3F and x17, x16, #0x3F
@ -278,11 +278,11 @@ _ZN3ams4kern5arm6430EL0SynchronousExceptionHandlerEv:
eret eret
/* ams::kern::arm64::EL1SynchronousExceptionHandler() */ /* ams::kern::arch::arm64::EL1SynchronousExceptionHandler() */
.section .text._ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6430EL1SynchronousExceptionHandlerEv, "ax", %progbits
.global _ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv .global _ZN3ams4kern4arch5arm6430EL1SynchronousExceptionHandlerEv
.type _ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv, %function .type _ZN3ams4kern4arch5arm6430EL1SynchronousExceptionHandlerEv, %function
_ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv: _ZN3ams4kern4arch5arm6430EL1SynchronousExceptionHandlerEv:
/* Nintendo uses the "unused" virtual timer compare value as a scratch register. */ /* Nintendo uses the "unused" virtual timer compare value as a scratch register. */
msr cntv_cval_el0, x0 msr cntv_cval_el0, x0
@ -324,10 +324,10 @@ _ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv:
/* Data abort. Check if it was from trying to access userspace memory. */ /* Data abort. Check if it was from trying to access userspace memory. */
mrs x1, elr_el1 mrs x1, elr_el1
adr x0, _ZN3ams4kern5arm6438UserspaceMemoryAccessFunctionAreaBeginEv adr x0, _ZN3ams4kern4arch5arm6438UserspaceMemoryAccessFunctionAreaBeginEv
cmp x1, x0 cmp x1, x0
b.lo 3f b.lo 3f
adr x0, _ZN3ams4kern5arm6436UserspaceMemoryAccessFunctionAreaEndEv adr x0, _ZN3ams4kern4arch5arm6436UserspaceMemoryAccessFunctionAreaEndEv
cmp x1, x0 cmp x1, x0
b.hs 3f b.hs 3f
@ -387,10 +387,10 @@ _ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv:
stp x21, x22, [sp, #(8 * 32)] stp x21, x22, [sp, #(8 * 32)]
str x23, [sp, #(8 * 34)] 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 mrs x18, tpidr_el1
mov x0, sp mov x0, sp
bl _ZN3ams4kern5arm6415HandleExceptionEPNS1_17KExceptionContextE bl _ZN3ams4kern4arch5arm6415HandleExceptionEPNS2_17KExceptionContextE
4: /* HandleException should never return. The best we can do is infinite loop. */ 4: /* HandleException should never return. The best we can do is infinite loop. */
b 4b b 4b
@ -434,11 +434,11 @@ _ZN3ams4kern5arm6430EL1SynchronousExceptionHandlerEv:
eret eret
/* ams::kern::arm64::FpuAccessExceptionHandler() */ /* ams::kern::arch::arm64::FpuAccessExceptionHandler() */
.section .text._ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6425FpuAccessExceptionHandlerEv, "ax", %progbits
.global _ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv .global _ZN3ams4kern4arch5arm6425FpuAccessExceptionHandlerEv
.type _ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv, %function .type _ZN3ams4kern4arch5arm6425FpuAccessExceptionHandlerEv, %function
_ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv: _ZN3ams4kern4arch5arm6425FpuAccessExceptionHandlerEv:
/* Save registers that need saving. */ /* Save registers that need saving. */
sub sp, sp, #(8 * 24) sub sp, sp, #(8 * 24)
@ -461,7 +461,7 @@ _ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv:
mrs x21, spsr_el1 mrs x21, spsr_el1
/* Invoke the FPU context switch handler. */ /* Invoke the FPU context switch handler. */
bl _ZN3ams4kern5arm6423FpuContextSwitchHandlerEv bl _ZN3ams4kern4arch5arm6423FpuContextSwitchHandlerEv
/* Restore registers that we saved. */ /* Restore registers that we saved. */
msr sp_el0, x19 msr sp_el0, x19
@ -486,11 +486,11 @@ _ZN3ams4kern5arm6425FpuAccessExceptionHandlerEv:
/* Return from the exception. */ /* Return from the exception. */
eret eret
/* ams::kern::arm64::EL1SystemErrorHandler() */ /* ams::kern::arch::arm64::EL1SystemErrorHandler() */
.section .text._ZN3ams4kern5arm6421EL1SystemErrorHandlerEv, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6421EL1SystemErrorHandlerEv, "ax", %progbits
.global _ZN3ams4kern5arm6421EL1SystemErrorHandlerEv .global _ZN3ams4kern4arch5arm6421EL1SystemErrorHandlerEv
.type _ZN3ams4kern5arm6421EL1SystemErrorHandlerEv, %function .type _ZN3ams4kern4arch5arm6421EL1SystemErrorHandlerEv, %function
_ZN3ams4kern5arm6421EL1SystemErrorHandlerEv: _ZN3ams4kern4arch5arm6421EL1SystemErrorHandlerEv:
/* Nintendo uses the "unused" virtual timer compare value as a scratch register. */ /* Nintendo uses the "unused" virtual timer compare value as a scratch register. */
msr cntv_cval_el0, x0 msr cntv_cval_el0, x0
@ -533,10 +533,10 @@ _ZN3ams4kern5arm6421EL1SystemErrorHandlerEv:
stp x21, x22, [sp, #(8 * 32)] stp x21, x22, [sp, #(8 * 32)]
str x23, [sp, #(8 * 34)] 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 mrs x18, tpidr_el1
mov x0, sp mov x0, sp
bl _ZN3ams4kern5arm6415HandleExceptionEPNS1_17KExceptionContextE bl _ZN3ams4kern4arch5arm6415HandleExceptionEPNS2_17KExceptionContextE
1: /* HandleException should never return. The best we can do is infinite loop. */ 1: /* HandleException should never return. The best we can do is infinite loop. */
b 1b b 1b
@ -544,11 +544,11 @@ _ZN3ams4kern5arm6421EL1SystemErrorHandlerEv:
/* Return from the exception. */ /* Return from the exception. */
eret eret
/* ams::kern::arm64::EL0SystemErrorHandler() */ /* ams::kern::arch::arm64::EL0SystemErrorHandler() */
.section .text._ZN3ams4kern5arm6421EL0SystemErrorHandlerEv, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6421EL0SystemErrorHandlerEv, "ax", %progbits
.global _ZN3ams4kern5arm6421EL0SystemErrorHandlerEv .global _ZN3ams4kern4arch5arm6421EL0SystemErrorHandlerEv
.type _ZN3ams4kern5arm6421EL0SystemErrorHandlerEv, %function .type _ZN3ams4kern4arch5arm6421EL0SystemErrorHandlerEv, %function
_ZN3ams4kern5arm6421EL0SystemErrorHandlerEv: _ZN3ams4kern4arch5arm6421EL0SystemErrorHandlerEv:
/* Create a KExceptionContext to pass to HandleException. */ /* Create a KExceptionContext to pass to HandleException. */
sub sp, sp, #0x120 sub sp, sp, #0x120
stp x0, x1, [sp, #(8 * 0)] stp x0, x1, [sp, #(8 * 0)]
@ -575,10 +575,10 @@ _ZN3ams4kern5arm6421EL0SystemErrorHandlerEv:
stp x21, x22, [sp, #(8 * 32)] stp x21, x22, [sp, #(8 * 32)]
str x23, [sp, #(8 * 34)] 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 mrs x18, tpidr_el1
mov x0, sp mov x0, sp
bl _ZN3ams4kern5arm6415HandleExceptionEPNS1_17KExceptionContextE bl _ZN3ams4kern4arch5arm6415HandleExceptionEPNS2_17KExceptionContextE
/* Restore state from the context. */ /* Restore state from the context. */
ldp x30, x20, [sp, #(8 * 30)] ldp x30, x20, [sp, #(8 * 30)]

View file

@ -14,11 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* ams::kern::arm64::UserModeThreadStarter() */ /* ams::kern::arch::arm64::UserModeThreadStarter() */
.section .text._ZN3ams4kern5arm6421UserModeThreadStarterEv, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6421UserModeThreadStarterEv, "ax", %progbits
.global _ZN3ams4kern5arm6421UserModeThreadStarterEv .global _ZN3ams4kern4arch5arm6421UserModeThreadStarterEv
.type _ZN3ams4kern5arm6421UserModeThreadStarterEv, %function .type _ZN3ams4kern4arch5arm6421UserModeThreadStarterEv, %function
_ZN3ams4kern5arm6421UserModeThreadStarterEv: _ZN3ams4kern4arch5arm6421UserModeThreadStarterEv:
/* NOTE: Stack layout on entry looks like following: */ /* NOTE: Stack layout on entry looks like following: */
/* SP */ /* SP */
/* | */ /* | */
@ -28,8 +28,8 @@ _ZN3ams4kern5arm6421UserModeThreadStarterEv:
/* Clear the disable count for this thread's stack parameters. */ /* Clear the disable count for this thread's stack parameters. */
str wzr, [sp, #(0x120 + 0x18)] str wzr, [sp, #(0x120 + 0x18)]
/* Call ams::kern::arm64::OnThreadStart() */ /* Call ams::kern::arch::arm64::OnThreadStart() */
bl _ZN3ams4kern5arm6413OnThreadStartEv bl _ZN3ams4kern4arch5arm6413OnThreadStartEv
/* Restore thread state from the KExceptionContext on stack */ /* Restore thread state from the KExceptionContext on stack */
ldp x30, x19, [sp, #(8 * 30)] /* x30 = lr, x19 = sp */ ldp x30, x19, [sp, #(8 * 30)] /* x30 = lr, x19 = sp */
@ -63,11 +63,11 @@ _ZN3ams4kern5arm6421UserModeThreadStarterEv:
/* Return to EL0 */ /* Return to EL0 */
eret eret
/* ams::kern::arm64::SupervisorModeThreadStarter() */ /* ams::kern::arch::arm64::SupervisorModeThreadStarter() */
.section .text._ZN3ams4kern5arm6427SupervisorModeThreadStarterEv, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6427SupervisorModeThreadStarterEv, "ax", %progbits
.global _ZN3ams4kern5arm6427SupervisorModeThreadStarterEv .global _ZN3ams4kern4arch5arm6427SupervisorModeThreadStarterEv
.type _ZN3ams4kern5arm6427SupervisorModeThreadStarterEv, %function .type _ZN3ams4kern4arch5arm6427SupervisorModeThreadStarterEv, %function
_ZN3ams4kern5arm6427SupervisorModeThreadStarterEv: _ZN3ams4kern4arch5arm6427SupervisorModeThreadStarterEv:
/* NOTE: Stack layout on entry looks like following: */ /* NOTE: Stack layout on entry looks like following: */
/* SP */ /* SP */
/* | */ /* | */
@ -88,11 +88,11 @@ _ZN3ams4kern5arm6427SupervisorModeThreadStarterEv:
eret eret
/* ams::kern::arm64::KThreadContext::RestoreFpuRegisters64(const KThreadContext &) */ /* ams::kern::arch::arm64::KThreadContext::RestoreFpuRegisters64(const KThreadContext &) */
.section .text._ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_, "ax", %progbits
.global _ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_ .global _ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_
.type _ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_, %function .type _ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_, %function
_ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_: _ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_:
/* Load and restore FPCR and FPSR from the context. */ /* Load and restore FPCR and FPSR from the context. */
ldr x1, [x0, #0x70] ldr x1, [x0, #0x70]
msr fpcr, x1 msr fpcr, x1
@ -119,11 +119,11 @@ _ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters64ERKS2_:
ret ret
/* ams::kern::arm64::KThreadContext::RestoreFpuRegisters32(const KThreadContext &) */ /* ams::kern::arch::arm64::KThreadContext::RestoreFpuRegisters32(const KThreadContext &) */
.section .text._ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_, "ax", %progbits
.global _ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_ .global _ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_
.type _ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_, %function .type _ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_, %function
_ZN3ams4kern5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_: _ZN3ams4kern4arch5arm6414KThreadContext21RestoreFpuRegisters32ERKS2_:
/* Load and restore FPCR and FPSR from the context. */ /* Load and restore FPCR and FPSR from the context. */
ldr x1, [x0, #0x70] ldr x1, [x0, #0x70]
msr fpcr, x1 msr fpcr, x1

View file

@ -14,11 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* ams::kern::arm64::UserspaceMemoryAccessFunctionAreaBegin() */ /* ams::kern::arch::arm64::UserspaceMemoryAccessFunctionAreaBegin() */
.section .text._ZN3ams4kern5arm6438UserspaceMemoryAccessFunctionAreaBeginEv, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6438UserspaceMemoryAccessFunctionAreaBeginEv, "ax", %progbits
.global _ZN3ams4kern5arm6438UserspaceMemoryAccessFunctionAreaBeginEv .global _ZN3ams4kern4arch5arm6438UserspaceMemoryAccessFunctionAreaBeginEv
.type _ZN3ams4kern5arm6438UserspaceMemoryAccessFunctionAreaBeginEv, %function .type _ZN3ams4kern4arch5arm6438UserspaceMemoryAccessFunctionAreaBeginEv, %function
_ZN3ams4kern5arm6438UserspaceMemoryAccessFunctionAreaBeginEv: _ZN3ams4kern4arch5arm6438UserspaceMemoryAccessFunctionAreaBeginEv:
/* NOTE: This is not a real function, and only exists as a label for safety. */ /* NOTE: This is not a real function, and only exists as a label for safety. */
/* ================ All Userspace Memory Functions after this line. ================ */ /* ================ All Userspace Memory Functions after this line. ================ */
@ -27,9 +27,9 @@ _ZN3ams4kern5arm6438UserspaceMemoryAccessFunctionAreaBeginEv:
/* ================ All Userspace Memory Functions before this line. ================ */ /* ================ All Userspace Memory Functions before this line. ================ */
/* ams::kern::arm64::UserspaceMemoryAccessFunctionAreaEnd() */ /* ams::kern::arch::arm64::UserspaceMemoryAccessFunctionAreaEnd() */
.section .text._ZN3ams4kern5arm6436UserspaceMemoryAccessFunctionAreaEndEv, "ax", %progbits .section .text._ZN3ams4kern4arch5arm6436UserspaceMemoryAccessFunctionAreaEndEv, "ax", %progbits
.global _ZN3ams4kern5arm6436UserspaceMemoryAccessFunctionAreaEndEv .global _ZN3ams4kern4arch5arm6436UserspaceMemoryAccessFunctionAreaEndEv
.type _ZN3ams4kern5arm6436UserspaceMemoryAccessFunctionAreaEndEv, %function .type _ZN3ams4kern4arch5arm6436UserspaceMemoryAccessFunctionAreaEndEv, %function
_ZN3ams4kern5arm6436UserspaceMemoryAccessFunctionAreaEndEv: _ZN3ams4kern4arch5arm6436UserspaceMemoryAccessFunctionAreaEndEv:
/* NOTE: This is not a real function, and only exists as a label for safety. */ /* NOTE: This is not a real function, and only exists as a label for safety. */