Artifact
21e13ce963e40b29d9c35ad3bc10a65e29339b2b:
0000: 2f 2f 20 41 73 73 65 6d 62 6c 79 20 6c 61 6e 67 // Assembly lang
0010: 75 61 67 65 20 73 75 70 70 6f 72 74 20 66 6f 72 uage support for
0020: 20 73 70 61 72 63 20 43 50 55 2e 0a 2f 2f 20 42 sparc CPU..// B
0030: 72 75 6e 6f 20 48 61 69 62 6c 65 20 32 39 2e 35 runo Haible 29.5
0040: 2e 31 39 39 39 0a 0a 23 69 66 64 65 66 20 41 53 .1999..#ifdef AS
0050: 4d 5f 55 4e 44 45 52 53 43 4f 52 45 0a 2f 2f 20 M_UNDERSCORE.//
0060: 53 75 6e 4f 53 34 2c 20 4c 69 6e 75 78 2f 61 2e SunOS4, Linux/a.
0070: 6f 75 74 0a 23 69 66 64 65 66 20 5f 5f 53 54 44 out.#ifdef __STD
0080: 43 5f 5f 0a 23 64 65 66 69 6e 65 20 43 28 65 6e C__.#define C(en
0090: 74 72 79 70 6f 69 6e 74 29 20 5f 23 23 65 6e 74 trypoint) _##ent
00a0: 72 79 70 6f 69 6e 74 0a 23 65 6c 73 65 0a 23 64 rypoint.#else.#d
00b0: 65 66 69 6e 65 20 43 28 65 6e 74 72 79 70 6f 69 efine C(entrypoi
00c0: 6e 74 29 20 5f 2f 2a 2a 2f 65 6e 74 72 79 70 6f nt) _/**/entrypo
00d0: 69 6e 74 0a 23 65 6e 64 69 66 0a 23 65 6c 73 65 int.#endif.#else
00e0: 0a 2f 2f 20 53 6f 6c 61 72 69 73 2c 20 4c 69 6e .// Solaris, Lin
00f0: 75 78 2f 45 4c 46 0a 23 64 65 66 69 6e 65 20 43 ux/ELF.#define C
0100: 28 65 6e 74 72 79 70 6f 69 6e 74 29 20 65 6e 74 (entrypoint) ent
0110: 72 79 70 6f 69 6e 74 0a 23 65 6e 64 69 66 0a 0a rypoint.#endif..
0120: 2f 2f 20 57 68 65 6e 20 61 73 73 65 6d 62 6c 79 // When assembly
0130: 20 6c 61 6e 67 75 61 67 65 20 63 6f 64 65 20 69 language code i
0140: 73 20 63 6f 6d 70 69 6c 65 64 20 69 6e 74 6f 20 s compiled into
0150: 61 20 73 68 61 72 65 64 20 6c 69 62 72 61 72 79 a shared library
0160: 2c 20 45 4c 46 20 6c 69 6e 6b 65 72 73 0a 2f 2f , ELF linkers.//
0170: 20 6e 65 65 64 20 74 6f 20 6b 6e 6f 77 20 77 68 need to know wh
0180: 69 63 68 20 73 79 6d 62 6f 6c 73 20 61 72 65 20 ich symbols are
0190: 66 75 6e 63 74 69 6f 6e 73 2e 0a 23 69 66 20 64 functions..#if d
01a0: 65 66 69 6e 65 64 28 5f 5f 4e 65 74 42 53 44 5f efined(__NetBSD_
01b0: 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f _) || defined(__
01c0: 4f 70 65 6e 42 53 44 5f 5f 29 0a 23 64 65 66 69 OpenBSD__).#defi
01d0: 6e 65 20 44 45 43 4c 41 52 45 5f 46 55 4e 43 54 ne DECLARE_FUNCT
01e0: 49 4f 4e 28 6e 61 6d 65 29 20 2e 74 79 70 65 20 ION(name) .type
01f0: 43 28 6e 61 6d 65 29 2c 40 66 75 6e 63 74 69 6f C(name),@functio
0200: 6e 0a 23 65 6c 69 66 20 64 65 66 69 6e 65 64 28 n.#elif defined(
0210: 5f 5f 73 76 72 34 5f 5f 29 20 7c 7c 20 64 65 66 __svr4__) || def
0220: 69 6e 65 64 28 5f 5f 45 4c 46 5f 5f 29 0a 2f 2f ined(__ELF__).//
0230: 20 53 6f 6c 61 72 69 73 2c 20 4c 69 6e 75 78 2f Solaris, Linux/
0240: 45 4c 46 0a 2f 2f 20 53 6f 6d 65 20 70 72 65 70 ELF.// Some prep
0250: 72 6f 63 65 73 73 6f 72 73 20 6b 65 65 70 20 74 rocessors keep t
0260: 68 65 20 62 61 63 6b 73 6c 61 73 68 20 69 6e 20 he backslash in
0270: 70 6c 61 63 65 2c 20 73 6f 6d 65 20 64 6f 6e 27 place, some don'
0280: 74 2e 0a 2f 2f 20 53 6f 6d 65 20 63 6f 6d 70 6c t..// Some compl
0290: 61 69 6e 20 61 62 6f 75 74 20 74 68 65 20 23 20 ain about the #
02a0: 62 65 69 6e 67 20 6e 6f 74 20 69 6e 20 66 72 6f being not in fro
02b0: 6e 74 20 6f 66 20 61 6e 20 41 4e 53 49 20 43 20 nt of an ANSI C
02c0: 6d 61 63 72 6f 2e 0a 2f 2f 20 54 68 65 72 65 66 macro..// Theref
02d0: 6f 72 65 20 77 65 20 75 73 65 20 61 20 64 6f 6c ore we use a dol
02e0: 6c 61 72 2c 20 77 68 69 63 68 20 77 69 6c 6c 20 lar, which will
02f0: 62 65 20 73 65 64 2d 63 6f 6e 76 65 72 74 65 64 be sed-converted
0300: 20 74 6f 20 23 20 6c 61 74 65 72 2e 0a 23 64 65 to # later..#de
0310: 66 69 6e 65 20 44 45 43 4c 41 52 45 5f 46 55 4e fine DECLARE_FUN
0320: 43 54 49 4f 4e 28 6e 61 6d 65 29 20 2e 74 79 70 CTION(name) .typ
0330: 65 20 43 28 6e 61 6d 65 29 2c 24 66 75 6e 63 74 e C(name),$funct
0340: 69 6f 6e 0a 23 65 6c 73 65 0a 2f 2f 20 53 75 6e ion.#else.// Sun
0350: 4f 53 34 2c 20 4c 69 6e 75 78 2f 61 2e 6f 75 74 OS4, Linux/a.out
0360: 0a 23 64 65 66 69 6e 65 20 44 45 43 4c 41 52 45 .#define DECLARE
0370: 5f 46 55 4e 43 54 49 4f 4e 28 6e 61 6d 65 29 0a _FUNCTION(name).
0380: 23 65 6e 64 69 66 0a #endif.