summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2009-08-27Port ACPI to VMStateJuan Quintela1-34/+21
This uses a run_after_load() function, and VMSTATE_PCI_DEVICE() It could be made smaller changing the type of pm_io_space_update() to return an int. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Add VMState support to run a function after loadJuan Quintela1-0/+1
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Port PCIDevice state to VMStateJuan Quintela2-22/+55
This uses a variant of buffer, with extra checks. Also uses the new support for cheking that a read value is less or equal than a field. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Add version_id to PCIDevice.Juan Quintela2-1/+4
It is needed for VMState Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Add VMState support for int32_t check valueJuan Quintela1-0/+4
We read the saved value and check that it is less or equal than the one stored in the structure. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Port PS2 devices to VMState designJuan Quintela1-67/+52
This uses STRUCT and BUFFER Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Add VMState support for static sized buffers (uint_8)Juan Quintela1-0/+18
This patch adds support for static sized buffer and typecheks that the buffer is right. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Port PCI Bus to VMState designJuan Quintela1-30/+11
This uses VARRAY and INT32_EQUAL values Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Add VMState support for variable sized arraysJuan Quintela1-0/+22
This patch add supports for variable sized arrays whose size is another field of the state. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Add VMState support for int32_t check valueJuan Quintela1-0/+5
We read the saved value and check that it is the same that the one is stored in the structure. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Port i8254 to new VMState designJuan Quintela1-29/+37
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Add VMState support for arrays of structsJuan Quintela1-0/+11
This patch add supports for arrays of structs Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Add VMState support for structsJuan Quintela1-0/+12
This patch adds support for saving one VMStateDescription from other VMStateDescription. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Port apic to new VMState designJuan Quintela1-34/+33
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Add VMState support for arraysJuan Quintela1-0/+28
This patch adds support for saving arrays inside the struct Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Add VMState support for pointersJuan Quintela1-0/+19
This patch adds support for saving pointers to values Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27New VMstate save/load infrastructureJuan Quintela1-0/+102
This patch introduces VMState infrastructure, to convert the save/load functions of devices to a table approach. This new approach has the following advantages: - it is type-safe - you can't have load/save functions out of sync - will allows us to have new interesting commands, like dump <device>, that shows all its internal state. - Just now, the only added type is arrays, but we can add structures. - Uses old load_state() function for loading old state. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27move useful type definitons to osdep.hJuan Quintela1-3/+0
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Move isa_connect_irq calls into isa_create_simpleGerd Hoffmann4-7/+10
Now with isa-bus maintaining the isa irqs we can move the isa_connect_irq() calls into isa_create_simple(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Add isa_reserve_irq().Jes Sorensen6-32/+58
Introduce isa_reserve_irq() which marks an irq reserved and returns the appropriate qemu_irq entry from the i8259 table. isa_reserve_irq() is a temporary interface to be used to allocate ISA IRQs for devices which have not yet been converted to qdev, and for special cases which are not suited for qdev conversions, such as the 'ferr'. This patch goes on top of Gerd Hoffmann's which makes isa-bus.c own the ISA irq table. [ added isa-bus.o to some targets to fix build failures -- kraxel ] Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27isa bus irq changes and fixes.Gerd Hoffmann9-37/+109
Changes: (1) make isa-bus maintain isa irqs, complain when allocating already taken irqs. (2) note that (1) works only for isa devices converted to qdev already (floppy and ps2/kbd/mouse right now), so more work is needed to make this really useful. (3) split floppy init into isa and sysbus versions. (4) add sysbus->isa bridge & fix -M isapc breakage. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27hw/eepro100.c: Use extended TBD only where applicableNaphtali Sprei1-3/+3
Bug fix for segfault when run as i82551 HW: Use Extended TBD only when HW supports it (i82558 and up). Added assertions to guard from such buffer overflow Introduce the MAX_TCB_BYTE_COUNT macro Allocate buf big enough as HW needs (MAX_ETH_FRAME_SIZE -> MAX_TCB_BYTE_COUNT) I don't feel 100% OK with the "s->device >= i82558B" condition since it relies on the numeric (hex) value of those defines, which currently is correct, but changes (which I don't forsee now) might break it. Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27pci-hotplug: initialize dinfo to NULL in pci_device_hot_addSebastian Herbszt1-1/+1
Suppress the following compiler warning emitted by at least gcc version 4.2.1 (SUSE Linux) and gcc version 3.4.5 (mingw32 special): hw/pci-hotplug.c: In function 'pci_device_hot_add': hw/pci-hotplug.c:102: warning: 'dinfo' may be used uninitialized in this function hw/pci-hotplug.c:102: note: 'dinfo' was declared here Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27add file descriptor migrationPaolo Bonzini1-0/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Chris Lalancette <clalance@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-25Sparc32: improve interrupt handlingBlue Swirl2-32/+47
Level 15 interrupts are broadcast to all CPUs, each CPU can clear the interrupt using the local Clear Pending register. Update intbit_to_level table. Don't try to raise level 0 interrupts. Calculate pending interrupts based on the separate inputs from master register. Setting or resetting the pending level isn't correct because of overlap of levels. Level 14 is always used for CPU timer interrupts, remove the property. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-25Make CPURead/WriteFunc structure 'const'Blue Swirl141-538/+538
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-24Make the e1000 the default network adapter for the pc target.Anthony Liguori1-2/+2
The ne2k is an ancient card that performs pretty terribly under QEMU. In many modern OSes, there is no longer drivers available for the ne2k. Switch the default network adapter to e1000. This card is more widely suppported and performs rather well under QEMU. There may be very old OSes that had a ne2k driver but not an e1000 driver but I think this is likely the exception. I think the average user is better served with an e1000 vs ne2k. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24virtio-blk: add msi support.Gerd Hoffmann2-2/+10
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24qdev/prop: convert isa-bus to helper macros.Gerd Hoffmann1-12/+3
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24unify popen/fopen qemu wrappersPaolo Bonzini1-1/+1
While reading Chris's code for fd migration I noticed the duplication between QEMUFilePopen and QEMUFileStdio. This fixes it, and makes qemu_fopen more similar qemu_popen. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24Unbreak large mem support by removing kqemuAnthony Liguori1-11/+1
kqemu introduces a number of restrictions on the i386 target. The worst is that it prevents large memory from working in the default build. Furthermore, kqemu is fundamentally flawed in a number of ways. It relies on the TSC as a time source which will not be reliable on a multiple processor system in userspace. Since most modern processors are multicore, this severely limits the utility of kqemu. kvm is a viable alternative for people looking to accelerate qemu and has the benefit of being supported by the upstream Linux kernel. If someone can implement work arounds to remove the restrictions introduced by kqemu, I'm happy to avoid and/or revert this patch. N.B. kqemu will still function in the 0.11 series but this patch removes it from the 0.12 series. Paul, please Ack or Nack this patch. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24Route IOAPIC interrupts via ISA busAvi Kivity4-26/+13
Instead of calling the IOAPIC from the PIC, raise IOAPIC irqs via the ISA bus. As a side effect, IOAPIC lines 16-23 are enabled. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24Route PC irqs to ISA bus instead of i8259 directlyAvi Kivity1-15/+31
A PC has its motherboard IRQ lines connected to both the PIC and IOAPIC. Currently, qemu routes IRQs to the PIC which then calls the IOAPIC, an incestuous arrangement. In order to clean this up, create a new ISA IRQ abstraction, and have devices raise ISA IRQs (which in turn raise the i8259 IRQs as usual). Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24QEMU set irq0override in fw_cfgJes Sorensen1-0/+2
Hi, After discussing the issue with Avi, Gleb and a couple others on irq, we came to the conclusion that it is preferred to have QEMU request features from the BIOS, rather than notifying the BIOS that it is running on QEMU or KVM. This way memory ranges can change etc. and an older BIOS will continue to work on newer QEMU if it receives the info as a fw_cfg value. This one also matches what qemu-kvm does for irq0override, except I haven't made it configurable. I leave that as an exercise for whoever would be interested in switching off irq0override. Thanks, Jes Set irq0 override in fw_cfg, informing the BIOS that QEMU expects override on irq0. This matches qemu-kvm, and will help sharing a single BIOS binary. Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24SMART ATA FunctionalityBrian Wheeler1-5/+200
For the lulz I implemented basic SMART functionality in ide.c. smartctl on linux recognizes it just fine and starting self tests with it complete successfully. Signed-off-by: Brian Wheeler <bdwheele@indiana.edu> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24make vga screen_dump use DisplayState properlyStefano Stabellini1-69/+21
Hi all, currently the vga screen_dump code doesn't use the DisplayState interface properly and tries to replace it temporarily while taking the screenshot. A better approach is to register a DisplayChangeListener, call vga_hw_update, and finally write the ppm in the next call from dpy_update. Testing is appreciated. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24Restore consistent formattingmalc1-5/+5
Signed-off-by: malc <av1474@comtv.ru>
2009-08-24es1370: Remove unused indirection of PCIES1370State and ES1370StateJuan Quintela1-21/+10
Signed-off-by: Juan Quintela <quintela@redhat.com>
2009-08-23Revert my commit c00a9de060124a988bd9847c095e5836488c6f01Andrzej Zaborowski1-3/+3
was incorrect.
2009-08-23Fix segfault of qemu-system-arm with PXA targetTorsten Duwe1-1/+1
qemu-system-arm (0.10.5) segfaults when invoked with a PXA machine target, e.g. -M tosa. The reason is fairly obvious: Signed-off-by: Torsten Duwe <duwe@lst.de> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
2009-08-23Use corect depth from DisplaySurface in vmware_vga.cReimar Döffinger1-3/+3
Hello, for what I can tell, there is no way for vmware_vga to work correctly right now. It assumes that the framebuffer bits-per-pixel and the one from the DisplaySurface are identical (it uses directly the VRAM from vga.c), but it always assumes 3 bytes per pixel, which is never possible with the current version of DisplaySurface. Attached patch fixes that by using ds_get_bits_per_pixel.
2009-08-23Remove the unnecessary and only global in musicpal.cAndrzej Zaborowski1-2/+1
2009-08-23Merge with balrog@git.sv.gnu.org:/srv/git/qemu.gitAndrzej Zaborowski5-19/+39
2009-08-23Make musicpal.c use the I2C device and the Marvell 88w8618 audio deviceAndrzej Zaborowski1-387/+40
Signed-off-by: Benoit Canet <benoit.canet@gmail.com> Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
2009-08-23Extract the Marvell 88w8618 audio device from musicpal.cAndrzej Zaborowski1-0/+274
Signed-off-by: Benoit Canet <benoit.canet@gmail.com> Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
2009-08-23Extract musicpal.c I2C bitbanging code and make it gpio awareAndrzej Zaborowski1-0/+179
Signed-off-by: Benoit Canet <benoit.canet@gmail.com> Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
2009-08-23Musicpal qdev conversion: gpio (except I2C part), keyboard and lcdBenoit Canet1-84/+230
Signed-off-by: Benoit Canet <benoit.canet@gmail.com> Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
2009-08-23Sparc32: fix monitor commands 'info pic' and 'info irq'Blue Swirl3-14/+19
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-23Rearrange to suppress gcc 3.3.5 warning about unused variableBlue Swirl1-3/+6
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-22ESP: implement Transfer PadBlue Swirl1-0/+7
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>