ia64/xen-unstable

diff xen/include/asm-ia64/linux-xen/asm/asmmacro.h @ 10672:ac110157c19d

[IA64] Move asmmacro.h to linux-xen

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild.aw
date Thu Jul 06 10:02:28 2006 -0600 (2006-07-06)
parents
children 80e04aa530b8
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xen/include/asm-ia64/linux-xen/asm/asmmacro.h	Thu Jul 06 10:02:28 2006 -0600
     1.3 @@ -0,0 +1,111 @@
     1.4 +#ifndef _ASM_IA64_ASMMACRO_H
     1.5 +#define _ASM_IA64_ASMMACRO_H
     1.6 +
     1.7 +/*
     1.8 + * Copyright (C) 2000-2001, 2003-2004 Hewlett-Packard Co
     1.9 + *	David Mosberger-Tang <davidm@hpl.hp.com>
    1.10 + */
    1.11 +
    1.12 +#include <linux/config.h>
    1.13 +
    1.14 +#define ENTRY(name)				\
    1.15 +	.align 32;				\
    1.16 +	.proc name;				\
    1.17 +name:
    1.18 +
    1.19 +#define ENTRY_MIN_ALIGN(name)			\
    1.20 +	.align 16;				\
    1.21 +	.proc name;				\
    1.22 +name:
    1.23 +
    1.24 +#define GLOBAL_ENTRY(name)			\
    1.25 +	.global name;				\
    1.26 +	ENTRY(name)
    1.27 +
    1.28 +#define END(name)				\
    1.29 +	.endp name
    1.30 +
    1.31 +/*
    1.32 + * Helper macros to make unwind directives more readable:
    1.33 + */
    1.34 +
    1.35 +/* prologue_gr: */
    1.36 +#define ASM_UNW_PRLG_RP			0x8
    1.37 +#define ASM_UNW_PRLG_PFS		0x4
    1.38 +#define ASM_UNW_PRLG_PSP		0x2
    1.39 +#define ASM_UNW_PRLG_PR			0x1
    1.40 +#define ASM_UNW_PRLG_GRSAVE(ninputs)	(32+(ninputs))
    1.41 +
    1.42 +/*
    1.43 + * Helper macros for accessing user memory.
    1.44 + */
    1.45 +
    1.46 +	.section "__ex_table", "a"		// declare section & section attributes
    1.47 +	.previous
    1.48 +
    1.49 +# define EX(y,x...)				\
    1.50 +	.xdata4 "__ex_table", 99f-., y-.;	\
    1.51 +  [99:]	x
    1.52 +# define EXCLR(y,x...)				\
    1.53 +	.xdata4 "__ex_table", 99f-., y-.+4;	\
    1.54 +  [99:]	x
    1.55 +
    1.56 +/*
    1.57 + * Mark instructions that need a load of a virtual address patched to be
    1.58 + * a load of a physical address.  We use this either in critical performance
    1.59 + * path (ivt.S - TLB miss processing) or in places where it might not be
    1.60 + * safe to use a "tpa" instruction (mca_asm.S - error recovery).
    1.61 + */
    1.62 +	.section ".data.patch.vtop", "a"	// declare section & section attributes
    1.63 +	.previous
    1.64 +
    1.65 +#define	LOAD_PHYSICAL(pr, reg, obj)		\
    1.66 +[1:](pr)movl reg = obj;				\
    1.67 +	.xdata4 ".data.patch.vtop", 1b-.
    1.68 +
    1.69 +/*
    1.70 + * For now, we always put in the McKinley E9 workaround.  On CPUs that don't need it,
    1.71 + * we'll patch out the work-around bundles with NOPs, so their impact is minimal.
    1.72 + */
    1.73 +#define DO_MCKINLEY_E9_WORKAROUND
    1.74 +
    1.75 +#ifdef DO_MCKINLEY_E9_WORKAROUND
    1.76 +	.section ".data.patch.mckinley_e9", "a"
    1.77 +	.previous
    1.78 +/* workaround for Itanium 2 Errata 9: */
    1.79 +# define FSYS_RETURN					\
    1.80 +	.xdata4 ".data.patch.mckinley_e9", 1f-.;	\
    1.81 +1:{ .mib;						\
    1.82 +	nop.m 0;					\
    1.83 +	mov r16=ar.pfs;					\
    1.84 +	br.call.sptk.many b7=2f;;			\
    1.85 +  };							\
    1.86 +2:{ .mib;						\
    1.87 +	nop.m 0;					\
    1.88 +	mov ar.pfs=r16;					\
    1.89 +	br.ret.sptk.many b6;;				\
    1.90 +  }
    1.91 +#else
    1.92 +# define FSYS_RETURN	br.ret.sptk.many b6
    1.93 +#endif
    1.94 +
    1.95 +/*
    1.96 + * Up until early 2004, use of .align within a function caused bad unwind info.
    1.97 + * TEXT_ALIGN(n) expands into ".align n" if a fixed GAS is available or into nothing
    1.98 + * otherwise.
    1.99 + */
   1.100 +#ifdef HAVE_WORKING_TEXT_ALIGN
   1.101 +# define TEXT_ALIGN(n)	.align n
   1.102 +#else
   1.103 +# define TEXT_ALIGN(n)
   1.104 +#endif
   1.105 +
   1.106 +#ifdef HAVE_SERIALIZE_DIRECTIVE
   1.107 +# define dv_serialize_data		.serialize.data
   1.108 +# define dv_serialize_instruction	.serialize.instruction
   1.109 +#else
   1.110 +# define dv_serialize_data
   1.111 +# define dv_serialize_instruction
   1.112 +#endif
   1.113 +
   1.114 +#endif /* _ASM_IA64_ASMMACRO_H */