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

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

?? parse.c

?? 詳細介紹了一篇關于pci開發的接口芯片
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
	parse.c

	RETURN:	conditions vars: cmdline_loop, cmdline_ask, cmdline_pause_on_error

	see "set_passthru_defaults()"  for configuration on exit
*/

#include <stdtypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <dir.h>
#include <dos.h>

/* non-standard includes... */
#include <lib.h>
#include <clib1.h>
#include <amcclib.h>
#include <main.h>
#include <nvram.h>



#define ENVSTR	"Requires env vars:\n" \
				"         VERSION5920 - version 0, 1...\n"		\
				"         DQMODE - 16 or 32 (addon bus size)\n" \
				"         MDMODE - IN or OUT\n" 				\
				"         PTMODE - ACTIVE or PASSIVE\n" 		\
				"         CLOCK - SYNC or ASYNC\n"		 		\
				"         CLOCK_RATE_P - PCI clock speed in mhz\n" 	\
				"         CLOCK_RATE_A - Addon clock speed in mhz\n"


#define CHECKPCI  	if ( status != PCI_SUCCESSFUL ) \
					return pci_bios_fail( status );

#define UUT_CHIP_ARG 1			/* argument is UUT nvram image file */
#define CONTROL_CHIP_ARG 3		/* argument is control chip nvram image */
#define NUM_REQD_ARGS 4			/* number of required arguments incl executable */

// from env vars...
extern int sync_clock, clock_rate_pci, clock_rate_addon;
extern version_uut;

extern struct _chip chip_uut, chip_control;
extern UINT8 boot_nvram[];
extern CHAR errstring[], text[];
extern int cmdline_ask, cmdline_pause_on_error;
extern int cmdline_loop, cmdline_sram_wait, cmdline_fifo_wait;
extern int cmdline_exit_on_error, cmdline_quiet, use_hp; 
extern int skiptest[], cmdline_type;
extern int cmdline_only, exit_program, cmdline_sram_wait, cmdline_fifo_wait;
extern UINT32 cmdline_count;
extern VUINT32 control;


/* ************************************ */
/*               local stuff...         */
/* ************************************ */
#define ERREXIT(str) return errexit(str)

static int wfifo, prefetch, priority;
static int cmdline_device, cmdline_vendor, cmdline_subsys_vendor_id, cmdline_subsys_id;

static int errexit( CHAR *string );
static int useage( CHAR *exefile );
static CHAR *strip( CHAR *string, CHAR *stripped );
static void enverr( void );
static void checkenv( void );
static int cmdline_pin_defaults( void );
static int dqmode_32, mdmode_in, ptmode_active;
static int c_break( void );
static void	set_passthru_defaults( void );

typedef int (*OPTPTR)(CHAR *str);		// ptr to function that returns TRUE if
										// OK, FALSE if  parameter error

// options...
static int ask( CHAR *str );
static int did( CHAR *str );
static int exiterr( CHAR *str );
static int wfifof( CHAR *str );
static int vendorid( CHAR *str );
static int loop( CHAR *str );
static int onetest( CHAR *str );
static int pause( CHAR *str );
static int quiet( CHAR *str );
static int prefetchf( CHAR *str );
static int skip( CHAR *str );
static int type( CHAR *str );
static int priorityf( CHAR *str );
static int svid( CHAR *str );
static int sid( CHAR *str );
static int sramwait( CHAR *str );
static int fifowait( CHAR *str );
static int usehpf( CHAR *str );
static int help( CHAR *str );

// define structure of options - may be more than one character
struct _option {
	CHAR *optstr;
	OPTPTR optionp;
	CHAR *description;
};

// string "BREAK" breaks the listing...
static struct _option options[] = {
	{ "DID", did, "<UUT Device ID>" },
	{ "VID", vendorid, "<UUT Vendor ID>" },
	{ "SVID", svid, "<Subsystem Vendor ID>" },
	{ "SIS", sid, "<UUT Subsystem ID>" },
	{ "O", onetest, "<test number> - Run this test only" }, 
	{ "PRE", prefetchf, "<prefetch value>" },
	{ "S", skip, "<test> - Skip test(s)" },
	{ "T", type, "<type> - nibble of types (set bit means SRAM vs FIFO)" },
	{ "SW", sramwait, "<waits> - number of SRAM wait states" },
	{ "FW", fifowait, "<waits> - number of FIFO wait states" },
	{ "PRI", priorityf, "Priority bit" }, 
	{ "BREAK", NULL, "BREAK" }, 		// leave description
	{ "A", ask, "Do not ask if want to run the test" }, 
	{ "E", exiterr, "Do not exit on error" },
	{ "F", wfifof, "Write FIFO enable" },
	{ "L", loop, "Loop" },
	{ "P", pause, "Pause on error" },
	{ "Q", quiet, "Quiet mode" },
	{ "HP", usehpf, "Do not use HP2925 in tests" },
	{ "H", help, "(or ?) - Help" },
	{ "?", help, "" },
// end of array...
	{ NULL, NULL, NULL }
};


int parse( int argc, char *argv[] )
/*
	Parse command line...

	* Get control chip DID, VID, and SID from indicated file.
	* Get UUT DID, VID, and SVID, and SID from indicated file.
	* The control chip and UUT devices must have different SID (SVID is AMCC 10E8).
	* Call PCI BIOS to find devices, and save base addresses.
	* Load boot_nvram from actual nvram and check against file from 
	command line (which indicates actual booted values).
	* Compare actual nvram against that required for testing.
	* If requires reboot, let user know, then do it.
	* Set up region sizes based on boot_nvram.
	* Set up pin options based on environment variables.
	* set up skiptest[] array

	Return:	TRUE if OK, else FALSE and message printed
			No return if must reboot.
*/
{
	UINT32 data32;
	int i, clp, status, region;
	int found, chars, result, write_reboot = 0;

	exit_program = FALSE;
	ctrlbrk( c_break );
	setcbrk( 1 );

	// argc includes the name of the executable
	if ( (argc < NUM_REQD_ARGS) )
		exit( useage(argv[0]) );

	// set up command line defaults...
	use_hp = TRUE;
	wfifo = FALSE; prefetch = 0; priority = FALSE;
	cmdline_only = 0;			// do not run just one test
	cmdline_quiet = FALSE;
	cmdline_loop = 1;
	cmdline_ask = TRUE;
	cmdline_pause_on_error = TRUE; 
	cmdline_exit_on_error = TRUE; 
	for ( i = 0; i < MAX_NUM_TESTS; i++ )
		skiptest[i] = FALSE;
	cmdline_sram_wait = 2;
	cmdline_fifo_wait = 0;
	cmdline_vendor = FALSE;
	cmdline_device = FALSE;
	cmdline_subsys_vendor_id = FALSE;
	cmdline_subsys_id = FALSE;

	// configuration defaults...
	cmdline_type = 0xF;		// all SRAM
	chip_control.bus = 0;
	chip_uut.bus = 0;

	// parse the optional parameters...
    for (clp=4; clp<argc; clp++) 
    {
        /* handle parms & switches using / or - */
        if ( (argv[clp][0] == '/') || (argv[clp][0] == '-') ) 
        {
			found = FALSE;
			for ( i = 0; options[i].optstr != NULL; i++ )
			{
				chars = strlen(	options[i].optstr );
				if ( strncmpi( options[i].optstr, &argv[clp][1], chars ) == 0 )
				{
					found = TRUE;
					if ( options[i].optionp == help )
						exit( useage(argv[0]) );
					result = options[i].optionp( &argv[clp][chars + 1] );
					if ( !result )
						exit(1);
				}
			}

			if ( !found )
			{
				fprintf( stderr, "Unknown option \"%s\".\n", &argv[clp][0] );
				exit( useage(argv[0]) );
			}
		}	// each arg

		else
		{
			fprintf( stderr, "Unrecognized option delimiter \"%c\".\n", argv[clp][0] );
			exit( useage(argv[0]) );
		}
	}

	// get device and vendor IDs from input files (use to find devices)...
	status = buffer_load( argv[CONTROL_CHIP_ARG], &boot_nvram, NVRAM_SIZE_BYTES );
	if ( status )  ERREXIT("");
	chip_control.vendor_id = *(UINT16 *)( &boot_nvram[PCI_CS_VENDOR_ID + 0x40] );
	chip_control.device_id = *(UINT16 *)( &boot_nvram[PCI_CS_DEVICE_ID + 0x40] );
	chip_control.subsys_vendor_id = *(UINT16 *)( &boot_nvram[0x6C] );
	chip_control.subsys_id = *(UINT16 *)( &boot_nvram[0x6E] );

	status = buffer_load( argv[UUT_CHIP_ARG], &boot_nvram, NVRAM_SIZE_BYTES );
	if ( status ) ERREXIT("");
	if ( !cmdline_vendor )
	chip_uut.vendor_id = *(UINT16 *)( &boot_nvram[PCI_CS_VENDOR_ID + 0x40] );
	if ( !cmdline_device )
	chip_uut.device_id = *(UINT16 *)( &boot_nvram[PCI_CS_DEVICE_ID + 0x40] );
	if ( !cmdline_subsys_vendor_id )
	chip_uut.subsys_vendor_id = *(UINT16 *)( &boot_nvram[0x6C] );
	if ( !cmdline_subsys_id )
	chip_uut.subsys_id = *(UINT16 *)( &boot_nvram[0x6E] );

	// set up structure _chip, base addresses for control chip...
	if ( !findchip( &chip_control, errstring ) )
	{
		printf("Did not find control chip.\n");
		printf( errstring );
		return FALSE;
	}
	chip_control.type = AMCC_5920;

	// set up structure _chip, base addresses for UUT chip...
	if ( !findchip( &chip_uut, errstring ) )
	{
		printf( "Did not find UUT chip.\n");
		printf( errstring );
		return FALSE;
	}
	chip_uut.type = AMCC_5920;

	// check/load nvram - first file goes into boot_nvram (UUT)...
	switch ( nvstart( argv[1], argv[2], write_reboot )  )
	{
		case 0:	break;			// all compared OK
		case 1:
		// file nvboot miscompared against desired UUT file, all else OK
		// fall thru for reboot...
		case 2:					// nvram data not same as nvboot file
			printf( errstring );
			if ( write_reboot )
			{
				printf( "Press key to reboot (may have to do yourself)..." );
				waitkey();
			  	dosboot();
			}
			exit(1);			// in case dosboot does not boot
		default:
		case 3:					// fatal error
			ERREXIT("");
	}


	// set up region sizes based on boot_nvram...
	// doesn't matter if not enabled
	for ( region = 0; region <= MAX_PT_REGION; region++ )
	{
		chip_uut.reg[region].size = 0L;
		data32 = *(UINT32 *)( &boot_nvram[ 0x50 + (region*4)] );
		data32 |= 0xC0000000L;			// top two bits are width
		if ( region == 0 )	data32 |= 0xFFFFFF00L;	// top 3 bytes are 10E8FF
		data32 &= 0xFFFFFFF0L;
		if ( !data32 ) continue;	// disabled
		data32 = ~data32;
		data32++;
		chip_uut.reg[region].size = data32;
	}


	// set up pin defaults from environment...
	checkenv();

	// must have <= 2 widths if active, only 1 if passive
	if ( region_widths() > 2 )
	{
	 	fprintf( stderr, "Configuration has more than two passthru widths.\n" );
		fprintf( stderr, show_passthru_configuration() );
		exit(1);
	}

	if ( !active_mode() && (region_widths() > 1) )
	{
	 	fprintf( stderr, "Passive configuration has more than one passthru width.\n" );
		fprintf( stderr, show_passthru_configuration() );
		exit(1);
	}

	control = 0L;		// control register shadow to match reset
	write_control_reg( 0L );
	bset_control_reg( CTRL_MDMODE );	// set as always inputs
	bset_control_reg( CTRL_LDENB );		// not loading
	bset_control_reg( CTRL_ADDINT );	// ADDINT# inactive
// shouldn't need to reset the UUT for just mode pins (per John)
//	if ( !reset_uut(1) )  ERREXIT("");	// reset, reconfigure

	// set up hardware from env vars...
	if ( !cmdline_pin_defaults() )
		ERREXIT("");

	// force PTCR and control reg to be consistent from here on...
	for ( region = MIN_PT_REGION; region <= MAX_PT_REGION; region++ )
	{
		region_make_sram( region );
		region_make_little_endian( region );
	}

	set_passthru_defaults();
	fix_bugs();		// fixed based on chip version and parameters
	return TRUE;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
不卡的av网站| 蜜臀av性久久久久av蜜臀妖精| 日韩一级二级三级| www.久久久久久久久| 国产盗摄一区二区| 成人国产精品视频| av激情成人网| 欧美性猛交xxxxxx富婆| 91国产福利在线| 欧美日韩国产在线播放网站| 欧美日韩二区三区| 91精品国产色综合久久久蜜香臀| 欧美一区二区高清| 日韩欧美在线一区二区三区| 欧美一二三在线| 国产日韩av一区二区| 国产精品久久久久久久岛一牛影视| 国产精品婷婷午夜在线观看| 亚洲三级免费观看| 亚洲一区日韩精品中文字幕| 日韩经典中文字幕一区| 国内精品视频666| 97久久超碰国产精品| 欧美日韩综合不卡| 欧美一区二区三区在线看| 久久人人超碰精品| 精品国产一区二区在线观看| 国产欧美久久久精品影院| 亚洲一区二区三区中文字幕在线| 蜜臀av性久久久久av蜜臀妖精 | 国产一级精品在线| 国产综合久久久久影院| 97久久精品人人爽人人爽蜜臀| 欧美电影一区二区三区| 欧美激情综合在线| 亚洲午夜成aⅴ人片| 国产一区二区在线电影| 欧美性色黄大片手机版| 国产视频一区在线播放| 亚洲福中文字幕伊人影院| 国产精品系列在线播放| 欧美视频中文一区二区三区在线观看 | 亚洲高清不卡在线| 国产精品一区三区| 一本久久综合亚洲鲁鲁五月天| 91精品在线一区二区| 国产精品色哟哟| 欧美aaaaa成人免费观看视频| 国产真实乱偷精品视频免| 在线观看不卡一区| 国产精品色呦呦| 久久se精品一区精品二区| 欧美性xxxxx极品少妇| 欧美激情一区二区三区在线| 激情综合五月婷婷| 欧美一区二区精品在线| 亚洲第一av色| 91激情在线视频| 日日摸夜夜添夜夜添国产精品| 东方欧美亚洲色图在线| 久久久亚洲午夜电影| 久久精品久久久精品美女| 欧美日韩精品欧美日韩精品一| 综合色中文字幕| 成人黄色一级视频| 国产欧美日韩中文久久| 国产一区二区三区美女| 欧美大尺度电影在线| 亚洲成人第一页| 欧美中文字幕一区二区三区亚洲| 久久精品男人天堂av| 另类欧美日韩国产在线| 69堂亚洲精品首页| 亚洲第一激情av| 91猫先生在线| 国产精品高潮久久久久无| 国产精品自拍一区| 国产日产欧美一区二区视频| 久久国产乱子精品免费女| 日韩欧美精品三级| 午夜日韩在线电影| 欧美另类z0zxhd电影| 视频在线在亚洲| 日韩一级大片在线观看| 国产一区二区影院| 国产日韩亚洲欧美综合| 成熟亚洲日本毛茸茸凸凹| 亚洲国产电影在线观看| 一本色道亚洲精品aⅴ| 亚洲国产日韩一级| 日韩一区二区三区免费看| 日韩国产一区二| 91精品国产91久久久久久一区二区 | 成人妖精视频yjsp地址| 国产三级欧美三级日产三级99| 麻豆精品视频在线| 久久综合色一综合色88| 成人精品一区二区三区四区| 亚洲精品国产一区二区三区四区在线| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 91美女片黄在线观看| 亚洲一区在线观看免费| 日韩欧美精品在线视频| 成人蜜臀av电影| 亚洲最新视频在线观看| 69堂国产成人免费视频| 国产 欧美在线| 亚洲一区二区免费视频| 精品国产麻豆免费人成网站| 国产成人三级在线观看| 亚洲一区在线视频观看| 久久综合久久久久88| 91美女精品福利| 精品一区二区免费在线观看| 18成人在线观看| 538prom精品视频线放| 成人免费视频网站在线观看| 亚洲国产欧美日韩另类综合| 久久久蜜臀国产一区二区| 日本黄色一区二区| 黄页网站大全一区二区| 亚洲综合激情另类小说区| 精品少妇一区二区三区在线视频 | 欧美午夜片在线看| 婷婷中文字幕综合| 中文字幕第一页久久| 欧美日韩一区二区欧美激情 | 一区二区三区四区高清精品免费观看 | 亚洲综合在线电影| 国产午夜精品久久久久久久| 欧美精品色一区二区三区| 粉嫩久久99精品久久久久久夜| 日本在线不卡视频一二三区| 自拍偷拍国产精品| 国产夜色精品一区二区av| 欧美日韩高清在线| 色综合久久中文综合久久牛| 国产在线精品国自产拍免费| 天堂va蜜桃一区二区三区漫画版| 自拍偷拍欧美激情| 欧美国产日韩a欧美在线观看| 日韩你懂的在线播放| 欧洲在线/亚洲| 色综合久久久久久久久久久| 成人免费毛片aaaaa**| 国产中文字幕精品| 九九视频精品免费| 日韩制服丝袜先锋影音| 樱花影视一区二区| 亚洲欧洲日韩综合一区二区| 国产情人综合久久777777| 久久青草国产手机看片福利盒子| 日韩免费看的电影| 欧美一区二区日韩一区二区| 7777精品伊人久久久大香线蕉超级流畅| 色婷婷综合久久久中文一区二区 | 欧美精品国产精品| 欧美午夜不卡视频| 欧美色偷偷大香| 欧美日韩国产三级| 91麻豆精品国产91久久久使用方法| 欧美日韩精品一区二区三区蜜桃| 欧美日精品一区视频| 欧美日韩高清一区二区| 欧美一级精品在线| 欧美电影免费观看高清完整版在线 | 国产精品影视天天线| 国产一区二区三区观看| 国产麻豆视频一区| 国内成人自拍视频| 国产精品一二三四五| 成人综合在线视频| 成人ar影院免费观看视频| www..com久久爱| 色婷婷av一区二区三区大白胸| 欧美图区在线视频| 欧美一区二区三区喷汁尤物| 久久久亚洲午夜电影| 国产精品女同一区二区三区| 亚洲人成影院在线观看| 亚洲高清免费观看| 久久精品国产精品亚洲红杏| 粉嫩在线一区二区三区视频| 在线精品视频免费播放| 欧美一级二级三级蜜桃| 国产精品成人一区二区三区夜夜夜| 亚洲精品大片www| 久久99久久99小草精品免视看| 成人免费视频视频| 欧美精品色一区二区三区| 国产日韩视频一区二区三区| 亚洲一区二区在线免费看| 美国十次综合导航| 国产激情一区二区三区桃花岛亚洲| 欧洲视频一区二区| 欧美国产成人在线| 天堂在线一区二区| 99久久免费视频.com| 欧美成人一区二区三区片免费 | 91福利区一区二区三区|