changes
[IRC.git] / Robust / src / Runtime / runtime.h
index cd7939f32728d6d4cf673f474faa859d5811c127..9c00112ef872058a7a8cb2345cc9d7dec8ddd5c8 100644 (file)
@@ -47,10 +47,10 @@ extern void * curr_heaptop;
 #define OBJECTARRAYINTERVAL 10
 
 #define ARRAYSET(array, type, index, value) \
-  ((type *)(& (& array->___length___)[1]))[index]=value
+  ((type *)(&(&array->___length___)[1]))[index]=value
 
 #define ARRAYGET(array, type, index) \
-  ((type *)(& (& array->___length___)[1]))[index]
+  ((type *)(&(&array->___length___)[1]))[index]
 
 #ifdef OPTIONAL
 #define OPTARG(x) , x
@@ -150,13 +150,14 @@ void createstartupobject();
 #ifdef MULTICORE
 #include "SimpleHash.h"
 inline void run(int argc, char** argv);
-int receiveObject(int send_port_pending);
+int receiveObject_I();
 void * smemalloc_I(int coren, int size, int * allocsize);
 #ifdef MULTICORE_GC
 inline void setupsmemmode(void);
 #endif
 #endif
 
+#if (defined(THREADS)||defined(MGC))
 #define MAXLOCKS 256
 
 struct lockpair {
@@ -173,6 +174,7 @@ struct lockvector {
 extern __thread struct lockvector lvector;
 extern __thread int mythreadid;
 #endif
+#endif
 
 #ifdef TASK
 #ifndef MULTICORE
@@ -281,45 +283,23 @@ int enqueuetasks(struct parameterwrapper *parameter, struct parameterwrapper *pr
 #endif
 
 #if defined(__i386__)
-
-static __inline__ unsigned long long rdtsc(void)
-{
+static __inline__ unsigned long long rdtsc(void) {
   unsigned long long int x;
   __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
   return x;
 }
 #elif defined(__x86_64__)
-
-static __inline__ unsigned long long rdtsc(void)
-{
+static __inline__ unsigned long long rdtsc(void) {
   unsigned hi, lo;
-  __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
+  __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
   return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 );
 }
+#endif
 
-#elif defined(__powerpc__)
-
-typedef unsigned long long int unsigned long long;
-
-static __inline__ unsigned long long rdtsc(void)
-{
-  unsigned long long int result=0;
-  unsigned long int upper, lower,tmp;
-  __asm__ volatile(
-      "0:                  \n"
-      "\tmftbu   %0           \n"
-      "\tmftb    %1           \n"
-      "\tmftbu   %2           \n"
-      "\tcmpw    %2,%0        \n"
-      "\tbne     0b         \n"
-      : "=r"(upper),"=r"(lower),"=r"(tmp)
-                  );
-  result = upper;
-  result = result<<32;
-  result = result|lower;
-
-  return(result);
-}
+#ifdef JNI
+typedef struct ___java___________lang___________Object___ * ObjectPtr
+#else
+typedef struct ___Object___ * ObjectPtr
 #endif