diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-07-30 19:11:16 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-07-30 19:11:16 +0200 |
commit | 4f33c88a51587681b7be1ae57cfbc43b627c6bc4 (patch) | |
tree | 25560404dc80007e5dc268811242c9071f6a1017 /sys/src/cmd/5i | |
parent | fcc5e75d07e5bc6cb3ddac6d9a437e7ec62d0d95 (diff) |
import updated compilers from sources
Diffstat (limited to 'sys/src/cmd/5i')
-rw-r--r-- | sys/src/cmd/5i/5i.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/src/cmd/5i/5i.c b/sys/src/cmd/5i/5i.c index 554a9f2cc..73e51219d 100644 --- a/sys/src/cmd/5i/5i.c +++ b/sys/src/cmd/5i/5i.c @@ -147,6 +147,15 @@ initstk(int argc, char *argv[]) initmap(); tos = STACKTOP - sizeof(Tos)*2; /* we'll assume twice the host's is big enough */ sp = tos; + for (i = 0; i < sizeof(Tos)*2; i++) + putmem_b(tos + i, 0); + + /* + * pid is second word from end of tos and needs to be set for nsec(). + * we know arm is a 32-bit cpu, so we'll assume knowledge of the Tos + * struct for now, and use our pid. + */ + putmem_w(tos + 4*4 + 2*sizeof(ulong) + 3*sizeof(uvlong), getpid()); /* Build exec stack */ size = strlen(file)+1+BY2WD+BY2WD+BY2WD; @@ -157,7 +166,7 @@ initstk(int argc, char *argv[]) sp &= ~7; reg.r[0] = tos; reg.r[13] = sp; - reg.r[1] = STACKTOP-4; /* Plan 9 profiling clock */ + reg.r[1] = STACKTOP-4; /* Plan 9 profiling clock (why & why in R1?) */ /* Push argc */ putmem_w(sp, argc+1); |