Revision d288c7ba
b/hw/fdc.c | ||
---|---|---|
627 | 627 |
} |
628 | 628 |
|
629 | 629 |
/* XXX: may change if moved to bdrv */ |
630 |
int fdctrl_get_drive_type(FDCtrl *fdctrl, int drive_num)
|
|
630 |
FDriveType fdctrl_get_drive_type(FDCtrl *fdctrl, int drive_num)
|
|
631 | 631 |
{ |
632 | 632 |
return fdctrl->drives[drive_num].drive; |
633 | 633 |
} |
b/hw/fdc.h | ||
---|---|---|
1 | 1 |
#ifndef HW_FDC_H |
2 | 2 |
#define HW_FDC_H |
3 | 3 |
|
4 |
#include "blockdev.h" |
|
5 |
|
|
4 | 6 |
/* fdc.c */ |
5 | 7 |
#define MAX_FD 2 |
6 | 8 |
|
... | ... | |
11 | 13 |
target_phys_addr_t mmio_base, DriveInfo **fds); |
12 | 14 |
FDCtrl *sun4m_fdctrl_init(qemu_irq irq, target_phys_addr_t io_base, |
13 | 15 |
DriveInfo **fds, qemu_irq *fdc_tc); |
14 |
int fdctrl_get_drive_type(FDCtrl *fdctrl, int drive_num);
|
|
16 |
FDriveType fdctrl_get_drive_type(FDCtrl *fdctrl, int drive_num);
|
|
15 | 17 |
|
16 | 18 |
#endif |
b/hw/pc.c | ||
---|---|---|
192 | 192 |
|
193 | 193 |
#define REG_EQUIPMENT_BYTE 0x14 |
194 | 194 |
|
195 |
static int cmos_get_fd_drive_type(int fd0)
|
|
195 |
static int cmos_get_fd_drive_type(FDriveType fd0)
|
|
196 | 196 |
{ |
197 | 197 |
int val; |
198 | 198 |
|
199 | 199 |
switch (fd0) { |
200 |
case 0:
|
|
200 |
case FDRIVE_DRV_144:
|
|
201 | 201 |
/* 1.44 Mb 3"5 drive */ |
202 | 202 |
val = 4; |
203 | 203 |
break; |
204 |
case 1:
|
|
204 |
case FDRIVE_DRV_288:
|
|
205 | 205 |
/* 2.88 Mb 3"5 drive */ |
206 | 206 |
val = 5; |
207 | 207 |
break; |
208 |
case 2:
|
|
208 |
case FDRIVE_DRV_120:
|
|
209 | 209 |
/* 1.2 Mb 5"5 drive */ |
210 | 210 |
val = 2; |
211 | 211 |
break; |
212 |
case FDRIVE_DRV_NONE: |
|
212 | 213 |
default: |
213 | 214 |
val = 0; |
214 | 215 |
break; |
... | ... | |
335 | 336 |
BusState *idebus0, BusState *idebus1, |
336 | 337 |
FDCtrl *floppy_controller, ISADevice *s) |
337 | 338 |
{ |
338 |
int val; |
|
339 |
int fd0, fd1, nb;
|
|
339 |
int val, nb;
|
|
340 |
FDriveType fd0, fd1;
|
|
340 | 341 |
static pc_cmos_init_late_arg arg; |
341 | 342 |
|
342 | 343 |
/* various important CMOS locations needed by PC/Bochs bios */ |
... | ... | |
387 | 388 |
|
388 | 389 |
val = 0; |
389 | 390 |
nb = 0; |
390 |
if (fd0 < 3)
|
|
391 |
if (fd0 < FDRIVE_DRV_NONE) {
|
|
391 | 392 |
nb++; |
392 |
if (fd1 < 3) |
|
393 |
} |
|
394 |
if (fd1 < FDRIVE_DRV_NONE) { |
|
393 | 395 |
nb++; |
396 |
} |
|
394 | 397 |
switch (nb) { |
395 | 398 |
case 0: |
396 | 399 |
break; |
Also available in: Unified diff