1 /*
2  * pv/domain.h
3  *
4  * PV guest interface definitions
5  *
6  * Copyright (C) 2017 Wei Liu <wei.liu2@citrix.com>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms and conditions of the GNU General Public
10  * License, version 2, as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public
18  * License along with this program; If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __X86_PV_DOMAIN_H__
22 #define __X86_PV_DOMAIN_H__
23 
24 #ifdef CONFIG_PV
25 
26 void pv_vcpu_destroy(struct vcpu *v);
27 int pv_vcpu_initialise(struct vcpu *v);
28 void pv_domain_destroy(struct domain *d);
29 int pv_domain_initialise(struct domain *d, unsigned int domcr_flags,
30                          struct xen_arch_domainconfig *config);
31 
32 #else  /* !CONFIG_PV */
33 
34 #include <xen/errno.h>
35 
pv_vcpu_destroy(struct vcpu * v)36 static inline void pv_vcpu_destroy(struct vcpu *v) {}
pv_vcpu_initialise(struct vcpu * v)37 static inline int pv_vcpu_initialise(struct vcpu *v) { return -EOPNOTSUPP; }
pv_domain_destroy(struct domain * d)38 static inline void pv_domain_destroy(struct domain *d) {}
39 static inline int pv_domain_initialise(struct domain *d,
40                                        unsigned int domcr_flags,
41                                        struct xen_arch_domainconfig *config);
42 {
43     return -EOPNOTSUPP;
44 }
45 #endif	/* CONFIG_PV */
46 
47 void paravirt_ctxt_switch_from(struct vcpu *v);
48 void paravirt_ctxt_switch_to(struct vcpu *v);
49 
50 #endif	/* __X86_PV_DOMAIN_H__ */
51 
52 /*
53  * Local variables:
54  * mode: C
55  * c-file-style: "BSD"
56  * c-basic-offset: 4
57  * tab-width: 4
58  * indent-tabs-mode: nil
59  * End:
60  */
61