ia64/xen-unstable

changeset 9001:b5a6da522577

[IA64] Cleanup hypercall.h

Cleanup to hypercall.h of ia64 xenlinux, and remove used stuff.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
author awilliam@xenbuild.aw
date Tue Feb 28 10:13:55 2006 -0700 (2006-02-28)
parents a220579c2aa8
children ff019fb073e4
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	Mon Feb 27 14:00:33 2006 -0700
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h	Tue Feb 28 10:13:55 2006 -0700
     1.3 @@ -37,8 +37,6 @@
     1.4  #include <asm/page.h>
     1.5  #define virt_to_machine(v) __pa(v)
     1.6  #define machine_to_virt(m) __va(m)
     1.7 -//#define virt_to_mfn(v)	(__pa(v) >> 14)
     1.8 -//#define mfn_to_virt(m)	(__va(m << 14))
     1.9  #define virt_to_mfn(v)	((__pa(v)) >> PAGE_SHIFT)
    1.10  #define mfn_to_virt(m)	(__va((m) << PAGE_SHIFT))
    1.11  
    1.12 @@ -55,8 +53,8 @@
    1.13  			      "mov %0=r8 ;;\n"			\
    1.14  			      : "=r" (__res)			\
    1.15  			      : "i" (__HYPERVISOR_##name)	\
    1.16 -			      : "r2","r8"			\
    1.17 -				"memory" );			\
    1.18 +			      : "r2","r8",			\
    1.19 +			        "memory" );			\
    1.20  	(type)__res;						\
    1.21  })
    1.22  
    1.23 @@ -109,328 +107,86 @@
    1.24  				"r" ((unsigned long)(a1)),	\
    1.25  				"r" ((unsigned long)(a2)),	\
    1.26  				"r" ((unsigned long)(a3))	\
    1.27 -			      : "r14","r15","r16","r2","r8",    \
    1.28 -				"memory" );                     \
    1.29 +			      : "r14","r15","r16","r2","r8",	\
    1.30 +			        "memory" );                     \
    1.31  	(type)__res;                                            \
    1.32  })
    1.33  
    1.34 -#if 0
    1.35 -static inline int
    1.36 -HYPERVISOR_set_trap_table(
    1.37 -    trap_info_t *table)
    1.38 -{
    1.39 -#if 0
    1.40 -    int ret;
    1.41 -    unsigned long ignore;
    1.42 -
    1.43 -    __asm__ __volatile__ (
    1.44 -        TRAP_INSTR
    1.45 -        : "=a" (ret), "=b" (ignore)
    1.46 -	: "0" (__HYPERVISOR_set_trap_table), "1" (table)
    1.47 -	: "memory" );
    1.48 -
    1.49 -    return ret;
    1.50 -#endif
    1.51 -    return 1;
    1.52 -}
    1.53 -
    1.54 -static inline int
    1.55 -HYPERVISOR_mmu_update(
    1.56 -    mmu_update_t *req, int count, int *success_count, domid_t domid)
    1.57 -{
    1.58 -#if 0
    1.59 -    int ret;
    1.60 -    unsigned long ign1, ign2, ign3, ign4;
    1.61 -
    1.62 -    __asm__ __volatile__ (
    1.63 -        TRAP_INSTR
    1.64 -        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
    1.65 -	: "0" (__HYPERVISOR_mmu_update), "1" (req), "2" (count),
    1.66 -        "3" (success_count), "4" (domid)
    1.67 -	: "memory" );
    1.68 -
    1.69 -    return ret;
    1.70 -#endif
    1.71 -    return 1;
    1.72 -}
    1.73 -
    1.74 -static inline int
    1.75 -HYPERVISOR_mmuext_op(
    1.76 -    struct mmuext_op *op, int count, int *success_count, domid_t domid)
    1.77 -{
    1.78 -#if 0
    1.79 -    int ret;
    1.80 -    unsigned long ign1, ign2, ign3, ign4;
    1.81 -
    1.82 -    __asm__ __volatile__ (
    1.83 -        TRAP_INSTR
    1.84 -        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
    1.85 -	: "0" (__HYPERVISOR_mmuext_op), "1" (op), "2" (count),
    1.86 -        "3" (success_count), "4" (domid)
    1.87 -	: "memory" );
    1.88 -
    1.89 -    return ret;
    1.90 -#endif
    1.91 -    return 1;
    1.92 -}
    1.93 -
    1.94 -static inline int
    1.95 -HYPERVISOR_set_gdt(
    1.96 -    unsigned long *frame_list, int entries)
    1.97 -{
    1.98 -#if 0
    1.99 -    int ret;
   1.100 -    unsigned long ign1, ign2;
   1.101 +#define _hypercall4(type, name, a1, a2, a3, a4)			\
   1.102 +({								\
   1.103 +	long __res;						\
   1.104 +	__asm__ __volatile__ (";;\n"                            \
   1.105 +			      "mov r14=%2\n"                    \
   1.106 +			      "mov r15=%3\n"                    \
   1.107 +			      "mov r16=%4\n"                    \
   1.108 +			      "mov r17=%5\n"                    \
   1.109 +			      "mov r2=%1\n"                     \
   1.110 +			      "break 0x1000 ;;\n"               \
   1.111 +			      "mov %0=r8 ;;\n"                  \
   1.112 +			      : "=r" (__res)                    \
   1.113 +			      : "i" (__HYPERVISOR_##name),      \
   1.114 +				"r" ((unsigned long)(a1)),	\
   1.115 +				"r" ((unsigned long)(a2)),	\
   1.116 +				"r" ((unsigned long)(a3)),	\
   1.117 +				"r" ((unsigned long)(a4))       \
   1.118 +			      : "r14","r15","r16","r2","r8",	\
   1.119 +			        "r17","memory" );               \
   1.120 +	(type)__res;                                            \
   1.121 +})
   1.122  
   1.123 -    __asm__ __volatile__ (
   1.124 -        TRAP_INSTR
   1.125 -        : "=a" (ret), "=b" (ign1), "=c" (ign2)
   1.126 -	: "0" (__HYPERVISOR_set_gdt), "1" (frame_list), "2" (entries)
   1.127 -	: "memory" );
   1.128 -
   1.129 -
   1.130 -    return ret;
   1.131 -#endif
   1.132 -    return 1;
   1.133 -}
   1.134 -
   1.135 -static inline int
   1.136 -HYPERVISOR_stack_switch(
   1.137 -    unsigned long ss, unsigned long esp)
   1.138 -{
   1.139 -#if 0
   1.140 -    int ret;
   1.141 -    unsigned long ign1, ign2;
   1.142 -
   1.143 -    __asm__ __volatile__ (
   1.144 -        TRAP_INSTR
   1.145 -        : "=a" (ret), "=b" (ign1), "=c" (ign2)
   1.146 -	: "0" (__HYPERVISOR_stack_switch), "1" (ss), "2" (esp)
   1.147 -	: "memory" );
   1.148 -
   1.149 -    return ret;
   1.150 -#endif
   1.151 -    return 1;
   1.152 -}
   1.153 -
   1.154 -static inline int
   1.155 -HYPERVISOR_set_callbacks(
   1.156 -    unsigned long event_selector, unsigned long event_address,
   1.157 -    unsigned long failsafe_selector, unsigned long failsafe_address)
   1.158 -{
   1.159 -#if 0
   1.160 -    int ret;
   1.161 -    unsigned long ign1, ign2, ign3, ign4;
   1.162 -
   1.163 -    __asm__ __volatile__ (
   1.164 -        TRAP_INSTR
   1.165 -        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
   1.166 -	: "0" (__HYPERVISOR_set_callbacks), "1" (event_selector),
   1.167 -	  "2" (event_address), "3" (failsafe_selector), "4" (failsafe_address)
   1.168 -	: "memory" );
   1.169 -
   1.170 -    return ret;
   1.171 -#endif
   1.172 -    return 1;
   1.173 -}
   1.174 -
   1.175 -static inline int
   1.176 -HYPERVISOR_fpu_taskswitch(
   1.177 -    int set)
   1.178 -{
   1.179 -#if 0
   1.180 -    int ret;
   1.181 -    unsigned long ign;
   1.182 -
   1.183 -    __asm__ __volatile__ (
   1.184 -        TRAP_INSTR
   1.185 -        : "=a" (ret), "=b" (ign)
   1.186 -        : "0" (__HYPERVISOR_fpu_taskswitch), "1" (set)
   1.187 -        : "memory" );
   1.188 -
   1.189 -    return ret;
   1.190 -#endif
   1.191 -    return 1;
   1.192 -}
   1.193 +#define _hypercall5(type, name, a1, a2, a3, a4, a5)		\
   1.194 +({								\
   1.195 +	long __res;						\
   1.196 +	__asm__ __volatile__ (";;\n"                            \
   1.197 +			      "mov r14=%2\n"                    \
   1.198 +			      "mov r15=%3\n"                    \
   1.199 +			      "mov r16=%4\n"                    \
   1.200 +			      "mov r17=%5\n"                    \
   1.201 +			      "mov r18=%6\n"                    \
   1.202 +			      "mov r2=%1\n"                     \
   1.203 +			      "break 0x1000 ;;\n"               \
   1.204 +			      "mov %0=r8 ;;\n"                  \
   1.205 +			      : "=r" (__res)                    \
   1.206 +			      : "i" (__HYPERVISOR_##name),      \
   1.207 +				"r" ((unsigned long)(a1)),	\
   1.208 +				"r" ((unsigned long)(a2)),	\
   1.209 +				"r" ((unsigned long)(a3)),	\
   1.210 +				"r" ((unsigned long)(a4)),	\
   1.211 +				"r" ((unsigned long)(a5))       \
   1.212 +			      : "r14","r15","r16","r2","r8",	\
   1.213 +			        "r17","r18","memory" );         \
   1.214 +	(type)__res;                                            \
   1.215 +})
   1.216  
   1.217  static inline int
   1.218  HYPERVISOR_sched_op(
   1.219      int cmd, unsigned long arg)
   1.220  {
   1.221 -    return 1;
   1.222 -}
   1.223 -
   1.224 -static inline int
   1.225 -HYPERVISOR_suspend(
   1.226 -    unsigned long srec)
   1.227 -{
   1.228 -    return 1;
   1.229 +	return _hypercall2(int, sched_op, cmd, arg);
   1.230  }
   1.231  
   1.232  static inline long
   1.233  HYPERVISOR_set_timer_op(
   1.234      u64 timeout)
   1.235  {
   1.236 -#if 0
   1.237 -    int ret;
   1.238      unsigned long timeout_hi = (unsigned long)(timeout>>32);
   1.239      unsigned long timeout_lo = (unsigned long)timeout;
   1.240 -    unsigned long ign1, ign2;
   1.241 -
   1.242 -    __asm__ __volatile__ (
   1.243 -        TRAP_INSTR
   1.244 -        : "=a" (ret), "=b" (ign1), "=c" (ign2)
   1.245 -	: "0" (__HYPERVISOR_set_timer_op), "b" (timeout_lo), "c" (timeout_hi)
   1.246 -	: "memory");
   1.247 -
   1.248 -    return ret;
   1.249 -#endif
   1.250 -    return 1;
   1.251 +    return _hypercall2(long, set_timer_op, timeout_lo, timeout_hi);
   1.252  }
   1.253  
   1.254  static inline int
   1.255  HYPERVISOR_dom0_op(
   1.256      dom0_op_t *dom0_op)
   1.257  {
   1.258 -#if 0
   1.259 -    int ret;
   1.260 -    unsigned long ign1;
   1.261 -
   1.262      dom0_op->interface_version = DOM0_INTERFACE_VERSION;
   1.263 -    __asm__ __volatile__ (
   1.264 -        TRAP_INSTR
   1.265 -        : "=a" (ret), "=b" (ign1)
   1.266 -	: "0" (__HYPERVISOR_dom0_op), "1" (dom0_op)
   1.267 -	: "memory");
   1.268 -
   1.269 -    return ret;
   1.270 -#endif
   1.271 -    return 1;
   1.272 -}
   1.273 -
   1.274 -static inline int
   1.275 -HYPERVISOR_set_debugreg(
   1.276 -    int reg, unsigned long value)
   1.277 -{
   1.278 -#if 0
   1.279 -    int ret;
   1.280 -    unsigned long ign1, ign2;
   1.281 -    __asm__ __volatile__ (
   1.282 -        TRAP_INSTR
   1.283 -        : "=a" (ret), "=b" (ign1), "=c" (ign2)
   1.284 -	: "0" (__HYPERVISOR_set_debugreg), "1" (reg), "2" (value)
   1.285 -	: "memory" );
   1.286 -
   1.287 -    return ret;
   1.288 -#endif
   1.289 -    return 1;
   1.290 -}
   1.291 -
   1.292 -static inline unsigned long
   1.293 -HYPERVISOR_get_debugreg(
   1.294 -    int reg)
   1.295 -{
   1.296 -#if 0
   1.297 -    unsigned long ret;
   1.298 -    unsigned long ign;
   1.299 -    __asm__ __volatile__ (
   1.300 -        TRAP_INSTR
   1.301 -        : "=a" (ret), "=b" (ign)
   1.302 -	: "0" (__HYPERVISOR_get_debugreg), "1" (reg)
   1.303 -	: "memory" );
   1.304 -
   1.305 -    return ret;
   1.306 -#endif
   1.307 -    return 1;
   1.308 -}
   1.309 -
   1.310 -static inline int
   1.311 -HYPERVISOR_update_descriptor(
   1.312 -    unsigned long ma, unsigned long word1, unsigned long word2)
   1.313 -{
   1.314 -#if 0
   1.315 -    int ret;
   1.316 -    unsigned long ign1, ign2, ign3;
   1.317 -
   1.318 -    __asm__ __volatile__ (
   1.319 -        TRAP_INSTR
   1.320 -        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
   1.321 -	: "0" (__HYPERVISOR_update_descriptor), "1" (ma), "2" (word1),
   1.322 -	  "3" (word2)
   1.323 -	: "memory" );
   1.324 -
   1.325 -    return ret;
   1.326 -#endif
   1.327 -    return 1;
   1.328 -}
   1.329 -
   1.330 -static inline int
   1.331 -HYPERVISOR_set_fast_trap(
   1.332 -    int idx)
   1.333 -{
   1.334 -#if 0
   1.335 -    int ret;
   1.336 -    unsigned long ign;
   1.337 -
   1.338 -    __asm__ __volatile__ (
   1.339 -        TRAP_INSTR
   1.340 -        : "=a" (ret), "=b" (ign)
   1.341 -	: "0" (__HYPERVISOR_set_fast_trap), "1" (idx)
   1.342 -	: "memory" );
   1.343 -
   1.344 -    return ret;
   1.345 -#endif
   1.346 -    return 1;
   1.347 -}
   1.348 -
   1.349 -static inline int
   1.350 -HYPERVISOR_dom_mem_op(
   1.351 -    unsigned int op, unsigned long *extent_list,
   1.352 -    unsigned long nr_extents, unsigned int extent_order)
   1.353 -{
   1.354 -#if 0
   1.355 -    int ret;
   1.356 -    unsigned long ign1, ign2, ign3, ign4, ign5;
   1.357 -
   1.358 -    __asm__ __volatile__ (
   1.359 -        TRAP_INSTR
   1.360 -        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4),
   1.361 -	  "=D" (ign5)
   1.362 -	: "0" (__HYPERVISOR_dom_mem_op), "1" (op), "2" (extent_list),
   1.363 -	  "3" (nr_extents), "4" (extent_order), "5" (DOMID_SELF)
   1.364 -        : "memory" );
   1.365 -
   1.366 -    return ret;
   1.367 -#endif
   1.368 -    return 1;
   1.369 +    return _hypercall1(int, dom0_op, dom0_op);
   1.370  }
   1.371  
   1.372  static inline int
   1.373  HYPERVISOR_multicall(
   1.374      void *call_list, int nr_calls)
   1.375  {
   1.376 -#if 0
   1.377 -    int ret;
   1.378 -    unsigned long ign1, ign2;
   1.379 -
   1.380 -    __asm__ __volatile__ (
   1.381 -        TRAP_INSTR
   1.382 -        : "=a" (ret), "=b" (ign1), "=c" (ign2)
   1.383 -	: "0" (__HYPERVISOR_multicall), "1" (call_list), "2" (nr_calls)
   1.384 -	: "memory" );
   1.385 -
   1.386 -    return ret;
   1.387 -#endif
   1.388 -    return 1;
   1.389 -}
   1.390 -#endif
   1.391 -
   1.392 -static inline int
   1.393 -HYPERVISOR_update_va_mapping(
   1.394 -    unsigned long va, pte_t new_val, unsigned long flags)
   1.395 -{
   1.396 -    /* no-op */
   1.397 -    return 1;
   1.398 +    return _hypercall2(int, multicall, call_list, nr_calls);
   1.399  }
   1.400  
   1.401  static inline int
   1.402 @@ -447,26 +203,12 @@ HYPERVISOR_event_channel_op(
   1.403      return _hypercall1(int, event_channel_op, op);
   1.404  }
   1.405  
   1.406 -#if 0
   1.407  static inline int
   1.408  HYPERVISOR_xen_version(
   1.409 -    int cmd)
   1.410 +    int cmd, void *arg)
   1.411  {
   1.412 -#if 0
   1.413 -    int ret;
   1.414 -    unsigned long ignore;
   1.415 -
   1.416 -    __asm__ __volatile__ (
   1.417 -        TRAP_INSTR
   1.418 -        : "=a" (ret), "=b" (ignore)
   1.419 -	: "0" (__HYPERVISOR_xen_version), "1" (cmd)
   1.420 -	: "memory" );
   1.421 -
   1.422 -    return ret;
   1.423 -#endif
   1.424 -    return 1;
   1.425 +    return _hypercall2(int, xen_version, cmd, arg);
   1.426  }
   1.427 -#endif
   1.428  
   1.429  static inline int
   1.430  HYPERVISOR_console_io(
   1.431 @@ -475,26 +217,12 @@ HYPERVISOR_console_io(
   1.432      return _hypercall3(int, console_io, cmd, count, str);
   1.433  }
   1.434  
   1.435 -#if 0
   1.436  static inline int
   1.437  HYPERVISOR_physdev_op(
   1.438      void *physdev_op)
   1.439  {
   1.440 -#if 0
   1.441 -    int ret;
   1.442 -    unsigned long ign;
   1.443 -
   1.444 -    __asm__ __volatile__ (
   1.445 -        TRAP_INSTR
   1.446 -        : "=a" (ret), "=b" (ign)
   1.447 -	: "0" (__HYPERVISOR_physdev_op), "1" (physdev_op)
   1.448 -	: "memory" );
   1.449 -
   1.450 -    return ret;
   1.451 -#endif
   1.452 -    return 1;
   1.453 +    return _hypercall1(int, physdev_op, physdev_op);
   1.454  }
   1.455 -#endif
   1.456  
   1.457  static inline int
   1.458  HYPERVISOR_grant_table_op(
   1.459 @@ -503,46 +231,23 @@ HYPERVISOR_grant_table_op(
   1.460      return _hypercall3(int, grant_table_op, cmd, uop, count);
   1.461  }
   1.462  
   1.463 -#if 0
   1.464  static inline int
   1.465 -HYPERVISOR_update_va_mapping_otherdomain(
   1.466 -    unsigned long va, pte_t new_val, unsigned long flags, domid_t domid)
   1.467 +HYPERVISOR_vcpu_op(
   1.468 +	int cmd, int vcpuid, void *extra_args)
   1.469  {
   1.470 -#if 0
   1.471 -    int ret;
   1.472 -    unsigned long ign1, ign2, ign3, ign4;
   1.473 -
   1.474 -    __asm__ __volatile__ (
   1.475 -        TRAP_INSTR
   1.476 -        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
   1.477 -	: "0" (__HYPERVISOR_update_va_mapping_otherdomain),
   1.478 -          "1" (va), "2" ((new_val).pte_low), "3" (flags), "4" (domid) :
   1.479 -        "memory" );
   1.480 -    
   1.481 -    return ret;
   1.482 -#endif
   1.483 -    return 1;
   1.484 +    return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
   1.485  }
   1.486  
   1.487  static inline int
   1.488 -HYPERVISOR_vm_assist(
   1.489 -    unsigned int cmd, unsigned int type)
   1.490 +HYPERVISOR_suspend(
   1.491 +	unsigned long srec)
   1.492  {
   1.493 -#if 0
   1.494 -    int ret;
   1.495 -    unsigned long ign1, ign2;
   1.496 -
   1.497 -    __asm__ __volatile__ (
   1.498 -        TRAP_INSTR
   1.499 -        : "=a" (ret), "=b" (ign1), "=c" (ign2)
   1.500 -	: "0" (__HYPERVISOR_vm_assist), "1" (cmd), "2" (type)
   1.501 -	: "memory" );
   1.502 -
   1.503 -    return ret;
   1.504 -#endif
   1.505 -    return 1;
   1.506 +    return _hypercall3(int, sched_op, SCHEDOP_shutdown,
   1.507 +			SHUTDOWN_suspend, srec);
   1.508  }
   1.509  
   1.510 -#endif
   1.511 +extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
   1.512 +static inline void exit_idle(void) {}
   1.513 +#define do_IRQ(irq, regs) __do_IRQ((irq), (regs))
   1.514  
   1.515  #endif /* __HYPERCALL_H__ */