Kevin O'Connor | e7cc764 | 2009-10-04 10:05:16 -0400 | [diff] [blame] | 1 | #ifndef __PV_H |
| 2 | #define __PV_H |
| 3 | |
Kevin O'Connor | 02313b2 | 2013-02-07 22:42:25 -0500 | [diff] [blame] | 4 | #include "config.h" // CONFIG_* |
Kevin O'Connor | 02313b2 | 2013-02-07 22:42:25 -0500 | [diff] [blame] | 5 | #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'Connor | 7b5bc50 | 2013-02-09 13:07:23 -0500 | [diff] [blame] | 10 | #define PF_KVM (1<<2) |
Kevin O'Connor | 02313b2 | 2013-02-07 22:42:25 -0500 | [diff] [blame] | 11 | |
Kevin O'Connor | f85e4bc | 2013-02-19 01:33:45 -0500 | [diff] [blame] | 12 | extern u32 RamSize; |
| 13 | extern u64 RamSizeOver4G; |
Kevin O'Connor | 02313b2 | 2013-02-07 22:42:25 -0500 | [diff] [blame] | 14 | extern int PlatformRunningOn; |
| 15 | |
| 16 | static inline int runningOnQEMU(void) { |
| 17 | return CONFIG_QEMU || ( |
| 18 | CONFIG_QEMU_HARDWARE && GET_GLOBAL(PlatformRunningOn) & PF_QEMU); |
| 19 | } |
| 20 | static inline int runningOnXen(void) { |
| 21 | return CONFIG_XEN && GET_GLOBAL(PlatformRunningOn) & PF_XEN; |
| 22 | } |
Kevin O'Connor | 7b5bc50 | 2013-02-09 13:07:23 -0500 | [diff] [blame] | 23 | static inline int runningOnKVM(void) { |
| 24 | return CONFIG_QEMU && GET_GLOBAL(PlatformRunningOn) & PF_KVM; |
Kevin O'Connor | e7cc764 | 2009-10-04 10:05:16 -0400 | [diff] [blame] | 25 | } |
| 26 | |
Kevin O'Connor | a2a86e2 | 2013-02-13 19:35:12 -0500 | [diff] [blame] | 27 | void qemu_preinit(void); |
| 28 | void qemu_platform_setup(void); |
Kevin O'Connor | b840ba9 | 2013-02-09 20:09:22 -0500 | [diff] [blame] | 29 | void qemu_cfg_init(void); |
Gerd Hoffmann | c4c9fae | 2009-12-18 12:16:04 +0100 | [diff] [blame] | 30 | |
Kevin O'Connor | e7cc764 | 2009-10-04 10:05:16 -0400 | [diff] [blame] | 31 | #endif |