blob: e32dae444dd6ec077f0f1ae259927aac723d5ec7 [file] [log] [blame]
Isaku Yamahataed50bd62008-10-17 11:17:52 +09001/*
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 Yamahata0a7d3242009-03-04 21:06:55 +090012#ifdef __INTEL_COMPILER
Isaku Yamahataed50bd62008-10-17 11:17:52 +090013/*
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 Yamahata0090d482008-11-18 19:20:51 +090062__HCALL0(xen_get_eflag, HYPERPRIVOP_GET_EFLAG)
Isaku Yamahataed50bd62008-10-17 11:17:52 +090063__HCALL1(xen_set_eflag, HYPERPRIVOP_SET_EFLAG) // refer SDM vol1 3.1.8
64#endif /* CONFIG_IA32_SUPPORT */
65
66GLOBAL_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 ;;
75END(xen_set_rr0_to_rr4)
Isaku Yamahata0a7d3242009-03-04 21:06:55 +090076#endif
Isaku Yamahataed50bd62008-10-17 11:17:52 +090077
78GLOBAL_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 ;;
86END(xen_send_ipi)
87
88GLOBAL_ENTRY(__hypercall)
89 mov r2=r37
90 break 0x1000
91 br.ret.sptk.many b0
92 ;;
93END(__hypercall)