summaryrefslogtreecommitdiff
path: root/xen/arch/x86/include/asm/pv/shim.h
blob: 5625b90b72bde9af909d213c88d492d572dbbf25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/* SPDX-License-Identifier: GPL-2.0-only */
/******************************************************************************
 * asm-x86/guest/shim.h
 *
 * Copyright (c) 2017 Citrix Systems Ltd.
 */

#ifndef __X86_PV_SHIM_H__
#define __X86_PV_SHIM_H__

#include <xen/hypercall.h>
#include <xen/types.h>

#if defined(CONFIG_PV_SHIM_EXCLUSIVE)
# define pv_shim 1
#elif defined(CONFIG_PV_SHIM)
extern bool pv_shim;
#else
# define pv_shim 0
#endif /* CONFIG_PV_SHIM{,_EXCLUSIVE} */

#ifdef CONFIG_PV_SHIM

void pv_shim_setup_dom(struct domain *d, l4_pgentry_t *l4start,
                       unsigned long va_start, unsigned long store_va,
                       unsigned long console_va, unsigned long vphysmap,
                       start_info_t *si);
int pv_shim_shutdown(uint8_t reason);
void pv_shim_inject_evtchn(unsigned int port);
long cf_check pv_shim_cpu_up(void *data);
long cf_check pv_shim_cpu_down(void *data);
void pv_shim_online_memory(unsigned int nr, unsigned int order);
void pv_shim_offline_memory(unsigned int nr, unsigned int order);
domid_t get_initial_domain_id(void);
uint64_t pv_shim_mem(uint64_t avail);
void pv_shim_fixup_e820(struct e820map *e820);
const struct platform_bad_page *pv_shim_reserved_pages(unsigned int *size);
typeof(do_event_channel_op) pv_shim_event_channel_op;
typeof(do_grant_table_op) pv_shim_grant_table_op;

#else

static inline void pv_shim_setup_dom(struct domain *d, l4_pgentry_t *l4start,
                                     unsigned long va_start,
                                     unsigned long store_va,
                                     unsigned long console_va,
                                     unsigned long vphysmap,
                                     start_info_t *si)
{
    ASSERT_UNREACHABLE();
}
static inline int pv_shim_shutdown(uint8_t reason)
{
    ASSERT_UNREACHABLE();
    return 0;
}
static inline void pv_shim_inject_evtchn(unsigned int port)
{
    ASSERT_UNREACHABLE();
}
static inline long cf_check pv_shim_cpu_up(void *data)
{
    ASSERT_UNREACHABLE();
    return 0;
}
static inline long cf_check pv_shim_cpu_down(void *data)
{
    ASSERT_UNREACHABLE();
    return 0;
}
static inline void pv_shim_online_memory(unsigned int nr, unsigned int order)
{
    ASSERT_UNREACHABLE();
}
static inline void pv_shim_offline_memory(unsigned int nr, unsigned int order)
{
    ASSERT_UNREACHABLE();
}
static inline domid_t get_initial_domain_id(void)
{
    return 0;
}
static inline uint64_t pv_shim_mem(uint64_t avail)
{
    ASSERT_UNREACHABLE();
    return 0;
}
static inline void pv_shim_fixup_e820(struct e820map *e820)
{
    ASSERT_UNREACHABLE();
}
static inline const struct platform_bad_page *
pv_shim_reserved_pages(unsigned int *s)
{
    ASSERT_UNREACHABLE();
    return NULL;
}

#endif

#endif /* __X86_PV_SHIM_H__ */

/*
 * Local variables:
 * mode: C
 * c-file-style: "BSD"
 * c-basic-offset: 4
 * tab-width: 4
 * indent-tabs-mode: nil
 * End:
 */