direct-io.hg

changeset 11332:c1261ca0d321

[IA64] Clean up: change asm constraints and remove _hypercall_imm*

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Thu Aug 24 11:42:24 2006 -0600 (2006-08-24)
parents 261b95f114a2
children 65042393b3e9
files linux-2.6-xen-sparse/include/asm-ia64/hypercall.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h	Thu Aug 24 11:32:55 2006 -0600
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h	Thu Aug 24 11:42:24 2006 -0600
     1.3 @@ -51,7 +51,7 @@
     1.4  			      "break 0x1000 ;;\n"		\
     1.5  			      "mov %0=r8 ;;\n"			\
     1.6  			      : "=r" (__res)			\
     1.7 -			      : "i" (__HYPERVISOR_##name)	\
     1.8 +			      : "J" (__HYPERVISOR_##name)	\
     1.9  			      : "r2","r8",			\
    1.10  			        "memory" );			\
    1.11  	(type)__res;						\
    1.12 @@ -66,8 +66,8 @@
    1.13  			      "break 0x1000 ;;\n"		\
    1.14  			      "mov %0=r8 ;;\n"			\
    1.15  			      : "=r" (__res)			\
    1.16 -			      : "i" (__HYPERVISOR_##name),	\
    1.17 -				"r" ((unsigned long)(a1))	\
    1.18 +			      : "J" (__HYPERVISOR_##name),	\
    1.19 +				"rI" ((unsigned long)(a1))	\
    1.20  			      : "r14","r2","r8",		\
    1.21  				"memory" );			\
    1.22  	(type)__res;						\
    1.23 @@ -83,9 +83,9 @@
    1.24  			      "break 0x1000 ;;\n"		\
    1.25  			      "mov %0=r8 ;;\n"			\
    1.26  			      : "=r" (__res)			\
    1.27 -			      : "i" (__HYPERVISOR_##name),	\
    1.28 -				"r" ((unsigned long)(a1)),	\
    1.29 -				"r" ((unsigned long)(a2))	\
    1.30 +			      : "J" (__HYPERVISOR_##name),	\
    1.31 +				"rI" ((unsigned long)(a1)),	\
    1.32 +				"rI" ((unsigned long)(a2))	\
    1.33  			      : "r14","r15","r2","r8",		\
    1.34  				"memory" );			\
    1.35  	(type)__res;						\
    1.36 @@ -102,10 +102,10 @@
    1.37  			      "break 0x1000 ;;\n"               \
    1.38  			      "mov %0=r8 ;;\n"                  \
    1.39  			      : "=r" (__res)                    \
    1.40 -			      : "i" (__HYPERVISOR_##name),      \
    1.41 -				"r" ((unsigned long)(a1)),	\
    1.42 -				"r" ((unsigned long)(a2)),	\
    1.43 -				"r" ((unsigned long)(a3))	\
    1.44 +			      : "J" (__HYPERVISOR_##name),      \
    1.45 +				"rI" ((unsigned long)(a1)),     \
    1.46 +				"rI" ((unsigned long)(a2)),     \
    1.47 +				"rI" ((unsigned long)(a3))      \
    1.48  			      : "r14","r15","r16","r2","r8",	\
    1.49  			        "memory" );                     \
    1.50  	(type)__res;                                            \
    1.51 @@ -123,11 +123,11 @@
    1.52  			      "break 0x1000 ;;\n"               \
    1.53  			      "mov %0=r8 ;;\n"                  \
    1.54  			      : "=r" (__res)                    \
    1.55 -			      : "i" (__HYPERVISOR_##name),      \
    1.56 -				"r" ((unsigned long)(a1)),	\
    1.57 -				"r" ((unsigned long)(a2)),	\
    1.58 -				"r" ((unsigned long)(a3)),	\
    1.59 -				"r" ((unsigned long)(a4))       \
    1.60 +			      : "J" (__HYPERVISOR_##name),      \
    1.61 +				"rI" ((unsigned long)(a1)),     \
    1.62 +				"rI" ((unsigned long)(a2)),     \
    1.63 +				"rI" ((unsigned long)(a3)),     \
    1.64 +				"rI" ((unsigned long)(a4))      \
    1.65  			      : "r14","r15","r16","r2","r8",	\
    1.66  			        "r17","memory" );               \
    1.67  	(type)__res;                                            \
    1.68 @@ -146,12 +146,12 @@
    1.69  			      "break 0x1000 ;;\n"               \
    1.70  			      "mov %0=r8 ;;\n"                  \
    1.71  			      : "=r" (__res)                    \
    1.72 -			      : "i" (__HYPERVISOR_##name),      \
    1.73 -				"r" ((unsigned long)(a1)),	\
    1.74 -				"r" ((unsigned long)(a2)),	\
    1.75 -				"r" ((unsigned long)(a3)),	\
    1.76 -				"r" ((unsigned long)(a4)),	\
    1.77 -				"r" ((unsigned long)(a5))       \
    1.78 +			      : "J" (__HYPERVISOR_##name),      \
    1.79 +				"rI" ((unsigned long)(a1)),     \
    1.80 +				"rI" ((unsigned long)(a2)),     \
    1.81 +				"rI" ((unsigned long)(a3)),     \
    1.82 +				"rI" ((unsigned long)(a4)),     \
    1.83 +				"rI" ((unsigned long)(a5))      \
    1.84  			      : "r14","r15","r16","r2","r8",	\
    1.85  			        "r17","r18","memory" );         \
    1.86  	(type)__res;                                            \
    1.87 @@ -317,97 +317,11 @@ static inline void exit_idle(void) {}
    1.88  #include <linux/err.h>
    1.89  #include <asm/xen/privop.h>
    1.90  
    1.91 -#define _hypercall_imm1(type, name, imm, a1)			\
    1.92 -({								\
    1.93 -	long __res;						\
    1.94 -	__asm__ __volatile__ (";;\n"				\
    1.95 -			      "mov r14=%2\n"			\
    1.96 -			      "mov r15=%3\n"			\
    1.97 -			      "mov r2=%1\n"			\
    1.98 -			      "break 0x1000 ;;\n"		\
    1.99 -			      "mov %0=r8 ;;\n"			\
   1.100 -			      : "=r" (__res)			\
   1.101 -			      : "i" (__HYPERVISOR_##name),	\
   1.102 -				"i" (imm),			\
   1.103 -				"r" ((unsigned long)(a1))	\
   1.104 -			      : "r14","r15","r2","r8",		\
   1.105 -				"memory" );			\
   1.106 -	(type)__res;						\
   1.107 -})
   1.108 -
   1.109 -#define _hypercall_imm2(type, name, imm, a1, a2)		\
   1.110 -({								\
   1.111 -	long __res;						\
   1.112 -	__asm__ __volatile__ (";;\n"				\
   1.113 -			      "mov r14=%2\n"			\
   1.114 -			      "mov r15=%3\n"			\
   1.115 -			      "mov r16=%4\n"			\
   1.116 -			      "mov r2=%1\n"			\
   1.117 -			      "break 0x1000 ;;\n"		\
   1.118 -			      "mov %0=r8 ;;\n"			\
   1.119 -			      : "=r" (__res)			\
   1.120 -			      : "i" (__HYPERVISOR_##name),	\
   1.121 -				"i" (imm),			\
   1.122 -				"r" ((unsigned long)(a1)),	\
   1.123 -				"r" ((unsigned long)(a2))	\
   1.124 -			      : "r14","r15","r16","r2","r8",	\
   1.125 -				"memory" );			\
   1.126 -	(type)__res;						\
   1.127 -})
   1.128 -
   1.129 -#define _hypercall_imm3(type, name, imm, a1, a2, a3)		\
   1.130 -({								\
   1.131 -	long __res;						\
   1.132 -	__asm__ __volatile__ (";;\n"				\
   1.133 -			      "mov r14=%2\n"			\
   1.134 -			      "mov r15=%3\n"			\
   1.135 -			      "mov r16=%4\n"			\
   1.136 -			      "mov r17=%5\n"			\
   1.137 -			      "mov r2=%1\n"			\
   1.138 -			      "break 0x1000 ;;\n"		\
   1.139 -			      "mov %0=r8 ;;\n"			\
   1.140 -			      : "=r" (__res)			\
   1.141 -			      : "i" (__HYPERVISOR_##name),	\
   1.142 -				"i" (imm),			\
   1.143 -				"r" ((unsigned long)(a1)),	\
   1.144 -				"r" ((unsigned long)(a2)),	\
   1.145 -				"r" ((unsigned long)(a3))	\
   1.146 -			      : "r14","r15","r16","r17",	\
   1.147 -				"r2","r8",			\
   1.148 -				"memory" );			\
   1.149 -	(type)__res;						\
   1.150 -})
   1.151 -
   1.152 -#define _hypercall_imm4(type, name, imm, a1, a2, a3, a4)	\
   1.153 -({								\
   1.154 -	long __res;						\
   1.155 -	__asm__ __volatile__ (";;\n"				\
   1.156 -			      "mov r14=%2\n"			\
   1.157 -			      "mov r15=%3\n"			\
   1.158 -			      "mov r16=%4\n"			\
   1.159 -			      "mov r17=%5\n"			\
   1.160 -			      "mov r18=%6\n"			\
   1.161 -			      "mov r2=%1\n"			\
   1.162 -			      "break 0x1000 ;;\n"		\
   1.163 -			      "mov %0=r8 ;;\n"			\
   1.164 -			      : "=r" (__res)			\
   1.165 -			      : "i" (__HYPERVISOR_##name),	\
   1.166 -				"i" (imm),			\
   1.167 -				"r" ((unsigned long)(a1)),	\
   1.168 -				"r" ((unsigned long)(a2)),	\
   1.169 -				"r" ((unsigned long)(a3)),	\
   1.170 -				"r" ((unsigned long)(a4))	\
   1.171 -			      : "r14","r15","r16","r17","r18",	\
   1.172 -				"r2","r8",			\
   1.173 -				"memory" );			\
   1.174 -	(type)__res;						\
   1.175 -})
   1.176 -
   1.177  static inline unsigned long
   1.178  __HYPERVISOR_ioremap(unsigned long ioaddr, unsigned long size)
   1.179  {
   1.180 -	return _hypercall_imm2(unsigned long, ia64_dom0vp_op,
   1.181 -			       IA64_DOM0VP_ioremap, ioaddr, size);
   1.182 +	return _hypercall3(unsigned long, ia64_dom0vp_op,
   1.183 +	                   IA64_DOM0VP_ioremap, ioaddr, size);
   1.184  }
   1.185  
   1.186  static inline unsigned long
   1.187 @@ -429,8 +343,8 @@ HYPERVISOR_ioremap(unsigned long ioaddr,
   1.188  static inline unsigned long
   1.189  __HYPERVISOR_phystomach(unsigned long gpfn)
   1.190  {
   1.191 -	return _hypercall_imm1(unsigned long, ia64_dom0vp_op,
   1.192 -			       IA64_DOM0VP_phystomach, gpfn);
   1.193 +	return _hypercall2(unsigned long, ia64_dom0vp_op,
   1.194 +	                   IA64_DOM0VP_phystomach, gpfn);
   1.195  }
   1.196  
   1.197  static inline unsigned long
   1.198 @@ -446,8 +360,8 @@ HYPERVISOR_phystomach(unsigned long gpfn
   1.199  static inline unsigned long
   1.200  __HYPERVISOR_machtophys(unsigned long mfn)
   1.201  {
   1.202 -	return _hypercall_imm1(unsigned long, ia64_dom0vp_op,
   1.203 -			       IA64_DOM0VP_machtophys, mfn);
   1.204 +	return _hypercall2(unsigned long, ia64_dom0vp_op,
   1.205 +	                   IA64_DOM0VP_machtophys, mfn);
   1.206  }
   1.207  
   1.208  static inline unsigned long
   1.209 @@ -463,8 +377,8 @@ HYPERVISOR_machtophys(unsigned long mfn)
   1.210  static inline unsigned long
   1.211  __HYPERVISOR_zap_physmap(unsigned long gpfn, unsigned int extent_order)
   1.212  {
   1.213 -	return _hypercall_imm2(unsigned long, ia64_dom0vp_op,
   1.214 -			       IA64_DOM0VP_zap_physmap, gpfn, extent_order);
   1.215 +	return _hypercall3(unsigned long, ia64_dom0vp_op,
   1.216 +	                   IA64_DOM0VP_zap_physmap, gpfn, extent_order);
   1.217  }
   1.218  
   1.219  static inline unsigned long
   1.220 @@ -481,9 +395,8 @@ static inline unsigned long
   1.221  __HYPERVISOR_add_physmap(unsigned long gpfn, unsigned long mfn,
   1.222  			 unsigned long flags, domid_t domid)
   1.223  {
   1.224 -	return _hypercall_imm4(unsigned long, ia64_dom0vp_op,
   1.225 -			       IA64_DOM0VP_add_physmap, gpfn, mfn, flags,
   1.226 -			       domid);
   1.227 +	return _hypercall5(unsigned long, ia64_dom0vp_op,
   1.228 +	                   IA64_DOM0VP_add_physmap, gpfn, mfn, flags, domid);
   1.229  }
   1.230  
   1.231  static inline unsigned long