blob: 96b35ba76084387529b78b5de04de7fac009b60f [file] [log] [blame]
Kevin O'Connore7cc7642009-10-04 10:05:16 -04001#ifndef __PV_H
2#define __PV_H
3
Kevin O'Connor02313b22013-02-07 22:42:25 -05004#include "config.h" // CONFIG_*
Kevin O'Connor02313b22013-02-07 22:42:25 -05005#include "biosvar.h" // GET_GLOBAL
6
7// Types of paravirtualized platforms.
8#define PF_QEMU (1<<0)
9#define PF_XEN (1<<1)
Kevin O'Connor7b5bc502013-02-09 13:07:23 -050010#define PF_KVM (1<<2)
Kevin O'Connor02313b22013-02-07 22:42:25 -050011
12// misc.c
13extern int PlatformRunningOn;
14
15static inline int runningOnQEMU(void) {
16 return CONFIG_QEMU || (
17 CONFIG_QEMU_HARDWARE && GET_GLOBAL(PlatformRunningOn) & PF_QEMU);
18}
19static inline int runningOnXen(void) {
20 return CONFIG_XEN && GET_GLOBAL(PlatformRunningOn) & PF_XEN;
21}
Kevin O'Connor7b5bc502013-02-09 13:07:23 -050022static inline int runningOnKVM(void) {
23 return CONFIG_QEMU && GET_GLOBAL(PlatformRunningOn) & PF_KVM;
Kevin O'Connore7cc7642009-10-04 10:05:16 -040024}
25
Kevin O'Connora2a86e22013-02-13 19:35:12 -050026void qemu_preinit(void);
27void qemu_platform_setup(void);
Kevin O'Connorb840ba92013-02-09 20:09:22 -050028void qemu_cfg_init(void);
Gerd Hoffmannc4c9fae2009-12-18 12:16:04 +010029
Kevin O'Connore7cc7642009-10-04 10:05:16 -040030#endif