aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/block/fdc.c26
-rw-r--r--hw/i386/pc.c25
2 files changed, 25 insertions, 26 deletions
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index f1da83f08e..4f0921298b 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -32,7 +32,6 @@
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/timer.h"
-#include "hw/i386/pc.h"
#include "hw/acpi/aml-build.h"
#include "hw/irq.h"
#include "hw/isa/isa.h"
@@ -2812,6 +2811,31 @@ static Aml *build_fdinfo_aml(int idx, FloppyDriveType type)
return dev;
}
+int cmos_get_fd_drive_type(FloppyDriveType fd0)
+{
+ int val;
+
+ switch (fd0) {
+ case FLOPPY_DRIVE_TYPE_144:
+ /* 1.44 Mb 3"5 drive */
+ val = 4;
+ break;
+ case FLOPPY_DRIVE_TYPE_288:
+ /* 2.88 Mb 3"5 drive */
+ val = 5;
+ break;
+ case FLOPPY_DRIVE_TYPE_120:
+ /* 1.2 Mb 5"5 drive */
+ val = 2;
+ break;
+ case FLOPPY_DRIVE_TYPE_NONE:
+ default:
+ val = 0;
+ break;
+ }
+ return val;
+}
+
static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope)
{
Aml *dev;
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index d103b8c0ab..e78e32b41b 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -386,31 +386,6 @@ static uint64_t ioportF0_read(void *opaque, hwaddr addr, unsigned size)
#define REG_EQUIPMENT_BYTE 0x14
-int cmos_get_fd_drive_type(FloppyDriveType fd0)
-{
- int val;
-
- switch (fd0) {
- case FLOPPY_DRIVE_TYPE_144:
- /* 1.44 Mb 3"5 drive */
- val = 4;
- break;
- case FLOPPY_DRIVE_TYPE_288:
- /* 2.88 Mb 3"5 drive */
- val = 5;
- break;
- case FLOPPY_DRIVE_TYPE_120:
- /* 1.2 Mb 5"5 drive */
- val = 2;
- break;
- case FLOPPY_DRIVE_TYPE_NONE:
- default:
- val = 0;
- break;
- }
- return val;
-}
-
static void cmos_init_hd(ISADevice *s, int type_ofs, int info_ofs,
int16_t cylinders, int8_t heads, int8_t sectors)
{