ReXGlue SDK
Loading...
Searching...
No Matches
recompiled_code.h File Reference
#include <csetjmp>
#include <cstddef>
#include <span>
#include <rex/platform.h>
#include <rex/types.h>

Go to the source code of this file.

Classes

struct  PPCFuncMapping

Namespaces

namespace  rex
namespace  rex::ppc

Macros

#define REX_FUNC(x)
#define REX_EXTERN(x)
#define REX_RECOMPILED_CODE_SECTION   __attribute__((section("rexguest")))
#define REX_RECOMPILED_CODE()

Typedefs

using PPCFunc = void(PPCContext& ctx, u8* base)

Functions

REX_PPC_API PPCFunc * rex::ppc::ResolveFunction (u32 guest_address)
REX_PPC_API void rex::ppc::Trap (PPCContext &ctx, u8 *base, u16 trap_type)
REX_PPC_API std::jmp_buf & rex::ppc::GetJumpBuffer (u32 address)
REX_PPC_API void rex::ppc::LongJump (u32 address, int value)
REX_PPC_API void rex::ppc::UnimplementedInstruction (const char *opcode)
REX_PPC_API bool rex::ppc::AddRecompiledCode (std::span< const u8 > code)
REX_PPC_API void rex::ppc::RemoveRecompiledCode (std::span< const u8 > code)
REX_PPC_API bool rex::ppc::IsRecompiledCode (u64 address)

Variables

const PPCFuncMapping kPPCFuncMappings []
const ::rex::u8 __start_rexguest []
const ::rex::u8 __stop_rexguest []

Detailed Description

License
BSD 3-Clause License See LICENSE file in the project root for full license text.

Macro Definition Documentation

◆ REX_EXTERN

#define REX_EXTERN ( x)
Value:
extern "C" REX_FUNC(x)
#define REX_FUNC(x)
Definition recompiled_code.h:68

Declares a recompiled function with C linkage.

Parameters
xThe C++ symbol the generated code defines and calls.
REX_EXTERN(sub_82010000);
#define REX_EXTERN(x)
Definition recompiled_code.h:79

◆ REX_FUNC

#define REX_FUNC ( x)
Value:
void x([[maybe_unused]] PPCContext& __restrict ctx, [[maybe_unused]] u8* base)
Definition context.h:387

Declares a recompiled function with no linkage specifier.

Parameters
xThe C++ symbol the generated code defines and calls.
REX_FUNC(sub_82010000);

◆ REX_RECOMPILED_CODE

#define REX_RECOMPILED_CODE ( )
Value:
::std::span<const ::rex::u8>(__start_rexguest, __stop_rexguest)
const ::rex::u8 __stop_rexguest[]
Definition recompiled_code.h:107
const ::rex::u8 __start_rexguest[]
Definition recompiled_code.h:105

Returns the recompiled code section of the image that expands it.

REX_PPC_API bool AddRecompiledCode(std::span< const u8 > code)
#define REX_RECOMPILED_CODE()
Definition recompiled_code.h:123

◆ REX_RECOMPILED_CODE_SECTION

#define REX_RECOMPILED_CODE_SECTION   __attribute__((section("rexguest")))

Places a function in the recompiled code section, where a stop may redirect a thread.

Variable Documentation

◆ __start_rexguest

const ::rex::u8 __start_rexguest[]

The first byte of the recompiled code section, null when the image has none.

◆ __stop_rexguest

const ::rex::u8 __stop_rexguest[]

The byte past the end of the recompiled code section, null when the image has none.

◆ kPPCFuncMappings

const PPCFuncMapping kPPCFuncMappings[]
extern

Guest to host function mappings, defined by the generated code.