(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:
Markus Armbruster 2005-12-05 21:38:03 +00:00
parent 955fab9d86
commit 3a18d0b986
3 changed files with 25 additions and 27 deletions

View file

@ -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