ia64/xen-unstable

changeset 2727:65295b0e2e99

bitkeeper revision 1.1159.1.269 (417bfb07XUL6X4zWaV5K6zpOCIkODA)

sync w/ Linux version:
1.18 04/10/15 18:04:37+01:00 sos22@douglas.cl.cam.ac.uk 20 19 128/54/501

It turns out that Xen hypercalls actually clobber the registers used to
pass in their arguments (some of the time, at least). Correct the
asm in hypervisor.h to allow for this.

1.17 04/10/07 17:30:37+01:00 kaf24@freefall.cl.cam.ac.uk 19 18 79/32/476

Grant-table interface redone.
author cl349@freefall.cl.cam.ac.uk
date Sun Oct 24 18:57:11 2004 +0000 (2004-10-24)
parents 4cec04241b9b
children 855925dd3bae
files netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h
line diff
     1.1 --- a/netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h	Sat Oct 23 17:50:05 2004 +0000
     1.2 +++ b/netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h	Sun Oct 24 18:57:11 2004 +0000
     1.3 @@ -4,25 +4,25 @@
     1.4   * 
     1.5   * Communication to/from hypervisor.
     1.6   * 
     1.7 - * Copyright (c) 2002-2003, K A Fraser
     1.8 + * Copyright (c) 2002-2004, K A Fraser
     1.9   * 
    1.10   * Permission is hereby granted, free of charge, to any person obtaining a copy
    1.11 - * of this software and associated documentation files (the "Software"), to
    1.12 - * deal in the Software without restriction, including without limitation the
    1.13 - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
    1.14 - * sell copies of the Software, and to permit persons to whom the Software is
    1.15 - * furnished to do so, subject to the following conditions:
    1.16 + * of this source file (the "Software"), to deal in the Software without
    1.17 + * restriction, including without limitation the rights to use, copy, modify,
    1.18 + * merge, publish, distribute, sublicense, and/or sell copies of the Software,
    1.19 + * and to permit persons to whom the Software is furnished to do so, subject to
    1.20 + * the following conditions:
    1.21   * 
    1.22   * The above copyright notice and this permission notice shall be included in
    1.23   * all copies or substantial portions of the Software.
    1.24   * 
    1.25 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
    1.26 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
    1.27 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
    1.28 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
    1.29 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
    1.30 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
    1.31 - * DEALINGS IN THE SOFTWARE.
    1.32 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    1.33 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    1.34 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    1.35 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    1.36 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    1.37 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
    1.38 + * IN THE SOFTWARE.
    1.39   */
    1.40  
    1.41  
    1.42 @@ -100,67 +100,87 @@ void hypervisor_force_callback(void);
    1.43   * Assembler stubs for hyper-calls.
    1.44   */
    1.45  
    1.46 -static inline int HYPERVISOR_set_trap_table(trap_info_t *table)
    1.47 +static inline int
    1.48 +HYPERVISOR_set_trap_table(trap_info_t *table)
    1.49  {
    1.50      int ret;
    1.51 +    unsigned long ign1;
    1.52 +
    1.53      __asm__ __volatile__ (
    1.54          TRAP_INSTR
    1.55 -        : "=a" (ret) : "0" (__HYPERVISOR_set_trap_table),
    1.56 -        "b" (table) : "memory" );
    1.57 +        : "=a" (ret), "=b" (ign1)
    1.58 +	: "0" (__HYPERVISOR_set_trap_table), "1" (table)
    1.59 +	: "memory" );
    1.60  
    1.61      return ret;
    1.62  }
    1.63  
    1.64 -static inline int HYPERVISOR_mmu_update(mmu_update_t *req, int count,
    1.65 -					int *success_count)
    1.66 +static inline int
    1.67 +HYPERVISOR_mmu_update(mmu_update_t *req, int count, int *success_count)
    1.68  {
    1.69      int ret;
    1.70 +    unsigned long ign1, ign2, ign3;
    1.71 +
    1.72      __asm__ __volatile__ (
    1.73          TRAP_INSTR
    1.74 -        : "=a" (ret) : "0" (__HYPERVISOR_mmu_update), 
    1.75 -        "b" (req), "c" (count), "d" (success_count) : "memory" );
    1.76 +        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
    1.77 +	: "0" (__HYPERVISOR_mmu_update), "1" (req), "2" (count),
    1.78 +	  "3" (success_count)
    1.79 +	: "memory" );
    1.80  
    1.81      return ret;
    1.82  }
    1.83  
    1.84 -static inline int HYPERVISOR_set_gdt(unsigned long *frame_list, int entries)
    1.85 +static inline int
    1.86 +HYPERVISOR_set_gdt(unsigned long *frame_list, int entries)
    1.87  {
    1.88      int ret;
    1.89 +    unsigned long ign1, ign2;
    1.90 +
    1.91      __asm__ __volatile__ (
    1.92          TRAP_INSTR
    1.93 -        : "=a" (ret) : "0" (__HYPERVISOR_set_gdt), 
    1.94 -        "b" (frame_list), "c" (entries) : "memory" );
    1.95 -
    1.96 +        : "=a" (ret), "=b" (ign1), "=c" (ign2)
    1.97 +	: "0" (__HYPERVISOR_set_gdt), "1" (frame_list), "2" (entries)
    1.98 +	: "memory" );
    1.99  
   1.100      return ret;
   1.101  }
   1.102  
   1.103 -static inline int HYPERVISOR_stack_switch(unsigned long ss, unsigned long esp)
   1.104 +static inline int
   1.105 +HYPERVISOR_stack_switch(unsigned long ss, unsigned long esp)
   1.106  {
   1.107      int ret;
   1.108 +    unsigned long ign1, ign2;
   1.109 +
   1.110      __asm__ __volatile__ (
   1.111          TRAP_INSTR
   1.112 -        : "=a" (ret) : "0" (__HYPERVISOR_stack_switch),
   1.113 -        "b" (ss), "c" (esp) : "memory" );
   1.114 +        : "=a" (ret), "=b" (ign1), "=c" (ign2)
   1.115 +	: "0" (__HYPERVISOR_stack_switch), "1" (ss), "2" (esp)
   1.116 +	: "memory" );
   1.117  
   1.118      return ret;
   1.119  }
   1.120  
   1.121 -static inline int HYPERVISOR_set_callbacks(
   1.122 +static inline int
   1.123 +HYPERVISOR_set_callbacks(
   1.124      unsigned long event_selector, unsigned long event_address,
   1.125      unsigned long failsafe_selector, unsigned long failsafe_address)
   1.126  {
   1.127      int ret;
   1.128 +    unsigned long ign1, ign2, ign3, ign4;
   1.129 +
   1.130      __asm__ __volatile__ (
   1.131          TRAP_INSTR
   1.132 -        : "=a" (ret) : "0" (__HYPERVISOR_set_callbacks),
   1.133 -        "b" (event_selector), "c" (event_address), 
   1.134 -        "d" (failsafe_selector), "S" (failsafe_address) : "memory" );
   1.135 +        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
   1.136 +	: "0" (__HYPERVISOR_set_callbacks), "1" (event_selector),
   1.137 +	  "2" (event_address), "3" (failsafe_selector), "4" (failsafe_address)
   1.138 +	: "memory" );
   1.139  
   1.140      return ret;
   1.141  }
   1.142  
   1.143 -static inline int HYPERVISOR_fpu_taskswitch(void)
   1.144 +static inline int
   1.145 +HYPERVISOR_fpu_taskswitch(void)
   1.146  {
   1.147      int ret;
   1.148      __asm__ __volatile__ (
   1.149 @@ -170,170 +190,226 @@ static inline int HYPERVISOR_fpu_taskswi
   1.150      return ret;
   1.151  }
   1.152  
   1.153 -static inline int HYPERVISOR_yield(void)
   1.154 +static inline int
   1.155 +HYPERVISOR_yield(void)
   1.156  {
   1.157      int ret;
   1.158 +    unsigned long ign1;
   1.159 +
   1.160      __asm__ __volatile__ (
   1.161          TRAP_INSTR
   1.162 -        : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
   1.163 -        "b" (SCHEDOP_yield) : "memory" );
   1.164 +        : "=a" (ret), "=b" (ign1)
   1.165 +	: "0" (__HYPERVISOR_sched_op), "1" (SCHEDOP_yield)
   1.166 +	: "memory" );
   1.167  
   1.168      return ret;
   1.169  }
   1.170  
   1.171 -static inline int HYPERVISOR_block(void)
   1.172 +static inline int
   1.173 +HYPERVISOR_block(void)
   1.174  {
   1.175      int ret;
   1.176 +    unsigned long ign1;
   1.177 +
   1.178      __asm__ __volatile__ (
   1.179          TRAP_INSTR
   1.180 -        : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
   1.181 -        "b" (SCHEDOP_block) : "memory" );
   1.182 +        : "=a" (ret), "=b" (ign1)
   1.183 +	: "0" (__HYPERVISOR_sched_op), "1" (SCHEDOP_block)
   1.184 +	: "memory" );
   1.185  
   1.186      return ret;
   1.187  }
   1.188  
   1.189 -static inline int HYPERVISOR_shutdown(void)
   1.190 +static inline int
   1.191 +HYPERVISOR_shutdown(void)
   1.192  {
   1.193      int ret;
   1.194 +    unsigned long ign1;
   1.195 +
   1.196      __asm__ __volatile__ (
   1.197          TRAP_INSTR
   1.198 -        : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
   1.199 -        "b" (SCHEDOP_shutdown | (SHUTDOWN_poweroff << SCHEDOP_reasonshift))
   1.200 +        : "=a" (ret), "=b" (ign1)
   1.201 +	: "0" (__HYPERVISOR_sched_op),
   1.202 +	  "1" (SCHEDOP_shutdown | (SHUTDOWN_poweroff << SCHEDOP_reasonshift))
   1.203          : "memory" );
   1.204  
   1.205      return ret;
   1.206  }
   1.207  
   1.208 -static inline int HYPERVISOR_reboot(void)
   1.209 +static inline int
   1.210 +HYPERVISOR_reboot(void)
   1.211  {
   1.212      int ret;
   1.213 +    unsigned long ign1;
   1.214 +
   1.215      __asm__ __volatile__ (
   1.216          TRAP_INSTR
   1.217 -        : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
   1.218 -        "b" (SCHEDOP_shutdown | (SHUTDOWN_reboot << SCHEDOP_reasonshift))
   1.219 +        : "=a" (ret), "=b" (ign1)
   1.220 +	: "0" (__HYPERVISOR_sched_op),
   1.221 +	  "1" (SCHEDOP_shutdown | (SHUTDOWN_reboot << SCHEDOP_reasonshift))
   1.222          : "memory" );
   1.223  
   1.224      return ret;
   1.225  }
   1.226  
   1.227 -static inline int HYPERVISOR_suspend(unsigned long srec)
   1.228 +static inline int
   1.229 +HYPERVISOR_suspend(unsigned long srec)
   1.230  {
   1.231      int ret;
   1.232 +    unsigned long ign1, ign2;
   1.233 +
   1.234      /* NB. On suspend, control software expects a suspend record in %esi. */
   1.235      __asm__ __volatile__ (
   1.236          TRAP_INSTR
   1.237 -        : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
   1.238 +        : "=a" (ret), "=b" (ign1), "=S" (ign2)
   1.239 +	: "0" (__HYPERVISOR_sched_op),
   1.240          "b" (SCHEDOP_shutdown | (SHUTDOWN_suspend << SCHEDOP_reasonshift)), 
   1.241 -        "S" (srec) : "memory" );
   1.242 +        "S" (srec) : "memory");
   1.243  
   1.244      return ret;
   1.245  }
   1.246  
   1.247 -static inline long HYPERVISOR_set_timer_op(uint64_t timeout)
   1.248 +static inline long
   1.249 +HYPERVISOR_set_timer_op(uint64_t timeout)
   1.250  {
   1.251      int ret;
   1.252      unsigned long timeout_hi = (unsigned long)(timeout>>32);
   1.253      unsigned long timeout_lo = (unsigned long)timeout;
   1.254 +    unsigned long ign1, ign2;
   1.255 +
   1.256      __asm__ __volatile__ (
   1.257          TRAP_INSTR
   1.258 -        : "=a" (ret) : "0" (__HYPERVISOR_set_timer_op),
   1.259 -        "b" (timeout_hi), "c" (timeout_lo) : "memory" );
   1.260 +        : "=a" (ret), "=b" (ign1), "=c" (ign2)
   1.261 +	: "0" (__HYPERVISOR_set_timer_op), "b" (timeout_hi), "c" (timeout_lo)
   1.262 +	: "memory");
   1.263  
   1.264      return ret;
   1.265  }
   1.266  
   1.267 -static inline int HYPERVISOR_dom0_op(dom0_op_t *dom0_op)
   1.268 +static inline int
   1.269 +HYPERVISOR_dom0_op(dom0_op_t *dom0_op)
   1.270  {
   1.271      int ret;
   1.272 +    unsigned long ign1;
   1.273 +
   1.274      dom0_op->interface_version = DOM0_INTERFACE_VERSION;
   1.275      __asm__ __volatile__ (
   1.276          TRAP_INSTR
   1.277 -        : "=a" (ret) : "0" (__HYPERVISOR_dom0_op),
   1.278 -        "b" (dom0_op) : "memory" );
   1.279 +        : "=a" (ret), "=b" (ign1)
   1.280 +	: "0" (__HYPERVISOR_dom0_op), "1" (dom0_op)
   1.281 +	: "memory");
   1.282  
   1.283      return ret;
   1.284  }
   1.285  
   1.286 -static inline int HYPERVISOR_set_debugreg(int reg, unsigned long value)
   1.287 +static inline int
   1.288 +HYPERVISOR_set_debugreg(int reg, unsigned long value)
   1.289  {
   1.290      int ret;
   1.291 +    unsigned long ign1, ign2;
   1.292 +
   1.293      __asm__ __volatile__ (
   1.294          TRAP_INSTR
   1.295 -        : "=a" (ret) : "0" (__HYPERVISOR_set_debugreg),
   1.296 -        "b" (reg), "c" (value) : "memory" );
   1.297 +        : "=a" (ret), "=b" (ign1), "=c" (ign2)
   1.298 +	: "0" (__HYPERVISOR_set_debugreg), "1" (reg), "2" (value)
   1.299 +	: "memory" );
   1.300  
   1.301      return ret;
   1.302  }
   1.303  
   1.304 -static inline unsigned long HYPERVISOR_get_debugreg(int reg)
   1.305 +static inline unsigned long
   1.306 +HYPERVISOR_get_debugreg(int reg)
   1.307  {
   1.308      unsigned long ret;
   1.309 +    unsigned long ign1;
   1.310 +
   1.311      __asm__ __volatile__ (
   1.312          TRAP_INSTR
   1.313 -        : "=a" (ret) : "0" (__HYPERVISOR_get_debugreg),
   1.314 -        "b" (reg) : "memory" );
   1.315 +        : "=a" (ret), "=b" (ign1)
   1.316 +	: "0" (__HYPERVISOR_get_debugreg), "1" (reg)
   1.317 +	: "memory" );
   1.318  
   1.319      return ret;
   1.320  }
   1.321  
   1.322 -static inline int HYPERVISOR_update_descriptor(
   1.323 -    unsigned long pa, unsigned long word1, unsigned long word2)
   1.324 +static inline int
   1.325 +HYPERVISOR_update_descriptor(unsigned long pa, unsigned long word1,
   1.326 +    unsigned long word2)
   1.327  {
   1.328      int ret;
   1.329 +    unsigned long ign1, ign2, ign3;
   1.330 +
   1.331      __asm__ __volatile__ (
   1.332          TRAP_INSTR
   1.333 -        : "=a" (ret) : "0" (__HYPERVISOR_update_descriptor), 
   1.334 -        "b" (pa), "c" (word1), "d" (word2) : "memory" );
   1.335 +        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
   1.336 +	: "0" (__HYPERVISOR_update_descriptor), "1" (pa), "2" (word1),
   1.337 +	  "3" (word2)
   1.338 +	: "memory" );
   1.339  
   1.340      return ret;
   1.341  }
   1.342  
   1.343 -static inline int HYPERVISOR_set_fast_trap(int idx)
   1.344 +static inline int
   1.345 +HYPERVISOR_set_fast_trap(int idx)
   1.346  {
   1.347      int ret;
   1.348 +    unsigned long ign1;
   1.349 +
   1.350      __asm__ __volatile__ (
   1.351          TRAP_INSTR
   1.352 -        : "=a" (ret) : "0" (__HYPERVISOR_set_fast_trap), 
   1.353 -        "b" (idx) : "memory" );
   1.354 +        : "=a" (ret), "=b" (ign1)
   1.355 +	: "0" (__HYPERVISOR_set_fast_trap), "1" (idx)
   1.356 +	: "memory" );
   1.357  
   1.358      return ret;
   1.359  }
   1.360  
   1.361 -static inline int HYPERVISOR_dom_mem_op(unsigned int   op,
   1.362 -                                        unsigned long *extent_list,
   1.363 -                                        unsigned long  nr_extents,
   1.364 -                                        unsigned int   extent_order)
   1.365 +static inline int
   1.366 +HYPERVISOR_dom_mem_op(unsigned int op, unsigned long *extent_list,
   1.367 +    unsigned long nr_extents, unsigned int extent_order)
   1.368  {
   1.369      int ret;
   1.370 +    unsigned long ign1, ign2, ign3, ign4, ign5;
   1.371 +
   1.372      __asm__ __volatile__ (
   1.373          TRAP_INSTR
   1.374 -        : "=a" (ret) : "0" (__HYPERVISOR_dom_mem_op),
   1.375 -        "b" (op), "c" (extent_list), "d" (nr_extents), "S" (extent_order),
   1.376 -	"D" (DOMID_SELF)
   1.377 +        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4),
   1.378 +	  "=D" (ign5)
   1.379 +	: "0" (__HYPERVISOR_dom_mem_op), "1" (op), "2" (extent_list),
   1.380 +	  "3" (nr_extents), "4" (extent_order), "5" (DOMID_SELF)
   1.381          : "memory" );
   1.382  
   1.383      return ret;
   1.384  }
   1.385  
   1.386 -static inline int HYPERVISOR_multicall(void *call_list, int nr_calls)
   1.387 +static inline int
   1.388 +HYPERVISOR_multicall(void *call_list, int nr_calls)
   1.389  {
   1.390      int ret;
   1.391 +    unsigned long ign1, ign2;
   1.392 +
   1.393      __asm__ __volatile__ (
   1.394          TRAP_INSTR
   1.395 -        : "=a" (ret) : "0" (__HYPERVISOR_multicall),
   1.396 -        "b" (call_list), "c" (nr_calls) : "memory" );
   1.397 +        : "=a" (ret), "=b" (ign1), "=c" (ign2)
   1.398 +	: "0" (__HYPERVISOR_multicall), "1" (call_list), "2" (nr_calls)
   1.399 +	: "memory" );
   1.400  
   1.401      return ret;
   1.402  }
   1.403  
   1.404 -static inline int HYPERVISOR_update_va_mapping(
   1.405 -    unsigned long page_nr, unsigned long new_val, unsigned long flags)
   1.406 +static inline int
   1.407 +HYPERVISOR_update_va_mapping(unsigned long page_nr, unsigned long new_val,
   1.408 +    unsigned long flags)
   1.409  {
   1.410      int ret;
   1.411 +    unsigned long ign1, ign2, ign3;
   1.412 +
   1.413      __asm__ __volatile__ (
   1.414          TRAP_INSTR
   1.415 -        : "=a" (ret) : "0" (__HYPERVISOR_update_va_mapping), 
   1.416 -        "b" (page_nr), "c" (new_val), "d" (flags) : "memory" );
   1.417 +        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
   1.418 +	: "0" (__HYPERVISOR_update_va_mapping), 
   1.419 +          "1" (page_nr), "2" (new_val), "3" (flags)
   1.420 +	: "memory" );
   1.421  
   1.422      if (__predict_false(ret < 0))
   1.423          panic("Failed update VA mapping: %08lx, %08lx, %08lx",
   1.424 @@ -342,81 +418,109 @@ static inline int HYPERVISOR_update_va_m
   1.425      return ret;
   1.426  }
   1.427  
   1.428 -static inline int HYPERVISOR_event_channel_op(void *op)
   1.429 +static inline int
   1.430 +HYPERVISOR_event_channel_op(void *op)
   1.431  {
   1.432      int ret;
   1.433 +    unsigned long ign1;
   1.434 +
   1.435      __asm__ __volatile__ (
   1.436          TRAP_INSTR
   1.437 -        : "=a" (ret) : "0" (__HYPERVISOR_event_channel_op),
   1.438 -        "b" (op) : "memory" );
   1.439 +        : "=a" (ret), "=b" (ign1)
   1.440 +	: "0" (__HYPERVISOR_event_channel_op), "1" (op)
   1.441 +	: "memory" );
   1.442  
   1.443      return ret;
   1.444  }
   1.445  
   1.446 -static inline int HYPERVISOR_xen_version(int cmd)
   1.447 +static inline int
   1.448 +HYPERVISOR_xen_version(int cmd)
   1.449  {
   1.450      int ret;
   1.451 +    unsigned long ign1;
   1.452 +
   1.453      __asm__ __volatile__ (
   1.454          TRAP_INSTR
   1.455 -        : "=a" (ret) : "0" (__HYPERVISOR_xen_version), 
   1.456 -        "b" (cmd) : "memory" );
   1.457 +        : "=a" (ret), "=b" (ign1)
   1.458 +	: "0" (__HYPERVISOR_xen_version), "1" (cmd)
   1.459 +	: "memory" );
   1.460  
   1.461      return ret;
   1.462  }
   1.463  
   1.464 -static inline int HYPERVISOR_console_io(int cmd, int count, char *str)
   1.465 +static inline int
   1.466 +HYPERVISOR_console_io(int cmd, int count, char *str)
   1.467  {
   1.468      int ret;
   1.469 +    unsigned long ign1, ign2, ign3;
   1.470 +
   1.471      __asm__ __volatile__ (
   1.472          TRAP_INSTR
   1.473 -        : "=a" (ret) : "0" (__HYPERVISOR_console_io),
   1.474 -        "b" (cmd), "c" (count), "d" (str) : "memory" );
   1.475 +        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
   1.476 +	: "0" (__HYPERVISOR_console_io), "1" (cmd), "2" (count), "3" (str)
   1.477 +	: "memory" );
   1.478  
   1.479      return ret;
   1.480  }
   1.481  
   1.482 -static inline int HYPERVISOR_physdev_op(void *physdev_op)
   1.483 +static inline int
   1.484 +HYPERVISOR_physdev_op(void *physdev_op)
   1.485  {
   1.486      int ret;
   1.487 +    unsigned long ign1;
   1.488 +
   1.489      __asm__ __volatile__ (
   1.490          TRAP_INSTR
   1.491 -        : "=a" (ret) : "0" (__HYPERVISOR_physdev_op),
   1.492 -        "b" (physdev_op) : "memory" );
   1.493 +        : "=a" (ret), "=b" (ign1)
   1.494 +	: "0" (__HYPERVISOR_physdev_op), "1" (physdev_op)
   1.495 +	: "memory" );
   1.496  
   1.497      return ret;
   1.498  }
   1.499  
   1.500 -static inline int HYPERVISOR_grant_table_op(void *gnttab_op)
   1.501 +static inline int
   1.502 +HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
   1.503  {
   1.504      int ret;
   1.505 +    unsigned long ign1, ign2, ign3;
   1.506 +
   1.507      __asm__ __volatile__ (
   1.508          TRAP_INSTR
   1.509 -        : "=a" (ret) : "0" (__HYPERVISOR_grant_table_op),
   1.510 -        "b" (gnttab_op) : "memory" );
   1.511 +        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
   1.512 +	: "0" (__HYPERVISOR_grant_table_op), "1" (cmd), "2" (count), "3" (uop)
   1.513 +	: "memory" );
   1.514  
   1.515      return ret;
   1.516  }
   1.517  
   1.518 -static inline int HYPERVISOR_update_va_mapping_otherdomain(
   1.519 -    unsigned long page_nr, unsigned long new_val, unsigned long flags, domid_t domid)
   1.520 +static inline int
   1.521 +HYPERVISOR_update_va_mapping_otherdomain(unsigned long page_nr,
   1.522 +    unsigned long new_val, unsigned long flags, domid_t domid)
   1.523  {
   1.524      int ret;
   1.525 +    unsigned long ign1, ign2, ign3, ign4;
   1.526 +
   1.527      __asm__ __volatile__ (
   1.528          TRAP_INSTR
   1.529 -        : "=a" (ret) : "0" (__HYPERVISOR_update_va_mapping_otherdomain), 
   1.530 -        "b" (page_nr), "c" (new_val), "d" (flags), "S" (domid) :
   1.531 +        : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
   1.532 +	: "0" (__HYPERVISOR_update_va_mapping_otherdomain),
   1.533 +          "1" (page_nr), "2" (new_val), "3" (flags), "4" (domid) :
   1.534          "memory" );
   1.535      
   1.536      return ret;
   1.537  }
   1.538  
   1.539 -static inline int HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type)
   1.540 +static inline int
   1.541 +HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type)
   1.542  {
   1.543      int ret;
   1.544 +    unsigned long ign1, ign2;
   1.545 +
   1.546      __asm__ __volatile__ (
   1.547          TRAP_INSTR
   1.548 -        : "=a" (ret) : "0" (__HYPERVISOR_vm_assist),
   1.549 -        "b" (cmd), "c" (type) : "memory" );
   1.550 +        : "=a" (ret), "=b" (ign1), "=c" (ign2)
   1.551 +	: "0" (__HYPERVISOR_vm_assist), "1" (cmd), "2" (type)
   1.552 +	: "memory" );
   1.553  
   1.554      return ret;
   1.555  }