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

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

?? main.c.bak

?? 這個是嵌入式arm系列的一個bootloader程序。對需要編寫bootloader的很有參考價值
?? BAK
?? 第 1 頁 / 共 4 頁
字號:

void WINAPIV NKDbgPrintfW(LPCWSTR lpszFmt, ...)  
{

}

int StoreEBootCFG(EBOOTCFG *EBootCFG)
{
	volatile DWORD * pdwFlash;
	DWORD *pCFG;
	int i,j,k;
		
	EdbgOutputDebugString("StoreEBootCFG.\r\n");
	j = sizeof(EBOOTCFG)/4;
	pdwFlash	= (volatile DWORD *)(FLASH_CFG_START); 

	// Erase the EBootCFG block
	FlashErase((DWORD)pdwFlash, 128*1024);  

	pCFG = (DWORD *)EBootCFG;

	// Program the contents of EBOOTCFG one DWORD at a time.
	for(i = 0; i < j; i++)
	{

		*pdwFlash = 0x00400040;
		*pdwFlash = *(DWORD *)(pCFG+i);
		k = 0;
		while((k & 0x00800080) != 0x00800080)
		{
			k = (*pdwFlash);
		}
		if (k & 0x00000008)
			EdbgOutputDebugString("Voltage Range Error ... \r\n");

		if (k & 0x00000002)
			EdbgOutputDebugString("Device Protect Error ... \r\n");

		if (k & 0x00000010)
			EdbgOutputDebugString("Programming Error ... \r\n");
		
		pdwFlash++;

	}
	// Put flash back into read mode.
	*pdwFlash = 0x00FF00FF;
	return 0;
}

int LoadEBootCFG(EBOOTCFG *EBootCFG)
{
	volatile DWORD * pdwFlash;
	DWORD *pCFG;
	DWORD i,j;
	
	j = sizeof(EBOOTCFG)/4;
	pdwFlash	= (volatile DWORD *)(FLASH_CFG_START);
	pCFG = (DWORD *)EBootCFG;

	// Read the contents of Flash into EBOOTCFG one DWORD at a time.
	*pdwFlash = 0x00FF00FF;
	for(i = 0; i < j; i++)
	{
		*(DWORD *)(pCFG+i) = *(pdwFlash+i);
	}

	// Is the CFG data valid?  Check for the magic number that was written the last time
	// the CFG block was updated.  If Eboot has never been run, there will be no configuration
	// information, so the magic number will likely not be found.  In this case, setup the 
	// factory defaults and store them into Flash.
	if (EBootCFG->ConfigMagicNumber != EbootCFGMagicNumber)
	{
		ResetFactoryDefaultCFG(EBootCFG);
	}

	return 0;
}

void ResetFactoryDefaultCFG(EBOOTCFG *pEbootCFG)
{
	EdbgOutputDebugString("\r\nResetting factory default configuration ... \r\n");
	pEbootCFG->autoDownloadImage = TRUE;
	pEbootCFG->IP = inet_addr("10.1.15.240"); 
	pEbootCFG->subnetMask = inet_addr("255.255.254.0"); 
	pEbootCFG->numBootMe = 25;
	pEbootCFG->delay = 5;
	pEbootCFG->DHCPEnable = FALSE;
	//======= Daric 2002/08/23 ========//
	pEbootCFG->dwLaunchAddr = 0x98381000; //change by houjg 2007.05.10
	//pEbootCFG->dwLaunchAddr = 0x800c1000;
	//================================//
	pEbootCFG->bootDeviceOrder = 0;
	pEbootCFG->ConfigMagicNumber = EbootCFGMagicNumber;
}

void SetIP(EBOOTCFG *pEbootCFG)
{
	char szDottedD[16];	// The string used to collect the dotted decimal IP address
	WORD cwNumChars = 0;
	UINT16 InChar = 0;

	EdbgOutputDebugString ( "\r\nEnter new IP address: ");

	while(!((InChar == 0x0d) || (InChar == 0x0a)))
	{
		InChar = OEMReadDebugByte();
		if (InChar != OEM_DEBUG_COM_ERROR && InChar != OEM_DEBUG_READ_NODATA) 
		{
			// If it's a number or a period, add it to the string
			if (InChar == '.' || (InChar >= '0' && InChar <= '9')) 
			{
				if (cwNumChars < 16) 
				{
					szDottedD[cwNumChars++] = (char)InChar;
					OEMWriteDebugByte((BYTE)InChar);
				}
			}
			// If it's a backspace, back up
			else if (InChar == 8) 
			{
				if (cwNumChars > 0) 
				{
					cwNumChars--;
					OEMWriteDebugByte((BYTE)InChar);
				}
			}
		}
	}

	// If it's a carriage return with an empty string, don't change anything.
	if (cwNumChars) 
	{
		szDottedD[cwNumChars] = '\0';
		pEbootCFG->IP = inet_addr( szDottedD );
	}
	ClearPromiscuousIP();                
}

void SetMask(EBOOTCFG *pEbootCFG)
{
	char szDottedD[16];	// The string used to collect the dotted masks
	WORD cwNumChars = 0;
	UINT16 InChar = 0;

	EdbgOutputDebugString ( "\r\nEnter new subnet mask: ");

	while(!((InChar == 0x0d) || (InChar == 0x0a)))
	{
		InChar = OEMReadDebugByte();
		if (InChar != OEM_DEBUG_COM_ERROR && InChar != OEM_DEBUG_READ_NODATA) 
		{
			// If it's a number or a period, add it to the string
			if (InChar == '.' || (InChar >= '0' && InChar <= '9')) 
			{
				if (cwNumChars < 16) 
				{
					szDottedD[cwNumChars++] = (char)InChar;
					OEMWriteDebugByte((BYTE)InChar);
				}
			}
			// If it's a backspace, back up
			else if (InChar == 8) 
			{
				if (cwNumChars > 0) 
				{
					cwNumChars--;
					OEMWriteDebugByte((BYTE)InChar);
				}
			}
		}
	}

	// If it's a carriage return with an empty string, don't change anything.
	if (cwNumChars) 
	{
		szDottedD[cwNumChars] = '\0';
		pEbootCFG->subnetMask = inet_addr( szDottedD );
	}
}
void SetBootMe(EBOOTCFG *pEbootCFG)
{
	char szCount[16];
	WORD cwNumChars = 0;
	UINT16 InChar = 0;

	EdbgOutputDebugString ( "\r\nUse 0 for continuous boot me packets. \r\n");
	EdbgOutputDebugString ( "Enter maximum number of boot me packets to send [0-255]: ");

	while(!((InChar == 0x0d) || (InChar == 0x0a)))
	{
		InChar = OEMReadDebugByte();
		if (InChar != OEM_DEBUG_COM_ERROR && InChar != OEM_DEBUG_READ_NODATA) 
		{
			// If it's a number or a period, add it to the string
			if ((InChar >= '0' && InChar <= '9')) 
			{
				if (cwNumChars < 16) 
				{
					szCount[cwNumChars++] = (char)InChar;
					OEMWriteDebugByte((BYTE)InChar);
				}
			}
			// If it's a backspace, back up
			else if (InChar == 8) 
			{
				if (cwNumChars > 0) 
				{
					cwNumChars--;
					OEMWriteDebugByte((BYTE)InChar);
				}
			}
		}
	}

	// If it's a carriage return with an empty string, don't change anything.
	if (cwNumChars) 
	{
		szCount[cwNumChars] = '\0';
		pEbootCFG->numBootMe = atoi(szCount);
		if (pEbootCFG->numBootMe > 255)
		{
			pEbootCFG->numBootMe = 255;
		} 
		else if (pEbootCFG->numBootMe < 0)
		{
			pEbootCFG->numBootMe = 1;
		}
	}
}

void SetDelay(EBOOTCFG *pEbootCFG)
{
	char szCount[16];
	WORD cwNumChars = 0;
	UINT16 InChar = 0;

	EdbgOutputDebugString ( "\r\nEnter maximum number of seconds to delay [1-255]: ");

	while(!((InChar == 0x0d) || (InChar == 0x0a)))
	{
		InChar = OEMReadDebugByte();
		if (InChar != OEM_DEBUG_COM_ERROR && InChar != OEM_DEBUG_READ_NODATA) 
		{
			// If it's a number or a period, add it to the string
			if ((InChar >= '0' && InChar <= '9')) 
			{
				if (cwNumChars < 16) 
				{
					szCount[cwNumChars++] = (char)InChar;
					OEMWriteDebugByte((BYTE)InChar);
				}
			}
			// If it's a backspace, back up
			else if (InChar == 8) 
			{
				if (cwNumChars > 0) 
				{
					cwNumChars--;
					OEMWriteDebugByte((BYTE)InChar);
				}
			}
		}
	}

	// If it's a carriage return with an empty string, don't change anything.
	if (cwNumChars) 
	{
		szCount[cwNumChars] = '\0';
		pEbootCFG->delay = atoi(szCount);
		if (pEbootCFG->delay > 255)
		{
			pEbootCFG->delay = 255;
		} 
		else if (pEbootCFG->delay < 1)
		{
			pEbootCFG->delay = 1;
		}
	}
}
#if defined ( PLAT_LUBBOCK )
void SetSMSCMACAddress()
{
	char szDottedD[24];	// The string used to collect the dotted masks
	WORD cwNumChars = 0;
	UINT16 InChar = 0;
	USHORT MacAddr[3];
	USHORT MacAddrTemp[3];

#if defined ( PLAT_LUBBOCK )
    //volatile BLR_REGS *BLR = (BLR_REGS *)FPGA_REGS_BASE_U_VIRTUAL;
#endif
	
    EdbgOutputDebugString("Checking for SMC 91C96 Ethernet controller...\r\n");

    // Enable the oscillator on the Neponset board.  Lubbock's oscillator is always running.
    #if defined ( PLAT_SANDGATE )
        #if defined ( USING_SA1111 )
			pBDRegister->ncr[0] |= ncrBits_enet_osc_en_mask;
       #endif
    #endif

    // Enable 16 bit access to the SMC device for the Lubbock platform, only.
    #if defined ( PLAT_LUBBOCK )
		//BLR->misc_wr &= ~ENET_nEN16;
		*((volatile PBYTE) SMC_ETHERNET_ATTRIB_BASE_U_VIRTUAL+0x20008) = 0;  // Enable 16 bit mode
		*((volatile PBYTE) SMC_ETHERNET_ATTRIB_BASE_U_VIRTUAL+0x20000) = 1;  // Enable Ethernet controller
    #endif
    // Enable 8 bit access to the SMC device for the Sandgate/Neponset platform, only.
    #if defined ( PLAT_SANDGATE )
        #if defined ( USING_SA1111 )
            *((volatile PBYTE) SMC_ETHERNET_ATTRIB_BASE_U_VIRTUAL+0x20008) =0x20;  // Enable 8 bit mode
			*((volatile PBYTE) SMC_ETHERNET_ATTRIB_BASE_U_VIRTUAL+0x20000) = 1;    // Enable Ethernet controller
        #endif
    #endif

	if (SMCInit( (BYTE*)(SMC_ETHERNET_IO_BASE_U_VIRTUAL), 4, MacAddr))
	{
	    EdbgOutputDebugString("SMC 91C96 Ethernet controller initialized.\r\n");
		EdbgOutputDebugString ( "\r\nEnter new MAC address (nnn.nnn.nnn.nnn.nnn.nnn): ");

		while(!((InChar == 0x0d) || (InChar == 0x0a)))
		{
			InChar = OEMReadDebugByte();
			if (InChar != OEM_DEBUG_COM_ERROR && InChar != OEM_DEBUG_READ_NODATA) 
			{
				// If it's a number or a period, add it to the string
				if (InChar == '.' || (InChar >= '0' && InChar <= '9')) 
				{
					if (cwNumChars < 23) 
					{
						szDottedD[cwNumChars++] = (char)InChar;
						OEMWriteDebugByte((BYTE)InChar);
					}
				}
				// If it's a backspace, back up
				else if (InChar == 8) 
				{
					if (cwNumChars > 0) 
					{
						cwNumChars--;
						OEMWriteDebugByte((BYTE)InChar);
					}
				}
			}
		}

		// If it's a carriage return with an empty string, don't change anything.
		if (cwNumChars) 
		{
			szDottedD[cwNumChars] = '\0';
			CvtMAC(MacAddr, szDottedD );
			EdbgOutputDebugString ( "\r\n");
			SMCSetMACAddress(MacAddr);
			SMCGetMACAddress(MacAddrTemp);
			if ( (MacAddr[0] != MacAddrTemp[0]) &&
				 (MacAddr[1] != MacAddrTemp[1]) &&
				 (MacAddr[2] != MacAddrTemp[2]) )
			{
				EdbgOutputDebugString ( "\r\nMAC address programming failure!\r\n");
			    EdbgOutputDebugString("Requested address: %B:%B:%B:%B:%B:%B\r\n",
                          MacAddr[0] & 0x00FF, MacAddr[0] >> 8,
                          MacAddr[1] & 0x00FF, MacAddr[1] >> 8,
                          MacAddr[2] & 0x00FF, MacAddr[2] >> 8);
			    EdbgOutputDebugString("SMSC controller returned: %B:%B:%B:%B:%B:%B\r\n",
                          MacAddr[0] & 0x00FF, MacAddr[0] >> 8,
                          MacAddr[1] & 0x00FF, MacAddr[1] >> 8,
                          MacAddr[2] & 0x00FF, MacAddr[2] >> 8);
			} else
			{
				EdbgOutputDebugString ( "\r\nMAC address programming complete.\r\n");
			}
		}
	} else 
	{
		EdbgOutputDebugString("SMC 91C96 Ethernet controller failed to initialize.\n");
		EdbgOutputDebugString("Unable to program MAC address.\n");
	}
}

// This routine will convert a dotted decimal MAC address into a binary version
void CvtMAC(USHORT MacAddr[3], char *pszDottedD ) 
{
    DWORD cBytes;
    char *pszLastNum;
    int atoi (const char *s);
	int i=0;    
	BYTE *p = (BYTE *)MacAddr;

    // Replace the dots with NULL terminators
    pszLastNum = pszDottedD;
    for( cBytes = 0; cBytes < 6; cBytes++ ) {
        while(*pszDottedD != '.' && *pszDottedD != '\0')
            pszDottedD++;
        if (pszDottedD == '\0' && cBytes != 5)
		{
			// zero out the rest of MAC address
			while(i++ < 6)
			{
				*p++ = 0;
			}
			break;
		}
        *pszDottedD = '\0';
        *p++ = (atoi(pszLastNum) & 0xFF);
		i++;
        pszLastNum = ++pszDottedD;
    }
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久精品99国产精品| 99久久免费视频.com| 一区二区激情视频| 欧美成人video| 欧美高清视频一二三区| 91毛片在线观看| 国产精品一区二区久久精品爱涩| 亚洲香肠在线观看| 日韩毛片一二三区| 国产精品三级av| 国产日韩欧美制服另类| 亚洲精品一线二线三线| 日韩午夜精品电影| 欧美一级爆毛片| 精品日韩在线观看| 欧美不卡视频一区| 欧美国产精品劲爆| 中文字幕一区二区不卡| 亚洲情趣在线观看| 午夜精品久久久久影视| 日韩avvvv在线播放| 久久精品国产77777蜜臀| 国产在线一区观看| 成人av网址在线| 91小视频在线| 欧美亚洲国产bt| 日韩一卡二卡三卡国产欧美| 日韩一区二区精品葵司在线| 久久久一区二区三区捆绑**| 中文字幕亚洲不卡| 亚洲欧美成人一区二区三区| 亚欧色一区w666天堂| 国产尤物一区二区| 欧美调教femdomvk| 精品日产卡一卡二卡麻豆| 精品国产乱码久久久久久夜甘婷婷 | 亚洲精品一区二区三区精华液| 久久久久久久久久久久久久久99| 中文字幕在线免费不卡| 麻豆专区一区二区三区四区五区| 成人禁用看黄a在线| 91精品国产高清一区二区三区| 国产日韩欧美精品综合| 天天综合天天综合色| 91网站在线播放| 亚洲精品一区二区三区在线观看| 亚洲高清久久久| 国产99精品国产| 久久蜜桃av一区精品变态类天堂| 亚洲一二三区不卡| 白白色 亚洲乱淫| 精品日韩欧美一区二区| 青草国产精品久久久久久| 色偷偷成人一区二区三区91| 中文字幕 久热精品 视频在线| 国产乱码精品一区二区三区忘忧草| 色综合久久天天综合网| 亚洲免费高清视频在线| 99re热这里只有精品免费视频 | 国产在线国偷精品免费看| 337p亚洲精品色噜噜噜| 亚洲最新视频在线观看| 91福利小视频| 亚洲日本中文字幕区| 99久久亚洲一区二区三区青草| 国产日韩欧美高清| 成人免费毛片嘿嘿连载视频| 久久亚洲影视婷婷| 国产乱对白刺激视频不卡| 精品国产乱码久久久久久浪潮| 男女男精品网站| 精品国产91乱码一区二区三区| 另类成人小视频在线| 久久久久一区二区三区四区| 成人久久视频在线观看| 成人欧美一区二区三区1314| 色视频一区二区| 免费成人在线观看视频| 久久精品人人爽人人爽| 91黄视频在线观看| 蜜桃精品视频在线| 综合中文字幕亚洲| 91精品在线一区二区| 国产乱子伦视频一区二区三区| 亚洲日本va午夜在线影院| 制服.丝袜.亚洲.另类.中文 | 免费av成人在线| 中文字幕一区二区三区不卡| 欧美伦理影视网| 91同城在线观看| 亚洲成a人片综合在线| 久久久.com| 91精品国产综合久久久蜜臀粉嫩| 国产一区二区精品久久| 亚洲一区二区三区在线播放| 精品国产91亚洲一区二区三区婷婷| av不卡在线播放| 国内外成人在线| 亚洲二区在线视频| 日韩毛片精品高清免费| 久久亚洲精品小早川怜子| 欧美性色综合网| 色综合久久久网| 国产激情一区二区三区桃花岛亚洲| 亚洲人成网站在线| 久久免费偷拍视频| 在线综合亚洲欧美在线视频 | 成人一道本在线| 国产精品伊人色| 激情欧美一区二区| 麻豆免费看一区二区三区| 天堂蜜桃91精品| 亚洲va韩国va欧美va精品| 亚洲美女电影在线| 亚洲一区成人在线| 五月激情丁香一区二区三区| 亚洲国产综合91精品麻豆| 一区二区三区精密机械公司| 亚洲精品美国一| 亚洲美女区一区| 午夜精品久久久久久久99樱桃 | 国产黑丝在线一区二区三区| 国产精品香蕉一区二区三区| 福利一区二区在线| 成人高清av在线| 欧美性大战久久| www一区二区| 久久久高清一区二区三区| 国产精品妹子av| 亚洲一区二区三区在线看| 91黄色免费看| 日韩欧美国产一区二区三区 | 国产一区二区电影| jlzzjlzz国产精品久久| 欧美男男青年gay1069videost| 精品粉嫩超白一线天av| 国产精品久久精品日日| 丝袜美腿亚洲色图| 国产成人精品免费视频网站| 国产色婷婷亚洲99精品小说| 亚洲一级电影视频| 韩国午夜理伦三级不卡影院| 色婷婷狠狠综合| 久久久精品免费网站| 亚洲国产综合91精品麻豆| 国产麻豆精品视频| 欧美精选午夜久久久乱码6080| 久久九九久久九九| 首页国产丝袜综合| 色综合久久久久综合| 久久久蜜桃精品| 日韩电影在线免费看| 99re视频精品| 国产精品少妇自拍| 黄一区二区三区| 3d动漫精品啪啪一区二区竹菊| 亚洲女与黑人做爰| 成人一二三区视频| 国产亚洲自拍一区| 激情五月婷婷综合| 91精品国模一区二区三区| 亚洲无人区一区| 欧美日韩在线不卡| 亚洲一区二区三区三| 欧美优质美女网站| 亚洲视频一区二区在线| 色婷婷综合久久| 中文字幕第一区综合| 国产精品亚洲一区二区三区在线 | 色噜噜偷拍精品综合在线| 综合av第一页| 91福利在线看| 午夜久久久影院| 51精品视频一区二区三区| 蜜桃av一区二区在线观看| 久久精品在这里| 99re在线视频这里只有精品| 一区二区三区在线视频免费| 日本电影欧美片| 精品午夜一区二区三区在线观看| 国产网站一区二区| 91浏览器打开| 日本色综合中文字幕| 国产日产欧美一区| 欧美午夜在线一二页| 激情综合色播激情啊| 欧美激情一二三区| 欧美日本一区二区在线观看| 激情综合色播激情啊| 亚洲日本va午夜在线电影| 91精品国产91久久久久久一区二区 | 亚洲猫色日本管| 日韩美女一区二区三区四区| 不卡一区中文字幕| 蜜桃一区二区三区在线观看| 国产精品久久久久aaaa| 91精品国产综合久久精品app | 51精品国自产在线| 91亚洲永久精品| 精品夜夜嗨av一区二区三区|