root / hw / pc.h @ 1673ad51
History | View | Annotate | Download (4.3 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 | 376253ec | aliguori | |
6 | 87ecb68b | pbrook | /* PC-style peripherals (also used by other machines). */
|
7 | 87ecb68b | pbrook | |
8 | 87ecb68b | pbrook | /* serial.c */
|
9 | 87ecb68b | pbrook | |
10 | b6cd0ea1 | aurel32 | SerialState *serial_init(int base, qemu_irq irq, int baudbase, |
11 | b6cd0ea1 | aurel32 | CharDriverState *chr); |
12 | c227f099 | Anthony Liguori | SerialState *serial_mm_init (target_phys_addr_t base, int it_shift,
|
13 | b6cd0ea1 | aurel32 | qemu_irq irq, int baudbase,
|
14 | b6cd0ea1 | aurel32 | CharDriverState *chr, int ioregister);
|
15 | ac0be998 | Gerd Hoffmann | SerialState *serial_isa_init(int index, CharDriverState *chr);
|
16 | 038eaf82 | Stefan Weil | void serial_set_frequency(SerialState *s, uint32_t frequency);
|
17 | 87ecb68b | pbrook | |
18 | 87ecb68b | pbrook | /* parallel.c */
|
19 | 87ecb68b | pbrook | |
20 | 87ecb68b | pbrook | typedef struct ParallelState ParallelState; |
21 | 021f0674 | Gerd Hoffmann | ParallelState *parallel_init(int index, CharDriverState *chr);
|
22 | c227f099 | Anthony Liguori | ParallelState *parallel_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq, CharDriverState *chr);
|
23 | 87ecb68b | pbrook | |
24 | 87ecb68b | pbrook | /* i8259.c */
|
25 | 87ecb68b | pbrook | |
26 | 87ecb68b | pbrook | typedef struct PicState2 PicState2; |
27 | 87ecb68b | pbrook | extern PicState2 *isa_pic;
|
28 | 87ecb68b | pbrook | void pic_set_irq(int irq, int level); |
29 | 87ecb68b | pbrook | void pic_set_irq_new(void *opaque, int irq, int level); |
30 | 87ecb68b | pbrook | qemu_irq *i8259_init(qemu_irq parent_irq); |
31 | 87ecb68b | pbrook | int pic_read_irq(PicState2 *s);
|
32 | 87ecb68b | pbrook | void pic_update_irq(PicState2 *s);
|
33 | 87ecb68b | pbrook | uint32_t pic_intack_read(PicState2 *s); |
34 | 376253ec | aliguori | void pic_info(Monitor *mon);
|
35 | 376253ec | aliguori | void irq_info(Monitor *mon);
|
36 | 87ecb68b | pbrook | |
37 | 87ecb68b | pbrook | /* APIC */
|
38 | 87ecb68b | pbrook | typedef struct IOAPICState IOAPICState; |
39 | 610626af | aliguori | void apic_deliver_irq(uint8_t dest, uint8_t dest_mode,
|
40 | 610626af | aliguori | uint8_t delivery_mode, |
41 | 610626af | aliguori | uint8_t vector_num, uint8_t polarity, |
42 | 610626af | aliguori | uint8_t trigger_mode); |
43 | 87ecb68b | pbrook | int apic_init(CPUState *env);
|
44 | 87ecb68b | pbrook | int apic_accept_pic_intr(CPUState *env);
|
45 | 1a7de94a | aurel32 | void apic_deliver_pic_intr(CPUState *env, int level); |
46 | 87ecb68b | pbrook | int apic_get_interrupt(CPUState *env);
|
47 | 1632dc6a | Avi Kivity | qemu_irq *ioapic_init(void);
|
48 | 87ecb68b | pbrook | void ioapic_set_irq(void *opaque, int vector, int level); |
49 | 73822ec8 | aliguori | void apic_reset_irq_delivered(void); |
50 | 73822ec8 | aliguori | int apic_get_irq_delivered(void); |
51 | 87ecb68b | pbrook | |
52 | 87ecb68b | pbrook | /* i8254.c */
|
53 | 87ecb68b | pbrook | |
54 | 87ecb68b | pbrook | #define PIT_FREQ 1193182 |
55 | 87ecb68b | pbrook | |
56 | 87ecb68b | pbrook | typedef struct PITState PITState; |
57 | 87ecb68b | pbrook | |
58 | 87ecb68b | pbrook | PITState *pit_init(int base, qemu_irq irq);
|
59 | 87ecb68b | pbrook | void pit_set_gate(PITState *pit, int channel, int val); |
60 | 87ecb68b | pbrook | int pit_get_gate(PITState *pit, int channel); |
61 | 87ecb68b | pbrook | int pit_get_initial_count(PITState *pit, int channel); |
62 | 87ecb68b | pbrook | int pit_get_mode(PITState *pit, int channel); |
63 | 87ecb68b | pbrook | int pit_get_out(PITState *pit, int channel, int64_t current_time); |
64 | 87ecb68b | pbrook | |
65 | bf4f74c0 | aurel32 | void hpet_pit_disable(void); |
66 | bf4f74c0 | aurel32 | void hpet_pit_enable(void); |
67 | bf4f74c0 | aurel32 | |
68 | 87ecb68b | pbrook | /* vmport.c */
|
69 | 26fb5e48 | aurel32 | void vmport_init(void); |
70 | 87ecb68b | pbrook | void vmport_register(unsigned char command, IOPortReadFunc *func, void *opaque); |
71 | 87ecb68b | pbrook | |
72 | 87ecb68b | pbrook | /* vmmouse.c */
|
73 | 87ecb68b | pbrook | void *vmmouse_init(void *m); |
74 | 87ecb68b | pbrook | |
75 | 87ecb68b | pbrook | /* pckbd.c */
|
76 | 87ecb68b | pbrook | |
77 | 87ecb68b | pbrook | void i8042_init(qemu_irq kbd_irq, qemu_irq mouse_irq, uint32_t io_base);
|
78 | 87ecb68b | pbrook | void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
|
79 | c227f099 | Anthony Liguori | target_phys_addr_t base, ram_addr_t size, |
80 | c227f099 | Anthony Liguori | target_phys_addr_t mask); |
81 | 87ecb68b | pbrook | |
82 | 87ecb68b | pbrook | /* mc146818rtc.c */
|
83 | 87ecb68b | pbrook | |
84 | 87ecb68b | pbrook | typedef struct RTCState RTCState; |
85 | 87ecb68b | pbrook | |
86 | 32e0c826 | Gerd Hoffmann | RTCState *rtc_init(int base_year);
|
87 | 87ecb68b | pbrook | void rtc_set_memory(RTCState *s, int addr, int val); |
88 | 87ecb68b | pbrook | void rtc_set_date(RTCState *s, const struct tm *tm); |
89 | 0bacd130 | aliguori | void cmos_set_s3_resume(void); |
90 | 87ecb68b | pbrook | |
91 | 87ecb68b | pbrook | /* pc.c */
|
92 | 87ecb68b | pbrook | extern int fd_bootchk; |
93 | 87ecb68b | pbrook | |
94 | 87ecb68b | pbrook | void ioport_set_a20(int enable); |
95 | 87ecb68b | pbrook | int ioport_get_a20(void); |
96 | 87ecb68b | pbrook | |
97 | 87ecb68b | pbrook | /* acpi.c */
|
98 | 87ecb68b | pbrook | extern int acpi_enabled; |
99 | 80deece2 | blueswir1 | extern char *acpi_tables; |
100 | 80deece2 | blueswir1 | extern size_t acpi_tables_len;
|
101 | 80deece2 | blueswir1 | |
102 | 9d5e77a2 | Isaku Yamahata | void acpi_bios_init(void); |
103 | 9d5e77a2 | Isaku Yamahata | int acpi_table_add(const char *table_desc); |
104 | 9d5e77a2 | Isaku Yamahata | |
105 | 9d5e77a2 | Isaku Yamahata | /* acpi_piix.c */
|
106 | cf7a2fe2 | aurel32 | i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
|
107 | cf7a2fe2 | aurel32 | qemu_irq sci_irq); |
108 | 87ecb68b | pbrook | void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);
|
109 | 3f84865a | Gerd Hoffmann | void piix4_acpi_system_hot_add_init(PCIBus *bus);
|
110 | 87ecb68b | pbrook | |
111 | 16b29ae1 | aliguori | /* hpet.c */
|
112 | 16b29ae1 | aliguori | extern int no_hpet; |
113 | 16b29ae1 | aliguori | |
114 | 87ecb68b | pbrook | /* pcspk.c */
|
115 | 87ecb68b | pbrook | void pcspk_init(PITState *);
|
116 | 22d83b14 | Paul Brook | int pcspk_audio_init(qemu_irq *pic);
|
117 | 87ecb68b | pbrook | |
118 | 87ecb68b | pbrook | /* piix_pci.c */
|
119 | 0a3bacf3 | Juan Quintela | struct PCII440FXState;
|
120 | 0a3bacf3 | Juan Quintela | typedef struct PCII440FXState PCII440FXState; |
121 | 0a3bacf3 | Juan Quintela | |
122 | 85a750ca | Juan Quintela | PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn, qemu_irq *pic);
|
123 | 0a3bacf3 | Juan Quintela | void i440fx_set_smm(PCII440FXState *d, int val); |
124 | 0a3bacf3 | Juan Quintela | void i440fx_init_memory_mappings(PCII440FXState *d);
|
125 | 87ecb68b | pbrook | |
126 | 823e675a | Juan Quintela | /* piix4.c */
|
127 | b1d8e52e | blueswir1 | extern PCIDevice *piix4_dev;
|
128 | 87ecb68b | pbrook | int piix4_init(PCIBus *bus, int devfn); |
129 | 87ecb68b | pbrook | |
130 | 87ecb68b | pbrook | /* vga.c */
|
131 | cb5a7aa8 | malc | enum vga_retrace_method {
|
132 | cb5a7aa8 | malc | VGA_RETRACE_DUMB, |
133 | cb5a7aa8 | malc | VGA_RETRACE_PRECISE |
134 | cb5a7aa8 | malc | }; |
135 | cb5a7aa8 | malc | |
136 | cb5a7aa8 | malc | extern enum vga_retrace_method vga_retrace_method; |
137 | 87ecb68b | pbrook | |
138 | fbe1b595 | Paul Brook | int isa_vga_init(void); |
139 | fbe1b595 | Paul Brook | int pci_vga_init(PCIBus *bus,
|
140 | 87ecb68b | pbrook | unsigned long vga_bios_offset, int vga_bios_size); |
141 | c227f099 | Anthony Liguori | int isa_vga_mm_init(target_phys_addr_t vram_base,
|
142 | c227f099 | Anthony Liguori | target_phys_addr_t ctrl_base, int it_shift);
|
143 | 87ecb68b | pbrook | |
144 | 87ecb68b | pbrook | /* cirrus_vga.c */
|
145 | fbe1b595 | Paul Brook | void pci_cirrus_vga_init(PCIBus *bus);
|
146 | fbe1b595 | Paul Brook | void isa_cirrus_vga_init(void); |
147 | 87ecb68b | pbrook | |
148 | 87ecb68b | pbrook | /* ne2000.c */
|
149 | 87ecb68b | pbrook | |
150 | 9453c5bc | Gerd Hoffmann | void isa_ne2000_init(int base, int irq, NICInfo *nd); |
151 | 87ecb68b | pbrook | |
152 | 678e12cc | Gleb Natapov | int cpu_is_bsp(CPUState *env);
|
153 | 87ecb68b | pbrook | #endif |