1 /*
2 * asm-x86/pv/grant_table.h
3 *
4 * Grant table interfaces for PV guests
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_GRANT_TABLE_H__
22 #define __X86_PV_GRANT_TABLE_H__
23
24 #ifdef CONFIG_PV
25
26 int create_grant_pv_mapping(uint64_t addr, unsigned long frame,
27 unsigned int flags, unsigned int cache_flags);
28 int replace_grant_pv_mapping(uint64_t addr, unsigned long frame,
29 uint64_t new_addr, unsigned int flags);
30
31 #else
32
33 #include <public/grant_table.h>
34
create_grant_pv_mapping(uint64_t addr,unsigned long frame,unsigned int flags,unsigned int cache_flags)35 static inline int create_grant_pv_mapping(uint64_t addr, unsigned long frame,
36 unsigned int flags,
37 unsigned int cache_flags)
38 {
39 return GNTST_general_error;
40 }
41
replace_grant_pv_mapping(uint64_t addr,unsigned long frame,uint64_t new_addr,unsigned int flags)42 static inline int replace_grant_pv_mapping(uint64_t addr, unsigned long frame,
43 uint64_t new_addr, unsigned int flags)
44 {
45 return GNTST_general_error;
46 }
47
48 #endif
49
50 #endif /* __X86_PV_GRANT_TABLE_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