ia64/xen-unstable

annotate linux-2.6-xen-sparse/include/asm-xen/asm-ia64/hypercall.h @ 7031:109a27c1c004

Another step towards building xenlinux/ia64 from -sparse
author djm@kirby.fc.hp.com
date Fri Sep 23 08:12:28 2005 -0600 (2005-09-23)
parents
children 85f92475b943 b7d11c9b6be4
rev   line source
djm@7031 1 /******************************************************************************
djm@7031 2 * hypercall.h
djm@7031 3 *
djm@7031 4 * Linux-specific hypervisor handling.
djm@7031 5 *
djm@7031 6 * Copyright (c) 2002-2004, K A Fraser
djm@7031 7 *
djm@7031 8 * This file may be distributed separately from the Linux kernel, or
djm@7031 9 * incorporated into other software packages, subject to the following license:
djm@7031 10 *
djm@7031 11 * Permission is hereby granted, free of charge, to any person obtaining a copy
djm@7031 12 * of this source file (the "Software"), to deal in the Software without
djm@7031 13 * restriction, including without limitation the rights to use, copy, modify,
djm@7031 14 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
djm@7031 15 * and to permit persons to whom the Software is furnished to do so, subject to
djm@7031 16 * the following conditions:
djm@7031 17 *
djm@7031 18 * The above copyright notice and this permission notice shall be included in
djm@7031 19 * all copies or substantial portions of the Software.
djm@7031 20 *
djm@7031 21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
djm@7031 22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
djm@7031 23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
djm@7031 24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
djm@7031 25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
djm@7031 26 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
djm@7031 27 * IN THE SOFTWARE.
djm@7031 28 */
djm@7031 29
djm@7031 30 #ifndef __HYPERCALL_H__
djm@7031 31 #define __HYPERCALL_H__
djm@7031 32 #include <asm-xen/xen-public/xen.h>
djm@7031 33
djm@7031 34 /* FIXME: temp place to hold these page related macros */
djm@7031 35 #include <asm/page.h>
djm@7031 36 #define virt_to_machine(v) __pa(v)
djm@7031 37 #define machine_to_virt(m) __va(m)
djm@7031 38 //#define virt_to_mfn(v) (__pa(v) >> 14)
djm@7031 39 //#define mfn_to_virt(m) (__va(m << 14))
djm@7031 40 #define virt_to_mfn(v) ((__pa(v)) >> PAGE_SHIFT)
djm@7031 41 #define mfn_to_virt(m) (__va((m) << PAGE_SHIFT))
djm@7031 42
djm@7031 43 /*
djm@7031 44 * Assembler stubs for hyper-calls.
djm@7031 45 */
djm@7031 46
djm@7031 47 #if 0
djm@7031 48 static inline int
djm@7031 49 HYPERVISOR_set_trap_table(
djm@7031 50 trap_info_t *table)
djm@7031 51 {
djm@7031 52 #if 0
djm@7031 53 int ret;
djm@7031 54 unsigned long ignore;
djm@7031 55
djm@7031 56 __asm__ __volatile__ (
djm@7031 57 TRAP_INSTR
djm@7031 58 : "=a" (ret), "=b" (ignore)
djm@7031 59 : "0" (__HYPERVISOR_set_trap_table), "1" (table)
djm@7031 60 : "memory" );
djm@7031 61
djm@7031 62 return ret;
djm@7031 63 #endif
djm@7031 64 return 1;
djm@7031 65 }
djm@7031 66
djm@7031 67 static inline int
djm@7031 68 HYPERVISOR_mmu_update(
djm@7031 69 mmu_update_t *req, int count, int *success_count, domid_t domid)
djm@7031 70 {
djm@7031 71 #if 0
djm@7031 72 int ret;
djm@7031 73 unsigned long ign1, ign2, ign3, ign4;
djm@7031 74
djm@7031 75 __asm__ __volatile__ (
djm@7031 76 TRAP_INSTR
djm@7031 77 : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
djm@7031 78 : "0" (__HYPERVISOR_mmu_update), "1" (req), "2" (count),
djm@7031 79 "3" (success_count), "4" (domid)
djm@7031 80 : "memory" );
djm@7031 81
djm@7031 82 return ret;
djm@7031 83 #endif
djm@7031 84 return 1;
djm@7031 85 }
djm@7031 86
djm@7031 87 static inline int
djm@7031 88 HYPERVISOR_mmuext_op(
djm@7031 89 struct mmuext_op *op, int count, int *success_count, domid_t domid)
djm@7031 90 {
djm@7031 91 #if 0
djm@7031 92 int ret;
djm@7031 93 unsigned long ign1, ign2, ign3, ign4;
djm@7031 94
djm@7031 95 __asm__ __volatile__ (
djm@7031 96 TRAP_INSTR
djm@7031 97 : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
djm@7031 98 : "0" (__HYPERVISOR_mmuext_op), "1" (op), "2" (count),
djm@7031 99 "3" (success_count), "4" (domid)
djm@7031 100 : "memory" );
djm@7031 101
djm@7031 102 return ret;
djm@7031 103 #endif
djm@7031 104 return 1;
djm@7031 105 }
djm@7031 106
djm@7031 107 static inline int
djm@7031 108 HYPERVISOR_set_gdt(
djm@7031 109 unsigned long *frame_list, int entries)
djm@7031 110 {
djm@7031 111 #if 0
djm@7031 112 int ret;
djm@7031 113 unsigned long ign1, ign2;
djm@7031 114
djm@7031 115 __asm__ __volatile__ (
djm@7031 116 TRAP_INSTR
djm@7031 117 : "=a" (ret), "=b" (ign1), "=c" (ign2)
djm@7031 118 : "0" (__HYPERVISOR_set_gdt), "1" (frame_list), "2" (entries)
djm@7031 119 : "memory" );
djm@7031 120
djm@7031 121
djm@7031 122 return ret;
djm@7031 123 #endif
djm@7031 124 return 1;
djm@7031 125 }
djm@7031 126
djm@7031 127 static inline int
djm@7031 128 HYPERVISOR_stack_switch(
djm@7031 129 unsigned long ss, unsigned long esp)
djm@7031 130 {
djm@7031 131 #if 0
djm@7031 132 int ret;
djm@7031 133 unsigned long ign1, ign2;
djm@7031 134
djm@7031 135 __asm__ __volatile__ (
djm@7031 136 TRAP_INSTR
djm@7031 137 : "=a" (ret), "=b" (ign1), "=c" (ign2)
djm@7031 138 : "0" (__HYPERVISOR_stack_switch), "1" (ss), "2" (esp)
djm@7031 139 : "memory" );
djm@7031 140
djm@7031 141 return ret;
djm@7031 142 #endif
djm@7031 143 return 1;
djm@7031 144 }
djm@7031 145
djm@7031 146 static inline int
djm@7031 147 HYPERVISOR_set_callbacks(
djm@7031 148 unsigned long event_selector, unsigned long event_address,
djm@7031 149 unsigned long failsafe_selector, unsigned long failsafe_address)
djm@7031 150 {
djm@7031 151 #if 0
djm@7031 152 int ret;
djm@7031 153 unsigned long ign1, ign2, ign3, ign4;
djm@7031 154
djm@7031 155 __asm__ __volatile__ (
djm@7031 156 TRAP_INSTR
djm@7031 157 : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
djm@7031 158 : "0" (__HYPERVISOR_set_callbacks), "1" (event_selector),
djm@7031 159 "2" (event_address), "3" (failsafe_selector), "4" (failsafe_address)
djm@7031 160 : "memory" );
djm@7031 161
djm@7031 162 return ret;
djm@7031 163 #endif
djm@7031 164 return 1;
djm@7031 165 }
djm@7031 166
djm@7031 167 static inline int
djm@7031 168 HYPERVISOR_fpu_taskswitch(
djm@7031 169 int set)
djm@7031 170 {
djm@7031 171 #if 0
djm@7031 172 int ret;
djm@7031 173 unsigned long ign;
djm@7031 174
djm@7031 175 __asm__ __volatile__ (
djm@7031 176 TRAP_INSTR
djm@7031 177 : "=a" (ret), "=b" (ign)
djm@7031 178 : "0" (__HYPERVISOR_fpu_taskswitch), "1" (set)
djm@7031 179 : "memory" );
djm@7031 180
djm@7031 181 return ret;
djm@7031 182 #endif
djm@7031 183 return 1;
djm@7031 184 }
djm@7031 185
djm@7031 186 static inline int
djm@7031 187 HYPERVISOR_yield(
djm@7031 188 void)
djm@7031 189 {
djm@7031 190 #if 0
djm@7031 191 int ret;
djm@7031 192 unsigned long ign;
djm@7031 193
djm@7031 194 __asm__ __volatile__ (
djm@7031 195 TRAP_INSTR
djm@7031 196 : "=a" (ret), "=b" (ign)
djm@7031 197 : "0" (__HYPERVISOR_sched_op), "1" (SCHEDOP_yield)
djm@7031 198 : "memory" );
djm@7031 199
djm@7031 200 return ret;
djm@7031 201 #endif
djm@7031 202 return 1;
djm@7031 203 }
djm@7031 204
djm@7031 205 static inline int
djm@7031 206 HYPERVISOR_block(
djm@7031 207 void)
djm@7031 208 {
djm@7031 209 #if 0
djm@7031 210 int ret;
djm@7031 211 unsigned long ign1;
djm@7031 212 __asm__ __volatile__ (
djm@7031 213 TRAP_INSTR
djm@7031 214 : "=a" (ret), "=b" (ign1)
djm@7031 215 : "0" (__HYPERVISOR_sched_op), "1" (SCHEDOP_block)
djm@7031 216 : "memory" );
djm@7031 217
djm@7031 218 return ret;
djm@7031 219 #endif
djm@7031 220 return 1;
djm@7031 221 }
djm@7031 222
djm@7031 223 static inline int
djm@7031 224 HYPERVISOR_shutdown(
djm@7031 225 void)
djm@7031 226 {
djm@7031 227 #if 0
djm@7031 228 int ret;
djm@7031 229 unsigned long ign1;
djm@7031 230 __asm__ __volatile__ (
djm@7031 231 TRAP_INSTR
djm@7031 232 : "=a" (ret), "=b" (ign1)
djm@7031 233 : "0" (__HYPERVISOR_sched_op),
djm@7031 234 "1" (SCHEDOP_shutdown | (SHUTDOWN_poweroff << SCHEDOP_reasonshift))
djm@7031 235 : "memory" );
djm@7031 236
djm@7031 237 return ret;
djm@7031 238 #endif
djm@7031 239 return 1;
djm@7031 240 }
djm@7031 241
djm@7031 242 static inline int
djm@7031 243 HYPERVISOR_reboot(
djm@7031 244 void)
djm@7031 245 {
djm@7031 246 #if 0
djm@7031 247 int ret;
djm@7031 248 unsigned long ign1;
djm@7031 249 __asm__ __volatile__ (
djm@7031 250 TRAP_INSTR
djm@7031 251 : "=a" (ret), "=b" (ign1)
djm@7031 252 : "0" (__HYPERVISOR_sched_op),
djm@7031 253 "1" (SCHEDOP_shutdown | (SHUTDOWN_reboot << SCHEDOP_reasonshift))
djm@7031 254 : "memory" );
djm@7031 255
djm@7031 256 return ret;
djm@7031 257 #endif
djm@7031 258 return 1;
djm@7031 259 }
djm@7031 260
djm@7031 261 static inline int
djm@7031 262 HYPERVISOR_suspend(
djm@7031 263 unsigned long srec)
djm@7031 264 {
djm@7031 265 #if 0
djm@7031 266 int ret;
djm@7031 267 unsigned long ign1, ign2;
djm@7031 268
djm@7031 269 /* NB. On suspend, control software expects a suspend record in %esi. */
djm@7031 270 __asm__ __volatile__ (
djm@7031 271 TRAP_INSTR
djm@7031 272 : "=a" (ret), "=b" (ign1), "=S" (ign2)
djm@7031 273 : "0" (__HYPERVISOR_sched_op),
djm@7031 274 "b" (SCHEDOP_shutdown | (SHUTDOWN_suspend << SCHEDOP_reasonshift)),
djm@7031 275 "S" (srec) : "memory");
djm@7031 276
djm@7031 277 return ret;
djm@7031 278 #endif
djm@7031 279 return 1;
djm@7031 280 }
djm@7031 281
djm@7031 282 static inline int
djm@7031 283 HYPERVISOR_crash(
djm@7031 284 void)
djm@7031 285 {
djm@7031 286 #if 0
djm@7031 287 int ret;
djm@7031 288 unsigned long ign1;
djm@7031 289 __asm__ __volatile__ (
djm@7031 290 TRAP_INSTR
djm@7031 291 : "=a" (ret), "=b" (ign1)
djm@7031 292 : "0" (__HYPERVISOR_sched_op),
djm@7031 293 "1" (SCHEDOP_shutdown | (SHUTDOWN_crash << SCHEDOP_reasonshift))
djm@7031 294 : "memory" );
djm@7031 295
djm@7031 296 return ret;
djm@7031 297 #endif
djm@7031 298 return 1;
djm@7031 299 }
djm@7031 300
djm@7031 301 static inline long
djm@7031 302 HYPERVISOR_set_timer_op(
djm@7031 303 u64 timeout)
djm@7031 304 {
djm@7031 305 #if 0
djm@7031 306 int ret;
djm@7031 307 unsigned long timeout_hi = (unsigned long)(timeout>>32);
djm@7031 308 unsigned long timeout_lo = (unsigned long)timeout;
djm@7031 309 unsigned long ign1, ign2;
djm@7031 310
djm@7031 311 __asm__ __volatile__ (
djm@7031 312 TRAP_INSTR
djm@7031 313 : "=a" (ret), "=b" (ign1), "=c" (ign2)
djm@7031 314 : "0" (__HYPERVISOR_set_timer_op), "b" (timeout_lo), "c" (timeout_hi)
djm@7031 315 : "memory");
djm@7031 316
djm@7031 317 return ret;
djm@7031 318 #endif
djm@7031 319 return 1;
djm@7031 320 }
djm@7031 321
djm@7031 322 static inline int
djm@7031 323 HYPERVISOR_dom0_op(
djm@7031 324 dom0_op_t *dom0_op)
djm@7031 325 {
djm@7031 326 #if 0
djm@7031 327 int ret;
djm@7031 328 unsigned long ign1;
djm@7031 329
djm@7031 330 dom0_op->interface_version = DOM0_INTERFACE_VERSION;
djm@7031 331 __asm__ __volatile__ (
djm@7031 332 TRAP_INSTR
djm@7031 333 : "=a" (ret), "=b" (ign1)
djm@7031 334 : "0" (__HYPERVISOR_dom0_op), "1" (dom0_op)
djm@7031 335 : "memory");
djm@7031 336
djm@7031 337 return ret;
djm@7031 338 #endif
djm@7031 339 return 1;
djm@7031 340 }
djm@7031 341
djm@7031 342 static inline int
djm@7031 343 HYPERVISOR_set_debugreg(
djm@7031 344 int reg, unsigned long value)
djm@7031 345 {
djm@7031 346 #if 0
djm@7031 347 int ret;
djm@7031 348 unsigned long ign1, ign2;
djm@7031 349 __asm__ __volatile__ (
djm@7031 350 TRAP_INSTR
djm@7031 351 : "=a" (ret), "=b" (ign1), "=c" (ign2)
djm@7031 352 : "0" (__HYPERVISOR_set_debugreg), "1" (reg), "2" (value)
djm@7031 353 : "memory" );
djm@7031 354
djm@7031 355 return ret;
djm@7031 356 #endif
djm@7031 357 return 1;
djm@7031 358 }
djm@7031 359
djm@7031 360 static inline unsigned long
djm@7031 361 HYPERVISOR_get_debugreg(
djm@7031 362 int reg)
djm@7031 363 {
djm@7031 364 #if 0
djm@7031 365 unsigned long ret;
djm@7031 366 unsigned long ign;
djm@7031 367 __asm__ __volatile__ (
djm@7031 368 TRAP_INSTR
djm@7031 369 : "=a" (ret), "=b" (ign)
djm@7031 370 : "0" (__HYPERVISOR_get_debugreg), "1" (reg)
djm@7031 371 : "memory" );
djm@7031 372
djm@7031 373 return ret;
djm@7031 374 #endif
djm@7031 375 return 1;
djm@7031 376 }
djm@7031 377
djm@7031 378 static inline int
djm@7031 379 HYPERVISOR_update_descriptor(
djm@7031 380 unsigned long ma, unsigned long word1, unsigned long word2)
djm@7031 381 {
djm@7031 382 #if 0
djm@7031 383 int ret;
djm@7031 384 unsigned long ign1, ign2, ign3;
djm@7031 385
djm@7031 386 __asm__ __volatile__ (
djm@7031 387 TRAP_INSTR
djm@7031 388 : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
djm@7031 389 : "0" (__HYPERVISOR_update_descriptor), "1" (ma), "2" (word1),
djm@7031 390 "3" (word2)
djm@7031 391 : "memory" );
djm@7031 392
djm@7031 393 return ret;
djm@7031 394 #endif
djm@7031 395 return 1;
djm@7031 396 }
djm@7031 397
djm@7031 398 static inline int
djm@7031 399 HYPERVISOR_set_fast_trap(
djm@7031 400 int idx)
djm@7031 401 {
djm@7031 402 #if 0
djm@7031 403 int ret;
djm@7031 404 unsigned long ign;
djm@7031 405
djm@7031 406 __asm__ __volatile__ (
djm@7031 407 TRAP_INSTR
djm@7031 408 : "=a" (ret), "=b" (ign)
djm@7031 409 : "0" (__HYPERVISOR_set_fast_trap), "1" (idx)
djm@7031 410 : "memory" );
djm@7031 411
djm@7031 412 return ret;
djm@7031 413 #endif
djm@7031 414 return 1;
djm@7031 415 }
djm@7031 416
djm@7031 417 static inline int
djm@7031 418 HYPERVISOR_dom_mem_op(
djm@7031 419 unsigned int op, unsigned long *extent_list,
djm@7031 420 unsigned long nr_extents, unsigned int extent_order)
djm@7031 421 {
djm@7031 422 #if 0
djm@7031 423 int ret;
djm@7031 424 unsigned long ign1, ign2, ign3, ign4, ign5;
djm@7031 425
djm@7031 426 __asm__ __volatile__ (
djm@7031 427 TRAP_INSTR
djm@7031 428 : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4),
djm@7031 429 "=D" (ign5)
djm@7031 430 : "0" (__HYPERVISOR_dom_mem_op), "1" (op), "2" (extent_list),
djm@7031 431 "3" (nr_extents), "4" (extent_order), "5" (DOMID_SELF)
djm@7031 432 : "memory" );
djm@7031 433
djm@7031 434 return ret;
djm@7031 435 #endif
djm@7031 436 return 1;
djm@7031 437 }
djm@7031 438
djm@7031 439 static inline int
djm@7031 440 HYPERVISOR_multicall(
djm@7031 441 void *call_list, int nr_calls)
djm@7031 442 {
djm@7031 443 #if 0
djm@7031 444 int ret;
djm@7031 445 unsigned long ign1, ign2;
djm@7031 446
djm@7031 447 __asm__ __volatile__ (
djm@7031 448 TRAP_INSTR
djm@7031 449 : "=a" (ret), "=b" (ign1), "=c" (ign2)
djm@7031 450 : "0" (__HYPERVISOR_multicall), "1" (call_list), "2" (nr_calls)
djm@7031 451 : "memory" );
djm@7031 452
djm@7031 453 return ret;
djm@7031 454 #endif
djm@7031 455 return 1;
djm@7031 456 }
djm@7031 457
djm@7031 458 static inline int
djm@7031 459 HYPERVISOR_update_va_mapping(
djm@7031 460 unsigned long va, pte_t new_val, unsigned long flags)
djm@7031 461 {
djm@7031 462 #if 0
djm@7031 463 int ret;
djm@7031 464 unsigned long ign1, ign2, ign3;
djm@7031 465
djm@7031 466 __asm__ __volatile__ (
djm@7031 467 TRAP_INSTR
djm@7031 468 : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)
djm@7031 469 : "0" (__HYPERVISOR_update_va_mapping),
djm@7031 470 "1" (va), "2" ((new_val).pte_low), "3" (flags)
djm@7031 471 : "memory" );
djm@7031 472
djm@7031 473 if ( unlikely(ret < 0) )
djm@7031 474 {
djm@7031 475 printk(KERN_ALERT "Failed update VA mapping: %08lx, %08lx, %08lx\n",
djm@7031 476 va, (new_val).pte_low, flags);
djm@7031 477 BUG();
djm@7031 478 }
djm@7031 479
djm@7031 480 return ret;
djm@7031 481 #endif
djm@7031 482 return 1;
djm@7031 483 }
djm@7031 484 #endif
djm@7031 485
djm@7031 486 static inline int
djm@7031 487 HYPERVISOR_event_channel_op(
djm@7031 488 void *op)
djm@7031 489 {
djm@7031 490 int ret;
djm@7031 491 __asm__ __volatile__ ( ";; mov r14=%2 ; mov r2=%1 ; break 0x1000 ;; mov %0=r8 ;;"
djm@7031 492 : "=r" (ret)
djm@7031 493 : "i" (__HYPERVISOR_event_channel_op), "r"(op)
djm@7031 494 : "r14","r2","r8","memory" );
djm@7031 495 return ret;
djm@7031 496 }
djm@7031 497
djm@7031 498 #if 0
djm@7031 499 static inline int
djm@7031 500 HYPERVISOR_xen_version(
djm@7031 501 int cmd)
djm@7031 502 {
djm@7031 503 #if 0
djm@7031 504 int ret;
djm@7031 505 unsigned long ignore;
djm@7031 506
djm@7031 507 __asm__ __volatile__ (
djm@7031 508 TRAP_INSTR
djm@7031 509 : "=a" (ret), "=b" (ignore)
djm@7031 510 : "0" (__HYPERVISOR_xen_version), "1" (cmd)
djm@7031 511 : "memory" );
djm@7031 512
djm@7031 513 return ret;
djm@7031 514 #endif
djm@7031 515 return 1;
djm@7031 516 }
djm@7031 517 #endif
djm@7031 518
djm@7031 519 static inline int
djm@7031 520 HYPERVISOR_console_io(
djm@7031 521 int cmd, int count, char *str)
djm@7031 522 {
djm@7031 523 int ret;
djm@7031 524 __asm__ __volatile__ ( ";; mov r14=%2 ; mov r15=%3 ; mov r16=%4 ; mov r2=%1 ; break 0x1000 ;; mov %0=r8 ;;"
djm@7031 525 : "=r" (ret)
djm@7031 526 : "i" (__HYPERVISOR_console_io), "r"(cmd), "r"(count), "r"(str)
djm@7031 527 : "r14","r15","r16","r2","r8","memory" );
djm@7031 528 return ret;
djm@7031 529 }
djm@7031 530
djm@7031 531 #if 0
djm@7031 532 static inline int
djm@7031 533 HYPERVISOR_physdev_op(
djm@7031 534 void *physdev_op)
djm@7031 535 {
djm@7031 536 #if 0
djm@7031 537 int ret;
djm@7031 538 unsigned long ign;
djm@7031 539
djm@7031 540 __asm__ __volatile__ (
djm@7031 541 TRAP_INSTR
djm@7031 542 : "=a" (ret), "=b" (ign)
djm@7031 543 : "0" (__HYPERVISOR_physdev_op), "1" (physdev_op)
djm@7031 544 : "memory" );
djm@7031 545
djm@7031 546 return ret;
djm@7031 547 #endif
djm@7031 548 return 1;
djm@7031 549 }
djm@7031 550 #endif
djm@7031 551
djm@7031 552 static inline int
djm@7031 553 HYPERVISOR_grant_table_op(
djm@7031 554 unsigned int cmd, void *uop, unsigned int count)
djm@7031 555 {
djm@7031 556 int ret;
djm@7031 557 __asm__ __volatile__ ( ";; mov r14=%2 ; mov r15=%3 ; mov r16=%4 ; mov r2=%1 ; break 0x1000 ;; mov %0=r8 ;;"
djm@7031 558 : "=r" (ret)
djm@7031 559 : "i" (__HYPERVISOR_grant_table_op), "r"(cmd), "r"(uop), "r"(count)
djm@7031 560 : "r14","r15","r16","r2","r8","memory" );
djm@7031 561 return ret;
djm@7031 562 }
djm@7031 563
djm@7031 564 #if 0
djm@7031 565 static inline int
djm@7031 566 HYPERVISOR_update_va_mapping_otherdomain(
djm@7031 567 unsigned long va, pte_t new_val, unsigned long flags, domid_t domid)
djm@7031 568 {
djm@7031 569 #if 0
djm@7031 570 int ret;
djm@7031 571 unsigned long ign1, ign2, ign3, ign4;
djm@7031 572
djm@7031 573 __asm__ __volatile__ (
djm@7031 574 TRAP_INSTR
djm@7031 575 : "=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)
djm@7031 576 : "0" (__HYPERVISOR_update_va_mapping_otherdomain),
djm@7031 577 "1" (va), "2" ((new_val).pte_low), "3" (flags), "4" (domid) :
djm@7031 578 "memory" );
djm@7031 579
djm@7031 580 return ret;
djm@7031 581 #endif
djm@7031 582 return 1;
djm@7031 583 }
djm@7031 584
djm@7031 585 static inline int
djm@7031 586 HYPERVISOR_vm_assist(
djm@7031 587 unsigned int cmd, unsigned int type)
djm@7031 588 {
djm@7031 589 #if 0
djm@7031 590 int ret;
djm@7031 591 unsigned long ign1, ign2;
djm@7031 592
djm@7031 593 __asm__ __volatile__ (
djm@7031 594 TRAP_INSTR
djm@7031 595 : "=a" (ret), "=b" (ign1), "=c" (ign2)
djm@7031 596 : "0" (__HYPERVISOR_vm_assist), "1" (cmd), "2" (type)
djm@7031 597 : "memory" );
djm@7031 598
djm@7031 599 return ret;
djm@7031 600 #endif
djm@7031 601 return 1;
djm@7031 602 }
djm@7031 603
djm@7031 604 static inline int
djm@7031 605 HYPERVISOR_boot_vcpu(
djm@7031 606 unsigned long vcpu, vcpu_guest_context_t *ctxt)
djm@7031 607 {
djm@7031 608 #if 0
djm@7031 609 int ret;
djm@7031 610 unsigned long ign1, ign2;
djm@7031 611
djm@7031 612 __asm__ __volatile__ (
djm@7031 613 TRAP_INSTR
djm@7031 614 : "=a" (ret), "=b" (ign1), "=c" (ign2)
djm@7031 615 : "0" (__HYPERVISOR_boot_vcpu), "1" (vcpu), "2" (ctxt)
djm@7031 616 : "memory");
djm@7031 617
djm@7031 618 return ret;
djm@7031 619 #endif
djm@7031 620 return 1;
djm@7031 621 }
djm@7031 622 #endif
djm@7031 623
djm@7031 624 #endif /* __HYPERCALL_H__ */