4 #include "qemu-common.h"
7 /* PC-style peripherals (also used by other machines). */
11 SerialState
*serial_init(int base
, qemu_irq irq
, int baudbase
,
12 CharDriverState
*chr
);
13 SerialState
*serial_mm_init (target_phys_addr_t base
, int it_shift
,
14 qemu_irq irq
, int baudbase
,
15 CharDriverState
*chr
, int ioregister
,
17 SerialState
*serial_isa_init(int index
, CharDriverState
*chr
);
18 void serial_set_frequency(SerialState
*s
, uint32_t frequency
);
22 typedef struct ParallelState ParallelState
;
23 ParallelState
*parallel_init(int index
, CharDriverState
*chr
);
24 ParallelState
*parallel_mm_init(target_phys_addr_t base
, int it_shift
, qemu_irq irq
, CharDriverState
*chr
);
28 typedef struct PicState2 PicState2
;
29 extern PicState2
*isa_pic
;
30 void pic_set_irq(int irq
, int level
);
31 void pic_set_irq_new(void *opaque
, int irq
, int level
);
32 qemu_irq
*i8259_init(qemu_irq parent_irq
);
33 int pic_read_irq(PicState2
*s
);
34 void pic_update_irq(PicState2
*s
);
35 uint32_t pic_intack_read(PicState2
*s
);
36 void pic_info(Monitor
*mon
);
37 void irq_info(Monitor
*mon
);
41 #define PIT_FREQ 1193182
43 typedef struct PITState PITState
;
45 PITState
*pit_init(int base
, qemu_irq irq
);
46 void pit_set_gate(PITState
*pit
, int channel
, int val
);
47 int pit_get_gate(PITState
*pit
, int channel
);
48 int pit_get_initial_count(PITState
*pit
, int channel
);
49 int pit_get_mode(PITState
*pit
, int channel
);
50 int pit_get_out(PITState
*pit
, int channel
, int64_t current_time
);
52 void hpet_pit_disable(void);
53 void hpet_pit_enable(void);
56 void vmport_init(void);
57 void vmport_register(unsigned char command
, IOPortReadFunc
*func
, void *opaque
);
60 void *vmmouse_init(void *m
);
64 void i8042_init(qemu_irq kbd_irq
, qemu_irq mouse_irq
, uint32_t io_base
);
65 void i8042_mm_init(qemu_irq kbd_irq
, qemu_irq mouse_irq
,
66 target_phys_addr_t base
, ram_addr_t size
,
67 target_phys_addr_t mask
);
71 typedef struct RTCState RTCState
;
73 RTCState
*rtc_init(int base_year
);
74 void rtc_set_memory(RTCState
*s
, int addr
, int val
);
75 void rtc_set_date(RTCState
*s
, const struct tm
*tm
);
78 extern int fd_bootchk
;
80 void ioport_set_a20(int enable
);
81 int ioport_get_a20(void);
84 extern int acpi_enabled
;
85 extern char *acpi_tables
;
86 extern size_t acpi_tables_len
;
88 void acpi_bios_init(void);
89 int acpi_table_add(const char *table_desc
);
93 i2c_bus
*piix4_pm_init(PCIBus
*bus
, int devfn
, uint32_t smb_io_base
,
94 qemu_irq sci_irq
, qemu_irq cmos_s3
, qemu_irq smi_irq
,
96 void piix4_smbus_register_device(SMBusDevice
*dev
, uint8_t addr
);
97 void piix4_acpi_system_hot_add_init(PCIBus
*bus
);
103 void pcspk_init(PITState
*);
104 int pcspk_audio_init(qemu_irq
*pic
);
107 struct PCII440FXState
;
108 typedef struct PCII440FXState PCII440FXState
;
110 PCIBus
*i440fx_init(PCII440FXState
**pi440fx_state
, int *piix_devfn
, qemu_irq
*pic
);
111 void i440fx_set_smm(PCII440FXState
*d
, int val
);
112 void i440fx_init_memory_mappings(PCII440FXState
*d
);
115 extern PCIDevice
*piix4_dev
;
116 int piix4_init(PCIBus
*bus
, int devfn
);
119 enum vga_retrace_method
{
124 extern enum vga_retrace_method vga_retrace_method
;
126 int isa_vga_init(void);
127 int pci_vga_init(PCIBus
*bus
,
128 unsigned long vga_bios_offset
, int vga_bios_size
);
129 int isa_vga_mm_init(target_phys_addr_t vram_base
,
130 target_phys_addr_t ctrl_base
, int it_shift
);
133 void pci_cirrus_vga_init(PCIBus
*bus
);
134 void isa_cirrus_vga_init(void);
138 void isa_ne2000_init(int base
, int irq
, NICInfo
*nd
);
142 #define E820_RESERVED 2
145 #define E820_UNUSABLE 5
147 int e820_add_entry(uint64_t, uint64_t, uint32_t);