asmacros.h revision 757
1#define ALIGN_DATA	.align	2	/* 4 byte alignment, zero filled */
2#define ALIGN_TEXT	.align	2,0x90	/* 4-byte alignment, nop filled */
3#define SUPERALIGN_TEXT	.align	4,0x90	/* 16-byte alignment (better for 486), nop filled */
4
5#define GEN_ENTRY(name)		ALIGN_TEXT;	.globl name; name:
6#define NON_GPROF_ENTRY(name)	GEN_ENTRY(_/**/name)
7
8#ifdef GPROF
9/*
10 * ALTENTRY() must be before a corresponding ENTRY() so that it can jump
11 * over the mcounting.
12 */
13#define ALTENTRY(name)	GEN_ENTRY(_/**/name); MCOUNT; jmp 2f
14#define ENTRY(name)	GEN_ENTRY(_/**/name); MCOUNT; 2:
15/*
16 * The call to mcount supports the usual (bad) conventions.  We allocate
17 * some data and pass a pointer to it although the FreeBSD doesn't use
18 * the data.  We set up a frame before calling mcount because that is
19 * the standard convention although it makes work for both mcount and
20 * callers.
21 */
22#define MCOUNT		.data; ALIGN_DATA; 1:; .long 0; .text; \
23			pushl %ebp; movl %esp,%ebp; \
24			movl $1b,%eax; call mcount; popl %ebp
25#else
26/*
27 * ALTENTRY() has to align because it is before a corresponding ENTRY().
28 * ENTRY() has to align to because there may be no ALTENTRY() before it.
29 * If there is a previous ALTENTRY() then the alignment code is empty.
30 */
31#define ALTENTRY(name)	GEN_ENTRY(_/**/name)
32#define ENTRY(name)	GEN_ENTRY(_/**/name)
33
34#endif
35
36#ifdef DUMMY_NOPS			/* this will break some older machines */
37#define FASTER_NOP
38#define NOP
39#else
40#define FASTER_NOP	pushl %eax ; inb $0x84,%al ; popl %eax
41#define NOP		pushl %eax ; inb $0x84,%al ; inb $0x84,%al ; popl %eax
42#endif
43
44