From f7a20068eee72811e7438e9c57e16d7a429230b5 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 9 Sep 2011 21:54:14 +0000 Subject: [PATCH] Support vm syscalls with up to 15 args using 64 bit compiled vm (like interprated vms). --- code/qcommon/vm_x86.c | 2 +- code/qcommon/vm_x86_64.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/qcommon/vm_x86.c b/code/qcommon/vm_x86.c index a303a335..1baf8223 100644 --- a/code/qcommon/vm_x86.c +++ b/code/qcommon/vm_x86.c @@ -442,7 +442,7 @@ static void DoSyscall(void) int *data; #if idx64 int index; - intptr_t args[11]; + intptr_t args[16]; #endif data = (int *) (savedVM->dataBase + programStack + 4); diff --git a/code/qcommon/vm_x86_64.c b/code/qcommon/vm_x86_64.c index 810bdc6f..c1400795 100644 --- a/code/qcommon/vm_x86_64.c +++ b/code/qcommon/vm_x86_64.c @@ -86,8 +86,8 @@ static intptr_t CROSSCALL callAsmCall(intptr_t callProgramStack, int64_t callSys { vm_t *savedVM; intptr_t ret = 0x77; - intptr_t args[11]; -// int iargs[11]; + intptr_t args[16]; +// int iargs[16]; int i; // Dfprintf(stderr, "callAsmCall(%ld, %ld)\n", callProgramStack, callSyscallNum); @@ -100,7 +100,7 @@ static intptr_t CROSSCALL callAsmCall(intptr_t callProgramStack, int64_t callSys args[0] = callSyscallNum; // iargs[0] = callSyscallNum; - for(i = 0; i < 10; ++i) + for(i = 0; i < ARRAY_LEN(args)-1; ++i) { // iargs[i+1] = *(int *)((byte *)currentVM->dataBase + callProgramStack + 8 + 4*i); args[i+1] = *(int *)((byte *)currentVM->dataBase + callProgramStack + 8 + 4*i);