[BOUNDS_CHECK]: Defunct, remove.
(lwpReschedule): Fix potential crash bug that crept in with BOUNDS_CHECK years ago.
This commit is contained in:
parent
d5774a938d
commit
a76c6d3a4a
2 changed files with 1 additions and 43 deletions
|
@ -31,11 +31,6 @@
|
||||||
|
|
||||||
#if defined(_EMPTH_LWP)
|
#if defined(_EMPTH_LWP)
|
||||||
|
|
||||||
#ifdef BOUNDS_CHECK
|
|
||||||
#include <bounds/fix-args.h>
|
|
||||||
#include <bounds/unchecked.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct lwpQueue LwpSchedQ[LWP_MAX_PRIO], LwpDeadQ;
|
struct lwpQueue LwpSchedQ[LWP_MAX_PRIO], LwpDeadQ;
|
||||||
|
|
||||||
struct lwpProc *LwpCurrent = NULL;
|
struct lwpProc *LwpCurrent = NULL;
|
||||||
|
@ -53,16 +48,7 @@ static int
|
||||||
growsdown(void *x)
|
growsdown(void *x)
|
||||||
{
|
{
|
||||||
int y;
|
int y;
|
||||||
|
|
||||||
#ifdef BOUNDS_CHECK
|
|
||||||
BOUNDS_CHECKING_OFF;
|
|
||||||
#endif
|
|
||||||
y = (x > (void *)&y);
|
y = (x > (void *)&y);
|
||||||
|
|
||||||
#ifdef BOUNDS_CHECK
|
|
||||||
BOUNDS_CHECKING_ON;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +97,6 @@ lwpReschedule(void)
|
||||||
lwpAddTail(&LwpDeadQ, nextp);
|
lwpAddTail(&LwpDeadQ, nextp);
|
||||||
} else {
|
} else {
|
||||||
lwpDestroy(nextp);
|
lwpDestroy(nextp);
|
||||||
/* fprintf(stderr, "Destroying done\n"); */
|
|
||||||
}
|
}
|
||||||
nextp = 0;
|
nextp = 0;
|
||||||
}
|
}
|
||||||
|
@ -125,28 +110,12 @@ lwpReschedule(void)
|
||||||
if (LwpCurrent)
|
if (LwpCurrent)
|
||||||
lwpStatus(LwpCurrent, "switch out");
|
lwpStatus(LwpCurrent, "switch out");
|
||||||
/* do context switch */
|
/* do context switch */
|
||||||
#ifdef BOUNDS_CHECK
|
if (LwpCurrent != nextp && !(LwpCurrent && lwpSave(LwpCurrent->context))) {
|
||||||
BOUNDS_CHECKING_OFF;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
i = lwpSave(LwpCurrent->context);
|
|
||||||
#ifdef BOUNDS_CHECK
|
|
||||||
BOUNDS_CHECKING_ON;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (LwpCurrent != nextp && !(LwpCurrent && i)) {
|
|
||||||
/* restore previous context */
|
/* restore previous context */
|
||||||
lwpStatus(nextp, "switch in %d", nextp->pri);
|
lwpStatus(nextp, "switch in %d", nextp->pri);
|
||||||
LwpCurrent = nextp;
|
LwpCurrent = nextp;
|
||||||
*LwpContextPtr = LwpCurrent->ud;
|
*LwpContextPtr = LwpCurrent->ud;
|
||||||
#ifdef BOUNDS_CHECK
|
|
||||||
BOUNDS_CHECKING_OFF;
|
|
||||||
#endif
|
|
||||||
lwpRestore(LwpCurrent->context);
|
lwpRestore(LwpCurrent->context);
|
||||||
|
|
||||||
#ifdef BOUNDS_CHECK
|
|
||||||
BOUNDS_CHECKING_ON;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,9 +127,6 @@ lwpEntryPoint(void)
|
||||||
{
|
{
|
||||||
sigset_t set;
|
sigset_t set;
|
||||||
|
|
||||||
#ifdef BOUNDS_CHECK
|
|
||||||
BOUNDS_CHECKING_OFF;
|
|
||||||
#endif
|
|
||||||
sigemptyset(&set);
|
sigemptyset(&set);
|
||||||
sigaddset(&set, SIGALRM);
|
sigaddset(&set, SIGALRM);
|
||||||
sigprocmask(SIG_SETMASK, &set, &oldmask);
|
sigprocmask(SIG_SETMASK, &set, &oldmask);
|
||||||
|
@ -169,11 +135,6 @@ lwpEntryPoint(void)
|
||||||
lwpStatus(LwpCurrent, "starting at entry point");
|
lwpStatus(LwpCurrent, "starting at entry point");
|
||||||
(*LwpCurrent->entry)(LwpCurrent->ud);
|
(*LwpCurrent->entry)(LwpCurrent->ud);
|
||||||
lwpExit();
|
lwpExit();
|
||||||
#ifdef BOUNDS_CHECK
|
|
||||||
BOUNDS_CHECKING_ON;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -33,9 +33,6 @@
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef BOUNDS_CHECK
|
|
||||||
#include <bounds/fix-args.h>
|
|
||||||
#endif
|
|
||||||
#include "lwp.h"
|
#include "lwp.h"
|
||||||
|
|
||||||
#if defined(_EMPTH_LWP)
|
#if defined(_EMPTH_LWP)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue