diff options
author | Mike Pall <mike> | 2012-08-02 15:13:28 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-08-02 15:13:28 +0200 |
commit | 77183e75f205cce3ffeabadfcd96504014b179f6 (patch) | |
tree | 56db11f535e5a165c55409f7ca8c2951b1520ecd /src | |
parent | 4b0af611d05fc15ccc57a050dead055546a3f485 (diff) | |
download | luajit-77183e75f205cce3ffeabadfcd96504014b179f6.tar.gz luajit-77183e75f205cce3ffeabadfcd96504014b179f6.tar.bz2 luajit-77183e75f205cce3ffeabadfcd96504014b179f6.zip |
FFI: Fix alignment of C call structure.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_ccall.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lj_ccall.h b/src/lj_ccall.h index 62f963e1..26198a02 100644 --- a/src/lj_ccall.h +++ b/src/lj_ccall.h | |||
@@ -36,6 +36,7 @@ | |||
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #define CCALL_SPS_FREE 1 | 38 | #define CCALL_SPS_FREE 1 |
39 | #define CCALL_ALIGN_CALLSTATE 16 | ||
39 | 40 | ||
40 | typedef LJ_ALIGN(16) union FPRArg { | 41 | typedef LJ_ALIGN(16) union FPRArg { |
41 | double d[2]; | 42 | double d[2]; |
@@ -117,6 +118,9 @@ typedef union FPRArg { | |||
117 | #ifndef CCALL_ALIGN_STACKARG | 118 | #ifndef CCALL_ALIGN_STACKARG |
118 | #define CCALL_ALIGN_STACKARG 1 | 119 | #define CCALL_ALIGN_STACKARG 1 |
119 | #endif | 120 | #endif |
121 | #ifndef CCALL_ALIGN_CALLSTATE | ||
122 | #define CCALL_ALIGN_CALLSTATE 8 | ||
123 | #endif | ||
120 | 124 | ||
121 | #define CCALL_NUM_GPR \ | 125 | #define CCALL_NUM_GPR \ |
122 | (CCALL_NARG_GPR > CCALL_NRET_GPR ? CCALL_NARG_GPR : CCALL_NRET_GPR) | 126 | (CCALL_NARG_GPR > CCALL_NRET_GPR ? CCALL_NARG_GPR : CCALL_NRET_GPR) |
@@ -131,7 +135,7 @@ LJ_STATIC_ASSERT(CCALL_NUM_FPR <= CCALL_MAX_FPR); | |||
131 | 135 | ||
132 | /* -- C call state -------------------------------------------------------- */ | 136 | /* -- C call state -------------------------------------------------------- */ |
133 | 137 | ||
134 | typedef LJ_ALIGN(8) struct CCallState { | 138 | typedef LJ_ALIGN(CCALL_ALIGN_CALLSTATE) struct CCallState { |
135 | void (*func)(void); /* Pointer to called function. */ | 139 | void (*func)(void); /* Pointer to called function. */ |
136 | uint32_t spadj; /* Stack pointer adjustment. */ | 140 | uint32_t spadj; /* Stack pointer adjustment. */ |
137 | uint8_t nsp; /* Number of stack slots. */ | 141 | uint8_t nsp; /* Number of stack slots. */ |