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