alpha-cleanup-20020119
authorLove Hörnquist-Åstrand <lha@e.kth.se>
Sat, 19 Jan 2002 09:25:19 +0000 (09:25 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sat, 19 Jan 2002 09:25:19 +0000 (09:25 +0000)
make alpha AFS_64BIT_ENV
Avoid warning by not passing data inside a pointer in the test program rw.

Provide compatibility symbols for those w/o preempt hack so its possible to
link test program `rw'.

When comparing to lwp_cpptr->statcheck, cast to int, since that is the type
of lwp_cpptr->statcheck. It may be the case that sizeof(int) !=
sizeof(afs_int32), but then other things will break too.

clean tests with -f

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================

and unbreak linux

src/config/param.alpha_nbsd15.h
src/lwp/lwp.c
src/lwp/preempt.c
src/lwp/preempt.h
src/lwp/rw.c
src/tests/Makefile.in

index 918a4f2..f592eb1 100644 (file)
@@ -5,6 +5,8 @@
 #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"
index 8569343..ac04876 100644 (file)
@@ -837,12 +837,12 @@ static int Dispatcher()           /* Lightweight process dispatcher */
                   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);
 
@@ -953,10 +953,10 @@ static void Initialize_PCB(temp, priority, stack, stacksize, ep, parm, name)
     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;
index ff6bd0d..4e60898 100644 (file)
 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 */
index e4fe79c..e295ab6 100644 (file)
 *                                                                  *
 \*******************************************************************/
 
+#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()
index ae7bf01..d10421c 100644 (file)
@@ -27,6 +27,7 @@ RCSID("$Header$");
 extern char *calloc();
 #endif
 #include <stdio.h>
+#include <stdlib.h>
 
 #include "lwp.h"
 #include "lock.h"
@@ -96,9 +97,9 @@ int asleep;   /* Number of processes sleeping -- used for
                   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();
@@ -116,7 +117,7 @@ static int read_process(id)
        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();
@@ -201,8 +202,10 @@ main(argc, argv)
    int argc; char **argv;
 {
     int nreaders, i;
+    PROCESS pid;
     afs_int32 interval;        /* To satisfy Brad */
     PROCESS *readers;
+    int *readerid;
     PROCESS writer;
     struct timeval tv;
 
@@ -219,7 +222,7 @@ main(argc, argv)
     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;
@@ -235,9 +238,10 @@ main(argc, argv)
     /* 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");
index 4baaa27..b3d9f07 100644 (file)
@@ -363,7 +363,7 @@ all: run-tests OpenAFS/OS.pm libxfiles.a libdumpscan.a $(TEST_PROGRAMS)\
        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