diff options
author | Greg Watson <jarrah@users.sourceforge.net> | 2004-03-13 03:09:57 +0000 |
---|---|---|
committer | Greg Watson <jarrah@users.sourceforge.net> | 2004-03-13 03:09:57 +0000 |
commit | b9f5c112ccd0e39b0652ba8496e2ebd0cb0c5fb8 (patch) | |
tree | 1c81c096a253ab9cd1b5d3e6a76ce952d100f164 /src/stream/fs_stream.c | |
parent | fc2ae8ee9f3b90876d30d80ffedaefa3fcb243f2 (diff) |
filesystem support
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1398 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/stream/fs_stream.c')
-rw-r--r-- | src/stream/fs_stream.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/stream/fs_stream.c b/src/stream/fs_stream.c new file mode 100644 index 0000000000..7d911e62e1 --- /dev/null +++ b/src/stream/fs_stream.c @@ -0,0 +1,32 @@ +#include <console/console.h> +#include <stdlib.h> +#include <stddef.h> +#include <stream/read_bytes.h> +#include <string.h> +#include <fs/fs.h> + +char *boot_file; + +int stream_init(void) +{ + return file_open(boot_file); +} + + +void stream_fini(void) +{ + return; +} + +byte_offset_t stream_skip(byte_offset_t count) +{ + unsigned long pos = file_pos(); + if (file_seek(count+pos) != count+pos) + return 0; + return count; +} + +byte_offset_t stream_read(void *vdest, byte_offset_t count) +{ + return file_read(vdest, count); +} |