diff options
author | Thilo Schulz <arny@ats.s.bawue.de> | 2011-05-31 20:47:18 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-09 22:29:04 +0000 |
commit | 11157ad2f337649f118811bd9122591577240aa1 (patch) | |
tree | 8348eaf2d5266b97619c8944c58d760d7e96497b | |
parent | 971fac79df9c8c29eb339455d72b8b29530449d5 (diff) |
Fix compilation on mingw64
-rw-r--r-- | src/qcommon/vm_x86_64.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/qcommon/vm_x86_64.c b/src/qcommon/vm_x86_64.c index ccd3ee91..7423755a 100644 --- a/src/qcommon/vm_x86_64.c +++ b/src/qcommon/vm_x86_64.c @@ -1082,21 +1082,26 @@ int VM_CallCompiled(vm_t *vm, int *args) opStack = PADP(stack, 4); *opStack = 0xDEADBEEF; + opStackRet = 0; __asm__ __volatile__ ( - " movq $0x0,%%rbx \r\n" \ - " movl %5,%%edi \r\n" \ " movq %4,%%r8 \r\n" \ " movq %3,%%r9 \r\n" \ " movq %2,%%r10 \r\n" \ + " push %%r15 \r\n" \ + " push %%r14 \r\n" \ + " push %%r13 \r\n" \ + " push %%r12 \r\n" \ " subq $24, %%rsp # fix alignment as call pushes one value \r\n" \ " callq *%%r10 \r\n" \ " addq $24, %%rsp \r\n" \ - " movl %%edi, %0 \r\n" \ - " movq %%rbx, %1 \r\n" \ - : "=g" (programStack), "=g" (opStackRet) + " pop %%r12 \r\n" \ + " pop %%r13 \r\n" \ + " pop %%r14 \r\n" \ + " pop %%r15 \r\n" + : "+D" (programStack), "+b" (opStackRet) : "g" (entryPoint), "g" (opStack), "g" (vm->dataBase), "g" (programStack) - : "%rsi", "%rdi", "%rax", "%rbx", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "%xmm0" + : "%rsi", "%rax", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%xmm0" ); if(opStackRet != 1 || *opStack != 0xDEADBEEF) |