From b9f5c112ccd0e39b0652ba8496e2ebd0cb0c5fb8 Mon Sep 17 00:00:00 2001 From: Greg Watson Date: Sat, 13 Mar 2004 03:09:57 +0000 Subject: filesystem support git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1398 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/stream/ide_stream.c | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) (limited to 'src/stream/ide_stream.c') diff --git a/src/stream/ide_stream.c b/src/stream/ide_stream.c index 0db2ac9089..0dd9a91258 100644 --- a/src/stream/ide_stream.c +++ b/src/stream/ide_stream.c @@ -4,10 +4,11 @@ #include #include #include +#include -/* read a sector or a partial sector */ -extern int ide_read(int drive, unsigned long block, void * buffer); -extern int ide_init(void); +#ifndef IDE_BOOT_DRIVE +#define IDE_BOOT_DRIVE 0 +#endif static unsigned long offset; int stream_init(void) @@ -30,7 +31,7 @@ int stream_init(void) #else offset = 0x7e00; #endif - res = ide_init(); + res = ide_probe(IDE_BOOT_DRIVE); delay(1); return res; } @@ -40,27 +41,9 @@ void stream_fini(void) return; } -#ifdef IDE_SWAB -/* from string/swab.c */ -void -swab (const char *from, char *to, int n) -{ - n &= ~1; - while (n > 1) - { - const char b0 = from[--n], b1 = from[--n]; - to[n] = b0; - to[n + 1] = b1; - } -} -#endif - static unsigned char buffer[512]; static unsigned int block_num = 0; static unsigned int first_fill = 1; -#ifndef IDE_BOOT_DRIVE -#define IDE_BOOT_DRIVE 0 -#endif static byte_offset_t stream_ide_read(void *vdest, byte_offset_t offset, byte_offset_t count) { byte_offset_t bytes = 0; @@ -84,11 +67,7 @@ static byte_offset_t stream_ide_read(void *vdest, byte_offset_t offset, byte_off len = (count - bytes); } -#ifdef IDE_SWAB - swab(buffer + byte_offset, dest, len); -#else memcpy(dest, buffer + byte_offset, len); -#endif offset += len; bytes += len; -- cgit v1.2.3