blob: 69d724865bda932667aae2137826d9e49588d0cc [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'Connor4ade5232013-09-18 21:41:48 -040027// Common paravirt ports.
28#define PORT_SMI_CMD 0x00b2
29#define PORT_SMI_STATUS 0x00b3
30#define PORT_QEMU_CFG_CTL 0x0510
31#define PORT_QEMU_CFG_DATA 0x0511
32#define PORT_ACPI_PM_BASE 0xb000
33#define PORT_SMB_BASE 0xb100
34#define PORT_BIOS_APM 0x8900
35
Kevin O'Connora2a86e22013-02-13 19:35:12 -050036void qemu_preinit(void);
37void qemu_platform_setup(void);
Kevin O'Connorb840ba92013-02-09 20:09:22 -050038void qemu_cfg_init(void);
Gerd Hoffmannc4c9fae2009-12-18 12:16:04 +010039
Kevin O'Connore7cc7642009-10-04 10:05:16 -040040#endif