⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mygzip.h

📁 1. 8623L平台
💻 H
字号:
/***************************************** Copyright (c) 2001-20047 Sigma Designs, Inc. All Rights Reserved Proprietary and Confidential *****************************************/#include "version.h"/* This file is part of the boot loader */typedef unsigned char  uch;typedef unsigned short ush;typedef unsigned long  ulg;#define OF(args)  args#define Assert(cond,msg)#define Trace(x)#define Tracev(x)#define Tracevv(x)#define Tracec(c,x)#define Tracecv(c,x)#include "uart.h"#define memzero bzero#define DPRINTF(x) while(0) // PrintUart(x"\r",40) // while(0)#define NULL (void *)0extern unsigned inptr;  /* index of next byte to be processed in inbuf */extern unsigned outcnt; /* bytes in output buffer */extern uch *window; extern uch *inbuf;/* Enable 32bits getbyte to speed up kunzip */#define FAST_GETBYTE#ifdef FAST_GETBYTEstatic unsigned long indwptr;static unsigned long shiftbits;static unsigned long reset_getbyte;static unsigned long mydw;#endif#define get_byte() __my_get_byte()#ifdef FAST_GETBYTEstatic __inline__ void reset_my_get_byte(void){  reset_getbyte = 1;  shiftbits = (inptr % 4) * 8;  indwptr = inptr / 4;}static __inline__ void update_inptr(void){  inptr = indwptr * 4;  if (shiftbits == 24)    inptr -= 1;  else if (shiftbits == 16)    inptr -= 2;  else if (shiftbits == 8)    inptr -= 3;}#endif /* FAST_GETBYTE */static __inline__ uch __my_get_byte(void){#ifndef FAST_GETBYTE  uch b = inbuf[inptr++];#else  uch b;  if (reset_getbyte && (shiftbits != 32)){    /* First access not aligned on 4 bytes boundary */    reset_getbyte = 0;    mydw = ((unsigned long *)inbuf)[indwptr++];  }  if (shiftbits == 32){    shiftbits = 0;    mydw = ((unsigned long *)inbuf)[indwptr++];  }  b = (uch)(mydw >> shiftbits);  shiftbits += 8;#endif//  led(inptr>>4);//  DPRINTF("getbyte : %x (inbuf = %p, inptr = %d)\n",b,inbuf,inptr);  return b;}#define WSIZE (dram0_size/2)  /* (WSIZE/2) : if the unzipped image is bigger than this, inflate() stops */#define malloc(x) __fake_malloc(x)#define free(x) __fake_free(x)#define flush_window() while(0)// printf("ceci est une erreur flush_window ne doit pas etre appele\n")extern char *heap_base, *heap_top;//, *max_heap_top;#if 0#define RECORD_MAX_MALLOC \do { \   if(heap_top > max_heap_top) max_heap_top=heap_top; \} while(0);#else#define RECORD_MAX_MALLOC#endifstatic __inline__ void * __fake_malloc(int size){  void *ret;  ret = (void *)heap_top;  heap_top += size;//  DPRINTF("fake_malloc : %08x (size = %d)\n",ret,size);  RECORD_MAX_MALLOC  return ret;}static __inline__ void __fake_free(void *p){  heap_top = heap_base;//  DPRINTF("fake_free (%p) : %08x\n",p,heap_top); }static __inline__ void memcpy(char *dest, const char *src, unsigned n){  unsigned i;  for(i=0; i<n; i++)    dest[i]=src[i];}static __inline__ void bzero(char *s, unsigned n){  unsigned i;  for(i=0; i<n; i++)    s[i]=0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -