Statistics
| Branch: | Revision:

root / hw / fdc.c @ 16fd921b

History | View | Annotate | Download (68.8 kB)

# Date Author Comment
6d013772 07/17/2012 05:48 pm Pavel Hrdina

fdc: fix relative seek

Signed-off-by: Pavel Hrdina <>
Signed-off-by: Kevin Wolf <>

61a8d649 07/17/2012 05:48 pm Markus Armbruster

fdc: Move floppy geometry guessing back from block.c

Commit 5bbdbb46 moved it to block.c because "other geometry guessing
functions already reside in block.c". Device-specific functionality
should be kept in device code, not the block layer. Move it back....

6be01b1e 07/09/2012 04:53 pm Pavel Hrdina

fdc: rewrite seek and DSKCHG bit handling

This bit is cleared on every successful seek to a different track (cylinder).
The seek is also called on revalidate or on read/write/format commands which
also clear the DSKCHG bit.

Signed-off-by: Pavel Hrdina <>...

2fee0088 07/09/2012 04:53 pm Pavel Hrdina

fdc: fix interrupt handling

If you call the SENSE INTERRUPT STATUS command while there is no interrupt
waiting you get as result unknown command.

Fixed status0 register handling for read/write/format commands.

Signed-off-by: Pavel Hrdina <>...

1f69c2b0 07/09/2012 04:53 pm Markus Armbruster

fdc: Drop broken code for user-defined floppy geometry

bdrv_get_floppy_geometry_hint() fails to store through its parameter
drive when bs has a geometry hint. Makes fd_revalidate() assign
random crap to drv->drive.

Has been broken that way for ages. Harmless, because:...

cced7a13 06/21/2012 09:45 pm Blue Swirl

fdc: use LOG_UNIMP logging

Convert uses of FLOPPY_ERROR to either FLOPPY_DPRINTF
(for implemented cases) or to use LOG_UNIMP (unimplemented).

Signed-off-by: Blue Swirl <>

c52acf60 06/15/2012 03:03 pm Pavel Hrdina

fdc: fix implied seek while there is no media in drive

The Windows uses 'READ' command at the start of an instalation
without checking the 'dir' register. We have to abort the transfer
with an abnormal termination if there is no media in the drive.

Signed-off-by: Pavel Hrdina <>...

dfc65f1f 06/15/2012 03:03 pm Markus Armbruster

Un-inline fdctrl_init_isa()

Signed-off-by: Markus Armbruster <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Kevin Wolf <>

cfb08fba 05/25/2012 07:21 pm Pavel Hrdina

fdc: fix media detection

We have to set up 'media_changed' after guest start so floppy driver
could detect that there is no media in drive. For this purpose we call
'fdctrl_change_cb' instead of 'fd_revalidate' in 'fdctrl_connect_drives'.
'fd_revalidate' is called inside 'fdctrl_change_cb'....

21fcf360 05/07/2012 08:33 pm Hervé Poussineau

fdc: simplify media change handling

This also (partly) fixes IBM OS/2 Warp 4.0 floppy installation, where
not all floppies have the same format (2x80x18 for the first ones,
2x80x23 for the next ones).

Signed-off-by: Hervé Poussineau <>...

c9ae703d 04/28/2012 09:51 pm Hervé Poussineau

fdc: Parametrize ISA base, IRQ and DMA

Keep the PC values as defaults but allow to override them for PReP.

Signed-off-by: Hervé Poussineau <>
Signed-off-by: Andreas Färber <>
Reviewed-by: Markus Armbruster <>

08388273 02/29/2012 01:48 pm Hervé Poussineau

fdc: take side count into account

Floppies can be simple or double-sided. However, current code
was only taking the common case into account (ie 2 sides).

This repairs single-sided floppies, which where totally broken
before this patch : for track > 0, wrong sector number was...

1457a758 02/29/2012 01:48 pm Hervé Poussineau

fdc: set busy bit when starting a command

This bit must be active while a command is currently executed.

Signed-off-by: Hervé Poussineau <>
Signed-off-by: Kevin Wolf <>

a005186c 02/29/2012 01:48 pm Hervé Poussineau

fdc: most control commands do not generate interrupts

In fact, only three control commands generate an interrupt:
read_id, recalibrate and seek

Signed-off-by: Hervé Poussineau <>
Signed-off-by: Kevin Wolf <>

8510854e 02/29/2012 01:48 pm Hervé Poussineau

fdc: handle read-only floppies (abort early on write commands)

A real floppy doesn't attempt to write to read-only media either.

Signed-off-by: Hervé Poussineau <>
Signed-off-by: Kevin Wolf <>

a758f8f4 02/29/2012 01:48 pm Hervé Poussineau

fdc: add CCR (Configuration Control Register) write register

DIR and CCR registers share the same address ; DIR is read-only
while CCR is write-only

CCR register is used to change media transfer rate, which will be
checked in following changes.

Signed-off-by: Hervé Poussineau <>...

f8d3d128 02/29/2012 01:48 pm Hervé Poussineau

block: add a transfer rate for floppy types

Floppies must be read at a specific transfer rate, depending of its own format.
Update floppy description table to include required transfer rate.

Signed-off-by: Hervé Poussineau <>
Signed-off-by: Kevin Wolf <>

09c6d585 02/29/2012 01:48 pm Hervé Poussineau

fdc: add a 'check media rate' property. Not used yet

Set it to true for current Qemu versions, and false for previous ones

Signed-off-by: Hervé Poussineau <>
Signed-off-by: Kevin Wolf <>

844f65d6 02/29/2012 01:48 pm Hervé Poussineau

fdc: check if media rate is correct before doing any transfer

The programmed rate has to be the same as the required rate for the
floppy format ; if that's not the case, the transfer should abort.
This check can be disabled by using the 'check_media_rate' property....

b072a3c8 02/29/2012 01:48 pm Hervé Poussineau

fdc: fix seek command, which shouldn't check tracks

The seek command just sends step pulses to the drive and doesn't care if
there is a medium inserted of if it is banging the head against the drive.

Signed-off-by: Hervé Poussineau <>...

a2df5fa3 02/29/2012 01:48 pm Hervé Poussineau

fdc: DIR (Digital Input Register) should return status of current drive...

Signed-off-by: Hervé Poussineau <>
Signed-off-by: Kevin Wolf <>

83f7d43a 02/15/2012 05:39 pm Andreas Färber

qom: Unify type registration

Replace device_init() with generalized type_init().

While at it, unify naming convention: type_init([$prefix_]register_types)
Also, type_init() is a function, so add preceding blank line where
necessary and don't put a semicolon after the closing brace....

39bffca2 02/03/2012 06:41 pm Anthony Liguori

qdev: register all types natively through QEMU Object Model

This was done in a mostly automated fashion. I did it in three steps and then
rebased it into a single step which avoids repeatedly touching every file in
the tree.

The first step was a sed-based addition of the parent type to the subclass...

999e12bb 01/27/2012 06:50 pm Anthony Liguori

sysbus: apic: ioapic: convert to QEMU Object Model

This converts three devices because apic and ioapic are subclasses of sysbus.
Converting subclasses independently of their base class is prohibitively hard.

Signed-off-by: Anthony Liguori <>

8f04ee08 01/27/2012 06:50 pm Anthony Liguori

isa: pic: convert to QEMU Object Model

This converts two devices at once because PIC subclasses ISA and converting
subclasses independently is extremely hard.

Signed-off-by: Anthony Liguori <>

bcc4e41f 12/06/2011 11:59 am Stefan Weil

Convert source files to UTF-8 encoding

Most QEMU files either are pure ASCII or use UTF-8.
Convert some files which still used ISO-8859-1 to UTF-8.

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

750ecd44 11/28/2011 03:38 pm Avi Kivity

sysbus: rename sysbus_init_mmio_region() to sysbus_init_mmio()

Signed-off-by: Avi Kivity <>

dc6c1b37 11/24/2011 06:31 pm Avi Kivity

fdc: convert to memory API

FIXME: instance ID for migration

Signed-off-by: Avi Kivity <>

a18e67f5 10/21/2011 06:34 pm Kevin Wolf

fdc: Fix floppy port I/O

The floppy device was broken by commit 212ec7ba (fdc: Convert to
isa_register_portio_list). While the old interface provided the port number
relative to the floppy drive's io_base, the new one provides the real port
number, so we need to apply a bitmask now to get the register number....

34d4260e 10/21/2011 06:34 pm Kevin Wolf

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 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...

212ec7ba 10/11/2011 04:57 pm Richard Henderson

fdc: Convert to isa_register_portio_list

Signed-off-by: Richard Henderson <>
Signed-off-by: Avi Kivity <>

2f290a8c 09/25/2011 02:58 pm Richard Henderson

fdc: Convert isabus_fdc_init1 to MemoryRegion

This requires some amount of hoop-jumping, so that we don't
inadvertently claim port 0x3f6, which is used by ISA IDE.

The sysbus initialization path is as yet unconverted.

Signed-off-by: Richard Henderson <>...

7d4b4ba5 09/12/2011 04:17 pm Markus Armbruster

block: New change_media_cb() parameter load

To let device models distinguish between eject and load.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

9e6a4c91 09/12/2011 04:17 pm Markus Armbruster

block: Drop BlockDriverState member removable

It's a confused mess (see previous commit). No users remain.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

fb0c61a5 09/12/2011 04:17 pm Markus Armbruster

hw: Trim superfluous #include "block_int.h"

Including it in device models is unclean, including it without a
reason adds insult to injury.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

8e49ca46 09/06/2011 12:24 pm Markus Armbruster

block: Leave tracking media change to device models

hw/fdc.c is the only one that cares.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

18d90055 09/06/2011 12:24 pm Markus Armbruster

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 physical
media change, but they don't.

bdrv_media_changed() lets you poll for media change, but it returns...

242cca4f 08/21/2011 11:01 pm Blue Swirl

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 */...
7d905f71 04/07/2011 02:51 pm Jason Wang

floppy: save and restore DIR register

We need to keep DIR register unchanged across migration, but currently it
depends on the media_changed flags from block layer. Since we do not
save/restore it and the bdrv_open() called in dest node may set the
media_changed flag when trying to open floppy image, guest driver may think the...

74475455 03/21/2011 10:23 am Paolo Bonzini

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\>' )...
63ffb564 02/20/2011 11:33 am Blue Swirl

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 <>

d288c7ba 02/20/2011 11:33 am Blue Swirl

fdc: use FDriveType for floppy drive type

Signed-off-by: Blue Swirl <>

5bbdbb46 02/20/2011 11:33 am Blue Swirl

fdc: move floppy geometry guessing to block.c

Other geometry guessing functions already reside in block.c.

Remove some unused or debugging only fields.

Signed-off-by: Blue Swirl <>

1ca4d09a 12/11/2010 11:32 pm Gleb Natapov

Add bootindex parameter to net/block/fd device

If bootindex is specified on command line a string that describes device
in firmware readable way is added into sorted list. Later this list will
be passed into firmware to control boot order.

Signed-off-by: Gleb Natapov <>...

dee41d58 12/11/2010 11:27 pm Gleb Natapov

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 <>
Signed-off-by: Blue Swirl <>

779206de 12/11/2010 11:27 pm Gleb Natapov

Introduce fw_name field to DeviceInfo structure.

Add "fw_name" to DeviceInfo to use in device path building. In
contrast to "name" "fw_name" should refer to functionality device
provides instead of particular device model like "name" does.

Signed-off-by: Gleb Natapov <>...

2507c12a 12/11/2010 05:24 pm Alexander Graf

Add endianness as io mem parameter

As stated before, devices can be little, big or native endian. The
target endianness is not of their concern, so we need to push things
down a level.

This patch adds a parameter to cpu_register_io_memory that allows a
device to choose its endianness. For now, all devices simply choose...

2446333c 08/24/2010 06:22 pm Blue Swirl

Rearrange block headers

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 <>

b47b3525 07/06/2010 06:05 pm Markus Armbruster

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 of
fdctrl_init_isa() ignore its value, change it to die instead of...

f8b6cc00 07/02/2010 02:18 pm Markus Armbruster

qdev: Decouple qdev_prop_drive from DriveInfo

Make the property point to BlockDriverState, cutting out the DriveInfo
middleman. This prepares the ground for block devices that don't have
a DriveInfo.

Currently all user-defined ones have a DriveInfo, because the only way...

18846dee 07/02/2010 02:18 pm Markus Armbruster

block: Catch attempt to attach multiple devices to a blockdev

For instance, -device scsi-disk,drive=foo -device scsi-disk,drive=foo
happily 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,...

7d0d6950 07/02/2010 02:18 pm Markus Armbruster

block: Fix virtual media change for if=none

BlockDriverState member removable controls whether virtual media
change (monitor commands change, eject) is allowed. It is set when
the "type hint" is BDRV_TYPE_CDROM or BDRV_TYPE_FLOPPY.

The type hint is only set by drive_init(). It sets BDRV_TYPE_FLOPPY...

bb350a5e 06/15/2010 10:41 am Jes Sorensen

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 values
for FD_CMD_SAVE is 0x2e and FD_CMD_RESTORE is 0x4e. Verified against...

666daa68 06/04/2010 04:20 pm Markus Armbruster

blockdev: Collect block device code in new blockdev.c

Anything that moves hundreds of lines out of vl.c can't be all bad.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

a64405d1 05/15/2010 05:33 pm Jan Kiszka

fdc: Register vmstate via qdev

Establish vmstate containers for ISA and sysbus variant, define the
iobase as instance ID alias, and let qdev do the vmstate registration
work.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Blue Swirl <>

3c83eb4f 04/18/2010 11:46 am Blue Swirl

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);...

8ec68b06 03/21/2010 02:30 pm Blue Swirl

Fix a typo

Signed-off-by: Blue Swirl <>

995bf0ca 03/13/2010 01:14 pm Gerd Hoffmann

fdc: fix drive property handling.

Fix the floppy controller init wrappers to set the drive properties
only in case the DriveInfo pointers passed in are non NULL. This allows
to set the properties using -global.

Signed-off-by: Gerd Hoffmann <>...

7859cb98 02/07/2010 11:13 am Blue Swirl

fdc: don't use reserved _ prefix

Signed-off-by: Blue Swirl <>

5c02c033 02/07/2010 11:01 am Blue Swirl

fdc: don't use reserved _t suffix

Signed-off-by: Blue Swirl <>

aef30c3c 12/18/2009 07:26 pm Juan Quintela

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 <>
Signed-off-by: Anthony Liguori <>

47f5ba72 12/18/2009 07:26 pm Juan Quintela

fdc: fix migration from 0.11

0.11 uses as instance ide io_base, get it back

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

82407d1a 12/13/2009 03:30 pm Artyom Tarasenko

fdc/sparc32: don't hang on detection under OBP

Stepping through the SS-5's OBP initialization routines
it looks like reading fdc main status register should
clear the fd interrupt.
The patch doesn't fix problems with fdc on sparc platform,
it only fixes fdc detection....

2966b390 11/12/2009 07:23 pm Juan Quintela

fdc: fix vmstate variable passed

When code was transformed to use qdev_reset/vmstate registration, vmstate
was passed a variable of the wrong type

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

39a51dfd 11/09/2009 04:43 pm Markus Armbruster

qdev: Tag isa-fdc, PIIX3 IDE and PIIX4 IDE as no-user

These devices are created automatically, and attempting to create
another one with -device fails with "qemu: hardware error:
register_ioport_write: invalid opaque".

Signed-off-by: Markus Armbruster <>...

a01d6ef4 11/07/2009 10:55 am Blue Swirl

sparc32 (mostly): remove unneeded calls to device reset

Signed-off-by: Blue Swirl <>

d6698281 10/27/2009 07:28 pm Juan Quintela

vmstate: Rename VMS_VARRAY to VMS_VARRAY_INT32

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

2be37833 10/24/2009 07:56 pm Blue Swirl

fdc: convert to reset + vmsd

Signed-off-by: Blue Swirl <>

5c17ca25 10/07/2009 04:54 pm Markus Armbruster

Clean up test for qdev_init() failure

Some callers test for != 0, some for < 0. Normalize to < 0.

Patchworks-ID: 35171
Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

e23a1b33 10/07/2009 04:54 pm Markus Armbruster

New qdev_init_nofail()

Like qdev_init(), but terminate program via hw_error() instead of
returning an error value.

Use it instead of qdev_init() where terminating the program on failure
is okay, either because it's during machine construction, or because...

99244fa1 10/05/2009 05:32 pm Gerd Hoffmann

floppy: move dma setup + drive connect to fdctrl_init_common()

isa-fdc is completely qdev-ified with this patch applied, all
configuration 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...

fd8014e1 10/05/2009 05:32 pm Gerd Hoffmann

floppy: add drive properties.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

d4bfa4d7 10/05/2009 05:32 pm Juan Quintela

vmstate: remove const from pre_save() functions

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

e59fb374 10/05/2009 05:32 pm Juan Quintela

vmstate: add version_id argument to post_load

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

c227f099 10/02/2009 12:12 am Anthony Liguori

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. Something
like this must be presented on the list first so people can provide input...

99a0949b 10/01/2009 09:45 pm malc

Get rid of _t suffix

Some not so obvious bits, slirp and Xen were left alone for the time
being.

Signed-off-by: malc <>

d7a6c270 09/11/2009 07:10 pm Juan Quintela

vmstate: port fdc device

We can't move fifo back to an embeded array because it needs to be aligned

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

6ee093c9 09/11/2009 06:19 pm Juan Quintela

Unexport ticks_per_sec variable. Create get_ticks_per_sec() function

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

2e15e23b 09/10/2009 06:47 pm Gerd Hoffmann

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 <>

86c86157 09/10/2009 06:47 pm Gerd Hoffmann

qdev: drop iobase properties from isa bus

Lot of ISA devices work at fixed addresses, so having iobase
as bus property doesn't make much sense. Devices which can
have different iobases will get a device property.

Also simply hard-code stuff which can't be configured anyway....

81a322d4 08/28/2009 04:43 am Gerd Hoffmann

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 init
callbacks can't signal failure because the init() callback has no
return value. This patch fixes it....

e8935eef 08/28/2009 04:30 am Gerd Hoffmann

Move isa_connect_irq calls into isa_create_simple

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 <>
Signed-off-by: Anthony Liguori <>

2091ba23 08/28/2009 04:30 am Gerd Hoffmann

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...
d60efc6b 08/25/2009 09:29 pm Blue Swirl

Make CPURead/WriteFunc structure 'const'

Signed-off-by: Blue Swirl <>

8baf73ad 08/10/2009 09:05 pm Gerd Hoffmann

qdev/isa: convert fdc.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>
Message-Id:

12a71a02 07/20/2009 09:56 am Blue Swirl

Clean up fdc qdev conversion

Signed-off-by: Blue Swirl <>

e8133762 07/17/2009 02:01 pm Blue Swirl

Sparc32: fix fdc io_base

On some Sparc32 machines, fdc is located above 4G limit, so uint32_t is not
appropriate type for io_base.

Signed-off-by: Blue Swirl <>

ee6847d1 07/17/2009 01:28 am Gerd Hoffmann

qdev: rework device properties.

This patch is a major overhaul of the device properties. The properties
are saved directly in the device state struct now, the linked list of
property values is gone.

Advantages: * We don't have to maintain the list with the property values....

f64ab228 07/15/2009 05:41 pm Blue Swirl

Convert fdc to qdev

Signed-off-by: Blue Swirl <>

a08d4367 06/29/2009 10:18 pm Jan Kiszka

Revert "Introduce reset notifier order"

This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (and
updates later added users of qemu_register_reset), we solved the
problem it originally addressed less invasively.

Signed-off-by: Jan Kiszka <>...

1eed09cb 06/16/2009 11:18 pm Avi Kivity

Remove io_index argument from cpu_register_io_memory()

The parameter is always zero except when registering the three internal
io regions (ROM, unassigned, notdirty). Remove the parameter to reduce
the API's power, thus facilitating future change.

Signed-off-by: Avi Kivity <>...

8217606e 05/22/2009 06:50 pm Jan Kiszka

Introduce reset notifier order

Add the parameter 'order' to qemu_register_reset and sort callbacks on
registration. On system reset, callbacks with lower order will be
invoked before those with higher order. Update all existing users to the
standard order 0....

001faf32 05/13/2009 08:53 pm Blue Swirl

Replace gcc variadic macro extension with C99 version

Signed-off-by: Blue Swirl <>

487414f1 02/06/2009 12:06 am aliguori

hw: remove error handling from qemu_malloc() callers (Avi Kivity)

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162

f2d81b33 01/24/2009 02:09 pm blueswir1

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)....

b1503cda 12/22/2008 10:33 pm malc

Use the ARRAY_SIZE() macro where appropriate.

Change from v1:
Avoid changing the existing coding style in certain files.

Signed-off-by: Stuart Brady <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6120 c046a42c-6fe2-441c-8c8c-71466251a162

e64d7d59 12/02/2008 07:47 pm blueswir1

Remove address masking

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5853 c046a42c-6fe2-441c-8c8c-71466251a162

771effeb 05/01/2008 10:05 pm blueswir1

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 to
the last sector of the floppy.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4294 c046a42c-6fe2-441c-8c8c-71466251a162

b3bc1540 05/01/2008 10:03 pm blueswir1

FDC: Fix buffer overflow (Hervé Poussineau)

In floppy controller, programming PIO writes which are more than one sector
long 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

cefec4f5 04/29/2008 07:18 pm blueswir1

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