1
0
Fork 0
mirror of https://github.com/PabloMK7/citra.git synced 2025-07-12 18:34:26 +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:
Wunkolo 2023-12-01 22:00:58 -08:00
parent b6808a1132
commit ccb268666f

View file

@ -23,8 +23,15 @@ inline bool IsWithin128M(const oaknut::CodeGenerator& code, uintptr_t target) {
return IsWithin128M(code.xptr<uintptr_t>(), target);
}
template <typename T>
inline void CallFarFunction(oaknut::CodeGenerator& code, const T f) {
inline bool IsWithin128M(const oaknut::VectorCodeGenerator& code, uintptr_t target) {
// 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.");
const std::uintptr_t addr = reinterpret_cast<std::uintptr_t>(f);
if (IsWithin128M(code, addr)) {