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 | |
| 12 | // misc.c |
| 13 | extern int PlatformRunningOn; |
| 14 | |
| 15 | static inline int runningOnQEMU(void) { |
| 16 | return CONFIG_QEMU || ( |
| 17 | CONFIG_QEMU_HARDWARE && GET_GLOBAL(PlatformRunningOn) & PF_QEMU); |
| 18 | } |
| 19 | static inline int runningOnXen(void) { |
| 20 | return CONFIG_XEN && GET_GLOBAL(PlatformRunningOn) & PF_XEN; |
| 21 | } |
Kevin O'Connor | 7b5bc50 | 2013-02-09 13:07:23 -0500 | [diff] [blame] | 22 | static inline int runningOnKVM(void) { |
| 23 | return CONFIG_QEMU && GET_GLOBAL(PlatformRunningOn) & PF_KVM; |
Kevin O'Connor | e7cc764 | 2009-10-04 10:05:16 -0400 | [diff] [blame] | 24 | } |
| 25 | |
Kevin O'Connor | 8ed2e53 | 2013-01-21 02:32:48 -0500 | [diff] [blame] | 26 | void qemu_ramsize_preinit(void); |
| 27 | void qemu_biostable_setup(void); |
Kevin O'Connor | d83c87b | 2013-01-21 01:14:12 -0500 | [diff] [blame] | 28 | void qemu_cfg_preinit(void); |
Kevin O'Connor | e7cc764 | 2009-10-04 10:05:16 -0400 | [diff] [blame] | 29 | int qemu_cfg_show_boot_menu(void); |
| 30 | void qemu_cfg_get_uuid(u8 *uuid); |
Kevin O'Connor | 4d2b619 | 2009-10-08 21:37:21 -0400 | [diff] [blame] | 31 | int qemu_cfg_irq0_override(void); |
Kevin O'Connor | cc6dc46 | 2009-10-08 21:18:41 -0400 | [diff] [blame] | 32 | u16 qemu_cfg_acpi_additional_tables(void); |
| 33 | u16 qemu_cfg_next_acpi_table_len(void); |
| 34 | void *qemu_cfg_next_acpi_table_load(void *addr, u16 len); |
Kevin O'Connor | 4e4b410 | 2009-10-08 21:21:59 -0400 | [diff] [blame] | 35 | u16 qemu_cfg_smbios_entries(void); |
| 36 | size_t qemu_cfg_smbios_load_field(int type, size_t offset, void *addr); |
| 37 | int qemu_cfg_smbios_load_external(int type, char **p, unsigned *nr_structs, |
| 38 | unsigned *max_struct_size, char *end); |
Kevin O'Connor | 590e554 | 2009-10-08 22:09:02 -0400 | [diff] [blame] | 39 | int qemu_cfg_get_numa_nodes(void); |
| 40 | void qemu_cfg_get_numa_data(u64 *data, int n); |
Kevin O'Connor | 8470585 | 2009-10-08 22:13:15 -0400 | [diff] [blame] | 41 | u16 qemu_cfg_get_max_cpus(void); |
Jes Sorensen | 0360e8e | 2010-02-16 09:46:08 +0100 | [diff] [blame] | 42 | u32 qemu_cfg_e820_entries(void); |
| 43 | void* qemu_cfg_e820_load_next(void *addr); |
Kevin O'Connor | d83c87b | 2013-01-21 01:14:12 -0500 | [diff] [blame] | 44 | void qemu_romfile_init(void); |
Gerd Hoffmann | c4c9fae | 2009-12-18 12:16:04 +0100 | [diff] [blame] | 45 | |
Kevin O'Connor | e7cc764 | 2009-10-04 10:05:16 -0400 | [diff] [blame] | 46 | #endif |