xen-os.h (8dee0e9bd64849deca80da9052c806e764ef026c) xen-os.h (cfa0b7b82fbdda56d7160569def5c6133eb045aa)
1/******************************************************************************
2 * xen/xen-os.h
3 *
4 * Random collection of macros and definition
5 *
6 * Copyright (c) 2003, 2004 Keir Fraser (on behalf of the Xen team)
7 * All rights reserved.
8 *

--- 26 unchanged lines hidden (view full) ---

35#endif
36
37#define GRANT_REF_INVALID 0xffffffff
38
39#ifdef LOCORE
40#define __ASSEMBLY__
41#endif
42
1/******************************************************************************
2 * xen/xen-os.h
3 *
4 * Random collection of macros and definition
5 *
6 * Copyright (c) 2003, 2004 Keir Fraser (on behalf of the Xen team)
7 * All rights reserved.
8 *

--- 26 unchanged lines hidden (view full) ---

35#endif
36
37#define GRANT_REF_INVALID 0xffffffff
38
39#ifdef LOCORE
40#define __ASSEMBLY__
41#endif
42
43#include <machine/xen/xen-os.h>
44
45#include <xen/interface/xen.h>
46
43#include <xen/interface/xen.h>
44
45#ifndef __ASSEMBLY__
46#include <xen/interface/event_channel.h>
47
48struct hypervisor_info {
49 vm_paddr_t (*get_xenstore_mfn)(void);
50 evtchn_port_t (*get_xenstore_evtchn)(void);
51 vm_paddr_t (*get_console_mfn)(void);
52 evtchn_port_t (*get_console_evtchn)(void);
53 uint32_t (*get_start_flags)(void);
54};
55extern struct hypervisor_info hypervisor_info;
56
57static inline vm_paddr_t
58xen_get_xenstore_mfn(void)
59{
60
61 return (hypervisor_info.get_xenstore_mfn());
62}
63
64static inline evtchn_port_t
65xen_get_xenstore_evtchn(void)
66{
67
68 return (hypervisor_info.get_xenstore_evtchn());
69}
70
71static inline vm_paddr_t
72xen_get_console_mfn(void)
73{
74
75 return (hypervisor_info.get_console_mfn());
76}
77
78static inline evtchn_port_t
79xen_get_console_evtchn(void)
80{
81
82 return (hypervisor_info.get_console_evtchn());
83}
84
85static inline uint32_t
86xen_get_start_flags(void)
87{
88
89 return (hypervisor_info.get_start_flags());
90}
91#endif
92
93#include <machine/xen/xen-os.h>
94
47/* Everything below this point is not included by assembler (.S) files. */
48#ifndef __ASSEMBLY__
49
50extern shared_info_t *HYPERVISOR_shared_info;
95/* Everything below this point is not included by assembler (.S) files. */
96#ifndef __ASSEMBLY__
97
98extern shared_info_t *HYPERVISOR_shared_info;
51extern start_info_t *HYPERVISOR_start_info;
52
99
53/* XXX: we need to get rid of this and use HYPERVISOR_start_info directly */
54extern char *console_page;
55
56extern int xen_disable_pv_disks;
57extern int xen_disable_pv_nics;
58
59extern bool xen_suspend_cancelled;
60
61enum xen_domain_type {
62 XEN_NATIVE, /* running on bare hardware */
63 XEN_PV_DOMAIN, /* running in a PV domain */

--- 18 unchanged lines hidden (view full) ---

82xen_hvm_domain(void)
83{
84 return (xen_domain_type == XEN_HVM_DOMAIN);
85}
86
87static inline bool
88xen_initial_domain(void)
89{
100extern int xen_disable_pv_disks;
101extern int xen_disable_pv_nics;
102
103extern bool xen_suspend_cancelled;
104
105enum xen_domain_type {
106 XEN_NATIVE, /* running on bare hardware */
107 XEN_PV_DOMAIN, /* running in a PV domain */

--- 18 unchanged lines hidden (view full) ---

126xen_hvm_domain(void)
127{
128 return (xen_domain_type == XEN_HVM_DOMAIN);
129}
130
131static inline bool
132xen_initial_domain(void)
133{
90 return (xen_domain() && HYPERVISOR_start_info != NULL &&
91 (HYPERVISOR_start_info->flags & SIF_INITDOMAIN) != 0);
134
135 return (xen_domain() && (xen_get_start_flags() & SIF_INITDOMAIN) != 0);
92}
93
94/*
95 * Based on ofed/include/linux/bitops.h
96 *
97 * Those helpers are prefixed by xen_ because xen-os.h is widely included
98 * and we don't want the other drivers using them.
99 *

--- 48 unchanged lines hidden ---
136}
137
138/*
139 * Based on ofed/include/linux/bitops.h
140 *
141 * Those helpers are prefixed by xen_ because xen-os.h is widely included
142 * and we don't want the other drivers using them.
143 *

--- 48 unchanged lines hidden ---