Search
lxdream.org :: lxdream/src/xlat/x86/amd64abi.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/xlat/x86/amd64abi.h
changeset 1292:799fdd4f704a
prev1146:76c5d1064262
author nkeynes
date Fri Aug 24 08:53:50 2012 +1000 (8 years ago)
permissions -rw-r--r--
last change Move the generated prologue/epilogue code out into a common entry stub
(reduces space requirements) and pre-save all saved registers. Change
FASTCALL to use 3 regs instead of 2 since we can now keep everything in
regs.
file annotate diff log raw
1.1 --- a/src/xlat/x86/amd64abi.h Mon Nov 08 18:56:11 2010 +1000
1.2 +++ b/src/xlat/x86/amd64abi.h Fri Aug 24 08:53:50 2012 +1000
1.3 @@ -22,13 +22,18 @@
1.4 #define REG_ARG3 REG_RDX
1.5 #define REG_RESULT1 REG_RAX
1.6 #define MAX_REG_ARG 3 /* There's more, but we don't use more than 3 here anyway */
1.7 +#define REG_SAVE1 REG_R12
1.8 +#define REG_SAVE2 REG_R13
1.9 +#define REG_SAVE3 REG_R14
1.10 +#define REG_SAVE4 REG_R15
1.11 +#define REG_CALLPTR REG_EBX
1.12
1.13 -static inline void decode_address( uintptr_t base, int addr_reg )
1.14 +static inline void decode_address( uintptr_t base, int addr_reg, int target_reg )
1.15 {
1.16 - MOVL_r32_r32( addr_reg, REG_ECX );
1.17 - SHRL_imm_r32( 12, REG_ECX );
1.18 + MOVL_r32_r32( addr_reg, target_reg );
1.19 + SHRL_imm_r32( 12, target_reg );
1.20 MOVP_immptr_rptr( base, REG_RDI );
1.21 - MOVP_sib_rptr( 3, REG_RCX, REG_RDI, 0, REG_RCX );
1.22 + MOVP_sib_rptr( 3, target_reg, REG_RDI, 0, target_reg );
1.23 }
1.24
1.25 /**
.