Merge branch 'master' of git://cadel.mutabah.net/acess2
[tpg/acess2.git] / AcessNative / acesskernel_src / include / arch.h
index f513530..868a056 100644 (file)
@@ -5,7 +5,6 @@
 
 #include <stdint.h>
 //#include <stdlib.h>
-#include <pthread.h>
 #undef CLONE_VM
 #define        _MODULE_NAME_   "NativeKernel"
 
@@ -29,16 +28,29 @@ typedef intptr_t    tPAddr;
 
 typedef        int     BOOL;
 
+extern void    exit(int status) __attribute__((noreturn));
+#define HALT_CPU()     exit(1)
+
+#include <stddef.h>
+#undef offsetof
+
 struct sShortSpinlock
 {
-        int    IsValid;
-       pthread_mutex_t Mutex;
+       void    *Mutex;
 };
 
-#define SHORTLOCK(...)
-#define SHORTREL(...)
+extern void    Threads_int_ShortLock(void **Ptr);
+extern void    Threads_int_ShortRel(void **Ptr);
+extern int     Threads_int_ShortHas(void **Ptr);
+
+#define SHORTLOCK(l)   Threads_int_ShortLock(&(l)->Mutex)
+#define SHORTREL(l)    Threads_int_ShortRel(&(l)->Mutex)
+#define CPU_HAS_LOCK(l)        Threads_int_ShortHas(&(l)->Mutex)
 
 //#define      NUM_CFG_ENTRIES 10
 
+extern void    Debug_PutCharDebug(char ch);
+extern void    Debug_PutStringDebug(const char *str);
+
 #endif
 

UCC git Repository :: git.ucc.asn.au