1 #include <console/console.h>
4 #include <stream/read_bytes.h>
8 #ifndef CONFIG_ROM_STREAM_START
9 #define CONFIG_ROM_STREAM_START 0xffff0000UL
12 static const unsigned char *rom_start = (void *)CONFIG_ROM_STREAM_START;
13 static const unsigned char *rom_end = (void *)(CONFIG_ROM_STREAM_START + PAYLOAD_SIZE - 1);
14 static const unsigned char *rom;
20 printk_spew("%6d:%s() - rom_stream: 0x%08lx - 0x%08lx\n"
21 __LINE__, __FUNCTION__,
22 (unsigned long)rom_start,
23 (unsigned long)rom_end);
28 void stream_fini(void)
33 byte_offset_t stream_skip(byte_offset_t count)
37 if ((rom + bytes) > rom_end) {
38 printk_warning("%6d:%s() - overflowed source buffer\n",
39 __LINE__, __FUNCTION__);
42 bytes = (rom_end - rom) + 1;
49 byte_offset_t stream_read(void *vdest, byte_offset_t count)
51 unsigned char *dest = vdest;
52 const unsigned char *src = rom;
55 bytes = stream_skip(count);
56 memcpy(dest, src, bytes);