/* VISIBLE TO LIBVEX CLIENT */
void LibVEX_GuestPPC64_initialise ( /*OUT*/VexGuestPPC64State* vex_state )
{
+ Int i;
vex_state->guest_GPR0 = 0;
vex_state->guest_GPR1 = 0;
vex_state->guest_GPR2 = 0;
vex_state->guest_TILEN = 0;
vex_state->guest_NRADDR = 0;
+
+ vex_state->guest_REDIR_SP = -1;
+ for (i = 0; i < VEX_GUEST_PPC64_REDIR_STACK_SIZE; i++)
+ vex_state->guest_REDIR_STACK[i] = 0;
}
/* Describe any sections to be regarded by Memcheck as
'always-defined'. */
- .n_alwaysDefd = 7,
+ .n_alwaysDefd = 8,
.alwaysDefd
= { /* 0 */ ALWAYSDEFD32(guest_CIA),
/* 3 */ ALWAYSDEFD32(guest_TILEN),
/* 4 */ ALWAYSDEFD32(guest_VSCR),
/* 5 */ ALWAYSDEFD32(guest_FPROUND),
- /* 6 */ ALWAYSDEFD32(guest_RESVN)
+ /* 6 */ ALWAYSDEFD32(guest_RESVN),
+ /* 7 */ ALWAYSDEFD32(guest_NRADDR)
}
};
/* Describe any sections to be regarded by Memcheck as
'always-defined'. */
- .n_alwaysDefd = 7,
+ .n_alwaysDefd = 10,
.alwaysDefd
= { /* 0 */ ALWAYSDEFD64(guest_CIA),
/* 3 */ ALWAYSDEFD64(guest_TILEN),
/* 4 */ ALWAYSDEFD64(guest_VSCR),
/* 5 */ ALWAYSDEFD64(guest_FPROUND),
- /* 6 */ ALWAYSDEFD64(guest_RESVN)
+ /* 6 */ ALWAYSDEFD64(guest_RESVN),
+ /* 7 */ ALWAYSDEFD64(guest_NRADDR),
+ /* 8 */ ALWAYSDEFD64(guest_REDIR_SP),
+ /* 9 */ ALWAYSDEFD64(guest_REDIR_STACK)
}
};
/*--- Vex's representation of the PPC64 CPU state ---*/
/*---------------------------------------------------------------*/
+#define VEX_GUEST_PPC64_REDIR_STACK_SIZE 16
+
typedef
struct {
/* General Purpose Registers */
replace-style ones. */
/* 1112 */ ULong guest_NRADDR;
+ /* A grows-upwards stack for hidden saves/restores of LR and R2
+ needed for function interception and wrapping on ppc64-linux.
+ A horrible hack. REDIR_SP points to the highest live entry,
+ and so starts at -1. */
+ /* 1120 */ ULong guest_REDIR_SP;
+ /* 1128 */ ULong guest_REDIR_STACK[VEX_GUEST_PPC64_REDIR_STACK_SIZE];
+
/* Padding to make it have an 8-aligned size */
/* UInt padding; */
}