|
30 | 30 | * SUCH DAMAGE.
|
31 | 31 | *
|
32 | 32 | * from: @(#)DEFS.h 5.1 (Berkeley) 4/23/90
|
33 |
| - * $FreeBSD: src/sys/amd64/include/asm.h,v 1.18 2007/08/22 04:26:07 jkoshy Exp $ |
| 33 | + * $FreeBSD$ |
34 | 34 | */
|
35 | 35 |
|
36 | 36 | #ifndef _MACHINE_ASM_H_
|
37 | 37 | #define _MACHINE_ASM_H_
|
38 | 38 |
|
| 39 | + |
39 | 40 | #ifdef __APPLE__
|
40 | 41 | #include "../i387/osx_asm.h"
|
41 | 42 | #define CNAME(x) EXT(x)
|
| 43 | + |
42 | 44 | #else
|
43 | 45 | #include "bsd_cdefs.h"
|
44 | 46 |
|
|
47 | 49 | #define PIC_GOT(x) x@GOTPCREL(%rip)
|
48 | 50 | #else
|
49 | 51 | #define PIC_PLT(x) x
|
50 |
| -#define PIC_GOT(x) x |
51 | 52 | #endif
|
52 | 53 |
|
53 | 54 | /*
|
|
60 | 61 | #define CNAME(csym) csym
|
61 | 62 | #define HIDENAME(asmsym) .asmsym
|
62 | 63 |
|
63 |
| -#define _START_ENTRY .p2align 4,0x90 |
| 64 | +#define _START_ENTRY .text; .p2align 4,0x90 |
64 | 65 |
|
65 |
| -#if defined(__ELF__) |
66 |
| -#define _ENTRY(x) .text; _START_ENTRY; \ |
| 66 | +#define _ENTRY(x) _START_ENTRY; \ |
67 | 67 | .globl CNAME(x); .type CNAME(x),@function; CNAME(x):
|
68 |
| -#define END(x) .size x, . - x |
69 |
| - |
70 |
| -#elif defined(_WIN32) |
71 |
| -#ifndef _MSC_VER |
72 |
| -#define END(x) .end |
73 |
| -#define _START_ENTRY_WIN .text; _START_ENTRY |
74 |
| -#else |
75 |
| -#define END(x) end |
76 |
| -#define _START_ENTRY_WIN .code; _START_ENTRY |
77 |
| -#endif |
78 |
| -#define _ENTRY(x) _START_ENTRY_WIN; \ |
79 |
| - .globl CNAME(x); .section .drectve; .ascii " -export:" #x; \ |
80 |
| - .section .text; .def CNAME(x); .scl 2; .type 32; .endef; CNAME(x): |
81 |
| -#endif |
82 | 68 |
|
83 | 69 | #ifdef PROF
|
84 | 70 | #define ALTENTRY(x) _ENTRY(x); \
|
|
96 | 82 | #define ENTRY(x) _ENTRY(x)
|
97 | 83 | #endif
|
98 | 84 |
|
| 85 | +#define END(x) .size x, . - x |
| 86 | + |
| 87 | +#endif /* __APPLE */ |
| 88 | + |
| 89 | +/* |
| 90 | + * WEAK_REFERENCE(): create a weak reference alias from sym. |
| 91 | + * The macro is not a general asm macro that takes arbitrary names, |
| 92 | + * but one that takes only C names. It does the non-null name |
| 93 | + * translation inside the macro. |
| 94 | + */ |
| 95 | +#define WEAK_REFERENCE(sym, alias) \ |
| 96 | + .weak CNAME(alias); \ |
| 97 | + .equ CNAME(alias),CNAME(sym) |
99 | 98 |
|
100 | 99 | #define RCSID(x) .text; .asciz x
|
101 | 100 |
|
|
106 | 105 | #define __FBSDID(s) /* nothing */
|
107 | 106 | #endif /* not lint and not STRIP_FBSDID */
|
108 | 107 |
|
109 |
| -#endif |
110 | 108 | #endif /* !_MACHINE_ASM_H_ */
|
0 commit comments