Macros that the generated precompiled header defines, listed for the reference.
More...
Go to the source code of this file.
|
| #define | DECLARE_REX_FUNC(name) |
| #define | DEFINE_REX_FUNC(name) |
| #define | REX_FUNC_PROLOGUE() |
| #define | REX_PHYS_HOST_OFFSET(addr) |
| #define | REX_RAW_ADDR(x) |
| #define | REX_LOAD_U8(x) |
| #define | REX_LOAD_U16(x) |
| #define | REX_LOAD_U32(x) |
| #define | REX_LOAD_U64(x) |
| #define | REX_LOAD_STRING(x, len) |
| #define | REX_STORE_U8(x, y) |
| #define | REX_STORE_U16(x, y) |
| #define | REX_STORE_U32(x, y) |
| #define | REX_STORE_U64(x, y) |
| #define | REX_STACK_ADDR(x) |
| #define | REX_STACK_LOAD_U8(x) |
| #define | REX_STACK_LOAD_U16(x) |
| #define | REX_STACK_LOAD_U32(x) |
| #define | REX_STACK_LOAD_U64(x) |
| #define | REX_STACK_STORE_U8(x, y) |
| #define | REX_STACK_STORE_U16(x, y) |
| #define | REX_STACK_STORE_U32(x, y) |
| #define | REX_STACK_STORE_U64(x, y) |
| #define | REX_GPU_LOAD32(addr) |
| #define | REX_GPU_STORE32(addr, val) |
| #define | REX_APU_LOAD32(addr) |
| #define | REX_APU_STORE32(addr, val) |
| #define | REX_MM_LOAD_U8(addr) |
| #define | REX_MM_LOAD_U16(addr) |
| #define | REX_MM_LOAD_U32(addr) |
| #define | REX_MM_LOAD_U64(addr) |
| #define | REX_MM_STORE_U8(addr, val) |
| #define | REX_MM_STORE_U16(addr, val) |
| #define | REX_MM_STORE_U32(addr, val) |
| #define | REX_MM_STORE_U64(addr, val) |
| #define | REX_CALL_FUNC(x) |
| #define | REX_LOOKUP_FUNC(x, y) |
| #define | REX_CALL_INDIRECT_FUNC(x) |
| #define | REX_SET_FLUSH_MODE(enable) |
| #define | REX_UNIMPLEMENTED(addr, opcode) |
| #define | REX_QUERY_TIMEBASE() |
| #define | ppc_setjmp(guest_buf_addr) |
| #define | ppc_longjmp(guest_buf_addr, val) |
| #define | ppc_trap(ctx, base, trap_type) |
Macros that the generated precompiled header defines, listed for the reference.
- Copyright
- Copyright (c) 2026 Tom Clay tomc@.nosp@m.tcte.nosp@m.chstu.nosp@m.ff.c.nosp@m.om All rights reserved.
- License
- BSD 3-Clause License See LICENSE file in the project root for full license text.
Documentation only. rexglue codegen writes the real definitions into <p>_pch.h from the template codegen/pch_h.inja, and nothing includes this file.
◆ DECLARE_REX_FUNC
| #define DECLARE_REX_FUNC |
( |
| name | ) |
|
Declares a recompiled function and its original entry point __imp__name.
- Parameters
-
◆ DEFINE_REX_FUNC
| #define DEFINE_REX_FUNC |
( |
| name | ) |
|
Starts the body of a recompiled function. Defines __imp__name and makes name a weak alias of it, so a hook that defines a strong name replaces the function and the original stays reachable. The body is placed in the rexguest section.
- Parameters
-
◆ ppc_longjmp
| #define ppc_longjmp |
( |
| guest_buf_addr, |
|
|
| val ) |
Jumps back to a buffer that ppc_setjmp saved.
- Parameters
-
| guest_buf_addr | The guest address of the buffer. |
| val | The value ppc_setjmp returns. |
◆ ppc_setjmp
| #define ppc_setjmp |
( |
| guest_buf_addr | ) |
|
Saves a guest jump buffer and returns 0, or the value that ppc_longjmp passes.
- Parameters
-
| guest_buf_addr | The guest address of the buffer. |
◆ ppc_trap
| #define ppc_trap |
( |
| ctx, |
|
|
| base, |
|
|
| trap_type ) |
Raises a guest trap.
- Parameters
-
| ctx | The guest context. |
| base | The guest memory base. |
| trap_type | The trap type. |
◆ REX_APU_LOAD32
| #define REX_APU_LOAD32 |
( |
| addr | ) |
|
Reads a 32 bit APU register through the APU MMIO recipient.
- Parameters
-
◆ REX_APU_STORE32
| #define REX_APU_STORE32 |
( |
| addr, |
|
|
| val ) |
Writes a 32 bit APU register through the APU MMIO recipient.
- Parameters
-
| addr | The guest address. |
| val | The value. |
◆ REX_CALL_FUNC
| #define REX_CALL_FUNC |
( |
| x | ) |
|
Calls a recompiled function with the current ctx and base.
- Parameters
-
◆ REX_CALL_INDIRECT_FUNC
| #define REX_CALL_INDIRECT_FUNC |
( |
| x | ) |
|
Calls the function at a guest address. Reads the pointer from the table placed after the image and calls rex::ppc::ResolveFunction when the slot is empty or the target is out of range.
- Parameters
-
◆ REX_FUNC_PROLOGUE
| #define REX_FUNC_PROLOGUE |
( |
| ) |
|
Declares that base is 32 byte aligned. Every recompiled function starts with it.
◆ REX_GPU_LOAD32
| #define REX_GPU_LOAD32 |
( |
| addr | ) |
|
Reads a 32 bit GPU register through the GPU MMIO recipient.
- Parameters
-
◆ REX_GPU_STORE32
| #define REX_GPU_STORE32 |
( |
| addr, |
|
|
| val ) |
Writes a 32 bit GPU register through the GPU MMIO recipient.
- Parameters
-
| addr | The guest address. |
| val | The value. |
◆ REX_LOAD_STRING
| #define REX_LOAD_STRING |
( |
| x, |
|
|
| len ) |
A std::string_view over guest memory.
- Parameters
-
| x | The guest address. |
| len | The length in bytes. |
◆ REX_LOAD_U16
| #define REX_LOAD_U16 |
( |
| x | ) |
|
A volatile 16 bit load at base + x, byte swapped.
- Parameters
-
◆ REX_LOAD_U32
| #define REX_LOAD_U32 |
( |
| x | ) |
|
A volatile 32 bit load at base + x, byte swapped.
- Parameters
-
◆ REX_LOAD_U64
| #define REX_LOAD_U64 |
( |
| x | ) |
|
A volatile 64 bit load at base + x, byte swapped.
- Parameters
-
◆ REX_LOAD_U8
A volatile byte load at base + x.
- Parameters
-
◆ REX_LOOKUP_FUNC
| #define REX_LOOKUP_FUNC |
( |
| x, |
|
|
| y ) |
Looks up the host function pointer of a guest address in the table placed after the image.
- Parameters
-
| x | The base pointer. |
| y | The guest address. |
◆ REX_MM_LOAD_U16
| #define REX_MM_LOAD_U16 |
( |
| addr | ) |
|
A 16 bit load that tests for an MMIO block first and uses the plain access otherwise.
- Parameters
-
◆ REX_MM_LOAD_U32
| #define REX_MM_LOAD_U32 |
( |
| addr | ) |
|
A 32 bit load that tests for an MMIO block first and uses the plain access otherwise.
- Parameters
-
◆ REX_MM_LOAD_U64
| #define REX_MM_LOAD_U64 |
( |
| addr | ) |
|
A 64 bit load that tests for an MMIO block first and uses the plain access otherwise.
- Parameters
-
◆ REX_MM_LOAD_U8
| #define REX_MM_LOAD_U8 |
( |
| addr | ) |
|
A byte load that tests for an MMIO block first and uses the plain access otherwise.
- Parameters
-
◆ REX_MM_STORE_U16
| #define REX_MM_STORE_U16 |
( |
| addr, |
|
|
| val ) |
A 16 bit store that tests for an MMIO block first and uses the plain access otherwise.
- Parameters
-
| addr | The guest address. |
| val | The value. |
◆ REX_MM_STORE_U32
| #define REX_MM_STORE_U32 |
( |
| addr, |
|
|
| val ) |
A 32 bit store that tests for an MMIO block first and uses the plain access otherwise.
- Parameters
-
| addr | The guest address. |
| val | The value. |
◆ REX_MM_STORE_U64
| #define REX_MM_STORE_U64 |
( |
| addr, |
|
|
| val ) |
A 64 bit store that tests for an MMIO block first and uses the plain access otherwise.
- Parameters
-
| addr | The guest address. |
| val | The value. |
◆ REX_MM_STORE_U8
| #define REX_MM_STORE_U8 |
( |
| addr, |
|
|
| val ) |
A byte store that tests for an MMIO block first and uses the plain access otherwise.
- Parameters
-
| addr | The guest address. |
| val | The value. |
◆ REX_PHYS_HOST_OFFSET
| #define REX_PHYS_HOST_OFFSET |
( |
| addr | ) |
|
The extra host offset of a guest address in the physical range from 0xE0000000, which is 0x1000 on Windows and macOS on arm64, where the host mapping rounds the offset away, and 0 elsewhere.
- Parameters
-
◆ REX_QUERY_TIMEBASE
| #define REX_QUERY_TIMEBASE |
( |
| ) |
|
The guest timebase tick count.
◆ REX_RAW_ADDR
| #define REX_RAW_ADDR |
( |
| x | ) |
|
The host address of a guest address, with no MMIO test.
- Parameters
-
◆ REX_SET_FLUSH_MODE
| #define REX_SET_FLUSH_MODE |
( |
| enable | ) |
|
Enables or disables flush to zero mode in ctx.fpscr.
- Parameters
-
◆ REX_STACK_ADDR
| #define REX_STACK_ADDR |
( |
| x | ) |
|
The host address of a stack access, checked to be below 0xE0000000 in debug builds.
- Parameters
-
◆ REX_STACK_LOAD_U16
| #define REX_STACK_LOAD_U16 |
( |
| x | ) |
|
A 16 bit load from the guest stack, byte swapped.
- Parameters
-
◆ REX_STACK_LOAD_U32
| #define REX_STACK_LOAD_U32 |
( |
| x | ) |
|
A 32 bit load from the guest stack, byte swapped.
- Parameters
-
◆ REX_STACK_LOAD_U64
| #define REX_STACK_LOAD_U64 |
( |
| x | ) |
|
A 64 bit load from the guest stack, byte swapped.
- Parameters
-
◆ REX_STACK_LOAD_U8
| #define REX_STACK_LOAD_U8 |
( |
| x | ) |
|
A byte load from the guest stack.
- Parameters
-
◆ REX_STACK_STORE_U16
| #define REX_STACK_STORE_U16 |
( |
| x, |
|
|
| y ) |
A 16 bit store to the guest stack, byte swapped.
- Parameters
-
| x | The guest address. |
| y | The value. |
◆ REX_STACK_STORE_U32
| #define REX_STACK_STORE_U32 |
( |
| x, |
|
|
| y ) |
A 32 bit store to the guest stack, byte swapped.
- Parameters
-
| x | The guest address. |
| y | The value. |
◆ REX_STACK_STORE_U64
| #define REX_STACK_STORE_U64 |
( |
| x, |
|
|
| y ) |
A 64 bit store to the guest stack, byte swapped.
- Parameters
-
| x | The guest address. |
| y | The value. |
◆ REX_STACK_STORE_U8
| #define REX_STACK_STORE_U8 |
( |
| x, |
|
|
| y ) |
A byte store to the guest stack.
- Parameters
-
| x | The guest address. |
| y | The value. |
◆ REX_STORE_U16
| #define REX_STORE_U16 |
( |
| x, |
|
|
| y ) |
A volatile 16 bit store at base + x, byte swapped.
- Parameters
-
| x | The guest address. |
| y | The value. |
◆ REX_STORE_U32
| #define REX_STORE_U32 |
( |
| x, |
|
|
| y ) |
A volatile 32 bit store at base + x, byte swapped.
- Parameters
-
| x | The guest address. |
| y | The value. |
◆ REX_STORE_U64
| #define REX_STORE_U64 |
( |
| x, |
|
|
| y ) |
A volatile 64 bit store at base + x, byte swapped.
- Parameters
-
| x | The guest address. |
| y | The value. |
◆ REX_STORE_U8
| #define REX_STORE_U8 |
( |
| x, |
|
|
| y ) |
A volatile byte store at base + x.
- Parameters
-
| x | The guest address. |
| y | The value. |
◆ REX_UNIMPLEMENTED
| #define REX_UNIMPLEMENTED |
( |
| addr, |
|
|
| opcode ) |
Reports an instruction that has no recompiled form.
- Parameters
-
| addr | The guest address. |
| opcode | The instruction word. |