aboutsummaryrefslogtreecommitdiff
path: root/src/lj_ccall.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_ccall.h')
-rw-r--r--src/lj_ccall.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lj_ccall.h b/src/lj_ccall.h
index 547415f7..57300817 100644
--- a/src/lj_ccall.h
+++ b/src/lj_ccall.h
@@ -152,14 +152,15 @@ typedef union FPRArg {
152LJ_STATIC_ASSERT(CCALL_NUM_GPR <= CCALL_MAX_GPR); 152LJ_STATIC_ASSERT(CCALL_NUM_GPR <= CCALL_MAX_GPR);
153LJ_STATIC_ASSERT(CCALL_NUM_FPR <= CCALL_MAX_FPR); 153LJ_STATIC_ASSERT(CCALL_NUM_FPR <= CCALL_MAX_FPR);
154 154
155#define CCALL_MAXSTACK 32 155#define CCALL_NUM_STACK 31
156#define CCALL_SIZE_STACK (CCALL_NUM_STACK * CTSIZE_PTR)
156 157
157/* -- C call state -------------------------------------------------------- */ 158/* -- C call state -------------------------------------------------------- */
158 159
159typedef LJ_ALIGN(CCALL_ALIGN_CALLSTATE) struct CCallState { 160typedef LJ_ALIGN(CCALL_ALIGN_CALLSTATE) struct CCallState {
160 void (*func)(void); /* Pointer to called function. */ 161 void (*func)(void); /* Pointer to called function. */
161 uint32_t spadj; /* Stack pointer adjustment. */ 162 uint32_t spadj; /* Stack pointer adjustment. */
162 uint8_t nsp; /* Number of stack slots. */ 163 uint8_t nsp; /* Number of bytes on stack. */
163 uint8_t retref; /* Return value by reference. */ 164 uint8_t retref; /* Return value by reference. */
164#if LJ_TARGET_X64 165#if LJ_TARGET_X64
165 uint8_t ngpr; /* Number of arguments in GPRs. */ 166 uint8_t ngpr; /* Number of arguments in GPRs. */
@@ -178,7 +179,7 @@ typedef LJ_ALIGN(CCALL_ALIGN_CALLSTATE) struct CCallState {
178 FPRArg fpr[CCALL_NUM_FPR]; /* Arguments/results in FPRs. */ 179 FPRArg fpr[CCALL_NUM_FPR]; /* Arguments/results in FPRs. */
179#endif 180#endif
180 GPRArg gpr[CCALL_NUM_GPR]; /* Arguments/results in GPRs. */ 181 GPRArg gpr[CCALL_NUM_GPR]; /* Arguments/results in GPRs. */
181 GPRArg stack[CCALL_MAXSTACK]; /* Stack slots. */ 182 GPRArg stack[CCALL_NUM_STACK]; /* Stack slots. */
182} CCallState; 183} CCallState;
183 184
184/* -- C call handling ----------------------------------------------------- */ 185/* -- C call handling ----------------------------------------------------- */