1 #ifndef INLINE_EXECLOCK_H
2 #define INLINE_EXECLOCK_H
5 Copyright © 2017, The AROS Development Team. All rights reserved.
9 Desc: Inline function(s) for execlock
12 #include <aros/libcall.h>
13 #include <exec/types.h>
14 #include <aros/symbolsets.h>
15 #include <aros/preprocessor/variadic/cast2iptr.hpp>
18 #if !defined(__EXECLOCK_LIBAPI__) || (36 <= __EXECLOCK_LIBAPI__)
20 static inline int __inline_ExecLock_ObtainSystemLock(struct List
* __arg1
, ULONG __arg2
, ULONG __arg3
, APTR __ExecLockBase
)
22 AROS_LIBREQ(ExecLockBase
, 36)
23 return AROS_LC3(int, ObtainSystemLock
,
24 AROS_LCA(struct List
*,(__arg1
),A0
),
25 AROS_LCA(ULONG
,(__arg2
),D0
),
26 AROS_LCA(ULONG
,(__arg3
),D1
),
27 struct Library
*, (__ExecLockBase
), 1, ExecLock
);
30 #define ObtainSystemLock(arg1, arg2, arg3) \
31 __inline_ExecLock_ObtainSystemLock((arg1), (arg2), (arg3), __aros_getbase_ExecLockBase())
33 #endif /* !defined(__EXECLOCK_LIBAPI__) || (36 <= __EXECLOCK_LIBAPI__) */
35 #if !defined(__EXECLOCK_LIBAPI__) || (36 <= __EXECLOCK_LIBAPI__)
37 static inline void __inline_ExecLock_ReleaseSystemLock(struct List
* __arg1
, ULONG __arg2
, APTR __ExecLockBase
)
39 AROS_LIBREQ(ExecLockBase
, 36)
40 AROS_LC2NR(void, ReleaseSystemLock
,
41 AROS_LCA(struct List
*,(__arg1
),A0
),
42 AROS_LCA(ULONG
,(__arg2
),D1
),
43 struct Library
*, (__ExecLockBase
), 2, ExecLock
);
46 #define ReleaseSystemLock(arg1, arg2) \
47 __inline_ExecLock_ReleaseSystemLock((arg1), (arg2), __aros_getbase_ExecLockBase())
49 #endif /* !defined(__EXECLOCK_LIBAPI__) || (36 <= __EXECLOCK_LIBAPI__) */
51 #if !defined(__EXECLOCK_LIBAPI__) || (36 <= __EXECLOCK_LIBAPI__)
53 static inline APTR
__inline_ExecLock_AllocLock(APTR __ExecLockBase
)
55 AROS_LIBREQ(ExecLockBase
, 36)
56 return AROS_LC0(APTR
, AllocLock
,
57 struct Library
*, (__ExecLockBase
), 3, ExecLock
);
61 __inline_ExecLock_AllocLock(__aros_getbase_ExecLockBase())
63 #endif /* !defined(__EXECLOCK_LIBAPI__) || (36 <= __EXECLOCK_LIBAPI__) */
65 #if !defined(__EXECLOCK_LIBAPI__) || (36 <= __EXECLOCK_LIBAPI__)
67 static inline void __inline_ExecLock_FreeLock(APTR __arg1
, APTR __ExecLockBase
)
69 AROS_LIBREQ(ExecLockBase
, 36)
70 AROS_LC1NR(void, FreeLock
,
71 AROS_LCA(APTR
,(__arg1
),A0
),
72 struct Library
*, (__ExecLockBase
), 4, ExecLock
);
75 #define FreeLock(arg1, arg2) \
76 __inline_ExecLock_FreeLock((arg1), __aros_getbase_ExecLockBase())
78 #endif /* !defined(__EXECLOCK_LIBAPI__) || (36 <= __EXECLOCK_LIBAPI__) */
80 #if !defined(__EXECLOCK_LIBAPI__) || (36 <= __EXECLOCK_LIBAPI__)
82 static inline int __inline_ExecLock_ObtainLock(APTR __arg1
, ULONG __arg2
, ULONG __arg3
, APTR __ExecLockBase
)
84 AROS_LIBREQ(ExecLockBase
, 36)
85 return AROS_LC3(int, ObtainLock
,
86 AROS_LCA(APTR
,(__arg1
),A0
),
87 AROS_LCA(ULONG
,(__arg2
),D0
),
88 AROS_LCA(ULONG
,(__arg3
),D1
),
89 struct Library
*, (__ExecLockBase
), 5, ExecLock
);
92 #define ObtainLock(arg1, arg2, arg3) \
93 __inline_ExecLock_ObtainLock((arg1), (arg2), (arg3), __aros_getbase_ExecLockBase())
95 #endif /* !defined(__EXECLOCK_LIBAPI__) || (36 <= __EXECLOCK_LIBAPI__) */
97 #if !defined(__EXECLOCK_LIBAPI__) || (36 <= __EXECLOCK_LIBAPI__)
99 static inline void __inline_ExecLock_ReleaseLock(APTR __arg1
, ULONG __arg2
, APTR __ExecLockBase
)
101 AROS_LIBREQ(ExecLockBase
, 36)
102 AROS_LC2NR(void, ReleaseLock
,
103 AROS_LCA(APTR
,(__arg1
),A0
),
104 AROS_LCA(ULONG
,(__arg2
),D1
),
105 struct Library
*, (__ExecLockBase
), 6, ExecLock
);
108 #define ReleaseLock(arg1, arg2) \
109 __inline_ExecLock_ReleaseLock((arg1), (arg2), __aros_getbase_ExecLockBase())
111 #endif /* !defined(__EXECLOCK_LIBAPI__) || (36 <= __EXECLOCK_LIBAPI__) */
113 #endif /* INLINE_EXECLOCK_H*/