Mercurial > pub > dyncall > dyncall
annotate dyncallback/dyncall_callback_arch.S @ 465:e2899b4ff713
- // -> /* */, mainly for consistency (but also for a few obscure compilers)
author | Tassilo Philipp |
---|---|
date | Wed, 02 Feb 2022 12:55:23 +0100 |
parents | d55f9d508074 |
children | 0c8838766866 |
rev | line source |
---|---|
0 | 1 /* |
2 | |
3 Package: dyncall | |
4 Library: dyncallback | |
5 File: dyncallback/dyncall_callback_arch.S | |
6 Description: Callback Thunk - Implementation Back-end selector | |
7 License: | |
8 | |
281 | 9 Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>, |
0 | 10 Tassilo Philipp <tphilipp@potion-studios.com> |
11 | |
12 Permission to use, copy, modify, and distribute this software for any | |
13 purpose with or without fee is hereby granted, provided that the above | |
14 copyright notice and this permission notice appear in all copies. | |
15 | |
16 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
17 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
18 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
19 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
20 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
21 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
23 | |
24 */ | |
25 | |
26 | |
27 | |
28 #include "../dyncall/dyncall_macros.h" | |
29 | |
30 #if defined(DC__C_MSVC) | |
31 # if defined(DC__OS_Win32) | |
32 # include "dyncall_callback_x86_masm.asm" | |
33 # elif defined(DC__OS_Win64) | |
34 # include "dyncall_callback_x64_masm.asm" | |
35 # endif | |
36 #elif defined(DC__OS_Plan9) | |
37 # if defined(DC__Arch_Intel_x86) | |
38 # include "dyncall_callback_x86_8a.s" | |
39 # else | |
40 # error Unsupported Architecture on Plan9. | |
41 # endif | |
42 #elif defined(DC__OS_Darwin) | |
43 # if defined(DC__Arch_PPC32) | |
44 # include "dyncall_callback_ppc32_apple.s" | |
45 # elif defined(DC__Arch_ARM_ARM) | |
46 # include "dyncall_callback_arm32_arm_apple.s" | |
47 # elif defined(DC__Arch_ARM_THUMB) | |
15
03c516772c65
- consistency in filenames that have cpp logic .s -> .S
cslag
parents:
0
diff
changeset
|
48 # include "dyncall_callback_arm32_thumb_apple.S" |
0 | 49 # elif defined(DC__Arch_AMD64) |
50 # include "dyncall_callback_x64.S" | |
51 # elif defined(DC__Arch_Intel_x86) | |
52 # include "dyncall_callback_x86.S" | |
53 # elif defined(DC__Arch_ARM64) | |
15
03c516772c65
- consistency in filenames that have cpp logic .s -> .S
cslag
parents:
0
diff
changeset
|
54 # include "dyncall_callback_arm64.S" |
465
e2899b4ff713
- // -> /* */, mainly for consistency (but also for a few obscure compilers)
Tassilo Philipp
parents:
302
diff
changeset
|
55 # else /* e.g. PowerPC G5, which is PPC64, etc. */ |
0 | 56 # error Unsupported Architecture on Darwin/OS X. |
57 # endif | |
58 #else | |
59 # if defined(DC__Arch_Intel_x86) | |
60 # include "dyncall_callback_x86.S" | |
61 # elif defined(DC__Arch_AMD64) | |
62 # include "dyncall_callback_x64.S" | |
63 # elif defined(DC__Arch_PPC32) | |
64 # include "dyncall_callback_ppc32.S" | |
65 # elif defined(DC__Arch_PPC64) | |
66 # include "dyncall_callback_ppc64.S" | |
94 | 67 # elif defined(DC__Arch_MIPS) || defined(DC__Arch_MIPS64) |
302
d55f9d508074
- mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents:
281
diff
changeset
|
68 # if defined(DC__ABI_MIPS_O32) |
d55f9d508074
- mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents:
281
diff
changeset
|
69 # include "dyncall_callback_mips_o32.S" |
d55f9d508074
- mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents:
281
diff
changeset
|
70 # elif defined(DC__ABI_MIPS_N64) |
d55f9d508074
- mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents:
281
diff
changeset
|
71 # include "dyncall_callback_mips_n64.S" |
d55f9d508074
- mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents:
281
diff
changeset
|
72 # elif defined(DC__ABI_MIPS_N32) |
d55f9d508074
- mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents:
281
diff
changeset
|
73 # include "dyncall_callback_mips_n32.S" |
d55f9d508074
- mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents:
281
diff
changeset
|
74 # elif defined(DC__ABI_MIPS_EABI) |
d55f9d508074
- mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents:
281
diff
changeset
|
75 # include "dyncall_callback_mips_eabi_gas.s" |
d55f9d508074
- mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents:
281
diff
changeset
|
76 # else |
d55f9d508074
- mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents:
281
diff
changeset
|
77 # error Unknown MIPS ABI. |
d55f9d508074
- mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents:
281
diff
changeset
|
78 # endif |
0 | 79 # elif defined(DC__Arch_ARM_ARM) |
38 | 80 # include "dyncall_callback_arm32_arm_gas.S" |
0 | 81 # elif defined(DC__Arch_ARM_THUMB) |
15
03c516772c65
- consistency in filenames that have cpp logic .s -> .S
cslag
parents:
0
diff
changeset
|
82 # include "dyncall_callback_arm32_thumb_gas.S" |
0 | 83 # elif defined(DC__Arch_Sparc) |
84 # include "dyncall_callback_sparc32.s" | |
179 | 85 # elif defined(DC__Arch_Sparc64) |
0 | 86 # include "dyncall_callback_sparc64.s" |
87 # elif defined(DC__Arch_ARM64) | |
15
03c516772c65
- consistency in filenames that have cpp logic .s -> .S
cslag
parents:
0
diff
changeset
|
88 # include "dyncall_callback_arm64.S" |
0 | 89 # endif |
90 #endif | |
91 | |
268
03f0b683918a
- reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents:
179
diff
changeset
|
92 |
03f0b683918a
- reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents:
179
diff
changeset
|
93 /* Use .note.GNU-stack to explicitly indicate a non-exec stack, b/c of bad */ |
03f0b683918a
- reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents:
179
diff
changeset
|
94 /* default behaviour when translating handwritten assembly files (needed on */ |
269 | 95 /* GNU platforms, Android and FreeBSD, as tests have shown). */ |
268
03f0b683918a
- reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents:
179
diff
changeset
|
96 #if (defined(DC__C_CLANG) || defined(DC__C_GNU)) && defined(__ELF__) && (defined(DC__OS_Linux) || defined(DC__OS_FreeBSD)) |
03f0b683918a
- reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents:
179
diff
changeset
|
97 .section .note.GNU-stack,"",%progbits |
03f0b683918a
- reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents:
179
diff
changeset
|
98 #endif |
03f0b683918a
- reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents:
179
diff
changeset
|
99 |