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