亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tmwrb.c

?? 可用于TM1300/PNX1300系列DSP(主要用于視頻處理)壓縮庫即應用例子。
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*
 *  +-------------------------------------------------------------------+
 *  | Copyright (c) 1995,2000 TriMedia Technologies Inc.                |
 *  |                                                                   |
 *  | This software  is furnished under a license  and may only be used |
 *  | and copied in accordance with the terms  and conditions of such a |
 *  | license  and with  the inclusion of this  copyright notice.  This |
 *  | software or any other copies of this software may not be provided |
 *  | or otherwise  made available  to any other person.  The ownership |
 *  | and title of this software is not transferred.                    |
 *  |                                                                   |
 *  | The information  in this software  is subject  to change  without |
 *  | any  prior notice  and should not be construed as a commitment by |
 *  | TriMedia Technologies.                                            |
 *  |                                                                   |
 *  | This  code  and  information  is  provided  "as is"  without  any |
 *  | warranty of any kind,  either expressed or implied, including but |
 *  | not limited  to the implied warranties  of merchantability and/or |
 *  | fitness for any particular purpose.                               |
 *  +-------------------------------------------------------------------+
 *
 *  Module name              : tmWRB.c    1.19
 *
 *  Module type              : IMPLEMENTATION
 *
 *  Title                    : Write Booter
 *
 *  Last update              : 16:19:55 - 00/06/16 
 *
 *  Description              : Usase zlib compression, Command line parser
 *                             and down loader    
 */
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>

#ifndef _WIN32
#include <unistd.h>
#include <dirent.h>
#else
#include <windows.h>
#endif


#include <TMDownLoader.h>
#include <tmhost.h>

/* if using the hp build */
#ifdef hpux
/* undefine Long and uLongf for zlib.h*/   
#undef uLong
#undef uLongf
#undef Byte
#endif


#include <tsaCmdOpt.h>
#include <zlib.h>

#include "tmWRB_options.h"

tsaCmdOptOption_t	options[] = {
#define	_Eg_opts_impl
#undef	Def
#define	Def(name,o1,o2,typ,flags,dflt,descr)	\
  o1,o2,typ,flags,(void *)(dflt),descr,Null,
#include "tmWRB_options.h"
};

#ifndef O_BINARY
#define O_BINARY 0 /* not defined on Unix */
#endif

#ifdef _WIN32
#define SLASH "\\"
#else
#define SLASH "/"
#endif

#define UNIX_PATH_NAME_SEPARATOR '/'
#define WIN_PATH_NAME_SEPARATOR  '\\'

#define MAX_FILENAME 1024
#define BLOCKSIZE    0x800

#define TEMP_DIR     ".tmWRB.temp"
#define TEMP_BASE    TEMP_DIR SLASH "tmpackedboot"

#define	Nelts(vec)	(sizeof(vec) / sizeof((vec)[0]))

static const char *progname = NULL;

static char *out_name_temp = NULL;
static char *out_namet =NULL;
static char *out_nameh =NULL;

static char buffer[MAX_FILENAME];
static char tcspath_buffer[MAX_FILENAME];
static char nostandard_buf[MAX_FILENAME];

static int fo = 0;
static int ft = 0;
static int fh = 0;

static int mem_start = 0;
static int mem_end   = 0;

static char buf[BLOCKSIZE];

static unsigned int NumElements = 0;

/* options arguements intialised as per data
   struct in tmWRB_options.h */
static Bool  NoCompression;
static Bool  inmi;
static Bool  out;
static char* host;
static int   tm_freq;
static int   mmio_base;
static char  *output;
static TMDwnLdr_CachingSupport   cache_support;
static char  *bigendian;
static Bool  unshuffled;
static Bool  verbose;
static Bool  nostandard;
static Bool  flashbsp;
static char  *cflags;
static char  *ldflags;
static char  *tcspath;
static char  *cpath;

static char  *image_file;
static int   host_int;
static Bool  download_unshuffled;

static int text_len;
static int locked_text_len;
static int locked_text_base;

/* used for siumlator Memory image */
static int  lv_syscall;

/* Prototypes for hidden supported functions. */
void TMDwnLdr_set_unshuffled( TMDwnLdr_Object_Handle  handle );
void TMDwnLdr_get_text_positions( TMDwnLdr_Object_Handle handle, 
                                  Int *text_len, Int *locked_text_len, Int *locked_text_base);

/*--------------------------- helper functions -------------------------*/

static int
parse_number( char *repr, char terminator, char **next, int *result )
{
     char *nxt;

    *result= strtol( repr, &nxt, 0 );

    if(*result < 0){
       return False;
    }

    if( *nxt != terminator){
        printf("Wrong Numeric Format\n");
        return False;
    }

    if (next) { *next= nxt; }

    return True;
}

static int
copy( char *old, char *new){

   int src, dest ;
    int lv_read,lv_write,lv_ret,file_size;
    void *inmem;
    struct stat statBuf;
    
    src = open(old, O_RDONLY|O_BINARY,O_RDONLY|O_BINARY);
    if (src == -1) {
        printf("Failed to open %s with error code %d\n", old, errno);
        return False;
    }

    /* get size of source file */
    lv_ret = fstat(src,&statBuf);
    if(lv_ret == -1) {
       printf("Failed to stat %s with error code %d\n", old, errno);
       close(src);
       return False;
    }
    
   file_size = statBuf.st_size;

   /* inmem is input memory */
   inmem = (void *)malloc(file_size);

   /* buffer will be output memory */
   if (inmem == NULL)
   {
      printf("out of memory\n");
      free(inmem);close(src);
      return False;
   }
   
   /* read the source into buf */
   lv_read= read  (src,  inmem, file_size);
   if(lv_read != file_size)
   {
       printf("read failure\n");
      free(inmem);close(src);
      return False;
   }

   close(src);

   errno = 0;
   dest = open(new,O_CREAT|O_WRONLY|O_BINARY,0x1FF);
   if (dest == -1) {
      printf("Failed to create %s with error code %d\n", new, errno);
      free(inmem);
      return False;
   }

   lv_write = write(dest, inmem, file_size);
   if(lv_write != file_size)
   {
       printf("write failure\n");
      free(inmem);   close(dest);
      return False;
   }

   free(inmem);
   close(dest);

   /* ensure that the file is readable */
   chmod(new,0x1FF);

   return file_size;
}

void 
rewrite_slashes( char *cmd )
{
#if defined(_WIN32)
	int i, len = strlen(cmd);

	for ( i = 0; i < len; i++ ) {
		if ( cmd[i] == UNIX_PATH_NAME_SEPARATOR )
			cmd[i] = WIN_PATH_NAME_SEPARATOR;
	}
#endif
}

#if	defined(_WIN32)
/* Windows implementation of Posix.1 directory handling calls:
 *	opendir(), readdir(), rewinddir(), closedir()
 * and also the unrelated system calls
 *	fsync(), sync().
 * These are implemented directly as system calls on SunOS and HP-UX
 * but not on Windows,
 * so this is Windows-specific code, required only for Windows.
 */

/* Directory entry. */
struct	dirent
{
	long	d_ino;
	long	d_namlen;
	char	d_name[MAX_PATH];
};

/* Directory. */
typedef	struct
{
	struct dirent	dirent;
	int		Win32EntryCount;
	HANDLE		Win32DirectoryHandle;
	WIN32_FIND_DATA	Win32FindData;
	char		Win32DirectoryName[1];
} DIR;

#define	_IFMT		0170000	/* type of file				*/
#define		_IFDIR	0040000	/* directory				*/
#define		_IFCHR	0020000	/* character special			*/
#define		_IFBLK	0060000	/* block special			*/
#define		_IFREG	0100000	/* regular				*/
#define		_IFLNK	0120000	/* symbolic link			*/
#define		_IFSOCK	0140000	/* socket				*/
#define		_IFIFO	0010000	/* fifo					*/

#define	S_ISDIR(m)	(((m)&_IFMT) == _IFDIR)

/* Open a directory. */
DIR *
opendir(char const *dirname)
{
	DIR	*dir;

	dir = (DIR *)malloc(sizeof(*dir) + strlen(dirname) + 3);
	if (dir == NULL) {
		/* No memory for DIR structure. */
		errno = ENOMEM;
		return NULL;
	}
	dir->Win32EntryCount = 0;
	sprintf(dir->Win32DirectoryName, "%s\\*", dirname);
	dir->Win32DirectoryHandle = FindFirstFile(dir->Win32DirectoryName,
						  &dir->Win32FindData);
	if (dir->Win32DirectoryHandle == INVALID_HANDLE_VALUE) {
		/* Not found, free and return failure. */
		free(dir);
		errno = ENOENT;
		return NULL;
	}
	return dir;	/* success */
}

/* Read the next entry from a directory. */
struct dirent *
readdir(DIR * dir)
{
	if (dir->Win32EntryCount == 0) {
		FindClose(dir->Win32DirectoryHandle);
		dir->Win32DirectoryHandle = FindFirstFile(dir->Win32DirectoryName,
							  &dir->Win32FindData);
		if (dir->Win32DirectoryHandle == INVALID_HANDLE_VALUE) {
			errno = EINVAL;
			return NULL;
		}
	} else if ((FindNextFile(dir->Win32DirectoryHandle,
				 &dir->Win32FindData) == 0) 
		&& (GetLastError() == ERROR_NO_MORE_FILES)) {
			return NULL;
	}
	dir->Win32EntryCount++;
	dir->dirent.d_ino = dir->Win32EntryCount;	/* this field is unneeded */
	dir->dirent.d_namlen = strlen(dir->Win32FindData.cFileName);
	strcpy(dir->dirent.d_name, dir->Win32FindData.cFileName);
	return &dir->dirent;
}

/* Rewind a directory. */
void
rewinddir(DIR *dir)
{
	dir->Win32EntryCount = 0;
}

/* Close a directory. */
int
closedir(DIR *dir)
{
	if (dir->Win32DirectoryHandle != INVALID_HANDLE_VALUE)
		FindClose(dir->Win32DirectoryHandle);
	free(dir);
	return 0;
}

/* File sync: a nop. */
int
fsync(int fildes)
{
	return 0;
}

/* Sync: a nop. */
int
sync(void)
{
	return 0;
}

#endif	/* defined(_WIN32) */

/*------------------------- conversion functions ----------------------*/

static
void ConvertOutToMI(char *outmem,int outsize,char *mimem,int *misize){

   Pointer     sdram_base = (Pointer)mem_start;
   UInt        sdram_length = mem_end - mem_start;

   TMDwnLdr_Object_Handle handle;
   TMDwnLdr_Status tmdl_ret;

   Int         alignment;
   
   /* load the executable object and create handle */
   if((tmdl_ret = TMDwnLdr_load_object_from_mem(outmem,outsize,Null,&handle)) != TMDwnLdr_OK) {
      fprintf(stdout, "Error TMDwnLdr_load_object_from_mem: %s\n", TMDwnLdr_get_last_error(tmdl_ret) );
      exit(-1);
   }
   
   /* if image should be unshuffled */
   if(unshuffled  == True || download_unshuffled == True){
      /* tell down loader to unshuffle image */
      TMDwnLdr_set_unshuffled(handle);
   }

   /* get the minimal image size */
   if((tmdl_ret = TMDwnLdr_get_image_size(handle, misize, &alignment)) != TMDwnLdr_OK) {
      fprintf(stdout, "Error TMDwnLdr_get_image_size: %s\n", TMDwnLdr_get_last_error(tmdl_ret) );
      exit(-1);
   }
   
   /* check if image size is too large */
   if(*misize > (Int) sdram_length)
      printf("Memory image 0x%x is larger than SDRAM 0x%x\n",*misize,(Int) sdram_length );
      
   if((Int) sdram_base % alignment != 0)
      printf("SDRAM Base 0x%x not aligned on a 64 byte boundary\n",sdram_base );

   /* resolve symbol - not used with nohost */
   if(host_int != tmNoHost){
      /* cheat a little bit */
      lv_syscall = mmio_base;
      
      if((tmdl_ret = TMDwnLdr_resolve_symbol(handle, "__syscall", (Int) lv_syscall)) != TMDwnLdr_OK) {
         fprintf(stdout, "Error TMDwnLdr_resolve_symbol: %s\n", TMDwnLdr_get_last_error(tmdl_ret) );
         exit(-1);
      }
   }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品999| 蜜桃视频一区二区三区在线观看 | 久久品道一品道久久精品| 欧美三级午夜理伦三级中视频| 成人av在线资源网站| 丁香婷婷综合色啪| 成人黄色777网| 91在线免费播放| 色婷婷激情一区二区三区| 一本久道久久综合中文字幕 | 免费美女久久99| 青青草视频一区| 欧美色图片你懂的| 日本韩国欧美一区| 91精品久久久久久久99蜜桃 | 欧美成人video| 26uuu久久天堂性欧美| 国产亚洲欧美日韩在线一区| 久久久久97国产精华液好用吗| 欧美国产视频在线| 亚洲精品久久久久久国产精华液| 亚洲夂夂婷婷色拍ww47| 午夜国产精品影院在线观看| 蜜桃传媒麻豆第一区在线观看| 韩日欧美一区二区三区| 91香蕉视频黄| 91精品国产色综合久久ai换脸 | 国产麻豆一精品一av一免费| 不卡av在线网| 欧美电影在哪看比较好| 久久综合网色—综合色88| 国产精品久久久久一区二区三区| 一区二区三区四区五区视频在线观看 | 亚洲一级二级三级| 九九视频精品免费| 91在线视频免费观看| 欧美精品三级在线观看| 国产欧美一区二区精品久导航| 亚洲日本在线观看| 另类调教123区 | 欧美电影在线免费观看| 国产午夜精品福利| 天堂av在线一区| 成人一区二区三区| 日韩亚洲欧美综合| 一区二区在线观看免费| 国产最新精品免费| 9191久久久久久久久久久| 欧美极品美女视频| 久久精品国产一区二区三| 91亚洲精品乱码久久久久久蜜桃| 欧美电视剧免费全集观看| 亚洲乱码日产精品bd| 国产在线播放一区二区三区| 欧美视频在线观看一区| 中文字幕欧美区| 狠狠色丁香婷婷综合| 欧美久久久影院| 一区二区三区91| 91在线高清观看| 中文字幕av一区二区三区免费看| 日本va欧美va欧美va精品| 欧美手机在线视频| 亚洲三级免费观看| av毛片久久久久**hd| 久久精品视频免费| 国产在线精品一区二区| 日韩欧美国产成人一区二区| 丝袜国产日韩另类美女| 欧美三级资源在线| 亚洲第一福利视频在线| 色系网站成人免费| 亚洲黄色免费电影| 色综合久久久久| 一区二区视频在线| 色欧美88888久久久久久影院| 中文字幕在线一区| 99re这里只有精品首页| 亚洲人成在线播放网站岛国| av电影在线观看完整版一区二区| 国产精品久久毛片a| 成人免费视频视频在线观看免费| 国产欧美精品日韩区二区麻豆天美| 久久www免费人成看片高清| 欧美va亚洲va在线观看蝴蝶网| 三级不卡在线观看| 欧美大胆一级视频| 国产成人av在线影院| 国产精品美女久久久久久久久| 国产成人免费在线观看| 中文字幕在线一区二区三区| 色综合久久综合网| 天天综合网天天综合色| 日韩女优电影在线观看| 国产高清成人在线| 亚洲激情成人在线| 日韩三级视频在线看| 国产原创一区二区三区| 中文字幕一区二区三区在线观看 | 成人99免费视频| 国产精品久久久久影院老司| 色综合一区二区三区| 视频在线在亚洲| 久久久三级国产网站| 91免费版在线| 日韩av电影免费观看高清完整版在线观看 | 国产精品久久久久久久浪潮网站| 色哟哟一区二区| 日本不卡中文字幕| 中文字幕在线不卡| 欧美一级理论片| 成人一二三区视频| 青青草97国产精品免费观看无弹窗版| 精品国产区一区| 欧美三级在线播放| 成人亚洲一区二区一| 日本欧美韩国一区三区| 国产精品美女久久久久久久久| 欧美视频自拍偷拍| 成人免费看黄yyy456| 奇米影视一区二区三区| 亚洲人成伊人成综合网小说| 欧美成人官网二区| 欧美日韩美女一区二区| 夫妻av一区二区| 蜜臀a∨国产成人精品| 亚洲欧洲国产专区| 国产午夜精品一区二区三区嫩草| 欧美日韩亚洲综合在线| 97超碰欧美中文字幕| 国产一区二区视频在线| 色综合激情久久| 国产成人精品三级麻豆| 久久国产精品一区二区| 亚洲成人免费在线| 亚洲色欲色欲www| 国产精品欧美一区二区三区| 日韩精品中文字幕在线一区| 欧美日本视频在线| 在线日韩一区二区| 日本丰满少妇一区二区三区| av不卡免费在线观看| 国产ts人妖一区二区| 国产一区日韩二区欧美三区| 蜜臀av一区二区在线观看 | 久久国产免费看| 日韩电影在线观看电影| 亚洲成a天堂v人片| 亚洲一区二区三区三| 亚洲裸体在线观看| 亚洲人成在线观看一区二区| 国产精品每日更新在线播放网址| 亚洲精品一区二区三区蜜桃下载 | 欧美不卡一区二区三区| 91精品国产综合久久久久久久久久 | 国产精品黄色在线观看| 久久国产三级精品| 日韩精品久久理论片| 青椒成人免费视频| 精品一区二区三区免费毛片爱 | 久久综合久久99| 精品第一国产综合精品aⅴ| 精品国产电影一区二区| ww久久中文字幕| 国产精品国产三级国产| 亚洲精品国产一区二区精华液| 一区二区三区欧美日韩| 亚洲成a人片综合在线| 麻豆极品一区二区三区| 国产白丝网站精品污在线入口| 成人午夜短视频| 色婷婷国产精品综合在线观看| 欧美日韩亚州综合| 久久一留热品黄| 最新国产成人在线观看| 亚洲成av人片在www色猫咪| 免费观看一级欧美片| 成人国产精品免费观看动漫| 色婷婷综合久色| 欧美成人a∨高清免费观看| 国产欧美视频在线观看| 玉足女爽爽91| 精品一区二区在线免费观看| 国产成人丝袜美腿| 欧美伦理视频网站| 国产精品嫩草久久久久| 亚洲va欧美va人人爽午夜| 国产真实乱偷精品视频免| 97se亚洲国产综合自在线| 日韩一级欧美一级| 中文字幕亚洲一区二区va在线| 午夜精品久久久久久久久久久 | 日韩欧美一区二区在线视频| 国产亚洲va综合人人澡精品 | 欧美乱熟臀69xxxxxx| 久久精品欧美日韩| 五月天一区二区| 92国产精品观看| 久久精品视频免费| 青青青爽久久午夜综合久久午夜|