revert between 56095 -> 55830 in arch
[AROS.git] / rom / exec / exec_platform.h
blobe65095e69b88b71ccc77fe15921b0e4912c1b58b
1 /*
2 * This file can be overriden in arch/all-$(ARCH)/exec.
3 */
4 #ifndef __EXEC_PLATFORM_H
5 #define __EXEC_PLATFORM_H
7 /*
8 * EXPERIMENTAL & Broken:
9 * undefine to use semaphore protection instead of
10 * Forbid()/Permit() for system memory allocation routines.
12 * Many AmigaOS programs assume forbid state won't get broken.
15 //#define __AROSEXEC_BROKENMEMLOCK__
17 /* the default Quantum value to use .. */
18 #define SCHEDQUANTUM_VALUE 4
20 struct Exec_PlatformData
22 /* No platform-specific data by default */
24 #ifdef AROS_NO_ATOMIC_OPERATIONS
25 #define IDNESTCOUNT_INC SysBase->IDNestCnt++
26 #define IDNESTCOUNT_DEC SysBase->IDNestCnt--
27 #define TDNESTCOUNT_INC SysBase->TDNestCnt++
28 #define TDNESTCOUNT_DEC SysBase->TDNestCnt--
29 #define FLAG_SCHEDQUANTUM_CLEAR SysBase->SysFlags &= ~SFF_QuantumOver
30 #define FLAG_SCHEDQUANTUM_SET SysBase->SysFlags |= SFF_QuantumOver
31 #define FLAG_SCHEDSWITCH_CLEAR SysBase->AttnResched &= ~ARF_AttnSwitch
32 #define FLAG_SCHEDSWITCH_SET SysBase->AttnResched |= ARF_AttnSwitch
33 #define FLAG_SCHEDDISPATCH_CLEAR SysBase->AttnResched &= ~ARF_AttnDispatch
34 #define FLAG_SCHEDDISPATCH_SET SysBase->AttnResched |= ARF_AttnDispatch
35 #else
36 #define IDNESTCOUNT_INC AROS_ATOMIC_INC(SysBase->IDNestCnt)
37 #define IDNESTCOUNT_DEC AROS_ATOMIC_DEC(SysBase->IDNestCnt)
38 #define TDNESTCOUNT_INC AROS_ATOMIC_INC(SysBase->TDNestCnt)
39 #define TDNESTCOUNT_DEC AROS_ATOMIC_DEC(SysBase->TDNestCnt)
40 #define FLAG_SCHEDQUANTUM_CLEAR AROS_ATOMIC_AND(SysBase->SysFlags, ~SFF_QuantumOver)
41 #define FLAG_SCHEDQUANTUM_SET AROS_ATOMIC_OR(SysBase->SysFlags, SFF_QuantumOver)
42 #define FLAG_SCHEDSWITCH_CLEAR AROS_ATOMIC_AND(SysBase->AttnResched, ~ARF_AttnSwitch)
43 #define FLAG_SCHEDSWITCH_SET AROS_ATOMIC_OR(SysBase->AttnResched, ARF_AttnSwitch)
44 #define FLAG_SCHEDDISPATCH_CLEAR AROS_ATOMIC_AND(SysBase->AttnResched, ~ARF_AttnDispatch)
45 #define FLAG_SCHEDDISPATCH_SET AROS_ATOMIC_OR(SysBase->AttnResched, ARF_AttnDispatch)
46 #endif
47 #define SCHEDQUANTUM_SET(val) (SysBase->Quantum=(val))
48 #define SCHEDQUANTUM_GET (SysBase->Quantum)
49 #define SCHEDELAPSED_SET(val) (SysBase->Elapsed=(val))
50 #define SCHEDELAPSED_GET (SysBase->Elapsed)
51 #define IDNESTCOUNT_GET (SysBase->IDNestCnt)
52 #define IDNESTCOUNT_SET(val) (SysBase->IDNestCnt=(val))
53 #define TDNESTCOUNT_GET (SysBase->TDNestCnt)
54 #define TDNESTCOUNT_SET(val) (SysBase->TDNestCnt=(val))
55 #define FLAG_SCHEDQUANTUM_ISSET (SysBase->SysFlags & SFF_QuantumOver)
56 #define FLAG_SCHEDSWITCH_ISSET (SysBase->AttnResched & ARF_AttnSwitch)
57 #define FLAG_SCHEDDISPATCH_ISSET (SysBase->AttnResched & ARF_AttnDispatch)
59 #define GET_THIS_TASK (SysBase->ThisTask)
60 #define SET_THIS_TASK(x) (SysBase->ThisTask=(x))
62 #endif /* __EXEC_PLATFORM_H */