Index: asp3_wo_tecs/trunk/README.txt
===================================================================
--- asp3_wo_tecs/trunk/README.txt	(revision 304)
+++ asp3_wo_tecs/trunk/README.txt	(revision 305)
@@ -6,6 +6,5 @@
 TOPPERS/ASP3ã«ã¼ãã«ï¼TOPPERS/ASPã«ã¼ãã« Release 3.Xï¼ä»¥ä¸ï¼ASP3ã«ã¼ã
 ã«ï¼ã¯ï¼TOPPERS/ASPã«ã¼ãã«ãæ¡å¼µã»æ¹è¯ãããã®ã§ï¼TOPPERSç¬¬3ä¸ä»£ã«ã¼ã
-ã«ï¼ITRONç³»ï¼ã®åºç¤ã¨ãªããã®ã¨ãã¦éçºãé²ãã¦ãããªã¢ã«ã¿ã¤ã ã«ã¼ãã«
-ã§ãï¼
+ã«ï¼ITRONç³»ï¼ã®åºç¤ã¨ãªããã®ã¨ãã¦éçºãããªã¢ã«ã¿ã¤ã ã«ã¼ãã«ã§ãï¼
 
 TOPPERS/ASPã«ã¼ãã«ã¯ï¼Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«æºæ ã®ãª
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/arm.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/arm.h	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/arm.h	(revision 305)
@@ -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.h 430 2015-08-08 11:38:46Z ertl-hiro $
+ *  $Id: arm.h 523 2016-01-14 11:01:04Z ertl-hiro $
  */
 
@@ -282,18 +282,26 @@
 
 /*
- *  High exception vectorãä½¿ããã®è¨­å®
- */
-Inline void
-arm_set_high_vector(bool_t enable)
+ *  High exception vectorsãä½¿ãããã«è¨­å®
+ */
+Inline void
+arm_set_high_vectors(void)
 {
 	uint32_t	reg;
 
 	CP15_READ_SCTLR(reg);
-	if (enable) {
-		reg |= CP15_SCTLR_VECTOR;
-	}
-	else {
-		reg &= ~CP15_SCTLR_VECTOR;
-	}
+	reg |= CP15_SCTLR_VECTOR;
+	CP15_WRITE_SCTLR(reg);
+}
+
+/*
+ *  Low exception vectorsãä½¿ãããã«è¨­å®
+ */
+Inline void
+arm_set_low_vectors(void)
+{
+	uint32_t	reg;
+
+	CP15_READ_SCTLR(reg);
+	reg &= ~CP15_SCTLR_VECTOR;
 	CP15_WRITE_SCTLR(reg);
 }
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 305)
@@ -3,5 +3,5 @@
 #		ãã¹3ã®çæã¹ã¯ãªããã®ã³ã¢ä¾å­é¨ï¼ARMç¨ï¼
 # 
-#  $Id: core_check.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#  $Id: core_check.trb 588 2016-02-05 12:54:58Z ertl-hiro $
 #
 
@@ -19,5 +19,5 @@
 #
 inhTable = SYMBOL("_kernel_inh_table")
-$cfgData[:DEF_INH].each do |id, params|
+$cfgData[:DEF_INH].each do |key, params|
   inthdr = PEEK(inhTable + params[:inhno] * $sizeof_FP, $sizeof_FP)
 
@@ -39,5 +39,5 @@
 #
 excTable = SYMBOL("_kernel_exc_table")
-$cfgData[:DEF_EXC].each do |id, params|
+$cfgData[:DEF_EXC].each do |key, params|
   exchdr = PEEK(excTable + params[:excno] * $sizeof_FP, $sizeof_FP)
 
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_kernel_impl.c
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_kernel_impl.c	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_kernel_impl.c	(revision 305)
@@ -6,5 +6,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
  * 
@@ -53,5 +53,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: core_kernel_impl.c 430 2015-08-08 11:38:46Z ertl-hiro $
+ *  $Id: core_kernel_impl.c 541 2016-01-16 03:09:21Z ertl-hiro $
  */
 
@@ -76,6 +76,6 @@
 #ifdef USE_ARM_MMU
 
-#define D0_CLIENT	0x01U		/* å¤æãã¼ãã«ã«å¾ã£ã¦ãã¡ã¤ã³0ã«ã¢ã¯ã»ã¹ */
-#define USE_ASID	1			/* ä½¿ç¨ããASID */
+#define CP15_DACR_D0_CLIENT	0x01U	/* å¤æãã¼ãã«ã«å¾ããã¡ã¤ã³0ã«ã¢ã¯ã»ã¹ */
+#define DEFAULT_ASID		1		/* ä½¿ç¨ããASID */
 
 /*
@@ -155,5 +155,5 @@
 	 * ãã¡ã¤ã³ã¢ã¯ã»ã¹å¶å¾¡ã®è¨­å®
 	 */
-	CP15_WRITE_DACR(D0_CLIENT);
+	CP15_WRITE_DACR(CP15_DACR_D0_CLIENT);
 
 	/*
@@ -161,5 +161,5 @@
 	 */
 #if __TARGET_ARCH_ARM >= 6
-	CP15_WRITE_CONTEXTIDR(USE_ASID);
+	CP15_WRITE_CONTEXTIDR(DEFAULT_ASID);
 #endif /* __TARGET_ARCH_ARM >= 6 */
 
@@ -197,4 +197,11 @@
 	 */ 
 	excpt_nest_count = 1U;
+
+	/*
+	 *  MMUãæå¹ã«
+	 */
+#ifdef USE_ARM_MMU
+	arm_mmu_initialize();
+#endif /* USE_ARM_MMU */
 
 	/*
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_syssvc.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_syssvc.h	(revision 305)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_syssvc.h	(revision 305)
@@ -0,0 +1,145 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: core_syssvc.h 534 2016-01-16 00:41:40Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ãµã¼ãã¹ã®ã³ã¢ä¾å­é¨ï¼ARMç¨ï¼
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼target_syssvc.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ã
+ *  ããããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ããç´æ¥ã¤
+ *  ã³ã¯ã«ã¼ããã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_CORE_SYSSVC_H
+#define TOPPERS_CORE_SYSSVC_H
+
+#include <t_stddef.h>
+#include "arm.h"
+
+/*
+ *  ããã©ã¼ãã³ã¹ã¢ãã¿ã«ããæ§è½è©ä¾¡
+ */
+#if defined(USE_ARM_PM_HIST) && __TARGET_ARCH_ARM == 7
+
+/*
+ *  ããã©ã¼ãã³ã¹ã¢ãã¿ã®ã«ã¦ã³ã¿ã®ãã¼ã¿å
+ */
+typedef uint32_t	PMCNT;
+
+/*
+ *  ããã©ã¼ãã³ã¹ã¢ãã¿ã®åæå
+ */
+Inline void
+arm_init_pmcnt(void)
+{
+	uint32_t	reg;
+
+	/*
+	 *  ããã©ã¼ãã³ã¹ã¢ãã¿ã®æå¹å
+	 *
+	 *  TOPPERS_ARM_PMCNT_DIV64ãå®ç¾©ããã¦ããå ´åã¯ï¼64ã¯ã­ãã¯æ¯ã«ã«
+	 *  ã¦ã³ãã¢ããããï¼é·ãæéãè¨æ¸¬ãããå ´åã«æå¹ï¼ï¼
+	 */
+	CP15_READ_PMCR(reg);
+	reg |= CP15_PMCR_ALLCNTR_ENABLE;
+
+#ifdef TOPPERS_ARM_PMCNT_DIV64
+	reg |= CP15_PMCR_PMCCNTR_DIVIDER;
+#else /* !TOPPERS_ARM_PMCNT_DIV64 */
+	reg &= ~CP15_PMCR_PMCCNTR_DIVIDER;
+#endif /* TOPPERS_ARM_PMCNT_DIV64 */
+
+	CP15_WRITE_PMCR(reg);
+
+	/*
+	 *  ããã©ã¼ãã³ã¹ã¢ãã¿ã®ã«ã¦ã³ã¿ã®æå¹å
+	 */
+	CP15_READ_PMCNTENSET(reg);
+	reg |= CP15_PMCNTENSET_CCNTR_ENABLE;
+	CP15_WRITE_PMCNTENSET(reg);
+}
+
+/*
+ *  ããã©ã¼ãã³ã¹ã¢ãã¿ã®ã«ã¦ã³ã¿ã®èª­ã¿è¾¼ã¿
+ */
+Inline void 
+arm_get_pmcnt(PMCNT *p_count)
+{
+	CP15_READ_PMCCNTR(*p_count);
+}
+
+/*
+ *  ã«ã¦ã³ã¿å¤ã®æéè¨æ¸¬åä½ã¸ã®å¤æ
+ *
+ *  æéè¨æ¸¬ã®åä½ã¯ï¼0.1ãã¤ã¯ã­ç§ã¨ãã¦ããï¼
+ */
+Inline uint_t
+arm_conv_pmcnt(PMCNT count) {
+#ifdef TOPPERS_ARM_PMCNT_DIV64
+	return(((uint_t) count) * (10 * 64) / CORE_CLK_MHZ);
+#else /* TOPPERS_ARM_PMCNT_DIV64 */
+	return(((uint_t) count) * 10 / CORE_CLK_MHZ);
+#endif /* TOPPERS_ARM_PMCNT_DIV64 */
+}
+
+/*
+ *  å®è¡æéåå¸éè¨ãµã¼ãã¹ã®è¨­å®
+ */
+#define HISTTIM					PMCNT
+#define HIST_GET_TIM(p_time)	(arm_get_pmcnt(p_time))
+#define HIST_CONV_TIM(time)		(arm_conv_pmcnt(time))
+#define HIST_BM_HOOK()			((void) 0)
+
+#endif /* defined(USE_ARM_PM_HIST) && __TARGET_ARCH_ARM == 7 */
+#endif /* TOPPERS_CORE_SYSSVC_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_test.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_test.h	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_test.h	(revision 305)
@@ -4,5 +4,5 @@
  *      Advanced Standard Profile Kernel
  * 
- *  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
  * 
@@ -51,5 +51,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: core_test.h 460 2015-08-29 13:04:06Z ertl-hiro $
+ *  $Id: core_test.h 524 2016-01-14 11:01:56Z ertl-hiro $
  */
 
@@ -146,77 +146,3 @@
 
 #endif
-
-/*
- *  ããã©ã¼ãã³ã¹ã¢ãã¿ã«ããæ§è½è©ä¾¡
- */
-#if defined(USE_ARM_PM_HIST) && __TARGET_ARCH_ARM == 7
-
-/*
- *  ããã©ã¼ãã³ã¹ã¢ãã¿ã®ã«ã¦ã³ã¿ã®ãã¼ã¿å
- */
-typedef uint32_t	PMCNT;
-
-/*
- *  ããã©ã¼ãã³ã¹ã¢ãã¿ã®åæå
- */
-Inline void
-arm_init_pmcnt(void)
-{
-	uint32_t	reg;
-
-	/*
-	 *  ããã©ã¼ãã³ã¹ã¢ãã¿ã®æå¹å
-	 *
-	 *  TOPPERS_ARM_PMCNT_DIV64ãå®ç¾©ããã¦ããå ´åã¯ï¼64ã¯ã­ãã¯æ¯ã«ã«
-	 *  ã¦ã³ãã¢ããããï¼
-	 */
-	CP15_READ_PMCR(reg);
-	reg |= CP15_PMCR_ALLCNTR_ENABLE;
-
-#ifdef TOPPERS_ARM_PMCNT_DIV64
-	reg |= CP15_PMCR_PMCCNTR_DIVIDER;
-#else /* !TOPPERS_ARM_PMCNT_DIV64 */
-	reg &= ~CP15_PMCR_PMCCNTR_DIVIDER;
-#endif /* TOPPERS_ARM_PMCNT_DIV64 */
-
-	CP15_WRITE_PMCR(reg);
-
-	/*
-	 *  ããã©ã¼ãã³ã¹ã¢ãã¿ã®ã«ã¦ã³ã¿ã®æå¹å
-	 */
-	CP15_READ_PMCNTENSET(reg);
-	reg |= CP15_PMCNTENSET_CCNTR_ENABLE;
-	CP15_WRITE_PMCNTENSET(reg);
-}
-
-/*
- *  ããã©ã¼ãã³ã¹ã¢ãã¿ã®ã«ã¦ã³ã¿ã®èª­ã¿è¾¼ã¿
- */
-Inline void 
-arm_get_pmcnt(PMCNT *p_count)
-{
-	CP15_READ_PMCCNTR(*p_count);
-}
-
-/*
- *  ã«ã¦ã³ã¿å¤ã®æéè¨æ¸¬åä½ã¸ã®å¤æ
- *
- *  æéè¨æ¸¬ã®åä½ã¯ï¼ç¾ç¶ã¯ããç§ã«ãªã£ã¦ããï¼ãã¤ã¯ã­ç§åä½ã«ããè¨­
- *  å®ãæ¬²ããã¨æãããï¼ï¼
- */
-Inline uint_t
-arm_conv_time(PMCNT count) {
-#ifdef TOPPERS_ARM_PMCNT_DIV64
-	return(((uint_t) count) * (1000 * 64) / CORE_CLK_MHZ);
-#else /* !TOPPERS_ARM_PMCNT_DIV64 */
-	return(((uint_t) count) * 1000 / CORE_CLK_MHZ);
-#endif /* TOPPERS_ARM_PMCNT_DIV64 */
-}
-
-#define HISTTIM					PMCNT
-#define HIST_GET_TIM(p_time)	(arm_get_pmcnt(p_time))
-#define HIST_CONV_TIM(time)		(arm_conv_tim(time))
-#define HIST_BM_HOOK()			((void) 0)
-
-#endif /* defined(USE_ARM_PM_HIST) && __TARGET_ARCH_ARM == 7 */
 #endif /* TOPPERS_CORE_TEST_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_kernel_impl.c
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_kernel_impl.c	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_kernel_impl.c	(revision 305)
@@ -4,5 +4,5 @@
  *      Advanced Standard Profile Kernel
  *
- *  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
  *
@@ -51,5 +51,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: gic_kernel_impl.c 355 2015-07-25 10:26:02Z ertl-hiro $
+ *  $Id: gic_kernel_impl.c 522 2016-01-14 06:56:53Z ertl-hiro $
  */
 
@@ -177,9 +177,9 @@
 	 */
 	for (i = GIC_INTNO_PPI0 / 16; i < GIC_TNUM_INTNO / 16; i++) {
-#ifdef GIC_ARM11MOCORE
+#ifdef GIC_ARM11MPCORE
 		sil_wrw_mem(GICD_ICFGR(i), 0x55555555U);
-#else /* GIC_ARM11MOCORE */
+#else /* GIC_ARM11MPCORE */
 		sil_wrw_mem(GICD_ICFGR(i), 0x00000000U);
-#endif /* GIC_ARM11MOCORE */
+#endif /* GIC_ARM11MPCORE */
 	}
 
@@ -229,17 +229,17 @@
 
 	if ((intatr & TA_EDGE) != 0U) {
-#ifdef GIC_ARM11MOCORE
+#ifdef GIC_ARM11MPCORE
 		gicd_config(intno, GICD_ICFGRn_EDGE|GICD_ICFGRn_1_N);
-#else /* GIC_ARM11MOCORE */
+#else /* GIC_ARM11MPCORE */
 		gicd_config(intno, GICD_ICFGRn_EDGE);
-#endif /* GIC_ARM11MOCORE */
+#endif /* GIC_ARM11MPCORE */
 		clear_int(intno);
 	}
 	else {
-#ifdef GIC_ARM11MOCORE
+#ifdef GIC_ARM11MPCORE
 		gicd_config(intno, GICD_ICFGRn_LEVEL|GICD_ICFGRn_1_N);
-#else /* GIC_ARM11MOCORE */
+#else /* GIC_ARM11MPCORE */
 		gicd_config(intno, GICD_ICFGRn_LEVEL);
-#endif /* GIC_ARM11MOCORE */
+#endif /* GIC_ARM11MPCORE */
 	}
 
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_kernel_impl.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_kernel_impl.h	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_kernel_impl.h	(revision 305)
@@ -4,5 +4,5 @@
  *      Advanced Standard Profile Kernel
  * 
- *  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
  * 
@@ -51,5 +51,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: gic_kernel_impl.h 377 2015-07-31 00:48:14Z ertl-hiro $
+ *  $Id: gic_kernel_impl.h 535 2016-01-16 00:42:29Z ertl-hiro $
  */
 
@@ -100,4 +100,6 @@
 åº¦ã®æ®µæ°ã256æ®µéã®æã«ãããã¦è¡¨ãï¼
  */
+#define GIC_PRI_LEVEL		(TMAX_INTPRI - TMIN_INTPRI + 2)
+
 #if GIC_PRI_LEVEL == 16
 #define GIC_PRI_SHIFT		4
@@ -128,9 +130,4 @@
 			(((uint_t)((ipm) + (GIC_PRI_LEVEL - 1))) << GIC_PRI_SHIFT)
 
-/* TMIN_INTPRIï¼TMAX_INTPRIã¨ã®æ´åæ§ã®ãã§ãã¯ */
-#if TMAX_INTPRI - TMIN_INTPRI + 2 != GIC_PRI_LEVEL
-#error GIC_PRI_LEVEL does not match TMIN_INTPRI.
-#endif
-
 /*
  *  GICã¬ã¸ã¹ã¿ã®ã¢ãã¬ã¹ãå®ç¾©ããããã®ãã¯ã­
@@ -209,8 +206,8 @@
 #define GICD_ICFGRn_LEVEL	UINT_C(0x00)
 #define GICD_ICFGRn_EDGE	UINT_C(0x02)
-#ifdef GIC_ARM11MOCORE
+#ifdef GIC_ARM11MPCORE
 #define GICD_ICFGRn_N_N		UINT_C(0x00)
 #define GICD_ICFGRn_1_N		UINT_C(0x01)
-#endif /* GIC_ARM11MOCORE */
+#endif /* GIC_ARM11MPCORE */
 
 #ifndef TOPPERS_MACRO_ONLY
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_support.S
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_support.S	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_support.S	(revision 305)
@@ -6,5 +6,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
  * 
@@ -53,5 +53,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: gic_support.S 454 2015-08-16 03:18:46Z ertl-hiro $
+ *  $Id: gic_support.S 522 2016-01-14 06:56:53Z ertl-hiro $
  */
 
@@ -176,5 +176,5 @@
  *
  *  irc_end_excã§ç¨ããæ
-å ±ï¼å²è¾¼ã¿çºçåã®å²è¾¼ã¿åªå
+å ±ï¼CPUä¾å¤çºçåã®å²è¾¼ã¿åªå
 åº¦ãã¹ã¯ï¼ãï¼ã¹ã¿ã
  *	ã¯ã«ä¿å­ããï¼
@@ -207,5 +207,5 @@
 ã«æ»ãï¼
 	 */
-	pop		{r2}				/* irc_begin_intã§ä¿å­ããæ
+	pop		{r2}				/* irc_begin_excã§ä¿å­ããæ
 å ±ãå¾©å¸° */
 	ldr		r1, =GICC_PMR		/* å²è¾¼ã¿åªå
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/sp804.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/sp804.h	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/sp804.h	(revision 305)
@@ -50,9 +50,9 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: sp804.h 440 2015-08-09 02:02:08Z ertl-hiro $
+ *  $Id: sp804.h 530 2016-01-14 15:17:30Z ertl-hiro $
  */
 
 /*
- *		ARM Dual-Timer Moduleï¼SP804ï¼ãµãã¼ãã¢ã¸ã¥ã¼ã«
+ *		ARM Dual-Timer Moduleï¼SP804ï¼ã«é¢ããå®ç¾©
  */
 
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/start.S
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/start.S	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/start.S	(revision 305)
@@ -5,5 +5,5 @@
  *  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
+ *  Copyright (C) 2005-2016 by Embedded and Real-Time Systems Laboratory
  *              Graduate School of Information Science, Nagoya Univ., JAPAN
  * 
@@ -52,5 +52,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: start.S 349 2015-07-25 05:25:27Z ertl-hiro $
+ *  $Id: start.S 540 2016-01-16 02:15:41Z ertl-hiro $
  */
 
@@ -106,13 +106,18 @@
 	 *  BSS_STARTããBSS_ENDã¾ã§ãã¼ã­ã¯ãªã¢ããï¼
 	 */
-	ldr		r1, =BSS_START
+	ldr		r0, =BSS_START
 	ldr		r2, =BSS_END
-	cmp		r1, r2
+	cmp		r0, r2
 	bhs		start_3
-	mov		r0, #0
+	mov		r1, #0
+#ifdef TOPPERS_USE_STDLIB
+	sub		r2, r2, r0
+	bl		memset
+#else /* TOPPERS_USE_STDLIB */
 ALABEL(start_2)
-	str		r0, [r1], #4
-	cmp		r1, r2
+	str		r1, [r0], #4
+	cmp		r0, r2
 	blo		start_2
+#endif /* TOPPERS_USE_STDLIB */
 ALABEL(start_3)
 #endif /* TOPPERS_OMIT_BSS_INIT */
@@ -125,14 +130,19 @@
 	 *  IDATA_STARTããIDATA_ENDã¾ã§ãï¼DATA_STARTä»¥éã«ã³ãã¼ããï¼
 	 */
-	ldr		r1, =DATA_START
-	ldr		r3, =DATA_END
-	cmp		r1, r3
+	ldr		r0, =DATA_START
+	ldr		r2, =DATA_END
+	cmp		r0, r2
 	bhs		start_5
-	ldr		r2, =IDATA_START
+	ldr		r1, =IDATA_START
+#ifdef TOPPERS_USE_STDLIB
+	sub		r2, r2, r0
+	bl		memcpy
+#else /* TOPPERS_USE_STDLIB */
 ALABEL(start_4)
-	ldr		r0, [r2], #4
-	str		r0, [r1], #4
-	cmp		r1, r3
+	ldr		r3, [r1], #4
+	str		r3, [r0], #4
+	cmp		r0, r2
 	blo		start_4
+#endif /* TOPPERS_USE_STDLIB */
 ALABEL(start_5)
 #endif /* TOPPERS_OMIT_DATA_INIT */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_kernel.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_kernel.h	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_kernel.h	(revision 305)
@@ -51,5 +51,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: chip_kernel.h 390 2015-08-01 02:03:34Z ertl-hiro $
+ *  $Id: chip_kernel.h 531 2016-01-14 15:19:13Z ertl-hiro $
  */
 
@@ -67,4 +67,6 @@
 /*
  *  ãµãã¼ãã§ããæ©è½ã®å®ç¾©
+ *
+ *  GICã§ã¯ï¼ena_intï¼dis_intããµãã¼ããããã¨ãã§ããï¼
  */
 #define TOPPERS_TARGET_SUPPORT_ENA_INT		/* ena_int */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_kernel_impl.c
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_kernel_impl.c	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_kernel_impl.c	(revision 305)
@@ -53,5 +53,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: chip_kernel_impl.c 357 2015-07-25 12:05:26Z ertl-hiro $
+ *  $Id: chip_kernel_impl.c 538 2016-01-16 01:27:50Z ertl-hiro $
  */
 
@@ -71,9 +71,4 @@
 {
 	/*
-	 *  ã³ã¢ä¾å­ã®åæå
-	 */
-	core_initialize();
-
-	/*
 	 *  ã­ã£ãã·ã¥ããã£ã¹ã¨ã¼ãã«
 	 */
@@ -81,7 +76,7 @@
 
 	/*
-	 *  MMUãæå¹ã«
+	 *  ã³ã¢ä¾å­ã®åæå
 	 */
-	arm_mmu_initialize();
+	core_initialize();
 
 	/*
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_timer.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_timer.h	(revision 304)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_timer.h	(revision 305)
@@ -53,5 +53,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: chip_timer.h 358 2015-07-26 10:26:23Z ertl-hiro $
+ *  $Id: chip_timer.h 537 2016-01-16 01:26:38Z ertl-hiro $
  */
 
@@ -60,10 +60,10 @@
 èµã¿ã¤ãç¨ï¼
  *
- *  ARM11 MPCoreã«ã¯ï¼ã³ã¢æ¯ã«ã¿ã¤ãã¨ã¦ã©ããããã°ãããï¼ã¦ã©ãããã
- *  ã°ã¯ï¼ã¿ã¤ãã¨ãã¦ä½¿ç¨ãããã¨ãã§ããããï¼ãã®2ã¤ã®ã¿ã¤ããä½¿ã£ã¦
- *  é«åè§£è½ã¿ã¤ããå®ç¾ããï¼å
-·ä½çã«ã¯ï¼ã¦ã©ããããã°ãã¿ã¤ãã¢ã¼ã
- *  ã«è¨­å®ãã¦ç¾å¨æå»ã®ç®¡çã®ããã«ç¨ãï¼ã¿ã¤ããç¸å¯¾æéå²è¾¼ã¿ã®çºç
- *  ã®ããã«ç¨ããï¼
+ *  MPCoreã«ã¯ï¼ã³ã¢æ¯ã«ãã©ã¤ãã¼ãã¿ã¤ãã¨ãã©ã¤ãã¼ãã¦ã©ããããã°
+ *  ãæã¤ï¼ã¦ã©ããããã°ã¯ï¼ã¿ã¤ãã¨ãã¦ä½¿ç¨ãããã¨ãã§ããããï¼ã
+ *  ã®2ã¤ã®ã¿ã¤ããä½¿ã£ã¦é«åè§£è½ã¿ã¤ããå®ç¾ããï¼å
+·ä½çã«ã¯ï¼ã¦ã©ãã
+ *  ããã°ãã¿ã¤ãã¢ã¼ãã«è¨­å®ãã¦ç¾å¨æå»ã®ç®¡çã®ããã«ç¨ãï¼ã¿ã¤ãã
+ *  ç¸å¯¾æéå²è¾¼ã¿ã®çºçã®ããã«ç¨ããï¼
  */
 
Index: asp3_wo_tecs/trunk/configure.rb
===================================================================
--- asp3_wo_tecs/trunk/configure.rb	(revision 304)
+++ asp3_wo_tecs/trunk/configure.rb	(revision 305)
@@ -54,5 +54,5 @@
 #  ã®è²¬ä»»ãè² ããªãï¼
 # 
-#  $Id: configure.rb 575 2016-02-02 23:16:20Z ertl-hiro $
+#  $Id: configure.rb 585 2016-02-05 10:58:56Z ertl-hiro $
 # 
 
@@ -88,9 +88,7 @@
 #						ã®æå®
 #  -V <devtooldir>		éçºãã¼ã«ï¼ã³ã³ãã¤ã©ç­ï¼ã®ç½®ããã¦ãããã£ã¬ã¯ããª
-#  -p <perl>			perlã®ãã¹åï¼æç¤ºçã«æå®ããå ´åï¼
 #  -R <ruby>			rubyã®ãã¹åï¼æç¤ºçã«æå®ããå ´åï¼
 #  -g <cfg>				ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ï¼cfgï¼ã®ãã¹å
 #  -G <tecsgen>			TECSã¸ã§ãã¬ã¼ã¿ï¼tecsgenï¼ã®ãã¹å
-#  -P <prcnum>			ãã­ã»ããµæ°ï¼ãã«ããã­ã»ããµå¯¾å¿ã«ã¼ãã«ã®å ´åï¼
 #  -o <options>			ã³ã³ãã¤ã«ãªãã·ã§ã³ï¼COPTSã«è¿½å ï¼
 #  -O <options>			ã·ã³ãã«å®ç¾©ãªãã·ã§ã³ï¼CDEFSã«è¿½å ï¼
@@ -111,4 +109,9 @@
 #  % ../configure.rb -T ct11mpcore_gcc -O "-DTOPPERS_USE_QEMU" -A tSample2 -t
 #	ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã¯ï¼TECSçã®ãµã³ãã«ãã­ã°ã©ã ã«ãªãï¼
+#
+#  ä½¿ç¨ä¾(4)
+#
+#  % ../configure.rb -T ct11mpcore_gcc PRC_NUM=4
+#	PRC_NUMã4ã«å®ç¾©ããï¼
 
 #
@@ -126,7 +129,5 @@
 $enable_trace = ""
 $devtooldir = ""
-$perl = "perl"
 $ruby = "ruby"
-$prc_num = ""
 $copts = []
 $cdefs = []
@@ -136,5 +137,4 @@
 #  ãªãã·ã§ã³ã®å¦ç
 #
-option = {}
 OptionParser.new(nil, 22) do |opt|
   opt.on("-T target",		"taget name (mandatory)") do |val|
@@ -189,7 +189,4 @@
     $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
@@ -200,7 +197,4 @@
   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|
@@ -307,13 +301,18 @@
 $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()
+ARGV.each do |arg|
+  if /^([A-Za-z0-9_]+)\s*\=\s*(.*)$/ =~ arg
+    $vartable[$1] = $2
+  else
+    $vartable[arg] = true
+  end
+end
 
 #
Index: asp3_wo_tecs/trunk/include/kernel.h
===================================================================
--- asp3_wo_tecs/trunk/include/kernel.h	(revision 304)
+++ asp3_wo_tecs/trunk/include/kernel.h	(revision 305)
@@ -53,5 +53,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: kernel.h 463 2015-10-18 14:25:55Z ertl-hiro $
+ *  $Id: kernel.h 520 2016-01-14 05:06:26Z ertl-hiro $
  */
 
@@ -548,5 +548,5 @@
 #define TKERNEL_PRID	UINT_C(0x0007)	/* ã«ã¼ãã«ã®è­å¥çªå· */
 #define TKERNEL_SPVER	UINT_C(0xf630)	/* ã«ã¼ãã«ä»æ§ã®ãã¼ã¸ã§ã³çªå· */
-#define TKERNEL_PRVER	UINT_C(0x30b0)	/* ã«ã¼ãã«ã®ãã¼ã¸ã§ã³çªå· */
+#define TKERNEL_PRVER	UINT_C(0x3000)	/* ã«ã¼ãã«ã®ãã¼ã¸ã§ã³çªå· */
 
 /*
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 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 # 
-#   $Id: alarm.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: alarm.trb 588 2016-02-05 12:54:58Z ertl-hiro $
 # 
 
@@ -65,5 +65,5 @@
   end
 
-  def prepare(id, params)
+  def prepare(key, params)
     # almatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2491ï¼½
     #ï¼TA_STAä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
@@ -74,8 +74,8 @@
     # éç¥æ
 å ±ã®å¦ç
-    params[:nfyhdr] = generateNotifyHandler(id, params, :almid)
+    params[:nfyhdr] = generateNotifyHandler(key, params, :almid)
   end
 
-  def generateInib(id, params)
+  def generateInib(key, params)
     return("(#{params[:almatr]}), (intptr_t)(#{params[:par1]}), " \
 												"#{params[:nfyhdr]}")
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 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 # 
-#   $Id: cyclic.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: cyclic.trb 588 2016-02-05 12:54:58Z ertl-hiro $
 # 
 
@@ -65,5 +65,5 @@
   end
 
-  def prepare(id, params)
+  def prepare(key, params)
     # cycatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2383ï¼½
     #ï¼TA_STAä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
@@ -84,8 +84,8 @@
     # éç¥æ
 å ±ã®å¦ç
-    params[:nfyhdr] = generateNotifyHandler(id, params, :cycid)
+    params[:nfyhdr] = generateNotifyHandler(key, params, :cycid)
   end
 
-  def generateInib(id, params)
+  def generateInib(key, params)
     return("(#{params[:cycatr]}), (intptr_t)(#{params[:par1]}), " \
 			"#{params[:nfyhdr]}, (#{params[:cyctim]}), (#{params[:cycphs]})")
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 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 # 
-#   $Id: dataqueue.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: dataqueue.trb 588 2016-02-05 12:54:58Z ertl-hiro $
 # 
 
@@ -65,5 +65,5 @@
   end
 
-  def prepare(id, params)
+  def prepare(key, params)
     # dtqatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1669ï¼½
     #ï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
@@ -84,5 +84,5 @@
   end
 
-  def generateInib(id, params)
+  def generateInib(key, params)
     if params[:dtqcnt] > 0
       dtqmb = "_kernel_dtqmb_#{params[:dtqid]}"
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 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 # 
-#   $Id: eventflag.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: eventflag.trb 588 2016-02-05 12:54:58Z ertl-hiro $
 # 
 
@@ -65,5 +65,5 @@
   end
 
-  def prepare(id, params)
+  def prepare(key, params)
     # flgatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1562ï¼½
     #ï¼TA_TPRIï¼TA_WMULï¼TA_CLRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
@@ -78,5 +78,5 @@
   end
 
-  def generateInib(id, params)
+  def generateInib(key, params)
     return("(#{params[:flgatr]}), (#{params[:iflgptn]})")
   end
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 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 # 
-#   $Id: exception.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: exception.trb 588 2016-02-05 12:54:58Z ertl-hiro $
 # 
 
@@ -68,5 +68,5 @@
 #  CPUä¾å¤ãã³ãã©ã«é¢ããã¨ã©ã¼ãã§ãã¯
 #
-$cfgData[:DEF_EXC].each do |id, params|
+$cfgData[:DEF_EXC].each do |key, params|
   # excnoãCPUä¾å¤ãã³ãã©çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3134ï¼½
   if $EXCNO_VALID.index(params[:excno]).nil?
@@ -99,5 +99,5 @@
     #  CPUä¾å¤ãã³ãã©ã®ã¨ã³ããª
     #
-    $cfgData[:DEF_EXC].each do |id, params|
+    $cfgData[:DEF_EXC].each do |key, params|
       $kernelCfgC.add("EXCHDR_ENTRY(#{params[:excno]}, " \
 						"#{params[:excno].val}, #{params[:exchdr]})")
@@ -109,5 +109,5 @@
     #
     $kernelCfgC.add("const EXCINIB _kernel_excinib_table[TNUM_DEF_EXCNO] = {")
-    $cfgData[:DEF_EXC].each_with_index do |(id, params), index|
+    $cfgData[:DEF_EXC].each_with_index do |(key, params), index|
       $kernelCfgC.add(",") if index > 0
       $kernelCfgC.append("\t{ (#{params[:excno]}), (#{params[:excatr]}), " \
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 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 # 
-#   $Id: interrupt.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: interrupt.trb 612 2016-02-08 04:27:57Z ertl-hiro $
 # 
 
@@ -65,5 +65,5 @@
 $kernelCfgH.add("#define TNUM_ISRID\t#{$cfgData[:CRE_ISR].size}")
 
-$cfgData[:CRE_ISR].sort.each do |id, params|
+$cfgData[:CRE_ISR].sort.each do |key, params|
   $kernelCfgH.add("#define #{params[:isrid]}\t#{params[:isrid].val}")
 end
@@ -127,5 +127,5 @@
 #  å²è¾¼ã¿è¦æ±ã©ã¤ã³ã«é¢ããã¨ã©ã¼ãã§ãã¯
 #
-$cfgData[:CFG_INT].each do |id, params|
+$cfgData[:CFG_INT].each do |key, params|
   #	intnoãå²è¾¼ã¿çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI2972ï¼½
   if $INTNO_VALID.index(params[:intno]).nil?
@@ -172,5 +172,5 @@
 #  å²è¾¼ã¿ãã³ãã©ã«é¢ããã¨ã©ã¼ãã§ãã¯
 #
-$cfgData[:DEF_INH].each do |id, params|
+$cfgData[:DEF_INH].each do |key, params|
   # inhnoãå²è¾¼ã¿ãã³ãã©çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3055ï¼½
   if $INHNO_VALID.index(params[:inhno]).nil?
@@ -243,5 +243,5 @@
 #  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ï¼ISRï¼ã«é¢ããã¨ã©ã¼ãã§ãã¯ã¨å²è¾¼ã¿ãã³ãã©ã®çæ
 #
-$cfgData[:CRE_ISR].sort.each do |id, params|
+$cfgData[:CRE_ISR].sort.each do |key, params|
   #	isratrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2998ï¼½
   #ï¼TARGET_ISRATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
@@ -264,10 +264,8 @@
 
 $INTNO_CREISR_VALID.each do |intnoVal|
-  inhnoVal = $toInhnoVal[intnoVal]
-
   # å²è¾¼ã¿çªå·intnoã«å¯¾ãã¦ç»é²ãããISRã®ãªã¹ãã®ä½æ
   isrParamsList = []
-  $cfgData[:CRE_ISR].sort.each do |id, params|
-    if params[:intno] == intnoVal
+  $cfgData[:CRE_ISR].sort.each do |key, params|
+    if params[:intno].val == intnoVal
       isrParamsList.push(params)
     end
@@ -276,4 +274,6 @@
   #	å²è¾¼ã¿çªå·intnoã«å¯¾ãã¦ç»é²ãããISRãå­å¨ããå ´å
   if isrParamsList.size > 0
+    inhnoVal = $toInhnoVal[intnoVal]
+
     # intnoã«å¯¾å¿ããinhnoã«å¯¾ãã¦DEF_INHãããå ´åï¼E_OBJï¼ï¼»NGKI3013ï¼½
     if $cfgData[:DEF_INH].has_key?(inhnoVal)
@@ -312,12 +312,13 @@
     $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|
+    i = 0		# stable sortãè¡ãããã®å¤æ°
+    isrParamsList.sort_by {|params| [ params[:isrpri].val, i += 1 ]} \
+										.each_with_index do |params, index|
       if index > 0
         $kernelCfgC.add
@@ -353,5 +354,5 @@
     #  å²è¾¼ã¿ãã³ãã©ã®ã¨ã³ããª
     #
-    $cfgData[:DEF_INH].each do |id, params|
+    $cfgData[:DEF_INH].each do |key, params|
       if (params[:inhatr] & $TA_NONKERNEL) == 0
         $kernelCfgC.add("INTHDR_ENTRY(#{params[:inhno]}, " \
@@ -365,5 +366,5 @@
     #
     $kernelCfgC.add("const INHINIB _kernel_inhinib_table[TNUM_DEF_INHNO] = {")
-    $cfgData[:DEF_INH].each_with_index do |(id, params), index|
+    $cfgData[:DEF_INH].each_with_index do |(key, params), index|
       $kernelCfgC.add(",") if index > 0
       if (params[:inhatr] & $TA_NONKERNEL) == 0
@@ -402,5 +403,5 @@
   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|
+    $cfgData[:CFG_INT].each_with_index do |(key, params), index|
       $kernelCfgC.add(",") if index > 0
       $kernelCfgC.append("\t{ (#{params[:intno]}), (#{params[:intatr]}), " \
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 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 #
-#   $Id: kernel.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: kernel.trb 588 2016-02-05 12:54:58Z ertl-hiro $
 #
 
@@ -136,5 +136,5 @@
 
     # ãªãã¸ã§ã¯ãã®IDçªå·ã®ãã¯ã­å®ç¾©ã®çæ
-    $cfgData[@api].sort.each do |id, params|
+    $cfgData[@api].sort.each do |key, params|
       $kernelCfgH.add("#define #{params[@objid]}\t#{params[@objid].val}")
     end
@@ -142,6 +142,6 @@
 
     # ãªãã¸ã§ã¯ãã®IDçªå·ãä¿æããå¤æ°
-    if $USE_EXTERNAL_ID
-      $cfgData[@api].sort.each do |id, params|
+    if !$USE_EXTERNAL_ID.nil?
+      $cfgData[@api].sort.each do |key, params|
         $kernelCfgC.add("const ID #{params[@objid]}_id" \
 										" = #{params[@objid].val};")
@@ -157,6 +157,6 @@
     if $cfgData[@api].size > 0
       # äºåæºåï¼ã¨ã©ã¼ãã§ãã¯ï¼ã¡ã¢ãªé åã®çæï¼
-      $cfgData[@api].sort.each do |id, params|
-        prepare(id, params)
+      $cfgData[@api].sort.each do |key, params|
+        prepare(key, params)
       end
 
@@ -171,7 +171,7 @@
       $kernelCfgC.add("const #{@OBJ_S}INIB _kernel_#{@obj_s}inib_table" \
 													"[TNUM_#{@OBJ}ID] = {")
-      $cfgData[@api].sort.each_with_index do |(id, params), index|
+      $cfgData[@api].sort.each_with_index do |(key, params), index|
         $kernelCfgC.add(",") if index > 0
-        $kernelCfgC.append("\t{ " + generateInib(id, params) + " }")
+        $kernelCfgC.append("\t{ " + generateInib(key, params) + " }")
       end
       $kernelCfgC.add
@@ -197,5 +197,5 @@
 #  éç¥ãã³ãã©ã®çæé¢æ°
 #
-def generateNotifyHandler(id, params, objid)
+def generateNotifyHandler(key, params, objid)
   # ãã©ã¡ã¼ã¿ãå¤æ°ã«æ ¼ç´
   nfymode = params[:nfymode]
@@ -376,5 +376,5 @@
 
   # DEF_ICSãããå ´åã®å¦ç
-  params = $cfgData[:DEF_ICS].values[0]
+  params = $cfgData[:DEF_ICS][1]
 
   # istkszãã¿ã¼ã²ããå®ç¾©ã®æå°å¤ï¼TARGET_MIN_ISTKSZï¼æªå®ç¾©ã®å ´åã¯1ï¼
@@ -439,5 +439,5 @@
 
 # ã¨ã©ã¼ãã§ãã¯
-$cfgData[:ATT_INI].each do |id, params|
+$cfgData[:ATT_INI].each do |key, params|
   # iniatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3241ï¼½
   #ï¼TA_NULLã§ãªãå ´åï¼
@@ -453,5 +453,5 @@
 {
 EOS
-$cfgData[:ATT_INI].each do |id, params|
+$cfgData[:ATT_INI].each do |key, params|
   $kernelCfgC.add("\t((INIRTN)(#{params[:inirtn]}))" \
 								"((intptr_t)(#{params[:exinf]}));")
@@ -465,5 +465,5 @@
 
 # ã¨ã©ã¼ãã§ãã¯
-$cfgData[:ATT_TER].each do |id, params|
+$cfgData[:ATT_TER].each do |key, params|
   # teratrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3248ï¼½
   #ï¼TA_NULLã§ãªãå ´åï¼
@@ -479,5 +479,5 @@
 {
 EOS
-$cfgData[:ATT_TER].reverse_each do |id, params|
+$cfgData[:ATT_TER].reverse_each do |key, params|
   $kernelCfgC.add("\t((TERRTN)(#{params[:terrtn]}))" \
 								"((intptr_t)(#{params[:exinf]}));")
@@ -489,5 +489,4 @@
 #
 $kernelCfgH.append(<<EOS)
-
 #endif /* TOPPERS_KERNEL_CFG_H */
 EOS
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 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 # 
-#   $Id: kernel_check.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: kernel_check.trb 588 2016-02-05 12:54:58Z ertl-hiro $
 #  
 
@@ -92,5 +92,5 @@
 $tmax_dtqid = PEEK(SYMBOL("_kernel_tmax_dtqid"), $sizeof_ID)
 
-def checkNotifyHandler(id, params, objid, exinf, nfyhdr)
+def checkNotifyHandler(key, params, objid, exinf, nfyhdr)
   # ãã©ã¡ã¼ã¿ãå¤æ°ã«æ ¼ç´
   nfymode = params[:nfymode]
@@ -244,5 +244,5 @@
 # 
 tinib = SYMBOL("_kernel_tinib_table")
-$cfgData[:CRE_TSK].each do |id, params|
+$cfgData[:CRE_TSK].each do |key, params|
   # ã¿ã¹ã¯ã®å
 é ­çªå°ã®ãã§ãã¯ï¼»NGKI1033ï¼½
@@ -258,5 +258,5 @@
 é ­çªå°ã®ãã§ãã¯ï¼»NGKI1056ï¼½
   if $USE_TSKINICTXB == 1
-    stk = GetStackTskinictxb(id, params)
+    stk = GetStackTskinictxb(key, params)
   else
     stk = PEEK(tinib + $offsetof_TINIB_stk, $sizeof_void_ptr)
@@ -273,39 +273,9 @@
 
 # 
-#  å¨æéç¥ã«é¢ãããã§ãã¯
-# 
-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)
+$cfgData[:CRE_MPF].each do |key, params|
+  mpf = PEEK(mpfinib + $offsetof_MPFINIB_mpf, $sizeof_void_ptr)
 
   # åºå®é·ã¡ã¢ãªãã¼ã«é åã®å
@@ -322,4 +292,34 @@
 
 # 
+#  å¨æéç¥ã«é¢ãããã§ãã¯
+# 
+cycinib = SYMBOL("_kernel_cycinib_table")
+$cfgData[:CRE_CYC].each do |key, params|
+  exinf = PEEK(cycinib + $offsetof_CYCINIB_exinf, $sizeof_intptr_t)
+  nfyhdr = PEEK(cycinib + $offsetof_CYCINIB_nfyhdr, $sizeof_FP)
+
+  #	éç¥æ
+å ±ã®ãã§ãã¯
+  checkNotifyHandler(key, params, :cycid, exinf, nfyhdr)
+
+  cycinib += $sizeof_CYCINIB
+end
+
+# 
+#  ã¢ã©ã¼ã éç¥ã«é¢ãããã§ãã¯
+# 
+alminib = SYMBOL("_kernel_alminib_table")
+$cfgData[:CRE_ALM].each do |key, params|
+  exinf = PEEK(alminib + $offsetof_ALMINIB_exinf, $sizeof_intptr_t)
+  nfyhdr = PEEK(alminib + $offsetof_ALMINIB_nfyhdr, $sizeof_FP)
+
+  #	éç¥æ
+å ±ã®ãã§ãã¯
+  checkNotifyHandler(key, params, :almid, exinf, nfyhdr)
+
+  alminib += $sizeof_ALMINIB
+end
+
+# 
 #  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã«é¢ãããã§ãã¯
 # 
@@ -329,7 +329,7 @@
 é ­çªå°ã®ãã§ãã¯ï¼»NGKI3222ï¼½
 if (istk & ($CHECK_STACK_ALIGN - 1)) != 0
-  error_wrong("E_PAR", $cfgData[:DEF_ICS][0], :istk, "not aligned")
+  error_wrong("E_PAR", $cfgData[:DEF_ICS][1], :istk, "not aligned")
 end
 if $CHECK_STACK_NONNULL == 1 && istk == 0
-  error_wrong("E_PAR", $cfgData[:DEF_ICS][0], :istk, "null")
-end
+  error_wrong("E_PAR", $cfgData[:DEF_ICS][1], :istk, "null")
+end
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 305)
@@ -1,2 +1,3 @@
+USE_EXTERNAL_ID,1,,defined(USE_EXTERNAL_ID)
 SIL_ENDIAN_BIG,1,,defined(SIL_ENDIAN_BIG)
 SIL_ENDIAN_LITTLE,1,,defined(SIL_ENDIAN_LITTLE)
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 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 # 
-#   $Id: mempfix.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: mempfix.trb 588 2016-02-05 12:54:58Z ertl-hiro $
 # 
 
@@ -65,5 +65,5 @@
   end
 
-  def prepare(id, params)
+  def prepare(key, params)
     # mpfatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2225ï¼½
     #ï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
@@ -98,5 +98,5 @@
   end
 
-  def generateInib(id, params)
+  def generateInib(key, params)
     if params[:mpf] == "NULL"
       mpf = "_kernel_mpf_#{params[:mpfid]}"
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 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 # 
-#   $Id: mutex.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: mutex.trb 588 2016-02-05 12:54:58Z ertl-hiro $
 # 
 
@@ -65,5 +65,5 @@
   end
 
-  def prepare(id, params)
+  def prepare(key, params)
     # mtxatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2025ï¼½
     # ï¼TA_NULLï¼TA_TPRIï¼TA_CEILINGã®ãããã§ããªãå ´åï¼
@@ -98,5 +98,5 @@
   end
 
-  def generateInib(id, params)
+  def generateInib(key, params)
     return("(#{params[:mtxatr]}), INT_PRIORITY(#{params[:ceilpri]})")
   end
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 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 # 
-#   $Id: pridataq.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: pridataq.trb 588 2016-02-05 12:54:58Z ertl-hiro $
 # 
 
@@ -66,5 +66,5 @@
   end
 
-  def prepare(id, params)
+  def prepare(key, params)
     # pdqatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1804ï¼½
     #ï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
@@ -92,5 +92,5 @@
   end
 
-  def generateInib(id, params)
+  def generateInib(key, params)
     if params[:pdqcnt] > 0
       pdqmb = "_kernel_pdqmb_#{params[:pdqid]}"
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 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 # 
-#   $Id: semaphore.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: semaphore.trb 588 2016-02-05 12:54:58Z ertl-hiro $
 # 
 
@@ -65,5 +65,5 @@
   end
 
-  def prepare(id, params)
+  def prepare(key, params)
     # sematrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1456ï¼½
     #ï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
@@ -83,5 +83,5 @@
   end
 
-  def generateInib(id, params)
+  def generateInib(key, params)
     return("(#{params[:sematr]}), (#{params[:isemcnt]}), (#{params[:maxsem]})")
   end
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 305)
@@ -53,5 +53,5 @@
 #   ã®è²¬ä»»ãè² ããªãï¼
 # 
-#   $Id: task.trb 572 2016-02-01 14:40:09Z ertl-hiro $
+#   $Id: task.trb 596 2016-02-06 17:08:56Z ertl-hiro $
 # 
 
@@ -65,5 +65,5 @@
   end
 
-  def prepare(id, params)
+  def prepare(key, params)
     # tskatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1028ï¼½
     #ï¼TA_ACTï¼TA_NOACTQUEï¼TARGET_TSKATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
@@ -83,9 +83,4 @@
     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"
@@ -94,4 +89,9 @@
       params[:tinib_stk] = "_kernel_stack_#{params[:tskid]}"
     else
+      # stkszãã¹ã¿ãã¯é åã®ãµã¤ãºã¨ãã¦æ­£ãããªãå ´åï¼»NGKI1056ï¼½
+      if (params[:stksz] & ($CHECK_STKSZ_ALIGN - 1)) != 0
+        error_wrong_id("E_PAR", params, :stksz, :tskid, "not aligned")
+      end
+
       params[:tinib_stksz] = params[:stksz]
       params[:tinib_stk] = "(void *)(#{params[:stk]})"
@@ -99,7 +99,7 @@
   end
 
-  def generateInib(id, params)
+  def generateInib(key, params)
     if $USE_TSKINICTXB == 1
-      tskinictxb = GenerateTskinictxb(id, params)
+      tskinictxb = GenerateTskinictxb(key, params)
     else
       tskinictxb = "#{params[:tinib_stksz]}, #{params[:tinib_stk]}"
@@ -124,5 +124,5 @@
 $kernelCfgC.add("const ID _kernel_torder_table[TNUM_TSKID] = { ")
 $kernelCfgC.append("\t")
-$cfgData[:CRE_TSK].each_with_index do |(id, params), index|
+$cfgData[:CRE_TSK].each_with_index do |(key, params), index|
   $kernelCfgC.append(", ") if index > 0
   $kernelCfgC.append("#{params[:tskid]}")
Index: asp3_wo_tecs/trunk/kernel/time_event.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/time_event.c	(revision 304)
+++ asp3_wo_tecs/trunk/kernel/time_event.c	(revision 305)
@@ -85,22 +85,9 @@
 /*
  *  ã¿ã¤ã ã¤ãã³ããã¼ãæä½ãã¯ã­
- *
- *  PARENTã¨CHILDã®ç´ ç´ãªå®ç¾©ã¯æ¬¡ã®éãã§ãããï¼ããå®è¡å¹çã®è¯ããã¯
- *  ã­å®ç¾©ã¨ãã¦ããï¼
- *  #define PARENT(p_tmevtn) (tmevt_heap + (((p_tmevtn) - tmevt_heap) >> 1))
- *  #define LCHILD(p_tmevtn) (tmevt_heap + (((p_tmevtn) - tmevt_heap) << 1))
- *
- *  ä¸ã®PARENTã®å®ç¾©ã¯ï¼TMEVTNã®é
-åãï¼sizeof(TMEVTN)ã®åä½ã§ã¢ã©ã¤ã³
- *  ããã¦ãããã¨ãæ³å®ãã¦ããï¼ãã®åæãæç«ããªãå ´åã¯ï¼ä¸ã®å®ç¾©
- *  ãä½¿ç¨ããå¿
-è¦ãããï¼
- */
-#define PARENT(p_tmevtn)				/* è¦ªãã¼ããæ±ãã */		\
-		((TMEVTN *)(((((uintptr_t) tmevt_heap)						\
-				+ ((uintptr_t)(p_tmevtn))) >> 1) & ~(sizeof(TMEVTN) - 1)))
-#define LCHILD(p_tmevtn)				/* å·¦ã®å­ãã¼ããæ±ãã */	\
-		((TMEVTN *)((((uintptr_t)(p_tmevtn)) << 1) - ((uintptr_t) tmevt_heap)))
-
+ */
+#define PARENT(p_tmevtn)	(tmevt_heap + (((p_tmevtn) - tmevt_heap) >> 1))
+													/* è¦ªãã¼ããæ±ãã */
+#define LCHILD(p_tmevtn)	(tmevt_heap + (((p_tmevtn) - tmevt_heap) << 1))
+													/* å·¦ã®å­ãã¼ããæ±ãã */
 /*
  *  ã¿ã¤ã ã¤ãã³ããã¼ãä¸­ã®å
Index: asp3_wo_tecs/trunk/sample/Makefile
===================================================================
--- asp3_wo_tecs/trunk/sample/Makefile	(revision 304)
+++ asp3_wo_tecs/trunk/sample/Makefile	(revision 305)
@@ -362,8 +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) \
+	$(CFG) --pass 3 --kernel asp -O $(INCLUDES) -T $(TARGET_CHECK_TRB) \
 				--rom-symbol $(OBJNAME).syms --rom-image $(OBJNAME).srec
 	@echo "configuration check passed"
Index: asp3_wo_tecs/trunk/syssvc/histogram.h
===================================================================
--- asp3_wo_tecs/trunk/syssvc/histogram.h	(revision 304)
+++ asp3_wo_tecs/trunk/syssvc/histogram.h	(revision 305)
@@ -69,5 +69,5 @@
  *  å®è¡æéåå¸è¨æ¸¬ã®åæå
  */
-extern void	init_hist(ID histid, uint_t maxval, uint_t histarea[]);
+extern void	init_hist(ID histid);
 
 /*
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel_impl.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel_impl.h	(revision 304)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel_impl.h	(revision 305)
@@ -78,6 +78,6 @@
  *  GICä¾å­é¨ãä½¿ç¨ããããã®å®ç¾©
  */
+#define GIC_ARM11MPCORE
 #define GIC_TNUM_INTNO	DIC_TNUM_INTNO
-#define GIC_PRI_LEVEL	16
 
 /*
Index: asp3_wo_tecs/trunk/target/dummy_gcc/dummy.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/dummy.h	(revision 304)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/dummy.h	(revision 305)
@@ -66,5 +66,5 @@
 #define TINTNO_HRT		0		/* é«åè§£è½ã¿ã¤ã */
 #define TINTNO_OVRTIMER	1		/* ãªã¼ãã©ã³ã¿ã¤ã */
-#define TINTNO_SIO		2		/* ã·ãªã¢ã«I/Oãã¼ã */
+#define TINTNO_SIO		2		/* SIOãã¼ã */
 
 #endif /* TOPPERS_DUMMY_H */
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel_impl.c
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel_impl.c	(revision 304)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel_impl.c	(revision 305)
@@ -60,4 +60,7 @@
 #include "kernel_impl.h"
 #include "task.h"
+#ifdef TOPPERS_SUPPORT_OVRHDR
+#include "overrun.h"
+#endif /* TOPPERS_SUPPORT_OVRHDR */
 
 /*
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel_impl.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel_impl.h	(revision 304)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel_impl.h	(revision 305)
@@ -65,9 +65,4 @@
 
 #include <kernel.h>
-#ifndef TOPPERS_MACRO_ONLY
-#ifdef TOPPERS_SUPPORT_OVRHDR
-#include "overrun.h"
-#endif /* TOPPERS_SUPPORT_OVRHDR */
-#endif /* TOPPERS_MACRO_ONLY */
 
 /*
Index: asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/Makefile.target
===================================================================
--- asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/Makefile.target	(revision 304)
+++ asp3_wo_tecs/trunk/target/nucleo_f401re_gcc/Makefile.target	(revision 305)
@@ -55,11 +55,4 @@
 
 #
-#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
-#
-#CFG_TABS := $(CFG_TABS) --cfg1-def-table $(TARGETDIR)/target_def.csv
-#CFG1_OUT_LDFLAGS := $(LDFLAGS) -T $(TARGETDIR)/blueninja_ram_cfg1_out.ld
-
-
-#
 #  ä½¿ç¨ããã¿ã¤ã
 #
@@ -91,8 +84,7 @@
 #
 cfg1_out.timestamp: $(TARGETDIR)/target_timer.cfg
-
-#offset.timestamp: 
-#kernel_cfg.timestamp: $(TARGETDIR)/target_kernel.trb
-#check.timestamp: $(TARGETDIR)/target_check.trb
+offset.timestamp: 
+kernel_cfg.timestamp: $(TARGETDIR)/target_kernel.trb
+check.timestamp: $(TARGETDIR)/target_check.trb
 
 #
Index: asp3_wo_tecs/trunk/test/bit_kernel.c
===================================================================
--- asp3_wo_tecs/trunk/test/bit_kernel.c	(revision 304)
+++ asp3_wo_tecs/trunk/test/bit_kernel.c	(revision 305)
@@ -4,5 +4,5 @@
  *      Advanced Standard Profile Kernel
  * 
- *  Copyright (C) 2005-2015 by Embedded and Real-Time Systems Laboratory
+ *  Copyright (C) 2005-2016 by Embedded and Real-Time Systems Laboratory
  *              Graduate School of Information Science, Nagoya Univ., JAPAN
  * 
@@ -51,5 +51,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: bit_kernel.c 456 2015-08-16 06:11:51Z ertl-hiro $
+ *  $Id: bit_kernel.c 554 2016-01-17 13:21:59Z ertl-hiro $
  */
 
@@ -167,4 +167,24 @@
 #endif /* PRIMAP_BIT */
 
+Inline bool_t
+primap_empty(void)
+{
+#ifndef PRIMAP_LEVEL_2
+	return(ready_primap == 0U);
+#else /* PRIMAP_LEVEL_2 */
+	return(ready_primap1 == 0U);
+#endif /* PRIMAP_LEVEL_2 */
+}
+
+Inline uint16_t
+primap_extract_bit(uint_t pri)
+{
+#ifndef PRIMAP_LEVEL_2
+	return(ready_primap & PRIMAP_BIT(pri));
+#else /* PRIMAP_LEVEL_2 */
+	return(ready_primap2[pri / TBIT_PRIMAP] & PRIMAP_BIT(pri % TBIT_PRIMAP));
+#endif /* PRIMAP_LEVEL_2 */
+}
+
 static ER
 bit_schedcb(void)
@@ -178,5 +198,5 @@
 	 */
 	if (enadsp) {
-		if (ready_primap == 0U) {
+		if (primap_empty()) {
 			if (p_schedtsk != NULL) {
 				return(E_SYS_LINENO);
@@ -189,4 +209,22 @@
 		}
 	}
+
+#ifdef PRIMAP_LEVEL_2
+	/*
+	 *  ready_primap1ã¨ready_primap2ã®æ´åæ§ã®æ¤æ»
+	 */
+	for (pri = 0; pri < TNUM_TPRI; pri += TBIT_PRIMAP) {
+		if (ready_primap2[pri / TBIT_PRIMAP] == 0U) {
+			if ((ready_primap1 & PRIMAP_BIT(pri / TBIT_PRIMAP)) != 0U) {
+				return(E_SYS_LINENO);
+			}
+		}
+		else {
+			if ((ready_primap1 & PRIMAP_BIT(pri / TBIT_PRIMAP)) == 0U) {
+				return(E_SYS_LINENO);
+			}
+		}
+	}
+#endif /* PRIMAP_LEVEL_2 */
 
 	/*
@@ -196,10 +234,10 @@
 		p_queue = ready_queue[pri].p_next;
 		if (p_queue == &ready_queue[pri]) {
-			if ((ready_primap & PRIMAP_BIT(pri)) != 0U) {
+			if (primap_extract_bit(pri) != 0U) {
 				return(E_SYS_LINENO);
 			}
 		}
 		else {
-			if ((ready_primap & PRIMAP_BIT(pri)) == 0U) {
+			if (primap_extract_bit(pri) == 0U) {
 				return(E_SYS_LINENO);
 			}
Index: asp3_wo_tecs/trunk/test/perf0.c
===================================================================
--- asp3_wo_tecs/trunk/test/perf0.c	(revision 304)
+++ asp3_wo_tecs/trunk/test/perf0.c	(revision 305)
@@ -50,5 +50,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: perf0.c 506 2016-01-12 01:46:49Z ertl-hiro $
+ *  $Id: perf0.c 509 2016-01-12 06:06:14Z ertl-hiro $
  */
 
@@ -71,10 +71,4 @@
  */
 #define NO_MEASURE	10000U			/* è¨æ¸¬åæ° */
-#define MAX_TIME	1000U			/* å®è¡æéåå¸ãè¨é²ããæå¤§æé */
-
-/*
- *  å®è¡æéåå¸ãè¨é²ããã¡ã¢ãªé å
- */
-static uint_t	histarea1[MAX_TIME + 1];
 
 /*
@@ -86,5 +80,5 @@
 
 	syslog_0(LOG_NOTICE, "Performance evaluation program (0)");
-	init_hist(1, MAX_TIME, histarea1);
+	init_hist(1);
 
 	for (i = 0; i < NO_MEASURE; i++) {
Index: asp3_wo_tecs/trunk/test/perf1.c
===================================================================
--- asp3_wo_tecs/trunk/test/perf1.c	(revision 304)
+++ asp3_wo_tecs/trunk/test/perf1.c	(revision 305)
@@ -50,5 +50,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: perf1.c 506 2016-01-12 01:46:49Z ertl-hiro $
+ *  $Id: perf1.c 509 2016-01-12 06:06:14Z ertl-hiro $
  */
 
@@ -71,11 +71,4 @@
  */
 #define NO_MEASURE	10000U			/* è¨æ¸¬åæ° */
-#define MAX_TIME	1000U			/* å®è¡æéåå¸ãè¨é²ããæå¤§æé */
-
-/*
- *  å®è¡æéåå¸ãè¨é²ããã¡ã¢ãªé å
- */
-static uint_t	histarea1[MAX_TIME + 1];
-static uint_t	histarea2[MAX_TIME + 1];
 
 /*
@@ -121,6 +114,6 @@
 {
 	syslog_0(LOG_NOTICE, "Performance evaluation program (1)");
-	init_hist(1, MAX_TIME, histarea1);
-	init_hist(2, MAX_TIME, histarea2);
+	init_hist(1);
+	init_hist(2);
 
 	act_tsk(TASK1);
Index: asp3_wo_tecs/trunk/test/perf2.c
===================================================================
--- asp3_wo_tecs/trunk/test/perf2.c	(revision 304)
+++ asp3_wo_tecs/trunk/test/perf2.c	(revision 305)
@@ -50,5 +50,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: perf2.c 506 2016-01-12 01:46:49Z ertl-hiro $
+ *  $Id: perf2.c 509 2016-01-12 06:06:14Z ertl-hiro $
  */
 
@@ -73,11 +73,4 @@
  */
 #define NO_MEASURE	10000U			/* è¨æ¸¬åæ° */
-#define MAX_TIME	1000U			/* å®è¡æéåå¸ãè¨é²ããæå¤§æé */
-
-/*
- *  å®è¡æéåå¸ãè¨é²ããã¡ã¢ãªé å
- */
-static uint_t	histarea1[MAX_TIME + 1];
-
 /*
  *  è¨æ¸¬ã«ã¼ãã³
@@ -91,5 +84,5 @@
 
 	ini_pdq(PDQ1);
-	init_hist(1, MAX_TIME, histarea1);
+	init_hist(1);
 
 	for (i = 0; i < n; i++) {
Index: asp3_wo_tecs/trunk/test/perf3.c
===================================================================
--- asp3_wo_tecs/trunk/test/perf3.c	(revision 304)
+++ asp3_wo_tecs/trunk/test/perf3.c	(revision 305)
@@ -50,5 +50,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: perf3.c 506 2016-01-12 01:46:49Z ertl-hiro $
+ *  $Id: perf3.c 509 2016-01-12 06:06:14Z ertl-hiro $
  */
 
@@ -73,10 +73,4 @@
  */
 #define NO_MEASURE	10000U			/* è¨æ¸¬åæ° */
-#define MAX_TIME	1000U			/* å®è¡æéåå¸ãè¨é²ããæå¤§æé */
-
-/*
- *  å®è¡æéåå¸ãè¨é²ããã¡ã¢ãªé å
- */
-static uint_t	histarea1[MAX_TIME + 1];
 
 /*
@@ -109,5 +103,5 @@
 	uint_t		i, j;
 
-	init_hist(1, MAX_TIME, histarea1);
+	init_hist(1);
 
 	for (i = 0; i < NO_MEASURE; i++) {
Index: asp3_wo_tecs/trunk/test/perf4.c
===================================================================
--- asp3_wo_tecs/trunk/test/perf4.c	(revision 304)
+++ asp3_wo_tecs/trunk/test/perf4.c	(revision 305)
@@ -50,5 +50,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: perf4.c 506 2016-01-12 01:46:49Z ertl-hiro $
+ *  $Id: perf4.c 509 2016-01-12 06:06:14Z ertl-hiro $
  */
 
@@ -100,12 +100,4 @@
  */
 #define NO_MEASURE	10000U			/* è¨æ¸¬åæ° */
-#define MAX_TIME	1000U			/* å®è¡æéåå¸ãè¨é²ããæå¤§æé */
-
-/*
- *  å®è¡æéåå¸ãè¨é²ããã¡ã¢ãªé å
- */
-static uint_t	histarea1[MAX_TIME + 1];
-static uint_t	histarea2[MAX_TIME + 1];
-static uint_t	histarea3[MAX_TIME + 1];
 
 /*
@@ -174,7 +166,7 @@
 
 	syslog_0(LOG_NOTICE, "Performance evaluation program (4)");
-	init_hist(1, MAX_TIME, histarea1);
-	init_hist(2, MAX_TIME, histarea2);
-	init_hist(3, MAX_TIME, histarea3);
+	init_hist(1);
+	init_hist(2);
+	init_hist(3);
 
 	/*
Index: asp3_wo_tecs/trunk/test/perf5.c
===================================================================
--- asp3_wo_tecs/trunk/test/perf5.c	(revision 304)
+++ asp3_wo_tecs/trunk/test/perf5.c	(revision 305)
@@ -3,5 +3,5 @@
  *      Toyohashi Open Platform for Embedded Real-Time Systems
  * 
- *  Copyright (C) 2016 by Embedded and Real-Time Systems Laboratory
+ *  Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
  *              Graduate School of Information Science, Nagoya Univ., JAPAN
  * 
@@ -50,5 +50,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: perf5.c 506 2016-01-12 01:46:49Z ertl-hiro $
+ *  $Id: perf5.c 544 2016-01-16 05:34:11Z ertl-hiro $
  */
 
@@ -71,15 +71,4 @@
  */
 #define NO_MEASURE	10000U			/* è¨æ¸¬åæ° */
-#define MAX_TIME	1000U			/* å®è¡æéåå¸ãè¨é²ããæå¤§æé */
-
-/*
- *  å®è¡æéåå¸ãè¨é²ããã¡ã¢ãªé å
- */
-static uint_t	histarea1[MAX_TIME + 1];
-static uint_t	histarea2[MAX_TIME + 1];
-static uint_t	histarea3[MAX_TIME + 1];
-static uint_t	histarea4[MAX_TIME + 1];
-static uint_t	histarea5[MAX_TIME + 1];
-static uint_t	histarea6[MAX_TIME + 1];
 
 /*
@@ -123,10 +112,10 @@
 
 	syslog_0(LOG_NOTICE, "Performance evaluation program (5)");
-	init_hist(1, MAX_TIME, histarea1);
-	init_hist(2, MAX_TIME, histarea2);
-	init_hist(3, MAX_TIME, histarea3);
-	init_hist(4, MAX_TIME, histarea4);
-	init_hist(5, MAX_TIME, histarea5);
-	init_hist(6, MAX_TIME, histarea6);
+	init_hist(1);
+	init_hist(2);
+	init_hist(3);
+	init_hist(4);
+	init_hist(5);
+	init_hist(6);
 
 	/*
Index: asp3_wo_tecs/trunk/test/test_dtq1.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_dtq1.c	(revision 305)
+++ asp3_wo_tecs/trunk/test/test_dtq1.c	(revision 305)
@@ -0,0 +1,668 @@
+/*
+ *  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_dtq1.c 602 2016-02-07 12:22:32Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¼ã¿ã­ã¥ã¼æ©è½ã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *	snd_dtqã®æ¯èãã®ãã¹ãï¼»NGKI1718ï¼½
+ *	  ã»snd_dtqã«é¢ãããã¹ã¦ã®è¦æ±ããã¹ãããï¼
+ *	  ã»snd_dtqé¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
+ *	snd_dtqãå¼ã³åºããã¼ã¿ã­ã¥ã¼æ©è½å
+é¨é¢æ°ã®ãã¹ã
+ *	  ã»send_dataé¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
+ *	  ã»enqueue_dataé¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
+ *	rcv_dtqã®æ¯èãã®ãã¹ãï¼»NGKI1751ï¼½
+ *	  ã»rcv_dtqã«é¢ãããã¹ã¦ã®è¦æ±ããã¹ãããï¼
+ *	  ã»rcv_dtqé¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
+ *	rcv_dtqãå¼ã³åºããã¼ã¿ã­ã¥ã¼æ©è½å
+é¨é¢æ°ã®ãã¹ã
+ *	  ã»receive_dataé¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
+ *	  ã»dequeue_dataé¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) snd_dtqã®ã¨ã©ã¼æ¤åº
+ *		(A-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãï¼»NGKI1722ï¼½
+ *		(A-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºãï¼»NGKI1724ï¼½
+ *		(A-3) ãã£ã¹ãããä¿çç¶æ
+ããã®å¼åºãï¼»NGKI1725ï¼½
+ *			(A-3-1) ãã£ã¹ãããç¦æ­¢ç¶æ
+
+ *			(A-3-2) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªãç¶æ
+
+ *		(A-4) dtqidãä¸æ­£ï¼»NGKI1727ï¼½
+ *			(A-4-1) å°ãããã
+ *			(A-4-2) å¤§ãããã
+ *		(A-5) å¾
+ã¡ç¶æ
+ã®å¼·å¶è§£é¤ï¼»NGKI1732ï¼½
+ *		(A-6) ã¿ã¹ã¯ã®çµäºè¦æ±ï¼»NGKI3459ï¼½
+ *			(A-6-1) å¼ã³åºãæç¹ã§çµäºè¦æ±ãã©ã°ãã»ãã
+ *			(A-6-2) å¾
+ã¡ç¶æ
+ã«ãªã£ãå¾ã«çµäºè¦æ±
+ *		(A-7) å¾
+ã¡ãªãã¸ã§ã¯ãã®åé¤ã¾ãã¯ååæåï¼»NGKI1733ï¼½
+ *	  â»ASPã«ã¼ãã«ã«é©ç¨ãããªãè¦æ±ï¼
+ *			ï¼»NGKI1726ï¼½ï¼»NGKI1729ï¼½ï¼»NGKI1730ï¼½
+ *	(B) snd_dtqã®æ­£å¸¸ç³»å¦ç
+ *		(B-1) åä¿¡å¾
+ã¡è¡åä¸­ã®ã¿ã¹ã¯ãå¾
+ã¡è§£é¤ï¼»NGKI1734ï¼½
+ *		(B-2) å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ã«E_OKãè¿ãï¼»NGKI1735ï¼½
+ *		(B-3) ãã¼ã¿ãFIFOé ã§ç®¡çé åã«æ ¼ç´ï¼»NGKI1736ï¼½
+ *			(B-3-1) ç®¡çé åãç©ºã®æ
+ *			(B-3-2) ç®¡çé åãç©ºã§ãªãæ
+ *		(B-4) ç®¡çé åã«ã¹ãã¼ã¹ããªãéä¿¡å¾
+ã¡ç¶æ
+ã«ï¼»NGKI1737ï¼½
+ *	(C) snd_dtqã®C1ã«ãã¬ãã¸
+ *	  â»ããã¾ã§ã®ãã¹ãã§æå¹ãªãã®
+ *			(A-1)(A-2)(A-3)(A-4-1)(A-4-2)(A-6-1)(B-1)(B-4)
+ *			â»(B-1)ã¯(B-3)ã«ä»£ãã¦ããã
+ *	  â»(B-1)ã®åè§£ãå¿
+è¦
+ *		(C-1) åä¿¡å¾
+ã¡ã¿ã¹ã¯ãå¾
+ã¡è§£é¤ãã¦ã¿ã¹ã¯åæããçºç
+ *		(C-2) åä¿¡å¾
+ã¡ã¿ã¹ã¯ãå¾
+ã¡è§£é¤ãã¦ã¿ã¹ã¯åæããçºçããªã
+ *	(D) send_datqã®C1ã«ãã¬ãã¸
+ *	  â»ããã¾ã§ã®ãã¹ãã§æå¹ãªãã®ï¼ä¸è¶³ã¯ãªãï¼
+ *			(B-1)(B-3)(B-4)
+ *	(E) enqueue_dataã®C1ã«ãã¬ãã¸
+ *	  â»(B-3)ã®åè§£ãå¿
+è¦
+ *		(E-1) ç®¡çé åãå¾ªç°ããªãï¼æ«å°¾ã«å°éããªãï¼
+ *		(E-2) ç®¡çé åãå¾ªç°ï¼æ«å°¾ã«å°éï¼
+ *	(F) rcv_dtqã®ã¨ã©ã¼æ¤åº
+ *		(F-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãï¼»NGKI1754ï¼½
+ *		(F-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºãï¼»NGKI1755ï¼½
+ *		(F-3) ãã£ã¹ãããä¿çç¶æ
+ããã®å¼åºãï¼»NGKI1756ï¼½
+ *			(F-3-1) ãã£ã¹ãããç¦æ­¢ç¶æ
+
+ *			(F-3-2) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªãç¶æ
+
+ *		(F-4) dtqidãä¸æ­£ï¼»NGKI1758ï¼½
+ *			(F-4-1) å°ãããã
+ *			(F-4-2) å¤§ãããã
+ *		(F-5) å¾
+ã¡ç¶æ
+ã®å¼·å¶è§£é¤ï¼»NGKI1764ï¼½
+ *		(F-6) ã¿ã¹ã¯ã®çµäºè¦æ±ï¼»NGKI3460ï¼½
+ *			(F-6-1) å¼ã³åºãæç¹ã§çµäºè¦æ±ãã©ã°ãã»ãã
+ *			(F-6-2) å¾
+ã¡ç¶æ
+ã«ãªã£ãå¾ã«çµäºè¦æ±
+ *		(F-7) å¾
+ã¡ãªãã¸ã§ã¯ãã®åé¤ã¾ãã¯ååæåï¼»NGKI1765ï¼½
+ *	  â»ASPã«ã¼ãã«ã«é©ç¨ãããªãè¦æ±ï¼
+ *			ï¼»NGKI1757ï¼½ï¼»NGKI1760ï¼½ï¼»NGKI1761ï¼½ï¼»NGKI1762ï¼½
+ *	(G) rcv_dtqã®æ­£å¸¸ç³»å¦ç
+ *		(G-1) åä¿¡ãããã¼ã¿ã¯p_dataãæãã¡ã¢ãªé åã«ï¼»NGKI3421ï¼½
+ *		(G-2) ç®¡çé åã®å
+é ­ã®ãã¼ã¿ãåä¿¡ï¼»NGKI1766ï¼½
+ *		(G-3) éä¿¡å¾
+ã¡è¡åä¸­ã®ã¿ã¹ã¯ãå¾
+ã¡è§£é¤ï¼»NGKI1767ï¼½
+ *		(G-4) å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ã«E_OKãè¿ãï¼»NGKI1768ï¼½
+ *		(G-5) éä¿¡å¾
+ã¡è¡åä¸­ã®ã¿ã¹ã¯ã®éä¿¡ãã¼ã¿ãåä¿¡ï¼»NGKI1769ï¼½
+ *		(G-6) éä¿¡å¾
+ã¡è¡åä¸­ã®ã¿ã¹ã¯ãå¾
+ã¡è§£é¤ï¼»NGKI3422ï¼½
+ *		(G-7) å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ã«E_OKãè¿ãï¼»NGKI1770ï¼½
+ *		(G-8) åä¿¡ãã¹ããã¼ã¿ããªãåä¿¡å¾
+ã¡ç¶æ
+ã«ï¼»NGKI1771ï¼½
+ *	  â»(G-5)(G-6)(G-7)ã¯æ ¼ç´ã§ãããã¼ã¿æ°ã0ã®å ´åã®ã¿çºçããæ¡ä»¶
+ *	(H) rcv_dtqã®C1ã«ãã¬ãã¸
+ *	  â»ããã¾ã§ã®ãã¹ãã§æå¹ãªãã®
+ *			(F-1)(F-2)(F-3)(F-4-1)(F-4-2)(F-6-1)(G-2)(G-8)
+ *			â»(G-2)ã¯(G-5)ã«ä»£ãã¦ããã
+ *	  â»(G-2)ã®åè§£ãå¿
+è¦
+ *		(H-1) éä¿¡å¾
+ã¡ã¿ã¹ã¯ãå¾
+ã¡è§£é¤ãã¦ã¿ã¹ã¯åæããçºç
+ *		(H-2) ã¿ã¹ã¯åæããçºçããªã
+ *	  â»(G-8)ã®åè§£ãå¿
+è¦
+ *		(H-3) å¾
+ã¡ç¶æ
+ããæ­£å¸¸çµäºï¼E_OKï¼
+ *		(H-4) å¾
+ã¡ç¶æ
+ããã¨ã©ã¼çµäºï¼E_OKä»¥å¤ï¼ â (A-5)ã§ã«ãã¼
+ *	(I) receive_datqã®C1ã«ãã¬ãã¸
+ *	  â»ããã¾ã§ã®ãã¹ãã§æå¹ãªãã®
+ *			(G-2)(G-3)(G-5)(G-8)
+ *	  â»(G-2)ã®åè§£ãå¿
+è¦
+ *		(I-1) éä¿¡å¾
+ã¡è¡åãç©º
+ *		(I-2) éä¿¡å¾
+ã¡è¡åãç©ºã§ãªã â (G-3)ã§ã«ãã¼
+ *	(J) dequeue_dataã®C1ã«ãã¬ãã¸
+ *	  â»(G-2)ã®åè§£ãå¿
+è¦
+ *		(J-1) ç®¡çé åãå¾ªç°ããªãï¼æ«å°¾ã«å°éããªãï¼
+ *		(J-2) ç®¡çé åãå¾ªç°ï¼æ«å°¾ã«å°éï¼
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	TASK2: é«åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *  DTQ1:  TA_NULLå±æ§ï¼æ ¼ç´ã§ãããã¼ã¿æ°2
+ *  DTQ2:  TA_NULLå±æ§ï¼æ ¼ç´ã§ãããã¼ã¿æ°0
+ *  DTQ3:  TA_TPRIå±æ§ï¼æ ¼ç´ã§ãããã¼ã¿æ°2 â¦ ä½¿ã£ã¦ããªã
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	1:	ref_dtq(DTQ1, &rdtq)
+ *		assert(rdtq.stskid == TSK_NONE)
+ *		assert(rdtq.rtskid == TSK_NONE)
+ *		assert(rdtq.sdtqcnt == 0)
+ *		loc_cpu()
+ *		snd_dtq(DTQ1, DATA0) -> E_CTX					... (A-2)
+ *		rcv_dtq(DTQ1, &data) -> E_CTX					... (F-2)
+ *		unl_cpu()
+ *		dis_dsp()
+ *		snd_dtq(DTQ1, DATA0) -> E_CTX					... (A-3-1)
+ *		rcv_dtq(DTQ1, &data) -> E_CTX					... (F-3-1)
+ *		ena_dsp()
+ *		chg_ipm(TMAX_INTPRI)
+ *		snd_dtq(DTQ1, DATA0) -> E_CTX					... (A-3-2)
+ *		rcv_dtq(DTQ1, &data) -> E_CTX					... (F-3-2)
+ *		chg_ipm(TIPM_ENAALL)
+ *		snd_dtq(0, DATA0) -> E_ID						... (A-4-1)
+ *		rcv_dtq(0, &data) -> E_ID						... (F-4-1)
+ *		snd_dtq(TNUM_DTQID+1, DATA0) -> E_ID			... (A-4-2)
+ *		rcv_dtq(TNUM_DTQID+1, &data) -> E_ID			... (F-4-2)
+ *		act_tsk(TASK3)
+ *	2:	act_tsk(TASK2)
+ *	== TASK2ï¼åªå
+åº¦ï¼é«ï¼==
+ *	3:	rcv_dtq(DTQ1, &data)							... (G-8)(H-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	4:	snd_dtq(DTQ1, DATA1)							... (B-1)(C-1)
+ *	== TASK2ï¼ç¶ãï¼==									... (B-2)
+ *	5:	assert(data == DATA1)							... (G-1)
+ *	6:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	7:	rcv_dtq(DTQ1, &data)
+ *	== TASK3ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	8:	wup_tsk(TASK2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	9:	snd_dtq(DTQ1, DATA2)							... (B-1)(C-2)
+ *	10:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	11:	assert(data == DATA2)
+ *		snd_dtq(DTQ1, DATA3)							... (B-3-1)(E-1)
+ *		ref_dtq(DTQ1, &rdtq)
+ *		assert(rdtq.stskid == TSK_NONE)
+ *		assert(rdtq.rtskid == TSK_NONE)
+ *		assert(rdtq.sdtqcnt == 1)
+ *		snd_dtq(DTQ1, DATA4)							... (B-3-2)(E-2)
+ *		ref_dtq(DTQ1, &rdtq)
+ *		assert(rdtq.stskid == TSK_NONE)
+ *		assert(rdtq.rtskid == TSK_NONE)
+ *		assert(rdtq.sdtqcnt == 2)
+ *		snd_dtq(DTQ1, DATA5)							... (B-4)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	12:	rcv_dtq(DTQ1, &data)							... (G-2)(G-3)(H-1)(J-1)
+ *	== TASK1ï¼ç¶ãï¼==									... (G-4)
+ *	13:	slp_tsk()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	14:	assert(data == DATA3)
+ *		rcv_dtq(DTQ1, &data)							... (G-2)(H-2)(I-1)(J-2)
+ *		assert(data == DATA4)
+ *		rcv_dtq(DTQ1, &data)
+ *		assert(data == DATA5)
+ *	15:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	16:	snd_dtq(DTQ2, DATA1)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	17:	rcv_dtq(DTQ2, &data)							... (G-5)(G-6)
+ *	== TASK1ï¼ç¶ãï¼==									... (G-7)
+ *	18:	slp_tsk()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	19:	assert(data == DATA1)
+ *	20:	sta_alm(ALM1, 10000U)
+ *	21:	rcv_dtq(DTQ2, &data)
+ *	== ALM1 ==
+ *	22:	snd_dtq(DTQ2, DATA0) -> E_CTX					... (A-1)
+ *		rcv_dtq(DTQ2, &data) -> E_CTX					... (F-1)
+ *		psnd_dtq(DTQ2, DATA2)
+ *	23:	RETURN
+ *	== TASK3ï¼ç¶ãï¼==
+ *	24:	assert(data == DATA2)
+ *	25:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	26:	snd_dtq(DTQ2, DATA0) -> E_RLWAI					... (A-5)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	27:	rel_wai(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	28:	snd_dtq(DTQ2, DATA0) -> E_DLT					... (A-7)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	29:	ini_dtq(DTQ2)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	30:	dis_ter()
+ *	31:	snd_dtq(DTQ2, DATA0) -> E_RASTER				... (A-6-2)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	32:	ras_ter(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	33:	snd_dtq(DTQ2, DATA0) -> E_RASTER				... (A-6-1)
+ *	34:	wup_tsk(TASK2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	35:	rcv_dtq(DTQ2, &data) -> E_RLWAI					... (F-5)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	36:	ena_ter()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	37:	rel_wai(TASK2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	38:	rcv_dtq(DTQ2, &data) -> E_DLT					... (F-7)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	39:	ini_dtq(DTQ2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	40:	dis_ter()
+ *	41:	rcv_dtq(DTQ2, &data) -> E_RASTER				... (F-6-2)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	42:	ras_ter(TASK2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	43:	rcv_dtq(DTQ2, &data) -> E_RASTER				... (F-6-1)
+ *	44:	ena_ter()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	45:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_dtq1.h"
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	intptr_t	data;
+
+	check_point(22);
+	ercd = snd_dtq(DTQ2, DATA0);
+	check_ercd(ercd, E_CTX);
+
+	ercd = rcv_dtq(DTQ2, &data);
+	check_ercd(ercd, E_CTX);
+
+	ercd = psnd_dtq(DTQ2, DATA2);
+	check_ercd(ercd, E_OK);
+
+	check_point(23);
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RDTQ	rdtq;
+	intptr_t	data;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	ercd = ref_dtq(DTQ1, &rdtq);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rdtq.stskid == TSK_NONE);
+
+	check_assert(rdtq.rtskid == TSK_NONE);
+
+	check_assert(rdtq.sdtqcnt == 0);
+
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	ercd = snd_dtq(DTQ1, DATA0);
+	check_ercd(ercd, E_CTX);
+
+	ercd = rcv_dtq(DTQ1, &data);
+	check_ercd(ercd, E_CTX);
+
+	ercd = unl_cpu();
+	check_ercd(ercd, E_OK);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	ercd = snd_dtq(DTQ1, DATA0);
+	check_ercd(ercd, E_CTX);
+
+	ercd = rcv_dtq(DTQ1, &data);
+	check_ercd(ercd, E_CTX);
+
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	ercd = chg_ipm(TMAX_INTPRI);
+	check_ercd(ercd, E_OK);
+
+	ercd = snd_dtq(DTQ1, DATA0);
+	check_ercd(ercd, E_CTX);
+
+	ercd = rcv_dtq(DTQ1, &data);
+	check_ercd(ercd, E_CTX);
+
+	ercd = chg_ipm(TIPM_ENAALL);
+	check_ercd(ercd, E_OK);
+
+	ercd = snd_dtq(0, DATA0);
+	check_ercd(ercd, E_ID);
+
+	ercd = rcv_dtq(0, &data);
+	check_ercd(ercd, E_ID);
+
+	ercd = snd_dtq(TNUM_DTQID+1, DATA0);
+	check_ercd(ercd, E_ID);
+
+	ercd = rcv_dtq(TNUM_DTQID+1, &data);
+	check_ercd(ercd, E_ID);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(4);
+	ercd = snd_dtq(DTQ1, DATA1);
+	check_ercd(ercd, E_OK);
+
+	check_point(7);
+	ercd = rcv_dtq(DTQ1, &data);
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	check_assert(data == DATA2);
+
+	ercd = snd_dtq(DTQ1, DATA3);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_dtq(DTQ1, &rdtq);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rdtq.stskid == TSK_NONE);
+
+	check_assert(rdtq.rtskid == TSK_NONE);
+
+	check_assert(rdtq.sdtqcnt == 1);
+
+	ercd = snd_dtq(DTQ1, DATA4);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_dtq(DTQ1, &rdtq);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rdtq.stskid == TSK_NONE);
+
+	check_assert(rdtq.rtskid == TSK_NONE);
+
+	check_assert(rdtq.sdtqcnt == 2);
+
+	ercd = snd_dtq(DTQ1, DATA5);
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(16);
+	ercd = snd_dtq(DTQ2, DATA1);
+	check_ercd(ercd, E_OK);
+
+	check_point(18);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(26);
+	ercd = snd_dtq(DTQ2, DATA0);
+	check_ercd(ercd, E_RLWAI);
+
+	check_point(28);
+	ercd = snd_dtq(DTQ2, DATA0);
+	check_ercd(ercd, E_DLT);
+
+	check_point(30);
+	ercd = dis_ter();
+	check_ercd(ercd, E_OK);
+
+	check_point(31);
+	ercd = snd_dtq(DTQ2, DATA0);
+	check_ercd(ercd, E_RASTER);
+
+	check_point(33);
+	ercd = snd_dtq(DTQ2, DATA0);
+	check_ercd(ercd, E_RASTER);
+
+	check_point(34);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(36);
+	ercd = ena_ter();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	intptr_t	data;
+
+	check_point(3);
+	ercd = rcv_dtq(DTQ1, &data);
+	check_ercd(ercd, E_OK);
+
+	check_point(5);
+	check_assert(data == DATA1);
+
+	check_point(6);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(9);
+	ercd = snd_dtq(DTQ1, DATA2);
+	check_ercd(ercd, E_OK);
+
+	check_point(10);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(35);
+	ercd = rcv_dtq(DTQ2, &data);
+	check_ercd(ercd, E_RLWAI);
+
+	check_point(38);
+	ercd = rcv_dtq(DTQ2, &data);
+	check_ercd(ercd, E_DLT);
+
+	check_point(40);
+	ercd = dis_ter();
+	check_ercd(ercd, E_OK);
+
+	check_point(41);
+	ercd = rcv_dtq(DTQ2, &data);
+	check_ercd(ercd, E_RASTER);
+
+	check_point(43);
+	ercd = rcv_dtq(DTQ2, &data);
+	check_ercd(ercd, E_RASTER);
+
+	check_point(44);
+	ercd = ena_ter();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	intptr_t	data;
+
+	check_point(8);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(12);
+	ercd = rcv_dtq(DTQ1, &data);
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	check_assert(data == DATA3);
+
+	ercd = rcv_dtq(DTQ1, &data);
+	check_ercd(ercd, E_OK);
+
+	check_assert(data == DATA4);
+
+	ercd = rcv_dtq(DTQ1, &data);
+	check_ercd(ercd, E_OK);
+
+	check_assert(data == DATA5);
+
+	check_point(15);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(17);
+	ercd = rcv_dtq(DTQ2, &data);
+	check_ercd(ercd, E_OK);
+
+	check_point(19);
+	check_assert(data == DATA1);
+
+	check_point(20);
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(21);
+	ercd = rcv_dtq(DTQ2, &data);
+	check_ercd(ercd, E_OK);
+
+	check_point(24);
+	check_assert(data == DATA2);
+
+	check_point(25);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(27);
+	ercd = rel_wai(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(29);
+	ercd = ini_dtq(DTQ2);
+	check_ercd(ercd, E_OK);
+
+	check_point(32);
+	ercd = ras_ter(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(37);
+	ercd = rel_wai(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(39);
+	ercd = ini_dtq(DTQ2);
+	check_ercd(ercd, E_OK);
+
+	check_point(42);
+	ercd = ras_ter(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_finish(45);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_dtq1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_dtq1.cfg	(revision 305)
+++ asp3_wo_tecs/trunk/test/test_dtq1.cfg	(revision 305)
@@ -0,0 +1,18 @@
+/*
+ *		ãã¼ã¿ã­ã¥ã¼æ©è½ã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: test_dtq1.cfg 602 2016-02-07 12:22:32Z ertl-hiro $
+ */
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_dtq1.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_DTQ(DTQ1, { TA_NULL, 2, NULL });
+CRE_DTQ(DTQ2, { TA_NULL, 0, NULL });
+CRE_DTQ(DTQ3, { TA_TPRI, 2, NULL });
Index: asp3_wo_tecs/trunk/test/test_dtq1.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_dtq1.h	(revision 305)
+++ asp3_wo_tecs/trunk/test/test_dtq1.h	(revision 305)
@@ -0,0 +1,52 @@
+/*
+ *		ãã¼ã¿ã­ã¥ã¼æ©è½ã®ãã¹ã(1)ã®ããããã¡ã¤ã«
+ *
+ *  $Id: test_dtq1.h 602 2016-02-07 12:22:32Z ertl-hiro $
+ */
+
+#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 */
+
+/*
+ *  éåä¿¡ãããã¼ã¿ã®å®ç¾©
+ */
+#define	DATA0		((intptr_t) 0)
+#define	DATA1		((intptr_t) 1)
+#define	DATA2		((intptr_t) 2)
+#define	DATA3		((intptr_t) 3)
+#define	DATA4		((intptr_t) 4)
+#define	DATA5		((intptr_t) 5)
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+#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_flg1.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_flg1.c	(revision 304)
+++ asp3_wo_tecs/trunk/test/test_flg1.c	(revision 305)
@@ -50,5 +50,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: test_flg1.c 579 2016-02-03 07:29:11Z ertl-hiro $
+ *  $Id: test_flg1.c 599 2016-02-07 03:33:35Z ertl-hiro $
  */
 
@@ -169,8 +169,4 @@
  *	TASK3: ä½åªå
 åº¦ã¿ã¹ã¯
- *	TASK4: ä¸­åªå
-åº¦ã¿ã¹ã¯
- *	TASK5: ä¸­åªå
-åº¦ã¿ã¹ã¯
  *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
  *  FLG1:  TA_NULLå±æ§ï¼åæããããã¿ã¼ã³0x00
@@ -191,5 +187,4 @@
  *	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()
@@ -343,5 +338,5 @@
 #include "syssvc/test_svc.h"
 #include "kernel_cfg.h"
-#include "test_sem1.h"
+#include "test_flg1.h"
 
 /* DO NOT DELETE THIS LINE -- gentest depends on it. */
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 305)
@@ -3,5 +3,5 @@
  *      Toyohashi Open Platform for Embedded Real-Time Systems
  * 
- *  Copyright (C) 2008-2014 by Embedded and Real-Time Systems Laboratory
+ *  Copyright (C) 2015-2016 by Embedded and Real-Time Systems Laboratory
  *              Graduate School of Information Science, Nagoya Univ., JAPAN
  * 
@@ -50,9 +50,9 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: test_flg1.h 579 2016-02-03 07:29:11Z ertl-hiro $
+ *  $Id: test_flg1.h 599 2016-02-07 03:33:35Z ertl-hiro $
  */
 
 /* 
- *		ã»ããã©æ©è½ã®ãã¹ã(1)
+ *		ã¤ãã³ããã©ã°æ©è½ã®ãã¹ã(1)
  */
 
Index: asp3_wo_tecs/trunk/test/test_raster2.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_raster2.c	(revision 304)
+++ asp3_wo_tecs/trunk/test/test_raster2.c	(revision 305)
@@ -50,5 +50,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: test_raster2.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ *  $Id: test_raster2.c 603 2016-02-07 12:42:10Z ertl-hiro $
  */
 
@@ -124,5 +124,5 @@
 ã«ï¼»NGKI1178ï¼½
  *	ASPã«ã¼ãã«ã«é©ç¨ãããªãè¦æ±ï¼
- *		ï¼»NGKI3485ï¼½ï¼»NGKI3490ï¼½ï¼»NGKI3497ï¼½
+ *		ï¼»NGKI3764ï¼½ï¼»NGKI3765ï¼½ï¼»NGKI3497ï¼½
  *
  * ãä½¿ç¨ãªã½ã¼ã¹ã
Index: asp3_wo_tecs/trunk/test/testexec.rb
===================================================================
--- asp3_wo_tecs/trunk/test/testexec.rb	(revision 305)
+++ asp3_wo_tecs/trunk/test/testexec.rb	(revision 305)
@@ -0,0 +1,346 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+#
+#  TOPPERS Software
+#      Toyohashi Open Platform for Embedded Real-Time Systems
+# 
+#  Copyright (C) 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: testexec.rb 600 2016-02-07 11:46:22Z ertl-hiro $
+# 
+
+require "pp"
+
+#
+#  ãã¹ããã­ã°ã©ã æ¯ã«å¿
+è¦ãªãªãã·ã§ã³ã®å®ç¾©
+#
+TEST_SPEC = {
+  # æ©è½ãã¹ããã­ã°ã©ã 
+  "cpuexc1"  => { :SRC=>"test_cpuexc1", :CFG=>"test_cpuexc" },
+  "cpuexc2"  => { :SRC=>"test_cpuexc2", :CFG=>"test_cpuexc" },
+  "cpuexc3"  => { :SRC=>"test_cpuexc3", :CFG=>"test_cpuexc" },
+  "cpuexc4"  => { :SRC=>"test_cpuexc4", :CFG=>"test_cpuexc" },
+  "cpuexc5"  => { :SRC=>"test_cpuexc5", :CFG=>"test_cpuexc" },
+  "cpuexc6"  => { :SRC=>"test_cpuexc6", :CFG=>"test_cpuexc" },
+  "cpuexc7"  => { :SRC=>"test_cpuexc7", :CFG=>"test_cpuexc" },
+  "cpuexc8"  => { :SRC=>"test_cpuexc8", :CFG=>"test_cpuexc" },
+  "cpuexc9"  => { :SRC=>"test_cpuexc9", :CFG=>"test_cpuexc" },
+  "cpuexc10" => { :SRC=>"test_cpuexc10", :CFG=>"test_cpuexc" },
+  "dlynse"   => { :SRC=>"test_dlynse" },
+  "dtq1"     => { :SRC=>"test_dtq1" },
+  "flg1"     => { :SRC=>"test_flg1" },
+  "hrt1"     => { :SRC=>"test_hrt1" },
+  "mutex1"   => { :SRC=>"test_mutex1", :BIT=>"mutex" },
+  "mutex2"   => { :SRC=>"test_mutex2", :BIT=>"mutex" },
+  "mutex3"   => { :SRC=>"test_mutex3", :BIT=>"mutex" },
+  "mutex4"   => { :SRC=>"test_mutex4", :BIT=>"mutex" },
+  "mutex5"   => { :SRC=>"test_mutex5", :BIT=>"mutex" },
+  "mutex6"   => { :SRC=>"test_mutex6", :BIT=>"mutex" },
+  "mutex7"   => { :SRC=>"test_mutex7", :BIT=>"mutex" },
+  "mutex8"   => { :SRC=>"test_mutex8", :BIT=>"mutex" },
+  "notify1"  => { :SRC=>"test_notify1" },
+  "raster1"  => { :SRC=>"test_raster1", :BIT=>"kernel" },
+  "raster2"  => { :SRC=>"test_raster2" },
+  "sem1"     => { :SRC=>"test_sem1" },
+  "sem2"     => { :SRC=>"test_sem2" },
+  "sysman1"  => { :SRC=>"test_sysman1" },
+  "sysstat1" => { :SRC=>"test_sysstat1" },
+  "task1"    => { :SRC=>"test_task1", :BIT=>"kernel" },
+  "tmevt1"   => { :SRC=>"test_hrt1" },
+
+  # ã¡ãã»ã¼ã¸ãããã¡æ©è½æ¡å¼µããã±ã¼ã¸ã®æ©è½ãã¹ããã­ã°ã©ã 
+  "messagebuf1" => { :SRC=>"test_messagebuf1", :BIT=>"kernel" },
+  "messagebuf2" => { :SRC=>"test_messagebuf2", :BIT=>"kernel" },
+
+  # ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸ã®æ©è½ãã¹ããã­ã°ã©ã 
+  "ovrhdr1"  => { :SRC=>"test_ovrhdr1" },
+
+  # å¶ç´ã¿ã¹ã¯æ¡å¼µããã±ã¼ã¸ã®æ©è½ãã¹ããã­ã°ã©ã 
+  "rstr1"    => { :SRC=>"test_rstr1" },
+  "rstr2"    => { :SRC=>"test_rstr2" },
+
+  # ãµãåªå
+åº¦æ©è½æ¡å¼µããã±ã¼ã¸ã®æ©è½ãã¹ããã­ã°ã©ã 
+  "subprio1" => { :SRC=>"test_subprio1" },
+  "subprio2" => { :SRC=>"test_subprio2" },
+
+  # ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ããã­ã°ã©ã 
+  "systim1" => { :TARGET=>1, :SRC=>"hrt_systim1", :DEFS=>"-DHRT_CONFIG1" },
+  "systim2" => { :TARGET=>1, :SRC=>"hrt_systim2", :DEFS=>"-DHRT_CONFIG1" },
+  "systim3" => { :TARGET=>1, :SRC=>"hrt_systim3", :DEFS=>"-DHRT_CONFIG1" },
+  "systim4" => { :TARGET=>1, :SRC=>"hrt_systim4", :DEFS=>"-DHRT_CONFIG2" },
+
+  # ããªããèª¿æ´æ©è½æ¡å¼µããã±ã¼ã¸ã®ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ããã­ã°ã©ã 
+  "drift1"   => { :TARGET=>1, :SRC=>"hrt_drift1", :DEFS=>"-DHRT_CONFIG1" },
+  "drift1-64ops"  => { :TARGET=>1, :SRC=>"hrt_drift1",
+								:DEFS=>"-DHRT_CONFIG1 -DUSE_64BIT_OPS" },
+  "systim1-64ops" => { :TARGET=>1, :SRC=>"hrt_systim1",
+								:DEFS=>"-DHRT_CONFIG1 -DUSE_64BIT_OPS" },
+
+  # æ§è½è©ä¾¡ãã­ã°ã©ã 
+  "perf0" => { :CDL=>"perf_pf" },
+  "perf1" => { :CDL=>"perf_pf" },
+  "perf2" => { :CDL=>"perf_pf" },
+  "perf3" => { :CDL=>"perf_pf" },
+  "perf4" => { :CDL=>"perf_pf" },
+  "perf5" => { :CDL=>"perf_pf" },
+}
+
+#
+#  ã«ã¼ãã«ã©ã¤ãã©ãªã®ä½æ
+#
+def BuildKernel
+  if !Dir.exist?("KERNELLIB")
+    Dir.mkdir("KERNELLIB")
+  end
+
+  Dir.chdir("KERNELLIB") do
+    puts("== building: KERNELLIB ==")
+    configCommand = "ruby #{$usedSrcDir}/configure.rb"
+    configCommand += " #{$targetOptions[0]}"
+    configCommand += " -f"
+    puts(configCommand)
+    system(configCommand)
+    system("make libkernel.a")
+    if File.exist?("Makefile.bak")
+      File.delete("Makefile.bak")
+    end
+  end
+end
+
+#
+#  ãã¹ããã­ã°ã©ã ã®ä½æ
+#
+def BuildTest(test, testSpec, mkdirFlag=false)
+  testName = test.tr("a-z", "A-Z")
+  objDir = "OBJ-#{testName}"
+
+  if !Dir.exist?(objDir)
+    if mkdirFlag
+      Dir.mkdir(objDir)
+    else
+      return
+    end
+  end
+
+  Dir.chdir(objDir) do
+    puts("== building: #{testName} ==")
+    configCommand = "ruby #{$usedSrcDir}/configure.rb"
+    if testSpec.has_key?(:TARGET)
+      configCommand += " #{$targetOptions[testSpec[:TARGET]]}"
+    else
+      configCommand += " #{$targetOptions[0]}"
+    end
+    configCommand += " -a #{$usedSrcDir}/test"
+
+    if (!testSpec.has_key?(:TARGET) || testSpec[:TARGET] == 0)
+      configCommand += " -L ../KERNELLIB"
+    end
+    if testSpec.has_key?(:SRC)
+      configCommand += " -A #{testSpec[:SRC]}"
+    else
+      configCommand += " -A #{test}"
+    end
+    if testSpec.has_key?(:CFG)
+      configCommand += " -c #{testSpec[:CFG]}.cfg"
+    end
+    if testSpec.has_key?(:CDL)
+      configCommand += " -C #{testSpec[:CDL]}.cdl"
+    else
+      configCommand += " -C test_pf.cdl"
+    end
+    if testSpec.has_key?(:BIT)
+      configCommand += " -S bit_#{testSpec[:BIT]}.o"
+    end
+    if testSpec.has_key?(:DEFS)
+      configCommand += " -O \"#{testSpec[:DEFS]}\""
+    end
+    puts(configCommand)
+    system(configCommand)
+    system("make")
+    if File.exist?("Makefile.bak")
+      File.delete("Makefile.bak")
+    end
+  end
+end
+
+#
+#  å
+¨ãã¹ããã­ã°ã©ã ã®ä½æ
+#
+def BuildAll
+  TEST_SPEC.each do |test, testSpec|
+    BuildTest(test, testSpec)
+  end
+end
+
+#
+#  ãã¹ããã­ã°ã©ã ã®å®è¡
+#
+def ExecTest(test, testSpec)
+  testName = test.tr("a-z", "A-Z")
+  objDir = "OBJ-#{testName}"
+
+  return unless Dir.exist?(objDir)
+
+  Dir.chdir(objDir) do
+    puts("== executing: #{testName} ==")
+    if File.exist?("../TARGET_RUN")
+      system(`cat ../TARGET_RUN`)
+    else
+      system("./asp")
+    end
+  end
+end
+
+#
+#  å
+¨ãã¹ããã­ã°ã©ã ã®å®è¡
+#
+def ExecAll
+  TEST_SPEC.each do |test, testSpec|
+    ExecTest(test, testSpec)
+  end
+end
+
+#
+#  ã«ã¼ãã«ã©ã¤ãã©ãªã®ã¯ãªã¼ã³
+#
+def CleanKernel
+  if Dir.exist?("KERNELLIB")
+    Dir.chdir("KERNELLIB") do
+      system("make clean")
+    end
+  end
+end
+
+#
+#  ãã¹ããã­ã°ã©ã ã®ã¯ãªã¼ã³
+#
+def CleanTest(test, testSpec)
+  testName = test.tr("a-z", "A-Z")
+  objDir = "OBJ-#{testName}"
+
+  return unless Dir.exist?(objDir)
+
+  Dir.chdir(objDir) do
+    system("make clean")
+  end
+end
+
+#
+#  å
+¨ãã¹ããã­ã°ã©ã ã®ã¯ãªã¼ã³
+#
+def CleanAll
+  TEST_SPEC.each do |test, testSpec|
+    CleanTest(test, testSpec)
+  end
+end
+
+#
+#  ã½ã¼ã¹ãã£ã¬ã¯ããªåãåãåºã
+#
+if /^(.*)\/test\/testexec/ =~ $0
+  $srcDir = $1
+else
+  $srcDir = "."
+end
+
+if /^\// =~ $srcDir
+  $usedSrcDir = $srcDir
+else
+  $usedSrcDir = "../" + $srcDir
+end
+
+#
+#  ã¿ã¼ã²ããä¾å­ã®ãªãã·ã§ã³ãèª­ã
+#
+$targetOptions = {}
+File.open("TARGET_OPTIONS") do |file|
+  file.each_line.with_index do |line, index|
+    line.chomp!
+    $targetOptions[index] = line
+  end
+end
+
+#
+#  ãã©ã¡ã¼ã¿ã§æå®ãããå¦çã®å®è¡
+#
+if ARGV.size == 0
+  BuildKernel()
+  BuildAll()
+  ExecAll()
+else
+  ARGV.each do |param|
+    case param
+    when "kernel"
+      BuildKernel()
+    when "build"
+      BuildAll()
+    when "exec"
+      ExecAll()
+    when "all"
+      BuildAll()
+      ExecAll()
+    when "clean_kernel"
+      CleanKernel()
+    when "clean"
+      CleanKernel()
+      CleanAll()
+    else
+      if TEST_SPEC.has_key?(param)
+        BuildTest(param, TEST_SPEC[param], true)
+        ExecTest(param, TEST_SPEC[param])
+      else
+        puts("invalid parameter: #{param}")
+      end
+    end
+  end
+end
