* include/grub/ata.h (grub_ata): Add a new element maxbuffer.
* grub-core/disk/ata.c (grub_ata_readwrite): Limit to ata->maxbuffer. * grub-core/disk/pata.c (grub_pata_open): Set ata->maxbuffer. * grub-core/disk/ahci.c (grub_ahci_open): Likewise.
This commit is contained in:
parent
74310bd8a7
commit
2b5336a24a
5 changed files with 16 additions and 2 deletions
|
@ -278,6 +278,7 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector,
|
|||
grub_ata_addressing_t addressing = ata->addr;
|
||||
grub_size_t batch;
|
||||
int cmd, cmd_write;
|
||||
grub_size_t nsectors = 0;
|
||||
|
||||
grub_dprintf("ata", "grub_ata_readwrite (size=%llu, rw=%d)\n",
|
||||
(unsigned long long) size, rw);
|
||||
|
@ -314,9 +315,11 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector,
|
|||
cmd = GRUB_ATA_CMD_READ_SECTORS;
|
||||
cmd_write = GRUB_ATA_CMD_WRITE_SECTORS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (batch > (ata->maxbuffer >> ata->log_sector_size))
|
||||
batch = (ata->maxbuffer >> ata->log_sector_size);
|
||||
|
||||
grub_size_t nsectors = 0;
|
||||
while (nsectors < size)
|
||||
{
|
||||
struct grub_disk_ata_pass_through_parms parms;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue