mirror of
https://github.com/PabloMK7/citra.git
synced 2025-07-25 22:06:51 +00:00
common/aarch64: Add VectorCodeGenerator
to CallFarFunction
`VectorCodeGenerator` will always do far-calls since we cannot resolve any absolute addresses here.
This commit is contained in:
parent
b6808a1132
commit
ccb268666f
1 changed files with 9 additions and 2 deletions
|
@ -23,8 +23,15 @@ inline bool IsWithin128M(const oaknut::CodeGenerator& code, uintptr_t target) {
|
||||||
return IsWithin128M(code.xptr<uintptr_t>(), target);
|
return IsWithin128M(code.xptr<uintptr_t>(), target);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
inline bool IsWithin128M(const oaknut::VectorCodeGenerator& code, uintptr_t target) {
|
||||||
inline void CallFarFunction(oaknut::CodeGenerator& code, const T f) {
|
// VectorCodeGenerator is not the final executable memory, so no assumption can be
|
||||||
|
// made about how far pointers are from each other.
|
||||||
|
// Always assume far-calls
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, typename Policy>
|
||||||
|
inline void CallFarFunction(oaknut::BasicCodeGenerator<Policy>& code, const T f) {
|
||||||
static_assert(std::is_pointer_v<T>, "Argument must be a (function) pointer.");
|
static_assert(std::is_pointer_v<T>, "Argument must be a (function) pointer.");
|
||||||
const std::uintptr_t addr = reinterpret_cast<std::uintptr_t>(f);
|
const std::uintptr_t addr = reinterpret_cast<std::uintptr_t>(f);
|
||||||
if (IsWithin128M(code, addr)) {
|
if (IsWithin128M(code, addr)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue