Prog*
gtext(Sym *s, int32 stkoff)
{
+ int32 a;
+
+ a = 0;
+ if(!(textflag & NOSPLIT))
+ a = argsize();
+ else if(stkoff >= 128)
+ yyerror("stack frame too large for NOSPLIT function");
+
gpseudo(ATEXT, s, nodconst(stkoff));
p->to.type = D_CONST2;
- p->to.offset2 = argsize();
+ p->to.offset2 = a;
return p;
}
gtext(Sym *s, int32 stkoff)
{
vlong v;
-
- v = argsize() << 32;
+
+ v = 0;
+ if(!(textflag & NOSPLIT))
+ v |= argsize() << 32;
v |= stkoff & 0xffffffff;
+ if((textflag & NOSPLIT) && stkoff >= 128)
+ yyerror("stack frame too large for NOSPLIT function");
gpseudo(ATEXT, s, nodgconst(v, types[TVLONG]));
return p;
Prog*
gtext(Sym *s, int32 stkoff)
{
+ int32 a;
+
+ a = 0;
+ if(!(textflag & NOSPLIT))
+ a = argsize();
+ else if(stkoff >= 128)
+ yyerror("stack frame too large for NOSPLIT function");
+
gpseudo(ATEXT, s, nodconst(stkoff));
p->to.type = D_CONST2;
- p->to.offset2 = argsize();
+ p->to.offset2 = a;
return p;
}
case TVOID:
break;
case TDOT:
+ yyerror("function takes ... without textflag NOSPLIT");
s += 64;
break;
default:
}
// chansend1(hchan *chan any, elem any);
+#pragma textflag 7
void
·chansend1(Hchan* c, ...)
{
}
// chansend2(hchan *chan any, elem any) (pres bool);
+#pragma textflag 7
void
·chansend2(Hchan* c, ...)
{
}
// chanrecv1(hchan *chan any) (elem any);
+#pragma textflag 7
void
·chanrecv1(Hchan* c, ...)
{
}
// chanrecv2(hchan *chan any) (elem any, pres bool);
+#pragma textflag 7
void
·chanrecv2(Hchan* c, ...)
{
}
// newselect(size uint32) (sel *byte);
+#pragma textflag 7
void
·newselect(int32 size, ...)
{
}
// selectsend(sel *byte, hchan *chan any, elem any) (selected bool);
+#pragma textflag 7
void
·selectsend(Select *sel, Hchan *c, ...)
{
}
// selectrecv(sel *byte, hchan *chan any, elem *any) (selected bool);
+#pragma textflag 7
void
·selectrecv(Select *sel, Hchan *c, ...)
{
// selectdefaul(sel *byte) (selected bool);
+#pragma textflag 7
void
·selectdefault(Select *sel, ...)
{
}
// mapaccess1(hmap *map[any]any, key any) (val any);
+#pragma textflag 7
void
·mapaccess1(Hmap *h, ...)
{
}
// mapaccess2(hmap *map[any]any, key any) (val any, pres bool);
+#pragma textflag 7
void
·mapaccess2(Hmap *h, ...)
{
}
// mapassign1(hmap *map[any]any, key any, val any);
+#pragma textflag 7
void
·mapassign1(Hmap *h, ...)
{
}
// mapassign2(hmap *map[any]any, key any, val any, pres bool);
+#pragma textflag 7
void
·mapassign2(Hmap *h, ...)
{
}
// mapiter1(hiter *any) (key any);
+#pragma textflag 7
void
·mapiter1(struct hash_iter *it, ...)
{
}
// mapiter2(hiter *any) (key any, val any);
+#pragma textflag 7
void
·mapiter2(struct hash_iter *it, ...)
{
// unlock(&debuglock);
}
+#pragma textflag 7
void
·printf(String s, ...)
{
uint32 args;
byte *sp;
G *g1;
+ static int32 goid;
//printf("oldstack m->cret=%p\n", m->cret);
sp -= args;
mcpy(top->fp, sp, args);
}
+ goid = old.gobuf.g->goid; // fault if g is bad, before gogo
stackfree(g1->stackguard - StackGuard);
g1->stackbase = old.stackbase;
*/
#pragma textflag 7
void
-·newproc(int32 siz, byte* fn, byte* arg0)
+·newproc(int32 siz, byte* fn, ...)
{
- newproc1(fn, (byte*)&arg0, siz, 0);
+ newproc1(fn, (byte*)(&fn+1), siz, 0);
}
void
#pragma textflag 7
void
-·deferproc(int32 siz, byte* fn, byte* arg0)
+·deferproc(int32 siz, byte* fn, ...)
{
Defer *d;
d = malloc(sizeof(*d) + siz - sizeof(d->args));
d->fn = fn;
- d->sp = (byte*)&arg0;
+ d->sp = (byte*)(&fn+1);
d->siz = siz;
mcpy(d->args, d->sp, d->siz);