ia64/xen-unstable

annotate xen/include/asm-ia64/linux-xen/asm/asmmacro.h @ 10673:80e04aa530b8

[IA64] Fix LOAD_PHYSCAL macro

This fix is workaround. Now LOAD_PHYSCAL is used only
by MCA/INIT handler.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
author awilliam@xenbuild.aw
date Thu Jul 06 10:04:57 2006 -0600 (2006-07-06)
parents ac110157c19d
children 96f167771979
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@10673 62 #ifdef XEN
awilliam@10673 63 #define LOAD_PHYSICAL(pr, reg, obj) \
awilliam@10673 64 [1:](pr)movl reg = obj;; \
awilliam@10673 65 shl reg = reg,4;; \
awilliam@10673 66 shr.u reg = reg,4;; \
awilliam@10673 67 .xdata4 ".data.patch.vtop", 1b-.
awilliam@10673 68 #else
awilliam@10672 69 #define LOAD_PHYSICAL(pr, reg, obj) \
awilliam@10672 70 [1:](pr)movl reg = obj; \
awilliam@10672 71 .xdata4 ".data.patch.vtop", 1b-.
awilliam@10673 72 #endif
awilliam@10672 73
awilliam@10672 74 /*
awilliam@10672 75 * For now, we always put in the McKinley E9 workaround. On CPUs that don't need it,
awilliam@10672 76 * we'll patch out the work-around bundles with NOPs, so their impact is minimal.
awilliam@10672 77 */
awilliam@10672 78 #define DO_MCKINLEY_E9_WORKAROUND
awilliam@10672 79
awilliam@10672 80 #ifdef DO_MCKINLEY_E9_WORKAROUND
awilliam@10672 81 .section ".data.patch.mckinley_e9", "a"
awilliam@10672 82 .previous
awilliam@10672 83 /* workaround for Itanium 2 Errata 9: */
awilliam@10672 84 # define FSYS_RETURN \
awilliam@10672 85 .xdata4 ".data.patch.mckinley_e9", 1f-.; \
awilliam@10672 86 1:{ .mib; \
awilliam@10672 87 nop.m 0; \
awilliam@10672 88 mov r16=ar.pfs; \
awilliam@10672 89 br.call.sptk.many b7=2f;; \
awilliam@10672 90 }; \
awilliam@10672 91 2:{ .mib; \
awilliam@10672 92 nop.m 0; \
awilliam@10672 93 mov ar.pfs=r16; \
awilliam@10672 94 br.ret.sptk.many b6;; \
awilliam@10672 95 }
awilliam@10672 96 #else
awilliam@10672 97 # define FSYS_RETURN br.ret.sptk.many b6
awilliam@10672 98 #endif
awilliam@10672 99
awilliam@10672 100 /*
awilliam@10672 101 * Up until early 2004, use of .align within a function caused bad unwind info.
awilliam@10672 102 * TEXT_ALIGN(n) expands into ".align n" if a fixed GAS is available or into nothing
awilliam@10672 103 * otherwise.
awilliam@10672 104 */
awilliam@10672 105 #ifdef HAVE_WORKING_TEXT_ALIGN
awilliam@10672 106 # define TEXT_ALIGN(n) .align n
awilliam@10672 107 #else
awilliam@10672 108 # define TEXT_ALIGN(n)
awilliam@10672 109 #endif
awilliam@10672 110
awilliam@10672 111 #ifdef HAVE_SERIALIZE_DIRECTIVE
awilliam@10672 112 # define dv_serialize_data .serialize.data
awilliam@10672 113 # define dv_serialize_instruction .serialize.instruction
awilliam@10672 114 #else
awilliam@10672 115 # define dv_serialize_data
awilliam@10672 116 # define dv_serialize_instruction
awilliam@10672 117 #endif
awilliam@10672 118
awilliam@10672 119 #endif /* _ASM_IA64_ASMMACRO_H */