868a0569c424934ea761926eff33e6211291c17e
[tpg/acess2.git] / AcessNative / acesskernel_src / include / arch.h
1 /**
2  */
3 #ifndef _ARCH_H_
4 #define _ARCH_H_
5
6 #include <stdint.h>
7 //#include <stdlib.h>
8 #undef CLONE_VM
9 #define _MODULE_NAME_   "NativeKernel"
10
11 #define PAGE_SIZE       0x1000  // Assume, making an Ass out of u and me
12 #define BITS    (sizeof(intptr_t)*8)
13
14 typedef uint8_t Uint8;
15 typedef uint16_t        Uint16;
16 typedef uint32_t        Uint32;
17 typedef uint64_t        Uint64;
18
19 typedef int8_t  Sint8;
20 typedef int16_t Sint16;
21 typedef int32_t Sint32;
22 typedef int64_t Sint64;
23
24 typedef intptr_t        Uint;
25
26 typedef intptr_t        tVAddr;
27 typedef intptr_t        tPAddr;
28
29 typedef int     BOOL;
30
31 extern void     exit(int status) __attribute__((noreturn));
32 #define HALT_CPU()      exit(1)
33
34 #include <stddef.h>
35 #undef offsetof
36
37 struct sShortSpinlock
38 {
39         void    *Mutex;
40 };
41
42 extern void     Threads_int_ShortLock(void **Ptr);
43 extern void     Threads_int_ShortRel(void **Ptr);
44 extern int      Threads_int_ShortHas(void **Ptr);
45
46 #define SHORTLOCK(l)    Threads_int_ShortLock(&(l)->Mutex)
47 #define SHORTREL(l)     Threads_int_ShortRel(&(l)->Mutex)
48 #define CPU_HAS_LOCK(l) Threads_int_ShortHas(&(l)->Mutex)
49
50 //#define       NUM_CFG_ENTRIES 10
51
52 extern void     Debug_PutCharDebug(char ch);
53 extern void     Debug_PutStringDebug(const char *str);
54
55 #endif
56

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