summaryrefslogtreecommitdiffstats
path: root/src/core/arm/nce/patcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/arm/nce/patcher.cpp')
-rw-r--r--src/core/arm/nce/patcher.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/arm/nce/patcher.cpp b/src/core/arm/nce/patcher.cpp
index ec8527224..47a7a8880 100644
--- a/src/core/arm/nce/patcher.cpp
+++ b/src/core/arm/nce/patcher.cpp
@@ -28,6 +28,8 @@ Patcher::~Patcher() = default;
void Patcher::PatchText(const Kernel::PhysicalMemory& program_image,
const Kernel::CodeSet::Segment& code) {
+ // Branch to the first instruction of the module.
+ this->BranchToModule(0);
// Write save context helper function.
c.l(m_save_context);
@@ -278,7 +280,7 @@ void Patcher::WriteSvcTrampoline(ModuleDestLabel module_dest, u32 svc_id) {
// Store SVC number to execute when we return
c.MOV(X2, svc_id);
- c.STR(W2, X1, offsetof(GuestContext, svc_swi));
+ c.STR(W2, X1, offsetof(GuestContext, svc));
// We are calling a SVC. Clear esr_el1 and return it.
static_assert(std::is_same_v<std::underlying_type_t<HaltReason>, u64>);