Test initialisation of MUIA_List_AdjustWidth and MUIA_List_AdjustHeight, and
[AROS.git] / arch / all-unix / exec / exec_platform.h
blob082d79938e87f42f5f1b94c293c48c166a94f4cc
1 #ifndef __EXEC_PLATFORM_H
2 #define __EXEC_PLATFORM_H
4 #ifdef HOST_OS_android
5 /* Android is not a true Linux ;-) */
6 #undef HOST_OS_linux
8 #else
10 /* On Darwin this definition is required by ucontext.h (which is marked as deprecated) */
11 #define _XOPEN_SOURCE
12 #include <ucontext.h>
14 #endif
16 #ifdef HOST_OS_linux
17 #define LIBC_NAME "libc.so.6"
18 #endif
20 #ifdef HOST_OS_darwin
21 #define LIBC_NAME "libSystem.dylib"
22 #endif
24 #ifndef LIBC_NAME
25 #define LIBC_NAME "libc.so"
26 #endif
28 struct LibCInterface
30 void (*exit)(int status);
31 #ifdef HAVE_SWAPCONTEXT
32 int (*getcontext)(ucontext_t *ucp);
33 void (*makecontext)(ucontext_t *ucp, void *func(), int argc, ...);
34 int (*swapcontext)(ucontext_t *oucp, ucontext_t *ucp);
35 #endif
38 struct Exec_PlatformData
40 APTR HostLibBase;
41 struct LibCInterface *SysIFace;
44 #define HostLibBase PD(SysBase).HostLibBase
46 #ifdef AROS_NO_ATOMIC_OPERATIONS
47 #define IDNESTCOUNT_INC SysBase->IDNestCnt++
48 #define IDNESTCOUNT_DEC SysBase->IDNestCnt--
49 #define TDNESTCOUNT_INC SysBase->TDNestCnt++
50 #define TDNESTCOUNT_DEC SysBase->TDNestCnt--
51 #define FLAG_SCHEDQUANTUM_CLEAR SysBase->SysFlags &= ~SFF_QuantumOver
52 #define FLAG_SCHEDQUANTUM_SET SysBase->SysFlags |= SFF_QuantumOver
53 #define FLAG_SCHEDSWITCH_CLEAR SysBase->AttnResched &= ~ARF_AttnSwitch
54 #define FLAG_SCHEDSWITCH_SET SysBase->AttnResched |= ARF_AttnSwitch
55 #define FLAG_SCHEDDISPATCH_CLEAR SysBase->AttnResched &= ~ARF_AttnDispatch
56 #define FLAG_SCHEDDISPATCH_SET SysBase->AttnResched |= ARF_AttnDispatch
57 #else
58 #define IDNESTCOUNT_INC AROS_ATOMIC_INC(SysBase->IDNestCnt)
59 #define IDNESTCOUNT_DEC AROS_ATOMIC_DEC(SysBase->IDNestCnt)
60 #define TDNESTCOUNT_INC AROS_ATOMIC_INC(SysBase->TDNestCnt)
61 #define TDNESTCOUNT_DEC AROS_ATOMIC_DEC(SysBase->TDNestCnt)
62 #define FLAG_SCHEDQUANTUM_CLEAR AROS_ATOMIC_AND(SysBase->SysFlags, ~SFF_QuantumOver)
63 #define FLAG_SCHEDQUANTUM_SET AROS_ATOMIC_OR(SysBase->SysFlags, SFF_QuantumOver)
64 #define FLAG_SCHEDSWITCH_CLEAR AROS_ATOMIC_AND(SysBase->AttnResched, ~ARF_AttnSwitch)
65 #define FLAG_SCHEDSWITCH_SET AROS_ATOMIC_OR(SysBase->AttnResched, ARF_AttnSwitch)
66 #define FLAG_SCHEDDISPATCH_CLEAR AROS_ATOMIC_AND(SysBase->AttnResched, ~ARF_AttnDispatch)
67 #define FLAG_SCHEDDISPATCH_SET AROS_ATOMIC_OR(SysBase->AttnResched, ARF_AttnDispatch)
68 #endif
69 #define IDNESTCOUNT_GET (SysBase->IDNestCnt)
70 #define IDNESTCOUNT_SET(val) (SysBase->IDNestCnt=(val))
71 #define TDNESTCOUNT_GET (SysBase->TDNestCnt)
72 #define TDNESTCOUNT_SET(val) (SysBase->TDNestCnt=(val))
73 #define FLAG_SCHEDQUANTUM_ISSET (SysBase->SysFlags & SFF_QuantumOver)
74 #define FLAG_SCHEDSWITCH_ISSET (SysBase->AttnResched & ARF_AttnSwitch)
75 #define FLAG_SCHEDDISPATCH_ISSET (SysBase->AttnResched & ARF_AttnDispatch)
77 #define GET_THIS_TASK (SysBase->ThisTask)
78 #define SET_THIS_TASK(x) (SysBase->ThisTask=(x))
80 #endif /* __EXEC_PLATFORM_H */