Isaku Yamahata | ed50bd6 | 2008-10-17 11:17:52 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Support routines for Xen hypercalls |
| 3 | * |
| 4 | * Copyright (C) 2005 Dan Magenheimer <dan.magenheimer@hp.com> |
| 5 | * Copyright (C) 2008 Yaozu (Eddie) Dong <eddie.dong@intel.com> |
| 6 | */ |
| 7 | |
| 8 | #include <asm/asmmacro.h> |
| 9 | #include <asm/intrinsics.h> |
| 10 | #include <asm/xen/privop.h> |
| 11 | |
| 12 | /* |
| 13 | * Hypercalls without parameter. |
| 14 | */ |
| 15 | #define __HCALL0(name,hcall) \ |
| 16 | GLOBAL_ENTRY(name); \ |
| 17 | break hcall; \ |
| 18 | br.ret.sptk.many rp; \ |
| 19 | END(name) |
| 20 | |
| 21 | /* |
| 22 | * Hypercalls with 1 parameter. |
| 23 | */ |
| 24 | #define __HCALL1(name,hcall) \ |
| 25 | GLOBAL_ENTRY(name); \ |
| 26 | mov r8=r32; \ |
| 27 | break hcall; \ |
| 28 | br.ret.sptk.many rp; \ |
| 29 | END(name) |
| 30 | |
| 31 | /* |
| 32 | * Hypercalls with 2 parameters. |
| 33 | */ |
| 34 | #define __HCALL2(name,hcall) \ |
| 35 | GLOBAL_ENTRY(name); \ |
| 36 | mov r8=r32; \ |
| 37 | mov r9=r33; \ |
| 38 | break hcall; \ |
| 39 | br.ret.sptk.many rp; \ |
| 40 | END(name) |
| 41 | |
| 42 | __HCALL0(xen_get_psr, HYPERPRIVOP_GET_PSR) |
| 43 | __HCALL0(xen_get_ivr, HYPERPRIVOP_GET_IVR) |
| 44 | __HCALL0(xen_get_tpr, HYPERPRIVOP_GET_TPR) |
| 45 | __HCALL0(xen_hyper_ssm_i, HYPERPRIVOP_SSM_I) |
| 46 | |
| 47 | __HCALL1(xen_set_tpr, HYPERPRIVOP_SET_TPR) |
| 48 | __HCALL1(xen_eoi, HYPERPRIVOP_EOI) |
| 49 | __HCALL1(xen_thash, HYPERPRIVOP_THASH) |
| 50 | __HCALL1(xen_set_itm, HYPERPRIVOP_SET_ITM) |
| 51 | __HCALL1(xen_get_rr, HYPERPRIVOP_GET_RR) |
| 52 | __HCALL1(xen_fc, HYPERPRIVOP_FC) |
| 53 | __HCALL1(xen_get_cpuid, HYPERPRIVOP_GET_CPUID) |
| 54 | __HCALL1(xen_get_pmd, HYPERPRIVOP_GET_PMD) |
| 55 | |
| 56 | __HCALL2(xen_ptcga, HYPERPRIVOP_PTC_GA) |
| 57 | __HCALL2(xen_set_rr, HYPERPRIVOP_SET_RR) |
| 58 | __HCALL2(xen_set_kr, HYPERPRIVOP_SET_KR) |
| 59 | |
| 60 | #ifdef CONFIG_IA32_SUPPORT |
Isaku Yamahata | 0090d48 | 2008-11-18 19:20:51 +0900 | [diff] [blame] | 61 | __HCALL0(xen_get_eflag, HYPERPRIVOP_GET_EFLAG) |
Isaku Yamahata | ed50bd6 | 2008-10-17 11:17:52 +0900 | [diff] [blame] | 62 | __HCALL1(xen_set_eflag, HYPERPRIVOP_SET_EFLAG) // refer SDM vol1 3.1.8 |
| 63 | #endif /* CONFIG_IA32_SUPPORT */ |
| 64 | |
| 65 | GLOBAL_ENTRY(xen_set_rr0_to_rr4) |
| 66 | mov r8=r32 |
| 67 | mov r9=r33 |
| 68 | mov r10=r34 |
| 69 | mov r11=r35 |
| 70 | mov r14=r36 |
| 71 | XEN_HYPER_SET_RR0_TO_RR4 |
| 72 | br.ret.sptk.many rp |
| 73 | ;; |
| 74 | END(xen_set_rr0_to_rr4) |
| 75 | |
| 76 | GLOBAL_ENTRY(xen_send_ipi) |
| 77 | mov r14=r32 |
| 78 | mov r15=r33 |
| 79 | mov r2=0x400 |
| 80 | break 0x1000 |
| 81 | ;; |
| 82 | br.ret.sptk.many rp |
| 83 | ;; |
| 84 | END(xen_send_ipi) |
| 85 | |
| 86 | GLOBAL_ENTRY(__hypercall) |
| 87 | mov r2=r37 |
| 88 | break 0x1000 |
| 89 | br.ret.sptk.many b0 |
| 90 | ;; |
| 91 | END(__hypercall) |