changed routine name
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1341 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
8af609f2fe
commit
456764dd30
|
@ -6,8 +6,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/* read a sector or a partial sector */
|
/* read a sector or a partial sector */
|
||||||
extern int ide_read_sector(int drive, void * buffer, unsigned int block, int byte_offset,
|
extern int ide_read(int drive, unsigned long block, void * buffer);
|
||||||
int n_bytes);
|
|
||||||
extern int ide_init(void);
|
extern int ide_init(void);
|
||||||
|
|
||||||
static unsigned long offset;
|
static unsigned long offset;
|
||||||
|
@ -62,12 +61,12 @@ static unsigned int first_fill = 1;
|
||||||
#ifndef IDE_BOOT_DRIVE
|
#ifndef IDE_BOOT_DRIVE
|
||||||
#define IDE_BOOT_DRIVE 0
|
#define IDE_BOOT_DRIVE 0
|
||||||
#endif
|
#endif
|
||||||
static byte_offset_t ide_read(void *vdest, byte_offset_t offset, byte_offset_t count)
|
static byte_offset_t stream_ide_read(void *vdest, byte_offset_t offset, byte_offset_t count)
|
||||||
{
|
{
|
||||||
byte_offset_t bytes = 0;
|
byte_offset_t bytes = 0;
|
||||||
unsigned char *dest = vdest;
|
unsigned char *dest = vdest;
|
||||||
|
|
||||||
//printk_debug("ide_read count = %x\n", count);
|
//printk_debug("stream_ide_read count = %x\n", count);
|
||||||
while (bytes < count) {
|
while (bytes < count) {
|
||||||
unsigned int byte_offset, len;
|
unsigned int byte_offset, len;
|
||||||
|
|
||||||
|
@ -75,8 +74,7 @@ static byte_offset_t ide_read(void *vdest, byte_offset_t offset, byte_offset_t c
|
||||||
if (block_num != offset / 512 || first_fill) {
|
if (block_num != offset / 512 || first_fill) {
|
||||||
block_num = offset / 512;
|
block_num = offset / 512;
|
||||||
printk_notice (".");
|
printk_notice (".");
|
||||||
ide_read_sector(IDE_BOOT_DRIVE, buffer, block_num,
|
ide_read(IDE_BOOT_DRIVE, block_num, buffer);
|
||||||
0, 512);
|
|
||||||
first_fill = 0;
|
first_fill = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +102,7 @@ byte_offset_t stream_read(void *vdest, byte_offset_t count)
|
||||||
{
|
{
|
||||||
byte_offset_t len;
|
byte_offset_t len;
|
||||||
|
|
||||||
len = ide_read(vdest, offset, count);
|
len = stream_ide_read(vdest, offset, count);
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
offset += len;
|
offset += len;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue