asmmacro.h 1.38 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1 2 3 4
#ifndef _ASM_IA64_ASMMACRO_H
#define _ASM_IA64_ASMMACRO_H

/*
5
 * Copyright (C) 2000-2001, 2003 Hewlett-Packard Co
David Mosberger's avatar
David Mosberger committed
6
 *	David Mosberger-Tang <davidm@hpl.hp.com>
Linus Torvalds's avatar
Linus Torvalds committed
7 8
 */

9 10
#include <linux/config.h>

Linus Torvalds's avatar
Linus Torvalds committed
11 12 13 14 15
#define ENTRY(name)				\
	.align 32;				\
	.proc name;				\
name:

16 17 18 19 20
#define ENTRY_MIN_ALIGN(name)			\
	.align 16;				\
	.proc name;				\
name:

Linus Torvalds's avatar
Linus Torvalds committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#define GLOBAL_ENTRY(name)			\
	.global name;				\
	ENTRY(name)

#define END(name)				\
	.endp name

/*
 * Helper macros to make unwind directives more readable:
 */

/* prologue_gr: */
#define ASM_UNW_PRLG_RP			0x8
#define ASM_UNW_PRLG_PFS		0x4
#define ASM_UNW_PRLG_PSP		0x2
#define ASM_UNW_PRLG_PR			0x1
#define ASM_UNW_PRLG_GRSAVE(ninputs)	(32+(ninputs))

Linus Torvalds's avatar
Linus Torvalds committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
/*
 * Helper macros for accessing user memory.
 */

	.section "__ex_table", "a"		// declare section & section attributes
	.previous

#if __GNUC__ >= 3
# define EX(y,x...)					\
	.xdata4 "__ex_table", @gprel(99f), @gprel(y);	\
  [99:]	x
# define EXCLR(y,x...)					\
	.xdata4 "__ex_table", @gprel(99f), @gprel(y)+4;	\
  [99:]	x
#else
# define EX(y,x...)					\
	.xdata4 "__ex_table", @gprel(99f), @gprel(y);	\
  99:	x
# define EXCLR(y,x...)					\
	.xdata4 "__ex_table", @gprel(99f), @gprel(y)+4;	\
  99:	x
#endif

62
#ifdef CONFIG_MCKINLEY
63 64
/* workaround for Itanium 2 Errata 9: */
# define MCKINLEY_E9_WORKAROUND			\
65 66 67
	br.call.sptk.many b7=1f;;		\
1:
#else
68
# define MCKINLEY_E9_WORKAROUND
69 70
#endif

Linus Torvalds's avatar
Linus Torvalds committed
71
#endif /* _ASM_IA64_ASMMACRO_H */