History | View | Annotate | Download (60.1 kB)
fdc: Fix floppy port I/O
The floppy device was broken by commit 212ec7ba (fdc: Convert toisa_register_portio_list). While the old interface provided the port numberrelative to the floppy drive's io_base, the new one provides the real portnumber, so we need to apply a bitmask now to get the register number....
pc: Fix floppy drives with if=none
Commit 63ffb564 broke floppy devices specified on the command line like-drive file=...,if=none,id=floppy -global isa-fdc.driveA=floppy because itrelies 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...
fdc: Convert to isa_register_portio_list
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Avi Kivity <avi@redhat.com>
fdc: Convert isabus_fdc_init1 to MemoryRegion
This requires some amount of hoop-jumping, so that we don'tinadvertently claim port 0x3f6, which is used by ISA IDE.
The sysbus initialization path is as yet unconverted.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
block: New change_media_cb() parameter load
To let device models distinguish between eject and load.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Drop BlockDriverState member removable
It's a confused mess (see previous commit). No users remain.
hw: Trim superfluous #include "block_int.h"
Including it in device models is unclean, including it without areason adds insult to injury.
block: Leave tracking media change to device models
hw/fdc.c is the only one that cares.
fdc: Make media change detection more robust
fdctrl_change_cb() gets called on a virtual media change via monitor.It would be nice if host device block drivers called it on physicalmedia change, but they don't.
bdrv_media_changed() lets you poll for media change, but it returns...
fdc: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:struct FDCtrl { uint8_t version; /* 0 1 */
/* XXX 7 bytes hole, try to pack */
qemu_irq irq; /* 8 8 */...
floppy: save and restore DIR register
We need to keep DIR register unchanged across migration, but currently itdepends on the media_changed flags from block layer. Since we do notsave/restore it and the bdrv_open() called in dest node may set themedia_changed flag when trying to open floppy image, guest driver may think the...
change all other clock references to use nanosecond resolution accessors
This was done with:
sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' )...
fdc: refactor device creation
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>
fdc: use FDriveType for floppy drive type
fdc: move floppy geometry guessing to block.c
Other geometry guessing functions already reside in block.c.
Remove some unused or debugging only fields.
Add bootindex parameter to net/block/fd device
If bootindex is specified on command line a string that describes devicein firmware readable way is added into sorted list. Later this list willbe passed into firmware to control boot order.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
Keep track of ISA ports ISA device is using in qdev.
Store all io ports used by device in ISADevice structure.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Introduce fw_name field to DeviceInfo structure.
Add "fw_name" to DeviceInfo to use in device path building. Incontrast to "name" "fw_name" should refer to functionality deviceprovides instead of particular device model like "name" does.
Add endianness as io mem parameter
As stated before, devices can be little, big or native endian. Thetarget endianness is not of their concern, so we need to push thingsdown a level.
This patch adds a parameter to cpu_register_io_memory that allows adevice to choose its endianness. For now, all devices simply choose...
Rearrange block headers
Changing block.h or blockdev.h resulted in recompiling most objects.
Move DriveInfo typedef and BlockInterfaceType enum definitionsto qemu-common.h and rearrange blockdev.h use to decrease churn.
fdc: Reject unimplemented error actions
drive_init() doesn't permit them for if=floppy, but that's worthless:we get them via if=none and -global.
This can make device initialization fail. Since all callers offdctrl_init_isa() ignore its value, change it to die instead of...
qdev: Decouple qdev_prop_drive from DriveInfo
Make the property point to BlockDriverState, cutting out the DriveInfomiddleman. This prepares the ground for block devices that don't havea DriveInfo.
Currently all user-defined ones have a DriveInfo, because the only way...
block: Catch attempt to attach multiple devices to a blockdev
For instance, -device scsi-disk,drive=foo -device scsi-disk,drive=foohappily creates two SCSI disks connected to the same block device.It's all downhill from there.
Device usb-storage deliberately attaches twice to the same blockdev,...
block: Fix virtual media change for if=none
BlockDriverState member removable controls whether virtual mediachange (monitor commands change, eject) is allowed. It is set whenthe "type hint" is BDRV_TYPE_CDROM or BDRV_TYPE_FLOPPY.
The type hint is only set by drive_init(). It sets BDRV_TYPE_FLOPPY...
Correct definitions for FD_CMD_SAVE and FD_CMD_RESTORE
Correct definitions for FD_CMD_SAVE and FD_CMD_RESTORE in hw/fdc.c
Per https://bugs.launchpad.net/qemu/+bug/424453 the correct valuesfor FD_CMD_SAVE is 0x2e and FD_CMD_RESTORE is 0x4e. Verified against...
blockdev: Collect block device code in new blockdev.c
Anything that moves hundreds of lines out of vl.c can't be all bad.
fdc: Register vmstate via qdev
Establish vmstate containers for ISA and sysbus variant, define theiobase as instance ID alias, and let qdev do the vmstate registrationwork.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix harmless if statements with empty body, spotted by clang
These clang errors are harmless but worth fixing: CC libhw64/fdc.o/src/qemu/hw/fdc.c:998:74: error: if statement has empty body [-Wempty-body] FLOPPY_DPRINTF("Floppy digital input register: 0x%02x\n", retval);...
Fix a typo
fdc: fix drive property handling.
Fix the floppy controller init wrappers to set the drive propertiesonly in case the DriveInfo pointers passed in are non NULL. This allowsto set the properties using -global.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
fdc: don't use reserved _ prefix
fdc: don't use reserved _t suffix
Revert "fdc: fix vmstate variable passed"
Floppy used the io_base address to register savevm region.
This reverts commit 2966b390d0f7cd5e5b971290fcc20685de374228.
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
fdc: fix migration from 0.11
0.11 uses as instance ide io_base, get it back
fdc/sparc32: don't hang on detection under OBP
Stepping through the SS-5's OBP initialization routinesit looks like reading fdc main status register shouldclear the fd interrupt.The patch doesn't fix problems with fdc on sparc platform,it only fixes fdc detection....
fdc: fix vmstate variable passed
When code was transformed to use qdev_reset/vmstate registration, vmstatewas passed a variable of the wrong type
qdev: Tag isa-fdc, PIIX3 IDE and PIIX4 IDE as no-user
These devices are created automatically, and attempting to createanother one with -device fails with "qemu: hardware error:register_ioport_write: invalid opaque".
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
sparc32 (mostly): remove unneeded calls to device reset
vmstate: Rename VMS_VARRAY to VMS_VARRAY_INT32
fdc: convert to reset + vmsd
Clean up test for qdev_init() failure
Some callers test for != 0, some for < 0. Normalize to < 0.
Patchworks-ID: 35171Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
New qdev_init_nofail()
Like qdev_init(), but terminate program via hw_error() instead ofreturning an error value.
Use it instead of qdev_init() where terminating the program on failureis okay, either because it's during machine construction, or because...
floppy: move dma setup + drive connect to fdctrl_init_common()
isa-fdc is completely qdev-ified with this patch applied, allconfiguration uses properties.
sysbus-fdc needs dma_channel config fixed. There is only one user(mips_jazz) which uses dma channel 0. Can anyone knowing this...
floppy: add drive properties.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: remove const from pre_save() functions
vmstate: add version_id argument to post_load
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
vmstate: port fdc device
We can't move fifo back to an embeded array because it needs to be aligned
Unexport ticks_per_sec variable. Create get_ticks_per_sec() function
qdev: simplify isa irq assignments
isa-bus owns the isa irqs now, so it can hand them out directly.There is no need for the separate isa_connect_irqs step, drop it.
Also hard-code isa interrupts which can't be configured anyway.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qdev: drop iobase properties from isa bus
Lot of ISA devices work at fixed addresses, so having iobaseas bus property doesn't make much sense. Devices which canhave different iobases will get a device property.
Also simply hard-code stuff which can't be configured anyway....
qdev: add return value to init() callbacks.
Sorry folks, but it has to be. One more of these invasive qdev patches.
We have a serious design bug in the qdev interface: device initcallbacks can't signal failure because the init() callback has noreturn value. This patch fixes it....
Move isa_connect_irq calls into isa_create_simple
Now with isa-bus maintaining the isa irqs we can move theisa_connect_irq() calls into isa_create_simple().
isa bus irq changes and fixes.
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...
Make CPURead/WriteFunc structure 'const'
qdev/isa: convert fdc.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-Id:
Clean up fdc qdev conversion
Sparc32: fix fdc io_base
On some Sparc32 machines, fdc is located above 4G limit, so uint32_t is notappropriate type for io_base.
qdev: rework device properties.
This patch is a major overhaul of the device properties. The propertiesare saved directly in the device state struct now, the linked list ofproperty values is gone.
Advantages: * We don't have to maintain the list with the property values....
Convert fdc to qdev
Revert "Introduce reset notifier order"
This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (andupdates later added users of qemu_register_reset), we solved theproblem it originally addressed less invasively.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Remove io_index argument from cpu_register_io_memory()
The parameter is always zero except when registering the three internalio regions (ROM, unassigned, notdirty). Remove the parameter to reducethe API's power, thus facilitating future change.
Signed-off-by: Avi Kivity <avi@redhat.com>...
Introduce reset notifier order
Add the parameter 'order' to qemu_register_reset and sort callbacks onregistration. On system reset, callbacks with lower order will beinvoked before those with higher order. Update all existing users to thestandard order 0....
Replace gcc variadic macro extension with C99 version
hw: remove error handling from qemu_malloc() callers (Avi Kivity)
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162
Floppy: Properly handle Sense Interrupt Status after FDC Reset
Original text below.
Attached is a patch that changes how the emulated floppy controller replies to Sense Interrupt Status commands immediately after a controller reset. The specs state that after a Reset the 82078 goes into polling mode which needs four Sense Interrupt Status commands to be issued afterwards to clear the status of each drive. Currently we always respond to Sense Interrupt Status with a SEEK END instead of POLLING. This causes a problem with the SCO Openserver installer which is expects a POLLING state after reset. This patch returns a POLLING status for four Sense Interrupt Status requests immediately after a controller reset. This approach mirrors the way Bochs handles this situation. With the attached patch applied Openserver gets further when trying to load storage drivers from the floppy disk (blocked by another issue, patch on its way). I have successfully tested the floppy drive on the following OSs after applying this patch: Windows 98, Windows XP SP2, Linux x86 (SysRescCD 1.1.3 and Ubuntu 8.10)....
Use the ARRAY_SIZE() macro where appropriate.
Change from v1: Avoid changing the existing coding style in certain files.
Signed-off-by: Stuart Brady <stuart.brady@gmail.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6120 c046a42c-6fe2-441c-8c8c-71466251a162
Remove address masking
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5853 c046a42c-6fe2-441c-8c8c-71466251a162
FDC: Fix data transfer len (Hervé Poussineau)
In floppy controller, transfer data len is not correctly calculated.We should read up to the last sector specified by the caller, and not up tothe last sector of the floppy.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4294 c046a42c-6fe2-441c-8c8c-71466251a162
FDC: Fix buffer overflow (Hervé Poussineau)
In floppy controller, programming PIO writes which are more than one sectorlong leads to a buffer overflow of the fdtrl->fifo[] array.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4293 c046a42c-6fe2-441c-8c8c-71466251a162
FDC fix 10/10 (Hervé Poussineau):- Replaces access to cur_drv field by macros.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4290 c046a42c-6fe2-441c-8c8c-71466251a162
FDC fix 9/10 (Hervé Poussineau):- Supports up to 4 floppy drives if MAX_FD is set to 4.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4289 c046a42c-6fe2-441c-8c8c-71466251a162
FDC fix 8/10 (Hervé Poussineau):- Replaces bootsel field by the whole tdr register. It may be easier if we want to later add support for tapes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4288 c046a42c-6fe2-441c-8c8c-71466251a162
FDC fix 7/10 (Hervé Poussineau):- Removes useless fields in fdrive_t structure.- Adds a message when bdrv_read/bdrv_write calls fail.- Rename int_status to status0.- Replace some constants by value names.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4287 c046a42c-6fe2-441c-8c8c-71466251a162
FDC fix 6/10 (Hervé Poussineau):- Stores controller state in MSR register instead of internal state field. This simplifies the fdctrl_read_main_status() function, which may be called in some tight loops.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4286 c046a42c-6fe2-441c-8c8c-71466251a162
FDC fix 5/10 (Hervé Poussineau):- Better handling of DOR register. DOR register drives external motors, but it not limited to existing drives.- Use FD_DOR_nRESET flag instead of internal FD_CTRL_RESET flag.- Support writing to DOR register even in reset mode (as said in specification)...
FDC fix 4/10 (Hervé Poussineau):- Handles correctly FD_MSR_NONDMA/FD_DOR_NONDMA flags, and uses them when possible. Fixes a problem with SPECIFY command.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4284 c046a42c-6fe2-441c-8c8c-71466251a162
FDC fix 3/10 (Hervé Poussineau):- Fixes status A and status B registers. It removes one Sun4m mutation. Also removes the internal FD_CTRL_INTR flag.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4283 c046a42c-6fe2-441c-8c8c-71466251a162
FDC fix 2/10 (Hervé Poussineau):- Extract seeking to next sector handling in a function. Add a sector seek in PIO read and write modes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4282 c046a42c-6fe2-441c-8c8c-71466251a162
FDC fix 1/12 (Hervé Poussineau):- Adds a command lookup table, as suggested by Fabrice at http://lists.gnu.org/archive/html/qemu-devel/2008-04/msg00143.html- This also moves initialization functions at the bottom of the file to prevent multiple forward declarations....
Simplify FDC code (Hervé Poussineau)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4174 c046a42c-6fe2-441c-8c8c-71466251a162
Wire up TC signal from Aux1 to FDC
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4096 c046a42c-6fe2-441c-8c8c-71466251a162
Give names to magic numbers (Herv�oussineau)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4000 c046a42c-6fe2-441c-8c8c-71466251a162
Register only valid register access widths
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3881 c046a42c-6fe2-441c-8c8c-71466251a162
Add "cache" parameter to "-drive" (Laurent Vivier).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3848 c046a42c-6fe2-441c-8c8c-71466251a162
Fix bdrv_get_geometry to return uint64_t, by Andre Przywara.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3825 c046a42c-6fe2-441c-8c8c-71466251a162
Fix wrong signedness, by Andre Przywara.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3815 c046a42c-6fe2-441c-8c8c-71466251a162
Break up vl.h.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
No functional changes: remove dead code and fix indentation & wrapping lines.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3535 c046a42c-6fe2-441c-8c8c-71466251a162
Fix memory corruption: bdrv_read/write API has been changed to take nb_sectors instead of len in bytes but the fdc driver has never been fixed.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3532 c046a42c-6fe2-441c-8c8c-71466251a162
Fix Solaris breakage
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3531 c046a42c-6fe2-441c-8c8c-71466251a162
Constification
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3529 c046a42c-6fe2-441c-8c8c-71466251a162
Remove target dependent code
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3528 c046a42c-6fe2-441c-8c8c-71466251a162
find -type f | xargs sed -i 's/[\t ]$//g' # on most files
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
Emulate spinning floppy disk, by Jan Jezabek.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3168 c046a42c-6fe2-441c-8c8c-71466251a162
Spelling fix, by Stefan Weil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3067 c046a42c-6fe2-441c-8c8c-71466251a162
Use full 36-bit physical address space on SS10
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2830 c046a42c-6fe2-441c-8c8c-71466251a162
Add device save and reset methods to FDC and M48T59
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2665 c046a42c-6fe2-441c-8c8c-71466251a162
Unify IRQ handling.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2635 c046a42c-6fe2-441c-8c8c-71466251a162