aboutsummaryrefslogtreecommitdiffstats
path: root/sys/i386/include/asmacros.h
diff options
context:
space:
mode:
authorsvn2git <svn2git@FreeBSD.org>1994-05-01 00:00:00 -0800
committersvn2git <svn2git@FreeBSD.org>1994-05-01 00:00:00 -0800
commita16f65c7d117419bd266c28a1901ef129a337569 (patch)
tree2626602f66dc3551e7a7c7bc9ad763c3bc7ab40a /sys/i386/include/asmacros.h
parent8503f4f13f77abf7adc8f7e329c6f9c1d52b6a20 (diff)
downloadsrc-a16f65c7d117419bd266c28a1901ef129a337569.tar.gz
src-a16f65c7d117419bd266c28a1901ef129a337569.zip
Release FreeBSD 1.1release/1.1.0_cvs
This commit was manufactured to restore the state of the 1.1-RELEASE image. Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
Diffstat (limited to 'sys/i386/include/asmacros.h')
-rw-r--r--sys/i386/include/asmacros.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/sys/i386/include/asmacros.h b/sys/i386/include/asmacros.h
new file mode 100644
index 000000000000..f0f2c014178c
--- /dev/null
+++ b/sys/i386/include/asmacros.h
@@ -0,0 +1,43 @@
+#define ALIGN_DATA .align 2 /* 4 byte alignment, zero filled */
+#define ALIGN_TEXT .align 2,0x90 /* 4-byte alignment, nop filled */
+#define SUPERALIGN_TEXT .align 4,0x90 /* 16-byte alignment (better for 486), nop filled */
+
+#define GEN_ENTRY(name) ALIGN_TEXT; .globl name; name:
+#define NON_GPROF_ENTRY(name) GEN_ENTRY(_/**/name)
+
+#ifdef GPROF
+/*
+ * ALTENTRY() must be before a corresponding ENTRY() so that it can jump
+ * over the mcounting.
+ */
+#define ALTENTRY(name) GEN_ENTRY(_/**/name); MCOUNT; jmp 2f
+#define ENTRY(name) GEN_ENTRY(_/**/name); MCOUNT; 2:
+/*
+ * The call to mcount supports the usual (bad) conventions. We allocate
+ * some data and pass a pointer to it although the FreeBSD doesn't use
+ * the data. We set up a frame before calling mcount because that is
+ * the standard convention although it makes work for both mcount and
+ * callers.
+ */
+#define MCOUNT .data; ALIGN_DATA; 1:; .long 0; .text; \
+ pushl %ebp; movl %esp,%ebp; \
+ movl $1b,%eax; call mcount; popl %ebp
+#else
+/*
+ * ALTENTRY() has to align because it is before a corresponding ENTRY().
+ * ENTRY() has to align to because there may be no ALTENTRY() before it.
+ * If there is a previous ALTENTRY() then the alignment code is empty.
+ */
+#define ALTENTRY(name) GEN_ENTRY(_/**/name)
+#define ENTRY(name) GEN_ENTRY(_/**/name)
+
+#endif
+
+#ifdef DUMMY_NOPS /* this will break some older machines */
+#define FASTER_NOP
+#define NOP
+#else
+#define FASTER_NOP pushl %eax ; inb $0x84,%al ; popl %eax
+#define NOP pushl %eax ; inb $0x84,%al ; inb $0x84,%al ; popl %eax
+#endif
+