VirtualBox

Changeset 37478 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jun 15, 2011 6:49:40 PM (14 years ago)
Author:
vboxsync
Message:

Renamed for clarity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/fdc.c

    r37460 r37478  
    189189} fdrive_t;
    190190
    191 #define NUM_HEADS(drv)      (drv->flags & FDISK_DBL_SIDES ? 2 : 1)
     191#define NUM_SIDES(drv)      (drv->flags & FDISK_DBL_SIDES ? 2 : 1)
    192192
    193193static void fd_init(fdrive_t *drv)
     
    202202
    203203static int fd_sector_calc(uint8_t head, uint8_t track, uint8_t sect,
    204                           uint8_t last_sect, uint8_t num_heads)
    205 {
    206     return (((track * num_heads) + head) * last_sect) + sect - 1; /* sect >= 1 */
     204                          uint8_t last_sect, uint8_t num_sides)
     205{
     206    return (((track * num_sides) + head) * last_sect) + sect - 1; /* sect >= 1 */
    207207}
    208208
     
    210210static int fd_sector(fdrive_t *drv)
    211211{
    212     return fd_sector_calc(drv->head, drv->track, drv->sect, drv->last_sect, NUM_HEADS(drv));
     212    return fd_sector_calc(drv->head, drv->track, drv->sect, drv->last_sect, NUM_SIDES(drv));
    213213}
    214214
     
    241241        return 3;
    242242    }
    243     sector = fd_sector_calc(head, track, sect, drv->last_sect, NUM_HEADS(drv));
     243    sector = fd_sector_calc(head, track, sect, drv->last_sect, NUM_SIDES(drv));
    244244    ret = 0;
    245245    if (sector != fd_sector(drv)) {
     
    11611161    FLOPPY_DPRINTF("Start transfer at %d %d %02x %02x (%d)\n",
    11621162                   GET_CUR_DRV(fdctrl), kh, kt, ks,
    1163                    fd_sector_calc(kh, kt, ks, cur_drv->last_sect, NUM_HEADS(cur_drv)));
     1163                   fd_sector_calc(kh, kt, ks, cur_drv->last_sect, NUM_SIDES(cur_drv)));
    11641164    switch (fd_seek(cur_drv, kh, kt, ks, fdctrl->config & FD_CONFIG_EIS)) {
    11651165    case 2:
     
    15721572    FLOPPY_DPRINTF("format sector at %d %d %02x %02x (%d)\n",
    15731573                   GET_CUR_DRV(fdctrl), kh, kt, ks,
    1574                    fd_sector_calc(kh, kt, ks, cur_drv->last_sect, NUM_HEADS(cur_drv)));
     1574                   fd_sector_calc(kh, kt, ks, cur_drv->last_sect, NUM_SIDES(cur_drv)));
    15751575    switch (fd_seek(cur_drv, kh, kt, ks, fdctrl->config & FD_CONFIG_EIS)) {
    15761576    case 2:
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette