mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
aarch64: Support calloc patch blocks
This commit is contained in:
parent
4d193ecb6a
commit
c80342e8d4
5 changed files with 65 additions and 12 deletions
|
@ -1,7 +1,9 @@
|
|||
#include "bin_patch.h"
|
||||
#include "ppu_patch.h"
|
||||
#include "File.h"
|
||||
#include "Config.h"
|
||||
#include "version.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/Memory/vm.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/VFS.h"
|
||||
|
@ -896,10 +898,6 @@ void patch_engine::append_title_patches(std::string_view title_id)
|
|||
load(m_map, fmt::format("%s%s_patch.yml", get_patches_path(), title_id));
|
||||
}
|
||||
|
||||
void ppu_register_range(u32 addr, u32 size);
|
||||
bool ppu_form_branch_to_code(u32 entry, u32 target, bool link = false, bool with_toc = false, std::string module_name = {});
|
||||
u32 ppu_generate_id(std::string_view name);
|
||||
|
||||
void unmap_vm_area(std::shared_ptr<vm::block_t>& ptr)
|
||||
{
|
||||
if (ptr && ptr->flags & (1ull << 62))
|
||||
|
@ -1216,6 +1214,10 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
|
|||
continue;
|
||||
}
|
||||
|
||||
// Record the insertion point as a faux block.
|
||||
g_fxo->need<ppu_patch_block_registry_t>();
|
||||
g_fxo->get<ppu_patch_block_registry_t>().block_addresses.insert(resval);
|
||||
|
||||
relocate_instructions_at = addr;
|
||||
break;
|
||||
}
|
||||
|
|
20
Utilities/ppu_patch.h
Normal file
20
Utilities/ppu_patch.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
#include <util/types.hpp>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
// Patch utilities specific to PPU code
|
||||
struct ppu_patch_block_registry_t
|
||||
{
|
||||
ppu_patch_block_registry_t() = default;
|
||||
ppu_patch_block_registry_t(const ppu_patch_block_registry_t&) = delete;
|
||||
ppu_patch_block_registry_t& operator=(const ppu_patch_block_registry_t&) = delete;
|
||||
|
||||
std::unordered_set<u32> block_addresses{};
|
||||
};
|
||||
|
||||
void ppu_register_range(u32 addr, u32 size);
|
||||
bool ppu_form_branch_to_code(u32 entry, u32 target, bool link = false, bool with_toc = false, std::string module_name = {});
|
||||
u32 ppu_generate_id(std::string_view name);
|
Loading…
Add table
Add a link
Reference in a new issue