Home | History | Annotate | Line # | Download | only in include
hypervisor.h revision 1.10.2.4
      1  1.10.2.4     snj /*	$NetBSD: hypervisor.h,v 1.10.2.4 2005/05/22 19:27:28 snj Exp $	*/
      2       1.1      cl 
      3       1.1      cl /*
      4       1.1      cl  *
      5       1.1      cl  * Communication to/from hypervisor.
      6       1.1      cl  *
      7      1.10  bouyer  * Copyright (c) 2002-2004, K A Fraser
      8       1.1      cl  *
      9       1.1      cl  * Permission is hereby granted, free of charge, to any person obtaining a copy
     10      1.10  bouyer  * of this source file (the "Software"), to deal in the Software without
     11      1.10  bouyer  * restriction, including without limitation the rights to use, copy, modify,
     12      1.10  bouyer  * merge, publish, distribute, sublicense, and/or sell copies of the Software,
     13      1.10  bouyer  * and to permit persons to whom the Software is furnished to do so, subject to
     14      1.10  bouyer  * the following conditions:
     15       1.1      cl  *
     16       1.1      cl  * The above copyright notice and this permission notice shall be included in
     17       1.1      cl  * all copies or substantial portions of the Software.
     18       1.1      cl  *
     19      1.10  bouyer  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     20      1.10  bouyer  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     21      1.10  bouyer  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     22      1.10  bouyer  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     23      1.10  bouyer  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     24      1.10  bouyer  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
     25      1.10  bouyer  * IN THE SOFTWARE.
     26       1.1      cl  */
     27       1.1      cl 
     28       1.1      cl 
     29       1.1      cl #ifndef _XEN_HYPERVISOR_H_
     30       1.1      cl #define _XEN_HYPERVISOR_H_
     31       1.1      cl 
     32       1.1      cl 
     33       1.4      cl struct hypervisor_attach_args {
     34       1.4      cl 	const char 		*haa_busname;
     35       1.4      cl };
     36       1.4      cl 
     37       1.5      cl struct xencons_attach_args {
     38       1.4      cl 	const char 		*xa_device;
     39       1.1      cl };
     40       1.1      cl 
     41       1.1      cl struct xen_npx_attach_args {
     42       1.4      cl 	const char 		*xa_device;
     43       1.1      cl };
     44       1.1      cl 
     45       1.1      cl 
     46      1.10  bouyer #define	u8 uint8_t
     47       1.8      cl #define	u16 uint16_t
     48       1.8      cl #define	u32 uint32_t
     49       1.8      cl #define	u64 uint64_t
     50      1.10  bouyer #define	s8 int8_t
     51      1.10  bouyer #define	s16 int16_t
     52      1.10  bouyer #define	s32 int32_t
     53      1.10  bouyer #define	s64 int64_t
     54      1.10  bouyer 
     55      1.10  bouyer #include <machine/xen-public/xen.h>
     56      1.10  bouyer #include <machine/xen-public/dom0_ops.h>
     57      1.10  bouyer #include <machine/xen-public/event_channel.h>
     58      1.10  bouyer #include <machine/xen-public/physdev.h>
     59      1.10  bouyer #include <machine/xen-public/io/domain_controller.h>
     60      1.10  bouyer #include <machine/xen-public/io/netif.h>
     61      1.10  bouyer #include <machine/xen-public/io/blkif.h>
     62       1.8      cl 
     63      1.10  bouyer #undef u8
     64       1.8      cl #undef u16
     65       1.8      cl #undef u32
     66       1.8      cl #undef u64
     67      1.10  bouyer #undef s8
     68      1.10  bouyer #undef s16
     69      1.10  bouyer #undef s32
     70      1.10  bouyer #undef s64
     71       1.1      cl 
     72       1.1      cl 
     73       1.1      cl /*
     74       1.1      cl  * a placeholder for the start of day information passed up from the hypervisor
     75       1.1      cl  */
     76       1.1      cl union start_info_union
     77       1.1      cl {
     78       1.1      cl     start_info_t start_info;
     79       1.1      cl     char padding[512];
     80       1.1      cl };
     81       1.1      cl extern union start_info_union start_info_union;
     82       1.1      cl #define xen_start_info (start_info_union.start_info)
     83       1.1      cl 
     84       1.1      cl 
     85       1.1      cl /* hypervisor.c */
     86      1.10  bouyer struct intrframe;
     87      1.10  bouyer void do_hypervisor_callback(struct intrframe *regs);
     88      1.10  bouyer void hypervisor_notify_via_evtchn(unsigned int);
     89  1.10.2.1    tron void hypervisor_enable_event(unsigned int);
     90      1.10  bouyer 
     91      1.10  bouyer /* hypervisor_machdep.c */
     92      1.10  bouyer void hypervisor_unmask_event(unsigned int);
     93      1.10  bouyer void hypervisor_mask_event(unsigned int);
     94      1.10  bouyer void hypervisor_clear_event(unsigned int);
     95  1.10.2.4     snj void hypervisor_force_callback(void)
     96  1.10.2.4     snj     __attribute__((no_instrument_function)); /* used by mcount */
     97  1.10.2.2    tron void hypervisor_enable_ipl(unsigned int);
     98  1.10.2.3    tron void hypervisor_set_ipending(u_int32_t, int, int);
     99       1.1      cl 
    100       1.1      cl /*
    101       1.1      cl  * Assembler stubs for hyper-calls.
    102       1.1      cl  */
    103       1.1      cl 
    104      1.10  bouyer static inline int
    105      1.10  bouyer HYPERVISOR_set_trap_table(trap_info_t *table)
    106       1.1      cl {
    107       1.1      cl     int ret;
    108      1.10  bouyer     unsigned long ign1;
    109      1.10  bouyer 
    110       1.1      cl     __asm__ __volatile__ (
    111       1.1      cl         TRAP_INSTR
    112      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    113      1.10  bouyer 	: "0" (__HYPERVISOR_set_trap_table), "1" (table)
    114      1.10  bouyer 	: "memory" );
    115       1.1      cl 
    116       1.1      cl     return ret;
    117       1.1      cl }
    118       1.1      cl 
    119      1.10  bouyer static inline int
    120      1.10  bouyer HYPERVISOR_mmu_update(mmu_update_t *req, int count, int *success_count)
    121       1.1      cl {
    122       1.1      cl     int ret;
    123      1.10  bouyer     unsigned long ign1, ign2, ign3;
    124      1.10  bouyer 
    125       1.1      cl     __asm__ __volatile__ (
    126       1.1      cl         TRAP_INSTR
    127      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
    128      1.10  bouyer 	: "0" (__HYPERVISOR_mmu_update), "1" (req), "2" (count),
    129      1.10  bouyer 	  "3" (success_count)
    130      1.10  bouyer 	: "memory" );
    131      1.10  bouyer 
    132      1.10  bouyer     return ret;
    133      1.10  bouyer }
    134       1.1      cl 
    135      1.10  bouyer static inline int
    136      1.10  bouyer HYPERVISOR_set_gdt(unsigned long *frame_list, int entries)
    137      1.10  bouyer {
    138      1.10  bouyer     int ret;
    139      1.10  bouyer     unsigned long ign1, ign2;
    140      1.10  bouyer 
    141      1.10  bouyer     __asm__ __volatile__ (
    142      1.10  bouyer         TRAP_INSTR
    143      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2)
    144      1.10  bouyer 	: "0" (__HYPERVISOR_set_gdt), "1" (frame_list), "2" (entries)
    145      1.10  bouyer 	: "memory" );
    146       1.2      cl 
    147       1.1      cl     return ret;
    148       1.1      cl }
    149       1.1      cl 
    150      1.10  bouyer static inline int
    151      1.10  bouyer HYPERVISOR_stack_switch(unsigned long ss, unsigned long esp)
    152       1.7      cl {
    153       1.7      cl     int ret;
    154      1.10  bouyer     unsigned long ign1, ign2;
    155      1.10  bouyer 
    156       1.7      cl     __asm__ __volatile__ (
    157       1.7      cl         TRAP_INSTR
    158      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2)
    159      1.10  bouyer 	: "0" (__HYPERVISOR_stack_switch), "1" (ss), "2" (esp)
    160      1.10  bouyer 	: "memory" );
    161       1.7      cl 
    162       1.7      cl     return ret;
    163       1.7      cl }
    164       1.7      cl 
    165      1.10  bouyer static inline int
    166      1.10  bouyer HYPERVISOR_set_callbacks(
    167      1.10  bouyer     unsigned long event_selector, unsigned long event_address,
    168      1.10  bouyer     unsigned long failsafe_selector, unsigned long failsafe_address)
    169       1.1      cl {
    170       1.1      cl     int ret;
    171      1.10  bouyer     unsigned long ign1, ign2, ign3, ign4;
    172      1.10  bouyer 
    173       1.1      cl     __asm__ __volatile__ (
    174       1.1      cl         TRAP_INSTR
    175      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
    176      1.10  bouyer 	: "0" (__HYPERVISOR_set_callbacks), "1" (event_selector),
    177      1.10  bouyer 	  "2" (event_address), "3" (failsafe_selector), "4" (failsafe_address)
    178      1.10  bouyer 	: "memory" );
    179       1.1      cl 
    180      1.10  bouyer     return ret;
    181      1.10  bouyer }
    182      1.10  bouyer 
    183      1.10  bouyer static inline int
    184      1.10  bouyer HYPERVISOR_fpu_taskswitch(void)
    185      1.10  bouyer {
    186      1.10  bouyer     int ret;
    187      1.10  bouyer     __asm__ __volatile__ (
    188      1.10  bouyer         TRAP_INSTR
    189      1.10  bouyer         : "=a" (ret) : "0" (__HYPERVISOR_fpu_taskswitch) : "memory" );
    190       1.1      cl 
    191       1.1      cl     return ret;
    192       1.1      cl }
    193       1.1      cl 
    194      1.10  bouyer static inline int
    195      1.10  bouyer HYPERVISOR_yield(void)
    196       1.1      cl {
    197       1.1      cl     int ret;
    198      1.10  bouyer     unsigned long ign1;
    199      1.10  bouyer 
    200       1.1      cl     __asm__ __volatile__ (
    201       1.1      cl         TRAP_INSTR
    202      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    203      1.10  bouyer 	: "0" (__HYPERVISOR_sched_op), "1" (SCHEDOP_yield)
    204      1.10  bouyer 	: "memory" );
    205      1.10  bouyer 
    206      1.10  bouyer     return ret;
    207      1.10  bouyer }
    208      1.10  bouyer 
    209      1.10  bouyer static inline int
    210      1.10  bouyer HYPERVISOR_block(void)
    211      1.10  bouyer {
    212      1.10  bouyer     int ret;
    213      1.10  bouyer     unsigned long ign1;
    214       1.1      cl 
    215      1.10  bouyer     __asm__ __volatile__ (
    216      1.10  bouyer         TRAP_INSTR
    217      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    218      1.10  bouyer 	: "0" (__HYPERVISOR_sched_op), "1" (SCHEDOP_block)
    219      1.10  bouyer 	: "memory" );
    220       1.1      cl 
    221       1.1      cl     return ret;
    222       1.1      cl }
    223       1.1      cl 
    224      1.10  bouyer static inline int
    225      1.10  bouyer HYPERVISOR_shutdown(void)
    226       1.1      cl {
    227       1.1      cl     int ret;
    228      1.10  bouyer     unsigned long ign1;
    229      1.10  bouyer 
    230       1.1      cl     __asm__ __volatile__ (
    231       1.1      cl         TRAP_INSTR
    232      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    233      1.10  bouyer 	: "0" (__HYPERVISOR_sched_op),
    234      1.10  bouyer 	  "1" (SCHEDOP_shutdown | (SHUTDOWN_poweroff << SCHEDOP_reasonshift))
    235      1.10  bouyer         : "memory" );
    236       1.1      cl 
    237       1.1      cl     return ret;
    238       1.1      cl }
    239       1.1      cl 
    240      1.10  bouyer static inline int
    241      1.10  bouyer HYPERVISOR_reboot(void)
    242       1.1      cl {
    243       1.1      cl     int ret;
    244      1.10  bouyer     unsigned long ign1;
    245      1.10  bouyer 
    246       1.1      cl     __asm__ __volatile__ (
    247       1.1      cl         TRAP_INSTR
    248      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    249      1.10  bouyer 	: "0" (__HYPERVISOR_sched_op),
    250      1.10  bouyer 	  "1" (SCHEDOP_shutdown | (SHUTDOWN_reboot << SCHEDOP_reasonshift))
    251      1.10  bouyer         : "memory" );
    252       1.1      cl 
    253       1.1      cl     return ret;
    254       1.1      cl }
    255       1.1      cl 
    256      1.10  bouyer static inline int
    257      1.10  bouyer HYPERVISOR_suspend(unsigned long srec)
    258       1.1      cl {
    259       1.1      cl     int ret;
    260      1.10  bouyer     unsigned long ign1, ign2;
    261      1.10  bouyer 
    262      1.10  bouyer     /* NB. On suspend, control software expects a suspend record in %esi. */
    263       1.1      cl     __asm__ __volatile__ (
    264       1.1      cl         TRAP_INSTR
    265      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=S" (ign2)
    266      1.10  bouyer 	: "0" (__HYPERVISOR_sched_op),
    267      1.10  bouyer         "b" (SCHEDOP_shutdown | (SHUTDOWN_suspend << SCHEDOP_reasonshift)),
    268      1.10  bouyer         "S" (srec) : "memory");
    269       1.1      cl 
    270       1.1      cl     return ret;
    271       1.1      cl }
    272       1.1      cl 
    273      1.10  bouyer static inline long
    274      1.10  bouyer HYPERVISOR_set_timer_op(uint64_t timeout)
    275       1.1      cl {
    276       1.1      cl     int ret;
    277      1.10  bouyer     unsigned long timeout_hi = (unsigned long)(timeout>>32);
    278      1.10  bouyer     unsigned long timeout_lo = (unsigned long)timeout;
    279      1.10  bouyer     unsigned long ign1, ign2;
    280      1.10  bouyer 
    281       1.1      cl     __asm__ __volatile__ (
    282       1.1      cl         TRAP_INSTR
    283      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2)
    284      1.10  bouyer 	: "0" (__HYPERVISOR_set_timer_op), "b" (timeout_hi), "c" (timeout_lo)
    285      1.10  bouyer 	: "memory");
    286       1.1      cl 
    287       1.1      cl     return ret;
    288       1.1      cl }
    289       1.1      cl 
    290      1.10  bouyer static inline int
    291      1.10  bouyer HYPERVISOR_dom0_op(dom0_op_t *dom0_op)
    292       1.1      cl {
    293       1.1      cl     int ret;
    294      1.10  bouyer     unsigned long ign1;
    295      1.10  bouyer 
    296      1.10  bouyer     dom0_op->interface_version = DOM0_INTERFACE_VERSION;
    297       1.1      cl     __asm__ __volatile__ (
    298       1.1      cl         TRAP_INSTR
    299      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    300      1.10  bouyer 	: "0" (__HYPERVISOR_dom0_op), "1" (dom0_op)
    301      1.10  bouyer 	: "memory");
    302       1.1      cl 
    303       1.1      cl     return ret;
    304       1.1      cl }
    305       1.1      cl 
    306      1.10  bouyer static inline int
    307      1.10  bouyer HYPERVISOR_set_debugreg(int reg, unsigned long value)
    308       1.1      cl {
    309       1.1      cl     int ret;
    310      1.10  bouyer     unsigned long ign1, ign2;
    311      1.10  bouyer 
    312       1.1      cl     __asm__ __volatile__ (
    313       1.1      cl         TRAP_INSTR
    314      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2)
    315      1.10  bouyer 	: "0" (__HYPERVISOR_set_debugreg), "1" (reg), "2" (value)
    316      1.10  bouyer 	: "memory" );
    317       1.1      cl 
    318       1.1      cl     return ret;
    319       1.1      cl }
    320       1.1      cl 
    321      1.10  bouyer static inline unsigned long
    322      1.10  bouyer HYPERVISOR_get_debugreg(int reg)
    323       1.1      cl {
    324      1.10  bouyer     unsigned long ret;
    325      1.10  bouyer     unsigned long ign1;
    326      1.10  bouyer 
    327       1.1      cl     __asm__ __volatile__ (
    328       1.1      cl         TRAP_INSTR
    329      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    330      1.10  bouyer 	: "0" (__HYPERVISOR_get_debugreg), "1" (reg)
    331      1.10  bouyer 	: "memory" );
    332       1.1      cl 
    333       1.1      cl     return ret;
    334       1.1      cl }
    335       1.1      cl 
    336      1.10  bouyer static inline int
    337      1.10  bouyer HYPERVISOR_update_descriptor(unsigned long pa, unsigned long word1,
    338      1.10  bouyer     unsigned long word2)
    339       1.1      cl {
    340       1.1      cl     int ret;
    341      1.10  bouyer     unsigned long ign1, ign2, ign3;
    342      1.10  bouyer 
    343       1.1      cl     __asm__ __volatile__ (
    344       1.1      cl         TRAP_INSTR
    345      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
    346      1.10  bouyer 	: "0" (__HYPERVISOR_update_descriptor), "1" (pa), "2" (word1),
    347      1.10  bouyer 	  "3" (word2)
    348      1.10  bouyer 	: "memory" );
    349       1.1      cl 
    350       1.1      cl     return ret;
    351       1.1      cl }
    352       1.1      cl 
    353      1.10  bouyer static inline int
    354      1.10  bouyer HYPERVISOR_set_fast_trap(int idx)
    355       1.1      cl {
    356       1.1      cl     int ret;
    357      1.10  bouyer     unsigned long ign1;
    358      1.10  bouyer 
    359       1.1      cl     __asm__ __volatile__ (
    360       1.1      cl         TRAP_INSTR
    361      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    362      1.10  bouyer 	: "0" (__HYPERVISOR_set_fast_trap), "1" (idx)
    363      1.10  bouyer 	: "memory" );
    364       1.1      cl 
    365       1.1      cl     return ret;
    366       1.1      cl }
    367       1.1      cl 
    368      1.10  bouyer static inline int
    369      1.10  bouyer HYPERVISOR_dom_mem_op(unsigned int op, unsigned long *extent_list,
    370      1.10  bouyer     unsigned long nr_extents, unsigned int extent_order)
    371       1.1      cl {
    372       1.1      cl     int ret;
    373      1.10  bouyer     unsigned long ign1, ign2, ign3, ign4, ign5;
    374      1.10  bouyer 
    375       1.1      cl     __asm__ __volatile__ (
    376       1.1      cl         TRAP_INSTR
    377      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4),
    378      1.10  bouyer 	  "=D" (ign5)
    379      1.10  bouyer 	: "0" (__HYPERVISOR_dom_mem_op), "1" (op), "2" (extent_list),
    380      1.10  bouyer 	  "3" (nr_extents), "4" (extent_order), "5" (DOMID_SELF)
    381      1.10  bouyer         : "memory" );
    382       1.1      cl 
    383       1.1      cl     return ret;
    384       1.1      cl }
    385       1.1      cl 
    386      1.10  bouyer static inline int
    387      1.10  bouyer HYPERVISOR_multicall(void *call_list, int nr_calls)
    388       1.1      cl {
    389       1.1      cl     int ret;
    390      1.10  bouyer     unsigned long ign1, ign2;
    391      1.10  bouyer 
    392       1.1      cl     __asm__ __volatile__ (
    393       1.1      cl         TRAP_INSTR
    394      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2)
    395      1.10  bouyer 	: "0" (__HYPERVISOR_multicall), "1" (call_list), "2" (nr_calls)
    396      1.10  bouyer 	: "memory" );
    397       1.1      cl 
    398       1.1      cl     return ret;
    399       1.1      cl }
    400       1.1      cl 
    401      1.10  bouyer static inline int
    402      1.10  bouyer HYPERVISOR_update_va_mapping(unsigned long page_nr, unsigned long new_val,
    403      1.10  bouyer     unsigned long flags)
    404       1.1      cl {
    405      1.10  bouyer     int ret;
    406      1.10  bouyer     unsigned long ign1, ign2, ign3;
    407      1.10  bouyer 
    408       1.1      cl     __asm__ __volatile__ (
    409       1.1      cl         TRAP_INSTR
    410      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
    411      1.10  bouyer 	: "0" (__HYPERVISOR_update_va_mapping),
    412      1.10  bouyer           "1" (page_nr), "2" (new_val), "3" (flags)
    413      1.10  bouyer 	: "memory" );
    414      1.10  bouyer 
    415      1.10  bouyer #ifdef notdef
    416      1.10  bouyer     if (__predict_false(ret < 0))
    417      1.10  bouyer         panic("Failed update VA mapping: %08lx, %08lx, %08lx",
    418      1.10  bouyer               page_nr, new_val, flags);
    419      1.10  bouyer #endif
    420       1.1      cl 
    421       1.1      cl     return ret;
    422       1.1      cl }
    423       1.1      cl 
    424      1.10  bouyer static inline int
    425      1.10  bouyer HYPERVISOR_event_channel_op(void *op)
    426       1.1      cl {
    427       1.1      cl     int ret;
    428      1.10  bouyer     unsigned long ign1;
    429      1.10  bouyer 
    430       1.1      cl     __asm__ __volatile__ (
    431       1.1      cl         TRAP_INSTR
    432      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    433      1.10  bouyer 	: "0" (__HYPERVISOR_event_channel_op), "1" (op)
    434      1.10  bouyer 	: "memory" );
    435       1.1      cl 
    436       1.1      cl     return ret;
    437       1.1      cl }
    438       1.1      cl 
    439      1.10  bouyer static inline int
    440      1.10  bouyer HYPERVISOR_xen_version(int cmd)
    441       1.1      cl {
    442       1.1      cl     int ret;
    443      1.10  bouyer     unsigned long ign1;
    444      1.10  bouyer 
    445       1.1      cl     __asm__ __volatile__ (
    446       1.1      cl         TRAP_INSTR
    447      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    448      1.10  bouyer 	: "0" (__HYPERVISOR_xen_version), "1" (cmd)
    449      1.10  bouyer 	: "memory" );
    450       1.1      cl 
    451       1.1      cl     return ret;
    452       1.1      cl }
    453       1.1      cl 
    454      1.10  bouyer static inline int
    455      1.10  bouyer HYPERVISOR_console_io(int cmd, int count, char *str)
    456       1.1      cl {
    457       1.1      cl     int ret;
    458      1.10  bouyer     unsigned long ign1, ign2, ign3;
    459      1.10  bouyer 
    460       1.1      cl     __asm__ __volatile__ (
    461       1.1      cl         TRAP_INSTR
    462      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
    463      1.10  bouyer 	: "0" (__HYPERVISOR_console_io), "1" (cmd), "2" (count), "3" (str)
    464      1.10  bouyer 	: "memory" );
    465       1.1      cl 
    466       1.1      cl     return ret;
    467       1.1      cl }
    468       1.1      cl 
    469      1.10  bouyer static inline int
    470      1.10  bouyer HYPERVISOR_physdev_op(void *physdev_op)
    471       1.1      cl {
    472       1.1      cl     int ret;
    473      1.10  bouyer     unsigned long ign1;
    474      1.10  bouyer 
    475       1.1      cl     __asm__ __volatile__ (
    476       1.1      cl         TRAP_INSTR
    477      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    478      1.10  bouyer 	: "0" (__HYPERVISOR_physdev_op), "1" (physdev_op)
    479      1.10  bouyer 	: "memory" );
    480       1.1      cl 
    481       1.1      cl     return ret;
    482       1.1      cl }
    483       1.1      cl 
    484      1.10  bouyer static inline int
    485      1.10  bouyer HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
    486       1.1      cl {
    487       1.1      cl     int ret;
    488      1.10  bouyer     unsigned long ign1, ign2, ign3;
    489      1.10  bouyer 
    490       1.1      cl     __asm__ __volatile__ (
    491       1.1      cl         TRAP_INSTR
    492      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
    493      1.10  bouyer 	: "0" (__HYPERVISOR_grant_table_op), "1" (cmd), "2" (count), "3" (uop)
    494      1.10  bouyer 	: "memory" );
    495       1.1      cl 
    496       1.1      cl     return ret;
    497       1.1      cl }
    498       1.1      cl 
    499      1.10  bouyer static inline int
    500      1.10  bouyer HYPERVISOR_update_va_mapping_otherdomain(unsigned long page_nr,
    501      1.10  bouyer     unsigned long new_val, unsigned long flags, domid_t domid)
    502       1.1      cl {
    503       1.1      cl     int ret;
    504      1.10  bouyer     unsigned long ign1, ign2, ign3, ign4;
    505      1.10  bouyer 
    506       1.1      cl     __asm__ __volatile__ (
    507       1.1      cl         TRAP_INSTR
    508      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
    509      1.10  bouyer 	: "0" (__HYPERVISOR_update_va_mapping_otherdomain),
    510      1.10  bouyer           "1" (page_nr), "2" (new_val), "3" (flags), "4" (domid) :
    511      1.10  bouyer         "memory" );
    512      1.10  bouyer 
    513      1.10  bouyer     return ret;
    514      1.10  bouyer }
    515       1.1      cl 
    516      1.10  bouyer static inline int
    517      1.10  bouyer HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type)
    518      1.10  bouyer {
    519      1.10  bouyer     int ret;
    520      1.10  bouyer     unsigned long ign1, ign2;
    521      1.10  bouyer 
    522      1.10  bouyer     __asm__ __volatile__ (
    523      1.10  bouyer         TRAP_INSTR
    524      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2)
    525      1.10  bouyer 	: "0" (__HYPERVISOR_vm_assist), "1" (cmd), "2" (type)
    526      1.10  bouyer 	: "memory" );
    527       1.2      cl 
    528       1.1      cl     return ret;
    529       1.1      cl }
    530       1.1      cl 
    531       1.1      cl #endif /* _XEN_HYPERVISOR_H_ */
    532