aboutsummaryrefslogtreecommitdiffstats
path: root/hw/pc.c
AgeCommit message (Collapse)AuthorFilesLines
2011-03-22vmmouse: Fix initializationJan Kiszka1-0/+1
Latest refactorings left vmmouse nonfunctional behind. Fix it by adding the required device initialization. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-12pc: fix wrong CMOS values for floppy drivesBlue Swirl1-1/+1
Before commit 63ffb564dca94f8bda01ed6d209784104630a4d2, states for floppy drives were calculated in fdc.c:fd_revalidate(). There it is also considered whether a disk is inserted or not. The commit didn't copy the logic completely to pc.c, which caused a regression. Fix by adding the same check also to pc.c. Reported-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Tested-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-20pc: remove test on TARGET_PHYS_ADDR_BITS == 32Aurelien Jarno1-7/+0
Both i386 and x86_64 targets are now using target_phys_bits=64. Remove useless code. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-20i8254: convert to qdevBlue Swirl1-3/+2
Convert to qdev. Don't expose PITState. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-20fdc: refactor device creationBlue Swirl1-12/+19
Turn fdc_init_isa into an inline function. Get floppy geometry directly from the drives. Don't expose FDCtrl. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-20fdc: use FDriveType for floppy drive typeBlue Swirl1-8/+11
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12hpet: make optionalBlue Swirl1-4/+7
Ignore failure with hpet device creation. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12x86: make vmmouse optionalBlue Swirl1-2/+4
Compile vmmouse in hwlib. Ignore failure if vmmouse device can't be created. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12vmmouse: convert to qdevBlue Swirl1-2/+3
Convert to qdev, also add a proper reset function. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12vmport: convert to qdevBlue Swirl1-0/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12x86,MIPS: make vmware_vga optionalBlue Swirl1-3/+8
Allow failure with vmware_vga device creation and use standard VGA instead. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-25audio: consolidate audio_init()Isaku Yamahata1-17/+0
consolidate audio_init() and remove references to shoundhw. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-06pc: move port 92 stuff back to pc.c from pckbd.cBlue Swirl1-3/+86
956a3e6bb7386de48b642d4fee11f7f86a2fcf9a introduced a bug concerning reset bit for port 92. Since the keyboard output port and port 92 are not compatible anyway, let's separate them. Reported-by: Peter Lieven <pl@dlh.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> -- v2: added reset handler and VMState
2010-12-27Merge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemuAurelien Jarno1-0/+8
* 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu: vnc/spice: add set_passwd monitor command. vnc: support password expire vnc: auth reject cleanup spice: add qmp 'query-spice' and hmp 'info spice' commands. spice: connection events. spice: add qxl device spice: add qxl vgabios binary.
2010-12-11Add bootindex for option roms.Gleb Natapov1-3/+4
Extend -option-rom command to have additional parameter ,bootindex=. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-09spice: add qxl deviceGerd Hoffmann1-0/+8
qxl is a paravirtual graphics card. The qxl device is the bridge between the guest and the spice server (aka libspice-server). The spice server will send the rendering commands to the spice client, which will actually render them. The spice server is also able to render locally, which is done in case the guest wants read something from video memory. Local rendering is also used to support display over vnc and sdl. qxl is activated using "-vga qxl". qxl supports multihead, additional cards can be added via '-device qxl". [ v2: add copyright to files ] [ v2: use qemu-common.h for standard includes ] [ v2: create separate qxl-vga device for primary ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-11-21pc: disable the BOCHS BIOS panic portBernhard Kohl1-2/+2
We have an OS which writes to port 0x400 when probing for special hardware. This causes an exit of the VM. With SeaBIOS this port isn't used anyway. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-By: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-16pc: Fix e820 fw_cfg for big endianAlex Williamson1-7/+7
Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-16pc: e820 qemu_cfg tables need to be packedAlex Williamson1-2/+2
We can't let the compiler define the alignment for qemu_cfg data. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-16more stdvga cleanups.Gerd Hoffmann1-1/+1
video.x is gone now. It was the only user of the vga bios_offset + bios_size logic. Zap it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-08-24Rearrange block headersBlue Swirl1-0/+1
Changing block.h or blockdev.h resulted in recompiling most objects. Move DriveInfo typedef and BlockInterfaceType enum definitions to qemu-common.h and rearrange blockdev.h use to decrease churn. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-13pc: Avoid registering zero sized memoryAlex Williamson1-2/+4
No need to call cpu_register_physical_memory() for a zero sized area. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-06qemu_ram_alloc: Add DeviceState and name parametersAlex Williamson1-3/+4
These will be used to generate unique id strings for ramblocks. The name field is required, the device pointer is optional as most callers don't have a device. When there's no device or the device isn't a child of a bus implementing BusInfo.get_dev_path, the name should be unique for the platform. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-06pc: Allocate all ram in a single qemu_ram_alloc()Alex Williamson1-13/+9
This will benefit us when we migrate based on ramblock name since we won't be bouncing between separate blocks. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-02pc: Fix CMOS info for drives defined with -deviceMarkus Armbruster1-35/+59
Drives defined with -drive if=ide get get created along with the IDE controller, inside machine->init(). That's before cmos_init(). Drives defined with -device get created during generic device init. That's after cmos_init(). Because of that, CMOS has no information on them (type, geometry, translation). Older versions of Windows such as XP reportedly choke on that. Split off the part of CMOS initialization that needs to know about -device devices, and turn it into a reset handler, so it runs after device creation. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-27x86: Clean up CPU resetJan Kiszka1-18/+4
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-27Remove useless device dependency of HAS_AUDIOBlue Swirl1-2/+0
System architecture dictates whether HAS_AUDIO is defined. It's then useless to check for HAS_AUDIO in files which are only used on those architectures which always have audio. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-19apic: qdev conversion cleanupBlue Swirl1-1/+30
Make APICState completely private to apic.c by using DeviceState in external APIs. Move apic_init() to pc.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-19apic: avoid using CPUState internalsBlue Swirl1-2/+32
Move the actual CPUState contents handling to cpu.h and cpuid.c. Handle CPU reset and set env->halted in pc.c. Add a function to get the local APIC state of the current CPU for the MMIO. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-19apic: avoid passing CPUState from devicesBlue Swirl1-4/+6
Pass only APICState from pc.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-14pass info about hpets to seabios.]Gleb Natapov1-0/+3
Currently HPET ACPI table is created regardless of whether qemu actually created hpet device. This may confuse some guests that don't check that hpet is functional before using it. Solve this by passing info about hpets in qemu to seabios via fw config interface. Additional benefit is that seabios no longer uses hard coded hpet configuration. Proposed interface supports up to 8 hpets. This is the number defined by hpet spec. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-14Merge remote branch 'kwolf/for-anthony' into stagingAnthony Liguori1-0/+1
Conflicts: hw/pc.c
2010-06-13hpet/rtc: Rework RTC IRQ replacement by HPETJan Kiszka1-6/+8
Allow the intercept the RTC IRQ for the HPET legacy mode. Then push routing to IRQ8 completely into the HPET. This allows to turn hpet_in_legacy_mode() into a private function. Furthermore, this stops the RTC from clearing IRQ8 even if the HPET is in control. This patch comes with a side effect: The RTC timers will no longer be stoppend when there is no IRQ consumer, possibly causing a minor performance degration. But as the guest may want to redirect the RTC to the SCI in that mode, it should normally disable unused IRQ source anyway. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-13hpet: Convert to qdevJan Kiszka1-1/+6
Register the HPET as a sysbus device and create it that way. As it can route its IRQs to any ISA IRQ, we need to connect it to all 24 of them. Once converted to qdev, we can move reset handler and vmstate registration into its hands as well. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-04blockdev: Collect block device code in new blockdev.cMarkus Armbruster1-0/+1
Anything that moves hundreds of lines out of vl.c can't be all bad. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-29pc: improve debuggingBlue Swirl1-0/+12
Add a DPRINTF macro and use it for ISA and PIC interrupts. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-22Compile dma only onceBlue Swirl1-1/+12
Use a qemu_irq to request CPU exit. 7 compilations less for the full build. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-22Compile pckbd only onceBlue Swirl1-22/+11
Use a qemu_irq to indicate A20 line changes. Move I/O port 92 to pckbd.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-20pc: fix segfault introduced by 3d53f5c36ff6Eduard - Gabriel Munteanu1-2/+2
Commit 3d53f5c36ff6 introduced a segfault by erroneously making fw_cfg a 'void **' and passing it around in different ways. Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15rtc: make rtc_xxx accept/return ISADevice instead of RTCState.Isaku Yamahata1-5/+6
To match rtc_xxx with qdev, make rtc_xxx accept and return ISADevice instead of RTCState. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15pc: split out piix specific part from pc.c into pc_piix.cIsaku Yamahata1-326/+25
Finally, we can safely split out the piix specific part from pc.c into pc_piix.c. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15pc: split out pci device init from pc_init1() into pc_pci_device_init()Isaku Yamahata1-7/+12
Split out pci device initialization from pc_init1() into pc_pci_device_init(). and removed unnecessary braces. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15pc: split out basic device init from pc_init1() into pc_basic_device_init()Isaku Yamahata1-38/+48
Split out basic device, i.e. legacy devices like floppy, initialization from pc_init1() into pc_basic_device_init(). Later it will be used. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15pc: split out vga initialization from pc_init1() into pc_vga_init().Isaku Yamahata1-18/+23
Split out vga initialization which is independent of piix from pc_init1() as pc_vga_init(). Later it will be used. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15pc: split out memory allocation from pc_init1() into pc_memory_init()Isaku Yamahata1-28/+45
Split out memory allocation and rom/bios loading which doesn't depend on piix from pc_init1() into pc_memory_init(). Later it will be used. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15pc: split out cpu initialization from pc_init1() into pc_cpus_init().Isaku Yamahata1-12/+19
split out cpu initialization which is piix independent from pc_init1() into pc_cpus_init(). Later it will be used. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15pc: make pc_init1() not refer ferr_irq directly.Isaku Yamahata1-1/+7
By introducing a registering function, make pc_init1() not refer to ferr_irq directly in order to make ferr_irq piix independent. Later pc_init1() will be split out into another file keeping ferr_irq static. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15pc: introduce a function to allocate cpu irq.Isaku Yamahata1-1/+6
Introduce a function, pc_allocate_cpu_irq(), to allocate cpu irq in order to make pic_irq_request() piix independent. Later piix code will be split out to another file keeping pic_irq_request() static. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15pc: remove global variable rtc_state by using qemu_irq.Isaku Yamahata1-9/+7
Remove the reference to the global variable, rtc_state, by passing function argument to cmos_init_hd(), cmos_init(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Cc: Paolo Bonzini <bonzini@gnu.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15pc: remove a global variable, floppy_controller.Isaku Yamahata1-3/+5
Remove a global variable, floppy_controller. Since it is unnecessarily global, make it local and pass it as a function argument. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>