(lwpSave, lwpReschedule) [hpc]: Move machine-dependent code to arch.c,
where it belongs. Code looks fishy. Untested. (initcontext, startpoint): Internal linkage.
This commit is contained in:
parent
955fab9d86
commit
3a18d0b986
3 changed files with 25 additions and 27 deletions
|
@ -70,8 +70,8 @@ lwpInitContext(struct lwpProc *newp, stack_t *spp)
|
|||
#elif defined(hpc)
|
||||
|
||||
static struct lwpProc *tempcontext;
|
||||
struct lwpProc *initcontext = NULL;
|
||||
int startpoint;
|
||||
static struct lwpProc *initcontext = NULL;
|
||||
static int startpoint;
|
||||
|
||||
static void
|
||||
startcontext(void)
|
||||
|
@ -117,6 +117,25 @@ lwpInitContext(struct lwpProc *newp, void *sp)
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
lwpSave(jmp_buf jb)
|
||||
{
|
||||
int endpoint;
|
||||
|
||||
endpoint = &endpoint;
|
||||
if (initcontext == NULL || endpoint < startpoint)
|
||||
return setjmp(jb, 1);
|
||||
|
||||
LwpCurrent->size = endpoint - startpoint;
|
||||
LwpCurrent->sbtm = realloc(LwpCurrent->sbtm, LwpCurrent->size);
|
||||
memcpy(LwpCurrent->sbtm, startpoint, LwpCurrent->size);
|
||||
if (setjmp(jb, 1)) {
|
||||
memcpy(startpoint, LwpCurrent->sbtm, LwpCurrent->size);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#elif defined(hpux)
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue