#else
// We have to point to an address on the stack that is
// below the saved registers.
- gp->gcnextsp = &afterregs;
+ gp->gcnextsp = (uintptr)(&afterregs);
#endif
gp->fromgogo = false;
getcontext(ucontext_arg(&gp->context[0]));
// Setting gcstacksize to 0 is a marker meaning that gcinitialsp
// is the top of the stack, not the bottom.
gp->gcstacksize = 0;
- gp->gcnextsp = &arg;
+ gp->gcnextsp = (uintptr)(&arg);
#endif
// Save the currently active context. This will return
__splitstack_block_signals(&val, nil);
#else
gp->gcinitialsp = &val;
- gp->gcstack = nil;
+ gp->gcstack = 0;
gp->gcstacksize = 0;
- gp->gcnextsp = &val;
+ gp->gcnextsp = (uintptr)(&val);
#endif
getcontext(ucontext_arg(&gp->context[0]));
#ifdef USING_SPLIT_STACK
{
size_t gcstacksize;
- g->gcstack = __splitstack_find(nil, nil, &gcstacksize,
- &g->gcnextsegment, &g->gcnextsp,
- &g->gcinitialsp);
+ g->gcstack = (uintptr)(__splitstack_find(nil, nil, &gcstacksize,
+ (void**)(&g->gcnextsegment),
+ (void**)(&g->gcnextsp),
+ &g->gcinitialsp));
g->gcstacksize = (uintptr)gcstacksize;
}
#else
{
void *v;
- g->gcnextsp = (byte *) &v;
+ g->gcnextsp = (uintptr)(&v);
}
#endif
#ifdef USING_SPLIT_STACK
{
size_t gcstacksize;
- g->gcstack = __splitstack_find(nil, nil, &gcstacksize,
- &g->gcnextsegment, &g->gcnextsp,
- &g->gcinitialsp);
+ g->gcstack = (uintptr)(__splitstack_find(nil, nil, &gcstacksize,
+ (void**)(&g->gcnextsegment),
+ (void**)(&g->gcnextsp),
+ &g->gcinitialsp));
g->gcstacksize = (uintptr)gcstacksize;
}
#else
*spsize = newg->gcstacksize;
if(*spsize == 0)
runtime_throw("bad spsize in resetNewG");
- newg->gcnextsp = *sp;
+ newg->gcnextsp = (uintptr)(*sp);
#endif
}
// as schedlock and may have needed to start a new stack segment.
// Use the stack segment and stack pointer at the time of
// the system call instead, since that won't change underfoot.
- if(gp->gcstack != nil) {
- sp = gp->gcstack;
+ if(gp->gcstack != 0) {
+ sp = (void*)(gp->gcstack);
spsize = gp->gcstacksize;
- next_segment = gp->gcnextsegment;
- next_sp = gp->gcnextsp;
- initial_sp = gp->gcinitialsp;
+ next_segment = (void*)(gp->gcnextsegment);
+ next_sp = (void*)(gp->gcnextsp);
+ initial_sp = (void*)(gp->gcinitialsp);
} else {
sp = __splitstack_find_context((void**)(&gp->stackcontext[0]),
&spsize, &next_segment,
} else {
// Scanning another goroutine's stack.
// The goroutine is usually asleep (the world is stopped).
- bottom = (byte*)gp->gcnextsp;
+ bottom = (void*)gp->gcnextsp;
if(bottom == nil)
return;
}
- top = (byte*)gp->gcinitialsp + gp->gcstacksize;
+ top = (byte*)(void*)(gp->gcinitialsp) + gp->gcstacksize;
if(top > bottom)
scanstackblock(bottom, (uintptr)(top - bottom), gcw);
else