summaryrefslogtreecommitdiffstats
path: root/libc/private/bionic_asm.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-02-19 16:53:20 -0800
committerElliott Hughes <enh@google.com>2014-02-20 13:51:26 -0800
commit851e68a2402fa414544e66650e09dfdaac813e51 (patch)
treebaec353c8e9b6f24e885459b20a8748fc5c39468 /libc/private/bionic_asm.h
parent22c6b7ffd36fe8b34b677eea94d00aef2624e4e8 (diff)
downloadbionic-851e68a2402fa414544e66650e09dfdaac813e51.zip
bionic-851e68a2402fa414544e66650e09dfdaac813e51.tar.gz
bionic-851e68a2402fa414544e66650e09dfdaac813e51.tar.bz2
Unify our assembler macros.
Our <machine/asm.h> files were modified from upstream, to the extent that no architecture was actually using the upstream ENTRY or END macros, assuming that architecture even had such a macro upstream. This patch moves everyone to the same macros, with just a few tweaks remaining in the <machine/asm.h> files, which no one should now use directly. I've removed most of the unused cruft from the <machine/asm.h> files, though there's still rather a lot in the mips/mips64 ones. Bug: 12229603 Change-Id: I2fff287dc571ac1087abe9070362fb9420d85d6d
Diffstat (limited to 'libc/private/bionic_asm.h')
-rw-r--r--libc/private/bionic_asm.h34
1 files changed, 23 insertions, 11 deletions
diff --git a/libc/private/bionic_asm.h b/libc/private/bionic_asm.h
index be22b75..7c2686f 100644
--- a/libc/private/bionic_asm.h
+++ b/libc/private/bionic_asm.h
@@ -29,20 +29,32 @@
#ifndef _PRIVATE_BIONIC_ASM_H_
#define _PRIVATE_BIONIC_ASM_H_
-#include <machine/asm.h>
-
#include <asm/unistd.h> /* For system call numbers. */
#define MAX_ERRNO 4095 /* For recognizing system call error returns. */
-#if __mips__
-/* mips/mips64 don't have ENTRY like the others. */
-#define ENTRY(f) .text; .globl f; .align 4; .type f, @function; .ent f; f: .cfi_startproc
-/* mips/mips64 do have END, but we want a better one, more like the others. */
-#undef END
-#define END(f) .cfi_endproc; .size f, .-f; .end f
-#endif
+#define __bionic_asm_custom_entry(f)
+#define __bionic_asm_custom_end(f)
+#define __bionic_asm_function_type @function
+
+#include <machine/asm.h>
+
+#define ENTRY(f) \
+ .text; \
+ .globl f; \
+ _ALIGN_TEXT; \
+ .type f, __bionic_asm_function_type; \
+ f: \
+ __bionic_asm_custom_entry(f); \
+ .cfi_startproc \
+
+#define END(f) \
+ .cfi_endproc; \
+ .size f, .-f; \
+ __bionic_asm_custom_end(f) \
-/* TODO: add ENTRY_PRIVATE. */
-/* TODO: add ASM_ALIAS macro. */
+/* Like ENTRY, but with hidden visibility. */
+#define ENTRY_PRIVATE(f) \
+ ENTRY(f); \
+ .hidden f \
#endif /* _PRIVATE_BIONIC_ASM_H_ */