5e: fix _tos->pid / libthread bug
This commit is contained in:
parent
5f7342a461
commit
cebce1be70
3 changed files with 11 additions and 1 deletions
|
@ -35,3 +35,4 @@ void invalid(u32int);
|
|||
void fpatransfer(u32int);
|
||||
void fpaoperation(u32int);
|
||||
void fparegtransfer(u32int);
|
||||
void inittos(void);
|
||||
|
|
|
@ -108,8 +108,16 @@ initstack(int argc, char **argv)
|
|||
ap += len;
|
||||
}
|
||||
*(ulong *) vaddrnol(sp, 4) = 0;
|
||||
inittos();
|
||||
}
|
||||
|
||||
((Tos *) vaddrnol(tos, sizeof(Tos)))->pid = getpid();
|
||||
void
|
||||
inittos(void)
|
||||
{
|
||||
ulong tos;
|
||||
|
||||
tos = mach->utop - sizeof(Tos) * 2;
|
||||
((Tos *) vaddrnol(tos, sizeof(Tos)))->pid = P->pid;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -401,6 +401,7 @@ sysrfork(void)
|
|||
P = p;
|
||||
atexit(cleanup);
|
||||
P->pid = getpid();
|
||||
inittos();
|
||||
addproc(P);
|
||||
}
|
||||
P->R[0] = rc;
|
||||
|
|
Loading…
Reference in a new issue