floppy: move cmos_get_fd_drive_type() from pc
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: John Snow <jsnow@redhat.com> Message-Id: <20200619091905.21676-6-kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
ffdf43edc3
commit
89ed90e318
@ -32,7 +32,6 @@
|
|||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
#include "qemu/timer.h"
|
#include "qemu/timer.h"
|
||||||
#include "hw/i386/pc.h"
|
|
||||||
#include "hw/acpi/aml-build.h"
|
#include "hw/acpi/aml-build.h"
|
||||||
#include "hw/irq.h"
|
#include "hw/irq.h"
|
||||||
#include "hw/isa/isa.h"
|
#include "hw/isa/isa.h"
|
||||||
@ -2812,6 +2811,31 @@ static Aml *build_fdinfo_aml(int idx, FloppyDriveType type)
|
|||||||
return dev;
|
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)
|
static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope)
|
||||||
{
|
{
|
||||||
Aml *dev;
|
Aml *dev;
|
||||||
|
25
hw/i386/pc.c
25
hw/i386/pc.c
@ -386,31 +386,6 @@ static uint64_t ioportF0_read(void *opaque, hwaddr addr, unsigned size)
|
|||||||
|
|
||||||
#define REG_EQUIPMENT_BYTE 0x14
|
#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,
|
static void cmos_init_hd(ISADevice *s, int type_ofs, int info_ofs,
|
||||||
int16_t cylinders, int8_t heads, int8_t sectors)
|
int16_t cylinders, int8_t heads, int8_t sectors)
|
||||||
{
|
{
|
||||||
|
@ -16,5 +16,6 @@ void sun4m_fdctrl_init(qemu_irq irq, hwaddr io_base,
|
|||||||
DriveInfo **fds, qemu_irq *fdc_tc);
|
DriveInfo **fds, qemu_irq *fdc_tc);
|
||||||
|
|
||||||
FloppyDriveType isa_fdc_get_drive_type(ISADevice *fdc, int i);
|
FloppyDriveType isa_fdc_get_drive_type(ISADevice *fdc, int i);
|
||||||
|
int cmos_get_fd_drive_type(FloppyDriveType fd0);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -178,7 +178,6 @@ typedef void (*cpu_set_smm_t)(int smm, void *arg);
|
|||||||
void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs);
|
void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs);
|
||||||
|
|
||||||
ISADevice *pc_find_fdc0(void);
|
ISADevice *pc_find_fdc0(void);
|
||||||
int cmos_get_fd_drive_type(FloppyDriveType fd0);
|
|
||||||
|
|
||||||
/* port92.c */
|
/* port92.c */
|
||||||
#define PORT92_A20_LINE "a20"
|
#define PORT92_A20_LINE "a20"
|
||||||
|
Loading…
Reference in New Issue
Block a user