summaryrefslogtreecommitdiffstats
path: root/hw/pc.h
Commit message (Collapse)AuthorAgeFilesLines
* HMP: add QDict to info callback handlerWenchao Xia2013-01-171-2/+2
| | | | | | | | | This patch change all info call back function to take additional QDict * parameter, which allow those command take parameter. Now it is set to NULL at default case. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* acpi: autoload dsdtGerd Hoffmann2013-01-041-0/+1
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* exec: move include files to include/exec/Paolo Bonzini2012-12-191-3/+3
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* net: reorganize headersPaolo Bonzini2012-12-191-1/+1
| | | | | | | | | Move public headers to include/net, and leave private headers in net/. Put the virtio headers in include/net/tap.h, removing the multiple copies that existed. Leave include/net/tap.h as the interface for NICs, and net/tap_int.h as the interface for OS-specific parts of the tap backend. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* pc: Move ioapic_init() from pc_piix.c to pc.cJason Baron2012-11-261-0/+2
| | | | | | | | | | Move ioapic_init() from pc_piix.c to pc.c, to make it a common function. Rename ioapic_init() -> ioapic_init_gsi(). Move to pc.h so q35 can use them as well. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pc, pc_piix: split out pc nic initializationIsaku Yamahata2012-11-261-0/+1
| | | | | | | | | | | | Factor out pc nic initialization. This simplifies the pc initialization and will reduce the code duplication of q35 pc initialization. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Rename target_phys_addr_t to hwaddrAvi Kivity2012-10-231-8/+8
| | | | | | | | | | | | | | | target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are reserved) and its purpose doesn't match the name (most target_phys_addr_t addresses are not target specific). Replace it with a finger-friendly, standards conformant hwaddr. Outstanding patchsets can be fixed up with the command git rebase -i --exec 'find -name "*.[ch]" | xargs s/target_phys_addr_t/hwaddr/g' origin Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* serial: split serial.cGerd Hoffmann2012-10-221-27/+0
| | | | | | | | | | Split serial.c into serial.c, serial.h and serial-isa.c. While being at creating a serial.h header file move the serial prototypes from pc.h to the new serial.h. The latter leads to s/pc.h/serial.h/ in tons of boards which just want the serial bits from pc.h Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: cleanup after isa_vga_init() and pci_vga_init() conversionAurelien Jarno2012-10-061-13/+0
| | | | | | | | Now that all machines call isa_vga_init() or pci_vga_init(), some unused code can be removed. Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* vga: rename isa_vga_init() to isa_std_vga_init()Aurelien Jarno2012-10-061-1/+1
| | | | | | | This better explains what is this function about. Adjust all callers. Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Revert "vga: add some optional CGA compatibility hacks"malc2012-08-271-4/+0
| | | | | | This reverts commit 482f7bf86b43af9f6903c52726fedf82b28bf953. Signed-off-by: malc <av1474@comtv.ru>
* vga: add some optional CGA compatibility hacksMatthew Ogilvie2012-08-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | This patch adds some optional compatibility hacks (default disabled) to allow Microport UNIX to function under qemu. I've tried to structure it to be easy to add more hacks for other old CGA programs, if anyone ever needs them. Microport UNIX System V/386 v 2.1 (ca 1987) tries to program the CGA registers directly with neither the assistance of BIOS, nor with proper handling of EGA/VGA-only registers. Note that it didn't work on real VGA hardware, either (although in that case, the most obvious problems seemed to be out-of-range hsync and/or vsync signalling, rather than the issues in this patch). Eventually real MDA and/or CGA support might provide an alternative to this patch, although a hybrid approach like this patch might still be useful in marginal cases. Signed-off-by: Matthew Ogilvie <mmogilvi_qemu@miniinfo.net> Signed-off-by: malc <av1474@comtv.ru>
* Add one new file vga-pci.h and cleanup on all platformszhlcindy@gmail.com2012-08-151-4/+0
| | | | | | | | | | | | Functions pci_vga_init() and pci_cirrus_vga_init() are declared in pc.h. That prevents other platforms (e.g. sPAPR) to use them. This patch is to create one new file vga-pci.h and move the declarations to vga-pci.h, so that they can be shared by all platforms. This patch also cleans up on all platforms. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* Add PIIX4 properties to control PM system states.Gleb Natapov2012-06-191-2/+2
| | | | | | | | | | | | | | | | | | This patch adds two things. First it allows QEMU to distinguish between regular powerdown and S4 powerdown. Later separate QMP notification will be added for S4 powerdown. Second it allows S3/S4 states to be disabled from QEMU command line. Some guests known to be broken with regards to power management, but allow to use it anyway. Using new properties management will be able to disable S3/S4 for such guests. Supported system state are passed to a firmware using new fw_cfg file. The file contains 6 byte array. Each byte represents one system state. If byte at offset X has its MSB set it means that system state X is supported and to enter it guest should use the value from lowest 3 bits. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* suspend: switch acpi s3 to new infrastructure.Gerd Hoffmann2012-02-241-2/+1
| | | | | | | | | | | | | | This patch switches pc s3 suspend over to the new infrastructure. The cmos_s3 qemu_irq is killed, the new notifier is used instead. The xen hack goes away with that too, the hypercall can simply be done in a notifier function now. This patch also makes the guest actually stay suspended instead of leaving suspend instantly, so it is useful for more than just testing whenever the suspend/resume cycle actually works. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* hw/pc: move rom init to pc_sysfw.cJordan Justen2012-02-221-0/+3
| | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pcspk: Convert to qdevJan Kiszka2012-02-171-4/+0
| | | | | | | | | Convert the PC speaker device to a qdev ISA model. Move the public interface to a dedicated header file at this chance. CC: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* i8254: Factor out interface headerJan Kiszka2012-02-171-25/+0
| | | | | | | | Move the public interface of the PIT into its own header file and update all users. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori2012-01-231-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qemu-kvm/uq/master: kvm: Activate in-kernel irqchip support kvm: x86: Add user space part for in-kernel IOAPIC kvm: x86: Add user space part for in-kernel i8259 kvm: x86: Add user space part for in-kernel APIC kvm: x86: Establish IRQ0 override control kvm: Introduce core services for in-kernel irqchip support memory: Introduce memory_region_init_reservation ioapic: Factor out base class for KVM reuse ioapic: Drop post-load irr initialization i8259: Factor out base class for KVM reuse i8259: Completely privatize PicState apic: Open-code timer save/restore apic: Factor out base class for KVM reuse apic: Introduce apic_report_irq_delivered apic: Inject external NMI events via LINT1 apic: Stop timer on reset kvm: Move kvmclock into hw/kvm folder msi: Generalize msix_supported to msi_supported hyper-v: initialize Hyper-V CPUID leaves. hyper-v: introduce Hyper-V support infrastructure. Conflicts: Makefile.target Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * kvm: x86: Add user space part for in-kernel i8259Jan Kiszka2012-01-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Introduce the alternative 'kvm-i8259' device model that exploits KVM in-kernel acceleration. The PIIX3 initialization code is furthermore extended by KVM specific IRQ route setup. GSI injection differs in KVM mode from the user space model. As we can dispatch ISA-range IRQs to both IOAPIC and PIC inside the kernel, we do not need to inject them separately. This is reflected by a KVM-specific GSI handler. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
| * i8259: Completely privatize PicStateJan Kiszka2012-01-191-4/+3
| | | | | | | | | | | | | | Use DeviceState instead of PicState in the public i8259 API. This is cleaner and allows to reorganize the PIC data structures for KVM reuse. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* | vga: make Cirrus ISA device optionalBlue Swirl2012-01-221-1/+0
|/ | | | | Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* audio: remove unused parameter isa_picHervé Poussineau2011-12-201-1/+1
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* malta: give ISA bus to ISA methodsHervé Poussineau2011-12-201-1/+1
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pc: give ISA bus to ISA methodsHervé Poussineau2011-12-201-1/+1
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* isa: give ISABus/ISADevice to isa_create(), isa_bus_irqs() and isa_get_irq() ↵Hervé Poussineau2011-12-201-17/+18
| | | | | | | | | functions NULL is a valid bus/device, so there is no change in behaviour. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qom: add vga node to the pc composition treeAnthony Liguori2011-12-151-7/+7
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* parallel: convert to memory APIAvi Kivity2011-11-241-1/+2
| | | | Signed-off-by: Avi Kivity <avi@redhat.com>
* pc: Fix floppy drives with if=noneKevin Wolf2011-10-211-1/+2
| | | | | | | | | | | | | Commit 63ffb564 broke floppy devices specified on the command line like -drive file=...,if=none,id=floppy -global isa-fdc.driveA=floppy because it relies on drive_get() which works only with -fda/-drive if=floppy. This patch resembles what we're already doing for IDE, i.e. remember the floppy device that was created and use that to extract the BlockDriverStates where needed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* i8259: Eliminate PicState2Jan Kiszka2011-10-161-4/+4
| | | | | | | | | | Introduce a reference to the slave PIC for the few cases we need to access it without a proper pointer at hand and drop PicState2. We could even live without slave_pic if we had a better way of modeling the cascade bus the PICs are attached to (in addition to the ISA bus). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* i8259: PREP: Replace pic_intack_read with pic_read_irqJan Kiszka2011-10-161-1/+0
| | | | | | | | | | | | | There is nothing in the i8259 spec that justifies the special pic_intack_read. At least the Linux PREP kernels configure the PICs properly so that pic_read_irq returns identical values, and setting read_reg_select in PIC0 cannot be derived from any special i8259 mode. So switch ppc_prep to pic_read_irq and drop the now unused PIC code. CC: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* i8259: Drop obsolete prototypesJan Kiszka2011-10-161-2/+0
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pc: Fix and clean up PIC-to-APIC IRQ pathJan Kiszka2011-10-161-1/+1
| | | | | | | | | | | | | | | | | | The master PIC is connected to the LINTIN0 of the APICs. As the APIC currently does not track the state of that line, we have to ask the PIC to reinject its IRQ after the CPU picked up an event from the APIC. This introduces pic_get_output to read the master PIC IRQ line state without changing it. The APIC uses this function to decide if a PIC IRQ should be reinjected on apic_update_irq. This reflects better how the real hardware works. The patch fixes some failures of the kvm unit tests apic and eventinj by allowing to enable the proper CPU IRQ deassertion when the guest masks some pending IRQs at PIC level. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pc: Convert GSIState::i8259_irq into arrayJan Kiszka2011-10-161-1/+1
| | | | | | | | Will be required when we no longer let i8259_init allocate the PIC IRQs but convert that chips to qdev. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pc: Generalize ISA IRQs to GSIsJan Kiszka2011-10-161-8/+10
| | | | | | | | | The ISA bus IRQ range is 0..15. What isa_irq_handler and IsaIrqState are actually dealing with are the Global System Interrupts. Refactor the code to clarify this. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* serial: Add MemoryRegion parameter to serial_mm_initRichard Henderson2011-10-021-3/+4
| | | | | | | | | Remove the get_system_memory() call from serial_mm_init, pushing it back into the callers. In many cases we already have the system memory region available. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
* serial: Remove ioregister parameter from serial_mm_initRichard Henderson2011-10-021-2/+1
| | | | | | | All callers passed 1. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
* serial: Use enum device_endian in serial_mm_init parameterRichard Henderson2011-10-021-1/+1
| | | | | | | | The use of DEVICE_NATIVE_ENDIAN cleans up lots of ifdefs in many of the callers. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
* pckbd: Convert to MemoryRegionRichard Henderson2011-09-251-1/+1
| | | | | | | | Slightly non-obvious with mips_jazz passing in the region structure to populate. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
* pc: Unbreak ROM mapping for ISA machineJan Kiszka2011-09-231-1/+1
| | | | | | | | | | This is based on the original fix by Hervé Poussineau: pc_memory_init actually takes a memory region for mapping BIOS and extension ROMs. That equals the PCI memory region if PCI is available, but must be system memory in the ISA case. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* 440fx: fix PAM, PCI holesAvi Kivity2011-08-221-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of PAM and the PCI holes is broken in several ways: - PCI BARs are not restricted to the PCI hole (a BAR may hide memory) - PCI devices do not respect PAM (if a PCI device maps a region while PAM maps the region to RAM, the request will be honored) This patch fixes things by introducing a pci address space, and using memory region aliases to represent PAM regions, SMRAM, and PCI holes. The memory hierarchy looks something like system_memory | +--- low memory alias (0-0xe0000000) | | | +-- ram@0 | +--- high memory alias (0x100000000-EOM) | | | +-- ram@0xe0000000 | +--- pci hole alias (end of low memory-0x100000000) | | | +-- pci@end-of-low-memory | | +--- pam[n] (0xc0000-0xc3fff etc) (when set to pci, priority 1) | | | +-- pci@0xc4000 etc | +--- smram (0xa0000-0xbffff) (when set to pci/vga, priority 1) | +-- pci@0xa0000 etc ram (simple ram region) pci | +--- BARn | +--- VGA 0xa0000-0xbffff | +--- ROMs Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: drop get_system_memory() from vga devices and derivativesAvi Kivity2011-08-221-2/+3
| | | | | | | | Instead, use the bus accessors, or get the address space directly from the board constructor. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: pass I/O address space to new PCI busAvi Kivity2011-08-081-1/+3
| | | | | | | | | This lets us register BARs in the I/O address space. Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: pass address space to pci bus when createdAvi Kivity2011-07-291-1/+3
| | | | | | | | | This is now done sloppily, via get_system_memory(). Eventually callers will be converted to stop using that. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pc: convert pc_memory_init() to memory APIAvi Kivity2011-07-291-0/+1
| | | | | | Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pc: grab system_memoryAvi Kivity2011-07-291-1/+3
| | | | | | | | | While eventually this should come from the machine initialization function, take a short cut to avoid converting all machines now. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* xen: fix interrupt routingStefano Stabellini2011-06-191-1/+0
| | | | | | | | | | | | | | | | Compared to the last version I only added a comment to the code. - remove i440FX-xen and i440fx_write_config_xen we don't need to intercept pci config writes to i440FX anymore; - introduce PIIX3-xen and piix3_write_config_xen we do need to intercept pci config write to the PCI-ISA bridge to update the PCI link routing; - set the number of PIIX3-xen interrupts line to 128; Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* piix_pci: Introduces Xen specific call for irq.Anthony PERARD2011-05-081-0/+1
| | | | | | | | | | | This patch introduces Xen specific call in piix_pci. The specific part for Xen is in write_config, set_irq and get_pirq. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* pc, Disable vmport initialisation with Xen.Anthony PERARD2011-05-081-1/+2
| | | | | | | | | | This is because there is not synchronisation of the vcpu register between Xen and QEMU, so vmport can't work properly. This patch introduces no_vmport parameter to pc_basic_device_init. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* pc_memory_init: Move memory calculation to the caller.Anthony PERARD2011-05-081-4/+3
| | | | | | | | | | This patch moves above_4g_mem_size and below_4g_mem_size calculation in the caller of pc_memory_init (pc_init1). And the prototype of pc_memory_init is changed because there is no need anymore to have variable pointer and the ram_size parameter. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
OpenPOWER on IntegriCloud