root / hw / pc.h @ 78895427
History | View | Annotate | Download (5.1 kB)
1 | 87ecb68b | pbrook | #ifndef HW_PC_H
|
---|---|---|---|
2 | 87ecb68b | pbrook | #define HW_PC_H
|
3 | 376253ec | aliguori | |
4 | 376253ec | aliguori | #include "qemu-common.h" |
5 | 35bed8ee | Paul Brook | #include "ioport.h" |
6 | 845773ab | Isaku Yamahata | #include "isa.h" |
7 | 845773ab | Isaku Yamahata | #include "fdc.h" |
8 | 376253ec | aliguori | |
9 | 87ecb68b | pbrook | /* PC-style peripherals (also used by other machines). */
|
10 | 87ecb68b | pbrook | |
11 | 87ecb68b | pbrook | /* serial.c */
|
12 | 87ecb68b | pbrook | |
13 | b6cd0ea1 | aurel32 | SerialState *serial_init(int base, qemu_irq irq, int baudbase, |
14 | b6cd0ea1 | aurel32 | CharDriverState *chr); |
15 | c227f099 | Anthony Liguori | SerialState *serial_mm_init (target_phys_addr_t base, int it_shift,
|
16 | b6cd0ea1 | aurel32 | qemu_irq irq, int baudbase,
|
17 | 2d48377a | Blue Swirl | CharDriverState *chr, int ioregister,
|
18 | 2d48377a | Blue Swirl | int be);
|
19 | ac0be998 | Gerd Hoffmann | SerialState *serial_isa_init(int index, CharDriverState *chr);
|
20 | 038eaf82 | Stefan Weil | void serial_set_frequency(SerialState *s, uint32_t frequency);
|
21 | 87ecb68b | pbrook | |
22 | 87ecb68b | pbrook | /* parallel.c */
|
23 | 87ecb68b | pbrook | |
24 | 87ecb68b | pbrook | typedef struct ParallelState ParallelState; |
25 | 021f0674 | Gerd Hoffmann | ParallelState *parallel_init(int index, CharDriverState *chr);
|
26 | c227f099 | Anthony Liguori | ParallelState *parallel_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq, CharDriverState *chr);
|
27 | 87ecb68b | pbrook | |
28 | 87ecb68b | pbrook | /* i8259.c */
|
29 | 87ecb68b | pbrook | |
30 | 87ecb68b | pbrook | typedef struct PicState2 PicState2; |
31 | 87ecb68b | pbrook | extern PicState2 *isa_pic;
|
32 | 87ecb68b | pbrook | void pic_set_irq(int irq, int level); |
33 | 87ecb68b | pbrook | void pic_set_irq_new(void *opaque, int irq, int level); |
34 | 87ecb68b | pbrook | qemu_irq *i8259_init(qemu_irq parent_irq); |
35 | 87ecb68b | pbrook | int pic_read_irq(PicState2 *s);
|
36 | 87ecb68b | pbrook | void pic_update_irq(PicState2 *s);
|
37 | 87ecb68b | pbrook | uint32_t pic_intack_read(PicState2 *s); |
38 | 376253ec | aliguori | void pic_info(Monitor *mon);
|
39 | 376253ec | aliguori | void irq_info(Monitor *mon);
|
40 | 87ecb68b | pbrook | |
41 | 845773ab | Isaku Yamahata | /* ISA */
|
42 | 96051119 | Blue Swirl | #define IOAPIC_NUM_PINS 0x18 |
43 | 96051119 | Blue Swirl | |
44 | 845773ab | Isaku Yamahata | typedef struct isa_irq_state { |
45 | 845773ab | Isaku Yamahata | qemu_irq *i8259; |
46 | 96051119 | Blue Swirl | qemu_irq ioapic[IOAPIC_NUM_PINS]; |
47 | 845773ab | Isaku Yamahata | } IsaIrqState; |
48 | 845773ab | Isaku Yamahata | |
49 | 845773ab | Isaku Yamahata | void isa_irq_handler(void *opaque, int n, int level); |
50 | 845773ab | Isaku Yamahata | |
51 | 87ecb68b | pbrook | /* i8254.c */
|
52 | 87ecb68b | pbrook | |
53 | 87ecb68b | pbrook | #define PIT_FREQ 1193182 |
54 | 87ecb68b | pbrook | |
55 | 87ecb68b | pbrook | typedef struct PITState PITState; |
56 | 87ecb68b | pbrook | |
57 | 87ecb68b | pbrook | PITState *pit_init(int base, qemu_irq irq);
|
58 | 87ecb68b | pbrook | void pit_set_gate(PITState *pit, int channel, int val); |
59 | 87ecb68b | pbrook | int pit_get_gate(PITState *pit, int channel); |
60 | 87ecb68b | pbrook | int pit_get_initial_count(PITState *pit, int channel); |
61 | 87ecb68b | pbrook | int pit_get_mode(PITState *pit, int channel); |
62 | 87ecb68b | pbrook | int pit_get_out(PITState *pit, int channel, int64_t current_time); |
63 | 87ecb68b | pbrook | |
64 | bf4f74c0 | aurel32 | void hpet_pit_disable(void); |
65 | bf4f74c0 | aurel32 | void hpet_pit_enable(void); |
66 | bf4f74c0 | aurel32 | |
67 | 87ecb68b | pbrook | /* vmport.c */
|
68 | 26fb5e48 | aurel32 | void vmport_init(void); |
69 | 87ecb68b | pbrook | void vmport_register(unsigned char command, IOPortReadFunc *func, void *opaque); |
70 | 87ecb68b | pbrook | |
71 | 87ecb68b | pbrook | /* vmmouse.c */
|
72 | 87ecb68b | pbrook | void *vmmouse_init(void *m); |
73 | 87ecb68b | pbrook | |
74 | 87ecb68b | pbrook | /* pckbd.c */
|
75 | 87ecb68b | pbrook | |
76 | 87ecb68b | pbrook | void i8042_init(qemu_irq kbd_irq, qemu_irq mouse_irq, uint32_t io_base);
|
77 | 87ecb68b | pbrook | void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
|
78 | c227f099 | Anthony Liguori | target_phys_addr_t base, ram_addr_t size, |
79 | c227f099 | Anthony Liguori | target_phys_addr_t mask); |
80 | 956a3e6b | Blue Swirl | void i8042_isa_mouse_fake_event(void *opaque); |
81 | 956a3e6b | Blue Swirl | void i8042_setup_a20_line(ISADevice *dev, qemu_irq *a20_out);
|
82 | 87ecb68b | pbrook | |
83 | 87ecb68b | pbrook | /* pc.c */
|
84 | 87ecb68b | pbrook | extern int fd_bootchk; |
85 | 87ecb68b | pbrook | |
86 | 8e78eb28 | Isaku Yamahata | void pc_register_ferr_irq(qemu_irq irq);
|
87 | 845773ab | Isaku Yamahata | void pc_cmos_set_s3_resume(void *opaque, int irq, int level); |
88 | 845773ab | Isaku Yamahata | void pc_acpi_smi_interrupt(void *opaque, int irq, int level); |
89 | 845773ab | Isaku Yamahata | |
90 | 845773ab | Isaku Yamahata | void pc_cpus_init(const char *cpu_model); |
91 | 845773ab | Isaku Yamahata | void pc_memory_init(ram_addr_t ram_size,
|
92 | 845773ab | Isaku Yamahata | const char *kernel_filename, |
93 | 845773ab | Isaku Yamahata | const char *kernel_cmdline, |
94 | 845773ab | Isaku Yamahata | const char *initrd_filename, |
95 | 845773ab | Isaku Yamahata | ram_addr_t *below_4g_mem_size_p, |
96 | 845773ab | Isaku Yamahata | ram_addr_t *above_4g_mem_size_p); |
97 | 845773ab | Isaku Yamahata | qemu_irq *pc_allocate_cpu_irq(void);
|
98 | 845773ab | Isaku Yamahata | void pc_vga_init(PCIBus *pci_bus);
|
99 | 845773ab | Isaku Yamahata | void pc_basic_device_init(qemu_irq *isa_irq,
|
100 | 845773ab | Isaku Yamahata | FDCtrl **floppy_controller, |
101 | 1d914fa0 | Isaku Yamahata | ISADevice **rtc_state); |
102 | 845773ab | Isaku Yamahata | void pc_init_ne2k_isa(NICInfo *nd);
|
103 | 845773ab | Isaku Yamahata | #ifdef HAS_AUDIO
|
104 | 845773ab | Isaku Yamahata | void pc_audio_init (PCIBus *pci_bus, qemu_irq *pic);
|
105 | 845773ab | Isaku Yamahata | #endif
|
106 | 845773ab | Isaku Yamahata | void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
|
107 | c0897e0c | Markus Armbruster | const char *boot_device, |
108 | c0897e0c | Markus Armbruster | BusState *ide0, BusState *ide1, |
109 | 1d914fa0 | Isaku Yamahata | FDCtrl *floppy_controller, ISADevice *s); |
110 | 845773ab | Isaku Yamahata | void pc_pci_device_init(PCIBus *pci_bus);
|
111 | 8e78eb28 | Isaku Yamahata | |
112 | f885f1ea | Isaku Yamahata | typedef void (*cpu_set_smm_t)(int smm, void *arg); |
113 | f885f1ea | Isaku Yamahata | void cpu_smm_register(cpu_set_smm_t callback, void *arg); |
114 | f885f1ea | Isaku Yamahata | |
115 | 87ecb68b | pbrook | /* acpi.c */
|
116 | 87ecb68b | pbrook | extern int acpi_enabled; |
117 | 80deece2 | blueswir1 | extern char *acpi_tables; |
118 | 80deece2 | blueswir1 | extern size_t acpi_tables_len;
|
119 | 80deece2 | blueswir1 | |
120 | 9d5e77a2 | Isaku Yamahata | void acpi_bios_init(void); |
121 | 9d5e77a2 | Isaku Yamahata | int acpi_table_add(const char *table_desc); |
122 | 9d5e77a2 | Isaku Yamahata | |
123 | 9d5e77a2 | Isaku Yamahata | /* acpi_piix.c */
|
124 | 53b67b30 | Blue Swirl | |
125 | cf7a2fe2 | aurel32 | i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
|
126 | 53b67b30 | Blue Swirl | qemu_irq sci_irq, qemu_irq cmos_s3, qemu_irq smi_irq, |
127 | 53b67b30 | Blue Swirl | int kvm_enabled);
|
128 | 87ecb68b | pbrook | void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);
|
129 | 87ecb68b | pbrook | |
130 | 16b29ae1 | aliguori | /* hpet.c */
|
131 | 16b29ae1 | aliguori | extern int no_hpet; |
132 | 16b29ae1 | aliguori | |
133 | 87ecb68b | pbrook | /* pcspk.c */
|
134 | 87ecb68b | pbrook | void pcspk_init(PITState *);
|
135 | 22d83b14 | Paul Brook | int pcspk_audio_init(qemu_irq *pic);
|
136 | 87ecb68b | pbrook | |
137 | 87ecb68b | pbrook | /* piix_pci.c */
|
138 | 0a3bacf3 | Juan Quintela | struct PCII440FXState;
|
139 | 0a3bacf3 | Juan Quintela | typedef struct PCII440FXState PCII440FXState; |
140 | 0a3bacf3 | Juan Quintela | |
141 | 97679527 | Avi Kivity | PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn, qemu_irq *pic, ram_addr_t ram_size);
|
142 | 0a3bacf3 | Juan Quintela | void i440fx_init_memory_mappings(PCII440FXState *d);
|
143 | 87ecb68b | pbrook | |
144 | 823e675a | Juan Quintela | /* piix4.c */
|
145 | b1d8e52e | blueswir1 | extern PCIDevice *piix4_dev;
|
146 | 87ecb68b | pbrook | int piix4_init(PCIBus *bus, int devfn); |
147 | 87ecb68b | pbrook | |
148 | 87ecb68b | pbrook | /* vga.c */
|
149 | cb5a7aa8 | malc | enum vga_retrace_method {
|
150 | cb5a7aa8 | malc | VGA_RETRACE_DUMB, |
151 | cb5a7aa8 | malc | VGA_RETRACE_PRECISE |
152 | cb5a7aa8 | malc | }; |
153 | cb5a7aa8 | malc | |
154 | cb5a7aa8 | malc | extern enum vga_retrace_method vga_retrace_method; |
155 | 87ecb68b | pbrook | |
156 | fbe1b595 | Paul Brook | int isa_vga_init(void); |
157 | 78895427 | Gerd Hoffmann | int pci_vga_init(PCIBus *bus);
|
158 | c227f099 | Anthony Liguori | int isa_vga_mm_init(target_phys_addr_t vram_base,
|
159 | c227f099 | Anthony Liguori | target_phys_addr_t ctrl_base, int it_shift);
|
160 | 87ecb68b | pbrook | |
161 | 87ecb68b | pbrook | /* cirrus_vga.c */
|
162 | fbe1b595 | Paul Brook | void pci_cirrus_vga_init(PCIBus *bus);
|
163 | fbe1b595 | Paul Brook | void isa_cirrus_vga_init(void); |
164 | 87ecb68b | pbrook | |
165 | 87ecb68b | pbrook | /* ne2000.c */
|
166 | 87ecb68b | pbrook | |
167 | 9453c5bc | Gerd Hoffmann | void isa_ne2000_init(int base, int irq, NICInfo *nd); |
168 | 87ecb68b | pbrook | |
169 | 4c5b10b7 | Jes Sorensen | /* e820 types */
|
170 | 4c5b10b7 | Jes Sorensen | #define E820_RAM 1 |
171 | 4c5b10b7 | Jes Sorensen | #define E820_RESERVED 2 |
172 | 4c5b10b7 | Jes Sorensen | #define E820_ACPI 3 |
173 | 4c5b10b7 | Jes Sorensen | #define E820_NVS 4 |
174 | 4c5b10b7 | Jes Sorensen | #define E820_UNUSABLE 5 |
175 | 4c5b10b7 | Jes Sorensen | |
176 | 4c5b10b7 | Jes Sorensen | int e820_add_entry(uint64_t, uint64_t, uint32_t);
|
177 | 4c5b10b7 | Jes Sorensen | |
178 | 87ecb68b | pbrook | #endif |