ia64/pv_ops: add hooks to paravirtualize fsyscall implementation.
[linux-2.6/mini2440.git] / arch / ia64 / include / asm / native / inst.h
blob5e4e15133f414af65e90e5522a5a635284fb7dc6
1 /******************************************************************************
2 * arch/ia64/include/asm/native/inst.h
4 * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
5 * VA Linux Systems Japan K.K.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #define DO_SAVE_MIN IA64_NATIVE_DO_SAVE_MIN
25 #define __paravirt_switch_to ia64_native_switch_to
26 #define __paravirt_leave_syscall ia64_native_leave_syscall
27 #define __paravirt_work_processed_syscall ia64_native_work_processed_syscall
28 #define __paravirt_leave_kernel ia64_native_leave_kernel
29 #define __paravirt_pending_syscall_end ia64_work_pending_syscall_end
30 #define __paravirt_work_processed_syscall_target \
31 ia64_work_processed_syscall
33 #define paravirt_fsyscall_table ia64_native_fsyscall_table
34 #define paravirt_fsys_bubble_down ia64_native_fsys_bubble_down
36 #ifdef CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK
37 # define PARAVIRT_POISON 0xdeadbeefbaadf00d
38 # define CLOBBER(clob) \
39 ;; \
40 movl clob = PARAVIRT_POISON; \
42 # define CLOBBER_PRED(pred_clob) \
43 ;; \
44 cmp.eq pred_clob, p0 = r0, r0 \
46 #else
47 # define CLOBBER(clob) /* nothing */
48 # define CLOBBER_PRED(pred_clob) /* nothing */
49 #endif
51 #define MOV_FROM_IFA(reg) \
52 mov reg = cr.ifa
54 #define MOV_FROM_ITIR(reg) \
55 mov reg = cr.itir
57 #define MOV_FROM_ISR(reg) \
58 mov reg = cr.isr
60 #define MOV_FROM_IHA(reg) \
61 mov reg = cr.iha
63 #define MOV_FROM_IPSR(pred, reg) \
64 (pred) mov reg = cr.ipsr
66 #define MOV_FROM_IIM(reg) \
67 mov reg = cr.iim
69 #define MOV_FROM_IIP(reg) \
70 mov reg = cr.iip
72 #define MOV_FROM_IVR(reg, clob) \
73 mov reg = cr.ivr \
74 CLOBBER(clob)
76 #define MOV_FROM_PSR(pred, reg, clob) \
77 (pred) mov reg = psr \
78 CLOBBER(clob)
80 #define MOV_TO_IFA(reg, clob) \
81 mov cr.ifa = reg \
82 CLOBBER(clob)
84 #define MOV_TO_ITIR(pred, reg, clob) \
85 (pred) mov cr.itir = reg \
86 CLOBBER(clob)
88 #define MOV_TO_IHA(pred, reg, clob) \
89 (pred) mov cr.iha = reg \
90 CLOBBER(clob)
92 #define MOV_TO_IPSR(pred, reg, clob) \
93 (pred) mov cr.ipsr = reg \
94 CLOBBER(clob)
96 #define MOV_TO_IFS(pred, reg, clob) \
97 (pred) mov cr.ifs = reg \
98 CLOBBER(clob)
100 #define MOV_TO_IIP(reg, clob) \
101 mov cr.iip = reg \
102 CLOBBER(clob)
104 #define MOV_TO_KR(kr, reg, clob0, clob1) \
105 mov IA64_KR(kr) = reg \
106 CLOBBER(clob0) \
107 CLOBBER(clob1)
109 #define ITC_I(pred, reg, clob) \
110 (pred) itc.i reg \
111 CLOBBER(clob)
113 #define ITC_D(pred, reg, clob) \
114 (pred) itc.d reg \
115 CLOBBER(clob)
117 #define ITC_I_AND_D(pred_i, pred_d, reg, clob) \
118 (pred_i) itc.i reg; \
119 (pred_d) itc.d reg \
120 CLOBBER(clob)
122 #define THASH(pred, reg0, reg1, clob) \
123 (pred) thash reg0 = reg1 \
124 CLOBBER(clob)
126 #define SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(clob0, clob1) \
127 ssm psr.ic | PSR_DEFAULT_BITS \
128 CLOBBER(clob0) \
129 CLOBBER(clob1) \
130 ;; \
131 srlz.i /* guarantee that interruption collectin is on */ \
134 #define SSM_PSR_IC_AND_SRLZ_D(clob0, clob1) \
135 ssm psr.ic \
136 CLOBBER(clob0) \
137 CLOBBER(clob1) \
138 ;; \
139 srlz.d
141 #define RSM_PSR_IC(clob) \
142 rsm psr.ic \
143 CLOBBER(clob)
145 #define SSM_PSR_I(pred, pred_clob, clob) \
146 (pred) ssm psr.i \
147 CLOBBER(clob) \
148 CLOBBER_PRED(pred_clob)
150 #define RSM_PSR_I(pred, clob0, clob1) \
151 (pred) rsm psr.i \
152 CLOBBER(clob0) \
153 CLOBBER(clob1)
155 #define RSM_PSR_I_IC(clob0, clob1, clob2) \
156 rsm psr.i | psr.ic \
157 CLOBBER(clob0) \
158 CLOBBER(clob1) \
159 CLOBBER(clob2)
161 #define RSM_PSR_DT \
162 rsm psr.dt
164 #define SSM_PSR_DT_AND_SRLZ_I \
165 ssm psr.dt \
166 ;; \
167 srlz.i
169 #define BSW_0(clob0, clob1, clob2) \
170 bsw.0 \
171 CLOBBER(clob0) \
172 CLOBBER(clob1) \
173 CLOBBER(clob2)
175 #define BSW_1(clob0, clob1) \
176 bsw.1 \
177 CLOBBER(clob0) \
178 CLOBBER(clob1)
180 #define COVER \
181 cover
183 #define RFI \