summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/asmacros.h
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1997-04-22 06:55:47 +0000
committerjdp <jdp@FreeBSD.org>1997-04-22 06:55:47 +0000
commitae3a563c6ee04fa1b4d008183af8eb1e1f23f05e (patch)
tree4bf568e3ad4a7debc59e03b325c4fd155f8e7f1e /sys/i386/include/asmacros.h
parent23b3d8266325c10c3d66be6ba93ad96a46c2f2bd (diff)
downloadFreeBSD-src-ae3a563c6ee04fa1b4d008183af8eb1e1f23f05e.zip
FreeBSD-src-ae3a563c6ee04fa1b4d008183af8eb1e1f23f05e.tar.gz
Make the necessary changes so that an ELF kernel can be built. I
have successfully built, booted, and run a number of different ELF kernel configurations, including GENERIC. LINT also builds and links cleanly, though I have not tried to boot it. The impact on developers is virtually nil, except for two things. All linker sets that might possibly be present in the kernel must be listed in "sys/i386/i386/setdefs.h". And all C symbols that are also referenced from assembly language code must be listed in "sys/i386/include/asnames.h". It so happens that failure to do these things will have no impact on the a.out kernel. But it will break the build of the ELF kernel. The ELF bootloader works, but it is not ready to commit quite yet.
Diffstat (limited to 'sys/i386/include/asmacros.h')
-rw-r--r--sys/i386/include/asmacros.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/sys/i386/include/asmacros.h b/sys/i386/include/asmacros.h
index 9b3559b..097e8dc 100644
--- a/sys/i386/include/asmacros.h
+++ b/sys/i386/include/asmacros.h
@@ -30,26 +30,42 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: asmacros.h,v 1.14 1997/02/22 09:33:56 peter Exp $
+ * $Id: asmacros.h,v 1.15 1997/03/09 13:57:33 bde Exp $
*/
#ifndef _MACHINE_ASMACROS_H_
#define _MACHINE_ASMACROS_H_
#include <sys/cdefs.h>
+#include <machine/asnames.h>
/* XXX too much duplication in various asm*.h's. */
-#define ALIGN_DATA .align 2 /* 4 byte alignment, zero filled */
+/*
+ * CNAME and HIDENAME manage the relationship between symbol names in C
+ * and the equivalent assembly language names. CNAME is given a name as
+ * it would be used in a C program. It expands to the equivalent assembly
+ * language name. HIDENAME is given an assembly-language name, and expands
+ * to a possibly-modified form that will be invisible to C programs.
+ */
+#if defined(__ELF__)
+#define CNAME(csym) csym
+#define HIDENAME(asmsym) __CONCAT(.,asmsym)
+#else
+#define CNAME(csym) __CONCAT(_,csym)
+#define HIDENAME(asmsym) asmsym
+#endif
+
+#define ALIGN_DATA .p2align 2 /* 4 byte alignment, zero filled */
#ifdef GPROF
-#define ALIGN_TEXT .align 4,0x90 /* 16-byte alignment, nop filled */
+#define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */
#else
-#define ALIGN_TEXT .align 2,0x90 /* 4-byte alignment, nop filled */
+#define ALIGN_TEXT .p2align 2,0x90 /* 4-byte alignment, nop filled */
#endif
-#define SUPERALIGN_TEXT .align 4,0x90 /* 16-byte alignment, nop filled */
+#define SUPERALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */
-#define GEN_ENTRY(name) ALIGN_TEXT; .globl __CONCAT(_,name); \
- __CONCAT(_,name):
+#define GEN_ENTRY(name) ALIGN_TEXT; .globl CNAME(name); \
+ CNAME(name):
#define NON_GPROF_ENTRY(name) GEN_ENTRY(name)
#define NON_GPROF_RET .byte 0xc3 /* opcode for `ret' */
OpenPOWER on IntegriCloud