Index: asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/Debug/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/Debug/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/Debug/Makefile	(revision 342)
@@ -391,5 +391,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/DebugCitrus/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/DebugCitrus/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/DebugCitrus/Makefile	(revision 342)
@@ -391,5 +391,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/DebugEther/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/DebugEther/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/DebugEther/Makefile	(revision 342)
@@ -391,5 +391,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/client.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/client.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/client.c	(revision 342)
@@ -245,5 +245,5 @@
 	FIL file;
 	FRESULT ret;
-	char fname[] = {"0:/log/20160101000000.log"};
+	char fname[] = {"1:/log/20160101000000.log"};
 
 	get_logfname(fname);
Index: asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/echonet_main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/echonet_main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/echonet_main.c	(revision 342)
@@ -50,5 +50,5 @@
 #include "echonet_main.h"
 #include "echonet_cfg.h"
-#include "rx630.h"
+#include "target_kernel_impl.h"
 #include "ff.h"
 #include "diskio.h"
@@ -59,4 +59,5 @@
 #include <net/ethernet.h>
 #include <net/if_var.h>
+#include "ntshell_main.h"
 
 /* TODO: メーカーコードを設定 */
@@ -504,8 +505,8 @@
 
 	/* 3ms後に7SEG表示を更新 */
-	main_led_timer = 3;
+	main_led_timer = 3 * 1000;
 
 	/* 10ms後にボタン状態を確認 */
-	main_timer = 10;
+	main_timer = 10 * 1000;
 
 	/* 12bitADC初期化 */
@@ -520,5 +521,10 @@
 
 	/* 1秒後に表示を更新 */
-	main_adv_timer = 1000;
+	main_adv_timer = 1000 * 1000;
+
+	ER ret = act_tsk(MAIN_TASK);
+	if (ret != E_OK) {
+		syslog(LOG_ERROR, "act_tsk");
+	}
 }
 
@@ -759,5 +765,5 @@
 
 			if (electric_energy_meter_data[0].current_pos == 0) {
-				//act_tsk(CLIENT_TASK);
+				cmd_execute("logupload", NULL);
 			}
 		}
Index: asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/main.c	(revision 342)
@@ -77,4 +77,5 @@
 #include "client.h"
 #include "ntp_cli.h"
+#include "netcmd.h"
 
 ID ws_api_mailboxid = MAIN_DATAQUEUE;
@@ -83,5 +84,5 @@
 #ifdef IF_ETHER_BTUSB
 extern int bt_bnep_mode;
-
+/* PANU向けリモートアドレス */
 // BUFFALLO
 //bd_addr_t remote_addr = { 0x00,0x1B,0xDC,0x04,0x5C,0x2D };
@@ -144,5 +145,4 @@
 
 ntshell_t ntshell;
-void _start_c(long *p);
 
 /*
@@ -150,13 +150,4 @@
  */
 void main_task(intptr_t exinf)
-{
-	long args[] = {
-		1,
-		(long)"ntshell",
-	};
-	_start_c(args);
-}
-
-int main(int argc, char **argv)
 {
 #ifdef IF_ETHER_BTUSB
@@ -170,6 +161,4 @@
 	ntshell_set_prompt(&ntshell, "NTShell>");
 	ntshell_execute(&ntshell);
-
-	return 0;
 }
 
@@ -187,5 +176,5 @@
 	fno.lfsize = _MAX_LFN + 1;
 #endif
-	ER ret2;
+	ER ret;
 
 	//wolfSSL_Debugging_ON();
@@ -247,6 +236,6 @@
 #endif
 
-	ret2 = get_tim(&main_obj.now);
-	if (ret2 != E_OK) {
+	ret = get_tim(&main_obj.now);
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "get_tim");
 		ext_tsk();
@@ -339,8 +328,4 @@
 
 extern int curl_main(int argc, char **argv);
-extern int usrcmd_ping(int argc, char **argv);
-extern int usrcmd_dhcp4c(int argc, char **argv);
-extern int usrcmd_dnsc(int argc, char **argv);
-extern int usrcmd_ntpc(int argc, char **argv);
 
 static const cmd_table_t cmdlist[] = {
Index: asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/main.cfg
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/main.cfg	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/main.cfg	(revision 342)
@@ -84,4 +84,4 @@
 INCLUDE("echonet_main.cfg");
 
-CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
+CRE_TSK(MAIN_TASK, { TA_NULL, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
 CRE_DTQ(MAIN_DATAQUEUE, { TA_TFIFO, NUM_MAIN_DATAQUEUE, NULL });
Index: asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/tinet_app_config.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/tinet_app_config.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app1_usb_watt_meter/src/tinet_app_config.h	(revision 342)
@@ -29,5 +29,5 @@
  *  接的または間接的に生じたいかなる損害に関しても，その責任を負わない．
  * 
- *  @(#) $Id$
+ *  @(#) $Id: tinet_app_config.h 1505 2018-04-17 11:22:02Z coas-nagasima $
  */
 
@@ -624,5 +624,5 @@
 /* DNS サーバの IP アドレス */
 
-#if !defined(DHCP6_CLI_CFG)
+//#if !defined(DHCP6_CLI_CFG)
 
 #define IPV6_ADDR_DNS_INIT	\
@@ -632,9 +632,9 @@
 	    UINT_C(0xfe), UINT_C(0x56), UINT_C(0xc5), UINT_C(0xd6) }}}
 
-#endif	/* of #if !defined(DHCP6_CLI_CFG) */
-
-#if !defined(DHCP4_CLI_CFG)
-#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,2,1)
-#endif
+//#endif	/* of #if !defined(DHCP6_CLI_CFG) */
+
+//#if !defined(DHCP4_CLI_CFG)
+#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,137,1)
+//#endif
 
 /* DOMAIN 名 */
Index: asp3_tinet_ecnl_rx/trunk/app2_light/Debug/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app2_light/Debug/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app2_light/Debug/Makefile	(revision 342)
@@ -382,5 +382,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app2_light/DebugCitrus/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app2_light/DebugCitrus/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app2_light/DebugCitrus/Makefile	(revision 342)
@@ -382,5 +382,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app2_light/DebugEther/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app2_light/DebugEther/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app2_light/DebugEther/Makefile	(revision 342)
@@ -380,5 +380,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app2_light/src/echonet_main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app2_light/src/echonet_main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app2_light/src/echonet_main.c	(revision 342)
@@ -50,5 +50,5 @@
 #include "echonet_main.h"
 #include "echonet_cfg.h"
-#include "rx630.h"
+#include "target_kernel_impl.h"
 
 /* TODO: メーカーコードを設定 */
@@ -490,4 +490,9 @@
 	main_btn1_state = (btn1 & 0x80/*0x0x20*/) != 0;
 	main_btn2_state = (btn2 & 0x80) != 0;
+
+	ER ret = act_tsk(MAIN_TASK);
+	if (ret != E_OK) {
+		syslog(LOG_ERROR, "act_tsk");
+	}
 }
 
Index: asp3_tinet_ecnl_rx/trunk/app2_light/src/main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app2_light/src/main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app2_light/src/main.c	(revision 342)
@@ -76,4 +76,5 @@
 #include <btstack/utils.h>
 #include "ntp_cli.h"
+#include "netcmd.h"
 
 ID ws_api_mailboxid = MAIN_DATAQUEUE;
@@ -82,5 +83,5 @@
 #ifdef IF_ETHER_BTUSB
 extern int bt_bnep_mode;
-
+/* PANU向けリモートアドレス */
 // BUFFALLO
 //bd_addr_t remote_addr = { 0x00,0x1B,0xDC,0x04,0x5C,0x2D };
@@ -143,5 +144,4 @@
 
 ntshell_t ntshell;
-void _start_c(long *p);
 
 /*
@@ -149,13 +149,4 @@
  */
 void main_task(intptr_t exinf)
-{
-	long args[] = {
-		1,
-		(long)"ntshell",
-	};
-	_start_c(args);
-}
-
-int main(int argc, char **argv)
 {
 #ifdef IF_ETHER_BTUSB
@@ -169,6 +160,4 @@
 	ntshell_set_prompt(&ntshell, "NTShell>");
 	ntshell_execute(&ntshell);
-
-	return 0;
 }
 
@@ -184,5 +173,5 @@
 	fno.lfsize = _MAX_LFN + 1;
 #endif
-	ER ret2;
+	ER ret;
 
 	ntshell_task_init();
@@ -239,6 +228,6 @@
 #endif
 
-	ret2 = get_tim(&main_obj.now);
-	if (ret2 != E_OK) {
+	ret = get_tim(&main_obj.now);
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "get_tim");
 		ext_tsk();
@@ -309,9 +298,4 @@
 	echonet_change_netif_link(link_up, up);
 }
-
-extern int usrcmd_ping(int argc, char **argv);
-extern int usrcmd_dhcp4c(int argc, char **argv);
-extern int usrcmd_dnsc(int argc, char **argv);
-extern int usrcmd_ntpc(int argc, char **argv);
 
 static const cmd_table_t cmdlist[] = {
Index: asp3_tinet_ecnl_rx/trunk/app2_light/src/main.cfg
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app2_light/src/main.cfg	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app2_light/src/main.cfg	(revision 342)
@@ -84,4 +84,4 @@
 INCLUDE("echonet_main.cfg");
 
-CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
+CRE_TSK(MAIN_TASK, { TA_NULL, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
 CRE_DTQ(MAIN_DATAQUEUE, { TA_TFIFO, NUM_MAIN_DATAQUEUE, NULL });
Index: asp3_tinet_ecnl_rx/trunk/app2_light/src/tinet_app_config.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app2_light/src/tinet_app_config.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app2_light/src/tinet_app_config.h	(revision 342)
@@ -29,5 +29,5 @@
  *  接的または間接的に生じたいかなる損害に関しても，その責任を負わない．
  * 
- *  @(#) $Id$
+ *  @(#) $Id: tinet_app_config.h 1505 2018-04-17 11:22:02Z coas-nagasima $
  */
 
@@ -624,5 +624,5 @@
 /* DNS サーバの IP アドレス */
 
-#if !defined(DHCP6_CLI_CFG)
+//#if !defined(DHCP6_CLI_CFG)
 
 #define IPV6_ADDR_DNS_INIT	\
@@ -632,9 +632,9 @@
 	    UINT_C(0xfe), UINT_C(0x56), UINT_C(0xc5), UINT_C(0xd6) }}}
 
-#endif	/* of #if !defined(DHCP6_CLI_CFG) */
-
-#if !defined(DHCP4_CLI_CFG)
-#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,2,1)
-#endif
+//#endif	/* of #if !defined(DHCP6_CLI_CFG) */
+
+//#if !defined(DHCP4_CLI_CFG)
+#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,137,1)
+//#endif
 
 /* DOMAIN 名 */
Index: asp3_tinet_ecnl_rx/trunk/app3_human_detec/Debug/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app3_human_detec/Debug/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app3_human_detec/Debug/Makefile	(revision 342)
@@ -382,5 +382,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app3_human_detec/DebugCitrus/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app3_human_detec/DebugCitrus/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app3_human_detec/DebugCitrus/Makefile	(revision 342)
@@ -382,5 +382,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app3_human_detec/DebugEther/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app3_human_detec/DebugEther/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app3_human_detec/DebugEther/Makefile	(revision 342)
@@ -380,5 +380,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app3_human_detec/src/echonet_main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app3_human_detec/src/echonet_main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app3_human_detec/src/echonet_main.c	(revision 342)
@@ -50,5 +50,5 @@
 #include "echonet_main.h"
 #include "echonet_cfg.h"
-#include "rx630.h"
+#include "target_kernel_impl.h"
 
 /* TODO: メーカーコードを設定 */
@@ -378,4 +378,9 @@
 	main_btn1_state = (btn1 & 0x80) != 0;
 	main_btn2_state = (btn2 & 0x80) != 0;
+
+	ER ret = act_tsk(MAIN_TASK);
+	if (ret != E_OK) {
+		syslog(LOG_ERROR, "act_tsk");
+	}
 }
 
Index: asp3_tinet_ecnl_rx/trunk/app3_human_detec/src/main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app3_human_detec/src/main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app3_human_detec/src/main.c	(revision 342)
@@ -76,4 +76,5 @@
 #include <btstack/utils.h>
 #include "ntp_cli.h"
+#include "netcmd.h"
 
 ID ws_api_mailboxid = MAIN_DATAQUEUE;
@@ -82,5 +83,5 @@
 #ifdef IF_ETHER_BTUSB
 extern int bt_bnep_mode;
-
+/* PANU向けリモートアドレス */
 // BUFFALLO
 //bd_addr_t remote_addr = { 0x00,0x1B,0xDC,0x04,0x5C,0x2D };
@@ -143,5 +144,4 @@
 
 ntshell_t ntshell;
-void _start_c(long *p);
 
 /*
@@ -149,13 +149,4 @@
  */
 void main_task(intptr_t exinf)
-{
-	long args[] = {
-		1,
-		(long)"ntshell",
-	};
-	_start_c(args);
-}
-
-int main(int argc, char **argv)
 {
 #ifdef IF_ETHER_BTUSB
@@ -169,6 +160,4 @@
 	ntshell_set_prompt(&ntshell, "NTShell>");
 	ntshell_execute(&ntshell);
-
-	return 0;
 }
 
@@ -184,5 +173,5 @@
 	fno.lfsize = _MAX_LFN + 1;
 #endif
-	ER ret2;
+	ER ret;
 
 	ntshell_task_init();
@@ -239,6 +228,6 @@
 #endif
 
-	ret2 = get_tim(&main_obj.now);
-	if (ret2 != E_OK) {
+	ret = get_tim(&main_obj.now);
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "get_tim");
 		ext_tsk();
@@ -309,9 +298,4 @@
 	echonet_change_netif_link(link_up, up);
 }
-
-extern int usrcmd_ping(int argc, char **argv);
-extern int usrcmd_dhcp4c(int argc, char **argv);
-extern int usrcmd_dnsc(int argc, char **argv);
-extern int usrcmd_ntpc(int argc, char **argv);
 
 static const cmd_table_t cmdlist[] = {
Index: asp3_tinet_ecnl_rx/trunk/app3_human_detec/src/main.cfg
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app3_human_detec/src/main.cfg	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app3_human_detec/src/main.cfg	(revision 342)
@@ -84,4 +84,4 @@
 INCLUDE("echonet_main.cfg");
 
-CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
+CRE_TSK(MAIN_TASK, { TA_NULL, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
 CRE_DTQ(MAIN_DATAQUEUE, { TA_TFIFO, NUM_MAIN_DATAQUEUE, NULL });
Index: asp3_tinet_ecnl_rx/trunk/app3_human_detec/src/tinet_app_config.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app3_human_detec/src/tinet_app_config.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app3_human_detec/src/tinet_app_config.h	(revision 342)
@@ -29,5 +29,5 @@
  *  接的または間接的に生じたいかなる損害に関しても，その責任を負わない．
  * 
- *  @(#) $Id$
+ *  @(#) $Id: tinet_app_config.h 1505 2018-04-17 11:22:02Z coas-nagasima $
  */
 
@@ -624,5 +624,5 @@
 /* DNS サーバの IP アドレス */
 
-#if !defined(DHCP6_CLI_CFG)
+//#if !defined(DHCP6_CLI_CFG)
 
 #define IPV6_ADDR_DNS_INIT	\
@@ -632,9 +632,9 @@
 	    UINT_C(0xfe), UINT_C(0x56), UINT_C(0xc5), UINT_C(0xd6) }}}
 
-#endif	/* of #if !defined(DHCP6_CLI_CFG) */
-
-#if !defined(DHCP4_CLI_CFG)
-#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,2,1)
-#endif
+//#endif	/* of #if !defined(DHCP6_CLI_CFG) */
+
+//#if !defined(DHCP4_CLI_CFG)
+#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,137,1)
+//#endif
 
 /* DOMAIN 名 */
Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/Debug/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/Debug/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/Debug/Makefile	(revision 342)
@@ -382,5 +382,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/DebugCitrus/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/DebugCitrus/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/DebugCitrus/Makefile	(revision 342)
@@ -382,5 +382,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/DebugEther/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/DebugEther/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/DebugEther/Makefile	(revision 342)
@@ -380,5 +380,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/src/echonet_main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/src/echonet_main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/src/echonet_main.c	(revision 342)
@@ -50,5 +50,5 @@
 #include "echonet_main.h"
 #include "echonet_cfg.h"
-#include "rx630.h"
+#include "target_kernel_impl.h"
 
 /* TODO: メーカーコードを設定 */
@@ -513,4 +513,9 @@
 	main_btn1_state = (btn1 & 0x20) != 0;
 	main_btn2_state = (btn2 & 0x80) != 0;
+
+	ER ret = act_tsk(MAIN_TASK);
+	if (ret != E_OK) {
+		syslog(LOG_ERROR, "act_tsk");
+	}
 }
 
@@ -1176,5 +1181,5 @@
 	/* 500msパルス出力 */
 	main_rly_state = main_rly_state_on;
-	main_rly_timer = 500;
+	main_rly_timer = 500 * 1000;
 }
 
Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/src/main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/src/main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/src/main.c	(revision 342)
@@ -76,4 +76,5 @@
 #include <btstack/utils.h>
 #include "ntp_cli.h"
+#include "netcmd.h"
 
 ID ws_api_mailboxid = MAIN_DATAQUEUE;
@@ -82,5 +83,5 @@
 #ifdef IF_ETHER_BTUSB
 extern int bt_bnep_mode;
-
+/* PANU向けリモートアドレス */
 // BUFFALLO
 //bd_addr_t remote_addr = { 0x00,0x1B,0xDC,0x04,0x5C,0x2D };
@@ -143,5 +144,4 @@
 
 ntshell_t ntshell;
-void _start_c(long *p);
 
 /*
@@ -149,13 +149,4 @@
  */
 void main_task(intptr_t exinf)
-{
-	long args[] = {
-		1,
-		(long)"ntshell",
-	};
-	_start_c(args);
-}
-
-int main(int argc, char **argv)
 {
 #ifdef IF_ETHER_BTUSB
@@ -169,6 +160,4 @@
 	ntshell_set_prompt(&ntshell, "NTShell>");
 	ntshell_execute(&ntshell);
-
-	return 0;
 }
 
@@ -184,5 +173,5 @@
 	fno.lfsize = _MAX_LFN + 1;
 #endif
-	ER ret2;
+	ER ret;
 
 	ntshell_task_init();
@@ -239,6 +228,6 @@
 #endif
 
-	ret2 = get_tim(&main_obj.now);
-	if (ret2 != E_OK) {
+	ret = get_tim(&main_obj.now);
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "get_tim");
 		ext_tsk();
@@ -309,9 +298,4 @@
 	echonet_change_netif_link(link_up, up);
 }
-
-extern int usrcmd_ping(int argc, char **argv);
-extern int usrcmd_dhcp4c(int argc, char **argv);
-extern int usrcmd_dnsc(int argc, char **argv);
-extern int usrcmd_ntpc(int argc, char **argv);
 
 static const cmd_table_t cmdlist[] = {
Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/src/main.cfg
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/src/main.cfg	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/src/main.cfg	(revision 342)
@@ -84,4 +84,4 @@
 INCLUDE("echonet_main.cfg");
 
-CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
+CRE_TSK(MAIN_TASK, { TA_NULL, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
 CRE_DTQ(MAIN_DATAQUEUE, { TA_TFIFO, NUM_MAIN_DATAQUEUE, NULL });
Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/src/tinet_app_config.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/src/tinet_app_config.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/src/tinet_app_config.h	(revision 342)
@@ -29,5 +29,5 @@
  *  接的または間接的に生じたいかなる損害に関しても，その責任を負わない．
  * 
- *  @(#) $Id$
+ *  @(#) $Id: tinet_app_config.h 1505 2018-04-17 11:22:02Z coas-nagasima $
  */
 
@@ -624,5 +624,5 @@
 /* DNS サーバの IP アドレス */
 
-#if !defined(DHCP6_CLI_CFG)
+//#if !defined(DHCP6_CLI_CFG)
 
 #define IPV6_ADDR_DNS_INIT	\
@@ -632,9 +632,9 @@
 	    UINT_C(0xfe), UINT_C(0x56), UINT_C(0xc5), UINT_C(0xd6) }}}
 
-#endif	/* of #if !defined(DHCP6_CLI_CFG) */
-
-#if !defined(DHCP4_CLI_CFG)
-#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,2,1)
-#endif
+//#endif	/* of #if !defined(DHCP6_CLI_CFG) */
+
+//#if !defined(DHCP4_CLI_CFG)
+#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,137,1)
+//#endif
 
 /* DOMAIN 名 */
Index: asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/Debug/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/Debug/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/Debug/Makefile	(revision 342)
@@ -382,5 +382,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/DebugCitrus/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/DebugCitrus/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/DebugCitrus/Makefile	(revision 342)
@@ -382,5 +382,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/DebugEther/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/DebugEther/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/DebugEther/Makefile	(revision 342)
@@ -380,5 +380,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/src/echonet_main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/src/echonet_main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/src/echonet_main.c	(revision 342)
@@ -50,5 +50,5 @@
 #include "echonet_main.h"
 #include "echonet_cfg.h"
-#include "rx630.h"
+#include "target_kernel_impl.h"
 
 /* TODO: メーカーコードを設定 */
@@ -403,4 +403,9 @@
 	main_btn1_state = (btn1 & 0x20) != 0;
 	main_btn2_state = (btn2 & 0x80) != 0;
+
+	ER ret = act_tsk(MAIN_TASK);
+	if (ret != E_OK) {
+		syslog(LOG_ERROR, "act_tsk");
+	}
 }
 
Index: asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/src/main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/src/main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/src/main.c	(revision 342)
@@ -76,4 +76,5 @@
 #include <btstack/utils.h>
 #include "ntp_cli.h"
+#include "netcmd.h"
 
 ID ws_api_mailboxid = MAIN_DATAQUEUE;
@@ -82,5 +83,5 @@
 #ifdef IF_ETHER_BTUSB
 extern int bt_bnep_mode;
-
+/* PANU向けリモートアドレス */
 // BUFFALLO
 //bd_addr_t remote_addr = { 0x00,0x1B,0xDC,0x04,0x5C,0x2D };
@@ -143,5 +144,4 @@
 
 ntshell_t ntshell;
-void _start_c(long *p);
 
 /*
@@ -149,13 +149,4 @@
  */
 void main_task(intptr_t exinf)
-{
-	long args[] = {
-		1,
-		(long)"ntshell",
-	};
-	_start_c(args);
-}
-
-int main(int argc, char **argv)
 {
 #ifdef IF_ETHER_BTUSB
@@ -169,6 +160,4 @@
 	ntshell_set_prompt(&ntshell, "NTShell>");
 	ntshell_execute(&ntshell);
-
-	return 0;
 }
 
@@ -184,5 +173,5 @@
 	fno.lfsize = _MAX_LFN + 1;
 #endif
-	ER ret2;
+	ER ret;
 
 	ntshell_task_init();
@@ -239,6 +228,6 @@
 #endif
 
-	ret2 = get_tim(&main_obj.now);
-	if (ret2 != E_OK) {
+	ret = get_tim(&main_obj.now);
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "get_tim");
 		ext_tsk();
@@ -309,9 +298,4 @@
 	echonet_change_netif_link(link_up, up);
 }
-
-extern int usrcmd_ping(int argc, char **argv);
-extern int usrcmd_dhcp4c(int argc, char **argv);
-extern int usrcmd_dnsc(int argc, char **argv);
-extern int usrcmd_ntpc(int argc, char **argv);
 
 static const cmd_table_t cmdlist[] = {
Index: asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/src/main.cfg
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/src/main.cfg	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/src/main.cfg	(revision 342)
@@ -84,4 +84,4 @@
 INCLUDE("echonet_main.cfg");
 
-CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
+CRE_TSK(MAIN_TASK, { TA_NULL, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
 CRE_DTQ(MAIN_DATAQUEUE, { TA_TFIFO, NUM_MAIN_DATAQUEUE, NULL });
Index: asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/src/tinet_app_config.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/src/tinet_app_config.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app5_temp_sensor/src/tinet_app_config.h	(revision 342)
@@ -29,5 +29,5 @@
  *  接的または間接的に生じたいかなる損害に関しても，その責任を負わない．
  * 
- *  @(#) $Id$
+ *  @(#) $Id: tinet_app_config.h 1505 2018-04-17 11:22:02Z coas-nagasima $
  */
 
@@ -624,5 +624,5 @@
 /* DNS サーバの IP アドレス */
 
-#if !defined(DHCP6_CLI_CFG)
+//#if !defined(DHCP6_CLI_CFG)
 
 #define IPV6_ADDR_DNS_INIT	\
@@ -632,9 +632,9 @@
 	    UINT_C(0xfe), UINT_C(0x56), UINT_C(0xc5), UINT_C(0xd6) }}}
 
-#endif	/* of #if !defined(DHCP6_CLI_CFG) */
-
-#if !defined(DHCP4_CLI_CFG)
-#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,2,1)
-#endif
+//#endif	/* of #if !defined(DHCP6_CLI_CFG) */
+
+//#if !defined(DHCP4_CLI_CFG)
+#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,137,1)
+//#endif
 
 /* DOMAIN 名 */
Index: asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/Debug/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/Debug/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/Debug/Makefile	(revision 342)
@@ -382,5 +382,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/DebugCitrus/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/DebugCitrus/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/DebugCitrus/Makefile	(revision 342)
@@ -382,5 +382,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/DebugEther/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/DebugEther/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/DebugEther/Makefile	(revision 342)
@@ -380,5 +380,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/echonet_main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/echonet_main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/echonet_main.c	(revision 342)
@@ -50,5 +50,5 @@
 #include "echonet_main.h"
 #include "echonet_cfg.h"
-#include "rx630.h"
+#include "target_kernel_impl.h"
 
 /* TODO: メーカーコードを設定 */
@@ -386,4 +386,9 @@
 	main_btn1_state = (btn1 & 0x80) != 0;
 	main_btn2_state = (btn2 & 0x80) != 0;
+
+	ER ret = act_tsk(MAIN_TASK);
+	if (ret != E_OK) {
+		syslog(LOG_ERROR, "act_tsk");
+	}
 }
 
Index: asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/main.c	(revision 342)
@@ -76,4 +76,5 @@
 #include <btstack/utils.h>
 #include "ntp_cli.h"
+#include "netcmd.h"
 
 ID ws_api_mailboxid = MAIN_DATAQUEUE;
@@ -82,5 +83,5 @@
 #ifdef IF_ETHER_BTUSB
 extern int bt_bnep_mode;
-
+/* PANU向けリモートアドレス */
 // BUFFALLO
 //bd_addr_t remote_addr = { 0x00,0x1B,0xDC,0x04,0x5C,0x2D };
@@ -143,5 +144,4 @@
 
 ntshell_t ntshell;
-void _start_c(long *p);
 
 /*
@@ -149,13 +149,4 @@
  */
 void main_task(intptr_t exinf)
-{
-	long args[] = {
-		1,
-		(long)"ntshell",
-	};
-	_start_c(args);
-}
-
-int main(int argc, char **argv)
 {
 #ifdef IF_ETHER_BTUSB
@@ -169,6 +160,4 @@
 	ntshell_set_prompt(&ntshell, "NTShell>");
 	ntshell_execute(&ntshell);
-
-	return 0;
 }
 
@@ -184,5 +173,5 @@
 	fno.lfsize = _MAX_LFN + 1;
 #endif
-	ER ret2;
+	ER ret;
 
 	ntshell_task_init();
@@ -239,6 +228,6 @@
 #endif
 
-	ret2 = get_tim(&main_obj.now);
-	if (ret2 != E_OK) {
+	ret = get_tim(&main_obj.now);
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "get_tim");
 		ext_tsk();
@@ -309,9 +298,4 @@
 	echonet_change_netif_link(link_up, up);
 }
-
-extern int usrcmd_ping(int argc, char **argv);
-extern int usrcmd_dhcp4c(int argc, char **argv);
-extern int usrcmd_dnsc(int argc, char **argv);
-extern int usrcmd_ntpc(int argc, char **argv);
 
 static const cmd_table_t cmdlist[] = {
Index: asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/main.cfg
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/main.cfg	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/main.cfg	(revision 342)
@@ -84,4 +84,4 @@
 INCLUDE("echonet_main.cfg");
 
-CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
+CRE_TSK(MAIN_TASK, { TA_NULL, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
 CRE_DTQ(MAIN_DATAQUEUE, { TA_TFIFO, NUM_MAIN_DATAQUEUE, NULL });
Index: asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/tinet_app_config.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/tinet_app_config.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/tinet_app_config.h	(revision 342)
@@ -29,5 +29,5 @@
  *  接的または間接的に生じたいかなる損害に関しても，その責任を負わない．
  * 
- *  @(#) $Id$
+ *  @(#) $Id: tinet_app_config.h 1505 2018-04-17 11:22:02Z coas-nagasima $
  */
 
@@ -624,5 +624,5 @@
 /* DNS サーバの IP アドレス */
 
-#if !defined(DHCP6_CLI_CFG)
+//#if !defined(DHCP6_CLI_CFG)
 
 #define IPV6_ADDR_DNS_INIT	\
@@ -632,9 +632,9 @@
 	    UINT_C(0xfe), UINT_C(0x56), UINT_C(0xc5), UINT_C(0xd6) }}}
 
-#endif	/* of #if !defined(DHCP6_CLI_CFG) */
-
-#if !defined(DHCP4_CLI_CFG)
-#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,2,1)
-#endif
+//#endif	/* of #if !defined(DHCP6_CLI_CFG) */
+
+//#if !defined(DHCP4_CLI_CFG)
+#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,137,1)
+//#endif
 
 /* DOMAIN 名 */
Index: asp3_tinet_ecnl_rx/trunk/app7_buzzer/Debug/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app7_buzzer/Debug/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app7_buzzer/Debug/Makefile	(revision 342)
@@ -382,5 +382,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app7_buzzer/DebugCitrus/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app7_buzzer/DebugCitrus/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app7_buzzer/DebugCitrus/Makefile	(revision 342)
@@ -382,5 +382,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app7_buzzer/DebugEther/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app7_buzzer/DebugEther/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app7_buzzer/DebugEther/Makefile	(revision 342)
@@ -380,5 +380,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/app7_buzzer/src/echonet_main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app7_buzzer/src/echonet_main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app7_buzzer/src/echonet_main.c	(revision 342)
@@ -50,5 +50,5 @@
 #include "echonet_main.h"
 #include "echonet_cfg.h"
-#include "rx630.h"
+#include "target_kernel_impl.h"
 
 /* TODO: メーカーコードを設定 */
@@ -378,4 +378,9 @@
 	main_state = main_state_search;
 	main_timer = 1000 * 1000;
+
+	ER ret = act_tsk(MAIN_TASK);
+	if (ret != E_OK) {
+		syslog(LOG_ERROR, "act_tsk");
+	}
 }
 
Index: asp3_tinet_ecnl_rx/trunk/app7_buzzer/src/main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app7_buzzer/src/main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app7_buzzer/src/main.c	(revision 342)
@@ -76,4 +76,5 @@
 #include <btstack/utils.h>
 #include "ntp_cli.h"
+#include "netcmd.h"
 
 ID ws_api_mailboxid = MAIN_DATAQUEUE;
@@ -82,5 +83,5 @@
 #ifdef IF_ETHER_BTUSB
 extern int bt_bnep_mode;
-
+/* PANU向けリモートアドレス */
 // BUFFALLO
 //bd_addr_t remote_addr = { 0x00,0x1B,0xDC,0x04,0x5C,0x2D };
@@ -143,5 +144,4 @@
 
 ntshell_t ntshell;
-void _start_c(long *p);
 
 /*
@@ -149,13 +149,4 @@
  */
 void main_task(intptr_t exinf)
-{
-	long args[] = {
-		1,
-		(long)"ntshell",
-	};
-	_start_c(args);
-}
-
-int main(int argc, char **argv)
 {
 #ifdef IF_ETHER_BTUSB
@@ -169,6 +160,4 @@
 	ntshell_set_prompt(&ntshell, "NTShell>");
 	ntshell_execute(&ntshell);
-
-	return 0;
 }
 
@@ -184,5 +173,5 @@
 	fno.lfsize = _MAX_LFN + 1;
 #endif
-	ER ret2;
+	ER ret;
 
 	ntshell_task_init();
@@ -239,6 +228,6 @@
 #endif
 
-	ret2 = get_tim(&main_obj.now);
-	if (ret2 != E_OK) {
+	ret = get_tim(&main_obj.now);
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "get_tim");
 		ext_tsk();
@@ -309,9 +298,4 @@
 	echonet_change_netif_link(link_up, up);
 }
-
-extern int usrcmd_ping(int argc, char **argv);
-extern int usrcmd_dhcp4c(int argc, char **argv);
-extern int usrcmd_dnsc(int argc, char **argv);
-extern int usrcmd_ntpc(int argc, char **argv);
 
 static const cmd_table_t cmdlist[] = {
Index: asp3_tinet_ecnl_rx/trunk/app7_buzzer/src/main.cfg
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app7_buzzer/src/main.cfg	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app7_buzzer/src/main.cfg	(revision 342)
@@ -84,4 +84,4 @@
 INCLUDE("echonet_main.cfg");
 
-CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
+CRE_TSK(MAIN_TASK, { TA_NULL, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
 CRE_DTQ(MAIN_DATAQUEUE, { TA_TFIFO, NUM_MAIN_DATAQUEUE, NULL });
Index: asp3_tinet_ecnl_rx/trunk/app7_buzzer/src/tinet_app_config.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app7_buzzer/src/tinet_app_config.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/app7_buzzer/src/tinet_app_config.h	(revision 342)
@@ -29,5 +29,5 @@
  *  接的または間接的に生じたいかなる損害に関しても，その責任を負わない．
  * 
- *  @(#) $Id$
+ *  @(#) $Id: tinet_app_config.h 1505 2018-04-17 11:22:02Z coas-nagasima $
  */
 
@@ -624,5 +624,5 @@
 /* DNS サーバの IP アドレス */
 
-#if !defined(DHCP6_CLI_CFG)
+//#if !defined(DHCP6_CLI_CFG)
 
 #define IPV6_ADDR_DNS_INIT	\
@@ -632,9 +632,9 @@
 	    UINT_C(0xfe), UINT_C(0x56), UINT_C(0xc5), UINT_C(0xd6) }}}
 
-#endif	/* of #if !defined(DHCP6_CLI_CFG) */
-
-#if !defined(DHCP4_CLI_CFG)
-#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,2,1)
-#endif
+//#endif	/* of #if !defined(DHCP6_CLI_CFG) */
+
+//#if !defined(DHCP4_CLI_CFG)
+#define IPV4_ADDR_DNS		MAKE_IPV4_ADDR(192,168,137,1)
+//#endif
 
 /* DOMAIN 名 */
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/Debug/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/Debug/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/Debug/Makefile	(revision 342)
@@ -369,5 +369,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/DebugCitrus/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/DebugCitrus/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/DebugCitrus/Makefile	(revision 342)
@@ -369,5 +369,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/arch/rx630_gcc/prc_kernel_impl.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/arch/rx630_gcc/prc_kernel_impl.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/arch/rx630_gcc/prc_kernel_impl.c	(revision 342)
@@ -39,5 +39,5 @@
  *  の責任を負わない．
  * 
- *  @(#) $Id$
+ *  @(#) $Id: prc_kernel_impl.c 1518 2018-04-24 00:37:16Z coas-nagasima $
  */
 
@@ -237,2 +237,55 @@
 #endif /* OMIT_DEFAULT_EXC_HANDLER */
 
+void _start_c(char **args);
+
+void
+_sta_ker()
+{
+	const char *const args[] = {
+		1,
+		"asp3",
+		0,
+		"TZ=JST-9",
+		0
+	};
+	_start_c(args);
+}
+
+//#include <errno.h>
+#define ENOSYS          38
+
+__attribute__((weak))
+long SYS_poll()
+{
+	return -ENOSYS;
+}
+
+__attribute__((weak))
+long SYS_open()
+{
+	return -ENOSYS;
+}
+
+__attribute__((weak))
+void SYS_set_tid_address()
+{
+	return 0;//-ENOSYS;
+}
+
+__attribute__((weak))
+void SYS_mmap2()
+{
+	return 0;//-ENOSYS;
+}
+
+__attribute__((weak))
+void SYS_exit_group()
+{
+	ext_ker();
+}
+
+__attribute__((weak))
+void SYS_exit()
+{
+	ext_ker();
+}
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/arch/rx630_gcc/start.S
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/arch/rx630_gcc/start.S	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/arch/rx630_gcc/start.S	(revision 342)
@@ -144,5 +144,5 @@
 	;
 kernel_link:
-	bra.a	_sta_ker					; --> _sta_ker()
+	bra.a	__sta_ker					; --> __sta_ker()
 
 	.end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/include/t_syslog.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/include/t_syslog.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/include/t_syslog.h	(revision 342)
@@ -140,7 +140,4 @@
 
 #ifndef TOPPERS_OMIT_SYSLOG
-#ifdef TOPPERS_OMIT_TECS
-#define tSysLog_eSysLog_write syslog_wri_log
-#endif
 
 /*
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/sample/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/sample/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/sample/Makefile	(revision 342)
@@ -362,5 +362,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/syssvc/tSerialPortMain.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/syssvc/tSerialPortMain.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/syssvc/tSerialPortMain.c	(revision 342)
@@ -504,4 +504,5 @@
 	pk_rpor->reacnt = VAR_receiveCount;
 	pk_rpor->wricnt = VAR_sendCount;
+	pk_rpor->wbufsz = ATTR_sendBufferSize;
 	return(E_OK);
 }
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/net/ethernet.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/net/ethernet.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/net/ethernet.c	(revision 342)
@@ -29,5 +29,5 @@
  *  接的または間接的に生じたいかなる損害に関しても，その責任を負わない．
  * 
- *  @(#) $Id$
+ *  @(#) $Id: ethernet.c 1524 2018-04-25 13:48:23Z coas-nagasima $
  */
 
@@ -195,72 +195,83 @@
 
 /**
- * Called by a driver when its link goes up
- */
-void ether_set_link_up()
-{
-  if (!(ether_ifnet.flags & IF_FLAG_LINK_UP)) {
-    ether_ifnet.flags |= IF_FLAG_LINK_UP;
-
-    if (ether_ifnet.flags & IF_FLAG_UP) {
-#if LWIP_ARP
-      /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */ 
-      if (ether_ifnet.flags & IF_FLAG_ETHARP) {
-        etharp_gratuitous(&ether_ifnet);
-      }
-#endif /* LWIP_ARP */
-
-#if LWIP_IGMP
-      /* resend IGMP memberships */
-      if (ether_ifnet._flags & IF_FLAG_IGMP) {
-        igmp_report_groups(&ether_ifnet);
-      }
-#endif /* LWIP_IGMP */
-    }
-    if (ether_ifnet.link_callback) {
-      (ether_ifnet.link_callback)(&ether_ifnet);
-    }
-  }
-}
+ * ether_set_link_up -- リンクしたときにNICから呼び出される
+ */
+void
+ether_set_link_up()
+{
+	if (!(ether_ifnet.flags & IF_FLAG_LINK_UP)) {
+		ether_ifnet.flags |= IF_FLAG_LINK_UP;
+
+		if (ether_ifnet.flags & IF_FLAG_UP) {
+#if defined(_IP4_CFG) && defined(SUPPORT_ETHER)
+			/* ARP再構築？ */
+#endif /* #if defined(_IP4_CFG) && defined(SUPPORT_ETHER) */
+
+#ifdef SUPPORT_IGMP
+			/* IGMP参加 */
+#endif /* #ifdef SUPPORT_IGMP */
+			}
+		if (ether_ifnet.link_callback) {
+			(ether_ifnet.link_callback)(&ether_ifnet);
+			}
+		}
+	}
 
 /**
- * Called by a driver when its link goes down
- */
-void ether_set_link_down()
-{
-  if (ether_ifnet.flags & IF_FLAG_LINK_UP) {
-    ether_ifnet.flags &= ~IF_FLAG_LINK_UP;
-    if (ether_ifnet.link_callback) {
-      (ether_ifnet.link_callback)(&ether_ifnet);
-    }
-  }
-}
-
-void ether_set_up()
-{
-  if (!(ether_ifnet.flags & IF_FLAG_UP)) {
-    ether_ifnet.flags |= IF_FLAG_UP;
-    if (ether_ifnet.link_callback) {
-      (ether_ifnet.link_callback)(&ether_ifnet);
-    }
-  }
-}
-
-void ether_set_down()
-{
-  if (ether_ifnet.flags & IF_FLAG_UP) {
-    ether_ifnet.flags &= ~IF_FLAG_UP;
-    if (ether_ifnet.link_callback) {
-      (ether_ifnet.link_callback)(&ether_ifnet);
-    }
-  }
-}
-
-/**
- * Set callback to be called when link is brought up/down
- */
-void ether_set_link_callback(ether_status_callback_fn link_callback)
+ * ether_set_link_up -- リンクが切断したときにNICから呼び出される
+ */
+void
+ether_set_link_down()
+{
+	if (ether_ifnet.flags & IF_FLAG_LINK_UP) {
+		ether_ifnet.flags &= ~IF_FLAG_LINK_UP;
+		if (ether_ifnet.link_callback) {
+			(ether_ifnet.link_callback)(&ether_ifnet);
+			}
+		}
+	}
+
+/*
+ * ether_set_up -- DHCPでアドレスが設定されたとき呼び出される
+ */
+
+void
+ether_set_up()
+{
+	if (!(ether_ifnet.flags & IF_FLAG_UP)) {
+		ether_ifnet.flags |= IF_FLAG_UP;
+		if (ether_ifnet.link_callback) {
+			(ether_ifnet.link_callback)(&ether_ifnet);
+			}
+		}
+	}
+
+/*
+ * ether_set_down -- DHCPでアドレスが解放されたとき呼び出される
+ */
+
+void
+ether_set_down()
+{
+	if (ether_ifnet.flags & IF_FLAG_UP) {
+		ether_ifnet.flags &= ~IF_FLAG_UP;
+		if (ether_ifnet.link_callback) {
+			(ether_ifnet.link_callback)(&ether_ifnet);
+			}
+		}
+	}
+
+/*
+ * ether_set_link_callback -- リンク状態変化時のコールバック登録
+ */
+
+void
+ether_set_link_callback(ether_status_callback_fn link_callback)
 {
 	ether_ifnet.link_callback = link_callback;
-}
+	if (ether_ifnet.link_callback) {
+		(ether_ifnet.link_callback)(&ether_ifnet);
+		}
+	}
 
 /*
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/net/ethernet.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/net/ethernet.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/net/ethernet.h	(revision 342)
@@ -29,5 +29,5 @@
  *  接的または間接的に生じたいかなる損害に関しても，その責任を負わない．
  * 
- *  @(#) $Id$
+ *  @(#) $Id: ethernet.h 1524 2018-04-25 13:48:23Z coas-nagasima $
  */
 
@@ -311,5 +311,4 @@
 extern uint32_t ether_srand (void);
 
-/** Function prototype for netif status- or link-callback functions. */
 typedef void (*ether_status_callback_fn)(T_IFNET *ether);
 extern void ether_set_link_callback(ether_status_callback_fn link_callback);
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/netapp/dhcp4_cli_var.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/netapp/dhcp4_cli_var.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tinet/netapp/dhcp4_cli_var.h	(revision 342)
@@ -165,5 +165,5 @@
 	ER_UINT		error;		/* エラー・データ長		*/
 	ID			tskid;		/* タスクID */
-	ID		cepid;		/* CEP ID			*/
+	ID			cepid;		/* CEP ID			*/
 	uint32_t	xid;		/* トランザクション ID		*/
 	uint16_t	flags;		/* 各種フラグ			*/
Index: asp3_tinet_ecnl_rx/trunk/bnep_bridge/Debug/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/bnep_bridge/Debug/Makefile	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/bnep_bridge/Debug/Makefile	(revision 342)
@@ -383,5 +383,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
Index: asp3_tinet_ecnl_rx/trunk/bnep_bridge/src/main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/bnep_bridge/src/main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/bnep_bridge/src/main.c	(revision 342)
@@ -143,6 +143,4 @@
 
 ntshell_t ntshell;
-#if !defined(_MSC_VER)
-void _start_c(long *p);
 
 /*
@@ -150,13 +148,4 @@
  */
 void main_task(intptr_t exinf)
-{
-	long args[] = {
-		1,
-		(long)"ntshell",
-	};
-	_start_c(args);
-}
-
-int main(int argc, char **argv)
 {
 	// NAP mode
@@ -168,17 +157,6 @@
 	ntshell_set_prompt(&ntshell, "NTShell>");
 	ntshell_execute(&ntshell);
-
-	return 0;
-}
-#else
-void main_task(intptr_t exinf)
-{
-	main_initialize();
-
-	ntshell_init(&ntshell, uart_read, uart_write, cmd_execute, NULL);
-	ntshell_set_prompt(&ntshell, "NTShell>");
-	ntshell_execute(&ntshell);
-}
-#endif
+}
+
 /*
  * 初期化
@@ -192,5 +170,5 @@
 	fno.lfsize = _MAX_LFN + 1;
 #endif
-	ER ret2;
+	ER ret;
 
 	ntshell_task_init();
@@ -226,6 +204,6 @@
 	usbhost_init(USBHOST_TASK);
 
-	ret2 = get_tim(&main_obj.now);
-	if (ret2 != E_OK) {
+	ret = get_tim(&main_obj.now);
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "get_tim");
 		ext_tsk();
Index: asp3_tinet_ecnl_rx/trunk/bnep_bridge/src/main.cfg
===================================================================
--- asp3_tinet_ecnl_rx/trunk/bnep_bridge/src/main.cfg	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/bnep_bridge/src/main.cfg	(revision 342)
@@ -48,5 +48,5 @@
 INCLUDE("ntshell_main.cfg");
 
-CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
+CRE_TSK(MAIN_TASK, { TA_NULL, 0, main_task, MAIN_PRIORITY, MAIN_STACK_SIZE, NULL });
 CRE_TSK(ETHER_INPUT_TASK,  { TA_ACT, 0, ether_input_task,  ETHER_INPUT_PRIORITY,  ETHER_INPUT_STACK_SIZE,  NULL });
 CRE_DTQ(MAIN_DATAQUEUE, { TA_TFIFO, NUM_MAIN_DATAQUEUE, NULL });
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/arch/rx/crt_arch.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/arch/rx/crt_arch.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/arch/rx/crt_arch.h	(revision 342)
@@ -0,0 +1,1 @@
+#define main sta_ker
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/arch/rx/syscall_arch.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/arch/rx/syscall_arch.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/arch/rx/syscall_arch.h	(revision 342)
@@ -85,39 +85,14 @@
 
 __attribute__((visibility("hidden")))
-long __syscall(syscall_arg_t, ...);
+long __syscall_ret(unsigned long), __syscall_nr(long nr, ...);
 
-static inline long __syscall0(long n)
-{
-	return __syscall(n);
-}
+#define __syscall(n, ...) n(__VA_ARGS__)
+#define __syscall_cp(n, ...) n(__VA_ARGS__)
+#define syscall(n, ...) __syscall_ret(__syscall(n, __VA_ARGS__))
+#define syscall_cp(n, ...) __syscall_ret(__syscall_cp(n, __VA_ARGS__))
 
-static inline long __syscall1(long n, long a)
-{
-	return __syscall(n, a);
-}
-
-static inline long __syscall2(long n, long a, long b)
-{
-	return __syscall(n, a, b);
-}
-
-static inline long __syscall3(long n, long a, long b, long c)
-{
-	return __syscall(n, a, b, c);
-}
-
-static inline long __syscall4(long n, long a, long b, long c, long d)
-{
-	return __syscall(n, a, b, c, d);
-}
-
-static inline long __syscall5(long n, long a, long b, long c, long d, long e)
-{
-	return __syscall(n, a, b, c, d, e);
-}
-
-static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
-{
-	return __syscall(n, a, b, c, d, e, f);
-}
+#define __syscall2(n, ...) n(__VA_ARGS__)
+#define __syscall3(n, ...) n(__VA_ARGS__)
+#define __syscall_cp2(n, ...) n(__VA_ARGS__)
+#define __syscall_cp3(n, ...) n(__VA_ARGS__)
 #endif
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/include/bits/syscall.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/include/bits/syscall.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/include/bits/syscall.h	(revision 342)
@@ -358,357 +358,711 @@
 #define __ARM_NR_set_tls	0x0f0005
 
-#define SYS_restart_syscall	0
-#define SYS_exit	1
-#define SYS_fork	2
-#define SYS_read	3
-#define SYS_write	4
-#define SYS_open	5
-#define SYS_close	6
-#define SYS_creat	8
-#define SYS_link	9
-#define SYS_unlink	10
-#define SYS_execve	11
-#define SYS_chdir	12
-#define SYS_mknod	14
-#define SYS_chmod	15
-#define SYS_lchown	16
-#define SYS_lseek	19
-#define SYS_getpid	20
-#define SYS_mount	21
-#define SYS_setuid	23
-#define SYS_getuid	24
-#define SYS_ptrace	26
-#define SYS_pause	29
-#define SYS_access	33
-#define SYS_nice	34
-#define SYS_sync	36
-#define SYS_kill	37
-#define SYS_rename	38
-#define SYS_mkdir	39
-#define SYS_rmdir	40
-#define SYS_dup	41
-#define SYS_pipe	42
-#define SYS_times	43
-#define SYS_brk	45
-#define SYS_setgid	46
-#define SYS_getgid	47
-#define SYS_geteuid	49
-#define SYS_getegid	50
-#define SYS_acct	51
-#define SYS_umount2	52
-#define SYS_ioctl	54
-#define SYS_fcntl	55
-#define SYS_setpgid	57
-#define SYS_umask	60
-#define SYS_chroot	61
-#define SYS_ustat	62
-#define SYS_dup2	63
-#define SYS_getppid	64
-#define SYS_getpgrp	65
-#define SYS_setsid	66
-#define SYS_sigaction	67
-#define SYS_setreuid	70
-#define SYS_setregid	71
-#define SYS_sigsuspend	72
-#define SYS_sigpending	73
-#define SYS_sethostname	74
-#define SYS_setrlimit	75
-#define SYS_getrusage	77
-#define SYS_gettimeofday	78
-#define SYS_settimeofday	79
-#define SYS_getgroups	80
-#define SYS_setgroups	81
-#define SYS_symlink	83
-#define SYS_readlink	85
-#define SYS_uselib	86
-#define SYS_swapon	87
-#define SYS_reboot	88
-#define SYS_munmap	91
-#define SYS_truncate	92
-#define SYS_ftruncate	93
-#define SYS_fchmod	94
-#define SYS_fchown	95
-#define SYS_getpriority	96
-#define SYS_setpriority	97
-#define SYS_statfs	99
-#define SYS_fstatfs	100
-#define SYS_syslog	103
-#define SYS_setitimer	104
-#define SYS_getitimer	105
-#define SYS_stat	106
-#define SYS_lstat	107
-#define SYS_fstat	108
-#define SYS_vhangup	111
-#define SYS_wait4	114
-#define SYS_swapoff	115
-#define SYS_sysinfo	116
-#define SYS_fsync	118
-#define SYS_sigreturn	119
-#define SYS_clone	120
-#define SYS_setdomainname	121
-#define SYS_uname	122
-#define SYS_adjtimex	124
-#define SYS_mprotect	125
-#define SYS_sigprocmask	126
-#define SYS_init_module	128
-#define SYS_delete_module	129
-#define SYS_quotactl	131
-#define SYS_getpgid	132
-#define SYS_fchdir	133
-#define SYS_bdflush	134
-#define SYS_sysfs	135
-#define SYS_personality	136
-#define SYS_setfsuid	138
-#define SYS_setfsgid	139
-#define SYS__llseek	140
-#define SYS_getdents	141
-#define SYS__newselect	142
-#define SYS_flock	143
-#define SYS_msync	144
-#define SYS_readv	145
-#define SYS_writev	146
-#define SYS_getsid	147
-#define SYS_fdatasync	148
-#define SYS__sysctl	149
-#define SYS_mlock	150
-#define SYS_munlock	151
-#define SYS_mlockall	152
-#define SYS_munlockall	153
-#define SYS_sched_setparam	154
-#define SYS_sched_getparam	155
-#define SYS_sched_setscheduler	156
-#define SYS_sched_getscheduler	157
-#define SYS_sched_yield	158
-#define SYS_sched_get_priority_max	159
-#define SYS_sched_get_priority_min	160
-#define SYS_sched_rr_get_interval	161
-#define SYS_nanosleep	162
-#define SYS_mremap	163
-#define SYS_setresuid	164
-#define SYS_getresuid	165
-#define SYS_poll	168
-#define SYS_nfsservctl	169
-#define SYS_setresgid	170
-#define SYS_getresgid	171
-#define SYS_prctl	172
-#define SYS_rt_sigreturn	173
-#define SYS_rt_sigaction	174
-#define SYS_rt_sigprocmask	175
-#define SYS_rt_sigpending	176
-#define SYS_rt_sigtimedwait	177
-#define SYS_rt_sigqueueinfo	178
-#define SYS_rt_sigsuspend	179
-#define SYS_pread64	180
-#define SYS_pwrite64	181
-#define SYS_chown	182
-#define SYS_getcwd	183
-#define SYS_capget	184
-#define SYS_capset	185
-#define SYS_sigaltstack	186
-#define SYS_sendfile	187
-#define SYS_vfork	190
-#define SYS_ugetrlimit	191
-#define SYS_mmap2	192
-#define SYS_truncate64	193
-#define SYS_ftruncate64	194
-#define SYS_stat64	195
-#define SYS_lstat64	196
-#define SYS_fstat64	197
-#define SYS_lchown32	198
-#define SYS_getuid32	199
-#define SYS_getgid32	200
-#define SYS_geteuid32	201
-#define SYS_getegid32	202
-#define SYS_setreuid32	203
-#define SYS_setregid32	204
-#define SYS_getgroups32	205
-#define SYS_setgroups32	206
-#define SYS_fchown32	207
-#define SYS_setresuid32	208
-#define SYS_getresuid32	209
-#define SYS_setresgid32	210
-#define SYS_getresgid32	211
-#define SYS_chown32	212
-#define SYS_setuid32	213
-#define SYS_setgid32	214
-#define SYS_setfsuid32	215
-#define SYS_setfsgid32	216
-#define SYS_getdents64	217
-#define SYS_pivot_root	218
-#define SYS_mincore	219
-#define SYS_madvise	220
-#define SYS_fcntl64	221
-#define SYS_gettid	224
-#define SYS_readahead	225
-#define SYS_setxattr	226
-#define SYS_lsetxattr	227
-#define SYS_fsetxattr	228
-#define SYS_getxattr	229
-#define SYS_lgetxattr	230
-#define SYS_fgetxattr	231
-#define SYS_listxattr	232
-#define SYS_llistxattr	233
-#define SYS_flistxattr	234
-#define SYS_removexattr	235
-#define SYS_lremovexattr	236
-#define SYS_fremovexattr	237
-#define SYS_tkill	238
-#define SYS_sendfile64	239
-#define SYS_futex	240
-#define SYS_sched_setaffinity	241
-#define SYS_sched_getaffinity	242
-#define SYS_io_setup	243
-#define SYS_io_destroy	244
-#define SYS_io_getevents	245
-#define SYS_io_submit	246
-#define SYS_io_cancel	247
-#define SYS_exit_group	248
-#define SYS_lookup_dcookie	249
-#define SYS_epoll_create	250
-#define SYS_epoll_ctl	251
-#define SYS_epoll_wait	252
-#define SYS_remap_file_pages	253
-#define SYS_set_tid_address	256
-#define SYS_timer_create	257
-#define SYS_timer_settime	258
-#define SYS_timer_gettime	259
-#define SYS_timer_getoverrun	260
-#define SYS_timer_delete	261
-#define SYS_clock_settime	262
-#define SYS_clock_gettime	263
-#define SYS_clock_getres	264
-#define SYS_clock_nanosleep	265
-#define SYS_statfs64	266
-#define SYS_fstatfs64	267
-#define SYS_tgkill	268
-#define SYS_utimes	269
-#define SYS_fadvise64_64	270
-#define SYS_pciconfig_iobase	271
-#define SYS_pciconfig_read	272
-#define SYS_pciconfig_write	273
-#define SYS_mq_open	274
-#define SYS_mq_unlink	275
-#define SYS_mq_timedsend	276
-#define SYS_mq_timedreceive	277
-#define SYS_mq_notify	278
-#define SYS_mq_getsetattr	279
-#define SYS_waitid	280
-#define SYS_socket	281
-#define SYS_bind	282
-#define SYS_connect	283
-#define SYS_listen	284
-#define SYS_accept	285
-#define SYS_getsockname	286
-#define SYS_getpeername	287
-#define SYS_socketpair	288
-#define SYS_send	289
-#define SYS_sendto	290
-#define SYS_recv	291
-#define SYS_recvfrom	292
-#define SYS_shutdown	293
-#define SYS_setsockopt	294
-#define SYS_getsockopt	295
-#define SYS_sendmsg	296
-#define SYS_recvmsg	297
-#define SYS_semop	298
-#define SYS_semget	299
-#define SYS_semctl	300
-#define SYS_msgsnd	301
-#define SYS_msgrcv	302
-#define SYS_msgget	303
-#define SYS_msgctl	304
-#define SYS_shmat	305
-#define SYS_shmdt	306
-#define SYS_shmget	307
-#define SYS_shmctl	308
-#define SYS_add_key	309
-#define SYS_request_key	310
-#define SYS_keyctl	311
-#define SYS_semtimedop	312
-#define SYS_vserver	313
-#define SYS_ioprio_set	314
-#define SYS_ioprio_get	315
-#define SYS_inotify_init	316
-#define SYS_inotify_add_watch	317
-#define SYS_inotify_rm_watch	318
-#define SYS_mbind	319
-#define SYS_get_mempolicy	320
-#define SYS_set_mempolicy	321
-#define SYS_openat	322
-#define SYS_mkdirat	323
-#define SYS_mknodat	324
-#define SYS_fchownat	325
-#define SYS_futimesat	326
-#define SYS_fstatat64	327
-#define SYS_unlinkat	328
-#define SYS_renameat	329
-#define SYS_linkat	330
-#define SYS_symlinkat	331
-#define SYS_readlinkat	332
-#define SYS_fchmodat	333
-#define SYS_faccessat	334
-#define SYS_pselect6	335
-#define SYS_ppoll	336
-#define SYS_unshare	337
-#define SYS_set_robust_list	338
-#define SYS_get_robust_list	339
-#define SYS_splice	340
-#define SYS_sync_file_range2	341
-#define SYS_tee	342
-#define SYS_vmsplice	343
-#define SYS_move_pages	344
-#define SYS_getcpu	345
-#define SYS_epoll_pwait	346
-#define SYS_kexec_load	347
-#define SYS_utimensat	348
-#define SYS_signalfd	349
-#define SYS_timerfd_create	350
-#define SYS_eventfd	351
-#define SYS_fallocate	352
-#define SYS_timerfd_settime	353
-#define SYS_timerfd_gettime	354
-#define SYS_signalfd4	355
-#define SYS_eventfd2	356
-#define SYS_epoll_create1	357
-#define SYS_dup3	358
-#define SYS_pipe2	359
-#define SYS_inotify_init1	360
-#define SYS_preadv	361
-#define SYS_pwritev	362
-#define SYS_rt_tgsigqueueinfo	363
-#define SYS_perf_event_open	364
-#define SYS_recvmmsg	365
-#define SYS_accept4	366
-#define SYS_fanotify_init	367
-#define SYS_fanotify_mark	368
-#define SYS_prlimit64	369
-#define SYS_name_to_handle_at	370
-#define SYS_open_by_handle_at	371
-#define SYS_clock_adjtime	372
-#define SYS_syncfs	373
-#define SYS_sendmmsg	374
-#define SYS_setns	375
-#define SYS_process_vm_readv	376
-#define SYS_process_vm_writev	377
-#define SYS_kcmp		378
-#define SYS_finit_module	379
-#define SYS_sched_setattr	380
-#define SYS_sched_getattr	381
-#define SYS_renameat2	382
-#define SYS_seccomp	383
-#define SYS_getrandom	384
-#define SYS_memfd_create	385
-#define SYS_bpf	386
-#define SYS_execveat	387
-#define SYS_userfaultfd	388
-#define SYS_membarrier		389
-#define SYS_mlock2		390
-#define SYS_copy_file_range	391
-#define SYS_preadv2	392
-#define SYS_pwritev2	393
-#define SYS_pkey_mprotect	394
-#define SYS_pkey_alloc	395
-#define SYS_pkey_free	396
+#define SYS_restart_syscall SYS_restart_syscall
+long SYS_restart_syscall();
+#define SYS_exit SYS_exit
+long SYS_exit();
+#define SYS_fork SYS_fork
+long SYS_fork();
+#define SYS_read SYS_read
+long SYS_read();
+#define SYS_write SYS_write
+long SYS_write();
+#define SYS_open SYS_open
+long SYS_open();
+#define SYS_close SYS_close
+long SYS_close();
+#define SYS_creat SYS_creat
+long SYS_creat();
+#define SYS_link SYS_link
+long SYS_link();
+#define SYS_unlink SYS_unlink
+long SYS_unlink();
+#define SYS_execve SYS_execve
+long SYS_execve();
+#define SYS_chdir SYS_chdir
+long SYS_chdir();
+#define SYS_mknod SYS_mknod
+long SYS_mknod();
+#define SYS_chmod SYS_chmod
+long SYS_chmod();
+#define SYS_lchown SYS_lchown
+long SYS_lchown();
+#define SYS_lseek SYS_lseek
+long SYS_lseek();
+#define SYS_getpid SYS_getpid
+long SYS_getpid();
+#define SYS_mount SYS_mount
+long SYS_mount();
+#define SYS_setuid SYS_setuid
+long SYS_setuid();
+#define SYS_getuid SYS_getuid
+long SYS_getuid();
+#define SYS_ptrace SYS_ptrace
+long SYS_ptrace();
+#define SYS_pause SYS_pause
+long SYS_pause();
+#define SYS_access SYS_access
+long SYS_access();
+#define SYS_nice SYS_nice
+long SYS_nice();
+#define SYS_sync SYS_sync
+long SYS_sync();
+#define SYS_kill SYS_kill
+long SYS_kill();
+#define SYS_rename SYS_rename
+long SYS_rename();
+#define SYS_mkdir SYS_mkdir
+long SYS_mkdir();
+#define SYS_rmdir SYS_rmdir
+long SYS_rmdir();
+#define SYS_dup SYS_dup
+long SYS_dup();
+#define SYS_pipe SYS_pipe
+long SYS_pipe();
+#define SYS_times SYS_times
+long SYS_times();
+#define SYS_brk SYS_brk
+long SYS_brk();
+#define SYS_setgid SYS_setgid
+long SYS_setgid();
+#define SYS_getgid SYS_getgid
+long SYS_getgid();
+#define SYS_geteuid SYS_geteuid
+long SYS_geteuid();
+#define SYS_getegid SYS_getegid
+long SYS_getegid();
+#define SYS_acct SYS_acct
+long SYS_acct();
+#define SYS_umount2 SYS_umount2
+long SYS_umount2();
+#define SYS_ioctl SYS_ioctl
+long SYS_ioctl();
+#define SYS_fcntl SYS_fcntl
+long SYS_fcntl();
+#define SYS_setpgid SYS_setpgid
+long SYS_setpgid();
+#define SYS_umask SYS_umask
+long SYS_umask();
+#define SYS_chroot SYS_chroot
+long SYS_chroot();
+#define SYS_ustat SYS_ustat
+long SYS_ustat();
+#define SYS_dup2 SYS_dup2
+long SYS_dup2();
+#define SYS_getppid SYS_getppid
+long SYS_getppid();
+#define SYS_getpgrp SYS_getpgrp
+long SYS_getpgrp();
+#define SYS_setsid SYS_setsid
+long SYS_setsid();
+#define SYS_sigaction SYS_sigaction
+long SYS_sigaction();
+#define SYS_setreuid SYS_setreuid
+long SYS_setreuid();
+#define SYS_setregid SYS_setregid
+long SYS_setregid();
+#define SYS_sigsuspend SYS_sigsuspend
+long SYS_sigsuspend();
+#define SYS_sigpending SYS_sigpending
+long SYS_sigpending();
+#define SYS_sethostname SYS_sethostname
+long SYS_sethostname();
+#define SYS_setrlimit SYS_setrlimit
+long SYS_setrlimit();
+#define SYS_getrusage SYS_getrusage
+long SYS_getrusage();
+#define SYS_gettimeofday SYS_gettimeofday
+long SYS_gettimeofday();
+#define SYS_settimeofday SYS_settimeofday
+long SYS_settimeofday();
+#define SYS_getgroups SYS_getgroups
+long SYS_getgroups();
+#define SYS_setgroups SYS_setgroups
+long SYS_setgroups();
+#define SYS_symlink SYS_symlink
+long SYS_symlink();
+#define SYS_readlink SYS_readlink
+long SYS_readlink();
+#define SYS_uselib SYS_uselib
+long SYS_uselib();
+#define SYS_swapon SYS_swapon
+long SYS_swapon();
+#define SYS_reboot SYS_reboot
+long SYS_reboot();
+#define SYS_munmap SYS_munmap
+long SYS_munmap();
+#define SYS_truncate SYS_truncate
+long SYS_truncate();
+#define SYS_ftruncate SYS_ftruncate
+long SYS_ftruncate();
+#define SYS_fchmod SYS_fchmod
+long SYS_fchmod();
+#define SYS_fchown SYS_fchown
+long SYS_fchown();
+#define SYS_getpriority SYS_getpriority
+long SYS_getpriority();
+#define SYS_setpriority SYS_setpriority
+long SYS_setpriority();
+#define SYS_statfs SYS_statfs
+long SYS_statfs();
+#define SYS_fstatfs SYS_fstatfs
+long SYS_fstatfs();
+#define SYS_syslog SYS_syslog
+long SYS_syslog();
+#define SYS_setitimer SYS_setitimer
+long SYS_setitimer();
+#define SYS_getitimer SYS_getitimer
+long SYS_getitimer();
+#define SYS_stat SYS_stat
+long SYS_stat();
+#define SYS_lstat SYS_lstat
+long SYS_lstat();
+#define SYS_fstat SYS_fstat
+long SYS_fstat();
+#define SYS_vhangup SYS_vhangup
+long SYS_vhangup();
+#define SYS_wait4 SYS_wait4
+long SYS_wait4();
+#define SYS_swapoff SYS_swapoff
+long SYS_swapoff();
+#define SYS_sysinfo SYS_sysinfo
+long SYS_sysinfo();
+#define SYS_fsync SYS_fsync
+long SYS_fsync();
+#define SYS_sigreturn SYS_sigreturn
+long SYS_sigreturn();
+#define SYS_clone SYS_clone
+long SYS_clone();
+#define SYS_setdomainname SYS_setdomainname
+long SYS_setdomainname();
+#define SYS_uname SYS_uname
+long SYS_uname();
+#define SYS_adjtimex SYS_adjtimex
+long SYS_adjtimex();
+#define SYS_mprotect SYS_mprotect
+long SYS_mprotect();
+#define SYS_sigprocmask SYS_sigprocmask
+long SYS_sigprocmask();
+#define SYS_init_module SYS_init_module
+long SYS_init_module();
+#define SYS_delete_module SYS_delete_module
+long SYS_delete_module();
+#define SYS_quotactl SYS_quotactl
+long SYS_quotactl();
+#define SYS_getpgid SYS_getpgid
+long SYS_getpgid();
+#define SYS_fchdir SYS_fchdir
+long SYS_fchdir();
+#define SYS_bdflush SYS_bdflush
+long SYS_bdflush();
+#define SYS_sysfs SYS_sysfs
+long SYS_sysfs();
+#define SYS_personality SYS_personality
+long SYS_personality();
+#define SYS_setfsuid SYS_setfsuid
+long SYS_setfsuid();
+#define SYS_setfsgid SYS_setfsgid
+long SYS_setfsgid();
+#define SYS__llseek SYS__llseek
+long SYS__llseek();
+#define SYS_getdents SYS_getdents
+long SYS_getdents();
+#define SYS__newselect SYS__newselect
+long SYS__newselect();
+#define SYS_flock SYS_flock
+long SYS_flock();
+#define SYS_msync SYS_msync
+long SYS_msync();
+#define SYS_readv SYS_readv
+long SYS_readv();
+#define SYS_writev SYS_writev
+long SYS_writev();
+#define SYS_getsid SYS_getsid
+long SYS_getsid();
+#define SYS_fdatasync SYS_fdatasync
+long SYS_fdatasync();
+#define SYS__sysctl SYS__sysctl
+long SYS__sysctl();
+#define SYS_mlock SYS_mlock
+long SYS_mlock();
+#define SYS_munlock SYS_munlock
+long SYS_munlock();
+#define SYS_mlockall SYS_mlockall
+long SYS_mlockall();
+#define SYS_munlockall SYS_munlockall
+long SYS_munlockall();
+#define SYS_sched_setparam SYS_sched_setparam
+long SYS_sched_setparam();
+#define SYS_sched_getparam SYS_sched_getparam
+long SYS_sched_getparam();
+#define SYS_sched_setscheduler SYS_sched_setscheduler
+long SYS_sched_setscheduler();
+#define SYS_sched_getscheduler SYS_sched_getscheduler
+long SYS_sched_getscheduler();
+#define SYS_sched_yield SYS_sched_yield
+long SYS_sched_yield();
+#define SYS_sched_get_priority_max SYS_sched_get_priority_max
+long SYS_sched_get_priority_max();
+#define SYS_sched_get_priority_min SYS_sched_get_priority_min
+long SYS_sched_get_priority_min();
+#define SYS_sched_rr_get_interval SYS_sched_rr_get_interval
+long SYS_sched_rr_get_interval();
+#define SYS_nanosleep SYS_nanosleep
+long SYS_nanosleep();
+#define SYS_mremap SYS_mremap
+long SYS_mremap();
+#define SYS_setresuid SYS_setresuid
+long SYS_setresuid();
+#define SYS_getresuid SYS_getresuid
+long SYS_getresuid();
+#define SYS_poll SYS_poll
+long SYS_poll();
+#define SYS_nfsservctl SYS_nfsservctl
+long SYS_nfsservctl();
+#define SYS_setresgid SYS_setresgid
+long SYS_setresgid();
+#define SYS_getresgid SYS_getresgid
+long SYS_getresgid();
+#define SYS_prctl SYS_prctl
+long SYS_prctl();
+#define SYS_rt_sigreturn SYS_rt_sigreturn
+long SYS_rt_sigreturn();
+#define SYS_rt_sigaction SYS_rt_sigaction
+long SYS_rt_sigaction();
+#define SYS_rt_sigprocmask SYS_rt_sigprocmask
+long SYS_rt_sigprocmask();
+#define SYS_rt_sigpending SYS_rt_sigpending
+long SYS_rt_sigpending();
+#define SYS_rt_sigtimedwait SYS_rt_sigtimedwait
+long SYS_rt_sigtimedwait();
+#define SYS_rt_sigqueueinfo SYS_rt_sigqueueinfo
+long SYS_rt_sigqueueinfo();
+#define SYS_rt_sigsuspend SYS_rt_sigsuspend
+long SYS_rt_sigsuspend();
+#define SYS_pread64 SYS_pread64
+long SYS_pread64();
+#define SYS_pwrite64 SYS_pwrite64
+long SYS_pwrite64();
+#define SYS_chown SYS_chown
+long SYS_chown();
+#define SYS_getcwd SYS_getcwd
+long SYS_getcwd();
+#define SYS_capget SYS_capget
+long SYS_capget();
+#define SYS_capset SYS_capset
+long SYS_capset();
+#define SYS_sigaltstack SYS_sigaltstack
+long SYS_sigaltstack();
+#define SYS_sendfile SYS_sendfile
+long SYS_sendfile();
+#define SYS_vfork SYS_vfork
+long SYS_vfork();
+#define SYS_ugetrlimit SYS_ugetrlimit
+long SYS_ugetrlimit();
+#define SYS_mmap2 SYS_mmap2
+long SYS_mmap2();
+#define SYS_truncate64 SYS_truncate64
+long SYS_truncate64();
+#define SYS_ftruncate64 SYS_ftruncate64
+long SYS_ftruncate64();
+#define SYS_stat64 SYS_stat64
+long SYS_stat64();
+#define SYS_lstat64 SYS_lstat64
+long SYS_lstat64();
+#define SYS_fstat64 SYS_fstat64
+long SYS_fstat64();
+#define SYS_lchown32 SYS_lchown32
+long SYS_lchown32();
+#define SYS_getuid32 SYS_getuid32
+long SYS_getuid32();
+#define SYS_getgid32 SYS_getgid32
+long SYS_getgid32();
+#define SYS_geteuid32 SYS_geteuid32
+long SYS_geteuid32();
+#define SYS_getegid32 SYS_getegid32
+long SYS_getegid32();
+#define SYS_setreuid32 SYS_setreuid32
+long SYS_setreuid32();
+#define SYS_setregid32 SYS_setregid32
+long SYS_setregid32();
+#define SYS_getgroups32 SYS_getgroups32
+long SYS_getgroups32();
+#define SYS_setgroups32 SYS_setgroups32
+long SYS_setgroups32();
+#define SYS_fchown32 SYS_fchown32
+long SYS_fchown32();
+#define SYS_setresuid32 SYS_setresuid32
+long SYS_setresuid32();
+#define SYS_getresuid32 SYS_getresuid32
+long SYS_getresuid32();
+#define SYS_setresgid32 SYS_setresgid32
+long SYS_setresgid32();
+#define SYS_getresgid32 SYS_getresgid32
+long SYS_getresgid32();
+#define SYS_chown32 SYS_chown32
+long SYS_chown32();
+#define SYS_setuid32 SYS_setuid32
+long SYS_setuid32();
+#define SYS_setgid32 SYS_setgid32
+long SYS_setgid32();
+#define SYS_setfsuid32 SYS_setfsuid32
+long SYS_setfsuid32();
+#define SYS_setfsgid32 SYS_setfsgid32
+long SYS_setfsgid32();
+#define SYS_getdents64 SYS_getdents64
+long SYS_getdents64();
+#define SYS_pivot_root SYS_pivot_root
+long SYS_pivot_root();
+#define SYS_mincore SYS_mincore
+long SYS_mincore();
+#define SYS_madvise SYS_madvise
+long SYS_madvise();
+#define SYS_fcntl64 SYS_fcntl64
+long SYS_fcntl64();
+#define SYS_gettid SYS_gettid
+long SYS_gettid();
+#define SYS_readahead SYS_readahead
+long SYS_readahead();
+#define SYS_setxattr SYS_setxattr
+long SYS_setxattr();
+#define SYS_lsetxattr SYS_lsetxattr
+long SYS_lsetxattr();
+#define SYS_fsetxattr SYS_fsetxattr
+long SYS_fsetxattr();
+#define SYS_getxattr SYS_getxattr
+long SYS_getxattr();
+#define SYS_lgetxattr SYS_lgetxattr
+long SYS_lgetxattr();
+#define SYS_fgetxattr SYS_fgetxattr
+long SYS_fgetxattr();
+#define SYS_listxattr SYS_listxattr
+long SYS_listxattr();
+#define SYS_llistxattr SYS_llistxattr
+long SYS_llistxattr();
+#define SYS_flistxattr SYS_flistxattr
+long SYS_flistxattr();
+#define SYS_removexattr SYS_removexattr
+long SYS_removexattr();
+#define SYS_lremovexattr SYS_lremovexattr
+long SYS_lremovexattr();
+#define SYS_fremovexattr SYS_fremovexattr
+long SYS_fremovexattr();
+#define SYS_tkill SYS_tkill
+long SYS_tkill();
+#define SYS_sendfile64 SYS_sendfile64
+long SYS_sendfile64();
+#define SYS_futex SYS_futex
+long SYS_futex();
+#define SYS_sched_setaffinity SYS_sched_setaffinity
+long SYS_sched_setaffinity();
+#define SYS_sched_getaffinity SYS_sched_getaffinity
+long SYS_sched_getaffinity();
+#define SYS_io_setup SYS_io_setup
+long SYS_io_setup();
+#define SYS_io_destroy SYS_io_destroy
+long SYS_io_destroy();
+#define SYS_io_getevents SYS_io_getevents
+long SYS_io_getevents();
+#define SYS_io_submit SYS_io_submit
+long SYS_io_submit();
+#define SYS_io_cancel SYS_io_cancel
+long SYS_io_cancel();
+#define SYS_exit_group SYS_exit_group
+long SYS_exit_group();
+#define SYS_lookup_dcookie SYS_lookup_dcookie
+long SYS_lookup_dcookie();
+#define SYS_epoll_create SYS_epoll_create
+long SYS_epoll_create();
+#define SYS_epoll_ctl SYS_epoll_ctl
+long SYS_epoll_ctl();
+#define SYS_epoll_wait SYS_epoll_wait
+long SYS_epoll_wait();
+#define SYS_remap_file_pages SYS_remap_file_pages
+long SYS_remap_file_pages();
+#define SYS_set_tid_address SYS_set_tid_address
+long SYS_set_tid_address();
+#define SYS_timer_create SYS_timer_create
+long SYS_timer_create();
+#define SYS_timer_settime SYS_timer_settime
+long SYS_timer_settime();
+#define SYS_timer_gettime SYS_timer_gettime
+long SYS_timer_gettime();
+#define SYS_timer_getoverrun SYS_timer_getoverrun
+long SYS_timer_getoverrun();
+#define SYS_timer_delete SYS_timer_delete
+long SYS_timer_delete();
+#define SYS_clock_settime SYS_clock_settime
+long SYS_clock_settime();
+#define SYS_clock_gettime SYS_clock_gettime
+long SYS_clock_gettime();
+#define SYS_clock_getres SYS_clock_getres
+long SYS_clock_getres();
+#define SYS_clock_nanosleep SYS_clock_nanosleep
+long SYS_clock_nanosleep();
+#define SYS_statfs64 SYS_statfs64
+long SYS_statfs64();
+#define SYS_fstatfs64 SYS_fstatfs64
+long SYS_fstatfs64();
+#define SYS_tgkill SYS_tgkill
+long SYS_tgkill();
+#define SYS_utimes SYS_utimes
+long SYS_utimes();
+#define SYS_fadvise64_64 SYS_fadvise64_64
+long SYS_fadvise64_64();
+#define SYS_pciconfig_iobase SYS_pciconfig_iobase
+long SYS_pciconfig_iobase();
+#define SYS_pciconfig_read SYS_pciconfig_read
+long SYS_pciconfig_read();
+#define SYS_pciconfig_write SYS_pciconfig_write
+long SYS_pciconfig_write();
+#define SYS_mq_open SYS_mq_open
+long SYS_mq_open();
+#define SYS_mq_unlink SYS_mq_unlink
+long SYS_mq_unlink();
+#define SYS_mq_timedsend SYS_mq_timedsend
+long SYS_mq_timedsend();
+#define SYS_mq_timedreceive SYS_mq_timedreceive
+long SYS_mq_timedreceive();
+#define SYS_mq_notify SYS_mq_notify
+long SYS_mq_notify();
+#define SYS_mq_getsetattr SYS_mq_getsetattr
+long SYS_mq_getsetattr();
+#define SYS_waitid SYS_waitid
+long SYS_waitid();
+#define SYS_socket SYS_socket
+long SYS_socket();
+#define SYS_bind SYS_bind
+long SYS_bind();
+#define SYS_connect SYS_connect
+long SYS_connect();
+#define SYS_listen SYS_listen
+long SYS_listen();
+#define SYS_accept SYS_accept
+long SYS_accept();
+#define SYS_getsockname SYS_getsockname
+long SYS_getsockname();
+#define SYS_getpeername SYS_getpeername
+long SYS_getpeername();
+#define SYS_socketpair SYS_socketpair
+long SYS_socketpair();
+#define SYS_send SYS_send
+long SYS_send();
+#define SYS_sendto SYS_sendto
+long SYS_sendto();
+#define SYS_recv SYS_recv
+long SYS_recv();
+#define SYS_recvfrom SYS_recvfrom
+long SYS_recvfrom();
+#define SYS_shutdown SYS_shutdown
+long SYS_shutdown();
+#define SYS_setsockopt SYS_setsockopt
+long SYS_setsockopt();
+#define SYS_getsockopt SYS_getsockopt
+long SYS_getsockopt();
+#define SYS_sendmsg SYS_sendmsg
+long SYS_sendmsg();
+#define SYS_recvmsg SYS_recvmsg
+long SYS_recvmsg();
+#define SYS_semop SYS_semop
+long SYS_semop();
+#define SYS_semget SYS_semget
+long SYS_semget();
+#define SYS_semctl SYS_semctl
+long SYS_semctl();
+#define SYS_msgsnd SYS_msgsnd
+long SYS_msgsnd();
+#define SYS_msgrcv SYS_msgrcv
+long SYS_msgrcv();
+#define SYS_msgget SYS_msgget
+long SYS_msgget();
+#define SYS_msgctl SYS_msgctl
+long SYS_msgctl();
+#define SYS_shmat SYS_shmat
+long SYS_shmat();
+#define SYS_shmdt SYS_shmdt
+long SYS_shmdt();
+#define SYS_shmget SYS_shmget
+long SYS_shmget();
+#define SYS_shmctl SYS_shmctl
+long SYS_shmctl();
+#define SYS_add_key SYS_add_key
+long SYS_add_key();
+#define SYS_request_key SYS_request_key
+long SYS_request_key();
+#define SYS_keyctl SYS_keyctl
+long SYS_keyctl();
+#define SYS_semtimedop SYS_semtimedop
+long SYS_semtimedop();
+#define SYS_vserver SYS_vserver
+long SYS_vserver();
+#define SYS_ioprio_set SYS_ioprio_set
+long SYS_ioprio_set();
+#define SYS_ioprio_get SYS_ioprio_get
+long SYS_ioprio_get();
+#define SYS_inotify_init SYS_inotify_init
+long SYS_inotify_init();
+#define SYS_inotify_add_watch SYS_inotify_add_watch
+long SYS_inotify_add_watch();
+#define SYS_inotify_rm_watch SYS_inotify_rm_watch
+long SYS_inotify_rm_watch();
+#define SYS_mbind SYS_mbind
+long SYS_mbind();
+#define SYS_get_mempolicy SYS_get_mempolicy
+long SYS_get_mempolicy();
+#define SYS_set_mempolicy SYS_set_mempolicy
+long SYS_set_mempolicy();
+#define SYS_openat SYS_openat
+long SYS_openat();
+#define SYS_mkdirat SYS_mkdirat
+long SYS_mkdirat();
+#define SYS_mknodat SYS_mknodat
+long SYS_mknodat();
+#define SYS_fchownat SYS_fchownat
+long SYS_fchownat();
+#define SYS_futimesat SYS_futimesat
+long SYS_futimesat();
+#define SYS_fstatat64 SYS_fstatat64
+long SYS_fstatat64();
+#define SYS_unlinkat SYS_unlinkat
+long SYS_unlinkat();
+#define SYS_renameat SYS_renameat
+long SYS_renameat();
+#define SYS_linkat SYS_linkat
+long SYS_linkat();
+#define SYS_symlinkat SYS_symlinkat
+long SYS_symlinkat();
+#define SYS_readlinkat SYS_readlinkat
+long SYS_readlinkat();
+#define SYS_fchmodat SYS_fchmodat
+long SYS_fchmodat();
+#define SYS_faccessat SYS_faccessat
+long SYS_faccessat();
+#define SYS_pselect6 SYS_pselect6
+long SYS_pselect6();
+#define SYS_ppoll SYS_ppoll
+long SYS_ppoll();
+#define SYS_unshare SYS_unshare
+long SYS_unshare();
+#define SYS_set_robust_list SYS_set_robust_list
+long SYS_set_robust_list();
+#define SYS_get_robust_list SYS_get_robust_list
+long SYS_get_robust_list();
+#define SYS_splice SYS_splice
+long SYS_splice();
+#define SYS_sync_file_range2 SYS_sync_file_range2
+long SYS_sync_file_range2();
+#define SYS_tee SYS_tee
+long SYS_tee();
+#define SYS_vmsplice SYS_vmsplice
+long SYS_vmsplice();
+#define SYS_move_pages SYS_move_pages
+long SYS_move_pages();
+#define SYS_getcpu SYS_getcpu
+long SYS_getcpu();
+#define SYS_epoll_pwait SYS_epoll_pwait
+long SYS_epoll_pwait();
+#define SYS_kexec_load SYS_kexec_load
+long SYS_kexec_load();
+#define SYS_utimensat SYS_utimensat
+long SYS_utimensat();
+#define SYS_signalfd SYS_signalfd
+long SYS_signalfd();
+#define SYS_timerfd_create SYS_timerfd_create
+long SYS_timerfd_create();
+#define SYS_eventfd SYS_eventfd
+long SYS_eventfd();
+#define SYS_fallocate SYS_fallocate
+long SYS_fallocate();
+#define SYS_timerfd_settime SYS_timerfd_settime
+long SYS_timerfd_settime();
+#define SYS_timerfd_gettime SYS_timerfd_gettime
+long SYS_timerfd_gettime();
+#define SYS_signalfd4 SYS_signalfd4
+long SYS_signalfd4();
+#define SYS_eventfd2 SYS_eventfd2
+long SYS_eventfd2();
+#define SYS_epoll_create1 SYS_epoll_create1
+long SYS_epoll_create1();
+#define SYS_dup3 SYS_dup3
+long SYS_dup3();
+#define SYS_pipe2 SYS_pipe2
+long SYS_pipe2();
+#define SYS_inotify_init1 SYS_inotify_init1
+long SYS_inotify_init1();
+#define SYS_preadv SYS_preadv
+long SYS_preadv();
+#define SYS_pwritev SYS_pwritev
+long SYS_pwritev();
+#define SYS_rt_tgsigqueueinfo SYS_rt_tgsigqueueinfo
+long SYS_rt_tgsigqueueinfo();
+#define SYS_perf_event_open SYS_perf_event_open
+long SYS_perf_event_open();
+#define SYS_recvmmsg SYS_recvmmsg
+long SYS_recvmmsg();
+#define SYS_accept4 SYS_accept4
+long SYS_accept4();
+#define SYS_fanotify_init SYS_fanotify_init
+long SYS_fanotify_init();
+#define SYS_fanotify_mark SYS_fanotify_mark
+long SYS_fanotify_mark();
+#define SYS_prlimit64 SYS_prlimit64
+long SYS_prlimit64();
+#define SYS_name_to_handle_at SYS_name_to_handle_at
+long SYS_name_to_handle_at();
+#define SYS_open_by_handle_at SYS_open_by_handle_at
+long SYS_open_by_handle_at();
+#define SYS_clock_adjtime SYS_clock_adjtime
+long SYS_clock_adjtime();
+#define SYS_syncfs SYS_syncfs
+long SYS_syncfs();
+#define SYS_sendmmsg SYS_sendmmsg
+long SYS_sendmmsg();
+#define SYS_setns SYS_setns
+long SYS_setns();
+#define SYS_process_vm_readv SYS_process_vm_readv
+long SYS_process_vm_readv();
+#define SYS_process_vm_writev SYS_process_vm_writev
+long SYS_process_vm_writev();
+#define SYS_kcmp SYS_kcmp
+long SYS_kcmp();
+#define SYS_finit_module SYS_finit_module
+long SYS_finit_module();
+#define SYS_sched_setattr SYS_sched_setattr
+long SYS_sched_setattr();
+#define SYS_sched_getattr SYS_sched_getattr
+long SYS_sched_getattr();
+#define SYS_renameat2 SYS_renameat2
+long SYS_renameat2();
+#define SYS_seccomp SYS_seccomp
+long SYS_seccomp();
+#define SYS_getrandom SYS_getrandom
+long SYS_getrandom();
+#define SYS_memfd_create SYS_memfd_create
+long SYS_memfd_create();
+#define SYS_bpf SYS_bpf
+long SYS_bpf();
+#define SYS_execveat SYS_execveat
+long SYS_execveat();
+#define SYS_userfaultfd SYS_userfaultfd
+long SYS_userfaultfd();
+#define SYS_membarrier SYS_membarrier
+long SYS_membarrier();
+#define SYS_mlock2 SYS_mlock2
+long SYS_mlock2();
+#define SYS_copy_file_range SYS_copy_file_range
+long SYS_copy_file_range();
+#define SYS_preadv2 SYS_preadv2
+long SYS_preadv2();
+#define SYS_pwritev2 SYS_pwritev2
+long SYS_pwritev2();
+#define SYS_pkey_mprotect SYS_pkey_mprotect
+long SYS_pkey_mprotect();
+#define SYS_pkey_alloc SYS_pkey_alloc
+long SYS_pkey_alloc();
+#define SYS_pkey_free SYS_pkey_free
+long SYS_pkey_free();
 
-#define SYS_set_thread_area	397
-#define SYS_get_thread_area	398
+#define SYS_set_thread_area SYS_set_thread_area
+long SYS_set_thread_area();
+#define SYS_get_thread_area SYS_get_thread_area
+long SYS_get_thread_area();
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/internal/syscall.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/internal/syscall.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/internal/syscall.h	(revision 342)
@@ -21,5 +21,5 @@
 typedef long syscall_arg_t;
 #endif
-
+#if 0
 __attribute__((visibility("hidden")))
 long __syscall_ret(unsigned long), __syscall(syscall_arg_t, ...),
@@ -44,5 +44,5 @@
 #endif
 #define __syscall7(n,a,b,c,d,e,f,g) (__syscall)(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e),__scc(f),__scc(g))
-
+#endif
 #define __SYSCALL_NARGS_X(a,b,c,d,e,f,g,h,n,...) n
 #define __SYSCALL_NARGS(...) __SYSCALL_NARGS_X(__VA_ARGS__,7,6,5,4,3,2,1,0,)
@@ -50,11 +50,11 @@
 #define __SYSCALL_CONCAT(a,b) __SYSCALL_CONCAT_X(a,b)
 #define __SYSCALL_DISP(b,...) __SYSCALL_CONCAT(b,__SYSCALL_NARGS(__VA_ARGS__))(__VA_ARGS__)
-
+#if 0
 #define __syscall(...) __SYSCALL_DISP(__syscall,__VA_ARGS__)
 #define syscall(...) __syscall_ret(__syscall(__VA_ARGS__))
-
+#endif
 #define socketcall __socketcall
 #define socketcall_cp __socketcall_cp
-
+#if 0
 #define __syscall_cp0(n) (__syscall_cp)(n,0,0,0,0,0,0)
 #define __syscall_cp1(n,a) (__syscall_cp)(n,__scc(a),0,0,0,0,0)
@@ -67,4 +67,5 @@
 #define __syscall_cp(...) __SYSCALL_DISP(__syscall_cp,__VA_ARGS__)
 #define syscall_cp(...) __syscall_ret(__syscall_cp(__VA_ARGS__))
+#endif
 
 #ifndef SYSCALL_USE_SOCKETCALL
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/misc/syscall.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/misc/syscall.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/misc/syscall.c	(revision 342)
@@ -16,4 +16,4 @@
 	f=va_arg(ap, syscall_arg_t);
 	va_end(ap);
-	return __syscall_ret(__syscall(n,a,b,c,d,e,f));
+	return __syscall_ret(__syscall_nr(n,a,b,c,d,e,f));
 }
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/thread/__syscall_cp.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/thread/__syscall_cp.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/thread/__syscall_cp.c	(revision 342)
@@ -2,4 +2,5 @@
 #include "syscall.h"
 
+#undef sccp
 __attribute__((__visibility__("hidden")))
 long __syscall_cp_c();
@@ -9,9 +10,16 @@
                  syscall_arg_t x, syscall_arg_t y, syscall_arg_t z)
 {
-	return (__syscall)(nr, u, v, w, x, y, z);
+	return (__syscall_nr)(nr, u, v, w, x, y, z);
 }
 
 #ifndef __c2__
 weak_alias(sccp, __syscall_cp_c);
+#else
+long __syscall_cp_c(syscall_arg_t nr,
+	syscall_arg_t u, syscall_arg_t v, syscall_arg_t w,
+	syscall_arg_t x, syscall_arg_t y, syscall_arg_t z)
+{
+	return sccp(nr, u, v, w, x, y, z);
+}
 #endif
 
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/thread/pthread_cancel.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/thread/pthread_cancel.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/thread/pthread_cancel.c	(revision 342)
@@ -31,5 +31,5 @@
 	if ((st=(self=__pthread_self())->canceldisable)
 	    && (st==PTHREAD_CANCEL_DISABLE || nr==SYS_close))
-		return __syscall(nr, u, v, w, x, y, z);
+		return __syscall_nr(nr, u, v, w, x, y, z);
 
 	r = __syscall_cp_asm(&self->cancel, nr, u, v, w, x, y, z);
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setegid.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setegid.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setegid.c	(revision 342)
@@ -5,4 +5,4 @@
 int setegid(gid_t egid)
 {
-	return __setxid(SYS_setresgid, -1, egid, -1);
+	return __setxid(__NR_setresgid, -1, egid, -1);
 }
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/seteuid.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/seteuid.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/seteuid.c	(revision 342)
@@ -5,4 +5,4 @@
 int seteuid(uid_t euid)
 {
-	return __setxid(SYS_setresuid, -1, euid, -1);
+	return __setxid(__NR_setresuid, -1, euid, -1);
 }
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setgid.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setgid.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setgid.c	(revision 342)
@@ -5,4 +5,4 @@
 int setgid(gid_t gid)
 {
-	return __setxid(SYS_setgid, gid, 0, 0);
+	return __setxid(__NR_setgid, gid, 0, 0);
 }
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setregid.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setregid.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setregid.c	(revision 342)
@@ -5,4 +5,4 @@
 int setregid(gid_t rgid, gid_t egid)
 {
-	return __setxid(SYS_setregid, rgid, egid, 0);
+	return __setxid(__NR_setregid, rgid, egid, 0);
 }
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setresgid.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setresgid.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setresgid.c	(revision 342)
@@ -6,4 +6,4 @@
 int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
 {
-	return __setxid(SYS_setresgid, rgid, egid, sgid);
+	return __setxid(__NR_setresgid, rgid, egid, sgid);
 }
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setresuid.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setresuid.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setresuid.c	(revision 342)
@@ -6,4 +6,4 @@
 int setresuid(uid_t ruid, uid_t euid, uid_t suid)
 {
-	return __setxid(SYS_setresuid, ruid, euid, suid);
+	return __setxid(__NR_setresuid, ruid, euid, suid);
 }
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setreuid.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setreuid.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setreuid.c	(revision 342)
@@ -5,4 +5,4 @@
 int setreuid(uid_t ruid, uid_t euid)
 {
-	return __setxid(SYS_setreuid, ruid, euid, 0);
+	return __setxid(__NR_setreuid, ruid, euid, 0);
 }
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setuid.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setuid.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setuid.c	(revision 342)
@@ -5,4 +5,4 @@
 int setuid(uid_t uid)
 {
-	return __setxid(SYS_setuid, uid, 0, 0);
+	return __setxid(__NR_setuid, uid, 0, 0);
 }
Index: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setxid.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setxid.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/setxid.c	(revision 342)
@@ -14,5 +14,5 @@
 	struct ctx *c = p;
 	if (c->err>0) return;
-	int ret = -__syscall(c->nr, c->id, c->eid, c->sid);
+	int ret = -__syscall_nr(c->nr, c->id, c->eid, c->sid);
 	if (ret && !c->err) {
 		/* If one thread fails to set ids after another has already
Index: asp3_tinet_ecnl_rx/trunk/ntshell/src/netcmd.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/ntshell/src/netcmd.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/ntshell/src/netcmd.c	(revision 342)
@@ -73,7 +73,171 @@
 extern void ping4(T_IN4_ADDR *addr, uint_t tmo, uint_t len);
 
+/*
+ *  str_num -- cons_printf の数値変換
+ */
+
+static void
+str_chr(char *text, int *pos, int size, char c)
+{
+	if (*pos >= size)
+		return;
+	text[*pos] = c;
+	*pos = *pos + 1;
+}
+
+/*
+ *  str_num -- cons_printf の数値変換
+ */
+
+static int
+str_num(char *text, int *pos, int size, ulong_t 	val, int radix,
+         const char *radchar, int width, bool_t minus, char padchar)
+{
+	char	digits[24];
+	int	ix, pad, pchars;
+	bool_t	left;
+
+	if (width < 0) {
+		width = -width;
+		left = true;
+	}
+	else
+		left = false;
+
+	ix = 0;
+	do {
+		digits[ix ++] = radchar[val % radix];
+		val /= radix;
+	} while (val != 0);
+
+	if (minus)
+		digits[ix ++] = '-';
+
+	if (width > ix)
+		pchars = width;
+	else
+		pchars = ix;
+
+	pad = ix;
+	if (!left)	/* 右詰め */
+		for ( ; pad < width; pad ++)
+			str_chr(text, pos, size, padchar);
+
+	while (ix -- > 0)
+		str_chr(text, pos, size, digits[ix]);
+
+	if (left)	/* 左詰め */
+		for ( ; pad < width; pad ++)
+			str_chr(text, pos, size, padchar);
+
+	return pchars;
+}
+
+/*
+ *  str_ipv4addr -- IPv4 アドレス出力
+ */
+
+int
+str_ipv4addr (char *text, int size, T_IN4_ADDR *addr, int width)
+{
+	int len = 3, pos = 0;	/* 3 は '.' の文字数 */
+
+	len += str_num(text, &pos, size, (*addr >> 24) & 0xff, 10, radhex, 0, false, ' '); 
+	str_chr(text, &pos, size, '.');
+	len += str_num(text, &pos, size, (*addr >> 16) & 0xff, 10, radhex, 0, false, ' '); 
+	str_chr(text, &pos, size, '.');
+	len += str_num(text, &pos, size, (*addr >>  8) & 0xff, 10, radhex, 0, false, ' '); 
+	str_chr(text, &pos, size, '.');
+	len += str_num(text, &pos, size,  *addr        & 0xff, 10, radhex, 0, false, ' '); 
+
+	for ( ; len < width; len ++)
+		str_chr(text, &pos, size, ' ');
+
+	return len;
+}
+
+/*
+ *  ipv6addr -- IPv6 アドレス出力
+ */
+
+int
+str_ipv6addr (char *text, int size, const T_IN6_ADDR *addr, int width)
+{
+	int	len = 0, ix, len6, pos = 0;
+	bool_t	omit = false, zero = false;
+
+	if (addr == NULL || IN6_IS_ADDR_UNSPECIFIED(addr)) {
+		str_chr(text, &pos, size, '0');
+		str_chr(text, &pos, size, ':');
+		str_chr(text, &pos, size, ':');
+		str_chr(text, &pos, size, '0');
+		len = 4;
+	}
+	else {
+		if (in6_is_addr_ipv4mapped(addr))
+			len6 = sizeof(T_IN6_ADDR) / 2 - 2;
+		else
+			len6 = sizeof(T_IN6_ADDR) / 2;
+		for (ix = 0; ix < len6; ix ++) {
+			if (omit) {
+				len += str_num(text, &pos, size, ntohs(addr->s6_addr16[ix]), 16, radhex, 0, false, ' '); 
+				if (ix < 7) {
+					str_chr(text, &pos, size, ':');
+					len ++;
+				}
+			}
+			else if (ix > 0 && ix < 7 && addr->s6_addr16[ix] == 0)
+				zero = true;
+			else {
+				if (zero) {
+					omit = true;
+					str_chr(text, &pos, size, ':');
+					len ++;
+				}
+				len += str_num(text, &pos, size, ntohs(addr->s6_addr16[ix]), 16, radhex, 0, false, ' '); 
+				if (ix < 7) {
+					str_chr(text, &pos, size, ':');
+					len ++;
+				}
+			}
+		}
+
+		if (len6 == sizeof(T_IN6_ADDR) / 2 - 2) {
+			T_IN4_ADDR ip4addr;
+
+			ip4addr = ntohl(addr->s6_addr32[3]);
+			len += str_ipv4addr(&text[len], size - len, &ip4addr, 0);
+		}
+
+		for ( ; len < width; len ++)
+			str_chr(text, &pos, size, ' ');
+	}
+	return len;
+}
+
+/*
+ *  str_macaddr -- MAC アドレス出力
+ */
+
+int
+str_macaddr (char *text, int size, uint8_t *mac, int width)
+{
+	int oct, len, pos = 0;
+
+	for (oct = 5; oct -- > 0; ) {
+		str_num(text, &pos, size, *mac ++, 16, radhex, 2, false, '0'); 
+		str_chr(text, &pos, size, ':');
+	}
+	str_num(text, &pos, size, *mac, 16, radhex, 2, false, '0'); 
+
+	for (len = 17; len < width; len ++)
+		str_chr(text, &pos, size, ' ');
+
+	return len;
+}
+
 int usrcmd_ping(int argc, char **argv)
 {
-	int_t	tmo, size;
+	int	tmo, size;
 	char	apip = DEFAULT_API_PROTO;
 	char *line = argv[1];
@@ -153,7 +317,11 @@
 	ER ret;
 	uint32_t expire, renew, rebind;
+	char temp[30];
+	int pos;
 
 	if ((ret = dhcp4c_get_info(&svaddr, &expire, &renew, &rebind, &bind_start)) == E_OK) {
-		ntstdio_printf(&ntstdio, "DHCPv4 server: %hI,\n", &svaddr);
+		pos = str_ipv4addr(temp, sizeof(temp), &svaddr, 0);
+		temp[pos] = '\0';
+		ntstdio_printf(&ntstdio, "DHCPv4 server: %s,\n", temp);
 		ntstdio_printf(&ntstdio, "  Renew:       %u:%02u:%02u,\n",
 			renew / 3600, (renew / 60) % 60, renew % 60);
@@ -279,4 +447,6 @@
 	int		count, dcount, col;
 	T_IN6_ADDR	in6_addr;
+	char temp[30];
+	int pos;
 
 	ntstdio_printf(&ntstdio, "%10s section: %d\n", title, scount);
@@ -294,5 +464,7 @@
 			memcpy((void*)&in4_addr, (void*)(msg + rr.rdata_offset), sizeof(in4_addr));
 			in4_addr = ntohl(in4_addr);
-			ntstdio_printf(&ntstdio, "    IPv4 addr: %hI\n", &in4_addr);
+			pos = str_ipv4addr(temp, sizeof(temp), &in4_addr, 0);
+			temp[pos] = '\0';
+			ntstdio_printf(&ntstdio, "    IPv4 addr: %s\n", temp);
 			break;
 		case DNS_TYPE_NS:
@@ -316,5 +488,7 @@
 		case DNS_TYPE_AAAA:
 			memcpy((void*)&in6_addr, (void*)(msg + rr.rdata_offset), sizeof(in6_addr));
-			ntstdio_printf(&ntstdio, "    IPv6 addr: %lI\n", &in6_addr);
+			pos = str_ipv6addr(temp, sizeof(temp), &in6_addr, 0);
+			temp[pos] = '\0';
+			ntstdio_printf(&ntstdio, "    IPv6 addr: %s\n", temp);
 			break;
 		default:
@@ -347,4 +521,6 @@
 	T_IN4_ADDR	in4_addr;
 #endif
+	char temp[30];
+	int pos;
 
 #if defined(SUPPORT_INET6)
@@ -363,6 +539,9 @@
 	if (IN6_IS_ADDR_UNSPECIFIED(&in6_addr))
 		ntstdio_printf(&ntstdio, "not available.\n");
-	else
-		ntstdio_printf(&ntstdio, "%lI.\n", &in6_addr);
+	else {
+		pos = str_ipv6addr(temp, sizeof(temp), &in6_addr, 0);
+		temp[pos] = '\0';
+		ntstdio_printf(&ntstdio, "%s.\n", temp);
+	}
 #endif	/* of #if defined(SUPPORT_INET6) */
 
@@ -372,6 +551,9 @@
 	if (in4_addr == IPV4_ADDRANY)
 		ntstdio_printf(&ntstdio, "not available.\n");
-	else
-		ntstdio_printf(&ntstdio, "%hI.\n", &in4_addr);
+	else {
+		pos = str_ipv4addr(temp, sizeof(temp), &in4_addr, 0);
+		temp[pos] = '\0';
+		ntstdio_printf(&ntstdio, "%s.\n", temp);
+	}
 #endif	/* of #if defined(SUPPORT_INET4) */
 }
Index: asp3_tinet_ecnl_rx/trunk/ntshell/src/netcmd.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/ntshell/src/netcmd.h	(revision 342)
+++ asp3_tinet_ecnl_rx/trunk/ntshell/src/netcmd.h	(revision 342)
@@ -0,0 +1,64 @@
+/*
+ *  TOPPERS ECHONET Lite Communication Middleware
+ * 
+ *  Copyright (C) 2018 Cores Co., Ltd. Japan
+ * 
+ *  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ï½(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+ *  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+ *  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+ *  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+ *      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+ *      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+ *  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+ *      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+ *      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+ *      ã¨ï¼
+ *    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+ *        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+ *        å ±åãããã¨ï¼
+ *  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+ *      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+ *      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+ *      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+ *      å
+è²¬ãããã¨ï¼
+ * 
+ *  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+ *  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+ *  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+ *  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+ *  ã®è²¬ä»»ãè² ããªãï¼
+ * 
+ *  @(#) $Id$
+ */
+#ifndef NETCMD_H
+#define NETCMD_H
+
+int str_ipv4addr(char *text, int size, T_IN4_ADDR *addr, int width);
+int str_ipv6addr(char *text, int size, const T_IN6_ADDR *addr, int width);
+int str_macaddr(char *text, int size, uint8_t *mac, int width);
+
+int usrcmd_ping(int argc, char **argv);
+int usrcmd_dhcp4c(int argc, char **argv);
+int usrcmd_dnsc(int argc, char **argv);
+int usrcmd_ntpc(int argc, char **argv);
+
+#endif /* NETCMD_H */
Index: asp3_tinet_ecnl_rx/trunk/ntshell/src/ntshell_main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/ntshell/src/ntshell_main.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/ntshell/src/ntshell_main.c	(revision 342)
@@ -59,5 +59,4 @@
 #include "ntshell_main.h"
 #include "socket_stub.h"
-#include "mbed_api.h"
 #include "usb_hbth.h"
 
@@ -162,16 +161,4 @@
 }
 
-void shellif_into()
-{
-	/* メインタスクの優先度より高くする */
-	chg_pri(NTSHELL_PRIORITY, main_task_priority);
-}
-
-void shellif_outof()
-{
-	/* ntshellタスクの優先度に戻す */
-	chg_pri(NTSHELL_PRIORITY, NTSHELL_PRIORITY);
-}
-
 void shell_abort()
 {
Index: asp3_tinet_ecnl_rx/trunk/ntshell/src/shellif.h
===================================================================
--- asp3_tinet_ecnl_rx/trunk/ntshell/src/shellif.h	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/ntshell/src/shellif.h	(revision 342)
@@ -282,6 +282,4 @@
 
 char *basename(char *);
-void shellif_into();
-void shellif_outof();
 
 struct regs_t {
@@ -295,5 +293,5 @@
 };
 
-void no_implement(const char *text);
+long no_implement(const char *text);
 void __mbedcall_cp_asm();
 
Index: asp3_tinet_ecnl_rx/trunk/ntshell/src/syscall.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/ntshell/src/syscall.c	(revision 341)
+++ asp3_tinet_ecnl_rx/trunk/ntshell/src/syscall.c	(revision 342)
@@ -1,7 +1,7 @@
 /*
  *  TOPPERS ECHONET Lite Communication Middleware
- * 
+ *
  *  Copyright (C) 2018 Cores Co., Ltd. Japan
- * 
+ *
  *  上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
  *  ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
@@ -26,5 +26,5 @@
  *      由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
  *      免責すること．
- * 
+ *
  *  本ソフトウェアは，無保証で提供されているものである．上記著作権者お
  *  よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
@@ -32,6 +32,6 @@
  *  アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
  *  の責任を負わない．
- * 
- *  @(#) $Id$
+ *
+ *  @(#) $Id: syscall.c 1530 2018-04-27 04:00:17Z coas-nagasima $
  */
 #include "bits/syscall.h"
@@ -42,855 +42,353 @@
 void *tid_address;
 
-void no_implement(const char *text)
+long no_implement(const char *text)
 {
 	syslog(LOG_ERROR, text);
 	DebugBreak();
-}
-
-long __syscall(long n, ...)
+	return -ENOSYS;
+}
+
+long __syscall_nr(long n, ...)
 {
 	long ret = -ENOSYS;
 	va_list ap;
-	int fd;
-
-	shellif_into();
 
 	va_start(ap, n);
 
 	switch (n) {
-	case SYS__llseek:
-		return shell_llseek(va_arg(ap, int), va_arg(ap, off_t), va_arg(ap, off_t *), va_arg(ap, int));
-	case SYS__newselect:
-		ret = shell_select(va_arg(ap, int), va_arg(ap, fd_set *), va_arg(ap, fd_set *), va_arg(ap, fd_set *), va_arg(ap, struct timeval *));
-		break;
-	case SYS_accept:
-		ret = shell_accept(va_arg(ap, int), va_arg(ap, struct sockaddr *), va_arg(ap, socklen_t *));
-		break;
-	case SYS_access:
-		ret = shell_access(va_arg(ap, const char *), va_arg(ap, int));
-		break;
-	case SYS_acct:
-		no_implement("acct\n");
-		break;
-	case SYS_adjtimex:
-		no_implement("adjtimex\n");
-		break;
-#ifdef SYS_arch_prctl
-	case SYS_arch_prctl:
-		no_implement("arch_prctl\n");
-		break;
+	case __NR_setresgid:
+		no_implement("setresgid");
+		break;
+	case __NR_setresuid:
+		no_implement("setresuid");
+		break;
+	case __NR_setgid:
+		no_implement("setgid");
+		break;
+	case __NR_setregid:
+		no_implement("setregid");
+		break;
+	case __NR_setreuid:
+		no_implement("setreuid");
+		break;
+	case __NR_setuid:
+		no_implement("setuid");
+		break;
+	default:
+		no_implement("syscall");
+		break;
+	}
+
+	va_end(ap);
+
+	return ret;
+}
+
+long SYS__llseek(long a, long b, long c, long d, long e) {
+	return shell_llseek((int)a, ((off_t)b << 32) | (off_t)c, (off_t *)d, (int)e);
+}
+
+long SYS__newselect(long a, long b, long c, long d, long e) {
+	return shell_select((int)a, (fd_set *)b, (fd_set *)c, (fd_set *)d, (struct timeval *)e);
+}
+
+long SYS_accept(long a, long b, long c) {
+	return shell_accept((int)a, (struct sockaddr *)b, (socklen_t *)c);
+}
+
+long SYS_access(long a, long b) {
+	return shell_access((const char *)a, (int)b);
+}
+
+long SYS_bind(long a, long b, long c) {
+	return shell_bind((int)a, (const struct sockaddr *)b, (socklen_t)c);
+}
+
+long SYS_brk(long a) {
+	return (long)shell_brk((void *)a);
+}
+
+long SYS_chdir(long a) {
+	return shell_chdir((const char *)a);
+}
+
+long SYS_chmod(long a, long b) {
+	return shell_chmod((const char *)a, (mode_t)b);
+}
+
+long SYS_chroot(long a) {
+	return shell_chroot((const char *)a);
+}
+
+long SYS_clock_getres(long a, long b) {
+	return shell_clock_getres((clockid_t)a, (struct timespec *)b);
+}
+
+long SYS_clock_gettime(long a, long b) {
+	return shell_clock_gettime((clockid_t)a, (struct timespec *)b);
+}
+
+long SYS_clock_settime(long a, long b) {
+	return shell_clock_settime((clockid_t)a, (const struct timespec *)b);
+}
+
+long SYS_close(long a) {
+	return shell_close((int)a);
+}
+
+long SYS_connect(long a, long b, long c) {
+	return shell_connect((int)a, (const struct sockaddr *)b, (socklen_t)c);
+}
+
+long SYS_exit(long a) {
+	shell_exit((int)a);
+	return 0;
+}
+
+long SYS_exit_group(long a) {
+	shell_exit_group((int)a);
+	return 0;
+}
+
+long SYS_fcntl64(long a, long b, long c) {
+	return shell_fcntl((int)a, (int)b, (void *)c);
+}
+
+long SYS_fdatasync() {
+	return no_implement("fdatasync\n");
+}
+
+long SYS_fstat64(long a, long b) {
+	return shell_fstat((int)a, (struct stat *)b);
+}
+
+long SYS_fsync(long a) {
+	return shell_fsync((int)a);
+}
+
+long SYS_ftruncate64(long a, long b, long c) {
+	return shell_ftruncate((int)a, ((off_t)b << 32) | (off_t)c);
+}
+
+long SYS_futex() {
+	int futex(int *uaddr, int op, int val, const struct timespec *timeout, int *uaddr2, int val3);
+	return no_implement("futex\n");
+}
+
+long SYS_futimesat() {
+	return no_implement("futimesat\n");
+}
+
+long SYS_getcwd(long a, long b) {
+	return (long)shell_getcwd((char *)a, (size_t)b);
+}
+
+long SYS_getdents64(long a, long b, long c) {
+	return shell_getdents((int)a, (struct dirent *)b, (size_t)c);
+}
+
+long SYS_getpeername(long a, long b, long c) {
+	return shell_getpeername((int)a, (struct sockaddr *)b, (socklen_t *)c);
+}
+
+long SYS_getsockname(long a, long b, long c) {
+	return shell_getsockname((int)a, (struct sockaddr *)b, (socklen_t *)c);
+}
+
+long SYS_getpid() {
+	return shell_getpid();
+}
+
+long SYS_getsockopt(long a, long b, long c, long d, long e) {
+	return shell_getsockopt((int)a, (int)b, (int)c, (void *)d, (socklen_t *)e);
+}
+
+long SYS_gettid() {
+	return shell_gettid();
+}
+
+long SYS_gettimeofday(long a, long b) {
+	return shell_gettimeofday((struct timeval *)a, (void *)b);
+}
+
+long SYS_getuid32() {
+	return no_implement("getuid\n");
+}
+
+long SYS_ioctl(long a, long b, long c) {
+	return shell_ioctl((int)a, (int)b, (void *)c);
+}
+
+long SYS_kill(long a, long b) {
+	return shell_kill((int)a, (int)b);
+}
+
+long SYS_link(long a, long b) {
+	return shell_link((const char *)a, (const char *)b);
+}
+
+long SYS_listen(long a, long b) {
+	return shell_listen((int)a, (int)b);
+}
+
+long SYS_lstat64(long a, long b) {
+	return shell_lstat((const char *__restrict)a, (struct stat *__restrict)b);
+}
+
+long SYS_madvise(long a, long b, long c) {
+	return shell_madvise((void *)a, (size_t)b, (int)c);
+}
+
+long SYS_mkdir(long a, long b) {
+	return shell_mkdir((const char *)a, (mode_t)b);
+}
+
+long SYS_mmap2(long a, long b, long c, long d, long e, long f, long g) {
+	return (int)shell_mmap2((void *)a, (size_t)b, (int)c, (int)d, (int)e, ((off_t)f << 32) | (off_t)g);
+}
+
+long SYS_mprotect(long a, long b, long c) {
+	return shell_mprotect((void *)a, (size_t)b, (int)c);
+}
+
+long SYS_munmap() {
+	return no_implement("munmap\n");
+}
+
+long SYS_open(long a, long b, long c) {
+	return shell_open((const char *)a, (int)b, (void *)c);
+}
+
+long SYS_poll(long a, long b, long c) {
+	return shell_poll((struct pollfd *)a, (nfds_t)b, (int)c);
+}
+
+long SYS_pread64() {
+	return no_implement("pread64\n");
+}
+
+long SYS_pwrite64() {
+	return no_implement("pwrite64\n");
+}
+
+long SYS_read(long a, long b, long c) {
+	return shell_read((int)a, (void *)b, (size_t)c);
+}
+
+long SYS_readv(long a, long b, long c) {
+	return shell_readv((int)a, (const struct iovec *)b, (int)c);
+}
+
+long SYS_recv(long a, long b, long c, long d) {
+	return shell_recv((int)a, (void *)b, (size_t)c, (int)d);
+}
+
+long SYS_recvfrom(long a, long b, long c, long d, long e, long f) {
+	if (a == 0)
+		return shell_recv(a, (void *)b, (size_t)c, (int)d);
+	else
+		return shell_recvfrom(a, (void *)b, (size_t)c, (int)d, (struct sockaddr *)e, (socklen_t *)f);
+}
+
+long SYS_recvmsg(long a, long b, long c) {
+	return shell_recvmsg((int)a, (struct msghdr *)b, (size_t)c);
+}
+
+long SYS_rename(long a, long b) {
+	return shell_rename((const char *)a, (const char *)b);
+}
+
+long SYS_rmdir(long a) {
+	return shell_rmdir((const char *)a);
+}
+
+long SYS_rt_sigaction(long a, long b, long c) {
+	return shell_sigaction((int)a, (const struct sigaction *)b, (struct sigaction *)c);
+}
+
+long SYS_rt_sigprocmask(long a, long b, long c) {
+	return shell_sigprocmask((int)a, (const sigset_t *)b, (sigset_t *)c);
+}
+
+long SYS_rt_sigqueueinfo() {
+	return no_implement("rt_sigqueueinfo\n");
+}
+
+long SYS_send(long a, long b, long c, long d) {
+	return shell_send((int)a, (const void *)b, (size_t)c, (int)d);
+}
+
+long SYS_sendmsg(long a, long b, long c) {
+	return shell_sendmsg((int)a, (const struct msghdr *)b, (size_t)c);
+}
+
+long SYS_sendto(long a, long b, long c, long d, long e, long f) {
+	if (a == 0)
+		return shell_send(a, (const void *)b, (size_t)c, (int)d);
+	else
+		return shell_sendto(a, (const void *)b, (size_t)c, (int)d, (const struct sockaddr *)e, (socklen_t)f);
+}
+
+long SYS_setsockopt(long a, long b, long c, long d, long e) {
+	return shell_setsockopt((int)a, (int)b, (int)c, (const void *)d, (socklen_t)e);
+}
+
+long SYS_shutdown(long a, long b) {
+	return shell_shutdown((int)a, (int)b);
+}
+
+long SYS_sched_setscheduler() {
+	return no_implement("sched_setscheduler\n");
+}
+
+long SYS_set_robust_list() {
+	return no_implement("set_robust_list\n");
+}
+
+#ifdef SYS_set_thread_area
+long SYS_set_thread_area(long a) {
+	thread_area = (void *)a;
+	return 0;
+}
 #endif
-	case SYS_bind:
-		ret = shell_bind(va_arg(ap, int), va_arg(ap, const struct sockaddr *), va_arg(ap, socklen_t));
-		break;
-	case SYS_brk:
-		ret = (long)shell_brk(va_arg(ap, void *));
-		break;
-#ifdef SYS_cachectl
-	case SYS_cachectl:
-		no_implement("cachectl\n");
-		break;
-#endif
-#ifdef SYS_cacheflush
-	case SYS_cacheflush:
-		no_implement("cacheflush\n");
-		break;
-#endif
-	case SYS_capget:
-		no_implement("capget\n");
-		break;
-	case SYS_capset:
-		no_implement("capset\n");
-		break;
-	case SYS_chdir:
-		ret = shell_chdir(va_arg(ap, const char *));
-		break;
-	case SYS_chmod:
-		ret = shell_chmod(va_arg(ap, const char *), va_arg(ap, mode_t));
-		break;
-	case SYS_chown32:
-		no_implement("chown\n");
-		break;
-	case SYS_chroot:
-		ret = shell_chroot(va_arg(ap, const char *));
-		break;
-	case SYS_clock_adjtime:
-		no_implement("clock_adjtime\n");
-		break;
-	case SYS_clock_getres:
-		ret = shell_clock_getres(va_arg(ap, clockid_t), va_arg(ap, struct timespec *));
-		break;
-	case SYS_clock_gettime:
-		ret = shell_clock_gettime(va_arg(ap, clockid_t), va_arg(ap, struct timespec *));
-		break;
-	case SYS_clock_nanosleep:
-		no_implement("clock_nanosleep\n");
-		break;
-	case SYS_clock_settime:
-		ret = shell_clock_settime(va_arg(ap, clockid_t), va_arg(ap, const struct timespec *));
-		break;
-	case SYS_clone:
-		no_implement("clone\n");
-		break;
-	case SYS_close:
-		ret = shell_close(va_arg(ap, int));
-		break;
-	case SYS_connect:
-		ret = shell_connect(va_arg(ap, int), va_arg(ap, const struct sockaddr *), va_arg(ap, socklen_t));
-		break;
-	case SYS_delete_module:
-		no_implement("delete_module\n");
-		break;
-	case SYS_dup:
-		no_implement("dup\n");
-		break;
-	case SYS_dup2:
-		no_implement("dup2\n");
-		break;
-	case SYS_dup3:
-		no_implement("dup3\n");
-		break;
-	case SYS_epoll_create:
-		no_implement("epoll_create\n");
-		break;
-	case SYS_epoll_create1:
-		no_implement("epoll_create1\n");
-		break;
-	case SYS_epoll_ctl:
-		no_implement("epoll_ctl\n");
-		break;
-	case SYS_epoll_pwait:
-		no_implement("epoll_pwait\n");
-		break;
-	case SYS_epoll_wait:
-		no_implement("epoll_wait\n");
-		break;
-	case SYS_eventfd:
-		no_implement("eventfd\n");
-		break;
-	case SYS_eventfd2:
-		no_implement("eventfd2\n");
-		break;
-	case SYS_execve:
-		no_implement("execve\n");
-		break;
-	case SYS_exit:
-		shell_exit(va_arg(ap, int));
-		ret = 0;
-		break;
-	case SYS_exit_group:
-		shell_exit_group(va_arg(ap, int));
-		ret = 0;
-		break;
-	case SYS_faccessat:
-		no_implement("faccessat\n");
-		break;
-	case SYS_fadvise64_64:
-		no_implement("fadvise64_64\n");
-		break;
-	case SYS_fallocate:
-		no_implement("fallocate\n");
-		break;
-	case SYS_fanotify_init:
-		no_implement("fanotify_init\n");
-		break;
-	case SYS_fanotify_mark:
-		no_implement("fanotify_mark\n");
-		break;
-	case SYS_fchdir:
-		no_implement("fchdir\n");
-		break;
-	case SYS_fchmod:
-		no_implement("fchmod\n");
-		break;
-	case SYS_fchmodat:
-		no_implement("fchmodat\n");
-		break;
-	case SYS_fchown32:
-		no_implement("fchown\n");
-		break;
-	case SYS_fchownat:
-		no_implement("fchownat\n");
-		break;
-	case SYS_fcntl64:
-		ret = shell_fcntl(va_arg(ap, int), va_arg(ap, int), va_arg(ap, void *));
-		break;
-	case SYS_fdatasync:
-		no_implement("fdatasync\n");
-		break;
-	case SYS_fgetxattr:
-		no_implement("fgetxattr\n");
-		break;
-	case SYS_flistxattr:
-		no_implement("flistxattr\n");
-		break;
-	case SYS_flock:
-		no_implement("flock\n");
-		break;
-	case SYS_fork:
-		no_implement("fork\n");
-		break;
-	case SYS_fremovexattr:
-		no_implement("fremovexattr\n");
-		break;
-	case SYS_fsetxattr:
-		no_implement("fsetxattr\n");
-		break;
-	case SYS_fstat64:
-		ret = shell_fstat(va_arg(ap, int), va_arg(ap, struct stat *));
-		break;
-	case SYS_fstatat64:
-		no_implement("fstatat64\n");
-		break;
-	case SYS_fstatfs:
-		no_implement("fstatfs\n");
-		break;
-	case SYS_fstatfs64:
-		no_implement("fstatfs64\n");
-		break;
-	case SYS_fsync:
-		ret = shell_fsync(va_arg(ap, int));
-		break;
-	case SYS_ftruncate64:
-		ret = shell_ftruncate(va_arg(ap, int), va_arg(ap, off_t));
-		break;
-	case SYS_futex:
-		no_implement("futex\n");
-		break;
-	case SYS_futimesat:
-		no_implement("futimesat\n");
-		break;
-	case SYS_getcpu:
-		no_implement("getcpu\n");
-		break;
-	case SYS_getcwd:
-		ret = (long)shell_getcwd(va_arg(ap, char *), va_arg(ap, size_t));
-		break;
-	case SYS_getdents64:
-		ret = shell_getdents(va_arg(ap, int), va_arg(ap, struct dirent *), va_arg(ap, size_t));	// TODO
-		break;
-	case SYS_getegid32:
-		no_implement("getegid\n");
-		break;
-	case SYS_geteuid32:
-		no_implement("geteuid\n");
-		break;
-	case SYS_getgid32:
-		no_implement("getgid\n");
-		break;
-	case SYS_getgroups32:
-		no_implement("getgroups\n");
-		break;
-	case SYS_getitimer:
-		no_implement("getitimer\n");
-		break;
-	case SYS_getpeername:
-		ret = shell_getpeername(va_arg(ap, int), va_arg(ap, struct sockaddr *), va_arg(ap, socklen_t *));
-		break;
-	case SYS_getsockname:
-		ret = shell_getsockname(va_arg(ap, int), va_arg(ap, struct sockaddr *), va_arg(ap, socklen_t *));
-		break;
-	case SYS_getpgid:
-		no_implement("getpgid\n");
-		break;
-	case SYS_getpid:
-		ret = shell_getpid();
-		break;
-	case SYS_getppid:
-		no_implement("getppid\n");
-		break;
-	case SYS_getpriority:
-		no_implement("getpriority\n");
-		break;
-	case SYS_getresgid32:
-		no_implement("getresgid\n");
-		break;
-	case SYS_getresuid32:
-		no_implement("getresuid\n");
-		break;
-#ifdef SYS_getrlimit
-	case SYS_getrlimit:
-		no_implement("getrlimit\n");
-		break;
-#endif
-	case SYS_getrusage:
-		no_implement("getrusage\n");
-		break;
-	case SYS_getsid:
-		no_implement("getsid\n");
-		break;
-	case SYS_getsockopt:
-		ret = shell_getsockopt(va_arg(ap, int), va_arg(ap, int), va_arg(ap, int), va_arg(ap, void *), va_arg(ap, socklen_t *));
-		break;
-	case SYS_gettid:
-		ret = shell_gettid();
-		break;
-	case SYS_gettimeofday:
-		ret = shell_gettimeofday(va_arg(ap, struct timeval *), va_arg(ap, void *));
-		break;
-	case SYS_getuid32:
-		no_implement("getuid\n");
-		break;
-	case SYS_getxattr:
-		no_implement("getxattr\n");
-		break;
-	case SYS_init_module:
-		no_implement("init_module\n");
-		break;
-	case SYS_inotify_add_watch:
-		no_implement("inotify_add_watch\n");
-		break;
-	case SYS_inotify_init:
-		no_implement("inotify_init\n");
-		break;
-	case SYS_inotify_init1:
-		no_implement("inotify_init1\n");
-		break;
-	case SYS_inotify_rm_watch:
-		no_implement("inotify_rm_watch\n");
-		break;
-	case SYS_ioctl:
-		ret = shell_ioctl(va_arg(ap, int), va_arg(ap, int), va_arg(ap, void *));
-		break;
-#ifdef SYS_ioperm
-	case SYS_ioperm:
-		no_implement("ioperm\n");
-		break;
-#endif
-#ifdef SYS_iopl
-	case SYS_iopl:
-		no_implement("iopl\n");
-		break;
-#endif
-#ifdef SYS_ipc
-	case SYS_ipc:
-		no_implement("ipc\n");
-		break;
-#endif
-#ifdef SYS_ipc
-	case SYS_ipc:
-		no_implement("ipc\n");
-		break;
-#endif
-	case SYS_kill:
-		ret = shell_kill(va_arg(ap, int), va_arg(ap, int));
-		break;
-	case SYS_lchown32:
-		no_implement("lchown\n");
-		break;
-	case SYS_lgetxattr:
-		no_implement("lgetxattr\n");
-		break;
-	case SYS_link:
-		ret = shell_link(va_arg(ap, const char *), va_arg(ap, const char *));
-		break;
-	case SYS_linkat:
-		no_implement("linkat\n");
-		break;
-	case SYS_listen:
-		ret = shell_listen(va_arg(ap, int), va_arg(ap, int));
-		break;
-	case SYS_listxattr:
-		no_implement("listxattr\n");
-		break;
-	case SYS_llistxattr:
-		no_implement("llistxattr\n");
-		break;
-	case SYS_lremovexattr:
-		no_implement("lremovexattr\n");
-		break;
-	case SYS_lsetxattr:
-		no_implement("lsetxattr\n");
-		break;
-	case SYS_lstat64:
-		ret = shell_lstat(va_arg(ap, const char *__restrict), va_arg(ap, struct stat *__restrict));
-		break;
-	case SYS_madvise:
-		ret = shell_madvise(va_arg(ap, void *), va_arg(ap, size_t), va_arg(ap, int));	// TODO
-		break;
-	case SYS_mincore:
-		no_implement("mincore\n");
-		break;
-	case SYS_mkdir:
-		ret = shell_mkdir(va_arg(ap, const char *), va_arg(ap, mode_t));
-		break;
-	case SYS_mkdirat:
-		no_implement("mkdirat\n");
-		break;
-	case SYS_mknod:
-		no_implement("mknod\n");
-		break;
-	case SYS_mknodat:
-		no_implement("mknodat\n");
-		break;
-	case SYS_mlock:
-		no_implement("mlock\n");
-		break;
-	case SYS_mlockall:
-		no_implement("mlockall\n");
-		break;
-	case SYS_mmap2:
-		ret = (int)shell_mmap2(va_arg(ap, void *), va_arg(ap, size_t), va_arg(ap, int), va_arg(ap, int), va_arg(ap, int), va_arg(ap, off_t));
-		break;
-	case SYS_mount:
-		no_implement("mount\n");
-		break;
-	case SYS_mprotect:
-		return shell_mprotect(va_arg(ap, void *), va_arg(ap, size_t), va_arg(ap, int));
-		break;
-	case SYS_mq_getsetattr:
-		no_implement("mq_getsetattr\n");
-		break;
-	case SYS_mq_notify:
-		no_implement("mq_notify\n");
-		break;
-	case SYS_mq_open:
-		no_implement("mq_open\n");
-		break;
-	case SYS_mq_timedreceive:
-		no_implement("mq_timedreceive\n");
-		break;
-	case SYS_mq_timedsend:
-		no_implement("mq_timedsend\n");
-		break;
-	case SYS_mq_unlink:
-		no_implement("mq_unlink\n");
-		break;
-	case SYS_mremap:
-		no_implement("mremap\n");
-		break;
-	case SYS_msgctl:
-		no_implement("msgctl\n");
-		break;
-	case SYS_msgget:
-		no_implement("msgget\n");
-		break;
-	case SYS_msgrcv:
-		no_implement("msgrcv\n");
-		break;
-	case SYS_msgsnd:
-		no_implement("msgsnd\n");
-		break;
-	case SYS_msync:
-		no_implement("msync\n");
-		break;
-	case SYS_munlock:
-		no_implement("munlock\n");
-		break;
-	case SYS_munlockall:
-		no_implement("munlockall\n");
-		break;
-	case SYS_munmap:
-		no_implement("munmap\n");
-		break;
-	case SYS_nanosleep:
-		no_implement("nanosleep\n");
-		break;
-	case SYS_nice:
-		no_implement("nice\n");
-		break;
-	case SYS_open:
-		ret = shell_open(va_arg(ap, const char *), va_arg(ap, int), va_arg(ap, void *));
-		break;
-	case SYS_openat:
-		no_implement("openat\n");
-		break;
-	case SYS_pause:
-		no_implement("pause\n");
-		break;
-	case SYS_personality:
-		no_implement("personality\n");
-		break;
-	case SYS_pipe:
-		no_implement("pipe\n");
-		break;
-	case SYS_pipe2:
-		no_implement("pipe2\n");
-		break;
-	case SYS_pivot_root:
-		no_implement("pivot_root\n");
-		break;
-	case SYS_poll:
-		ret = shell_poll(va_arg(ap, struct pollfd *), va_arg(ap, nfds_t), va_arg(ap, int));
-		break;
-	case SYS_ppoll:
-		no_implement("ppoll\n");
-		break;
-	case SYS_prctl:
-		no_implement("prctl\n");
-		break;
-	case SYS_pread64:
-		no_implement("pread64\n");
-		break;
-	case SYS_preadv:
-		no_implement("preadv\n");
-		break;
-	case SYS_prlimit64:
-		no_implement("prlimit64\n");
-		break;
-	case SYS_process_vm_readv:
-		no_implement("process_vm_readv\n");
-		break;
-	case SYS_process_vm_writev:
-		no_implement("process_vm_writev\n");
-		break;
-	case SYS_pselect6:
-		no_implement("pselect6\n");
-		break;
-	case SYS_ptrace:
-		no_implement("ptrace\n");
-		break;
-	case SYS_pwrite64:
-		no_implement("pwrite64\n");
-		break;
-	case SYS_pwritev:
-		no_implement("pwritev\n");
-		break;
-	case SYS_quotactl:
-		no_implement("quotactl\n");
-		break;
-	case SYS_read:
-		ret = shell_read(va_arg(ap, int), va_arg(ap, void *), va_arg(ap, size_t));
-		break;
-	case SYS_readahead:
-		no_implement("readahead\n");
-		break;
-	case SYS_readlink:
-		no_implement("readlink\n");
-		break;
-	case SYS_readlinkat:
-		no_implement("readlinkat\n");
-		break;
-	case SYS_readv:
-		ret = shell_readv(va_arg(ap, int), va_arg(ap, const struct iovec *), va_arg(ap, int));
-		break;
-	case SYS_recv:
-		ret = shell_recv(va_arg(ap, int), va_arg(ap, void *), va_arg(ap, size_t), va_arg(ap, int));
-		break;
-	case SYS_recvfrom:
-		fd = va_arg(ap, int);
-		if (fd == 0)
-			ret = shell_recv(fd, va_arg(ap, void *), va_arg(ap, size_t), va_arg(ap, int));
-		else
-			ret = shell_recvfrom(fd, va_arg(ap, void *), va_arg(ap, size_t), va_arg(ap, int), va_arg(ap, struct sockaddr *), va_arg(ap, socklen_t *));
-		break;
-	case SYS_recvmsg:
-		ret = shell_recvmsg(va_arg(ap, int), va_arg(ap, struct msghdr *), va_arg(ap, size_t));
-		break;
-	case SYS_reboot:
-		no_implement("reboot\n");
-		break;
-	case SYS_recvmmsg:
-		no_implement("recvmmsg\n");
-		break;
-	case SYS_remap_file_pages:
-		no_implement("remap_file_pages\n");
-		break;
-	case SYS_removexattr:
-		no_implement("removexattr\n");
-		break;
-	case SYS_rename:
-		ret = shell_rename(va_arg(ap, const char *), va_arg(ap, const char *));
-		break;
-	case SYS_renameat:
-		no_implement("renameat\n");
-		break;
-	case SYS_rmdir:
-		ret = shell_rmdir(va_arg(ap, const char *));
-		break;
-	case SYS_rt_sigaction:
-		ret = shell_sigaction(va_arg(ap, int), va_arg(ap, const struct sigaction *), va_arg(ap, struct sigaction *));
-		break;
-	case SYS_rt_sigpending:
-		no_implement("rt_sigpending\n");
-		break;
-	case SYS_rt_sigprocmask:
-		ret = shell_sigprocmask(va_arg(ap, int), va_arg(ap, const sigset_t *), va_arg(ap, sigset_t *));
-		break;
-	case SYS_rt_sigqueueinfo:
-		no_implement("rt_sigqueueinfo\n");
-		break;
-	case SYS_rt_sigsuspend:
-		no_implement("rt_sigsuspend\n");
-		break;
-	case SYS_rt_sigtimedwait:
-		no_implement("rt_sigtimedwait\n");
-		break;
-	case SYS_send:
-		ret = shell_send(va_arg(ap, int), va_arg(ap, const void *), va_arg(ap, size_t), va_arg(ap, int));
-		break;
-	case SYS_sendmsg:
-		ret = shell_sendmsg(va_arg(ap, int), va_arg(ap, const struct msghdr *), va_arg(ap, size_t));
-		break;
-	case SYS_sendto:
-		fd = va_arg(ap, int);
-		if (fd == 0)
-			ret = shell_send(fd, va_arg(ap, const void *), va_arg(ap, size_t), va_arg(ap, int));
-		else
-			ret = shell_sendto(fd, va_arg(ap, const void *), va_arg(ap, size_t), va_arg(ap, int), va_arg(ap, const struct sockaddr *), va_arg(ap, socklen_t));
-		break;
-	case SYS_setsockopt:
-		ret = shell_setsockopt(va_arg(ap, int), va_arg(ap, int), va_arg(ap, int), va_arg(ap, const void *), va_arg(ap, socklen_t));
-		break;
-	case SYS_shutdown:
-		ret = shell_shutdown(va_arg(ap, int), va_arg(ap, int));
-		break;
-	case SYS_sched_get_priority_max:
-		no_implement("sched_get_priority_max\n");
-		break;
-	case SYS_sched_get_priority_min:
-		no_implement("sched_get_priority_min\n");
-		break;
-	case SYS_sched_getaffinity:
-		no_implement("sched_getaffinity\n");
-		break;
-	case SYS_sched_getparam:
-		no_implement("sched_getparam\n");
-		break;
-	case SYS_sched_getscheduler:
-		no_implement("sched_getscheduler\n");
-		break;
-	case SYS_sched_rr_get_interval:
-		no_implement("sched_rr_get_interval\n");
-		break;
-	case SYS_sched_setaffinity:
-		no_implement("sched_setaffinity\n");
-		break;
-	case SYS_sched_setparam:
-		no_implement("sched_setparam\n");
-		break;
-	case SYS_sched_setscheduler:
-		no_implement("sched_setscheduler\n");
-		break;
-	case SYS_sched_yield:
-		no_implement("sched_yield\n");
-		break;
-	case SYS_semctl:
-		no_implement("semctl\n");
-		break;
-	case SYS_semget:
-		no_implement("semget\n");
-		break;
-	case SYS_semop:
-		no_implement("semop\n");
-		break;
-	case SYS_semtimedop:
-		no_implement("semtimedop\n");
-		break;
-	case SYS_sendfile64:
-		no_implement("sendfile\n");
-		break;
-	case SYS_sendmmsg:
-		no_implement("sendmmsg\n");
-		break;
-	case SYS_set_robust_list:
-		no_implement("set_robust_list\n");
-		break;
-#ifdef SYS_set_thread_area
-	case SYS_set_thread_area:
-		thread_area = va_arg(ap, void *);
-		ret = 0;
-		break;
-#endif
-	case SYS_set_tid_address:
-		tid_address = va_arg(ap, void *);
-		ret = 0;
-		break;
-	case SYS_setdomainname:
-		no_implement("setdomainname\n");
-		break;
-	case SYS_setfsgid32:
-		no_implement("setfsgid\n");
-		break;
-	case SYS_setfsuid32:
-		no_implement("setfsuid\n");
-		break;
-	case SYS_setgroups32:
-		no_implement("setgroups\n");
-		break;
-	case SYS_sethostname:
-		no_implement("sethostname\n");
-		break;
-	case SYS_setitimer:
-		no_implement("setitimer\n");
-		break;
-	case SYS_setns:
-		no_implement("setns\n");
-		break;
-	case SYS_setpgid:
-		no_implement("setpgid\n");
-		break;
-	case SYS_setpriority:
-		no_implement("setpriority\n");
-		break;
-	case SYS_setrlimit:
-		no_implement("setrlimit\n");
-		break;
-	case SYS_setsid:
-		no_implement("setsid\n");
-		break;
-	case SYS_settimeofday:
-		no_implement("settimeofday\n");
-		break;
-	case SYS_setxattr:
-		no_implement("setxattr\n");
-		break;
-	case SYS_shmat:
-		no_implement("shmat\n");
-		break;
-	case SYS_shmctl:
-		no_implement("shmctl\n");
-		break;
-	case SYS_shmdt:
-		no_implement("shmdt\n");
-		break;
-	case SYS_shmget:
-		no_implement("shmget\n");
-		break;
-	case SYS_sigaltstack:
-		no_implement("sigaltstack\n");
-		break;
-	case SYS_signalfd:
-		no_implement("signalfd\n");
-		break;
-	case SYS_signalfd4:
-		no_implement("signalfd4\n");
-		break;
-	case SYS_socket:
-		ret = shell_socket(va_arg(ap, int), va_arg(ap, int), va_arg(ap, int));
-		break;
-	case SYS_splice:
-		no_implement("splice\n");
-		break;
-	case SYS_stat64:
-		ret = shell_stat(va_arg(ap, const char *), va_arg(ap, struct stat *));
-		break;
-	case SYS_statfs64:
-		no_implement("statfs64\n");
-		break;
-	case SYS_swapoff:
-		no_implement("swapoff\n");
-		break;
-	case SYS_swapon:
-		no_implement("swapon\n");
-		break;
-	case SYS_symlink:
-		no_implement("symlink\n");
-		break;
-	case SYS_symlinkat:
-		no_implement("symlinkat\n");
-		break;
-	case SYS_sync:
-		no_implement("sync\n");
-		break;
-#ifdef SYS_sync_file_range
-	case SYS_sync_file_range:
-		no_implement("sync_file_range\n");
-		break;
-#endif
-	case SYS_sync_file_range2:
-		no_implement("sync_file_range2\n");
-		break;
-	case SYS_syncfs:
-		no_implement("syncfs\n");
-		break;
-	case SYS_sysinfo:
-		no_implement("sysinfo\n");
-		break;
-	case SYS_syslog:
-		no_implement("syslog\n");
-		break;
-	case SYS_tee:
-		no_implement("tee\n");
-		break;
-	case SYS_tgkill:
-		no_implement("tgkill\n");
-		break;
-	case SYS_timer_create:
-		no_implement("timer_create\n");
-		break;
-	case SYS_timer_delete:
-		no_implement("timer_delete\n");
-		break;
-	case SYS_timer_getoverrun:
-		no_implement("timer_getoverrun\n");
-		break;
-	case SYS_timer_gettime:
-		no_implement("timer_gettime\n");
-		break;
-	case SYS_timer_settime:
-		no_implement("timer_settime\n");
-		break;
-	case SYS_timerfd_create:
-		no_implement("timerfd_create\n");
-		break;
-	case SYS_timerfd_gettime:
-		no_implement("timerfd_gettime\n");
-		break;
-	case SYS_timerfd_settime:
-		no_implement("timerfd_settime\n");
-		break;
-	case SYS_times:
-		no_implement("times\n");
-		break;
-	case SYS_tkill:
-		ret = shell_tkill(va_arg(ap, int), va_arg(ap, int));
-		break;
-	case SYS_truncate64:
-		no_implement("truncate\n");
-		break;
-	case SYS_ugetrlimit:
-		no_implement("ugetrlimit\n");
-		break;
-	case SYS_umask:
-		no_implement("umask\n");
-		break;
-	case SYS_umount2:
-		no_implement("umount2\n");
-		break;
-	case SYS_uname:
-		ret = shell_uname(va_arg(ap, struct utsname *));
-		break;
-	case SYS_unlink:
-		ret = shell_unlink(va_arg(ap, const char *));
-		break;
-	case SYS_unlinkat:
-		no_implement("unlinkat\n");
-		break;
-	case SYS_unshare:
-		no_implement("unshare\n");
-		break;
-	case SYS_utimensat:
-		no_implement("utimensat\n");
-		break;
-	case SYS_utimes:
-		no_implement("utimes\n");
-		break;
-	case SYS_vhangup:
-		no_implement("vhangup\n");
-		break;
-	case SYS_vmsplice:
-		no_implement("vmsplice\n");
-		break;
-	case SYS_wait4:
-		no_implement("wait4\n");
-		break;
-	case SYS_waitid:
-		no_implement("waitid\n");
-		break;
-	case SYS_write:
-		ret = shell_write(va_arg(ap, int), va_arg(ap, const void *), va_arg(ap, size_t));
-		break;
-	case SYS_writev:
-		ret = shell_writev(va_arg(ap, int), va_arg(ap, const struct iovec *), va_arg(ap, size_t));
-		break;
-	default:
-		DebugBreak();
-	}
-
-	va_end(ap);
-
-	shellif_outof();
-
-	return ret;
-}
+
+long SYS_set_tid_address(long a) {
+	tid_address = (void *)a;
+	return 0;
+}
+
+long SYS_socket(long a, long b, long c) {
+	return shell_socket((int)a, (int)b, (int)c);
+}
+
+long SYS_stat64(long a, long b) {
+	return shell_stat((const char *)a, (struct stat *)b);
+}
+
+long SYS_tkill(long a, long b) {
+	return shell_tkill((int)a, (int)b);
+}
+
+long SYS_uname(long a) {
+	return shell_uname((struct utsname *)a);
+}
+
+long SYS_unlink(long a) {
+	return shell_unlink((const char *)a);
+}
+
+long SYS_utimensat() {
+	return no_implement("utimensat\n");
+}
+
+long SYS_utimes() {
+	return no_implement("utimes\n");
+}
+
+long SYS_write(long a, long b, long c) {
+	return shell_write((int)a, (const void *)b, (size_t)c);
+}
+
+long SYS_writev(long a, long b, long c) {
+	return shell_writev((int)a, (const struct iovec *)b, (size_t)c);
+}
