ia64/xen-unstable

annotate 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
rev   line source
awilliam@10672 1 #ifndef _ASM_IA64_ASMMACRO_H
awilliam@10672 2 #define _ASM_IA64_ASMMACRO_H
awilliam@10672 3
awilliam@10672 4 /*
awilliam@10672 5 * Copyright (C) 2000-2001, 2003-2004 Hewlett-Packard Co
awilliam@10672 6 * David Mosberger-Tang <davidm@hpl.hp.com>
awilliam@10672 7 */
awilliam@10672 8
awilliam@10672 9 #include <linux/config.h>
awilliam@10672 10
awilliam@10672 11 #define ENTRY(name) \
awilliam@10672 12 .align 32; \
awilliam@10672 13 .proc name; \
awilliam@10672 14 name:
awilliam@10672 15
awilliam@10672 16 #define ENTRY_MIN_ALIGN(name) \
awilliam@10672 17 .align 16; \
awilliam@10672 18 .proc name; \
awilliam@10672 19 name:
awilliam@10672 20
awilliam@10672 21 #define GLOBAL_ENTRY(name) \
awilliam@10672 22 .global name; \
awilliam@10672 23 ENTRY(name)
awilliam@10672 24
awilliam@10672 25 #define END(name) \
awilliam@10672 26 .endp name
awilliam@10672 27
awilliam@10672 28 /*
awilliam@10672 29 * Helper macros to make unwind directives more readable:
awilliam@10672 30 */
awilliam@10672 31
awilliam@10672 32 /* prologue_gr: */
awilliam@10672 33 #define ASM_UNW_PRLG_RP 0x8
awilliam@10672 34 #define ASM_UNW_PRLG_PFS 0x4
awilliam@10672 35 #define ASM_UNW_PRLG_PSP 0x2
awilliam@10672 36 #define ASM_UNW_PRLG_PR 0x1
awilliam@10672 37 #define ASM_UNW_PRLG_GRSAVE(ninputs) (32+(ninputs))
awilliam@10672 38
awilliam@10672 39 /*
awilliam@10672 40 * Helper macros for accessing user memory.
awilliam@10672 41 */
awilliam@10672 42
awilliam@10672 43 .section "__ex_table", "a" // declare section & section attributes
awilliam@10672 44 .previous
awilliam@10672 45
awilliam@10672 46 # define EX(y,x...) \
awilliam@10672 47 .xdata4 "__ex_table", 99f-., y-.; \
awilliam@10672 48 [99:] x
awilliam@10672 49 # define EXCLR(y,x...) \
awilliam@10672 50 .xdata4 "__ex_table", 99f-., y-.+4; \
awilliam@10672 51 [99:] x
awilliam@10672 52
awilliam@10672 53 /*
awilliam@10672 54 * Mark instructions that need a load of a virtual address patched to be
awilliam@10672 55 * a load of a physical address. We use this either in critical performance
awilliam@10672 56 * path (ivt.S - TLB miss processing) or in places where it might not be
awilliam@10672 57 * safe to use a "tpa" instruction (mca_asm.S - error recovery).
awilliam@10672 58 */
awilliam@10672 59 .section ".data.patch.vtop", "a" // declare section & section attributes
awilliam@10672 60 .previous
awilliam@10672 61
awilliam@10672 62 #define LOAD_PHYSICAL(pr, reg, obj) \
awilliam@10672 63 [1:](pr)movl reg = obj; \
awilliam@10672 64 .xdata4 ".data.patch.vtop", 1b-.
awilliam@10672 65
awilliam@10672 66 /*
awilliam@10672 67 * For now, we always put in the McKinley E9 workaround. On CPUs that don't need it,
awilliam@10672 68 * we'll patch out the work-around bundles with NOPs, so their impact is minimal.
awilliam@10672 69 */
awilliam@10672 70 #define DO_MCKINLEY_E9_WORKAROUND
awilliam@10672 71
awilliam@10672 72 #ifdef DO_MCKINLEY_E9_WORKAROUND
awilliam@10672 73 .section ".data.patch.mckinley_e9", "a"
awilliam@10672 74 .previous
awilliam@10672 75 /* workaround for Itanium 2 Errata 9: */
awilliam@10672 76 # define FSYS_RETURN \
awilliam@10672 77 .xdata4 ".data.patch.mckinley_e9", 1f-.; \
awilliam@10672 78 1:{ .mib; \
awilliam@10672 79 nop.m 0; \
awilliam@10672 80 mov r16=ar.pfs; \
awilliam@10672 81 br.call.sptk.many b7=2f;; \
awilliam@10672 82 }; \
awilliam@10672 83 2:{ .mib; \
awilliam@10672 84 nop.m 0; \
awilliam@10672 85 mov ar.pfs=r16; \
awilliam@10672 86 br.ret.sptk.many b6;; \
awilliam@10672 87 }
awilliam@10672 88 #else
awilliam@10672 89 # define FSYS_RETURN br.ret.sptk.many b6
awilliam@10672 90 #endif
awilliam@10672 91
awilliam@10672 92 /*
awilliam@10672 93 * Up until early 2004, use of .align within a function caused bad unwind info.
awilliam@10672 94 * TEXT_ALIGN(n) expands into ".align n" if a fixed GAS is available or into nothing
awilliam@10672 95 * otherwise.
awilliam@10672 96 */
awilliam@10672 97 #ifdef HAVE_WORKING_TEXT_ALIGN
awilliam@10672 98 # define TEXT_ALIGN(n) .align n
awilliam@10672 99 #else
awilliam@10672 100 # define TEXT_ALIGN(n)
awilliam@10672 101 #endif
awilliam@10672 102
awilliam@10672 103 #ifdef HAVE_SERIALIZE_DIRECTIVE
awilliam@10672 104 # define dv_serialize_data .serialize.data
awilliam@10672 105 # define dv_serialize_instruction .serialize.instruction
awilliam@10672 106 #else
awilliam@10672 107 # define dv_serialize_data
awilliam@10672 108 # define dv_serialize_instruction
awilliam@10672 109 #endif
awilliam@10672 110
awilliam@10672 111 #endif /* _ASM_IA64_ASMMACRO_H */