blob: fce5af954934eb95d2f89c8197b0850ac1cc3e90 [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
Kevin O'Connorf85e4bc2013-02-19 01:33:45 -050012extern u32 RamSize;
13extern u64 RamSizeOver4G;
Kevin O'Connor02313b22013-02-07 22:42:25 -050014extern int PlatformRunningOn;
15
16static inline int runningOnQEMU(void) {
17 return CONFIG_QEMU || (
18 CONFIG_QEMU_HARDWARE && GET_GLOBAL(PlatformRunningOn) & PF_QEMU);
19}
20static inline int runningOnXen(void) {
21 return CONFIG_XEN && GET_GLOBAL(PlatformRunningOn) & PF_XEN;
22}
Kevin O'Connor7b5bc502013-02-09 13:07:23 -050023static inline int runningOnKVM(void) {
24 return CONFIG_QEMU && GET_GLOBAL(PlatformRunningOn) & PF_KVM;
Kevin O'Connore7cc7642009-10-04 10:05:16 -040025}
26
Kevin O'Connora2a86e22013-02-13 19:35:12 -050027void qemu_preinit(void);
28void qemu_platform_setup(void);
Kevin O'Connorb840ba92013-02-09 20:09:22 -050029void qemu_cfg_init(void);
Gerd Hoffmannc4c9fae2009-12-18 12:16:04 +010030
Kevin O'Connore7cc7642009-10-04 10:05:16 -040031#endif