Index: asp3_wo_tecs/trunk/README.txt
===================================================================
--- asp3_wo_tecs/trunk/README.txt	(revision 303)
+++ asp3_wo_tecs/trunk/README.txt	(revision 304)
@@ -1,4 +1,4 @@
 
-	TOPPERS/ASP3 Kernelï¼Release 3.B.0ï¼
+	TOPPERS/ASP3 Kernelï¼Release 3.0.0ï¼
 		Toyohashi Open Platform for Embedded Real-Time Systems/
 		Advanced Standard Profile Kernel
@@ -16,6 +16,8 @@
 
 ASP3ã«ã¼ãã«ã®ä»æ§æ¦è¦ãdoc/asp_spec.txtã«ï¼ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ã
-doc/user.txtã«ããã¾ãï¼ASP3ã«ã¼ãã«ãä½¿ç¨ããå ´åã«ã¯ï¼ã¾ãã¯ãããã®
-ãã­ã¥ã¡ã³ãããèª­ã¿ä¸ããï¼
+doc/user.txtã«ããã¾ãï¼ã¾ãï¼å¾æ¥ã®TOPPERSã«ã¼ãã«ããASP3ã«ã¼ãã«ã¸ç§»
+è¡ããããã®æ¹æ³ãè¨è¿°ãããã¤ã°ã¬ã¼ã·ã§ã³ã¬ã¤ããdoc/migration.txtã«ã
+ãã¾ãï¼ASP3ã«ã¼ãã«ãä½¿ç¨ããå ´åã«ã¯ï¼ã¾ãã¯ãããã®ãã­ã¥ã¡ã³ããã
+èª­ã¿ä¸ããï¼
 
 ããã¡ã¤ã«ã®é²è¦§ã«ããã£ã¦ã
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/Makefile.core
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/Makefile.core	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/Makefile.core	(revision 304)
@@ -36,10 +36,10 @@
 #  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
 #
-CFG_TABS := $(CFG_TABS) --cfg1-def-table $(COREDIR)/core_def.csv 
+CFG_TABS := $(CFG_TABS) --symval-table $(COREDIR)/core_sym.def
 
 #
 #  ãªãã»ãããã¡ã¤ã«çæã®ããã®å®ç¾©
 #
-OFFSET_TF = $(COREDIR)/core_offset.tf
+TARGET_OFFSET_TRB = $(COREDIR)/core_offset.trb
 
 #
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/arm_insn.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/arm_insn.h	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/arm_insn.h	(revision 304)
@@ -5,5 +5,5 @@
  *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
  *                              Toyohashi Univ. of Technology, JAPAN
- *  Copyright (C) 2006-2015 by Embedded and Real-Time Systems Laboratory
+ *  Copyright (C) 2006-2016 by Embedded and Real-Time Systems Laboratory
  *              Graduate School of Information Science, Nagoya Univ., JAPAN
  * 
@@ -52,5 +52,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: arm_insn.h 438 2015-08-09 01:37:47Z ertl-hiro $
+ *  $Id: arm_insn.h 547 2016-01-16 06:26:08Z ertl-hiro $
  */
 
@@ -365,4 +365,11 @@
  *  ã§ã¯æå¤§ç¯å²ï¼ã·ã¹ãã å
 ¨ä½ï¼ãªã¼ãï¼ã©ã¤ãã®ä¸¡æ¹ï¼ã§åæãåãï¼
+ *
+ *  ARMv5ä»¥åã§ã¯ï¼ã¡ã¢ãªããªã¢æ©è½ã¯å®è£
+ä¾å­ã§ããããï¼ããããï¼
+ *  DATA_MEMORY_BARRIERï¼DATA_SYNC_BARRIERï¼INST_SYNC_BARRIERãå®ç¾©ãã
+ *  ãã¨ã«ãã£ã¦ï¼é¢æ°ã®å
+å®¹ãå
+¥ãæããããããã«ãã¦ããï¼
  */
 
@@ -377,9 +384,11 @@
 data_memory_barrier(void)
 {
-#if __TARGET_ARCH_ARM <= 6
+#ifdef DATA_MEMORY_BARRIER
+	DATA_MEMORY_BARRIER();
+#elif __TARGET_ARCH_ARM <= 6
 	CP15_DATA_MEMORY_BARRIER();
 #else /* __TARGET_ARCH_ARM <= 6 */
 	Asm("dmb":::"memory");
-#endif /* __TARGET_ARCH_ARM <= 6 */
+#endif
 }
 
@@ -396,9 +405,11 @@
 data_sync_barrier(void)
 {
-#if __TARGET_ARCH_ARM <= 6
+#ifdef DATA_SYNC_BARRIER
+	DATA_SYNC_BARRIER();
+#elif __TARGET_ARCH_ARM <= 6
 	CP15_DATA_SYNC_BARRIER();
 #else /* __TARGET_ARCH_ARM <= 6 */
 	Asm("dsb":::"memory");
-#endif /* __TARGET_ARCH_ARM <= 6 */
+#endif
 }
 
@@ -415,9 +426,11 @@
 inst_sync_barrier(void)
 {
-#if __TARGET_ARCH_ARM <= 6
+#ifdef INST_SYNC_BARRIER
+	INST_SYNC_BARRIER();
+#elif __TARGET_ARCH_ARM <= 6
 	CP15_INST_SYNC_BARRIER();
 #else /* __TARGET_ARCH_ARM <= 6 */
 	Asm("isb":::"memory");
-#endif /* __TARGET_ARCH_ARM <= 6 */
+#endif
 }
 
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core.tf
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core.tf	(revision 303)
+++ 	(revision )
@@ -1,83 +1,0 @@
-$
-$		ãã¹2ã®ã³ã¢ä¾å­ãã³ãã¬ã¼ãï¼ARMç¨ï¼
-$
-$  $Id: core.tf 349 2015-07-25 05:25:27Z ertl-hiro $
-$
-
-$
-$  æå¹ãªCPUä¾å¤ãã³ãã©çªå·
-$
-$EXCNO_VALID = { 0, 1, 2, 3, 4, 5 }$
-
-$
-$  DEF_EXCã§ä½¿ç¨ã§ããCPUä¾å¤ãã³ãã©çªå·
-$
-$EXCNO_DEFEXC_VALID = { 0, 1, 2, 3, 5 }$
-
-$
-$  æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
-$
-$INCLUDE "kernel/kernel.tf"$
-
-$
-$  å²è¾¼ã¿ãã³ãã©ãã¼ãã«
-$
-$FILE "kernel_cfg.c"$
-/*$NL$
-$SPC$*  Interrupt Handler Table$NL$
-$SPC$*/$NL$
-$NL$
-const FP _kernel_inh_table[TNUM_INHNO] = {$NL$
-$JOINEACH inhno INHNO_VALID ",\n"$
-	$TAB$$FORMAT("/* 0x%03x */", +inhno)$$SPC$
-	$IF LENGTH(INH.INHNO[inhno])$
-		(FP)($INH.INTHDR[inhno]$)
-	$ELSE$
-		(FP)(_kernel_default_int_handler)
-	$END$
-$END$$NL$
-};$NL$
-$NL$
-
-$
-$  å²è¾¼ã¿è¦æ±ã©ã¤ã³è¨­å®ãã¼ãã«
-$
-$IF USE_INTCFG_TABLE$
-
-$FILE "kernel_cfg.c"$
-/*$NL$
-$SPC$*  Interrupt Configuration Table$NL$
-$SPC$*/$NL$
-$NL$
-const uint8_t _kernel_intcfg_table[TNUM_INTNO] = {$NL$
-$JOINEACH intno INTNO_VALID ",\n"$
-	$TAB$$FORMAT("/* 0x%03x */", +intno)$$SPC$
-	$IF LENGTH(INT.INTNO[intno])$
-		1U
-	$ELSE$
-		0U
-	$END$
-$END$$NL$
-};$NL$
-$NL$
-$END$
-
-$
-$  CPUä¾å¤ãã³ãã©ãã¼ãã«
-$
-$FILE "kernel_cfg.c"$
-/*$NL$
-$SPC$*  CPU Exception Handler Table$NL$
-$SPC$*/$NL$
-$NL$
-const FP _kernel_exc_table[TNUM_EXCNO] = {$NL$
-$JOINEACH excno EXCNO_VALID ",\n"$ 
-	$TAB$$FORMAT("/* %d */", +excno)$$SPC$
-	$IF LENGTH(EXC.EXCNO[excno])$
-		(FP)($EXC.EXCHDR[excno]$)
-	$ELSE$
-		(FP)(_kernel_default_exc_handler)
-	$END$
-$END$$NL$
-};$NL$
-$NL$
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_check.tf
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_check.tf	(revision 303)
+++ 	(revision )
@@ -1,61 +1,0 @@
-$ 
-$		ãã¹3ã®ã³ã¢ä¾å­ãã³ãã¬ã¼ãï¼ARMç¨ï¼
-$ 
-$  $Id: core_check.tf 407 2015-08-02 21:57:33Z ertl-hiro $
-$
-
-$ 
-$  æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
-$ 
-$INCLUDE "kernel/kernel_check.tf"$
-
-$
-$  å²è¾¼ã¿ãã³ãã©ãã¼ãã«ã«é¢ãããã§ãã¯
-$
-$ DEF_INHã§ç»é²ããå²è¾¼ã¿ãã³ãã©ã®ã¿ãã§ãã¯ããï¼éã«è¨ãã¨ï¼ã³ã³ãã£
-$ ã®ã¥ã¬ã¼ã¿ã§çæããå²è¾¼ã¿ãã³ãã©ãï¼default_int_handlerã®ãã§ãã¯ã¯
-$ è¡ããªãï¼
-$
-$inh_table = SYMBOL("_kernel_inh_table")$
-$FOREACH inhno INH.ORDER_LIST$
-$	// å²è¾¼ã¿ãã³ãã©ã®å
-é ­çªå°ã®ãã§ãã¯ï¼»NGKI3056ï¼½
-	$inthdr = PEEK(inh_table + inhno * sizeof_FP, sizeof_FP)$
-	$IF CHECK_FUNC_ALIGN && (inthdr & (CHECK_FUNC_ALIGN - 1)) != 0$
-		$ERROR INH.TEXT_LINE[inhno]$E_PAR:$SPC$
-			$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is not aligned"),
-							"inthdr", INH.INTHDR[inhno], inhno, "DEF_INH")$
-		$END$
-	$END$
-	$IF CHECK_FUNC_NONNULL && inthdr == 0$
-		$ERROR INH.TEXT_LINE[inhno]$E_PAR:$SPC$
-			$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is null"),
-							"inthdr", INH.INTHDR[inhno], inhno, "DEF_INH")$
-		$END$
-	$END$
-$END$
-
-$
-$  CPUä¾å¤ãã³ãã©ãã¼ãã«ã«é¢ãããã§ãã¯
-$
-$ DEF_EXCã§ç»é²ããCPUä¾å¤ãã³ãã©ã®ã¿ãã§ãã¯ããï¼éã«è¨ãã¨ï¼
-$ default_exc_handlerã®ãã§ãã¯ã¯è¡ããªãï¼
-$
-$exc_table = SYMBOL("_kernel_exc_table")$
-$FOREACH excno EXC.ORDER_LIST$
-$	// CPUä¾å¤ãã³ãã©ã®å
-é ­çªå°ã®ãã§ãã¯ï¼»NGKI3135ï¼½
-	$exchdr = PEEK(exc_table + excno * sizeof_FP, sizeof_FP)$
-	$IF CHECK_FUNC_ALIGN && (exchdr & (CHECK_FUNC_ALIGN - 1)) != 0$
-		$ERROR EXC.TEXT_LINE[excno]$E_PAR:$SPC$
-			$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is not aligned"),
-							"exchdr", EXC.EXCHDR[excno], excno, "DEF_EXC")$
-		$END$
-	$END$
-	$IF CHECK_FUNC_NONNULL && exchdr == 0$
-		$ERROR EXC.TEXT_LINE[excno]$E_PAR:$SPC$
-			$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is null"),
-							"exchdr", EXC.EXCHDR[excno], excno, "DEF_EXC")$
-		$END$
-	$END$
-$END$
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_check.trb
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_check.trb	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_check.trb	(revision 304)
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+# 
+#		ãã¹3ã®çæã¹ã¯ãªããã®ã³ã¢ä¾å­é¨ï¼ARMç¨ï¼
+# 
+#  $Id: core_check.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#
+
+# 
+#  ã¿ã¼ã²ããéä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ã
+# 
+IncludeTrb("kernel/kernel_check.trb")
+
+#
+#  å²è¾¼ã¿ãã³ãã©ãã¼ãã«ã«é¢ãããã§ãã¯
+#
+# DEF_INHã§ç»é²ããå²è¾¼ã¿ãã³ãã©ã®ã¿ãã§ãã¯ããï¼éã«è¨ãã¨ï¼ã³ã³ãã£
+# ã®ã¥ã¬ã¼ã¿ã§çæããå²è¾¼ã¿ãã³ãã©ãï¼default_int_handlerã®ãã§ãã¯ã¯
+# è¡ããªãï¼
+#
+inhTable = SYMBOL("_kernel_inh_table")
+$cfgData[:DEF_INH].each do |id, params|
+  inthdr = PEEK(inhTable + params[:inhno] * $sizeof_FP, $sizeof_FP)
+
+  #	å²è¾¼ã¿ãã³ãã©ã®å
+é ­çªå°ã®ãã§ãã¯ï¼»NGKI3056ï¼½
+  if (inthdr & ($CHECK_FUNC_ALIGN - 1)) != 0
+    error_wrong_id("E_PAR", params, :inthdr, :inhno, "not aligned")
+  end
+  if $CHECK_FUNC_NONNULL == 1 && inthdr == 0
+    error_wrong_id("E_PAR", params, :inthdr, :inhno, "null")
+  end
+end
+
+#
+#  CPUä¾å¤ãã³ãã©ãã¼ãã«ã«é¢ãããã§ãã¯
+#
+# DEF_EXCã§ç»é²ããCPUä¾å¤ãã³ãã©ã®ã¿ãã§ãã¯ããï¼éã«è¨ãã¨ï¼
+# default_exc_handlerã®ãã§ãã¯ã¯è¡ããªãï¼
+#
+excTable = SYMBOL("_kernel_exc_table")
+$cfgData[:DEF_EXC].each do |id, params|
+  exchdr = PEEK(excTable + params[:excno] * $sizeof_FP, $sizeof_FP)
+
+  # CPUä¾å¤ãã³ãã©ã®å
+é ­çªå°ã®ãã§ãã¯ï¼»NGKI3135ï¼½
+  if (exchdr & ($CHECK_FUNC_ALIGN - 1)) != 0
+    error_wrong_id("E_PAR", params, :exchdr, :excno, "not aligned")
+  end
+  if $CHECK_FUNC_NONNULL == 1 && exchdr == 0
+    error_wrong_id("E_PAR", params, :exchdr, :excno, "null")
+  end
+end
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_def.csv
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_def.csv	(revision 303)
+++ 	(revision )
@@ -1,7 +1,0 @@
-TARGET_ARCH_ARM,__TARGET_ARCH_ARM
-USE_INTCFG_TABLE,#defined(USE_INTCFG_TABLE)
-sizeof_TCB,sizeof(TCB)
-offsetof_TCB_p_tinib,"offsetof(TCB,p_tinib)"
-offsetof_TCB_sp,"offsetof(TCB,tskctxb.sp)"
-offsetof_TCB_pc,"offsetof(TCB,tskctxb.pc)"
-offsetof_T_EXCINF_cpsr,"offsetof(T_EXCINF,cpsr)"
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_kernel.trb
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_kernel.trb	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_kernel.trb	(revision 304)
@@ -0,0 +1,131 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: core_kernel.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#		ãã¹2ã®çæã¹ã¯ãªããã®ã³ã¢ä¾å­é¨ï¼ARMç¨ï¼
+#
+
+#
+#  æå¹ãªCPUä¾å¤ãã³ãã©çªå·
+#
+$EXCNO_VALID = [ 0, 1, 2, 3, 4, 5 ]
+
+#
+#  DEF_EXCã§ä½¿ç¨ã§ããCPUä¾å¤ãã³ãã©çªå·
+#
+$EXCNO_DEFEXC_VALID = [ 0, 1, 2, 3, 5 ]
+
+#
+#  ã¿ã¼ã²ããéä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ã
+#
+IncludeTrb("kernel/kernel.trb")
+
+#
+#  å²è¾¼ã¿ãã³ãã©ãã¼ãã«
+#
+$kernelCfgC.comment_header("Interrupt Handler Table")
+
+$kernelCfgC.add("const FP _kernel_inh_table[TNUM_INHNO] = {")
+$INHNO_VALID.each_with_index do |inhnoVal, index|
+  $kernelCfgC.add(",") if index > 0
+  $kernelCfgC.append("\t/* 0x#{sprintf("%03x", inhnoVal)} */ ")
+  if $cfgData[:DEF_INH].has_key?(inhnoVal)
+    $kernelCfgC.append("(FP)(#{$cfgData[:DEF_INH][inhnoVal][:inthdr]})")
+  else
+    $kernelCfgC.append("(FP)(_kernel_default_int_handler)")
+  end
+end
+$kernelCfgC.add
+$kernelCfgC.add2("};")
+
+#
+#  å²è¾¼ã¿è¦æ±ã©ã¤ã³è¨­å®ãã¼ãã«
+#
+if $USE_INTCFG_TABLE == 1
+  $kernelCfgC.comment_header("Interrupt Configuration Table")
+
+  $kernelCfgC.add("const uint8_t _kernel_intcfg_table[TNUM_INTNO] = {")
+  $INTNO_VALID.each_with_index do |intnoVal, index|
+    $kernelCfgC.add(",") if index > 0
+    $kernelCfgC.append("\t/* 0x#{sprintf("%03x", intnoVal)} */ ")
+    if $cfgData[:CFG_INT].has_key?(intnoVal)
+      $kernelCfgC.append("1U")
+    else
+      $kernelCfgC.append("0U")
+    end
+  end
+  $kernelCfgC.add
+  $kernelCfgC.add2("};")
+end
+
+#
+#  CPUä¾å¤ãã³ãã©ãã¼ãã«
+#
+$kernelCfgC.comment_header("CPU Exception Handler Table")
+
+$kernelCfgC.add("const FP _kernel_exc_table[TNUM_EXCNO] = {")
+$EXCNO_VALID.each_with_index do |excnoVal, index|
+  $kernelCfgC.add(",") if index > 0
+  $kernelCfgC.append("\t/* #{excnoVal} */ ")
+  if $cfgData[:DEF_EXC].has_key?(excnoVal)
+    $kernelCfgC.append("(FP)(#{$cfgData[:DEF_EXC][excnoVal][:exchdr]})")
+  else
+    $kernelCfgC.append("(FP)(_kernel_default_exc_handler)")
+  end
+end
+$kernelCfgC.add
+$kernelCfgC.add2("};")
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_kernel_impl.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_kernel_impl.h	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_kernel_impl.h	(revision 304)
@@ -53,5 +53,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: core_kernel_impl.h 471 2015-12-30 10:03:16Z ertl-hiro $
+ *  $Id: core_kernel_impl.h 546 2016-01-16 06:00:09Z ertl-hiro $
  */
 
@@ -482,5 +482,7 @@
  *  å¤æãã¼ãã«ãã¼ã¹ã¬ã¸ã¹ã¿ï¼TTBRï¼ã®è¨­å®å¤
  */
-#if __TARGET_ARCH_ARM < 7
+#if __TARGET_ARCH_ARM < 6
+#define TTBR_CONFIG		0U
+#elif __TARGET_ARCH_ARM < 7
 #define TTBR_CONFIG		(CP15_TTBR_RGN_CACHEABLE|CP15_TTBR_RGN_SHAREABLE \
 												|CP15_TTBR_RGN_WBACK)
@@ -488,5 +490,5 @@
 #define TTBR_CONFIG		(CP15_TTBR_RGN_SHAREABLE|CP15_TTBR_RGN_WBWA \
 												|CP15_TTBR_IRGN_WBWA)
-#endif /* __TARGET_ARCH_ARM < 7 */
+#endif
 
 #ifndef TOPPERS_MACRO_ONLY
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_offset.tf
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_offset.tf	(revision 303)
+++ 	(revision )
@@ -1,22 +1,0 @@
-$
-$		ãªãã»ãããã¡ã¤ã«çæç¨ãã³ãã¬ã¼ãï¼ARMç¨ï¼
-$
-$  $Id: core_offset.tf 454 2015-08-16 03:18:46Z ertl-hiro $
-$
-
-$
-$  æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
-$
-$INCLUDE "kernel/genoffset.tf"$
-
-$
-$  ãã£ã¼ã«ãã®ãªãã»ããã®å®ç¾©ã®çæ
-$
-$DEFINE("TCB_p_tinib", offsetof_TCB_p_tinib)$
-$DEFINE("TCB_sp", offsetof_TCB_sp)$
-$DEFINE("TCB_pc", offsetof_TCB_pc)$
-$DEFINE("TINIB_exinf", offsetof_TINIB_exinf)$
-$DEFINE("TINIB_task", offsetof_TINIB_task)$
-$DEFINE("TINIB_stksz", offsetof_TINIB_stksz)$
-$DEFINE("TINIB_stk", offsetof_TINIB_stk)$
-$DEFINE("T_EXCINF_cpsr", offsetof_T_EXCINF_cpsr)$
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_offset.trb
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_offset.trb	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_offset.trb	(revision 304)
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+#
+#		ãªãã»ãããã¡ã¤ã«çæç¨Rubyãã³ãã¬ã¼ãï¼ARMç¨ï¼
+#
+#  $Id: core_offset.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#
+
+#
+#  ã¿ã¼ã²ããéä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ã
+#
+IncludeTrb("kernel/genoffset.trb")
+
+#
+#  ãã£ã¼ã«ãã®ãªãã»ããã®å®ç¾©ã®çæ
+#
+GenerateDefine("TCB_p_tinib", $offsetof_TCB_p_tinib)
+GenerateDefine("TCB_sp", $offsetof_TCB_sp)
+GenerateDefine("TCB_pc", $offsetof_TCB_pc)
+GenerateDefine("TINIB_exinf", $offsetof_TINIB_exinf)
+GenerateDefine("TINIB_task", $offsetof_TINIB_task)
+GenerateDefine("TINIB_stksz", $offsetof_TINIB_stksz)
+GenerateDefine("TINIB_stk", $offsetof_TINIB_stk)
+GenerateDefine("T_EXCINF_cpsr", $offsetof_T_EXCINF_cpsr)
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_rename.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_rename.h	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_rename.h	(revision 304)
@@ -63,67 +63,4 @@
 #define arm_memory_area				_kernel_arm_memory_area
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  kernel_cfg.c
- */
-#define _inh_table					__kernel_inh_table
-#define _intcfg_table				__kernel_intcfg_table
-#define _exc_table					__kernel_exc_table
-
-/*
- *  core_support.S
- */
-#define _dispatch					__kernel_dispatch
-#define _start_dispatch				__kernel_start_dispatch
-#define _exit_and_dispatch			__kernel_exit_and_dispatch
-#define _call_exit_kernel			__kernel_call_exit_kernel
-#define _start_r					__kernel_start_r
-#define _irq_handler				__kernel_irq_handler
-#define _undef_handler				__kernel_undef_handler
-#define _svc_handler				__kernel_svc_handler
-#define _pabort_handler				__kernel_pabort_handler
-#define _dabort_handler				__kernel_dabort_handler
-#define _fiq_handler				__kernel_fiq_handler
-#define _current_cpsr				__kernel_current_cpsr
-#define _set_cpsr					__kernel_set_cpsr
-
-/*
- *  core_kernel_impl.c
- */
-#define _excpt_nest_count			__kernel_excpt_nest_count
-#define _arm_mmu_initialize			__kernel_arm_mmu_initialize
-#define _core_initialize			__kernel_core_initialize
-#define _core_terminate				__kernel_core_terminate
-#define _xlog_sys					__kernel_xlog_sys
-#define _xlog_fsr					__kernel_xlog_fsr
-#define _default_int_handler		__kernel_default_int_handler
-#define _default_exc_handler		__kernel_default_exc_handler
-
-/*
- *  gic_kernel_impl.c
- */
-#define _gicc_initialize			__kernel_gicc_initialize
-#define _gicc_terminate				__kernel_gicc_terminate
-#define _gicd_initialize			__kernel_gicd_initialize
-#define _gicd_terminate				__kernel_gicd_terminate
-
-/*
- *  gic_support.S
- */
-#define _irc_begin_int				__kernel_irc_begin_int
-#define _irc_end_int				__kernel_irc_end_int
-#define _irc_get_intpri				__kernel_irc_get_intpri
-#define _irc_begin_exc				__kernel_irc_begin_exc
-#define _irc_end_exc				__kernel_irc_end_exc
-
-/*
- *  target_kernel_impl.c
- */
-#define _arm_tnum_memory_area		__kernel_arm_tnum_memory_area
-#define _arm_memory_area			__kernel_arm_memory_area
-
-#endif /* TOPPERS_LABEL_ASM */
-
 
 #endif /* TOPPERS_CORE_RENAME_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_sym.def
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_sym.def	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_sym.def	(revision 304)
@@ -0,0 +1,7 @@
+TARGET_ARCH_ARM,__TARGET_ARCH_ARM
+USE_INTCFG_TABLE,1,,defined(USE_INTCFG_TABLE)
+sizeof_TCB,sizeof(TCB)
+offsetof_TCB_p_tinib,"offsetof(TCB,p_tinib)"
+offsetof_TCB_sp,"offsetof(TCB,tskctxb.sp)"
+offsetof_TCB_pc,"offsetof(TCB,tskctxb.pc)"
+offsetof_T_EXCINF_cpsr,"offsetof(T_EXCINF,cpsr)"
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_unrename.h	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_unrename.h	(revision 304)
@@ -64,67 +64,4 @@
 #undef arm_memory_area
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  kernel_cfg.c
- */
-#undef _inh_table
-#undef _intcfg_table
-#undef _exc_table
-
-/*
- *  core_support.S
- */
-#undef _dispatch
-#undef _start_dispatch
-#undef _exit_and_dispatch
-#undef _call_exit_kernel
-#undef _start_r
-#undef _irq_handler
-#undef _undef_handler
-#undef _svc_handler
-#undef _pabort_handler
-#undef _dabort_handler
-#undef _fiq_handler
-#undef _current_cpsr
-#undef _set_cpsr
-
-/*
- *  core_kernel_impl.c
- */
-#undef _excpt_nest_count
-#undef _arm_mmu_initialize
-#undef _core_initialize
-#undef _core_terminate
-#undef _xlog_sys
-#undef _xlog_fsr
-#undef _default_int_handler
-#undef _default_exc_handler
-
-/*
- *  gic_kernel_impl.c
- */
-#undef _gicc_initialize
-#undef _gicc_terminate
-#undef _gicd_initialize
-#undef _gicd_terminate
-
-/*
- *  gic_support.S
- */
-#undef _irc_begin_int
-#undef _irc_end_int
-#undef _irc_get_intpri
-#undef _irc_begin_exc
-#undef _irc_end_exc
-
-/*
- *  target_kernel_impl.c
- */
-#undef _arm_tnum_memory_area
-#undef _arm_memory_area
-
-#endif /* TOPPERS_LABEL_ASM */
-
 
 #endif /* TOPPERS_CORE_RENAME_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_rename.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_rename.h	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_rename.h	(revision 304)
@@ -18,22 +18,4 @@
 
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  chip_kernel_impl.c
- */
-#define _chip_initialize			__kernel_chip_initialize
-#define _chip_terminate				__kernel_chip_terminate
-
-/*
- *  chip_timer.c
- */
-#define _target_hrt_initialize		__kernel_target_hrt_initialize
-#define _target_hrt_terminate		__kernel_target_hrt_terminate
-#define _target_hrt_handler			__kernel_target_hrt_handler
-
-
-#endif /* TOPPERS_LABEL_ASM */
-
 #include "core_rename.h"
 
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_unrename.h	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_unrename.h	(revision 304)
@@ -19,22 +19,4 @@
 
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  chip_kernel_impl.c
- */
-#undef _chip_initialize
-#undef _chip_terminate
-
-/*
- *  chip_timer.c
- */
-#undef _target_hrt_initialize
-#undef _target_hrt_terminate
-#undef _target_hrt_handler
-
-
-#endif /* TOPPERS_LABEL_ASM */
-
 #include "core_unrename.h"
 
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/Makefile.core
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/Makefile.core	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/Makefile.core	(revision 304)
@@ -92,13 +92,10 @@
 #  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
 #
-cfg1_out.c: $(COREDIR)/core_def.csv
-kernel_cfg.timestamp: $(COREDIR)/core.tf
-#CFG_TABS := $(CFG_TABS) --symval-table $(COREDIR)/core_sym.def
+CFG_TABS := $(CFG_TABS) --symval-table $(COREDIR)/core_sym.def
 
 #
 #  ãªãã»ãããã¡ã¤ã«çæã®ããã®å®ç¾©(ToDo)
 #
-OFFSET_TF = $(COREDIR)/core_offset.tf
-#TARGET_OFFSET_TRB = $(COREDIR)/core_offset.trb
+TARGET_OFFSET_TRB = $(COREDIR)/core_offset.trb
 
 #
@@ -153,7 +150,2 @@
 	CDEFS := $(CDEFS) -D$(FPU_ARCH_MACRO) -DTOPPERS_FPU_ENABLE -DTOPPERS_FPU_LAZYSTACKING -DTOPPERS_FPU_CONTEXT
 endif
-
-#
-#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
-#
-CFG_TABS := $(CFG_TABS) --cfg1-def-table $(COREDIR)/core_def.csv
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core.tf
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core.tf	(revision 303)
+++ 	(revision )
@@ -1,245 +1,0 @@
-$ ======================================================================
-$ 
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$  
-$   Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
-$                               Toyohashi Univ. of Technology, JAPAN
-$   Copyright (C) 2005-2015 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$  
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$  
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   @(#) $Id: core.tf 322 2015-04-30 13:23:48Z ertl-ishikawa $
-$
-$ =====================================================================
-
-$ 
-$     ãã¹2ã®ã¢ã¼ã­ãã¯ãã£ä¾å­ãã³ãã¬ã¼ãï¼ARM-Mç¨ï¼
-$ 
-
-$ 
-$  æå¹ãªå²è¾¼ã¿çªå·ï¼å²è¾¼ã¿ãã³ãã©çªå·
-$ 
-$INTNO_VALID = RANGE(15, TMAX_INTNO)$
-$INHNO_VALID = INTNO_VALID$
-
-$ 
-$  æå¹ãªCPUä¾å¤çªå·
-$  7,8ã¯ã¨ãã¥ã¬ã¼ããããä¾å¤
-$ 
-$EXCNO_VALID = { 2,3,4,5,6,7,8,11,12,14 }$
-
-$ 
-$  CRE_ISRã§ä½¿ç¨ã§ããå²è¾¼ã¿çªå·ã¨ããã«å¯¾å¿ããå²è¾¼ã¿ãã³ãã©çªå·
-$ 
-$INTNO_CREISR_VALID = INTNO_VALID$
-$INHNO_CREISR_VALID = INHNO_VALID$
-
-$ 
-$  DEF_INTï¼DEF_EXCã§ä½¿ç¨ã§ããå²è¾¼ã¿ãã³ãã©çªå·ï¼CPUä¾å¤ãã³ãã©çªå·
-$ 
-$INHNO_DEFINH_VALID = INHNO_VALID$
-$EXCNO_DEFEXC_VALID = EXCNO_VALID$
-
-$ 
-$  CFG_INTã§ä½¿ç¨ã§ããå²è¾¼ã¿çªå·ã¨å²è¾¼ã¿åªå
-åº¦
-$  æå¤§åªå
-åº¦ã¯BASEPRIã¬ã¸ã¹ã¿ã§ãã¹ã¯ã§ããªãåªå
-åº¦ï¼å
-é¨åªå
-åº¦'0'ï¼
-$  ãã®ããï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã§ã®ã¿æå®å¯è½ï¼
-$INTNO_CFGINT_VALID = INTNO_VALID$
-$INTPRI_CFGINT_VALID = RANGE(-(1 << TBITW_IPRI),-2)$
-           
-$ 
-$  kernel/kernel.tf ã®ã¿ã¼ã²ããä¾å­é¨
-$ 
-
-$ 
-$  TSKINICTXBã®åæåæ
-å ±ãçæ
-$ 
-$FUNCTION GENERATE_TSKINICTXB$
-    $SPC${
-    $SPC$$TSK.TINIB_STKSZ[ARGV[1]]$, 
-    $SPC$((void *)((char *)($TSK.TINIB_STK[ARGV[1]]$)
-    $SPC$+ ($TSK.TINIB_STKSZ[ARGV[1]]$))),
-    $SPC$},
-$END$
-
-$ 
-$  æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
-$ 
-$INCLUDE "kernel/kernel.tf"$
-
-$FILE "kernel_cfg.c"$
-
-/*$NL$
-$SPC$*  Target-dependent Definitions (ARM-M)$NL$
-$SPC$*/$NL$
-$NL$
-
-$ 
-$  ãã¯ã¿ã¼ãã¼ãã«
-$ 
-$NL$
-$NL$
-extern void start(void);$NL$
-$NL$
-__attribute__ ((section(".vector"))) $NL$
-const FP _kernel_vector_table[] =      $NL$ 
-{                                    $NL$
-	$TAB$(FP)(TOPPERS_ISTKPT(TOPPERS_ISTK, TOPPERS_ISTKSZ)),   // 0 The initial stack pointer $NL$
-	$TAB$(FP)start,                 // 1 The reset handler         $NL$
-
-$FOREACH excno {2,3,...,14}$ 
-	$IF excno == 11$
-        $TAB$(FP)(_exit_and_dispatch),      /* 11 SVCall handler */
-	$ELIF excno == 14$
-        $TAB$(FP)(_dispatch),      /* 14 PendSV handler */
-	$ELSE$
-		$TAB$(FP)(_kernel_core_exc_entry),
-	$END$
-	$SPC$$FORMAT("/* %d */", +excno)$$NL$
-$END$
-
-$FOREACH inhno INTNO_VALID$ 
-	$IF LENGTH(INH.INHNO[inhno]) && ((INH.INHATR[inhno] & TA_NONKERNEL) != 0)$
-		$TAB$(FP)($INH.INTHDR[inhno]$),
-	$ELSE$
-		$TAB$(FP)(_kernel_core_int_entry),
-	$END$
-	$SPC$$FORMAT("/* %d */", +inhno)$$NL$
-$END$
-
-
-$NL$};$NL$
-$NL$
-
-$NL$
-const FP _kernel_exc_tbl[] = $NL$
-{$NL$
-$FOREACH excno {0,1,...,14}$
-	$IF LENGTH(EXC.EXCNO[excno])$
-		$TAB$(FP)($EXC.EXCHDR[excno]$),
-	$ELSE$
-		$TAB$(FP)(_kernel_default_exc_handler),
-	$END$
-	$SPC$$FORMAT("/* %d */", +excno)$$NL$
-$END$
-
-
-$FOREACH inhno INTNO_VALID$
-	$IF LENGTH(INH.INHNO[inhno])$
-		$TAB$(FP)($INH.INTHDR[inhno]$),
-	$ELSE$
-		$TAB$(FP)(_kernel_default_int_handler),
-	$END$
-	$SPC$$FORMAT("/* %d */", +inhno)$$NL$
-$END$
-
-
-$NL$};$NL$
-$NL$
-
-$ 
-$  _kernel_bitpat_cfgintã®çæ
-$ 
-
-$bitpat_cfgint_num = 0$
-$bitpat_cfgint = 0$
-
-
-const uint32_t _kernel_bitpat_cfgint[
-$IF (TMAX_INTNO & 0x0f) == 0x00 $
-	$bitpat_cfgint_num = (TMAX_INTNO >> 4)$
-$ELSE$
-	$bitpat_cfgint_num = (TMAX_INTNO >> 4) + 1$
-$END$
-	$bitpat_cfgint_num$
-] = {$NL$
-$FOREACH num RANGE(0,(bitpat_cfgint_num-1))$
-$   //boost ã®ãã¼ã¸ã§ã³ã«ãã£ã¦æåãå¤ããããã®å¯¾ç­
-$   //http://www.toppers.jp/TOPPERS-USERS/201004/msg00034.html
-	$bitpat_cfgint = 1-1$
-	$FOREACH inhno RANGE(num*32, (num*32)+31)$
-		$IF LENGTH(INH.INHNO[inhno])$
-			$bitpat_cfgint = bitpat_cfgint | (1 << (inhno & 0x01f))$
-		$END$
-	$END$
-	$TAB$UINT32_C($FORMAT("0x%08x", bitpat_cfgint)$), $NL$
-$END$
-
-$NL$};$NL$
-$NL$
-
-
-$ 
-$  å²è¾¼ã¿åªå
-åº¦ãã¼ãã«ï¼å
-é¨è¡¨ç¾ï¼
-$ 
-const uint32_t _kernel_int_iipm_tbl[] = {$NL$
-$FOREACH excno {0,1,...,14}$
-	$TAB$$FORMAT("UINT32_C(0x%08x), /* 0x%03x */", 0, +excno)$$NL$
-$END$
-
-$FOREACH intno INTNO_VALID$
-	$IF LENGTH(INT.INTNO[intno])$
-		$intpri = (((1 << TBITW_IPRI) + INT.INTPRI[intno]) << (8 - TBITW_IPRI))$
-	$ELSE$
-$		// LSBã1ã«ãã¦ããã®ã¯ï¼å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªããã¨ãå¤
-$		// å¥ããããã§ããï¼
-		$intpri = 0 $
-	$END$
-	$TAB$$FORMAT("UINT32_C(0x%08x), /* 0x%03x */", intpri, +intno)$$NL$
-$END$
-$NL$};$NL$
-$NL$
-
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_cfg1_out.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_cfg1_out.h	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_cfg1_out.h	(revision 304)
@@ -61,5 +61,5 @@
  */
 
-void sta_ker(void){}
+void start(void){}
 
 /* 
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_check.tf
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_check.tf	(revision 303)
+++ 	(revision )
@@ -1,76 +1,0 @@
-$ ======================================================================
-$ 
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$  
-$   Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
-$                               Toyohashi Univ. of Technology, JAPAN
-$   Copyright (C) 2005-2014 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$  
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$  
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   @(#) $Id: core_check.tf 301 2015-01-07 04:57:01Z ertl-ishikawa $
-$
-$ =====================================================================
-
-$ 
-$ 		ãã¹3ã®ãã­ã»ããµä¾å­ãã³ãã¬ã¼ãï¼ARM-Mç¨ï¼
-$ 
-
-$ 
-$  ãã¹4ã®ãã­ã»ããµä¾å­ãã³ãã¬ã¼ãï¼ARM-Mç¨ï¼
-$  
-$FUNCTION GET_STK_TSKINICTXB$
-    $bottom = PEEK(ARGV[1] + offsetof_TINIB_TSKINICTXB_stk_bottom, sizeof_void_ptr)$
-    $size = PEEK(ARGV[1] + offsetof_TINIB_TSKINICTXB_stksz, sizeof_size_t)$
-    $RESULT = (bottom - size)$
-$END$
-
-$ 
-$  æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
-$ 
-$INCLUDE "kernel/kernel_check.tf"$
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_check.trb
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_check.trb	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_check.trb	(revision 304)
@@ -0,0 +1,78 @@
+# ======================================================================
+# 
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+#  
+#   Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+#                               Toyohashi Univ. of Technology, JAPAN
+#   Copyright (C) 2005-2014 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+#  
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+#  
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   @(#) $Id: core_check.tf 301 2015-01-07 04:57:01Z ertl-ishikawa $
+#
+# =====================================================================
+
+# 
+# 		ãã¹3ã®ãã­ã»ããµä¾å­ãã³ãã¬ã¼ãï¼ARM-Mç¨ï¼
+# 
+
+# 
+#  ãã¹4ã®ãã­ã»ããµä¾å­ãã³ãã¬ã¼ãï¼ARM-Mç¨ï¼
+#  
+def GetStackTskinictxb(key, params)
+    tinib = SYMBOL("_kernel_tinib_table")
+    tinib += $sizeof_TINIB * (key - 1)
+    bottom = PEEK(tinib + $offsetof_TINIB_TSKINICTXB_stk_bottom, $sizeof_void_ptr)
+    size = PEEK(tinib + $offsetof_TINIB_TSKINICTXB_stksz, $sizeof_size_t)
+    return (bottom - size)
+end
+
+# 
+#  ã¿ã¼ã²ããéä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ã
+# 
+IncludeTrb("kernel/kernel_check.trb")
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_check_.trb
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_check_.trb	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_check_.trb	(revision 304)
@@ -0,0 +1,76 @@
+# ======================================================================
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+#
+#   Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+#                               Toyohashi Univ. of Technology, JAPAN
+#   Copyright (C) 2005-2014 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+#
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+#
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+#
+#   @(#) $Id: core_check.tf 301 2015-01-07 04:57:01Z ertl-ishikawa $
+#
+# =====================================================================
+
+#
+# 		ãã¹3ã®ãã­ã»ããµä¾å­ãã³ãã¬ã¼ãï¼ARM-Mç¨ï¼
+#
+
+#
+#  ãã¹4ã®ãã­ã»ããµä¾å­ãã³ãã¬ã¼ãï¼ARM-Mç¨ï¼
+#
+def GetStackTskinictxb(key, params, tinib)
+    bottom = PEEK(tinib + $offsetof_TINIB_TSKINICTXB_stk_bottom, $sizeof_void_ptr)
+    size = PEEK(tinib + $offsetof_TINIB_TSKINICTXB_stksz, $sizeof_size_t)
+    return (bottom - size)
+end
+
+#
+#  ã¿ã¼ã²ããéä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ã
+#
+IncludeTrb("kernel/kernel_check.trb")
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_def.csv
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_def.csv	(revision 303)
+++ 	(revision )
@@ -1,9 +1,0 @@
-TMAX_INTNO,TMAX_INTNO
-TIPM_LOCK,TIPM_LOCK 
-TBITW_IPRI,TBITW_IPRI
-sizeof_TCB,sizeof(TCB)
-offsetof_TCB_p_tinib,"offsetof(TCB,p_tinib)"
-offsetof_TCB_pc,"offsetof(TCB,tskctxb.pc)"
-offsetof_TINIB_TSKINICTXB_stksz,"offsetof(TINIB,tskinictxb.stksz)"
-offsetof_TINIB_TSKINICTXB_stk_bottom,"offsetof(TINIB,tskinictxb.stk_bottom)"
-offsetof_TCB_sp,"offsetof(TCB,tskctxb.sp)"
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_kernel.trb
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_kernel.trb	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_kernel.trb	(revision 304)
@@ -0,0 +1,236 @@
+# ======================================================================
+# 
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+#  
+#   Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+#                               Toyohashi Univ. of Technology, JAPAN
+#   Copyright (C) 2005-2015 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+#  
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+#  
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   @(#) $Id: core.tf 322 2015-04-30 13:23:48Z ertl-ishikawa $
+#
+# =====================================================================
+
+# 
+#     ãã¹2ã®ã¢ã¼ã­ãã¯ãã£ä¾å­ãã³ãã¬ã¼ãï¼ARM-Mç¨ï¼
+# 
+
+# 
+#  æå¹ãªå²è¾¼ã¿çªå·ï¼å²è¾¼ã¿ãã³ãã©çªå·
+# 
+$INTNO_VALID = Array(15..$TMAX_INTNO.val)
+$INHNO_VALID = $INTNO_VALID
+
+# 
+#  æå¹ãªCPUä¾å¤çªå·
+#  7,8ã¯ã¨ãã¥ã¬ã¼ããããä¾å¤
+# 
+$EXCNO_VALID = [ 2,3,4,5,6,7,8,11,12,14 ]
+
+# 
+#  CRE_ISRã§ä½¿ç¨ã§ããå²è¾¼ã¿çªå·ã¨ããã«å¯¾å¿ããå²è¾¼ã¿ãã³ãã©çªå·
+# 
+$INTNO_CREISR_VALID = $INTNO_VALID
+$INHNO_CREISR_VALID = $INHNO_VALID
+
+# 
+#  DEF_INTï¼DEF_EXCã§ä½¿ç¨ã§ããå²è¾¼ã¿ãã³ãã©çªå·ï¼CPUä¾å¤ãã³ãã©çªå·
+# 
+$INHNO_DEFINH_VALID = $INHNO_VALID
+$EXCNO_DEFEXC_VALID = $EXCNO_VALID
+
+# 
+#  CFG_INTã§ä½¿ç¨ã§ããå²è¾¼ã¿çªå·ã¨å²è¾¼ã¿åªå
+åº¦
+#  æå¤§åªå
+åº¦ã¯BASEPRIã¬ã¸ã¹ã¿ã§ãã¹ã¯ã§ããªãåªå
+åº¦ï¼å
+é¨åªå
+åº¦'0'ï¼
+#  ãã®ããï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã§ã®ã¿æå®å¯è½ï¼
+$INTNO_CFGINT_VALID = $INTNO_VALID
+$INTPRI_CFGINT_VALID = Array(-(1 << $TBITW_IPRI.val)..-2)
+
+# 
+#  kernel/kernel.tf ã®ã¿ã¼ã²ããä¾å­é¨
+# 
+
+# 
+#  TSKINICTXBã®åæåæ
+å ±ãçæ
+# 
+def GenerateTskinictxb(key, params)
+   return("{" \
+          "\t#{params[:tinib_stksz]}, " \
+          "\t((void *)((char *)(#{params[:tinib_stk]}) + " \
+          "(#{params[:tinib_stksz]}))), " \
+          "},")
+end
+
+# 
+#  æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
+# 
+IncludeTrb("kernel/kernel.trb")
+
+$kernelCfgC.append(<<EOS)
+/*
+ *  Target-dependent Definitions (ARM-M)
+ */
+
+/* 
+ *  ãã¯ã¿ã¼ãã¼ãã«
+ */ 
+__attribute__ ((section(".vector")))
+const FP _kernel_vector_table[] = {
+    (FP)(TOPPERS_ISTKPT(_kernel_istack, ROUND_STK_T(DEFAULT_ISTKSZ))),   /* 0 The initial stack pointer */
+    (FP)start,                 /* 1 The reset handler */
+EOS
+Array(2..14).each { |excno|
+    if excno == 11
+        $kernelCfgC.add("    (FP)(_exit_and_dispatch),      /* 11 SVCall handler */")
+    elsif excno == 14
+        $kernelCfgC.add("    (FP)(_dispatch),      /* 14 PendSV handler */")
+    else
+        $kernelCfgC.add("    (FP)(_kernel_core_exc_entry), /* #{excno} */")
+    end
+}
+$INTNO_VALID.each { |inhno|
+    #if $cfgData[:DEF_INH][inhno]) && ((INH.INHATR[inhno] & TA_NONKERNEL) != 0)$
+    inh = $cfgData[:DEF_INH].select { |k,v| 
+        (v[:inhno] == inhno) && (v[:inhatr] & $TA_NONKERNEL)
+    }
+    if !inh.empty?
+        inh.each_value { |v|
+   	        $kernelCfgC.add("    (FP)(#{v[:inthdr]}), /* #{inhno} */")
+        }
+    else
+   	    $kernelCfgC.add("    (FP)(_kernel_core_int_entry), /* #{inhno} */")
+    end
+}
+$kernelCfgC.add2("};")
+
+$kernelCfgC.add("const FP _kernel_exc_tbl[] = {")
+Array(0..14).each { |excno|
+    exc = $cfgData[:DEF_EXC].select { |k,v| 
+        (v[:excno] == excno)
+    }
+    if !exc.empty?
+        exc.each_value { |v|
+   	        $kernelCfgC.add("   (FP)(#{v[:exchdr]}), /* #{excno} */")
+        }
+    else
+   	    $kernelCfgC.add("   (FP)(_kernel_default_exc_handler), /* #{excno} */")
+    end
+}
+$INTNO_VALID.each { |inhno|
+    inh = $cfgData[:DEF_INH].select { |k,v| 
+        (v[:inhno] == inhno)
+    }
+    if !inh.empty?
+        inh.each_value { |v|
+   	        $kernelCfgC.add("   (FP)(#{v[:inthdr]}), /* #{inhno} */")
+        }
+    else
+   	    $kernelCfgC.add("   (FP)(_kernel_default_int_handler), /* #{inhno} */")
+    end
+}
+$kernelCfgC.add2("};")
+
+# 
+#  _kernel_bitpat_cfgintã®çæ
+# 
+
+bitpat_cfgint_num = 0
+bitpat_cfgint = 0
+if ($TMAX_INTNO & 0x0f) == 0x00
+    bitpat_cfgint_num = ($TMAX_INTNO >> 4)
+else
+    bitpat_cfgint_num = ($TMAX_INTNO >> 4) + 1
+end
+
+$kernelCfgC.add
+$kernelCfgC.add("const uint32_t _kernel_bitpat_cfgint[#{bitpat_cfgint_num}] = {")
+Array(0..(bitpat_cfgint_num-1)).each { |num|
+    Array((num*32)..((num*32)+31)).each { |inhno|
+        inh = $cfgData[:DEF_INH].select { |k,v| 
+            (v[:inhno] == inhno)
+        }
+        if !inh.empty?
+            bitpat_cfgint = bitpat_cfgint | (1 << (inhno & 0x01f))
+        end
+    }
+    $kernelCfgC.add(sprintf("   UINT32_C(0x%08x),", bitpat_cfgint))
+}
+$kernelCfgC.add2("};")
+
+# 
+#  å²è¾¼ã¿åªå
+åº¦ãã¼ãã«ï¼å
+é¨è¡¨ç¾ï¼
+# 
+$kernelCfgC.add("const uint32_t _kernel_int_iipm_tbl[] = {")
+Array(0..14).each { |excno|
+    $kernelCfgC.add(sprintf("   UINT32_C(0x%08x), /* 0x%03x */", 0, excno))
+}
+$INTNO_VALID.each { |intno|
+    int = $cfgData[:CFG_INT].select { |k,v| 
+        (v[:intno] == intno)
+    }
+    intpri = 0
+    if !int.empty?
+        #	 LSBã1ã«ãã¦ããã®ã¯ï¼å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªããã¨ãå¤
+        #	 å¥ããããã§ããï¼
+        int.each_value { |v|
+       	    intpri = (((1 << $TBITW_IPRI) + v[:intpri]) << (8 - $TBITW_IPRI))
+        }
+    end
+    $kernelCfgC.add(sprintf("   UINT32_C(0x%08x), /* 0x%03x */", intpri, intno))
+}
+$kernelCfgC.add2("};")
+
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_kernel_impl.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_kernel_impl.h	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_kernel_impl.h	(revision 304)
@@ -482,5 +482,5 @@
  *  ã¹ã¿ã¼ãã¢ããã«ã¼ãã³ï¼start.Sï¼
  */
-extern void _kernel_start(void);
+extern void start(void);
 
 /*
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_offset.tf
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_offset.tf	(revision 303)
+++ 	(revision )
@@ -1,79 +1,0 @@
-$ ======================================================================
-$ 
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$  
-$   Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
-$                               Toyohashi Univ. of Technology, JAPAN
-$   Copyright (C) 2005-2014 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$  
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$  
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   @(#) $Id: core_offset.tf 301 2015-01-07 04:57:01Z ertl-ishikawa $
-$
-$ =====================================================================
-
-$
-$       ãªãã»ãããã¡ã¤ã«çæç¨ãã³ãã¬ã¼ããã¡ã¤ã«ï¼ARM-Mç¨ï¼
-$
-
-$
-$  æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
-$
-$INCLUDE "kernel/genoffset.tf"$
-
-$
-$  ãªãã»ããå¤ã®ãã¯ã­å®ç¾©ã®çæ
-$
-$DEFINE("TCB_p_tinib", offsetof_TCB_p_tinib)$
-$DEFINE("TCB_pc", offsetof_TCB_pc)$
-$DEFINE("TCB_sp", offsetof_TCB_sp)$
-
-$DEFINE("TINIB_exinf", offsetof_TINIB_exinf)$
-$DEFINE("TINIB_task", offsetof_TINIB_task)$
-$DEFINE("TINIB_stk_bottom", offsetof_TINIB_TSKINICTXB_stk_bottom)$
-
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_offset.trb
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_offset.trb	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_offset.trb	(revision 304)
@@ -0,0 +1,79 @@
+# ======================================================================
+# 
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+#  
+#   Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+#                               Toyohashi Univ. of Technology, JAPAN
+#   Copyright (C) 2005-2014 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+#  
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+#  
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   @(#) $Id: core_offset.tf 301 2015-01-07 04:57:01Z ertl-ishikawa $
+#
+# =====================================================================
+
+#
+#       ãªãã»ãããã¡ã¤ã«çæç¨ãã³ãã¬ã¼ããã¡ã¤ã«ï¼ARM-Mç¨ï¼
+#
+
+#
+#  ã¿ã¼ã²ããéä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ã
+#
+IncludeTrb("kernel/genoffset.trb")
+
+#
+#  ãªãã»ããå¤ã®ãã¯ã­å®ç¾©ã®çæ
+#
+GenerateDefine("TCB_p_tinib", $offsetof_TCB_p_tinib)
+GenerateDefine("TCB_pc", $offsetof_TCB_pc)
+GenerateDefine("TCB_sp", $offsetof_TCB_sp)
+
+GenerateDefine("TINIB_exinf", $offsetof_TINIB_exinf)
+GenerateDefine("TINIB_task", $offsetof_TINIB_task)
+GenerateDefine("TINIB_stk_bottom", $offsetof_TINIB_TSKINICTXB_stk_bottom)
+
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_rename.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_rename.h	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_rename.h	(revision 304)
@@ -40,44 +40,4 @@
 
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  core_kernel_impl.c
- */
-#define _exc_tbl					__kernel_exc_tbl
-#define _vector_table				__kernel_vector_table
-#define _lock_flag					__kernel_lock_flag
-#define _saved_iipm					__kernel_saved_iipm
-#define _default_exc_handler		__kernel_default_exc_handler
-#define _default_int_handler		__kernel_default_int_handler
-#define _config_int					__kernel_config_int
-#define _core_initialize			__kernel_core_initialize
-#define _core_terminate				__kernel_core_terminate
-#define _bitpat_cfgint				__kernel_bitpat_cfgint
-#define _set_exc_int_priority		__kernel_set_exc_int_priority
-#define _enable_exc					__kernel_enable_exc
-#define _disable_exc				__kernel_disable_exc
-
-/*
- *  core_support.S
- */
-#define _core_int_entry				__kernel_core_int_entry
-#define _core_exc_entry				__kernel_core_exc_entry
-#define _ret_int					__kernel_ret_int
-#define _ret_int_r					__kernel_ret_int_r
-#define _ret_exc					__kernel_ret_exc
-#define _svc_handler				__kernel_svc_handler
-#define _svc_vector_tbl				__kernel_svc_vector_tbl
-#define _start_r					__kernel_start_r
-#define _dispatcher					__kernel_dispatcher
-#define _dispatch					__kernel_dispatch
-#define _dispatch_r					__kernel_dispatch_r
-#define _start_dispatch				__kernel_start_dispatch
-#define _exit_and_dispatch			__kernel_exit_and_dispatch
-#define _call_exit_kernel			__kernel_call_exit_kernel
-
-
-#endif /* TOPPERS_LABEL_ASM */
-
 
 #endif /* TOPPERS_CORE_RENAME_H */
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_sym.def
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_sym.def	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_sym.def	(revision 304)
@@ -0,0 +1,9 @@
+TMAX_INTNO,TMAX_INTNO
+TIPM_LOCK,TIPM_LOCK 
+TBITW_IPRI,TBITW_IPRI
+sizeof_TCB,sizeof(TCB)
+offsetof_TCB_p_tinib,"offsetof(TCB,p_tinib)"
+offsetof_TCB_pc,"offsetof(TCB,tskctxb.pc)"
+offsetof_TINIB_TSKINICTXB_stksz,"offsetof(TINIB,tskinictxb.stksz)"
+offsetof_TINIB_TSKINICTXB_stk_bottom,"offsetof(TINIB,tskinictxb.stk_bottom)"
+offsetof_TCB_sp,"offsetof(TCB,tskctxb.sp)"
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_unrename.h	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_unrename.h	(revision 304)
@@ -41,44 +41,4 @@
 
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  core_kernel_impl.c
- */
-#undef _exc_tbl
-#undef _vector_table
-#undef _lock_flag
-#undef _saved_iipm
-#undef _default_exc_handler
-#undef _default_int_handler
-#undef _config_int
-#undef _core_initialize
-#undef _core_terminate
-#undef _bitpat_cfgint
-#undef _set_exc_int_priority
-#undef _enable_exc
-#undef _disable_exc
-
-/*
- *  core_support.S
- */
-#undef _core_int_entry
-#undef _core_exc_entry
-#undef _ret_int
-#undef _ret_int_r
-#undef _ret_exc
-#undef _svc_handler
-#undef _svc_vector_tbl
-#undef _start_r
-#undef _dispatcher
-#undef _dispatch
-#undef _dispatch_r
-#undef _start_dispatch
-#undef _exit_and_dispatch
-#undef _call_exit_kernel
-
-
-#endif /* TOPPERS_LABEL_ASM */
-
 
 #endif /* TOPPERS_CORE_RENAME_H */
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/stm32f4xx_stm32cube/chip_rename.def
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/stm32f4xx_stm32cube/chip_rename.def	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/stm32f4xx_stm32cube/chip_rename.def	(revision 304)
@@ -1,1 +1,1 @@
-INCLUDE "arm_m_gcc/common/core"
+INCLUDE "core"
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/stm32f4xx_stm32cube/chip_rename.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/stm32f4xx_stm32cube/chip_rename.h	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/stm32f4xx_stm32cube/chip_rename.h	(revision 304)
@@ -5,9 +5,4 @@
 
 
-#ifdef TOPPERS_LABEL_ASM
-
-
-#endif /* TOPPERS_LABEL_ASM */
-
 #include "core_rename.h"
 
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/stm32f4xx_stm32cube/chip_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/stm32f4xx_stm32cube/chip_unrename.h	(revision 303)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/stm32f4xx_stm32cube/chip_unrename.h	(revision 304)
@@ -6,9 +6,4 @@
 
 
-#ifdef TOPPERS_LABEL_ASM
-
-
-#endif /* TOPPERS_LABEL_ASM */
-
 #include "core_unrename.h"
 
Index: asp3_wo_tecs/trunk/cfg/MANIFEST
===================================================================
--- asp3_wo_tecs/trunk/cfg/MANIFEST	(revision 304)
+++ asp3_wo_tecs/trunk/cfg/MANIFEST	(revision 304)
@@ -0,0 +1,8 @@
+MANIFEST
+cfg.rb
+pass1.rb
+pass2.rb
+
+common/GenFile.rb
+common/StrVal.rb
+common/SRecord.rb
Index: asp3_wo_tecs/trunk/cfg/cfg.rb
===================================================================
--- asp3_wo_tecs/trunk/cfg/cfg.rb	(revision 304)
+++ asp3_wo_tecs/trunk/cfg/cfg.rb	(revision 304)
@@ -0,0 +1,557 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+#
+#  TOPPERS Configurator by Ruby
+#
+#  Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#  Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#              Graduate School of Information Science, Nagoya Univ., JAPAN
+#
+#  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#      ã¨ï¼
+#    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#        å ±åãããã¨ï¼
+#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#      å
+è²¬ãããã¨ï¼
+#
+#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#  ã®è²¬ä»»ãè² ããªãï¼
+#
+#  $Id: cfg.rb 32 2016-01-31 14:45:59Z ertl-hiro $
+#
+
+if ($0 == __FILE__)
+  TOOL_ROOT = File.expand_path(File.dirname(__FILE__)) + "/"
+  $LOAD_PATH.unshift(TOOL_ROOT)
+end
+
+require "pp"
+require "csv"
+require "optparse"
+require "pstore"
+require "common/GenFile.rb"
+require "common/StrVal.rb"
+require "common/SRecord.rb"
+
+#
+#  å®æ°å®ç¾©
+#
+# å
+±é
+VERSION = "1.0.0"
+
+# cfg1_outé¢ä¿
+CFG1_PREFIX        = "TOPPERS_cfg_"
+CFG1_MAGIC_NUM     = "TOPPERS_magic_number"
+CFG1_SIZEOF_SIGNED = "TOPPERS_sizeof_signed_t"
+CFG1_OUT_C         = "cfg1_out.c"
+CFG1_OUT_DB        = "cfg1_out.db"
+CFG1_OUT_SREC      = "cfg1_out.srec"
+CFG1_OUT_SYMS      = "cfg1_out.syms"
+CFG1_OUT_TIMESTAMP = "cfg1_out.timestamp"
+
+# cfg2_outé¢ä¿
+CFG2_OUT_DB        = "cfg2_out.db"
+
+#
+#  ã¨ã©ã¼çºçæç¡ãã©ã°
+#
+$errorFlag = false
+
+#
+#  ã¨ã©ã¼ï¼è­¦åè¡¨ç¤ºé¢æ°
+#
+# ä¸è¬çãªã¨ã©ã¼è¡¨ç¤ºï¼å¦çãä¸­æ­ï¼
+def error_exit(message, location = "")
+  location += " " if location != ""
+  abort("#{location}error: #{message}")
+end
+
+# ä¸è¬çãªã¨ã©ã¼è¡¨ç¤ºï¼å¦çãç¶ç¶ï¼
+def error(message, location = "")
+  location += " " if location != ""
+  STDERR.puts("#{location}error: #{message}")
+  $errorFlag = true
+end
+
+# ä¸è¬çãªè­¦åè¡¨ç¤º
+def warning(message, location = "")
+  location += " " if location != ""
+  STDERR.puts("#{location}warning: #{message}")
+end
+
+# ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã®æ§æè§£ææã®ã¨ã©ã¼
+$no_parse_error = 0
+def parse_error(cfgFile, message)
+  error(message, "#{cfgFile.getFileName()}:#{cfgFile.getLineNo}:")
+  if ($no_parse_error += 1) >= 10
+    error_exit("too many errors emitted, stopping now")
+  end
+end
+
+# éçAPIå¦çæã®ã¨ã©ã¼
+def error_api(params, message)
+  error(message, "#{params[:_file_]}:#{params[:_line_]}:")
+end
+
+# éçAPIå¦çæã®ã¨ã©ã¼ï¼ã¨ã©ã¼ã³ã¼ãä»ãï¼
+def error_ercd(errorCode, params, message)
+  error_api(params, "#{errorCode}: #{message}")
+end
+
+# éçAPIå¦çæã®è­¦å
+def warning_api(params, message)
+  warning(message, "#{params[:_file_]}:#{params[:_line_]}:")
+end
+
+# ãã©ã¡ã¼ã¿ã®ã¨ã©ã¼
+def error_wrong(errorCode, params, symbol, wrong)
+  error_ercd(errorCode, params, "#{symbol.to_s} `#{params[symbol]}'" \
+									" is #{wrong} in #{params[:apiname]}")
+end
+
+def error_wrong_id(errorCode, params, symbol, objid, wrong)
+  error_ercd(errorCode, params, "#{symbol.to_s} `#{params[symbol]}'" \
+				" is #{wrong} in #{params[:apiname]} of #{params[objid]}")
+end
+
+def error_wrong_sym(errorCode, params, symbol, symbol2, wrong)
+  error_ercd(errorCode, params, "#{symbol.to_s} `#{params[symbol]}'" \
+								" is #{wrong} in #{params[:apiname]}" \
+								" of #{symbol2.to_s} `#{params[symbol2]}'")
+end
+
+# ãã©ã¡ã¼ã¿ä¸æ­£ã®ã¨ã©ã¼
+def error_illegal(errorCode, params, symbol)
+  error_ercd(errorCode, params, "illegal #{symbol.to_s} `#{params[symbol]}'" \
+													" in #{params[:apiname]}")
+end
+
+def error_illegal_id(errorCode, params, symbol, objid)
+  error_ercd(errorCode, params, "illegal #{symbol.to_s} `#{params[symbol]}'" \
+								" in #{params[:apiname]} of #{params[objid]}")
+end
+
+def error_illegal_sym(errorCode, params, symbol, symbol2)
+  error_ercd(errorCode, params, "illegal #{symbol.to_s} `#{params[symbol]}'" \
+			" in #{params[:apiname]} of #{symbol2.to_s} `#{params[symbol2]}'")
+end
+
+#
+#  Stringã¯ã©ã¹ã®æ¡å¼µï¼äºéå¼ç¨ç¬¦ã§å²ã¾ããæå­åã®ä½æï¼å±éï¼
+#
+class String
+  #
+  #  äºéå¼ç¨ç¬¦ã§å²ã¾ããæå­åã®ä½æ
+  #
+  def quote
+    result = ""
+    self.chars do |c|
+      case c
+      when "'"
+        result += "\\\'"
+      when "\""
+        result += "\\\""
+      when "\0"
+        result += "\\0"
+      when "\a"
+        result += "\\a"
+      when "\b"
+        result += "\\b"
+      when "\f"
+        result += "\\f"
+      when "\n"
+        result += "\\n"
+      when "\r"
+        result += "\\r"
+      when "\t"
+        result += "\\t"
+      when "\v"
+        result += "\\v"
+      when "\\"
+        result += "\\\\"
+      else
+        result += c
+      end
+    end
+    return("\"" + result + "\"")
+  end
+
+  #
+  #  äºéå¼ç¨ç¬¦ã§å²ã¾ããæå­åã®å±é
+  #
+  def unquote
+    if /^\"(.*)\"$/m =~ self
+      str = $1
+      result = ""
+      while (/^(.*)\\(.*)$/m =~ str)
+        result += $1
+        str = $2
+        case str
+        when /^[aA](.*)$/m
+          result += "\a"
+          str = $1
+        when /^[bB](.*)$/m
+          result += "\b"
+          str = $1
+        when /^[fF](.*)$/m
+          result += "\f"
+          str = $1
+        when /^[nN](.*)$/m
+          result += "\n"
+          str = $1
+        when /^[rR](.*)$/m
+          result += "\r"
+          str = $1
+        when /^[tT](.*)$/m
+          result += "\t"
+          str = $1
+        when /^[vV](.*)$/m
+          result += "\v"
+          str = $1
+        when /^[xX]([0-9a-fA-F][0-9a-fA-F]?)(.*)$/m
+          result += $1.hex
+          str = $2
+        when /^([0-7][0-7]?[0-7]?)(.*)$/m
+          result += $1.oct
+          str = $2
+        when /^\\(.*)$/m
+          result += "\\"
+          str = $1
+        end
+      end
+      return(result + str)
+    else
+      return(self.dup)
+    end
+  end
+end
+
+#
+#  ã·ã³ãã«ãã¡ã¤ã«ã®èª­ã¿è¾¼ã¿
+#
+#  ä»¥ä¸ã®ã¡ã½ããã¯ï¼GNUã®nmãçæããã·ã³ãã«ãã¡ã¤ã«ã«å¯¾å¿ãã¦ããï¼
+#  å¥ã®ãã¼ã«ã«å¯¾å¿ããå ´åã«ã¯ï¼ãã®ã¡ã½ãããæ¸ãæããã°ããï¼
+#
+def ReadSymbolFile(symbolFileName)
+  begin
+    symbolFile = File.open(symbolFileName)
+  rescue Errno::ENOENT, Errno::EACCES => ex
+    abort(ex.message)
+  end
+
+  symbolAddress = {}
+  symbolFile.each do |line|
+    # ã¹ãã¼ã¹åºåãã§åè§£
+    fields = line.split(/\s+/)
+
+    # 3åã«ãªã£ã¦ããªãè¡ã¯é¤å¤
+    if (fields.size == 3)
+      symbolAddress[fields[2]] = fields[0].hex
+    end
+  end
+  symbolFile.close
+  return(symbolAddress)
+end
+
+#
+#  å¤åå¾ã·ã³ãã«ãã°ã­ã¼ãã«å¤æ°ã¨ãã¦å®ç¾©ãã
+#
+def DefineSymbolValue
+  $symbolValueTable.each do |symbolName, symbolData|
+    if symbolData.has_key?(:VALUE)
+        eval("$#{symbolName} = " \
+				"StrVal.new(\"#{symbolName}\", #{symbolData[:VALUE]})")
+    end
+ end
+end
+
+#
+#  ã¤ã³ã¯ã«ã¼ããã¹ãããã¡ã¤ã«ãæ¢ã
+#
+def SearchFilePath(fileName)
+  if File.exist?(fileName)
+    # æå®ãããã¡ã¤ã«ãã¹ã«å­å¨ãã
+    return fileName
+  elsif /^\./ =~ fileName
+    # ç¸å¯¾ãã¹ãæå®ãã¦ãã¦è¦ã¤ãããªãã£ãå ´åï¼å­å¨ããªããã®ã¨ãã
+    #ï¼æå³ããªããã¡ã¤ã«ãå¯¾è±¡ã¨ãªããã¨ãé²æ­¢ï¼
+    return nil
+  else
+    # åã¤ã³ã¯ã«ã¼ããã¹ãããã¡ã¤ã«å­å¨ãã§ãã¯
+    $includePaths.each do |includePath|
+      path = includePath + "/" + fileName
+      # è¦ã¤ãã£ããç¸å¯¾ãã¹ãè¿ã
+      if File.exist?(path)
+        return path
+      end
+    end
+    return nil
+  end
+end
+
+#
+#  æå®ããçæã¹ã¯ãªããï¼trbãã¡ã¤ã«ï¼ãæ¤ç´¢ãã¦loadãã
+#
+def IncludeTrb(fileName)
+  filePath = SearchFilePath(fileName)
+  if filePath.nil?
+    error_exit("`#{fileName}' not found")
+  else
+    load(filePath)
+  end
+end
+
+#
+#  ãã¹3ã®å¦ç
+#
+def Pass3
+  #
+  #  ãã¹2ããå¼ãæ¸¡ãããæ
+å ±ããã¡ã¤ã«ããèª­ã¿è¾¼ã
+  #
+  db = PStore.new(CFG2_OUT_DB)
+  db.transaction(true) do
+    $apiDefinition = db[:apiDefinition]
+    $symbolValueTable = db[:symbolValueTable]
+    $cfgFileInfo = db[:cfgFileInfo]
+    $includeFiles = db[:includeFiles]
+    $cfgData = db[:cfgData]
+    $asmLabel = db[:asmLabel]
+    $bLittleEndian = db[:bLittleEndian]
+  end
+
+  #
+  #  å¤åå¾ã·ã³ãã«ãã°ã­ã¼ãã«å¤æ°ã¨ãã¦å®ç¾©ãã
+  #
+  DefineSymbolValue()
+
+  #
+  #  çæã¹ã¯ãªããï¼trbãã¡ã¤ã«ï¼ãå®è¡ãã
+  #
+  $trbFileNames.each do |trbFileName|
+    IncludeTrb(trbFileName)
+  end
+end
+
+#
+#  çæã¹ã¯ãªããï¼trbãã¡ã¤ã«ï¼åãã®é¢æ°
+#
+def SYMBOL(symbol)
+  if !$romSymbol.nil? && $romSymbol.has_key?($asmLabel + symbol)
+    return $romSymbol[$asmLabel + symbol]
+  else
+    return nil
+  end
+end
+
+def BCOPY(startIData, startData, size)
+  if !$romImage.nil?
+    copyData = $romImage.get_data(startIData, size)
+    $romImage.set_data(startData, copyData)
+  end
+end
+
+def PEEK(address, size)
+  if !$romImage.nil?
+    return $romImage.get_value(address, size, false)
+  else
+    return nil
+  end
+end
+
+#
+#  ã°ã­ã¼ãã«å¤æ°ã®åæå
+#
+$kernel = nil
+$pass = nil
+$includePaths = []
+$trbFileNames = []
+$apiTableFileNames = []
+$symvalTableFileNames = []
+$romImageFileName = nil
+$romSymbolFileName = nil
+$dependencyFileName = nil
+$idInputFileName = nil
+$idOutputFileName = nil
+
+#
+#  ãªãã·ã§ã³ã®å¦ç
+#
+opt = OptionParser.new(banner="Usage: cfg.rb [options] CONFIG-FILE", 40)
+opt.version = VERSION
+opt.on("-k KERNEL", "--kernel KERNEL", "kernel profile name") do |val|
+  $kernel = val
+end
+opt.on("-p NUM", "--pass NUM", "processing pass number") do |val|
+  $pass = val
+end
+opt.on("-I PATH", "--include-path PATH", "include directory path") do |val|
+  $includePaths.push(val)
+end
+opt.on("-T TRB-FILE", "--trb-file TRB-FILE",
+								"generation script (trb file)") do |val|
+  $trbFileNames.push(val)
+end
+opt.on("--api-table API-TABLE-FILE", "static API table file") do |val|
+  $apiTableFileNames.push(val)
+end
+opt.on("--symval-table SYMVAL-TABLE-FILE", "symbol-value table file") do |val|
+  $symvalTableFileNames.push(val)
+end
+opt.on("--rom-image SREC-FILE", "rom image file (s-record)") do |val|
+  $romImageFileName = val
+end
+opt.on("--rom-symbol SYMS-FILE", "rom symbol table file (nm)") do |val|
+  $romSymbolFileName = val
+end
+opt.on("--id-input-file ID-FILE", "ID input file") do |val|
+  $idInputFileName = val
+end
+opt.on("--id-output-file ID-FILE", "ID output file") do |val|
+  $idOutputFileName = val
+end
+opt.on("--external-id", "generate object ID variables") do
+  $USE_EXTERNAL_ID = true
+end
+opt.on("-M [DEPEND-FILE]", "--print-dependencies [DEPEND-FILE]",
+										"dependency file") do |val|
+  $dependencyFileName = val.nil? ? "" : val
+end
+opt.on("-O", "--omit-output-db", "omit DB file output") do
+  $omitOutputDb = true
+end
+opt.on("-v", "--version", "show version number") do
+  abort(opt.ver)
+end
+opt.on("-h", "--help", "show help (this)") do
+  abort(opt.help)
+end
+
+begin
+  $configFileNames = opt.parse(ARGV)
+rescue OptionParser::ParseError
+  abort(opt.help)
+end
+
+#
+#  ãªãã·ã§ã³ã®ãã§ãã¯
+#
+# ä¾å­é¢ä¿åºåã¢ã¼ã
+if $pass.nil?
+  # ãã¹ã®æå®ã¯å¿
+é 
+  STDERR.puts("`--pass' option is mandatory")
+  abort(opt.help)
+elsif /^[123]$/ !~ $pass
+  STDERR.puts("pass number `#{$pass}' is not valid")
+  abort(opt.help)
+end
+
+# ãã¹1ã§ã¯ï¼éçAPIãã¼ãã«ã¯å¿
+é 
+if ($pass == "1" && $apiTableFileNames.empty?)
+  STDERR.puts("`--api-table' option must be specified in pass 1")
+  abort(opt.help)
+end
+
+# ãã¹1ä»¥å¤ã§ã¯ï¼çæã¹ã¯ãªããï¼trbãã¡ã¤ã«ï¼ãå¿
+é 
+if ($pass != "1" && $trbFileNames.empty?)
+  STDERR.puts("`--trb-file' must be specified except in pass 1")
+  abort(opt.help)
+end
+
+#
+#  æå®ãããã·ã³ãã«ãã¡ã¤ã«ã®èª­ã¿è¾¼ã¿
+#
+if !$romSymbolFileName.nil?
+  if File.exist?($romSymbolFileName)
+    $romSymbol = ReadSymbolFile($romSymbolFileName)
+  else
+    error_exit("`#{$romSymbolFileName}' not found")
+  end
+end
+
+#
+#  æå®ãããSã¬ã³ã¼ããã¡ã¤ã«ã®èª­ã¿è¾¼ã¿
+#
+if !$romImageFileName.nil?
+  if File.exist?($romImageFileName)
+    $romImage = SRecord.new($romImageFileName)
+  else
+    error_exit("`#{$romImageFileName}' not found")
+  end
+end
+
+#
+#  ãã¹ã«å¾ã£ã¦åå¦çãå®è¡
+#
+case $pass
+when "1"
+  load("pass1.rb")
+  Pass1()
+when "2"
+  load("pass2.rb")
+  Pass2()
+when "3"
+  Pass3()
+else
+  error_exit("invalid pass: #{$pass}")
+end
+
+# ã¨ã©ã¼çºçæã¯abortãã
+if $errorFlag
+  if ($0 == __FILE__)
+    abort()
+  else
+    # simplecovå¯¾å¿
+    raise()
+  end
+end
+
+#
+#  ä½æãããã¹ã¦ã®ãã¡ã¤ã«ãåºåãã
+#
+GenFile.output
+
+# 
+#  ã¿ã¤ã ã¹ã¿ã³ããã¡ã¤ã«ã®çæ
+# 
+if !$timeStampFileName.nil?
+  File.open($timeStampFileName, "w").close
+end
Index: asp3_wo_tecs/trunk/cfg/common/GenFile.rb
===================================================================
--- asp3_wo_tecs/trunk/cfg/common/GenFile.rb	(revision 304)
+++ asp3_wo_tecs/trunk/cfg/common/GenFile.rb	(revision 304)
@@ -0,0 +1,173 @@
+#!ruby -Ku
+#
+#  TOPPERS Configurator by Ruby
+#
+#  Copyright (C) 2015 by Embedded and Real-Time Systems Laboratory
+#              Graduate School of Information Science, Nagoya Univ., JAPAN
+#  Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#  Copyright (C) 2016 by APTJ Co., Ltd., JAPAN
+#
+#  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#      ã¨ï¼
+#    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#        å ±åãããã¨ï¼
+#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#      å
+è²¬ãããã¨ï¼
+#
+#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#  ã®è²¬ä»»ãè² ããªãï¼
+#
+#  $Id: GenFile.rb 25 2016-01-29 16:48:00Z ertl-hiro $
+#
+
+if ($0 == __FILE__)
+  TOOL_ROOT = File.expand_path(File.dirname(__FILE__) + "/")
+  $LOAD_PATH.unshift(TOOL_ROOT)
+end
+
+######################################################################
+# å®æ°å®ç¾©
+######################################################################
+NL  = "\n"
+TAB = "\t"
+
+######################################################################
+# ãã¡ã¤ã«ä½æã¯ã©ã¹å®ç¾©
+######################################################################
+class GenFile
+  @@hFileData = {}
+
+  def initialize(sName)
+    @sCurName = sName
+    if (!@@hFileData.has_key?(sName))
+      @@hFileData[@sCurName] = ""
+    end
+  end
+
+  # ãã¡ã¤ã«ãã¼ã¿ã«1è¡è¿½å ãã
+  def add(sCode = "")
+    @@hFileData[@sCurName].concat(sCode + NL)
+  end
+
+  # ãã¡ã¤ã«ãã¼ã¿ã«1è¡è¿½å ãã(æ¹è¡2å)
+  def add2(sCode = "")
+    add(sCode + NL)
+  end
+
+  # ãã¡ã¤ã«ãã¼ã¿ã®æ«å°¾ã«æå­åãè¿½å ãã
+  def append(sCode = "")
+    @@hFileData[@sCurName].concat(sCode)
+  end
+
+  # ãã¡ã¤ã«ãã¼ã¿ã®æ«å°¾ãæå®ããæå­ã®å ´åï¼ãã®æå­ãé¤å»ãã(æ¹è¡ãã¹ãã¼ã¹ãèæ
+®)
+  def chop_char(sChar, sCode = "")
+    # æ«å°¾ã®æ¹è¡ï¼ã¹ãã¼ã¹ãåãåºã
+    sChopped = ""
+    while (["\r", "\n", " "].include?(@@hFileData[@sCurName][-1]))
+      sChopped = @@hFileData[@sCurName][-1] + sChopped
+      @@hFileData[@sCurName].chop!()
+    end
+
+    # æ¹è¡ã³ã¼ããåãåºããå¾ã®æ«å°¾ãsCharã®å ´åé¤å»
+    if (@@hFileData[@sCurName][-1] == sChar)
+      @@hFileData[@sCurName].chop!()
+    end
+
+    # åãåºããã³ã¼ããæ»ãã¦ï¼æå­åãè¿½å 
+    append(sChopped + sCode)
+  end
+
+  # æå®ããæå­ã®å¾ã«ã¹ãã¼ã¹ãããå ´åï¼ã¹ãã¼ã¹ãé¤å»ãã
+  def chop_char_sp(sChar, sCode = "")
+    chop_char(sChar, sCode)
+    while (@@hFileData[@sCurName][-1] == " ")
+      @@hFileData[@sCurName].chop!()
+    end
+  end
+
+  # ãã¡ã¤ã«ãã¼ã¿ã®æ«å°¾ã","ã®å ´åï¼","ãé¤å»ãã
+  def chop_comma(sCode = "")
+    chop_char(",", sCode)
+  end
+
+  # ã«ã³ãã®å¾ã«ã¹ãã¼ã¹ãããå ´åï¼ã¹ãã¼ã¹ãé¤å»ãã
+  def chop_comma_sp(sCode = "")
+    chop_char_sp(",", sCode)
+  end
+
+  # ã³ã¡ã³ãããããè¿½å ãã
+  def comment_header(sComment)
+    # è¤æ°è¡å¯¾å¿
+    aString = sComment.split(NL)
+
+    add("/*")
+    aString.each{|sLine|
+      add(" *  " + sLine)
+    }
+    add2(" */")
+  end
+
+  # ãã¡ã¤ã«ãã¼ã¿ãè¡¨ç¤ºãã
+  def print()
+    puts(@@hFileData[@sCurName])
+  end
+
+  # å
+¨ãã¡ã¤ã«ãåºåãã
+  def self.output()
+    # ã¨ã©ã¼çºçæã¯åºåããªã
+    if ($error_flg == true)
+      return
+    end
+
+    @@hFileData.each{|sName, sData|
+      # æ¢ã«ãã¡ã¤ã«ãå­å¨ãï¼å·®åããªãå ´åã¯åºåããªã(ã¿ã¤ã ã¹ã¿ã³ããæ´æ°ããªã)
+      if (File.exist?(sName))
+        sCurrentData = File.read(sName)
+        if (sData == sCurrentData)
+          next
+        end
+      end
+      File.open(sName, "w") {|io|
+        puts("[#{File.basename($0)}] Generated #{sName}")
+        io.puts(sData)
+      }
+    }
+  end
+end
+
Index: asp3_wo_tecs/trunk/cfg/common/SRecord.rb
===================================================================
--- asp3_wo_tecs/trunk/cfg/common/SRecord.rb	(revision 304)
+++ asp3_wo_tecs/trunk/cfg/common/SRecord.rb	(revision 304)
@@ -0,0 +1,194 @@
+#!ruby -Ku
+#
+#  TOPPERS Configurator by Ruby
+#
+#  Copyright (C) 2015 by Embedded and Real-Time Systems Laboratory
+#              Graduate School of Information Science, Nagoya Univ., JAPAN
+#  Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#
+#  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#      ã¨ï¼
+#    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#        å ±åãããã¨ï¼
+#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#      å
+è²¬ãããã¨ï¼
+#
+#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#  ã®è²¬ä»»ãè² ããªãï¼
+#
+#  $Id: SRecord.rb 25 2016-01-29 16:48:00Z ertl-hiro $
+#
+
+######################################################################
+# Sã¬ã³ã¼ããã¡ã¤ã«å¦çã¯ã©ã¹å®ç¾©
+######################################################################
+class SRecord
+  def initialize(sFile)
+    @hSrecData = {}
+    @sOneLineData = ""
+    File.open(sFile){|cFile|
+      cFile.each{|sLine|
+        # ã¬ã³ã¼ãã¿ã¤ã
+        sType = sLine.slice(0, 2)
+
+        # ãã¼ã¿ã¬ã³ã¼ãã®ã¿å¦çãã
+        case sType
+        when "S1"
+          # ãã¼ã¿é·(ã¢ãã¬ã¹å[2byte]+ãã§ãã¯ãµã å1byteãæ¸ç®)
+          nLength = sLine.slice(2, 2).hex() - 2 - 1
+
+          # ã¢ãã¬ã¹(4æå­=2byte)
+          nAddress = sLine.slice(4, 4).hex()
+
+          # ãã¼ã¿(ãã®æç¹ã§ã¯æå­åã§åã£ã¦ãã)
+          sData = sLine.slice(8, nLength * 2)
+        when "S2"
+          # ãã¼ã¿é·(ã¢ãã¬ã¹å[3byte]+ãã§ãã¯ãµã å1byteãæ¸ç®)
+          nLength = sLine.slice(2, 2).hex() - 3 - 1
+
+          # ã¢ãã¬ã¹(6æå­=3byte)
+          nAddress = sLine.slice(4, 6).hex()
+
+          # ãã¼ã¿(ãã®æç¹ã§ã¯æå­åã§åã£ã¦ãã)
+          sData = sLine.slice(10, nLength * 2)
+        when "S3"
+          # ãã¼ã¿é·(ã¢ãã¬ã¹å[4byte]+ãã§ãã¯ãµã å1byteãæ¸ç®)
+          nLength = sLine.slice(2, 2).hex() - 4 - 1
+
+          # ã¢ãã¬ã¹(8æå­=4byte)
+          nAddress = sLine.slice(4, 8).hex()
+
+          # ãã¼ã¿(ãã®æç¹ã§ã¯æå­åã§åã£ã¦ãã)
+          sData = sLine.slice(12, nLength * 2)
+        else
+          nAddress = nil
+        end
+
+        if (!nAddress.nil?)
+          @hSrecData[nAddress] = sData
+        end
+      }
+    }
+    @hSrecData.freeze()
+
+    # å
+¨ãã¼ã¿ã1è¡ã«å¤æ(å
+é ­ã¢ãã¬ã¹ãåå¾ãã¦ãã)
+    @nHeadAddress = nil
+    nPreAddress = nil
+    nPreData = nil
+    @hSrecData.each{|nAddress, sData|
+      if (@nHeadAddress.nil?)
+        @nHeadAddress = nAddress
+      end
+
+      # ã¢ãã¬ã¹ãé£ãã å ´å0ã§åãã¦ãã
+      if (!nPreAddress.nil? && !nPreData.nil?)
+        nOffset = nAddress - nPreAddress
+        nDiff = nOffset - (nPreData.size() / 2)
+        if (nDiff > 0)
+          @sOneLineData += "0" * (nDiff * 2)
+        end
+      end
+      nPreAddress = nAddress
+      nPreData = sData
+
+      # å
+¨ãã¼ã¿ã«è¿½å 
+      @sOneLineData += sData
+    }
+  end
+
+  # ãã¼ã¿åå¾
+  def get_data(nAddress, nSize)
+    # ã¢ãã¬ã¹ç¯å²å¤ã®å ´å
+    nChkSize = ((nAddress - @nHeadAddress) * 2) + (nSize * 2)
+    if (nChkSize > @sOneLineData.size())
+      return nil
+    else
+      return @sOneLineData.slice(((nAddress - @nHeadAddress) * 2), (nSize * 2))
+    end
+  end
+
+  # ãã¼ã¿æ¸è¾¼ã¿
+  def set_data(nAddress, sData)
+    nIdx = (nAddress - @nHeadAddress) * 2
+    sData.chars{|sChar|
+      @sOneLineData[nIdx] = sChar
+      nIdx += 1
+    }
+  end
+
+  # å¤ã¨ãã¦ã®ãã¼ã¿åå¾
+  def get_value(nAddress, nSize, bSigned)
+    nReturnData = nil
+    sTargetData = get_data(nAddress, nSize)
+    if (sTargetData.nil?)
+      return nil
+    end
+
+    # ãªãã«ã¨ã³ãã£ã¢ã³ã®å ´åï¼ãã¤ããªã¼ãã¼ãéã«ãã
+    if ($bLittleEndian == true)
+      sReverseStr = ""
+      # å¾ããã2æå­ãã¤æãåºãï¼ä¸¦ã³æ¿ãã
+      while (sTargetData.size() != 0)
+        sReverseStr += sTargetData[-2]
+        sReverseStr += sTargetData[-1]
+        sTargetData.chop!().chop!()
+      end
+      sTargetData = sReverseStr
+    end
+
+    if (bSigned == false)
+      # ç¬¦å·ç¡ãã®å ´åï¼ãã®ã¾ã¾16é²æ°ã¨ãã¦è§£éãã
+      nReturnData = sTargetData.hex()
+    else
+      # 1æå­ç®ã2é²æ°ã®æå­åã§åå¾
+      sBin = sprintf("%04b", sTargetData[0].hex())
+      if (sBin[0] == "0")
+        # æ­£ã®æ°ã§ããã°ãã®ã¾ã¾å¤æ
+        nReturnData = sTargetData.hex()
+      else
+        # 2ã®è£æ°è¡¨ç¾ããè² ã®å¤ãåå¾
+        nBaseNum = ("0x1" + ("0" * nSize * 2)).hex()
+        nReturnData = (-1) * (nBaseNum - sTargetData.hex())
+      end
+    end
+
+    return nReturnData
+  end
+end
Index: asp3_wo_tecs/trunk/cfg/common/StrVal.rb
===================================================================
--- asp3_wo_tecs/trunk/cfg/common/StrVal.rb	(revision 304)
+++ asp3_wo_tecs/trunk/cfg/common/StrVal.rb	(revision 304)
@@ -0,0 +1,357 @@
+#!ruby -Ku
+#
+#  TOPPERS Configurator by Ruby
+#
+#  Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#              Graduate School of Information Science, Nagoya Univ., JAPAN
+#  Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#
+#  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#      ã¨ï¼
+#    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#        å ±åãããã¨ï¼
+#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#      å
+è²¬ãããã¨ï¼
+#
+#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#  ã®è²¬ä»»ãè² ããªãï¼
+#
+#  $Id: StrVal.rb 25 2016-01-29 16:48:00Z ertl-hiro $
+#
+
+######################################################################
+# æå­åï¼æ°å¤ã¯ã©ã¹å®ç¾©
+######################################################################
+class StrVal < String
+  def initialize(sStr, nVal = (sStr =~ /^[0-9]+$/) ? sStr.to_i() : nil)
+    @nVal = nVal
+    super(sStr)
+  end
+
+  # æ°å¤æ
+å ±ãè¿ã
+  def val()
+    return @nVal
+  end
+
+  # ã¤ã¬ã®ã¥ã©ã¼ãªä½¿ç¨æã®ã¨ã©ã¼
+  def unexpected_use(other, sExp)
+    if (!@nVal.nil?)
+      if (other.is_a?(StrVal) && other.val.nil?)
+        error_exit("`#{other}' don't have value", caller[1])
+      else
+        error_exit("`#{sExp}' can't use with `#{other.class}'", caller[1])
+      end
+    else
+      error_exit("`#{self}' don't have value", caller[1])
+    end
+  end
+
+  # æ¼ç®å­ãªã¼ãã¼ã©ã¤ã(tfã¨åç­ã®æ©è½ãå®ç¾)
+  alias_method :plus, :+
+  alias_method :asterisk, :*
+  alias_method :gt, :>
+  alias_method :lt, :<
+  alias_method :ge, :>=
+  alias_method :le, :<=
+  alias_method :eq, :==
+  alias_method :ne, :!=
+  alias_method :ls, :<<
+  def +(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal + other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal + other.val
+    else
+      plus(other)
+    end
+  end
+  def -(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal - other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal - other.val
+    else
+      unexpected_use(other, "-")
+    end
+  end
+  def *(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal * other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal * other.val
+    else
+      asterisk(other)
+    end
+  end
+  def /(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal / other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal / other.val
+    else
+      unexpected_use(other, "/")
+    end
+  end
+  def &(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal & other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal & other.val
+    else
+      unexpected_use(other, "&")
+    end
+  end
+  def |(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal | other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal | other.val
+    else
+      unexpected_use(other, "|")
+    end
+  end
+  def >(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal > other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal > other.val
+    else
+      gt(other)
+    end
+  end
+  def <(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal < other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal < other.val
+    else
+      lt(other)
+    end
+  end
+  def >=(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal >= other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal >= other.val
+    else
+      ge(other)
+    end
+  end
+  def <=(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal <= other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal <= other.val
+    else
+      le(other)
+    end
+  end
+  def ==(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal == other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal == other.val
+    else
+      eq(other)
+    end
+  end
+  def !=(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal != other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal != other.val
+    else
+      ne(other)
+    end
+  end
+  def >>(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal >> other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal >> other.val
+    else
+      unexpected_use(other, ">>")
+    end
+  end
+  def <<(other)
+    if (!@nVal.nil? && other.is_a?(Integer))
+      @nVal << other
+    elsif (!@nVal.nil? && other.is_a?(StrVal) && !other.val.nil?)
+      @nVal << other.val
+    else
+      ls(other)
+    end
+  end
+  def ~@
+    if (!@nVal.nil?)
+      ~@nVal
+    else
+      unexpected_use(nil, "~")
+    end
+  end
+
+  # ppãããã°æã®è¡¨ç¤ºæ¹å
+  def pretty_print(q)
+    if (!@nVal.nil?)
+      q.text("#{self}{#{@nVal}(#{sprintf("0x%x",@nVal)})}")
+    else
+      q.text("#{self}{-}")
+    end
+  end
+end
+
+######################################################################
+# æ´æ°ã¯ã©ã¹ã®æ¼ç®å­ãªã¼ãã¼ã©ã¤ã(tfã¨åç­ã®æ©è½ãå®ç¾)
+######################################################################
+class Fixnum
+  alias_method :plus, :+
+  alias_method :minus, :-
+  alias_method :asterisk, :*
+  alias_method :slash, :/
+  alias_method :ampersand, :&
+  alias_method :pipe, :|
+  alias_method :gt, :>
+  alias_method :lt, :<
+  alias_method :ge, :>=
+  alias_method :le, :<=
+  alias_method :eq, :==
+  alias_method :ne, :!=
+  alias_method :rs, :>>
+  alias_method :ls, :<<
+  def +(other)
+    other.is_a?(StrVal) ? plus(other.val) : plus(other)
+  end
+  def -(other)
+    other.is_a?(StrVal) ? minus(other.val) : minus(other)
+  end
+  def *(other)
+    other.is_a?(StrVal) ? asterisk(other.val) : asterisk(other)
+  end
+  def /(other)
+    other.is_a?(StrVal) ? slash(other.val) : slash(other)
+  end
+  def &(other)
+    other.is_a?(StrVal) ? ampersand(other.val) : ampersand(other)
+  end
+  def |(other)
+    other.is_a?(StrVal) ? pipe(other.val) : pipe(other)
+  end
+  def >(other)
+    other.is_a?(StrVal) ? gt(other.val) : gt(other)
+  end
+  def <(other)
+    other.is_a?(StrVal) ? lt(other.val) : lt(other)
+  end
+  def >=(other)
+    other.is_a?(StrVal) ? ge(other.val) : ge(other)
+  end
+  def <=(other)
+    other.is_a?(StrVal) ? le(other.val) : le(other)
+  end
+  def ==(other)
+    other.is_a?(StrVal) ? eq(other.val) : eq(other)
+  end
+  def !=(other)
+    other.is_a?(StrVal) ? ne(other.val) : ne(other)
+  end
+  def >>(other)
+    other.is_a?(StrVal) ? rs(other.val) : rs(other)
+  end
+  def <<(other)
+    other.is_a?(StrVal) ? ls(other.val) : ls(other)
+  end
+end
+
+class Bignum
+  alias_method :plus, :+
+  alias_method :minus, :-
+  alias_method :asterisk, :*
+  alias_method :slash, :/
+  alias_method :ampersand, :&
+  alias_method :pipe, :|
+  alias_method :gt, :>
+  alias_method :lt, :<
+  alias_method :ge, :>=
+  alias_method :le, :<=
+  alias_method :eq, :==
+  alias_method :ne, :!=
+  alias_method :rs, :>>
+  alias_method :ls, :<<
+  def +(other)
+    other.is_a?(StrVal) ? plus(other.val) : plus(other)
+  end
+  def -(other)
+    other.is_a?(StrVal) ? minus(other.val) : minus(other)
+  end
+  def *(other)
+    other.is_a?(StrVal) ? asterisk(other.val) : asterisk(other)
+  end
+  def /(other)
+    other.is_a?(StrVal) ? slash(other.val) : slash(other)
+  end
+  def &(other)
+    other.is_a?(StrVal) ? ampersand(other.val) : ampersand(other)
+  end
+  def |(other)
+    other.is_a?(StrVal) ? pipe(other.val) : pipe(other)
+  end
+  def >(other)
+    other.is_a?(StrVal) ? gt(other.val) : gt(other)
+  end
+  def <(other)
+    other.is_a?(StrVal) ? lt(other.val) : lt(other)
+  end
+  def >=(other)
+    other.is_a?(StrVal) ? ge(other.val) : ge(other)
+  end
+  def <=(other)
+    other.is_a?(StrVal) ? le(other.val) : le(other)
+  end
+  def ==(other)
+    other.is_a?(StrVal) ? eq(other.val) : eq(other)
+  end
+  def !=(other)
+    other.is_a?(StrVal) ? ne(other.val) : ne(other)
+  end
+  def >>(other)
+    other.is_a?(StrVal) ? rs(other.val) : rs(other)
+  end
+  def <<(other)
+    other.is_a?(StrVal) ? ls(other.val) : ls(other)
+  end
+end
Index: asp3_wo_tecs/trunk/cfg/pass1.rb
===================================================================
--- asp3_wo_tecs/trunk/cfg/pass1.rb	(revision 304)
+++ asp3_wo_tecs/trunk/cfg/pass1.rb	(revision 304)
@@ -0,0 +1,694 @@
+# -*- coding: utf-8 -*-
+#
+#  TOPPERS Configurator by Ruby
+#
+#  Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#  Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#              Graduate School of Information Science, Nagoya Univ., JAPAN
+#
+#  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#      ã¨ï¼
+#    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#        å ±åãããã¨ï¼
+#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#      å
+è²¬ãããã¨ï¼
+#
+#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#  ã®è²¬ä»»ãè² ããªãï¼
+#
+#  $Id: pass1.rb 32 2016-01-31 14:45:59Z ertl-hiro $
+#
+
+#
+#		ãã¹1ã®å¦ç
+#
+
+#
+#  å¤åå¾ã·ã³ãã«ãã¼ãã«ã¸ã®åºå®ç»é²
+#
+$symbolValueTable = {
+  "CHAR_BIT" => { :EXPR => "CHAR_BIT" },
+  "SCHAR_MAX" => { :EXPR => "SCHAR_MAX", :SIGNED => true },
+  "SCHAR_MIN" => { :EXPR => "SCHAR_MIN", :SIGNED => true },
+  "UCHAR_MAX" => { :EXPR => "UCHAR_MAX" },
+  "CHAR_MAX" => { :EXPR => "CHAR_MAX", :SIGNED => true },
+  "CHAR_MIN" => { :EXPR => "CHAR_MIN", :SIGNED => true },
+  "SHRT_MAX" => { :EXPR => "SHRT_MAX", :SIGNED => true },
+  "SHRT_MIN" => { :EXPR => "SHRT_MIN", :SIGNED => true },
+  "USHRT_MAX" => { :EXPR => "USHRT_MAX" },
+  "INT_MAX" => { :EXPR => "INT_MAX", :SIGNED => true },
+  "INT_MIN" => { :EXPR => "INT_MIN", :SIGNED => true },
+  "UINT_MAX" => { :EXPR => "UINT_MAX" },
+  "LONG_MAX" => { :EXPR => "LONG_MAX", :SIGNED => true },
+  "LONG_MIN" => { :EXPR => "LONG_MIN", :SIGNED => true },
+  "ULONG_MAX" => { :EXPR => "ULONG_MAX" }
+}
+
+#
+#  éçAPIãã¼ãã«ã¸ã®åºå®ç»é²
+#
+$apiDefinition = { "INCLUDE" =>
+  { :PARAM => [ { :NAME => :file, :STRING => true }]}}
+
+#
+#  éçAPIãã¼ãã«ã®èª­ã¿è¾¼ã¿
+#
+def ReadApiTableFile
+  $apiTableFileNames.each do |apiTableFileName|
+    if !File.exist?(apiTableFileName)
+      error_exit("`#{apiTableFileName}' not found")
+      next
+    end
+
+    apiFile = File.open(apiTableFileName)
+    apiFile.each do |line|
+      next if /^#/ =~ line			# ã³ã¡ã³ããã¹ã­ãã
+
+      fields = line.split(/\s+/)
+      staticApi = fields.shift
+      apiDef = { :API => staticApi }
+      apiParams = []
+      fields.each do |param|
+        case param
+        when /^(\W*)(\w+)(\W*)$/
+          prefix = $1
+          name = $2
+          postfix = $3
+          apiParam = { :NAME => name }
+
+          case prefix
+          when "#"					# ãªãã¸ã§ã¯ãè­å¥åï¼å®ç¾©ï¼
+            apiParam[:ID_DEF] = true
+          when "%"					# ãªãã¸ã§ã¯ãè­å¥åï¼åç
+§ï¼
+            apiParam[:ID_REF] = true
+          when "."					# ç¬¦å·ç¡ãæ´æ°å®æ°å¼ãã©ã¡ã¼ã¿
+            apiParam[:UNSIGNED] = true
+          when "+"					# ç¬¦å·ä»ãæ´æ°å®æ°å¼ãã©ã¡ã¼ã¿
+            apiParam[:SIGNED] = true
+          when "&"					# ä¸è¬æ´æ°å®æ°å¼ãã©ã¡ã¼ã¿
+            # do nothing
+          when "$"					# æå­åå®æ°å¼ãã©ã¡ã¼ã¿
+            apiParam[:STRING] = true
+          else
+            error_exit("`#{param}' is invalid")
+          end
+
+          case postfix
+          when "*"					# ã­ã¼ãæ±ºãããã©ã¡ã¼ã¿
+            apiDef[:KEYPAR] = name
+          when "?"					# ãªãã·ã§ã³ãã©ã¡ã¼ã¿
+            apiParam[:OPTIONAL] = true
+          when "\.\.\."				# ãªã¹ããã©ã¡ã¼ã¿
+            apiParam[:LIST] = true
+          end
+        
+        when /^([{}])$/				# {ã¨}
+          apiParam = { :BRACE => $1 }
+
+        else
+          error_exit("`#{param}' is invalid")
+        end
+        apiParams.push(apiParam)
+      end
+      apiDef[:PARAM] = apiParams
+      $apiDefinition[staticApi] = apiDef
+    end
+    apiFile.close
+  end
+end
+
+#
+#  å¤åå¾ã·ã³ãã«ãã¼ãã«ã®èª­ã¿è¾¼ã¿
+#
+def ReadSymvalTable
+  $symvalTableFileNames.each do |symvalTableFileName|
+    if !File.exist?(symvalTableFileName)
+      error_exit("`#{symvalTableFileName}' not found")
+      next
+    end
+
+    symvalCsv = CSV.open(symvalTableFileName)
+    symvalCsv.each do |record|
+      # å¤æ°å
+      if record[0].nil?
+        error_exit("invalid variable name in `#{fileName}'")
+      end
+
+      symbol = {}
+      variable = record[0]
+
+      # å¼
+      if record[1].nil? || record[1] == ""
+        symbol[:EXPR] = variable
+      else
+        symbol[:EXPR] = record[1]
+      end
+
+      # ç¬¦å·ãã©ã°
+      if !(record[2].nil? || record[2] == "" || /^[uU]/ =~ record[2])
+        symbol[:SIGNED] = true
+      end
+
+      # ã³ã³ãã¤ã«æ¡ä»¶
+      symbol[:CONDITION] = record[3]
+
+      # ã³ã³ãã¤ã«æ¡ä»¶ãæºããããªãæã®ããã©ã«ãå¤
+      symbol[:DEFAULT] = record[4]
+
+      $symbolValueTable[variable] = symbol
+    end
+    symvalCsv.close
+  end
+end
+
+#
+#  ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ããã®èª­ã¿è¾¼ã¿ã¯ã©ã¹
+#
+class ConfigFile
+  def initialize(fileName)
+    @cfgFileName = fileName
+    begin
+      @cfgFile = File.open(@cfgFileName)
+    rescue Errno::ENOENT, Errno::EACCES => ex
+      abort(ex.message)
+    end
+    @lineNo = 0
+    @withinComment = false
+  end
+
+  def close
+    @cfgFile.close
+  end
+
+  def getNextLine(withinApi)
+    line = @cfgFile.gets
+    return nil if line.nil?
+    @lineNo += 1
+
+    line.chomp!
+    if @withinComment
+      case line
+      when /\*\//						# Cè¨èªã¹ã¿ã¤ã«ã®ã³ã¡ã³ãçµäº
+        line.sub!(/^.*?\*\//, "")		# æåã®*/ã«ãããããã */
+        @withinComment = false
+      else
+        line = ""
+      end
+    end
+    if !@withinComment
+      line.gsub!(/\/\*.*?\*\//, "")		# Cè¨èªã¹ã¿ã¤ã«ã®ã³ã¡ã³ãã®é¤å»
+										# æåã®*/ã«ãããããã */
+      case line
+      when /^\s*#/						# ããªãã­ã»ããµãã£ã¬ã¯ãã£ã
+        if withinApi
+          parse_error(self, \
+					"preprocessor directive must not be within static API")
+          line = ""
+        end
+      when /\/\*/						# Cè¨èªã¹ã¿ã¤ã«ã®ã³ã¡ã³ãéå§
+        line.sub!(/\/\*.*$/, "")
+        @withinComment = true
+      when /\/\//						# C++è¨èªã¹ã¿ã¤ã«ã®ã³ã¡ã³ã
+        line.sub!(/\/\/.*$/, "")
+      end
+    end
+    return(line)
+  end
+
+  def getFileName
+    return(@cfgFileName)
+  end
+
+  def getLineNo
+    return(@lineNo)
+  end
+end
+
+#
+#  ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã®ãã¼ãµã¼ã¯ã©ã¹
+#
+class CfgParser
+  @@lastApiIndex = 0
+
+  def initialize
+    @line = ""
+    @skipComma = false						# æ¬¡ã,ã§ããã°èª­ã¿é£ã°ã
+  end
+
+  #
+  #  æå­åæ«ã¾ã§èª­ã
+  #
+  def parseString(cfgFile)
+    string = ""
+    begin
+      case @line
+      when /^([^"]*\\\\)(.*)$/				# \\ã¾ã§èª­ã
+        string += $1
+        @line = $2
+      when /^([^"]*\\\")(.*)$/				# \"ã¾ã§èª­ã
+        string += $1
+        @line = $2
+      when /^([^"]*\")(.*)$/				# "ã¾ã§èª­ã
+        string += $1
+        @line = $2
+        return(string)
+      else									# è¡æ«ã¾ã§èª­ã
+        string += @line + "\n"
+        @line = cfgFile.getNextLine(true)
+      end
+    end while (@line)
+    error_exit("unterminated string meets end-of-file")
+    return(string)
+  end
+
+  #
+  #  æå­æ«ã¾ã§èª­ã
+  #
+  def parseChar(cfgFile)
+    string = ""
+    begin
+      case @line
+      when /^([^']*\\\\)(.*)$/				# \\ã¾ã§èª­ã
+        string += $1
+        @line = $2
+      when /^([^']*\\\')(.*)$/				# \'ã¾ã§èª­ã
+        string += $1
+        @line = $2
+      when /^([^']*\')(.*)$/				# 'ã¾ã§èª­ã
+        string += $1
+        @line = $2
+        return(string)
+      else									# è¡æ«ã¾ã§èª­ã
+        string += @line + "\n"
+        @line = cfgFile.getNextLine(true)
+      end
+    end while (@line)
+    error_exit("unterminated string meets end-of-file")
+    return(string)
+  end
+
+  #
+  #  ãã©ã¡ã¼ã¿ã1ã¤èª­ã
+  #
+  # @lineã®å
+é ­ãããã©ã¡ã¼ã¿ã1ã¤èª­ãã§ï¼ãããæå­åã§è¿ãï¼èª­ãã ã
+  # ã©ã¡ã¼ã¿ã¯ï¼@lineããã¯åé¤ããï¼ãã©ã¡ã¼ã¿ã®éä¸­ã§è¡æ«ã«éããæã¯ï¼
+  # cfgFileããæ¬¡ã®è¡ãåãåºãï¼ãã¡ã¤ã«æ«ã«éããæã¯ï¼nilãè¿ãï¼
+  #
+  def parseParam(cfgFile)
+    param = ""								# èª­ãã æå­å
+    parenLevel = 0							# æ¬å¼§ã®ãã¹ãã¬ãã«
+  
+    skipComma = @skipComma
+    @skipComma = false
+
+    @line.lstrip!							# å
+é ­ã®ç©ºç½ãåé¤
+    while @line == ""						# ç©ºè¡ãèª­ã¿é£ã°ã
+      @line = cfgFile.getNextLine(true)
+      return nil if @line.nil?				# ãã¡ã¤ã«æ«ã§ããã°ãªã¿ã¼ã³
+      @line.lstrip!							# å
+é ­ã®ç©ºç½ãåé¤
+    end
+
+    begin
+      if parenLevel == 0
+        case @line
+        when /^(\s*,)(.*)$/					# ,
+          @line = $2
+          if param == "" && skipComma
+            skipComma = false
+            return(parseParam(cfgFile))		# åå¸°å¼ã³åºã
+          else
+            return(param)
+          end
+        when /^(\s*{)(.*)$/					# {
+          if param != ""
+            return(param)
+          else
+            @line = $2
+            return("{")
+          end
+        when /^(\s*\()(.*)$/				# (
+          param += $1
+          @line = $2
+          parenLevel += 1
+        when /^(\s*([)}]))(.*)$/			# }ã)
+          if param != ""
+            return(param)
+          else
+            @line = $3
+            @skipComma = true if $2 == "}"
+            return($2)
+          end
+        when /^(\s*\")(.*)$/				# "
+          @line = $2
+          param += $1 + parseString(cfgFile)
+        when /^(\s*\')(.*)$/				# '
+          @line = $2
+          param += $1 + parseChar(cfgFile)
+        when /^(\s*[^,{}()"'\s]+)(.*)$/		# ãã®ä»ã®æå­å
+          param += $1
+          @line = $2
+        else								# è¡æ«
+          param += "\n"
+          @line = cfgFile.getNextLine(true)
+        end
+      else
+        # æ¬å¼§å
+ã®å¦ç
+        case @line
+        when /^(\s*\()(.*)$/				# "("
+          param += $1
+          @line = $2
+          parenLevel += 1
+        when /^(\s*\))(.*)$/				# ")"
+          param += $1
+          @line = $2
+          parenLevel -= 1
+        when /^(\s*\")(.*)$/				# "
+          @line = $2
+          param += $1 + parseString(cfgFile)
+        when /^(\s*\')(.*)$/				# '
+          @line = $2
+          param += $1 + parseChar(cfgFile)
+        when /^(\s*[^()"'\s]+)(.*)$/		# ãã®ä»ã®æå­å
+          param += $1
+          @line = $2
+        else								# è¡æ«
+          param += "\n"
+          @line = cfgFile.getNextLine(true)
+        end
+      end
+    end while (@line)
+    return(param)
+  end
+
+  def parseApi(cfgFile)
+    # éçAPIã®èª­ã¿è¾¼ã¿
+    staticApi = {}
+    if (/^([A-Z_]+)\s*\((.*)$/ =~ @line)
+      apiName = $1
+      @line = $2
+
+      if $apiDefinition.has_key?(apiName)
+        staticApi[:API] = apiName
+        staticApi[:_FILE_] = cfgFile.getFileName
+        staticApi[:_LINE_] = cfgFile.getLineNo
+		apiDef = $apiDefinition[apiName]
+        param = parseParam(cfgFile)
+
+        apiDef[:PARAM].each do |apiParam|
+          if param.nil?						# ãã¡ã¤ã«æ«ã§ããã°ãªã¿ã¼ã³
+            error_exit("unexpexced end-of-file")
+            return(staticApi)
+          end
+          if apiParam.has_key?(:BRACE)
+            if param != apiParam[:BRACE]
+              parse_error(cfgFile, "'#{apiParam[:BRACE]}' expected")
+            end
+            param = parseParam(cfgFile)
+          elsif apiParam.has_key?(:LIST)
+            staticApi[apiParam[:NAME]] = []
+            while /^([{})])$/ !~ param
+              if apiParam.has_key?(:STRING)
+                staticApi[apiParam[:NAME]].push(param.unquote)
+              else
+                staticApi[apiParam[:NAME]].push(param)
+              end
+              param = parseParam(cfgFile)
+            end
+          elsif /^([{}])$/ =~ param
+            if !apiParam.has_key?(:OPTIONAL)
+              parse_error(cfgFile, "#{$1} unexpected")
+            end
+          else
+            if apiParam.has_key?(:STRING)
+              staticApi[apiParam[:NAME]] = param.unquote
+            else
+              staticApi[apiParam[:NAME]] = param
+            end
+            param = parseParam(cfgFile)
+          end
+        end
+        if param != ")"
+          parse_error(cfgFile, "')' expected")
+        end
+      else
+        parse_error(cfgFile, "unknown static API: #{apiName}")
+      end
+    else
+        parse_error(cfgFile, "syntax error: #{@line}")
+    end
+    @line = ""
+    return(staticApi)
+  end
+
+  def parseFile(cfgFileName)
+    cfgFiles = [ ConfigFile.new(cfgFileName) ]
+    @line = ""
+    begin
+      cfgFile = cfgFiles.last
+      while @line == ""									# ç©ºè¡ãèª­ã¿é£ã°ã
+        @line = cfgFile.getNextLine(false)
+        @line.sub!(/^[\s;]*/, "") unless @line.nil?		# å
+é ­ã®ç©ºç½ã¨";"ãåé¤
+      end
+
+      if @line.nil?
+        # ãã¡ã¤ã«æ«ã®å¦ç
+        cfgFiles.pop.close
+        if cfgFiles.empty?
+          break								# ãã¼ã¹å¦ççµäº
+        else
+          @line = ""
+          next								# å
+ã®ãã¡ã¤ã«ã«æ»ã£ã¦ç¶ãã
+        end
+      end
+
+      if /^#/ =~ @line
+        # ããªãã­ã»ããµãã£ã¬ã¯ãã£ããèª­ã
+        case @line
+        when /^#include\b(.*)$/
+          $includeFiles.push($1.strip)
+        when /^#(ifdef|ifndef|if|endif|else|elif)\b/
+          directive = {:DIRECTIVE => @line.strip}
+          $cfgFileInfo.push(directive)
+        else
+          parse_error(cfgFile, "unknown preprocessor directive: #{@line}")
+        end
+        @line = ""
+      else
+        # éçAPIã1ã¤èª­ã
+        staticApi = parseApi(cfgFile)
+        if staticApi.empty?
+          # ææ³ã¨ã©ã¼
+        elsif (staticApi[:API] == "INCLUDE")
+          # INCLUDEã®å¦ç
+          includeFilePath = SearchFilePath(staticApi[:file])
+          if includeFilePath.nil?
+            parse_error(cfgFile, "`#{staticApi["file"]}' not found")
+          else
+            $dependencyFiles.push(includeFilePath)
+            cfgFiles.push(ConfigFile.new(includeFilePath))
+          end
+        else
+          # éçAPIã®å¦ç
+          staticApi[:INDEX] = (@@lastApiIndex += 1)
+          $cfgFileInfo.push(staticApi)
+        end
+      end
+    end while true
+  end
+end
+
+#
+#  cfg1_out.cã®çæ
+#
+def GenerateCfg1OutC
+  cfg1Out = GenFile.new(CFG1_OUT_C)
+
+  cfg1Out.append(<<EOS)
+/* #{CFG1_OUT_C} */
+#define TOPPERS_CFG1_OUT
+#include "kernel/kernel_int.h"
+EOS
+
+  # ã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«
+  $includeFiles.each do |file|
+    cfg1Out.add("#include #{file}")
+  end
+
+  cfg1Out.append(<<EOS)
+
+#ifdef INT64_MAX
+  typedef int64_t signed_t;
+  typedef uint64_t unsigned_t;
+#else
+  typedef int32_t signed_t;
+  typedef uint32_t unsigned_t;
+#endif
+
+#include "target_cfg1_out.h"
+#include <limits.h>
+
+const uint32_t #{CFG1_MAGIC_NUM} = 0x12345678;
+const uint32_t #{CFG1_SIZEOF_SIGNED} = sizeof(signed_t);
+
+EOS
+
+  # å¤åå¾ã·ã³ãã«ã®å¦ç
+  $symbolValueTable.each do |symbolName, symbolData|
+    type = symbolData.has_key?(:SIGNED) ? "signed_t" : "unsigned_t"
+    if !symbolData[:CONDITION].nil?
+      cfg1Out.add("#if #{symbolData[:CONDITION]}")
+    end
+    cfg1Out.add("const #{type} #{CFG1_PREFIX}#{symbolName} = " \
+							"(#{type})(#{symbolData[:EXPR]});")
+    if !symbolData[:DEFAULT].nil?
+      cfg1Out.add("#else")
+      cfg1Out.add("const #{type} #{CFG1_PREFIX}#{symbolName} = " \
+							"(#{type})(#{symbolData[:DEFAULT]});")
+    end
+    if !symbolData[:CONDITION].nil?
+      cfg1Out.add("#endif")
+    end
+  end
+
+  # éçAPIï¼ããªãã­ã»ããµãã£ã¬ã¯ãã£ãã®å¦ç
+  $cfgFileInfo.each do |cfgInfo|
+    if cfgInfo.has_key?(:DIRECTIVE)
+      cfg1Out.add2(cfgInfo[:DIRECTIVE])
+    else
+      apiDef = $apiDefinition[cfgInfo[:API]]
+      apiIndex = cfgInfo[:INDEX]
+      cfg1Out.add("#line #{cfgInfo[:_LINE_]} \"#{cfgInfo[:_FILE_]}\"")
+      cfg1Out.add("const unsigned_t #{CFG1_PREFIX}static_api_" \
+										"#{apiIndex} = #{apiIndex};")
+      apiDef[:PARAM].each do |apiParam|
+        if apiParam.has_key?(:ID_DEF)
+          cfg1Out.add("#define #{cfgInfo[apiParam[:NAME]]}\t(<>)")
+        elsif (apiParam.has_key?(:SIGNED) || apiParam.has_key?(:UNSIGNED)) \
+										&& !cfgInfo[apiParam[:NAME]].nil?
+          type = apiParam.has_key?(:SIGNED) ? "signed_t" : "unsigned_t"
+          cfg1Out.add("#line #{cfgInfo[:_LINE_]} \"#{cfgInfo[:_FILE_]}\"")
+          cfg1Out.add("const #{type} #{CFG1_PREFIX}valueof_" \
+							"#{apiParam[:NAME]}_#{apiIndex} = " \
+							"(#{type})(#{cfgInfo[apiParam[:NAME]]});")
+        end
+      end
+      cfg1Out.add
+    end
+  end
+end
+
+#
+#  ãã¹1ã®å¦ç
+#
+def Pass1
+  # 
+  #  ã¿ã¤ã ã¹ã¿ã³ããã¡ã¤ã«ã®æå®
+  # 
+  $timeStampFileName = CFG1_OUT_TIMESTAMP
+
+  #
+  #  éçAPIãã¼ãã«ã®èª­ã¿è¾¼ã¿
+  #
+  ReadApiTableFile()
+
+  #
+  #  å¤åå¾ã·ã³ãã«ãã¼ãã«ã®èª­ã¿è¾¼ã¿
+  #
+  ReadSymvalTable()
+
+  #
+  #  ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã®èª­ã¿è¾¼ã¿
+  #
+  $cfgFileInfo = []
+  $dependencyFiles = $configFileNames.dup
+  $includeFiles = []
+  $configFileNames.each do |configFileName|
+    CfgParser.new.parseFile(configFileName)
+  end
+  abort if $errorFlag					# ã¨ã©ã¼çºçæã¯abortãã
+
+  #
+  #  cfg1_out.cã®çæ
+  #
+  GenerateCfg1OutC()
+
+  #
+  #  ä¾å­é¢ä¿ã®åºå
+  #
+  if !$dependencyFileName.nil?
+    if $dependencyFileName == ""
+      depFile = STDOUT
+    else
+      begin
+        depFile = File.open($dependencyFileName, "w")
+      rescue Errno::ENOENT, Errno::EACCES => ex
+        abort(ex.message)
+      end
+    end
+
+    depFile.print("#{CFG1_OUT_C} #{CFG1_OUT_DB}:")
+    $dependencyFiles.each do |fileName|
+      depFile.print(" #{fileName}")
+    end
+    depFile.puts("")
+
+    if $dependencyFileName != ""
+      depFile.close
+    end
+  end
+
+  #
+  #  ãã¹2ã«å¼ãæ¸¡ãæ
+å ±ããã¡ã¤ã«ã«çæ
+  #
+  if $omitOutputDb.nil?
+    db = PStore.new(CFG1_OUT_DB)
+    db.transaction do
+      db[:apiDefinition] = $apiDefinition
+      db[:symbolValueTable] = $symbolValueTable
+      db[:cfgFileInfo] = $cfgFileInfo
+      db[:includeFiles] = $includeFiles
+    end
+  end
+end
Index: asp3_wo_tecs/trunk/cfg/pass2.rb
===================================================================
--- asp3_wo_tecs/trunk/cfg/pass2.rb	(revision 304)
+++ asp3_wo_tecs/trunk/cfg/pass2.rb	(revision 304)
@@ -0,0 +1,328 @@
+# -*- coding: utf-8 -*-
+#
+#  TOPPERS Configurator by Ruby
+#
+#  Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#  Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#              Graduate School of Information Science, Nagoya Univ., JAPAN
+#
+#  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#      ã¨ï¼
+#    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#        å ±åãããã¨ï¼
+#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#      å
+è²¬ãããã¨ï¼
+#
+#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#  ã®è²¬ä»»ãè² ããªãï¼
+#
+#  $Id: pass2.rb 32 2016-01-31 14:45:59Z ertl-hiro $
+#
+
+#
+#		ãã¹2ã®å¦ç
+#
+
+#
+#  ãã¹1ã®çæç©ã®èª­ã¿è¾¼ã¿
+#
+def ReadCfg1Out
+  # cfg1_out.symsã®èª­ã¿è¾¼ã¿
+  symbolAddress = ReadSymbolFile(CFG1_OUT_SYMS)
+
+  # cfg1_out.srecã®èª­ã¿è¾¼ã¿
+  begin
+    cfg1SRec = SRecord.new(CFG1_OUT_SREC)
+  rescue Errno::ENOENT, Errno::EACCES => ex
+    abort(ex.message)
+  end
+
+  # ãã¸ãã¯ãã³ãã¼ã®åå¾
+  if symbolAddress.has_key?(CFG1_MAGIC_NUM)
+    $asmLabel = ""
+    cfg1_prefix = CFG1_PREFIX
+  elsif symbolAddress.has_key?("_" + CFG1_MAGIC_NUM)
+    $asmLabel = "_"
+    cfg1_prefix = "_" + CFG1_PREFIX
+  else
+    error_exit("`#{CFG1_MAGIC_NUM}' is not found in `#{CFG1_OUT_SYMS}'")
+  end
+
+  magicNumberData = cfg1SRec.get_data(symbolAddress \
+							[$asmLabel + CFG1_MAGIC_NUM], 4)
+  if (magicNumberData == "12345678")
+    $bLittleEndian = false
+  elsif (magicNumberData == "78563412")
+    $bLittleEndian = true
+  else
+    error_exit("`#{CFG1_MAGIC_NUM}' is invalid in `#{CFG1_OUT_SREC}'")
+  end
+
+  # åºå®åºåããå¤æ°ã®åå¾
+  $sizeOfSigned = cfg1SRec.get_value(symbolAddress \
+							[$asmLabel + CFG1_SIZEOF_SIGNED], 4, false)
+
+  # å¤åå¾ã·ã³ãã«ã®åå¾
+  $symbolValueTable.each do |symbolName, symbolData|
+    symbol = cfg1_prefix + symbolName
+    if symbolAddress.has_key?(symbol)
+      value = cfg1SRec.get_value(symbolAddress[symbol], \
+							$sizeOfSigned, symbolData.has_key?(:SIGNED))
+      if !value.nil?
+        symbolData[:VALUE] = value
+      end
+    end
+  end
+
+  #
+  #  IDçªå·å
+¥åãã¡ã¤ã«ã®åãè¾¼ã¿
+  #
+  $inputObjid = {}
+  if !$idInputFileName.nil?
+    begin
+      idInputFile = File.open($idInputFileName)
+    rescue Errno::ENOENT, Errno::EACCES => ex
+      abort(ex.message)
+    end
+
+    idInputFile.each do |line|
+      ( objidName, objidNumber ) = line.split(/\s+/)
+      $inputObjid[objidName] = objidNumber.to_i
+    end
+
+    idInputFile.close
+  end
+
+  #
+  #  ããã·ã¥ã®åæå
+  #
+  $cfgData = {}
+  objidValue = {}
+  $apiDefinition.each do |apiName, apiDef|
+    if apiDef.has_key?(:API)
+      $cfgData[apiDef[:API].to_sym] = {}
+    end
+    apiDef[:PARAM].each do |apiParam|
+      if apiParam.has_key?(:NAME) && apiParam.has_key?(:ID_DEF)
+        objidValue[apiParam[:NAME]] = {}
+      end
+    end
+  end
+
+  #
+  #  ãªãã¸ã§ã¯ãIDã®å²ãå½ã¦
+  #
+  # IDçªå·å²ãå½ã¦ã®åå¦ç
+  $cfgFileInfo.each do |cfgInfo|
+    # ããªãã­ã»ããµãã£ã¬ã¯ãã£ãã¨æ¶ããéçAPIã¯èª­ã¿é£ã°ã
+    next if (cfgInfo.has_key?(:DIRECTIVE) || !symbolAddress.has_key?( \
+							"#{cfg1_prefix}static_api_#{cfgInfo[:INDEX]}"))
+
+    apiDef = $apiDefinition[cfgInfo[:API]]
+    apiDef[:PARAM].each do |apiParam|
+      if apiParam.has_key?(:NAME) && apiParam.has_key?(:ID_DEF)
+        objidName = apiParam[:NAME]
+        objidData = cfgInfo[objidName]
+        if $inputObjid.has_key?(objidData)
+          objidValue[objidName][objidData] = $inputObjid[objidData]
+        else
+          objidValue[objidName][objidData] = nil
+        end
+      end
+    end
+  end
+
+  # IDçªå·ã®å²ãå½ã¦å¦ç
+  objidValue.each do |objidName, objidList|
+    # æªä½¿ç¨ã®IDçªå·ã®ãªã¹ãï¼ä½¿ç¨ãããã®ããæ¶ãã¦ããï¼
+    unusedObjidList = (1.upto(objidList.keys.size)).to_a
+
+    # å²ãå½ã¦æ¸ã¿ã®IDçªå·ã®å¦ç
+    objidList.each do |objidData, objidNumber|
+      if $inputObjid.has_key?(objidData)
+        objidIndex = unusedObjidList.index($inputObjid[objidData])
+        if objidIndex.nil?
+          # IDçªå·å
+¥åãã¡ã¤ã«ã§æå®ãããå¤ãä¸æ­£
+          error_exit("value of `#{objidData}' in ID input file is illegal")
+        else
+          # æªä½¿ç¨ã®IDçªå·ã®ãªã¹ãããåé¤
+          unusedObjidList.delete_at(objidIndex)
+        end
+      end
+    end
+
+    # IDçªå·ã®å²ãå½ã¦
+    objidList.each do |objidData, objidNumber|
+      if objidList[objidData].nil?
+        # ä»¥ä¸ã§ï¼objidValueãæ¸ãæãã¦ãã
+        objidList[objidData] = unusedObjidList.shift
+      end
+    end
+  end
+
+  #
+  #  éçAPIãã¼ã¿ãããã·ã¥å½¢å¼ã¸å¤æ
+  #
+  $cfgFileInfo.each do |cfgInfo|
+    # ããªãã­ã»ããµãã£ã¬ã¯ãã£ãã¯èª­ã¿é£ã°ã
+    next if cfgInfo.has_key?(:DIRECTIVE)
+
+    apiDef = $apiDefinition[cfgInfo[:API]]
+    apiSym = apiDef[:API].to_sym
+    apiIndex = cfgInfo[:INDEX]
+
+    # ã·ã³ãã«ãã¡ã¤ã«ã«éçAPIã®ã¤ã³ããã¯ã¹ãå­å¨ããªããã°èª­ã¿é£ã°ã
+    #ï¼ifdefç­ã§æ¶ããéçAPIï¼
+    next unless symbolAddress.has_key?("#{cfg1_prefix}static_api_#{apiIndex}")
+
+    # ãã©ã¡ã¼ã¿ã®å¤ãããã·ã¥å½¢å¼ã«æ ¼ç´
+    params = {}
+    apiDef[:PARAM].each do |apiParam|
+      if apiParam.has_key?(:NAME)
+        paramName = apiParam[:NAME]
+        if cfgInfo.has_key?(paramName)
+          paramData = cfgInfo[paramName]
+          value = nil
+          if apiParam.has_key?(:ID_DEF)			# ãªãã¸ã§ã¯ãè­å¥åï¼å®ç¾©ï¼
+            value = objidValue[paramName][paramData]
+          elsif apiParam.has_key?(:ID_REF)		# ãªãã¸ã§ã¯ãè­å¥åï¼åç
+§ï¼
+            if objidValue[paramName].has_key?(paramData)
+              value = objidValue[paramName][paramData]
+            else
+              error("E_OBJ: `#{paramData}' in #{cfgInfo[:API]} is not defined",
+								"#{cfgInfo[:_FILE_]}:#{cfgInfo[:_LINE_]}:")
+            end
+          elsif apiParam.has_key?(:SIGNED) || apiParam.has_key?(:UNSIGNED)
+            symbol = "#{cfg1_prefix}valueof_#{paramName}_#{apiIndex}"
+            if (symbolAddress.has_key?(symbol))
+              value = cfg1SRec.get_value(symbolAddress[symbol], \
+							$sizeOfSigned, apiParam.has_key?(:SIGNED))
+            end
+          end
+          params[paramName.to_sym] = StrVal.new(paramData, value)
+        end
+      end
+    end
+
+	# ç»é²ã­ã¼ãæ±ºå®ãã
+    if apiDef.has_key?(:KEYPAR)
+      keyParam = params[apiDef[:KEYPAR].to_sym]
+      key = keyParam.val
+      if $cfgData[apiSym].has_key?(key)
+		# ç»é²ã­ã¼ã®éè¤
+        error("E_OBJ: #{apiDef[:KEYPAR]} `#{keyParam}'" \
+								" is duplicaed in #{cfgInfo[:API]}",
+								"#{cfgInfo[:_FILE_]}:#{cfgInfo[:_LINE_]}:")
+      end
+    else
+      key = $cfgData[apiSym].count + 1
+    end
+
+    # APIåï¼ãã¡ã¤ã«åï¼è¡çªå·ãè¿½å 
+    params[:apiname] = cfgInfo[:API]
+    params[:_file_] = cfgInfo[:_FILE_]
+    params[:_line_] = cfgInfo[:_LINE_]
+    $cfgData[apiSym][key] = params
+  end
+
+  #
+  #  IDçªå·åºåãã¡ã¤ã«ã®çæ
+  #
+  if !$idOutputFileName.nil?
+    idOutputFile = GenFile.new($idOutputFileName)
+    objidValue.each do |objidName, objidList|
+      objidList.each do |objidData, objidNumber|
+        idOutputFile.add("#{objidData} #{objidNumber}")
+      end
+    end
+  end
+end
+
+#
+#  ãã¹2ã®å¦ç
+#
+def Pass2
+  #
+  #  ãã¹1ããå¼ãæ¸¡ãããæ
+å ±ããã¡ã¤ã«ããèª­ã¿è¾¼ã
+  #
+  db = PStore.new(CFG1_OUT_DB)
+  db.transaction(true) do
+    $apiDefinition = db[:apiDefinition]
+    $symbolValueTable = db[:symbolValueTable]
+    $cfgFileInfo = db[:cfgFileInfo]
+    $includeFiles = db[:includeFiles]
+  end
+
+  #
+  #  ãã¹1ã®çæç©ãèª­ã¿è¾¼ã
+  #
+  ReadCfg1Out()
+  abort if $errorFlag					# ã¨ã©ã¼çºçæã¯abortãã
+
+  #
+  #  å¤åå¾ã·ã³ãã«ãã°ã­ã¼ãã«å¤æ°ã¨ãã¦å®ç¾©ãã
+  #
+  DefineSymbolValue()
+
+  #
+  #  çæã¹ã¯ãªããï¼trbãã¡ã¤ã«ï¼ãå®è¡ãã
+  #
+  $trbFileNames.each do |trbFileName|
+    IncludeTrb(trbFileName)
+  end
+
+  #
+  #  ãã¹3ã«å¼ãæ¸¡ãæ
+å ±ããã¡ã¤ã«ã«çæ
+  #
+  if $omitOutputDb.nil?
+    db = PStore.new(CFG2_OUT_DB)
+    db.transaction do
+      db[:apiDefinition] = $apiDefinition
+      db[:symbolValueTable] = $symbolValueTable
+      db[:cfgFileInfo] = $cfgFileInfo
+      db[:includeFiles] = $includeFiles
+      db[:cfgData] = $cfgData
+      db[:asmLabel] = $asmLabel
+      db[:bLittleEndian] = $bLittleEndian
+    end
+  end
+end
Index: asp3_wo_tecs/trunk/configure
===================================================================
--- asp3_wo_tecs/trunk/configure	(revision 303)
+++ 	(revision )
@@ -1,275 +1,0 @@
-#! /usr/bin/perl
-#
-#  TOPPERS Software
-#      Toyohashi Open Platform for Embedded Real-Time Systems
-# 
-#  Copyright (C) 2001-2003 by Embedded and Real-Time Systems Laboratory
-#                              Toyohashi Univ. of Technology, JAPAN
-#  Copyright (C) 2006-2016 by Embedded and Real-Time Systems Laboratory
-#              Graduate School of Information Science, Nagoya Univ., JAPAN
-# 
-#  ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-#  å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-#      ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-#      è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-#      ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-#      ã¨ï¼
-#    (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-#    (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-#        å ±åãããã¨ï¼
-#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-#      å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-#      å
-è²¬ãããã¨ï¼
-# 
-#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-#  ã®è²¬ä»»ãè² ããªãï¼
-# 
-#  $Id: configure 505 2016-01-12 01:41:01Z ertl-hiro $
-# 
-
-use Getopt::Std;
-
-#  ãªãã·ã§ã³ã®å®ç¾©
-#
-#  -T <target>			ã¿ã¼ã²ããåï¼å¿
-é ï¼
-#  -a <appldirs>		ã¢ããªã±ã¼ã·ã§ã³ã®ãã£ã¬ã¯ããªåï¼è¤æ°æå®å¯ï¼ã
-#						ãã©ã«ãã¯sampleãã£ã¬ã¯ããªï¼
-#  -A <applname>		ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã åï¼ããã©ã«ãã¯sample1ï¼
-#  -t					ã¡ã¤ã³ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ããªã³ã¯å¯¾è±¡ã«å«ããªã
-#  -c <cfgfile>			ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ï¼.cfgãã¡ã¤
-#						ã«åï¼å
-#  -C <cdlflle>			ã³ã³ãã¼ãã³ãè¨è¿°ãã¡ã¤ã«ï¼.cdlãã¡ã¤ã«ï¼å
-#  -U <applobjs>		ä»ã®ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ãã¡ã¤ã«
-#						ï¼.oãã¡ã¤ã«åã§æå®ï¼è¤æ°æå®å¯ï¼
-#  -S <syssvcobjs>		ã·ã¹ãã ãµã¼ãã¹ã®ãã­ã°ã©ã ãã¡ã¤ã«
-#						ï¼.oãã¡ã¤ã«åã§æå®ï¼è¤æ°æå®å¯ï¼
-#  -L <kernel_lib>		ã«ã¼ãã«ã©ã¤ãã©ãªï¼libkernel.aï¼ã®ãã£ã¬ã¯ããªå
-#						ï¼çç¥ããå ´åï¼ã«ã¼ãã«ã©ã¤ãã©ãªãmakeããï¼
-#  -f					ã«ã¼ãã«ãé¢æ°åä½ã§ã³ã³ãã¤ã«ãããã©ããã®æå®
-#  -D <srcdir>			ã«ã¼ãã«ã½ã¼ã¹ã®ç½®ããã¦ãããã£ã¬ã¯ããª
-#  -l <srclang>			ãã­ã°ã©ãã³ã°è¨èªï¼ç¾æç¹ã§ã¯cã¨c++ã®ã¿ãµãã¼ãï¼
-#  -m <tempmakefile>	Makefileã®ãã³ãã¬ã¼ãã®ãã¡ã¤ã«åã®æå®ï¼ããã©ã«
-#						ãã¯sampleãã£ã¬ã¯ããªã®Makefileï¼
-#  -d <depdir>			ä¾å­é¢ä¿ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªåï¼ããã©ã«ãã¯depsï¼
-#  -w					TECSãä½¿ç¨ããªã
-#  -r					ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ããä½¿ç¨ãããã©ãã
-#						ã®æå®
-#  -V <devtooldir>		éçºãã¼ã«ï¼ã³ã³ãã¤ã©ç­ï¼ã®ç½®ããã¦ãããã£ã¬ã¯ããª
-#  -p <perl>			perlã®ãã¹åï¼æç¤ºçã«æå®ããå ´åï¼
-#  -g <cfg>				ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ï¼cfgï¼ã®ãã¹å
-#  -G <tecsgen>			TECSã¸ã§ãã¬ã¼ã¿ï¼tecsgenï¼ã®ãã¹å
-#  -P <num>				ãã­ã»ããµæ°ï¼ãã«ããã­ã»ããµå¯¾å¿ã«ã¼ãã«ã®å ´åï¼
-#  -o <options>			å
-±éã³ã³ãã¤ã«ãªãã·ã§ã³ï¼COPTSã«è¿½å ï¼
-#  -O <options>			å
-±éã·ã³ãã«å®ç¾©ãªãã·ã§ã³ï¼CDEFSã«è¿½å ï¼
-#  -k <options>			å
-±éãªã³ã«ãªãã·ã§ã³ï¼LDFLAGSç­ã«è¿½å ï¼
-
-#  ä½¿ç¨ä¾(1)
-#
-#  % ../configure -T ct11mpcore_gcc -O "-DTOPPERS_USE_QEMU" \
-#					-A perf1 -a ../test -S "test_svc.o histogram.o"
-#
-#  ä½¿ç¨ä¾(2)
-#
-#  % ../configure -T macosx_gcc -L .
-#	ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã¯ï¼sample1ã«ãªãï¼
-#
-#  ä½¿ç¨ä¾(3)
-#
-#  % ../configure -T ct11mpcore_gcc -O "-DTOPPERS_USE_QEMU" -A tSample2 -t
-#	ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã¯ï¼TECSçã®ãµã³ãã«ãã­ã°ã©ã ã«ãªãï¼
-
-#
-#  ãªãã·ã§ã³ã®å¦ç
-#
-getopt("TaAcCUSLDlmdVpgGPoOk");
-
-#
-#  å¤æ°ã®åæå
-#
-
-$target = $opt_T;
-$appldirs = $opt_a ? $opt_a : "\$(SRCDIR)/sample";
-$applname = $opt_A ? $opt_A : "sample1";
-$applobj = $applname.".o";
-$cfgfile = $opt_c ? $opt_c : $applname.".cfg";
-$cdlfile = $opt_C ? $opt_C : $applname.".cdl";
-$applobjs = $opt_t ? ($opt_U ? $opt_U : "")
-				   : ($opt_U ? $applobj." ".$opt_U : $applobj);
-$syssvcobjs = $opt_S ? $opt_S : "";
-$kernel_lib = $opt_L ? $opt_L : "";
-$kernel_funcobjs = $opt_f ? "true" : "";
-$srclang = $opt_l ? $opt_l : "c";
-$depdir = $opt_d ? $opt_d : "deps";
-$omit_tecs = $opt_w ? "true" : "";
-$enable_trace = $opt_r ? "true" : "";
-$devtooldir = $opt_V ? $opt_V : "";
-$perl = $opt_p ? $opt_p : "perl";
-$cfg = $opt_g ? $opt_g : "\$(SRCDIR)/cfg/cfg/cfg";
-$tecsgen = $opt_G ? $opt_G : "ruby \$(SRCDIR)/tecsgen/tecsgen.rb";
-$prc_num = $opt_P ? $opt_P : "";
-$copts = $opt_o ? $opt_o : "";
-$cdefs = $opt_O ? $opt_O : "";
-$ldflags = $opt_k ? $opt_k : "";
-
-#
-#  ãªãã¸ã§ã¯ããã¡ã¤ã«åã®æ¡å¼µå­ãè¿ã
-#
-sub get_objext {
-	if ($^O eq 'cygwin') {
-		return("exe");
-	}
-	else {
-		return("");
-	}
-}
-
-#
-#  ãã¡ã¤ã«ãå¤æãã
-#
-sub convert {
-	my($infile, $outfile) = @_;
-	my($line);
-
-	print STDERR "configure: Generating $outfile from $infile.\n";
-	if (-f $outfile) {
-		print STDERR "configure: $outfile exists.",
-						"  Save as $outfile.bak.\n";
-		rename($outfile, $outfile.".bak");
-	}
-	unless (open(INFILE, $infile)) {
-		print STDERR "configure: can't open $infile\n";
-		exit(1);
-	}
-	unless (open(OUTFILE, "> ".$outfile)) {
-		print STDERR "configure: can't open $outfile\n";
-		exit(1);
-	}
-
-	while ($line = <INFILE>) {
-		chop $line;
-		while ($line =~ /^(.*)\@\(([A-Za-z_]+)\)(.*)$/) {
-			$line = $1.$vartable{$2}.$3;
-		}
-		print OUTFILE $line,"\n";
-	}
-
-	close(INFILE);
-	close(OUTFILE);
-}
-
-#
-#  ã½ã¼ã¹ãã£ã¬ã¯ããªåãåãåºã
-#
-$pwd = `pwd`; chop $pwd;
-if ($opt_D) {
-	$srcabsdir = $srcdir = $opt_D;
-}
-elsif ($0 =~ /(.*)\/configure/) {
-	$srcdir = $1;
-	if ($srcdir =~ /^\//) {
-		$srcabsdir = $srcdir;
-	}
-	else {
-		$srcabsdir = $pwd."/".$srcdir;
-	}
-}
-else {
-	$srcabsdir = $srcdir = $pwd;
-}
-
-$tempmakefile = $opt_m ? $opt_m : $srcdir."/sample/Makefile";
-
-#
-#  -Tãªãã·ã§ã³ã®ç¢ºèª
-#
-unless ($opt_T) {
-	print STDERR "configure: -T option is mandatory\n";
-	print STDERR "Installed targets are:\n";
-	foreach $targetname (<$srcdir/target/[a-zA-Z0-9]*>) {
-		$targetname =~ s|$srcdir/target/||;
-		print STDERR "\t$targetname\n";
-	}
-	exit(1);
-}
-
-#
-#  å¤æ°ãã¼ãã«ã®ä½æ
-#
-%vartable = ();
-$vartable{"TARGET"} = $target;
-$vartable{"APPLDIRS"} = $appldirs;
-$vartable{"APPLNAME"} = $applname;
-$vartable{"CFGFILE"} = $cfgfile;
-$vartable{"CDLFILE"} = $cdlfile;
-$vartable{"APPLOBJS"} = $applobjs;
-$vartable{"SYSSVCOBJS"} = $syssvcobjs;
-$vartable{"KERNEL_LIB"} = $kernel_lib;
-$vartable{"KERNEL_FUNCOBJS"} = $kernel_funcobjs;
-$vartable{"SRCDIR"} = $srcdir;
-$vartable{"SRCABSDIR"} = $srcabsdir;
-$vartable{"SRCLANG"} = $srclang;
-$vartable{"DEPDIR"} = $depdir;
-$vartable{"OMIT_TECS"} = $omit_tecs;
-$vartable{"ENABLE_TRACE"} = $enable_trace;
-$vartable{"DEVTOOLDIR"} = $devtooldir;
-$vartable{"PERL"} = $perl;
-$vartable{"CFG"} = $cfg;
-$vartable{"TECSGEN"} = $tecsgen;
-$objext = get_objext();
-$vartable{"OBJEXT"} = $objext;
-$vartable{"PRC_NUM"} = $prc_num;
-$vartable{"COPTS"} = $copts;
-$vartable{"CDEFS"} = $cdefs;
-$vartable{"LDFLAGS"} = $ldflags;
-
-#
-#  ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããªã®ãã§ãã¯
-#
-if (! -d $srcdir."/target/".$target) {
-	print STDERR "configure: $srcdir/target/$target not exist\n";
-	exit(1);
-}
-
-#
-#  Makefileã®çæ
-#
-convert($tempmakefile, "Makefile");
-
-#
-#  ä¾å­é¢ä¿ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®ä½æ
-#
-if (! -d $depdir) {
-	mkdir $depdir;
-}
Index: asp3_wo_tecs/trunk/configure.rb
===================================================================
--- asp3_wo_tecs/trunk/configure.rb	(revision 304)
+++ asp3_wo_tecs/trunk/configure.rb	(revision 304)
@@ -0,0 +1,356 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+#
+#  TOPPERS Software
+#      Toyohashi Open Platform for Embedded Real-Time Systems
+# 
+#  Copyright (C) 2001-2003 by Embedded and Real-Time Systems Laboratory
+#                              Toyohashi Univ. of Technology, JAPAN
+#  Copyright (C) 2006-2016 by Embedded and Real-Time Systems Laboratory
+#              Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#      ã¨ï¼
+#    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#        å ±åãããã¨ï¼
+#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#      å
+è²¬ãããã¨ï¼
+# 
+#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#  ã®è²¬ä»»ãè² ããªãï¼
+# 
+#  $Id: configure.rb 575 2016-02-02 23:16:20Z ertl-hiro $
+# 
+
+require "optparse"
+require "fileutils"
+require "shell"
+
+#  ãªãã·ã§ã³ã®å®ç¾©
+#
+#  -T <target>			ã¿ã¼ã²ããåï¼å¿
+é ï¼
+#  -a <appldirs>		ã¢ããªã±ã¼ã·ã§ã³ã®ãã£ã¬ã¯ããªåï¼è¤æ°æå®å¯ï¼ã
+#						ãã©ã«ãã¯sampleãã£ã¬ã¯ããªï¼
+#  -A <applname>		ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã åï¼ããã©ã«ãã¯sample1ï¼
+#  -t					ã¡ã¤ã³ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ããªã³ã¯å¯¾è±¡ã«å«ããªã
+#  -c <cfgfile>			ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ï¼.cfgãã¡ã¤
+#						ã«åï¼å
+#  -C <cdlflle>			ã³ã³ãã¼ãã³ãè¨è¿°ãã¡ã¤ã«ï¼.cdlãã¡ã¤ã«ï¼å
+#  -U <applobjs>		ä»ã®ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ãã¡ã¤ã«
+#						ï¼.oãã¡ã¤ã«åã§æå®ï¼è¤æ°æå®å¯ï¼
+#  -S <syssvcobjs>		ã·ã¹ãã ãµã¼ãã¹ã®ãã­ã°ã©ã ãã¡ã¤ã«
+#						ï¼.oãã¡ã¤ã«åã§æå®ï¼è¤æ°æå®å¯ï¼
+#  -L <kernel_lib>		ã«ã¼ãã«ã©ã¤ãã©ãªï¼libkernel.aï¼ã®ãã£ã¬ã¯ããªå
+#						ï¼çç¥ããå ´åï¼ã«ã¼ãã«ã©ã¤ãã©ãªãmakeããï¼
+#  -f					ã«ã¼ãã«ãé¢æ°åä½ã§ã³ã³ãã¤ã«ãããã©ããã®æå®
+#  -D <srcdir>			ã«ã¼ãã«ã½ã¼ã¹ã®ç½®ããã¦ãããã£ã¬ã¯ããª
+#  -l <srclang>			ãã­ã°ã©ãã³ã°è¨èªï¼ç¾æç¹ã§ã¯cã¨c++ã®ã¿ãµãã¼ãï¼
+#  -m <tempmakefile>	Makefileã®ãã³ãã¬ã¼ãã®ãã¡ã¤ã«åã®æå®ï¼ããã©ã«
+#						ãã¯sampleãã£ã¬ã¯ããªã®Makefileï¼
+#  -d <depdir>			ä¾å­é¢ä¿ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªåï¼ããã©ã«ãã¯depsï¼
+#  -w					TECSãä½¿ç¨ããªã
+#  -r					ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ããä½¿ç¨ãããã©ãã
+#						ã®æå®
+#  -V <devtooldir>		éçºãã¼ã«ï¼ã³ã³ãã¤ã©ç­ï¼ã®ç½®ããã¦ãããã£ã¬ã¯ããª
+#  -p <perl>			perlã®ãã¹åï¼æç¤ºçã«æå®ããå ´åï¼
+#  -R <ruby>			rubyã®ãã¹åï¼æç¤ºçã«æå®ããå ´åï¼
+#  -g <cfg>				ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ï¼cfgï¼ã®ãã¹å
+#  -G <tecsgen>			TECSã¸ã§ãã¬ã¼ã¿ï¼tecsgenï¼ã®ãã¹å
+#  -P <prcnum>			ãã­ã»ããµæ°ï¼ãã«ããã­ã»ããµå¯¾å¿ã«ã¼ãã«ã®å ´åï¼
+#  -o <options>			ã³ã³ãã¤ã«ãªãã·ã§ã³ï¼COPTSã«è¿½å ï¼
+#  -O <options>			ã·ã³ãã«å®ç¾©ãªãã·ã§ã³ï¼CDEFSã«è¿½å ï¼
+#  -k <options>			ãªã³ã«ãªãã·ã§ã³ï¼LDFLAGSç­ã«è¿½å ï¼
+
+#  ä½¿ç¨ä¾(1)
+#
+#  % ../configure.rb -T ct11mpcore_gcc -O "-DTOPPERS_USE_QEMU" \
+#					-A perf1 -a ../test -S "test_svc.o histogram.o"
+#
+#  ä½¿ç¨ä¾(2)
+#
+#  % ../configure.rb -T macosx_gcc -L .
+#	ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã¯ï¼sample1ã«ãªãï¼
+#
+#  ä½¿ç¨ä¾(3)
+#
+#  % ../configure.rb -T ct11mpcore_gcc -O "-DTOPPERS_USE_QEMU" -A tSample2 -t
+#	ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã¯ï¼TECSçã®ãµã³ãã«ãã­ã°ã©ã ã«ãªãï¼
+
+#
+#  å¤æ°ã®åæå
+#
+$target = nil
+$appldirs = []
+$applobjs = []
+$syssvcobjs = []
+$kernel_lib = ""
+$kernel_funcobjs = ""
+$srclang = "c"
+$depdir = "deps"
+$omit_tecs = ""
+$enable_trace = ""
+$devtooldir = ""
+$perl = "perl"
+$ruby = "ruby"
+$prc_num = ""
+$copts = []
+$cdefs = []
+$ldflags = []
+
+#
+#  ãªãã·ã§ã³ã®å¦ç
+#
+option = {}
+OptionParser.new(nil, 22) do |opt|
+  opt.on("-T target",		"taget name (mandatory)") do |val|
+    $target = val
+  end
+  opt.on("-a appldirs",		"application directories") do |val|
+    $appldirs += val.split("\s+")
+  end
+  opt.on("-A applname",		"application program name") do |val|
+    $applname = val
+  end
+  opt.on("-t",				"TECS is used for application development") do |val|
+    $option_t = true
+  end
+  opt.on("-c cfgfile",		"system configuration file") do |val|
+    $cfgfile = val
+  end
+  opt.on("-C cdlfile",		"component description file") do |val|
+    $cdlfile = val
+  end
+  opt.on("-U applobjs",		"additional application object files") do |val|
+    $applobjs += val.split("\s+")
+  end
+  opt.on("-S syssvcobjs",	"system service object files") do |val|
+    $syssvcobjs += val.split("\s+")
+  end
+  opt.on("-L kernel_lib",	"directory of built kernel library") do |val|
+    $kernel_lib = val
+  end
+  opt.on("-f", "each function is complied separately in kernel") do |val|
+    $kernel_funcobjs = true
+  end
+  opt.on("-D srcdir",		"path of source code directory") do |val|
+    $srcdir = val
+  end
+  opt.on("-l srclang",		"programming language (C or C++)") do |val|
+    $srclang = val
+  end
+  opt.on("-m tempmakefile", "template file of Makefile") do |val|
+    $tempmakefile = val
+  end
+  opt.on("-d depdir",		"dependency relation file directory") do |val|
+    $depdir = val
+  end
+  opt.on("-w",				"TECS is not used at all") do |val|
+    $omit_tecs = true
+  end
+  opt.on("-r",				"use the sample code for trace log") do |val|
+    $enable_trace = true
+  end
+  opt.on("-V devtooldir",	"development tools directory") do |val|
+    $devtooldir = val
+  end
+  opt.on("-p perl",			"path of perl command") do |val|
+    $perl = val
+  end
+  opt.on("-R ruby",			"path of ruby command") do |val|
+    $ruby = val
+  end
+  opt.on("-g cfg",			"path of configurator") do |val|
+    $cfg = val
+  end
+  opt.on("-G tecsgen",		"path of TECS generator") do |val|
+    $tecsgen = val
+  end
+  opt.on("-P prcnum",		"number of processors") do |val|
+    $prc_num = val
+  end
+  opt.on("-o options",		"compiler options") do |val|
+    $copts += val.split("\s+")
+  end
+  opt.on("-O options",		"symbol definition options") do |val|
+    $cdefs += val.split("\s+")
+  end
+  opt.on("-k options",		"linker options") do |val|
+    $ldflags += val.split("\s+")
+  end
+  opt.parse!(ARGV)
+end
+
+#
+#  ãªãã¸ã§ã¯ããã¡ã¤ã«åã®æ¡å¼µå­ãè¿ã
+#
+def GetObjectExtension
+  if /cygwin/ =~ RUBY_PLATFORM
+    return("exe")
+  else
+    return("")
+  end
+end
+
+#
+#  å¤æ°ã®ããã©ã«ãå¤
+#
+if $appldirs.empty?
+  $appldirs.push("\$(SRCDIR)/sample")
+end
+if $applname.nil?
+  $applname = "sample1"
+end
+if $option_t.nil?
+  $applobjs.unshift($applname + ".o")
+end
+if $cfgfile.nil?
+  $cfgfile = $applname + ".cfg"
+end
+if $cdlfile.nil?
+  $cdlfile = $applname + ".cdl"
+end
+if $srcdir.nil?
+  # ã½ã¼ã¹ãã£ã¬ã¯ããªåãåãåºã
+  if /(.*)\/configure/ =~ $0
+    $srcdir = $1
+  else
+    $srcdir = Shell.new.cwd
+  end
+end
+if /^\// =~ $srcdir
+  $srcabsdir = $srcdir
+else
+  $srcabsdir = Shell.new.cwd + "/" + $srcdir
+end
+if $tempmakefile.nil?
+  $tempmakefile = $srcdir + "/sample/Makefile"
+end
+if $cfg.nil?
+  $cfg = $ruby + " \$(SRCDIR)/cfg/cfg.rb"
+end
+if $tecsgen.nil?
+  $tecsgen = $ruby + " \$(SRCDIR)/tecsgen/tecsgen.rb"
+end
+
+#
+#  -Tãªãã·ã§ã³ã¨ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããªã®ç¢ºèª
+#
+if $target.nil?
+  puts("configure.rb: -T option is mandatory")
+elsif !File.directory?($srcdir + "/target/" + $target)
+  puts("configure.rb: #{$srcdir}/target/#{$target} not exist.")
+  $target = nil
+end
+
+if $target.nil?
+  puts("Installed targets are:")
+  Dir.glob($srcdir + "/target/[a-zA-Z0-9]*").each do |target|
+    target.sub!($srcdir + "/target/", "")
+    puts("\t" + target)
+  end
+  abort
+end
+
+#
+#  å¤æ°ãã¼ãã«ã®ä½æ
+#
+$vartable = Hash.new("")
+$vartable["TARGET"] = $target
+$vartable["APPLDIRS"] = $appldirs.join(" ")
+$vartable["APPLNAME"] = $applname
+$vartable["CFGFILE"] = $cfgfile
+$vartable["CDLFILE"] = $cdlfile
+$vartable["APPLOBJS"] = $applobjs.join(" ")
+$vartable["SYSSVCOBJS"] = $syssvcobjs.join(" ")
+$vartable["KERNEL_LIB"] = $kernel_lib
+$vartable["KERNEL_FUNCOBJS"] = $kernel_funcobjs
+$vartable["SRCDIR"] = $srcdir
+$vartable["SRCABSDIR"] = $srcabsdir
+$vartable["SRCLANG"] = $srclang
+$vartable["DEPDIR"] = $depdir
+$vartable["OMIT_TECS"] = $omit_tecs
+$vartable["ENABLE_TRACE"] = $enable_trace
+$vartable["DEVTOOLDIR"] = $devtooldir
+$vartable["PERL"] = $perl
+$vartable["RUBY"] = $ruby
+$vartable["CFG"] = $cfg
+$vartable["TECSGEN"] = $tecsgen
+$vartable["PRC_NUM"] = $prc_num
+$vartable["COPTS"] = $copts.join(" ")
+$vartable["CDEFS"] = $cdefs.join(" ")
+$vartable["LDFLAGS"] = $ldflags.join(" ")
+$vartable["OBJEXT"] = GetObjectExtension()
+
+#
+#  ãã¡ã¤ã«ãå¤æãã
+#
+def convert(inFileName, outFileName)
+  puts("Generating #{outFileName} from #{inFileName}.\n")
+  if (File.file?(outFileName))
+    puts("#{outFileName} exists.  Save as #{outFileName}.bak.\n")
+    FileUtils.move(outFileName, outFileName + ".bak")
+  end
+
+  begin
+    inFile = File.open(inFileName)
+    outFile = File.open(outFileName, "w")
+  rescue Errno::ENOENT, Errno::EACCES => ex
+    abort(ex.message)
+  end
+
+  inFile.each do |line|
+    line.chomp!
+    while line.sub!(/\@\(([A-Za-z0-9_]+)\)/) {|var| $vartable[$1]} do end
+    outFile.print(line,"\n")
+  end
+
+  inFile.close
+  outFile.close
+end
+
+#
+#  Makefileã®çæ
+#
+convert($tempmakefile, "Makefile")
+
+#
+#  ä¾å­é¢ä¿ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®ä½æ
+#
+if !File.directory?($depdir)
+  Dir.mkdir($depdir)
+end
Index: asp3_wo_tecs/trunk/kernel/alarm.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/alarm.tf	(revision 303)
+++ 	(revision )
@@ -1,139 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2015 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: alarm.tf 480 2016-01-03 07:37:12Z ertl-hiro $
-$ 
-
-$
-$		ã¢ã©ã¼ã éç¥æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$
-$  kernel_cfg.hã®çæ
-$
-$FILE "kernel_cfg.h.new"$
-
-#define TNUM_ALMID	$LENGTH(ALM.ID_LIST)$$NL$
-$FOREACH id ALM.ID_LIST$
-	#define $id$	$+id$$NL$
-$END$
-
-$
-$  kernel_cfg.cã®çæ
-$
-$FILE "kernel_cfg.c"$
-
-/*$NL$
-$SPC$*  Alarm Handler Functions$NL$
-$SPC$*/$NL$
-$NL$
-
-$
-$  ã¢ã©ã¼ã éç¥ã®IDçªå·ãä¿æããå¤æ°
-$
-$IF USE_EXTERNAL_ID$
-	$FOREACH id ALM.ID_LIST$
-		const ID $id$_id = $+id$;$NL$
-	$END$
-$END$
-
-$
-$  ã¢ã©ã¼ã éç¥IDçªå·ã®æå¤§å¤
-$
-const ID _kernel_tmax_almid = (TMIN_ALMID + TNUM_ALMID - 1);$NL$
-$NL$
-
-$
-$  ã¢ã©ã¼ã éç¥åæåãã­ãã¯
-$
-$IF LENGTH(ALM.ID_LIST)$
-	$FOREACH almid ALM.ID_LIST$
-$		// almatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2491ï¼½
-$		//ï¼TA_STAä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
-		$IF ALM.ALMATR[almid] != 0$
-			$ERROR ALM.TEXT_LINE[almid]$E_RSATR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"almatr", ALM.ALMATR[almid], almid, "CRE_ALM")$
-			$END$
-		$END$
-
-$		// éç¥æ
-å ±ã®å¦ç
-		$ALM.NFYHDR[almid] = GENERATE_NFYHDR(ALM.NFYMODE[almid],
-								ALM.PAR1[almid], ALM.PAR2[almid],
-								ALM.PAR3[almid], ALM.PAR4[almid],
-								ALM.TEXT_LINE[almid], almid, "CRE_ALM")$
-	$END$
-
-$	// ã¢ã©ã¼ã éç¥åæåãã­ãã¯
-	const ALMINIB _kernel_alminib_table[TNUM_ALMID] = {$NL$
-	$JOINEACH almid ALM.ID_LIST ",\n"$
-		$TAB${$SPC$
-			($ALM.ALMATR[almid]$),$SPC$
-			(intptr_t)($ALM.PAR1[almid]$),$SPC$
-			$ALM.NFYHDR[almid]$$SPC$
-		}$END$$NL$
-	};$NL$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(const ALMINIB, _kernel_alminib_table);$NL$
-$END$$NL$
-
-$
-$  ã¢ã©ã¼ã éç¥ç®¡çãã­ãã¯ã¨ã¢ã©ã¼ã éç¥æ©è½åæåé¢æ°
-$
-$IF LENGTH(ALM.ID_LIST)$
-	ALMCB _kernel_almcb_table[TNUM_ALMID];$NL$
-	$initfuncs = APPEND(initfuncs, "_kernel_initialize_alarm();")$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(ALMCB, _kernel_almcb_table);$NL$
-$END$$NL$
Index: asp3_wo_tecs/trunk/kernel/alarm.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/alarm.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/alarm.trb	(revision 304)
@@ -0,0 +1,90 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: alarm.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#		ã¢ã©ã¼ã éç¥æ©è½ã®çæã¹ã¯ãªãã
+#
+
+class AlarmObject < KernelObject
+  def initialize()
+    super("alm", "alarm")
+  end
+
+  def prepare(id, params)
+    # almatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2491ï¼½
+    #ï¼TA_STAä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+    if (params[:almatr] & ~($TA_STA)) != 0
+      error_illegal_id("E_RSATR", params, :almatr, :almid)
+    end
+
+    # éç¥æ
+å ±ã®å¦ç
+    params[:nfyhdr] = generateNotifyHandler(id, params, :almid)
+  end
+
+  def generateInib(id, params)
+    return("(#{params[:almatr]}), (intptr_t)(#{params[:par1]}), " \
+												"#{params[:nfyhdr]}")
+  end
+end
+
+#
+#  ã¢ã©ã¼ã éç¥ã«é¢ããæ
+å ±ã®çæ
+#
+$kernelCfgC.comment_header("Alarm Notification Functions")
+AlarmObject.new.generate()
Index: asp3_wo_tecs/trunk/kernel/cyclic.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/cyclic.tf	(revision 303)
+++ 	(revision )
@@ -1,157 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2015 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: cyclic.tf 480 2016-01-03 07:37:12Z ertl-hiro $
-$ 
-
-$
-$		å¨æéç¥æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$
-$  kernel_cfg.hã®çæ
-$
-$FILE "kernel_cfg.h.new"$
-
-#define TNUM_CYCID	$LENGTH(CYC.ID_LIST)$$NL$
-$FOREACH id CYC.ID_LIST$
-	#define $id$	$+id$$NL$
-$END$
-
-$
-$  kernel_cfg.cã®çæ
-$
-$FILE "kernel_cfg.c"$
-
-/*$NL$
-$SPC$*  Cyclic Handler Functions$NL$
-$SPC$*/$NL$
-$NL$
-
-$
-$  å¨æéç¥ã®IDçªå·ãä¿æããå¤æ°
-$
-$IF USE_EXTERNAL_ID$
-	$FOREACH id CYC.ID_LIST$
-		const ID $id$_id = $+id$;$NL$
-	$END$
-$END$
-
-$
-$  å¨æéç¥IDçªå·ã®æå¤§å¤
-$
-const ID _kernel_tmax_cycid = (TMIN_CYCID + TNUM_CYCID - 1);$NL$
-$NL$
-
-$
-$  å¨æéç¥åæåãã­ãã¯
-$
-$IF LENGTH(CYC.ID_LIST)$
-	$FOREACH cycid CYC.ID_LIST$
-$		// cycatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2383ï¼½
-$		//ï¼TA_STAä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
-		$IF (CYC.CYCATR[cycid] & ~TA_STA) != 0$
-			$ERROR CYC.TEXT_LINE[cycid]$E_RSATR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-					"cycatr", CYC.CYCATR[cycid], cycid, "CRE_CYC")$
-			$END$
-		$END$
-
-$		// (0 < cyctim && cyctim <= TMAX_RELTIM)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI2397ï¼½
-		$IF !(0 < CYC.CYCTIM[cycid] && CYC.CYCTIM[cycid] <= TMAX_RELTIM)$
-			$ERROR CYC.TEXT_LINE[cycid]$E_PAR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"cyctim", CYC.CYCTIM[cycid], cycid, "CRE_CYC")$
-			$END$
-		$END$
-
-$		// (0 <= cycphs && cycphs <= TMAX_RELTIM)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI2399ï¼½
-		$IF !(0 <= CYC.CYCPHS[cycid] && CYC.CYCPHS[cycid] <= TMAX_RELTIM)$
-			$ERROR CYC.TEXT_LINE[cycid]$E_PAR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"cycphs", CYC.CYCPHS[cycid], cycid, "CRE_CYC")$
-			$END$
-		$END$
-
-$		// éç¥æ
-å ±ã®å¦ç
-		$CYC.NFYHDR[cycid] = GENERATE_NFYHDR(CYC.NFYMODE[cycid],
-								CYC.PAR1[cycid], CYC.PAR2[cycid],
-								CYC.PAR3[cycid], CYC.PAR4[cycid],
-								CYC.TEXT_LINE[cycid], cycid, "CRE_CYC")$
-	$END$
-
-$	// å¨æéç¥åæåãã­ãã¯
-	const CYCINIB _kernel_cycinib_table[TNUM_CYCID] = {$NL$
-	$JOINEACH cycid CYC.ID_LIST ",\n"$
-		$TAB${$SPC$
-			($CYC.CYCATR[cycid]$),$SPC$
-			(intptr_t)($CYC.PAR1[cycid]$),$SPC$
-			$CYC.NFYHDR[cycid]$,$SPC$
-			($CYC.CYCTIM[cycid]$),$SPC$
-			($CYC.CYCPHS[cycid]$)$SPC$
-		}$END$$NL$
-	};$NL$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(const CYCINIB, _kernel_cycinib_table);$NL$
-$END$$NL$
-
-$
-$  å¨æéç¥ç®¡çãã­ãã¯ã¨å¨æéç¥æ©è½åæåé¢æ°
-$
-$IF LENGTH(CYC.ID_LIST)$
-	CYCCB _kernel_cyccb_table[TNUM_CYCID];$NL$
-	$initfuncs = APPEND(initfuncs, "_kernel_initialize_cyclic();")$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(CYCCB, _kernel_cyccb_table);$NL$
-$END$$NL$
Index: asp3_wo_tecs/trunk/kernel/cyclic.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/cyclic.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/cyclic.trb	(revision 304)
@@ -0,0 +1,100 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: cyclic.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#		å¨æéç¥æ©è½ã®çæã¹ã¯ãªãã
+#
+
+class CyclicObject < KernelObject
+  def initialize()
+    super("cyc", "cyclic")
+  end
+
+  def prepare(id, params)
+    # cycatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2383ï¼½
+    #ï¼TA_STAä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+    if (params[:cycatr] & ~($TA_STA)) != 0
+      error_illegal_id("E_RSATR", params, :cycatr, :cycid)
+    end
+
+    # (0 < cyctim && cyctim <= TMAX_RELTIM)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI2397ï¼½
+    if !(0 < params[:cyctim] && params[:cyctim] <= $TMAX_RELTIM)
+      error_illegal_id("E_PAR", params, :cyctim, :cycid)
+    end
+
+    # (0 <= cycphs && cycphs <= TMAX_RELTIM)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI2399ï¼½
+    if !(0 <= params[:cycphs] && params[:cycphs] <= $TMAX_RELTIM)
+      error_illegal_id("E_PAR", params, :cycphs, :cycid)
+    end
+
+    # éç¥æ
+å ±ã®å¦ç
+    params[:nfyhdr] = generateNotifyHandler(id, params, :cycid)
+  end
+
+  def generateInib(id, params)
+    return("(#{params[:cycatr]}), (intptr_t)(#{params[:par1]}), " \
+			"#{params[:nfyhdr]}, (#{params[:cyctim]}), (#{params[:cycphs]})")
+  end
+end
+
+#
+#  å¨æéç¥ã«é¢ããæ
+å ±ã®çæ
+#
+$kernelCfgC.comment_header("Cyclic Notification Functions")
+CyclicObject.new.generate()
Index: asp3_wo_tecs/trunk/kernel/dataqueue.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/dataqueue.tf	(revision 303)
+++ 	(revision )
@@ -1,159 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2014 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: dataqueue.tf 480 2016-01-03 07:37:12Z ertl-hiro $
-$ 
-
-$
-$		ãã¼ã¿ã­ã¥ã¼æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$
-$  kernel_cfg.hã®çæ
-$
-
-$FILE "kernel_cfg.h.new"$
-
-#define TNUM_DTQID	$LENGTH(DTQ.ID_LIST)$$NL$
-$FOREACH id DTQ.ID_LIST$
-	#define $id$	$+id$$NL$
-$END$
-
-$
-$  kernel_cfg.cã®çæ
-$
-
-$FILE "kernel_cfg.c"$
-
-/*$NL$
-$SPC$*  Dataqueue Functions$NL$
-$SPC$*/$NL$
-$NL$
-
-$
-$  ãã¼ã¿ã­ã¥ã¼ã®IDçªå·ãä¿æããå¤æ°
-$
-$IF USE_EXTERNAL_ID$
-	$FOREACH id DTQ.ID_LIST$
-		const ID $id$_id = $+id$;$NL$
-	$END$
-$END$
-
-$
-$  ãã¼ã¿ã­ã¥ã¼IDçªå·ã®æå¤§å¤
-$
-const ID _kernel_tmax_dtqid = (TMIN_DTQID + TNUM_DTQID - 1);$NL$
-$NL$
-
-$
-$  ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯
-$
-$IF LENGTH(DTQ.ID_LIST)$
-	$FOREACH dtqid DTQ.ID_LIST$
-$		// dtqatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1669ï¼½
-$		//ï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
-		$IF (DTQ.DTQATR[dtqid] & ~TA_TPRI) != 0$
-			$ERROR DTQ.TEXT_LINE[dtqid]$E_RSATR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"dtqatr", DTQ.DTQATR[dtqid], dtqid, "CRE_DTQ")$
-			$END$
-		$END$
-
-$		// dtqcntãè² ã®å ´åï¼E_PARï¼ï¼»NGKI3288ï¼½
-		$IF DTQ.DTQCNT[dtqid] < 0$
-			$ERROR DTQ.TEXT_LINE[dtqid]$E_PAR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"dtqcnt", DTQ.DTQCNT[dtqid], dtqid, "CRE_DTQ")$
-			$END$
-		$END$
-
-$		// dtqmbãNULLã§ãªãå ´åï¼E_NOSPTï¼ï¼»ASPS0132ï¼½
-		$IF !EQ(DTQ.DTQMB[dtqid], "NULL")$
-			$ERROR DTQ.TEXT_LINE[dtqid]$E_NOSPT:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"dtqmb", DTQ.DTQMB[dtqid], dtqid, "CRE_DTQ")$
-			$END$
-		$END$
-
-$		// ãã¼ã¿ã­ã¥ã¼ç®¡çé å
-		$IF DTQ.DTQCNT[dtqid]$
-			static DTQMB _kernel_dtqmb_$dtqid$[$DTQ.DTQCNT[dtqid]$];$NL$
-		$END$
-	$END$
-
-$	// ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯
-	const DTQINIB _kernel_dtqinib_table[TNUM_DTQID] = {$NL$
-	$JOINEACH dtqid DTQ.ID_LIST ",\n"$
-		$TAB${$SPC$
-			($DTQ.DTQATR[dtqid]$),$SPC$
-			($DTQ.DTQCNT[dtqid]$),$SPC$
-			$IF DTQ.DTQCNT[dtqid]$
-				_kernel_dtqmb_$dtqid$
-			$ELSE$
-				NULL
-			$END$$SPC$
-		}$END$$NL$
-	};$NL$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(const DTQINIB, _kernel_dtqinib_table);$NL$
-$END$$NL$
-
-$
-$  ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ã¨ãã¼ã¿ã­ã¥ã¼æ©è½åæåé¢æ°
-$
-$IF LENGTH(DTQ.ID_LIST)$
-	DTQCB _kernel_dtqcb_table[TNUM_DTQID];$NL$
-	$initfuncs = APPEND(initfuncs, "_kernel_initialize_dataqueue();")$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(DTQCB, _kernel_dtqcb_table);$NL$
-$END$$NL$
Index: asp3_wo_tecs/trunk/kernel/dataqueue.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/dataqueue.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/dataqueue.trb	(revision 304)
@@ -0,0 +1,101 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: dataqueue.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#		ãã¼ã¿ã­ã¥ã¼æ©è½ã®çæã¹ã¯ãªãã
+#
+
+class DataqueueObject < KernelObject
+  def initialize()
+    super("dtq", "dataqueue")
+  end
+
+  def prepare(id, params)
+    # dtqatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1669ï¼½
+    #ï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+    if (params[:dtqatr] & ~($TA_TPRI)) != 0
+      error_illegal_id("E_RSATR", params, :dtqatr, :dtqid)
+    end
+
+    # dtqmbãNULLã§ãªãå ´åï¼E_NOSPTï¼ï¼»ASPS0132ï¼½
+    if params[:dtqmb] != "NULL"
+      error_illegal_id("E_PAR", params, :dtqmb, :dtqid)
+    end
+
+    # ãã¼ã¿ã­ã¥ã¼ç®¡çé å
+    if params[:dtqcnt] > 0
+      $kernelCfgC.add("static DTQMB _kernel_dtqmb_#{params[:dtqid]}" \
+												"[#{params[:dtqcnt]}];")
+    end
+  end
+
+  def generateInib(id, params)
+    if params[:dtqcnt] > 0
+      dtqmb = "_kernel_dtqmb_#{params[:dtqid]}"
+    else
+      dtqmb = "NULL"
+    end
+    return("(#{params[:dtqatr]}), (#{params[:dtqcnt]}), #{dtqmb}")
+  end
+end
+
+#
+#  ãã¼ã¿ã­ã¥ã¼ã«é¢ããæ
+å ±ã®çæ
+#
+$kernelCfgC.comment_header("Dataqueue Functions")
+DataqueueObject.new.generate()
Index: asp3_wo_tecs/trunk/kernel/eventflag.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/eventflag.tf	(revision 303)
+++ 	(revision )
@@ -1,139 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2014 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: eventflag.tf 480 2016-01-03 07:37:12Z ertl-hiro $
-$ 
-
-$
-$		ã¤ãã³ããã©ã°æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$
-$  kernel_cfg.hã®çæ
-$
-$FILE "kernel_cfg.h.new"$
-
-#define TNUM_FLGID	$LENGTH(FLG.ID_LIST)$$NL$
-$FOREACH id FLG.ID_LIST$
-	#define $id$	$+id$$NL$
-$END$
-
-$
-$  kernel_cfg.cã®çæ
-$
-$FILE "kernel_cfg.c"$
-
-/*$NL$
-$SPC$*  Eventflag Functions$NL$
-$SPC$*/$NL$
-$NL$
-
-$
-$  ã¤ãã³ããã©ã°ã®IDçªå·ãä¿æããå¤æ°
-$
-$IF USE_EXTERNAL_ID$
-	$FOREACH id FLG.ID_LIST$
-		const ID $id$_id = $+id$;$NL$
-	$END$
-$END$
-
-$
-$  ã¤ãã³ããã©ã°IDçªå·ã®æå¤§å¤
-$
-const ID _kernel_tmax_flgid = (TMIN_FLGID + TNUM_FLGID - 1);$NL$
-$NL$
-
-$
-$  ã¤ãã³ããã©ã°åæåãã­ãã¯
-$
-$IF LENGTH(FLG.ID_LIST)$
-	$FOREACH flgid FLG.ID_LIST$
-$		// flgatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1562ï¼½
-$		//ï¼TA_TPRIï¼TA_WMULï¼TA_CLRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
-		$IF (FLG.FLGATR[flgid] & ~(TA_TPRI|TA_WMUL|TA_CLR)) != 0$
-			$ERROR FLG.TEXT_LINE[flgid]$E_RSATR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"flgatr", FLG.FLGATR[flgid], flgid, "CRE_FLG")$
-			$END$
-		$END$
-
-$		// iflgptnãFLGPTNã«æ ¼ç´ã§ããªãå ´åï¼E_PARï¼ï¼»NGKI3275ï¼½
-		$IF (FLG.IFLGPTN[flgid] & ~((1 << TBIT_FLGPTN) - 1)) != 0$
-			$ERROR FLG.TEXT_LINE[flgid]$E_PAR:$SPC$
-				$FORMAT(_("too large %1% `%2%\' of `%3%\' in %4%"),
-							"iflgptn", FLG.IFLGPTN[flgid], flgid, "CRE_FLG")$
-			$END$
-		$END$
-	$END$
-
-$	// ã¤ãã³ããã©ã°åæåãã­ãã¯
-	const FLGINIB _kernel_flginib_table[TNUM_FLGID] = {$NL$
-	$JOINEACH flgid FLG.ID_LIST ",\n"$
-		$TAB${$SPC$
-			($FLG.FLGATR[flgid]$),$SPC$
-			($FLG.IFLGPTN[flgid]$)$SPC$
-		}$END$$NL$
-	};$NL$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(const FLGINIB, _kernel_flginib_table);$NL$
-$END$$NL$
-
-$
-$  ã¤ãã³ããã©ã°ç®¡çãã­ãã¯ã¨ã¤ãã³ããã©ã°æ©è½åæåé¢æ°
-$
-$IF LENGTH(FLG.ID_LIST)$
-	FLGCB _kernel_flgcb_table[TNUM_FLGID];$NL$
-	$initfuncs = APPEND(initfuncs, "_kernel_initialize_eventflag();")$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(FLGCB, _kernel_flgcb_table);$NL$
-$END$$NL$
Index: asp3_wo_tecs/trunk/kernel/eventflag.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/eventflag.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/eventflag.trb	(revision 304)
@@ -0,0 +1,90 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: eventflag.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#		ã¤ãã³ããã©ã°æ©è½ã®çæã¹ã¯ãªãã
+#
+
+class EventflagObject < KernelObject
+  def initialize()
+    super("flg", "eventflag")
+  end
+
+  def prepare(id, params)
+    # flgatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1562ï¼½
+    #ï¼TA_TPRIï¼TA_WMULï¼TA_CLRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+    if (params[:flgatr] & ~($TA_TPRI|$TA_WMUL|$TA_CLR)) != 0
+      error_illegal_id("E_RSATR", params, :flgatr, :flgid)
+    end
+
+    # iflgptnãFLGPTNã«æ ¼ç´ã§ããªãå ´åï¼E_PARï¼ï¼»NGKI3275ï¼½
+    if (params[:iflgptn] & ~((1 << $TBIT_FLGPTN) - 1)) != 0
+      error_wrong_id("E_PAR", params, :iflgptn, :flgid, "too large")
+    end
+  end
+
+  def generateInib(id, params)
+    return("(#{params[:flgatr]}), (#{params[:iflgptn]})")
+  end
+end
+
+#
+#  ã¤ãã³ããã©ã°ã«é¢ããæ
+å ±ã®çæ
+#
+$kernelCfgC.comment_header("Eventflag Functions")
+EventflagObject.new.generate()
Index: asp3_wo_tecs/trunk/kernel/exception.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/exception.tf	(revision 303)
+++ 	(revision )
@@ -1,147 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2015 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: exception.tf 462 2015-08-29 13:07:45Z ertl-hiro $
-$ 
-
-$
-$		CPUä¾å¤ç®¡çæ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$
-$  kernel_cfg.cã®çæ
-$
-$FILE "kernel_cfg.c"$
-
-/*$NL$
-$SPC$*  CPU Exception Management Functions$NL$
-$SPC$*/$NL$
-$NL$
-
-$
-$  CPUä¾å¤ãã³ãã©ã«é¢ããã¨ã©ã¼ãã§ãã¯
-$
-$ EXCNO_LISTï¼å¦çæ¸ã¿ã®CPUä¾å¤ãã³ãã©çªå·ã®ãªã¹ãï¼ããã§ã®ã¿ä½¿ç¨ï¼
-$
-$FOREACH excno EXC.ORDER_LIST$
-$	// excnoãCPUä¾å¤ãã³ãã©çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3134ï¼½
-	$IF !LENGTH(FIND(EXCNO_VALID, EXC.EXCNO[excno]))$
-		$ERROR EXC.TEXT_LINE[excno]$E_PAR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' in %3%"),
-						"excno", EXC.EXCNO[excno], "DEF_EXC")$
-		$END$
-	$END$
-
-$	// excnoãDEF_EXCã«ãã£ã¦è¨­å®æ¸ã¿ã®å ´åï¼E_OBJï¼ï¼»NGKI3141ï¼½
-	$IF LENGTH(FIND(EXCNO_LIST, EXC.EXCNO[excno]))$
-		$ERROR EXC.TEXT_LINE[excno]$E_OBJ:$SPC$
-			$FORMAT(_("%1% `%2%\' in %3% is duplicated"),
-						"excno", EXC.EXCNO[excno], "DEF_EXC")$
-		$END$
-	$END$
-
-$	// excatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3131ï¼½
-$	//ï¼TARGET_EXCATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
-	$IF (EXC.EXCATR[excno] & ~TARGET_EXCATR) != 0$
-		$ERROR EXC.TEXT_LINE[excno]$E_RSATR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' of %3% `%4%\' in %5%"),
-						"excatr", EXC.EXCATR[excno], "excno",
-						EXC.EXCNO[excno], "DEF_EXC")$
-		$END$
-	$END$
-
-	$EXCNO_LIST = APPEND(EXCNO_LIST, EXC.EXCNO[excno])$
-$END$
-
-$
-$  CPUä¾å¤ãã³ãã©ã®ããã®æ¨æºçãªåæåæ
-å ±ã®çæ
-$
-$IF !OMIT_INITIALIZE_EXCEPTION$
-
-$
-$  å®ç¾©ããCPUä¾å¤ãã³ãã©ã®æ°
-$
-#define TNUM_DEF_EXCNO	$LENGTH(EXC.ORDER_LIST)$$NL$
-const uint_t _kernel_tnum_def_excno = TNUM_DEF_EXCNO;$NL$
-$NL$
-
-$
-$  CPUä¾å¤ãã³ãã©ã®ã¨ã³ããª
-$
-$FOREACH excno EXC.ORDER_LIST$
-	EXCHDR_ENTRY($EXC.EXCNO[excno]$, $+EXC.EXCNO[excno]$,$SPC$
-										$EXC.EXCHDR[excno]$)$NL$
-$END$$NL$
-
-$
-$  CPUä¾å¤ãã³ãã©åæåãã­ãã¯
-$
-$IF LENGTH(EXC.ORDER_LIST)$
-	const EXCINIB _kernel_excinib_table[TNUM_DEF_EXCNO] = {$NL$
-	$JOINEACH excno EXC.ORDER_LIST ",\n"$
-		$TAB${$SPC$
-			($EXC.EXCNO[excno]$),$SPC$
-			($EXC.EXCATR[excno]$),$SPC$
-			(FP)(EXC_ENTRY($EXC.EXCNO[excno]$, $EXC.EXCHDR[excno]$))$SPC$
-		}$END$$NL$
-	};$NL$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(const EXCINIB, _kernel_excinib_table);$NL$
-$END$$NL$
-$END$
-
-$
-$  CPUä¾å¤ãã³ãã©ç®¡çæ©è½åæåé¢æ°
-$
-$initfuncs = APPEND(initfuncs, "_kernel_initialize_exception();")$
Index: asp3_wo_tecs/trunk/kernel/exception.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/exception.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/exception.trb	(revision 304)
@@ -0,0 +1,127 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: exception.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#		CPUä¾å¤ç®¡çæ©è½ã®çæã¹ã¯ãªãã
+#
+
+#
+#  kernel_cfg.cã®çæ
+#
+$kernelCfgC.comment_header("CPU Exception Management Functions")
+
+#
+#  CPUä¾å¤ãã³ãã©ã«é¢ããã¨ã©ã¼ãã§ãã¯
+#
+$cfgData[:DEF_EXC].each do |id, params|
+  # excnoãCPUä¾å¤ãã³ãã©çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3134ï¼½
+  if $EXCNO_VALID.index(params[:excno]).nil?
+    error_illegal("E_PAR", params, :excno)
+  end
+
+  # excatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3131ï¼½
+  #ï¼TARGET_EXCATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+  if (params[:excatr] & ~$TARGET_EXCATR) != 0
+    error_illegal_sym("E_RSATR", params, :excatr, :excno)
+  end
+end
+
+#
+#  CPUä¾å¤ãã³ãã©ã®ããã®æ¨æºçãªåæåæ
+å ±ã®çæ
+#
+if $OMIT_INITIALIZE_EXCEPTION.nil?
+  #
+  #  å®ç¾©ããCPUä¾å¤ãã³ãã©ã®æ°
+  #
+  $kernelCfgC.append(<<EOS)
+#define TNUM_DEF_EXCNO	#{$cfgData[:DEF_EXC].size}
+const uint_t _kernel_tnum_def_excno = TNUM_DEF_EXCNO;
+
+EOS
+
+  if $cfgData[:DEF_EXC].size != 0
+    #
+    #  CPUä¾å¤ãã³ãã©ã®ã¨ã³ããª
+    #
+    $cfgData[:DEF_EXC].each do |id, params|
+      $kernelCfgC.add("EXCHDR_ENTRY(#{params[:excno]}, " \
+						"#{params[:excno].val}, #{params[:exchdr]})")
+    end
+    $kernelCfgC.add("")
+
+    #
+    #  CPUä¾å¤ãã³ãã©åæåãã­ãã¯
+    #
+    $kernelCfgC.add("const EXCINIB _kernel_excinib_table[TNUM_DEF_EXCNO] = {")
+    $cfgData[:DEF_EXC].each_with_index do |(id, params), index|
+      $kernelCfgC.add(",") if index > 0
+      $kernelCfgC.append("\t{ (#{params[:excno]}), (#{params[:excatr]}), " \
+				"(FP)(EXC_ENTRY(#{params[:excno]}, #{params[:exchdr]})) }")
+    end
+    $kernelCfgC.add
+    $kernelCfgC.add2("};")
+  else
+    $kernelCfgC.add2("TOPPERS_EMPTY_LABEL(const EXCINIB, " \
+										"_kernel_excinib_table);")
+  end
+end
+
+#
+#  CPUä¾å¤ç®¡çæ©è½åæåé¢æ°ã®è¿½å 
+#
+$initializeFunctions.push("_kernel_initialize_exception();")
Index: asp3_wo_tecs/trunk/kernel/genoffset.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/genoffset.tf	(revision 303)
+++ 	(revision )
@@ -1,169 +1,0 @@
-$ 
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2011 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$  
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$  
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: genoffset.tf 480 2016-01-03 07:37:12Z ertl-hiro $
-$ 
-
-$
-$		ãªãã»ãããã¡ã¤ã«çæç¨ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$ 
-$  #defineãã£ã¬ã¯ãã£ãã®çæ
-$ 
-$FUNCTION DEFINE$
-	#define $ARGV[1]$$TAB$$FORMAT("%d", +ARGV[2])$$NL$
-$END$
-
-$ 
-$  ãããã®ãµã¼ã
-$ 
-$FUNCTION SEARCH_BIT$
-	$_val = ARGV[1]$
-	$FOREACH _val_bit RANGE(0,7)$
-		$IF (_val & 1) != 0$
-			$RESULT = _val_bit$
-		$END$
-		$_val = _val >> 1$
-	$END$
-$END$
-
-$ 
-$  ããããã£ã¼ã«ãã®ãªãã»ããã¨ãããä½ç½®ã®å®ç¾©ã®çæ
-$ 
-$FUNCTION DEFINE_BIT$
-	$label = ARGV[1]$
-	$struct_size = ARGV[2]$
-	$output_size = ARGV[3]$
-
-	$top = SYMBOL(label)$
-	$IF !LENGTH(top)$
-		$ERROR$$FORMAT("label %1% not found", label)$$END$
-	$ELSE$
-		$val = 0$
-		$FOREACH i RANGE(0,struct_size-1)$
-			$tmp_val = PEEK(top + i, 1)$
-			$IF val == 0 && tmp_val != 0$
-				$val = tmp_val$
-				$offset = i$
-			$END$
-		$END$
-
-		$IF val == 0$
-			$ERROR$$FORMAT("bit not found in %1%", ARGV[1])$$END$
-		$ELSE$
-			$val_bit = SEARCH_BIT(val)$
-			$RESULT = {}$
-			$IF EQ(output_size, "W")$
-				$IF SIL_ENDIAN_BIG$
-					$val_bit = val_bit + 24 - ((offset & 0x03) << 3)$
-				$ELSE$
-					$val_bit = val_bit + ((offset & 0x03) << 3)$
-				$END$
-				$offset = offset & ~0x03$
-			$ELSE$$IF EQ(output_size, "H")$
-				$IF SIL_ENDIAN_BIG$
-					$val_bit = val_bit + 8 - ((offset & 0x01) << 3)$
-				$ELSE$
-					$val_bit = val_bit + ((offset & 0x01) << 3)$
-				$END$
-				$offset = offset & ~0x01$
-			$END$$END$
-		$END$
-
-		#define $label$$TAB$$FORMAT("%d", +offset)$$NL$
-		#define $label$_bit$TAB$$FORMAT("%d", +val_bit)$$NL$
-		#define $label$_mask$TAB$$FORMAT("0x%x", 1 << val_bit)$$NL$
-	$END$
-$END$
-
-$ 
-$  ãã¤ãé
-ç½®ã®ãã§ãã¯
-$ 
-$FUNCTION MAGIC_CHECK$
-	$size = ARGV[1]$
-	$check = ARGV[2]$
-
-	$label = FORMAT("MAGIC_%d", +size)$
-	$top = SYMBOL(label)$
-	$IF !LENGTH(top)$
-		$ERROR$$FORMAT("label %1% not found", label)$$END$
-	$ELSE$
-		$FOREACH offset RANGE(1,size)$
-			$IF SIL_ENDIAN_BIG$
-				$val = PEEK(top + offset - 1, 1)$
-			$ELSE$
-				$val = PEEK(top + size - offset, 1)$
-			$END$
-			$IF val != AT(check, offset - 1)$
-				$ERROR$$FORMAT("value check of %1% failed", label)$$END$
-			$END$
-		$END$
-	$END$
-$END$
-
-$MAGIC_CHECK(1, { 0x12 })$
-$MAGIC_CHECK(2, { 0x12, 0x34 })$
-$MAGIC_CHECK(4, { 0x12, 0x34, 0x56, 0x78 })$
-
-$ 
-$  ã¿ã¤ã ã¹ã¿ã³ããã¡ã¤ã«ã®çæ
-$ 
-$FILE "offset.timestamp"$
-
-$ 
-$  ãã¡ã¤ã«ãããã®çæ
-$ 
-$FILE "offset.h.new"$
-/* offset.h */$NL$
-$NL$
Index: asp3_wo_tecs/trunk/kernel/genoffset.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/genoffset.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/genoffset.trb	(revision 304)
@@ -0,0 +1,164 @@
+# -*- coding: utf-8 -*-
+# 
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2011-2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+#  
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+#  
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: genoffset.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#		ãªãã»ãããã¡ã¤ã«çæç¨ã®çæã¹ã¯ãªãã
+#
+
+# 
+#  ã¿ã¤ã ã¹ã¿ã³ããã¡ã¤ã«ã®æå®
+# 
+$timeStampFileName = "offset.timestamp"
+
+# 
+#  offset.hã®å
+é ­é¨åã®çæ
+# 
+$offsetH = GenFile.new("offset.h")
+$offsetH.add2("/* offset.h */")
+
+# 
+#  #defineãã£ã¬ã¯ãã£ãã®çæ
+# 
+def GenerateDefine(symbol, value)
+  $offsetH.add("#define #{symbol}\t#{value.val}")
+end
+
+# 
+#  ãããã®ãµã¼ã
+# 
+def SearchBit(val)
+  (0..7).each do |valBit|
+    if (val & 1) != 0
+      return valBit
+    end
+    val >>= 1
+  end
+end
+
+# 
+#  ããããã£ã¼ã«ãã®ãªãã»ããã¨ãããä½ç½®ã®å®ç¾©ã®çæ
+# 
+def GenerateDefineBit(label, structSize, outputSize)
+  top = SYMBOL(label)
+  if top.nil?
+    error_exit("label `#{label}' not found")
+  else
+    val = 0
+    offset = 0
+    0.upto(structSize - 1).each do |i|
+      tmpVal = PEEK(top + i, 1)
+      if tmpVal != 0
+        val = tmpVal
+        offset = i
+        break
+      end
+    end
+
+    if val == 0
+      error_exit("bit not found in `#{label}'")
+    else
+      valBit = SearchBit(val)
+      case outputSize
+      when "W"
+        if $SIL_ENDIAN_BIG
+          valBit = valBit + 24 - ((offset & 0x03) << 3)
+        else
+          valBit = valBit + ((offset & 0x03) << 3)
+        end
+        offset &= ~0x03
+      when "H"
+        if $SIL_ENDIAN_BIG
+          valBit = valBit + 8 - ((offset & 0x01) << 3)
+        else
+          valBit = valBit + ((offset & 0x01) << 3)
+        end
+        offset &= ~0x01
+      end
+    end
+
+    $offsetH.add("#define #{label}\t#{offset}")
+    $offsetH.add("#define #{label}_bit\t#{valBit}")
+    $offsetH.add("#define #{label}_mask\t#{sprintf("0x%x", 1 << valBit)}")
+  end
+end
+
+# 
+#  ãã¤ãé
+ç½®ã®ãã§ãã¯
+# 
+def magicCheck(size, check)
+  label = "MAGIC_#{size}"
+  top = SYMBOL(label)
+  if top.nil?
+    error_exit("label `#{label}' not found")
+  else
+    1.upto(size).each do |offset|
+      if $SIL_ENDIAN_BIG
+        val = PEEK(top + offset - 1, 1)
+      else
+        val = PEEK(top + size - offset, 1)
+      end
+      if val != check.at(offset - 1)
+        error_exit("value check of `#{label}' failed")
+      end
+    end
+  end
+end
+
+magicCheck(1, [ 0x12 ])
+magicCheck(2, [ 0x12, 0x34 ])
+magicCheck(4, [ 0x12, 0x34, 0x56, 0x78 ])
Index: asp3_wo_tecs/trunk/kernel/interrupt.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/interrupt.tf	(revision 303)
+++ 	(revision )
@@ -1,460 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2015 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: interrupt.tf 480 2016-01-03 07:37:12Z ertl-hiro $
-$ 
-
-$
-$		å²è¾¼ã¿ç®¡çæ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$
-$  kernel_cfg.hã®çæ
-$
-$FILE "kernel_cfg.h.new"$
-
-#define TNUM_ISRID	$LENGTH(ISR.ID_LIST)$$NL$
-$FOREACH id ISR.ID_LIST$
-	#define $id$	$+id$$NL$
-$END$
-
-$
-$  kernel_cfg.cã®çæ
-$
-$FILE "kernel_cfg.c"$
-
-/*$NL$
-$SPC$*  Interrupt Management Functions$NL$
-$SPC$*/$NL$
-$NL$
-
-$
-$  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
-$
-#ifndef LOG_ISR_ENTER$NL$
-#define LOG_ISR_ENTER(isrid)$NL$
-#endif /* LOG_ISR_ENTER */$NL$
-$NL$
-#ifndef LOG_ISR_LEAVE$NL$
-#define LOG_ISR_LEAVE(isrid)$NL$
-#endif /* LOG_ISR_LEAVE */$NL$
-$NL$
-
-$
-$  CRE_ISRã§ä½¿ç¨ã§ããå²è¾¼ã¿çªå·ã¨ããã«å¯¾å¿ããå²è¾¼ã¿ãã³ãã©çªå·ã®ããã©
-$  ã«ãå®ç¾©
-$
-$IF !LENGTH(INTNO_CREISR_VALID)$
-	$INTNO_CREISR_VALID = INTNO_VALID$
-$END$
-$IF !LENGTH(INHNO_CREISR_VALID)$
-	$INHNO_CREISR_VALID = INHNO_VALID$
-$END$
-
-$
-$  CFG_INTã§ä½¿ç¨ã§ããå²è¾¼ã¿åªå
-åº¦ã®ããã©ã«ãå®ç¾©
-$ 
-$IF !LENGTH(INTPRI_CFGINT_VALID)$
-	$INTPRI_CFGINT_VALID = RANGE(TMIN_INTPRI, TMAX_INTPRI)$
-$END$
-
-$
-$  å²è¾¼ã¿çªå·ã¨å²è¾¼ã¿ãã³ãã©çªå·ã®å¤æãã¼ãã«ã®ä½æ
-$
-$IF LENGTH(INTNO_CREISR_VALID) != LENGTH(INHNO_CREISR_VALID)$
-	$ERROR$length of `INTNO_CREISR_VALID' is different from length of `INHNO_CREISR_VALID'$END$
-$END$
-$i = 0$
-$FOREACH intno INTNO_CREISR_VALID$
-	$inhno = AT(INHNO_CREISR_VALID, i)$
-	$INHNO[intno] = inhno$
-	$INTNO[inhno] = intno$
-	$i = i + 1$
-$END$
-
-$
-$  å²è¾¼ã¿è¦æ±ã©ã¤ã³ã«é¢ããã¨ã©ã¼ãã§ãã¯
-$
-$ INTNO_LISTï¼å¦çæ¸ã¿ã®å²è¾¼ã¿çªå·ã®ãªã¹ãï¼ããã§ã®ã¿ä½¿ç¨ï¼
-$
-$FOREACH intno INT.ORDER_LIST$
-$	// intnoãå²è¾¼ã¿çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI2972ï¼½
-	$IF !LENGTH(FIND(INTNO_VALID, INT.INTNO[intno]))$
-		$ERROR INT.TEXT_LINE[intno]$E_PAR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' in %3%"),
-						"intno", INT.INTNO[intno], "CFG_INT")$
-		$END$
-	$END$
-
-$	// intnoãCFG_INTã«ãã£ã¦è¨­å®æ¸ã¿ã®å ´åï¼E_OBJï¼ï¼»NGKI2976ï¼½
-	$IF LENGTH(FIND(INTNO_LIST, INT.INTNO[intno]))$
-		$ERROR INT.TEXT_LINE[intno]$E_OBJ:$SPC$
-			$FORMAT(_("%1% `%2%\' in %3% is duplicated"),
-						"intno", INT.INTNO[intno], "CFG_INT")$
-		$END$
-	$END$
-
-$	// intatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2969ï¼½
-$	//ï¼TA_ENAINTï¼TA_EDGEï¼TARGET_INTATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
-	$IF (INT.INTATR[intno] & ~(TA_ENAINT|TA_EDGE|TARGET_INTATR)) != 0$
-		$ERROR INT.TEXT_LINE[intno]$E_RSATR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' of %3% `%4%\' in %5%"),
-						"intatr", INT.INTATR[intno], "intno",
-						INT.INTNO[intno], "CFG_INT")$
-		$END$
-	$END$
-
-$	// intpriãCFG_INTã«å¯¾ããå²è¾¼ã¿åªå
-åº¦ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼
-$	// ï¼»NGKI2973ï¼½
-	$IF !LENGTH(FIND(INTPRI_CFGINT_VALID, INT.INTPRI[intno]))$
-		$ERROR INT.TEXT_LINE[intno]$E_PAR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' in %3%"),
-						"intpri", INT.INTPRI[intno], "CFG_INT")$
-		$END$
-	$END$
-
-$	// ã«ã¼ãã«ç®¡çå¤ã«åºå®ããã¦ããintnoã«å¯¾ãã¦ï¼intpriã«TMIN_INTPRI
-$	// ãããå°ããå¤ãæå®ãããªãã£ãå ´åï¼E_OBJï¼ï¼»NGKI2983ï¼½
-	$IF LENGTH(FIND(INTNO_FIX_NONKERNEL, intno))$
-		$IF INT.INTPRI[intno] >= TMIN_INTPRI$
-			$ERROR INT.TEXT_LINE[intno]$E_OBJ:$SPC$
-				$FORMAT(_("%1% `%2%\' must have higher priority than %3%"),
-							"intno", INT.INTNO[intno], "TMIN_INTPRI")$
-			$END$
-		$END$
-	$END$
-
-$	// ã«ã¼ãã«ç®¡çã«åºå®ããã¦ããintnoã«å¯¾ãã¦ï¼intpriã«TMIN_INTPRI
-$	// ãããå°ããå¤ãæå®ãããå ´åï¼E_OBJï¼ï¼»NGKI2984ï¼½
-	$IF LENGTH(FIND(INTNO_FIX_KERNEL, intno))$
-		$IF INT.INTPRI[intno] < TMIN_INTPRI$
-			$ERROR INT.TEXT_LINE[intno]$E_OBJ:$SPC$
-				$FORMAT(_("%1% `%2%\' must not have higher priority than %3%"),
-							"intno", INT.INTNO[intno], "TMIN_INTPRI")$
-			$END$
-		$END$
-	$END$
-
-	$INTNO_LIST = APPEND(INTNO_LIST, INT.INTNO[intno])$
-$END$
-
-$
-$  å²è¾¼ã¿ãã³ãã©ã«é¢ããã¨ã©ã¼ãã§ãã¯
-$
-$ INHNO_LISTï¼å¦çæ¸ã¿ã®å²è¾¼ã¿ãã³ãã©çªå·ã®ãªã¹ãï¼ããã§ã®ã¿ä½¿ç¨ï¼
-$
-$FOREACH inhno INH.ORDER_LIST$
-$	// inhnoãå²è¾¼ã¿ãã³ãã©çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3055ï¼½
-	$IF !LENGTH(FIND(INHNO_VALID, INH.INHNO[inhno]))$
-		$ERROR INH.TEXT_LINE[inhno]$E_PAR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' in %3%"),
-						"inhno", INH.INHNO[inhno], "DEF_INH")$
-		$END$
-	$END$
-
-$	// inhnoãDEF_INHã«ãã£ã¦è¨­å®æ¸ã¿ã®å ´åï¼E_OBJï¼ï¼»NGKI3063ï¼½
-	$IF LENGTH(FIND(INHNO_LIST, INH.INHNO[inhno]))$
-		$ERROR INH.TEXT_LINE[inhno]$E_OBJ:$SPC$
-			$FORMAT(_("%1% `%2%\' in %3% is duplicated"),
-						"inhno", INH.INHNO[inhno], "DEF_INH")$
-		$END$
-	$END$
-
-$	// inhatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3052ï¼½
-$	//ï¼TARGET_INHATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
-	$IF (INH.INHATR[inhno] & ~TARGET_INHATR) != 0$
-		$ERROR INH.TEXT_LINE[inhno]$E_RSATR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' of %3% `%4%\' in %5%"),
-						"inhatr", INH.INHATR[inhno], "inhno",
-						INH.INHNO[inhno], "DEF_INH")$
-		$END$
-	$END$
-
-$	// ã«ã¼ãã«ç®¡çå¤ã«åºå®ããã¦ããinhnoã«å¯¾ãã¦ï¼inhatrã«TA_NONKERNEL
-$	// ãæå®ããã¦ããªãå ´åï¼E_RSATRï¼ï¼»NGKI3067ï¼½
-	$IF LENGTH(FIND(INHNO_FIX_NONKERNEL, inhno))$
-		$IF (INH.INHATR[inhno] & TA_NONKERNEL) == 0$
-			$ERROR INH.TEXT_LINE[inhno]$E_RSATR:$SPC$
-				$FORMAT(_("%1% `%2%\' must be non-kernel interrupt"),
-							"inhno", INH.INHNO[inhno])$
-			$END$
-		$END$
-	$END$
-
-$	// ã«ã¼ãã«ç®¡çã«åºå®ããã¦ããinhnoã«å¯¾ãã¦ï¼inhatrã«TA_NONKERNEL
-$	//ããæå®ããã¦ããå ´åï¼E_RSATRï¼ï¼»NGKI3068ï¼½
-	$IF LENGTH(FIND(INHNO_FIX_KERNEL, inhno))$
-		$IF (INH.INHATR[inhno] & TA_NONKERNEL) != 0$
-			$ERROR INH.TEXT_LINE[inhno]$E_RSATR:$SPC$
-				$FORMAT(_("%1% `%2%\' must not be non-kernel interrupt"),
-							"inhno", INH.INHNO[inhno])$
-			$END$
-		$END$
-	$END$
-
-	$IF LENGTH(INTNO[INH.INHNO[inhno]])$
-		$intno = INTNO[INH.INHNO[inhno]]$
-$		// inhnoã«å¯¾å¿ããintnoã«å¯¾ããCFG_INTããªãå ´åï¼E_OBJï¼ï¼»NGKI3062ï¼½
-		$IF !LENGTH(INT.INTNO[intno])$
-			$ERROR INH.TEXT_LINE[inhno]$E_OBJ:$SPC$
-				$FORMAT(_("%1% `%2%\' corresponding to %3% `%4%\' is not configured with %5%"),
-						"intno", intno, "inhno", INH.INHNO[inhno], "CFG_INT")$
-			$END$
-		$ELSE$
-			$IF (INH.INHATR[inhno] & TA_NONKERNEL) == 0$
-$				// inhatrã«TA_NONKERNELãæå®ããã¦ãããï¼inhnoã«å¯¾å¿
-$				// ããintnoã«å¯¾ãã¦CFG_INTã§è¨­å®ãããå²è¾¼ã¿åªå
-åº¦ã
-$				// TMIN_INTPRIãããå°ããå ´åï¼E_OBJï¼ï¼»NGKI3065ï¼½
-				$IF INT.INTPRI[intno] < TMIN_INTPRI$
-					$ERROR INT.TEXT_LINE[intno]$E_OBJ:$SPC$
-						$FORMAT(_("%1% `%2%\' configured for %3% `%4%\' is higher than %5%"),
-									"intpri", INT.INTPRI[intno], "inhno",
-									INH.INHNO[inhno], "TMIN_INTPRI")$
-					$END$
-				$END$
-			$ELSE$
-$				// inhatrã«TA_NONKERNELãæå®ããã¦ããï¼inhnoã«å¯¾å¿
-$				// ããintnoã«å¯¾ãã¦CFG_INTã§è¨­å®ãããå²è¾¼ã¿åªå
-åº¦ã
-$				// TMIN_INTPRIä»¥ä¸ã§ããå ´åï¼E_OBJï¼ï¼»NGKI3066ï¼½
-				$IF INT.INTPRI[intno] >= TMIN_INTPRI$
-					$ERROR INT.TEXT_LINE[intno]$E_OBJ:$SPC$
-						$FORMAT(_("%1% `%2%\' configured for %3% `%4%\' is lower than or equal to %5%"),
-									"intpri", INT.INTPRI[intno], "inhno",
-									INH.INHNO[inhno], "TMIN_INTPRI")$
-					$END$
-				$END$
-			$END$
-		$END$
-	$END$
-
-	$INHNO_LIST = APPEND(INHNO_LIST, INH.INHNO[inhno])$
-$END$
-
-$
-$  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ï¼ISRï¼ã«é¢ããã¨ã©ã¼ãã§ãã¯ã¨å²è¾¼ã¿ãã³ãã©ã®çæ
-$
-$FOREACH id ISR.ID_LIST$
-$	// isratrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2998ï¼½
-$	//ï¼TARGET_ISRATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
-	$IF (ISR.ISRATR[id] & ~TARGET_ISRATR) != 0$
-		$ERROR ISR.TEXT_LINE[id]$E_RSATR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' in %3%"),
-						"isratr", ISR.ISRATR[id], "CRE_ISR")$
-		$END$
-	$END$
-
-$	// intnoãCRE_ISRã«å¯¾ããå²è¾¼ã¿çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼
-$	// ï¼»NGKI3003ï¼½
-	$IF !LENGTH(FIND(INTNO_CREISR_VALID, ISR.INTNO[id]))$
-		$ERROR ISR.TEXT_LINE[id]$E_PAR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' in %3%"),
-						"intno", ISR.INTNO[id], "CRE_ISR")$
-		$END$
-	$END$
-
-$	// (TMIN_ISRPRI <= isrpri && isrpri <= TMAX_ISRPRI)ã§ãªãå ´åï¼E_PARï¼
-$	// ï¼»NGKI3005ï¼½
-	$IF !(TMIN_ISRPRI <= ISR.ISRPRI[id] && ISR.ISRPRI[id] <= TMAX_ISRPRI)$
-		$ERROR ISR.TEXT_LINE[id]$E_PAR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' in %3%"),
-						"isrpri", ISR.ISRPRI[id], "CRE_ISR")$
-		$END$
-	$END$
-$END$
-
-$FOREACH intno INTNO_CREISR_VALID$
-	$inhno = INHNO[intno]$
-
-$	// å²è¾¼ã¿çªå·intnoã«å¯¾ãã¦ç»é²ãããISRã®ãªã¹ãã®ä½æ
-	$isrid_list = {}$
-	$FOREACH id ISR.ID_LIST$
-		$IF ISR.INTNO[id] == intno$
-			$isrid_list = APPEND(isrid_list, id)$
-			$id_for_error = id$
-		$END$
-	$END$
-
-$	// å²è¾¼ã¿çªå·intnoã«å¯¾ãã¦ç»é²ãããISRãå­å¨ããå ´å
-	$IF LENGTH(isrid_list) > 0$
-$		// intnoã«å¯¾å¿ããinhnoã«å¯¾ãã¦DEF_INHãããå ´åï¼E_OBJï¼ï¼»NGKI3013ï¼½
-		$IF LENGTH(INH.INHNO[inhno])$
-			$ERROR ISR.TEXT_LINE[id_for_error]$E_OBJ:$SPC$
-				$FORMAT(_("%1% `%2%\' in %3% is duplicated with %4% `%5%\'"),
-							"intno", ISR.INTNO[id_for_error],
-							"CRE_ISR", "inhno", INH.INHNO[inhno])$
-			$END$
-		$END$
-
-$		// intnoã«å¯¾ããCFG_INTããªãå ´åï¼E_OBJï¼ï¼»NGKI3012ï¼½
-		$IF !LENGTH(INT.INTNO[intno])$
-			$ERROR ISR.TEXT_LINE[id_for_error]$E_OBJ:$SPC$
-				$FORMAT(_("%1% `%2%\' is not configured with %3%"),
-							"intno", ISR.INTNO[id_for_error], "CFG_INT")$
-			$END$
-		$ELSE$
-$			// intnoã«å¯¾ãã¦CFG_INTã§è¨­å®ãããå²è¾¼ã¿åªå
-åº¦ãTMIN_INTPRI
-$			// ãããå°ããå ´åï¼E_OBJï¼ï¼»NGKI3014ï¼½
-			$IF INT.INTPRI[intno] < TMIN_INTPRI$
-				$ERROR INT.TEXT_LINE[intno]$E_OBJ:$SPC$
-					$FORMAT(_("%1% `%2%\' configured for %3% `%4%\' is higher than %5%"),
-								"intpri", INT.INTPRI[intno], "intno",
-								ISR.INTNO[id_for_error], "TMIN_INTPRI")$
-				$END$
-			$END$
-		$END$
-
-$		// DEF_INH(inhno, { TA_NULL, _kernel_inthdr_<intno> } );
-		$INH.INHNO[inhno] = inhno$
-		$INH.INHATR[inhno] = VALUE("TA_NULL", 0)$
-		$INH.INTHDR[inhno] = CONCAT("_kernel_inthdr_", intno)$
-		$INH.ORDER_LIST = APPEND(INH.ORDER_LIST, inhno)$
-
-$		// ISRç¨ã®å²è¾¼ã¿ãã³ãã©
-		void$NL$
-		_kernel_inthdr_$intno$(void)$NL$
-		{$NL$
-$		// ISRãåªå
-åº¦é ã«å¼ã³åºã
-		$JOINEACH id SORT(isrid_list, "ISR.ISRPRI") "\n\tif (sense_lock()) {\n\t\tunlock_cpu();\n\t}\n\n"$
-			$TAB$LOG_ISR_ENTER($ISR.ISRID[id]$);$NL$
-			$TAB$((ISR)($ISR.ISR[id]$))((intptr_t)($ISR.EXINF[id]$));$NL$
-			$TAB$LOG_ISR_LEAVE($ISR.ISRID[id]$);$NL$
-		$END$
-		}$NL$
-	$END$
-$END$
-$NL$
-
-$
-$  å²è¾¼ã¿ãã³ãã©ã®ããã®æ¨æºçãªåæåæ
-å ±ã®çæ
-$
-$IF !OMIT_INITIALIZE_INTERRUPT || USE_INHINIB_TABLE$
-
-$
-$  å®ç¾©ããå²è¾¼ã¿ãã³ãã©ã®æ°
-$
-#define TNUM_DEF_INHNO	$LENGTH(INH.ORDER_LIST)$$NL$
-const uint_t _kernel_tnum_def_inhno = TNUM_DEF_INHNO;$NL$
-$NL$
-
-$
-$  å²è¾¼ã¿ãã³ãã©ã®ã¨ã³ããª
-$
-$FOREACH inhno INH.ORDER_LIST$
-	$IF (INH.INHATR[inhno] & TA_NONKERNEL) == 0$
-		INTHDR_ENTRY($INH.INHNO[inhno]$, $+INH.INHNO[inhno]$,$SPC$
-												$INH.INTHDR[inhno]$)$NL$
-	$END$
-$END$$NL$
-
-$
-$  å²è¾¼ã¿ãã³ãã©åæåãã­ãã¯
-$
-$IF LENGTH(INH.ORDER_LIST)$
-	const INHINIB _kernel_inhinib_table[TNUM_DEF_INHNO] = {$NL$
-	$JOINEACH inhno INH.ORDER_LIST ",\n"$
-		$TAB${$SPC$
-			($INH.INHNO[inhno]$),$SPC$
-			($INH.INHATR[inhno]$),$SPC$
-			$IF (INH.INHATR[inhno] & TA_NONKERNEL) == 0$
-				(FP)(INT_ENTRY($INH.INHNO[inhno]$, $INH.INTHDR[inhno]$))
-			$ELSE$
-				(FP)($INH.INTHDR[inhno]$)
-			$END$$SPC$
-		}$END$$NL$
-	};$NL$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(const INHINIB, _kernel_inhinib_table);$NL$
-$END$$NL$
-$END$
-
-$
-$  å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®ããã®æ¨æºçãªåæåæ
-å ±ã®çæ
-$
-$IF !OMIT_INITIALIZE_INTERRUPT || USE_INTINIB_TABLE$
-
-$
-$  è¨­å®ããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã®æ°
-$
-#define TNUM_CFG_INTNO	$LENGTH(INT.ORDER_LIST)$$NL$
-const uint_t _kernel_tnum_cfg_intno = TNUM_CFG_INTNO;$NL$
-$NL$
-
-$
-$  å²è¾¼ã¿è¦æ±ã©ã¤ã³åæåãã­ãã¯
-$
-$IF LENGTH(INT.ORDER_LIST)$
-	const INTINIB _kernel_intinib_table[TNUM_CFG_INTNO] = {$NL$
-	$JOINEACH intno INT.ORDER_LIST ",\n"$
-		$TAB${$SPC$
-			($INT.INTNO[intno]$),$SPC$
-			($INT.INTATR[intno]$),$SPC$
-			($INT.INTPRI[intno]$)$SPC$
-		}$END$$NL$
-	};$NL$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(const INTINIB, _kernel_intinib_table);$NL$
-$END$$NL$
-$END$
-
-$
-$  å²è¾¼ã¿ç®¡çæ©è½åæåé¢æ°
-$
-$initfuncs = APPEND(initfuncs, "_kernel_initialize_interrupt();")$
Index: asp3_wo_tecs/trunk/kernel/interrupt.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/interrupt.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/interrupt.trb	(revision 304)
@@ -0,0 +1,420 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: interrupt.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#		å²è¾¼ã¿ç®¡çæ©è½ã®çæã¹ã¯ãªãã
+#
+
+#
+#  kernel_cfg.hã®çæ
+#
+$kernelCfgH.add("#define TNUM_ISRID\t#{$cfgData[:CRE_ISR].size}")
+
+$cfgData[:CRE_ISR].sort.each do |id, params|
+  $kernelCfgH.add("#define #{params[:isrid]}\t#{params[:isrid].val}")
+end
+$kernelCfgH.add()
+
+#
+#  kernel_cfg.cã®çæ
+#
+$kernelCfgC.comment_header("Interrupt Management Functions")
+
+#
+#  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+#
+$kernelCfgC.append(<<EOS)
+#ifndef LOG_ISR_ENTER
+#define LOG_ISR_ENTER(isrid)
+#endif /* LOG_ISR_ENTER */
+
+#ifndef LOG_ISR_LEAVE
+#define LOG_ISR_LEAVE(isrid)
+#endif /* LOG_ISR_LEAVE */
+
+EOS
+
+#
+#  CRE_ISRã§ä½¿ç¨ã§ããå²è¾¼ã¿çªå·ã¨ããã«å¯¾å¿ããå²è¾¼ã¿ãã³ãã©çªå·ã®ã
+#  ãã©ã«ãå®ç¾©
+#
+if $INTNO_CREISR_VALID.nil?
+  $INTNO_CREISR_VALID = $INTNO_VALID
+end
+if $INHNO_CREISR_VALID.nil?
+  $INHNO_CREISR_VALID = $INHNO_VALID
+end
+
+#
+#  CFG_INTã§ä½¿ç¨ã§ããå²è¾¼ã¿åªå
+åº¦ã®ããã©ã«ãå®ç¾©
+# 
+if $INTPRI_CFGINT_VALID.nil?
+  $INTPRI_CFGINT_VALID = $TMIN_INTPRI.val.upto($TMAX_INTPRI.val).to_a
+end
+
+#
+#  å²è¾¼ã¿çªå·ã¨å²è¾¼ã¿ãã³ãã©çªå·ã®å¤æãã¼ãã«ã®ä½æ
+#
+if $INTNO_CREISR_VALID.length != $INHNO_CREISR_VALID.length
+  error_exit("length of `INTNO_CREISR_VALID' is different from" \
+									" length of `INHNO_CREISR_VALID'")
+end
+$toInhnoVal = {}
+$toIntnoVal = {}
+inhno_creisr_valid = $INHNO_CREISR_VALID.dup
+$INTNO_CREISR_VALID.each do |intnoVal|
+  inhnoVal = inhno_creisr_valid.shift
+  $toInhnoVal[intnoVal] = inhnoVal
+  $toIntnoVal[inhnoVal] = intnoVal
+end
+
+#
+#  å²è¾¼ã¿è¦æ±ã©ã¤ã³ã«é¢ããã¨ã©ã¼ãã§ãã¯
+#
+$cfgData[:CFG_INT].each do |id, params|
+  #	intnoãå²è¾¼ã¿çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI2972ï¼½
+  if $INTNO_VALID.index(params[:intno]).nil?
+    error_illegal("E_PAR", params, :intno)
+  end
+
+  #	intatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2969ï¼½
+  #ï¼TA_ENAINTï¼TA_EDGEï¼TARGET_INTATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+  if (params[:intatr] & ~($TA_ENAINT|$TA_EDGE|$TARGET_INTATR)) != 0
+    error_illegal_sym("E_RSATR", params, :intatr, :intno)
+  end
+
+  #	intpriãCFG_INTã«å¯¾ããå²è¾¼ã¿åªå
+åº¦ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼
+  #	ï¼»NGKI2973ï¼½
+  if $INTPRI_CFGINT_VALID.index(params[:intpri]).nil?
+    error_illegal_sym("E_OBJ", params, :intpri, :intno)
+  end
+
+  # ã«ã¼ãã«ç®¡çå¤ã«åºå®ããã¦ããintnoã«å¯¾ãã¦ï¼intpriã«TMIN_INTPRIã
+  #	ããå°ããå¤ãæå®ãããªãã£ãå ´åï¼E_OBJï¼ï¼»NGKI2983ï¼½
+  if !$INTNO_FIX_NONKERNEL.nil?
+    if !$INTNO_FIX_NONKERNEL.index(params[:intno]).nil?
+      if params[:intpri] >= $TMIN_INTPRI
+        error_ercd("E_OBJ", params, "intno `#{params[:intno]}'" \
+							" must have higher priority than TMIN_INTPRI")
+      end
+    end
+  end
+
+  #	ã«ã¼ãã«ç®¡çã«åºå®ããã¦ããintnoã«å¯¾ãã¦ï¼intpriã«TMIN_INTPRIãã
+  #	ãå°ããå¤ãæå®ãããå ´åï¼E_OBJï¼ï¼»NGKI2984ï¼½
+  if !$INTNO_FIX_KERNEL.nil?
+    if !$INTNO_FIX_KERNEL.index(params[:intno]).nil?
+      if params[:intpri] < $TMIN_INTPRI
+        error_ercd("E_OBJ", params, "intno `#{params[:intno]}'" \
+					" must have lower or equal priority to TMIN_INTPRI")
+      end
+    end
+  end
+end
+
+#
+#  å²è¾¼ã¿ãã³ãã©ã«é¢ããã¨ã©ã¼ãã§ãã¯
+#
+$cfgData[:DEF_INH].each do |id, params|
+  # inhnoãå²è¾¼ã¿ãã³ãã©çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3055ï¼½
+  if $INHNO_VALID.index(params[:inhno]).nil?
+    error_illegal("E_PAR", params, :inhno)
+  end
+
+  # inhatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3052ï¼½
+  #ï¼TARGET_INHATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+  if (params[:inhatr] & ~$TARGET_INHATR) != 0
+    error_illegal_sym("E_RSATR", params, :inhatr, :inhno)
+  end
+
+  #	ã«ã¼ãã«ç®¡çå¤ã«åºå®ããã¦ããinhnoã«å¯¾ãã¦ï¼inhatrã«TA_NONKERNELã
+  #	æå®ããã¦ããªãå ´åï¼E_RSATRï¼ï¼»NGKI3067ï¼½
+  if !$INHNO_FIX_NONKERNEL.nil?
+    if !$INHNO_FIX_NONKERNEL.index(params[:inhno]).nil?
+      if (params[:inhatr] & $TA_NONKERNEL) == 0
+        error_ercd("E_RSATR", params, "inhno `#{params[:inhno]}'" \
+									" must be non-kernel interrupt")
+      end
+    end
+  end
+
+  #	ã«ã¼ãã«ç®¡çã«åºå®ããã¦ããinhnoã«å¯¾ãã¦ï¼inhatrã«TA_NONKERNELãæ
+  #	å®ããã¦ããå ´åï¼E_RSATRï¼ï¼»NGKI3068ï¼½
+  if !$INHNO_FIX_KERNEL.nil?
+    if !$INHNO_FIX_KERNEL.index(params[:inhno]).nil?
+      if (params[:inhatr] & $TA_NONKERNEL) != 0
+        error_ercd("E_RSATR", params, "inhno `#{params[:inhno]}'" \
+									" must not be non-kernel interrupt")
+      end
+    end
+  end
+
+  if $toIntnoVal.has_key?(params[:inhno].val)
+    intnoVal = $toIntnoVal[params[:inhno].val]
+
+    # inhnoã«å¯¾å¿ããintnoã«å¯¾ããCFG_INTããªãå ´åï¼E_OBJï¼ï¼»NGKI3062ï¼½
+    if !$cfgData[:CFG_INT].has_key?(intnoVal)
+      error_ercd("E_OBJ", params, "intno `#{intnoVal}' corresponding to" \
+				" inhno `#{params[:inhno]}' is not configured with CFG_INT")
+    else
+      intnoParams = $cfgData[:CFG_INT][intnoVal]
+      if (params[:inhatr] & $TA_NONKERNEL) == 0
+        # inhatrã«TA_NONKERNELãæå®ããã¦ãããï¼inhnoã«å¯¾å¿ããintno
+        # ã«å¯¾ãã¦CFG_INTã§è¨­å®ãããå²è¾¼ã¿åªå
+åº¦ãTMIN_INTPRIãããå°
+        # ããå ´åï¼E_OBJï¼ï¼»NGKI3065ï¼½
+        if intnoParams[:intpri] < $TMIN_INTPRI
+          error_ercd("E_OBJ", params, "intpri `#{intnoParams[:intpri]}'" \
+						" configured for inhno `#{params[:inhno]}' must" \
+						" be lower or equal to TMIN_INTPRI")
+        end
+      else
+        # inhatrã«TA_NONKERNELãæå®ããã¦ããï¼inhnoã«å¯¾å¿ããintnoã«
+        # å¯¾ãã¦CFG_INTã§è¨­å®ãããå²è¾¼ã¿åªå
+åº¦ãTMIN_INTPRIä»¥ä¸ã§ãã
+        # å ´åï¼E_OBJï¼ï¼»NGKI3066ï¼½
+        if intnoParams[:intpri] >= $TMIN_INTPRI
+          error_ercd("E_OBJ", params, "intpri `#{intnoParams[:intpri]}'" \
+						" configured for inhno `#{params[:inhno]}' must" \
+						" be higher than with TMIN_INTPRI")
+        end
+      end
+    end
+  end
+end
+
+#
+#  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ï¼ISRï¼ã«é¢ããã¨ã©ã¼ãã§ãã¯ã¨å²è¾¼ã¿ãã³ãã©ã®çæ
+#
+$cfgData[:CRE_ISR].sort.each do |id, params|
+  #	isratrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2998ï¼½
+  #ï¼TARGET_ISRATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+  if (params[:isratr] & ~$TARGET_ISRATR) != 0
+    error_illegal("E_RSATR", params, "isratr")
+  end
+
+  #	intnoãCRE_ISRã«å¯¾ããå²è¾¼ã¿çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼
+  #	ï¼»NGKI3003ï¼½
+  if $INTNO_CREISR_VALID.index(params[:intno]).nil?
+    error_illegal("E_PAR", params, "intno")
+  end
+
+  #	(TMIN_ISRPRI <= isrpri && isrpri <= TMAX_ISRPRI)ã§ãªãå ´åï¼E_PARï¼
+  #	ï¼»NGKI3005ï¼½
+  if !($TMIN_ISRPRI <= params[:isrpri] && params[:isrpri] <= $TMAX_ISRPRI)
+    error_illegal("E_PAR", params, "isrpri")
+  end
+end
+
+$INTNO_CREISR_VALID.each do |intnoVal|
+  inhnoVal = $toInhnoVal[intnoVal]
+
+  # å²è¾¼ã¿çªå·intnoã«å¯¾ãã¦ç»é²ãããISRã®ãªã¹ãã®ä½æ
+  isrParamsList = []
+  $cfgData[:CRE_ISR].sort.each do |id, params|
+    if params[:intno] == intnoVal
+      isrParamsList.push(params)
+    end
+  end
+
+  #	å²è¾¼ã¿çªå·intnoã«å¯¾ãã¦ç»é²ãããISRãå­å¨ããå ´å
+  if isrParamsList.size > 0
+    # intnoã«å¯¾å¿ããinhnoã«å¯¾ãã¦DEF_INHãããå ´åï¼E_OBJï¼ï¼»NGKI3013ï¼½
+    if $cfgData[:DEF_INH].has_key?(inhnoVal)
+      inhnoParams = $cfgData[:DEF_INH][inhnoVal]
+      error_ercd("E_OBJ", isrParamsList[0], \
+					"intno `#{isrParamsList[0][:intno]}' in CRE_ISR" \
+					" is duplicated with inhno #{inhnoParams[:inhno]}")
+    end
+
+    # intnoã«å¯¾ããCFG_INTããªãå ´åï¼E_OBJï¼ï¼»NGKI3012ï¼½
+    if !$cfgData[:CFG_INT].has_key?(intnoVal)
+      error_ercd("E_OBJ", isrParamsList[0], \
+						"intno `#{isrParamsList[0][:intno]}'" \
+						" is not configured with CFG_INT")
+    else
+      intnoParams = $cfgData[:CFG_INT][intnoVal]
+
+      #	intnoã«å¯¾ãã¦CFG_INTã§è¨­å®ãããå²è¾¼ã¿åªå
+åº¦ãTMIN_INTPRIããã
+      #	å°ããå ´åï¼E_OBJï¼ï¼»NGKI3014ï¼½
+      if intnoParams[:intpri] < $TMIN_INTPRI
+        error_ercd("E_OBJ", isrParamsList[0],
+						"intpri `#{intnoParams[:intpri]}' configured for" \
+						" intno `#{isrParamsList[0][:intno]}}' in higher" \
+						" than TMIN_INTPRI")
+      end
+    end
+
+    # æ¬¡ã®DEF_INHã«ç¸å½ãããã¼ã¿ãçæ
+    # DEF_INH(inhno, { TA_NULL, _kernel_inthdr_<intno> } );
+    params = {
+      :inhno => StrVal.new(inhnoVal.to_s, inhnoVal),
+      :inhatr => $TA_NULL,
+      :inthdr => StrVal.new("_kernel_inthdr_#{intnoVal}")
+    }
+    $cfgData[:DEF_INH][inhnoVal] = params
+
+    # ISRç¨ã®å²è¾¼ã¿ãã³ãã©
+    $kernelCfgC.add("void")
+    $kernelCfgC.add("_kernel_inthdr_#{intnoVal}(void)")
+    $kernelCfgC.add("{")
+    # ISRãåªå
+åº¦é ã«å¼ã³åºã
+    isrParamsList.sort_by {|params| params[:isrpri]}.each_with_index \
+														do |params, index|
+      if index > 0
+        $kernelCfgC.add
+        $kernelCfgC.add("\tif (sense_lock()) {")
+        $kernelCfgC.add("\t\tunlock_cpu();")
+        $kernelCfgC.add2("\t}")
+      end
+      $kernelCfgC.add("\tLOG_ISR_ENTER(#{params[:isrid]});")
+      $kernelCfgC.add("\t((ISR)(#{params[:isr]}))" \
+						"((intptr_t)(#{params[:exinf]}));")
+      $kernelCfgC.add("\tLOG_ISR_LEAVE(#{params[:isrid]});")
+    end
+    $kernelCfgC.add2("}")
+  end
+end
+
+#
+#  å²è¾¼ã¿ãã³ãã©ã®ããã®æ¨æºçãªåæåæ
+å ±ã®çæ
+#
+if $OMIT_INITIALIZE_INTERRUPT.nil? || !$USE_INHINIB_TABLE.nil?
+  #
+  #  å®ç¾©ããå²è¾¼ã¿ãã³ãã©ã®æ°
+  #
+  $kernelCfgC.append(<<EOS)
+#define TNUM_DEF_INHNO	#{$cfgData[:DEF_INH].size}
+const uint_t _kernel_tnum_def_inhno = TNUM_DEF_INHNO;
+
+EOS
+
+  if $cfgData[:DEF_INH].size != 0
+    #
+    #  å²è¾¼ã¿ãã³ãã©ã®ã¨ã³ããª
+    #
+    $cfgData[:DEF_INH].each do |id, params|
+      if (params[:inhatr] & $TA_NONKERNEL) == 0
+        $kernelCfgC.add("INTHDR_ENTRY(#{params[:inhno]}, " \
+						"#{params[:inhno].val}, #{params[:inthdr]})")
+      end
+    end
+    $kernelCfgC.add("")
+
+    #
+    #  å²è¾¼ã¿ãã³ãã©åæåãã­ãã¯
+    #
+    $kernelCfgC.add("const INHINIB _kernel_inhinib_table[TNUM_DEF_INHNO] = {")
+    $cfgData[:DEF_INH].each_with_index do |(id, params), index|
+      $kernelCfgC.add(",") if index > 0
+      if (params[:inhatr] & $TA_NONKERNEL) == 0
+        inthdr = "(FP)(INT_ENTRY(#{params[:inhno]}, #{params[:inthdr]}))"
+      else
+        inthdr = "(FP)(#{params[:inthdr]})"
+      end
+      $kernelCfgC.append("\t{ (#{params[:inhno]}), (#{params[:inhatr]}), " \
+															"#{inthdr} }")
+    end
+    $kernelCfgC.add
+    $kernelCfgC.add2("};")
+  else
+    $kernelCfgC.add2("TOPPERS_EMPTY_LABEL(const INHINIB, " \
+										"_kernel_inhinib_table);")
+  end
+end
+
+#
+#  å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®ããã®æ¨æºçãªåæåæ
+å ±ã®çæ
+#
+if $OMIT_INITIALIZE_INTERRUPT.nil? || !$USE_INTINIB_TABLE.nil?
+  #
+  #  è¨­å®ããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã®æ°
+  #
+  $kernelCfgC.append(<<EOS)
+#define TNUM_CFG_INTNO	#{$cfgData[:CFG_INT].size}
+const uint_t _kernel_tnum_cfg_intno = TNUM_CFG_INTNO;
+
+EOS
+
+  #
+  #  å²è¾¼ã¿è¦æ±ã©ã¤ã³åæåãã­ãã¯
+  #
+  if $cfgData[:CFG_INT].size != 0
+    $kernelCfgC.add("const INTINIB _kernel_intinib_table[TNUM_CFG_INTNO] = {")
+    $cfgData[:CFG_INT].each_with_index do |(id, params), index|
+      $kernelCfgC.add(",") if index > 0
+      $kernelCfgC.append("\t{ (#{params[:intno]}), (#{params[:intatr]}), " \
+													"(#{params[:intpri]}) }")
+    end
+    $kernelCfgC.add
+    $kernelCfgC.add2("};")
+  else
+    $kernelCfgC.add2("TOPPERS_EMPTY_LABEL(const INTINIB, " \
+										"_kernel_intinib_table);")
+  end
+end
+
+#
+#  å²è¾¼ã¿ç®¡çæ©è½åæåé¢æ°ã®è¿½å 
+#
+$initializeFunctions.push("_kernel_initialize_interrupt();")
Index: asp3_wo_tecs/trunk/kernel/kernel.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel.tf	(revision 303)
+++ 	(revision )
@@ -1,434 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2015 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: kernel.tf 480 2016-01-03 07:37:12Z ertl-hiro $
-$ 
-
-$
-$		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$ 
-$  ã¿ã¤ã ã¹ã¿ã³ããã¡ã¤ã«ã®çæ
-$ 
-$FILE "kernel_cfg.timestamp"$
-
-$
-$  kernel_cfg.hã®å
-é ­é¨åã®çæ
-$
-$FILE "kernel_cfg.h.new"$
-
-/* kernel_cfg.h */$NL$
-#ifndef TOPPERS_KERNEL_CFG_H$NL$
-#define TOPPERS_KERNEL_CFG_H$NL$
-
-$
-$  kernel_cfg.cã®å
-é ­é¨åã®çæ
-$
-$FILE "kernel_cfg.c"$
-
-/* kernel_cfg.c */$NL$
-#include "kernel/kernel_int.h"$NL$
-#include "kernel_cfg.h"$NL$
-$NL$
-
-#if !(TKERNEL_PRID == 0x0007U && (TKERNEL_PRVER & 0xf000U) == 0x3000U)$NL$
-#error The kernel does not match this configuration file.$NL$
-#endif$NL$
-$NL$
-
-$ 
-$  ã¤ã³ã¯ã«ã¼ããã£ã¬ã¯ãã£ãï¼#includeï¼
-$ 
-/*$NL$
-$SPC$*  Include Directives (#include)$NL$
-$SPC$*/$NL$
-$NL$
-$INCLUDES$
-$NL$
-
-$
-$  ã¹ã¿ãã¯é åã®ç¢ºä¿é¢æ°
-$
-$IF !ISFUNCTION("ALLOC_STACK")$
-$FUNCTION ALLOC_STACK$
-$	// å¤§ããæ¹ã«ä¸¸ãããµã¤ãºã§ç¢ºä¿ããï¼»NGKI1050ï¼½ï¼»NGKI3220ï¼½
-	static STK_T $ARGV[1]$[COUNT_STK_T($ARGV[2]$)];$NL$
-	$RESULT = FORMAT("ROUND_STK_T(%1%)", ARGV[2])$
-$END$
-$END$
-
-$
-$  éç¥ãã³ãã©ã®çæé¢æ°
-$
-$FUNCTION GENERATE_NFYHDR$
-$	// ãã©ã¡ã¼ã¿ãå¤æ°ã«æ ¼ç´
-	$nfymode = ARGV[1]$
-	$nfymode1 = nfymode & 0x0f$
-	$nfymode2 = nfymode & ~0x0f$
-	$par1 = ARGV[2]$
-	$par2 = ARGV[3]$
-	$text_line = ARGV[6]$
-	$objid = ARGV[7]$
-	$apiname = ARGV[8]$
-
-$	// éç¥å¦çã®ãã©ã¡ã¼ã¿æ°ã«ããè£æ­£å¦ç
-	$IF nfymode == TNFY_HANDLER || nfymode1 == TNFY_SETVAR
-								|| nfymode1 == TNFY_SETFLG
-								|| nfymode1 == TNFY_SNDDTQ$
-$		// éç¥å¦çã®ãã©ã¡ã¼ã¿ã2ã¤ã®å ´å
-		$numpar = 2$
-		$epar1 = ARGV[4]$
-		$epar2 = ARGV[5]$
-	$ELSE$
-$		// éç¥å¦çã®ãã©ã¡ã¼ã¿ã1ã¤ã®å ´å
-		$numpar = 1$
-		$epar1 = ARGV[3]$
-		$epar2 = ARGV[4]$
-	$END$
-
-$	// ãã©ã¡ã¼ã¿æ°ã®ãã§ãã¯
-	$IF (numpar == 2 && !LENGTH(par2))
-					|| (nfymode2 != 0 && !LENGTH(epar1))
-					|| (nfymode2 == TENFY_SETFLG && !LENGTH(epar2))$
-$		// ãã©ã¡ã¼ã¿ãè¶³ããªãå ´å
-		$ERROR text_line$
-			$FORMAT(_("too few parameters for %1% `%2%\' of `%3%\' in %4%"),
-										"nfymode", nfymode, objid, apiname)$
-		$END$
-	$ELIF (nfymode2 == 0 && LENGTH(epar1))
-					|| (nfymode2 != TENFY_SETFLG && LENGTH(epar2))$
-$		// ãã©ã¡ã¼ã¿ãå¤ãããå ´å
-		$ERROR text_line$
-			$FORMAT(_("too many parameters for %1% `%2%\' of `%3%\' in %4%"),
-										"nfymode", nfymode, objid, apiname)$
-		$END$
-	$ELIF nfymode == TNFY_HANDLER$
-$		// ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºã
-		$funcname = FORMAT("(NFYHDR)(%s)", par2)$
-	$ELSE$
-$		// éç¥ãã³ãã©ã®é¢æ°å
-		$funcname = CONCAT("_kernel_nfyhdr_", objid)$
-
-$		// ã¨ã©ã¼éç¥ã®ããã®å¤æ°ã®ã¢ãã¬ã¹ã¨ãªãã¸ã§ã¯ãIDãæ ¼ç´ãã
-$		// å¤æ°ã®çæï¼ã¨ã©ã¼ãã§ãã¯ã®ããã«å¿
-è¦ï¼
-		$IF nfymode2 == TENFY_SETVAR ||  nfymode2 == TENFY_INCVAR$
-			intptr_t *const $funcname$_p_evar =
-			$SPC$(intptr_t *)($epar1$);$NL$$NL$
-		$ELIF nfymode2 == TENFY_ACTTSK || nfymode2 == TENFY_WUPTSK$
-			const ID $funcname$_etskid = $epar1$;$NL$$NL$
-		$ELIF nfymode2 == TENFY_SIGSEM$
-			const ID $funcname$_esemid = $epar1$;$NL$$NL$
-		$ELIF nfymode2 == TENFY_SETFLG$
-			const ID $funcname$_eflgid = $epar1$;$NL$$NL$
-		$ELIF nfymode2 == TENFY_SNDDTQ$
-			const ID $funcname$_edtqid = $epar1$;$NL$$NL$
-		$END$
-
-$		// é¢æ°ã®å
-é ­é¨åã®çæ
-		static void$NL$
-		$funcname$(intptr_t exinf)$NL$
-		{$NL$
-
-		$IF nfymode2 == 0$
-$			// ã¨ã©ã¼éç¥ããªãå ´å
-			$error_code = "(void) "$
-		$ELSE$
-$			// ã¨ã©ã¼éç¥ãããå ´å
-			$TAB$ER		ercd;$NL$
-			$NL$
-			$error_code = "ercd = "$
-		$END$
-
-$		// ã¤ãã³ãéç¥å¦çã®å¦ç
-		$IF nfymode1 == TNFY_SETVAR && nfymode2 == 0$
-$			// å¤æ°ã®è¨­å®
-			$TAB$*((intptr_t *) exinf) = ($par2$);$NL$
-		$ELIF nfymode1 == TNFY_INCVAR && nfymode2 == 0$
-$			// å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã
-			$TAB$*((intptr_t *) exinf) += 1;$NL$
-		$ELIF nfymode1 == TNFY_ACTTSK$
-$			// ã¿ã¹ã¯ã®èµ·å
-			$TAB$$error_code$act_tsk((ID) exinf);$NL$
-		$ELIF nfymode1 == TNFY_WUPTSK$
-$			// ã¿ã¹ã¯ã®èµ·åº
-			$TAB$$error_code$wup_tsk((ID) exinf);$NL$
-		$ELIF nfymode1 == TNFY_SIGSEM$
-$			// ã»ããã©ã®è¿å´
-			$TAB$$error_code$sig_sem((ID) exinf);$NL$
-		$ELIF nfymode1 == TNFY_SETFLG$
-$			// ã¤ãã³ããã©ã°ã®ã»ãã
-			$TAB$$error_code$set_flg(((ID) exinf), $par2$);$NL$
-		$ELIF nfymode1 == TNFY_SNDDTQ$
-$			// ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡
-			$TAB$$error_code$psnd_dtq(((ID) exinf), $par2$);$NL$
-		$ELSE$
-			$ERROR text_line$E_PAR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-									"nfymode", nfymode, objid, apiname)$
-			$END$
-		$END$
-
-		$IF nfymode2 != 0$
-$			// ã¨ã©ã¼éç¥å¦çã®å¦ç
-			$TAB$if (ercd != E_OK) {$NL$
-
-			$IF nfymode2 == TENFY_SETVAR$
-$				// å¤æ°ã®è¨­å®
-				$TAB$$TAB$*$funcname$_p_evar = (intptr_t) ercd;$NL$
-			$ELIF nfymode2 == TENFY_INCVAR$
-$				// å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã
-				$TAB$$TAB$*$funcname$_p_evar += 1;$NL$
-			$ELIF nfymode2 == TENFY_ACTTSK$
-$				// ã¿ã¹ã¯ã®èµ·å
-				$TAB$$TAB$(void) act_tsk($funcname$_etskid);$NL$
-			$ELIF nfymode2 == TENFY_WUPTSK$
-$				// ã¿ã¹ã¯ã®èµ·åº
-				$TAB$$TAB$(void) wup_tsk($funcname$_etskid);$NL$
-			$ELIF nfymode2 == TENFY_SIGSEM$
-$				// ã»ããã©ã®è¿å´
-				$TAB$$TAB$(void) sig_sem($funcname$_esemid);$NL$
-			$ELIF nfymode2 == TENFY_SETFLG$
-$				// ã¤ãã³ããã©ã°ã®ã»ãã
-				$TAB$$TAB$(void) set_flg($funcname$_eflgid, $epar2$);$NL$
-			$ELIF nfymode2 == TENFY_SNDDTQ$
-$				// ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡
-				$TAB$$TAB$(void) psnd_dtq
-								($funcname$_edtqid, (intptr_t) ercd);$NL$
-			$ELSE$
-				$ERROR text_line$E_PAR:$SPC$
-					$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-										"nfymode", nfymode, objid, apiname)$
-				$END$
-			$END$
-
-			$TAB$}$NL$
-		$END$
-
-$		// é¢æ°ã®æ«å°¾é¨åã®çæ
-		}$NL$
-		$NL$
-	$END$
-	$RESULT = funcname$
-$END$
-
-$
-$  åæ©è½ã¢ã¸ã¥ã¼ã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³
-$
-$INCLUDE "kernel/task.tf"$
-$INCLUDE "kernel/semaphore.tf"$
-$INCLUDE "kernel/eventflag.tf"$
-$INCLUDE "kernel/dataqueue.tf"$
-$INCLUDE "kernel/pridataq.tf"$
-$INCLUDE "kernel/mutex.tf"$
-$INCLUDE "kernel/mempfix.tf"$
-$INCLUDE "kernel/cyclic.tf"$
-$INCLUDE "kernel/alarm.tf"$
-$INCLUDE "kernel/interrupt.tf"$
-$INCLUDE "kernel/exception.tf"$
-
-$ 
-$  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é å
-$ 
-/*$NL$
-$SPC$*  Stack Area for Non-task Context$NL$
-$SPC$*/$NL$
-$NL$
-
-$IF !LENGTH(ICS.ORDER_LIST)$
-$	// DEF_ICSããªãå ´åã®ããã©ã«ãå¤ã®è¨­å®
-	#ifdef DEFAULT_ISTK$NL$
-	$NL$
-	#define TOPPERS_ISTKSZ		DEFAULT_ISTKSZ$NL$
-	#define TOPPERS_ISTK		DEFAULT_ISTK$NL$
-	$NL$
-	#else /* DEAULT_ISTK */$NL$
-	$NL$
-	$istksz = ALLOC_STACK("_kernel_istack", "DEFAULT_ISTKSZ")$$NL$
-	#define TOPPERS_ISTKSZ		$istksz$$NL$
-	#define TOPPERS_ISTK		_kernel_istack$NL$
-	$NL$
-	#endif /* DEAULT_ISTK */$NL$
-$ELSE$
-
-$	// éçAPIãDEF_ICSããè¤æ°ããï¼E_OBJï¼ï¼»NGKI3216ï¼½
-	$IF LENGTH(ICS.ORDER_LIST) > 1$
-		$ERROR$E_OBJ: $FORMAT(_("too many %1%"), "DEF_ICS")$$END$
-	$END$
-
-$	// istkszã0ä»¥ä¸ãï¼ã¿ã¼ã²ããå®ç¾©ã®æå°å¤ï¼TARGET_MIN_ISTKSZï¼ããã
-$	// å°ããå ´åï¼E_PARï¼ï¼»NGKI3254ï¼½
-	$IF ICS.ISTKSZ[1] <= 0 || (TARGET_MIN_ISTKSZ
-									&& ICS.ISTKSZ[1] < TARGET_MIN_ISTKSZ)$
-		$ERROR ICS.TEXT_LINE[1]$E_PAR:$SPC$
-			$FORMAT(_("too small %1% `%2%\' in %3%"),
-						"istksz", ICS.ISTKSZ[1], "DEF_ICS")$
-		$END$
-	$END$
-
-$ 	// istkszãã¹ã¿ãã¯é åã®ãµã¤ãºã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3222ï¼½
-	$IF !EQ(ICS.ISTK[1], "NULL") && CHECK_STKSZ_ALIGN
-							&& (ICS.ISTKSZ[1] & (CHECK_STKSZ_ALIGN - 1))$
-		$ERROR ICS.TEXT_LINE[1]$E_PAR:$SPC$
-			$FORMAT(_("%1% `%2%\' in %3% is not aligned"),
-						"istksz", ICS.ISTKSZ[1], "DEF_ICS")$
-		$END$
-	$END$
-
-	$IF EQ(ICS.ISTK[1], "NULL")$
-$		// ã¹ã¿ãã¯é åã®èªåå²ä»ã
-		$istksz = ALLOC_STACK("_kernel_istack", ICS.ISTKSZ[1])$$NL$
-		#define TOPPERS_ISTKSZ		$istksz$$NL$
-		#define TOPPERS_ISTK		_kernel_istack$NL$
-	$ELSE$
-		#define TOPPERS_ISTKSZ		($ICS.ISTKSZ[1]$)$NL$
-		#define TOPPERS_ISTK		(void *)($ICS.ISTK[1]$)$NL$
-	$END$
-$END$
-$NL$
-
-$ éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é å
-const size_t	_kernel_istksz = TOPPERS_ISTKSZ;$NL$
-STK_T *const	_kernel_istk = TOPPERS_ISTK;$NL$
-$NL$
-#ifdef TOPPERS_ISTKPT$NL$
-STK_T *const	_kernel_istkpt = TOPPERS_ISTKPT(TOPPERS_ISTK, TOPPERS_ISTKSZ);$NL$
-#endif /* TOPPERS_ISTKPT */$NL$
-$NL$
-
-$ 
-$  ã¿ã¤ã ã¤ãã³ãç®¡ç
-$ 
-/*$NL$
-$SPC$*  Time Event Management$NL$
-$SPC$*/$NL$
-$NL$
-TMEVTN   _kernel_tmevt_heap[1 + TNUM_TSKID + TNUM_CYCID + TNUM_ALMID];$NL$
-$NL$
-
-$ 
-$  åã¢ã¸ã¥ã¼ã«ã®åæåé¢æ°
-$ 
-/*$NL$
-$SPC$*  Module Initialization Function$NL$
-$SPC$*/$NL$
-$NL$
-void$NL$
-_kernel_initialize_object(void)$NL$
-{$NL$
-$FOREACH func (initfuncs)$
-	$TAB$$func$$NL$
-$END$
-}$NL$
-$NL$
-
-$ 
-$  åæåã«ã¼ãã³ã®å®è¡é¢æ°
-$ 
-/*$NL$
-$SPC$*  Initialization Routine$NL$
-$SPC$*/$NL$
-$NL$
-void$NL$
-_kernel_call_inirtn(void)$NL$
-{$NL$
-$FOREACH order INI.ORDER_LIST$
-$ 	// iniatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3241ï¼½
-$	//ï¼TA_NULLã§ãªãå ´åï¼
-	$IF INI.INIATR[order] != 0$
-		$ERROR INI.TEXT_LINE[order]$E_RSATR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' of %3% `%4%\' in %5%"),
-						"iniatr", INI.INIATR[order], "inirtn",
-						INI.INIRTN[order], "ATT_INI")$
-		$END$
-	$END$
-	$TAB$((INIRTN)($INI.INIRTN[order]$))((intptr_t)($INI.EXINF[order]$));$NL$
-$END$
-}$NL$
-$NL$
-
-$ 
-$  çµäºå¦çã«ã¼ãã³ã®å®è¡é¢æ°
-$ 
-/*$NL$
-$SPC$*  Termination Routine$NL$
-$SPC$*/$NL$
-$NL$
-void$NL$
-_kernel_call_terrtn(void)$NL$
-{$NL$
-$FOREACH rorder TER.RORDER_LIST$
-$ 	// teratrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3248ï¼½
-$	//ï¼TA_NULLã§ãªãå ´åï¼
-	$IF TER.TERATR[rorder] != 0$
-		$ERROR TER.TEXT_LINE[rorder]$E_RSATR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' of %3% `%4%\' in %5%"),
-						"teratr", TER.TERATR[rorder], "terrtn",
-						TER.TERRTN[rorder], "ATT_TER")$
-		$END$
-	$END$
-	$TAB$((TERRTN)($TER.TERRTN[rorder]$))((intptr_t)($TER.EXINF[rorder]$));$NL$
-$END$
-}$NL$
-$NL$
-
-$
-$  kernel_cfg.hã®æ«å°¾é¨åã®çæ
-$
-$FILE "kernel_cfg.h.new"$
-
-#endif /* TOPPERS_KERNEL_CFG_H */$NL$
Index: asp3_wo_tecs/trunk/kernel/kernel.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/kernel.trb	(revision 304)
@@ -0,0 +1,493 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+#
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+#
+#   $Id: kernel.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#
+
+#
+#		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹2ã®çæã¹ã¯ãªãã
+#
+
+# 
+#  ã¿ã¤ã ã¹ã¿ã³ããã¡ã¤ã«ã®æå®
+# 
+$timeStampFileName = "kernel_cfg.timestamp"
+
+#
+#  kernel_cfg.hã®å
+é ­é¨åã®çæ
+#
+$kernelCfgH = GenFile.new("kernel_cfg.h")
+$kernelCfgH.append(<<EOS)
+/* kernel_cfg.h */
+#ifndef TOPPERS_KERNEL_CFG_H
+#define TOPPERS_KERNEL_CFG_H
+
+EOS
+
+#
+#  kernel_cfg.cã®å
+é ­é¨åã®çæ
+#
+$kernelCfgC = GenFile.new("kernel_cfg.c")
+$kernelCfgC.append(<<EOS)
+/* kernel_cfg.c */
+#include "kernel/kernel_int.h"
+#include "kernel_cfg.h"
+
+#if !(TKERNEL_PRID == 0x0007U && (TKERNEL_PRVER & 0xf000U) == 0x3000U)
+#error The kernel does not match this configuration file.
+#endif
+
+EOS
+
+# 
+#  ã¤ã³ã¯ã«ã¼ããã£ã¬ã¯ãã£ãï¼#includeï¼
+# 
+$kernelCfgC.comment_header("Include Directives")
+$includeFiles.each do |file|
+  $kernelCfgC.add("#include #{file}")
+end
+$kernelCfgC.add()
+
+#
+#  ã¹ã¿ãã¯é åã®ç¢ºä¿é¢æ°
+#
+#  ã¹ã¿ãã¯é åã®å®ç¾©åã¨ï¼ã¹ã¿ãã¯é åã®ãµã¤ãºè¨è¿°ãé
+åã§è¿ãï¼
+#
+unless defined? AllocStack()
+  def AllocStack(stack, size)
+    # å¤§ããæ¹ã«ä¸¸ãããµã¤ãºã§ç¢ºä¿ããï¼»NGKI1050ï¼½ï¼»NGKI3220ï¼½
+    $kernelCfgC.add("static STK_T #{stack}[COUNT_STK_T(#{size})];")
+    return("ROUND_STK_T(#{size})")
+  end
+end
+
+#
+#  ã«ã¼ãã«ãªãã¸ã§ã¯ãã«é¢ããæ
+å ±ã®çæï¼ä»®æ³ã¯ã©ã¹ï¼
+#
+class KernelObject
+  def initialize(obj, object, obj_s = obj)
+    @obj = obj
+    @OBJ = obj.tr("a-z", "A-Z")
+    @object = object
+    @obj_s = obj_s
+    @OBJ_S = obj_s.tr("a-z", "A-Z")
+    @objid = (obj + "id").to_sym
+    @api = "CRE_#{@OBJ}".to_sym
+  end
+
+  def generate()
+    # kernel_cfg.hã®çæ
+    $kernelCfgH.add("#define TNUM_#{@OBJ}ID\t#{$cfgData[@api].size}")
+
+    # ãªãã¸ã§ã¯ãã®IDçªå·ã®ãã¯ã­å®ç¾©ã®çæ
+    $cfgData[@api].sort.each do |id, params|
+      $kernelCfgH.add("#define #{params[@objid]}\t#{params[@objid].val}")
+    end
+    $kernelCfgH.add()
+
+    # ãªãã¸ã§ã¯ãã®IDçªå·ãä¿æããå¤æ°
+    if $USE_EXTERNAL_ID
+      $cfgData[@api].sort.each do |id, params|
+        $kernelCfgC.add("const ID #{params[@objid]}_id" \
+										" = #{params[@objid].val};")
+      end
+      $kernelCfgC.add()
+    end
+
+    # ãªãã¸ã§ã¯ãIDçªå·ã®æå¤§å¤
+    $kernelCfgC.add2("const ID _kernel_tmax_#{@obj}id" \
+							" = (TMIN_#{@OBJ}ID + TNUM_#{@OBJ}ID - 1);")
+
+    # ãã¼ã¿æ§é 
+    if $cfgData[@api].size > 0
+      # äºåæºåï¼ã¨ã©ã¼ãã§ãã¯ï¼ã¡ã¢ãªé åã®çæï¼
+      $cfgData[@api].sort.each do |id, params|
+        prepare(id, params)
+      end
+
+      # ãªãã¸ã§ã¯ãå
+¨ä½ã«å¯¾ãã¦å¿
+è¦ãªã¡ã¢ãªé åã®çæï¼ãªãã·ã§ã³ï¼
+      if respond_to?(:generateData)
+        generateData()
+      end
+
+      # ãªãã¸ã§ã¯ãåæåãã­ãã¯ã®çæ
+      $kernelCfgC.add("const #{@OBJ_S}INIB _kernel_#{@obj_s}inib_table" \
+													"[TNUM_#{@OBJ}ID] = {")
+      $cfgData[@api].sort.each_with_index do |(id, params), index|
+        $kernelCfgC.add(",") if index > 0
+        $kernelCfgC.append("\t{ " + generateInib(id, params) + " }")
+      end
+      $kernelCfgC.add
+      $kernelCfgC.add2("};")
+
+      # ãªãã¸ã§ã¯ãç®¡çãã­ãã¯ã®çæ
+      $kernelCfgC.add2("#{@OBJ_S}CB _kernel_#{@obj_s}cb_table" \
+													"[TNUM_#{@OBJ}ID];")
+
+      # ãªãã¸ã§ã¯ãåæåé¢æ°ã®è¿½å 
+      $initializeFunctions.push("_kernel_initialize_#{@object}();")
+    else
+      # ãªãã¸ã§ã¯ãã1ã¤ããªãå ´å
+      $kernelCfgC.add("TOPPERS_EMPTY_LABEL(const #{@OBJ_S}INIB, " \
+										"_kernel_#{@obj_s}inib_table);")
+      $kernelCfgC.add2("TOPPERS_EMPTY_LABEL(#{@OBJ_S}CB, " \
+										"_kernel_#{@obj_s}cb_table);")
+    end
+  end
+end
+
+#
+#  éç¥ãã³ãã©ã®çæé¢æ°
+#
+def generateNotifyHandler(id, params, objid)
+  # ãã©ã¡ã¼ã¿ãå¤æ°ã«æ ¼ç´
+  nfymode = params[:nfymode]
+  nfymode1 = nfymode & 0x0f
+  nfymode2 = nfymode & ~0x0f
+  par1 = params[:par1]
+  par2 = params[:par2]
+
+  # éç¥å¦çã®ãã©ã¡ã¼ã¿æ°ã«ããè£æ­£å¦ç
+  if nfymode == $TNFY_HANDLER || nfymode1 == $TNFY_SETVAR \
+								|| nfymode1 == $TNFY_SETFLG \
+								|| nfymode1 == $TNFY_SNDDTQ
+    # éç¥å¦çã®ãã©ã¡ã¼ã¿ã2ã¤ã®å ´å
+	numpar = 2
+	epar1 = params[:par3]
+	epar2 = params[:par4]
+  else
+    # éç¥å¦çã®ãã©ã¡ã¼ã¿ã1ã¤ã®å ´å
+    numpar = 1
+    epar1 = params[:par2]
+    epar2 = params[:par3]
+  end
+
+  # ãã©ã¡ã¼ã¿æ°ã®ãã§ãã¯
+  if (numpar == 2 && par2.nil?) || (nfymode2 != 0 && epar1.nil?) \
+								|| (nfymode2 == $TENFY_SETFLG && epar2.nil?)
+    # ãã©ã¡ã¼ã¿ãè¶³ããªãå ´å
+    error_api(params, "too few parameters for nfymode `#{nfymode}'" \
+							" in #{params[:apiname]} of #{params[objid]}")
+  elsif (nfymode2 == 0 && !epar1.nil?) \
+					|| (nfymode2 != $TENFY_SETFLG && !epar2.nil?)
+    # ãã©ã¡ã¼ã¿ãå¤ãããå ´å
+    error_api(params, "too many parameters for nfymode `#{nfymode}'" \
+							" in #{params[:apiname]} of #{params[objid]}")
+  elsif nfymode == $TNFY_HANDLER
+    # ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºã
+    funcname = "(NFYHDR)(#{par2})"
+  else
+    # éç¥ãã³ãã©ã®é¢æ°å
+    funcname = "_kernel_nfyhdr_#{params[objid]}"
+
+    # ã¨ã©ã¼éç¥ã®ããã®å¤æ°ã®ã¢ãã¬ã¹ã¨ãªãã¸ã§ã¯ãIDãæ ¼ç´ãã
+    # å¤æ°ã®çæï¼ã¨ã©ã¼ãã§ãã¯ã®ããã«å¿
+è¦ï¼
+    if nfymode2 == $TENFY_SETVAR || nfymode2 == $TENFY_INCVAR
+      $kernelCfgC.add2("intptr_t *const #{funcname}_p_evar =" \
+											" (intptr_t *)(#{epar1});")
+    elsif nfymode2 == $TENFY_ACTTSK || nfymode2 == $TENFY_WUPTSK
+      $kernelCfgC.add2("const ID #{funcname}_etskid = #{epar1};")
+    elsif nfymode2 == $TENFY_SIGSEM
+      $kernelCfgC.add2("const ID #{funcname}_esemid = #{epar1};")
+    elsif nfymode2 == $TENFY_SETFLG
+      $kernelCfgC.add2("const ID #{funcname}_eflgid = #{epar1};")
+    elsif nfymode2 == $TENFY_SNDDTQ
+      $kernelCfgC.add2("const ID #{funcname}_edtqid = #{epar1};")
+    end
+
+    # é¢æ°ã®å
+é ­é¨åã®çæ
+    $kernelCfgC.add("static void")
+    $kernelCfgC.add("#{funcname}(intptr_t exinf)")
+    $kernelCfgC.add("{")
+
+    if nfymode2 == 0
+      # ã¨ã©ã¼éç¥ããªãå ´å
+      errorCode = "(void) "
+    else
+      # ã¨ã©ã¼éç¥ãããå ´å
+      $kernelCfgC.add2("\tER\tercd;")
+      errorCode = "ercd = "
+    end
+
+    # ã¤ãã³ãéç¥å¦çã®å¦ç
+    if nfymode1 == $TNFY_SETVAR && nfymode2 == 0
+      # å¤æ°ã®è¨­å®
+      $kernelCfgC.add("\t*((intptr_t *) exinf) = (#{par2});")
+    elsif nfymode1 == $TNFY_INCVAR && nfymode2 == 0
+      # å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã
+      $kernelCfgC.add("\t(void) loc_cpu();")
+      $kernelCfgC.add("\t*((intptr_t *) exinf) += 1;")
+      $kernelCfgC.add("\t(void) unl_cpu();")
+    elsif nfymode1 == $TNFY_ACTTSK
+      # ã¿ã¹ã¯ã®èµ·å
+      $kernelCfgC.add("\t#{errorCode}act_tsk((ID) exinf);")
+    elsif nfymode1 == $TNFY_WUPTSK
+      # ã¿ã¹ã¯ã®èµ·åº
+      $kernelCfgC.add("\t#{errorCode}wup_tsk((ID) exinf);")
+    elsif nfymode1 == $TNFY_SIGSEM
+      # ã»ããã©ã®è¿å´
+      $kernelCfgC.add("\t#{errorCode}sig_sem((ID) exinf);")
+    elsif nfymode1 == $TNFY_SETFLG
+      # ã¤ãã³ããã©ã°ã®ã»ãã
+      $kernelCfgC.add("\t#{errorCode}set_flg(((ID) exinf), #{par2});")
+    elsif nfymode1 == $TNFY_SNDDTQ
+      # ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡
+      $kernelCfgC.add("\t#{errorCode}psnd_dtq(((ID) exinf), #{par2});")
+    else
+      error_illegal_id("E_PAR", params, :nfymode, objid)
+    end
+			
+    if nfymode2 != 0
+      # ã¨ã©ã¼éç¥å¦çã®å¦ç
+      $kernelCfgC.add("\tif (ercd != E_OK) {")
+
+
+      if nfymode2 == $TENFY_SETVAR
+        # å¤æ°ã®è¨­å®
+        $kernelCfgC.add("\t\t*#{funcname}_p_evar = (intptr_t) ercd;")
+      elsif nfymode2 == $TENFY_INCVAR
+        # å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã
+        $kernelCfgC.add("\t\t(void) loc_cpu();")
+        $kernelCfgC.add("\t\t*#{funcname}_p_evar += 1;")
+        $kernelCfgC.add("\t\t(void) unl_cpu();")
+      elsif nfymode2 == $TENFY_ACTTSK
+        # ã¿ã¹ã¯ã®èµ·å
+        $kernelCfgC.add("\t\t(void) act_tsk(#{funcname}_etskid);")
+      elsif nfymode2 == $TENFY_WUPTSK
+        # ã¿ã¹ã¯ã®èµ·åº
+        $kernelCfgC.add("\t\t(void) wup_tsk(#{funcname}_etskid);")
+      elsif nfymode2 == $TENFY_SIGSEM
+        # ã»ããã©ã®è¿å´
+        $kernelCfgC.add("\t\t(void) sig_sem(#{funcname}_esemid);")
+      elsif nfymode2 == $TENFY_SETFLG
+        # ã¤ãã³ããã©ã°ã®ã»ãã
+        $kernelCfgC.add("\t\t(void) set_flg(#{funcname}_eflgid, #{epar2});")
+      elsif nfymode2 == $TENFY_SNDDTQ
+        # ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡
+        $kernelCfgC.add("\t\t(void) psnd_dtq(#{funcname}_edtqid," \
+													" (intptr_t) ercd);")
+      else
+        error_illegal_id("E_PAR", params, :nfymode, objid)
+      end
+      $kernelCfgC.add("\t}")
+    end
+
+    # é¢æ°ã®æ«å°¾é¨åã®çæ
+    $kernelCfgC.add2("}")
+  end
+  return(funcname)
+end
+
+#
+#  åæ©è½ã¢ã¸ã¥ã¼ã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³
+#
+$initializeFunctions = []
+IncludeTrb("kernel/task.trb")
+IncludeTrb("kernel/semaphore.trb")
+IncludeTrb("kernel/eventflag.trb")
+IncludeTrb("kernel/dataqueue.trb")
+IncludeTrb("kernel/pridataq.trb")
+IncludeTrb("kernel/mutex.trb")
+IncludeTrb("kernel/mempfix.trb")
+IncludeTrb("kernel/cyclic.trb")
+IncludeTrb("kernel/alarm.trb")
+IncludeTrb("kernel/interrupt.trb")
+IncludeTrb("kernel/exception.trb")
+
+# 
+#  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é å
+# 
+$kernelCfgC.comment_header("Stack Area for Non-task Context")
+
+if $cfgData[:DEF_ICS].size() == 0
+  # DEF_ICSããªãå ´åã®ããã©ã«ãå¤ã®è¨­å®
+  if $DEFAULT_ISTK.nil?
+    # ã¹ã¿ãã¯é åã®èªåå²ä»ã
+    istksz = AllocStack("_kernel_istack", "DEFAULT_ISTKSZ")
+    istk = "_kernel_istack"
+  else
+    istksz = "DEFAULT_ISTKSZ"
+    istk = "DEFAULT_ISTK"
+  end
+else
+  # éçAPIãDEF_ICSããè¤æ°ããï¼E_OBJï¼ï¼»NGKI3216ï¼½
+  if $cfgData[:DEF_ICS].size() > 1
+    error("E_OBJ: too many DEF_ICS")
+  end
+
+  # DEF_ICSãããå ´åã®å¦ç
+  params = $cfgData[:DEF_ICS].values[0]
+
+  # istkszãã¿ã¼ã²ããå®ç¾©ã®æå°å¤ï¼TARGET_MIN_ISTKSZï¼æªå®ç¾©ã®å ´åã¯1ï¼
+  # ãããå°ããå ´åï¼E_PARï¼ï¼»NGKI3254ï¼½
+  if params[:istksz] <= $TARGET_MIN_ISTKSZ
+    error_wrong("E_PAR", params, :istksz, "too small")
+  end
+
+  if (params[:istk] == "NULL")
+    # ã¹ã¿ãã¯é åã®èªåå²ä»ã
+	istksz = AllocStack("_kernel_istack", params[:istksz])
+    istk = "_kernel_istack"
+  else
+    # istkszãã¹ã¿ãã¯é åã®ãµã¤ãºã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3222ï¼½
+    if (params[:istksz] & ($CHECK_STKSZ_ALIGN - 1)) != 0
+      error_wrong("E_PAR", params, :istksz, "not aligned")
+    end
+
+    istksz = "(#{params[:istksz]})"
+    istk = "(void *)(#{params[:istk]})"
+  end
+end
+
+$kernelCfgC.append(<<EOS)
+const size_t _kernel_istksz = #{istksz};
+STK_T *const _kernel_istk = #{istk};
+
+#ifdef TOPPERS_ISTKPT
+STK_T *const _kernel_istkpt = TOPPERS_ISTKPT(#{istk}, #{istksz});
+#endif /* TOPPERS_ISTKPT */
+
+EOS
+
+# 
+#  ã¿ã¤ã ã¤ãã³ãç®¡ç
+# 
+$kernelCfgC.comment_header("Time Event Management")
+$kernelCfgC.append(<<EOS)
+TMEVTN   _kernel_tmevt_heap[1 + TNUM_TSKID + TNUM_CYCID + TNUM_ALMID];
+
+EOS
+
+# 
+#  åã¢ã¸ã¥ã¼ã«ã®åæåé¢æ°
+# 
+$kernelCfgC.comment_header("Module Initialization Function")
+$kernelCfgC.append(<<EOS)
+void
+_kernel_initialize_object(void)
+{
+EOS
+$initializeFunctions.each do |func|
+	$kernelCfgC.add("\t#{func}")
+end
+$kernelCfgC.add2("}")
+
+# 
+#  åæåã«ã¼ãã³æ©è½
+# 
+# 
+$kernelCfgC.comment_header("Initialization Routine")
+
+# ã¨ã©ã¼ãã§ãã¯
+$cfgData[:ATT_INI].each do |id, params|
+  # iniatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3241ï¼½
+  #ï¼TA_NULLã§ãªãå ´åï¼
+  if (params[:iniatr] != 0)
+    error_illegal_sym("E_RSATR", params, :iniatr, :inirtn)
+  end
+end
+
+# åæåã«ã¼ãã³ã®å®è¡é¢æ°ã®çæ
+$kernelCfgC.append(<<EOS)
+void
+_kernel_call_inirtn(void)
+{
+EOS
+$cfgData[:ATT_INI].each do |id, params|
+  $kernelCfgC.add("\t((INIRTN)(#{params[:inirtn]}))" \
+								"((intptr_t)(#{params[:exinf]}));")
+end
+$kernelCfgC.add2("}")
+
+# 
+#  çµäºå¦çã«ã¼ãã³æ©è½
+# 
+$kernelCfgC.comment_header("Termination Routine")
+
+# ã¨ã©ã¼ãã§ãã¯
+$cfgData[:ATT_TER].each do |id, params|
+  # teratrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3248ï¼½
+  #ï¼TA_NULLã§ãªãå ´åï¼
+  if (params[:teratr] != 0)
+    error_illegal_sym("E_RSATR", params, :teratr, :terrtn)
+  end
+end
+
+# çµäºå¦çã«ã¼ãã³ã®å®è¡é¢æ°ã®çæ
+$kernelCfgC.append(<<EOS)
+void
+_kernel_call_terrtn(void)
+{
+EOS
+$cfgData[:ATT_TER].reverse_each do |id, params|
+  $kernelCfgC.add("\t((TERRTN)(#{params[:terrtn]}))" \
+								"((intptr_t)(#{params[:exinf]}));")
+end
+$kernelCfgC.add2("}")
+
+#
+#  kernel_cfg.hã®æ«å°¾é¨åã®çæ
+#
+$kernelCfgH.append(<<EOS)
+
+#endif /* TOPPERS_KERNEL_CFG_H */
+EOS
Index: asp3_wo_tecs/trunk/kernel/kernel_api.csv
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_api.csv	(revision 303)
+++ 	(revision )
@@ -1,16 +1,0 @@
-tsk,CRE_TSK,#tskid { .tskatr &exinf &task +itskpri .stksz &stk },,
-sem,CRE_SEM,#semid { .sematr .isemcnt .maxsem },,
-flg,CRE_FLG,#flgid { .flgatr .iflgptn },,
-dtq,CRE_DTQ,#dtqid { .dtqatr .dtqcnt &dtqmb },,
-pdq,CRE_PDQ,#pdqid { .pdqatr .pdqcnt +maxdpri &pdqmb },,
-mtx,CRE_MTX,#mtxid { .mtxatr +ceilpri? },,
-mpf,CRE_MPF,#mpfid { .mpfatr .blkcnt .blksz &mpf &mpfmb },,
-cyc,CRE_CYC,#cycid { .cycatr { .nfymode &par1 &par2? &par3? &par4? } .cyctim .cycphs },,
-alm,CRE_ALM,#almid { .almatr { .nfymode &par1 &par2? &par3? &par4? } },,
-int,CFG_INT,.intno { .intatr +intpri },,
-isr,CRE_ISR,#isrid { .isratr &exinf .intno &isr +isrpri },,
-inh,DEF_INH,.inhno { .inhatr &inthdr },,
-exc,DEF_EXC,.excno { .excatr &exchdr },,
-ics,DEF_ICS,{ .istksz &istk },-1,
-ini,ATT_INI,{ .iniatr &exinf &inirtn },-1,
-ter,ATT_TER,{ .teratr &exinf &terrtn },-1,
Index: asp3_wo_tecs/trunk/kernel/kernel_api.def
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_api.def	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/kernel_api.def	(revision 304)
@@ -0,0 +1,16 @@
+CRE_TSK #tskid* { .tskatr &exinf &task +itskpri .stksz &stk }
+CRE_SEM #semid* { .sematr .isemcnt .maxsem }
+CRE_FLG #flgid* { .flgatr .iflgptn }
+CRE_DTQ #dtqid* { .dtqatr .dtqcnt &dtqmb }
+CRE_PDQ #pdqid* { .pdqatr .pdqcnt +maxdpri &pdqmb }
+CRE_MTX #mtxid* { .mtxatr +ceilpri? }
+CRE_MPF #mpfid* { .mpfatr .blkcnt .blksz &mpf &mpfmb }
+CRE_CYC #cycid* { .cycatr { .nfymode &par1 &par2? &par3? &par4? } .cyctim .cycphs }
+CRE_ALM #almid* { .almatr { .nfymode &par1 &par2? &par3? &par4? } }
+CFG_INT .intno* { .intatr +intpri }
+CRE_ISR #isrid* { .isratr &exinf .intno &isr +isrpri }
+DEF_INH .inhno* { .inhatr &inthdr }
+DEF_EXC .excno* { .excatr &exchdr }
+DEF_ICS { .istksz &istk }
+ATT_INI { .iniatr &exinf &inirtn }
+ATT_TER { .teratr &exinf &terrtn }
Index: asp3_wo_tecs/trunk/kernel/kernel_check.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_check.tf	(revision 303)
+++ 	(revision )
@@ -1,383 +1,0 @@
-$ 
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2008-2015 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$  
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$  
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: kernel_check.tf 463 2015-10-18 14:25:55Z ertl-hiro $
-$  
-
-$
-$		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$
-$  ãã¼ã¿ã»ã¯ã·ã§ã³ã®LMAããVMAã¸ã®ã³ãã¼
-$
-$FOREACH lma LMA.ORDER_LIST$
-	$start_data = SYMBOL(LMA.START_DATA[lma])$
-	$end_data = SYMBOL(LMA.END_DATA[lma])$
-	$start_idata = SYMBOL(LMA.START_IDATA[lma])$
-	$IF !LENGTH(start_data)$
-		$ERROR$$FORMAT(_("symbol '%1%' not found"), LMA.START_DATA[lma])$$END$
-	$ELIF !LENGTH(end_data)$
-		$ERROR$$FORMAT(_("symbol '%1%' not found"), LMA.END_DATA[lma])$$END$
-	$ELIF !LENGTH(start_idata)$
-		$ERROR$$FORMAT(_("symbol '%1%' not found"), LMA.START_IDATA[lma])$$END$
-	$ELSE$
-		$BCOPY(start_idata, start_data, end_data - start_data)$
-	$END$
-$END$
-
-$
-$  éç¥æ
-å ±ã®ãã§ãã¯é¢æ°
-$
-$tmax_tskid = PEEK(SYMBOL("_kernel_tmax_tskid"), sizeof_ID)$
-$tmax_semid = PEEK(SYMBOL("_kernel_tmax_semid"), sizeof_ID)$
-$tmax_flgid = PEEK(SYMBOL("_kernel_tmax_flgid"), sizeof_ID)$
-$tmax_dtqid = PEEK(SYMBOL("_kernel_tmax_dtqid"), sizeof_ID)$
-
-$FUNCTION CHECK_NFYHDR$
-$	// ãã©ã¡ã¼ã¿ãå¤æ°ã«æ ¼ç´
-	$nfymode = ARGV[1]$
-	$nfymode1 = nfymode & 0x0f$
-	$nfymode2 = nfymode & ~0x0f$
-	$exinf = ARGV[2]$
-	$nfyhdr = ARGV[3]$
-	$par1 = ARGV[4]$
-	$par2 = ARGV[5]$
-	$text_line = ARGV[8]$
-	$objid = ARGV[9]$
-	$apiname = ARGV[10]$
-	$funcname = CONCAT("_kernel_nfyhdr_", objid)$
-
-$	// éç¥å¦çã®ãã©ã¡ã¼ã¿æ°ã«ããè£æ­£å¦ç
-	$IF nfymode1 == TNFY_SETVAR || nfymode1 == TNFY_SETFLG
-											|| nfymode1 == TNFY_SNDDTQ$
-$		// éç¥å¦çã®ãã©ã¡ã¼ã¿ã2ã¤ã®å ´å
-		$epar1 = ARGV[6]$
-		$epar2 = ARGV[7]$
-	$ELSE$
-$		// éç¥å¦çã®ãã©ã¡ã¼ã¿ã1ã¤ã®å ´å
-		$epar1 = ARGV[5]$
-		$epar2 = ARGV[6]$
-	$END$
-
-$	// ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å
-é ­çªå°ã®ãã§ãã¯ï¼»NGKI3693ï¼½
-	$IF nfymode == TNFY_HANDLER$
-		$tmehdr = nfyhdr$
-		$IF CHECK_FUNC_ALIGN && (tmehdr & (CHECK_FUNC_ALIGN - 1)) != 0$
-			$ERROR text_line$E_PAR:$SPC$
-				$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is not aligned"),
-										"tmehdr", par2, objid, apiname)$
-				$END$
-		$END$
-		$IF CHECK_FUNC_NONNULL && tmehdr == 0$
-			$ERROR text_line$E_PAR:$SPC$
-				$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is null"),
-										"tmehdr", par2, objid, apiname)$
-			$END$
-		$END$
-	$END$
-
-$	// ã¤ãã³ãéç¥å¦çã®å¤æ°ã®çªå°ã¨ãªãã¸ã§ã¯ãIDã®ãã§ãã¯
-	$IF nfymode1 == TNFY_SETVAR || nfymode1 == TNFY_INCVAR$
-$		// å¤æ°ã®è¨­å®ï¼ã¤ã³ã¯ãªã¡ã³ãã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
-		$p_var = exinf$
-
-$		// å¤æ°ã®çªå°ã®ãã§ãã¯ï¼»NGKI3699ï¼½ï¼»NGKI3897ï¼½
-		$IF CHECK_INTPTR_ALIGN && (p_var & (CHECK_INTPTR_ALIGN - 1)) != 0$
-			$ERROR text_line$E_PAR:$SPC$
-				$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is not aligned"),
-										"p_var", par1, objid, apiname)$
-			$END$
-		$END$
-		$IF CHECK_INTPTR_NONNULL && p_var == 0$
-			$ERROR text_line$E_PAR:$SPC$
-				$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is null"),
-										"p_var", par1, objid, apiname)$
-			$END$
-		$END$
-	$ELIF nfymode1 == TNFY_ACTTSK || nfymode1 == TNFY_WUPTSK$
-$		// ã¿ã¹ã¯ã®èµ·åï¼èµ·åºã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
-		$tskid = exinf$
-
-$		// ã¿ã¹ã¯IDã®ãã§ãã¯ï¼»NGKI3704ï¼½
-		$IF !(TMIN_TSKID <= tskid && tskid <= tmax_tskid)$
-			$ERROR text_line$E_ID:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-										"tskid", par1, objid, apiname)$
-			$END$
-		$END$
-	$ELIF nfymode1 == TNFY_SIGSEM$
-$		// ã»ããã©ã®è³æºã®è¿å´ã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
-		$semid = exinf$
-
-$		// ã»ããã©IDã®ãã§ãã¯ï¼»NGKI3707ï¼½
-		$IF !(TMIN_SEMID <= semid && semid <= tmax_semid)$
-			$ERROR text_line$E_ID:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-										"semid", par1, objid, apiname)$
-			$END$
-		$END$
-	$ELIF nfymode1 == TNFY_SETFLG$
-$		// ã¤ãã³ããã©ã°ã®ã»ããã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
-		$flgid = exinf$
-
-$		// ã¤ãã³ããã©ã°IDã®ãã§ãã¯ï¼»NGKI3710ï¼½
-		$IF !(TMIN_FLGID <= flgid && flgid <= tmax_flgid)$
-			$ERROR text_line$E_ID:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-										"flgid", par1, objid, apiname)$
-			$END$
-		$END$
-	$ELIF nfymode1 == TNFY_SNDDTQ$
-$		// ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
-		$dtqid = exinf$
-
-$		// ãã¼ã¿ã­ã¥ã¼IDã®ãã§ãã¯ï¼»NGKI3713ï¼½
-		$IF !(TMIN_DTQID <= dtqid && dtqid <= tmax_dtqid)$
-			$ERROR text_line$E_ID:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-										"dtqid", par1, objid, apiname)$
-			$END$
-		$END$
-	$END$
-
-$	// ã¨ã©ã¼éç¥å¦çã®å¤æ°ã®çªå°ã¨ãªãã¸ã§ã¯ãIDã®ãã§ãã¯
-	$IF nfymode2 == TENFY_SETVAR || nfymode2 == TENFY_INCVAR$
-$		// å¤æ°ã®è¨­å®ï¼ã¤ã³ã¯ãªã¡ã³ãã«ããã¨ã©ã¼ã®éç¥
-		$p_var = PEEK(SYMBOL(CONCAT(funcname, "_p_evar")), sizeof_intptr_t)$
-
-$		// å¤æ°ã®çªå°ã®ãã§ãã¯ï¼»NGKI3701ï¼½ï¼»NGKI3897ï¼½
-		$IF CHECK_INTPTR_ALIGN && (p_var & (CHECK_INTPTR_ALIGN - 1)) != 0$
-			$ERROR text_line$E_PAR:$SPC$
-				$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is not aligned"),
-										"p_var", epar1, objid, apiname)$
-			$END$
-		$END$
-		$IF CHECK_INTPTR_NONNULL && p_var == 0$
-			$ERROR text_line$E_PAR:$SPC$
-				$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is null"),
-										"p_var", epar1, objid, apiname)$
-			$END$
-		$END$
-	$ELIF nfymode2 == TENFY_ACTTSK || nfymode2 == TENFY_WUPTSK$
-$		// ã¿ã¹ã¯ã®èµ·åï¼èµ·åºã«ããã¨ã©ã¼ã®éç¥
-		$tskid = PEEK(SYMBOL(CONCAT(funcname, "_etskid")), sizeof_ID)$
-
-$		// ã¿ã¹ã¯IDã®ãã§ãã¯ï¼»NGKI3704ï¼½
-		$IF !(TMIN_TSKID <= tskid && tskid <= tmax_tskid)$
-			$ERROR text_line$E_ID:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-										"tskid", epar1, objid, apiname)$
-			$END$
-		$END$
-	$ELIF nfymode2 == TENFY_SIGSEM$
-$		// ã»ããã©ã®è³æºã®è¿å´ã«ããã¨ã©ã¼ã®éç¥
-		$semid = PEEK(SYMBOL(CONCAT(funcname, "_esemid")), sizeof_ID)$
-
-$		// ã»ããã©IDã®ãã§ãã¯ï¼»NGKI3707ï¼½
-		$IF !(TMIN_SEMID <= semid && semid <= tmax_semid)$
-			$ERROR text_line$E_ID:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-										"semid", epar1, objid, apiname)$
-			$END$
-		$END$
-	$ELIF nfymode2 == TENFY_SETFLG$
-$		// ã¤ãã³ããã©ã°ã®ã»ããã«ããã¨ã©ã¼ã®éç¥
-		$flgid = PEEK(SYMBOL(CONCAT(funcname, "_eflgid")), sizeof_ID)$
-
-$		// ã¤ãã³ããã©ã°IDã®ãã§ãã¯ï¼»NGKI3710ï¼½
-		$IF !(TMIN_FLGID <= flgid && flgid <= tmax_flgid)$
-			$ERROR text_line$E_ID:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-										"flgid", epar1, objid, apiname)$
-			$END$
-		$END$
-	$ELIF nfymode2 == TENFY_SNDDTQ$
-$		// ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ã«ããã¨ã©ã¼ã®éç¥
-		$dtqid = PEEK(SYMBOL(CONCAT(funcname, "_edtqid")), sizeof_ID)$
-
-$		// ãã¼ã¿ã­ã¥ã¼IDã®ãã§ãã¯ï¼»NGKI3715ï¼½
-		$IF !(TMIN_DTQID <= dtqid && dtqid <= tmax_dtqid)$
-			$ERROR text_line$E_ID:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-										"dtqid", epar1, objid, apiname)$
-			$END$
-		$END$
-	$END$
-$END$
-
-$ 
-$  ã¿ã¹ã¯ã«é¢ãããã§ãã¯
-$ 
-$tinib = SYMBOL("_kernel_tinib_table")$
-$FOREACH tskid TSK.ID_LIST$
-$	// ã¿ã¹ã¯ã®å
-é ­çªå°ã®ãã§ãã¯ï¼»NGKI1033ï¼½
-	$task = PEEK(tinib + offsetof_TINIB_task, sizeof_FP)$
-	$IF CHECK_FUNC_ALIGN && (task & (CHECK_FUNC_ALIGN - 1)) != 0$
-		$ERROR TSK.TEXT_LINE[tskid]$E_PAR:$SPC$
-			$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is not aligned"),
-							"task", TSK.TASK[tskid], tskid, "CRE_TSK")$
-		$END$
-	$END$
-	$IF CHECK_FUNC_NONNULL && task == 0$
-		$ERROR TSK.TEXT_LINE[tskid]$E_PAR:$SPC$
-			$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is null"),
-							"task", TSK.TASK[tskid], tskid, "CRE_TSK")$
-		$END$
-	$END$
-
-$	// ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åã®å
-é ­çªå°ã®ãã§ãã¯ï¼»NGKI1056ï¼½
-	$IF USE_TSKINICTXB$
-		$stk = GET_STK_TSKINICTXB(tinib)$
-	$ELSE$
-		$stk = PEEK(tinib + offsetof_TINIB_stk, sizeof_void_ptr)$
-	$END$
-	$IF CHECK_STACK_ALIGN && (stk & (CHECK_STACK_ALIGN - 1)) != 0$
-		$ERROR TSK.TEXT_LINE[tskid]$E_PAR:$SPC$
-			$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is not aligned"),
-							"stk", TSK.STK[tskid], tskid, "CRE_TSK")$
-		$END$
-	$END$
-	$IF CHECK_STACK_NONNULL && stk == 0$
-		$ERROR TSK.TEXT_LINE[tskid]$E_PAR:$SPC$
-			$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is null"),
-							"stk", TSK.STK[tskid], tskid, "CRE_TSK")$
-		$END$
-	$END$
-
-	$tinib = tinib + sizeof_TINIB$
-$END$
-
-$ 
-$  å¨æéç¥ã«é¢ãããã§ãã¯
-$ 
-$cycinib = SYMBOL("_kernel_cycinib_table")$
-$FOREACH cycid CYC.ID_LIST$
-	$exinf = PEEK(cycinib + offsetof_CYCINIB_exinf, sizeof_intptr_t)$
-	$nfyhdr = PEEK(cycinib + offsetof_CYCINIB_nfyhdr, sizeof_FP)$
-
-$	// éç¥æ
-å ±ã®ãã§ãã¯
-	$CHECK_NFYHDR(CYC.NFYMODE[cycid], exinf, nfyhdr,
-						CYC.PAR1[cycid], CYC.PAR2[cycid],
-						CYC.PAR3[cycid], CYC.PAR4[cycid],
-						CYC.TEXT_LINE[cycid], cycid, "CRE_CYC")$
-
-	$cycinib = cycinib + sizeof_CYCINIB$
-$END$
-
-$ 
-$  ã¢ã©ã¼ã éç¥ã«é¢ãããã§ãã¯
-$ 
-$alminib = SYMBOL("_kernel_alminib_table")$
-$FOREACH almid ALM.ID_LIST$
-	$exinf = PEEK(alminib + offsetof_ALMINIB_exinf, sizeof_intptr_t)$
-	$nfyhdr = PEEK(alminib + offsetof_ALMINIB_nfyhdr, sizeof_FP)$
-
-$	// éç¥æ
-å ±ã®ãã§ãã¯
-	$CHECK_NFYHDR(ALM.NFYMODE[almid], exinf, nfyhdr,
-						ALM.PAR1[almid], ALM.PAR2[almid],
-						ALM.PAR3[almid], ALM.PAR4[almid],
-						ALM.TEXT_LINE[almid], almid, "CRE_ALM")$
-
-	$alminib = alminib + sizeof_ALMINIB$
-$END$
-
-$ 
-$  åºå®é·ã¡ã¢ãªãã¼ã«ã«é¢ãããã§ãã¯
-$ 
-$mpfinib = SYMBOL("_kernel_mpfinib_table")$
-$FOREACH mpfid MPF.ID_LIST$
-	$mpf = PEEK(mpfinib + offsetof_MPFINIB_mpf, sizeof_void_ptr)$
-
-$	// åºå®é·ã¡ã¢ãªãã¼ã«é åã®å
-é ­çªå°ã®ãã§ãã¯ï¼»NGKI2249ï¼½
-	$IF CHECK_MPF_ALIGN && (mpf & (CHECK_MPF_ALIGN - 1)) != 0$
-		$ERROR MPF.TEXT_LINE[mpfid]$E_PAR:$SPC$
-			$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is not aligned"),
-							"mpf", MPF.MPF[mpfid], mpfid, "CRE_MPF")$
-		$END$
-	$END$
-	$IF CHECK_MPF_NONNULL && mpf == 0$
-		$ERROR MPF.TEXT_LINE[mpfid]$E_PAR:$SPC$
-			$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is null"),
-							"mpf", MPF.MPF[mpfid], mpfid, "CRE_MPF")$
-		$END$
-	$END$
-
-	$mpfinib = mpfinib + sizeof_MPFINIB$
-$END$
-
-$ 
-$  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã«é¢ãããã§ãã¯
-$ 
-$istk = PEEK(SYMBOL("_kernel_istk"), sizeof_void_ptr)$
-
-$ éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã®å
-é ­çªå°ã®ãã§ãã¯ï¼»NGKI3222ï¼½
-$IF CHECK_STACK_ALIGN && (istk & (CHECK_STACK_ALIGN - 1)) != 0$
-	$ERROR ICS.TEXT_LINE[1]$E_PAR:$SPC$
-		$FORMAT(_("%1% `%2%\' in %3% is not aligned"),
-							"istk", ICS.ISTK[1], "DEF_ICS")$
-	$END$
-$END$
-$IF CHECK_STACK_NONNULL && istk == 0$
-	$ERROR ICS.TEXT_LINE[1]$E_PAR:$SPC$
-		$FORMAT(_("%1% `%2%\' in %3% is null"),
-							"istk", ICS.ISTK[1], "DEF_ICS")$
-	$END$
-$END$
Index: asp3_wo_tecs/trunk/kernel/kernel_check.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_check.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/kernel_check.trb	(revision 304)
@@ -0,0 +1,335 @@
+# -*- coding: utf-8 -*-
+# 
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+#  
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+#  
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: kernel_check.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#  
+
+#
+#		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã®çæã¹ã¯ãªãã
+#
+
+# 
+#  ã¿ã¤ã ã¹ã¿ã³ããã¡ã¤ã«ã®æå®
+# 
+$timeStampFileName = "check.timestamp"
+
+#
+#  ãã¼ã¿ã»ã¯ã·ã§ã³ã®LMAããVMAã¸ã®ã³ãã¼
+#
+if !$lmaList.nil?
+  $lmaList.each do |lma|
+    startData = SYMBOL(lma[:START_DATA])
+    endData = SYMBOL(lma[:END_DATA])
+    startIdata = SYMBOL(lma[:START_IDATA])
+    if startData.nil?
+      error_exit("symbol `lma[:START_DATA]' not found")
+    elsif endData.nil?
+      error_exit("symbol `lma[:END_DATA]' not found")
+    elsif startIdata.nil?
+      error_exit("symbol `lma[:START_IDATA]' not found")
+    end
+  end
+end
+
+#
+#  éç¥æ
+å ±ã®ãã§ãã¯é¢æ°
+#
+$tmax_tskid = PEEK(SYMBOL("_kernel_tmax_tskid"), $sizeof_ID)
+$tmax_semid = PEEK(SYMBOL("_kernel_tmax_semid"), $sizeof_ID)
+$tmax_flgid = PEEK(SYMBOL("_kernel_tmax_flgid"), $sizeof_ID)
+$tmax_dtqid = PEEK(SYMBOL("_kernel_tmax_dtqid"), $sizeof_ID)
+
+def checkNotifyHandler(id, params, objid, exinf, nfyhdr)
+  # ãã©ã¡ã¼ã¿ãå¤æ°ã«æ ¼ç´
+  nfymode = params[:nfymode]
+  nfymode1 = nfymode & 0x0f
+  nfymode2 = nfymode & ~0x0f
+  par1 = params[:par1]
+  par2 = params[:par2]
+  funcname = "_kernel_nfyhdr_#{params[objid]}"
+
+  # éç¥å¦çã®ãã©ã¡ã¼ã¿æ°ã«ããè£æ­£å¦ç
+  if nfymode1 == $TNFY_SETVAR || nfymode1 == $TNFY_SETFLG \
+								|| nfymode1 == $TNFY_SNDDTQ
+    # éç¥å¦çã®ãã©ã¡ã¼ã¿ã2ã¤ã®å ´å
+    epar1 = params[:par3]
+    epar2 = params[:par4]
+  else
+    # éç¥å¦çã®ãã©ã¡ã¼ã¿ã1ã¤ã®å ´å
+    epar1 = params[:par2]
+    epar2 = params[:par3]
+  end
+
+  #	ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å
+é ­çªå°ã®ãã§ãã¯ï¼»NGKI3693ï¼½
+  if nfymode == $TNFY_HANDLER
+    tmehdr = nfyhdr
+    params1 = params.dup
+    params1[:tmehdr] = par2
+    if (tmehdr & ($CHECK_FUNC_ALIGN - 1)) != 0
+      error_wrong_id("E_PAR", params1, :tmehdr, objid, "not aligned")
+    end
+    if $CHECK_FUNC_NONNULL == 1 && tmehdr == 0
+      error_wrong_id("E_PAR", params1, :tmehdr, objid, "null")
+    end
+  end
+
+  #	ã¤ãã³ãéç¥å¦çã®å¤æ°ã®çªå°ã¨ãªãã¸ã§ã¯ãIDã®ãã§ãã¯
+  if nfymode1 == $TNFY_SETVAR || nfymode1 == $TNFY_INCVAR
+    # å¤æ°ã®è¨­å®ï¼ã¤ã³ã¯ãªã¡ã³ãã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
+	p_var = exinf
+    params1 = params.dup
+    params1[:p_var] = par1
+
+    # å¤æ°ã®çªå°ã®ãã§ãã¯ï¼»NGKI3699ï¼½ï¼»NGKI3897ï¼½
+    if (p_var & ($CHECK_INTPTR_ALIGN - 1)) != 0
+      error_wrong_id("E_PAR", params1, :p_var, objid, "not aligned")
+    end
+    if $CHECK_INTPTR_NONNULL == 1 && p_var == 0
+      error_wrong_id("E_PAR", params1, :p_var, objid, "null")
+    end
+  elsif (nfymode1 == $TNFY_ACTTSK || nfymode1 == $TNFY_WUPTSK)
+    # ã¿ã¹ã¯ã®èµ·åï¼èµ·åºã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
+    tskid = exinf
+    params1 = params.dup
+    params1[:tskid] = par1
+
+    # ã¿ã¹ã¯IDã®ãã§ãã¯ï¼»NGKI3704ï¼½
+    if !($TMIN_TSKID <= tskid && tskid <= $tmax_tskid)
+      error_illegal_id("E_ID", params1, :tskid, objid)
+    end
+  elsif nfymode1 == $TNFY_SIGSEM
+    # ã»ããã©ã®è³æºã®è¿å´ã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
+    semid = exinf
+    params1 = params.dup
+    params1[:semid] = par1
+
+    # ã»ããã©IDã®ãã§ãã¯ï¼»NGKI3707ï¼½
+    if !($TMIN_SEMID <= semid && semid <= $tmax_semid)
+      error_illegal_id("E_ID", params1, :semid, objid)
+    end
+  elsif nfymode1 == $TNFY_SETFLG
+    # ã¤ãã³ããã©ã°ã®ã»ããã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
+    flgid = exinf
+    params1 = params.dup
+    params1[:flgid] = par1
+
+    # ã¤ãã³ããã©ã°IDã®ãã§ãã¯ï¼»NGKI3710ï¼½
+    if !($TMIN_FLGID <= flgid && flgid <= $tmax_flgid)
+      error_illegal_id("E_ID", params1, :flgid, objid)
+    end
+  elsif nfymode1 == $TNFY_SNDDTQ
+    # ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
+    dtqid = exinf
+    params1 = params.dup
+    params1[:dtqid] = par1
+
+    # ãã¼ã¿ã­ã¥ã¼IDã®ãã§ãã¯ï¼»NGKI3713ï¼½
+    if !($TMIN_DTQID <= dtqid && dtqid <= $tmax_dtqid)
+      error_illegal_id("E_ID", params1, :dtqid, objid)
+    end
+  end
+
+  # ã¨ã©ã¼éç¥å¦çã®å¤æ°ã®çªå°ã¨ãªãã¸ã§ã¯ãIDã®ãã§ãã¯
+  if (nfymode2 == $TENFY_SETVAR || nfymode2 == $TENFY_INCVAR)
+    # å¤æ°ã®è¨­å®ï¼ã¤ã³ã¯ãªã¡ã³ãã«ããã¨ã©ã¼ã®éç¥
+    p_var = PEEK(SYMBOL(funcname + "_p_evar"), $sizeof_intptr_t)
+    params1 = params.dup
+    params1[:p_var] = epar1
+
+    # å¤æ°ã®çªå°ã®ãã§ãã¯ï¼»NGKI3701ï¼½ï¼»NGKI3897ï¼½
+    if (p_var & ($CHECK_INTPTR_ALIGN - 1)) != 0
+      error_wrong_id("E_PAR", params1, :p_var, objid, "not aligned")
+    end
+    if $CHECK_INTPTR_NONNULL == 1 && p_var == 0
+      error_wrong_id("E_PAR", params1, :p_var, objid, "null")
+    end
+  elsif nfymode2 == $TENFY_ACTTSK || nfymode2 == $TENFY_WUPTSK
+    # ã¿ã¹ã¯ã®èµ·åï¼èµ·åºã«ããã¨ã©ã¼ã®éç¥
+    tskid = PEEK(SYMBOL(funcname + "_etskid"), $sizeof_ID)
+    params1 = params.dup
+    params1[:tskid] = epar1
+
+    # ã¿ã¹ã¯IDã®ãã§ãã¯ï¼»NGKI3704ï¼½
+    if !($TMIN_TSKID <= tskid && tskid <= $tmax_tskid)
+      error_illegal_id("E_ID", params1, :tskid, objid)
+    end
+  elsif nfymode2 == $TENFY_SIGSEM
+    # ã»ããã©ã®è³æºã®è¿å´ã«ããã¨ã©ã¼ã®éç¥
+	semid = PEEK(SYMBOL(funcname + "_esemid"), $sizeof_ID)
+    params1 = params.dup
+    params1[:semid] = epar1
+
+    # ã»ããã©IDã®ãã§ãã¯ï¼»NGKI3707ï¼½
+    if !($TMIN_SEMID <= semid && semid <= $tmax_semid)
+      error_illegal_id("E_ID", params1, :semid, objid)
+    end
+  elsif nfymode2 == $TENFY_SETFLG
+    # ã¤ãã³ããã©ã°ã®ã»ããã«ããã¨ã©ã¼ã®éç¥
+    flgid = PEEK(SYMBOL(funcname + "_eflgid"), $sizeof_ID)
+    params1 = params.dup
+    params1[:flgid] = epar1
+
+    # ã¤ãã³ããã©ã°IDã®ãã§ãã¯ï¼»NGKI3710ï¼½
+    if !($TMIN_FLGID <= flgid && flgid <= $tmax_flgid)
+      error_illegal_id("E_ID", params1, :flgid, objid)
+    end
+  elsif nfymode2 == $TENFY_SNDDTQ
+    # ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ã«ããã¨ã©ã¼ã®éç¥
+    dtqid = PEEK(SYMBOL(funcname + "_edtqid"), $sizeof_ID)
+    params1 = params.dup
+    params1[:dtqid] = epar1
+
+    # ãã¼ã¿ã­ã¥ã¼IDã®ãã§ãã¯ï¼»NGKI3715ï¼½
+    if !($TMIN_DTQID <= dtqid && dtqid <= $tmax_dtqid)
+      error_illegal_id("E_ID", params1, :dtqid, objid)
+    end
+  end
+end
+
+# 
+#  ã¿ã¹ã¯ã«é¢ãããã§ãã¯
+# 
+tinib = SYMBOL("_kernel_tinib_table")
+$cfgData[:CRE_TSK].each do |id, params|
+  # ã¿ã¹ã¯ã®å
+é ­çªå°ã®ãã§ãã¯ï¼»NGKI1033ï¼½
+  task = PEEK(tinib + $offsetof_TINIB_task, $sizeof_FP)
+  if (task & ($CHECK_FUNC_ALIGN - 1)) != 0
+    error_wrong_id("E_PAR", params, :task, :tskid, "not aligned")
+  end
+  if $CHECK_FUNC_NONNULL == 1 && task == 0
+    error_wrong_id("E_PAR", params, :task, :tskid, "null")
+  end
+
+  # ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åã®å
+é ­çªå°ã®ãã§ãã¯ï¼»NGKI1056ï¼½
+  if $USE_TSKINICTXB == 1
+    stk = GetStackTskinictxb(id, params)
+  else
+    stk = PEEK(tinib + $offsetof_TINIB_stk, $sizeof_void_ptr)
+  end
+  if (stk & ($CHECK_STACK_ALIGN - 1)) != 0
+    error_wrong_id("E_PAR", params, :stk, :tskid, "not aligned")
+  end
+  if $CHECK_STACK_NONNULL == 1 && stk == 0
+    error_wrong_id("E_PAR", params, :stk, :tskid, "null")
+  end
+
+  tinib += $sizeof_TINIB
+end
+
+# 
+#  å¨æéç¥ã«é¢ãããã§ãã¯
+# 
+cycinib = SYMBOL("_kernel_cycinib_table")
+$cfgData[:CRE_CYC].each do |id, params|
+  exinf = PEEK(cycinib + $offsetof_CYCINIB_exinf, $sizeof_intptr_t)
+  nfyhdr = PEEK(cycinib + $offsetof_CYCINIB_nfyhdr, $sizeof_FP)
+
+  #	éç¥æ
+å ±ã®ãã§ãã¯
+  checkNotifyHandler(id, params, :cycid, exinf, nfyhdr)
+
+  cycinib += $sizeof_CYCINIB
+end
+
+# 
+#  ã¢ã©ã¼ã éç¥ã«é¢ãããã§ãã¯
+# 
+alminib = SYMBOL("_kernel_alminib_table")
+$cfgData[:CRE_ALM].each do |id, params|
+  exinf = PEEK(alminib + $offsetof_ALMINIB_exinf, $sizeof_intptr_t)
+  nfyhdr = PEEK(alminib + $offsetof_ALMINIB_nfyhdr, $sizeof_FP)
+
+  #	éç¥æ
+å ±ã®ãã§ãã¯
+  checkNotifyHandler(id, params, :almid, exinf, nfyhdr)
+
+  alminib += $sizeof_ALMINIB
+end
+
+# 
+#  åºå®é·ã¡ã¢ãªãã¼ã«ã«é¢ãããã§ãã¯
+# 
+mpfinib = SYMBOL("_kernel_mpfinib_table")
+$cfgData[:CRE_MPF].each do |id, params|
+  mpf = PEEK(alminib + $offsetof_MPFINIB_mpf, $sizeof_void_ptr)
+
+  # åºå®é·ã¡ã¢ãªãã¼ã«é åã®å
+é ­çªå°ã®ãã§ãã¯ï¼»NGKI2249ï¼½
+  if (mpf & ($CHECK_MPF_ALIGN - 1)) != 0
+    error_wrong_id("E_PAR", params, :mpf, :mpfid, "not aligned")
+  end
+  if $CHECK_MPF_NONNULL == 1 && mpf == 0
+    error_wrong_id("E_PAR", params, :mpf, :mpfid, "null")
+  end
+
+  mpfinib += $sizeof_MPFINIB
+end
+
+# 
+#  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã«é¢ãããã§ãã¯
+# 
+istk = PEEK(SYMBOL("_kernel_istk"), $sizeof_void_ptr)
+
+# éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã®å
+é ­çªå°ã®ãã§ãã¯ï¼»NGKI3222ï¼½
+if (istk & ($CHECK_STACK_ALIGN - 1)) != 0
+  error_wrong("E_PAR", $cfgData[:DEF_ICS][0], :istk, "not aligned")
+end
+if $CHECK_STACK_NONNULL == 1 && istk == 0
+  error_wrong("E_PAR", $cfgData[:DEF_ICS][0], :istk, "null")
+end
Index: asp3_wo_tecs/trunk/kernel/kernel_def.csv
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_def.csv	(revision 303)
+++ 	(revision )
@@ -1,133 +1,0 @@
-SIL_ENDIAN_BIG,#defined(SIL_ENDIAN_BIG)
-SIL_ENDIAN_LITTLE,#defined(SIL_ENDIAN_LITTLE)
-TA_NULL,TA_NULL
-TA_ACT,TA_ACT
-TA_NOACTQUE,TA_NOACTQUE
-TA_TPRI,TA_TPRI
-TA_WMUL,TA_WMUL
-TA_CLR,TA_CLR
-TA_CEILING,TA_CEILING
-TA_STA,TA_STA
-TA_NONKERNEL,TA_NONKERNEL
-TA_ENAINT,TA_ENAINT
-TA_EDGE,TA_EDGE
-TNFY_HANDLER,TNFY_HANDLER
-TNFY_SETVAR,TNFY_SETVAR
-TNFY_INCVAR,TNFY_INCVAR
-TNFY_ACTTSK,TNFY_ACTTSK
-TNFY_WUPTSK,TNFY_WUPTSK
-TNFY_SIGSEM,TNFY_SIGSEM
-TNFY_SETFLG,TNFY_SETFLG
-TNFY_SNDDTQ,TNFY_SNDDTQ
-TENFY_SETVAR,TENFY_SETVAR
-TENFY_INCVAR,TENFY_INCVAR
-TENFY_ACTTSK,TENFY_ACTTSK
-TENFY_WUPTSK,TENFY_WUPTSK
-TENFY_SIGSEM,TENFY_SIGSEM
-TENFY_SETFLG,TENFY_SETFLG
-TENFY_SNDDTQ,TENFY_SNDDTQ
-TMIN_TPRI,TMIN_TPRI,signed
-TMAX_TPRI,TMAX_TPRI,signed
-TMIN_DPRI,TMIN_DPRI,signed
-TMAX_DPRI,TMAX_DPRI,signed
-TMIN_ISRPRI,TMIN_ISRPRI,signed
-TMAX_ISRPRI,TMAX_ISRPRI,signed
-TBIT_FLGPTN,TBIT_FLGPTN
-TMAX_MAXSEM,TMAX_MAXSEM
-TMAX_RELTIM,TMAX_RELTIM
-TMIN_INTPRI,TMIN_INTPRI,signed
-TMAX_INTPRI,TMAX_INTPRI,signed
-TMIN_TSKID,TMIN_TSKID,signed
-TMIN_SEMID,TMIN_SEMID,signed
-TMIN_FLGID,TMIN_FLGID,signed
-TMIN_DTQID,TMIN_DTQID,signed
-TMIN_PDQID,TMIN_PDQID,signed
-TMIN_MTXID,TMIN_MTXID,signed
-TMIN_MPFID,TMIN_MPFID,signed
-TMIN_CYCID,TMIN_CYCID,signed
-TMIN_ALMID,TMIN_ALMID,signed
-OMIT_INITIALIZE_INTERRUPT,#defined(OMIT_INITIALIZE_INTERRUPT)
-USE_INHINIB_TABLE,#defined(USE_INHINIB_TABLE)
-USE_INTINIB_TABLE,#defined(USE_INTINIB_TABLE)
-OMIT_INITIALIZE_EXCEPTION,#defined(OMIT_INITIALIZE_EXCEPTION)
-USE_TSKINICTXB,#defined(USE_TSKINICTXB)
-TARGET_TSKATR,#defined(TARGET_TSKATR),,TARGET_TSKATR
-TARGET_INTATR,#defined(TARGET_INTATR),,TARGET_INTATR
-TARGET_INHATR,#defined(TARGET_INHATR),,TARGET_INHATR
-TARGET_ISRATR,#defined(TARGET_ISRATR),,TARGET_ISRATR
-TARGET_EXCATR,#defined(TARGET_EXCATR),,TARGET_EXCATR
-TARGET_MIN_STKSZ,#defined(TARGET_MIN_STKSZ),,TARGET_MIN_STKSZ
-TARGET_MIN_ISTKSZ,#defined(TARGET_MIN_ISTKSZ),,TARGET_MIN_ISTKSZ
-CHECK_STKSZ_ALIGN,#defined(CHECK_STKSZ_ALIGN),,CHECK_STKSZ_ALIGN
-CHECK_INTPTR_ALIGN,#defined(CHECK_INTPTR_ALIGN),,CHECK_INTPTR_ALIGN
-CHECK_INTPTR_NONNULL,#defined(CHECK_INTPTR_NONNULL)
-CHECK_FUNC_ALIGN,#defined(CHECK_FUNC_ALIGN),,CHECK_FUNC_ALIGN
-CHECK_FUNC_NONNULL,#defined(CHECK_FUNC_NONNULL)
-CHECK_STACK_ALIGN,#defined(CHECK_STACK_ALIGN),,CHECK_STACK_ALIGN
-CHECK_STACK_NONNULL,#defined(CHECK_STACK_NONNULL)
-CHECK_MPF_ALIGN,#defined(CHECK_MPF_ALIGN),,CHECK_MPF_ALIGN
-CHECK_MPF_NONNULL,#defined(CHECK_MPF_NONNULL)
-sizeof_void_ptr,sizeof(void*)
-sizeof_uint_t,sizeof(uint_t)
-sizeof_size_t,sizeof(size_t)
-sizeof_intptr_t,sizeof(intptr_t)
-sizeof_ID,sizeof(ID)
-sizeof_FP,sizeof(FP)
-sizeof_INHNO,sizeof(INHNO)
-sizeof_INTNO,sizeof(INTNO)
-sizeof_EXCNO,sizeof(EXCNO)
-sizeof_TINIB,sizeof(TINIB)
-offsetof_TINIB_tskatr,"offsetof(TINIB,tskatr)"
-offsetof_TINIB_exinf,"offsetof(TINIB,exinf)"
-offsetof_TINIB_task,"offsetof(TINIB,task)"
-offsetof_TINIB_ipriority,"offsetof(TINIB,ipriority)"
-offsetof_TINIB_stksz,#!defined(USE_TSKINICTXB),,"offsetof(TINIB,stksz)"
-offsetof_TINIB_stk,#!defined(USE_TSKINICTXB),,"offsetof(TINIB,stk)"
-sizeof_SEMINIB,sizeof(SEMINIB)
-offsetof_SEMINIB_sematr,"offsetof(SEMINIB,sematr)"
-offsetof_SEMINIB_isemcnt,"offsetof(SEMINIB,isemcnt)"
-offsetof_SEMINIB_maxsem,"offsetof(SEMINIB,maxsem)"
-sizeof_FLGPTN,sizeof(FLGPTN)
-sizeof_FLGINIB,sizeof(FLGINIB)
-offsetof_FLGINIB_flgatr,"offsetof(FLGINIB,flgatr)"
-offsetof_FLGINIB_iflgptn,"offsetof(FLGINIB,iflgptn)"
-sizeof_DTQINIB,sizeof(DTQINIB)
-offsetof_DTQINIB_dtqatr,"offsetof(DTQINIB,dtqatr)"
-offsetof_DTQINIB_dtqcnt,"offsetof(DTQINIB,dtqcnt)"
-offsetof_DTQINIB_p_dtqmb,"offsetof(DTQINIB,p_dtqmb)"
-sizeof_PDQINIB,sizeof(PDQINIB)
-offsetof_PDQINIB_pdqatr,"offsetof(PDQINIB,pdqatr)"
-offsetof_PDQINIB_pdqcnt,"offsetof(PDQINIB,pdqcnt)"
-offsetof_PDQINIB_maxdpri,"offsetof(PDQINIB,maxdpri)"
-offsetof_PDQINIB_p_pdqmb,"offsetof(PDQINIB,p_pdqmb)"
-sizeof_MTXINIB,sizeof(MTXINIB)
-offsetof_MTXINIB_mtxatr,"offsetof(MTXINIB,mtxatr)"
-offsetof_MTXINIB_ceilpri,"offsetof(MTXINIB,ceilpri)"
-sizeof_MPFINIB,sizeof(MPFINIB)
-offsetof_MPFINIB_mpfatr,"offsetof(MPFINIB,mpfatr)"
-offsetof_MPFINIB_blkcnt,"offsetof(MPFINIB,blkcnt)"
-offsetof_MPFINIB_blksz,"offsetof(MPFINIB,blksz)"
-offsetof_MPFINIB_mpf,"offsetof(MPFINIB,mpf)"
-offsetof_MPFINIB_p_mpfmb,"offsetof(MPFINIB,p_mpfmb)"
-sizeof_CYCINIB,sizeof(CYCINIB)
-offsetof_CYCINIB_cycatr,"offsetof(CYCINIB,cycatr)"
-offsetof_CYCINIB_exinf,"offsetof(CYCINIB,exinf)"
-offsetof_CYCINIB_nfyhdr,"offsetof(CYCINIB,nfyhdr)"
-offsetof_CYCINIB_cyctim,"offsetof(CYCINIB,cyctim)"
-offsetof_CYCINIB_cycphs,"offsetof(CYCINIB,cycphs)"
-sizeof_ALMINIB,sizeof(ALMINIB)
-offsetof_ALMINIB_almatr,"offsetof(ALMINIB,almatr)"
-offsetof_ALMINIB_exinf,"offsetof(ALMINIB,exinf)"
-offsetof_ALMINIB_nfyhdr,"offsetof(ALMINIB,nfyhdr)"
-sizeof_INHINIB,#!defined(OMIT_INITIALIZE_INTERRUPT),,sizeof(INHINIB)
-offset_INHINIB_inhno,#!defined(OMIT_INITIALIZE_INTERRUPT),,"offsetof(INHINIB,inhno)"
-offset_INHINIB_inhatr,#!defined(OMIT_INITIALIZE_INTERRUPT),,"offsetof(INHINIB,inhatr)"
-offset_INHINIB_int_entry,#!defined(OMIT_INITIALIZE_INTERRUPT),,"offsetof(INHINIB,int_entry)"
-sizeof_INTINIB,#!defined(OMIT_INITIALIZE_INTERRUPT),,sizeof(INTINIB)
-offset_INTINIB_intno,#!defined(OMIT_INITIALIZE_INTERRUPT),,"offsetof(INTINIB,intno)"
-offset_INTINIB_intatr,#!defined(OMIT_INITIALIZE_INTERRUPT),,"offsetof(INTINIB,intatr)"
-offset_INTINIB_intpri,#!defined(OMIT_INITIALIZE_INTERRUPT),,"offsetof(INTINIB,intpri)"
-sizeof_EXCINIB,#!defined(OMIT_INITIALIZE_EXCEPTION),,sizeof(EXCINIB)
-offset_EXCINIB_excno,#!defined(OMIT_INITIALIZE_EXCEPTION),,"offsetof(EXCINIB,excno)"
-offset_EXCINIB_excatr,#!defined(OMIT_INITIALIZE_EXCEPTION),,"offsetof(EXCINIB,excatr)"
-offset_EXCINIB_exc_entry,#!defined(OMIT_INITIALIZE_EXCEPTION),,"offsetof(EXCINIB,exc_entry)"
Index: asp3_wo_tecs/trunk/kernel/kernel_rename.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_rename.h	(revision 303)
+++ asp3_wo_tecs/trunk/kernel/kernel_rename.h	(revision 304)
@@ -184,188 +184,4 @@
 
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  startup.c
- */
-#define _kerflg						__kernel_kerflg
-#define _exit_kernel				__kernel_exit_kernel
-
-/*
- *  task.c
- */
-#define _p_runtsk					__kernel_p_runtsk
-#define _p_schedtsk					__kernel_p_schedtsk
-#define _enadsp						__kernel_enadsp
-#define _dspflg						__kernel_dspflg
-#define _ready_queue				__kernel_ready_queue
-#define _ready_primap				__kernel_ready_primap
-#define _initialize_task			__kernel_initialize_task
-#define _search_schedtsk			__kernel_search_schedtsk
-#define _make_runnable				__kernel_make_runnable
-#define _make_non_runnable			__kernel_make_non_runnable
-#define _make_dormant				__kernel_make_dormant
-#define _make_active				__kernel_make_active
-#define _change_priority			__kernel_change_priority
-#define _rotate_ready_queue			__kernel_rotate_ready_queue
-#define _task_terminate				__kernel_task_terminate
-
-/*
- *  taskhook.c
- */
-#define _mtxhook_check_ceilpri		__kernel_mtxhook_check_ceilpri
-#define _mtxhook_scan_ceilmtx		__kernel_mtxhook_scan_ceilmtx
-#define _mtxhook_release_all		__kernel_mtxhook_release_all
-
-/*
- *  wait.c
- */
-#define _make_wait_tmout			__kernel_make_wait_tmout
-#define _wait_complete				__kernel_wait_complete
-#define _wait_tmout					__kernel_wait_tmout
-#define _wait_tmout_ok				__kernel_wait_tmout_ok
-#define _wobj_make_wait				__kernel_wobj_make_wait
-#define _wobj_make_wait_tmout		__kernel_wobj_make_wait_tmout
-#define _init_wait_queue			__kernel_init_wait_queue
-
-/*
- *  time_event.c
- */
-#define _boundary_evttim			__kernel_boundary_evttim
-#define _current_evttim				__kernel_current_evttim
-#define _current_hrtcnt				__kernel_current_hrtcnt
-#define _monotonic_evttim			__kernel_monotonic_evttim
-#define _systim_offset				__kernel_systim_offset
-#define _in_signal_time				__kernel_in_signal_time
-#define _initialize_tmevt			__kernel_initialize_tmevt
-#define _tmevt_up					__kernel_tmevt_up
-#define _tmevt_down					__kernel_tmevt_down
-#define _update_current_evttim		__kernel_update_current_evttim
-#define _set_hrt_event				__kernel_set_hrt_event
-#define _tmevtb_register			__kernel_tmevtb_register
-#define _tmevtb_enqueue				__kernel_tmevtb_enqueue
-#define _tmevtb_dequeue				__kernel_tmevtb_dequeue
-#define _check_adjtim				__kernel_check_adjtim
-#define _tmevt_lefttim				__kernel_tmevt_lefttim
-#define _signal_time				__kernel_signal_time
-
-/*
- *  semaphore.c
- */
-#define _initialize_semaphore		__kernel_initialize_semaphore
-
-/*
- *  eventflag.c
- */
-#define _initialize_eventflag		__kernel_initialize_eventflag
-#define _check_flg_cond				__kernel_check_flg_cond
-
-/*
- *  dataqueue.c
- */
-#define _initialize_dataqueue		__kernel_initialize_dataqueue
-#define _enqueue_data				__kernel_enqueue_data
-#define _force_enqueue_data			__kernel_force_enqueue_data
-#define _dequeue_data				__kernel_dequeue_data
-#define _send_data					__kernel_send_data
-#define _force_send_data			__kernel_force_send_data
-#define _receive_data				__kernel_receive_data
-
-/*
- *  pridataq.c
- */
-#define _initialize_pridataq		__kernel_initialize_pridataq
-#define _enqueue_pridata			__kernel_enqueue_pridata
-#define _dequeue_pridata			__kernel_dequeue_pridata
-#define _send_pridata				__kernel_send_pridata
-#define _receive_pridata			__kernel_receive_pridata
-
-/*
- *  mutex.c
- */
-#define _initialize_mutex			__kernel_initialize_mutex
-#define _mutex_check_ceilpri		__kernel_mutex_check_ceilpri
-#define _mutex_scan_ceilmtx			__kernel_mutex_scan_ceilmtx
-#define _mutex_drop_priority		__kernel_mutex_drop_priority
-#define _mutex_acquire				__kernel_mutex_acquire
-#define _mutex_release				__kernel_mutex_release
-#define _mutex_release_all			__kernel_mutex_release_all
-
-/*
- *  mempfix.c
- */
-#define _initialize_mempfix			__kernel_initialize_mempfix
-#define _get_mpf_block				__kernel_get_mpf_block
-
-/*
- *  cyclic.c
- */
-#define _initialize_cyclic			__kernel_initialize_cyclic
-#define _call_cyclic				__kernel_call_cyclic
-
-/*
- *  alarm.c
- */
-#define _initialize_alarm			__kernel_initialize_alarm
-#define _call_alarm					__kernel_call_alarm
-
-/*
- *  interrupt.c
- */
-#define _initialize_interrupt		__kernel_initialize_interrupt
-
-/*
- *  exception.c
- */
-#define _initialize_exception		__kernel_initialize_exception
-
-/*
- *  kernel_cfg.c
- */
-#define _initialize_object			__kernel_initialize_object
-#define _call_inirtn				__kernel_call_inirtn
-#define _call_terrtn				__kernel_call_terrtn
-#define _tmax_tskid					__kernel_tmax_tskid
-#define _tinib_table				__kernel_tinib_table
-#define _torder_table				__kernel_torder_table
-#define _tcb_table					__kernel_tcb_table
-#define _tmax_semid					__kernel_tmax_semid
-#define _seminib_table				__kernel_seminib_table
-#define _semcb_table				__kernel_semcb_table
-#define _tmax_flgid					__kernel_tmax_flgid
-#define _flginib_table				__kernel_flginib_table
-#define _flgcb_table				__kernel_flgcb_table
-#define _tmax_dtqid					__kernel_tmax_dtqid
-#define _dtqinib_table				__kernel_dtqinib_table
-#define _dtqcb_table				__kernel_dtqcb_table
-#define _tmax_pdqid					__kernel_tmax_pdqid
-#define _pdqinib_table				__kernel_pdqinib_table
-#define _pdqcb_table				__kernel_pdqcb_table
-#define _tmax_mtxid					__kernel_tmax_mtxid
-#define _mtxinib_table				__kernel_mtxinib_table
-#define _mtxcb_table				__kernel_mtxcb_table
-#define _tmax_mpfid					__kernel_tmax_mpfid
-#define _mpfinib_table				__kernel_mpfinib_table
-#define _mpfcb_table				__kernel_mpfcb_table
-#define _tmax_cycid					__kernel_tmax_cycid
-#define _cycinib_table				__kernel_cycinib_table
-#define _cyccb_table				__kernel_cyccb_table
-#define _tmax_almid					__kernel_tmax_almid
-#define _alminib_table				__kernel_alminib_table
-#define _almcb_table				__kernel_almcb_table
-#define _tnum_def_inhno				__kernel_tnum_def_inhno
-#define _inhinib_table				__kernel_inhinib_table
-#define _tnum_cfg_intno				__kernel_tnum_cfg_intno
-#define _intinib_table				__kernel_intinib_table
-#define _tnum_def_excno				__kernel_tnum_def_excno
-#define _excinib_table				__kernel_excinib_table
-#define _tmevt_heap					__kernel_tmevt_heap
-#define _istksz						__kernel_istksz
-#define _istk						__kernel_istk
-#define _istkpt						__kernel_istkpt
-
-
-#endif /* TOPPERS_LABEL_ASM */
-
 #include "target_rename.h"
 
Index: asp3_wo_tecs/trunk/kernel/kernel_sym.def
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_sym.def	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/kernel_sym.def	(revision 304)
@@ -0,0 +1,134 @@
+SIL_ENDIAN_BIG,1,,defined(SIL_ENDIAN_BIG)
+SIL_ENDIAN_LITTLE,1,,defined(SIL_ENDIAN_LITTLE)
+TA_NULL
+TA_ACT
+TA_NOACTQUE
+TA_TPRI
+TA_WMUL
+TA_CLR
+TA_CEILING
+TA_STA
+TA_NONKERNEL
+TA_ENAINT
+TA_EDGE
+TNFY_HANDLER
+TNFY_SETVAR
+TNFY_INCVAR
+TNFY_ACTTSK
+TNFY_WUPTSK
+TNFY_SIGSEM
+TNFY_SETFLG
+TNFY_SNDDTQ
+TENFY_SETVAR
+TENFY_INCVAR
+TENFY_ACTTSK
+TENFY_WUPTSK
+TENFY_SIGSEM
+TENFY_SETFLG
+TENFY_SNDDTQ
+TMIN_TPRI,,signed
+TMAX_TPRI,,signed
+TMIN_DPRI,,signed
+TMAX_DPRI,,signed
+TMIN_ISRPRI,,signed
+TMAX_ISRPRI,,signed
+TBIT_FLGPTN
+TMAX_MAXSEM
+TMAX_RELTIM
+TMIN_INTPRI,,signed
+TMAX_INTPRI,,signed
+TMIN_TSKID,,signed
+TMIN_SEMID,,signed
+TMIN_FLGID,,signed
+TMIN_DTQID,,signed
+TMIN_PDQID,,signed
+TMIN_MTXID,,signed
+TMIN_MPFID,,signed
+TMIN_CYCID,,signed
+TMIN_ALMID,,signed
+USE_TSKINICTXB,1,,defined(USE_TSKINICTXB)
+OMIT_INITIALIZE_INTERRUPT,1,,defined(OMIT_INITIALIZE_INTERRUPT)
+USE_INHINIB_TABLE,1,,defined(USE_INHINIB_TABLE)
+USE_INTINIB_TABLE,1,,defined(USE_INTINIB_TABLE)
+OMIT_INITIALIZE_EXCEPTION,1,,defined(OMIT_INITIALIZE_EXCEPTION)
+DEFAULT_ISTK,,,defined(DEFAULT_ISTK)
+TARGET_TSKATR,,,defined(TARGET_TSKATR),0
+TARGET_INTATR,,,defined(TARGET_INTATR),0
+TARGET_INHATR,,,defined(TARGET_INHATR),0
+TARGET_ISRATR,,,defined(TARGET_ISRATR),0
+TARGET_EXCATR,,,defined(TARGET_EXCATR),0
+TARGET_MIN_STKSZ,,,defined(TARGET_MIN_STKSZ),1
+TARGET_MIN_ISTKSZ,,,defined(TARGET_MIN_ISTKSZ),1
+CHECK_STKSZ_ALIGN,,,defined(CHECK_STKSZ_ALIGN),1
+CHECK_INTPTR_ALIGN,,,defined(CHECK_INTPTR_ALIGN),1
+CHECK_INTPTR_NONNULL,1,,defined(CHECK_INTPTR_NONNULL)
+CHECK_FUNC_ALIGN,,,defined(CHECK_FUNC_ALIGN),1
+CHECK_FUNC_NONNULL,1,,defined(CHECK_FUNC_NONNULL)
+CHECK_STACK_ALIGN,,,defined(CHECK_STACK_ALIGN),1
+CHECK_STACK_NONNULL,1,,defined(CHECK_STACK_NONNULL)
+CHECK_MPF_ALIGN,,,defined(CHECK_MPF_ALIGN),1
+CHECK_MPF_NONNULL,1,,defined(CHECK_MPF_NONNULL)
+sizeof_void_ptr,sizeof(void*)
+sizeof_uint_t,sizeof(uint_t)
+sizeof_size_t,sizeof(size_t)
+sizeof_intptr_t,sizeof(intptr_t)
+sizeof_ID,sizeof(ID)
+sizeof_FP,sizeof(FP)
+sizeof_INHNO,sizeof(INHNO)
+sizeof_INTNO,sizeof(INTNO)
+sizeof_EXCNO,sizeof(EXCNO)
+sizeof_TINIB,sizeof(TINIB)
+offsetof_TINIB_tskatr,"offsetof(TINIB,tskatr)"
+offsetof_TINIB_exinf,"offsetof(TINIB,exinf)"
+offsetof_TINIB_task,"offsetof(TINIB,task)"
+offsetof_TINIB_ipriority,"offsetof(TINIB,ipriority)"
+offsetof_TINIB_stksz,"offsetof(TINIB,stksz)",,!defined(USE_TSKINICTXB)
+offsetof_TINIB_stk,"offsetof(TINIB,stk)",,!defined(USE_TSKINICTXB)
+sizeof_SEMINIB,sizeof(SEMINIB)
+offsetof_SEMINIB_sematr,"offsetof(SEMINIB,sematr)"
+offsetof_SEMINIB_isemcnt,"offsetof(SEMINIB,isemcnt)"
+offsetof_SEMINIB_maxsem,"offsetof(SEMINIB,maxsem)"
+sizeof_FLGPTN,sizeof(FLGPTN)
+sizeof_FLGINIB,sizeof(FLGINIB)
+offsetof_FLGINIB_flgatr,"offsetof(FLGINIB,flgatr)"
+offsetof_FLGINIB_iflgptn,"offsetof(FLGINIB,iflgptn)"
+sizeof_DTQINIB,sizeof(DTQINIB)
+offsetof_DTQINIB_dtqatr,"offsetof(DTQINIB,dtqatr)"
+offsetof_DTQINIB_dtqcnt,"offsetof(DTQINIB,dtqcnt)"
+offsetof_DTQINIB_p_dtqmb,"offsetof(DTQINIB,p_dtqmb)"
+sizeof_PDQINIB,sizeof(PDQINIB)
+offsetof_PDQINIB_pdqatr,"offsetof(PDQINIB,pdqatr)"
+offsetof_PDQINIB_pdqcnt,"offsetof(PDQINIB,pdqcnt)"
+offsetof_PDQINIB_maxdpri,"offsetof(PDQINIB,maxdpri)"
+offsetof_PDQINIB_p_pdqmb,"offsetof(PDQINIB,p_pdqmb)"
+sizeof_MTXINIB,sizeof(MTXINIB)
+offsetof_MTXINIB_mtxatr,"offsetof(MTXINIB,mtxatr)"
+offsetof_MTXINIB_ceilpri,"offsetof(MTXINIB,ceilpri)"
+sizeof_MPFINIB,sizeof(MPFINIB)
+offsetof_MPFINIB_mpfatr,"offsetof(MPFINIB,mpfatr)"
+offsetof_MPFINIB_blkcnt,"offsetof(MPFINIB,blkcnt)"
+offsetof_MPFINIB_blksz,"offsetof(MPFINIB,blksz)"
+offsetof_MPFINIB_mpf,"offsetof(MPFINIB,mpf)"
+offsetof_MPFINIB_p_mpfmb,"offsetof(MPFINIB,p_mpfmb)"
+sizeof_CYCINIB,sizeof(CYCINIB)
+offsetof_CYCINIB_cycatr,"offsetof(CYCINIB,cycatr)"
+offsetof_CYCINIB_exinf,"offsetof(CYCINIB,exinf)"
+offsetof_CYCINIB_nfyhdr,"offsetof(CYCINIB,nfyhdr)"
+offsetof_CYCINIB_cyctim,"offsetof(CYCINIB,cyctim)"
+offsetof_CYCINIB_cycphs,"offsetof(CYCINIB,cycphs)"
+sizeof_ALMINIB,sizeof(ALMINIB)
+offsetof_ALMINIB_almatr,"offsetof(ALMINIB,almatr)"
+offsetof_ALMINIB_exinf,"offsetof(ALMINIB,exinf)"
+offsetof_ALMINIB_nfyhdr,"offsetof(ALMINIB,nfyhdr)"
+sizeof_INHINIB,sizeof(INHINIB),,!defined(OMIT_INITIALIZE_INTERRUPT)
+offset_INHINIB_inhno,"offsetof(INHINIB,inhno)",,!defined(OMIT_INITIALIZE_INTERRUPT)
+offset_INHINIB_inhatr,"offsetof(INHINIB,inhatr)",,!defined(OMIT_INITIALIZE_INTERRUPT),,
+offset_INHINIB_int_entry,"offsetof(INHINIB,int_entry)",,!defined(OMIT_INITIALIZE_INTERRUPT),,
+sizeof_INTINIB,sizeof(INTINIB),,!defined(OMIT_INITIALIZE_INTERRUPT)
+offset_INTINIB_intno,"offsetof(INTINIB,intno)",,!defined(OMIT_INITIALIZE_INTERRUPT)
+offset_INTINIB_intatr,"offsetof(INTINIB,intatr)",,!defined(OMIT_INITIALIZE_INTERRUPT)
+offset_INTINIB_intpri,"offsetof(INTINIB,intpri)",,!defined(OMIT_INITIALIZE_INTERRUPT)
+sizeof_EXCINIB,sizeof(EXCINIB),,!defined(OMIT_INITIALIZE_EXCEPTION)
+offset_EXCINIB_excno,"offsetof(EXCINIB,excno)",,!defined(OMIT_INITIALIZE_EXCEPTION)
+offset_EXCINIB_excatr,"offsetof(EXCINIB,excatr)",,!defined(OMIT_INITIALIZE_EXCEPTION)
+offset_EXCINIB_exc_entry,"offsetof(EXCINIB,exc_entry)",,!defined(OMIT_INITIALIZE_EXCEPTION)
Index: asp3_wo_tecs/trunk/kernel/kernel_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_unrename.h	(revision 303)
+++ asp3_wo_tecs/trunk/kernel/kernel_unrename.h	(revision 304)
@@ -185,188 +185,4 @@
 
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  startup.c
- */
-#undef _kerflg
-#undef _exit_kernel
-
-/*
- *  task.c
- */
-#undef _p_runtsk
-#undef _p_schedtsk
-#undef _enadsp
-#undef _dspflg
-#undef _ready_queue
-#undef _ready_primap
-#undef _initialize_task
-#undef _search_schedtsk
-#undef _make_runnable
-#undef _make_non_runnable
-#undef _make_dormant
-#undef _make_active
-#undef _change_priority
-#undef _rotate_ready_queue
-#undef _task_terminate
-
-/*
- *  taskhook.c
- */
-#undef _mtxhook_check_ceilpri
-#undef _mtxhook_scan_ceilmtx
-#undef _mtxhook_release_all
-
-/*
- *  wait.c
- */
-#undef _make_wait_tmout
-#undef _wait_complete
-#undef _wait_tmout
-#undef _wait_tmout_ok
-#undef _wobj_make_wait
-#undef _wobj_make_wait_tmout
-#undef _init_wait_queue
-
-/*
- *  time_event.c
- */
-#undef _boundary_evttim
-#undef _current_evttim
-#undef _current_hrtcnt
-#undef _monotonic_evttim
-#undef _systim_offset
-#undef _in_signal_time
-#undef _initialize_tmevt
-#undef _tmevt_up
-#undef _tmevt_down
-#undef _update_current_evttim
-#undef _set_hrt_event
-#undef _tmevtb_register
-#undef _tmevtb_enqueue
-#undef _tmevtb_dequeue
-#undef _check_adjtim
-#undef _tmevt_lefttim
-#undef _signal_time
-
-/*
- *  semaphore.c
- */
-#undef _initialize_semaphore
-
-/*
- *  eventflag.c
- */
-#undef _initialize_eventflag
-#undef _check_flg_cond
-
-/*
- *  dataqueue.c
- */
-#undef _initialize_dataqueue
-#undef _enqueue_data
-#undef _force_enqueue_data
-#undef _dequeue_data
-#undef _send_data
-#undef _force_send_data
-#undef _receive_data
-
-/*
- *  pridataq.c
- */
-#undef _initialize_pridataq
-#undef _enqueue_pridata
-#undef _dequeue_pridata
-#undef _send_pridata
-#undef _receive_pridata
-
-/*
- *  mutex.c
- */
-#undef _initialize_mutex
-#undef _mutex_check_ceilpri
-#undef _mutex_scan_ceilmtx
-#undef _mutex_drop_priority
-#undef _mutex_acquire
-#undef _mutex_release
-#undef _mutex_release_all
-
-/*
- *  mempfix.c
- */
-#undef _initialize_mempfix
-#undef _get_mpf_block
-
-/*
- *  cyclic.c
- */
-#undef _initialize_cyclic
-#undef _call_cyclic
-
-/*
- *  alarm.c
- */
-#undef _initialize_alarm
-#undef _call_alarm
-
-/*
- *  interrupt.c
- */
-#undef _initialize_interrupt
-
-/*
- *  exception.c
- */
-#undef _initialize_exception
-
-/*
- *  kernel_cfg.c
- */
-#undef _initialize_object
-#undef _call_inirtn
-#undef _call_terrtn
-#undef _tmax_tskid
-#undef _tinib_table
-#undef _torder_table
-#undef _tcb_table
-#undef _tmax_semid
-#undef _seminib_table
-#undef _semcb_table
-#undef _tmax_flgid
-#undef _flginib_table
-#undef _flgcb_table
-#undef _tmax_dtqid
-#undef _dtqinib_table
-#undef _dtqcb_table
-#undef _tmax_pdqid
-#undef _pdqinib_table
-#undef _pdqcb_table
-#undef _tmax_mtxid
-#undef _mtxinib_table
-#undef _mtxcb_table
-#undef _tmax_mpfid
-#undef _mpfinib_table
-#undef _mpfcb_table
-#undef _tmax_cycid
-#undef _cycinib_table
-#undef _cyccb_table
-#undef _tmax_almid
-#undef _alminib_table
-#undef _almcb_table
-#undef _tnum_def_inhno
-#undef _inhinib_table
-#undef _tnum_cfg_intno
-#undef _intinib_table
-#undef _tnum_def_excno
-#undef _excinib_table
-#undef _tmevt_heap
-#undef _istksz
-#undef _istk
-#undef _istkpt
-
-
-#endif /* TOPPERS_LABEL_ASM */
-
 #include "target_unrename.h"
 
Index: asp3_wo_tecs/trunk/kernel/mempfix.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/mempfix.tf	(revision 303)
+++ 	(revision )
@@ -1,171 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2014 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: mempfix.tf 480 2016-01-03 07:37:12Z ertl-hiro $
-$ 
-
-$
-$		åºå®é·ã¡ã¢ãªãã¼ã«æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$
-$  kernel_cfg.hã®çæ
-$
-$FILE "kernel_cfg.h.new"$
-
-#define TNUM_MPFID	$LENGTH(MPF.ID_LIST)$$NL$
-$FOREACH id MPF.ID_LIST$
-	#define $id$	$+id$$NL$
-$END$
-
-$
-$  kernel_cfg.cã®çæ
-$
-$FILE "kernel_cfg.c"$
-
-/*$NL$
-$SPC$*  Fixed-sized Memorypool Functions$NL$
-$SPC$*/$NL$
-$NL$
-
-$
-$  åºå®é·ã¡ã¢ãªãã¼ã«ã®IDçªå·ãä¿æããå¤æ°
-$
-$IF USE_EXTERNAL_ID$
-	$FOREACH id MPF.ID_LIST$
-		const ID $id$_id = $+id$;$NL$
-	$END$
-$END$
-
-$
-$  åºå®é·ã¡ã¢ãªãã¼ã«IDçªå·ã®æå¤§å¤
-$
-const ID _kernel_tmax_mpfid = (TMIN_MPFID + TNUM_MPFID - 1);$NL$
-$NL$
-
-$
-$  åºå®é·ã¡ã¢ãªãã¼ã«åæåãã­ãã¯
-$
-$IF LENGTH(MPF.ID_LIST)$
-	$FOREACH mpfid MPF.ID_LIST$
-$		// mpfatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2225ï¼½
-$		//ï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
-		$IF (MPF.MPFATR[mpfid] & ~TA_TPRI) != 0$
-			$ERROR MPF.TEXT_LINE[mpfid]$E_RSATR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"mpfatr", MPF.MPFATR[mpfid], mpfid, "CRE_MPF")$
-			$END$
-		$END$
-
-$		// blkcntã0ä»¥ä¸ã®å ´åï¼E_PARï¼ï¼»NGKI2229ï¼½
-		$IF MPF.BLKCNT[mpfid] <= 0$
-			$ERROR MPF.TEXT_LINE[mpfid]$E_PAR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"blkcnt", MPF.BLKCNT[mpfid], mpfid, "CRE_MPF")$
-			$END$
-		$END$
-
-$		// blkszã0ä»¥ä¸ã®å ´åï¼E_PARï¼ï¼»NGKI2230ï¼½
-		$IF MPF.BLKSZ[mpfid] <= 0$
-			$ERROR MPF.TEXT_LINE[mpfid]$E_PAR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"blksz", MPF.BLKSZ[mpfid], mpfid, "CRE_MPF")$
-			$END$
-		$END$
-
-$		// åºå®é·ã¡ã¢ãªãã¼ã«é å
-		$IF EQ(MPF.MPF[mpfid], "NULL")$
-			static MPF_T _kernel_mpf_$mpfid$[($MPF.BLKCNT[mpfid]$)$SPC$
-									* COUNT_MPF_T($MPF.BLKSZ[mpfid]$)];$NL$
-		$END$
-
-$		// mpfmbãNULLã§ãªãå ´åï¼E_NOSPTï¼ï¼»ASPS0166ï¼½
-		$IF !EQ(MPF.MPFMB[mpfid], "NULL")$
-			$ERROR MPF.TEXT_LINE[mpfid]$E_NOSPT:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"mpfmb", MPF.MPFMB[mpfid], mpfid, "CRE_MPF")$
-			$END$
-		$END$
-
-$		// åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çé å
-		static MPFMB _kernel_mpfmb_$mpfid$[$MPF.BLKCNT[mpfid]$];$NL$
-	$END$
-
-$	// åºå®é·ã¡ã¢ãªãã¼ã«åæåãã­ãã¯
-	const MPFINIB _kernel_mpfinib_table[TNUM_MPFID] = {$NL$
-	$JOINEACH mpfid MPF.ID_LIST ",\n"$
-		$TAB${$SPC$
-			($MPF.MPFATR[mpfid]$),$SPC$
-			($MPF.BLKCNT[mpfid]$),$SPC$
-			ROUND_MPF_T($MPF.BLKSZ[mpfid]$),$SPC$
-			$IF EQ(MPF.MPF[mpfid],"NULL")$
-				_kernel_mpf_$mpfid$
-			$ELSE$
-				(void *)($MPF.MPF[mpfid]$)
-			$END$,$SPC$
-			_kernel_mpfmb_$mpfid$$SPC$
-		}$END$$NL$
-	};$NL$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(const MPFINIB, _kernel_mpfinib_table);$NL$
-$END$$NL$
-
-$
-$  åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çãã­ãã¯ã¨åºå®é·ã¡ã¢ãªãã¼ã«æ©è½åæåé¢æ°
-$
-$IF LENGTH(MPF.ID_LIST)$
-	MPFCB _kernel_mpfcb_table[TNUM_MPFID];$NL$
-	$initfuncs = APPEND(initfuncs, "_kernel_initialize_mempfix();")$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(MPFCB, _kernel_mpfcb_table);$NL$
-$END$$NL$
Index: asp3_wo_tecs/trunk/kernel/mempfix.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/mempfix.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/mempfix.trb	(revision 304)
@@ -0,0 +1,117 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: mempfix.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#		åºå®é·ã¡ã¢ãªãã¼ã«æ©è½ã®çæã¹ã¯ãªãã
+#
+
+class MempfixObject < KernelObject
+  def initialize()
+    super("mpf", "mempfix")
+  end
+
+  def prepare(id, params)
+    # mpfatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2225ï¼½
+    #ï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+    if (params[:mpfatr] & ~($TA_TPRI)) != 0
+      error_illegal_id("E_RSATR", params, :mpfatr, :mpfid)
+    end
+
+    # blkcntã0ä»¥ä¸ã®å ´åï¼E_PARï¼ï¼»NGKI2229ï¼½
+    if params[:blkcnt] <= 0
+      error_illegal_id("E_PAR", params, :blkcnt, :mpfid)
+    end
+
+    # blkszã0ä»¥ä¸ã®å ´åï¼E_PARï¼ï¼»NGKI2230ï¼½
+    if params[:blksz] <= 0
+      error_illegal_id("E_PAR", params, :blksz, :mpfid)
+    end
+
+    # åºå®é·ã¡ã¢ãªãã¼ã«é å
+    if params[:mpf] == "NULL"
+      $kernelCfgC.add("static MPF_T _kernel_mpf_#{params[:mpfid]}" \
+				"[#{params[:blkcnt]} * COUNT_MPF_T(#{params[:blksz]})];")
+    end
+
+    # mpfmbãNULLã§ãªãå ´åï¼E_NOSPTï¼ï¼»ASPS0166ï¼½
+    if params[:mpfmb] != "NULL"
+      error_illegal_id("E_PAR", params, :mpfmb, :mpfid)
+    end
+
+    # åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çé å
+    $kernelCfgC.add("static MPFMB _kernel_mpfmb_#{params[:mpfid]}" \
+												"[#{params[:blkcnt]}];")
+  end
+
+  def generateInib(id, params)
+    if params[:mpf] == "NULL"
+      mpf = "_kernel_mpf_#{params[:mpfid]}"
+    else
+      mpf = "(void *)(#{params[:mpf]})"
+    end
+    return("(#{params[:mpfatr]}), (#{params[:blkcnt]}), " \
+					"ROUND_MPF_T(#{params[:blksz]}), #{mpf}, " \
+					"_kernel_mpfmb_#{params[:mpfid]}")
+  end
+end
+
+#
+#  åºå®é·ã¡ã¢ãªãã¼ã«ã«é¢ããæ
+å ±ã®çæ
+#
+$kernelCfgC.comment_header("Fixed-sized Memorypool Functions")
+MempfixObject.new.generate()
Index: asp3_wo_tecs/trunk/kernel/mutex.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/mutex.tf	(revision 303)
+++ 	(revision )
@@ -1,148 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2014 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: mutex.tf 480 2016-01-03 07:37:12Z ertl-hiro $
-$ 
-
-$
-$		ãã¥ã¼ããã¯ã¹æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$
-$  kernel_cfg.hã®çæ
-$
-$FILE "kernel_cfg.h.new"$
-
-#define TNUM_MTXID	$LENGTH(MTX.ID_LIST)$$NL$
-$FOREACH id MTX.ID_LIST$
-	#define $id$	$+id$$NL$
-$END$
-
-$
-$  kernel_cfg.cã®çæ
-$
-$FILE "kernel_cfg.c"$
-
-/*$NL$
-$SPC$*  Mutex Functions$NL$
-$SPC$*/$NL$
-$NL$
-
-$
-$  ãã¥ã¼ããã¯ã¹ã®IDçªå·ãä¿æããå¤æ°
-$
-$IF USE_EXTERNAL_ID$
-	$FOREACH id MTX.ID_LIST$
-		const ID $id$_id = $+id$;$NL$
-	$END$
-$END$
-
-$
-$  ãã¥ã¼ããã¯ã¹IDçªå·ã®æå¤§å¤
-$
-const ID _kernel_tmax_mtxid = (TMIN_MTXID + TNUM_MTXID - 1);$NL$
-$NL$
-
-$
-$  ãã¥ã¼ããã¯ã¹åæåãã­ãã¯
-$
-$IF LENGTH(MTX.ID_LIST)$
-	$FOREACH mtxid MTX.ID_LIST$
-$		// mtxatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2025ï¼½
-$		//ï¼TA_NULLï¼TA_TPRIï¼TA_CEILINGã®ãããã§ããªãå ´åï¼
-		$IF !(MTX.MTXATR[mtxid] == 0 || MTX.MTXATR[mtxid] == TA_TPRI
-										|| MTX.MTXATR[mtxid] == TA_CEILING)$
-			$ERROR MTX.TEXT_LINE[mtxid]$E_RSATR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"mtxatr", MTX.MTXATR[mtxid], mtxid, "CRE_MTX")$
-			$END$
-		$END$
-
-$		// ceilpriãæªæå®ã®å ´åã¯0ã¨è¦ãªã
-		$IF !LENGTH(MTX.CEILPRI[mtxid])$
-			$MTX.CEILPRI[mtxid] = 0$
-		$END$
-
-$		// åªå
-åº¦ä¸éãã¥ã¼ããã¯ã¹ã§ï¼(TMIN_TPRI <= ceilpri && ceilpri <=
-$		// TMAX_TPRI)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI2037ï¼½
-		$IF MTX.MTXATR[mtxid] == TA_CEILING && (MTX.CEILPRI[mtxid] < TMIN_TPRI
-											|| TMAX_TPRI < MTX.CEILPRI[mtxid])$
-			$ERROR MTX.TEXT_LINE[mtxid]$E_PAR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"ceilpri", MTX.CEILPRI[mtxid], mtxid, "CRE_MTX")$
-			$END$
-		$END$
-	$END$
-
-$	// ãã¥ã¼ããã¯ã¹åæåãã­ãã¯
-	const MTXINIB _kernel_mtxinib_table[TNUM_MTXID] = {$NL$
-	$JOINEACH mtxid MTX.ID_LIST ",\n"$
-		$TAB${$SPC$
-			($MTX.MTXATR[mtxid]$),$SPC$
-			INT_PRIORITY($MTX.CEILPRI[mtxid]$)$SPC$
-		}$END$$NL$
-	};$NL$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(const MTXINIB, _kernel_mtxinib_table);$NL$
-$END$$NL$
-
-$
-$  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ã¨ãã¥ã¼ããã¯ã¹æ©è½åæåé¢æ°
-$
-$IF LENGTH(MTX.ID_LIST)$
-	MTXCB _kernel_mtxcb_table[TNUM_MTXID];$NL$
-	$initfuncs = APPEND(initfuncs, "_kernel_initialize_mutex();")$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(MTXCB, _kernel_mtxcb_table);$NL$
-$END$$NL$
Index: asp3_wo_tecs/trunk/kernel/mutex.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/mutex.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/mutex.trb	(revision 304)
@@ -0,0 +1,110 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: mutex.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#		ãã¥ã¼ããã¯ã¹æ©è½ã®çæã¹ã¯ãªãã
+#
+
+class MutexObject < KernelObject
+  def initialize()
+    super("mtx", "mutex")
+  end
+
+  def prepare(id, params)
+    # mtxatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2025ï¼½
+    # ï¼TA_NULLï¼TA_TPRIï¼TA_CEILINGã®ãããã§ããªãå ´åï¼
+    if !(params[:mtxatr] == $TA_NULL || params[:mtxatr] == $TA_TPRI \
+										|| params[:mtxatr] == $TA_CEILING)
+      error_illegal_id("E_RSATR", params, :mtxatr, :mtxid)
+    end
+
+    if params[:mtxatr] == $TA_CEILING
+      # åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã®å ´å
+      # ceilpriãæªæå®ã®å ´åã¯ã¨ã©ã¼ã¨ãã
+      if params[:ceilpri].nil?
+        error_api(params, "ceilpri must be specified" \
+							" in #{params[:apiname]} of #{param[:mtxid]}")
+
+      # (TMIN_TPRI <= ceilpri && ceilpri <= TMAX_TPRI)ã§ãªãå ´åï¼E_PARï¼
+      # ï¼»NGKI2037ï¼½
+      elsif !($TMIN_TPRI <= params[:ceilpri] && params[:ceilpri] <= $TMAX_TPRI)
+        error_illegal_id("E_PAR", params, :ceilpri, :mtxid)
+      end
+    else
+      # åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã§ãªãå ´å
+      # ceilpriãæå®ããã¦ããå ´åã¯è­¦åã¡ãã»ã¼ã¸ãåºã
+      if !params[:ceilpri].nil?
+        warning_api(params, "ceilpri `#{params[:ceilpri]}' is ignored" \
+								" in #{params[:apiname]} of #{params[:mtxid]}")
+      end
+      params[:ceilpri] = 0
+    end
+  end
+
+  def generateInib(id, params)
+    return("(#{params[:mtxatr]}), INT_PRIORITY(#{params[:ceilpri]})")
+  end
+end
+
+#
+#  ãã¥ã¼ããã¯ã¹ã«é¢ããæ
+å ±ã®çæ
+#
+$kernelCfgC.comment_header("Mutex Functions")
+MutexObject.new.generate()
Index: asp3_wo_tecs/trunk/kernel/pridataq.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/pridataq.tf	(revision 303)
+++ 	(revision )
@@ -1,176 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2014 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: pridataq.tf 480 2016-01-03 07:37:12Z ertl-hiro $
-$ 
-
-$
-$		åªå
-åº¦ãã¼ã¿ã­ã¥ã¼æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$
-$  kernel_cfg.hã®çæ
-$
-$FILE "kernel_cfg.h.new"$
-
-#define TNUM_PDQID	$LENGTH(PDQ.ID_LIST)$$NL$
-$FOREACH id PDQ.ID_LIST$
-	#define $id$	$+id$$NL$
-$END$
-
-$
-$  kernel_cfg.cã®çæ
-$
-$FILE "kernel_cfg.c"$
-
-/*$NL$
-$SPC$*  Priority Dataqueue Functions$NL$
-$SPC$*/$NL$
-$NL$
-
-$
-$  åªå
-åº¦ãã¼ã¿ã­ã¥ã¼ã®IDçªå·ãä¿æããå¤æ°
-$
-$IF USE_EXTERNAL_ID$
-	$FOREACH id PDQ.ID_LIST$
-		const ID $id$_id = $+id$;$NL$
-	$END$
-$END$
-
-$
-$  åªå
-åº¦ãã¼ã¿ã­ã¥ã¼IDçªå·ã®æå¤§å¤
-$
-const ID _kernel_tmax_pdqid = (TMIN_PDQID + TNUM_PDQID - 1);$NL$
-$NL$
-
-$
-$  åªå
-åº¦ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯
-$
-$IF LENGTH(PDQ.ID_LIST)$
-	$FOREACH pdqid PDQ.ID_LIST$
-$		// pdqatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1804ï¼½
-$		//ï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
-		$IF (PDQ.PDQATR[pdqid] & ~TA_TPRI) != 0$
-			$ERROR PDQ.TEXT_LINE[pdqid]$E_RSATR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"pdqatr", PDQ.PDQATR[pdqid], pdqid, "CRE_PDQ")$
-			$END$
-		$END$
-
-$		// pdqcntãè² ã®å ´åï¼E_PARï¼ï¼»NGKI3289ï¼½
-		$IF PDQ.PDQCNT[pdqid] < 0$
-			$ERROR PDQ.TEXT_LINE[pdqid]$E_PAR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"pdqcnt", PDQ.PDQCNT[pdqid], pdqid, "CRE_PDQ")$
-			$END$
-		$END$
-
-$		// (TMIN_DPRI <= maxdpri && maxdpri <= TMAX_DPRI)ã§ãªãå ´åï¼E_PARï¼
-$		// ï¼»NGKI1819ï¼½
-		$IF !(TMIN_DPRI <= PDQ.MAXDPRI[pdqid]
-								&& PDQ.MAXDPRI[pdqid] <= TMAX_DPRI)$
-			$ERROR PDQ.TEXT_LINE[pdqid]$E_PAR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"maxdpri", PDQ.MAXDPRI[pdqid], pdqid, "CRE_PDQ")$
-			$END$
-		$END$
-
-$		// pdqmbãNULLã§ãªãå ´åï¼E_NOSPTï¼ï¼»ASPS0142ï¼½
-		$IF !EQ(PDQ.PDQMB[pdqid], "NULL")$
-			$ERROR PDQ.TEXT_LINE[pdqid]$E_NOSPT:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"pdqmb", PDQ.PDQMB[pdqid], pdqid, "CRE_PDQ")$
-			$END$
-		$END$
-
-$		// åªå
-åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé å
-		$IF PDQ.PDQCNT[pdqid]$
-			static PDQMB _kernel_pdqmb_$pdqid$[$PDQ.PDQCNT[pdqid]$];$NL$
-		$END$
-	$END$
-
-$	// åªå
-åº¦ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯
-	const PDQINIB _kernel_pdqinib_table[TNUM_PDQID] = {$NL$
-	$JOINEACH pdqid PDQ.ID_LIST ",\n"$
-		$TAB${$SPC$
-			($PDQ.PDQATR[pdqid]$),$SPC$
-			($PDQ.PDQCNT[pdqid]$),$SPC$
-			($PDQ.MAXDPRI[pdqid]$),$SPC$
-			$IF PDQ.PDQCNT[pdqid]$
-				_kernel_pdqmb_$pdqid$
-			$ELSE$
-				NULL
-			$END$$SPC$
-		}$END$$NL$
-	};$NL$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(const PDQINIB, _kernel_pdqinib_table);$NL$
-$END$$NL$
-
-$
-$  åªå
-åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ã¨åªå
-åº¦ãã¼ã¿ã­ã¥ã¼æ©è½åæåé¢æ°
-$
-$IF LENGTH(PDQ.ID_LIST)$
-	PDQCB _kernel_pdqcb_table[TNUM_PDQID];$NL$
-	$initfuncs = APPEND(initfuncs, "_kernel_initialize_pridataq();")$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(PDQCB, _kernel_pdqcb_table);$NL$
-$END$$NL$
Index: asp3_wo_tecs/trunk/kernel/pridataq.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/pridataq.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/pridataq.trb	(revision 304)
@@ -0,0 +1,111 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: pridataq.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½ã®çæã¹ã¯ãªãã
+#
+
+class PridataqObject < KernelObject
+  def initialize()
+    super("pdq", "pridataq")
+  end
+
+  def prepare(id, params)
+    # pdqatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1804ï¼½
+    #ï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+    if (params[:pdqatr] & ~($TA_TPRI)) != 0
+      error_illegal_id("E_RSATR", params, :pdqatr, :pdqid)
+    end
+
+    # (TMIN_DPRI <= maxdpri && maxdpri <= TMAX_DPRI)ã§ãªãå ´åï¼E_PARï¼
+    # ï¼»NGKI1819ï¼½
+    if !($TMIN_DPRI <= params[:maxdpri] && params[:maxdpri] <= $TMAX_DPRI)
+      error_illegal_id("E_PAR", params, :maxdpri, :pdqid)
+    end
+
+    # pdqmbãNULLã§ãªãå ´åï¼E_NOSPTï¼ï¼»ASPS0142ï¼½
+    if params[:pdqmb] != "NULL"
+      error_illegal_id("E_PAR", params, :pdqmb, :pdqid)
+    end
+
+    # åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé å
+    if params[:pdqcnt] > 0
+      $kernelCfgC.add("static PDQMB _kernel_pdqmb_#{params[:pdqid]}" \
+												"[#{params[:pdqcnt]}];")
+    end
+  end
+
+  def generateInib(id, params)
+    if params[:pdqcnt] > 0
+      pdqmb = "_kernel_pdqmb_#{params[:pdqid]}"
+    else
+      pdqmb = "NULL"
+    end
+    return("(#{params[:pdqatr]}), (#{params[:pdqcnt]}), " \
+									"(#{params[:maxdpri]}), #{pdqmb}")
+  end
+end
+
+#
+#  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã«é¢ããæ
+å ±ã®çæ
+#
+$kernelCfgC.comment_header("Priority Dataqueue Functions")
+PridataqObject.new.generate()
Index: asp3_wo_tecs/trunk/kernel/semaphore.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/semaphore.tf	(revision 303)
+++ 	(revision )
@@ -1,148 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2014 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: semaphore.tf 480 2016-01-03 07:37:12Z ertl-hiro $
-$ 
-
-$
-$		ã»ããã©æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$
-$  kernel_cfg.hã®çæ
-$
-$FILE "kernel_cfg.h.new"$
-
-#define TNUM_SEMID	$LENGTH(SEM.ID_LIST)$$NL$
-$FOREACH id SEM.ID_LIST$
-	#define $id$	$+id$$NL$
-$END$
-
-$
-$  kernel_cfg.cã®çæ
-$
-$FILE "kernel_cfg.c"$
-
-/*$NL$
-$SPC$*  Semaphore Functions$NL$
-$SPC$*/$NL$
-$NL$
-
-$
-$  ã»ããã©ã®IDçªå·ãä¿æããå¤æ°
-$
-$IF USE_EXTERNAL_ID$
-	$FOREACH id SEM.ID_LIST$
-		const ID $id$_id = $+id$;$NL$
-	$END$$NL$
-$END$
-
-$
-$  ã»ããã©IDçªå·ã®æå¤§å¤
-$
-const ID _kernel_tmax_semid = (TMIN_SEMID + TNUM_SEMID - 1);$NL$
-$NL$
-
-$
-$  ã»ããã©åæåãã­ãã¯
-$
-$IF LENGTH(SEM.ID_LIST)$
-	$FOREACH semid SEM.ID_LIST$
-$		// sematrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1456ï¼½
-$		//ï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
-		$IF (SEM.SEMATR[semid] & ~TA_TPRI) != 0$
-			$ERROR SEM.TEXT_LINE[semid]$E_RSATR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"sematr", SEM.SEMATR[semid], semid, "CRE_SEM")$
-			$END$
-		$END$
-
-$		// (1 <= maxsem && maxsem <= TMAX_MAXSEM)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI1468ï¼½
-		$IF !(1 <= SEM.MAXSEM[semid] && SEM.MAXSEM[semid] <= TMAX_MAXSEM)$
-			$ERROR SEM.TEXT_LINE[semid]$E_PAR:$SPC$
-				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-							"maxsem", SEM.MAXSEM[semid], semid, "CRE_SEM")$
-			$END$
-		$END$
-
-$		// (0 <= isemcnt && isemcnt <= maxsem)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI1466ï¼½
-		$IF !(0 <= SEM.ISEMCNT[semid]
-								&& SEM.ISEMCNT[semid] <= SEM.MAXSEM[semid])$
-			$ERROR SEM.TEXT_LINE[semid]$E_PAR:$SPC$
-				$FORMAT(_("too large %1% `%2%\' of `%3%\' in %4%"),
-							"isemcnt", SEM.ISEMCNT[semid], semid, "CRE_SEM")$
-			$END$
-		$END$
-	$END$
-
-$	// ã»ããã©åæåãã­ãã¯
-	const SEMINIB _kernel_seminib_table[TNUM_SEMID] = {$NL$
-	$JOINEACH semid SEM.ID_LIST ",\n"$
-		$TAB${$SPC$
-			($SEM.SEMATR[semid]$),$SPC$
-			($SEM.ISEMCNT[semid]$),$SPC$
-			($SEM.MAXSEM[semid]$)$SPC$
-		}$END$$NL$
-	};$NL$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(const SEMINIB, _kernel_seminib_table);$NL$
-$END$$NL$
-
-$
-$  ã»ããã©ç®¡çãã­ãã¯ã¨ã»ããã©æ©è½åæåé¢æ°
-$IF LENGTH(SEM.ID_LIST)$
-	SEMCB _kernel_semcb_table[TNUM_SEMID];$NL$
-	$initfuncs = APPEND(initfuncs, "_kernel_initialize_semaphore();")$
-$ELSE$
-	TOPPERS_EMPTY_LABEL(SEMCB, _kernel_semcb_table);$NL$
-$END$$NL$
Index: asp3_wo_tecs/trunk/kernel/semaphore.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/semaphore.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/semaphore.trb	(revision 304)
@@ -0,0 +1,95 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: semaphore.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#		ã»ããã©æ©è½ã®çæã¹ã¯ãªãã
+#
+
+class SemaphoreObject < KernelObject
+  def initialize()
+    super("sem", "semaphore")
+  end
+
+  def prepare(id, params)
+    # sematrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1456ï¼½
+    #ï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+    if (params[:sematr] & ~($TA_TPRI)) != 0
+      error_illegal_id("E_RSATR", params, :sematr, :semid)
+    end
+
+    # (1 <= maxsem && maxsem <= TMAX_MAXSEM)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI1468ï¼½
+    if !(1 <= params[:maxsem] && params[:maxsem] <= $TMAX_MAXSEM)
+      error_illegal_id("E_PAR", params, :maxsem, :semid)
+    end
+
+    # (0 <= isemcnt && isemcnt <= maxsem)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI1466ï¼½
+    if !(0 <= params[:isemcnt] && params[:isemcnt] <= params[:maxsem])
+      error_wrong_id("E_PAR", params, :isemcnt, :semid, "too large")
+    end
+  end
+
+  def generateInib(id, params)
+    return("(#{params[:sematr]}), (#{params[:isemcnt]}), (#{params[:maxsem]})")
+  end
+end
+
+#
+#  ã»ããã©ã«é¢ããæ
+å ±ã®çæ
+#
+$kernelCfgC.comment_header("Semaphore Functions")
+SemaphoreObject.new.generate()
Index: asp3_wo_tecs/trunk/kernel/task.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/task.tf	(revision 303)
+++ 	(revision )
@@ -1,202 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2014 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: task.tf 480 2016-01-03 07:37:12Z ertl-hiro $
-$ 
-
-$
-$		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$
-$  kernel_cfg.hã®çæ
-$
-$FILE "kernel_cfg.h.new"$
-
-#define TNUM_TSKID	$LENGTH(TSK.ID_LIST)$$NL$
-$FOREACH id TSK.ID_LIST$
-	#define $id$	$+id$$NL$
-$END$
-
-$
-$  kernel_cfg.cã®çæ
-$
-$FILE "kernel_cfg.c"$
-
-/*$NL$
-$SPC$*  Task Management Functions$NL$
-$SPC$*/$NL$
-$NL$
-
-$
-$  ã¿ã¹ã¯ã®IDçªå·ãä¿æããå¤æ°
-$
-$IF USE_EXTERNAL_ID$
-	$FOREACH id TSK.ID_LIST$
-		const ID $id$_id = $+id$;$NL$
-	$END$$NL$
-$END$
-
-$
-$  ã¿ã¹ã¯ã1ã¤ãç»é²ããã¦ããªãå ´åï¼»NGKI0033ï¼½
-$
-$IF !LENGTH(TSK.ID_LIST)$
-	$ERROR$$FORMAT(_("no task is registered"))$$END$
-$END$
-
-$
-$  ã¿ã¹ã¯IDçªå·ã®æå¤§å¤
-$
-const ID _kernel_tmax_tskid = (TMIN_TSKID + TNUM_TSKID - 1);$NL$
-$NL$
-
-$
-$  ã¨ã©ã¼ãã§ãã¯
-$
-$FOREACH tskid TSK.ID_LIST$
-$	// tskatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1028ï¼½
-$	//ï¼TA_ACTï¼TA_NOACTQUEï¼TARGET_TSKATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
-	$IF (TSK.TSKATR[tskid] & ~(TA_ACT|TA_NOACTQUE|TARGET_TSKATR)) != 0$
-		$ERROR TSK.TEXT_LINE[tskid]$E_RSATR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-						"tskatr", TSK.TSKATR[tskid], tskid, "CRE_TSK")$
-		$END$
-	$END$
-
-$	// (TMIN_TPRI <= itskpri && itskpri <= TMAX_TPRI)ã§ãªãå ´åï¼»NGKI1034ï¼½
-	$IF !(TMIN_TPRI <= TSK.ITSKPRI[tskid] && TSK.ITSKPRI[tskid] <= TMAX_TPRI)$
-		$ERROR TSK.TEXT_LINE[tskid]$E_PAR:$SPC$
-			$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
-						"itskpri", TSK.ITSKPRI[tskid], tskid, "CRE_TSK")$
-		$END$
-	$END$
-$END$
-
-$
-$  ã¹ã¿ãã¯é åã®çæã¨ããã«é¢ããã¨ã©ã¼ãã§ãã¯
-$
-$FOREACH tskid TSK.ID_LIST$
-$	// stkszã0ä»¥ä¸ãï¼ã¿ã¼ã²ããå®ç¾©ã®æå°å¤ï¼TARGET_MIN_STKSZï¼ããã
-$	// å°ããå ´åï¼»NGKI1042ï¼½
-	$IF TSK.STKSZ[tskid] <= 0 || (TARGET_MIN_STKSZ
-									&& TSK.STKSZ[tskid] < TARGET_MIN_STKSZ)$
-		$ERROR TSK.TEXT_LINE[tskid]$E_PAR:$SPC$
-			$FORMAT(_("too small %1% `%2%\' of `%3%\' in %4%"),
-						"stksz", TSK.STKSZ[tskid], tskid, "CRE_TSK")$
-		$END$
-	$END$
-
-$ 	// stkszãã¹ã¿ãã¯é åã®ãµã¤ãºã¨ãã¦æ­£ãããªãå ´åï¼»NGKI1056ï¼½
-	$IF !EQ(TSK.STK[tskid], "NULL") && CHECK_STKSZ_ALIGN
-							&& (TSK.STKSZ[tskid] & (CHECK_STKSZ_ALIGN - 1))$
-		$ERROR TSK.TEXT_LINE[tskid]$E_PAR:$SPC$
-			$FORMAT(_("%1% `%2%\' of `%3%\' in %4% is not aligned"),
-						"stksz", TSK.STKSZ[tskid], tskid, "CRE_TSK")$
-		$END$
-	$END$
-
-$	// ã¹ã¿ãã¯é åã®è¨­å®ï¼»NGKI1041ï¼½
-	$IF EQ(TSK.STK[tskid],"NULL")$
-$		// ã¹ã¿ãã¯é åã®çæï¼»NGKI1049ï¼½
-		$TSK.TINIB_STKSZ[tskid] = ALLOC_STACK(CONCAT("_kernel_stack_",
-												tskid), TSK.STKSZ[tskid])$
-		$TSK.TINIB_STK[tskid] = CONCAT("_kernel_stack_", tskid)$
-	$ELSE$
-		$TSK.TINIB_STKSZ[tskid] = FORMAT("(%1%)", TSK.STKSZ[tskid])$
-		$TSK.TINIB_STK[tskid] = FORMAT("(void *)(%1%)", TSK.STK[tskid])$
-	$END$
-$END$
-$NL$
-
-$
-$  ã¿ã¹ã¯åæåãã­ãã¯ã®çæï¼ã¿ã¹ã¯ã¯1åä»¥ä¸å­å¨ããï¼
-$
-const TINIB _kernel_tinib_table[TNUM_TSKID] = {$NL$
-$JOINEACH tskid TSK.ID_LIST ",\n"$
-	$TAB${$SPC$
-$		// ã¿ã¹ã¯å±æ§ï¼æ¡å¼µæ
-å ±ï¼èµ·åçªå°ï¼èµ·åæåªå
-åº¦
-		($TSK.TSKATR[tskid]$),$SPC$
-		(intptr_t)($TSK.EXINF[tskid]$),$SPC$
-		(TASK)($TSK.TASK[tskid]$),$SPC$
-		INT_PRIORITY($TSK.ITSKPRI[tskid]$),$SPC$
-
-$		// ã¿ã¹ã¯åæåã³ã³ãã­ã¹ããã­ãã¯ï¼ã¹ã¿ãã¯é å
-		$IF USE_TSKINICTXB$
-			$GENERATE_TSKINICTXB(tskid)$
-		$ELSE$
-			$TSK.TINIB_STKSZ[tskid]$, $TSK.TINIB_STK[tskid]$
-		$END$$SPC$
-	}$END$$NL$
-};$NL$
-$NL$
-
-$
-$  ã¿ã¹ã¯çæé åºãã¼ãã«ã®çæ
-$
-const ID _kernel_torder_table[TNUM_TSKID] = {$NL$
-$TAB$$JOINEACH tskid TSK.ORDER_LIST ", "$$tskid$$END$$NL$
-};$NL$
-$NL$
-
-$
-$  ã¿ã¹ã¯ç®¡çãã­ãã¯ã®çæ
-$
-TCB _kernel_tcb_table[TNUM_TSKID];$NL$
-$NL$
-
-$
-$  ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«åæåé¢æ°
-$
-$initfuncs = "_kernel_initialize_task();"$
Index: asp3_wo_tecs/trunk/kernel/task.trb
===================================================================
--- asp3_wo_tecs/trunk/kernel/task.trb	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/task.trb	(revision 304)
@@ -0,0 +1,131 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: task.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®çæã¹ã¯ãªãã
+#
+
+class TaskObject < KernelObject
+  def initialize()
+    super("tsk", "task", "t")
+  end
+
+  def prepare(id, params)
+    # tskatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1028ï¼½
+    #ï¼TA_ACTï¼TA_NOACTQUEï¼TARGET_TSKATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+    if (params[:tskatr] & ~($TA_ACT|$TA_NOACTQUE|$TARGET_TSKATR)) != 0
+      error_illegal_id("E_RSATR", params, :tskatr, :tskid)
+    end
+
+    # (TMIN_TPRI <= itskpri && itskpri <= TMAX_TPRI)ã§ãªãå ´åï¼»NGKI1034ï¼½
+    if !($TMIN_TPRI <= params[:itskpri] && params[:itskpri] <= $TMAX_TPRI)
+      error_illegal_id("E_PAR", params, :itskpri, :tskid)
+    end
+
+    # stkszãã¿ã¼ã²ããå®ç¾©ã®æå°å¤ï¼TARGET_MIN_STKSZï¼æªå®ç¾©ã®å ´åã¯1ï¼
+    # ãããå°ããå ´åï¼»NGKI1042ï¼½
+    if params[:stksz] < $TARGET_MIN_STKSZ
+      error_wrong_id("E_PAR", params, :stksz, :tskid, "too small")
+    end
+
+    # stkszãã¹ã¿ãã¯é åã®ãµã¤ãºã¨ãã¦æ­£ãããªãå ´åï¼»NGKI1056ï¼½
+    if (params[:stksz] & ($CHECK_STKSZ_ALIGN - 1)) != 0
+      error_wrong_id("E_PAR", params, :stksz, :tskid, "not aligned")
+    end
+
+    # ã¹ã¿ãã¯é åã®è¨­å®ï¼»NGKI1041ï¼½
+    if params[:stk] == "NULL"
+      params[:tinib_stksz] = AllocStack("_kernel_stack_#{params[:tskid]}", \
+															params[:stksz])
+      params[:tinib_stk] = "_kernel_stack_#{params[:tskid]}"
+    else
+      params[:tinib_stksz] = params[:stksz]
+      params[:tinib_stk] = "(void *)(#{params[:stk]})"
+    end
+  end
+
+  def generateInib(id, params)
+    if $USE_TSKINICTXB == 1
+      tskinictxb = GenerateTskinictxb(id, params)
+    else
+      tskinictxb = "#{params[:tinib_stksz]}, #{params[:tinib_stk]}"
+    end
+    return("(#{params[:tskatr]}), (intptr_t)(#{params[:exinf]}), " \
+			"(TASK)(#{params[:task]}), INT_PRIORITY(#{params[:itskpri]}), " \
+			+ tskinictxb)
+  end
+end
+
+#
+#  ã¿ã¹ã¯ç®¡çã«é¢ããæ
+å ±ã®çæ
+#
+$kernelCfgC.comment_header("Task Management Functions")
+if $cfgData[:CRE_TSK].size() == 0
+  error("no task is registered")
+end
+TaskObject.new.generate()
+
+# ã¿ã¹ã¯çæé åºãã¼ãã«ã®çæ
+$kernelCfgC.add("const ID _kernel_torder_table[TNUM_TSKID] = { ")
+$kernelCfgC.append("\t")
+$cfgData[:CRE_TSK].each_with_index do |(id, params), index|
+  $kernelCfgC.append(", ") if index > 0
+  $kernelCfgC.append("#{params[:tskid]}")
+end
+$kernelCfgC.add
+$kernelCfgC.add2("};")
Index: asp3_wo_tecs/trunk/sample/Makefile
===================================================================
--- asp3_wo_tecs/trunk/sample/Makefile	(revision 303)
+++ asp3_wo_tecs/trunk/sample/Makefile	(revision 304)
@@ -192,7 +192,8 @@
 #  ã¿ã¼ã²ãããã¡ã¤ã«ï¼è¤æ°ãåæã«é¸æãã¦ã¯ãªããªãï¼
 #
-all: $(OBJFILE)
-#all: $(OBJNAME).bin
-#all: $(OBJNAME).srec
+.PHONY: all
+all: check
+#all: check $(OBJNAME).bin
+#all: check $(OBJNAME).srec
 
 ##### ä»¥ä¸ã¯ç·¨éããªããã¨ #####
@@ -201,6 +202,6 @@
 #  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«é¢ããå®ç¾©
 #
-CFG_TABS := --api-table $(SRCDIR)/kernel/kernel_api.csv \
-			--cfg1-def-table $(SRCDIR)/kernel/kernel_def.csv $(CFG_TABS)
+CFG_TABS := --api-table $(SRCDIR)/kernel/kernel_api.def \
+			--symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS)
 CFG_ASMOBJS := $(CFG_ASMOBJS)
 CFG_COBJS := kernel_cfg.o $(CFG_COBJS)
@@ -243,12 +244,15 @@
 	OFFSET_H = offset.h
 endif
-ifndef OFFSET_TF
-	OFFSET_TF := $(TARGETDIR)/target_offset.tf
-endif
-ifndef TARGET_TF
-	TARGET_TF := $(TARGETDIR)/target.tf
-endif
-ifndef TARGET_CHECK_TF
-	TARGET_CHECK_TF := $(TARGETDIR)/target_check.tf
+ifndef TARGET_OFFSET_TRB
+	TARGET_OFFSET_TRB := $(TARGETDIR)/target_offset.trb
+endif
+ifndef TARGET_KERNEL_TRB
+	TARGET_KERNEL_TRB := $(TARGETDIR)/target_kernel.trb
+endif
+ifndef TARGET_CHECK_TRB
+	TARGET_CHECK_TRB := $(TARGETDIR)/target_check.trb
+endif
+ifndef TARGET_KERNEL_CFG
+	TARGET_KERNEL_CFG := $(TARGETDIR)/target_kernel.cfg
 endif
 
@@ -291,29 +295,30 @@
 #  ã«ã¼ãã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã®çæ
 #
-cfg1_out.c: $(APPL_CFG)
-	$(CFG) --pass 1 --kernel asp $(INCLUDES) $(CFG_TABS) $<
-	$(CFG) -M cfg1_out.c $(INCLUDES) $< > $(DEPDIR)/cfg1_out_c.d
-
-$(CFG1_OUT) cfg1_out.syms cfg1_out.srec: \
-					$(START_OBJS) cfg1_out.o $(END_OBJS) $(HIDDEN_OBJS)
+cfg1_out.c cfg1_out.db: cfg1_out.timestamp ;
+cfg1_out.timestamp: $(APPL_CFG) $(TECSGEN_TIMESTAMP)
+	$(CFG) --pass 1 --kernel asp $(INCLUDES) $(CFG_TABS) \
+						-M $(DEPDIR)/cfg1_out_c.d $(TARGET_KERNEL_CFG) $<
+
+$(CFG1_OUT): $(START_OBJS) cfg1_out.o $(END_OBJS) $(HIDDEN_OBJS)
 	$(LINK) $(CFLAGS) $(LDFLAGS) $(CFG1_OUT_LDFLAGS) -o $(CFG1_OUT) \
 						$(START_OBJS) cfg1_out.o $(END_OBJS)
+
+cfg1_out.syms: $(CFG1_OUT)
 	$(NM) -n $(CFG1_OUT) > cfg1_out.syms
+
+cfg1_out.srec: $(CFG1_OUT)
 	$(OBJCOPY) -O srec -S $(CFG1_OUT) cfg1_out.srec
 
-$(CFG2_OUT_SRCS): kernel_cfg.timestamp
-kernel_cfg.timestamp: $(APPL_CFG) cfg1_out.syms cfg1_out.srec
-	$(CFG) --pass 2 --kernel asp $(INCLUDES) -T $(TARGET_TF) $(CFG_TABS) $<
-	$(SRCDIR)/utils/move-if-change kernel_cfg.h.new kernel_cfg.h
+$(CFG2_OUT_SRCS) cfg2_out.db: kernel_cfg.timestamp ;
+kernel_cfg.timestamp: cfg1_out.db cfg1_out.syms cfg1_out.srec
+	$(CFG) --pass 2 --kernel asp $(INCLUDES) -T $(TARGET_KERNEL_TRB)
 
 #
 #  ãªãã»ãããã¡ã¤ã«ï¼offset.hï¼ã®çæè¦å
 #
-$(OFFSET_H): offset.timestamp
-offset.timestamp: $(APPL_CFG) cfg1_out.syms cfg1_out.srec
-	$(CFG) --pass 3 --kernel asp $(INCLUDES) \
-				--rom-image cfg1_out.srec --symbol-table cfg1_out.syms \
-				-T $(OFFSET_TF) $(CFG_TABS) $<
-	$(SRCDIR)/utils/move-if-change offset.h.new offset.h
+$(OFFSET_H): offset.timestamp ;
+offset.timestamp: cfg1_out.db cfg1_out.syms cfg1_out.srec
+	$(CFG) --pass 2 -O --kernel asp $(INCLUDES) -T $(TARGET_OFFSET_TRB) \
+				--rom-symbol cfg1_out.syms --rom-image cfg1_out.srec
 
 #
@@ -334,13 +339,14 @@
 ¨ä½ã®ãªã³ã¯
 #
-$(OBJFILE): $(APPL_CFG) kernel_cfg.h $(ALL_OBJS) $(LIBS_DEP)
+$(OBJFILE): $(ALL_OBJS) $(LIBS_DEP)
 	$(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) \
 			$(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
 			$(ALL_LIBS) $(END_OBJS)
+
+#
+#  ã·ã³ãã«ãã¡ã¤ã«ã®çæ
+#
+$(OBJNAME).syms: $(OBJFILE)
 	$(NM) -n $(OBJFILE) > $(OBJNAME).syms
-	$(OBJCOPY) -O srec -S $(OBJFILE) $(OBJNAME).srec
-	$(CFG) --pass 3 --kernel asp $(INCLUDES) \
-				--rom-image $(OBJNAME).srec --symbol-table $(OBJNAME).syms \
-				-T $(TARGET_CHECK_TF) $(CFG_TABS) $<
 
 #
@@ -356,4 +362,11 @@
 	$(OBJCOPY) -O srec -S $(OBJFILE) $(OBJNAME).srec
 
+.PHONY: check
+check: check.timestamp ;
+check.timestamp: cfg2_out.db $(OBJNAME).syms $(OBJNAME).srec
+	$(CFG) --pass 3 --kernel asp $(INCLUDES) -T $(TARGET_CHECK_TRB) \
+				--rom-symbol $(OBJNAME).syms --rom-image $(OBJNAME).srec
+	@echo "configuration check passed"
+
 #
 #  ã³ã³ãã¤ã«çµæã®æ¶å»
@@ -361,9 +374,10 @@
 .PHONY: clean
 clean:
-	rm -f \#* *~ *.o $(CLEAN_FILES) offset.timestamp $(OFFSET_H)
+	rm -f \#* *~ *.o $(DEPDIR)/*.d $(CLEAN_FILES) check.timestamp
 	rm -f $(OBJFILE) $(OBJNAME).syms $(OBJNAME).srec $(OBJNAME).bin
-	rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS)
-	rm -f cfg1_out.c $(CFG1_OUT) cfg1_out.syms cfg1_out.srec
-	rm -f $(DEPDIR)/*.d
+	rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS) cfg2_out.db
+	rm -f offset.timestamp $(OFFSET_H)
+	rm -f cfg1_out.syms cfg1_out.srec $(CFG1_OUT)
+	rm -f cfg1_out.timestamp cfg1_out.c cfg1_out.db
 ifndef KERNEL_LIB
 	rm -f libkernel.a
Index: asp3_wo_tecs/trunk/sample/sample1.cfg
===================================================================
--- asp3_wo_tecs/trunk/sample/sample1.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/sample/sample1.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: sample1.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/Makefile.target
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/Makefile.target	(revision 303)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/Makefile.target	(revision 304)
@@ -75,9 +75,4 @@
 
 #
-#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
-#
-#CFG_TABS := $(CFG_TABS) --cfg1-def-table $(TARGETDIR)/target_def.csv
-
-#
 #  ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ãã«é¢ããå®ç¾©
 #
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target.tf
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target.tf	(revision 303)
+++ 	(revision )
@@ -1,16 +1,0 @@
-$ 
-$		ãã¹2ã®ã¿ã¼ã²ããä¾å­ãã³ãã¬ã¼ãï¼CT11MPCoreç¨ï¼
-$ 
-$  $Id: target.tf 362 2015-07-26 11:29:15Z ertl-hiro $
-$
-
-$ 
-$  ä½¿ç¨ã§ããå²è¾¼ã¿çªå·ã¨ããã«å¯¾å¿ããå²è¾¼ã¿ãã³ãã©çªå·
-$ 
-$INTNO_VALID = { 0, 1 ,..., 47 }$
-$INHNO_VALID = INTNO_VALID$
-
-$ 
-$  ã³ã¢ä¾å­ãã³ãã¬ã¼ãï¼ãããä¾å­é¨ã¯é£ã°ãï¼
-$ 
-$INCLUDE "core.tf"$
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_check.tf
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_check.tf	(revision 303)
+++ 	(revision )
@@ -1,8 +1,0 @@
-$ 
-$		ãã¹3ã®ã¿ã¼ã²ããä¾å­ãã³ãã¬ã¼ãï¼CT11MPCoreç¨ï¼
-$ 
-
-$ 
-$  ã³ã¢ä¾å­ãã³ãã¬ã¼ãï¼ãããä¾å­é¨ã¯é£ã°ãï¼
-$ 
-$INCLUDE "core_check.tf"$
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_check.trb
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_check.trb	(revision 304)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_check.trb	(revision 304)
@@ -0,0 +1,8 @@
+# 
+#		ãã¹3ã®çæã¹ã¯ãªããã®ã¿ã¼ã²ããä¾å­é¨ï¼CT11MPCoreç¨ï¼
+# 
+
+# 
+#  çæã¹ã¯ãªããã®ã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ã¯é£ã°ãï¼
+# 
+IncludeTrb("core_check.trb")
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel.cfg
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel.cfg	(revision 304)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel.cfg	(revision 304)
@@ -0,0 +1,7 @@
+/*
+ *		ã«ã¼ãã«å®è£
+ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: target_kernel.cfg 572 2016-02-01 14:40:09Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg")
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel.trb
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel.trb	(revision 304)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel.trb	(revision 304)
@@ -0,0 +1,16 @@
+# 
+#		ãã¹2ã®çæã¹ã¯ãªããã®ã¿ã¼ã²ããä¾å­é¨ï¼CT11MPCoreç¨ï¼
+# 
+#  $Id: target_kernel.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#
+
+# 
+#  ä½¿ç¨ã§ããå²è¾¼ã¿çªå·ã¨ããã«å¯¾å¿ããå²è¾¼ã¿ãã³ãã©çªå·
+# 
+$INTNO_VALID = [ *(0..47) ]
+$INHNO_VALID = $INTNO_VALID
+
+# 
+#  çæã¹ã¯ãªããã®ã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ã¯é£ã°ãï¼
+# 
+IncludeTrb("core_kernel.trb")
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_rename.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_rename.h	(revision 303)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_rename.h	(revision 304)
@@ -31,35 +31,4 @@
 
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  target_kernel_impl.c
- */
-#define _target_initialize			__kernel_target_initialize
-#define _target_exit				__kernel_target_exit
-
-/*
- *  target_timer.c
- */
-#define _target_ovrtimer_initialize	__kernel_target_ovrtimer_initialize
-#define _target_ovrtimer_terminate	__kernel_target_ovrtimer_terminate
-#define _target_ovrtimer_start		__kernel_target_ovrtimer_start
-#define _target_ovrtimer_stop		__kernel_target_ovrtimer_stop
-#define _target_ovrtimer_get_current	__kernel_target_ovrtimer_get_current
-#define _target_ovrtimer_handler	__kernel_target_ovrtimer_handler
-
-/*
- *  trace_config.c
- */
-#define _log_dsp_enter				__kernel_log_dsp_enter
-#define _log_dsp_leave				__kernel_log_dsp_leave
-#define _log_inh_enter				__kernel_log_inh_enter
-#define _log_inh_leave				__kernel_log_inh_leave
-#define _log_exc_enter				__kernel_log_exc_enter
-#define _log_exc_leave				__kernel_log_exc_leave
-
-
-#endif /* TOPPERS_LABEL_ASM */
-
 #include "chip_rename.h"
 
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_unrename.h	(revision 303)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_unrename.h	(revision 304)
@@ -32,35 +32,4 @@
 
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  target_kernel_impl.c
- */
-#undef _target_initialize
-#undef _target_exit
-
-/*
- *  target_timer.c
- */
-#undef _target_ovrtimer_initialize
-#undef _target_ovrtimer_terminate
-#undef _target_ovrtimer_start
-#undef _target_ovrtimer_stop
-#undef _target_ovrtimer_get_current
-#undef _target_ovrtimer_handler
-
-/*
- *  trace_config.c
- */
-#undef _log_dsp_enter
-#undef _log_dsp_leave
-#undef _log_inh_enter
-#undef _log_inh_leave
-#undef _log_exc_enter
-#undef _log_exc_leave
-
-
-#endif /* TOPPERS_LABEL_ASM */
-
 #include "chip_unrename.h"
 
Index: asp3_wo_tecs/trunk/target/dummy_gcc/Makefile.target
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/Makefile.target	(revision 303)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/Makefile.target	(revision 304)
@@ -42,5 +42,5 @@
 #  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
 #
-CFG_TABS := $(CFG_TABS) --cfg1-def-table $(TARGETDIR)/target_def.csv
+CFG_TABS := $(CFG_TABS) --symval-table $(TARGETDIR)/target_sym.def
 
 #
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target.tf
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target.tf	(revision 303)
+++ 	(revision )
@@ -1,21 +1,0 @@
-$ 
-$ 		ãã¹2ã®ã¿ã¼ã²ããä¾å­ãã³ãã¬ã¼ãï¼ããã¼ã¿ã¼ã²ããç¨ï¼
-$
-$   $Id: target.tf 354 2015-07-25 10:19:41Z ertl-hiro $
-$ 
-
-$ 
-$  ä½¿ç¨ã§ããå²è¾¼ã¿çªå·ã¨ããã«å¯¾å¿ããå²è¾¼ã¿ãã³ãã©çªå·
-$ 
-$INTNO_VALID = { 0, 1,..., 31 }$
-$INHNO_VALID = INTNO_VALID$
-
-$ 
-$  ä½¿ç¨ã§ããCPUä¾å¤ãã³ãã©çªå·
-$ 
-$EXCNO_VALID = { 0, 1, 2, 3, 4, 5, 6, 7 }$
-
-$ 
-$  æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
-$ 
-$INCLUDE "kernel/kernel.tf"$
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_check.tf
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_check.tf	(revision 303)
+++ 	(revision )
@@ -1,10 +1,0 @@
-$ 
-$ 		ãã¹3ã®ã¿ã¼ã²ããä¾å­ãã³ãã¬ã¼ãï¼ããã¼ã¿ã¼ã²ããç¨ï¼
-$
-$   $Id: target_check.tf 238 2014-09-28 19:19:25Z ertl-hiro $
-$ 
-
-$ 
-$  æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
-$ 
-$INCLUDE "kernel/kernel_check.tf"$
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_check.trb
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_check.trb	(revision 304)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_check.trb	(revision 304)
@@ -0,0 +1,11 @@
+# -*- coding: utf-8 -*-
+#
+#		ãã¹3ã®çæã¹ã¯ãªããã®ã¿ã¼ã²ããä¾å­é¨ï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+#
+#   $Id: target_check.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#  ã¿ã¼ã²ããéä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ã
+#
+IncludeTrb("kernel/kernel_check.trb")
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_def.csv
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_def.csv	(revision 303)
+++ 	(revision )
@@ -1,4 +1,0 @@
-sizeof_TCB,sizeof(TCB)
-offsetof_TCB_p_tinib,"offsetof(TCB,p_tinib)"
-offsetof_TCB_sp,"offsetof(TCB,tskctxb.sp)"
-offsetof_TCB_pc,"offsetof(TCB,tskctxb.pc)"
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel.cfg
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel.cfg	(revision 304)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel.cfg	(revision 304)
@@ -0,0 +1,7 @@
+/*
+ *		ã«ã¼ãã«å®è£
+ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: target_kernel.cfg 572 2016-02-01 14:40:09Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg")
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel.trb
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel.trb	(revision 304)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel.trb	(revision 304)
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+# 
+#		ãã¹2ã®çæã¹ã¯ãªããã®ã¿ã¼ã²ããä¾å­é¨ï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+#
+#   $Id: target_kernel.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+# 
+#  ä½¿ç¨ã§ããå²è¾¼ã¿çªå·ã¨ããã«å¯¾å¿ããå²è¾¼ã¿ãã³ãã©çªå·
+# 
+$INTNO_VALID = [ *(0..31) ]
+$INHNO_VALID = $INTNO_VALID
+
+# 
+#  ä½¿ç¨ã§ããCPUä¾å¤ãã³ãã©çªå·
+# 
+$EXCNO_VALID = [ *(0..7) ]
+
+#
+#  ã¿ã¼ã²ããéä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ã
+#
+IncludeTrb("kernel/kernel.trb")
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_offset.tf
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_offset.tf	(revision 303)
+++ 	(revision )
@@ -1,19 +1,0 @@
-$ 
-$ 		ãªãã»ãããã¡ã¤ã«çæç¨ãã³ãã¬ã¼ããã¡ã¤ã«ï¼ããã¼ã¿ã¼ã²ããç¨ï¼
-$
-$   $Id: target_offset.tf 238 2014-09-28 19:19:25Z ertl-hiro $
-$ 
-
-$
-$  æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
-$
-$INCLUDE "kernel/genoffset.tf"$
-
-$
-$  ãã£ã¼ã«ãã®ãªãã»ããã®å®ç¾©ã®çæ
-$
-$DEFINE("TCB_p_tinib", offsetof_TCB_p_tinib)$
-$DEFINE("TCB_sp", offsetof_TCB_sp)$
-$DEFINE("TCB_pc", offsetof_TCB_pc)$
-$DEFINE("TINIB_exinf", offsetof_TINIB_exinf)$
-$DEFINE("TINIB_task", offsetof_TINIB_task)$
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_offset.trb
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_offset.trb	(revision 304)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_offset.trb	(revision 304)
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+# 
+# 		ãªãã»ãããã¡ã¤ã«çæç¨ã®çæã¹ã¯ãªããã®ã¿ã¼ã²ããä¾å­é¨ï¼ã
+# 		ãã¼ã¿ã¼ã²ããç¨ï¼
+#
+#   $Id: target_offset.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+# 
+
+#
+#  ã¿ã¼ã²ããéä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ã
+#
+IncludeTrb("kernel/genoffset.trb")
+
+#
+#  ãã£ã¼ã«ãã®ãªãã»ããã®å®ç¾©ã®çæ
+#
+GenerateDefine("TCB_p_tinib", $offsetof_TCB_p_tinib)
+GenerateDefine("TCB_sp", $offsetof_TCB_sp)
+GenerateDefine("TCB_pc", $offsetof_TCB_pc)
+GenerateDefine("TINIB_exinf", $offsetof_TINIB_exinf)
+GenerateDefine("TINIB_task", $offsetof_TINIB_task)
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_rename.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_rename.h	(revision 303)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_rename.h	(revision 304)
@@ -43,47 +43,4 @@
 #define log_exc_leave				_kernel_log_exc_leave
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  target_kernel_impl.c
- */
-#define _dispatch					__kernel_dispatch
-#define _start_dispatch				__kernel_start_dispatch
-#define _exit_and_dispatch			__kernel_exit_and_dispatch
-#define _ret_int					__kernel_ret_int
-#define _ret_exc					__kernel_ret_exc
-#define _call_exit_kernel			__kernel_call_exit_kernel
-#define _start_r					__kernel_start_r
-#define _target_initialize			__kernel_target_initialize
-#define _target_exit				__kernel_target_exit
-
-/*
- *  target_timer.c
- */
-#define _target_hrt_initialize		__kernel_target_hrt_initialize
-#define _target_hrt_terminate		__kernel_target_hrt_terminate
-#define _target_hrt_get_current		__kernel_target_hrt_get_current
-#define _target_hrt_set_event		__kernel_target_hrt_set_event
-#define _target_hrt_raise_event		__kernel_target_hrt_raise_event
-#define _target_hrt_handler			__kernel_target_hrt_handler
-#define _target_ovrtimer_initialize	__kernel_target_ovrtimer_initialize
-#define _target_ovrtimer_terminate	__kernel_target_ovrtimer_terminate
-#define _target_ovrtimer_start		__kernel_target_ovrtimer_start
-#define _target_ovrtimer_stop		__kernel_target_ovrtimer_stop
-#define _target_ovrtimer_get_current	__kernel_target_ovrtimer_get_current
-#define _target_ovrtimer_handler	__kernel_target_ovrtimer_handler
-
-/*
- *  trace_config.c
- */
-#define _log_dsp_enter				__kernel_log_dsp_enter
-#define _log_dsp_leave				__kernel_log_dsp_leave
-#define _log_inh_enter				__kernel_log_inh_enter
-#define _log_inh_leave				__kernel_log_inh_leave
-#define _log_exc_enter				__kernel_log_exc_enter
-#define _log_exc_leave				__kernel_log_exc_leave
-
-#endif /* TOPPERS_LABEL_ASM */
-
 
 #endif /* TOPPERS_TARGET_RENAME_H */
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_sym.def
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_sym.def	(revision 304)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_sym.def	(revision 304)
@@ -0,0 +1,4 @@
+sizeof_TCB,sizeof(TCB)
+offsetof_TCB_p_tinib,"offsetof(TCB,p_tinib)"
+offsetof_TCB_sp,"offsetof(TCB,tskctxb.sp)"
+offsetof_TCB_pc,"offsetof(TCB,tskctxb.pc)"
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_unrename.h	(revision 303)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_unrename.h	(revision 304)
@@ -44,47 +44,4 @@
 #undef log_exc_leave
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  target_kernel_impl.c
- */
-#undef _dispatch
-#undef _start_dispatch
-#undef _exit_and_dispatch
-#undef _ret_int
-#undef _ret_exc
-#undef _call_exit_kernel
-#undef _start_r
-#undef _target_initialize
-#undef _target_exit
-
-/*
- *  target_timer.c
- */
-#undef _target_hrt_initialize
-#undef _target_hrt_terminate
-#undef _target_hrt_get_current
-#undef _target_hrt_set_event
-#undef _target_hrt_raise_event
-#undef _target_hrt_handler
-#undef _target_ovrtimer_initialize
-#undef _target_ovrtimer_terminate
-#undef _target_ovrtimer_start
-#undef _target_ovrtimer_stop
-#undef _target_ovrtimer_get_current
-#undef _target_ovrtimer_handler
-
-/*
- *  trace_config.c
- */
-#undef _log_dsp_enter
-#undef _log_dsp_leave
-#undef _log_inh_enter
-#undef _log_inh_leave
-#undef _log_exc_enter
-#undef _log_exc_leave
-
-#endif /* TOPPERS_LABEL_ASM */
-
 
 #endif /* TOPPERS_TARGET_RENAME_H */
Index: asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/target.tf
===================================================================
--- asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/target.tf	(revision 303)
+++ 	(revision )
@@ -1,8 +1,0 @@
-$ 
-$     ãã¹2ã®ã¿ã¼ã²ããä¾å­ãã³ãã¬ã¼ãï¼NUCLEO_F401REç¨ï¼
-$ 
-
-$ 
-$  ãããä¾å­ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
-$ 
-$INCLUDE "core.tf"$
Index: asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/target_rename.def
===================================================================
--- asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/target_rename.def	(revision 303)
+++ asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/target_rename.def	(revision 304)
@@ -1,3 +1,3 @@
-INCLUDE	"arm_m_gcc/stm32f4xx_stm32cube/chip"
+INCLUDE	"chip"
 
 #target_config.c
Index: asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/target_rename.h
===================================================================
--- asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/target_rename.h	(revision 303)
+++ asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/target_rename.h	(revision 304)
@@ -6,20 +6,9 @@
 
 /*
- * target_config.c
+ *  target_config.c
  */
 #define target_initialize			_kernel_target_initialize
 #define target_exit					_kernel_target_exit
 
-#ifdef TOPPERS_LABEL_ASM
-
-
-/*
- * target_config.c
- */
-#define _target_initialize			__kernel_target_initialize
-#define _target_exit				__kernel_target_exit
-
-#endif /* TOPPERS_LABEL_ASM */
-
 #include "chip_rename.h"
 
Index: asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/target_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/target_unrename.h	(revision 303)
+++ asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/target_unrename.h	(revision 304)
@@ -7,20 +7,9 @@
 
 /*
- * target_config.c
+ *  target_config.c
  */
 #undef target_initialize
 #undef target_exit
 
-#ifdef TOPPERS_LABEL_ASM
-
-
-/*
- * target_config.c
- */
-#undef _target_initialize
-#undef _target_exit
-
-#endif /* TOPPERS_LABEL_ASM */
-
 #include "chip_unrename.h"
 
Index: asp3_wo_tecs/trunk/test/MANIFEST
===================================================================
--- asp3_wo_tecs/trunk/test/MANIFEST	(revision 303)
+++ asp3_wo_tecs/trunk/test/MANIFEST	(revision 304)
@@ -34,4 +34,5 @@
 perf5.cfg
 perf5.h
+perf_pf.cdl
 test_cpuexc.cfg
 test_cpuexc.h
@@ -50,4 +51,7 @@
 test_dlynse.cfg
 test_dlynse.h
+test_flg1.c
+test_flg1.cfg
+test_flg1.h
 test_hrt1.c
 test_hrt1.cfg
@@ -78,4 +82,5 @@
 test_notify1.cfg
 test_notify1.h
+test_pf.cdl
 test_raster1.c
 test_raster1.cfg
Index: asp3_wo_tecs/trunk/test/hrt_systim1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim1.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/hrt_systim1.cfg	(revision 304)
@@ -5,5 +5,4 @@
  *  $Id: hrt_systim1.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/hrt_systim2.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim2.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/hrt_systim2.cfg	(revision 304)
@@ -5,5 +5,4 @@
  *  $Id: hrt_systim2.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/hrt_systim3.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim3.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/hrt_systim3.cfg	(revision 304)
@@ -5,5 +5,4 @@
  *  $Id: hrt_systim3.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/hrt_systim4.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim4.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/hrt_systim4.cfg	(revision 304)
@@ -5,5 +5,4 @@
  *  $Id: hrt_systim4.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/perf0.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/perf0.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/perf0.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: perf0.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/perf1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/perf1.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/perf1.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: perf1.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/perf2.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/perf2.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/perf2.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: perf2.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/perf3.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/perf3.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/perf3.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: perf3.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/perf4.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/perf4.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/perf4.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: perf4.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/perf5.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/perf5.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/perf5.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: perf5.cfg 449 2015-08-14 01:26:43Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_cpuexc.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_cpuexc.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_cpuexc.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_cpuexc.cfg 404 2015-08-02 21:56:21Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_dlynse.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_dlynse.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_dlynse.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_dlynse.cfg 263 2014-10-05 13:30:34Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_flg1.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_flg1.c	(revision 304)
+++ asp3_wo_tecs/trunk/test/test_flg1.c	(revision 304)
@@ -0,0 +1,758 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2015-2016 by Embedded and Real-Time Systems Laboratory
+ *              Graduate School of Information Science, Nagoya Univ., JAPAN
+ * 
+ *  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+ *  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+ *  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+ *  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+ *      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+ *      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+ *  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+ *      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+ *      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+ *      ã¨ï¼
+ *    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+ *        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+ *        å ±åãããã¨ï¼
+ *  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+ *      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+ *      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+ *      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+ *      å
+è²¬ãããã¨ï¼
+ * 
+ *  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+ *  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+ *  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+ *  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+ *  ã®è²¬ä»»ãè² ããªãï¼
+ * 
+ *  $Id: test_flg1.c 579 2016-02-03 07:29:11Z ertl-hiro $
+ */
+
+/* 
+ *		ã¤ãã³ããã©ã°æ©è½ã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  set_flgï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãï¼ï¼wai_flgï¼CRE_FLGãç¶²ç¾
+ç
+ *  ã«ãã¹ãããï¼ãã ãï¼CRE_FLGã®ã¨ã©ã¼ã®ãã¹ãã¯é¤ãï¼ï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) set_flgã®éçã¨ã©ã¼ã®ãã¹ã
+ *		(A-1) CPUã­ãã¯ç¶æ
+ããã®å¼åºãï¼»NGKI1604ï¼½
+ *		(A-2) flgidãä¸æ­£ï¼å°ããããï¼ï¼»NGKI1605ï¼½
+ *		(A-3) flgidãä¸æ­£ï¼å¤§ããããï¼ï¼»NGKI1605ï¼½
+ *	(B) set_flgã«ããã¤ãã³ããã©ã°ãã»ãããããï¼»NGKI1608ï¼½
+ *		(B-1) ç¾å¨ãã¿ã¼ã³ã0x00ã®æã«ï¼0x00ãã»ãããã
+ *		(B-2) ç¾å¨ãã¿ã¼ã³ã0x00ã®æã«ï¼0x01ãã»ãããã
+ *		(B-3) ç¾å¨ãã¿ã¼ã³ã0x01ã®æã«ï¼0x01ãã»ãããã
+ *		(B-4) ç¾å¨ãã¿ã¼ã³ã0x01ã®æã«ï¼0x02ãã»ãããã
+ *		(B-5) ç¾å¨ãã¿ã¼ã³ã0x01ã®æã«ï¼0x03ãã»ãããã
+ *	(C) set_flgã«ããã¤ãã³ããã©ã°å¾
+ã¡ç¶æ
+ã®ã¿ã¹ã¯ãå¾
+ã¡è§£é¤ããã
+ *		(C-1) å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ã«åãæãã
+ *		(C-2) ãã£ã¹ãããä¿çç¶æ
+ã§ï¼åãæãããªã
+ *		(C-3) å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ãå¼·å¶å¾
+ã¡ç¶æ
+ã§ï¼åãæãããªã
+ *		(C-4) å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ãåªå
+åº¦ãä½ãï¼åãæãããªã
+ *	(D) wai_flgã®éçã¨ã©ã¼ã®ãã¹ã
+ *		(D-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãï¼»NGKI1621ï¼½
+ *		(D-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºãï¼»NGKI1622ï¼½
+ *		(D-3) ãã£ã¹ãããç¦æ­¢ç¶æ
+ããã®å¼åºãï¼»NGKI1623ï¼½
+ *		(D-4) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªãç¶æ
+ããã®å¼åºãï¼»NGKI1623ï¼½
+ *		(D-5) flgidãä¸æ­£ï¼å°ããããï¼ï¼»NGKI1625ï¼½
+ *		(D-6) flgidãä¸æ­£ï¼å¤§ããããï¼ï¼»NGKI1625ï¼½
+ *		(D-7) waiptnã0ï¼»NGKI1626ï¼½
+ *		(D-8) wfmodeã0ï¼»NGKI1627ï¼½
+ *		(D-9) wfmodeã(TWF_ORW|TWF_ANDW)ï¼»NGKI1627ï¼½
+ *	(E) wai_flgã®å¾
+ã¡è§£é¤æ¡ä»¶ã®ãã¹ãï¼»NGKI1636ï¼½
+ *		TA_CLRå±æ§ã§ãªãã¤ãã³ããã©ã°ã§ãã¹ãããï¼ä»¥ä¸ã®åãã¿ã¼ã³ã§ï¼
+ *		ããããã¿ã¼ã³ã®ç¾å¨å¤ã*p_flgptnã«è¿ããã¨ãç¢ºèªãã
+ *		(E-1) TWF_ORWã§ï¼ããããã®ããããã»ããããã¦ããã°æç«ãããã¨
+ *		(E-2) TWF_ORWã§ï¼å¯¾è±¡å¤ã®ããããã»ããããã¦ãã¦ãä¸æç«ã«ãªããã¨
+ *		(E-3) TWF_ANDWã§ï¼ãã¹ã¦ã®ããããã»ããããã¦ããã°æç«ãããã¨
+ *		(E-4) TWF_ANDWã§ï¼ä¸é¨ã®ããããã»ããããã¦ãã¦ãä¸æç«ã«ãªããã¨
+ *	(F) wai_flgã§ã®TA_CLRå±æ§ã®ãã¹ãï¼»NGKI1637ï¼½
+ *		TA_CLRå±æ§ã®ã¤ãã³ããã©ã°ã§ãã¹ãããï¼ä»¥ä¸ã®åãã¿ã¼ã³ã§ï¼ãã
+ *		ããã¿ã¼ã³ã0ã«ã¯ãªã¢ããããã¨ã¨ï¼ããããã¿ã¼ã³ã®ç¾å¨å¤ã
+ *		*p_flgptnã«è¿ããã¨ãç¢ºèªãã
+ *		(F-1) TWF_ORWã§ï¼ããããã®ããããã»ããããã¦ããã°æç«ãããã¨
+ *		(F-2) TWF_ORWã§ï¼å¯¾è±¡å¤ã®ããããã»ããããã¦ãã¦ãä¸æç«ã«ãªããã¨
+ *		(F-3) TWF_ANDWã§ï¼ãã¹ã¦ã®ããããã»ããããã¦ããã°æç«ãããã¨
+ *		(F-4) TWF_ANDWã§ï¼ä¸é¨ã®ããããã»ããããã¦ãã¦ãä¸æç«ã«ãªããã¨
+ *	(G) è¤æ°ã¿ã¹ã¯å¾
+ã¡ã¨ã©ã¼ã®ãã¹ãï¼»NGKI1632ï¼½
+ *		TA_WMULå±æ§ã§ãªãã¤ãã³ããã©ã°ã§ãã¹ãããï¼ä»¥ä¸ã®åãã¿ã¼ã³ã§ï¼
+ *		å¾
+ã¡ã¿ã¹ã¯ããæã«ï¼wai_flgãå¼ã¶ã¨ã¨ã©ã¼ã«ãªããã¨ãç¢ºèªãã
+ *		(G-1) å¾
+ã¡è§£é¤æ¡ä»¶ãæç«ãã¦ããæ
+ *		(G-2) å¾
+ã¡è§£é¤æ¡ä»¶ãæç«ãã¦ããªãæ
+ *	(H) è¤æ°ã¿ã¹ã¯å¾
+ã¡ã®ãã¹ãï¼»NGKI1609ï¼½
+ *		TA_WMULå±æ§ï¼TA_CLRå±æ§ã§ï¼TA_TPRIå±æ§ã§ãªãã¤ãã³ããã©ã°ã§ã
+ *		ã¹ãããï¼
+ *		(H-1) è¤æ°ã®ã¿ã¹ã¯ãå¾
+ã¡ã«ãªãããã¨
+ *		(H-2) è¤æ°ã®ã¿ã¹ã¯ãFIFOé ã§å¾
+ã¡è§£é¤ããããã¨
+ *		(H-3) å¾
+ã¡è§£é¤æ¡ä»¶ã«ãã£ã¦ã¯ï¼FIFOé ã§å¾ãã®ã¿ã¹ã¯ã®ã¿ãå¾
+ã¡è§£
+ *			  é¤ããããã¨
+ *	(I) è¤æ°ã¿ã¹ã¯å¾
+ã¡ã®ãã¹ãï¼»NGKI1609ï¼½
+ *		TA_WMULå±æ§ï¼TA_CLRå±æ§ãã¤TA_TPRIå±æ§ã®ã¤ãã³ããã©ã°ã§ãã¹ã
+ *		ããï¼
+ *		(I-1) è¤æ°ã®ã¿ã¹ã¯ãå¾
+ã¡ã«ãªãããã¨
+ *		(I-2) è¤æ°ã®ã¿ã¹ã¯ãåªå
+åº¦é ã§å¾
+ã¡è§£é¤ããããã¨
+ *		(I-3) å¾
+ã¡è§£é¤æ¡ä»¶ã«ãã£ã¦ã¯ï¼åªå
+åº¦é ã§å¾ãã®ã¿ã¹ã¯ã®ã¿ãå¾
+ã¡
+ *			  è§£é¤ããããã¨
+ *	(J) ã¤ãã³ããã©ã°ã®ããããã¿ã¼ã³ã®åæå¤ãæ­£ããè¨­å®ãããï¼»NGKI1570ï¼½
+ *		(J-1) åæããããã¿ã¼ã³ã0x00
+ *		(J-2) åæããããã¿ã¼ã³ã0x01
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	TASK2: é«åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	TASK4: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK5: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *  FLG1:  TA_NULLå±æ§ï¼åæããããã¿ã¼ã³0x00
+ *  FLG2:  TA_CLRå±æ§ï¼åæããããã¿ã¼ã³0x01
+ *  FLG3:  TA_WMULå±æ§ï¼åæããããã¿ã¼ã³0x00
+ *  FLG4:  TA_WMUL|TA_TPRIå±æ§ï¼åæããããã¿ã¼ã³0x00
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *  1:	ref_flg(FLG1, &rflg)
+ *		assert(rflg.wtskid == TSK_NONE)
+ *		assert(rflg.flgptn == 0x00)									... (J-1)
+ *  	ref_flg(FLG2, &rflg)
+ *		assert(rflg.wtskid == TSK_NONE)
+ *		assert(rflg.flgptn == 0x01)									... (J-2)
+ *	2:	loc_cpu()
+ *		set_flg(FLG1, 0x01) -> E_CTX								... (A-1)
+ *		wai_flg(FLG1)
+ *		wai_flg(FLG1, 0x01, TWF_ORW, &flgptn) -> E_CTX				... (D-2)
+ *		unl_cpu()
+ *		dis_dsp()
+ *		wai_flg(FLG1, 0x01, TWF_ORW, &flgptn) -> E_CTX				... (D-3)
+ *		ena_dsp()
+ *		chg_ipm(TMAX_INTPRI)
+ *		wai_flg(FLG1, 0x01, TWF_ORW, &flgptn) -> E_CTX				... (D-4)
+ *		chg_ipm(TIPM_ENAALL)
+ *		set_flg(0, 0x01) -> E_ID									... (A-2)
+ *		wai_flg(0, 0x01, TWF_ORW, &flgptn) -> E_ID					... (D-5)
+ *		set_flg(TNUM_FLGID+1, 0x01) -> E_ID							... (A-3)
+ *		wai_flg(TNUM_FLGID+1, 0x01, TWF_ORW, &flgptn) -> E_ID		... (D-6)
+ *		wai_flg(FLG1, 0x00, TWF_ORW, &flgptn) -> E_PAR				... (D-7)
+ *		wai_flg(FLG1, 0x01, 0U, &flgptn) -> E_PAR					... (D-8)
+ *		wai_flg(FLG1, 0x01, (TWF_ORW|TWF_ANDW), &flgptn) -> E_PAR	... (D-9)
+ *		set_flg(FLG1, 0x00)											... (B-1)
+ *  	ref_flg(FLG1, &rflg)
+ *		assert(rflg.wtskid == TSK_NONE)
+ *		assert(rflg.flgptn == 0x00)
+ *		set_flg(FLG1, 0x01)											... (B-2)
+ *  	ref_flg(FLG1, &rflg)
+ *		assert(rflg.wtskid == TSK_NONE)
+ *		assert(rflg.flgptn == 0x01)
+ *		set_flg(FLG1, 0x01)											... (B-3)
+ *  	ref_flg(FLG1, &rflg)
+ *		assert(rflg.wtskid == TSK_NONE)
+ *		assert(rflg.flgptn == 0x01)
+ *		set_flg(FLG1, 0x02)											... (B-4)
+ *  	ref_flg(FLG1, &rflg)
+ *		assert(rflg.wtskid == TSK_NONE)
+ *		assert(rflg.flgptn == 0x03)
+ *		clr_flg(FLG1, ~0x01)
+ *		set_flg(FLG1, 0x03)											... (B-5)
+ *  	ref_flg(FLG1, &rflg)
+ *		assert(rflg.wtskid == TSK_NONE)
+ *		assert(rflg.flgptn == 0x03)
+ *	3:	act_tsk(TASK2)
+ *	== TASK2ï¼åªå
+åº¦ï¼é«ï¼==
+ *	4:	wai_flg(FLG1, 0x05, TWF_ORW, &flgptn)						... (E-1)
+ *		assert(flgptn == 0x03)
+ *	5:	wai_flg(FLG1, 0x04, TWF_ORW, &flgptn)						... (E-2)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	6:	set_flg(FLG1, 0x04)											... (C-1)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	7:	assert(flgptn == 0x07)
+ *		wai_flg(FLG1, 0x03, TWF_ANDW, &flgptn)						... (E-3)
+ *		assert(flgptn == 0x07)
+ *	8:	wai_flg(FLG1, 0x0c, TWF_ANDW, &flgptn)						... (E-4)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	9:	dis_dsp()
+ *		set_flg(FLG1, 0x08)											... (C-2)
+ *  	ref_flg(FLG1, &rflg)
+ *		assert(rflg.wtskid == TSK_NONE)
+ *		assert(rflg.flgptn == 0x0f)
+ *	10:	ena_dsp()
+ *	== TASK2ï¼ç¶ãï¼==
+ *	11:	assert(flgptn == 0x0f)
+ *		wai_flg(FLG2, 0x05, TWF_ORW, &flgptn)						... (F-1)
+ *		assert(flgptn == 0x01)
+ *  	ref_flg(FLG2, &rflg)
+ *		assert(rflg.wtskid == TSK_NONE)
+ *		assert(rflg.flgptn == 0x00)
+ *		set_flg(FLG2, 0x01)
+ *	12:	wai_flg(FLG2, 0x04, TWF_ORW, &flgptn)						... (F-2)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	13:	chg_ipm(TMAX_INTPRI)
+ *		set_flg(FLG2, 0x04)											... (C-2)
+ *  	ref_flg(FLG2, &rflg)
+ *		assert(rflg.wtskid == TSK_NONE)
+ *		assert(rflg.flgptn == 0x00)
+ *	14:	chg_ipm(TIPM_ENAALL)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	15:	assert(flgptn == 0x05)
+ *  	ref_flg(FLG2, &rflg)
+ *		assert(rflg.wtskid == TSK_NONE)
+ *		assert(rflg.flgptn == 0x00)
+ *		set_flg(FLG2, 0x03)
+ *		wai_flg(FLG2, 0x03, TWF_ANDW, &flgptn)						... (F-3)
+ *		assert(flgptn == 0x03)
+ *  	ref_flg(FLG2, &rflg)
+ *		assert(rflg.wtskid == TSK_NONE)
+ *		assert(rflg.flgptn == 0x00)
+ *		set_flg(FLG2, 0x03)
+ *	16:	wai_flg(FLG2, 0x05, TWF_ANDW, &flgptn)						... (F-4)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	17:	sus_tsk(TASK2)
+ *		set_flg(FLG2, 0x04)											... (C-3)
+ *  	ref_flg(FLG2, &rflg)
+ *		assert(rflg.wtskid == TSK_NONE)
+ *		assert(rflg.flgptn == 0x00)
+ *	18:	rsm_tsk(TASK2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	19:	assert(flgptn == 0x07)
+ *	20:	wai_flg(FLG2, 0x01, TWF_ORW, &flgptn)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	21:	wai_flg(FLG2, 0x02, TWF_ORW, &flgptn) -> E_ILUSE			... (G-2)
+ *		set_flg(FLG2, 0x02)
+ *		wai_flg(FLG2, 0x02, TWF_ORW, &flgptn) -> E_ILUSE			... (G-1)
+ *	22:	set_flg(FLG2, 0x01)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	23:	assert(flgptn == 0x03)
+ *		act_tsk(TASK3)
+ *	24:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	25:	wai_flg(FLG3, 0x01, TWF_ORW, &flgptn)
+ *	== TASK3ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	26:	wup_tsk(TASK2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	27:	wai_flg(FLG3, 0x02, TWF_ORW, &flgptn)						... (H-1)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	28: set_flg(FLG3, 0x02)											... (H-3)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	29:	wai_flg(FLG3, 0x02, TWF_ORW, &flgptn)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	30: set_flg(FLG3, 0x03)											... (H-2)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	31:	wai_flg(FLG4, 0x01, TWF_ORW, &flgptn)
+ *	== TASK3ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	32: set_flg(FLG3, 0x03)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	33:	wai_flg(FLG4, 0x02, TWF_ORW, &flgptn)						... (I-1)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	34: set_flg(FLG4, 0x03)											... (I-2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	35:	wai_flg(FLG4, 0x02, TWF_ORW, &flgptn)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	36: set_flg(FLG4, 0x01)											... (I-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	37:	clr_flg(FLG3, 0)
+ *		sta_alm(ALM1, 10000U)
+ *	38:	wai_flg(FLG3, 0x01, TWF_ORW, &flgptn)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	39:	wai_flg(FLG3, 0x02, TWF_ORW, &flgptn)
+ *	== ALM1 ==
+ *	40:	wai_flg(FLG1, 0x01, TWF_ORW, &flgptn) -> E_CTX				... (D-1)
+ *		set_flg(FLG3, 0x01)
+ *	41:	RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	42:	set_flg(FLG3, 0x02)											... (C-4)
+ *	43:	slp_tsk()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	44:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_sem1.h"
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	FLGPTN	flgptn;
+
+	check_point(40);
+	ercd = wai_flg(FLG1, 0x01, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_CTX);
+
+	ercd = set_flg(FLG3, 0x01);
+	check_ercd(ercd, E_OK);
+
+	check_point(41);
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RFLG	rflg;
+	FLGPTN	flgptn;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	ercd = ref_flg(FLG1, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.wtskid == TSK_NONE);
+
+	check_assert(rflg.flgptn == 0x00);
+
+	ercd = ref_flg(FLG2, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.wtskid == TSK_NONE);
+
+	check_assert(rflg.flgptn == 0x01);
+
+	check_point(2);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	ercd = set_flg(FLG1, 0x01);
+	check_ercd(ercd, E_CTX);
+
+	ercd = wai_flg(FLG1, 0x01, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_CTX);
+
+	ercd = unl_cpu();
+	check_ercd(ercd, E_OK);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	ercd = wai_flg(FLG1, 0x01, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_CTX);
+
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	ercd = chg_ipm(TMAX_INTPRI);
+	check_ercd(ercd, E_OK);
+
+	ercd = wai_flg(FLG1, 0x01, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_CTX);
+
+	ercd = chg_ipm(TIPM_ENAALL);
+	check_ercd(ercd, E_OK);
+
+	ercd = set_flg(0, 0x01);
+	check_ercd(ercd, E_ID);
+
+	ercd = wai_flg(0, 0x01, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_ID);
+
+	ercd = set_flg(TNUM_FLGID+1, 0x01);
+	check_ercd(ercd, E_ID);
+
+	ercd = wai_flg(TNUM_FLGID+1, 0x01, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_ID);
+
+	ercd = wai_flg(FLG1, 0x00, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_PAR);
+
+	ercd = wai_flg(FLG1, 0x01, 0U, &flgptn);
+	check_ercd(ercd, E_PAR);
+
+	ercd = wai_flg(FLG1, 0x01, (TWF_ORW|TWF_ANDW), &flgptn);
+	check_ercd(ercd, E_PAR);
+
+	ercd = set_flg(FLG1, 0x00);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_flg(FLG1, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.wtskid == TSK_NONE);
+
+	check_assert(rflg.flgptn == 0x00);
+
+	ercd = set_flg(FLG1, 0x01);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_flg(FLG1, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.wtskid == TSK_NONE);
+
+	check_assert(rflg.flgptn == 0x01);
+
+	ercd = set_flg(FLG1, 0x01);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_flg(FLG1, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.wtskid == TSK_NONE);
+
+	check_assert(rflg.flgptn == 0x01);
+
+	ercd = set_flg(FLG1, 0x02);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_flg(FLG1, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.wtskid == TSK_NONE);
+
+	check_assert(rflg.flgptn == 0x03);
+
+	ercd = clr_flg(FLG1, ~0x01);
+	check_ercd(ercd, E_OK);
+
+	ercd = set_flg(FLG1, 0x03);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_flg(FLG1, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.wtskid == TSK_NONE);
+
+	check_assert(rflg.flgptn == 0x03);
+
+	check_point(3);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(6);
+	ercd = set_flg(FLG1, 0x04);
+	check_ercd(ercd, E_OK);
+
+	check_point(9);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	ercd = set_flg(FLG1, 0x08);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_flg(FLG1, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.wtskid == TSK_NONE);
+
+	check_assert(rflg.flgptn == 0x0f);
+
+	check_point(10);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	ercd = chg_ipm(TMAX_INTPRI);
+	check_ercd(ercd, E_OK);
+
+	ercd = set_flg(FLG2, 0x04);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_flg(FLG2, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.wtskid == TSK_NONE);
+
+	check_assert(rflg.flgptn == 0x00);
+
+	check_point(14);
+	ercd = chg_ipm(TIPM_ENAALL);
+	check_ercd(ercd, E_OK);
+
+	check_point(17);
+	ercd = sus_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = set_flg(FLG2, 0x04);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_flg(FLG2, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.wtskid == TSK_NONE);
+
+	check_assert(rflg.flgptn == 0x00);
+
+	check_point(18);
+	ercd = rsm_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(21);
+	ercd = wai_flg(FLG2, 0x02, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_ILUSE);
+
+	ercd = set_flg(FLG2, 0x02);
+	check_ercd(ercd, E_OK);
+
+	ercd = wai_flg(FLG2, 0x02, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_ILUSE);
+
+	check_point(22);
+	ercd = set_flg(FLG2, 0x01);
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	ercd = wai_flg(FLG3, 0x01, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(31);
+	ercd = wai_flg(FLG4, 0x01, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(37);
+	ercd = clr_flg(FLG3, 0);
+	check_ercd(ercd, E_OK);
+
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(38);
+	ercd = wai_flg(FLG3, 0x01, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(42);
+	ercd = set_flg(FLG3, 0x02);
+	check_ercd(ercd, E_OK);
+
+	check_point(43);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	FLGPTN	flgptn;
+	T_RFLG	rflg;
+
+	check_point(4);
+	ercd = wai_flg(FLG1, 0x05, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_assert(flgptn == 0x03);
+
+	check_point(5);
+	ercd = wai_flg(FLG1, 0x04, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(7);
+	check_assert(flgptn == 0x07);
+
+	ercd = wai_flg(FLG1, 0x03, TWF_ANDW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_assert(flgptn == 0x07);
+
+	check_point(8);
+	ercd = wai_flg(FLG1, 0x0c, TWF_ANDW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	check_assert(flgptn == 0x0f);
+
+	ercd = wai_flg(FLG2, 0x05, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_assert(flgptn == 0x01);
+
+	ercd = ref_flg(FLG2, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.wtskid == TSK_NONE);
+
+	check_assert(rflg.flgptn == 0x00);
+
+	ercd = set_flg(FLG2, 0x01);
+	check_ercd(ercd, E_OK);
+
+	check_point(12);
+	ercd = wai_flg(FLG2, 0x04, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(15);
+	check_assert(flgptn == 0x05);
+
+	ercd = ref_flg(FLG2, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.wtskid == TSK_NONE);
+
+	check_assert(rflg.flgptn == 0x00);
+
+	ercd = set_flg(FLG2, 0x03);
+	check_ercd(ercd, E_OK);
+
+	ercd = wai_flg(FLG2, 0x03, TWF_ANDW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_assert(flgptn == 0x03);
+
+	ercd = ref_flg(FLG2, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.wtskid == TSK_NONE);
+
+	check_assert(rflg.flgptn == 0x00);
+
+	ercd = set_flg(FLG2, 0x03);
+	check_ercd(ercd, E_OK);
+
+	check_point(16);
+	ercd = wai_flg(FLG2, 0x05, TWF_ANDW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(19);
+	check_assert(flgptn == 0x07);
+
+	check_point(20);
+	ercd = wai_flg(FLG2, 0x01, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(23);
+	check_assert(flgptn == 0x03);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(24);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(27);
+	ercd = wai_flg(FLG3, 0x02, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(29);
+	ercd = wai_flg(FLG3, 0x02, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(33);
+	ercd = wai_flg(FLG4, 0x02, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(35);
+	ercd = wai_flg(FLG4, 0x02, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	FLGPTN	flgptn;
+
+	check_point(26);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(28);
+	ercd = set_flg(FLG3, 0x02);
+	check_ercd(ercd, E_OK);
+
+	check_point(30);
+	ercd = set_flg(FLG3, 0x03);
+	check_ercd(ercd, E_OK);
+
+	check_point(32);
+	ercd = set_flg(FLG3, 0x03);
+	check_ercd(ercd, E_OK);
+
+	check_point(34);
+	ercd = set_flg(FLG4, 0x03);
+	check_ercd(ercd, E_OK);
+
+	check_point(36);
+	ercd = set_flg(FLG4, 0x01);
+	check_ercd(ercd, E_OK);
+
+	check_point(39);
+	ercd = wai_flg(FLG3, 0x02, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_finish(44);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_flg1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_flg1.cfg	(revision 304)
+++ asp3_wo_tecs/trunk/test/test_flg1.cfg	(revision 304)
@@ -0,0 +1,19 @@
+/*
+ *		ã¤ãã³ããã©ã°æ©è½ã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: test_flg1.cfg 579 2016-02-03 07:29:11Z ertl-hiro $
+ */
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_flg1.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
+CRE_FLG(FLG1, { TA_NULL, 0x00 });
+CRE_FLG(FLG2, { TA_CLR, 0x01 });
+CRE_FLG(FLG3, { TA_WMUL|TA_CLR, 0x00 });
+CRE_FLG(FLG4, { TA_WMUL|TA_TPRI|TA_CLR, 0x00 });
Index: asp3_wo_tecs/trunk/test/test_flg1.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_flg1.h	(revision 304)
+++ asp3_wo_tecs/trunk/test/test_flg1.h	(revision 304)
@@ -0,0 +1,94 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2008-2014 by Embedded and Real-Time Systems Laboratory
+ *              Graduate School of Information Science, Nagoya Univ., JAPAN
+ * 
+ *  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+ *  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+ *  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+ *  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+ *      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+ *      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+ *  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+ *      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+ *      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+ *      ã¨ï¼
+ *    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+ *        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+ *        å ±åãããã¨ï¼
+ *  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+ *      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+ *      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+ *      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+ *      å
+è²¬ãããã¨ï¼
+ * 
+ *  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+ *  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+ *  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+ *  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+ *  ã®è²¬ä»»ãè² ããªãï¼
+ * 
+ *  $Id: test_flg1.h 579 2016-02-03 07:29:11Z ertl-hiro $
+ */
+
+/* 
+ *		ã»ããã©æ©è½ã®ãã¹ã(1)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åªå
+åº¦ã®å®ç¾©
+ */
+#define HIGH_PRIORITY	9		/* é«åªå
+åº¦ */
+#define MID_PRIORITY	10		/* ä¸­åªå
+åº¦ */
+#define LOW_PRIORITY	11		/* ä½åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#ifndef STACK_SIZE
+#define	STACK_SIZE		4096		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãº */
+#endif /* STACK_SIZE */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+extern void	task1(intptr_t exinf);
+extern void	task2(intptr_t exinf);
+extern void	task3(intptr_t exinf);
+extern void	alarm1_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_hrt1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_hrt1.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_hrt1.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_hrt1.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_mutex1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex1.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_mutex1.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_mutex1.cfg 263 2014-10-05 13:30:34Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_mutex2.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex2.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_mutex2.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_mutex2.cfg 263 2014-10-05 13:30:34Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_mutex3.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex3.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_mutex3.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_mutex3.cfg 263 2014-10-05 13:30:34Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_mutex4.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex4.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_mutex4.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_mutex4.cfg 263 2014-10-05 13:30:34Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_mutex5.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex5.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_mutex5.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_mutex5.cfg 263 2014-10-05 13:30:34Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_mutex6.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex6.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_mutex6.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_mutex6.cfg 263 2014-10-05 13:30:34Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_mutex7.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex7.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_mutex7.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_mutex7.cfg 263 2014-10-05 13:30:34Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_mutex8.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex8.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_mutex8.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_mutex8.cfg 263 2014-10-05 13:30:34Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_notify1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_notify1.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_notify1.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_notify1.cfg 463 2015-10-18 14:25:55Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_raster1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_raster1.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_raster1.cfg	(revision 304)
@@ -5,5 +5,4 @@
  *  $Id: test_raster1.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_raster2.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_raster2.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_raster2.cfg	(revision 304)
@@ -5,5 +5,4 @@
  *  $Id: test_raster2.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_sem1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_sem1.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_sem1.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_sem1.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_sem2.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_sem2.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_sem2.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_sem2.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_sysman1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_sysman1.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_sysman1.cfg	(revision 304)
@@ -6,5 +6,4 @@
  *  $Id: test_sysman1.cfg 263 2014-10-05 13:30:34Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_sysstat1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_sysstat1.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_sysstat1.cfg	(revision 304)
@@ -5,5 +5,4 @@
  *  $Id: test_sysstat1.cfg 263 2014-10-05 13:30:34Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_task1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_task1.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_task1.cfg	(revision 304)
@@ -4,5 +4,4 @@
  *  $Id: test_task1.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/test/test_tmevt1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_tmevt1.cfg	(revision 303)
+++ asp3_wo_tecs/trunk/test/test_tmevt1.cfg	(revision 304)
@@ -5,5 +5,4 @@
  *  $Id: test_tmevt1.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
  */
-INCLUDE("target_timer.cfg");
 INCLUDE("syssvc/syslog.cfg");
 INCLUDE("syssvc/banner.cfg");
Index: asp3_wo_tecs/trunk/utils/applyrename
===================================================================
--- asp3_wo_tecs/trunk/utils/applyrename	(revision 303)
+++ 	(revision )
@@ -1,134 +1,0 @@
-#! /usr/bin/perl
-#
-#  TOPPERS Software
-#      Toyohashi Open Platform for Embedded Real-Time Systems
-# 
-#  Copyright (C) 2003 by Embedded and Real-Time Systems Laboratory
-#                              Toyohashi Univ. of Technology, JAPAN
-#  Copyright (C) 2004-2011 by Embedded and Real-Time Systems Laboratory
-#              Graduate School of Information Science, Nagoya Univ., JAPAN
-# 
-#  ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-#  å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-#      ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-#      è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-#      ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-#      ã¨ï¼
-#    (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-#    (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-#        å ±åãããã¨ï¼
-#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-#      å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-#      å
-è²¬ãããã¨ï¼
-# 
-#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-#  ã®è²¬ä»»ãè² ããªãï¼
-# 
-#  $Id: applyrename 108 2014-05-11 01:30:18Z ertl-hiro $
-# 
-
-#
-#  ãã¡ã¤ã«ã«ãªãã¼ã ãé©ç¨ãã
-#
-sub applyrename
-{
-	local($infile) = @_;
-	local($outfile) = $infile.".new";
-	local($line);
-
-	open(INFILE, "< ".$infile) || die;
-	open(OUTFILE, "> ".$outfile) || die;
-
-	while ($line = <INFILE>) {
-		$line =~ s/\b(_?)($syms)\b/$1_kernel_$2/gc;
-		print OUTFILE $line;
-	}
-
-	close(INFILE);
-	close(OUTFILE);
-
-	if (`cmp $infile $outfile`) {
-		rename($infile, $infile.".bak");
-		rename($outfile, $infile);
-		print STDERR "Modified: ",$infile,"\n";
-	}
-	else {
-		unlink($outfile);
-	}
-}
-
-#
-#  ã¨ã©ã¼ãã§ãã¯
-#
-if ($#ARGV < 1) {
-	die "Usage: appyrename <prefix> <filelist>\n";
-}
-
-#
-#  åæå
-#
-@syms = ();
-$name = $ARGV[0];
-
-#
-#  ã·ã³ãã«ãªã¹ããèª­ã¿è¾¼ã
-#
-$deffile = $name."_rename.def";
-open(INFILE, $deffile) || die "Cannot open $deffile";
-while ($line = <INFILE>) {
-	chomp $line;
-	if ($line =~ /^#(.*)$/) {
-		# do nothing
-	}
-	elsif ($line =~ /^INCLUDE[ \t]+(.*)$/) {
-		# do nothing
-	}
-	elsif ($line ne "") {
-		@syms = (@syms, $line)
-	}
-}
-close(INFILE);
-
-#
-#  æ­£è¦è¡¨ç¾ãä½ã
-#
-$syms = join("|", @syms);
-
-#
-#  ãã¡ã¤ã«ã«ãªãã¼ã ãé©ç¨ãã
-#
-shift @ARGV;
-foreach $infile (@ARGV) {
-	# ãã¡ã¤ã«ã§ãªããã°ã¹ã­ãã
-	next unless (-f $infile);
-
-	applyrename($infile) if ($infile ne $deffile);
-}
Index: asp3_wo_tecs/trunk/utils/applyrename.rb
===================================================================
--- asp3_wo_tecs/trunk/utils/applyrename.rb	(revision 304)
+++ asp3_wo_tecs/trunk/utils/applyrename.rb	(revision 304)
@@ -0,0 +1,138 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+#
+#  TOPPERS Software
+#      Toyohashi Open Platform for Embedded Real-Time Systems
+# 
+#  Copyright (C) 2003 by Embedded and Real-Time Systems Laboratory
+#                              Toyohashi Univ. of Technology, JAPAN
+#  Copyright (C) 2004-2016 by Embedded and Real-Time Systems Laboratory
+#              Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#      ã¨ï¼
+#    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#        å ±åãããã¨ï¼
+#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#      å
+è²¬ãããã¨ï¼
+# 
+#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#  ã®è²¬ä»»ãè² ããªãï¼
+# 
+#  $Id: applyrename.rb 562 2016-01-21 14:24:34Z ertl-hiro $
+# 
+
+require "fileutils"
+
+#
+#  ãã¡ã¤ã«ã«ãªãã¼ã ãé©ç¨ãã
+#
+def applyRename(inFileName, syms)
+  symsRegexp = syms.join("|")
+  outFileName = inFileName + ".new"
+
+  begin
+    inFile = File.open(inFileName)
+    outFile = File.open(outFileName, "w")
+  rescue Errno::ENOENT, Errno::EACCES => ex
+    abort(ex.message)
+  end
+
+  inFile.each do |line|
+    line.gsub!(/\b(_?)(#{symsRegexp})\b/, "\\1_kernel_\\2")
+    outFile.print line
+  end
+
+  inFile.close
+  outFile.close
+
+  if FileUtils.cmp(inFileName, outFileName)
+    # ãã¡ã¤ã«ã®å
+å®¹ãå¤åããªãã£ãå ´å
+    FileUtils.remove(outFileName)
+  else
+    # ãã¡ã¤ã«ã®å
+å®¹ãå¤åããå ´å
+    FileUtils.move(inFileName, inFileName + ".bak")
+    FileUtils.move(outFileName, inFileName)
+    puts("Modified: #{inFileName}")
+  end
+end
+
+#
+#  ã¨ã©ã¼ãã§ãã¯
+#
+if ARGV.length < 1
+  abort("Usage: ruby appyrename.rb <prefix> <filelists>")
+end
+
+#
+#  åæå
+#
+syms = []
+name = ARGV.shift
+
+#
+#  ã·ã³ãã«ãªã¹ããèª­ã¿è¾¼ã
+#
+defFileName = name + "_rename.def"
+
+begin
+  defFile = File.open(defFileName)
+rescue Errno::ENOENT, Errno::EACCES => ex
+  abort(ex.message)
+end
+
+defFile.each do |line|
+  line.chomp!
+  if /^#\s*(.*)$/ =~ line
+    # do nothing
+  elsif /^INCLUDE\s+(.*)$/ =~ line
+    # do nothing
+  elsif line != ""
+    syms.push(line)
+  end
+end
+
+#
+#  ãã¡ã¤ã«ã«ãªãã¼ã ãé©ç¨ãã
+#
+ARGV.each do |inFileName|
+  if inFileName != defFileName && File.readable?(inFileName)
+    applyRename(inFileName, syms)
+  end
+end
Index: asp3_wo_tecs/trunk/utils/genrename
===================================================================
--- asp3_wo_tecs/trunk/utils/genrename	(revision 303)
+++ 	(revision )
@@ -1,265 +1,0 @@
-#! /usr/bin/perl
-#
-#  TOPPERS Software
-#      Toyohashi Open Platform for Embedded Real-Time Systems
-# 
-#  Copyright (C) 2003 by Embedded and Real-Time Systems Laboratory
-#                              Toyohashi Univ. of Technology, JAPAN
-#  Copyright (C) 2005-2011 by Embedded and Real-Time Systems Laboratory
-#              Graduate School of Information Science, Nagoya Univ., JAPAN
-# 
-#  ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-#  å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-#      ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-#      è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-#      ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-#      ã¨ï¼
-#    (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-#    (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-#        å ±åãããã¨ï¼
-#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-#      å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-#      å
-è²¬ãããã¨ï¼
-# 
-#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-#  ã®è²¬ä»»ãè² ããªãï¼
-# 
-#  $Id: genrename 108 2014-05-11 01:30:18Z ertl-hiro $
-# 
-
-#
-#  å
-é ­ã«ã¤ããæå­å
-#
-sub prefix_string {
-	local($sym) = @_;
-
-	if ($sym =~ /[a-z]/) {
-		return("_kernel_");
-	}
-	else {
-		return("_KERNEL_");
-	}
-}
-
-#
-#  ãªãã¼ã å®ç¾©ãçæãã
-#
-sub generate_define
-{
-	local($sym, $prefix) = @_;
-
-	print FILE "#define ",$prefix,$sym;
-	print FILE "\t" if (length($prefix.$sym) < 4);
-	print FILE "\t" if (length($prefix.$sym) < 8);
-	print FILE "\t" if (length($prefix.$sym) < 12);
-	print FILE "\t" if (length($prefix.$sym) < 16);
-	print FILE "\t" if (length($prefix.$sym) < 20);
-	print FILE "\t" if (length($prefix.$sym) < 24);
-	print FILE "\t",$prefix,prefix_string($sym),$sym,"\n";
-}
-
-#
-#  ãªãã¼ã è§£é¤ãçæãã
-#
-sub generate_undef
-{
-	local($sym, $prefix) = @_;
-
-	print FILE "#undef ",$prefix,$sym,"\n";
-}
-
-#
-#  ã¤ã³ã¯ã«ã¼ããã£ã¬ã¯ãã£ããçæãã
-#
-sub generate_include
-{
-	local($file, $prefix) = @_;
-
-	$file =~ s/([>"])$/_$prefix.h$1/;
-	$includes .= "#include ".$file."\n";
-}
-
-#
-#  ã¨ã©ã¼ãã§ãã¯
-#
-if ($#ARGV != 0) {
-	die "Usage: genrename <prefix>\n";
-}
-
-#
-#  åæå
-#
-@syms = ();
-$name = $ARGV[0];
-$NAME = $name; $NAME =~ y/a-z/A-Z/;
-
-$infile = $name."_rename.def";
-$header_defsym = "TOPPERS_".$NAME."_RENAME_H";
-
-#
-#  ã·ã³ãã«ãªã¹ããèª­ã¿è¾¼ã
-#
-open(INFILE, $infile) || die "Cannot open $infile";
-while ($line = <INFILE>) {
-	chomp $line;
-	@syms = (@syms, $line);
-}
-close(INFILE);
-
-#
-#  ???_rename.h ãçæãã
-#
-$includes = "";
-$file = $name."_rename.h";
-open(FILE, "> ".$file);
-
-print FILE <<END;
-/* This file is generated from $infile by genrename. */
-
-#ifndef $header_defsym
-#define $header_defsym
-
-END
-
-foreach $sym (@syms) {
-	if ($sym =~ /^#(.*)$/) {
-		print FILE "/*\n";
-		print FILE " * ",$1,"\n";
-		print FILE " */\n";
-	}
-	elsif ($sym =~ /^INCLUDE[ \t]+(.*)$/) {
-		generate_include($1, "rename");
-	}
-	elsif ($sym ne "") {
-		generate_define($sym, "");
-	}
-	else {
-		print FILE "\n";
-	}
-}
-
-print FILE <<END;
-
-#ifdef TOPPERS_LABEL_ASM
-
-END
-
-foreach $sym (@syms) {
-	if ($sym =~ /^#(.*)$/) {
-		print FILE "/*\n";
-		print FILE " * ",$1,"\n";
-		print FILE " */\n";
-	}
-	elsif ($sym =~ /^INCLUDE[ \t]+(.*)$/) {
-		# do nothing
-	}
-	elsif ($sym ne "") {
-		generate_define($sym, "_");
-	}
-	else {
-		print FILE "\n";
-	}
-}
-
-print FILE <<END;
-
-#endif /* TOPPERS_LABEL_ASM */
-
-$includes
-#endif /* $header_defsym */
-END
-
-#
-#  ???_unrename.h ãçæãã
-#
-$includes = "";
-$file = $name."_unrename.h";
-open(FILE, "> ".$file);
-
-print FILE <<END;
-/* This file is generated from $infile by genrename. */
-
-/* This file is included only when $name\_rename.h has been included. */
-#ifdef $header_defsym
-#undef $header_defsym
-
-END
-
-foreach $sym (@syms) {
-	if ($sym =~ /^#(.*)$/) {
-		print FILE "/*\n";
-		print FILE " * ",$1,"\n";
-		print FILE " */\n";
-	}
-	elsif ($sym =~ /^INCLUDE[ \t]+(.*)$/) {
-		generate_include($1, "unrename");
-	}
-	elsif ($sym ne "") {
-		generate_undef($sym, "");
-	}
-	else {
-		print FILE "\n";
-	}
-}
-
-print FILE <<END;
-
-#ifdef TOPPERS_LABEL_ASM
-
-END
-
-foreach $sym (@syms) {
-	if ($sym =~ /^#(.*)$/) {
-		print FILE "/*\n";
-		print FILE " * ",$1,"\n";
-		print FILE " */\n";
-	}
-	elsif ($sym =~ /^INCLUDE[ \t]+(.*)$/) {
-		# do nothing
-	}
-	elsif ($sym ne "") {
-		generate_undef($sym, "_");
-	}
-	else {
-		print FILE "\n";
-	}
-}
-
-print FILE <<END;
-
-#endif /* TOPPERS_LABEL_ASM */
-
-$includes
-#endif /* $header_defsym */
-END
-
-close(FILE);
Index: asp3_wo_tecs/trunk/utils/genrename.rb
===================================================================
--- asp3_wo_tecs/trunk/utils/genrename.rb	(revision 304)
+++ asp3_wo_tecs/trunk/utils/genrename.rb	(revision 304)
@@ -0,0 +1,199 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+#
+#  TOPPERS Software
+#      Toyohashi Open Platform for Embedded Real-Time Systems
+# 
+#  Copyright (C) 2003 by Embedded and Real-Time Systems Laboratory
+#                              Toyohashi Univ. of Technology, JAPAN
+#  Copyright (C) 2005-2016 by Embedded and Real-Time Systems Laboratory
+#              Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#      ã¨ï¼
+#    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#        å ±åãããã¨ï¼
+#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#      å
+è²¬ãããã¨ï¼
+# 
+#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#  ã®è²¬ä»»ãè² ããªãï¼
+# 
+#  $Id: genrename.rb 566 2016-01-29 16:55:57Z ertl-hiro $
+# 
+
+#
+#  å
+é ­ã«ã¤ããæå­å
+#
+def prefixString(sym)
+  if sym =~ /[a-z]/
+    return("_kernel_")
+  else
+    return("_KERNEL_")
+  end
+end
+
+#
+#  ãªãã¼ã å®ç¾©ãçæãã
+#
+def generateDefine(outFile, sym, prefix)
+  outFile.print("#define #{prefix}#{sym}");
+  outFile.print("\t" * [(6 - (sym.length + prefix.length) / 4), 0].max);
+  outFile.print("\t#{prefix}#{prefixString(sym)}#{sym}\n");
+end
+
+#
+#  ãªãã¼ã è§£é¤ãçæãã
+#
+def generateUndef(outFile, sym, prefix)
+  outFile.print("#undef #{prefix}#{sym}\n");
+end
+
+#
+#  ã³ã¡ã³ããçæãã
+#
+def generateComment(outFile, comment)
+  outFile.print("/*\n")
+  outFile.print(" *  #{comment}\n")
+  outFile.print(" */\n")
+end
+
+#
+#  ã¨ã©ã¼ãã§ãã¯
+#
+if ARGV.length < 1
+  abort("Usage: ruby genrename.rb <prefix>")
+end
+
+#
+#  åæå
+#
+syms = []
+name = ARGV.shift
+NAME = name.upcase
+
+inFileName = name + "_rename.def"
+headerDefineSymbol = "TOPPERS_" + NAME + "_RENAME_H"
+
+#
+#  ã·ã³ãã«ãªã¹ããèª­ã¿è¾¼ã
+#
+begin
+  inFile = File.open(inFileName)
+rescue Errno::ENOENT, Errno::EACCES => ex
+  abort(ex.message)
+end
+
+inFile.each do |line|
+  syms.push(line.chomp)
+end
+
+#
+#  ???_rename.h ãçæãã
+#
+begin
+  outFile = File.open(name + "_rename.h", "w")
+rescue Errno::ENOENT, Errno::EACCES => ex
+  abort(ex.message)
+end
+
+outFile.print <<EOS
+/* This file is generated from #{inFileName} by genrename. */
+
+#ifndef #{headerDefineSymbol}
+#define #{headerDefineSymbol}
+
+EOS
+
+includes = ""
+syms.each do |sym|
+  if /^#\s*(.*)$/ =~ sym
+    generateComment(outFile, $1)
+  elsif /^INCLUDE\s+(.*)$/ =~ sym
+    fileName = $1.sub(/([>"])$/, "_rename.h\\1")
+    includes += "#include #{fileName}\n"
+  elsif sym != ""
+    generateDefine(outFile, sym, "")
+  else
+    outFile.print("\n")
+  end
+end
+
+outFile.print <<EOS
+
+#{includes}
+#endif /* #{headerDefineSymbol} */
+EOS
+
+#
+#  ???_unrename.h ãçæãã
+#
+begin
+  outFile = File.open(name + "_unrename.h", "w")
+rescue Errno::ENOENT, Errno::EACCES => ex
+  abort(ex.message)
+end
+
+outFile.print <<EOS
+/* This file is generated from #{inFileName} by genrename. */
+
+/* This file is included only when #{name}_rename.h has been included. */
+#ifdef #{headerDefineSymbol}
+#undef #{headerDefineSymbol}
+
+EOS
+
+includes = ""
+syms.each do |sym|
+  if /^#\s*(.*)$/ =~ sym
+    generateComment(outFile, $1)
+  elsif /^INCLUDE\s+(.*)$/ =~ sym
+    fileName = $1.sub(/([>"])$/, "_unrename.h\\1")
+    includes += "#include #{fileName}\n"
+  elsif sym != ""
+    generateUndef(outFile, sym, "")
+  else
+    outFile.print("\n")
+  end
+end
+
+outFile.print <<EOS
+
+#{includes}
+#endif /* #{headerDefineSymbol} */
+EOS
Index: asp3_wo_tecs/trunk/utils/gentest
===================================================================
--- asp3_wo_tecs/trunk/utils/gentest	(revision 303)
+++ 	(revision )
@@ -1,494 +1,0 @@
-#! /usr/bin/perl
-#
-#  TOPPERS Software
-#      Toyohashi Open Platform for Embedded Real-Time Systems
-# 
-#  Copyright (C) 2007-2015 by Embedded and Real-Time Systems Laboratory
-#              Graduate School of Information Science, Nagoya Univ., JAPAN
-# 
-#  ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-#  å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-#      ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-#      è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-#      ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-#      ã¨ï¼
-#    (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-#    (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-#        å ±åãããã¨ï¼
-#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-#      å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-#      å
-è²¬ãããã¨ï¼
-# 
-#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-#  ã®è²¬ä»»ãè² ããªãï¼
-# 
-#  $Id: gentest 336 2015-06-28 08:26:10Z ertl-hiro $
-# 
-
-#
-#		ãã¹ããã­ã°ã©ã çæãã¼ã«
-#
-
-$infile = $ARGV[0];
-
-%parampos = (
-	"get_tst" => 2,
-	"get_pri" => 2,
-	"get_inf" => 1,
-	"ref_tsk" => 2,
-	"ref_sem" => 2,
-	"ref_flg" => 2,
-	"ref_dtq" => 2,
-	"ref_pdq" => 2,
-	"ref_mtx" => 2,
-	"ref_mbf" => 2,
-	"ref_mpf" => 2,
-	"get_tim" => 1,
-	"ref_cyc" => 2,
-	"ref_alm" => 2,
-	"ref_ovr" => 2,
-	"get_tid" => 1,
-	"iget_tid" => 1,
-	"get_lod" => 2,
-	"get_nth" => 3,
-	"get_ipm" => 1,
-	"wai_flg" => 4,
-	"pol_flg" => 4,
-	"twai_flg" => 4,
-	"rcv_dtq" => 2,
-	"prcv_dtq" => 2,
-	"trcv_dtq" => 2,
-);
-
-%paramtype = (
-	"get_tst" => "STAT",
-	"get_pri" => "PRI",
-	"get_inf" => "intptr_t",
-	"ref_tsk" => "T_RTSK",
-	"ref_sem" => "T_RSEM",
-	"ref_flg" => "T_RFLG",
-	"ref_dtq" => "T_RDTQ",
-	"ref_pdq" => "T_RPDQ",
-	"ref_mtx" => "T_RMTX",
-	"ref_mbf" => "T_RMBF",
-	"ref_mpf" => "T_RMPF",
-	"get_tim" => "SYSTIM",
-	"ref_cyc" => "T_RCYC",
-	"ref_alm" => "T_RALM",
-	"ref_ovr" => "T_ROVR",
-	"get_tid" => "ID",
-	"iget_tid" => "ID",
-	"get_lod" => "uint_t",
-	"get_nth" => "ID",
-	"get_ipm" => "PRI",
-	"wai_flg" => "FLGPTN",
-	"pol_flg" => "FLGPTN",
-	"twai_flg" => "FLGPTN",
-	"rcv_dtq" => "intptr_t",
-	"prcv_dtq" => "intptr_t",
-	"trcv_dtq" => "intptr_t",
-);
-
-%funcparams = (
-	"target_hrt_set_event" => "HRTCNT hrtcnt",
-);
-
-%funcvalue = (
-	"target_hrt_get_current" => "HRTCNT",
-);
-
-%funcreturn = (
-	"target_hrt_get_current" => "0U",
-);
-
-%funccheckparam = (
-	"target_hrt_set_event" => "hrtcnt",
-);
-
-$last_check_point = 0;
-
-sub gen_var_def {
-	local($svc_call) = @_;
-	local($svcname, @params);
-	local($typename, $varname);
-
-	if ($svc_call =~ /^([a-z_]+)\((.*)\)$/) {
-		$svcname = $1;
-		@params = split(/\s*,\s*/, $2);
-
-		if ($parampos{$svcname}) {
-			$varname = $params[@parampos{$svcname} - 1];
-			$varname =~ s/^\&//;
-			$typename = $paramtype{$svcname};
-			${$TASKVAR{$tskid}}{$typename} = ${varname};
-		}
-	}
-}
-
-sub gen_svc_call {
-	local($svc_call, $error_code_string) = @_;
-	local($error_code);
-
-	${$TASKVAR{$tskid}}{"ER_UINT"} = "ercd";
-
-	push(@{$TASKCODE{$tskid}{$tskcnt}}, sprintf("\tercd = %s;", $svc_call));
-	gen_var_def($svc_call);
-
-	if ($error_code_string eq "") {
-		push(@{$TASKCODE{$tskid}{$tskcnt}},
-								sprintf("\tcheck_ercd(ercd, E_OK);"), "");
-	}
-	elsif ($error_code_string =~ /^\-\>\s*noreturn$/) {
-		push(@{$TASKCODE{$tskid}{$tskcnt}}, "");
-	}
-	else {
-		$error_code = $error_code_string;
-		$error_code =~ s/^\-\>\s*([A-Za-z0-9_]*)$/$1/;
-		push(@{$TASKCODE{$tskid}{$tskcnt}},
-						sprintf("\tcheck_ercd(ercd, %s);", $error_code), "");
-	}
-}
-
-sub init_taskcountvar {
-	if (!$TASKCOUNTVAR{$tskid}) {
-		if ($tskid =~ /^TASK([0-9]*)$/) {
-			$countvar = "task$1_count";
-		}
-		elsif ($tskid =~ /^CYC([0-9]*)$/) {
-			$countvar = "cyclic$1_count";
-		}
-		elsif ($tskid =~ /^ALM([0-9]*)$/) {
-			$countvar = "alarm$1_count";
-		}
-		elsif ($tskid =~ /^OVR$/) {
-			$countvar = "overrun_count";
-		}
-		elsif ($tskid =~ /^CPUEXC([0-9]*)$/) {
-			$countvar = "cpuexc$1_count";
-		}
-		elsif ($tskid =~ /^EXTSVC([0-9]*)$/) {
-			$countvar = "extsvc$1_count";
-		}
-		else {
-			$countvar = $tskid."_count";
-		}
-		$TASKCOUNTVAR{$tskid} = $countvar;
-		$TASKCOUNT{$tskid} = 1;
-	}
-}
-
-sub test_start_code {
-	if ($startflag) {
-		push(@{$TASKCODE{$tskid}{$tskcnt}}, "\ttest_start(__FILE__);");
-		push(@{$TASKCODE{$tskid}{$tskcnt}}, "");
-		$startflag = 0;
-	}
-}
-
-sub target_func {
-	local($line) = @_;
-	local($tskid, $tskcnt, $retval, $param);
-
-	if ($line =~ /^([a-zA-Z_]+)\s*(.*)$/) {
-		$tskid = $1;
-		$line = $2;
-	}
-	if ($line =~ /\-\>\s*([^\s]+)\s*(.*)$/) {
-		$retval = $1;
-		$line = $2;
-	}
-	if ($line =~ /\<\-\s*([^\s]+)\s*(.*)$/) {
-		$param = $1;
-		$line = $2;
-	}
-	init_taskcountvar();
-	$tskcnt = $TASKCOUNT{$tskid};
-	test_start_code();
-	push(@{$TASKCODE{$tskid}{$tskcnt}},
-							sprintf("\tcheck_point(%d);", $check_no));
-	if ($param && $funccheckparam{$tskid}) {
-		push(@{$TASKCODE{$tskid}{$tskcnt}},
-							sprintf("\tcheck_assert(%s == %s);",
-							$funccheckparam{$tskid}, $param), "");
-	}
-	if ($retval) {
-		push(@{$TASKCODE{$tskid}{$tskcnt}}, "\treturn(".$retval.");", "");
-	}
-	else {
-		push(@{$TASKCODE{$tskid}{$tskcnt}}, "\treturn;", "");
-	}
-	$TASKCOUNT{$tskid} = $TASKCOUNT{$tskid} + 1
-}
-
-sub parse_line {
-	local($line) = @_;
-
-	if ($line =~ /^==\s*(([a-zA-Z_]+)[0-9]*)(.*)$/) {
-		$procflag = 1;
-		$tskid = $1;
-		$line2 = $3;
-		if ($line2 =~ /^\-([0-9]+)(.*)$/) {
-			$tskcnt = $1;
-			init_taskcountvar();
-			$TASKCOUNT{$tskid} = $tskcnt;
-		}
-		elsif ($line2 =~ /^\-[nN](.*)$/) {
-			init_taskcountvar();
-			$tskcnt = $TASKCOUNT{$tskid};
-		}
-		else {
-			$tskcnt = "";
-		}
-		if ($tskid !~ /^START/) {
-			test_start_code();
-		}
-	}
-	elsif (!$procflag) {
-		# do nothing.
-	}
-	elsif ($line =~ /^([0-9]+\:)\s*END$/) {
-		$check_str = $1;
-		$check_no = ++$last_check_point;
-		push(@{$TASKCODE{$tskid}{$tskcnt}},
-								sprintf("\tcheck_finish(%d);", $check_no));
-		$procflag = 0;
-		$output_line =~ s/$check_str/$check_no:/;
-	}
-	else {
-		if ($line =~ /^([0-9]+\:)\s*(.*)$/) {
-			$check_str = $1;
-			$line = $2;
-			$check_no = ++$last_check_point;
-			$output_line =~ s/$check_str/$check_no:/;
-			if ($line =~ /^HOOK\((.*)\)$/) {
-				push(@{$TASKCODE{$tskid}{$tskcnt}},
-								sprintf("\t".$1.";", $check_no));
-				return;
-			}
-			elsif ($line =~ /^\[(.*)\]$/) {
-				target_func($1);
-				return;
-			}
-			else {
-				push(@{$TASKCODE{$tskid}{$tskcnt}},
-								sprintf("\tcheck_point(%d);", $check_no));
-			}
-		}
-		if ($line =~ /^(assert\(.*\))$/) {
-			$assert_string = $1;
-			push(@{$TASKCODE{$tskid}{$tskcnt}},
-								sprintf("\tcheck_%s;", $assert_string), "");
-		}
-		elsif ($line =~ /^((state|ipm)\(.*\))$/) {
-			$state_string = $1;
-			push(@{$TASKCODE{$tskid}{$tskcnt}},
-								sprintf("\tcheck_%s;", $state_string), "");
-		}
-		elsif ($line =~ /^call\((.*)\)$/ || $line =~ /^DO\((.*)\)$/) {
-			$call_string = $1;
-			push(@{$TASKCODE{$tskid}{$tskcnt}},
-									sprintf("\t%s;", $call_string), "");
-			if ($call_string =~ /^SIL_..._INT\(\)$/) {
-				$TASKSILLOC{$tskid} = 1;
-			}
-		}
-		elsif ($line =~ /^RETURN((\(.*\))?)$/) {
-			$return_string = $1;
-			push(@{$TASKCODE{$tskid}{$tskcnt}},
-									"\treturn".$return_string.";", "");
-			$TASKCOUNT{$tskid} = $TASKCOUNT{$tskid} + 1
-		}
-		elsif ($line =~ /^GOTO\((.*)\)$/) {
-			$goto_string = $1;
-			push(@{$TASKCODE{$tskid}{$tskcnt}},
-									sprintf("\tgoto %s;", $goto_string), "");
-		}
-		elsif ($line =~ /^LABEL\((.*)\)$/) {
-			$label_string = $1;
-			$indent_string = $indentstr;
-			$indent_string =~ s/\t$//;
-			push(@{$TASKCODE{$tskid}{$tskcnt}},
-									sprintf("%s:", $label_string));
-		}
-		elsif ($line =~ /^([a-z_]+\(.*\))\s*(\-\>\s*[A-Za-z0-9_]*)?\s*$/) {
-			$svc_call = $1;
-			$error_code_string = $2;
-			gen_svc_call($svc_call, $error_code_string);
-		}
-		else {
-			print STDERR "Error: ",$line,"\n";
-		}
-	}
-}
-
-#
-#  ã¹ã¯ãªãããã¡ã¤ã«èª­è¾¼ã¿å¦ç
-#
-$procflag = 0;
-$startflag = 1;
-$outflag = 1;
-open(INFILE, $infile) || die "Cannot open $infile";
-while (($line = <INFILE>) && $outflag) {
-	$output_line = $line;
-	chomp $line;
-	$line =~ s/^\s*\*\s*//;
-	$line =~ s/\s*\/\/.*$//;
-	$line =~ s/\s*\.\.\..*$//;
-	while ($line =~ s/\\$//) {
-		$line1 = <INFILE>;
-		$output_line .= $line1;
-		chomp $line1;
-		$line1 =~ s/^\s*\*\s*//;
-		$line1 =~ s/\s*\/\/.*$//;
-		$line1 =~ s/\s*\.\.\..*$//;
-		$line .= $line1;
-	}
-	if ($line) {
-		parse_line($line);
-	}
-	print $output_line;
-	if ($output_line =~ /DO NOT DELETE THIS LINE/) {
-		$outflag = 0;
-	}
-}
-close(INFILE);
-
-#
-#  ã¿ã¹ã¯ã®å¤æ°å®ç¾©ã®ã³ã¼ãåºå
-#
-sub output_task_vardef {
-	my($tskid) = @_;
-
-	foreach my $typename (keys(%{$TASKVAR{$tskid}})) {
-		print "\t",$typename, (length($typename) < 4 ? "\t\t" : "\t"),
-								${$TASKVAR{$tskid}}{$typename},";\n";
-	}
-	if ($TASKSILLOC{$tskid}) {
-		print "\tSIL_PRE_LOC;\n";
-	}
-}
-
-#
-#  ã¿ã¹ã¯æ¬ä½ã®ã³ã¼ãåºå
-#
-sub output_task_body {
-	my($tskid) = @_;
-
-	foreach my $tskcnt (sort {$a <=> $b} (keys(%{$TASKCODE{$tskid}}))) {
-		printf "\tcase %d:\n", $tskcnt;
-		foreach my $line (@{$TASKCODE{$tskid}{$tskcnt}}) {
-			print "\t",$line if ($line);
-			print "\n";
-		}
-		printf "\t\tcheck_point(0);\n\n";
-	}
-}
-
-#
-#  ã¿ã¹ã¯ã³ã¼ãã®åºå
-#
-sub output_task {
-	if ($TASKCOUNTVAR{$tskid}) {
-		printf "\nstatic uint_t\t%s = 0;\n", $TASKCOUNTVAR{$tskid};
-	}
-	if ($tskid =~ /^TASK([0-9]*)$/) {
-		print "\nvoid\n";
-		print "task$1(intptr_t exinf)\n";
-	}
-	elsif ($tskid =~ /^CYC([0-9]*)$/) {
-		print "\nvoid\n";
-		print "cyclic$1_handler(intptr_t exinf)\n";
-	}
-	elsif ($tskid =~ /^ALM([0-9]*)$/) {
-		print "\nvoid\n";
-		print "alarm$1_handler(intptr_t exinf)\n";
-	}
-	elsif ($tskid =~ /^OVR$/) {
-		print "\nvoid\n";
-		print "overrun_handler(ID tskid, intptr_t exinf)\n";
-	}
-	elsif ($tskid =~ /^CPUEXC([0-9]*)$/) {
-		print "\nvoid\n";
-		print "cpuexc$1_handler(void *p_excinf)\n";
-	}
-	elsif ($tskid =~ /^EXTSVC([0-9]*)$/) {
-		print "\nER_UINT\n";
-		print "extsvc$1_routine(intptr_t par1, intptr_t par2, intptr_t par3,\n";
-		print "\t\t\t\t\t\t\t\tintptr_t par4, intptr_t par5, ID cdmid)\n";
-	}
-	else {
-		if ($funcvalue{$tskid}) {
-			print "\n",$funcvalue{$tskid},"\n";
-		}
-		else {
-			print "\nvoid\n";
-		}
-		print $tskid;
-		if ($funcparams{$tskid}) {
-			print "(",$funcparams{$tskid},")\n";
-		}
-		else {
-			print "(void)\n";
-		}
-	}
-	print "{\n";
-	output_task_vardef($tskid);
-	print "\n";
-	if ($TASKCOUNTVAR{$tskid}) {
-		printf "\tswitch (++%s) {\n", $TASKCOUNTVAR{$tskid};
-		output_task_body($tskid);
-		printf "\tdefault:\n";
-		printf "\t\tcheck_point(0);\n";
-		printf "\t}\n";
-	}
-	else {
-		foreach my $line (@{$TASKCODE{$tskid}{""}}) {
-			print $line,"\n";
-		}
-	}
-	print "\tcheck_point(0);\n";
-	if ($tskid =~ /^EXTSVC([0-9]*)$/) {
-		print "\treturn(E_SYS);\n";
-	}
-	else {
-		if ($funcreturn{$tskid}) {
-			print "\treturn(",$funcreturn{$tskid},");\n";
-		}
-	}
-	print "}\n";
-}
-
-#
-#  ãã¹ããã­ã°ã©ã åºåå¦ç
-#
-foreach $tskid (sort(keys(%TASKCODE))) {
-	output_task();
-}
Index: asp3_wo_tecs/trunk/utils/gentest.rb
===================================================================
--- asp3_wo_tecs/trunk/utils/gentest.rb	(revision 304)
+++ asp3_wo_tecs/trunk/utils/gentest.rb	(revision 304)
@@ -0,0 +1,489 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+#
+#  TOPPERS Software
+#      Toyohashi Open Platform for Embedded Real-Time Systems
+# 
+#  Copyright (C) 2007-2016 by Embedded and Real-Time Systems Laboratory
+#              Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#      ã¨ï¼
+#    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#        å ±åãããã¨ï¼
+#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#      å
+è²¬ãããã¨ï¼
+# 
+#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#  ã®è²¬ä»»ãè² ããªãï¼
+# 
+#  $Id: gentest.rb 578 2016-02-03 07:23:53Z ertl-hiro $
+# 
+
+#
+#		ãã¹ããã­ã°ã©ã çæãã¼ã«
+#
+	
+#
+#  çæåä½ãæ±ºããããã®è¨­å®
+#
+$parameterPosition = {
+  "get_tst" => 2,
+  "get_pri" => 2,
+  "get_inf" => 1,
+  "ref_tsk" => 2,
+  "ref_sem" => 2,
+  "ref_flg" => 2,
+  "ref_dtq" => 2,
+  "ref_pdq" => 2,
+  "ref_mtx" => 2,
+  "ref_mbf" => 2,
+  "ref_mpf" => 2,
+  "get_tim" => 1,
+  "ref_cyc" => 2,
+  "ref_alm" => 2,
+  "ref_ovr" => 2,
+  "get_tid" => 1,
+  "iget_tid" => 1,
+  "get_lod" => 2,
+  "get_nth" => 3,
+  "get_ipm" => 1,
+  "wai_flg" => 4,
+  "pol_flg" => 4,
+  "twai_flg" => 4,
+  "rcv_dtq" => 2,
+  "prcv_dtq" => 2,
+  "trcv_dtq" => 2,
+}
+
+$parameterType = {
+  "get_tst" => "STAT",
+  "get_pri" => "PRI",
+  "get_inf" => "intptr_t",
+  "ref_tsk" => "T_RTSK",
+  "ref_sem" => "T_RSEM",
+  "ref_flg" => "T_RFLG",
+  "ref_dtq" => "T_RDTQ",
+  "ref_pdq" => "T_RPDQ",
+  "ref_mtx" => "T_RMTX",
+  "ref_mbf" => "T_RMBF",
+  "ref_mpf" => "T_RMPF",
+  "get_tim" => "SYSTIM",
+  "ref_cyc" => "T_RCYC",
+  "ref_alm" => "T_RALM",
+  "ref_ovr" => "T_ROVR",
+  "get_tid" => "ID",
+  "iget_tid" => "ID",
+  "get_lod" => "uint_t",
+  "get_nth" => "ID",
+  "get_ipm" => "PRI",
+  "wai_flg" => "FLGPTN",
+  "pol_flg" => "FLGPTN",
+  "twai_flg" => "FLGPTN",
+  "rcv_dtq" => "intptr_t",
+  "prcv_dtq" => "intptr_t",
+  "trcv_dtq" => "intptr_t",
+}
+  
+$functionParameters = {
+  "target_hrt_set_event" => "HRTCNT hrtcnt",
+}
+  
+$functionValue = {
+  "target_hrt_get_current" => "HRTCNT",
+}
+  
+$functionReturn = {
+  "target_hrt_get_current" => "0U",
+}
+  
+$functionCheckParameter = {
+  "target_hrt_set_event" => "hrtcnt",
+}
+
+#
+#  å¦çåä½ã®ã³ã¼ããæ ¼ç´ããã¯ã©ã¹
+#
+class PUCode
+  # åæå
+  def initialize(puName)
+    @puName = puName						# å¦çåä½ã®åå
+    @currentCount = ""						# å¦çã«ã¦ã³ã
+    @countFlag = false						# å¦çã«ã¦ã³ããä½¿ãããã
+    @code = Hash.new { |h,k| h[k] = [] }	# å¦çåä½ã®ã³ã¼ã
+    @variableList = {}						# å¦çåä½ã®å¤æ°
+    @silFlag = false						# SILãä½¿ãããã
+
+    # å¦çã«ã¦ã³ãå¤æ°åã®çæ
+    case puName
+    when /^TASK([0-9]*)$/
+      @count_var = "task#{$1}_count"
+    when /^CYC([0-9]*)$/
+      @count_var = "cyclic#{$1}_count"
+    when /^ALM([0-9]*)$/
+      @count_var = "alarm#{$1}_count"
+    when /^OVR$/
+      @count_var = "overrun_count"
+    when /^CPUEXC([0-9]*)$/
+      @count_var = "cpuexc#{$1}_count"
+    when /^EXTSVC([0-9]*)$/
+      @count_var = "extsvc#{$1}_count"
+    else
+      @count_var = puName + "_count"
+    end
+  end
+
+  # å¦çã«ã¦ã³ãã®è¨­å®
+  def setCount(count)
+    @countFlag = true if count != ""
+    @currentCount = count
+  end
+
+  # å¦çã«ã¦ã³ãã®ã¤ã³ã¯ãªã¡ã³ã
+  def incrementCount
+    if @currentCount != ""
+      @currentCount = (@currentCount.to_i + 1).to_s
+    end
+  end
+
+  # ã³ã¼ãã®è¿½å 
+  def append(*lines)
+    lines.each do |line|
+      @code[@currentCount].push(line)
+        end
+  end
+
+  # å¤æ°ã®è¿½å 
+  def addVariable(varName, typeName)
+    @variableList[varName] = typeName
+  end
+
+  # SILã®ä½¿ç¨
+  def useSil
+    @silFlag = true
+  end
+
+  # å¦çåä½ã®ã³ã¼ãã®åºå
+  def generateCode
+    # ä¸è¦ãªå¦çåä½ã®å¤å®
+    return if @code.length == 0
+
+    # å¦çã«ã¦ã³ãå¤æ°ã®çæ
+    if @countFlag
+      print("\nstatic uint_t\t#{@count_var} = 0;\n")
+    end
+
+    # é¢æ°ãããã®çæ
+    case @puName
+    when /^TASK([0-9]*)$/
+      print("\nvoid\n")
+      print("task#{$1}(intptr_t exinf)\n")
+    when /^CYC([0-9]*)$/
+      print("\nvoid\n")
+      print("cyclic#{$1}_handler(intptr_t exinf)\n")
+    when /^ALM([0-9]*)$/
+      print("\nvoid\n")
+      print("alarm#{$1}_handler(intptr_t exinf)\n")
+    when /^OVR$/
+      print("\nvoid\n")
+      print("overrun_handler(ID tskid, intptr_t exinf)\n")
+    when /^CPUEXC([0-9]*)$/
+      print("\nvoid\n")
+      print("cpuexc#{$1}_handler(void *p_excinf)\n")
+    when /^EXTSVC([0-9]*)$/
+      print("\nER_UINT\n")
+      print("extsvc#{$1}_routine")
+      print("(intptr_t par1, intptr_t par2, intptr_t par3,\n")
+      print("\t\t\t\t\t\t\t\tintptr_t par4, intptr_t par5, ID cdmid)\n")
+    else
+      if $functionValue[@puName]
+        print("\n#{$functionValue[@puName]}\n")
+      else
+        print("\nvoid\n")
+      end
+      print(@puName)
+      if $functionParameters[@puName]
+        print("(#{$functionParameters[@puName]})\n")
+      else
+        print("(void)\n")
+      end
+    end
+
+    print("{\n")
+
+    @variableList.keys.each do |varName|
+      print("\t#{@variableList[varName]}")
+      print(@variableList[varName].length < 4 ? "\t\t" : "\t")
+      print("#{varName};\n")
+    end
+    if @silFlag
+      print("\tSIL_PRE_LOC;\n")
+    end
+    print("\n")
+
+    if @countFlag
+      print("\tswitch (++#{@count_var}) {\n")
+      @code.keys.sort_by { |c| c.to_i }.each do |count|
+        print("\tcase #{count}:\n")
+        @code[count].each do |line|
+          print("\t",line) if line != ""
+          print("\n")
+        end
+        print("\t\tcheck_point(0);\n\n")
+      end
+      print("\tdefault:\n")
+      print("\t\tcheck_point(0);\n")
+      print("\t}\n")
+    else
+      @code[""].each do |line|
+        print(line,"\n")
+      end
+    end
+
+    print("\tcheck_point(0);\n")
+    if /^EXTSVC([0-9]*)$/ =~ @puName
+      print("\treturn(E_SYS);\n")
+    elsif $functionReturn[@pu_nama]
+      print("\treturn(#{$functionReturn[@puName]});\n")
+    end
+    print("}\n")
+  end
+end
+
+#
+#  ãµã¼ãã¹ã³ã¼ã«å¼ã³åºãã®èª­ã¿è¾¼ã¿
+#
+def genServiceCall(pu, svc_call, error_code)
+  pu.addVariable("ercd", "ER_UINT")
+  pu.append("\tercd = #{svc_call};")
+
+  if /^([a-z_]+)\((.*)\)$/ =~ svc_call
+    svcName = $1;
+    params = $2.split(/\s*,\s*/)
+
+    if !$parameterPosition[svcName].nil? \
+					&& params.size >= $parameterPosition[svcName]
+      varName = params[$parameterPosition[svcName] - 1].sub(/^\&/, "")
+      typeName = $parameterType[svcName]
+      pu.addVariable(varName, typeName)
+    end
+  end
+
+  if !error_code
+    # E_OKãè¿ãå ´å
+    pu.append("\tcheck_ercd(ercd, E_OK);", "")
+  elsif error_code == "noreturn"
+    # ãªã¿ã¼ã³ããªãå ´å
+    pu.append("")
+  else
+    pu.append("\tcheck_ercd(ercd, #{error_code});", "")
+  end
+end
+
+#
+#  ãã¹ãéå§ã³ã¼ãã®çæ
+#
+def testStartCode(pu)
+  # ãã¹ãéå§ã³ã¼ãã¯ä¸åº¦ã®ã¿åºåãã
+  if $startFlag == 0
+    pu.append("\ttest_start(__FILE__);", "")
+    $startFlag = 1
+  end
+end
+
+#
+#  ã¿ã¼ã²ããä¾å­é¨é¢æ°ã®æ¯ãèãã®èª­ã¿è¾¼ã¿
+#
+def targetFunction(line, checkNum)
+  if /^([a-zA-Z_]+)\s*(.*)$/ =~ line
+    functionName = $1
+    line = $2
+    if (pu = $puList[functionName]).nil?
+      # æ°ããå¦çåä½ã®çæ
+      pu = $puList[functionName] = PUCode.new(functionName)
+      pu.setCount("1")
+      testStartCode(pu)
+    end
+  end
+
+  if /\-\>\s*([^\s]+)\s*(.*)$/ =~ line
+    retval = $1
+    line = $2
+  end
+  if /\<\-\s*([^\s]+)\s*(.*)$/ =~ line
+    param = $1
+    line = $2
+  end
+
+  pu.append("\tcheck_point(#{checkNum});");
+  if param && $functionCheckParameter[functionName]
+    pu.append(sprintf("\tcheck_assert(%s == %s);",
+					$functionCheckParameter[functionName], param), "")
+  end
+  if retval
+    pu.append("\treturn(#{retval});", "")
+  else
+    pu.append("\treturn;", "")
+  end
+  pu.incrementCount()
+end
+
+#
+#  ãã¹ãã¹ã¯ãªããã®èª­ã¿è¾¼ã¿
+#
+def parseLine(line)
+  if /^==\s*(([a-zA-Z_]+)[0-9]*)(.*)$/ =~ line
+    # å¦çåä½ã®éå§
+    $procFlag = 1
+    puName = $1
+    line2 = $3
+    if (pu = $puList[puName]).nil?
+      # æ°ããå¦çåä½ã®çæ
+      pu = $puList[puName] = PUCode.new(puName)
+    end
+    $currentPu = pu
+
+    case line2
+    when /^\-([0-9]+)(.*)$/
+      pu.setCount($1)
+    when /^\-[nN](.*)$/
+      # do nothing.
+    else
+      pu.setCount("")
+    end
+    testStartCode(pu) if /^START/ !~ puName
+  elsif $procFlag != 0
+    pu = $currentPu
+    if /^([0-9]+\:)\s*(.*)$/ =~ line
+      # ãã§ãã¯ãã¤ã³ãçªå·ã®å¦ç
+      originalCheckNum = $1
+      line = $2
+      checkNum = ($lastCheckPoint += 1).to_s
+      $outputLine.sub!(/#{originalCheckNum}/, "#{checkNum}:")
+
+      case line
+      when /^END$/
+        pu.append("\tcheck_finish(#{checkNum});")
+        $procFlag = 0
+        return
+      when /^HOOK\((.*)\)$/
+        pu.append(sprintf("\t#{$1};", checkNum))
+        return
+      when /^\[(.*)\]$/
+        targetFunction($1, checkNum)
+        return
+      else
+        pu.append("\tcheck_point(#{checkNum});")
+      end
+    end
+
+    case line
+    when /^((assert|state|ipm)\(.*\))$/
+      pu.append("\tcheck_#{$1};", "")
+    when /^(call|DO)\((.*)\)$/
+      call_string = $2
+      pu.append("\t#{call_string};", "")
+      pu.useSil() if /^SIL_..._INT\(\)$/ =~ call_string
+    when /^RETURN((\(.*\))?)$/
+      pu.append("\treturn#{$1};", "")
+      pu.incrementCount()
+    when /^GOTO\((.*)\)$/
+      pu.append("\tgoto #{$1};", "")
+    when /^LABEL\((.*)\)$/
+      pu.append("#{$1}:", "")
+    when /^([a-z_]+\(.*\))\s*(\-\>\s*([A-Za-z0-9_]*))?\s*$/
+      genServiceCall(pu, $1, $3)
+    else
+      warn("Error: #{line}")
+    end
+  end
+end
+
+#
+#  ã¨ã©ã¼ãã§ãã¯
+#
+if ARGV.length < 1
+  abort("Usage: ruby gentest.rb <test_program>")
+end
+
+#
+#  åæå
+#
+inFileName = ARGV.shift
+
+#
+#  ã¹ã¯ãªãããã¡ã¤ã«èª­ã¿è¾¼ã¿å¦ç
+#
+$lastCheckPoint = 0		# æå¾ã®ãã§ãã¯ãã¤ã³ãçªå·
+$procFlag = 0				# ã¹ã¯ãªããå¦çä¸­ãã©ã°
+$startFlag = 0			# ãã¹ãéå§ã³ã¼ãã®åºåãã©ã°
+$currentPu = nil			# èª­ã¿è¾¼ã¿ä¸­ã®å¦çåä½
+$puList = {}				# å¦çåä½ã®ãªã¹ã
+
+begin
+  inFile = File.open(inFileName)
+rescue Errno::ENOENT, Errno::EACCES => ex
+  abort(ex.message)
+end
+
+while line = inFile.gets do
+  $outputLine = line.dup
+  line.chomp!
+  line.sub!(/^\s*\*\s*/, "")
+  line.sub!(/\s*\/\/.*$/, "")
+  line.sub!(/\s*\.\.\..*$/, "")
+
+  while line.sub!(/\\$/, "") do
+    line1 = inFile.gets
+    $outputLine += line1.dup
+    line1.chomp!
+    line1.sub!(/^\s*\*\s*/, "")
+    line1.sub!(/\s*\/\/.*$/, "")
+    line1.sub!(/\s*\.\.\..*$/, "")
+    line += line1
+  end
+  parseLine(line) if line != ""
+  print($outputLine)
+  break if /DO NOT DELETE THIS LINE/ =~ $outputLine
+end
+
+#
+#  ãã¹ããã­ã°ã©ã åºåå¦ç
+#
+$puList.keys.sort.each do |puName|
+  $puList[puName].generateCode()
+end
Index: asp3_wo_tecs/trunk/utils/makerelease
===================================================================
--- asp3_wo_tecs/trunk/utils/makerelease	(revision 303)
+++ 	(revision )
@@ -1,174 +1,0 @@
-#! /usr/bin/perl
-#
-#  TOPPERS Software
-#      Toyohashi Open Platform for Embedded Real-Time Systems
-# 
-#  Copyright (C) 2006-2015 by Embedded and Real-Time Systems Laboratory
-#              Graduate School of Information Science, Nagoya Univ., JAPAN
-# 
-#  ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-#  å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-#      ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-#      è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-#      ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-#      ã¨ï¼
-#    (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-#    (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-#        å ±åãããã¨ï¼
-#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-#      å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-#      å
-è²¬ãããã¨ï¼
-# 
-#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-#  ã®è²¬ä»»ãè² ããªãï¼
-# 
-#  $Id: makerelease 415 2015-08-04 06:18:16Z ertl-hiro $
-# 
-
-use Cwd;
-
-$cwd = getcwd();
-$cwd =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
-$prefix = "./".$cwd;
-
-@file_list = ();
-%file_list = ();
-
-if ($#ARGV >= 0) {
-	$arg1 = $ARGV[0];
-	$arg1 =~ s/^\.\///;
-	$arg1 =~ s/\/$/\/MANIFEST/;
-}
-else {
-	$arg1 = "MANIFEST";
-}
-
-sub gen_path {
-	local($base, $path) = @_;
-
-	while ($path =~ /^..\/(.*)$/) {
-		$path = $1;
-		$base =~ s/(\/?)[^\/]*\/$/$1/;
-	}
-	return($base.$path);
-}
-
-sub read_file {
-	local($filename) = @_;
-	local($fh, $dirname);
-
-	if ($filename =~ /^(.*\/)[^\/]*$/) {
-		$dirname = $1;
-	}
-	else {
-		$dirname = "";
-	}
-
-	open($fh, $filename) || die "Cannot open $filename";
-	while ($line = <$fh>) {
-		chomp $line;
-		$line =~ s/\r$//;
-		$line =~ s/[ \t]*\#.*$//;
-		next if ($line =~ /^[ \t]*$/);
-
-		if ($line =~ /^E_PACKAGE[ \t]+(.*)$/) {
-			if ($package) {
-				die "Duplicated E_PACKAGE directive.";
-			}
-			else {
-				$package = $1;
-				$e_package = 1;
-			}
-		}
-		elsif ($line =~ /^PACKAGE[ \t]+(.*)$/) {
-			if ($package) {
-				if (!$e_package && $package ne $1) {
-					die "Inconsistent PACKAGE directive.";
-				}
-			}
-			else {
-				$package = $1;
-			}
-		}
-		elsif ($line =~ /^VERSION[ \t]+(.*)$/) {
-			if ($version) {
-				if (!$e_package && $version ne $1) {
-					die "Inconsistent VERSION directive.";
-				}
-			}
-			else {
-				$version = $1;
-				if ($version =~ /%date/) {
-					@current_time = localtime();
-					$vdate = sprintf("%04d%02d%02d", $current_time[5]+1900,
-										$current_time[4]+1, $current_time[3]);
-					$version =~ s/%date/$vdate/;
-				}
-			}
-		}
-		elsif ($line =~ /^INCLUDE[ \t]+(.*)$/) {
-			read_file(gen_path($dirname, $1));
-		}
-		else {
-			$filename = $prefix."/".$dirname.$line;
-			while ($filename =~ s|/[^/]+/\.\./|/|) {}
-			if (!(-f "../".$filename)) {
-				die "$filename is not a file.";
-			}
-			elsif ($file_list{$filename}) {
-				die "$filename is duplicated.";
-			}
-			else {
-				push(@file_list, $filename);
-				$file_list{$filename} = $filename;
-			}
-		}
-	}
-	close($fh);
-}
-
-read_file($arg1);
-unless ($package) {
-	die "PACKAGE/E_PACKAGE directive not found.";
-}
-unless ($version) {
-	die "VERSION directive not found.";
-}
-
-if (! -d "RELEASE") {
-	mkdir("RELEASE");
-}
-
-$archive_name = $package."-".$version.".tar.gz";
-$file_list = join(" ", @file_list);
-$command = "tar cvfz RELEASE/$archive_name -C .. $file_list\n";
-die if (system($command));
-print STDERR "== RELEASE/$archive_name is generated. ==\n";
Index: asp3_wo_tecs/trunk/utils/makerelease.rb
===================================================================
--- asp3_wo_tecs/trunk/utils/makerelease.rb	(revision 304)
+++ asp3_wo_tecs/trunk/utils/makerelease.rb	(revision 304)
@@ -0,0 +1,186 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+#
+#  TOPPERS Software
+#      Toyohashi Open Platform for Embedded Real-Time Systems
+# 
+#  Copyright (C) 2006-2016 by Embedded and Real-Time Systems Laboratory
+#              Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#      ã¨ï¼
+#    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#        å ±åãããã¨ï¼
+#  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#      å
+è²¬ãããã¨ï¼
+# 
+#  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#  ã®è²¬ä»»ãè² ããªãï¼
+# 
+#  $Id: makerelease.rb 567 2016-01-30 00:49:03Z ertl-hiro $
+# 
+
+require "shell"
+
+#
+#  ".."ãå«ããã¹ã®æ´å½¢
+#
+#  ä¾ï¼"yyy/../zzz" â "zzz"
+#  ä¾ï¼"xxx/yyy/../zzz" â "xxx/zzz"
+#
+def canonicalPath(path)
+  while path.sub!(/([^\/]+\/\.\.\/)/, "") do end
+  return(path)
+end
+
+#
+#  ãã¡ã¤ã«ã®èª­ã¿è¾¼ã¿
+#
+def readFile(inFileName)
+  baseDirectory = File.dirname(inFileName)
+  if (baseDirectory == ".")
+    baseDirectory = ""
+  else
+    baseDirectory += "/"
+  end
+
+  begin
+    inFile = File.open(inFileName)
+  rescue Errno::ENOENT, Errno::EACCES => ex
+    abort(ex.message)
+  end
+
+  inFile.each do |line|
+    line.chomp!
+    line.sub!(/\s*\#.*$/, "")
+    next if /^\s*$/ =~ line
+
+    if /^E_PACKAGE[ \t]+(.*)$/ =~ line
+      if $package != ""
+        abort("Duplicated E_PACKAGE directive.")
+      else
+        $package = $1
+        $e_package = 1
+      end
+    elsif /^PACKAGE[ \t]+(.*)$/ =~ line
+      if $package != ""
+        if !$e_package && $package != $1
+          abort("Inconsistent PACKAGE directive.")
+        end
+      else
+        $package = $1
+      end
+    elsif /^VERSION[ \t]+(.*)$/ =~ line
+      if $version != ""
+        if !$e_package && $version != $1
+          abort("Inconsistent VERSION directive.")
+        end
+      else
+        $version = $1
+        if /%date/ =~ $version
+          currentTime = Time.now.localtime
+          vdate = sprintf("%04d%02d%02d", currentTime.year,
+									currentTime.month, currentTime.day)
+          $version.sub!(/%date/, vdate)
+        end
+      end
+    elsif /^INCLUDE[ \t]+(.*)$/ =~ line
+      readFile(canonicalPath(baseDirectory + $1))
+    else
+      fileName = $prefix + "/" + canonicalPath(baseDirectory + line)
+      if !File.file?("../" + fileName)
+        abort("#{fileName} is not a file.")
+      elsif $fileList.index(fileName)
+        abort("#{fileName} is duplicated.")
+      else 
+        $fileList.push(fileName)
+      end
+    end
+  end
+end
+
+#
+#  åæå
+#
+$package = ""
+$e_package = 0
+$version = ""
+$fileList = []
+
+#
+#  ããªãã£ãã¯ã¹ï¼./ã«ã¬ã³ããã£ã¬ã¯ããªåï¼ã®åãåºã
+#
+cwd = Shell.new.cwd
+$prefix = "./" + File.basename(cwd)
+
+#
+#  ãã©ã¡ã¼ã¿ã®åãåºã
+#
+if ARGV.length >= 1
+  arg = ARGV.shift.dup
+  arg.sub!(/\/$/, "/MANIFEST")
+  arg.sub!(/^\.\//, "")
+else
+  arg = "MANIFEST"
+end
+
+#
+#  ãã¡ã¤ã«ã®èª­ã¿è¾¼ã¿
+#
+readFile(arg)
+if $package == ""
+  abort("PACKAGE/E_PACKAGE directive not found.")
+end
+if $version == ""
+  abort("VERSION directive not found.")
+end
+
+#
+#  RELEASEãã£ã¬ã¯ããªã®ä½æ
+#
+if !File.directory?("RELEASE")
+  Dir.mkdir("RELEASE")
+end
+
+#
+#  ã¢ã¼ã«ã¤ãï¼.tar.gzï¼ã®ä½æ
+#
+archiveName = $package + "-" + $version + ".tar.gz"
+fileListStr = $fileList.join(" ")
+command = "tar cvfz RELEASE/#{archiveName} -C .. #{fileListStr}\n";
+system(command)
+puts("== RELEASE/#{archiveName} is generated. ==\n")
