#define AFS_ALPHA_ENV 1
#define AFS_ALPHA_XBSD_ENV 1
+#define AFS_64BIT_ENV 1
+
#define AFS_ALPHA_ENV 1
#define SYS_NAME "alpha_nbsd15"
lwp_cpptr->stack + lwp_cpptr->stacksize - 4)) {
#else
if (lwp_cpptr && lwp_cpptr->stack &&
- (lwp_cpptr->stackcheck != *(afs_int32 *)(lwp_cpptr->stack) ||
+ (lwp_cpptr->stackcheck != *(int *)(lwp_cpptr->stack) ||
lwp_cpptr->context.topstack < lwp_cpptr->stack ||
lwp_cpptr->context.topstack > (lwp_cpptr->stack + lwp_cpptr->stacksize))) {
#endif
printf("stackcheck = %u: stack = %u \n",
- lwp_cpptr->stackcheck, *(afs_int32 *)lwp_cpptr->stack);
+ lwp_cpptr->stackcheck, *(int *)lwp_cpptr->stack);
printf("topstack = 0x%x: stackptr = 0x%x: stacksize = 0x%x\n",
lwp_cpptr->context.topstack, lwp_cpptr->stack, lwp_cpptr->stacksize);
temp -> stacksize = stacksize;
#ifdef __hp9000s800
if (temp -> stack != NULL)
- temp -> stackcheck = *(afs_int32 *) ((temp -> stack) + stacksize - 4);
+ temp -> stackcheck = *(int *) ((temp -> stack) + stacksize - 4);
#else
if (temp -> stack != NULL)
- temp -> stackcheck = *(afs_int32 *) (temp -> stack);
+ temp -> stackcheck = *(int *) (temp -> stack);
#endif
temp -> ep = ep;
temp -> parm = parm;
RCSID("$Header$");
+#include "lwp.h"
+#include "preempt.h"
+
#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_DJGPP_ENV)
int PRE_Block = 0;
+
+
+int PRE_InitPreempt(slice)
+ struct timeval *slice;
+{
+ return LWP_SUCCESS;
+}
+
+int PRE_EndPreempt()
+{
+ return LWP_SUCCESS;
+}
+
#else
#include <sys/time.h>
#include <signal.h>
#include <ucontext.h>
-#include "lwp.h"
-#include "preempt.h"
#if defined(AFS_OSF_ENV) || defined(AFS_S390_LINUX20_ENV)
int PRE_Block = 0; /* used in lwp.c and process.s */
* *
\*******************************************************************/
+#if defined( _WIN32)
+#define PRE_InitPreempt(A)
+#endif
#if defined( _WIN32) || defined(AFS_LINUX20_ENV)
/* preemption not implemented for win32. Use threads instead. */
-#define PRE_InitPreempt(A)
#define PRE_PreemptMe()
#define PRE_BeginCritical()
#define PRE_EndCritical()
extern char *calloc();
#endif
#include <stdio.h>
+#include <stdlib.h>
#include "lwp.h"
#include "lock.h"
clean termination */
static int read_process(id)
- int id;
+ int *id;
{
- printf("\t[Reader %d]\n", id);
+ printf("\t[Reader %d]\n", *id);
LWP_DispatchProcess(); /* Just relinquish control for now */
PRE_PreemptMe();
asleep--;
for (i=0; i<10000; i++) ;
PRE_BeginCritical();
- printf("[%d: %s]\n", id, Remove(q));
+ printf("[%d: %s]\n", *id, Remove(q));
PRE_EndCritical();
ReleaseReadLock(&q->lock);
LWP_DispatchProcess();
int argc; char **argv;
{
int nreaders, i;
+ PROCESS pid;
afs_int32 interval; /* To satisfy Brad */
PROCESS *readers;
+ int *readerid;
PROCESS writer;
struct timeval tv;
interval = (argc >= 3 ? atoi(*++argv)*1000 : 50000);
if (argc == 4) lwp_debug = 1;
- LWP_InitializeProcessSupport(0, (PROCESS*)&i);
+ LWP_InitializeProcessSupport(0, &pid);
printf("[Support initialized]\n");
tv.tv_sec = 0;
tv.tv_usec = interval;
/* Now create readers */
printf("[Creating Readers...\n");
readers = (PROCESS *) calloc(nreaders, sizeof(PROCESS));
+ readerid = (int *)calloc(nreaders, sizeof(i));
for (i=0; i<nreaders; i++)
- LWP_CreateProcess(read_process, STACK_SIZE, 0, (void*)i, "Reader",
- &readers[i]);
+ LWP_CreateProcess(read_process, STACK_SIZE, 0, (void*)&readerid[i],
+ "Reader", &readers[i]);
printf("done]\n");
printf("\t[Creating Writer...\n");
afsdump_scan afsdump_dirlist afsdump_extract dumptool
clean:
- -rm xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h *.o \
+ -rm -f xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h *.o \
$(TARGETS) run-tests $(TEST_PROGRAMS) OS.pm
include ../config/Makefile.version