summaryrefslogtreecommitdiffstats
path: root/arch/ia64/include/asm/native/inst.h
blob: d2d46efb3e6e83888e4f53910439b15794076785 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
/******************************************************************************
 * arch/ia64/include/asm/native/inst.h
 *
 * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
 *                    VA Linux Systems Japan K.K.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#define DO_SAVE_MIN		IA64_NATIVE_DO_SAVE_MIN

#define __paravirt_switch_to			ia64_native_switch_to
#define __paravirt_leave_syscall		ia64_native_leave_syscall
#define __paravirt_work_processed_syscall	ia64_native_work_processed_syscall
#define __paravirt_leave_kernel			ia64_native_leave_kernel
#define __paravirt_pending_syscall_end		ia64_work_pending_syscall_end
#define __paravirt_work_processed_syscall_target \
						ia64_work_processed_syscall

#define paravirt_fsyscall_table			ia64_native_fsyscall_table
#define paravirt_fsys_bubble_down		ia64_native_fsys_bubble_down

#ifdef CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK
# define PARAVIRT_POISON	0xdeadbeefbaadf00d
# define CLOBBER(clob)				\
	;;					\
	movl clob = PARAVIRT_POISON;		\
	;;
# define CLOBBER_PRED(pred_clob)		\
	;;					\
	cmp.eq pred_clob, p0 = r0, r0		\
	;;
#else
# define CLOBBER(clob)			/* nothing */
# define CLOBBER_PRED(pred_clob)	/* nothing */
#endif

#define MOV_FROM_IFA(reg)	\
	mov reg = cr.ifa

#define MOV_FROM_ITIR(reg)	\
	mov reg = cr.itir

#define MOV_FROM_ISR(reg)	\
	mov reg = cr.isr

#define MOV_FROM_IHA(reg)	\
	mov reg = cr.iha

#define MOV_FROM_IPSR(pred, reg)	\
(pred)	mov reg = cr.ipsr

#define MOV_FROM_IIM(reg)	\
	mov reg = cr.iim

#define MOV_FROM_IIP(reg)	\
	mov reg = cr.iip

#define MOV_FROM_IVR(reg, clob)	\
	mov reg = cr.ivr	\
	CLOBBER(clob)

#define MOV_FROM_PSR(pred, reg, clob)	\
(pred)	mov reg = psr			\
	CLOBBER(clob)

#define MOV_FROM_ITC(pred, pred_clob, reg, clob)	\
(pred)	mov reg = ar.itc				\
	CLOBBER(clob)					\
	CLOBBER_PRED(pred_clob)

#define MOV_TO_IFA(reg, clob)	\
	mov cr.ifa = reg	\
	CLOBBER(clob)

#define MOV_TO_ITIR(pred, reg, clob)	\
(pred)	mov cr.itir = reg		\
	CLOBBER(clob)

#define MOV_TO_IHA(pred, reg, clob)	\
(pred)	mov cr.iha = reg		\
	CLOBBER(clob)

#define MOV_TO_IPSR(pred, reg, clob)		\
(pred)	mov cr.ipsr = reg			\
	CLOBBER(clob)

#define MOV_TO_IFS(pred, reg, clob)	\
(pred)	mov cr.ifs = reg		\
	CLOBBER(clob)

#define MOV_TO_IIP(reg, clob)	\
	mov cr.iip = reg	\
	CLOBBER(clob)

#define MOV_TO_KR(kr, reg, clob0, clob1)	\
	mov IA64_KR(kr) = reg			\
	CLOBBER(clob0)				\
	CLOBBER(clob1)

#define ITC_I(pred, reg, clob)	\
(pred)	itc.i reg		\
	CLOBBER(clob)

#define ITC_D(pred, reg, clob)	\
(pred)	itc.d reg		\
	CLOBBER(clob)

#define ITC_I_AND_D(pred_i, pred_d, reg, clob)	\
(pred_i) itc.i reg;				\
(pred_d) itc.d reg				\
	CLOBBER(clob)

#define THASH(pred, reg0, reg1, clob)		\
(pred)	thash reg0 = reg1			\
	CLOBBER(clob)

#define SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(clob0, clob1)		\
	ssm psr.ic | PSR_DEFAULT_BITS					\
	CLOBBER(clob0)							\
	CLOBBER(clob1)							\
	;;								\
	srlz.i /* guarantee that interruption collectin is on */	\
	;;

#define SSM_PSR_IC_AND_SRLZ_D(clob0, clob1)	\
	ssm psr.ic				\
	CLOBBER(clob0)				\
	CLOBBER(clob1)				\
	;;					\
	srlz.d

#define RSM_PSR_IC(clob)	\
	rsm psr.ic		\
	CLOBBER(clob)

#define SSM_PSR_I(pred, pred_clob, clob)	\
(pred)	ssm psr.i				\
	CLOBBER(clob)				\
	CLOBBER_PRED(pred_clob)

#define RSM_PSR_I(pred, clob0, clob1)	\
(pred)	rsm psr.i			\
	CLOBBER(clob0)			\
	CLOBBER(clob1)

#define RSM_PSR_I_IC(clob0, clob1, clob2)	\
	rsm psr.i | psr.ic			\
	CLOBBER(clob0)				\
	CLOBBER(clob1)				\
	CLOBBER(clob2)

#define RSM_PSR_DT		\
	rsm psr.dt

#define RSM_PSR_BE_I(clob0, clob1)	\
	rsm psr.be | psr.i		\
	CLOBBER(clob0)			\
	CLOBBER(clob1)

#define SSM_PSR_DT_AND_SRLZ_I	\
	ssm psr.dt		\
	;;			\
	srlz.i

#define BSW_0(clob0, clob1, clob2)	\
	bsw.0				\
	CLOBBER(clob0)			\
	CLOBBER(clob1)			\
	CLOBBER(clob2)

#define BSW_1(clob0, clob1)	\
	bsw.1			\
	CLOBBER(clob0)		\
	CLOBBER(clob1)

#define COVER	\
	cover

#define RFI	\
	rfi
OpenPOWER on IntegriCloud