summaryrefslogtreecommitdiffstats
path: root/hostTools/lzma/decompress/IInOutStreams.c
diff options
context:
space:
mode:
authorroot <root@lamia.panaceas.james.local>2015-12-19 14:18:43 +0000
committerroot <root@lamia.panaceas.james.local>2015-12-19 14:18:43 +0000
commit71478fd62d8483483abb34609cdabb7f9cbadfd6 (patch)
tree37b8eaba1ffe2d5f775227911eb0ed6fdc3c9553 /hostTools/lzma/decompress/IInOutStreams.c
parent1a2238d1bddc823df06f67312d96ccf9de2893cc (diff)
downloadbootloader-71478fd62d8483483abb34609cdabb7f9cbadfd6.tar.gz
bootloader-71478fd62d8483483abb34609cdabb7f9cbadfd6.tar.bz2
bootloader-71478fd62d8483483abb34609cdabb7f9cbadfd6.zip
Add hostTools from https://github.com/Noltari/cfe_bcm63xx
Diffstat (limited to 'hostTools/lzma/decompress/IInOutStreams.c')
-rw-r--r--hostTools/lzma/decompress/IInOutStreams.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/hostTools/lzma/decompress/IInOutStreams.c b/hostTools/lzma/decompress/IInOutStreams.c
new file mode 100644
index 0000000..789c4ae
--- /dev/null
+++ b/hostTools/lzma/decompress/IInOutStreams.c
@@ -0,0 +1,38 @@
+#include "IInOutStreams.h"
+// BRCM modification
+static void *lib_memcpy(void *dest,const void *src,size_t cnt);
+static void *lib_memcpy(void *dest,const void *src,size_t cnt)
+{
+ unsigned char *d;
+ const unsigned char *s;
+
+ d = (unsigned char *) dest;
+ s = (const unsigned char *) src;
+
+ while (cnt) {
+ *d++ = *s++;
+ cnt--;
+ }
+
+ return dest;
+}
+
+HRESULT InStreamRead(void *aData, UINT32 aSize, UINT32* aProcessedSize) {
+ if (aSize > in_stream.remainingBytes)
+ aSize = in_stream.remainingBytes;
+ *aProcessedSize = aSize;
+ lib_memcpy(aData, in_stream.data, aSize); // brcm modification
+ in_stream.remainingBytes -= aSize;
+ in_stream.data += aSize;
+ return S_OK;
+ }
+
+#if 0
+BYTE InStreamReadByte()
+ {
+ if (in_stream.remainingBytes == 0)
+ return 0x0;
+ in_stream.remainingBytes--;
+ return (BYTE) *in_stream.data++;
+ }
+#endif