亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
99精品偷自拍| 国产精品网站在线播放| 亚洲欧洲一区二区在线播放| 亚洲高清视频的网址| 成人一二三区视频| 日韩一区二区精品葵司在线| 亚洲精品视频在线看| 国产一区二区三区在线观看免费视频 | hitomi一区二区三区精品| 91麻豆精品国产91久久久资源速度 | 日本精品视频一区二区| 欧美成人乱码一区二区三区| 一区av在线播放| 99久久婷婷国产综合精品| 欧美精品一区二区在线观看| 亚洲成人av一区二区三区| 色噜噜狠狠成人中文综合| 国产精品嫩草久久久久| 国产成人免费网站| 久久久久国色av免费看影院| 美国毛片一区二区三区| 在线播放视频一区| 亚洲超碰精品一区二区| 欧美日韩高清一区二区不卡| 亚洲综合免费观看高清完整版| 99精品久久久久久| 亚洲视频 欧洲视频| 91丨porny丨在线| 亚洲精品欧美激情| 91福利在线播放| 亚洲午夜一区二区| 欧美日本乱大交xxxxx| 亚洲地区一二三色| 欧美一级高清片| 激情综合色丁香一区二区| 日韩视频不卡中文| 国产一区二区h| 国产精品人妖ts系列视频| 99久久婷婷国产综合精品 | 99国产精品一区| 亚洲精品国产成人久久av盗摄| 一本大道久久a久久精二百| 亚洲综合一二区| 制服丝袜一区二区三区| 另类成人小视频在线| 欧美videos中文字幕| 国产成人在线影院| 亚洲日本乱码在线观看| 欧美精品丝袜久久久中文字幕| 免费成人美女在线观看.| 久久一夜天堂av一区二区三区| 成人午夜av在线| 亚洲精品中文在线观看| 欧美一区二区三区啪啪| 国产成人av电影在线播放| 亚洲特黄一级片| 欧美日本国产视频| 国产成人高清在线| 亚洲精品久久7777| 日韩欧美一区在线| 97久久精品人人爽人人爽蜜臀| 亚洲午夜精品网| 久久久欧美精品sm网站| 91色.com| 国内精品第一页| 亚洲自拍偷拍欧美| 国产欧美精品一区二区色综合| 欧美最猛性xxxxx直播| 精品一区二区在线观看| 亚洲精选一二三| 久久一二三国产| 欧美日韩精品久久久| 成人综合在线观看| 日本不卡一二三区黄网| 亚洲色图在线看| 久久久久亚洲蜜桃| 欧美性猛交xxxx乱大交退制版 | 高清不卡一二三区| 日韩国产欧美在线播放| 亚洲欧美在线高清| 久久亚洲一区二区三区四区| 欧美丝袜自拍制服另类| 福利一区二区在线| 美国欧美日韩国产在线播放| 一区二区三区成人| 国产精品网站在线| 久久精子c满五个校花| 欧美一区二区免费| 欧美色精品天天在线观看视频| 国产91精品一区二区| 久久精品国产**网站演员| 亚洲超丰满肉感bbw| 亚洲视频免费在线| 亚洲国产成人自拍| 久久精品亚洲精品国产欧美kt∨ | 色88888久久久久久影院野外| 国产成人在线视频网址| 久久黄色级2电影| 日本最新不卡在线| 日产精品久久久久久久性色| 亚洲一区二区视频| 亚洲精品第一国产综合野| 国产精品初高中害羞小美女文| 久久看人人爽人人| 亚洲精品一区二区三区四区高清| 欧美二区三区的天堂| 欧美日韩国产成人在线91| 欧美在线观看一区二区| 日本电影亚洲天堂一区| 色偷偷88欧美精品久久久| 91美女在线视频| 日本高清不卡一区| 欧美自拍丝袜亚洲| 欧美精品三级在线观看| 欧美肥妇bbw| 欧美一区二区三区男人的天堂| 欧美一级片在线观看| 91精品国产色综合久久不卡蜜臀| 91精品国产综合久久精品麻豆| 在线成人免费视频| 日韩一区二区三区四区五区六区| 9191精品国产综合久久久久久| 欧美日韩不卡一区| 欧美xingq一区二区| 久久精品人人爽人人爽| 国产精品污污网站在线观看| 亚洲嫩草精品久久| 五月天网站亚洲| 激情六月婷婷久久| 粉嫩aⅴ一区二区三区四区| av午夜精品一区二区三区| 在线影视一区二区三区| 欧美无乱码久久久免费午夜一区| 欧美日韩成人综合| 26uuu欧美| 亚洲免费在线视频一区 二区| 性做久久久久久久久| 精品综合免费视频观看| 国产成人av电影在线| 91福利小视频| 久久综合色一综合色88| 最好看的中文字幕久久| 婷婷久久综合九色综合伊人色| 国精品**一区二区三区在线蜜桃| 99久久精品免费| 久久毛片高清国产| 中文字幕成人av| 天天影视色香欲综合网老头| 精品夜夜嗨av一区二区三区| 99国产精品久久久| 日韩欧美不卡在线观看视频| 国产精品久久久久影院色老大| 亚洲一二三四区不卡| 国产精品小仙女| 欧美日韩中文字幕一区二区| 国产日韩欧美一区二区三区乱码| 亚洲精品乱码久久久久久日本蜜臀| 欧美aa在线视频| 欧美性xxxxxxxx| 国产精品网曝门| 青青青伊人色综合久久| 99精品久久只有精品| 精品国产第一区二区三区观看体验| 亚洲精选免费视频| 丁香一区二区三区| 日韩一级片网站| 亚洲已满18点击进入久久| 夫妻av一区二区| 精品久久久三级丝袜| 亚洲va欧美va国产va天堂影院| 国产精品99久久久久久久vr | 另类中文字幕网| 在线免费观看一区| 中文字幕在线不卡一区二区三区| 国模大尺度一区二区三区| 欧美军同video69gay| 亚洲一卡二卡三卡四卡五卡| 99久久国产综合精品色伊| 国产午夜精品久久久久久久| 美国三级日本三级久久99| 69精品人人人人| 亚洲va韩国va欧美va精品| 在线观看国产精品网站| |精品福利一区二区三区| 成人黄色大片在线观看| 国产欧美一区二区精品久导航 | 久久精品视频在线免费观看| 另类综合日韩欧美亚洲| 欧美一区二区成人| 日本91福利区| 欧美大片一区二区| 久久国产精品露脸对白| 精品免费日韩av| 国产剧情在线观看一区二区| 欧美成人伊人久久综合网| 美国毛片一区二区三区| 日韩欧美色电影| 国产精品亚洲第一区在线暖暖韩国| 久久一夜天堂av一区二区三区| 精品夜夜嗨av一区二区三区|