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