Esempio n. 1
0
int main(void)
{
	/* <1> Enable flash. */
	sysFlushCache (I_D_CACHE);
	sysDisableCache ();
	sysEnableCache (CACHE_WRITE_BACK);
	sysInit();
	printf("REG_APLLCON=0x%x REG_UPLLCON=0x%x\n", inpw(REG_APLLCON), inpw(REG_UPLLCON));
	printf("REG_CLKCON=0x%x REG_CLKSEL=0x%x\n", inpw(REG_CLKCON), inpw(REG_CLKSEL));
	printf("REG_CLKDIV0=0x%x REG_CLKDIV1=0x%x\n", inpw(REG_CLKDIV0), inpw(REG_CLKDIV1));
	printf("REG_TICR0=%d\n", inpw(REG_TICR0));
	FTH_Init();
	
#if 0
	test_inet(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_gethost(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_socket(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_netread();
	test_netwrite();
	test_send();
	test_recv();
	test_recvmsg();
	test_sendmsg();
	test_recvfrom(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_sendto(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_netselect();
	test_getsockname();
	test_getsockopt(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_netfcntl(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_netioctl(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_netioctl_withbuf(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_wb740getgateway(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_wb740reboot(g_RemoteNet_Buf, RNT_BUFFER_LEN);
#endif
	test_inet(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_gethost(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_socket(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_netread();
	test_netwrite();
	test_send();
	test_recv();
	test_recvmsg();
	test_sendmsg();
	test_recvfrom(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_sendto(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_netselect();
	test_getsockname();
	test_getsockopt(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_netfcntl(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_netioctl(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_netioctl_withbuf(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_wb740getgateway(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	test_wb740reboot(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	
	// insert test program here
	//GetDevInterface();
	//simple_getgateway();
	//simple_ioctl_withbuf();
	//simple_udpserver();
	//simple_tcpserver();
	//simple_inet_addr();
	//simple_uname();
	//simple_gethostbyaddr();
	//simple_multi_thread();
	//wb740reboot(g_RemoteNet_Buf, RNT_BUFFER_LEN);
	return 0;
}
int main(int argc, char **argv)
{
	test_getsockname();
	return 0;
}