]>
Commit | Line | Data |
---|---|---|
55e303ae A |
1 | #define BSWAP_32(x) \ |
2 | ((x & 0x000000ff) << 24) | \ | |
3 | ((x & 0x0000ff00) << 8) | \ | |
4 | ((x & 0x00ff0000) >> 8) | \ | |
5 | ((x & 0xff000000) >> 24) | |
6 | ||
7 | #define COMMPAGE_SIGS_BEGIN \ | |
8 | .const_data ; \ | |
9 | .align 2 ; \ | |
10 | .private_extern _commpage_sigs_begin ; \ | |
11 | _commpage_sigs_begin: | |
12 | ||
13 | #define COMMPAGE_SIGS_DONE \ | |
14 | .private_extern _commpage_sigs_end ; \ | |
15 | _commpage_sigs_end: ; \ | |
16 | ||
17 | #define COMMPAGE_SIG_START(x) \ | |
18 | .private_extern _commpage_sig ## x ; \ | |
19 | _commpage_sig ## x ## : ; \ | |
20 | .long BSWAP_32(0x14400000) ; \ | |
21 | .long BSWAP_32(0x00000001) ; \ | |
22 | .asciz # x ; \ | |
23 | .align 2 ; \ | |
24 | .long BSWAP_32(0x14400000) | |
25 | ||
26 | #define COMMPAGE_SIG_END(x) \ | |
27 | .long BSWAP_32(0x4e800020) ; \ | |
28 | .long BSWAP_32(0x14400000) ; \ | |
29 | .long BSWAP_32(0x00000000) ; \ | |
30 | .asciz # x ; \ | |
31 | .align 2 ; \ | |
32 | .long BSWAP_32(0x14400000) | |
33 | ||
34 | #define ARG(n) \ | |
35 | ((((n * 2) + 6) << 20) + 4) | |
36 | ||
37 | #define COMMPAGE_SIG_ARG(n) \ | |
38 | .long BSWAP_32(0x14400001) ; \ | |
39 | .long BSWAP_32(ARG(n)) ; \ | |
40 | .long BSWAP_32(0x14400001) | |
41 | ||
42 | #define COMMPAGE_SIG_CALL(x, n) \ | |
43 | .long BSWAP_32(0x14400002) ; \ | |
44 | .long BSWAP_32(n) ; \ | |
45 | .long BSWAP_32(0x00000000) ; \ | |
46 | .asciz # x ; \ | |
47 | .align 2 ; \ | |
48 | .long BSWAP_32(0x14400002) | |
49 | ||
50 | #define COMMPAGE_SIG_CALL_VOID(x) \ | |
51 | COMMPAGE_SIG_CALL(x, 0) | |
52 | ||
53 | #define COMMPAGE_SIG_CALL_RET0(x) \ | |
54 | COMMPAGE_SIG_CALL(x, ARG(0)) | |
55 | ||
56 | #define COMMPAGE_SIG_CALL_RET1(x) \ | |
57 | COMMPAGE_SIG_CALL(x, ARG(1)) |