X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Tools%2Fnativelib%2Finclude%2Facess.h;h=b8bd4df29fa84703e63b587dc64bc487363d8b5b;hb=cd8146698b87d571d8393336fb013e6406ba7e5a;hp=c7f77751e2b3a90d7787b374c14107e49825bae7;hpb=c3b821ccc009ec819f2580a53c0ed423aad43bf9;p=tpg%2Facess2.git diff --git a/Tools/nativelib/include/acess.h b/Tools/nativelib/include/acess.h index c7f77751..b8bd4df2 100644 --- a/Tools/nativelib/include/acess.h +++ b/Tools/nativelib/include/acess.h @@ -50,15 +50,13 @@ typedef uint32_t tUID; typedef uint32_t tGID; typedef uint32_t tTID; -// NOTE: Since this is single-threaded (for now) mutexes can be implimented as simple locks -typedef char tShortSpinlock; - typedef int64_t tTime; extern tTime now(void); extern int64_t timestamp(int sec, int min, int hr, int day, int month, int year); extern void format_date(tTime TS, int *year, int *month, int *day, int *hrs, int *mins, int *sec, int *ms); #define PACKED __attribute__((packed)) +#define NORETURN __attribute__((noreturn)) #define DEPRECATED #define EXPORT(s) #define EXPORTV(s) @@ -70,11 +68,13 @@ extern void *malloc(size_t bytes); extern void *calloc(size_t nmemb, size_t size); extern void *realloc(void *oldptr, size_t bytes); extern void free(void *buffer); +extern char *strdup(const char *str); #include #include // Threads +extern void **Threads_GetHandlesPtr(void); extern int *Threads_GetErrno(void); //extern tPGID Threads_GetPGID(void); //extern tPID Threads_GetPID(void); @@ -145,18 +145,10 @@ extern uint64_t DivMod64U(uint64_t Num, uint64_t Den, uint64_t *Rem); static inline int MIN(int a, int b) { return a < b ? a : b; } static inline int MAX(int a, int b) { return a > b ? a : b; } -#if USE_MULTITHREADING -#error "TODO: Impliment multithreaded SHORTLOCK" -#else -static inline void SHORTLOCK(tShortSpinlock *Lock) { - if(*Lock) Log_KernelPanic("---", "Double short lock"); - *Lock = 1; -} -static inline void SHORTREL(tShortSpinlock *m) { *m = 0; } -static inline int CPU_HAS_LOCK(tShortSpinlock *m) { return *m; } -#endif +#include static inline intptr_t MM_GetPhysAddr(void *Ptr) { return 1; } +static inline int MM_IsUser(const void *Ptr) { return 1; } #endif