BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
gadtools.h
Go to the documentation of this file.
1
/* The safe forms of <inline/gadtools.h> for the libraries
2
(cmake/ndk-calls.cmake, libs/include/ndk/functions.list): the NDK's
3
macro, the register variable on a3 replaced by an operand in a register
4
gcc chooses, which "exg" swaps with a3 around the jsr. a3 is back
5
afterwards (the OS keeps d2-d7/a2-a6); 4 bytes per call, no stack, the
6
condition codes untouched (the NDK's own technique for a5). */
7
8
#define __GT_SetGadgetAttrsA_base(__in_base, ___gad, ___win, ___req, ___taglist) ({\
9
struct Gadget * __p____gad = (struct Gadget *)(___gad);\
10
struct Window * __p____win = (struct Window *)(___win);\
11
struct Requester * __p____req = (struct Requester *)(___req);\
12
struct TagItem * __p____taglist = (struct TagItem *)(___taglist);\
13
register void * __p__in_base __asm("a6") = (void *)(__in_base);\
14
register struct Gadget * __v0 __asm("a0") = __p____gad;\
15
register struct Window * __v1 __asm("a1") = __p____win;\
16
register struct Requester * __v2 __asm("a2") = __p____req;\
17
__asm volatile (\
18
"exg %2,%/a3\n\tjsr %/a6@(-42:W)\n\texg %2,%/a3\n"\
19
: "+a"(__v0), "+a"(__v1), "+r"(__p____taglist)\
20
: "a"(__p__in_base), "a"(__v2)\
21
: "fp0", "fp1", "cc", "memory", "d0", "d1" );\
22
})
23
24
#define __GT_GetGadgetAttrsA_base(__in_base, ___gad, ___win, ___req, ___taglist) ({\
25
struct Gadget * __p____gad = (struct Gadget *)(___gad);\
26
struct Window * __p____win = (struct Window *)(___win);\
27
struct Requester * __p____req = (struct Requester *)(___req);\
28
struct TagItem * __p____taglist = (struct TagItem *)(___taglist);\
29
register void * __p__in_base __asm("a6") = (void *)(__in_base);\
30
register LONG __v_ret __asm("d0");\
31
register struct Gadget * __v0 __asm("a0") = __p____gad;\
32
register struct Window * __v1 __asm("a1") = __p____win;\
33
register struct Requester * __v2 __asm("a2") = __p____req;\
34
__asm volatile (\
35
"exg %3,%/a3\n\tjsr %/a6@(-174:W)\n\texg %3,%/a3\n"\
36
: "=d"(__v_ret), "+a"(__v0), "+a"(__v1), "+r"(__p____taglist)\
37
: "a"(__p__in_base), "a"(__v2)\
38
: "fp0", "fp1", "cc", "memory", "d1" );\
39
__v_ret;})
libs
include
ndk
safe
gadtools.h
Generated by
1.16.1