/* Stash away the client's FPC register because the helper might change it. */
buf = s390_emit_STFPC(buf, S390_REGNO_STACK_POINTER, S390_OFFSET_SAVED_FPC_C);
- /* Before we can call the helper, we need to save the link register,
- because the BASR will overwrite it. We cannot use a register for that.
- (a) Volatile registers will be modified by the helper.
- (b) For saved registers the client code assumes that they have not
- changed after the function returns. So we cannot use it to store
- the link register.
- In the dispatcher, before calling the client code, we have arranged for
- a location on the stack for this purpose. See dispatch-s390x-linux.S. */
- buf = s390_emit_STG(buf, S390_REGNO_LINK_REGISTER, 0, // save LR
- S390_REGNO_STACK_POINTER, S390_OFFSET_SAVED_LR, 0);
buf = s390_emit_BASR(buf, S390_REGNO_LINK_REGISTER, 1); // call helper
/* Move the return value to the destination register */
S390_REGNO_RETURN_VALUE);
}
- buf = s390_emit_LG(buf, S390_REGNO_LINK_REGISTER, 0, // restore LR
- S390_REGNO_STACK_POINTER, S390_OFFSET_SAVED_LR, 0);
buf = s390_emit_LFPC(buf, S390_REGNO_STACK_POINTER, // restore FPC
S390_OFFSET_SAVED_FPC_C);
/*--- Offsets in the stack frame allocated by the dispatcher ---*/
/*--------------------------------------------------------------*/
+/* Dispatcher will save 8 FPRs at offsets 160 + 0 ... 160 + 56 */
+
/* Where the dispatcher saves the r2 contents. */
-#define S390_OFFSET_SAVED_R2 160+96
+#define S390_OFFSET_SAVED_R2 160+80
/* Where client's FPC register is saved. */
-#define S390_OFFSET_SAVED_FPC_C 160+88
+#define S390_OFFSET_SAVED_FPC_C 160+72
/* Where valgrind's FPC register is saved. */
-#define S390_OFFSET_SAVED_FPC_V 160+80
-
-/* Where client code will save the link register before calling a helper. */
-#define S390_OFFSET_SAVED_LR 160+72
+#define S390_OFFSET_SAVED_FPC_V 160+64
/* Size of frame allocated by VG_(disp_run_translations)
Need size for
8 FPRs
- + 2 GPRs (SAVED_LR, and SAVED_R2)
+ + 1 GPR (SAVED_R2)
+ 2 FPCs (SAVED_FPC_C and SAVED_FPC_V).
Additionally, we need a standard frame for helper functions being called
from client code. (See figure 1-16 in zSeries ABI) */
-#define S390_INNERLOOP_FRAME_SIZE ((8+2+2)*8 + 160)
+#define S390_INNERLOOP_FRAME_SIZE ((8+1+2)*8 + 160)
/*--------------------------------------------------------------*/