start to stub out the public locking mechanisms for access to exec resources that...
[AROS.git] / compiler / include / rexx / rexxcall-m68k.h
blob69206f70e506c6fd1ef012b7fafc66123e8fa350
1 /*
2 Copyright © 1995-2016, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Macros to make calling ARexx library querying functions portable
6 Lang: English
7 */
9 #ifndef AROS_REXXCALL_M68K_H
10 #define AROS_REXXCALL_M68K_H
12 /* Some macros to make ARexx portable to non-m68k platforms */
13 #define RexxCallQueryLibFunc(rexxmsg, libbase, offset, retargstringptr) \
14 ({ \
15 int _offset=abs(offset)/6; \
16 AROS_LVO_CALL2(ULONG, \
17 AROS_LCA(struct RexxMsg *, rexxmsg, A0), \
18 AROS_LCA(STRPTR *, retargstringptr, A1), \
19 struct Library *, libbase, _offset, rexxcall); \
22 /* ARexx Query Functions return their arguments in BOTH
23 * A0 and D0.
25 #define AROS_AREXXLIBQUERYFUNC(f,m,lt,l,o,p) \
26 AROS_UFP3(ULONG, p##_##f##_wrapper, \
27 AROS_UFPA(struct RexxMsg *, m, A0), \
28 AROS_UFPA(STRPTR *, _retargstringptr, A1), \
29 AROS_UFHA(lt, l, A6)); \
30 asm ( ".text\n" \
31 ".global " #p "_" #o "_" #f "\n" \
32 #p "_" #o "_" #f ":\n" \
33 "jsr " #p "_" #f "_wrapper \n" \
34 "move.l %d0,%a0 \n" \
35 "rts\n" ); \
36 AROS_UFH3(ULONG, p##_##f##_wrapper, \
37 AROS_UFHA(struct RexxMsg *, m, A0), \
38 AROS_UFHA(STRPTR *, _retargstringptr, A1), \
39 AROS_UFHA(lt, l, A6)) { AROS_USERFUNC_INIT
40 #define AROS_AREXXLIBQUERYFUNC_END \
41 AROS_USERFUNC_EXIT }
43 #define ReturnRexxQuery(rc,arg) \
44 *_retargstringptr = arg; \
45 return rc;
47 #endif