aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/windows/thread.c
diff options
context:
space:
mode:
authorHector Chu <hectorchu@gmail.com>2011-01-25 17:56:33 +1100
committerAlex Brainman <alex.brainman@gmail.com>2011-01-25 17:56:33 +1100
commit90294a08c830b22acb8ab58113d02ae816b82274 (patch)
tree5dcbc5d5dd420b7ecded8db15cdbb87559d431ed /src/pkg/runtime/windows/thread.c
parent4e5e0b1d20f8636be3e576302a4e3a6f59caab3e (diff)
downloadgo-90294a08c830b22acb8ab58113d02ae816b82274.tar.xz
runtime: make Walk webbrowser example work
R=rsc, brainman, lxn CC=golang-dev https://golang.org/cl/4005045
Diffstat (limited to 'src/pkg/runtime/windows/thread.c')
-rw-r--r--src/pkg/runtime/windows/thread.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pkg/runtime/windows/thread.c b/src/pkg/runtime/windows/thread.c
index ac237961f4..585f6fc592 100644
--- a/src/pkg/runtime/windows/thread.c
+++ b/src/pkg/runtime/windows/thread.c
@@ -276,13 +276,13 @@ runtime·compilecallback(byte *code, void *fn, uint32 argsize)
byte *p;
p = code;
- // SUBL $12, SP
+ // SUBL $16, SP
*p++ = 0x83;
*p++ = 0xec;
- *p++ = 0x0c;
- // PUSH argsize
+ *p++ = 0x10;
+ // PUSH argsize * 4
*p++ = 0x68;
- *(uint32*)p = argsize;
+ *(uint32*)p = argsize << 2;
p += 4;
// PUSH fn
*p++ = 0x68;
@@ -308,8 +308,8 @@ runtime·callback(void *arg, void (*fn)(void), int32 argsize)
G *g1;
void *sp, *gostack;
void **p;
- USED(argsize);
+ USED(argsize);
if(g != m->g0)
runtime·throw("bad g in callback");
@@ -326,7 +326,7 @@ runtime·callback(void *arg, void (*fn)(void), int32 argsize)
if(sp < g1->stackguard - StackGuard + 4) // +4 for return address
runtime·throw("g stack overflow in callback");
-
+
p = sp;
p[0] = arg;