Home | History | Annotate | Line # | Download | only in include
hypervisor.h revision 1.10.2.3
      1  1.10.2.3    tron /*	$NetBSD: hypervisor.h,v 1.10.2.3 2005/04/28 10:39:00 tron 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  bouyer void hypervisor_force_callback(void);
     96  1.10.2.2    tron void hypervisor_enable_ipl(unsigned int);
     97  1.10.2.3    tron void hypervisor_set_ipending(u_int32_t, int, int);
     98       1.1      cl 
     99       1.1      cl /*
    100       1.1      cl  * Assembler stubs for hyper-calls.
    101       1.1      cl  */
    102       1.1      cl 
    103      1.10  bouyer static inline int
    104      1.10  bouyer HYPERVISOR_set_trap_table(trap_info_t *table)
    105       1.1      cl {
    106       1.1      cl     int ret;
    107      1.10  bouyer     unsigned long ign1;
    108      1.10  bouyer 
    109       1.1      cl     __asm__ __volatile__ (
    110       1.1      cl         TRAP_INSTR
    111      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    112      1.10  bouyer 	: "0" (__HYPERVISOR_set_trap_table), "1" (table)
    113      1.10  bouyer 	: "memory" );
    114       1.1      cl 
    115       1.1      cl     return ret;
    116       1.1      cl }
    117       1.1      cl 
    118      1.10  bouyer static inline int
    119      1.10  bouyer HYPERVISOR_mmu_update(mmu_update_t *req, int count, int *success_count)
    120       1.1      cl {
    121       1.1      cl     int ret;
    122      1.10  bouyer     unsigned long ign1, ign2, ign3;
    123      1.10  bouyer 
    124       1.1      cl     __asm__ __volatile__ (
    125       1.1      cl         TRAP_INSTR
    126      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
    127      1.10  bouyer 	: "0" (__HYPERVISOR_mmu_update), "1" (req), "2" (count),
    128      1.10  bouyer 	  "3" (success_count)
    129      1.10  bouyer 	: "memory" );
    130      1.10  bouyer 
    131      1.10  bouyer     return ret;
    132      1.10  bouyer }
    133       1.1      cl 
    134      1.10  bouyer static inline int
    135      1.10  bouyer HYPERVISOR_set_gdt(unsigned long *frame_list, int entries)
    136      1.10  bouyer {
    137      1.10  bouyer     int ret;
    138      1.10  bouyer     unsigned long ign1, ign2;
    139      1.10  bouyer 
    140      1.10  bouyer     __asm__ __volatile__ (
    141      1.10  bouyer         TRAP_INSTR
    142      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2)
    143      1.10  bouyer 	: "0" (__HYPERVISOR_set_gdt), "1" (frame_list), "2" (entries)
    144      1.10  bouyer 	: "memory" );
    145       1.2      cl 
    146       1.1      cl     return ret;
    147       1.1      cl }
    148       1.1      cl 
    149      1.10  bouyer static inline int
    150      1.10  bouyer HYPERVISOR_stack_switch(unsigned long ss, unsigned long esp)
    151       1.7      cl {
    152       1.7      cl     int ret;
    153      1.10  bouyer     unsigned long ign1, ign2;
    154      1.10  bouyer 
    155       1.7      cl     __asm__ __volatile__ (
    156       1.7      cl         TRAP_INSTR
    157      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2)
    158      1.10  bouyer 	: "0" (__HYPERVISOR_stack_switch), "1" (ss), "2" (esp)
    159      1.10  bouyer 	: "memory" );
    160       1.7      cl 
    161       1.7      cl     return ret;
    162       1.7      cl }
    163       1.7      cl 
    164      1.10  bouyer static inline int
    165      1.10  bouyer HYPERVISOR_set_callbacks(
    166      1.10  bouyer     unsigned long event_selector, unsigned long event_address,
    167      1.10  bouyer     unsigned long failsafe_selector, unsigned long failsafe_address)
    168       1.1      cl {
    169       1.1      cl     int ret;
    170      1.10  bouyer     unsigned long ign1, ign2, ign3, ign4;
    171      1.10  bouyer 
    172       1.1      cl     __asm__ __volatile__ (
    173       1.1      cl         TRAP_INSTR
    174      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
    175      1.10  bouyer 	: "0" (__HYPERVISOR_set_callbacks), "1" (event_selector),
    176      1.10  bouyer 	  "2" (event_address), "3" (failsafe_selector), "4" (failsafe_address)
    177      1.10  bouyer 	: "memory" );
    178       1.1      cl 
    179      1.10  bouyer     return ret;
    180      1.10  bouyer }
    181      1.10  bouyer 
    182      1.10  bouyer static inline int
    183      1.10  bouyer HYPERVISOR_fpu_taskswitch(void)
    184      1.10  bouyer {
    185      1.10  bouyer     int ret;
    186      1.10  bouyer     __asm__ __volatile__ (
    187      1.10  bouyer         TRAP_INSTR
    188      1.10  bouyer         : "=a" (ret) : "0" (__HYPERVISOR_fpu_taskswitch) : "memory" );
    189       1.1      cl 
    190       1.1      cl     return ret;
    191       1.1      cl }
    192       1.1      cl 
    193      1.10  bouyer static inline int
    194      1.10  bouyer HYPERVISOR_yield(void)
    195       1.1      cl {
    196       1.1      cl     int ret;
    197      1.10  bouyer     unsigned long ign1;
    198      1.10  bouyer 
    199       1.1      cl     __asm__ __volatile__ (
    200       1.1      cl         TRAP_INSTR
    201      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    202      1.10  bouyer 	: "0" (__HYPERVISOR_sched_op), "1" (SCHEDOP_yield)
    203      1.10  bouyer 	: "memory" );
    204      1.10  bouyer 
    205      1.10  bouyer     return ret;
    206      1.10  bouyer }
    207      1.10  bouyer 
    208      1.10  bouyer static inline int
    209      1.10  bouyer HYPERVISOR_block(void)
    210      1.10  bouyer {
    211      1.10  bouyer     int ret;
    212      1.10  bouyer     unsigned long ign1;
    213       1.1      cl 
    214      1.10  bouyer     __asm__ __volatile__ (
    215      1.10  bouyer         TRAP_INSTR
    216      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    217      1.10  bouyer 	: "0" (__HYPERVISOR_sched_op), "1" (SCHEDOP_block)
    218      1.10  bouyer 	: "memory" );
    219       1.1      cl 
    220       1.1      cl     return ret;
    221       1.1      cl }
    222       1.1      cl 
    223      1.10  bouyer static inline int
    224      1.10  bouyer HYPERVISOR_shutdown(void)
    225       1.1      cl {
    226       1.1      cl     int ret;
    227      1.10  bouyer     unsigned long ign1;
    228      1.10  bouyer 
    229       1.1      cl     __asm__ __volatile__ (
    230       1.1      cl         TRAP_INSTR
    231      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    232      1.10  bouyer 	: "0" (__HYPERVISOR_sched_op),
    233      1.10  bouyer 	  "1" (SCHEDOP_shutdown | (SHUTDOWN_poweroff << SCHEDOP_reasonshift))
    234      1.10  bouyer         : "memory" );
    235       1.1      cl 
    236       1.1      cl     return ret;
    237       1.1      cl }
    238       1.1      cl 
    239      1.10  bouyer static inline int
    240      1.10  bouyer HYPERVISOR_reboot(void)
    241       1.1      cl {
    242       1.1      cl     int ret;
    243      1.10  bouyer     unsigned long ign1;
    244      1.10  bouyer 
    245       1.1      cl     __asm__ __volatile__ (
    246       1.1      cl         TRAP_INSTR
    247      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    248      1.10  bouyer 	: "0" (__HYPERVISOR_sched_op),
    249      1.10  bouyer 	  "1" (SCHEDOP_shutdown | (SHUTDOWN_reboot << SCHEDOP_reasonshift))
    250      1.10  bouyer         : "memory" );
    251       1.1      cl 
    252       1.1      cl     return ret;
    253       1.1      cl }
    254       1.1      cl 
    255      1.10  bouyer static inline int
    256      1.10  bouyer HYPERVISOR_suspend(unsigned long srec)
    257       1.1      cl {
    258       1.1      cl     int ret;
    259      1.10  bouyer     unsigned long ign1, ign2;
    260      1.10  bouyer 
    261      1.10  bouyer     /* NB. On suspend, control software expects a suspend record in %esi. */
    262       1.1      cl     __asm__ __volatile__ (
    263       1.1      cl         TRAP_INSTR
    264      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=S" (ign2)
    265      1.10  bouyer 	: "0" (__HYPERVISOR_sched_op),
    266      1.10  bouyer         "b" (SCHEDOP_shutdown | (SHUTDOWN_suspend << SCHEDOP_reasonshift)),
    267      1.10  bouyer         "S" (srec) : "memory");
    268       1.1      cl 
    269       1.1      cl     return ret;
    270       1.1      cl }
    271       1.1      cl 
    272      1.10  bouyer static inline long
    273      1.10  bouyer HYPERVISOR_set_timer_op(uint64_t timeout)
    274       1.1      cl {
    275       1.1      cl     int ret;
    276      1.10  bouyer     unsigned long timeout_hi = (unsigned long)(timeout>>32);
    277      1.10  bouyer     unsigned long timeout_lo = (unsigned long)timeout;
    278      1.10  bouyer     unsigned long ign1, ign2;
    279      1.10  bouyer 
    280       1.1      cl     __asm__ __volatile__ (
    281       1.1      cl         TRAP_INSTR
    282      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2)
    283      1.10  bouyer 	: "0" (__HYPERVISOR_set_timer_op), "b" (timeout_hi), "c" (timeout_lo)
    284      1.10  bouyer 	: "memory");
    285       1.1      cl 
    286       1.1      cl     return ret;
    287       1.1      cl }
    288       1.1      cl 
    289      1.10  bouyer static inline int
    290      1.10  bouyer HYPERVISOR_dom0_op(dom0_op_t *dom0_op)
    291       1.1      cl {
    292       1.1      cl     int ret;
    293      1.10  bouyer     unsigned long ign1;
    294      1.10  bouyer 
    295      1.10  bouyer     dom0_op->interface_version = DOM0_INTERFACE_VERSION;
    296       1.1      cl     __asm__ __volatile__ (
    297       1.1      cl         TRAP_INSTR
    298      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    299      1.10  bouyer 	: "0" (__HYPERVISOR_dom0_op), "1" (dom0_op)
    300      1.10  bouyer 	: "memory");
    301       1.1      cl 
    302       1.1      cl     return ret;
    303       1.1      cl }
    304       1.1      cl 
    305      1.10  bouyer static inline int
    306      1.10  bouyer HYPERVISOR_set_debugreg(int reg, unsigned long value)
    307       1.1      cl {
    308       1.1      cl     int ret;
    309      1.10  bouyer     unsigned long ign1, ign2;
    310      1.10  bouyer 
    311       1.1      cl     __asm__ __volatile__ (
    312       1.1      cl         TRAP_INSTR
    313      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2)
    314      1.10  bouyer 	: "0" (__HYPERVISOR_set_debugreg), "1" (reg), "2" (value)
    315      1.10  bouyer 	: "memory" );
    316       1.1      cl 
    317       1.1      cl     return ret;
    318       1.1      cl }
    319       1.1      cl 
    320      1.10  bouyer static inline unsigned long
    321      1.10  bouyer HYPERVISOR_get_debugreg(int reg)
    322       1.1      cl {
    323      1.10  bouyer     unsigned long ret;
    324      1.10  bouyer     unsigned long ign1;
    325      1.10  bouyer 
    326       1.1      cl     __asm__ __volatile__ (
    327       1.1      cl         TRAP_INSTR
    328      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    329      1.10  bouyer 	: "0" (__HYPERVISOR_get_debugreg), "1" (reg)
    330      1.10  bouyer 	: "memory" );
    331       1.1      cl 
    332       1.1      cl     return ret;
    333       1.1      cl }
    334       1.1      cl 
    335      1.10  bouyer static inline int
    336      1.10  bouyer HYPERVISOR_update_descriptor(unsigned long pa, unsigned long word1,
    337      1.10  bouyer     unsigned long word2)
    338       1.1      cl {
    339       1.1      cl     int ret;
    340      1.10  bouyer     unsigned long ign1, ign2, ign3;
    341      1.10  bouyer 
    342       1.1      cl     __asm__ __volatile__ (
    343       1.1      cl         TRAP_INSTR
    344      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
    345      1.10  bouyer 	: "0" (__HYPERVISOR_update_descriptor), "1" (pa), "2" (word1),
    346      1.10  bouyer 	  "3" (word2)
    347      1.10  bouyer 	: "memory" );
    348       1.1      cl 
    349       1.1      cl     return ret;
    350       1.1      cl }
    351       1.1      cl 
    352      1.10  bouyer static inline int
    353      1.10  bouyer HYPERVISOR_set_fast_trap(int idx)
    354       1.1      cl {
    355       1.1      cl     int ret;
    356      1.10  bouyer     unsigned long ign1;
    357      1.10  bouyer 
    358       1.1      cl     __asm__ __volatile__ (
    359       1.1      cl         TRAP_INSTR
    360      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    361      1.10  bouyer 	: "0" (__HYPERVISOR_set_fast_trap), "1" (idx)
    362      1.10  bouyer 	: "memory" );
    363       1.1      cl 
    364       1.1      cl     return ret;
    365       1.1      cl }
    366       1.1      cl 
    367      1.10  bouyer static inline int
    368      1.10  bouyer HYPERVISOR_dom_mem_op(unsigned int op, unsigned long *extent_list,
    369      1.10  bouyer     unsigned long nr_extents, unsigned int extent_order)
    370       1.1      cl {
    371       1.1      cl     int ret;
    372      1.10  bouyer     unsigned long ign1, ign2, ign3, ign4, ign5;
    373      1.10  bouyer 
    374       1.1      cl     __asm__ __volatile__ (
    375       1.1      cl         TRAP_INSTR
    376      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4),
    377      1.10  bouyer 	  "=D" (ign5)
    378      1.10  bouyer 	: "0" (__HYPERVISOR_dom_mem_op), "1" (op), "2" (extent_list),
    379      1.10  bouyer 	  "3" (nr_extents), "4" (extent_order), "5" (DOMID_SELF)
    380      1.10  bouyer         : "memory" );
    381       1.1      cl 
    382       1.1      cl     return ret;
    383       1.1      cl }
    384       1.1      cl 
    385      1.10  bouyer static inline int
    386      1.10  bouyer HYPERVISOR_multicall(void *call_list, int nr_calls)
    387       1.1      cl {
    388       1.1      cl     int ret;
    389      1.10  bouyer     unsigned long ign1, ign2;
    390      1.10  bouyer 
    391       1.1      cl     __asm__ __volatile__ (
    392       1.1      cl         TRAP_INSTR
    393      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2)
    394      1.10  bouyer 	: "0" (__HYPERVISOR_multicall), "1" (call_list), "2" (nr_calls)
    395      1.10  bouyer 	: "memory" );
    396       1.1      cl 
    397       1.1      cl     return ret;
    398       1.1      cl }
    399       1.1      cl 
    400      1.10  bouyer static inline int
    401      1.10  bouyer HYPERVISOR_update_va_mapping(unsigned long page_nr, unsigned long new_val,
    402      1.10  bouyer     unsigned long flags)
    403       1.1      cl {
    404      1.10  bouyer     int ret;
    405      1.10  bouyer     unsigned long ign1, ign2, ign3;
    406      1.10  bouyer 
    407       1.1      cl     __asm__ __volatile__ (
    408       1.1      cl         TRAP_INSTR
    409      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
    410      1.10  bouyer 	: "0" (__HYPERVISOR_update_va_mapping),
    411      1.10  bouyer           "1" (page_nr), "2" (new_val), "3" (flags)
    412      1.10  bouyer 	: "memory" );
    413      1.10  bouyer 
    414      1.10  bouyer #ifdef notdef
    415      1.10  bouyer     if (__predict_false(ret < 0))
    416      1.10  bouyer         panic("Failed update VA mapping: %08lx, %08lx, %08lx",
    417      1.10  bouyer               page_nr, new_val, flags);
    418      1.10  bouyer #endif
    419       1.1      cl 
    420       1.1      cl     return ret;
    421       1.1      cl }
    422       1.1      cl 
    423      1.10  bouyer static inline int
    424      1.10  bouyer HYPERVISOR_event_channel_op(void *op)
    425       1.1      cl {
    426       1.1      cl     int ret;
    427      1.10  bouyer     unsigned long ign1;
    428      1.10  bouyer 
    429       1.1      cl     __asm__ __volatile__ (
    430       1.1      cl         TRAP_INSTR
    431      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    432      1.10  bouyer 	: "0" (__HYPERVISOR_event_channel_op), "1" (op)
    433      1.10  bouyer 	: "memory" );
    434       1.1      cl 
    435       1.1      cl     return ret;
    436       1.1      cl }
    437       1.1      cl 
    438      1.10  bouyer static inline int
    439      1.10  bouyer HYPERVISOR_xen_version(int cmd)
    440       1.1      cl {
    441       1.1      cl     int ret;
    442      1.10  bouyer     unsigned long ign1;
    443      1.10  bouyer 
    444       1.1      cl     __asm__ __volatile__ (
    445       1.1      cl         TRAP_INSTR
    446      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    447      1.10  bouyer 	: "0" (__HYPERVISOR_xen_version), "1" (cmd)
    448      1.10  bouyer 	: "memory" );
    449       1.1      cl 
    450       1.1      cl     return ret;
    451       1.1      cl }
    452       1.1      cl 
    453      1.10  bouyer static inline int
    454      1.10  bouyer HYPERVISOR_console_io(int cmd, int count, char *str)
    455       1.1      cl {
    456       1.1      cl     int ret;
    457      1.10  bouyer     unsigned long ign1, ign2, ign3;
    458      1.10  bouyer 
    459       1.1      cl     __asm__ __volatile__ (
    460       1.1      cl         TRAP_INSTR
    461      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
    462      1.10  bouyer 	: "0" (__HYPERVISOR_console_io), "1" (cmd), "2" (count), "3" (str)
    463      1.10  bouyer 	: "memory" );
    464       1.1      cl 
    465       1.1      cl     return ret;
    466       1.1      cl }
    467       1.1      cl 
    468      1.10  bouyer static inline int
    469      1.10  bouyer HYPERVISOR_physdev_op(void *physdev_op)
    470       1.1      cl {
    471       1.1      cl     int ret;
    472      1.10  bouyer     unsigned long ign1;
    473      1.10  bouyer 
    474       1.1      cl     __asm__ __volatile__ (
    475       1.1      cl         TRAP_INSTR
    476      1.10  bouyer         : "=a" (ret), "=b" (ign1)
    477      1.10  bouyer 	: "0" (__HYPERVISOR_physdev_op), "1" (physdev_op)
    478      1.10  bouyer 	: "memory" );
    479       1.1      cl 
    480       1.1      cl     return ret;
    481       1.1      cl }
    482       1.1      cl 
    483      1.10  bouyer static inline int
    484      1.10  bouyer HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
    485       1.1      cl {
    486       1.1      cl     int ret;
    487      1.10  bouyer     unsigned long ign1, ign2, ign3;
    488      1.10  bouyer 
    489       1.1      cl     __asm__ __volatile__ (
    490       1.1      cl         TRAP_INSTR
    491      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
    492      1.10  bouyer 	: "0" (__HYPERVISOR_grant_table_op), "1" (cmd), "2" (count), "3" (uop)
    493      1.10  bouyer 	: "memory" );
    494       1.1      cl 
    495       1.1      cl     return ret;
    496       1.1      cl }
    497       1.1      cl 
    498      1.10  bouyer static inline int
    499      1.10  bouyer HYPERVISOR_update_va_mapping_otherdomain(unsigned long page_nr,
    500      1.10  bouyer     unsigned long new_val, unsigned long flags, domid_t domid)
    501       1.1      cl {
    502       1.1      cl     int ret;
    503      1.10  bouyer     unsigned long ign1, ign2, ign3, ign4;
    504      1.10  bouyer 
    505       1.1      cl     __asm__ __volatile__ (
    506       1.1      cl         TRAP_INSTR
    507      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
    508      1.10  bouyer 	: "0" (__HYPERVISOR_update_va_mapping_otherdomain),
    509      1.10  bouyer           "1" (page_nr), "2" (new_val), "3" (flags), "4" (domid) :
    510      1.10  bouyer         "memory" );
    511      1.10  bouyer 
    512      1.10  bouyer     return ret;
    513      1.10  bouyer }
    514       1.1      cl 
    515      1.10  bouyer static inline int
    516      1.10  bouyer HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type)
    517      1.10  bouyer {
    518      1.10  bouyer     int ret;
    519      1.10  bouyer     unsigned long ign1, ign2;
    520      1.10  bouyer 
    521      1.10  bouyer     __asm__ __volatile__ (
    522      1.10  bouyer         TRAP_INSTR
    523      1.10  bouyer         : "=a" (ret), "=b" (ign1), "=c" (ign2)
    524      1.10  bouyer 	: "0" (__HYPERVISOR_vm_assist), "1" (cmd), "2" (type)
    525      1.10  bouyer 	: "memory" );
    526       1.2      cl 
    527       1.1      cl     return ret;
    528       1.1      cl }
    529       1.1      cl 
    530       1.1      cl #endif /* _XEN_HYPERVISOR_H_ */
    531