#ifdef CONFIG_LBA48
unsigned char lba48 = 0;
- if (blknr & 0x0000fffff0000000) {
+ if (blknr & 0x0000fffff0000000ULL) {
/* more than 28 bits used, use 48bit mode */
lba48 = 1;
}
/* write high bits */
ide_outb (device, ATA_SECT_CNT, 0);
ide_outb (device, ATA_LBA_LOW, (blknr >> 24) & 0xFF);
+#ifdef CFG_64BIT_LBA
ide_outb (device, ATA_LBA_MID, (blknr >> 32) & 0xFF);
ide_outb (device, ATA_LBA_HIGH, (blknr >> 40) & 0xFF);
+#else
+ ide_outb (device, ATA_LBA_MID, 0);
+ ide_outb (device, ATA_LBA_HIGH, 0);
+#endif
}
#endif
ide_outb (device, ATA_SECT_CNT, 1);
#ifdef CONFIG_LBA48
unsigned char lba48 = 0;
- if (blknr & 0x0000fffff0000000) {
+ if (blknr & 0x0000fffff0000000ULL) {
/* more than 28 bits used, use 48bit mode */
lba48 = 1;
}
/* write high bits */
ide_outb (device, ATA_SECT_CNT, 0);
ide_outb (device, ATA_LBA_LOW, (blknr >> 24) & 0xFF);
+#ifdef CFG_64BIT_LBA
ide_outb (device, ATA_LBA_MID, (blknr >> 32) & 0xFF);
ide_outb (device, ATA_LBA_HIGH, (blknr >> 40) & 0xFF);
+#else
+ ide_outb (device, ATA_LBA_MID, 0);
+ ide_outb (device, ATA_LBA_HIGH, 0);
+#endif
}
#endif
ide_outb (device, ATA_SECT_CNT, 1);