root / hw / pc.h @ 3d575329
History | View | Annotate | Download (4.9 kB)
1 | 87ecb68b | pbrook | #ifndef HW_PC_H
|
---|---|---|---|
2 | 87ecb68b | pbrook | #define HW_PC_H
|
3 | 87ecb68b | pbrook | /* PC-style peripherals (also used by other machines). */
|
4 | 87ecb68b | pbrook | |
5 | 87ecb68b | pbrook | /* serial.c */
|
6 | 87ecb68b | pbrook | |
7 | 87ecb68b | pbrook | SerialState *serial_init(int base, qemu_irq irq, CharDriverState *chr);
|
8 | 87ecb68b | pbrook | SerialState *serial_mm_init (target_phys_addr_t base, int it_shift,
|
9 | 87ecb68b | pbrook | qemu_irq irq, CharDriverState *chr, |
10 | 87ecb68b | pbrook | int ioregister);
|
11 | 87ecb68b | pbrook | uint32_t serial_mm_readb (void *opaque, target_phys_addr_t addr);
|
12 | 87ecb68b | pbrook | void serial_mm_writeb (void *opaque, target_phys_addr_t addr, uint32_t value); |
13 | 87ecb68b | pbrook | uint32_t serial_mm_readw (void *opaque, target_phys_addr_t addr);
|
14 | 87ecb68b | pbrook | void serial_mm_writew (void *opaque, target_phys_addr_t addr, uint32_t value); |
15 | 87ecb68b | pbrook | uint32_t serial_mm_readl (void *opaque, target_phys_addr_t addr);
|
16 | 87ecb68b | pbrook | void serial_mm_writel (void *opaque, target_phys_addr_t addr, uint32_t value); |
17 | 87ecb68b | pbrook | |
18 | 87ecb68b | pbrook | /* parallel.c */
|
19 | 87ecb68b | pbrook | |
20 | 87ecb68b | pbrook | typedef struct ParallelState ParallelState; |
21 | 87ecb68b | pbrook | ParallelState *parallel_init(int base, qemu_irq irq, CharDriverState *chr);
|
22 | 87ecb68b | pbrook | 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 | void pic_set_alt_irq_func(PicState2 *s, SetIRQFunc *alt_irq_func,
|
32 | 87ecb68b | pbrook | void *alt_irq_opaque);
|
33 | 87ecb68b | pbrook | int pic_read_irq(PicState2 *s);
|
34 | 87ecb68b | pbrook | void pic_update_irq(PicState2 *s);
|
35 | 87ecb68b | pbrook | uint32_t pic_intack_read(PicState2 *s); |
36 | 87ecb68b | pbrook | void pic_info(void); |
37 | 87ecb68b | pbrook | void irq_info(void); |
38 | 87ecb68b | pbrook | |
39 | 87ecb68b | pbrook | /* APIC */
|
40 | 87ecb68b | pbrook | typedef struct IOAPICState IOAPICState; |
41 | 87ecb68b | pbrook | |
42 | 87ecb68b | pbrook | int apic_init(CPUState *env);
|
43 | 87ecb68b | pbrook | int apic_accept_pic_intr(CPUState *env);
|
44 | 87ecb68b | pbrook | int apic_get_interrupt(CPUState *env);
|
45 | 87ecb68b | pbrook | IOAPICState *ioapic_init(void);
|
46 | 87ecb68b | pbrook | void ioapic_set_irq(void *opaque, int vector, int level); |
47 | 87ecb68b | pbrook | |
48 | 87ecb68b | pbrook | /* i8254.c */
|
49 | 87ecb68b | pbrook | |
50 | 87ecb68b | pbrook | #define PIT_FREQ 1193182 |
51 | 87ecb68b | pbrook | |
52 | 87ecb68b | pbrook | typedef struct PITState PITState; |
53 | 87ecb68b | pbrook | |
54 | 87ecb68b | pbrook | PITState *pit_init(int base, qemu_irq irq);
|
55 | 87ecb68b | pbrook | void pit_set_gate(PITState *pit, int channel, int val); |
56 | 87ecb68b | pbrook | int pit_get_gate(PITState *pit, int channel); |
57 | 87ecb68b | pbrook | int pit_get_initial_count(PITState *pit, int channel); |
58 | 87ecb68b | pbrook | int pit_get_mode(PITState *pit, int channel); |
59 | 87ecb68b | pbrook | int pit_get_out(PITState *pit, int channel, int64_t current_time); |
60 | 87ecb68b | pbrook | |
61 | 87ecb68b | pbrook | /* vmport.c */
|
62 | 87ecb68b | pbrook | void vmport_init(CPUState *env);
|
63 | 87ecb68b | pbrook | void vmport_register(unsigned char command, IOPortReadFunc *func, void *opaque); |
64 | 87ecb68b | pbrook | |
65 | 87ecb68b | pbrook | /* vmmouse.c */
|
66 | 87ecb68b | pbrook | void *vmmouse_init(void *m); |
67 | 87ecb68b | pbrook | |
68 | 87ecb68b | pbrook | /* pckbd.c */
|
69 | 87ecb68b | pbrook | |
70 | 87ecb68b | pbrook | void i8042_init(qemu_irq kbd_irq, qemu_irq mouse_irq, uint32_t io_base);
|
71 | 87ecb68b | pbrook | void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
|
72 | 87ecb68b | pbrook | target_phys_addr_t base, int it_shift);
|
73 | 87ecb68b | pbrook | |
74 | 87ecb68b | pbrook | /* mc146818rtc.c */
|
75 | 87ecb68b | pbrook | |
76 | 87ecb68b | pbrook | typedef struct RTCState RTCState; |
77 | 87ecb68b | pbrook | |
78 | 87ecb68b | pbrook | RTCState *rtc_init(int base, qemu_irq irq);
|
79 | 87ecb68b | pbrook | RTCState *rtc_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq);
|
80 | 87ecb68b | pbrook | void rtc_set_memory(RTCState *s, int addr, int val); |
81 | 87ecb68b | pbrook | void rtc_set_date(RTCState *s, const struct tm *tm); |
82 | 87ecb68b | pbrook | |
83 | 87ecb68b | pbrook | /* pc.c */
|
84 | 87ecb68b | pbrook | extern int fd_bootchk; |
85 | 87ecb68b | pbrook | |
86 | 87ecb68b | pbrook | void ioport_set_a20(int enable); |
87 | 87ecb68b | pbrook | int ioport_get_a20(void); |
88 | 87ecb68b | pbrook | |
89 | 87ecb68b | pbrook | /* acpi.c */
|
90 | 87ecb68b | pbrook | extern int acpi_enabled; |
91 | 87ecb68b | pbrook | i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base);
|
92 | 87ecb68b | pbrook | void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);
|
93 | 87ecb68b | pbrook | void acpi_bios_init(void); |
94 | 87ecb68b | pbrook | |
95 | 87ecb68b | pbrook | /* pcspk.c */
|
96 | 87ecb68b | pbrook | void pcspk_init(PITState *);
|
97 | 87ecb68b | pbrook | int pcspk_audio_init(AudioState *, qemu_irq *pic);
|
98 | 87ecb68b | pbrook | |
99 | 87ecb68b | pbrook | /* piix_pci.c */
|
100 | 87ecb68b | pbrook | PCIBus *i440fx_init(PCIDevice **pi440fx_state, qemu_irq *pic); |
101 | 87ecb68b | pbrook | void i440fx_set_smm(PCIDevice *d, int val); |
102 | 87ecb68b | pbrook | int piix3_init(PCIBus *bus, int devfn); |
103 | 87ecb68b | pbrook | void i440fx_init_memory_mappings(PCIDevice *d);
|
104 | 87ecb68b | pbrook | |
105 | 87ecb68b | pbrook | int piix4_init(PCIBus *bus, int devfn); |
106 | 87ecb68b | pbrook | |
107 | 87ecb68b | pbrook | /* vga.c */
|
108 | 87ecb68b | pbrook | |
109 | 87ecb68b | pbrook | #ifndef TARGET_SPARC
|
110 | 87ecb68b | pbrook | #define VGA_RAM_SIZE (8192 * 1024) |
111 | 87ecb68b | pbrook | #else
|
112 | 87ecb68b | pbrook | #define VGA_RAM_SIZE (9 * 1024 * 1024) |
113 | 87ecb68b | pbrook | #endif
|
114 | 87ecb68b | pbrook | |
115 | 87ecb68b | pbrook | int isa_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
|
116 | 87ecb68b | pbrook | unsigned long vga_ram_offset, int vga_ram_size); |
117 | 87ecb68b | pbrook | int pci_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
|
118 | 87ecb68b | pbrook | unsigned long vga_ram_offset, int vga_ram_size, |
119 | 87ecb68b | pbrook | unsigned long vga_bios_offset, int vga_bios_size); |
120 | 87ecb68b | pbrook | int isa_vga_mm_init(DisplayState *ds, uint8_t *vga_ram_base,
|
121 | 87ecb68b | pbrook | unsigned long vga_ram_offset, int vga_ram_size, |
122 | 87ecb68b | pbrook | target_phys_addr_t vram_base, target_phys_addr_t ctrl_base, |
123 | 87ecb68b | pbrook | int it_shift);
|
124 | 87ecb68b | pbrook | |
125 | 87ecb68b | pbrook | /* cirrus_vga.c */
|
126 | 87ecb68b | pbrook | void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
|
127 | 87ecb68b | pbrook | unsigned long vga_ram_offset, int vga_ram_size); |
128 | 87ecb68b | pbrook | void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
|
129 | 87ecb68b | pbrook | unsigned long vga_ram_offset, int vga_ram_size); |
130 | 87ecb68b | pbrook | |
131 | 87ecb68b | pbrook | /* ide.c */
|
132 | 87ecb68b | pbrook | void isa_ide_init(int iobase, int iobase2, qemu_irq irq, |
133 | 87ecb68b | pbrook | BlockDriverState *hd0, BlockDriverState *hd1); |
134 | 87ecb68b | pbrook | void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,
|
135 | 87ecb68b | pbrook | int secondary_ide_enabled);
|
136 | 87ecb68b | pbrook | void pci_piix3_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn, |
137 | 87ecb68b | pbrook | qemu_irq *pic); |
138 | 87ecb68b | pbrook | void pci_piix4_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn, |
139 | 87ecb68b | pbrook | qemu_irq *pic); |
140 | 87ecb68b | pbrook | |
141 | 87ecb68b | pbrook | /* ne2000.c */
|
142 | 87ecb68b | pbrook | |
143 | 87ecb68b | pbrook | void isa_ne2000_init(int base, qemu_irq irq, NICInfo *nd); |
144 | 87ecb68b | pbrook | |
145 | 87ecb68b | pbrook | #endif |