2007-11-03 Marco Gerards <marco@gnu.org>
* disk/ata.c (grub_ata_readwrite): Call grub_ata_pio_read and grub_ata_pio_write once for every single sector, instead of for multiple sectors.
This commit is contained in:
parent
ca25d8f0c1
commit
ed649e5402
2 changed files with 36 additions and 15 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2007-11-03 Marco Gerards <marco@gnu.org>
|
||||||
|
|
||||||
|
* disk/ata.c (grub_ata_readwrite): Call grub_ata_pio_read and
|
||||||
|
grub_ata_pio_write once for every single sector, instead of for
|
||||||
|
multiple sectors.
|
||||||
|
|
||||||
2007-10-31 Robert Millan <rmh@aybabtu.com>
|
2007-10-31 Robert Millan <rmh@aybabtu.com>
|
||||||
|
|
||||||
* configure.ac: Add `i386-linuxbios' to the list of supported targets.
|
* configure.ac: Add `i386-linuxbios' to the list of supported targets.
|
||||||
|
|
45
disk/ata.c
45
disk/ata.c
|
@ -492,6 +492,7 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector,
|
||||||
grub_ata_addressing_t addressing;
|
grub_ata_addressing_t addressing;
|
||||||
int cmd;
|
int cmd;
|
||||||
int cmd_write;
|
int cmd_write;
|
||||||
|
unsigned int sect;
|
||||||
|
|
||||||
addressing = dev->addr;
|
addressing = dev->addr;
|
||||||
|
|
||||||
|
@ -523,21 +524,28 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector,
|
||||||
{
|
{
|
||||||
/* Read 256/65536 sectors. */
|
/* Read 256/65536 sectors. */
|
||||||
grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd);
|
grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd);
|
||||||
if (grub_ata_pio_read (dev, buf,
|
for (sect = 0; sect < batch; sect++)
|
||||||
batch * GRUB_DISK_SECTOR_SIZE))
|
{
|
||||||
return grub_errno;
|
if (grub_ata_pio_read (dev, buf,
|
||||||
|
GRUB_DISK_SECTOR_SIZE))
|
||||||
|
return grub_errno;
|
||||||
|
buf += GRUB_DISK_SECTOR_SIZE;
|
||||||
|
sector++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Write 256/65536 sectors. */
|
/* Write 256/65536 sectors. */
|
||||||
grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd_write);
|
grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd_write);
|
||||||
if (grub_ata_pio_write (dev, buf,
|
for (sect = 0; sect < batch; sect++)
|
||||||
batch * GRUB_DISK_SECTOR_SIZE))
|
{
|
||||||
return grub_errno;
|
if (grub_ata_pio_write (dev, buf,
|
||||||
|
GRUB_DISK_SECTOR_SIZE))
|
||||||
|
return grub_errno;
|
||||||
|
buf += GRUB_DISK_SECTOR_SIZE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
sector += batch;
|
||||||
buf += batch * GRUB_DISK_SECTOR_SIZE;
|
|
||||||
sector += batch * GRUB_DISK_SECTOR_SIZE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read/write just a "few" sectors. */
|
/* Read/write just a "few" sectors. */
|
||||||
|
@ -548,15 +556,22 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector,
|
||||||
{
|
{
|
||||||
/* Read sectors. */
|
/* Read sectors. */
|
||||||
grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd);
|
grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd);
|
||||||
if (grub_ata_pio_read (dev, buf,
|
for (sect = 0; sect < (size % batch); sect++)
|
||||||
(size % batch) * GRUB_DISK_SECTOR_SIZE))
|
{
|
||||||
return grub_errno;
|
if (grub_ata_pio_read (dev, buf, GRUB_DISK_SECTOR_SIZE))
|
||||||
|
return grub_errno;
|
||||||
|
buf += GRUB_DISK_SECTOR_SIZE;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Write sectors. */
|
/* Write sectors. */
|
||||||
grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd_write);
|
grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd_write);
|
||||||
if (grub_ata_pio_write (dev, buf,
|
for (sect = 0; sect < batch; sect++)
|
||||||
(size % batch) * GRUB_DISK_SECTOR_SIZE))
|
{
|
||||||
return grub_errno;
|
if (grub_ata_pio_write (dev, buf,
|
||||||
|
(size % batch) * GRUB_DISK_SECTOR_SIZE))
|
||||||
|
return grub_errno;
|
||||||
|
buf += GRUB_DISK_SECTOR_SIZE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
|
|
Loading…
Reference in a new issue