1 #ifndef __HVMLOADER_CONFIG_H__
2 #define __HVMLOADER_CONFIG_H__
3 
4 #include <stdint.h>
5 
6 enum virtual_vga { VGA_none, VGA_std, VGA_cirrus, VGA_pt };
7 extern enum virtual_vga virtual_vga;
8 
9 extern unsigned long igd_opregion_pgbase;
10 #define IGD_OPREGION_PAGES 3
11 
12 struct bios_config {
13     const char *name;
14 
15     /* BIOS ROM image bits */
16     void *image;
17     unsigned int image_size;
18 
19     /* Physical address to load at */
20     unsigned int bios_address;
21 
22     /* ROMS */
23     void (*load_roms)(void);
24 
25     void (*bios_load)(const struct bios_config *config, void *addr, uint32_t size);
26 
27     void (*bios_info_setup)(void);
28     void (*bios_info_finish)(void);
29 
30     void (*e820_setup)(void);
31 
32     void (*acpi_build_tables)(void);
33     void (*create_mp_tables)(void);
34     void (*create_smbios_tables)(void);
35     void (*create_pir_tables)(void);
36 };
37 
38 extern struct bios_config rombios_config;
39 extern struct bios_config seabios_config;
40 extern struct bios_config ovmf_config;
41 
42 #define PAGE_SHIFT 12
43 #define PAGE_SIZE  (1ul << PAGE_SHIFT)
44 
45 extern uint32_t ioapic_base_address;
46 extern uint8_t ioapic_version;
47 
48 #define IOAPIC_ID           0x01
49 
50 #define LAPIC_BASE_ADDRESS  0xfee00000
51 #define LAPIC_ID(vcpu_id)   ((vcpu_id) * 2)
52 
53 #define PCI_ISA_DEVFN       0x08    /* dev 1, fn 0 */
54 #define PCI_ISA_IRQ_MASK    0x0c20U /* ISA IRQs 5,10,11 are PCI connected */
55 
56 /* MMIO hole: Hardcoded defaults, which can be dynamically expanded. */
57 #define PCI_MEM_END         0xfc000000
58 
59 #define ACPI_TIS_HDR_ADDRESS 0xFED40F00UL
60 
61 extern unsigned long pci_mem_start, pci_mem_end;
62 extern uint64_t pci_hi_mem_start, pci_hi_mem_end;
63 
64 /* Memory map. */
65 #define SCRATCH_PHYSICAL_ADDRESS      0x00010000
66 #define HYPERCALL_PHYSICAL_ADDRESS    0x00080000
67 #define VGABIOS_PHYSICAL_ADDRESS      0x000C0000
68 #define HVMLOADER_PHYSICAL_ADDRESS    0x00100000
69 /* Special BIOS mappings, etc. are allocated from here upwards... */
70 #define RESERVED_MEMBASE              0xFC000000
71 /* NB. ACPI_INFO_PHYSICAL_ADDRESS *MUST* match definition in acpi/dsdt.asl! */
72 #define ACPI_INFO_PHYSICAL_ADDRESS    0xFC000000
73 #define RESERVED_MEMORY_DYNAMIC_START 0xFC001000
74 #define RESERVED_MEMORY_DYNAMIC_END   0xFE000000
75 /*
76  * GUEST_RESERVED: Physical address space reserved for guest use.
77  * This is not dynamically advertised to guests, so this range must *never*
78  * be used for any purpose by us, in future. It must always be marked as
79  * reserved in the memory map (e.g., E820_RESERVED) so that mechanisms such
80  * as PCI BAR remapping do not allocate from this region.
81  */
82 #define GUEST_RESERVED_START          0xFE700000
83 #define GUEST_RESERVED_END            0xFE800000
84 
85 extern unsigned long scratch_start;
86 
87 #endif /* __HVMLOADER_CONFIG_H__ */
88 
89 /*
90  * Local variables:
91  * mode: C
92  * c-file-style: "BSD"
93  * c-basic-offset: 4
94  * tab-width: 4
95  * indent-tabs-mode: nil
96  * End:
97  */
98