Index: asp3_wo_tecs/trunk/MANIFEST
===================================================================
--- asp3_wo_tecs/trunk/MANIFEST	(revision 302)
+++ asp3_wo_tecs/trunk/MANIFEST	(revision 302)
@@ -0,0 +1,127 @@
+PACKAGE asp3
+VERSION 3.0.0
+
+configure
+MANIFEST
+README.txt
+
+doc/asp_spec.txt
+doc/configurator.txt
+doc/design.txt
+doc/extension.txt
+doc/porting.txt
+doc/user.txt
+doc/version.txt
+
+include/itron.h
+include/kernel.h
+include/log_output.h
+include/queue.h
+include/sil.h
+include/t_stddef.h
+include/t_stdlib.h
+include/t_syslog.h
+
+kernel/Makefile.kernel
+kernel/alarm.c
+kernel/alarm.h
+kernel/alarm.tf
+kernel/allfunc.h
+kernel/check.h
+kernel/cyclic.c
+kernel/cyclic.h
+kernel/cyclic.tf
+kernel/dataqueue.c
+kernel/dataqueue.h
+kernel/dataqueue.tf
+kernel/eventflag.c
+kernel/eventflag.h
+kernel/eventflag.tf
+kernel/exception.c
+kernel/exception.h
+kernel/exception.tf
+kernel/genoffset.tf
+kernel/interrupt.c
+kernel/interrupt.h
+kernel/interrupt.tf
+kernel/kernel.tf
+kernel/kernel_api.csv
+kernel/kernel_check.tf
+kernel/kernel_def.csv
+kernel/kernel_impl.h
+kernel/kernel_int.h
+kernel/kernel_rename.def
+kernel/kernel_rename.h
+kernel/kernel_unrename.h
+kernel/mempfix.c
+kernel/mempfix.h
+kernel/mempfix.tf
+kernel/mutex.c
+kernel/mutex.h
+kernel/mutex.tf
+kernel/pridataq.c
+kernel/pridataq.h
+kernel/pridataq.tf
+kernel/semaphore.c
+kernel/semaphore.h
+kernel/semaphore.tf
+kernel/startup.c
+kernel/sys_manage.c
+kernel/task.c
+kernel/task.h
+kernel/task.tf
+kernel/task_manage.c
+kernel/task_refer.c
+kernel/task_sync.c
+kernel/task_term.c
+kernel/taskhook.c
+kernel/taskhook.h
+kernel/time_event.c
+kernel/time_event.h
+kernel/time_manage.c
+kernel/wait.c
+kernel/wait.h
+
+syssvc/banner.c
+syssvc/banner.cfg
+syssvc/banner.h
+syssvc/histogram.c
+syssvc/histogram.h
+syssvc/logtask.c
+syssvc/logtask.cfg
+syssvc/logtask.h
+syssvc/serial.c
+syssvc/serial.cfg
+syssvc/serial.h
+syssvc/syslog.c
+syssvc/syslog.cfg
+syssvc/syslog.h
+syssvc/test_svc.c
+syssvc/test_svc.h
+
+library/log_output.c
+library/strerror.c
+library/t_perror.c
+library/vasyslog.c
+
+arch/gcc/tool_stddef.h
+
+arch/logtrace/trace_config.h
+arch/logtrace/trace_config.c
+arch/logtrace/trace_config.cfg
+arch/logtrace/trace_dump.c
+
+utils/applyrename
+utils/genrename
+utils/gentest
+utils/makerelease
+utils/move-if-change
+
+sample/Makefile
+sample/sample1.c
+sample/sample1.cfg
+sample/sample1.h
+
+INCLUDE test/MANIFEST
+INCLUDE extension/MANIFEST
+INCLUDE target/dummy_gcc/MANIFEST
Index: asp3_wo_tecs/trunk/README.txt
===================================================================
--- asp3_wo_tecs/trunk/README.txt	(revision 302)
+++ asp3_wo_tecs/trunk/README.txt	(revision 302)
@@ -0,0 +1,55 @@
+
+	TOPPERS/ASP3 Kernelï¼Release 3.B.0ï¼
+		Toyohashi Open Platform for Embedded Real-Time Systems/
+		Advanced Standard Profile Kernel
+
+TOPPERS/ASP3ã«ã¼ãã«ï¼TOPPERS/ASPã«ã¼ãã« Release 3.Xï¼ä»¥ä¸ï¼ASP3ã«ã¼ã
+ã«ï¼ã¯ï¼TOPPERS/ASPã«ã¼ãã«ãæ¡å¼µã»æ¹è¯ãããã®ã§ï¼TOPPERSç¬¬3ä¸ä»£ã«ã¼ã
+ã«ï¼ITRONç³»ï¼ã®åºç¤ã¨ãªããã®ã¨ãã¦éçºãé²ãã¦ãããªã¢ã«ã¿ã¤ã ã«ã¼ãã«
+ã§ãï¼
+
+TOPPERS/ASPã«ã¼ãã«ã¯ï¼Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«æºæ ã®ãª
+ã¢ã«ã¿ã¤ã ã«ã¼ãã«ã§ããTOPPERS/JSPã«ã¼ãã«ãæ¡å¼µã»æ¹è¯ããå½¢ã§éçºãã
+ãã®ã§ãï¼
+
+ãæåã«èª­ãã¹ããã­ã¥ã¡ã³ãã
+
+ASP3ã«ã¼ãã«ã®ä»æ§æ¦è¦ãdoc/asp_spec.txtã«ï¼ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ã
+doc/user.txtã«ããã¾ãï¼ASP3ã«ã¼ãã«ãä½¿ç¨ããå ´åã«ã¯ï¼ã¾ãã¯ãããã®
+ãã­ã¥ã¡ã³ãããèª­ã¿ä¸ããï¼
+
+ããã¡ã¤ã«ã®é²è¦§ã«ããã£ã¦ã
+
+ASP3ã«ã¼ãã«ã®ãã­ã¥ã¡ã³ãï¼ãã¬ã¼ã³ãã­ã¹ããã¡ã¤ã«ï¼ããã³ã½ã¼ã¹ãã¡
+ã¤ã«ãèª­ãéã«ã¯ï¼TABã4ã«è¨­å®ãã¦ãã ããï¼
+
+ãå©ç¨æ¡ä»¶ã
+
+ASP3ã«ã¼ãã«ã®å©ç¨æ¡ä»¶ã¯ï¼åãã¡ã¤ã«ã®å
+é ­ã«è¡¨ç¤ºããã¦ããTOPPERSã©ã¤ã»
+ã³ã¹ã§ãï¼TOPPERSã©ã¤ã»ã³ã¹ã«é¢ããFAQãï¼ä»¥ä¸ã®ãã¼ã¸ã«ããã¾ãï¼
+
+	http://www.toppers.jp/faq/faq_ct12.html
+
+ãè³ªåã»ãã°ã¬ãã¼ãã»æè¦ç­ã®éä»å
+ã
+
+ASP3ã«ã¼ãã«ãããè¯ããã®ã«ããããã®ãæè¦ç­ãæ­è¿ãã¾ãï¼ASP3ã«ã¼ã
+ã«ã«é¢ããè³ªåããã°ã¬ãã¼ãï¼ãæè¦ç­ã¯ï¼TOPPERSãã­ã¸ã§ã¯ãã®ä¼å¡ã¯
+TOPPERSéçºè
+ã¡ã¼ãªã³ã°ãªã¹ãï¼dev@toppers.jpï¼å®ã¾ãã¯ASP3ã«ã¼ãã«ã®ã
+ã°ãã©ãã­ã³ã°ã·ã¹ãã ï¼Tracï¼ã«ï¼ãã®ä»ã®æ¹ã¯TOPPERSã¦ã¼ã¶ã¼ãºã¡ã¼ãªã³
+ã°ãªã¹ãï¼users@toppers.jpï¼å®ã«ãé¡ããã¾ãï¼
+
+TOPPERSã¦ã¼ã¶ã¼ãºã¡ã¼ãªã³ã°ãªã¹ãã¸ã®ç»é²æ¹æ³ã«ã¤ãã¦ã¯ï¼ä»¥ä¸ã®ãã¼ã¸ã«
+èª¬æãããã¾ãï¼
+
+	http://www.toppers.jp/community.html
+
+ããã¼ãã£ã³ã°ã«ããã£ã¦ã
+
+ASP3ã«ã¼ãã«ãï¼TOPPERSãã­ã¸ã§ã¯ããããªã¼ãã³ã½ã¼ã¹ã«ãããã¨ãåæã«ï¼
+æªãµãã¼ãã®ã¿ã¼ã²ããã«ãã¼ãã£ã³ã°ãããå ´åã«ã¯ï¼ããããããç¸è«ã
+ã ããã¨å¹¸ãã§ãï¼
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/arch/arm_gcc/MANIFEST
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/MANIFEST	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/MANIFEST	(revision 302)
@@ -0,0 +1,38 @@
+PACKAGE asp3_arch_arm_gcc
+VERSION 3.0.0
+
+MANIFEST
+
+doc/arm_design.txt
+doc/gic_design.txt
+
+common/Makefile.core
+common/arm.c
+common/arm.h
+common/arm_insn.h
+common/core.tf
+common/core_asm.inc
+common/core_cfg1_out.h
+common/core_check.tf
+common/core_def.csv
+common/core_kernel.h
+common/core_kernel_impl.c
+common/core_kernel_impl.h
+common/core_offset.tf
+common/core_rename.def
+common/core_rename.h
+common/core_sil.h
+common/core_stddef.h
+common/core_support.S
+common/core_test.h
+common/core_unrename.h
+common/gic_kernel_impl.c
+common/gic_kernel_impl.h
+common/gic_support.S
+common/sp804.h
+common/start.S
+common/uart_pl011.c
+common/uart_pl011.h
+
+INCLUDE mpcore/MANIFEST
+INCLUDE ../../target/ct11mpcore_gcc/MANIFEST
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/Makefile.core
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/Makefile.core	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/Makefile.core	(revision 302)
@@ -0,0 +1,55 @@
+#
+#		Makefileã®ã³ã¢ä¾å­é¨ï¼ARMç¨ï¼
+#
+#  $Id: Makefile.core 484 2016-01-03 15:13:38Z ertl-hiro $
+#
+
+#
+#  ã³ã¢ä¾å­é¨ãã£ã¬ã¯ããªåã®å®ç¾©
+#
+COREDIR = $(SRCDIR)/arch/$(CORE)_$(TOOL)/common
+
+#
+#  ãã¼ã«ä¾å­é¨ãã£ã¬ã¯ããªåã®å®ç¾© 
+#
+TOOLDIR = $(SRCDIR)/arch/$(TOOL)
+
+#
+#  GNUéçºç°å¢ã®ã¿ã¼ã²ããã¢ã¼ã­ãã¯ãã£ã®å®ç¾©
+#
+GCC_TARGET = arm-none-eabi
+
+#
+#  ã³ã³ãã¤ã«ãªãã·ã§ã³
+#
+INCLUDES := $(INCLUDES) -I$(COREDIR) -I$(TOOLDIR)
+LIBS := $(LIBS) -lgcc
+
+#
+#  ã«ã¼ãã«ã«é¢ããå®ç¾©
+#
+KERNEL_DIRS := $(KERNEL_DIRS) $(COREDIR)
+KERNEL_ASMOBJS := $(KERNEL_ASMOBJS) core_support.o
+KERNEL_COBJS := $(KERNEL_COBJS) core_kernel_impl.o arm.o
+
+#
+#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
+#
+CFG_TABS := $(CFG_TABS) --cfg1-def-table $(COREDIR)/core_def.csv 
+
+#
+#  ãªãã»ãããã¡ã¤ã«çæã®ããã®å®ç¾©
+#
+OFFSET_TF = $(COREDIR)/core_offset.tf
+
+#
+#  ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã«é¢ããå®ç¾©
+#
+#  START_OBJSãstart.oã«è¨­å®ãï¼LDFLAGSã«-nostdlibãè¿½å ããï¼
+#
+START_OBJS = start.o
+
+$(START_OBJS): %.o: %.S
+	$(CC) -c $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+LDFLAGS := -nostdlib $(LDFLAGS)
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/arm.c
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/arm.c	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/arm.c	(revision 302)
@@ -0,0 +1,213 @@
+/*
+ *  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: arm.c 438 2015-08-09 01:37:47Z ertl-hiro $
+ */
+
+/*
+ *		ARMã³ã¢ãµãã¼ãã¢ã¸ã¥ã¼ã«
+ */
+
+#include "arm.h"
+
+/*
+ *  ã­ã£ãã·ã¥ã®æä½
+ */
+
+/*
+ *  ãã¼ã¿ã­ã£ãã·ã¥ã®ã¤ãã¼ãã«
+ */
+void
+arm_enable_dcache(void)
+{
+	uint32_t	reg;
+
+	CP15_READ_SCTLR(reg);
+	if ((reg & CP15_SCTLR_DCACHE) == 0U) {
+		arm_invalidate_dcache();
+
+		reg |= CP15_SCTLR_DCACHE;
+		CP15_WRITE_SCTLR(reg);
+	}
+}
+
+/*
+ *  ãã¼ã¿ã­ã£ãã·ã¥ã®ãã£ã¹ã¨ã¼ãã«
+ *
+ *  ãã¼ã¿ã­ã£ãã·ã¥ãç¡å¹ãªç¶æ
+ã§clean_and_invalidateãå®è¡ããã¨æ´èµ°
+ *  ããå ´åãããããï¼ãã¼ã¿ã­ã£ãã·ã¥ã®ç¶æ
+ãå¤æ­ãã¦ï¼ç¡å¹ãªå ´åã¯ï¼
+ *  ç¡å¹åã®ã¿ãè¡ãï¼
+ */
+void
+arm_disable_dcache(void)
+{
+	uint32_t	reg;
+
+	CP15_READ_SCTLR(reg);
+	if ((reg & CP15_SCTLR_DCACHE) == 0U) {
+		arm_invalidate_dcache();
+	}
+	else {
+		reg &= ~CP15_SCTLR_DCACHE;
+		CP15_WRITE_SCTLR(reg);
+
+		arm_clean_and_invalidate_dcache();
+	}
+}
+
+/*
+ *  å½ä»¤ã­ã£ãã·ã¥ã®ã¤ãã¼ãã«
+ */
+void
+arm_enable_icache(void)
+{
+	uint32_t	reg;
+
+	CP15_READ_SCTLR(reg);
+	if ((reg & CP15_SCTLR_ICACHE) == 0U) {
+		arm_invalidate_icache();
+
+		reg |= CP15_SCTLR_ICACHE;
+		CP15_WRITE_SCTLR(reg);
+	}
+}
+
+/*
+ *  å½ä»¤ã­ã£ãã·ã¥ã®ãã£ã¹ã¨ã¼ãã«
+ */
+void
+arm_disable_icache(void)
+{
+	uint32_t	reg;
+
+	CP15_READ_SCTLR(reg);
+	reg &= ~CP15_SCTLR_ICACHE;
+	CP15_WRITE_SCTLR(reg);
+
+	arm_invalidate_icache();
+}
+
+/*
+ *  ARMv5ã«ããããã¼ã¿ã­ã£ãã·ã¥ã®ã¯ãªã¼ã³ã¨ç¡å¹å
+ */
+#if __TARGET_ARCH_ARM <= 5
+
+void
+armv5_clean_and_invalidate_dcache(void)
+{
+	ARMV5_CLEAN_AND_INVALIDATE_DCACHE();
+}
+
+#endif /* __TARGET_ARCH_ARM <= 5 */
+
+/*
+ *  ARMv7ã«ããããã¼ã¿ã­ã£ãã·ã¥ã®ç¡å¹å
+ *
+ *  ã¬ãã«0ã®ã­ã£ãã·ã¥ã®ã¿ãç¡å¹åããï¼
+ */
+#if __TARGET_ARCH_ARM == 7
+
+void
+armv7_invalidate_dcache(void)
+{
+	uint32_t	reg;
+	uint32_t	way, no_ways, shift_way;
+	uint32_t	set, no_sets, shift_set;
+
+	CP15_WRITE_CSSELR(0U);
+	CP15_READ_CCSIDR(reg);
+	no_sets = ((reg >> 13) & 0x7fffU) + 1;
+	shift_set = (reg & 0x07U) + 4;
+	no_ways = ((reg >> 3) & 0x3ffU) + 1;
+	shift_way = count_leading_zero(no_ways);
+
+	for (way = 0; way < no_ways; way++){
+		for (set = 0; set < no_sets; set++) {
+			reg = (way << shift_way) | (set << shift_set);
+			CP15_WRITE_DCISW(reg);
+		}
+	}
+}
+
+#endif /* __TARGET_ARCH_ARM == 7 */
+
+/*
+ *  ARMv7ã«ããããã¼ã¿ã­ã£ãã·ã¥ã®ã¯ãªã¼ã³ã¨ç¡å¹å
+ *
+ *  ã¬ãã«0ã®ã­ã£ãã·ã¥ã®ã¿ãã¯ãªã¼ã³ã¨ç¡å¹åããï¼
+ */
+#if __TARGET_ARCH_ARM == 7
+
+void
+armv7_clean_and_invalidate_dcache(void)
+{
+	uint32_t	reg;
+	uint32_t	way, no_ways, shift_way;
+	uint32_t	set, no_sets, shift_set;
+
+	CP15_WRITE_CSSELR(0U);
+	CP15_READ_CCSIDR(reg);
+	no_sets = ((reg >> 13) & 0x7fffU) + 1;
+	shift_set = (reg & 0x07U) + 4;
+	no_ways = ((reg >> 3) & 0x3ffU) + 1;
+	shift_way = count_leading_zero(no_ways);
+
+	for (way = 0; way < no_ways; way++){
+		for (set = 0; set < no_sets; set++) {
+			reg = (way << shift_way) | (set << shift_set);
+			CP15_WRITE_DCCISW(reg);
+		}
+	}
+}
+
+#endif /* __TARGET_ARCH_ARM == 7 */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/arm.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/arm.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/arm.h	(revision 302)
@@ -0,0 +1,417 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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
+ *              Graduate School of Information Science, Nagoya Univ., JAPAN
+ * 
+ *  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+ *  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+ *  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+ *  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+ *      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+ *      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+ *  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+ *      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+ *      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+ *      ã¨ï¼
+ *    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+ *        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+ *        å ±åãããã¨ï¼
+ *  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+ *      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+ *      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+ *      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+ *      å
+è²¬ãããã¨ï¼
+ * 
+ *  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+ *  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+ *  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+ *  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+ *  ã®è²¬ä»»ãè² ããªãï¼
+ * 
+ *  $Id: arm.h 430 2015-08-08 11:38:46Z ertl-hiro $
+ */
+
+/*
+ *		ARMã³ã¢ãµãã¼ãã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_ARM_H
+#define TOPPERS_ARM_H
+
+#include <t_stddef.h>
+
+/*
+ *  ARMã³ã¢ã®ç¹æ®å½ä»¤ã®ã¤ã³ã©ã¤ã³é¢æ°å®ç¾©
+ */
+#ifndef TOPPERS_MACRO_ONLY
+#include "arm_insn.h"
+#endif /*  TOPPERS_MACRO_ONLY */
+
+/*
+ *  ARMä¾å¤ãã¯ã¿
+ */
+#define RESET_VECTOR	UINT_C(0x00)
+#define UNDEF_VECTOR	UINT_C(0x04)
+#define SVC_VECTOR		UINT_C(0x08)
+#define PABORT_VECTOR	UINT_C(0x0c)
+#define DABORT_VECTOR	UINT_C(0x10)
+#define IRQ_VECTOR		UINT_C(0x18)
+#define FIQ_VECTOR		UINT_C(0x1c)
+
+/*
+ *  ARMä¾å¤ãã¯ã¿çªå·
+ */
+#define RESET_NUMBER	UINT_C(0)
+#define UNDEF_NUMBER	UINT_C(1)
+#define SVC_NUMBER		UINT_C(2)
+#define PABORT_NUMBER	UINT_C(3)
+#define DABORT_NUMBER	UINT_C(4)
+#define IRQ_NUMBER		UINT_C(6)
+#define FIQ_NUMBER		UINT_C(7)
+
+/*
+ *  CPSRã®å²è¾¼ã¿ç¦æ­¢ããã
+ */
+#define CPSR_INT_MASK	UINT_C(0xc0)
+#define CPSR_IRQ_BIT	UINT_C(0x80)
+#define CPSR_FIQ_BIT	UINT_C(0x40)
+
+/*
+ *  CPSRã®Thumbããã
+ */
+#define CPSR_THUMB_BIT	UINT_C(0x20)
+
+/*
+ *  CPSRã®ã¢ã¼ãããã
+ */
+#define CPSR_MODE_MASK	UINT_C(0x1f)
+#define CPSR_USER_MODE	UINT_C(0x10)
+#define CPSR_FIQ_MODE	UINT_C(0x11)
+#define CPSR_IRQ_MODE	UINT_C(0x12)
+#define CPSR_SVC_MODE	UINT_C(0x13)
+#define CPSR_ABT_MODE	UINT_C(0x17)
+#define CPSR_UND_MODE	UINT_C(0x1b)
+#define CPSR_SYS_MODE	UINT_C(0x1f)
+
+/*
+ *  CP15ã®ã·ã¹ãã å¶å¾¡ã¬ã¸ã¹ã¿ï¼SCTLRï¼ã®è¨­å®å¤
+ *
+ *  ARMv7ã§ã¯ï¼CP15_SCTLR_EXTPAGEã¯å¸¸ã«1ã«ãªã£ã¦ããï¼
+ */
+#if __TARGET_ARCH_ARM == 6
+#define CP15_SCTLR_EXTPAGE		UINT_C(0x00800000)
+#endif /* __TARGET_ARCH_ARM == 6 */
+#define CP15_SCTLR_VECTOR		UINT_C(0x00002000)
+#define CP15_SCTLR_ICACHE		UINT_C(0x00001000)
+#define CP15_SCTLR_DCACHE		UINT_C(0x00000004)
+#define CP15_SCTLR_MMU			UINT_C(0x00000001)
+
+/*
+ *  CP15ã®ãã©ã¼ã«ãç¶æ
+ã¬ã¸ã¹ã¿ã®åç
+§å¤
+ */
+#define CP15_FSR_FS_MASK			UINT_C(0x0000040f)
+#define CP15_FSR_FS_ALIGNMENT		UINT_C(0x00000001)
+#define CP15_FSR_FS_TRANSLATION1	UINT_C(0x00000005)
+#define CP15_FSR_FS_TRANSLATION2	UINT_C(0x00000007)
+#define CP15_FSR_FS_PERMISSION1		UINT_C(0x0000000d)
+#define CP15_FSR_FS_PERMISSION2		UINT_C(0x0000000f)
+
+/*
+ *  CP15ã®ããã©ã¼ãã³ã¹ã¢ãã¿å¶å¾¡ã¬ã¸ã¹ã¿ï¼PMCRï¼ã®è¨­å®å¤
+ */
+#define CP15_PMCR_ALLCNTR_ENABLE		UINT_C(0x01)
+#define CP15_PMCR_PMCCNTR_DIVIDER		UINT_C(0x08)
+
+/*
+ *  CP15ã®ããã©ã¼ãã³ã¹ã¢ãã¿ã«ã¦ã³ãã¤ãã¼ãã«ã»ããã¬ã¸ã¹ã¿ï¼PMCNTENSETï¼
+ *  ã®è¨­å®å¤
+ */
+#define CP15_PMCNTENSET_CCNTR_ENABLE	UINT_C(0x80000000)
+
+/*
+ *  CP15ã®å¤æãã¼ãã«ãã¼ã¹ã¬ã¸ã¹ã¿ï¼TTBRï¼ã®è¨­å®å¤
+ */
+#define CP15_TTBR_RGN_SHAREABLE		UINT_C(0x00000002)
+#if __TARGET_ARCH_ARM == 7
+#define CP15_TTBR_RGN_WBWA			UINT_C(0x00000008)
+#endif /* __TARGET_ARCH_ARM == 7 */
+#define CP15_TTBR_RGN_WTHROUGH		UINT_C(0x00000010)
+#define CP15_TTBR_RGN_WBACK			UINT_C(0x00000018)
+#if __TARGET_ARCH_ARM < 7
+#define CP15_TTBR_RGN_CACHEABLE		UINT_C(0x00000001)
+#else /* __TARGET_ARCH_ARM < 7 */
+#define CP15_TTBR_IRGN_WBWA			UINT_C(0x00000040)
+#define CP15_TTBR_IRGN_WTHROUGH		UINT_C(0x00000001)
+#define CP15_TTBR_IRGN_WBACK		UINT_C(0x00000041)
+#endif /* __TARGET_ARCH_ARM < 7 */
+
+/*
+ *  MMUé¢é£ã®å®ç¾©ï¼VMSAï¼
+ */
+
+/*
+ *  ã»ã¯ã·ã§ã³ã¨ãã¼ã¸ã®ãµã¤ãº
+ */
+#define ARM_SSECTION_SIZE			UINT_C(0x1000000)
+#define ARM_SECTION_SIZE			UINT_C(0x0100000)
+#define ARM_LPAGE_SIZE				UINT_C(0x0010000)
+#define ARM_PAGE_SIZE				UINT_C(0x0001000)
+
+/*
+ *  ã»ã¯ã·ã§ã³ãã¼ãã«ã¨ãã¼ã¸ãã¼ãã«ã®ãµã¤ãº
+ */
+#define ARM_SECTION_TABLE_SIZE		UINT_C(0x4000)
+#define ARM_SECTION_TABLE_ALIGN		UINT_C(0x4000)
+#define ARM_SECTION_TABLE_ENTRY		(ARM_SECTION_TABLE_SIZE / sizeof(uint32_t))
+
+#define ARM_PAGE_TABLE_SIZE			UINT_C(0x0400)
+#define ARM_PAGE_TABLE_ALIGN		UINT_C(0x0400)
+#define ARM_PAGE_TABLE_ENTRY		(ARM_PAGE_TABLE_SIZE / sizeof(uint32_t))
+
+/*
+ *  ç¬¬1ã¬ãã«ãã£ã¹ã¯ãªãã¿ã®è¨­å®å¤
+ */
+#define ARM_MMU_DSCR1_FAULT			0x00000U	/* ãã©ã«ã */
+#define ARM_MMU_DSCR1_PAGETABLE		0x00001U	/* ã³ã¢ã¼ã¹ãã¼ã¸ãã¼ãã« */
+#define ARM_MMU_DSCR1_SECTION		0x00002U	/* ã»ã¯ã·ã§ã³ */
+#define ARM_MMU_DSCR1_SSECTION		0x40002U	/* ã¹ã¼ãã¼ã»ã¯ã·ã§ã³ */
+
+#define ARM_MMU_DSCR1_SHARED		0x10000U	/* ãã­ã»ããµéã§å
+±æ */
+#define ARM_MMU_DSCR1_TEX000		0x00000U	/* TEXãããã000 */
+#define ARM_MMU_DSCR1_TEX001		0x01000U	/* TEXãããã001 */
+#define ARM_MMU_DSCR1_TEX010		0x02000U	/* TEXãããã010 */
+#define ARM_MMU_DSCR1_TEX100		0x04000U	/* TEXãããã100 */
+#define ARM_MMU_DSCR1_AP01			0x00400U	/* APãããã01 */
+#define ARM_MMU_DSCR1_AP10			0x00800U	/* APãããã10 */
+#define ARM_MMU_DSCR1_AP11			0x00c00U	/* APãããã11 */
+#define ARM_MMU_DSCR1_CB00			0x00000U	/* Cãããã0ï¼Bãããã0 */
+#define ARM_MMU_DSCR1_CB01			0x00004U	/* Cãããã0ï¼Bãããã1 */
+#define ARM_MMU_DSCR1_CB10			0x00008U	/* Cãããã1ï¼Bãããã0 */
+#define ARM_MMU_DSCR1_CB11			0x0000cU	/* Cãããã1ï¼Bãããã1 */
+
+#if __TARGET_ARCH_ARM >= 6
+#define ARMV6_MMU_DSCR1_NONGLOBAL	0x20000U	/* ã°ã­ã¼ãã«ã§ãªã */
+#define ARMV6_MMU_DSCR1_APX0		0x00000U	/* APXãããã0 */
+#define ARMV6_MMU_DSCR1_APX1		0x08000U	/* APXãããã1 */
+#define ARMV6_MMU_DSCR1_ECC			0x00200U	/* ECCãæå¹ï¼MPCoreï¼*/
+#define ARMV6_MMU_DSCR1_NOEXEC		0x00010U	/* å®è¡ä¸å¯ */
+#endif /* __TARGET_ARCH_ARM >= 6 */
+
+/*
+ *  ç¬¬2ã¬ãã«ãã£ã¹ã¯ãªãã¿ã®è¨­å®å¤
+ */
+#define ARM_MMU_DSCR2_FAULT			0x0000U		/* ãã©ã«ã */
+#define ARM_MMU_DSCR2_LARGE			0x0001U		/* ã©ã¼ã¸ãã¼ã¸ */
+#define ARM_MMU_DSCR2_SMALL			0x0002U		/* ã¹ã¢ã¼ã«ãã¼ã¸ */
+
+#define ARM_MMU_DSCR2_CB00			0x0000U		/* Cãããã0ï¼Bãããã0 */
+#define ARM_MMU_DSCR2_CB01			0x0004U		/* Cãããã0ï¼Bãããã1 */
+#define ARM_MMU_DSCR2_CB10			0x0008U		/* Cãããã1ï¼Bãããã0 */
+#define ARM_MMU_DSCR2_CB11			0x000cU		/* Cãããã1ï¼Bãããã1 */
+
+#if __TARGET_ARCH_ARM < 6
+
+#define ARMV5_MMU_DSCR2_AP01		0x0550U		/* AP[0-3]ãããã01 */
+#define ARMV5_MMU_DSCR2_AP10		0x0aa0U		/* AP[0-3]ãããã10 */
+#define ARMV5_MMU_DSCR2_AP11		0x0ff0U		/* AP[0-3]ãããã11 */
+
+/* ã©ã¼ã¸ãã¼ã¸ã®ãã£ã¹ã¯ãªãã¿ç¨ */
+#define ARMV5_MMU_DSCR2L_TEX000		0x0000U		/* TEXãããã000 */
+#define ARMV5_MMU_DSCR2L_TEX001		0x1000U		/* TEXãããã001 */
+#define ARMV5_MMU_DSCR2L_TEX010		0x2000U		/* TEXãããã010 */
+#define ARMV5_MMU_DSCR2L_TEX100		0x4000U		/* TEXãããã100 */
+
+#else /* __TARGET_ARCH_ARM < 6 */
+
+#define ARMV6_MMU_DSCR2_NONGLOBAL	0x0800U		/* ã°ã­ã¼ãã«ã§ãªã */
+#define ARMV6_MMU_DSCR2_SHARED		0x0400U		/* ãã­ã»ããµéã§å
+±æ */
+#define ARMV6_MMU_DSCR2_APX0		0x0000U		/* APXãããã0 */
+#define ARMV6_MMU_DSCR2_APX1		0x0200U		/* APXãããã1 */
+#define ARMV6_MMU_DSCR2_AP01		0x0010U		/* APãããã01 */
+#define ARMV6_MMU_DSCR2_AP10		0x0020U		/* APãããã10 */
+#define ARMV6_MMU_DSCR2_AP11		0x0030U		/* APãããã11 */
+
+/* ã©ã¼ã¸ãã¼ã¸ã®ãã£ã¹ã¯ãªãã¿ç¨ */
+#define ARMV6_MMU_DSCR2L_TEX000		0x0000U		/* TEXãããã000 */
+#define ARMV6_MMU_DSCR2L_TEX001		0x1000U		/* TEXãããã001 */
+#define ARMV6_MMU_DSCR2L_TEX010		0x2000U		/* TEXãããã010 */
+#define ARMV6_MMU_DSCR2L_TEX100		0x4000U		/* TEXãããã100 */
+#define ARMV6_MMU_DSCR2L_NOEXEC		0x8000U		/* å®è¡ä¸å¯ */
+
+/* ã¹ã¢ã¼ã«ãã¼ã¸ã®ãã£ã¹ã¯ãªãã¿ç¨ */
+#define ARMV6_MMU_DSCR2S_TEX000		0x0000U		/* TEXãããã000 */
+#define ARMV6_MMU_DSCR2S_TEX001		0x0040U		/* TEXãããã001 */
+#define ARMV6_MMU_DSCR2S_TEX010		0x0080U		/* TEXãããã010 */
+#define ARMV6_MMU_DSCR2S_TEX100		0x0100U		/* TEXãããã100 */
+#define ARMV6_MMU_DSCR2S_NOEXEC		0x0001U		/* å®è¡ä¸å¯ */
+
+#endif /* __TARGET_ARCH_ARM < 6 */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *	ã³ãã­ã»ããµ15ã®æä½é¢æ°
+ */
+
+/*
+ *  High exception vectorãä½¿ããã®è¨­å®
+ */
+Inline void
+arm_set_high_vector(bool_t enable)
+{
+	uint32_t	reg;
+
+	CP15_READ_SCTLR(reg);
+	if (enable) {
+		reg |= CP15_SCTLR_VECTOR;
+	}
+	else {
+		reg &= ~CP15_SCTLR_VECTOR;
+	}
+	CP15_WRITE_SCTLR(reg);
+}
+
+/*
+ *  ãã­ã»ããµçªå·ã®åå¾
+ *
+ *  ãã«ããã­ã»ããµã¢ãã£ããã£ã¬ã¸ã¹ã¿ãèª­ãã§ï¼ãã®ä¸ä½8ããããè¿ãï¼
+ *  ARMv6ã§ã¯ï¼ãã«ããã­ã»ããµããµãã¼ããã¦ããå ´åã«ã®ã¿ä½¿ç¨ã§ããï¼
+ */
+#if __TARGET_ARCH_ARM >= 6
+
+Inline uint32_t
+arm_prc_index(void)
+{
+	uint32_t	reg;
+
+	CP15_READ_MPIDR(reg);
+	return(reg & 0xffU);
+}
+
+#endif /* __TARGET_ARCH_ARM >= 6 */
+
+/*
+ *  ã­ã£ãã·ã¥ã®æä½
+ */
+
+/*
+ *  å½ä»¤ï¼ãã¼ã¿ã­ã£ãã·ã¥ã®ã¤ãã¼ãã«ï¼ãã£ã¹ã¨ã¼ãã«
+ */
+extern void arm_enable_icache(void);
+extern void arm_disable_icache(void);
+extern void arm_enable_dcache(void);
+extern void arm_disable_dcache(void);
+
+/*
+ *  ã­ã£ãã·ã¥ã®ã¤ãã¼ãã«
+ */
+Inline void
+arm_enable_cache(void)
+{
+	arm_enable_icache();
+	arm_enable_dcache();
+}
+
+/*
+ *  ã­ã£ãã·ã¥ã®ãã£ã¹ã¨ã¼ãã«
+ */
+Inline void
+arm_disable_cache(void)
+{
+	arm_disable_icache();
+	arm_disable_dcache();
+}
+
+/*
+ *  ARMv5ã«ããããã¼ã¿ã­ã£ãã·ã¥ã®ç¡å¹åï¼ã¯ãªã¼ã³
+ */
+#if __TARGET_ARCH_ARM <= 5
+extern void armv5_clean_and_invalidate_dcache(void);
+#endif /* __TARGET_ARCH_ARM <= 5 */
+
+/*
+ *  ARMv7ã«ããããã¼ã¿ã­ã£ãã·ã¥ã®ç¡å¹åï¼ã¯ãªã¼ã³
+ */
+#if __TARGET_ARCH_ARM == 7
+extern void armv7_invalidate_dcache(void);
+extern void armv7_clean_and_invalidate_dcache(void);
+#endif /* __TARGET_ARCH_ARM == 7 */
+
+/*
+ *  ãã¼ã¿ã­ã£ãã·ã¥ã¨çµ±åã­ã£ãã·ã¥ã®ç¡å¹å
+ */
+Inline void
+arm_invalidate_dcache(void)
+{
+#if __TARGET_ARCH_ARM <= 6
+	CP15_INVALIDATE_DCACHE();
+	CP15_INVALIDATE_UCACHE();
+#else /* __TARGET_ARCH_ARM <= 6 */
+	armv7_invalidate_dcache();
+#endif /* __TARGET_ARCH_ARM <= 6 */
+}
+
+/*
+ *  ãã¼ã¿ã­ã£ãã·ã¥ã¨çµ±åã­ã£ãã·ã¥ã®ã¯ãªã¼ã³ã¨ç¡å¹å
+ */
+Inline void
+arm_clean_and_invalidate_dcache(void)
+{
+#if __TARGET_ARCH_ARM <= 5
+	armv5_clean_and_invalidate_dcache();
+#elif __TARGET_ARCH_ARM == 6
+	CP15_CLEAN_AND_INVALIDATE_DCACHE();
+	CP15_CLEAN_AND_INVALIDATE_UCACHE();
+#else
+	armv7_clean_and_invalidate_dcache();
+#endif
+}
+
+/*
+ *  å½ä»¤ã­ã£ãã·ã¥ã®ç¡å¹å
+ */
+Inline void
+arm_invalidate_icache(void)
+{
+	CP15_INVALIDATE_ICACHE();
+}
+
+/*
+ *  TLBã®ç¡å¹å
+ */
+Inline void
+arm_invalidate_tlb(void)
+{
+	CP15_INVALIDATE_TLB();
+	data_sync_barrier();
+}
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_ARM_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/arm_insn.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/arm_insn.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/arm_insn.h	(revision 302)
@@ -0,0 +1,424 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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
+ *              Graduate School of Information Science, Nagoya Univ., JAPAN
+ * 
+ *  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+ *  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+ *  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+ *  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+ *      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+ *      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+ *  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+ *      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+ *      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+ *      ã¨ï¼
+ *    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+ *        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+ *        å ±åãããã¨ï¼
+ *  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+ *      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+ *      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+ *      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+ *      å
+è²¬ãããã¨ï¼
+ * 
+ *  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+ *  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+ *  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+ *  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+ *  ã®è²¬ä»»ãè² ããªãï¼
+ * 
+ *  $Id: arm_insn.h 438 2015-08-09 01:37:47Z ertl-hiro $
+ */
+
+/*
+ *		ARMã³ã¢ã®ç¹æ®å½ä»¤ã®ã¤ã³ã©ã¤ã³é¢æ°å®ç¾©
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼arm.hããã¤ã³ã¯ã«ã¼ããããï¼arm.hããåé¢ã
+ *  ã¦ããã®ã¯ï¼ã³ã³ãã¤ã©ã«ããã¤ã³ã©ã¤ã³ã¢ã»ã³ãã©ã®è¨è¿°æ¹æ³ã®éãã
+ *  å¸åããããã«ï¼ãã®ãã¡ã¤ã«ã®ã¿ãç½®ãæããã°ããããã«ããããã§
+ *  ããï¼
+ */
+
+#ifndef TOPPERS_ARM_INSN_H
+#define TOPPERS_ARM_INSN_H
+
+#include <t_stddef.h>
+
+/*
+ *  CLZï¼Count Leading Zeroï¼å½ä»¤
+ */
+#if __TARGET_ARCH_ARM >= 6
+
+Inline uint32_t
+count_leading_zero(uint32_t val)
+{
+	uint32_t	count;
+
+	Asm("clz %0, %1" : "=r"(count) : "r"(val));
+	return(count);
+}
+
+#endif /* __TARGET_ARCH_ARM >= 6 */
+
+/*
+ *  ã¡ã¢ãªãå¤æ´ããããã¨ãã³ã³ãã¤ã©ã«ä¼ããããã®ãã¯ã­
+ */
+#define ARM_MEMORY_CHANGED	Asm("":::"memory")
+
+/*
+ *  ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ã®æä½é¢æ°
+ */
+#ifndef __thumb__
+
+/*
+ *  ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼CPSRï¼ã®ç¾å¨å¤ã®èª­åºã
+ */
+Inline uint32_t
+current_cpsr(void)
+{
+	uint32_t	cpsr;
+
+	Asm("mrs %0, cpsr" : "=r"(cpsr));
+	return(cpsr);
+}
+
+/*
+ *  ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼CPSRï¼ã®ç¾å¨å¤ã®å¤æ´
+ */
+Inline void
+set_cpsr(uint32_t cpsr)
+{
+	Asm("msr cpsr_cxsf, %0" : : "r"(cpsr) : "memory","cc");
+}
+
+#else /* __thumb__ */
+/*
+ *  Thumbã¢ã¼ãã§ã¯mrs/msrå½ä»¤ãä½¿ç¨ã§ããªãããï¼é¢æ°ã¨ãã¦å®ç¾ãã¦ï¼
+ *  ARMã¢ã¼ãã«ç§»è¡ãã¦å®è¡ããï¼
+ */
+
+/*
+ *  ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼CPSRï¼ã®ç¾å¨å¤ã®èª­åºã
+ */
+extern uint32_t current_cpsr(void);
+
+/*
+ *  ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼CPSRï¼ã®ç¾å¨å¤ã®å¤æ´
+ */
+extern void set_cpsr(uint32_t cpsr);
+
+#endif /* __thumb__ */
+
+/*
+ *  å²è¾¼ã¿ç¦æ­¢ï¼è¨±å¯é¢æ°
+ *
+ *  ARMv6ããè¿½å ãããã·ã¹ãã ç¶æ
+ãå¤æ´ããå½ä»¤ãä½¿ã£ãå²è¾¼ã¿ç¦æ­¢ï¼è¨±
+ *  å¯ã®ããã®é¢æ°ï¼
+ */
+#if __TARGET_ARCH_ARM >= 6
+
+/*
+ *  IRQã®ç¦æ­¢
+ */
+Inline void
+disable_irq(void)
+{
+	Asm("cpsid i");
+}
+
+/*
+ *  IRQã®è¨±å¯
+ */
+Inline void
+enable_irq(void)
+{
+	Asm("cpsie i");
+}
+
+/*
+ *  FIQã®ç¦æ­¢
+ */
+Inline void
+disable_fiq(void)
+{
+	Asm("cpsid f");
+}
+
+/*
+ *  FIQã®è¨±å¯
+ */
+Inline void
+enable_fiq(void)
+{
+	Asm("cpsie f");
+}
+
+/*
+ *  FIQã¨IRQã®ç¦æ­¢
+ */
+Inline void
+disable_fiq_irq(void)
+{
+	Asm("cpsid fi");
+}
+
+/*
+ *  FIQã¨IRQã®è¨±å¯
+ */
+Inline void
+enable_fiq_irq(void)
+{
+	Asm("cpsie fi");
+}
+
+#endif /* __TARGET_ARCH_ARM >= 6 */
+
+/*
+ *  CP15ã®IDã¬ã¸ã¹ã¿æä½ãã¯ã­
+ */
+
+/* ã¡ã¤ã³IDã¬ã¸ã¹ã¿ */
+#define CP15_READ_MIDR(reg)		Asm("mrc p15, 0, %0, c0, c0, 0":"=r"(reg))
+
+/* ãã«ããã­ã»ããµã¢ãã£ããã£ã¬ã¸ã¹ã¿ï¼ARMv6ä»¥éï¼*/
+#if __TARGET_ARCH_ARM >= 6
+#define CP15_READ_MPIDR(reg)	Asm("mrc p15, 0, %0, c0, c0, 5":"=r"(reg))
+#endif /* __TARGET_ARCH_ARM >= 6 */
+
+/* ã­ã£ãã·ã¥ã¿ã¤ãã¬ã¸ã¹ã¿ */
+#define CP15_READ_CTR(reg)		Asm("mrc p15, 0, %0, c0, c0, 1":"=r"(reg))
+
+#if __TARGET_ARCH_ARM == 7
+/* ã­ã£ãã·ã¥ã¬ãã«IDã¬ã¸ã¹ã¿ï¼ARMv7ï¼ */
+#define CP15_READ_CLIDR(reg)	Asm("mrc p15, 1, %0, c0, c0, 1":"=r"(reg))
+
+/* ã­ã£ãã·ã¥ãµã¤ãºé¸æã¬ã¸ã¹ã¿ï¼ARMv7ï¼*/
+#define CP15_WRITE_CSSELR(reg)	Asm("mcr p15, 2, %0, c0, c0, 0"::"r"(reg))
+
+/* ã­ã£ãã·ã¥ãµã¤ãºIDã¬ã¸ã¹ã¿ï¼ARMv7ï¼*/
+#define CP15_READ_CCSIDR(reg)	Asm("mrc p15, 1, %0, c0, c0, 0":"=r"(reg))
+#endif /* __TARGET_ARCH_ARM == 7 */
+
+/*
+ *  CP15ã®ã·ã¹ãã å¶å¾¡ã¬ã¸ã¹ã¿æä½ãã¯ã­
+ */
+
+/* ã·ã¹ãã å¶å¾¡ã¬ã¸ã¹ã¿ */
+#define CP15_READ_SCTLR(reg)	Asm("mrc p15, 0, %0, c1, c0, 0":"=r"(reg))
+#define CP15_WRITE_SCTLR(reg)	Asm("mcr p15, 0, %0, c1, c0, 0"::"r"(reg))
+
+/* è£å©å¶å¾¡ã¬ã¸ã¹ã¿ï¼æ©è½ã¯ãããä¾å­ï¼*/
+#define CP15_READ_ACTLR(reg)	Asm("mrc p15, 0, %0, c1, c0, 1":"=r"(reg))
+#define CP15_WRITE_ACTLR(reg)	Asm("mcr p15, 0, %0, c1, c0, 1"::"r"(reg))
+
+/*
+ *  CP15ã«ããã­ã£ãã·ã¥æä½ãã¯ã­
+ */
+
+/* å½ä»¤ã­ã£ãã·ã¥å
+¨ä½ã®ç¡å¹å */
+#define CP15_INVALIDATE_ICACHE() \
+								Asm("mcr p15, 0, %0, c7, c5, 0"::"r"(0))
+
+/* ãã¼ã¿ã­ã£ãã·ã¥å
+¨ä½ã®ç¡å¹åï¼ARMv6ä»¥åï¼*/
+#if __TARGET_ARCH_ARM <= 6
+#define CP15_INVALIDATE_DCACHE() Asm("mcr p15, 0, %0, c7, c6, 0"::"r"(0))
+#endif /* __TARGET_ARCH_ARM <= 6 */
+
+/* çµ±åã­ã£ãã·ã¥å
+¨ä½ã®ç¡å¹åï¼ARMv6ä»¥åï¼*/
+#if __TARGET_ARCH_ARM <= 6
+#define CP15_INVALIDATE_UCACHE() Asm("mcr p15, 0, %0, c7, c7, 0"::"r"(0))
+#endif /* __TARGET_ARCH_ARM <= 6 */
+
+/* ãã¼ã¿ã­ã£ãã·ã¥å
+¨ä½ã®ã¯ãªã¼ã³ã¨ç¡å¹åï¼ARMv5ã®ã¿ï¼*/
+#if __TARGET_ARCH_ARM <= 5
+#define ARMV5_CLEAN_AND_INVALIDATE_DCACHE() \
+						Asm("1: mrc p15, 0, apsr_nzcv, c7, c14, 3; bne 1b")
+#endif /* __TARGET_ARCH_ARM <= 5 */
+
+/* ãã¼ã¿ã­ã£ãã·ã¥å
+¨ä½ã®ã¯ãªã¼ã³ã¨ç¡å¹åï¼ARMv6ã®ã¿ï¼*/
+#if __TARGET_ARCH_ARM == 6
+#define CP15_CLEAN_AND_INVALIDATE_DCACHE() \
+								Asm("mcr p15, 0, %0, c7, c14, 0"::"r"(0))
+#endif /* __TARGET_ARCH_ARM == 6 */
+
+/* çµ±åã­ã£ãã·ã¥å
+¨ä½ã®ã¯ãªã¼ã³ã¨ç¡å¹åï¼ARMv6ã®ã¿ï¼*/
+#if __TARGET_ARCH_ARM == 6
+#define CP15_CLEAN_AND_INVALIDATE_UCACHE() \
+								Asm("mcr p15, 0, %0, c7, c15, 0"::"r"(0))
+#endif /* __TARGET_ARCH_ARM == 6 */
+
+/* ãã¼ã¿ã­ã£ãã·ã¥ã®ã»ããï¼ã¦ã§ã¤åä½ã®ç¡å¹å */
+#define CP15_WRITE_DCISW(reg)	Asm("mcr p15, 0, %0, c7, c6, 2"::"r"(reg))
+
+/* ãã¼ã¿ã­ã£ãã·ã¥ã®ã»ããï¼ã¦ã§ã¤åä½ã®ã¯ãªã¼ã³ã¨ç¡å¹å */
+#define CP15_WRITE_DCCISW(reg)	Asm("mcr p15, 0, %0, c7, c14, 2"::"r"(reg))
+
+/*
+ *  CP15ã®ãã©ã¼ã«ãç¶æ
+ï¼ã¢ãã¬ã¹ã®æä½ãã¯ã­
+ */
+#if __TARGET_ARCH_ARM >= 6
+#define CP15_READ_DFSR(reg)		Asm("mrc p15, 0, %0, c5, c0, 0":"=r"(reg))
+#define CP15_READ_DFAR(reg)		Asm("mrc p15, 0, %0, c6, c0, 0":"=r"(reg))
+#define CP15_READ_IFSR(reg)		Asm("mrc p15, 0, %0, c5, c0, 1":"=r"(reg))
+#define CP15_READ_IFAR(reg)		Asm("mrc p15, 0, %0, c6, c0, 2":"=r"(reg))
+#else /* __TARGET_ARCH_ARM >= 6 */
+#define CP15_READ_FSR(reg)		Asm("mrc p15, 0, %0, c5, c0, 0":"=r"(reg))
+#define CP15_READ_FAR(reg)		Asm("mrc p15, 0, %0, c6, c0, 0":"=r"(reg))
+#endif /* __TARGET_ARCH_ARM >= 6 */
+
+/*
+ *  CP15ã«ããMMUã®æä½ãã¯ã­ï¼VMSAï¼
+ */
+
+/* å¤æãã¼ãã«ãã¼ã¹å¶å¾¡ã¬ã¸ã¹ã¿ï¼ARMv6ä»¥éï¼*/
+#if __TARGET_ARCH_ARM >= 6
+#define CP15_WRITE_TTBCR(reg)	Asm("mcr p15, 0, %0, c2, c0, 2"::"r"(reg))
+#endif /* __TARGET_ARCH_ARM >= 6 */
+
+/* å¤æãã¼ãã«ãã¼ã¹ã¬ã¸ã¹ã¿0 */
+#define CP15_READ_TTBR0(reg)	Asm("mrc p15, 0, %0, c2, c0, 0":"=r"(reg))
+#define CP15_WRITE_TTBR0(reg)	Asm("mcr p15, 0, %0, c2, c0, 0"::"r"(reg))
+
+/* ãã¡ã¤ã³ã¢ã¯ã»ã¹å¶å¾¡ã¬ã¸ã¹ã¿ */
+#define CP15_WRITE_DACR(reg)	Asm("mcr p15, 0, %0, c3, c0, 0":: "r"(reg))
+
+/* ã³ã³ãã­ã¹ãIDã¬ã¸ã¹ã¿ï¼ARMv6ä»¥éï¼*/
+#if __TARGET_ARCH_ARM >= 6
+#define CP15_WRITE_CONTEXTIDR(reg) Asm("mcr p15, 0, %0, c13, c0, 1" ::"r"(reg))
+#endif /* __TARGET_ARCH_ARM >= 6 */
+
+/*
+ *  CP15ã«ããTLBæä½ãã¯ã­ï¼VMSAï¼
+ */
+
+/* TLBå
+¨ä½ã®ç¡å¹å */
+#define CP15_INVALIDATE_TLB()	Asm("mcr p15, 0, %0, c8, c7, 0"::"r"(0))
+
+/*
+ *  CP15ã®ããã©ã¼ãã³ã¹ã¢ãã¿æä½ãã¯ã­ï¼ARMv7ã®ã¿ï¼
+ */
+#if __TARGET_ARCH_ARM == 7
+
+/* ããã©ã¼ãã³ã¹ã¢ãã¿å¶å¾¡ã¬ã¸ã¹ã¿ */
+#define CP15_READ_PMCR(reg)		Asm("mrc p15, 0, %0, c9, c12, 0":"=r"(reg))
+#define CP15_WRITE_PMCR(reg)	Asm("mcr p15, 0, %0, c9, c12, 0"::"r"(reg))
+
+/* ããã©ã¼ãã³ã¹ã¢ãã¿ã«ã¦ã³ãã¤ãã¼ãã«ã»ããã¬ã¸ã¹ã¿ */
+#define CP15_READ_PMCNTENSET(reg)  Asm("mrc p15, 0, %0, c9, c12, 1":"=r"(reg))
+#define CP15_WRITE_PMCNTENSET(reg) Asm("mcr p15, 0, %0, c9, c12, 1"::"r"(reg))
+
+/* ããã©ã¼ãã³ã¹ã¢ãã¿ã«ã¦ã³ã¿ãµã¤ã¯ã«ã¬ã¸ã¹ã¿ */
+#define CP15_READ_PMCCNTR(reg)	Asm("mrc p15, 0, %0, c9, c13, 0":"=r"(reg))
+#define CP15_WRITE_PMCCNTR(reg)	Asm("mcr p15, 0, %0, c9, c13, 0"::"r"(reg))
+
+#endif /* __TARGET_ARCH_ARM == 7 */
+
+/*
+ *  CP15ã«ããã¡ã¢ãªããªã¢æä½ãã¯ã­
+ */
+#define CP15_INST_SYNC_BARRIER() \
+						Asm("mcr p15, 0, %0, c7, c5, 4"::"r"(0):"memory")
+#define CP15_DATA_SYNC_BARRIER() \
+						Asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0):"memory")
+#define CP15_DATA_MEMORY_BARRIER() \
+						Asm("mcr p15, 0, %0, c7, c10, 5"::"r"(0):"memory")
+
+/*
+ *  ã¡ã¢ãªããªã¢
+ *
+ *  ARMv6ã¨ARMv7ãæã¤3ã¤ã®ã¡ã¢ãªããªã¢æ©è½ãä½¿ç¨ããããã®é¢æ°ï¼ã¡ã¢ãª
+ *  ããªã¢ã¯ï¼ARMv7ã§ã¯å°ç¨å½ä»¤ï¼ARMv6ã§ã¯CP15ã¸ã®æ¸è¾¼ã¿ã§å®ç¾ãããï¼
+ *  ARMv7ã®ã¡ã¢ãªããªã¢å½ä»¤ã¯ï¼åæãåãç¯å²ãæå®ã§ãããï¼ä»¥ä¸ã®é¢æ°
+ *  ã§ã¯æå¤§ç¯å²ï¼ã·ã¹ãã å
+¨ä½ï¼ãªã¼ãï¼ã©ã¤ãã®ä¸¡æ¹ï¼ã§åæãåãï¼
+ */
+
+/*
+ *  ãã¼ã¿ã¡ã¢ãªããªã¢
+ *
+ *  ãã®ããªã¢ã®åå¾ã§ï¼ã¡ã¢ãªã¢ã¯ã»ã¹ã®é åºãå
+¥ãæãããªãããã«ããï¼
+ *  ãã«ãã³ã¢ï¼å³å¯ã«ã¯ãã«ããã¹ã¿ï¼ã§ã®ä½¿ç¨ãæ³å®ããå½ä»¤ï¼
+ */
+Inline void
+data_memory_barrier(void)
+{
+#if __TARGET_ARCH_ARM <= 6
+	CP15_DATA_MEMORY_BARRIER();
+#else /* __TARGET_ARCH_ARM <= 6 */
+	Asm("dmb":::"memory");
+#endif /* __TARGET_ARCH_ARM <= 6 */
+}
+
+/*
+ *  ãã¼ã¿åæããªã¢
+ *
+ *  å
+è¡ããã¡ã¢ãªã¢ã¯ã»ã¹ãå®äºããã®ãå¾
+ã¤ï¼ã¡ã¢ãªã¢ã¯ã»ã¹ãå¯ä½ç¨ã
+ *  æã¤æã«ï¼ãã®å¯ä½ç¨ãèµ·ããã®ãå¾
+ã¤ããã®ä½¿ç¨ãæ³å®ããå½ä»¤ï¼
+ */
+Inline void
+data_sync_barrier(void)
+{
+#if __TARGET_ARCH_ARM <= 6
+	CP15_DATA_SYNC_BARRIER();
+#else /* __TARGET_ARCH_ARM <= 6 */
+	Asm("dsb":::"memory");
+#endif /* __TARGET_ARCH_ARM <= 6 */
+}
+
+/*
+ *  å½ä»¤åæããªã¢
+ *
+ *  ãã­ã°ã©ã ãæ¸ãæããããï¼ã¾ãã¯ï¼ã·ã¹ãã ç¶æ
+ã®å¤åã«ããå®è¡ã
+ *  ã¹ããã­ã°ã©ã ãå¤ãã£ãï¼æã«ï¼ãã¤ãã©ã¤ã³ããã©ãã·ã¥ãããªã©ï¼
+ *  æ°ãããã­ã°ã©ã ãèª­ã¿è¾¼ãããã«ããï¼ARMv6ã§ã¯ï¼ããªãã§ãããã©ã
+ *  ã·ã¥ã¨å¼ã°ãã¦ããï¼
+ */
+Inline void
+inst_sync_barrier(void)
+{
+#if __TARGET_ARCH_ARM <= 6
+	CP15_INST_SYNC_BARRIER();
+#else /* __TARGET_ARCH_ARM <= 6 */
+	Asm("isb":::"memory");
+#endif /* __TARGET_ARCH_ARM <= 6 */
+}
+
+#endif /* TOPPERS_ARM_INSN_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core.tf
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core.tf	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core.tf	(revision 302)
@@ -0,0 +1,83 @@
+$
+$		ãã¹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_asm.inc
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_asm.inc	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_asm.inc	(revision 302)
@@ -0,0 +1,84 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2011-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_asm.inc 349 2015-07-25 05:25:27Z ertl-hiro $
+ */
+
+/*
+ *		ã¢ã»ã³ããªè¨èªç¨ãã¯ã­å®ç¾©ï¼ARM GNUéçºç°å¢ç¨ï¼
+ */
+
+#ifndef TOPPERS_CORE_ASM_INC
+#define TOPPERS_CORE_ASM_INC
+
+/*
+ *  ãã£ã¬ã¯ãã£ãã®ãã¯ã­å®ç¾©
+ */
+#define ASECTION(name)	.section name, "a"
+#define ATEXT			.text
+#define AGLOBAL(name)	.global name
+#define AALIGN(size)	.align size
+#define ALONG			.long
+#define ALABEL(label)	label:
+#define AOR				|
+#define AWEAK(name)		.weak name
+
+/*
+ *  ã»ã¯ã·ã§ã³æ
+å ±
+ */
+#define DATA_START		__start_data
+#define DATA_END		__end_data
+#define IDATA_START		__start_idata
+#define BSS_START		__start_bss
+#define BSS_END			__end_bss
+
+#endif /* TOPPERS_CORE_ASM_INC */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_cfg1_out.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_cfg1_out.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_cfg1_out.h	(revision 302)
@@ -0,0 +1,23 @@
+/*
+ *		cfg1_out.cã®ãªã³ã¯ã«å¿
+è¦ãªã¹ã¿ãã®å®ç¾©
+ *
+ *  $Id: core_cfg1_out.h 349 2015-07-25 05:25:27Z ertl-hiro $
+ */
+
+/*
+ *  cfg1_out.cã®ãªã³ã¯ã«å¿
+è¦ãªå®ç¾©
+ */
+
+#include <kernel.h>
+
+void sta_ker(void){}
+STK_T *const	_kernel_istkpt;
+
+/*
+ *  offset.hãçæããããã®å®ç¾©
+ */
+const uint8_t	MAGIC_1 = 0x12;
+const uint16_t	MAGIC_2 = 0x1234;
+const uint32_t	MAGIC_4 = 0x12345678;
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_check.tf
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_check.tf	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_check.tf	(revision 302)
@@ -0,0 +1,61 @@
+$ 
+$		ãã¹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_def.csv
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_def.csv	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_def.csv	(revision 302)
@@ -0,0 +1,7 @@
+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.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_kernel.h	(revision 302)
@@ -0,0 +1,136 @@
+/*
+ *  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) 2004-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_kernel.h 454 2015-08-16 03:18:46Z ertl-hiro $
+ */
+
+/*
+ *		kernel.hã®ã³ã¢ä¾å­é¨ï¼ARMç¨ï¼
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼target_kernel.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ã
+ *  ããããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ããç´æ¥ã¤
+ *  ã³ã¯ã«ã¼ããã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_CORE_KERNEL_H
+#define TOPPERS_CORE_KERNEL_H
+
+/*
+ *  ã¹ã¿ãã¯ã®å
+ *
+ *  ARMã§ã¯ï¼ã¹ã¿ãã¯ã8ãã¤ãå¢çã«é
+ç½®ããå¿
+è¦ãããï¼
+ */
+#define TOPPERS_STK_T	long long
+
+/*
+ *  CPUä¾å¤ãã³ãã©çªå·ã®æ°
+ */  
+#define TNUM_EXCNO		6
+
+/*
+ *  CPUä¾å¤ãã³ãã©çªå·ã®å®ç¾©
+ */
+#define EXCNO_UNDEF		0
+#define EXCNO_SVC		1
+#define EXCNO_PABORT	2
+#define EXCNO_DABORT	3
+#define EXCNO_IRQ		4
+#define EXCNO_FIQ		5
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããã¡ã¢ãªé åã®æ§é 
+ */
+#if __TARGET_ARCH_ARM < 6
+
+typedef struct t_excinf {
+	uint32_t	nest_count;				/* ä¾å¤ãã¹ãã«ã¦ã³ã */
+	uint32_t	intpri;					/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ */
+	uint32_t	cpsr;					/* CPUä¾å¤çºçæã®CPSR */
+	uint32_t	r0;
+	uint32_t	r1;
+	uint32_t	r2;
+	uint32_t	r3;
+	uint32_t	r4;
+	uint32_t	r12;
+	uint32_t	lr;
+	uint32_t	pc;						/* æ»ãçªå° */
+} T_EXCINF;
+
+#else /* __TARGET_ARCH_ARM < 6 */
+
+typedef struct t_excinf {
+	uint32_t	nest_count;				/* ä¾å¤ãã¹ãã«ã¦ã³ã */
+	uint32_t	intpri;					/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ */
+	uint32_t	r0;
+	uint32_t	r1;
+	uint32_t	r2;
+	uint32_t	r3;
+	uint32_t	r4;
+	uint32_t	r12;
+	uint32_t	lr;
+	uint32_t	pc;						/* æ»ãçªå° */
+	uint32_t	cpsr;					/* CPUä¾å¤çºçæã®CPSR */
+} T_EXCINF;
+
+#endif /* __TARGET_ARCH_ARM < 6 */
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_CORE_KERNEL_H */
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 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_kernel_impl.c	(revision 302)
@@ -0,0 +1,348 @@
+/*
+ *  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) 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: core_kernel_impl.c 430 2015-08-08 11:38:46Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®ã³ã¢ä¾å­é¨ï¼ARMç¨ï¼
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "arm.h"
+
+/*
+ *  ã³ã³ãã­ã¹ãåç
+§ã®ããã®å¤æ°
+ */
+uint32_t	excpt_nest_count;		/* ä¾å¤ãã¹ãã«ã¦ã³ã */
+
+/*
+ *  MMUé¢é£ã®æä½ï¼VMSAï¼
+ */
+#ifdef USE_ARM_MMU
+
+#define D0_CLIENT	0x01U		/* å¤æãã¼ãã«ã«å¾ã£ã¦ãã¡ã¤ã³0ã«ã¢ã¯ã»ã¹ */
+#define USE_ASID	1			/* ä½¿ç¨ããASID */
+
+/*
+ *  ã»ã¯ã·ã§ã³ãã¼ãã«
+ */
+static uint32_t section_table[ARM_SECTION_TABLE_ENTRY]
+							__attribute__((aligned(ARM_SECTION_TABLE_ALIGN)));
+
+/*
+ *  MMUã®ã»ã¯ã·ã§ã³ãã¼ãã«ã¨ã³ããªã®è¨­å®
+ */
+Inline void
+config_section_entry(ARM_MMU_CONFIG *p_ammuc)
+{
+	uint32_t	vaddr = p_ammuc->vaddr;
+	uint32_t	paddr = p_ammuc->paddr;
+	uint32_t	size = p_ammuc->size;
+	uint_t		i;
+
+	while (size > 0) {
+#ifdef USE_ARM_SSECTION
+		if (size >= ARM_SSECTION_SIZE && (vaddr % ARM_SSECTION_SIZE) == 0) {
+			for (i = 0; i < 16; i++) {
+				section_table[vaddr / ARM_SECTION_SIZE] = paddr
+									|ARM_MMU_DSCR1_SSECTION|p_ammuc->attr;
+				vaddr += ARM_SECTION_SIZE;
+			}
+			paddr += ARM_SSECTION_SIZE;
+			size -= ARM_SSECTION_SIZE;
+		}
+		else {
+#endif /* USE_ARM_SSECTION */
+			section_table[vaddr / ARM_SECTION_SIZE] = paddr
+									|ARM_MMU_DSCR1_SECTION|p_ammuc->attr;
+			vaddr += ARM_SECTION_SIZE;
+			paddr += ARM_SECTION_SIZE;
+			size -= ARM_SECTION_SIZE;
+#ifdef USE_ARM_SSECTION
+		}
+#endif /* USE_ARM_SSECTION */
+	}
+}
+
+/*
+ *  MMUã®åæå
+ */
+void
+arm_mmu_initialize(void)
+{
+	uint32_t	reg;
+	uint_t		i;
+
+	/*
+	 *  MMUã®ã»ã¯ã·ã§ã³ãã¼ãã«ã®è¨­å®
+	 */
+	for (i = 0; i < ARM_SECTION_TABLE_ENTRY; i++) {
+		section_table[i] = ARM_MMU_DSCR1_FAULT;
+	}
+	for (i = 0; i < arm_tnum_memory_area; i++) {
+		config_section_entry(&(arm_memory_area[i]));
+	}
+
+	/*
+	 *  TTBR0ãç¨ããããã«æå®ï¼ARMv6ä»¥éï¼
+	 */
+#if __TARGET_ARCH_ARM >= 6
+	CP15_WRITE_TTBCR(0U);
+#endif /* __TARGET_ARCH_ARM >= 6 */
+
+	/*
+	 *  å¤æãã¼ãã«ã¨ãã¦ï¼section_tableãä½¿ç¨ããï¼
+	 */
+	reg = ((uint32_t) &(section_table[0])) | TTBR_CONFIG;
+	CP15_WRITE_TTBR0(reg);
+
+	/*
+	 * ãã¡ã¤ã³ã¢ã¯ã»ã¹å¶å¾¡ã®è¨­å®
+	 */
+	CP15_WRITE_DACR(D0_CLIENT);
+
+	/*
+	 *  ASIDã®è¨­å®
+	 */
+#if __TARGET_ARCH_ARM >= 6
+	CP15_WRITE_CONTEXTIDR(USE_ASID);
+#endif /* __TARGET_ARCH_ARM >= 6 */
+
+	/*
+	 *  TLBå
+¨ä½ã®ç¡å¹å
+	 */
+	arm_invalidate_tlb();
+
+	/*
+	 *  MMUãæå¹ã«ããï¼ARMv6ã§ã¯ï¼æ¡å¼µãã¼ã¸ãã¼ãã«è¨­å®ãä½¿ãï¼ãµã
+	 *  ãã¼ã¸ã¯ä½¿ããªãï¼ããã«è¨­å®ããï¼
+	 */
+	CP15_READ_SCTLR(reg);
+#if __TARGET_ARCH_ARM == 6
+	reg |= (CP15_SCTLR_MMU|CP15_SCTLR_EXTPAGE);
+#else /* __TARGET_ARCH_ARM == 6 */
+	reg |= CP15_SCTLR_MMU;
+#endif /* __TARGET_ARCH_ARM == 6 */
+	CP15_WRITE_SCTLR(reg);
+	inst_sync_barrier();
+}
+
+#endif /* USE_ARM_MMU */
+
+/*
+ *  ã³ã¢ä¾å­ã®åæå
+ */
+void
+core_initialize(void)
+{
+	/*
+	 *  ã«ã¼ãã«èµ·åæã¯éã¿ã¹ã¯ã³ã³ãã­ã¹ãã¨ãã¦åä½ãããããã«ï¼ä¾å¤
+	 *  ã®ãã¹ãåæ°ã1ã«åæåããï¼
+	 */ 
+	excpt_nest_count = 1U;
+
+	/*
+	 *  ããã©ã¼ãã³ã¹ã¢ãã¿ã®åæå
+	 */
+#if defined(USE_ARM_PM_HIST) && __TARGET_ARCH_ARM == 7
+	arm_init_pmcnt();
+#endif /* defined(USE_ARM_PM_HIST) && __TARGET_ARCH_ARM == 7 */
+}
+
+/*
+ *  ã³ã¢ä¾å­ã®çµäºå¦ç
+ */
+void
+core_terminate(void)
+{
+}
+
+/*
+ *  CPUä¾å¤ã®çºçç¶æ³ã®ã­ã°åºå
+ */
+#ifndef OMIT_XLOG_SYS
+
+/*
+ *  CPUä¾å¤ãã³ãã©ã®ä¸­ããï¼CPUä¾å¤æ
+å ±ãã¤ã³ã¿ï¼p_excinfï¼ãå¼æ°ã¨ã
+ *  ã¦å¼ã³åºããã¨ã§ï¼CPUä¾å¤ã®çºçç¶æ³ãã·ã¹ãã ã­ã°ã«åºåããï¼
+ */
+void
+xlog_sys(void *p_excinf)
+{
+	syslog_4(LOG_EMERG, "pc = %08x, cpsr = %08x, lr = %08x, r12 = %08x",
+			((T_EXCINF *)(p_excinf))->pc, ((T_EXCINF *)(p_excinf))->cpsr,
+			((T_EXCINF *)(p_excinf))->lr, ((T_EXCINF *)(p_excinf))->r12);
+	syslog_4(LOG_EMERG, "r0 = %08x, r1 = %08x, r2 = %08x, r3 = %08x",
+			((T_EXCINF *)(p_excinf))->r0, ((T_EXCINF *)(p_excinf))->r1,
+			((T_EXCINF *)(p_excinf))->r2, ((T_EXCINF *)(p_excinf))->r3);
+	syslog_2(LOG_EMERG, "nest_count = %d, intpri = %d",
+			((T_EXCINF *)(p_excinf))->nest_count,
+			((T_EXCINF *)(p_excinf))->intpri);
+}
+
+/*
+ *  ããªãã§ããï¼ãã¼ã¿ã¢ãã¼ããçºçããç¶æ³ï¼ç¶æ
+ã¨ã¢ãã¬ã¹ï¼ãã·ã¹
+ *  ãã ã­ã°ã«åºåããï¼
+ */
+void
+xlog_fsr(uint32_t fsr, uint32_t far)
+{
+	char	*status;
+
+	switch (fsr & CP15_FSR_FS_MASK) {
+	case CP15_FSR_FS_ALIGNMENT:
+		status = "alignment fault";
+		break;
+	case CP15_FSR_FS_TRANSLATION1:
+		status = "translation fault (1st level)";
+		break;
+	case CP15_FSR_FS_TRANSLATION2:
+		status = "translation fault (2nd level)";
+		break;
+	case CP15_FSR_FS_PERMISSION1:
+		status = "permission fault (1st level)";
+		break;
+	case CP15_FSR_FS_PERMISSION2:
+		status = "permission fault (2nd level)";
+		break;
+	default:
+		status = "other fault";
+		break;
+	}
+	syslog_2(LOG_EMERG, "Fault status: 0x%04x (%s)", fsr, status);
+	syslog_1(LOG_EMERG, "Fault address: 0x%08x", far);
+}
+
+#endif /* OMIT_XLOG_SYS */
+
+/*
+ *  æªå®ç¾©ã®å²è¾¼ã¿ãå
+¥ã£ãå ´åã®å¦ç
+ */
+#ifndef OMIT_DEFAULT_INT_HANDLER
+
+void
+default_int_handler(void)
+{
+	syslog_0(LOG_EMERG, "Unregistered interrupt occurs.");
+	ext_ker();
+}
+
+#endif /* OMIT_DEFAULT_INT_HANDLER */
+
+/*
+ *  æªå®ç¾©ã®ä¾å¤ãå
+¥ã£ãå ´åã®å¦ç
+ */
+#ifndef OMIT_DEFAULT_EXC_HANDLER
+
+void
+default_exc_handler(void *p_excinf, EXCNO excno)
+{
+#ifdef OMIT_XLOG_SYS
+	syslog_1(LOG_EMERG, "Unregistered exception %d occurs.", excno);
+#else /* OMIT_XLOG_SYS */
+	switch (excno) {
+	case EXCNO_UNDEF:
+		syslog_0(LOG_EMERG, "Undefined Instruction exception occurs.");
+		break;
+	case EXCNO_SVC:
+		syslog_0(LOG_EMERG, "Supervisor Call exception occurs.");
+		break;
+	case EXCNO_PABORT:
+		syslog_0(LOG_EMERG, "Prefetch Abort exception occurs.");
+		break;
+	case EXCNO_DABORT:
+		syslog_0(LOG_EMERG, "Data Abort exception occurs.");
+		break;
+	case EXCNO_IRQ:
+		syslog_0(LOG_EMERG, "IRQ exception occurs.");
+		break;
+	case EXCNO_FIQ:
+		syslog_0(LOG_EMERG, "FIQ exception occurs.");
+		break;
+	}
+	xlog_sys(p_excinf);
+
+	if (excno == EXCNO_PABORT || excno == EXCNO_DABORT) {
+		uint32_t	fsr, far;
+
+#if __TARGET_ARCH_ARM >= 6
+		if (excno == EXCNO_PABORT) {
+			CP15_READ_IFSR(fsr);
+			CP15_READ_IFAR(far);
+		}
+		else {
+			CP15_READ_DFSR(fsr);
+			CP15_READ_DFAR(far);
+		}
+#else /* __TARGET_ARCH_ARM >= 6 */
+		CP15_READ_FSR(fsr);
+		CP15_READ_FAR(far);
+#endif /* __TARGET_ARCH_ARM >= 6 */
+
+		xlog_fsr(fsr, far);
+	}
+#endif /* OMIT_XLOG_SYS */
+	ext_ker();
+}
+
+#endif /* OMIT_DEFAULT_EXC_HANDLER */
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 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_kernel_impl.h	(revision 302)
@@ -0,0 +1,559 @@
+/*
+ *  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) 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: core_kernel_impl.h 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		kernel_impl.hã®ã³ã¢ä¾å­é¨ï¼ARMç¨ï¼
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼target_kernel_impl.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯
+ *  ã«ã¼ãããããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ãã
+ *  ç´æ¥ã¤ã³ã¯ã«ã¼ããã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_CORE_KERNEL_IMPL_H
+#define TOPPERS_CORE_KERNEL_IMPL_H
+
+#include "arm.h"
+
+/*
+ *  ã¨ã©ã¼ãã§ãã¯æ¹æ³ã®æå®
+ */
+#define CHECK_STKSZ_ALIGN	8		/* ã¹ã¿ãã¯ãµã¤ãºã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_INTPTR_ALIGN	4		/* intptr_tåã®å¤æ°ã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_INTPTR_NONNULL		/* intptr_tåã®å¤æ°ã®éNULLãã§ãã¯ */
+#ifndef  __thumb__
+#define CHECK_FUNC_ALIGN	4		/* é¢æ°ã®ã¢ã©ã¤ã³åä½ */
+#endif /* __thumb__ */
+#define CHECK_FUNC_NONNULL			/* é¢æ°ã®éNULLãã§ãã¯ */
+#define CHECK_STACK_ALIGN	4		/* ã¹ã¿ãã¯é åã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_STACK_NONNULL			/* ã¹ã¿ãã¯é åã®éNULLãã§ãã¯ */
+#define CHECK_MPF_ALIGN		4		/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_MPF_NONNULL			/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®éNULLãã§ãã¯ */
+#define CHECK_MB_ALIGN		4		/* ç®¡çé åã®ã¢ã©ã¤ã³åä½ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ãµã¼ãã®ããã®ãããããããµã¼ãé¢æ°
+ *
+ *  CLZå½ä»¤ã¯æä¸ä½ããããããµã¼ãããããï¼æä¸ä½ããããæé«åªå
+åº¦ã«
+ *  å¯¾å¿ãããï¼
+ */
+#if __TARGET_ARCH_ARM >= 6
+
+#define	OMIT_BITMAP_SEARCH
+#define	PRIMAP_BIT(pri)		(0x8000U >> (pri))
+
+Inline uint_t
+bitmap_search(uint16_t bitmap)
+{
+	return((uint_t)(count_leading_zero((uint32_t) bitmap) - 16));
+}
+
+#endif /* __TARGET_ARCH_ARM >= 6 */
+
+/*
+ *  ã³ã³ãã­ã¹ãã®åç
+§
+ *
+ *  ARMä¾å­é¨ã§ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã¨éã¿ã¹ã¯ã³ã³ãã­ã¹ãã®ä¸¡æ¹ãã¹ã¼
+ *  ããã¤ã¶ã¢ã¼ãã§åä½ãããããï¼ãã­ã»ããµã¢ã¼ãã§å¤æ­ãããã¨ãã§
+ *  ããªãï¼ãã®ããï¼å²è¾¼ã¿ãã³ãã©ï¼CPUä¾å¤ãã³ãã©ã®ãã¹ãæ®µæ°ï¼ãã
+ *  ãï¼ä¾å¤ãã¹ãã«ã¦ã³ãã¨å¼ã¶ï¼ã§ç®¡çãï¼ä¾å¤ãã¹ãã«ã¦ã³ãã0ã®æã«
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼0ããå¤§ããå ´åã«éã¿ã¹ã¯ã³ã³ãã­ã¹ãã§ããã¨å¤
+ *  æ­ããï¼
+ */
+extern uint32_t	excpt_nest_count;		/* ä¾å¤ãã¹ãã«ã¦ã³ã */
+
+Inline bool_t
+sense_context(void)
+{
+	return(excpt_nest_count > 0U);
+}
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  TOPPERSæ¨æºå²è¾¼ã¿å¦çã¢ãã«ã®å®ç¾
+ *
+ *  ARMã³ã¢ä¾å­é¨ã§ã¯ï¼å²è¾¼ã¿ã®æ±ãã«é¢ãã¦ï¼æ¬¡ã®2ã¤ã®æ¹æ³ããµãã¼ãã
+ *  ãï¼
+ *
+ *  (1) ã«ã¼ãã«ãåä½ã§ä½¿ç¨ããå ´åãSafeGã®ãã³ã»ã­ã¥ã¢ã¢ã¼ãã§ä½¿ç¨ã
+ *  ãå ´åï¼IRQãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ï¼FIQãã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã¨ã
+ *  ãï¼ããã©ã«ãã§ã¯ï¼ãã®æ¹æ³ãä½¿ç¨ãããï¼
+ *
+ *  (2) SafeGã®ã»ã­ã¥ã¢ã¢ã¼ãã§ä½¿ç¨ããå ´åï¼FIQãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿
+ *  ã¨ãï¼ã«ã¼ãã«ã®åä½ä¸­ã¯IRQãå¸¸ã«ãã¹ã¯ããï¼ãã®æ¹æ³ãä½¿ç¨ããå ´å
+ *  ã«ã¯ï¼TOPPERS_SAFEG_SECUREããã¯ã­å®ç¾©ããï¼
+ * 
+ *  TOPPERSæ¨æºå²è¾¼ã¿å¦çã¢ãã«ã®ä¸­ã§ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¨å²è¾¼ã¿è¦æ±ç¦
+ *  æ­¢ãã©ã°ã«é¢ãã¦ã¯ï¼å²è¾¼ã¿ã³ã³ãã­ã¼ã©ã«ãã£ã¦å®ç¾æ¹æ³ãç°ãªãããï¼
+ *  ARMã³ã¢ä¾å­é¨ã§ã¯æ±ããªãï¼
+ */
+
+/*
+ *  FIQã¨IRQã®ä¸¡æ¹ãç¦æ­¢ããCPSRã®ããããã¿ã¼ã³
+ */
+#ifndef TOPPERS_MACRO_ONLY
+#define CPSR_FIQ_IRQ_BIT	(CPSR_FIQ_BIT|CPSR_IRQ_BIT)
+#else /* TOPPERS_MACRO_ONLY */
+#define CPSR_FIQ_IRQ_BIT	(CPSR_FIQ_BIT AOR CPSR_IRQ_BIT)
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  CPUã­ãã¯ã»å²è¾¼ã¿ã­ãã¯ã§ãªãç¶æ
+ã§ã®CPSRã®ããããã¿ã¼ã³
+ */
+#ifndef TOPPERS_SAFEG_SECURE
+#define CPSR_UNLOCK			UINT_C(0x00)
+#else /* TOPPERS_SAFEG_SECURE */
+#define CPSR_UNLOCK			CPSR_IRQ_BIT
+#endif /* TOPPERS_SAFEG_SECURE */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã§ã®CPSRã®ããããã¿ã¼ã³
+ */
+#ifndef TOPPERS_SAFEG_SECURE
+#define CPSR_CPULOCK		CPSR_IRQ_BIT
+#else /* TOPPERS_SAFEG_SECURE */
+#define CPSR_CPULOCK		CPSR_FIQ_IRQ_BIT
+#endif /* TOPPERS_SAFEG_SECURE */
+
+/*
+ *  å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§ã®CPSRã®ããããã¿ã¼ã³
+ */
+#define CPSR_INTLOCK		CPSR_FIQ_IRQ_BIT
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã¸ã®é·ç§»
+ */
+Inline void
+lock_cpu(void)
+{
+#if __TARGET_ARCH_ARM < 6
+	set_cpsr(current_cpsr() | CPSR_CPULOCK);
+#else /* __TARGET_ARCH_ARM < 6 */
+#ifndef TOPPERS_SAFEG_SECURE
+	disable_irq();
+#else /* TOPPERS_SAFEG_SECURE */
+	disable_fiq()
+#endif /* TOPPERS_SAFEG_SECURE */
+#endif /* __TARGET_ARCH_ARM < 6 */
+
+	/*
+	 *  ã¡ã¢ãªåç
+§ãï¼ãã®é¢æ°ãè¶
+ãã¦æé©åããããã¨ãææ­¢
+	 */
+	ARM_MEMORY_CHANGED;
+}
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã¸ã®ç§»è¡ï¼ãã£ã¹ãããã§ããç¶æ
+ï¼
+ */
+#define lock_cpu_dsp()		lock_cpu()
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®è§£é¤
+ */
+Inline void
+unlock_cpu(void)
+{
+	/*
+	 *  ã¡ã¢ãªåç
+§ãï¼ãã®é¢æ°ãè¶
+ãã¦æé©åããããã¨ãææ­¢
+	 */
+	ARM_MEMORY_CHANGED;
+
+#if __TARGET_ARCH_ARM < 6
+	set_cpsr((current_cpsr() & ~CPSR_INT_MASK) | CPSR_UNLOCK);
+#else /* __TARGET_ARCH_ARM < 6 */
+#ifndef TOPPERS_SAFEG_SECURE
+	enable_irq();
+#else /* TOPPERS_SAFEG_SECURE */
+	enable_fiq()
+#endif /* TOPPERS_SAFEG_SECURE */
+#endif /* __TARGET_ARCH_ARM < 6 */
+}
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®è§£é¤ï¼ãã£ã¹ãããã§ããç¶æ
+ï¼
+ */
+#define unlock_cpu_dsp()	unlock_cpu()
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®åç
+§
+ */
+Inline bool_t
+sense_lock(void)
+{
+#ifndef TOPPERS_SAFEG_SECURE
+	return((current_cpsr() & CPSR_IRQ_BIT) != 0U);
+#else /* TOPPERS_SAFEG_SECURE */
+	return((current_cpsr() & CPSR_FIQ_BIT) != 0U);
+#endif /* TOPPERS_SAFEG_SECURE */
+}
+
+/*
+ *  å²è¾¼ã¿ãåãä»ããããã®é
+å»¶å¦ç
+ */
+Inline void
+delay_for_interrupt(void)
+{
+}
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯åæå¤
+ */
+#define TOPPERS_ISTKPT(istk, istksz)	((STK_T *)((char *)(istk) + (istksz)))
+
+/*
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ã®å®ç¾©
+ */
+typedef struct task_context_block {
+	void	*sp;		/* ã¹ã¿ãã¯ãã¤ã³ã¿ */
+	FP		pc;			/* å®è¡åéçªå° */
+} TSKCTXB;
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããã£
+ */
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã¸ã®ãã£ã¹ãããï¼core_support.Sï¼
+ *
+ *  dispatchã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºããããµã¼ãã¹ã³ã¼ã«å¦çã
+ *  ãå¼ã³åºãã¹ããã®ã§ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»ãã£ã¹ãã
+ *  ãè¨±å¯ç¶æ
+ã»ï¼ã¢ãã«ä¸ã®ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§å¼ã³åºããª
+ *  ããã°ãªããªãï¼
+ */
+extern void dispatch(void);
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®ãã£ã¹ãããè¦æ±
+ */
+#define request_dispatch()
+
+/*
+ *  ãã£ã¹ãããã£ã®åä½éå§ï¼core_support.Sï¼
+ *
+ *  start_dispatchã¯ï¼ã«ã¼ãã«èµ·åæã«å¼ã³åºãã¹ããã®ã§ï¼ãã¹ã¦ã®å²è¾¼
+ *  ã¿ãç¦æ­¢ããç¶æ
+ï¼å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨åç­ã®ç¶æ
+ï¼ã§å¼ã³åºããªããã°
+ *  ãªããªãï¼
+ */
+extern void start_dispatch(void) NoReturn;
+
+/*
+ *  ç¾å¨ã®ã³ã³ãã­ã¹ããæ¨ã¦ã¦ãã£ã¹ãããï¼core_support.Sï¼
+ *
+ *  exit_and_dispatchã¯ï¼ext_tskããå¼ã³åºãã¹ããã®ã§ï¼ã¿ã¹ã¯ã³ã³ãã­
+ *  ã¹ãã»CPUã­ãã¯ç¶æ
+ã»ãã£ã¹ãããè¨±å¯ç¶æ
+ã»ï¼ã¢ãã«ä¸ã®ï¼å²è¾¼ã¿åªå
+
+ *  åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§å¼ã³åºããªããã°ãªããªãï¼
+ */
+extern void exit_and_dispatch(void) NoReturn;
+
+/*
+ *  ã«ã¼ãã«ã®çµäºå¦çã®å¼åºãï¼core_support.Sï¼
+ *
+ *  call_exit_kernelã¯ï¼ã«ã¼ãã«ã®çµäºæã«å¼ã³åºãã¹ããã®ã§ï¼éã¿ã¹ã¯
+ *  ã³ã³ãã­ã¹ãã«åãæãã¦ï¼ã«ã¼ãã«ã®çµäºå¦çï¼exit_kernelï¼ãå¼ã³åº
+ *  ãï¼
+ */
+extern void call_exit_kernel(void) NoReturn;
+     
+/*
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãã®åæå
+ *
+ *  ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã«é·ç§»ããæã«å¼ã°ããï¼ãã®æç¹
+ *  ã§ã¹ã¿ãã¯é åãä½¿ã£ã¦ã¯ãªããªãï¼
+ *
+ *  activate_contextãï¼ã¤ã³ã©ã¤ã³é¢æ°ã§ã¯ãªããã¯ã­å®ç¾©ã¨ãã¦ããã®ã¯ï¼
+ *  ãã®æç¹ã§ã¯TCBãå®ç¾©ããã¦ããªãããã§ããï¼
+ */
+extern void start_r(void);
+
+#define activate_context(p_tcb)											\
+{																		\
+	(p_tcb)->tskctxb.sp = (void *)((char *)((p_tcb)->p_tinib->stk)		\
+										+ (p_tcb)->p_tinib->stksz);		\
+	(p_tcb)->tskctxb.pc = (FP) start_r;									\
+}
+
+/*
+ *  æ¨æºã®å²è¾¼ã¿ç®¡çæ©è½ã®åæåå¦çãç¨ããªã
+ */
+#define OMIT_INITIALIZE_INTERRUPT
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©ãã¼ãã«ï¼kernel_cfg.cï¼
+ */
+extern const FP inh_table[TNUM_INHNO];
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã©ã¤ã³è¨­å®ãã¼ãã«ï¼kernel_cfg.cï¼
+ * 
+ *  å²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããã°1ï¼è¨­å®ããã¦ã
+ *  ãªããã°0ãä¿æãããã¼ãã«ï¼
+ */
+#ifdef USE_INTCFG_TABLE
+extern const uint8_t intcfg_table[TNUM_INTNO];
+#endif /* USE_INTCFG_TABLE */
+
+/*
+ *  æ¨æºã®ä¾å¤ç®¡çæ©è½ã®åæåå¦çãç¨ããªã
+ */
+#define OMIT_INITIALIZE_EXCEPTION
+
+/*
+ *  CPUä¾å¤ãã³ãã©ãã¼ãã«ï¼kernel_cfg.cï¼
+ */
+extern const FP exc_table[TNUM_EXCNO];
+
+/*
+ *  CPUä¾å¤ãã³ãã©ã®åæå
+ */
+Inline void
+initialize_exception(void)
+{
+}
+
+/*
+ *  CPUä¾å¤ã®çºçããæã®ã³ã³ãã­ã¹ãã®åç
+§
+ *
+ *  CPUä¾å¤ã®çºçããæã®ã³ã³ãã­ã¹ããï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã®æã«falseï¼
+ *  ããã§ãªãæã«trueãè¿ãï¼
+ */
+Inline bool_t
+exc_sense_context(void *p_excinf)
+{
+	return(((T_EXCINF *)(p_excinf))->nest_count != 0U);
+}
+
+/*
+ *  CPUä¾å¤ã®çºçããæã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®åç
+§
+ */
+Inline PRI
+exc_get_intpri(void *p_excinf)
+{
+	return((PRI)(((T_EXCINF *)(p_excinf))->intpri));
+}
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã¾ãã¯å²è¾¼ã¿ã­ãã¯ç¶æ
+ãã®åç
+§
+ */
+Inline bool_t
+exc_sense_lock(void *p_excinf)
+{
+#ifndef TOPPERS_SAFEG_SECURE
+	return(((((T_EXCINF *)(p_excinf))->cpsr) & CPSR_INT_MASK) != 0U);
+#define CPSR_UNLOCK			UINT_C(0x00)
+#else /* TOPPERS_SAFEG_SECURE */
+	return(((((T_EXCINF *)(p_excinf))->cpsr) & CPSR_FIQ_BIT) != 0U);
+#endif /* TOPPERS_SAFEG_SECURE */
+}
+
+/*
+ *  CPUä¾å¤ã®çºçããæã®ã³ã³ãã­ã¹ãã¨å²è¾¼ã¿ã®ãã¹ã¯ç¶æ
+ã®åç
+§
+ *
+ *  CPUä¾å¤ã®çºçããæã®ã·ã¹ãã ç¶æ
+ãï¼ã«ã¼ãã«å®è¡ä¸­ã§ãªãï¼ã¿ã¹ã¯ã³
+ *  ã³ãã­ã¹ãã§ããï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§ãªãï¼CPUã­ãã¯ç¶æ
+ã§ãªãï¼å²
+ *  è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§ããæã«trueï¼ããã§ãªãæã«falseãè¿ã
+ *  ï¼CPUä¾å¤ãã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿å¦çä¸­ã§çºçããå ´åã«ãfalseãè¿
+ *  ãï¼ï¼
+ *
+ */
+Inline bool_t
+exc_sense_intmask(void *p_excinf)
+{
+	return(!exc_sense_context(p_excinf)
+				&& exc_get_intpri(p_excinf) == TIPM_ENAALL
+				&& !exc_sense_lock(p_excinf));
+}
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  MMUé¢é£ã®æä½ï¼VMSAï¼
+ */
+#ifdef USE_ARM_MMU
+
+/*
+ *  å¤æãã¼ãã«ãã¼ã¹ã¬ã¸ã¹ã¿ï¼TTBRï¼ã®è¨­å®å¤
+ */
+#if __TARGET_ARCH_ARM < 7
+#define TTBR_CONFIG		(CP15_TTBR_RGN_CACHEABLE|CP15_TTBR_RGN_SHAREABLE \
+												|CP15_TTBR_RGN_WBACK)
+#else /* __TARGET_ARCH_ARM < 7 */
+#define TTBR_CONFIG		(CP15_TTBR_RGN_SHAREABLE|CP15_TTBR_RGN_WBWA \
+												|CP15_TTBR_IRGN_WBWA)
+#endif /* __TARGET_ARCH_ARM < 7 */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  MMUã®è¨­å®æ
+å ±ã®ãã¼ã¿å
+ */
+typedef struct arm_mmu_config {
+	uint32_t	vaddr;			/* ä»®æ³ã¢ãã¬ã¹ */
+	uint32_t	paddr;			/* ç©çã¢ãã¬ã¹ */
+	uint32_t	size;			/* ãµã¤ãº */
+	uint32_t	attr;			/* ã»ã¯ã·ã§ã³å±æ§ */
+} ARM_MMU_CONFIG;
+
+/*
+ *  MMUã®è¨­å®æ
+å ±ã®æ°ï¼ã¡ã¢ãªã¨ãªã¢ã®æ°ï¼ï¼target_kernel_impl.cï¼
+ */
+extern const uint_t arm_tnum_memory_area;
+
+/*
+ *  MMUã®è¨­å®æ
+å ±ï¼ã¡ã¢ãªã¨ãªã¢ã®æ
+å ±ï¼ï¼target_kernel_impl.cï¼
+ */
+extern ARM_MMU_CONFIG arm_memory_area[];
+
+/*
+ *  MMUã®åæå
+ */
+extern void arm_mmu_initialize(void);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* USE_ARM_MMU */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã³ã¢ä¾å­ã®åæå
+ */
+extern void core_initialize(void);
+
+/*
+ *  ã³ã¢ä¾å­ã®çµäºå¦ç
+ */
+extern void core_terminate(void);
+
+/*
+ *  CPUä¾å¤ã®çºçç¶æ³ã®ã­ã°åºå
+ */
+#ifndef OMIT_XLOG_SYS
+extern void xlog_sys(void *p_excinf);
+extern void xlog_fsr(uint32_t fsr, uint32_t far);
+#endif /* OMIT_XLOG_SYS */
+
+/*
+ *  æªå®ç¾©ã®å²è¾¼ã¿ãå
+¥ã£ãå ´åã®å¦ç
+ */
+extern void default_int_handler(void);
+
+/*
+ *  æªå®ç¾©ã®ä¾å¤ãå
+¥ã£ãå ´åã®å¦ç
+ */
+extern void default_exc_handler(void *p_excinf, EXCNO excno);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_CORE_KERNEL_IMPL_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_offset.tf
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_offset.tf	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_offset.tf	(revision 302)
@@ -0,0 +1,22 @@
+$
+$		ãªãã»ãããã¡ã¤ã«çæç¨ãã³ãã¬ã¼ãï¼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_rename.def
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_rename.def	(revision 302)
@@ -0,0 +1,46 @@
+# kernel_cfg.c
+inh_table
+intcfg_table
+exc_table
+
+# core_support.S
+dispatch
+start_dispatch
+exit_and_dispatch
+call_exit_kernel
+start_r
+irq_handler
+undef_handler
+svc_handler
+pabort_handler
+dabort_handler
+fiq_handler
+current_cpsr
+set_cpsr
+
+# core_kernel_impl.c
+excpt_nest_count
+arm_mmu_initialize
+core_initialize
+core_terminate
+xlog_sys
+xlog_fsr
+default_int_handler
+default_exc_handler
+
+# gic_kernel_impl.c
+gicc_initialize
+gicc_terminate
+gicd_initialize
+gicd_terminate
+
+# gic_support.S
+irc_begin_int
+irc_end_int
+irc_get_intpri
+irc_begin_exc
+irc_end_exc
+
+# target_kernel_impl.c
+arm_tnum_memory_area
+arm_memory_area
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_rename.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_rename.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_rename.h	(revision 302)
@@ -0,0 +1,129 @@
+/* This file is generated from core_rename.def by genrename. */
+
+#ifndef TOPPERS_CORE_RENAME_H
+#define TOPPERS_CORE_RENAME_H
+
+/*
+ *  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
+
+#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_sil.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_sil.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_sil.h	(revision 302)
@@ -0,0 +1,169 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  Copyright (C) 2004-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_sil.h 352 2015-07-25 06:36:42Z ertl-hiro $
+ */
+
+/*
+ *		sil.hã®ã³ã¢ä¾å­é¨ï¼ARMç¨ï¼
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼target_sil.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ãã
+ *  ãããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ããç´æ¥ã¤ã³
+ *  ã¯ã«ã¼ããã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_CORE_SIL_H
+#define TOPPERS_CORE_SIL_H
+
+#include <t_stddef.h>
+
+#ifndef TOPPERS_MACRO_ONLY
+#ifndef __thumb__
+
+/*
+ *  ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼CPSRï¼ã®ç¾å¨å¤ã®èª­åºã
+ */
+Inline uint32_t
+TOPPERS_current_cpsr(void)
+{
+	uint32_t	cpsr;
+
+	Asm("mrs %0, cpsr" : "=r"(cpsr));
+	return(cpsr);
+}
+
+/*
+ *  ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼CPSRï¼ã®ç¾å¨å¤ã®å¤æ´
+ */
+Inline void
+TOPPERS_set_cpsr(uint32_t cpsr)
+{
+	Asm("msr cpsr_cxsf, %0" : : "r"(cpsr) : "memory","cc");
+}
+
+#else /* __thumb__ */
+/*
+ *  Thumbã¢ã¼ãã§ã¯mrs/msrå½ä»¤ãä½¿ç¨ã§ããªãããï¼é¢æ°ã¨ãã¦å®ç¾ãã¦ï¼
+ *  ARMã¢ã¼ãã«ç§»è¡ãã¦å®è¡ããï¼
+ */
+
+/*
+ *  ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼CPSRï¼ã®ç¾å¨å¤ã®èª­åºã
+ */
+extern uint32_t current_cpsr(void);
+#define TOPPERS_current_cpsr()	current_cpsr()
+
+/*
+ *  ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼CPSRï¼ã®ç¾å¨å¤ã®å¤æ´
+ */
+extern void set_cpsr(uint32_t cpsr);
+#define TOPPERS_set_cpsr(cpsr)	current_cpsr(cpsr)
+
+#endif /* __thumb__ */
+
+/*
+ *  ãã¹ã¦ã®å²è¾¼ã¿ï¼FIQã¨IRQï¼ã®ç¦æ­¢
+ */
+Inline uint32_t
+TOPPERS_disint(void)
+{
+	uint32_t	cpsr;
+	uint32_t	fiq_irq_mask;
+
+	cpsr = TOPPERS_current_cpsr();
+	fiq_irq_mask = cpsr & (0x40U|0x80U);
+#if __TARGET_ARCH_ARM == 6 || __TARGET_ARCH_ARM == 7
+	Asm("cpsid fi" ::: "memory");
+#else /* __TARGET_ARCH_ARM == 6 || __TARGET_ARCH_ARM == 7 */
+	cpsr |= (0x40U|0x80U);
+	TOPPERS_set_cpsr(cpsr);
+#endif /* __TARGET_ARCH_ARM == 6 || __TARGET_ARCH_ARM == 7 */
+	return(fiq_irq_mask);
+}
+
+/*
+ *  FIQã¨IRQã®ç¦æ­¢ãããã®å¾©å¸°
+ */
+Inline void
+TOPPERS_set_fiq_irq(uint32_t fiq_irq_mask)
+{
+	uint32_t	cpsr;
+
+	cpsr = TOPPERS_current_cpsr();
+	cpsr &= ~(0x40U|0x80U);
+	cpsr |= fiq_irq_mask;
+	TOPPERS_set_cpsr(cpsr);
+}
+
+/*
+ *  å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®å¶å¾¡
+ */
+#define SIL_PRE_LOC		uint32_t TOPPERS_fiq_irq_mask
+#define SIL_LOC_INT()	((void)(TOPPERS_fiq_irq_mask = TOPPERS_disint()))
+#define SIL_UNL_INT()	(TOPPERS_set_fiq_irq(TOPPERS_fiq_irq_mask))
+
+/*
+ *  å¾®å°æéå¾
+ã¡
+ */
+Inline void
+sil_dly_nse(ulong_t dlytim) throw()
+{
+	register uint32_t r0 asm("r0") = (uint32_t) dlytim;
+	Asm("bl _sil_dly_nse" : "=g"(r0) : "0"(r0) : "lr","cc");
+}
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_CORE_SIL_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_stddef.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_stddef.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_stddef.h	(revision 302)
@@ -0,0 +1,73 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  Copyright (C) 2004-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_stddef.h 351 2015-07-25 06:25:03Z ertl-hiro $
+ */
+
+/*
+ *		t_stddef.hã®ã³ã¢ä¾å­é¨ï¼ARMç¨ï¼
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼target_stddef.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ã
+ *  ããããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ããç´æ¥ã¤
+ *  ã³ã¯ã«ã¼ããã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_CORE_STDDEF_H
+#define TOPPERS_CORE_STDDEF_H
+
+/*
+ *  ã¿ã¼ã²ãããè­å¥ããããã®ãã¯ã­ã®å®ç¾©
+ */
+#define TOPPERS_ARM						/* ã³ã¢ç¥ç§° */
+
+#endif /* TOPPERS_CORE_STDDEF_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_support.S
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_support.S	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_support.S	(revision 302)
@@ -0,0 +1,1187 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2000-2004 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  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: core_support.S 459 2015-08-29 13:03:42Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®ã³ã¢ä¾å­é¨ã®ã¢ã»ã³ããªè¨èªé¨ï¼ARMç¨ï¼
+ */
+
+#define TOPPERS_MACRO_ONLY
+#define TOPPERS_ASM_MACRO
+#define UINT_C(val)			(val)		/* uint_tåã®å®æ°ãä½ããã¯ã­ */
+#define ULONG_C(val)		(val)		/* ulong_tåã®å®æ°ãä½ããã¯ã­ */
+#define CAST(type, val)		(val)		/* åã­ã£ã¹ããè¡ããã¯ã­ */
+#include "kernel_impl.h"
+#include "offset.h"
+#include "core_asm.inc"
+
+/*
+ *  ä¾å¤ãã¯ã¿
+ */
+	ASECTION(vector)
+	AGLOBAL(vector_table)
+ALABEL(vector_table)
+	ldr		pc, reset_vector		/* ãªã»ãã */
+	ldr		pc, undef_vector		/* æªå®ç¾©å½ä»¤ */
+	ldr		pc, svc_vector			/* ã½ããã¦ã§ã¢å²è¾¼ã¿ */
+	ldr		pc, pabort_vector		/* ããªãã§ããã¢ãã¼ã */
+	ldr		pc, dabort_vector		/* ãã¼ã¿ã¢ãã¼ã */
+	ldr		pc, reset_vector		/* æªä½¿ç¨ */
+	ldr		pc, irq_vector			/* IRQ */
+	ldr		pc, fiq_vector			/* FIQ */
+
+/*
+ *  ä¾å¤ãã¯ã¿ã®å½ä»¤ããåç
+§ãããã¸ã£ã³ãå
+ã¢ãã¬ã¹
+ */
+	AGLOBAL(vector_ref_table)
+ALABEL(vector_ref_table)
+ALABEL(reset_vector)
+	ALONG	start
+ALABEL(undef_vector)
+	ALONG	undef_handler
+ALABEL(svc_vector)
+	ALONG	svc_handler
+ALABEL(pabort_vector)
+	ALONG	pabort_handler
+ALABEL(dabort_vector)
+	ALONG	dabort_handler
+ALABEL(irq_vector)
+	ALONG	irq_handler
+ALABEL(fiq_vector)
+	ALONG	fiq_handler
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããã£
+ */
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(dispatch)
+ALABEL(dispatch)
+	/*
+	 *  ãã®ã«ã¼ãã³ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»å²è¾¼ã¿åªå
+åº¦
+	 *  ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã»ãã£ã¹ãããè¨±å¯ç¶æ
+ã§å¼ã³åºãããï¼
+	 */
+	push	{lr}					/* æ»ãçªå°ãä¿å­ */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	bl		ovrtimer_stop
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	stmfd	sp!, {r4-r11}			/* éã¹ã¯ã©ããã¬ã¸ã¹ã¿ã®ä¿å­ */
+	ldr		r0, =p_runtsk			/* p_runtsk â r0 */
+	ldr		r0, [r0]
+	str		sp, [r0,#TCB_sp]		/* ã¹ã¿ãã¯ãã¤ã³ã¿ãä¿å­ */
+	adr		r1, dispatch_r
+	str		r1, [r0,#TCB_pc]		/* å®è¡åéçªå°ãä¿å­ */
+	b		dispatcher				/* r0ã«ã¯p_runtskãæ ¼ç´ããã¦ãã */
+
+ALABEL(dispatch_r)
+	ldmfd	sp!, {r4-r11}			/* éã¹ã¯ã©ããã¬ã¸ã¹ã¿ã®å¾©å¸° */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	bl		ovrtimer_start
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	pop		{lr}					/* æ»ãçªå°ãå¾©å¸° */
+	bx		lr
+
+/*
+ *  ãã£ã¹ãããã£ã®åä½éå§
+ */
+	AGLOBAL(start_dispatch)
+ALABEL(start_dispatch)
+	/*
+	 *  ãã®ã«ã¼ãã³ã¯ï¼ã«ã¼ãã«èµ·åæã«ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãã§ï¼NMIã
+	 *  é¤ããã¹ã¦ã®å²è¾¼ã¿ãç¦æ­¢ããç¶æ
+ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨åç­ï¼ã§
+	 *  å¼ã³åºãããï¼
+	 *
+	 *  dispatcher_0ã¸åå²ããåã«ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»
+	 *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã«ãï¼ä½¿ç¨ããã¹ã¿ãã¯ãï¼IDã1ã®ã¿
+	 *  ã¹ã¯ã®ã¹ã¿ãã¯é åã«åãæããªããã°ãªããªãï¼
+	 */
+
+	/*
+	 *	ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæããï¼
+	 */
+	ldr		r2, =excpt_nest_count	/* ä¾å¤ãã¹ãã«ã¦ã³ãã0ã« */
+	mov		r0, #0
+	str		r0, [r2]
+
+	/*
+	 *  IDã1ã®ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åã«åãæããï¼
+	 */
+	ldr		r0, =tcb_table			/* tcb_table[0] â r0 */
+	ldr		r2, [r0,#TCB_p_tinib]	/* tcb_table[0].p_tinib â r2 */
+	ldr		r0, [r2,#TINIB_stk]
+	ldr		r1, [r2,#TINIB_stksz]
+	add		sp, r0, r1
+
+	/*
+	 *  CPUã­ãã¯ç¶æ
+ã«ãã¦ï¼ãã£ã¹ãããã£æ¬ä½ã¸åå²ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_CPULOCK)
+	b		dispatcher_0
+
+/*
+ *  ç¾å¨ã®ã³ã³ãã­ã¹ããæ¨ã¦ã¦ãã£ã¹ããã
+ */
+	AGLOBAL(exit_and_dispatch)
+ALABEL(exit_and_dispatch)
+	/*
+	 *  ãã®ã«ã¼ãã³ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»å²è¾¼ã¿åªå
+åº¦
+	 *  ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã»ãã£ã¹ãããè¨±å¯ç¶æ
+ã§å¼ã³åºãããï¼
+	 */
+#ifdef LOG_DSP_ENTER
+	ldr		r0, =p_runtsk			/* p_runtsk â r0 */
+	ldr		r0, [r0]
+#endif /* LOG_DSP_ENTER */
+	/* ãã£ã¹ãããã£æ¬ä½ï¼dispatcherï¼ã¸ */
+
+/*
+ *  ãã£ã¹ãããã£æ¬ä½
+ */
+ALABEL(dispatcher)
+#ifdef LOG_DSP_ENTER
+	/*
+	 * ããã®æç¹ã®ã¬ã¸ã¹ã¿ç¶æ
+ã
+	 *  r0ï¼p_runtskï¼ã¿ã¹ã¯åæãåï¼
+	 */
+	bl		log_dsp_enter
+#endif /* LOG_DSP_ENTER */
+	
+ALABEL(dispatcher_0)
+	/*
+	 *  ãã®ã«ã¼ãã³ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»å²è¾¼ã¿åªå
+åº¦
+	 *  ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã»ãã£ã¹ãããè¨±å¯ç¶æ
+ã§å¼ã³åºãããï¼å®è¡åéçª
+	 *  å°ã¸ããã®ç¶æ
+ã®ã¾ã¾åå²ããï¼
+	 */
+	ldr		r0, =p_schedtsk		/* p_schedtsk â r4 â p_runtsk */
+	ldr		r4, [r0]
+	ldr		r1, =p_runtsk
+	str		r4, [r1]
+	tst		r4, r4				/* p_runtskãNULLãªãdispatcher_1ã¸ */
+	beq		dispatcher_1
+	ldr		sp, [r4,#TCB_sp]	/* ã¿ã¹ã¯ã¹ã¿ãã¯ãå¾©å¸° */
+#ifdef LOG_DSP_LEAVE
+	mov		r0, r4				/* p_runtskããã©ã¡ã¼ã¿ã«æ¸¡ã */
+	bl		log_dsp_leave
+#endif /* LOG_DSP_LEAVE */
+	ldr		r0, [r4,#TCB_pc]	/* å®è¡åéçªå°ãå¾©å¸° */
+	bx		r0					/* p_runtskãr4ã«å
+¥ããç¶æ
+ã§åå²ãã */
+
+	/*
+	 *  ã¢ã¤ãã«å¦ç
+	 *
+	 *  å²è¾¼ã¿ããã¹ã¦è¨±å¯ãï¼CPUã­ãã¯è§£é¤ç¶æ
+ã«ãã¦å²è¾¼ã¿ãå¾
+ã¤ï¼
+	 *
+	 *  ã¿ã¼ã²ããã«ãã£ã¦ã¯ï¼çé»åã¢ã¼ãç­ã«ç§»è¡ããããï¼æ¨æºã®æ¹æ³
+	 *  ã¨ç°ãªãæé ãå¿
+è¦ãªå ´åãããï¼ãã®ãããªã¿ã¼ã²ããã§ã¯ï¼ã¿ã¼
+	 *  ã²ããä¾å­é¨ã§TOPPERS_CUSTOM_IDLEãå®ç¾©ãï¼ã¢ã»ã³ãã©ãã¯ã­ã¨ã
+	 *  ã¦ï¼toppers_asm_custom_idleãç¨æããã°ããï¼
+	 */
+ALABEL(dispatcher_1)
+#ifdef TOPPERS_CUSTOM_IDLE
+	toppers_asm_custom_idle
+#else /* TOPPERS_CUSTOM_IDLE */
+	msr		cpsr_c, #CPSR_SVC_MODE	/* å²è¾¼ã¿ãè¨±å¯ï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãï¼*/
+ALABEL(dispatcher_2)
+	b		dispatcher_2			/* å²è¾¼ã¿å¾
+ã¡ */
+#endif /* TOPPERS_CUSTOM_IDLE */
+
+/*
+ *  ã«ã¼ãã«ã®çµäºå¦çã®å¼åºã
+ *
+ *  å²è¾¼ã¿ã­ãã¯ç¶æ
+ã«ãï¼ä½¿ç¨ããã¹ã¿ãã¯ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ã
+ *  ã¯é åã«åãæ¿ãï¼exit_kernelãå¼ã³åºãï¼
+ */
+	AGLOBAL(call_exit_kernel)
+ALABEL(call_exit_kernel)
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_INTLOCK)
+	ldr		r0, =istkpt				/* éã¿ã¹ã¯ã³ã³ãã­ã¹ãã®ã¹ã¿ãã¯ã¸ */
+	ldr		sp, [r0]
+	b		exit_kernel
+
+/*
+ *  ã¿ã¹ã¯ã®å®è¡éå§æå¦ç
+ */
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(start_r)
+	/*
+	 *  ãã£ã¹ãããã£æ¬ä½ããå¼ã³åºãããããï¼p_runtskã¯r4ã«å
+¥ã£ã¦ããï¼
+	 */
+ALABEL(start_r)
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	bl		ovrtimer_start
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_UNLOCK)
+									/* CPUã­ãã¯è§£é¤ç¶æ
+ã« */
+	ldr		lr, =ext_tsk			/* ã¿ã¹ã¯æ¬ä½ããã®æ»ãçªå°ãè¨­å® */
+	ldr		r2, [r4,#TCB_p_tinib]	/* p_runtsk->p_tinib â r2 */
+	ldr		r0, [r2,#TINIB_exinf]	/* exinfããã©ã¡ã¼ã¿ã« */
+	ldr		r1, [r2,#TINIB_task]	/* ã¿ã¹ã¯èµ·åçªå°ã«ã¸ã£ã³ã */
+	bx		r1
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦ç
+ */
+#ifndef OMIT_IRQ_HANDLER
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(irq_handler)
+ALABEL(irq_handler)
+	/*
+	 *  ããã«ã¯ï¼IRQã¢ã¼ãã§åå²ãã¦ããï¼
+	 */
+#if __TARGET_ARCH_ARM < 6
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_IRQ_BIT)
+	stmfd	sp!, {r0-r4,r12,lr,pc}		/* pcã¯ã¹ãã¼ã¹ç¢ºä¿ã®ãã */
+
+	/*
+	 *  IRQã¢ã¼ãã«æ»ãã¦ï¼æ»ãçªå°ã¨spsrï¼æ»ãå
+ã®cpsrï¼ãåå¾ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_IRQ_MODE AOR CPSR_IRQ_BIT)
+	sub		r2, lr, #4
+	mrs		r1, spsr
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼æ»ãçªå°ã¨spsrãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_IRQ_BIT)
+	str		r2, [sp,#0x1c]			/* æ»ãçªå°ãã¹ã¿ãã¯ã«ä¿å­ */
+	push	{r1}					/* spsrãã¹ã¿ãã¯ã«ä¿å­ */
+#else /* __TARGET_ARCH_ARM < 6 */
+	/*
+	 *  æ»ãå
+ï¼lrï¼ã¨spsrï¼cpsr_svcï¼ãã¹ã¼ããã¤ã¶ã¢ã¼ãã®ã¹ã¿ãã¯ã«
+	 *  ä¿å­ããï¼
+	 */
+	sub		lr, lr, #4				/* æ»ãçªå°ã®ç®åº */
+	srsfd	#CPSR_SVC_MODE!
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	cps		#CPSR_SVC_MODE
+	stmfd	sp!, {r0-r4,r12,lr}
+#endif /* __TARGET_ARCH_ARM < 6 */
+
+	/*
+	 *  ä¾å¤ãã¹ãã«ã¦ã³ããã¤ã³ã¯ãªã¡ã³ãããï¼å²è¾¼ã¿ãéã¿ã¹ã¯ã³ã³ãã­
+	 *  ã¹ãã§çºçããå ´åã«ã¯ï¼irq_handler_1ã¸åå²ããï¼
+	 */
+	ldr		r2, =excpt_nest_count
+	ldr		r3, [r2]
+	add		r3, r3, #1
+	str		r3, [r2]
+	teq		r3, #1					/* å²è¾¼ã¿ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç */
+	bne		irq_handler_1			/*			  ãªãirq_handler_1ã«åå² */
+
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	/*
+	 *  ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ããï¼
+	 */
+	bl		ovrtimer_stop
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+	/*
+	 *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæããï¼
+	 */
+	mov		r1, sp					/* ãã®æç¹ã®ã¹ã¿ãã¯ãã¤ã³ã¿ãr1ã« */
+	ldr		r2, =istkpt				/* éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã« */
+	ldr		sp, [r2]
+	push	{r1}					/* åæãåã®ã¹ã¿ãã¯ãã¤ã³ã¿ãä¿å­ */
+
+ALABEL(irq_handler_1)
+	/*
+	 *  å²è¾¼ã¿ã³ã³ãã­ã¼ã©ãæä½ãï¼å²è¾¼ã¿çªå·ãåå¾ããï¼
+	 */
+	bl		irc_begin_int
+	cmp		r4, #TNUM_INHNO			/* ã¹ããªã¢ã¹å²è¾¼ã¿ãªã */
+	bhs		irq_handler_2			/*  irq_handler_2ã«åå² */
+
+	/*
+	 *  CPUã­ãã¯è§£é¤ç¶æ
+ã«ããï¼
+	 */
+#if __TARGET_ARCH_ARM < 6
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_UNLOCK)
+#else /* __TARGET_ARCH_ARM < 6 */
+#ifndef TOPPERS_SAFEG_SECURE
+	cpsie	if
+#else /* TOPPERS_SAFEG_SECURE */
+	cpsie	f
+#endif /* TOPPERS_SAFEG_SECURE */
+#endif /* __TARGET_ARCH_ARM < 6 */
+
+#ifdef LOG_INH_ENTER
+	/*
+	 *  ã­ã°åºåã®å¼åºã
+	 */
+	mov		r0, r4					/* å²è¾¼ã¿çªå·ããã©ã¡ã¼ã¿ã«æ¸¡ã */
+	bl		log_inh_enter
+#endif /* LOG_INH_ENTER */
+
+	/*
+	 *  å²è¾¼ã¿ãã³ãã©ã®å¼åºã
+	 */
+	ldr		r2, =inh_table			/* å²è¾¼ã¿ãã³ãã©ãã¼ãã«ã®èª­è¾¼ã¿ */
+	ldr		r1, [r2,r4,lsl #2]		/* å²è¾¼ã¿ãã³ãã©ã®çªå° â r1 */
+	mov		lr, pc					/* å²è¾¼ã¿ãã³ãã©ã®å¼åºã */
+	bx		r1
+
+#ifdef LOG_INH_LEAVE
+	/*
+	 *  ã­ã°åºåã®å¼åºã
+	 */
+	mov		r0, r4					/* å²è¾¼ã¿çªå·ããã©ã¡ã¼ã¿ã«æ¸¡ã */
+	bl		log_inh_leave
+#endif /* LOG_INH_LEAVE */
+
+	/*
+	 *  ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããï¼
+	 */
+#if __TARGET_ARCH_ARM < 6
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_CPULOCK)
+#else /* __TARGET_ARCH_ARM < 6 */
+#ifndef TOPPERS_SAFEG_SECURE
+	cpsid	i
+#else /* TOPPERS_SAFEG_SECURE */
+	cpsid	if
+#endif /* TOPPERS_SAFEG_SECURE */
+#endif /* __TARGET_ARCH_ARM < 6 */
+
+	/*
+	 *  å²è¾¼ã¿ã³ã³ãã­ã¼ã©ãæä½ããï¼
+	 */
+ALABEL(irq_handler_2)
+	bl		irc_end_int
+#endif /* OMIT_IRQ_HANDLER */
+
+	/*
+	 *  ä¾å¤ãã¹ãã«ã¦ã³ãããã¯ãªã¡ã³ãããï¼
+	 */
+	ldr		r2, =excpt_nest_count
+	ldr		r3, [r2]
+	subs	r3, r3, #1
+	str		r3, [r2]				/* æ»ãå
+ãéã¿ã¹ã¯ã³ã³ãã­ã¹ããªã */
+	bne		irq_handler_3			/*				irq_handler_3ã«åå² */
+
+	/*
+	 *  ã¿ã¹ã¯ç¨ã®ã¹ã¿ãã¯ã«æ»ãï¼
+	 */
+	pop		{r1}
+	mov   	sp, r1
+
+	/*
+	 *  ãã£ã¹ããããå¿
+è¦ãå¤å®ããï¼
+	 */
+ALABEL(ret_int_1)
+	ldr		r0, =p_runtsk			/* p_runtsk â r0 */
+	ldr		r0, [r0]
+	ldr		r1, =p_schedtsk			/* p_schedtsk â r1 */
+	ldr		r1, [r1]
+	teq		r0, r1					/* p_runtskã¨p_schedtskãåããªã */
+	beq		irq_handler_4			/*				  irq_handler_4ã¸ */
+
+	/*
+	 *  ã³ã³ãã­ã¹ããä¿å­ããï¼
+	 */
+	tst		r0, r0					/* p_runtskãNULLãªãdispatcher_0ã¸ */
+	beq		dispatcher_0
+	stmfd	sp!, {r5-r11}			/* éã¹ã¯ã©ããã¬ã¸ã¹ã¿ã®ä¿å­ */
+	str		sp, [r0,#TCB_sp]		/* ã¹ã¿ãã¯ãã¤ã³ã¿ãä¿å­ */
+	adr		r1, ret_int_r			/* å®è¡åéçªå°ãä¿å­ */
+	str		r1, [r0,#TCB_pc]
+	b		dispatcher				/* r0ã«ã¯p_runtskãæ ¼ç´ããã¦ãã */
+
+ALABEL(ret_int_r)
+	/*
+	 *  ã³ã³ãã­ã¹ããå¾©å¸°ããï¼
+	 */
+	ldmfd	sp!, {r5-r11}			/* éã¹ã¯ã©ããã¬ã¸ã¹ã¿ã®å¾©å¸° */
+
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	/*
+	 *  ãªã¼ãã©ã³ã¿ã¤ããåä½éå§ããï¼
+	 */
+	bl		ovrtimer_start
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+	/*
+	 *  å²è¾¼ã¿ï¼CPUä¾å¤å¦çããã®ãªã¿ã¼ã³
+	 *
+	 *  å²è¾¼ã¿ï¼CPUä¾å¤å¦çããã®ãªã¿ã¼ã³ã«ããï¼CPUã­ãã¯è§£é¤ç¶æ
+ã«é·
+	 *  ç§»ããããã«ããå¿
+è¦ããããï¼ARMã¯CPSRã®ãããã«ãã£ã¦CPUã­ã
+	 *  ã¯ç¶æ
+ãè¡¨ãã¦ããããï¼CPSRãå
+ã«æ»ãã¦ãªã¿ã¼ã³ããã°ããï¼
+	 */
+#ifndef TOPPERS_SUPPORT_OVRHDR
+ALABEL(irq_handler_4)
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+ALABEL(irq_handler_3)
+#if __TARGET_ARCH_ARM < 6
+	ldmfd	sp!, {r0}				/* æ»ãå
+ã®cpsrãspsrã«è¨­å® */
+	msr		spsr_cxsf, r0
+	ldmfd	sp!, {r0-r4,r12,lr,pc}^	/* ã³ã³ãã­ã¹ãã®å¾©å¸° */
+									/* ^ä»ããªã®ã§ï¼spsr â cpsr */
+#else /* __TARGET_ARCH_ARM < 6 */
+	ldmfd	sp!, {r0-r4,r12,lr}
+	rfefd	sp!
+#endif /* __TARGET_ARCH_ARM < 6 */
+
+#ifdef TOPPERS_SUPPORT_OVRHDR
+ALABEL(irq_handler_4)
+	/*
+	 *  ãªã¼ãã©ã³ã¿ã¤ããåä½éå§ããï¼
+	 */
+	tst		r0, r0					/* p_runtskãNULLã§ãªãå ´å */
+	blne	ovrtimer_start
+	b		irq_handler_3
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+/*
+ *  CPUä¾å¤ãã³ãã©åºå
+¥å£å¦ç
+ */
+ALABEL(start_exc_entry)
+
+/*
+ *  æªå®ç¾©å½ä»¤
+ */
+#ifndef OMIT_UNDEF_HANDLER
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(undef_handler)
+ALABEL(undef_handler)
+	/*
+	 *  ããã«ã¯ï¼æªå®ç¾©ã¢ã¼ãã§åå²ãã¦ããï¼
+	 */
+#if __TARGET_ARCH_ARM < 6
+	/*
+	 *  Iãããã¨Fããããã»ãããï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¯
+	 *  ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT)
+	stmfd	sp!, {r0-r4,r12,lr,pc}		/* pcã¯ã¹ãã¼ã¹ç¢ºä¿ã®ãã */
+
+	/*
+	 *  æªå®ç¾©ã¢ã¼ãã«æ»ãã¦ï¼æ»ãçªå°ã¨spsrãåå¾ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_UND_MODE AOR CPSR_FIQ_IRQ_BIT)
+	mov		r2, lr
+	mrs		r1, spsr
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼æ»ãçªå°ã¨spsrãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT)
+	str		r2, [sp,#0x1c]			/* æ»ãçªå°ãã¹ã¿ãã¯ã«ä¿å­ */
+	push	{r1}					/* spsrãã¹ã¿ãã¯ã«ä¿å­ */
+#else /* __TARGET_ARCH_ARM < 6 */
+	/*
+	 *  æ»ãå
+ï¼lrï¼ã¨spsrï¼cpsr_svcï¼ãã¹ã¼ããã¤ã¶ã¢ã¼ãã®ã¹ã¿ãã¯ã«
+	 *  ä¿å­ããï¼
+	 */
+	srsfd	#CPSR_SVC_MODE!
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	cps		#CPSR_SVC_MODE
+	stmfd	sp!, {r0-r4,r12,lr}
+#endif /* __TARGET_ARCH_ARM < 6 */
+	mov		r4, #EXCNO_UNDEF
+	b		exc_handler_1
+#endif /* OMIT_UNDEF_HANDLER */
+
+/*
+ *  ã¹ã¼ããã¤ã¶ã³ã¼ã«
+ */
+#ifndef OMIT_SVC_HANDLER
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(svc_handler)
+ALABEL(svc_handler)
+	/*
+	 *  ããã«ã¯ï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã§åå²ãã¦ããï¼
+	 */
+#if __TARGET_ARCH_ARM < 6
+	/*
+	 *  Iãããã¨Fããããã»ãããï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT)
+	stmfd	sp!, {r0-r4,r12,lr,pc}		/* pcã¯ã¹ãã¼ã¹ç¢ºä¿ã®ãã */
+
+	/*
+	 *  æ»ãçªå°ã¨spsrãåå¾ããï¼
+	 */
+	mov		r2, lr
+	mrs		r1, spsr
+
+	/*
+	 *  æ»ãçªå°ã¨spsrãä¿å­ããï¼
+	 */
+	str		r2, [sp,#0x1c]			/* æ»ãçªå°ãã¹ã¿ãã¯ã«ä¿å­ */
+	push	{r1}					/* spsrãã¹ã¿ãã¯ã«ä¿å­ */
+#else /* __TARGET_ARCH_ARM < 6 */
+	/*
+	 *  æ»ãå
+ï¼lrï¼ã¨spsrï¼cpsr_svcï¼ãã¹ã¼ããã¤ã¶ã¢ã¼ãã®ã¹ã¿ãã¯ã«
+	 *  ä¿å­ããï¼
+	 */
+	srsfd	#CPSR_SVC_MODE!
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã§ï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	cps		#CPSR_SVC_MODE			/* ä¸è¦ã¨æããã */
+	stmfd	sp!, {r0-r4,r12,lr}
+#endif /* __TARGET_ARCH_ARM < 6 */
+	mov		r4, #EXCNO_SVC
+	b		exc_handler_1
+#endif /* OMIT_SVC_HANDLER */
+
+/*
+ *  ããªãã§ããã¢ãã¼ã
+ */
+#ifndef OMIT_PABORT_HANDLER
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(pabort_handler)
+ALABEL(pabort_handler)
+	/*
+	 *  ããã«ã¯ï¼ã¢ãã¼ãã¢ã¼ãã§åå²ãã¦ããï¼
+	 */
+#if __TARGET_ARCH_ARM < 6
+	/*
+	 *  Iãããã¨Fããããã»ãããï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¯
+	 *  ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT)
+	stmfd	sp!, {r0-r4,r12,lr,pc}		/* pcã¯ã¹ãã¼ã¹ç¢ºä¿ã®ãã */
+
+	/*
+	 *  ã¢ãã¼ãã¢ã¼ãã«æ»ãã¦ï¼æ»ãçªå°ã¨spsrãåå¾ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_ABT_MODE AOR CPSR_FIQ_IRQ_BIT)
+	mov		r2, lr
+	mrs		r1, spsr
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼æ»ãçªå°ã¨spsrãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT)
+	str		r2, [sp,#0x1c]			/* æ»ãçªå°ãã¹ã¿ãã¯ã«ä¿å­ */
+	push	{r1}					/* spsrãã¹ã¿ãã¯ã«ä¿å­ */
+#else /* __TARGET_ARCH_ARM < 6 */
+	/*
+	 *  æ»ãå
+ï¼lrï¼ã¨spsrï¼cpsr_svcï¼ãã¹ã¼ããã¤ã¶ã¢ã¼ãã®ã¹ã¿ãã¯ã«
+	 *  ä¿å­ããï¼
+	 */
+	srsfd	#CPSR_SVC_MODE!
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	cps		#CPSR_SVC_MODE
+	stmfd	sp!, {r0-r4,r12,lr}
+#endif /* __TARGET_ARCH_ARM < 6 */
+	mov		r4, #EXCNO_PABORT
+	b		exc_handler_1
+#endif /* OMIT_PABORT_HANDLER */
+
+/*
+ *  ãã¼ã¿ã¢ãã¼ã
+ */
+#ifndef OMIT_DABORT_HANDLER
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(dabort_handler)
+ALABEL(dabort_handler)
+	/*
+	 *  ããã«ã¯ï¼ã¢ãã¼ãã¢ã¼ãã§åå²ãã¦ããï¼
+	 *
+	 *  ãã¼ã¿ã¢ãã¼ããï¼CPUä¾å¤ã®å
+¥å£ï¼start_exc_entryã¨end_exc_entry
+	 *  ã®éï¼ã§çºçããå ´åã«ã¯ï¼fatal_dabort_handlerã«åå²ããï¼ã¢ãã¼
+	 *  ãã¢ã¼ãã®spãæ±ç¨ã¬ã¸ã¹ã¿ã®ä»£ããã«ä½¿ç¨ããï¼
+	 */
+	ldr		sp, =start_exc_entry+8
+	cmp		lr, sp
+	bcc		dabort_handler_1
+	ldr		sp, =end_exc_entry+8
+	cmp		lr, sp
+	bcc		fatal_dabort_handler
+
+ALABEL(dabort_handler_1)
+#if __TARGET_ARCH_ARM < 6
+	/*
+	 *  Iãããã¨Fããããã»ãããï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¯
+	 *  ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT)
+	stmfd	sp!, {r0-r4,r12,lr,pc}		/* pcã¯ã¹ãã¼ã¹ç¢ºä¿ã®ãã */
+
+	/*
+	 *  ã¢ãã¼ãã¢ã¼ãã«æ»ãã¦ï¼æ»ãçªå°ã¨spsrãåå¾ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_ABT_MODE AOR CPSR_FIQ_IRQ_BIT)
+	mov		r2, lr
+	mrs		r1, spsr
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼æ»ãçªå°ã¨spsrãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT)
+	str		r2, [sp,#0x1c]			/* æ»ãçªå°ãã¹ã¿ãã¯ã«ä¿å­ */
+	push	{r1}					/* spsrãã¹ã¿ãã¯ã«ä¿å­ */
+#else /* __TARGET_ARCH_ARM < 6 */
+	/*
+	 *  æ»ãå
+ï¼lrï¼ã¨spsrï¼cpsr_svcï¼ãã¹ã¼ããã¤ã¶ã¢ã¼ãã®ã¹ã¿ãã¯ã«
+	 *  ä¿å­ããï¼
+	 */
+	srsfd	#CPSR_SVC_MODE!
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	cps		#CPSR_SVC_MODE
+	stmfd	sp!, {r0-r4,r12,lr}
+#endif /* __TARGET_ARCH_ARM < 6 */
+	mov		r4, #EXCNO_DABORT
+	b		exc_handler_1
+#endif /* OMIT_DABORT_HANDLER */
+
+/*
+ *  CPUä¾å¤ã®å
+¥å£ã§çºçãããã¼ã¿ã¢ãã¼ã
+ */
+ALABEL(fatal_dabort_handler)
+#if __TARGET_ARCH_ARM < 6
+	/*
+	 *  Iãããã¨Fããããã»ãããï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¿ã
+	 *  ã¯ãã¤ã³ã¿ãåæåãï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT)
+	ldr		sp, =istkpt
+	ldr		sp, [sp]
+	stmfd	sp!, {r0-r4,r12,lr,pc}		/* pcã¯ã¹ãã¼ã¹ç¢ºä¿ã®ãã */
+
+	/*
+	 *  ã¢ãã¼ãã¢ã¼ãã«æ»ãã¦ï¼æ»ãçªå°ã¨spsrãåå¾ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_ABT_MODE AOR CPSR_FIQ_IRQ_BIT)
+	mov		r2, lr
+	mrs		r1, spsr
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼æ»ãçªå°ã¨spsrãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT)
+	str		r2, [sp,#0x1c]			/* æ»ãçªå°ãã¹ã¿ãã¯ã«ä¿å­ */
+	push	{r1}					/* spsrãã¹ã¿ãã¯ã«ä¿å­ */
+#else /* __TARGET_ARCH_ARM < 6 */
+	/*
+	 *  Iãããã¨Fããããã»ãããï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¿ã
+	 *  ã¯ãã¤ã³ã¿ãåæåããï¼
+	 */
+	cpsid	if,#CPSR_SVC_MODE
+	ldr		sp, =istkpt
+	ldr		sp, [sp]
+
+	/*
+	 *  ã¢ãã¼ãã¢ã¼ãã«æ»ãã¦ï¼æ»ãå
+ï¼lrï¼ã¨spsrï¼cpsr_svcï¼ãã¹ã¼ã
+	 *  ãã¤ã¶ã¢ã¼ãã®ã¹ã¿ãã¯ã«ä¿å­ããï¼
+	 */
+	cps		#CPSR_ABT_MODE
+	srsfd	#CPSR_SVC_MODE!
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	cps		#CPSR_SVC_MODE
+	stmfd	sp!, {r0-r4,r12,lr}
+#endif /* __TARGET_ARCH_ARM < 6 */
+
+	/*
+	 *  ä¾å¤ãã¹ãã«ã¦ã³ãã®æä¸ä½ãããã1ã«ããï¼
+	 */
+	ldr		r2, =excpt_nest_count
+	ldr		r3, [r2]
+	orr		r3, r3, #0x80000000
+	str		r3, [r2]
+
+	mov		r4, #EXCNO_DABORT
+	b		exc_handler_1
+
+/*
+ *  FIQ
+ */
+#ifndef OMIT_FIQ_HANDLER
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(fiq_handler)
+ALABEL(fiq_handler)
+	/*
+	 *  ããã«ã¯ï¼FIQã¢ã¼ãã§åå²ãã¦ããï¼
+	 */
+#if __TARGET_ARCH_ARM < 6
+	/*
+	 *  Iãããã¨Fããããã»ãããï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¯
+	 *  ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT)
+	stmfd	sp!, {r0-r4,r12,lr,pc}		/* pcã¯ã¹ãã¼ã¹ç¢ºä¿ã®ãã */
+
+	/*
+	 *  FIQã¢ã¼ãã«æ»ãã¦ï¼æ»ãçªå°ã¨spsrãåå¾ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_FIQ_MODE AOR CPSR_FIQ_IRQ_BIT)
+	mov		r2, lr
+	mrs		r1, spsr
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼æ»ãçªå°ã¨spsrãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_FIQ_IRQ_BIT)
+	str		r2, [sp,#0x1c]			/* æ»ãçªå°ãã¹ã¿ãã¯ã«ä¿å­ */
+	push	{r1}					/* spsrãã¹ã¿ãã¯ã«ä¿å­ */
+#else /* __TARGET_ARCH_ARM < 6 */
+	/*
+	 *  æ»ãå
+ï¼lrï¼ã¨spsrï¼cpsr_svcï¼ãã¹ã¼ããã¤ã¶ã¢ã¼ãã®ã¹ã¿ãã¯ã«
+	 *  ä¿å­ããï¼
+	 */
+	srsfd	#CPSR_SVC_MODE!
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	cps		#CPSR_SVC_MODE
+	stmfd	sp!, {r0-r4,r12,lr}
+#endif /* __TARGET_ARCH_ARM < 6 */
+	mov		r4, #EXCNO_FIQ
+	b		exc_handler_1
+#endif /* OMIT_FIQ_HANDLER */
+	
+ALABEL(end_exc_entry)
+
+/*
+ *  CPUä¾å¤ãã³ãã©åºå
+¥å£å¦çã®å
+±éé¨å
+ *
+ * ããã®æç¹ã®ã¬ã¸ã¹ã¿ç¶æ
+ã
+ *  r0ï¼CPUä¾å¤ãã³ãã©çªå·
+ */
+ALABEL(exc_handler_1)
+	/*
+	 *  CPUä¾å¤ãçºçããç¶æ³ã®å¤æ­ã«ç¨ããããã«ï¼CPUä¾å¤çºçåã®å²
+	 *  è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¨ä¾å¤ãã¹ãã«ã¦ã³ããã¹ã¿ãã¯ã«ä¿å­ããï¼
+	 */
+	bl		irc_get_intpri
+	push	{r0}					/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãä¿å­ */
+	ldr		r2, =excpt_nest_count
+	ldr		r3, [r2]
+	push	{r3}					/* ä¾å¤ãã¹ãã«ã¦ã³ããä¿å­ */
+	mov		r12, sp					/* CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã® */
+									/*				å
+é ­çªå°ãr12ã«ä¿å­ */
+	/*
+	 *  ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ãå¤å®ãã
+	 *
+	 *  ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã¯ï¼ã«ã¼ãã«å®è¡ä¸­ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ï¼
+	 *  CPUã­ãã¯ç¶æ
+ï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©å®è¡ä¸­ã«çºçãã
+	 *  CPUä¾å¤ã§ããï¼ARMã³ã¢ã®å ´åã¯ï¼æ»ãå
+ã®CPSRã®IããããFããã
+	 *  ã®ãããããã»ããããã¦ãããªãï¼ããè©²å½ããï¼
+	 */
+	ldr		r1, [r12,#T_EXCINF_cpsr]	/* ä¾å¤ãã¬ã¼ã ããcpsrãåå¾ */
+	ands	r1, r1, #CPSR_FIQ_IRQ_BIT
+	bne		nk_exc_handler_1		/* ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã®å¦çã¸ */
+
+	/*
+	 * ããã®æç¹ã®ã¬ã¸ã¹ã¿ç¶æ
+ã
+	 *  r2ï¼excpt_nest_countã®çªå°
+	 *  r3ï¼excpt_nest_countã®å¤
+	 *  r4ï¼CPUä¾å¤ãã³ãã©çªå·
+	 *  r12ï¼CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã®å
+é ­çªå°
+	 */
+
+	/*
+	 *  ä¾å¤ãã¹ãã«ã¦ã³ããã¤ã³ã¯ãªã¡ã³ãããï¼
+	 */
+	add		r3, r3, #1
+	str		r3, [r2]
+	teq		r3, #1					/* CPUä¾å¤çºçåãéã¿ã¹ã¯ã³ã³ãã­ã¹ã */
+	bne		exc_handler_2			/*			   ãªãexc_handler_2ã«åå² */
+
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	/*
+	 *  ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ããï¼
+	 */
+	push	{r12}
+	bl		ovrtimer_stop
+	pop		{r12}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+	/*
+	 *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæããï¼
+	 */
+	mov		r3, sp					/* ãã®æç¹ã®ã¹ã¿ãã¯ãã¤ã³ã¿ãr3ã« */
+	ldr		r2, =istkpt				/* éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã« */
+	ldr		sp, [r2]
+	push	{r3}					/* åæãåã®ã¹ã¿ãã¯ãã¤ã³ã¿ãä¿å­ */
+
+ALABEL(exc_handler_2)
+	/*
+	 * ããã®æç¹ã®ã¬ã¸ã¹ã¿ç¶æ
+ã
+	 *  r4ï¼CPUä¾å¤ãã³ãã©çªå·
+	 *  r12ï¼CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã®å
+é ­çªå°
+	 */
+
+	/*
+	 *  ï¼å¿
+è¦ãªãï¼å²è¾¼ã¿ã³ã³ãã­ã¼ã©ãæä½ããï¼
+	 */
+	bl		irc_begin_exc
+
+	/*
+	 *  CPUã­ãã¯è§£é¤ç¶æ
+ã«ããï¼
+	 *
+	 *  ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ãã³ãã©ã¯å¥ã«ã¼ãã³ã§å¼ã³åºãããï¼åç´
+	 *  ã«å²è¾¼ã¿ãè¨±å¯ããã ãã§ããï¼
+	 */
+#if __TARGET_ARCH_ARM < 6
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_UNLOCK)
+#else /* __TARGET_ARCH_ARM < 6 */
+#ifndef TOPPERS_SAFEG_SECURE
+	cpsie	if
+#else /* TOPPERS_SAFEG_SECURE */
+	cpsie	f
+#endif /* TOPPERS_SAFEG_SECURE */
+#endif /* __TARGET_ARCH_ARM < 6 */
+
+	/*
+	 *  ã­ã°åºåã®å¼åºã
+	 */
+#ifdef LOG_EXC_ENTER
+	push	{r12}
+	mov		r0, r4					/* CPUä¾å¤çªå·ããã©ã¡ã¼ã¿ã«æ¸¡ã */
+	bl		log_exc_enter
+	pop		{r12}
+#endif /* LOG_EXC_ENTER */
+
+	/*
+	 *  CPUä¾å¤ãã³ãã©ã®å¼åºã
+	 */
+	ldr		r2, =exc_table			/* CPUä¾å¤ãã³ãã©ãã¼ãã«ã®èª­è¾¼ã¿ */
+	ldr		r3, [r2,r4,lsl #2]		/* CPUä¾å¤ãã³ãã©ã®çªå° â r3 */
+	mov		r0, r12					/* CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã® */
+									/*		å
+é ­çªå°ãç¬¬1ãã©ã¡ã¼ã¿ã«æ¸¡ã */
+	mov		r1, r4					/* CPUä¾å¤çªå·ãç¬¬2ãã©ã¡ã¼ã¿ã«æ¸¡ã */
+	mov		lr, pc					/* CPUä¾å¤ãã³ãã©ã®å¼åºã */
+	bx		r3
+
+	/*
+	 *  ã­ã°åºåã®å¼åºã
+	 */
+#ifdef LOG_EXC_LEAVE
+	mov		r0, r4					/* CPUä¾å¤çªå·ããã©ã¡ã¼ã¿ã«æ¸¡ã */
+	bl		log_exc_leave
+#endif /* LOG_EXC_LEAVE */
+
+	/*
+	 *  ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããï¼
+	 */
+#if __TARGET_ARCH_ARM < 6
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_CPULOCK)
+#else /* __TARGET_ARCH_ARM < 6 */
+#ifndef TOPPERS_SAFEG_SECURE
+	cpsid	i
+#else /* TOPPERS_SAFEG_SECURE */
+	cpsid	if
+#endif /* TOPPERS_SAFEG_SECURE */
+#endif /* __TARGET_ARCH_ARM < 6 */
+
+	/*
+	 *  å²è¾¼ã¿ã³ã³ãã­ã¼ã©ãæä½ãã¦ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãï¼CPUä¾å¤çº
+	 *  çæã®å¤ã«è¨­å®ããï¼
+	 */
+	bl		irc_end_exc
+
+	/*
+	 *  ä¾å¤ãã¹ãã«ã¦ã³ãããã¯ãªã¡ã³ãããï¼
+	 */
+	ldr		r2, =excpt_nest_count
+	ldr		r3, [r2]
+	subs	r3, r3, #1
+	str		r3, [r2]
+
+	/*
+	 *  ã¿ã¹ã¯ç¨ã®ã¹ã¿ãã¯ã«æ»ãï¼
+	 */
+	popeq	{r1}					/* æ»ãå
+ãã¿ã¹ã¯ã³ã³ãã­ã¹ããªã */
+	moveq	sp, r1					/*		 ã¿ã¹ã¯ç¨ã®ã¹ã¿ãã¯ã«æ»ã */
+	add		sp, sp, #8				/* ã¹ã¿ãã¯ä¸ã®æ
+å ±ãæ¨ã¦ã */
+	beq		ret_int_1				/* ret_int_1ã«åå² */
+
+	/*
+	 *  CPUä¾å¤å¦çããã®ãªã¿ã¼ã³ï¼irq_handler_3ã¨åãå¦çå
+å®¹ï¼
+	 */
+#if __TARGET_ARCH_ARM < 6
+	ldmfd	sp!, {r0}				/* æ»ãå
+ã®cpsrãspsrã«è¨­å® */
+	msr		spsr_cxsf, r0
+	ldmfd	sp!, {r0-r4,r12,lr,pc}^	/* ã³ã³ãã­ã¹ãã®å¾©å¸° */
+									/* ^ä»ããªã®ã§ï¼spsr â cpsr */
+#else /* __TARGET_ARCH_ARM < 6 */
+	ldmfd	sp!, {r0-r4,r12,lr}
+	rfefd	sp!
+#endif /* __TARGET_ARCH_ARM < 6 */
+
+/*
+ *  ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã®åºå
+¥å£å¦ç
+ */
+ALABEL(nk_exc_handler_1)
+	/*
+	 * ããã®æç¹ã®ã¬ã¸ã¹ã¿ç¶æ
+ã
+	 *  r1ï¼CPUä¾å¤çºçåã®CPSRã®Fãããã¨Iãããã®å¤
+	 *  r2ï¼excpt_nest_countã®çªå°
+	 *  r3ï¼excpt_nest_countã®å¤
+	 *  r4ï¼CPUä¾å¤ãã³ãã©çªå·
+	 *  r12ï¼CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã®å
+é ­çªå°
+	 */
+
+	/*
+	 *  ä¾å¤ãã¹ãã«ã¦ã³ããã¤ã³ã¯ãªã¡ã³ãããï¼
+	 */
+	add		r3, r3, #1
+	str		r3, [r2]
+	teq		r3, #1					/* CPUä¾å¤çºçåãéã¿ã¹ã¯ã³ã³ãã­ã¹ã */
+	bne		nk_exc_handler_2		/*		 	ãªãnk_exc_handler_2ã«åå² */
+
+	/*
+	 *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæããï¼
+	 */
+	mov		r3, sp					/* ãã®æç¹ã®ã¹ã¿ãã¯ãã¤ã³ã¿ãr3ã« */
+	ldr		r2, =istkpt				/* éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã« */
+	ldr		sp, [r2]
+	push	{r3}					/* åæãåã®ã¹ã¿ãã¯ãã¤ã³ã¿ãä¿å­ */
+
+ALABEL(nk_exc_handler_2)
+	/*
+	 *  ã·ã¹ãã ç¶æ
+ï¼ã³ã³ãã­ã¹ãã¯é¤ãï¼ãï¼CPUä¾å¤çºçæã®ç¶æ
+ã¸
+	 */
+	orr		r1, r1, #CPSR_SVC_MODE
+	msr		cpsr_c, r1
+
+	/*
+	 *  CPUä¾å¤ãã³ãã©ã®å¼åºã
+	 */
+	ldr		r2, =exc_table			/* CPUä¾å¤ãã³ãã©ãã¼ãã«ã®èª­è¾¼ã¿ */
+	ldr		r3, [r2,r4,lsl #2]		/* CPUä¾å¤ãã³ãã©ã®çªå° â r3 */
+	mov		r0, r12					/* CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã® */
+									/*		å
+é ­çªå°ãç¬¬1ãã©ã¡ã¼ã¿ã«æ¸¡ã */
+	mov		r1, r4					/* CPUä¾å¤çªå·ãç¬¬2ãã©ã¡ã¼ã¿ã«æ¸¡ã */
+	mov		lr, pc					/* CPUä¾å¤ãã³ãã©ã®å¼åºã */
+	bx		r3
+
+	/*
+	 *  ä¾å¤ãã¹ãã«ã¦ã³ãããã¯ãªã¡ã³ãããï¼
+	 */
+	ldr		r2, =excpt_nest_count
+	ldr		r3, [r2]
+	subs	r3, r3, #1
+	str		r3, [r2]
+
+	/*
+	 *  ã¿ã¹ã¯ç¨ã®ã¹ã¿ãã¯ã«æ»ãï¼
+	 */
+	popeq	{r1}					/* æ»ãå
+ãã¿ã¹ã¯ã³ã³ãã­ã¹ããªã */
+	moveq	sp, r1					/*		 ã¿ã¹ã¯ç¨ã®ã¹ã¿ãã¯ã«æ»ã */
+	add		sp, sp, #8				/* ã¹ã¿ãã¯ä¸ã®æ
+å ±ãæ¨ã¦ã */
+
+	/*
+	 *  CPUä¾å¤å¦çããã®ãªã¿ã¼ã³ï¼irq_handler_3ã¨åãå¦çå
+å®¹ï¼
+	 */
+#if __TARGET_ARCH_ARM < 6
+	ldmfd	sp!, {r0}				/* æ»ãå
+ã®cpsrãspsrã«è¨­å® */
+	msr		spsr_cxsf, r0
+	ldmfd	sp!, {r0-r4,r12,lr,pc}^	/* ã³ã³ãã­ã¹ãã®å¾©å¸° */
+									/* ^ä»ããªã®ã§ï¼spsr â cpsr */
+#else /* __TARGET_ARCH_ARM < 6 */
+	ldmfd	sp!, {r0-r4,r12,lr}
+	rfefd	sp!
+#endif /* __TARGET_ARCH_ARM < 6 */
+
+/*
+ *  å¾®å°æéå¾
+ã¡
+ */
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(_sil_dly_nse)
+ALABEL(_sil_dly_nse)
+	subs	r0, r0, #SIL_DLY_TIM1
+	bxls	lr
+ALABEL(_sil_dly_nse1)
+	subs	r0, r0, #SIL_DLY_TIM2
+	bhi		_sil_dly_nse1
+	bx		lr
+
+/*
+ *  ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ã®æä½é¢æ°
+ *
+ *  Thumbã¢ã¼ãã§ã¯mrs/msrå½ä»¤ãä½¿ç¨ã§ããªãããï¼é¢æ°ã¨ãã¦å®ç¾ãã¦ï¼
+ *  ARMã¢ã¼ãã«ç§»è¡ãã¦å®è¡ããï¼
+ */
+#ifdef __thumb__
+
+	ATEXT
+	AALIGN(2)
+	AWEAK(current_cpsr)
+ALABEL(current_cpsr)
+	mrs		r0, cpsr_cxsf
+	bx		lr
+
+	AALIGN(2)
+	AWEAK(set_cpsr)
+ALABEL(set_cpsr)
+	msr		cpsr_cxsf, r0
+	bx		lr
+
+#endif /* __thumb__ */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/core_test.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_test.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_test.h	(revision 302)
@@ -0,0 +1,222 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: core_test.h 460 2015-08-29 13:04:06Z ertl-hiro $
+ */
+
+/*
+ *		ãã¹ããã­ã°ã©ã ã®ã³ã¢ä¾å­é¨ï¼ARMç¨ï¼
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼target_test.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ãã
+ *  ãããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ããç´æ¥ã¤ã³
+ *  ã¯ã«ã¼ããã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_CORE_TEST_H
+#define TOPPERS_CORE_TEST_H
+
+#include <t_stddef.h>
+#include "arm.h"
+
+/*
+ *  CPUä¾å¤ã®çºç
+ */
+
+#ifndef ILLEGAL_IADDR
+#define ILLEGAL_IADDR			0xd0000000U		/* ä¸æ­£å½ä»¤ã¢ãã¬ã¹ */
+#endif /* ILLEGAL_IADDR */
+
+#ifndef ILLEGAL_DADDR
+#define ILLEGAL_DADDR			0xd0000000U		/* ä¸æ­£ãã¼ã¿ã¢ãã¬ã¹ */
+#endif /* ILLEGAL_DADDR */
+
+/*
+ *  ã¹ã¼ããã¤ã¶ã³ã¼ã«ã«ããCPUä¾å¤ã®çºç
+ *
+ *  CPUä¾å¤ãã³ãã©ããï¼ãã®ã¾ã¾ãªã¿ã¼ã³ãããã¨ãã§ããï¼svcå½ä»¤ã«ã
+ *  ãlrã¬ã¸ã¹ã¿ãä¸æ¸ããããããï¼lrã¬ã¸ã¹ã¿ã¯ç ´å£ããããã®ã¨æå®ã
+ *  ã¦ããï¼
+ */
+#if defined(USE_SVC_CPUEXC)
+
+#define CPUEXC1					EXCNO_SVC		/* ã¹ã¼ããã¤ã¶ã³ã¼ã« */
+#define RAISE_CPU_EXCEPTION		Asm("svc #0":::"lr")
+#define PREPARE_RETURN_CPUEXC
+
+/*
+ *  ããªãã§ããã¢ãã¼ãã«ããCPUä¾å¤ã®çºç
+ *
+ *  ããªãã§ããã¢ãã¼ããèµ·ãããå½ä»¤ãã¹ã­ãããã¦CPUä¾å¤ãã³ãã©ãã
+ *  ãªã¿ã¼ã³ããããã«ï¼æ»ãçªå°ã¯ãã®ã¾ã¾ã§è¯ãï¼ARMã¢ã¼ãã§ä½¿ããã¨ã
+ *  æ³å®ï¼ï¼
+ */
+#elif defined(USE_PABORT_CPUEXC)
+
+#define CPUEXC1					EXCNO_PABORT	/* ããªãã§ããã¢ãã¼ã */
+#define RAISE_CPU_EXCEPTION		((void (*)(void)) ILLEGAL_IADDR)()
+#define PREPARE_RETURN_CPUEXC
+
+/*
+ *  ãã¼ã¿ã¢ãã¼ãã«ããCPUä¾å¤ã®çºç
+ *
+ *  ãã¼ã¿ã¢ãã¼ããèµ·ãããå½ä»¤ãã¹ã­ãããã¦CPUä¾å¤ãã³ãã©ãããªã¿ã¼
+ *  ã³ããããã«ï¼æ»ãçªå°ãã4ãæ¸ç®ããï¼ARMã¢ã¼ãã§ä½¿ããã¨ãæ³å®ï¼ï¼
+ */
+#elif defined(USE_DABORT_CPUEXC)
+
+#include "arm.h"
+#define CPUEXC1					EXCNO_DABORT	/* ãã¼ã¿ã¢ãã¼ã */
+#define RAISE_CPU_EXCEPTION		(void)(*((volatile uint32_t *) ILLEGAL_DADDR))
+#define PREPARE_RETURN_CPUEXC	((T_EXCINF *) p_excinf)->pc -= 4U
+
+/*
+ *  ãã§ã¤ã¿ã«ãã¼ã¿ã¢ãã¼ãå¦ç
+ *
+ *  ã¹ã¿ãã¯ãã¤ã³ã¿ãä¸æ­£ã«ãã¦ï¼ãã§ã¤ã¿ã«ãã¼ã¿ã¢ãã¼ãå¦çãè¡ãã
+ *  ãï¼CPUä¾å¤ãã³ãã©ããã¯ãªã¿ã¼ã³ã§ããªãï¼
+ */
+#elif defined(USE_FATAL_DABORT_CPUEXC)
+
+#define CPUEXC1					EXCNO_DABORT	/* ãã¼ã¿ã¢ãã¼ã */
+#define RAISE_CPU_EXCEPTION		Asm("mov sp, %0"::"I"(ILLEGAL_DADDR))
+
+/*
+ *  æªå®ç¾©å½ä»¤ã«ããCPUä¾å¤ã®çºç
+ *
+ *  RAISE_CPU_EXCEPTIONã¯ï¼ARMã¢ã¼ãã§ä½¿ããã¨ãæ³å®ãã¦ããï¼CPUä¾å¤ã
+ *  ã³ãã©ããï¼ãã®ã¾ã¾ãªã¿ã¼ã³ãããã¨ãã§ããï¼ä½¿ç¨ãã¦ããæªå®ç¾©å½
+ *  ä»¤ã¯ï¼"Multiply and multiply accumulate"å½ä»¤ç¾¤ã®ã¨ã³ã³ã¼ãã£ã³ã°å
+
+ *  ã«ãããæªå®ç¾©å½ä»¤ã§ããï¼
+ */
+#else
+
+#define CPUEXC1					EXCNO_UNDEF		/* æªå®ç¾©å½ä»¤ */
+#define RAISE_CPU_EXCEPTION		Asm(".word 0xf0500090")
+#define PREPARE_RETURN_CPUEXC
+
+#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/core_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/core_unrename.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/core_unrename.h	(revision 302)
@@ -0,0 +1,130 @@
+/* This file is generated from core_rename.def by genrename. */
+
+/* This file is included only when core_rename.h has been included. */
+#ifdef TOPPERS_CORE_RENAME_H
+#undef TOPPERS_CORE_RENAME_H
+
+/*
+ *  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
+
+#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/common/gic_kernel_impl.c
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_kernel_impl.c	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_kernel_impl.c	(revision 302)
@@ -0,0 +1,274 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ *
+ *  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: gic_kernel_impl.c 355 2015-07-25 10:26:02Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®å²è¾¼ã¿ã³ã³ãã­ã¼ã©ä¾å­é¨ï¼GICç¨ï¼
+ */
+
+#include "kernel_impl.h"
+#include "interrupt.h"
+#include <sil.h>
+#include "arm.h"
+
+/*
+ *  CPUã¤ã³ã¿ãã§ã¼ã¹ã®æä½
+ */
+
+/*
+ *  CPUã¤ã³ã¿ãã§ã¼ã¹ã®åæå
+ */
+void
+gicc_initialize(void)
+{
+	/*
+	 *  CPUã¤ã³ã¿ãã§ã¼ã¹ããã£ã¹ã¨ã¼ãã«
+	 */
+	sil_wrw_mem(GICC_CTLR, GICC_CTLR_DISABLE);
+
+	/*
+	 *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãæä½åªå
+åº¦ã«è¨­å®
+	 */
+	gicc_set_priority((GIC_PRI_LEVEL - 1) << GIC_PRI_SHIFT);
+
+	/*
+	 *  å²è¾¼ã¿åªå
+åº¦ã®å
+¨ãããæå¹ã«
+	 */
+	sil_wrw_mem(GICC_BPR, 0U);
+
+	/*
+	 *  ã¢ã¯ãã£ããªå²è¾¼ã¿ãããã°ï¼EOIã«ããã¯ãªã¢ãã
+	 */
+	sil_wrw_mem(GICC_EOIR, sil_rew_mem(GICC_IAR));
+
+	/*
+	 *  CPUã¤ã³ã¿ãã§ã¼ã¹ãã¤ãã¼ãã«
+	 */
+#ifdef TOPPERS_SAFEG_SECURE
+	sil_wrw_mem(GICC_CTLR, (GICC_CTLR_FIQEN|GICC_CTLR_ENABLEGRP1
+												|GICC_CTLR_ENABLEGRP0));
+#else /* TOPPERS_SAFEG_SECURE */
+	sil_wrw_mem(GICC_CTLR, GICC_CTLR_ENABLE);
+#endif /* TOPPERS_SAFEG_SECURE */
+}
+
+/*
+ *  CPUã¤ã³ã¿ãã§ã¼ã¹ã®çµäºå¦ç
+ */
+void
+gicc_terminate(void)
+{
+	sil_wrw_mem(GICC_CTLR, GICC_CTLR_DISABLE);
+}
+
+/*
+ *  ãã£ã¹ããªãã¥ã¼ã¿ã®æä½
+ */
+
+/*
+ *  ãã£ã¹ããªãã¥ã¼ã¿ã®åæå
+ */
+void
+gicd_initialize(void)
+{
+	int		i;
+
+	/*
+	 *  ãã£ã¹ããªãã¥ã¼ã¿ããã£ã¹ã¨ã¼ãã«
+	 */
+	sil_wrw_mem(GICD_CTLR, GICD_CTLR_DISABLE);
+
+#ifdef TOPPERS_SAFEG_SECURE
+	/*
+	 *  ãã¹ã¦ã®å²è¾¼ã¿ãã°ã«ã¼ã1ï¼IRQï¼ã«è¨­å®
+	 */
+	for (i = 0; i < GIC_TNUM_INTNO / 32; i++) {
+		sil_wrw_mem(GICD_IGROUPR(i), 0xffffffffU);
+	}
+#endif /* TOPPERS_SAFEG_SECURE */
+
+	/*
+	 *  ãã¹ã¦ã®å²è¾¼ã¿ãç¦æ­¢
+	 */
+	for (i = 0; i < GIC_TNUM_INTNO / 32; i++) {
+		sil_wrw_mem(GICD_ICENABLER(i), 0xffffffffU);
+	}
+
+	/*
+	 *  ãã¹ã¦ã®å²è¾¼ã¿ãã³ãã£ã³ã°ãã¯ãªã¢
+	 */
+	for (i = 0; i < GIC_TNUM_INTNO / 32; i++) {
+		sil_wrw_mem(GICD_ICPENDR(i), 0xffffffffU);
+	}
+
+	/*
+	 *  ãã¹ã¦ã®å²è¾¼ã¿ãæä½åªå
+åº¦ã«è¨­å®
+	 */
+	for (i = 0; i < GIC_TNUM_INTNO / 4; i++){
+		sil_wrw_mem(GICD_IPRIORITYR(i), 0xffffffffU);
+	}
+
+	/*
+	 *  ãã¹ã¦ã®å
+±æããªãã§ã©ã«å²è¾¼ã¿ã®ã¿ã¼ã²ããããã­ã»ããµ0ã«è¨­å®
+	 */
+	for (i = GIC_INTNO_SPI0 / 4; i < GIC_TNUM_INTNO / 4; i++) {
+		sil_wrw_mem(GICD_ITARGETSR(i), 0x01010101U);
+	}
+
+	/*
+	 *  ãã¹ã¦ã®ããªãã§ã©ã«å²è¾¼ã¿ãã¬ãã«ããªã¬ã«è¨­å®
+	 */
+	for (i = GIC_INTNO_PPI0 / 16; i < GIC_TNUM_INTNO / 16; i++) {
+#ifdef GIC_ARM11MOCORE
+		sil_wrw_mem(GICD_ICFGR(i), 0x55555555U);
+#else /* GIC_ARM11MOCORE */
+		sil_wrw_mem(GICD_ICFGR(i), 0x00000000U);
+#endif /* GIC_ARM11MOCORE */
+	}
+
+	/*
+	 *  ãã£ã¹ããªãã¥ã¼ã¿ãã¤ãã¼ãã«
+	 */
+	sil_wrw_mem(GICD_CTLR, GICD_CTLR_ENABLE);
+}
+
+/*
+ *  ãã£ã¹ããªãã¥ã¼ã¿ã®çµäºå¦ç
+ */
+void
+gicd_terminate(void)
+{
+	sil_wrw_mem(GICD_CTLR, GICD_CTLR_DISABLE);
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ã®è¨­å®
+ *
+ *  ASPã«ã¼ãã«ã§ã®å©ç¨ãæ³å®ãã¦ï¼ãã©ã¡ã¼ã¿ã¨ã©ã¼ã¯ã¢ãµã¼ã·ã§ã³ã§ãã§ã
+ *  ã¯ãã¦ããï¼
+ */
+Inline void
+config_int(INTNO intno, ATR intatr, PRI intpri)
+{
+	assert(VALID_INTNO(intno));
+	assert(TMIN_INTPRI <= intpri && intpri <= TMAX_INTPRI);
+
+	/*
+	 *  å²è¾¼ã¿ãç¦æ­¢
+	 *
+	 *  å²è¾¼ã¿ãåãä»ããã¾ã¾ï¼ã¬ãã«ããªã¬ï¼ã¨ãã¸ããªã¬ã®è¨­å®ãï¼å²
+	 *  è¾¼ã¿åªå
+åº¦ã®è¨­å®ãè¡ãã®ã¯å±éºãªããï¼å²è¾¼ã¿å±æ§ã«ãããããï¼
+	 *  ä¸æ¦ãã¹ã¯ããï¼
+	 */
+	disable_int(intno);
+
+	/*
+	 *  å²è¾¼ã¿ãã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³
+	 */
+#ifdef TOPPERS_SAFEG_SECURE
+	gicd_config_group(intno, 1U);
+#endif /* TOPPERS_SAFEG_SECURE */
+
+	if ((intatr & TA_EDGE) != 0U) {
+#ifdef GIC_ARM11MOCORE
+		gicd_config(intno, GICD_ICFGRn_EDGE|GICD_ICFGRn_1_N);
+#else /* GIC_ARM11MOCORE */
+		gicd_config(intno, GICD_ICFGRn_EDGE);
+#endif /* GIC_ARM11MOCORE */
+		clear_int(intno);
+	}
+	else {
+#ifdef GIC_ARM11MOCORE
+		gicd_config(intno, GICD_ICFGRn_LEVEL|GICD_ICFGRn_1_N);
+#else /* GIC_ARM11MOCORE */
+		gicd_config(intno, GICD_ICFGRn_LEVEL);
+#endif /* GIC_ARM11MOCORE */
+	}
+
+	/*
+	 *  å²è¾¼ã¿åªå
+åº¦ã¨ã¿ã¼ã²ãããã­ã»ããµãè¨­å®
+	 */
+	gicd_set_priority(intno, INT_IPM(intpri));
+	gicd_set_target(intno, 1U << arm_prc_index());
+
+	/*
+	 * å²è¾¼ã¿ãè¨±å¯
+	 */
+	if ((intatr & TA_ENAINT) != 0U) {
+		enable_int(intno);
+	}
+}
+
+/*
+ *  å²è¾¼ã¿ç®¡çæ©è½ã®åæå
+ */
+void
+initialize_interrupt(void)
+{
+	uint_t			i;
+	const INTINIB	*p_intinib;
+
+	for (i = 0; i < tnum_cfg_intno; i++) {
+		p_intinib = &(intinib_table[i]);
+		config_int(p_intinib->intno, p_intinib->intatr, p_intinib->intpri);
+	}
+}
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 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_kernel_impl.h	(revision 302)
@@ -0,0 +1,485 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: gic_kernel_impl.h 377 2015-07-31 00:48:14Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®å²è¾¼ã¿ã³ã³ãã­ã¼ã©ä¾å­é¨ï¼GICç¨ï¼
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼target_kernel_impl.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯
+ *  ã«ã¼ãããããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ãã
+ *  ç´æ¥ã¤ã³ã¯ã«ã¼ããã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_GIC_KERNEL_IMPL_H
+#define TOPPERS_GIC_KERNEL_IMPL_H
+
+#include <sil.h>
+#include "arm.h"
+
+/*
+ *  å²è¾¼ã¿çªå·ã®æ°ï¼æå°å¤ã¨æå¤§å¤
+ */
+#define TNUM_INTNO		GIC_TNUM_INTNO
+#define TMIN_INTNO		UINT_C(0)
+#define TMAX_INTNO		(GIC_TNUM_INTNO - 1)
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©çªå·ã®æ°
+ */
+#define TNUM_INHNO		GIC_TNUM_INTNO
+
+/*
+ *  å²è¾¼ã¿çªå·ã®å®ç¾©
+ */
+#define GIC_INTNO_SGI0		0U
+#define GIC_INTNO_PPI0		16U
+#define GIC_INTNO_SPI0		32U
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ã®æä½
+ *
+ *  å²è¾¼ã¿åªå
+åº¦ã®å
+é¨è¡¨ç¾ã¯ï¼uint_tåã§è¡¨ãï¼0ãæé«åªå
+åº¦ã§ï¼å¤ãå¤§ã
+ *  ãã»ã©åªå
+åº¦ãä¸ãããã®ã¨ããï¼GICã®ã¬ã¸ã¹ã¿æ§æã¨æ´åãããããã«ï¼
+ *  åªå
+åº¦ã®æ®µæ°ã256æ®µéã®æã«ãããã¦è¡¨ãï¼
+ */
+#if GIC_PRI_LEVEL == 16
+#define GIC_PRI_SHIFT		4
+#define GIC_PRI_MASK		UINT_C(0x0f)
+#elif GIC_PRI_LEVEL == 32
+#define GIC_PRI_SHIFT		3
+#define GIC_PRI_MASK		UINT_C(0x1f)
+#elif GIC_PRI_LEVEL == 64
+#define GIC_PRI_SHIFT		2
+#define GIC_PRI_MASK		UINT_C(0x3f)
+#elif GIC_PRI_LEVEL == 128
+#define GIC_PRI_SHIFT		1
+#define GIC_PRI_MASK		UINT_C(0x7f)
+#elif GIC_PRI_LEVEL == 256
+#define GIC_PRI_SHIFT		0
+#define GIC_PRI_MASK		UINT_C(0xff)
+#else
+#error Invalid number of priority levels for GIC.
+#endif /* GIC_PRI_LEVEL == 16 */
+
+/* å¤é¨è¡¨ç¾ã¸ã®å¤æ */
+#define EXT_IPM(pri) \
+			(((PRI)((pri) >> GIC_PRI_SHIFT)) - (GIC_PRI_LEVEL - 1))
+
+/* å
+é¨è¡¨ç¾ã¸ã®å¤æ */
+#define INT_IPM(ipm) \
+			(((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ã¬ã¸ã¹ã¿ã®ã¢ãã¬ã¹ãå®ç¾©ããããã®ãã¯ã­
+ *
+ *  GICã¬ã¸ã¹ã¿ã®ã¢ãã¬ã¹ãï¼ã¢ã»ã³ããªè¨èªãããåç
+§ã§ããããã«ããã
+ *  ãã®ãã¯ã­ï¼
+ */
+#ifndef GIC_REG
+#define GIC_REG(base, offset)	((uint32_t *)((base) + (offset ## U)))
+#endif /* GIC_REG */
+
+/*
+ *  CPUã¤ã³ã¿ãã§ã¼ã¹é¢é£ã®å®ç¾©
+ */
+#define GICC_CTLR		GIC_REG(GICC_BASE, 0x00)
+#define GICC_PMR		GIC_REG(GICC_BASE, 0x04)
+#define GICC_BPR		GIC_REG(GICC_BASE, 0x08)
+#define GICC_IAR		GIC_REG(GICC_BASE, 0x0C)
+#define GICC_EOIR		GIC_REG(GICC_BASE, 0x10)
+#define GICC_RPR		GIC_REG(GICC_BASE, 0x14)
+#define GICC_HPIR		GIC_REG(GICC_BASE, 0x18)
+
+/*
+ *  CPUã¤ã³ã¿ãã§ã¼ã¹å¶å¾¡ã¬ã¸ã¹ã¿ï¼GICC_CTLRï¼ã®è¨­å®å¤ï¼GICv1ã§ã»ã­ã¥ãª
+ *  ãã£æ¡å¼µããªãå ´åï¼
+ */
+#define GICC_CTLR_DISABLE		UINT_C(0x00)
+#define GICC_CTLR_ENABLE		UINT_C(0x01)
+
+/*
+ *  CPUã¤ã³ã¿ãã§ã¼ã¹å¶å¾¡ã¬ã¸ã¹ã¿ï¼GICC_CTLRï¼ã®è¨­å®å¤ï¼GICv2ã§ã»ã­ã¥ãª
+ *  ãã£æ¡å¼µããªãå ´åãï¼æ¡å¼µãããå ´åã®ã»ã­ã¥ã¢ã¢ã¼ãï¼
+ */
+#ifdef TOPPERS_SAFEG_SECURE
+#define GICC_CTLR_ENABLEGRP0	UINT_C(0x01)
+#define GICC_CTLR_ENABLEGRP1	UINT_C(0x02)
+#define GICC_CTLR_FIQEN			UINT_C(0x08)
+#define GICC_CTLR_CBPR			UINT_C(0x10)
+#endif /* TOPPERS_SAFEG_SECURE */
+
+/*
+ *  ãã£ã¹ããªãã¥ã¼ã¿é¢é£ã®å®ç¾©
+ */
+#define GICD_CTLR			GIC_REG(GICD_BASE, 0x000)
+#define GICD_TYPER			GIC_REG(GICD_BASE, 0x004)
+#define GICD_IIDR			GIC_REG(GICD_BASE, 0x008)
+#define GICD_IGROUPR(n)		GIC_REG(GICD_BASE, 0x080 + n * 4)
+#define GICD_ISENABLER(n)	GIC_REG(GICD_BASE, 0x100 + n * 4)
+#define GICD_ICENABLER(n)	GIC_REG(GICD_BASE, 0x180 + n * 4)
+#define GICD_ISPENDR(n)		GIC_REG(GICD_BASE, 0x200 + n * 4)
+#define GICD_ICPENDR(n)		GIC_REG(GICD_BASE, 0x280 + n * 4)
+#define GICD_ISACTIVER(n)	GIC_REG(GICD_BASE, 0x300 + n * 4)
+#define GICD_ICACTIVER(n)	GIC_REG(GICD_BASE, 0x380 + n * 4)
+#define GICD_IPRIORITYR(n)	GIC_REG(GICD_BASE, 0x400 + n * 4)
+#define GICD_ITARGETSR(n)	GIC_REG(GICD_BASE, 0x800 + n * 4)
+#define GICD_ICFGR(n)		GIC_REG(GICD_BASE, 0xc00 + n * 4)
+#define GICD_NSCAR(n)		GIC_REG(GICD_BASE, 0xe00 + n * 4)
+#define GICD_SGIR			GIC_REG(GICD_BASE, 0xf00)
+#define GICD_CPENDSGIR(n)	GIC_REG(GICD_BASE, 0xf10 + n * 4)
+#define GICD_SPENDSGIR(n)	GIC_REG(GICD_BASE, 0xf20 + n * 4)
+
+/*
+ *  ãã£ã¹ããªãã¥ã¼ã¿å¶å¾¡ã¬ã¸ã¹ã¿ï¼GICD_CTLRï¼ã®è¨­å®å¤
+ */
+#define GICD_CTLR_DISABLE	UINT_C(0x00)
+#define GICD_CTLR_ENABLE	UINT_C(0x01)
+
+/*
+ *  å²è¾¼ã¿ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¬ã¸ã¹ã¿ï¼GICD_ICFGRnï¼ã®è¨­å®å¤
+ *
+ *  ç¬¬1ãããã¯ï¼ARM11 MPCoreã§ã¯å²è¾¼ã¿ã®éç¥å
+ãã­ã»ããµãè¨­å®ãããã
+ *  ã«ä½¿ç¨ããã¦ãããï¼GICv1ããã³GICv2ã§ã¯äºç´ãããã¨ãªã£ã¦ããï¼
+ */
+#define GICD_ICFGRn_LEVEL	UINT_C(0x00)
+#define GICD_ICFGRn_EDGE	UINT_C(0x02)
+#ifdef GIC_ARM11MOCORE
+#define GICD_ICFGRn_N_N		UINT_C(0x00)
+#define GICD_ICFGRn_1_N		UINT_C(0x01)
+#endif /* GIC_ARM11MOCORE */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  CPUã¤ã³ã¿ãã§ã¼ã¹ã®æä½
+ */
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãè¨­å®ï¼priã¯å
+é¨è¡¨ç¾ï¼
+ */ 
+Inline void
+gicc_set_priority(uint_t pri)
+{
+	sil_wrw_mem(GICC_PMR, pri);
+}
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãåå¾ï¼å
+é¨è¡¨ç¾ã§è¿ãï¼
+ */ 
+Inline uint_t
+gicc_get_priority(void)
+{
+	return(sil_rew_mem(GICC_PMR));
+}
+
+/*
+ *  CPUã¤ã³ã¿ãã§ã¼ã¹ã®åæå
+ */
+extern void gicc_initialize(void);
+
+/*
+ *  CPUã¤ã³ã¿ãã§ã¼ã¹ã®çµäº
+ */
+extern void gicc_terminate(void);
+
+/*
+ *  ãã£ã¹ããªãã¥ã¼ã¿ã®æä½
+ */
+
+/*
+ *  å²è¾¼ã¿ç¦æ­¢ï¼å²è¾¼ã¿ã¤ãã¼ãã«ã®ã¯ãªã¢ï¼
+ */
+Inline void
+gicd_disable_int(INTNO intno)
+{
+	sil_wrw_mem(GICD_ICENABLER(intno / 32), (1U << (intno % 32)));
+}
+
+/*
+ *  å²è¾¼ã¿è¨±å¯ï¼å²è¾¼ã¿ã¤ãã¼ãã«ã®ã»ããï¼
+ */
+Inline void
+gicd_enable_int(INTNO intno)
+{
+	sil_wrw_mem(GICD_ISENABLER(intno / 32), (1U << (intno % 32)));
+}
+
+/*
+ *  å²è¾¼ã¿ãã³ãã£ã³ã°ã®ã¯ãªã¢
+ */
+Inline void
+gicd_clear_pending(INTNO intno)
+{
+	sil_wrw_mem(GICD_ICPENDR(intno / 32), (1U << (intno % 32)));
+}
+
+/*
+ *  å²è¾¼ã¿ãã³ãã£ã³ã°ã®ã»ãã
+ */
+Inline void
+gicd_set_pending(INTNO intno)
+{
+	sil_wrw_mem(GICD_ISPENDR(intno / 32), (1U << (intno % 32)));
+}
+
+/*
+ *  å²è¾¼ã¿ãã³ãã£ã³ã°ã®ãã§ãã¯
+ */
+Inline bool_t
+gicd_probe_pending(INTNO intno)
+{
+	return((sil_rew_mem(GICD_ISPENDR(intno / 32)) & (1U << (intno % 32)))
+																	!= 0U);
+}
+
+/*
+ *  å²è¾¼ã¿ã®ã³ã³ãã£ã°ã¬ã¼ã·ã§ã³
+ */
+Inline void
+gicd_config(INTNO intno, uint_t config)
+{
+	uint_t		shift = (intno % 16) * 2;
+	uint32_t	reg;
+
+	reg = sil_rew_mem(GICD_ICFGR(intno / 16));
+	reg &= ~(0x03U << shift);
+	reg |= (config << shift);
+	sil_wrw_mem(GICD_ICFGR(intno / 16), reg);
+}
+
+/*
+ *  å²è¾¼ã¿ã°ã«ã¼ãã®è¨­å®ï¼ã»ã­ã¥ãªãã£æ¡å¼µï¼
+ */
+Inline void
+gicd_config_group(INTNO intno, uint_t group)
+{
+	uint_t		shift = intno % 32;
+	uint32_t	reg;
+
+	reg = sil_rew_mem(GICD_IGROUPR(intno / 32));
+	reg &= ~(0x01U << shift);
+	reg |= (group << shift);
+	sil_wrw_mem(GICD_IGROUPR(intno / 32), reg);
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ããå²è¾¼ã¿åªå
+åº¦ã®è¨­å®ï¼priã¯å
+é¨è¡¨ç¾ï¼
+ */
+Inline void
+gicd_set_priority(INTNO intno, uint_t pri)
+{
+	uint_t		shift = (intno % 4) * 8;
+	uint32_t	reg;
+
+	reg = sil_rew_mem(GICD_IPRIORITYR(intno / 4));
+	reg &= ~(0xffU << shift);
+	reg |= (pri << shift);
+	sil_wrw_mem(GICD_IPRIORITYR(intno / 4), reg);
+}
+
+/*
+ *  å²è¾¼ã¿ã¿ã¼ã²ãããã­ã»ããµã®è¨­å®
+ *
+ *  prcsã¯ï¼ã¿ã¼ã²ããã¨ãããã­ã»ããµãè¡¨ããããã®ãããæ¯è«çåã§æ
+ *  å®ããï¼
+ *		ãã­ã»ããµ0 : 0x01
+ *		ãã­ã»ããµ1 : 0x02
+ *		ãã­ã»ããµ2 : 0x04
+ *		ãã­ã»ããµ3 : 0x08
+ */
+Inline void
+gicd_set_target(INTNO intno, uint_t prcs)
+{
+	uint_t		shift = (intno % 4) * 8;
+	uint32_t	reg;
+
+	reg = sil_rew_mem(GICD_ITARGETSR(intno / 4));
+	reg &= ~(0xffU << shift);
+	reg |= (prcs << shift);
+	sil_wrw_mem(GICD_ITARGETSR(intno / 4), reg);
+}
+
+/*
+ *  ãã£ã¹ããªãã¥ã¼ã¿ã®åæå
+ */
+extern void gicd_initialize(void);
+
+/*
+ *  ãã£ã¹ããªãã¥ã¼ã¿ã®çµäº
+ */
+extern void gicd_terminate(void);
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  å²è¾¼ã¿çªå·ã®ç¯å²ã®å¤å®
+ */
+#define VALID_INTNO(intno)	(TMIN_INTNO <= (intno) && (intno) <= TMAX_INTNO)
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®ããã®æ¨æºçãªåæåæ
+å ±ãçæãã
+ */
+#define USE_INTINIB_TABLE
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã©ã¤ã³è¨­å®ãã¼ãã«ãçæãã
+ */
+#define USE_INTCFG_TABLE
+
+/*
+ *  ã³ã¢ä¾å­é¨
+ */
+#include "core_kernel_impl.h"
+
+/*
+ *  ã¿ã¼ã²ããéä¾å­é¨ã«æä¾ããé¢æ°
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®è¨­å®
+ */
+Inline void
+t_set_ipm(PRI intpri)
+{
+	gicc_set_priority(INT_IPM(intpri));
+}
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®åç
+§
+ */
+Inline PRI
+t_get_ipm(void)
+{
+	return(EXT_IPM(gicc_get_priority()));
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ã»ãã
+ *
+ *  intnoã§æå®ãããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ããå²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ã»ã
+ *  ããï¼å²è¾¼ã¿ãç¦æ­¢ããï¼å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªãå²è¾¼ã¿è¦æ±ã©ã¤
+ *  ã³ãæå®ãããå ´åã«ã¯ï¼falseãè¿ãï¼
+ */
+Inline bool_t
+disable_int(INTNO intno)
+{
+	if (intcfg_table[intno] == 0U) {
+		return(false);
+	}
+	gicd_disable_int(intno);
+	return(true);
+}
+
+/* 
+ *  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ã¯ãªã¢
+ *
+ *  intnoã§æå®ãããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ããå²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ã¯ãª
+ *  ã¢ãï¼å²è¾¼ã¿ãè¨±å¯ããï¼å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªãå²è¾¼ã¿è¦æ±ã©ã¤
+ *  ã³ãæå®ãããå ´åã«ã¯ï¼falseãè¿ãï¼
+ */
+Inline bool_t
+enable_int(INTNO intno)
+{
+	if (intcfg_table[intno] == 0U) {
+		return(false);
+	}
+	gicd_enable_int(intno);
+	return(true);
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã®ã¯ãªã¢
+ */
+Inline void
+clear_int(INTNO intno)
+{
+	gicd_clear_pending(intno);
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã®ãã§ãã¯
+ */
+Inline bool_t
+probe_int(INTNO intno)
+{
+	return(gicd_probe_pending(intno));
+}
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_GIC_KERNEL_IMPL_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_support.S
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_support.S	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/gic_support.S	(revision 302)
@@ -0,0 +1,215 @@
+/*
+ *  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) 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: gic_support.S 454 2015-08-16 03:18:46Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®å²è¾¼ã¿ã³ã³ãã­ã¼ã©ä¾å­é¨ã®ã¢ã»ã³ããªè¨èªé¨ï¼GICç¨ï¼
+ */
+
+#define TOPPERS_MACRO_ONLY
+#define TOPPERS_ASM_MACRO
+#define UINT_C(val)			(val)		/* uint_tåã®å®æ°ãä½ããã¯ã­ */
+#define ULONG_C(val)		(val)		/* ulong_tåã®å®æ°ãä½ããã¯ã­ */
+#define CAST(type, val)		(val)		/* åã­ã£ã¹ããè¡ããã¯ã­ */
+#define GIC_REG(base, offset)	((base) + (offset))
+#include "kernel_impl.h"
+#include "core_asm.inc"
+
+#if __TARGET_ARCH_ARM < 6
+#error gic_suport.S supports ARMv6 or later.
+#endif /* __TARGET_ARCH_ARM < 6 */
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©å¼åºãåã®å²è¾¼ã¿ã³ã³ãã­ã¼ã©æä½
+ *
+ *  r4ã«å²è¾¼ã¿çªå·ãè¿ãï¼irc_end_intã§ç¨ããæ
+å ±ï¼å²è¾¼ã¿çºçåã®å²è¾¼ã¿
+ *  åªå
+åº¦ãã¹ã¯ï¼ãï¼ã¹ã¿ãã¯ã«ä¿å­ããï¼
+ */
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(irc_begin_int)
+ALABEL(irc_begin_int)
+	/*
+	 *  å²è¾¼ã¿è¦å ãåå¾ããï¼
+	 */
+	ldr		r1, =GICC_IAR
+	ldr		r3, [r1]
+
+	/*
+	 *  å²è¾¼ã¿è¦å ã®å²è¾¼ã¿åªå
+åº¦ãæ±ãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã«è¨­å®ããï¼
+	 */
+	ldr		r1, =GICC_RPR		/* åãä»ããå²è¾¼ã¿ã®å²è¾¼ã¿åªå
+åº¦ãåå¾ */
+	ldr		r0, [r1]
+	ldr		r1, =GICC_PMR		/* å²è¾¼ã¿çºçåã®å²è¾¼ã¿åªå
+åº¦ãåå¾ */
+	ldr		r2, [r1]
+	str		r0, [r1]			/* æ°ããå²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãã»ãããã */
+//	DATA_SYNC_BARRIER			/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãã»ãããããã®ãå¾
+ã¤ */
+#if __TARGET_ARCH_ARM == 6
+	mov		r0, #0
+	mcr		p15, 0, r0, c7, c10, 4
+#elif __TARGET_ARCH_ARM == 7
+	dsb
+#endif /* __TARGET_ARCH_ARM == 7 */
+	push	{r2}				/* irc_end_intã§ç¨ããæ
+å ±ãä¿å­ */
+
+	/*
+	 *  EOIãçºè¡ããï¼
+	 */
+	ldr		r1, =GICC_EOIR		/* EOIã¬ã¸ã¹ã¿ã¸ã®æ¸è¾¼ã¿ */
+	str		r3, [r1]
+
+	/*
+	 *  å²è¾¼ã¿çªå·ãè¿å¤ã¨ãã¦ãªã¿ã¼ã³ããï¼
+	 */
+	lsl		r4, r3, #22			/* ä¸ä½10ããããåãåºã */
+	lsr		r4, r4, #22
+	bx		lr
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©å¼åºãå¾ã®å²è¾¼ã¿ã³ã³ãã­ã¼ã©æä½
+ */
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(irc_end_int)
+ALABEL(irc_end_int)
+	/*
+	 *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ãï¼
+	 */
+	pop		{r2}				/* irc_begin_intã§ä¿å­ããæ
+å ±ãå¾©å¸° */
+	ldr		r1, =GICC_PMR		/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ã */
+	str		r2, [r1]
+	bx		lr
+
+/*
+ *  CPUä¾å¤çºçåã®å²è¾¼ã¿åªå
+åº¦ã®åå¾
+ *
+ *  CPUä¾å¤ã®çºçã§å²è¾¼ã¿åªå
+åº¦ãå¤ãããã¨ã¯ãªãããï¼ç¾å¨ã®å²è¾¼ã¿åªå
+
+ *  åº¦ãè¿ãï¼
+ */
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(irc_get_intpri)
+ALABEL(irc_get_intpri)
+	/*
+	 *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤é¨è¡¨ç¾ã«å¤æãã¦è¿ãï¼
+	 */
+	ldr		r1, =GICC_PMR
+	ldr		r0, [r1]
+	asr		r0, r0, #GIC_PRI_SHIFT
+	sub		r0, r0, #GIC_PRI_MASK
+	bx		lr
+
+/*
+ *  CPUä¾å¤ãã³ãã©å¼åºãåã®å²è¾¼ã¿ã³ã³ãã­ã¼ã©æä½
+ *
+ *  irc_end_excã§ç¨ããæ
+å ±ï¼å²è¾¼ã¿çºçåã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼ãï¼ã¹ã¿ã
+ *	ã¯ã«ä¿å­ããï¼
+ */
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(irc_begin_exc)
+ALABEL(irc_begin_exc)
+	/*
+	 *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãä¿å­ããï¼
+	 */
+	ldr		r1, =GICC_PMR		/* ç¾å¨ã®å²è¾¼ã¿åªå
+åº¦ãåå¾ */
+	ldr		r2, [r1]
+	push	{r2}				/* irc_end_excã§ç¨ããæ
+å ±ãä¿å­ */
+	bx		lr
+
+/*
+ *  CPUä¾å¤ãã³ãã©å¼åºãå¾ã®å²è¾¼ã¿ã³ã³ãã­ã¼ã©æä½
+ */
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(irc_end_exc)
+ALABEL(irc_end_exc)
+	/*
+	 *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ãï¼
+	 */
+	pop		{r2}				/* irc_begin_intã§ä¿å­ããæ
+å ±ãå¾©å¸° */
+	ldr		r1, =GICC_PMR		/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ã */
+	str		r2, [r1]
+	bx		lr
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/sp804.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/sp804.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/sp804.h	(revision 302)
@@ -0,0 +1,87 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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: sp804.h 440 2015-08-09 02:02:08Z ertl-hiro $
+ */
+
+/*
+ *		ARM Dual-Timer Moduleï¼SP804ï¼ãµãã¼ãã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_SP804_H
+#define TOPPERS_SP804_H
+
+/*
+ *  ã¿ã¤ãã¬ã¸ã¹ã¿ã®çªå°ã®å®ç¾©
+ */
+#define SP804_LR(base)		((uint32_t *)((base) + 0x00U))
+#define SP804_CVR(base)		((uint32_t *)((base) + 0x04U))
+#define SP804_CR(base)		((uint32_t *)((base) + 0x08U))
+#define SP804_ICR(base)		((uint32_t *)((base) + 0x0cU))
+#define SP804_RIS(base)		((uint32_t *)((base) + 0x10U))
+#define SP804_MIS(base)		((uint32_t *)((base) + 0x14U))
+#define SP804_BGLR(base)	((uint32_t *)((base) + 0x18U))
+
+/*
+ *  å¶å¾¡ã¬ã¸ã¹ã¿ï¼SP804_CRï¼ã®è¨­å®å¤
+ */
+#define SP804_DISABLE			UINT_C(0x00)	/* ã¿ã¤ããã£ã¹ã¨ã¼ãã« */
+#define SP804_ENABLE			UINT_C(0x80)	/* ã¿ã¤ãã¤ãã¼ãã« */
+#define SP804_INT_ENABLE		UINT_C(0x20)	/* ã¿ã¤ãå²è¾¼ã¿ã¤ãã¼ãã« */
+#define SP804_MODE_FREERUN		UINT_C(0x00)	/* ããªã¼ã©ã³ãã³ã°ã¢ã¼ã */
+#define SP804_MODE_PERIODIC		UINT_C(0x40)	/* å¨æã¢ã¼ã */
+#define SP804_MODE_ONESHOT		UINT_C(0x01)	/* ã¯ã³ã·ã§ããã¢ã¼ã */
+#define SP804_SIZE_32			UINT_C(0x02)	/* 32ããã */
+#define SP804_PRESCALE_1		UINT_C(0x00)	/* ããªã¹ã±ã¼ã© Ã1 */
+#define SP804_PRESCALE_16		UINT_C(0x04)	/* ããªã¹ã±ã¼ã© Ã16 */
+#define SP804_PRESCALE_256		UINT_C(0x08)	/* ããªã¹ã±ã¼ã© Ã256 */
+
+#endif /* TOPPERS_SP804_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/start.S
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/start.S	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/start.S	(revision 302)
@@ -0,0 +1,155 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: start.S 349 2015-07-25 05:25:27Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ç¨ã®ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ï¼ARMç¨ï¼
+ */
+	
+#define TOPPERS_MACRO_ONLY
+#define TOPPERS_ASM_MACRO
+#define UINT_C(val)			(val)		/* uint_tåã®å®æ°ãä½ããã¯ã­ */
+#define ULONG_C(val)		(val)		/* ulong_tåã®å®æ°ãä½ããã¯ã­ */
+#define CAST(type, val)		(val)		/* åã­ã£ã¹ããè¡ããã¯ã­ */
+#include "kernel_impl.h"
+#include "core_asm.inc"
+
+	ATEXT
+	AALIGN(2)
+	AGLOBAL(start)
+ALABEL(start)
+	/*
+	 *  ãã­ã»ããµã¢ã¼ãã®åæå
+	 *
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã«åæåããï¼
+	 */
+	msr		cpsr_cxsf, #(CPSR_SVC_MODE AOR CPSR_INTLOCK)
+
+	/*
+	 *  ã¹ã¿ãã¯ãã¤ã³ã¿ã¨ãã¬ã¼ã ãã¤ã³ã¿ã®åæå
+	 */
+	ldr		r0, =_kernel_istkpt
+	ldr		sp, [r0]			/* ã¹ã¿ãã¯ãã¤ã³ã¿ï¼spï¼*/
+	mov		fp, #0				/* ARMã¢ã¼ãç¨ãã¬ã¼ã ãã¤ã³ã¿ï¼r11ï¼*/
+	mov		r7, #0				/* Thumbã¢ã¼ãç¨ãã¬ã¼ã ãã¤ã³ã¿ï¼r7ï¼*/
+
+	/*
+	 *  hardware_init_hookã®å¼åºãï¼0ã§ãªãå ´åï¼
+	 *
+	 *  ã¿ã¼ã²ãããã¼ãã¦ã§ã¢ã«ä¾å­ãã¦å¿
+è¦ãªåæåå¦çãããå ´åã¯ï¼
+	 *  hardware_init_hookã¨ããé¢æ°ãç¨æããï¼
+	 */
+	ldr		r0, =hardware_init_hook
+	cmp		r0, #0
+	movne	lr, pc
+	bxne	r0
+
+#ifndef TOPPERS_OMIT_BSS_INIT
+	/*
+	 *  bssã»ã¯ã·ã§ã³ã®ã¯ãªã¢
+	 *
+	 *  BSS_STARTããBSS_ENDã¾ã§ãã¼ã­ã¯ãªã¢ããï¼
+	 */
+	ldr		r1, =BSS_START
+	ldr		r2, =BSS_END
+	cmp		r1, r2
+	bhs		start_3
+	mov		r0, #0
+ALABEL(start_2)
+	str		r0, [r1], #4
+	cmp		r1, r2
+	blo		start_2
+ALABEL(start_3)
+#endif /* TOPPERS_OMIT_BSS_INIT */
+
+#ifndef TOPPERS_OMIT_DATA_INIT
+	/*
+	 *  dataã»ã¯ã·ã§ã³ã®åæåï¼ROMåå¯¾å¿ï¼
+	 *
+	 *  DATA_STARTããDATA_ENDã¾ã§ã«ï¼IDATA_STARTä»¥éããã³ãã¼ããï¼
+	 *  IDATA_STARTããIDATA_ENDã¾ã§ãï¼DATA_STARTä»¥éã«ã³ãã¼ããï¼
+	 */
+	ldr		r1, =DATA_START
+	ldr		r3, =DATA_END
+	cmp		r1, r3
+	bhs		start_5
+	ldr		r2, =IDATA_START
+ALABEL(start_4)
+	ldr		r0, [r2], #4
+	str		r0, [r1], #4
+	cmp		r1, r3
+	blo		start_4
+ALABEL(start_5)
+#endif /* TOPPERS_OMIT_DATA_INIT */
+
+	/*
+	 *  software_init_hookã®å¼åºãï¼0ã§ãªãå ´åï¼
+	 *
+	 *  ã½ããã¦ã§ã¢ç°å¢ï¼ç¹ã«ã©ã¤ãã©ãªï¼ã«ä¾å­ãã¦å¿
+è¦ãªåæåå¦çã
+	 *  ããå ´åã¯ï¼software_init_hookã¨ããé¢æ°ãç¨æããã°ããï¼
+	 */
+	ldr		r0, =software_init_hook
+	cmp		r0, #0
+	movne	lr, pc
+	bxne	r0
+
+	/*
+	 *  ã«ã¼ãã«ã®èµ·å
+	 */
+	b		sta_ker
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/uart_pl011.c
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/uart_pl011.c	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/uart_pl011.c	(revision 302)
@@ -0,0 +1,269 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: uart_pl011.c 362 2015-07-26 11:29:15Z ertl-hiro $
+ */
+
+/*
+ *		ARM PrimCell UARTï¼PL011ï¼ç¨ ç°¡æSIOãã©ã¤ã
+ */
+
+#include <sil.h>
+#include "target_syssvc.h"
+#include "uart_pl011.h"
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãåæåãã­ãã¯ã®å®ç¾©
+ */
+typedef struct sio_port_initialization_block {
+	uintptr_t	base;			/* UARTã¬ã¸ã¹ã¿ã®ãã¼ã¹ã¢ãã¬ã¹ */
+	uint8_t		ibrd;			/* ãã¼ã¬ã¼ãï¼æ´æ°é¨ï¼ã¬ã¸ã¹ã¿ã®è¨­å®å¤ */
+	uint8_t		fbrd;			/* ãã¼ã¬ã¼ãï¼å°æ°é¨ï¼ã¬ã¸ã¹ã¿ã®è¨­å®å¤ */
+	uint8_t		lcr_h;			/* ã©ã¤ã³å¶å¾¡ã¬ã¸ã¹ã¿ã®è¨­å®å¤ */
+} SIOPINIB;
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®å®ç¾©
+ */
+struct sio_port_control_block {
+    const SIOPINIB *siopinib;	/* ã·ãªã¢ã«I/Oãã¼ãåæåãã­ãã¯ */
+    intptr_t	exinf;			/* æ¡å¼µæ
+å ± */
+};
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãåæåãã­ãã¯
+ */
+const SIOPINIB siopinib_table[TNUM_SIOP] = {
+    { SIO_UART_BASE, UART_IBRD_DEF, UART_FBRD_DEF, UART_LCR_H_DEF }
+};
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®ã¨ãªã¢
+ */
+SIOPCB	siopcb_table[TNUM_SIOP];
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãIDããç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_SIOP(siopid)	((uint_t)((siopid) - 1))
+#define get_siopcb(siopid)	(&(siopcb_table[INDEX_SIOP(siopid)]))
+
+/*
+ *  SIOãã©ã¤ãã®åæå
+ */
+void
+uart_pl011_initialize(void)
+{
+	SIOPCB	*p_siopcb;
+	uint_t	i;
+
+	/*
+	 *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®åæå
+	 */
+	for (p_siopcb = siopcb_table, i = 0; i < TNUM_SIOP; p_siopcb++, i++) {
+		p_siopcb->siopinib = &(siopinib_table[i]);
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
+ */
+SIOPCB *
+uart_pl011_opn_por(ID siopid, intptr_t exinf)
+{
+	SIOPCB		*p_siopcb;
+
+	p_siopcb = get_siopcb(siopid);
+
+	/*
+	 *  UARTããã£ã¹ã¨ã¼ãã«
+	 */
+	sil_wrw_mem(UART_CR(p_siopcb->siopinib->base), 0U);
+
+	/*
+	 *  ã¨ã©ã¼ãã©ã°ãã¯ãªã¢
+	 */
+    sil_wrw_mem(UART_ECR(p_siopcb->siopinib->base), 0U);
+
+	/*
+	 *  FIFOãç©ºã«ãã
+	 */
+	while (uart_pl011_getready(p_siopcb->siopinib->base)) {
+		(void) uart_pl011_getchar(p_siopcb->siopinib->base);
+	}
+
+	/*
+	 *  ãã¼ã¬ã¼ãã¨éä¿¡è¦æ ¼ãè¨­å®
+	 */
+	sil_wrw_mem(UART_IBRD(p_siopcb->siopinib->base),
+									p_siopcb->siopinib->ibrd);
+	sil_wrw_mem(UART_FBRD(p_siopcb->siopinib->base),
+									p_siopcb->siopinib->fbrd);
+	sil_wrw_mem(UART_LCR_H(p_siopcb->siopinib->base),
+									p_siopcb->siopinib->lcr_h);
+		
+	/*
+	 *  UARTãã¤ãã¼ãã«
+	 */
+	sil_wrw_mem(UART_CR(p_siopcb->siopinib->base),
+						UART_CR_UARTEN|UART_CR_TXE|UART_CR_RXE);
+    
+	p_siopcb->exinf = exinf;
+	return(p_siopcb);   
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ã¯ã­ã¼ãº
+ */
+void
+uart_pl011_cls_por(SIOPCB *p_siopcb)
+{
+	/*
+	 *  UARTããã£ã¹ã¨ã¼ãã«
+	 */
+	sil_wrw_mem(UART_CR(p_siopcb->siopinib->base), 0U);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã¸ã®æå­éä¿¡
+ */
+bool_t
+uart_pl011_snd_chr(SIOPCB *p_siopcb, char c)
+{
+	if (uart_pl011_putready(p_siopcb->siopinib->base)){
+		uart_pl011_putchar(p_siopcb->siopinib->base, c);
+		return(true);
+	}
+	return(false);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®æå­åä¿¡
+ */
+int_t
+uart_pl011_rcv_chr(SIOPCB *p_siopcb)
+{
+	if (uart_pl011_getready(p_siopcb->siopinib->base)) {
+		return((int_t)(uint8_t) uart_pl011_getchar(p_siopcb->siopinib->base));
+	}
+	return(-1);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®è¨±å¯
+ */
+void
+uart_pl011_ena_cbr(SIOPCB *p_siopcb, uint_t cbrtn)
+{
+	uint32_t	reg;
+
+	reg = sil_rew_mem(UART_IMSC(p_siopcb->siopinib->base));
+	switch (cbrtn) {
+	case SIO_RDY_SND:
+		reg |= UART_IMSC_TXIM;
+		break;
+	case SIO_RDY_RCV:
+		reg |= UART_IMSC_RXIM;
+		break;
+	}
+	sil_wrw_mem(UART_IMSC(p_siopcb->siopinib->base), reg);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®ç¦æ­¢
+ */
+void
+uart_pl011_dis_cbr(SIOPCB *p_siopcb, uint_t cbrtn)
+{
+	uint32_t	reg;
+
+	reg = sil_rew_mem(UART_IMSC(p_siopcb->siopinib->base));
+	switch (cbrtn) {
+	case SIO_RDY_SND:
+		reg &= ~UART_IMSC_TXIM;
+		break;
+	case SIO_RDY_RCV:
+		reg &= ~UART_IMSC_RXIM;
+		break;
+	}
+	sil_wrw_mem(UART_IMSC(p_siopcb->siopinib->base), reg);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã«å¯¾ããå²è¾¼ã¿å¦ç
+ */
+static void
+uart_pl011_isr_siop(SIOPCB *p_siopcb)
+{
+	if (uart_pl011_getready(p_siopcb->siopinib->base)) {
+		/*
+		 *  åä¿¡éç¥ã³ã¼ã«ããã¯ã«ã¼ãã³ãå¼ã³åºãï¼
+		 */
+		uart_pl011_irdy_rcv(p_siopcb->exinf);
+	}
+	if (uart_pl011_putready(p_siopcb->siopinib->base)) {
+		/*
+		 *  éä¿¡å¯è½ã³ã¼ã«ããã¯ã«ã¼ãã³ãå¼ã³åºãï¼
+		 */
+		uart_pl011_irdy_snd(p_siopcb->exinf);
+	}
+}
+
+/*
+ *  SIOã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+ */
+void
+uart_pl011_isr()
+{
+	uart_pl011_isr_siop(&(siopcb_table[0]));
+}
Index: asp3_wo_tecs/trunk/arch/arm_gcc/common/uart_pl011.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/common/uart_pl011.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/common/uart_pl011.h	(revision 302)
@@ -0,0 +1,226 @@
+/*
+ *  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) 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: uart_pl011.h 359 2015-07-26 10:27:20Z ertl-hiro $
+ */
+
+/*
+ *		ARM PrimCell UARTï¼PL011ï¼ç¨ ç°¡æSIOãã©ã¤ã
+ */
+
+#ifndef TOPPERS_UART_PL011_H
+#define TOPPERS_UART_PL011_H
+
+#include <sil.h>
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãæ°ã®å®ç¾©
+ */
+#define TNUM_SIOP		1		/* ãµãã¼ãããã·ãªã¢ã«I/Oãã¼ãã®æ° */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®å®ç¾©
+ */
+typedef struct sio_port_control_block	SIOPCB;
+
+/*
+ *  ã³ã¼ã«ããã¯ã«ã¼ãã³ã®è­å¥çªå·
+ */
+#define SIO_RDY_SND		1U		/* éä¿¡å¯è½ã³ã¼ã«ããã¯ */
+#define SIO_RDY_RCV		2U		/* åä¿¡éç¥ã³ã¼ã«ããã¯ */
+
+/*
+ *  UARTã¬ã¸ã¹ã¿ã®çªå°ã®å®ç¾©
+ */
+#define UART_DR(base)		((uint32_t *)((base) + 0x00U))
+#define UART_RSR(base)		((uint32_t *)((base) + 0x04U))
+#define UART_ECR(base)		((uint32_t *)((base) + 0x04U))
+#define UART_FR(base)		((uint32_t *)((base) + 0x18U))
+#define UART_IBRD(base)		((uint32_t *)((base) + 0x24U))
+#define UART_FBRD(base)		((uint32_t *)((base) + 0x28U))
+#define UART_LCR_H(base)	((uint32_t *)((base) + 0x2cU))
+#define UART_CR(base)		((uint32_t *)((base) + 0x30U))
+#define UART_IFLS(base)		((uint32_t *)((base) + 0x34U))
+#define UART_IMSC(base)		((uint32_t *)((base) + 0x38U))
+#define UART_RIS(base)		((uint32_t *)((base) + 0x3cU))
+#define UART_MIS(base)		((uint32_t *)((base) + 0x40U))
+#define UART_ICR(base)		((uint32_t *)((base) + 0x44U))
+
+/*
+ *  ãã©ã°ã¬ã¸ã¹ã¿ï¼UART_FRï¼ã®åç
+§å¤
+ */
+#define UART_FR_RXFE		UINT_C(0x10)	/* åä¿¡ãããã¡ãç©º */
+#define UART_FR_TXFF		UINT_C(0x20)	/* éä¿¡ãããã¡ããã« */
+
+/*
+ *  ã©ã¤ã³å¶å¾¡ã¬ã¸ã¹ã¿ï¼UART_LCR_Hï¼ã®è¨­å®å¤
+ */
+#define UART_LCR_H_PEN		UINT_C(0x02)	/* ããªãã£ãç¨ãã */
+#define UART_LCR_H_EPS		UINT_C(0x04)	/* å¶æ°ããªãã£ã« */
+#define UART_LCR_H_STP2		UINT_C(0x08)	/* ã¹ããããããã2ãããã« */
+#define UART_LCR_H_FEN		UINT_C(0x10)	/* FIFOãæå¹ã« */
+#define UART_LCR_H_WLEN8	UINT_C(0x60)	/* ãã¼ã¿é·ã8ãããã« */
+
+/*
+ *  å¶å¾¡ã¬ã¸ã¹ã¿ï¼UART_CRï¼ã®è¨­å®å¤
+ */
+#define UART_CR_UARTEN	UINT_C(0x0001)		/* UARTãã¤ãã¼ãã«ã« */
+#define UART_CR_TXE		UINT_C(0x0100)		/* éä¿¡ãã¤ãã¼ãã«ã« */
+#define UART_CR_RXE		UINT_C(0x0200)		/* åä¿¡ãã¤ãã¼ãã«ã« */
+
+/*
+ *  å²è¾¼ã¿ãã¹ã¯ã»ããï¼ã¯ãªã¢ã¬ã¸ã¹ã¿ï¼UART_IMSCï¼ã®è¨­å®å¤
+ */
+#define UART_IMSC_RXIM	UINT_C(0x0010)		/* åä¿¡å²è¾¼ã¿ãã¹ã¯ */
+#define UART_IMSC_TXIM	UINT_C(0x0020)		/* éä¿¡å²è¾¼ã¿ãã¹ã¯ */
+
+/*
+ *  ããªããã£ããªéä¿¡ï¼åä¿¡é¢æ°
+ */
+
+/*
+ *  åä¿¡ãããã¡ã«æå­ããããï¼
+ */
+Inline bool_t
+uart_pl011_getready(uintptr_t base)
+{
+	return((sil_rew_mem(UART_FR(base)) & UART_FR_RXFE) == 0U);
+}
+
+/*
+ *  éä¿¡ãããã¡ã«ç©ºãããããï¼
+ */
+Inline bool_t
+uart_pl011_putready(uintptr_t base)
+{
+	return((sil_rew_mem(UART_FR(base)) & UART_FR_TXFF) == 0U);
+}
+
+/*
+ *  åä¿¡ããæå­ã®ååºã
+ */
+Inline char
+uart_pl011_getchar(uintptr_t base)
+{
+	return((char) sil_rew_mem(UART_DR(base)));
+}
+
+/*
+ *  éä¿¡ããæå­ã®æ¸è¾¼ã¿
+ */
+Inline void
+uart_pl011_putchar(uintptr_t base, char c)
+{
+	sil_wrw_mem(UART_DR(base), (uint32_t) c);
+}
+
+/*
+ *  ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã«æä¾ããæ©è½
+ */
+
+/*
+ *  SIOãã©ã¤ãã®åæåã«ã¼ãã³
+ */
+extern void		uart_pl011_initialize(void);
+
+/*
+ *  SIOã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+ */
+extern void		uart_pl011_isr(void);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
+ */
+extern SIOPCB	*uart_pl011_opn_por(ID siopid, intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ã¯ã­ã¼ãº
+ */
+extern void		uart_pl011_cls_por(SIOPCB *siopcb);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã¸ã®æå­éä¿¡
+ */
+extern bool_t	uart_pl011_snd_chr(SIOPCB *siopcb, char c);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®æå­åä¿¡
+ */
+extern int_t	uart_pl011_rcv_chr(SIOPCB *siopcb);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®è¨±å¯
+ */
+extern void		uart_pl011_ena_cbr(SIOPCB *siopcb, uint_t cbrtn);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®ç¦æ­¢
+ */
+extern void		uart_pl011_dis_cbr(SIOPCB *siopcb, uint_t cbrtn);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®éä¿¡å¯è½ã³ã¼ã«ããã¯
+ */
+extern void		uart_pl011_irdy_snd(intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®åä¿¡éç¥ã³ã¼ã«ããã¯
+ */
+extern void		uart_pl011_irdy_rcv(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_UART_PL011_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/doc/arm_design.txt
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/doc/arm_design.txt	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/doc/arm_design.txt	(revision 302)
@@ -0,0 +1,998 @@
+
+		TOPPERS/ASP3ã«ã¼ãã«
+		ARMã³ã¢ä¾å­é¨ è¨­è¨ã¡ã¢
+
+		å¯¾å¿ãã¼ã¸ã§ã³: Release 3.B.0
+		æçµæ´æ°: 2015å¹´8æ18æ¥
+
+----------------------------------------------------------------------
+
+âç®æ¬¡
+
+ã»ç¥å·
+ã»åèæç®
+ã»ARMã³ã¢ä¾å­é¨ã®ä½ç½®ã¥ã
+	- Thumbå½ä»¤ã®æ±ã
+ã»ã·ã¹ãã ç¶æ
+ã®ç®¡ç
+	- ãã­ã»ããµã¢ã¼ã
+	- ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿
+	- å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®ç®¡ç
+	- ã³ã³ãã­ã¹ãã®ç®¡ç
+	- CPUã­ãã¯ç¶æ
+ã®ç®¡ç
+	- å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®ç®¡ç
+	- å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ç®¡ç
+	- å²è¾¼ã¿ã«é¢ãããã®ä»ã®æä½
+	- CPSRï¼Program Status Registerï¼ã®è¨­å®å¤
+ã»ä¾å¤ï¼å²è¾¼ã¿ãã³ãã©ããã³CPUä¾å¤ãã³ãã©ï¼ã®åºå
+¥å£
+	- ARMv6ããåã®ãã­ã»ããµã®å ´å
+	- ARMv6ä»¥éã®ãã­ã»ããµã®å ´å
+ã»å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦ç
+ã»CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦ç
+	- ã¹ã¿ãã¯ãã¤ã³ã¿ãä¸æ­£ã®å ´åã®å¯¾ç­
+
+âç¥å·
+
+CPSR		Current Program Status Register
+FIQ			Fast Interrupt Request
+GIC			Generic Interrupt Controller
+IRQ			Interrupt Request
+
+âåèæç®
+
+[1] TOPPERSãã­ã¸ã§ã¯ã è¨­è¨ã¡ã¢ãARMã®ã¢ã¼ã­ãã¯ãã£ã«é¢ããã¡ã¢ãï¼
+
+âARMã³ã¢ä¾å­é¨ã®ä½ç½®ã¥ã
+
+ARMã³ã¢ä¾å­é¨ã¯ï¼ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã®ä¸­ã§ï¼ARMv4ï¼ARMv5ï¼ARMv6ï¼
+ARMv7-Aï¼ARMv7-Rã«æºæ ãããã­ã»ããµã³ã¢ãæã¤ã¿ã¼ã²ããã·ã¹ãã ï¼ãã
+ãï¼ã«å
+±éã«ä½¿ç¨ã§ããé¨åã§ããï¼
+
+ARMã³ã¢ã®ãã­ã»ããµã³ã¢ç¥ç§°ã"arm"ã¨ããï¼GNUéçºç°å¢åãã®ARMã³ã¢ä¾å­
+é¨ãç½®ããã£ã¬ã¯ããªã¯arch/arm_gcc/commonã¨ãªãï¼
+
+ARMã®å ´åï¼å²è¾¼ã¿ã³ã³ãã­ã¼ã©ã¯ã³ã¢ã®å¤ã«ãããã¨ããï¼å²è¾¼ã¿ã³ã³ãã­ã¼
+ã©ã«ä¾å­ããé¨åã¯ARMã³ã¢ä¾å­é¨ã«å«ããªããã¨ãååã¨ãããï¼å¤ãã®ãã
+ãã«æ¡ç¨ããã¦ããå²è¾¼ã¿ã³ã³ãã­ã¼ã©ã§ããGICï¼ARM Generic Interrupt
+Controllerï¼ã«ä¾å­ããé¨åï¼GICä¾å­é¨ï¼ã¯ï¼ARMã³ã¢ä¾å­é¨ã®ãã£ã¬ã¯ããª
+ã«ç½®ãã¦ããï¼GICä¾å­é¨ã®è¨­è¨ã«ã¤ãã¦ã¯ï¼ãGICä¾å­é¨ è¨­è¨ã¡ã¢ããåç
+§ã
+ããã¨ï¼
+
+ãªãï¼ARMã³ã¢ä¾å­é¨ã¯ï¼ARMã¢ã¼ã­ãã¯ãã£ã®ãã¼ã¸ã§ã³çªå·ï¼4ã7ã®ããã
+ãï¼ãï¼__TARGET_ARCH_ARMã«ãã¯ã­å®ç¾©ããã¦ãããã®ã¨ãã¦è¨è¿°ãã¦ããï¼
+
+âThumbã¢ã¼ãã®æ±ã
+
+ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã¨ã«ã¼ãã«ã®Cè¨èªã§è¨è¿°ãããé¨åã¯ï¼Thumbã¢ã¼
+ãåãã«ã³ã³ãã¤ã«ãã¦ãåä½ããããã«ããï¼ããã«å¯¾ãã¦ï¼ã«ã¼ãã«ã®ã¢
+ã»ã³ããªè¨èªè¨è¿°ã®é¨åã¯ï¼ARMå½ä»¤ã§è¨è¿°ãï¼Thumbã¢ã¼ãã§å®è¡ãããã¨ã¯
+èããªãï¼
+
+âã·ã¹ãã ç¶æ
+ã®ç®¡ç
+
+âãã­ã»ããµã¢ã¼ã
+
+ASP3ã«ã¼ãã«ã®ARMã³ã¢ä¾å­é¨ã§ã¯ï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã¨ã«ã¼ãã«ã®
+å¤§é¨åãï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã§å®è¡ããï¼ä¾å¤ã®å
+¥å£ã§ããããã®ãã­ã»ã
+ãµã¢ã¼ãã«åãæãããï¼å
+¥å£å¦çã®ä¸­ã§ã¹ã¼ããã¤ã¶ã¢ã¼ãã«æ»ãããï¼ã
+ãã¾ã§ã«ã¼ãã«ã®å
+é¨ã§ä¸æçã«ä»ã®ã¢ã¼ããä½¿ãã«éããªãï¼
+
+å²è¾¼ã¿å¦çã®å®è¡ã«IRQã¢ã¼ããä½¿ããªãã®ã¯ï¼æ¬¡ã®çç±ã§ããï¼IRQã¢ã¼ãã§
+å®è¡ä¸­ã«å²è¾¼ã¿ãçºçããã¨ï¼lrã¬ã¸ã¹ã¿ã«æ»ãçªå°ãæ ¼ç´ãããï¼ãã®ããï¼
+å²è¾¼ã¿å¦çãIRQã¢ã¼ããå®è¡ããã¨ï¼å¤éå²è¾¼ã¿ã«ããlrã¬ã¸ã¹ã¿ã®å
+å®¹ãå¤±
+ãããããï¼å¤éå²è¾¼ã¿ãè¨±å¯ãããã¨ãã§ããªãï¼
+
+ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã¨ã«ã¼ãã«ã®å¤§é¨åã®å®è¡ã«ã·ã¹ãã ã¢ã¼ããä½¿
+ããªãçç±ã¯ï¼ä»¥ä¸ã®éãã§ããï¼
+
+(1) ARMv5ä»¥åã®ãã­ã»ããµã§ã¯ï¼ä¾å¤ããã®å¾©å¸°ãï¼
+
+	ldmfd	sp!, {<å¾©å¸°ãã¹ãã¬ã¸ã¹ã¿ã®ãªã¹ã>, pc}^
+
+ã®å½ä»¤ã§è¡ãï¼ãã®å½ä»¤ã¯ï¼ä¾å¤ã¢ã¼ãã§ã®ã¿ä½¿ç¨ãããã¨ãã§ãï¼ã·ã¹ãã 
+ã¢ã¼ãã§ã¯ä½¿ç¨ã§ããªãï¼ã·ã¹ãã ã¢ã¼ãã«ã¯SPSRããªãããï¼CPSRãå¾©å¸°ã§
+ããªãï¼ï¼ãã®ããï¼å²è¾¼ã¿ãã³ãã©ãCPUä¾å¤ãã³ãã©ãã·ã¹ãã ã¢ã¼ãã§å®
+è¡ããã¨ï¼ä¾å¤ããã®ãªã¿ã¼ã³æã«ï¼ä½è¨ãªãã­ã»ããµã¢ã¼ãåæãã¨ããã«
+ä¼´ãã¹ã¿ãã¯æä½ãå¿
+è¦ã«ãªãï¼å¹çãæªãï¼
+
+ARMv6ä»¥éã®ãã­ã»ããµã§ã¯ï¼ä¾å¤ããã®å¾©å¸°ã®ããã«rfeå½ä»¤ãæã£ã¦ãããï¼
+rfeå½ä»¤ã«ã¯ã·ã¹ãã ã¢ã¼ãã§ã¯ä½¿ç¨ã§ããªãã¨ããå¶ç´ããªãããã«ï¼ãã®ã
+ã¨ã¯å½ã¦ã¯ã¾ããªãï¼
+
+(2) ä¿è­·æ©è½å¯¾å¿ã«ã¼ãã«ã«ããã¦ã¯ï¼ä¾å¤ã®å
+¥å£ã§ï¼ã¦ã¼ã¶ã¹ã¿ãã¯ããã·
+ã¹ãã ã¹ã¿ãã¯ã«åãæããå¦çãå¿
+è¦ã§ãããï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©
+ã ã®éç¹æ¨©ã¢ã¼ãã§å®è¡ãã¹ãé¨åãã¦ã¼ã¶ã¢ã¼ãã§ï¼ã¢ããªã±ã¼ã·ã§ã³ãã­
+ã°ã©ã ã®ç¹æ¨©ã¢ã¼ãã§å®è¡ãã¹ãé¨åã¨ã«ã¼ãã«ã®å¤§é¨åãã¹ã¼ããã¤ã¶ã¢ã¼
+ããå®è¡ããã°ï¼ã¹ã¿ãã¯ã®åæãããã¼ãã¦ã§ã¢ã§è¡ããï¼å¹ççã§ããï¼
+
+éã«ï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã¨ã«ã¼ãã«ã®å¤§é¨åãã·ã¹ãã ã¢ã¼ãã§å®
+è¡ããã¡ãªããã¨ãã¦ï¼ä»¥ä¸ãæãããã¨ãã§ããï¼
+
+ã»ã¹ã¼ããã¤ã¶ã¢ã¼ãã§å®è¡ä¸­ã«svcå½ä»¤ãçºè¡ããã¨ï¼lrã¬ã¸ã¹ã¿ã«æ»ãçªå°
+ããæ ¼ç´ãããï¼lrãå£ããæ³å®ã§svcå½ä»¤ãå¼ã³åºãã°ãããï¼ãã­ã°ã©ã ã«
+ãããããå½ã¦ãç®çã§svcå½ä»¤ãä½¿ãå ´åãªã©ï¼lrãä¿å­ï¼å¾©å¸°ããä½å°ããª
+ããå ´åã«ã¯ï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã§å®è¡ãã¦ããã¨ãã¾ãå®è£
+ã§ããªãï¼
+
+ä¿è­·æ©è½å¯¾å¿ã§ãªãASP3ã«ã¼ãã«ã§ï¼ARMv6ä»¥éã®ãã­ã»ããµãä½¿ç¨ããå ´åã«
+ã¯ï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã¨ã«ã¼ãã«ã®å¤§é¨åãã·ã¹ãã ã¢ã¼ãã§å®è¡
+ããããã«ä¿®æ­£ããã®ã¯å®¹æã§ããï¼å
+·ä½çã«ã¯ï¼core_support.Sã¨start.Så
+
+ã®ç´20ç®æç¨åº¦ã®CPSR_SVC_MODEãï¼CPSR_SYS_MODEã«æ¸ãæããã°ããï¼
+
+âã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿
+
+ARMã³ã¢ä¾å­é¨ã®æ¨æºã§ã¯ï¼IRQãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ï¼FIQãã«ã¼ãã«ç®¡çå¤
+ã®å²è¾¼ã¿ã¨æ±ãï¼ãã®ããã«ããã®ãï¼æãã·ã³ãã«ã§æ§è½ãè¯ãããã§ããï¼
+
+ãã ãï¼SafeGã®ã»ã­ã¥ã¢ã¢ã¼ãã§ASP3ã«ã¼ãã«ãåä½ãããå ´åã«ã¯ï¼FIQã
+ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ã¨ãã¦æ±ãï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã¯ãµãã¼ãããªãï¼
+IRQã¯ï¼ãã³ã»ã­ã¥ã¢ã¢ã¼ãã§åä½ããOSãä½¿ç¨ããï¼ãã®è¨­å®ã«ããå ´åã«ã¯ï¼
+TOPPERS_SAFEG_SECUREããã¯ã­å®ç¾©ããï¼
+
+âå
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®ç®¡ç
+
+å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§ã¯ï¼FIQã»IRQã¨ããã¹ã¯ããï¼å
+·å¤çã«ã¯ï¼CPSRä¸­ã®Fãã
+ãï¼FIQç¦æ­¢ï¼ã¨Iãããï¼IRQç¦æ­¢ï¼ãã»ããããï¼
+
+âã³ã³ãã­ã¹ãã®ç®¡ç
+
+å®è¡ä¸­ã®ã³ã³ãã­ã¹ãããã­ã»ããµã¢ã¼ãã§å¤æ­ãããã¨ãã§ããªãããï¼ä¾
+å¤ï¼å²è¾¼ã¿ãã³ãã©ããã³CPUä¾å¤ãã³ãã©ï¼ã®ãã¹ãæ®µæ°ãå¤æ°ï¼ãããï¼ä¾
+å¤ãã¹ãã«ã¦ã³ãã¨å¼ã¶ï¼ã§ç®¡çãï¼ä¾å¤ãã¹ãã«ã¦ã³ãã0ã®æã«ã¿ã¹ã¯ã³ã³
+ãã­ã¹ãï¼0ããå¤§ããå ´åã«éã¿ã¹ã¯ã³ã³ãã­ã¹ãã§ããã¨å¤æ­ããï¼
+
+âCPUã­ãã¯ç¶æ
+ã®ç®¡ç
+
+CPUã­ãã¯ç¶æ
+ã§ã¯ï¼IRQããã¹ã¯ããï¼å
+·å¤çã«ã¯ï¼CPSRä¸­ã®Iãããï¼IRQç¦
+æ­¢ï¼ãã»ããããï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨CPUã­ãã¯ç¶æ
+ãåºå¥ã§ããå¿
+è¦ã¯ãª
+ããã¨ããï¼CPSRä¸­ã®Iããããç«ã£ã¦ããã°ï¼CPUã­ãã¯ç¶æ
+ã§ããã¨å¤æ­ã
+ãï¼
+
+TOPPERS_SAFEG_SECUREããã¯ã­å®ç¾©ããã¦ããå ´åã«ã¯ï¼CPUã­ãã¯ç¶æ
+ã§ã¯ï¼
+FIQããã¹ã¯ããï¼IRQã¯å¸¸ã«ãã¹ã¯ããããï¼FIQã»IRQã¨ããã¹ã¯ãããã¨ã«
+ãªãï¼CPSRä¸­ã®Fããããç«ã£ã¦ããã°ï¼CPUã­ãã¯ç¶æ
+ã§ããã¨å¤æ­ããï¼
+
+âå²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®ç®¡ç
+
+å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®ç®¡çã¯ï¼å²è¾¼ã¿ã³ã³ãã­ã¼ã©ã«ãã£ã¦è¡ãï¼ãã®ããï¼
+ARMä¾å­é¨ã«ã¯å«ããªãï¼
+
+GICã®å ´åã«ã¯ï¼GICC_PMRï¼Interrupt Priority Mask Registerï¼ã«ããï¼å²è¾¼
+ã¿åªå
+åº¦ãã¹ã¯ãç®¡çããï¼
+
+âå²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ç®¡ç
+
+å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ç®¡çã¯ï¼å²è¾¼ã¿ã³ã³ãã­ã¼ã©ã«ãã£ã¦è¡ãï¼ãã®ããï¼
+ARMä¾å­é¨ã«ã¯å«ããªãï¼
+
+GICã®å ´åã«ã¯ï¼GICD_ISENABLEnï¼Interrupt Set-Enable Registersï¼ã¨
+GICD_ICENABLERnï¼Interrupt Clear-Enable Registersï¼ã«ãã£ã¦ï¼ã»ããï¼ã¯
+ãªã¢ããï¼
+
+âå²è¾¼ã¿ã«é¢ãããã®ä»ã®æä½
+
+å²è¾¼ã¿ã«é¢ãããã®ä»ã®æä½ã¯ï¼å²è¾¼ã¿ã³ã³ãã­ã¼ã©ã«ãã£ã¦å®ç¾ããï¼ãã®
+ããï¼ARMä¾å­é¨ã«ã¯å«ããªãï¼
+
+GICã®å ´åã«ã¯ï¼å²è¾¼ã¿è¦æ±ã®ã¯ãªã¢ã¨ãã­ã¼ãã¯ï¼GICD_ICPENDRnï¼Interrupt
+Clear-Pending Registersï¼ã¨GICD_ISPENDRnï¼Interrupt Set-Pending
+Registersï¼ã«ãã£ã¦å®ç¾ããï¼
+
+âCPSRï¼Program Status Registerï¼ã®è¨­å®å¤
+
+CPUã­ãã¯ã»å
+¨å²è¾¼ã¿ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯ç¶æ
+ï¼å
+¨å²è¾¼ã­ãã¯ç¶æ
+ã¨ã
+ãCPSRã®è¨­å®å¤ãï¼ä»¥ä¸ã®ããã«å®ç¾©ãã¦ããï¼
+
+#define CPSR_UNLOCK			UINT_C(0x00)
+#define CPSR_CPULOCK		CPSR_IRQ_BIT
+#define CPSR_INTLOCK		CPSR_FIQ_IRQ_BIT
+
+TOPPERS_SAFEG_SECUREããã¯ã­å®ç¾©ããã¦ããå ´åã«ã¯ï¼ä»¥ä¸ã®ããã«å®ç¾©ã
+ãï¼
+
+#define CPSR_UNLOCK			CPSR_IRQ_BIT
+#define CPSR_CPULOCK		CPSR_FIQ_IRQ_BIT
+#define CPSR_INTLOCK		CPSR_FIQ_IRQ_BIT
+
+ããã§ï¼CPSR_IRQ_BITã¨CPSR_FIQ_BITã¯ï¼ããããIRQã¨FIQããã¹ã¯ããå ´å
+ã®CPSRã®å¤ï¼CPSR_FIQ_IRQ_BITã¯ï¼FIQã»IRQã¨ããã¹ã¯ããå ´åã®CPSRã®å¤ã§
+ããï¼ä»¥ä¸ã®ããã«å®ç¾©ãã¦ããï¼
+
+#define CPSR_IRQ_BIT		UINT_C(0x80)
+#define CPSR_FIQ_BIT		UINT_C(0x40)
+#define CPSR_FIQ_IRQ_BIT	(CPSR_FIQ_BIT|CPSR_IRQ_BIT)
+
+âä¾å¤ï¼å²è¾¼ã¿ãã³ãã©ããã³CPUä¾å¤ãã³ãã©ï¼ã®åºå
+¥å£
+
+SRSå½ä»¤ã¨RFEå½ä»¤ãæã¤ARMv6ä»¥éã¨ï¼ããããåã®ãã­ã»ããµã§ã¯ï¼ä¾å¤ã®åº
+å
+¥å£ï¼å²è¾¼ã¿ãã³ãã©ããã³CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦çã®æåã¨æå¾ã®é¨åï¼
+ã®æé©ãªã³ã¼ããç°ãªãï¼
+
+âARMv6ããåã®ãã­ã»ããµã®å ´å
+
+ã¢ã¼ã­ãã¯ãã£ã®æ³å®ã§ã¯ï¼ä¾å¤ããã®å¾©å¸°ãï¼
+
+	ldmfd	sp!, {<å¾©å¸°ãã¹ãã¬ã¸ã¹ã¿ã®ãªã¹ã>, pc}^
+
+ã®å½ä»¤ã§è¡ãï¼ãã®æç¹ã§ï¼æ»ãçªå°ãã¹ã¿ãã¯ã®æå¾ï¼æãå¤§ããçªå°ï¼ã«
+ä¿å­ããã¦ããï¼æ»ãå
+ã®CPSRããã®ã¢ã¼ãã®SPSRã«ç½®ããã¦ãããã¨ãå¿
+è¦
+ã§ããï¼
+
+ä¾å¤ã®åºå
+¥å£å¦çã§ï¼ãã¹ã¦ã®ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãä¿å­ï¼å¾©å¸°ãããã¨ã«ã
+ãã¨ï¼ä¸ã®å½ä»¤ã®<å¾©å¸°ãã¹ãã¬ã¸ã¹ã¿ã®ãªã¹ã>ã«ã¯ï¼ãã¹ã¦ã®ã¹ã¯ã©ããã¬
+ã¸ã¹ã¿ã®ãªã¹ããè¨è¿°ããï¼ã¾ãï¼ä¾å¤ããã®ãªã¿ã¼ã³ã§ã¢ã¼ããå¤ãããªã
+ï¼ã©ã¡ããã¹ã¼ããã¤ã¶ã¢ã¼ãã§ããï¼ããï¼å¾©å¸°ããã¬ã¸ã¹ã¿ã«ï¼lrãå ã
+ã¦ãããã¨ãå¿
+è¦ã§ããï¼
+
+å
+·ä½çã«ã¯ï¼ä¾å¤ã®åºå£ã¯ï¼æ¬¡ã®ãããªã³ã¼ãã¨ãªãï¼
+
+----------------------------------------
+	/*
+	 *  ãã®æç¹ã§ã¯ã¹ã¼ããã¤ã¶ã¢ã¼ãã«ãªã£ã¦ããï¼
+	 */
+	ldmfd	sp!, {r0}					/* æ»ãå
+ã®cpsrãspsrã«å¾©å¸° */
+	msr		spsr_cxsf, r0
+	ldmfd	sp!, {r0-r4,r12,lr,pc}^		/* ä¾å¤å¦çããã®å¾©å¸° */
+----------------------------------------
+
+ããã§ï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ã«å ãã¦r4ãå¾©å¸°ãã¦ããã®ã¯ï¼ä¾å¤ã®åºå
+¥å£å¦
+çã§ã¹ã¯ã©ããã¬ã¸ã¹ã¿ä»¥å¤ã«ä½¿ããã¬ã¸ã¹ã¿ã¨ãã¦ï¼r4ãç¢ºä¿ããããã§ã
+ãï¼
+
+ãã®åºå£ãå®è¡ããæç¹ã§ï¼ã¹ã¿ãã¯ã¯æ¬¡ã®ããã«ãªã£ã¦ããå¿
+è¦ãããï¼ã¬
+ã¸ã¹ã¿ã¯ããããCPUä¾å¤çºçæã®å¤ãç¤ºãï¼ä¾ãã°ï¼CPSRã¯CPUä¾å¤çºçæã®
+CPSRãç¤ºãï¼ï¼
+
+	+----------------+ <- sp
+	|      cpsr      |
+	+----------------+ <- sp+0x04
+	|       r0       |
+	+----------------+ <- sp+0x08
+	|       r1       |
+	+----------------+ <- sp+0x0c
+	|       r2       |
+	+----------------+ <- sp+0x10
+	|       r3       |
+	+----------------+ <- sp+0x14
+	|       r4       |
+	+----------------+ <- sp+0x18
+	|       r12      |
+	+----------------+ <- sp+0x1c
+	|       lr       |
+	+----------------+ <- sp+0x20
+	|    æ»ãçªå°    |
+	+----------------+
+
+ããã«å¯¾å¿ããä¾å¤ã®å
+¥å£ã¯ï¼æ¬¡ã®ã³ã¼ãã¨ãªãï¼IRQã®å ´åï¼ï¼
+
+----------------------------------------
+	/* 
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_IRQ_BIT)
+	stmfd	sp!, {r0-r4,r12,lr,pc}		/* pcã¯ã¹ãã¼ã¹ç¢ºä¿ã®ãã */	(*1)
+
+	/*
+	 *  IRQã¢ã¼ãã«æ»ãã¦ï¼æ»ãçªå°ã¨spsrï¼æ»ãå
+ã®cpsrï¼ãåå¾ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_IRQ_MODE AOR CPSR_IRQ_BIT)
+	sub		r2, lr, #4
+	mrs		r1, spsr
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼æ»ãçªå°ã¨spsrãä¿å­ããï¼
+	 */
+	msr		cpsr_c, #(CPSR_SVC_MODE AOR CPSR_IRQ_BIT)
+	str		r2, [sp,#0x1c]			/* æ»ãçªå°ãã¹ã¿ãã¯ã«ä¿å­ */		(*2)
+	push	{r1}					/* spsrãã¹ã¿ãã¯ã«ä¿å­ */
+----------------------------------------
+
+(*1)ã§pcãä¿å­ããã®ã¯ï¼æ»ãçªå°ãä¿å­ãã¹ãã¹ãã¼ã¹ãç¢ºä¿ããããã§ã
+ãï¼ãã®æç¹ã§ä¿å­ããpcã®å¤ã¯ä½¿ããªãï¼(*2)ã§ï¼ç¢ºä¿ããã¹ãã¼ã¹ã«æ»ã
+çªå°ãæ ¼ç´ããï¼æ ¼ç´å
+ã[sp,#0x1c]ã¨ããã®ã¯ï¼ãã®æç¹ã§ã¯spã¯ä¸ã®å³ã®
+ï¼sp+0x04ï¼ãæãã¦ããï¼æ»ãçªå°ã¯ï¼sp+0x20ï¼ã«æ ¼ç´ãããããã§ããï¼
+
+ä¾å¤ãåãä»ããã¨Iããããã»ããããããï¼ä¾å¤ã®å
+¥å£ãå®è¡ãããæç¹ã§ï¼
+CPSRã®Iãããã¯ã»ããããã¦ããï¼IRQã®å ´åï¼IRQãåãä»ããããã¨ããã
+ã¨ã¯ï¼åä»åã®æç¹ã§ã¯Iãããã¯ã¯ãªã¢ããã¦ããã¯ãã§ããããï¼Fããã
+ã¯ã¯ãªã¢ããã¦ããï¼Iããããã»ããããã¦ããï¼Fããããã¯ãªã¢ããã¦ã
+ãç¶æ³ã¯ä½ããªãããï¼ï¼ãã£ã¦ï¼ä¸è¨ã®ã³ã¼ãã§ï¼Iãããã¨Fãããã¯å¤å
+ããªãï¼
+
+IRQä»¥å¤ã®ä¾å¤ï¼CPUä¾å¤ãã³ãã©ï¼ã®åºå
+¥å£ã«ããã¦ã¯ï¼ä¸è¨ã®ã³ã¼ãã«å¯¾ã
+ã¦ï¼æ¬¡ã®ä¿®æ­£ãå ããï¼
+
+ã»Iãããã ãã§ã¯ãªãï¼Fããããã»ããããï¼å
+·ä½çã«ã¯ï¼3ç®æã«ãã
+ãCPSR_IRQ_BITãï¼CPSR_FIQ_IRQ_BITã«ç½®ãæããï¼
+
+ã»æ»ãçªå°ãåå¾ããæã«ï¼lrãã4ãæ¸ç®ããªãï¼å®éã«æ»ãã¹ãçªå°ã«ãªã£
+ãã¦ããã¨ã¯éããªãï¼ï¼
+
+ã»æ»ãçªå°ã¨spsrãåå¾ããæã«ï¼IRQã¢ã¼ãã§ã¯ãªãï¼ãã®CPUä¾å¤ã§é·ç§»ã
+ããã¢ã¼ãã«æ»ãï¼ã¹ã¼ããã¤ã¶ã³ã¼ã«ã®å ´åã¯ï¼æ»ãå¿
+è¦ããªãï¼ï¼
+
+Iãããã ãã§ãªãFããããã»ããããã®ã¯ï¼(1) FIQãåãä»ããã¨Fããã
+ãã»ãããããï¼(2) ãã®ä»ã®ä¾å¤ã¯Fããããã»ããããã¦ããç¶æ
+ã§ãåã
+ä»ããããï¼ã®2ã¤ã®çç±ããã§ããï¼ãã ãï¼Fããããã¯ãªã¢ããã¦ããæ
+ã«çºçããï¼FIQä»¥å¤ã®ï¼ä¾å¤ã§ã¯ï¼ãã®å¦çã«ããFããããã»ãããããã
+ã¨ã«ãªãï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ããã¹ã¯ãããæéãé·ããªããï¼CPUä¾å¤
+ãã³ãã©ãå¼ã³åºãã¾ã§ã®ç­æéãªã®ã§ï¼è¨±å®¹ãããã¨ã«ããï¼
+
+3ã¤ãã®å¦çï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãã¨ï¼æ»ãçªå°ã¨spsrã®ä¿å­ï¼ã¯ï¼
+ï¼IRQä»¥å¤ã®ï¼ãã¹ã¦ã®ä¾å¤ã§å
+±éã§ããããï¼exc_handler_1ã®å
+é ­ã§å®æ½ã
+ããã¨ãã§ãããï¼ARMv6ä»¥éã®ãã­ã»ããµã®å ´åã¨ã®å
+±éåã®ããã«ï¼ä¾å¤æ¯
+ã«åå¥ã«å®æ½ããï¼
+
+âARMv6ä»¥éã®ãã­ã»ããµã®å ´å
+
+ä¾å¤ããã®å¾©å¸°ã«rfeå½ä»¤ãç¨ããã¨ï¼ä¾å¤ã®åºå£ã¯ï¼æ¬¡ã®ãããªã³ã¼ãã¨ãªãï¼
+
+----------------------------------------
+	ldmfd	sp!, {r0-r4,r12,lr}
+	rfefd	sp!
+----------------------------------------
+
+ããã§ï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ã«å ãã¦r4ãå¾©å¸°ãã¦ããã®ã¯ï¼ä¾å¤ã®åºå
+¥å£å¦
+çã§ã¹ã¯ã©ããã¬ã¸ã¹ã¿ä»¥å¤ã«ä½¿ããã¬ã¸ã¹ã¿ã¨ãã¦ï¼r4ãç¢ºä¿ããããã§ã
+ãï¼
+
+ãã®åºå£ãå®è¡ããæç¹ã§ï¼ã¹ã¿ãã¯ã¯æ¬¡ã®ããã«ãªã£ã¦ããå¿
+è¦ãããï¼ã¬
+ã¸ã¹ã¿ã¯ããããCPUä¾å¤çºçæã®å¤ãç¤ºãï¼ä¾ãã°ï¼CPSRã¯CPUä¾å¤çºçæã®
+CPSRãç¤ºãï¼ï¼
+
+	+----------------+ <- sp
+	|       r0       |
+	+----------------+ <- sp+0x04
+	|       r1       |
+	+----------------+ <- sp+0x08
+	|       r2       |
+	+----------------+ <- sp+0x0c
+	|       r3       |
+	+----------------+ <- sp+0x10
+	|       r4       |
+	+----------------+ <- sp+0x14
+	|       r12      |
+	+----------------+ <- sp+0x18
+	|       lr       |
+	+----------------+ <- sp+0x1c
+	|    æ»ãçªå°    |
+	+----------------+ <- sp+0x20
+	|      cpsr      |
+	+----------------+
+
+ããã«å¯¾å¿ããä¾å¤ã®å
+¥å£ã¯ï¼æ¬¡ã®ãããªã³ã¼ãã¨ãªãï¼IRQã®å ´åï¼ï¼
+
+----------------------------------------
+	/* 
+	 *  æ»ãå
+ï¼lrï¼ã¨spsrï¼cpsr_svcï¼ãã¹ã¼ããã¤ã¶ã¢ã¼ãã®ã¹ã¿ãã¯ã«
+	 *  ä¿å­ããï¼
+	 */
+	sub		lr, lr, #4				/* æ»ãçªå°ã®ç®åº */
+	srsfd	#CPSR_SVC_MODE!
+
+	/*
+	 *  ã¹ã¼ããã¤ã¶ã¢ã¼ãã«åãæãï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãä¿å­ããï¼
+	 */
+	cps		#CPSR_SVC_MODE
+	stmfd	sp!, {r0-r4,r12,lr}
+----------------------------------------
+
+IRQä»¥å¤ã®ä¾å¤ï¼CPUä¾å¤ãã³ãã©ï¼ã®åºå
+¥å£ã«ããã¦ã¯ï¼ä¸è¨ã®ã³ã¼ãã«å¯¾ã
+ã¦ï¼æ¬¡ã®ä¿®æ­£ãå ããï¼
+
+ã»æ»ãçªå°ã®ç®åºã®ããã«lrãã4ãæ¸ç®ããªãï¼å®éã«æ»ãã¹ãçªå°ã«ãªã£ã¦
+ãããã¨ã¯éããªãï¼ï¼
+
+å¾åã®å¦çï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã¸ã®åæãã¨ã¹ã¯ã©ããã¬ã¸ã¹ã¿ã®ä¿å­ï¼ã¯
+å
+±éã ãï¼ãã®ç´å¾ã§CPUä¾å¤ãã³ãã©çªå·ãæ ¼ç´ããããã«r4ãä½¿ãããï¼
+exc_handler_1ã®æ¹ã¸ç§»åã§ããªãï¼
+
+âå²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦ç
+
+ASP3ã«ã¼ãã« ãã¼ãã£ã³ã°ã¬ã¤ãã«å¾ã£ã¦ï¼å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦çã®å®
+è£
+æ¹æ³ãæ¤è¨ãã¦ããï¼
+
+----------------------------------------
+void
+<å²è¾¼ã¿ã®åºå
+¥å£å¦ç>(void)
+{
+	å°ãªãã¨ãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããç¶æ
+ã«ãã â¦ (*d)
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ãã
+----------------------------------------
+
+ARMã³ã¢ã¯ï¼ä¾å¤ãåãä»ããã¨ï¼CPSRä¸­ã®Iããããã»ãããã¦å²è¾¼ã¿ãç¦æ­¢
+ããããï¼(*d)ã®å¦çã¯å¿
+è¦ãªãï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ã®ä¿å­ã¯ï¼ä¾å¤ã®å
+¥å£
+ã§å®è£
+æ¸ã¿ã§ããï¼
+
+----------------------------------------
+	if (å²è¾¼ã¿ãã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç) {
+----------------------------------------
+
+ã¾ãï¼ä¾å¤ãã¹ãã«ã¦ã³ããã¤ã³ã¯ãªã¡ã³ãããï¼ã¤ã³ã¯ãªã¡ã³ãå¾ã®å¤ã1ã§
+ãªãå ´åã«ã¯ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãã§ã®å²è¾¼ã¿çºçã§ããããï¼ãã®å¾ã®{}
+å
+ã®å¦çãã¹ã­ããããï¼irq_handler_1ã«åå²ï¼ï¼
+
+----------------------------------------
+#ifdef TOPPERS_SUPPORT_OVRHDR
+		ovrtimer_stop();				/* ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+		ã¹ã¿ãã¯ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãï¼
+								éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã
+	}
+----------------------------------------
+
+ã¹ã¿ãã¯ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãï¼åãæãåã®ã¹ã¿ã
+ã¯ãã¤ã³ã¿ãåãæãå¾ã®ã¹ã¿ãã¯ä¸ã«ä¿å­ããï¼ãããã®å¦çã®å¾ã«ï¼
+irq_handler_1ã©ãã«ãç½®ãï¼
+
+----------------------------------------
+	å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãï¼åãä»ããå²è¾¼ã¿ã®å²è¾¼ã¿åªå
+åº¦ã«è¨­å®ãã
+
+	CPUã­ãã¯è§£é¤ç¶æ
+ã«ããï¼åãä»ããå²è¾¼ã¿ãããåªå
+åº¦ã®é«ãå²è¾¼ã¿ã
+												åãä»ããããã«ããï¼
+
+	å²è¾¼ã¿ãã³ãã©ã®å
+¥å£ã§å¿
+è¦ãªIRCã®æä½ãè¡ãï¼å²è¾¼ã¿è¦æ±ã©ã¤ã³ãã¨ã
+				ã¸ããªã¬ã§ããå ´åã®ããªã¬ãããå²è¾¼ã¿è¦æ±ã®ã¯ãªã¢ãªã©ï¼
+----------------------------------------
+
+å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®ç®¡çã¯ï¼ãããä¾å­ã®å²è¾¼ã¿ã³ã³ãã­ã¼ã©ã«ãã£ã¦è¡ã
+å¿
+è¦ãããããï¼ä¸è¨ã®å¦çã®é åºãä¸é¨å¤æ´ãï¼ä¸è¨ã®å¦çã®ä¸­ã§ãCPUã­ã
+ã¯è§£é¤ç¶æ
+ã«ãããä»¥å¤ã®å¦çã¯ï¼ãããä¾å­é¨ã®irc_begin_intã§è¡ããã¨ã¨
+ããï¼ããªãã¡ï¼irc_begin_intã¯ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãåãä»ããå²è¾¼ã¿è¦
+æ±ã®å²è¾¼ã¿åªå
+åº¦ã«è¨­å®ãï¼å²è¾¼ã¿ãã³ãã©ã®å
+¥å£ã§å¿
+è¦ãªIRCã®æä½ãè¡ãï¼
+ã¾ãirc_begin_intã¯ï¼å²è¾¼ã¿çªå·ï¼0ããå§ã¾ãçªå·ã§ï¼å²è¾¼ã¿ãã³ãã©çªå·
+ã¨ä¸è´ãããï¼ãè¿ãããã«ããï¼ã¹ããªã¢ã¹å²è¾¼ã¿ã®å ´åã«ã¯ï¼
+irc_begin_intã¯å²è¾¼ã¿çªå·ã®æå¤§å¤ããå¤§ããå¤ãè¿ããã®ã¨ãï¼ãã®å ´åã«
+ã¯ï¼å²è¾¼ã¿ãã³ãã©ã®å¼åºãå¦çãã¹ã­ããããï¼irq_handler_2ã«åå²ï¼ï¼
+
+ãã®å¾ï¼irc_begin_intã§è¡ããªãã£ããCPUã­ãã¯è§£é¤ç¶æ
+ã«ãããå¦çãè¡
+ãï¼å
+·ä½çã«ã¯ï¼CPSRä¸­ã®Fãããã¨Iãããï¼ãã ãï¼TOPPERS_SAFEG_SECURE
+ã®å ´åã¯ï¼Fãããã®ã¿ï¼ãã¯ãªã¢ãã¦ï¼å²è¾¼ã¿ãè¨±å¯ããï¼
+
+----------------------------------------
+#ifdef LOG_INH_ENTER
+	log_inh_enter(å²è¾¼ã¿ãã³ãã©çªå·);
+#endif /* LOG_INH_ENTER */
+	å²è¾¼ã¿ãã³ãã©ãå¼ã³åºã
+#ifdef LOG_INH_LEAVE
+	log_inh_leave(å²è¾¼ã¿ãã³ãã©çªå·);
+#endif /* LOG_INH_LEAVE */
+----------------------------------------
+
+å²è¾¼ã¿ãã³ãã©ãã¼ãã«ï¼inh_tableï¼ããå²è¾¼ã¿ãã³ãã©ã®çªå°ãåãåºãã¦
+å¼ã³åºãï¼
+
+----------------------------------------
+	å²è¾¼ã¿ãã³ãã©ã®åºå£ã§å¿
+è¦ãªIRCã®æä½ãè¡ãï¼IRCã«å¯¾ããå²è¾¼ã¿å¦ç
+														ã®çµäºéç¥ãªã©ï¼
+
+	å°ãªãã¨ãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããç¶æ
+ã«ãã
+
+	å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãï¼å²è¾¼ã¿ãåãä»ããåã®å¤ã«æ»ã â¦ (*e)
+----------------------------------------
+
+å²è¾¼ã¿ãã³ãã©ã®å¼åºãåã®å¦çã®é åºãä¸é¨å¤æ´ããã®ã«å¯¾å¿ãã¦ï¼ã¾ãï¼
+ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããï¼å
+·ä½çã«ã¯ï¼CPSRä¸­ã®Iãããï¼ãã ãï¼
+TOPPERS_SAFEG_SECUREã®å ´åã¯ï¼Fããããï¼ãã»ããããï¼ãã®å¦çã®å¾ã«ï¼
+irq_handler_2ã©ãã«ãç½®ãï¼
+
+æ¬¡ã«ï¼ãããä¾å­é¨ã®irc_end_intãå¼ã³åºãï¼irc_end_intã§ã¯ï¼å²è¾¼ã¿ãã³
+ãã©ã®åºå£ã§å¿
+è¦ãªIRCã®æä½ãè¡ãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå²è¾¼ã¿å¦çåã®ç¶
+æ
+ã«æ»ãï¼
+
+ã³ã¢ä¾å­é¨ããã¯ï¼irc_end_intã«ãã©ã¡ã¼ã¿ãæ¸¡ããªãããï¼irc_end_intã®
+ä¸­ã§å¿
+è¦ãªæ
+å ±ï¼ä¾ãã°ï¼å²è¾¼ã¿çªå·ï¼ã¯ï¼irc_begin_intã§ã¹ã¿ãã¯ä¸ã«ä¿å­
+ãã¦ããå¿
+è¦ãããï¼ãããå¯è½ã«ããããã«ï¼irc_begin_intãå¼ã³åºããã
+ãï¼irc_end_intãå¿
+ãå¼ã³åºãããããã«ãã¦ããï¼ã¹ããªã¢ã¹å²è¾¼ã¿ã®å ´å
+ã«ãï¼irc_end_intãå¼ã³åºãããã«ãã¦ããï¼
+
+ãµãã«ã¼ãã³ï¼irc_begin_intï¼ã®ä¸­ã§ã¹ã¿ãã¯ã«ç©ã¿å¢ãã®ã¯ï¼ä¸è¬ã«ã¯æ¡ç¨
+ããªããã­ã°ã©ãã³ã°ææ³ã§ãããï¼irc_begin_intããirc_end_intã«æ¸¡ãæ
+
+å ±ã¯ï¼ãããä¾å­é¨ã«ãã£ã¦ç°ãªããã¨ï¼ARMã§ã¯æ»ãçªå°ãlrã«ä¿å­ãããã
+ã¹ã¿ãã¯ã«ç©ã¿å¢ãã®ãå®¹æã§ãããã¨ããï¼ãã®æ¹æ³ãæ¡ç¨ãããã¨ã«ããï¼
+
+----------------------------------------
+  ret_int:
+	if (å²è¾¼ã¿ãã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç) {
+----------------------------------------
+
+ã¾ãï¼ä¾å¤ãã¹ãã«ã¦ã³ãããã¯ãªã¡ã³ãããï¼ãã¯ãªã¡ã³ãå¾ã®å¤ã0ã§ãªã
+å ´åã«ã¯ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãã§ã®å²è¾¼ã¿çºçã§ããããï¼{}å
+ã®å¦çãã¹
+ã­ããããï¼irq_handler_3ã«åå²ï¼ï¼
+
+----------------------------------------
+		ã¹ã¿ãã¯ãã¿ã¹ã¯ç¨ã®ã¹ã¿ãã¯ã«æ»ãï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã
+																â¦ (*f)
+----------------------------------------
+
+ã¿ã¹ã¯ã³ã³ãã­ã¹ãã®ã¹ã¿ãã¯ãã¤ã³ã¿ã¯ï¼ãã®æç¹ã§ï¼ã¹ã¿ãã¯ã®å
+é ­ã«ä¿
+å­ããã¦ããããï¼ã¹ã¿ãã¯ã®å
+é ­ãåãåºãã¦ï¼ã¹ã¿ãã¯ãã¤ã³ã¿ã«è¨­å®ã
+ãï¼
+
+----------------------------------------
+		if (p_runtsk != p_schedtsk) {
+----------------------------------------
+
+ãã®å¦çã®åã«ï¼ret_int_1ã©ãã«ãç½®ãï¼p_runtskã¨p_schedtskãä¸è´ããªã
+æã¯ï¼irq_handler_4ã¸åå²ããï¼
+
+----------------------------------------
+			CPUã­ãã¯ç¶æ
+ã«ãã â¦ (*g)
+			å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¯ï¼å
+¨è§£é¤ç¶æ
+ï¼TIPM_ENAALLï¼ã«ãªã£ã¦
+												ããªããã°ãªããªã â¦ (*h)
+----------------------------------------
+
+(*g)ã®å¦çã¯ï¼irc_end_intãå¼ã³åºãåã«è¡ã£ãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢
+ããå¦çã§ååã§ããããï¼ããã§ã¯è¡ããªãï¼(*h)ã«ã¤ãã¦ã¯ï¼
+irc_end_intã§å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå²è¾¼ã¿å¦çåã®ç¶æ
+ã«æ»ããã¨ã§ï¼æºãã
+ãã¦ããã¯ãã§ããï¼
+
+----------------------------------------
+			if (p_runtsk != NULL) {
+				ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ãã
+				ã¹ã¿ãã¯ãã¤ã³ã¿ãèªã¿ã¹ã¯ï¼p_runtskï¼ã®TCBã«ä¿å­ãã
+				ret_int_rãï¼å®è¡åéçªå°ã¨ãã¦èªã¿ã¹ã¯ã®TCBã«ä¿å­ãã â¦ (*a)
+#ifdef LOG_DSP_ENTER
+				log_dsp_enter(p_runtsk);
+#endif /* LOG_DSP_ENTER */
+			}
+			dispatcherã«åå²ãã
+
+		  ret_int_r:
+			ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã
+#ifdef TOPPERS_SUPPORT_OVRHDR
+			ovrtimer_start();			/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+		}
+----------------------------------------
+
+ãã®è¾ºãã¯ç´ ç´ã«å®è£
+ã§ããï¼
+
+----------------------------------------
+#ifdef TOPPERS_SUPPORT_OVRHDR
+		else {
+			if (p_runtsk != NULL) {
+				ovrtimer_start();		/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+			}
+		}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	}
+----------------------------------------
+
+ãã®elseé¨ã¯ï¼p_runtskã¨p_schedtskãä¸è´ãã¦ããï¼ã¿ã¹ã¯åæããå¿
+è¦ãª
+ãã£ãå ´åã®å¦çã§ããï¼elseé¨ã®{}ã®ä¸­ã®å¦çã®å
+é ­ã«ï¼irq_handler_4ã©ã
+ã«ãç½®ãï¼ãªã¼ãã©ã³ãã³ãã©ããµãã¼ãããªãå ´åã¯ï¼irq_handler_4ã®ã©ã
+ã«ãï¼irq_handler_3ã¨åãå ´æï¼å¾è¿°ï¼ã«ç½®ãï¼ããã«ããï¼ä¸ã®å¦çãã¹ã­ã
+ãããï¼
+
+----------------------------------------
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã
+	å²è¾¼ã¿å¦çããã®ãªã¿ã¼ã³å¾ã«ï¼CPUã­ãã¯è§£é¤ç¶æ
+ã«æ»ãããã«æºåãã
+	å²è¾¼ã¿å¦çããã®ãªã¿ã¼ã³
+}
+----------------------------------------
+
+ãããã®å¦çã®åã«ï¼irq_handler_3ã®ã©ãã«ãç½®ãï¼ãããã®å¦çã¯ï¼ä¾å¤ã
+ãã®åºå£ã§è¡ãï¼
+
+âCPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦ç
+
+ASP3ã«ã¼ãã« ãã¼ãã£ã³ã°ã¬ã¤ãã«å¾ã£ã¦ï¼CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦çã®
+å®è£
+æ¹æ³ãæ¤è¨ãã¦ããï¼
+
+----------------------------------------
+void
+<CPUä¾å¤ã®åºå
+¥å£å¦ç>(void)
+{
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ãã
+----------------------------------------
+
+ãã®å¦çã¯ï¼ä¾å¤ã®å
+¥å£ã§å®è£
+æ¸ã¿ã§ããï¼
+
+----------------------------------------
+	CPUä¾å¤ãçºçããç¶æ³ãå¤æ­ããããã®è¿½å æ
+å ±ãã¹ã¿ãã¯ã«ä¿å­ãã â¦ (*j)
+	ãã®æç¹ã§ã®ã¹ã¿ãã¯ãã¤ã³ã¿Â±nãï¼CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã®
+										å
+é ­çªå°ã¨ããï¼å¿
+è¦ãªãä¿å­ããï¼
+----------------------------------------
+
+exc_sense_intmaskãå®ç¾ããããã«ï¼CPUä¾å¤ãçºçããæç¹ã§ã®ã³ã³ãã­ã¹
+ãã¨å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¿
+è¦ã¨ãªãããï¼ç¾å¨ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼CPUä¾
+å¤ã®çºçã§å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤ãããã¨ã¯ãªãããï¼ããã§è¯ãï¼ã¨ä¾å¤
+ãã¹ãã«ã¦ã³ããã¹ã¿ãã¯ã«ä¿å­ããï¼ã¾ãï¼CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé 
+åã®å
+é ­çªå°ã¨ãã¦ï¼ãã®æç¹ã§ã®ã¹ã¿ãã¯ãã¤ã³ã¿ãï¼ã¬ã¸ã¹ã¿ã«ä¿å­ãã¦
+ããï¼
+
+----------------------------------------
+	if (ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤) {
+----------------------------------------
+
+ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã¯ï¼ã«ã¼ãã«å®è¡ä¸­ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ï¼CPUã­ã
+ã¯ç¶æ
+ï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©å®è¡ä¸­ã«çºçããCPUä¾å¤ã§ããï¼
+ARMã³ã¢ã®å ´åã¯ï¼æ»ãå
+ã®CPSRã®IããããFãããã®ãããããã»ããããã¦
+ãããªãï¼ããã«è©²å½ããï¼
+
+ããã§ï¼ä¾å¤ãã¬ã¼ã ããæ»ãå
+ã®CPSRãåãåºãï¼IããããFãããã®ãã
+ãããã»ããããã¦ããå ´åã«ã¯ï¼ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã®åºå
+¥å£å¦ç
+ï¼nk_exc_handler_1ï¼ã«åå²ããï¼
+
+----------------------------------------
+		if (CPUä¾å¤ãã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç) {
+			ã¹ã¿ãã¯ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãï¼
+									éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã â¦ (*k)
+		}
+----------------------------------------
+
+ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã®åºå
+¥å£å¦çï¼nk_exc_handler_1ï¼ã§ã¯ï¼ã¾ãï¼ä¾å¤
+ãã¹ãã«ã¦ã³ããã¤ã³ã¯ãªã¡ã³ãããï¼CPUä¾å¤çºçåãã¿ã¹ã¯ã³ã³ãã­ã¹ããª
+ãï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãï¼åãæãåã®ã¹ã¿ãã¯ã
+ã¤ã³ã¿ãåãæãå¾ã®ã¹ã¿ãã¯ä¸ã«ä¿å­ããï¼
+
+----------------------------------------
+		ã·ã¹ãã ç¶æ
+ï¼ã³ã³ãã­ã¹ãã¯é¤ãï¼ãï¼CPUä¾å¤çºçæã®ç¶æ
+ã«ãã
+----------------------------------------
+
+ã·ã¹ãã ç¶æ
+ï¼ã³ã³ãã­ã¹ãã¯é¤ãï¼ãCPUä¾å¤çºçæã®ç¶æ
+ã«ããã«ã¯ï¼ã¹ã¼
+ããã¤ã¶ã¢ã¼ãã«åãæãï¼Iãã©ã°ã¨Fãã©ã°ã®ç¶æ
+ãCPUä¾å¤çºçæã®ç¶æ
+ã«
+æ»ãï¼
+
+----------------------------------------
+		CPUä¾å¤ãã³ãã©ãï¼CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã®å
+é ­çªå°ã
+									ãã©ã¡ã¼ã¿ï¼p_excinfï¼ã¨ãã¦å¼ã³åºã
+----------------------------------------
+
+CPUä¾å¤ãã³ãã©ãã¼ãã«ï¼exc_tableï¼ããCPUä¾å¤ãã³ãã©ã®çªå°ãåãåºãï¼
+CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã®å
+é ­çªå°ãç¬¬1ãã©ã¡ã¼ã¿ï¼CPUä¾å¤ãã³ã
+ã©çªå·ãç¬¬2ãã©ã¡ã¼ã¿ã¨ãã¦å¼ã³åºãï¼ç¬¬2ãã©ã¡ã¼ã¿ã«CPUä¾å¤ãã³ãã©çªå·
+ãæ¸¡ãã®ã¯ï¼default_exc_handlerã§å²è¾¼ã¿ãã³ãã©çªå·ãè¡¨ç¤ºã§ããããã«ã
+ãããã§ï¼ARMã³ã¢ä¾å­é¨ã®ç¬èªæ¡å¼µã§ããï¼
+
+----------------------------------------
+		if (CPUä¾å¤ãã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç) {
+			ã¹ã¿ãã¯ãã¿ã¹ã¯ç¨ã®ã¹ã¿ãã¯ã«æ»ãï¼
+									ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã â¦ (*k)
+		}
+		CPUä¾å¤å¦çããã®ãªã¿ã¼ã³å¾ã«ï¼CPUä¾å¤çºçæã®ã·ã¹ãã ç¶æ
+ã«
+													æ»ãããã«æºåãã
+	}
+	CPUä¾å¤ãçºçããç¶æ³ãå¤æ­ããããã®è¿½å æ
+å ±ãã¹ã¿ãã¯ä¸ããæ¨ã¦ã
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã
+	CPUä¾å¤å¦çããã®ãªã¿ã¼ã³
+}
+----------------------------------------
+
+ä¾å¤ãã¹ãã«ã¦ã³ãããã¯ãªã¡ã³ããï¼0ã«ãªã£ãå ´åã«ã¯ï¼ã¿ã¹ã¯ç¨ã®ã¹ã¿ã
+ã¯ã«æ»ãï¼ãã®å¾ï¼CPUä¾å¤ãçºçããç¶æ³ãå¤æ­ããããã®è¿½å æ
+å ±ãã¹ã¿ã
+ã¯ä¸ããæ¨ã¦ï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãå¾©å¸°ããå¾ï¼ä¾å¤ãããªã¿ã¼ã³ããï¼
+
+----------------------------------------
+	else {
+		if (CPUä¾å¤ãã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç) {
+----------------------------------------
+
+ã«ã¼ãã«ç®¡çã®CPUä¾å¤ã®åºå
+¥å£å¦çã§ã¯ï¼ã¾ãï¼ä¾å¤ãã¹ãã«ã¦ã³ããã¤ã³ã¯
+ãªã¡ã³ãããï¼CPUä¾å¤çºçåãéã¿ã¹ã¯ã³ã³ãã­ã¹ããªãï¼ãã®å¾ã®{}å
+ã®å¦
+çãã¹ã­ããããï¼exc_handler_2ã«åå²ï¼ï¼
+
+----------------------------------------
+			å°ãªãã¨ãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããç¶æ
+ã«ãã
+----------------------------------------
+
+ARMã³ã¢ã§ã¯ï¼ä¾å¤ã®åä»ã«ããCPSRã®Iããããã»ãããããããï¼ãã®å¦ç
+ã¯å¿
+è¦ãªãï¼
+
+----------------------------------------
+#ifdef TOPPERS_SUPPORT_OVRHDR
+			ovrtimer_stop();			/* ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+			ã¹ã¿ãã¯ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãï¼
+									éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã
+		}
+----------------------------------------
+
+ã¹ã¿ãã¯ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãï¼åãæãåã®ã¹ã¿ã
+ã¯ãã¤ã³ã¿ãåãæãå¾ã®ã¹ã¿ãã¯ä¸ã«ä¿å­ããï¼ãããã®å¦çã®å¾ã«ï¼
+exc_handler_2ã©ãã«ãç½®ãï¼
+
+----------------------------------------
+		å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãï¼CPUä¾å¤çºçæã®å¤ã«è¨­å®ãã â¦ (*l)
+----------------------------------------
+
+ãããä¾å­é¨ã®irc_begin_excãå¼ã³åºãï¼å¿
+è¦ã§ããã°ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯
+ãCPUä¾å¤çºçæã®å¤ã«è¨­å®ããï¼ã¾ãï¼irc_end_excã§å¿
+è¦ãªæ
+å ±ãã¹ã¿ãã¯
+ã«ä¿å­ããï¼
+
+----------------------------------------
+		CPUã­ãã¯è§£é¤ç¶æ
+ã«ããï¼CPUä¾å¤çºçæã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ããã
+							åªå
+åº¦ã®é«ãå²è¾¼ã¿ãåãä»ããããã«ããï¼
+----------------------------------------
+
+å²è¾¼ã¿ãè¨±å¯ãã¦ï¼CPUã­ãã¯è§£é¤ç¶æ
+ã«ããï¼
+
+----------------------------------------
+#ifdef LOG_EXC_ENTER
+		log_exc_enter(CPUä¾å¤ãã³ãã©çªå·);
+#endif /* LOG_EXC_ENTER */
+		CPUä¾å¤ãã³ãã©ãï¼CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã®å
+é ­çªå°ã
+									ãã©ã¡ã¼ã¿ï¼p_excinfï¼ã¨ãã¦å¼ã³åºã
+#ifdef LOG_EXC_LEAVE
+		log_exc_leave(CPUä¾å¤ãã³ãã©çªå·);
+#endif /* LOG_EXC_LEAVE */
+----------------------------------------
+
+CPUä¾å¤ãã³ãã©ãã¼ãã«ï¼exc_tableï¼ããCPUä¾å¤ãã³ãã©ã®çªå°ãåãåºãï¼
+CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã®å
+é ­çªå°ãç¬¬1ãã©ã¡ã¼ã¿ï¼CPUä¾å¤ãã³ã
+ã©çªå·ãç¬¬2ãã©ã¡ã¼ã¿ã¨ãã¦å¼ã³åºãï¼r12ã«ä¿å­ããã¦ããCPUä¾å¤ã®æ
+å ±ã
+è¨æ¶ãã¦ããé åã®å
+é ­çªå°ãä¿å­ãããããã«ï¼å¿
+è¦ã«å¿ãã¦ï¼ã¹ã¿ãã¯ã«
+ä¿å­ããï¼
+
+----------------------------------------
+		å°ãªãã¨ãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããç¶æ
+ã«ãã â¦ (*m)
+		å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãï¼CPUä¾å¤çºçæã®å¤ã«è¨­å®ãã â¦ (*n)
+----------------------------------------
+
+ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããå¾ï¼ãããä¾å­é¨ã®irc_end_excãå¼ã³åºãï¼
+
+----------------------------------------
+		if (CPUä¾å¤ãã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç) {
+			ã¹ã¿ãã¯ãã¿ã¹ã¯ç¨ã®ã¹ã¿ãã¯ã«æ»ãï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã
+																	â¦ (*g)
+----------------------------------------
+
+ä¾å¤ãã¹ãã«ã¦ã³ãããã¯ãªã¡ã³ããï¼0ã«ãªã£ãå ´åã«ã¯ï¼ã¿ã¹ã¯ç¨ã®ã¹ã¿ã
+ã¯ã«æ»ãï¼ãã®å¾ï¼CPUä¾å¤ãçºçããç¶æ³ãå¤æ­ããããã®è¿½å æ
+å ±ãã¹ã¿ã
+ã¯ä¸ããæ¨ã¦ãï¼ä¾å¤ãã¹ãã«ã¦ã³ãã0ã«ãªã£ãå ´åã®å¦çã¯ï¼å²è¾¼ã¿ãã³ã
+ã©ã®åºå£å¦çã¨å
+±éã§ããããï¼ret_int_1ã«åå²ããï¼
+
+----------------------------------------
+			if (p_runtsk != p_schedtsk) {
+				CPUã­ãã¯ç¶æ
+ã«ãã â¦ (*h)
+				å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¯ï¼å
+¨è§£é¤ç¶æ
+ï¼TIPM_ENAALLï¼ã«ãªã£ã¦
+												ããªããã°ãªããªã â¦ (*i)
+				if (p_runtsk != NULL) {
+					ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ãã
+					ã¹ã¿ãã¯ãã¤ã³ã¿ãèªã¿ã¹ã¯ï¼p_runtskï¼ã®TCBã«ä¿å­ãã
+					ret_exc_rãï¼å®è¡åéçªå°ã¨ãã¦èªã¿ã¹ã¯ã®TCBã«ä¿å­ãã
+																	â¦ (*a)
+#ifdef LOG_DSP_ENTER
+					log_dsp_enter(p_runtsk);
+#endif /* LOG_DSP_ENTER */
+				}
+				dispatcherã«åå²ãã
+
+			  ret_exc_r:
+				ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã
+#ifdef TOPPERS_SUPPORT_OVRHDR
+				ovrtimer_start();		/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+			}
+#ifdef TOPPERS_SUPPORT_OVRHDR
+			else {
+				if (p_runtsk != NULL) {
+					ovrtimer_start();	/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+				}
+			}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+		}
+----------------------------------------
+
+ä»¥ä¸ã®å¦çã«ã¯ï¼å²è¾¼ã¿ãã³ãã©ã®åºå£å¦çã®ã«ã¼ãã³ãæµç¨ããï¼
+
+----------------------------------------
+		CPUä¾å¤å¦çããã®ãªã¿ã¼ã³å¾ã«ï¼CPUã­ãã¯è§£é¤ç¶æ
+ã«æ»ãããã«æºåãã
+	}
+	CPUä¾å¤ãçºçããç¶æ³ãå¤æ­ããããã®è¿½å æ
+å ±ãã¹ã¿ãã¯ä¸ããæ¨ã¦ã
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã
+	CPUä¾å¤å¦çããã®ãªã¿ã¼ã³
+}
+----------------------------------------
+
+ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãå¾©å¸°ããå¾ï¼ä¾å¤ãããªã¿ã¼ã³ããï¼
+
+âã¹ã¿ãã¯ãã¤ã³ã¿ãä¸æ­£ã®å ´åã®å¯¾ç­
+
+CPUä¾å¤ãã³ãã©ãå®è¡ããéã«çµç±ããé¨åã§ï¼CPUä¾å¤ãèµ·ããå¯è½æ§ã¨ã
+ã¦ï¼ã¹ã¿ãã¯ãã¤ã³ã¿ãä¸æ­£ãªçªå°ã¨ãªã£ãå ´åãèããããï¼ã¹ã¼ããã¤ã¶
+ã¢ã¼ãã®ã¹ã¿ãã¯ãã¤ã³ã¿ãä¸æ­£ãªçªå°ã¨ãªã£ãç¶æ
+ã§ä¾å¤ãçºçããã¨ï¼ã
+ã®å
+¥å£ã§ã¹ã¯ã©ããã¬ã¸ã¹ã¿ç­ãä¿å­ãããã¨ãã¦ï¼ååº¦ä¾å¤ãçºçããï¼ã
+ã®ç¶æ³ã§ï¼ä¾å¤çºçãç¡éã«ç¹°ãè¿ããã¨ãé²ãå¯¾ç­ãã¨ããã¨ãæã¾ããï¼
+
+ãããé²ãããã«ï¼ãã¼ã¿ã¢ãã¼ãã®å
+¥å£ã§ï¼ãã¼ã¿ã¢ãã¼ããçºçãããçª
+å°ãèª¿ã¹ï¼CPUä¾å¤ã®å
+¥å£ã§ãã£ãå ´åã«ã¯ï¼ãã§ã¤ã¿ã«ãã¼ã¿ã¢ãã¼ãå¦çã
+è¡ãï¼
+
+ãã§ã¤ã¿ã«ãã¼ã¿ã¢ãã¼ãå¦çã§ã¯ï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã®ã¹ã¿ãã¯ãï¼å¼·å¶
+çã«ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã®åæå¤ã«è¨­å®ããå¾ï¼CPUä¾å¤ã®å¦
+çãè¡ãï¼ãã®éï¼éå¸¸ã®ãã¼ã¿ã¢ãã¼ãã¨åºå¥ã§ããããã«ï¼ä¾å¤ãã¹ãã«
+ã¦ã³ãã®æä¸ä½ãããã1ã«ããï¼ãã§ã¤ã¿ã«ãã¼ã¿ã¢ãã¼ãå¦çããã¯ãªã¿ã¼
+ã³ãããã¨ãã§ããªãï¼
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/arch/arm_gcc/doc/arm_memo.txt
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/doc/arm_memo.txt	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/doc/arm_memo.txt	(revision 302)
@@ -0,0 +1,1324 @@
+													TOPPERS Confidential
+		TOPPERSãã­ã¸ã§ã¯ã è¨­è¨ã¡ã¢
+		ARMã®ã¢ã¼ã­ãã¯ãã£ã«é¢ããã¡ã¢
+
+		ä½æè
+: é«ç°åºç« ï¼åå¤å±å¤§å­¦ï¼
+		æçµæ´æ°: 2015å¹´8æ18æ¥
+
+âã¡ã¢ã®ä½ç½®ã¥ã
+
+ãã®ã¡ã¢ã¯ï¼ARMã®ã¢ã¼ã­ãã¯ãã£ã«é¢ãã¦ï¼TOPPERSã«ã¼ãã«ããã¼ãã£ã³ã°
+ããã«ããã£ã¦å¿
+è¦ã¨ãªãäºé 
+ãã¾ã¨ãããã®ã§ããï¼
+
+ãªãï¼ãã®ã¡ã¢ã§å¯¾è±¡ã¨ããARMã¢ã¼ã­ãã¯ãã£ã¯ä»¥ä¸ã®ãã®ã§ããï¼ARM-Mã¢ã¼
+ã­ãã¯ãã£ï¼Cortex-Mã·ãªã¼ãºï¼ããã³ARMv8ã¢ã¼ã­ãã¯ãã£ï¼64ãããARMï¼
+ã¯æ±ããªãï¼
+
+ARMv4ï¼ARM7TDMIï¼ARM9TDMIï¼
+ARMv5ï¼ARM9Eï¼ARM10Eï¼
+ARMv6ï¼ARM11ï¼
+ARMv7-Aï¼Cortex-A8ï¼Cortex-A9ï¼Cortex-A15ãªã©ï¼
+ARMv7-Rï¼Cortex-R4ï¼Cortex-R5ï¼Cortex-R7ï¼
+
+ARMã®MMUé¢é£ã®äºé 
+ã«ã¤ãã¦ã¯ï¼ãARMã®VMSAã«é¢ããã¡ã¢ããåç
+§ãããã¨ï¼
+
+âç®æ¬¡
+
+ã»åèæç®
+ã»å®è¡ã¢ã¼ã
+	- ç¹æ¨©ã¬ãã«
+	- ãã­ã»ããµã¢ã¼ã
+ã»æ±ç¨ã¬ã¸ã¹ã¿
+	- ã¢ããªã±ã¼ã·ã§ã³ã¬ãã«ã®æ±ç¨ã¬ã¸ã¹ã¿
+	- ã·ã¹ãã ã¬ãã«ã®æ±ç¨ã¬ã¸ã¹ã¿
+ã»ãã­ã°ã©ã ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿
+	- ã¢ããªã±ã¼ã·ã§ã³ã¬ãã«ã®ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿
+	- ã·ã¹ãã ã¬ãã«ã®ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿
+	- å®æ°å¤ã®å®ç¾©
+ã»è¤æ°ã®ã¬ã¸ã¹ã¿ã®æä½
+	- ã¢ãã¬ãã·ã³ã°ã¢ã¼ã
+	- ã¬ã¸ã¹ã¿ã®ã­ã¼ãï¼ã¹ãã¢é åº
+	- Wãããï¼"!"ã®ä»å ï¼
+	- Sãããï¼"^"ã®ä»å ï¼
+ã»ä¾å¤
+	- ä¾å¤ã®ç¨®é¡ã¨ã¢ã¼ã/ãã¯ã¿
+	- ä¾å¤åä»æã®å¦ç
+	- å²è¾¼ã¿ã®åºå
+¥å£
+	- ARMv6ä»¥éã®ä¾å¤å¦çå½ä»¤
+ã»ã·ã¹ãã å½ä»¤ãªãã¡ã¬ã³ã¹
+	- ldm
+	- stm
+	- mrs
+	- msr
+	- cps
+ã»ã­ã£ãã·ã¥ã¨åå²äºæ¸¬
+	- ã­ã£ãã·ã¥ã®è­å¥
+	- ã­ã£ãã·ã¥ã®æ¯èã
+	- ã­ã£ãã·ã¥ã®ã¤ãã¼ãã«ï¼ãã£ã¹ã¨ã¼ãã«
+	- ARMv7ã«ãããã­ã£ãã·ã¥ã¨åå²äºæ¸¬ã®ã¡ã³ããã³ã¹æä½
+ã»TLBã®ã¡ã³ããã³ã¹æä½
+	- VMSAã«ãããTLBã®ã¡ã³ããã³ã¹æä½
+ã»ã¡ã¢ãªã¿ã¤ãã»å±æ§ã¨ã¡ã¢ãªé åºã¢ãã«
+	- ã¡ã¢ãªã¿ã¤ã
+	- ã¡ã¢ãªå±æ§
+	- Deviceã¨Strongly-orderedã¡ã¢ãª
+ã»ã¡ã¢ãªã¢ã¯ã»ã¹é åº
+	- ãªã¼ãã¨ã©ã¤ã
+	- ã¡ã¢ãªã¢ã¯ã»ã¹ã®é åºè¦æ±
+	- ã¡ã¢ãªããªã¢
+	- CPSRã®å¤æ´ã¨ã¡ã¢ãªé åºã¢ãã«
+	- ããªã¢å½ä»¤ã®ä½¿ç¨ä¾
+ã»ã³ãã­ã»ããµ
+	- ã³ãã­ã»ããµãµãã¼ã
+	- ã³ãã­ã»ããµå½ä»¤
+ã»CP15
+	- ä»®æ³ã¡ã¢ãªã·ã¹ãã ã¢ã¼ã­ãã¯ãã£ï¼VMSAï¼ã§ã®ã¬ã¸ã¹ã¿
+	- ç©çã¡ã¢ãªã·ã¹ãã ã¢ã¼ã­ãã¯ãã£ï¼PMSAï¼ã§ã®ã¬ã¸ã¹ã¿
+	- ããã©ã¼ãã³ã¹ã¢ãã¿ã¬ã¸ã¹ã¿
+
+âåèæç®
+
+[1] ARM Architecture Reference Manual, 2005
+DDI 01001.pdf
+â» ARMv6ä»¥åã®å®ç¾©
+
+[2] ARM Architecture Reference Manual - ARMv7-A and ARv7-R edition, 2014
+DDI0406C_C_arm_architecture_reference_manual.pdf
+â» ARMv7ã®å®ç¾©ï¼ARMv6ä»¥åã¨ã®å·®åã«ã¤ãã¦ãè¨è¼ãã
+
+âç¨èªé
+
+RAZ			Read-As-Zero
+RAZ/WI		Read-As-Zero Write-Ignored
+RAZ/SBZP	Read-As-Zero Should-Be-Zero-or-Preserved on writes
+
+âå®è¡ã¢ã¼ã
+
+âç¹æ¨©ã¬ãã«
+
+ARMã¯ï¼ä»¥ä¸ã®ç¹æ¨©ã¬ãã«ãæã¤ï¼
+
+	PL0		ã¦ã¼ã¶ãã­ã°ã©ã ãå®è¡ããã¢ã¼ãï¼éç¹æ¨©ã¬ãã«
+	PL1		OSãå®è¡ããã¬ãã«ï¼ã¹ã¼ããã¤ã¶ã¬ãã«ï¼ããããç¹æ¨©ã¬ãã«ï¼
+	PL2		VMMãå®è¡ããã¬ãã«ï¼ãã¤ããã¤ã¶ã¬ãã«ãä»®æ³åæ¡å¼µã
+
+ã»ã­ã¥ãªãã£æ¡å¼µã«ããã¦ï¼Secureç¶æ
+ã¯ï¼PL2ãæããªãï¼è¨ãæããã¨ï¼
+PL2ã¯ï¼Non-secureç¶æ
+ã«éãããï¼Secureç¶æ
+ã§VMãç¨ãããã¨ã¯æ³å®ãã¦ã
+ãªãï¼ï¼
+
+âãã­ã»ããµã¢ã¼ãï¼[2] B.1.3ç¯ï¼
+
+ARMã¯ï¼ä»¥ä¸ã®ãã­ã»ããµã¢ã¼ããæã¤ï¼
+
+	User			usr			ã¦ã¼ã¶
+	FIQ				fiq			FIQ
+	IRQ				irq			IRQ
+	Supervisor		svc			ã¹ã¼ããã¤ã¶
+	Abort			abt			ã¢ãã¼ã
+	Undefined		und			æªå®ç¾©
+	System			sys			ã·ã¹ãã 
+
+ã¦ã¼ã¶ã¢ã¼ãã¯éç¹æ¨©ã¬ãã«ï¼PL0ï¼ï¼ãã®ä»ã¯ç¹æ¨©ã¬ãã«ï¼PL1ï¼ã§ããï¼ã¦ã¼
+ã¶ã¢ã¼ãã¨ã·ã¹ãã ã¢ã¼ãä»¥å¤ãï¼ä¾å¤ã¢ã¼ãã¨ç·ç§°ããï¼
+
+ã»ã­ã¥ãªãã£æ¡å¼µã§ã¯ï¼Secureç¶æ
+ã¨Non-secureç¶æ
+ã®åãæãç¨ã«ï¼ä»¥ä¸ã®
+ã¢ã¼ããæã¤ï¼ä»¥ä¸ï¼ãã®ã¡ã¢ã§ã¯æ±ããªãï¼ï¼ãã®ã¢ã¼ãã¯ï¼ç¹æ¨©ã¬ãã«
+ï¼PL1ï¼ã§ããï¼Secureç¶æ
+ã«éå®ãããï¼
+
+	Monitor			mon			ã¢ãã¿
+
+ã¾ãï¼ä»®æ³åæ¡å¼µã§ã¯ï¼ä»¥ä¸ã®ã¢ã¼ããæã¤ï¼ä»¥ä¸ï¼ãã®ã¡ã¢ã§ã¯æ±ããªãï¼ï¼
+ãã®ã¢ã¼ãã¯ï¼ãã¤ããã¤ã¶ã¬ãã«ï¼PL2ï¼ã§ããï¼Non-secureç¶æ
+ã«éå®ãã
+ãï¼
+
+	Hyp				hyp			ãã¤ããã¤ã¶
+
+âæ±ç¨ã¬ã¸ã¹ã¿
+
+âã¢ããªã±ã¼ã·ã§ã³ã¬ãã«ã®æ±ç¨ã¬ã¸ã¹ã¿
+
+ARMã®æ±ç¨ã¬ã¸ã¹ã¿ã¯ï¼r0ãr15ã®16æ¬ããï¼ãã ãï¼ä»¥ä¸ã®ã¬ã¸ã¹ã¿ã¯ç¹æ®ç®
+çã«ä½¿ããã¦ããï¼æ±ç¨ã¬ã¸ã¹ã¿ã¨ãã¦ã¯ä½¿ç¨ããªãï¼
+
+	r13		ã¹ã¿ãã¯ãã¤ã³ã¿	sp
+	r14		ãªã³ã¯ã¬ã¸ã¹ã¿		lr
+	r15		ãã­ã°ã©ã ã«ã¦ã³ã¿	pc
+
+ã¾ãï¼ä»¥ä¸ã®ã¬ã¸ã¹ã¿ãç¹æ®ç®çã«ä½¿ãããå ´åããããï¼éå¸¸ã¯æ±ç¨ã¬ã¸ã¹
+ã¿ã¨ãã¦ä½¿ç¨ããï¼
+
+	r12		InterProcedure		ip
+
+ç¹æ®ç®çã®ã¬ã¸ã¹ã¿ä»¥å¤ã§ï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ã¯ä»¥ä¸ã®éãï¼
+
+	r0, r1, r2, r3, r12
+
+ãã®ä»ã®ã¬ã¸ã¹ã¿ï¼r4ãr11ï¼ã¯ï¼callee saved registerã§ããï¼
+
+âã·ã¹ãã ã¬ãã«ã®æ±ç¨ã¬ã¸ã¹ã¿
+
+åä¾å¤ã¢ã¼ãã¯ï¼å°ç¨ã®spï¼r13ï¼ã¨lrï¼r14ï¼ãæã¤ï¼FIQã¢ã¼ãã¯ï¼ããã«å 
+ãã¦ï¼R8ãR12ãå°ç¨ã«æã¤ï¼ãã®ä»ã®ã¬ã¸ã¹ã¿ï¼pcãå«ãï¼ã¯ï¼ã¦ã¼ã¶ã¢ã¼ã
+ã¨å
+±ç¨ãã¦ããï¼
+
+ã·ã¹ãã ã¢ã¼ãã¯ï¼ãã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¦ã¼ã¶ã¢ã¼ãã¨å
+±ç¨ãã¦ããï¼ã¤ã¾ãï¼
+ã·ã¹ãã ã¢ã¼ãã¨ã¦ã¼ã¶ã¢ã¼ãã®éãã¯ï¼ç¹æ¨©ã¢ã¼ããå¦ãã®éãã®ã¿ï¼ï¼
+
+ç¹å®ã®ã¢ã¼ãã®spã¨lrãï¼sp_usrï¼lr_usrï¼sp_svcï¼lr_svcã®ããã«è¡¨è¨ããï¼
+
+âãã­ã°ã©ã ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿
+
+âã¢ããªã±ã¼ã·ã§ã³ã¬ãã«ã®ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿
+
+ã¢ããªã±ã¼ã·ã§ã³ã¬ãã«ã®ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ã¨ãã¦ï¼APSRï¼Application
+Program Status Registerï¼ãããï¼APSRã®æ§æã¯ä»¥ä¸ã®éãï¼
+
+	ããã31ï¼MSBï¼	Nãã©ã°ï¼Negativeï¼
+		  30		Zãã©ã°ï¼Zeroï¼
+		  29		Cãã©ã°ï¼Carryï¼
+		  28		Vãã©ã°ï¼Overflowï¼
+		  27		Qãã©ã°ï¼Overflowã¾ãã¯Saturationï¼DSPå½ä»¤ç¨ï¼
+		  26ã24	å¸¸ã«0ï¼RAZ/SBZPï¼
+		  23ã20	äºç´
+		  19ã16	GE[3:0] Greater or Equalãã©ã°ï¼SIMDå½ä»¤ç¨ï¼
+		  15ã0		äºç´
+
+âã·ã¹ãã ã¬ãã«ã®ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿
+
+ã·ã¹ãã ã¬ãã«ã®ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ã¨ãã¦ï¼CPSRï¼Current Program Status
+Registerï¼ãããï¼CPSRã¯ï¼APSRã®æ¡å¼µã§ããï¼è¨ãæããã¨ï¼APSRã¯ï¼CPSR
+ã®ä¸é¨ãè¦ãã¦ããï¼ï¼CPSRã®æ§æã¯ä»¥ä¸ã®éãï¼
+
+	ããã31ã27	N,Z,C,V,Qãã©ã° â¦ APSRã¨åã
+		  26ã25	IT[1:0] ä¸ã®ITãããã®ä¸ä½2ããã
+		  24		Jãããï¼Jazelleãããï¼
+		  23ã20	äºç´
+		  19ã16	GE[3:0] Greater or Equalãã©ã°ï¼SIMDå½ä»¤ç¨ï¼â¦ APSRã¨åã
+		  15ã10	IT[7:2] If-Thenå®è¡ç¶æ
+ãããï¼Thumb ITå½ä»¤ç¨ï¼
+		  9			Eãããï¼ã¨ã³ãã£ã¢ã³ç¶æ
+ï¼
+		  8			Aãããï¼éåæã¢ãã¼ãç¦æ­¢ï¼
+		  7			Iãããï¼IRQç¦æ­¢ï¼
+		  6			Fãããï¼FIQç¦æ­¢ï¼
+		  5			Tãããï¼Thumbãããï¼Jãããã¨åããã¦å½ä»¤ã»ãããæå®ï¼
+		  4ã0		M[4:0] ãã­ã»ããµã¢ã¼ã
+
+CPSRã¯ï¼ãã¹ã¦ã®ã¢ã¼ãã§å
+±ç¨ãã¦ããï¼ã¤ã¾ãï¼CPSRã¯1ã¤ãããªãï¼ï¼
+
+ã¢ã¼ãåæãåã®CPSRãä¿å­ããããã®ã¬ã¸ã¹ã¿ã¨ãã¦ï¼SPSRï¼Saved
+Program Status Registerï¼ãããï¼SPSRã¯ï¼åä¾å¤ã¢ã¼ãæ¯ã«å°ç¨ã«æã¤ï¼ã¦ã¼
+ã¶ã¢ã¼ãã¨ã·ã¹ãã ã¢ã¼ãã¯ï¼SPSRãæããªãï¼ï¼
+
+âã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ã«é¢ããå®æ°å¤ã®å®ç¾©ï¼arm.hï¼
+
+ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ã«è¨­å®ããå¤ãè¡¨ãããã®å®æ°å¤ãç¨æãã¦ããï¼
+
+/*
+ *  CPSRã®å²è¾¼ã¿ç¦æ­¢ããã
+ */
+#define CPSR_INT_MASK	UINT_C(0xc0)
+#define CPSR_IRQ_BIT	UINT_C(0x80)
+#define CPSR_FIQ_BIT	UINT_C(0x40)
+
+/*
+ *  CPSRã®Thumbããã
+ */
+#define CPSR_THUMB_BIT	UINT_C(0x20)
+
+/*
+ *  CPSRã®ã¢ã¼ãããã
+ */
+#define CPSR_MODE_MASK	UINT_C(0x1f)
+#define CPSR_USR_MODE	UINT_C(0x10)
+#define CPSR_FIQ_MODE	UINT_C(0x11)
+#define CPSR_IRQ_MODE	UINT_C(0x12)
+#define CPSR_SVC_MODE	UINT_C(0x13)
+#define CPSR_ABT_MODE	UINT_C(0x17)
+#define CPSR_UND_MODE	UINT_C(0x1b)
+#define CPSR_SYS_MODE	UINT_C(0x1f)
+
+âè¤æ°ã®ã¬ã¸ã¹ã¿ã®æä½
+
+âã¢ãã¬ãã·ã³ã°ã¢ã¼ã
+
+è¤æ°ã®ã¬ã¸ã¹ã¿ã®ã­ã¼ãï¼ã¹ãã¢ã«ã¯ï¼4ã¤ã®ã¢ãã¬ãã·ã³ã°ã¢ã¼ããããï¼
+
+	IAï¼Increment Afterï¼	æå®ããçªå°ããå¤§ããæ¹ã®çªå°ã«åãã£ã¦ä½¿ç¨
+	IBï¼Increment Beforeï¼	æå®ããçªå°ï¼4ããå¤§ããæ¹ã®çªå°ã«åãã£ã¦ä½¿ç¨
+	DAï¼Decrement Afterï¼	æå®ããçªå°ããå°ããæ¹ã®çªå°ã«åãã£ã¦ä½¿ç¨
+	DBï¼Decrement Beforeï¼	æå®ããçªå°â4ããå°ããæ¹ã®çªå°ã«åãã£ã¦ä½¿ç¨
+
+ã¹ã¿ãã¯æä½ã®å ´åã«ã¯ï¼ããããããããããã«ï¼ä»¥ä¸ã®4ã¤ã®ã¢ãã¬ãã·ã³
+ã°ã¢ã¼ããç¨ããï¼
+
+	FDï¼Full Descendingï¼
+	EDï¼Empty Descendingï¼
+	FAï¼Full Ascendingï¼
+	EAï¼Enpty Ascendingï¼
+
+	Full â¦ ã¹ã¿ãã¯ãã¤ã³ã¿ã¯ä½¿ã£ã¦ããæå¾ã®çªå°ãæã
+	Empty â¦ ã¹ã¿ãã¯ãã¤ã³ã¿ã¯æ¬¡ã«ä½¿ãï¼ã¤ã¾ãï¼ä½¿ã£ã¦ããªãï¼çªå°ãæã
+	Descending â¦ ã¹ã¿ãã¯ã¯å°ããçªå°ã«åãã£ã¦ä¼¸ã³ã
+	Ascending â¦ ã¹ã¿ãã¯ã¯å¤§ããçªå°ã«åãã£ã¦ä¼¸ã³ã
+
+ã¹ã¿ãã¯æä½ã«ã¯ï¼éå¸¸ã¯FDãä½¿ãï¼ldmå½ä»¤ã¨stmå½ä»¤ã«ããã¦ï¼ä»¥ä¸ã®ãã
+ã«å¯¾å¿ããï¼
+
+	ã¹ã¿ãã¯æä½				ã¹ã¿ãã¯ä»¥å¤ã®æä½
+	stmfdï¼Full Descendingï¼	stmdbï¼Decrement Beforeï¼	â¦ push
+	ldmfdï¼Full Descendingï¼	ldmiaï¼Increment Afterï¼	â¦ pop
+
+âã¬ã¸ã¹ã¿ã®ã­ã¼ãï¼ã¹ãã¢é åº
+
+çªå·ã®å°ããã¬ã¸ã¹ã¿ãï¼å°ããã¢ãã¬ã¹ããã­ã¼ãï¼ã«ã¹ãã¢ããï¼
+
+âWãããï¼"!"ã®ä»å ï¼
+
+Wãããã1ã®å ´åï¼ãã¼ã¹ã¬ã¸ã¹ã¿ã®å¤ãï¼ã¤ã³ã¯ãªã¡ã³ãã¾ãã¯ãã¯ãªã¡ã³
+ãããå¤ã«ï¼æ´æ°ããï¼
+
+âSãããï¼"^"ã®ä»å ï¼
+
+Sãããã¯ï¼ç¶æ³ã«ãã2ã¤ã®æ©è½ãæã¤ï¼
+
+pcï¼r15ï¼ãå«ãldmã®å ´å
+	cpsrãï¼spsrããã­ã¼ãï¼å¾©å¸°ï¼ãããï¼
+
+stmã¨pcï¼r15ï¼ãå«ã¾ãªãldmã®å ´å
+	ç¹æ¨©ã¢ã¼ãã§ä½¿ç¨ããå ´åï¼ã¦ã¼ã¶ã¢ã¼ãã®ã¬ã¸ã¹ã¿ãè»¢éãããï¼
+
+âä¾å¤
+
+âä¾å¤ã®ç¨®é¡ã¨ã¢ã¼ã/ãã¯ã¿
+
+ä¾å¤ã¿ã¤ã					ä¾å¤ã¢ã¼ã		ãã¯ã¿ã¢ãã¬ã¹
+											ãã¼ãã«		ãã¤ãã¯ã¿
+----------------------------------------------------------------------
+Reset						ã¹ã¼ããã¤ã¶	0x00000000		0xffff0000
+Undefined instructions		æªå®ç¾©			0x00000004		0xffff0004
+Supervisor Call				ã¹ã¼ããã¤ã¶	0x00000008		0xffff0008
+Prefetch Abort				ã¢ãã¼ã		0x0000000c		0xffff000c
+Data Abort					ã¢ãã¼ã		0x00000010		0xffff0010
+IRQ (interrupt)				IRQ				0x00000018		0xffff0018
+FIQ (fast interrupt)		FIQ				0x0000001c		0xffff001c
+----------------------------------------------------------------------
+â»Supervisor Callã¯ï¼å¤ãããã¥ã¢ã«ã§ã¯Software interrupt (SWI)ã¨æ¸ããã¦ãã
+â»Prefetch Abortï¼å½ä»¤ãã§ããã§ã®ã¡ã¢ãªã¢ãã¼ã
+â»Data Abortï¼ãã¼ã¿ã¢ã¯ã»ã¹ã§ã®ã¡ã¢ãªã¢ãã¼ã
+
+ãã¯ã¿å²è¾¼ã¿ã¢ã¼ãï¼CP15ã§å¶å¾¡ãããï¼ã®å ´åï¼IRQã¨FIQã«å¯¾ãã¦ã¯ï¼ä¸ã®
+ãã¯ã¿ã¢ãã¬ã¹ã¯ä½¿ãããï¼å®è£
+ä¾å­ã®ã¢ãã¬ã¹ãä½¿ãããï¼
+
+âä¾å¤åä»æã®å¦ç
+
+ã»ä¾å¤çºçæç¹ã®pcã¨cpsrãï¼è©²å½ããä¾å¤ã¢ã¼ãã®lrã¨spsrã«ä¿å­ãããï¼
+	- lrã«ä¿å­ãããå¤ã¯ï¼ç¶æ³ã«ãã£ã¦ç°ãªãï¼å¾è¿°ï¼ï¼
+
+ã»ãã»ã­ã¥ãªãã£æ¡å¼µãå¿
+è¦ãªå ´åã«ã¯ï¼Secureã¢ã¼ãã«åãæããï¼
+
+ã»cpsrãä»¥ä¸ã®ããã«å¤æ´ãããï¼
+	- ã¢ã¼ããåãä»ããä¾å¤ã®ã¢ã¼ãã«å¤æ´ãããï¼
+	- è©²å½ããå²è¾¼ã¿ãã¹ã¯ãã»ãããããï¼
+		+ ResetãFIQãªãï¼FIQãç¦æ­¢ããï¼
+		+ IRQãç¦æ­¢ããï¼
+		+ãARMv6ä»¥éãUNDEFã¨SWIä»¥å¤ãªãï¼éåæã¢ãã¼ããç¦æ­¢ããï¼
+	- å½ä»¤ã»ããï¼Jï¼Tï¼ãä¾å¤ã¨ã³ããªãè¦æ±ãããå¤ã«ã»ãããããï¼
+		+ ARMç¶æ
+ã«ããï¼
+	- ã¨ã³ãã£ã¢ã³ç¶æ
+ï¼Eï¼ãä¾å¤ã¨ã³ããªãè¦æ±ãããå¤ã«ã»ãããããï¼
+		+ CP15ã®reg1_EEãããã§æ±ºã¾ãï¼
+	- IT[7:0]ã0ã«ã¯ãªã¢ãããï¼
+
+ã»ãã¯ã¿ã¢ãã¬ã¹ã«åå²ããï¼
+
+âlrã«ä¿å­ãããå¤
+
+ä¾å¤ã¿ã¤ã					æã¾ããæ»ãçªå°			ãªãã»ãã
+----------------------------------------------------------------------
+Undefined instructions		æªå®ç¾©å½ä»¤ã®çªå°			ï¼4/2(*)
+Supervisor Call				SVCã®æ¬¡ã®å½ä»¤ã®çªå°			ï¼0
+Prefetch Abort				ã¢ãã¼ããããå½ä»¤ã®çªå°	ï¼4
+Data Abort					ã¢ãã¼ããçæããå½ä»¤ã®çªå°ï¼8
+IRQ (interrupt)				æ¬¡ã«å®è¡ãã¹ãçªå°			ï¼4
+FIQ (fast interrupt)		æ¬¡ã«å®è¡ãã¹ãçªå°			ï¼4
+----------------------------------------------------------------------
+(*) ARMã¢ã¼ãã§ã¯4ï¼Thumbã¢ã¼ãã§ã¯2
+â»æã¾ããæ»ãçªå°ã¯ï¼ããã¾ã§ã1ã¤ã®æ³å®ã¨æãããï¼ä¾ãã°ï¼æªå®ç¾©å½ä»¤
+ããã¨ãã¥ã¬ã¼ã·ã§ã³ããå ´åã«ã¯ï¼ãã®æ¬¡ã®çªå°ã¸æ»ãæ¹ãæ®éã§ãããï¼
+
+âå²è¾¼ã¿ã®åºå
+¥å£
+
+ä»¥ä¸ã¯ï¼ã¢ã¼ããå¤æ´ããªãå ´åã®å²è¾¼ã¿ã®åºå
+¥å£ã®å¦çã§ããï¼
+
+å²è¾¼ã¿ã®å
+¥å£ã§ã¯ï¼lrãã4ãå¼ãã¦æ»ãçªå°ãæ±ããå¾ï¼å¿
+è¦ãªã¬ã¸ã¹ã¿ã¨
+lrï¼æ»ãçªå°ï¼ãã¹ã¿ãã¯ã«ä¿å­ããï¼
+
+	sub		lr, lr, #4
+	stmfd	sp!, {<other_registers>, lr}
+
+å²è¾¼ã¿ã®åºå£ã§ã¯ï¼å¿
+è¦ãªã¬ã¸ã¹ã¿ã¨æ»ãçªå°ãã¹ã¿ãã¯ããï¼æ»ãçªå°ã¯pc
+ã«ï¼ï¼cpsrãspsrããå¾©å¸°ããï¼æå¾ã«"^"ãä»ãããã¨ã§ï¼cpsrãspsrããå¾©
+å¸°ãããã¨ãç¤ºãï¼
+
+	ldmfd	sp!, {<other_registers>, pc}^
+
+ãã®å½ä»¤ã¯ï¼ã·ã¹ãã ã¢ã¼ãã§ã¯ä½¿ããªãï¼spsrããªãããï¼ï¼
+
+âARMv6ä»¥éã®ä¾å¤å¦çå½ä»¤
+
+ARMv6ããï¼CPSå½ä»¤ï¼SRSå½ä»¤ï¼RFEå½ä»¤ãç¨æãããï¼ãããã®å½ä»¤ãããå ´
+åã¨ãªãå ´åã§ï¼ä¾å¤å¦çã®åºå
+¥å£ã®æé©ãªã³ã¼ããç°ãªãï¼
+
+srsï¼Store Return Stateï¼â¦ ç¾å¨ã®ã¢ã¼ãã®lrã¨spsrãï¼å¥ã®ã¢ã¼ãã®spã
+ç¨ãã¦ä¿å­ããããã®å½ä»¤ï¼lrãå°ããå´ã®çªå°ï¼spsrãå¤§ããå´ã®çªå°ã«ä¿
+å­ãããï¼ã·ã¹ãã ã¢ã¼ãã§ã¯ä½¿ããªãï¼spsrããªãããï¼ï¼
+
+ä¾ï¼srsfd	#CPSR_SVC_MODE!	â¦ lrï¼ä¾å¤ããã®æ»ãå
+ï¼ã¨spsrï¼ä¾å¤çºçå
+							ã®cpsrï¼ãï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã®ã¹ã¿ãã¯ã«
+							ä¿å­ããï¼
+
+rfeï¼Return From Exceptionï¼â¦ pcã¨cpsrãï¼å¾©å¸°ããå½ä»¤ï¼SRSã§ä¿å­ãã
+ãç¶æ
+ã«æ»ãããã«ç¨ããï¼
+
+ä¾ï¼rfefd	sp!				â¦ pcã¨cpsrãï¼ç¾å¨ã®ã¢ã¼ãã®ã¹ã¿ãã¯ããå¾©
+							å¸°ããï¼
+
+cpsï¼Change Processor Stateï¼â¦ cpsrã®å²è¾¼ã¿ãã¹ã¯ã¨ã¢ã¼ãããããå¤æ´
+ããããã®å½ä»¤ï¼
+
+âã·ã¹ãã å½ä»¤ãªãã¡ã¬ã³ã¹
+
+âldm
+
+(1)	ldm<ã¢ãã¬ãã·ã³ã°ã¢ã¼ã><æ¡ä»¶> <Rn>{!}, <ã¬ã¸ã¹ã¿ãªã¹ã>
+
+Rnã§ç¤ºãããé£ç¶ããçªå°ããï¼ã¬ã¸ã¹ã¿ãªã¹ãã«ãªã¹ãã¢ãããããã¬ã¸ã¹
+ã¿ã«å¤ãã­ã¼ãããï¼ã¦ã¼ã¶ã¢ã¼ããå«ããã¹ã¦ã®ã¢ã¼ãã§ä½¿ç¨ã§ããï¼
+
+(2)	ldm<ã¢ãã¬ãã·ã³ã°ã¢ã¼ã><æ¡ä»¶> <Rn>, <PCä»¥å¤ã®ã¬ã¸ã¹ã¿ãªã¹ã>^
+	â»æå¾ã«"^"ãããï¼
+
+Rnã§ç¤ºãããé£ç¶ããçªå°ããï¼ã¬ã¸ã¹ã¿ãªã¹ãã«ãªã¹ãã¢ããããããã¦ã¼
+ã¶ã¢ã¼ãã®ã¬ã¸ã¹ã¿ãã«å¤ãã­ã¼ãããï¼ã·ã¹ãã ã¢ã¼ãä»¥å¤ã®ç¹æ¨©ã¢ã¼ãã§
+ä½¿ç¨ã§ããï¼"!"ã¯ä½¿ããªãï¼
+
+(3)	ldm<ã¢ãã¬ãã·ã³ã°ã¢ã¼ã><æ¡ä»¶> <Rn>{!}, <PCãå«ãã¬ã¸ã¹ã¿ãªã¹ã>^
+	â»æå¾ã«"^"ãããï¼
+
+Rnã§ç¤ºãããé£ç¶ããçªå°ããï¼ã¬ã¸ã¹ã¿ãªã¹ãã«ãªã¹ãã¢ãããããã¬ã¸ã¹
+ã¿ã«å¤ãã­ã¼ãããï¼ã¾ãï¼ç¾å¨ã®ã¢ã¼ãã®spsrãï¼cpsrã«ã³ãã¼ããï¼ã·ã¹
+ãã ã¢ã¼ãä»¥å¤ã®ç¹æ¨©ã¢ã¼ãã§ä½¿ç¨ã§ããï¼
+
+âstm
+
+(1)	stm<ã¢ãã¬ãã·ã³ã°ã¢ã¼ã><æ¡ä»¶> <Rn>{!}, <ã¬ã¸ã¹ã¿ãªã¹ã>
+
+Rnã§ç¤ºãããé£ç¶ããçªå°ããï¼ã¬ã¸ã¹ã¿ãªã¹ãã«ãªã¹ãã¢ãããããã¬ã¸ã¹
+ã¿ã«å¤ãã¹ãã¢ããï¼ã¦ã¼ã¶ã¢ã¼ããå«ããã¹ã¦ã®ã¢ã¼ãã§ä½¿ç¨ã§ããï¼
+
+(2)	stm<ã¢ãã¬ãã·ã³ã°ã¢ã¼ã><æ¡ä»¶> <Rn>, <ã¬ã¸ã¹ã¿ãªã¹ã>^
+	â»æå¾ã«"^"ãããï¼
+
+Rnã§ç¤ºãããé£ç¶ããçªå°ããï¼ã¬ã¸ã¹ã¿ãªã¹ãã«ãªã¹ãã¢ããããããã¦ã¼
+ã¶ã¢ã¼ãã®ã¬ã¸ã¹ã¿ãã«å¤ãã¹ãã¢ããï¼ã·ã¹ãã ã¢ã¼ãä»¥å¤ã®ç¹æ¨©ã¢ã¼ãã§
+ä½¿ç¨ã§ããï¼"!"ã¯ä½¿ããªãï¼
+
+âmrs
+
+ç¹æ®ã¬ã¸ã¹ã¿ï¼ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼ãï¼æ±ç¨ã¬ã¸ã¹ã¿ã«ã³ãã¼ããï¼
+ARMv7VEï¼ä»®æ³åæ¡å¼µï¼ã§ã¯ï¼ä»ã®ã¢ã¼ãã®ã¬ã¸ã¹ã¿ãæ±ç¨ã¬ã¸ã¹ã¿ã«ã³ãã¼ã
+ãæ©è½ãæã¤ï¼
+
+(1) mrs<æ¡ä»¶> <Rd>, <ç¹æ®ã¬ã¸ã¹ã¿è¨è¿°>
+
+ç¹æ®ã¬ã¸ã¹ã¿ãï¼æ±ç¨ã¬ã¸ã¹ã¿Rdã«ã³ãã¼ããï¼
+
+<ç¹æ®ã¬ã¸ã¹ã¿è¨è¿°>ã«ã¯ï¼ä»¥ä¸ã®ãããããæå®ããï¼
+	- apsr
+	- cpsr â¦ ã¦ã¼ã¶ã¢ã¼ãã§ä½¿ã£ãå ´åã¯ï¼apsrãæå³ããï¼
+	- spsr â¦ ã¦ã¼ã¶ã¢ã¼ãã§ã¯ä½¿ããªãï¼
+
+âmsr
+
+ç¹æ®ã¬ã¸ã¹ã¿ï¼ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼ã«ï¼å³å¤ã¾ãã¯æ±ç¨ã¬ã¸ã¹ã¿ã®å¤ãã³ãã¼
+ããï¼ARMv7VEï¼ä»®æ³åæ¡å¼µï¼ã§ã¯ï¼ä»ã®ã¢ã¼ãã®ã¬ã¸ã¹ã¿ã«æ±ç¨ã¬ã¸ã¹ã¿ã®å¤
+ãã³ãã¼ããæ©è½ãæã¤ï¼
+
+ãã®å½ä»¤ã§Eãããï¼ã¨ã³ãã£ã¢ã³ç¶æ
+ï¼ãæ¸ãæããã¹ãã§ã¯ãªãï¼setendå½
+ä»¤ãä½¿ãã¹ãï¼
+
+(1) msr<æ¡ä»¶> <ç¹æ®ã¬ã¸ã¹ã¿è¨è¿°>, #<å®æ°>
+
+ç¹æ®ã¬ã¸ã¹ã¿ï¼ã®ä¸é¨ï¼ã«ï¼å³å¤ãã³ãã¼ããï¼
+
+<ç¹æ®ã¬ã¸ã¹ã¿è¨è¿°>ã«ã¯ï¼ä»¥ä¸ã®ãããããæå®ããï¼
+	- apsr_nzcvq		â¦ cpsr_fã¨åã
+	- apsr_g			â¦ cpsr_sã¨åã
+	- apsr_nzcvqg		â¦ cpsr_fsã¨åã
+	- cpsr_<ãã£ã¼ã«ãæå®>
+	- spsr_<ãã£ã¼ã«ãæå®>
+
+<ãã£ã¼ã«ãæå®>ã«ã¯ï¼ä»¥ä¸ã®æå­ã®åãè¨è¿°ããï¼
+	- c â¦ PSRã®ããã7ã0ï¼Iãããï¼Fãããï¼Tãããï¼M[4:0]ï¼
+	- x â¦ PSRã®ããã15ã8ï¼IT[7:2]ï¼Eãããï¼Aãããï¼
+	- s â¦ PSRã®ããã23ã16ï¼GE[3:0]ï¼
+	- f â¦ PSRã®ããã31ã24ï¼N,Z,C,V,Qãã©ã°ï¼IT[1:0]ï¼Jãããï¼
+
+(2) msr<æ¡ä»¶> <ç¹æ®ã¬ã¸ã¹ã¿è¨è¿°>, <Rn>
+
+ç¹æ®ã¬ã¸ã¹ã¿ï¼ã®ä¸é¨ï¼ã«ï¼æ±ç¨ã¬ã¸ã¹ã¿Rnã®å¤ãã³ãã¼ããï¼<ç¹æ®ã¬ã¸ã¹ã¿
+è¨è¿°>ã¯ï¼ä¸ã¨åæ§ï¼
+
+âcps â¦ ARMv6ä»¥é
+
+ãã­ã»ããµã®ç¶æ
+ï¼CPSRã®Aãããï¼Iãããï¼Fãããï¼ãã­ã»ããµã¢ã¼ãï¼ã
+å¤æ´ããï¼
+
+(1) cpsie <å²è¾¼ã¿ãã©ã°>{, #<ã¢ã¼ã>}
+
+æå®ããå²è¾¼ã¿ãã©ã°ã0ã«ããï¼è¨±å¯ããï¼ï¼ã¾ãï¼ï¼æå®ããå ´åã«ã¯ï¼ã
+ã­ã»ããµã¢ã¼ããå¤æ´ããï¼
+
+<å²è¾¼ã¿ãã©ã°>ã«ã¯ï¼ä»¥ä¸ã®æå­ã®åãè¨è¿°ããï¼
+	- a â¦ Aãããï¼éåæã¢ãã¼ãç¦æ­¢ï¼
+	- i â¦ Iãããï¼IRQç¦æ­¢ï¼
+	- f â¦ Fãããï¼FIQç¦æ­¢ï¼
+
+<ã¢ã¼ã>ã«ã¯ï¼0ã31ã®å¤ï¼ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ã®ä¸ä½5ãããï¼ãè¨è¿°ããï¼
+
+ä¾ï¼cpsie	i				â¦ IRQãè¨±å¯ï¼cpsrä¸­ã®Iããããã¯ãªã¢ï¼
+
+(2) cpsid <å²è¾¼ã¿ãã©ã°>{, #<ã¢ã¼ã>}
+
+æå®ããå²è¾¼ã¿ãã©ã°ã1ã«ããï¼ç¦æ­¢ããï¼ï¼ã¾ãï¼ï¼æå®ããå ´åã«ã¯ï¼ã
+ã­ã»ããµã¢ã¼ããå¤æ´ããï¼<å²è¾¼ã¿ãã©ã°>ã¨<ã¢ã¼ã>ã¯ä¸ã¨åæ§ï¼
+
+ä¾ï¼cpsid	i				â¦ IRQãç¦æ­¢ï¼cpsrä¸­ã®Iããããã»ããï¼
+ä¾ï¼cpsid	if				â¦ IRQã¨FIQãç¦æ­¢
+ä¾ï¼cpsid	i,#CPSR_SVC_MODE â¦ IRQãç¦æ­¢ãã¦ï¼ã¹ã¼ããã¤ã¶ã¢ã¼ãã«
+
+(3) cps #<ã¢ã¼ã>
+
+ãã­ã»ããµã¢ã¼ããå¤æ´ããï¼<ã¢ã¼ã>ã¯ä¸ã¨åæ§ï¼
+
+ä¾ï¼cps		#CPSR_USR_MODE	â¦ ã¦ã¼ã¶ã¢ã¼ãã«
+
+âã­ã£ãã·ã¥ã¨åå²äºæ¸¬ï¼[2] B2.2ç¯ï¼
+
+ã»ä»¥åã®ã¢ã¼ã­ãã¯ãã£
+	- ARMv6ã«ã¤ãã¦ã¯ï¼[2] D12.6.2ç¯
+	- ARMv4, ARMv5ã«ã¤ãã¦ã¯ï¼[2] D15.6.1ç¯
+
+âã­ã£ãã·ã¥ã®è­å¥ï¼[2] B2.2.1ç¯ï¼
+
+ã»ã­ã£ãã·ã¥ã¿ã¤ãã¬ã¸ã¹ã¿ï¼CTRï¼
+	- æç­ã©ã¤ã³é·ãªã©ï¼ã©ã®ãããªã­ã£ãã·ã¥ãã¤ãã¦ããããèª­ã¿åºãã
+	- è©³ããã¯ï¼[2] B4.1.42ç¯
+	- ARMv6ä»¥åã¯ãã©ã¼ããããç°ãªã
+
+ã»ã­ã£ãã·ã¥ã¬ãã«IDã¬ã¸ã¹ã¿ï¼CLIDRï¼
+	- åã¬ãã«ï¼7ã¬ãã«ã¾ã§ï¼ã®ã­ã£ãã·ã¥ã®ã¿ã¤ããèª­ã¿åºãã
+	- ã³ãã¼ã¬ã³ã¹ã«é¢ããæ
+å ±ãèª­ã¿åºãã
+	- ARMv6ä»¥åã«ã¯ãªã
+
+ã»ã­ã£ãã·ã¥ãµã¤ãºé¸æã¬ã¸ã¹ã¿ï¼CSSELRï¼
+	- ç¾å¨ã®ã­ã£ãã·ã¥ãµã¤ãºIDã¬ã¸ã¹ã¿ï¼CCSIDRï¼ãé¸æãã
+	- ã­ã£ãã·ã¥ã¬ãã«ã¨ã¿ã¤ãï¼å½ä»¤ or ãã¼ã¿ï¼çµ±åï¼ãæå®ãã
+	- ARMv6ä»¥åã«ã¯ãªã
+
+ã»ã­ã£ãã·ã¥ãµã¤ãºIDã¬ã¸ã¹ã¿ï¼CCSIDRï¼
+	- ã­ã£ãã·ã¥ã¬ãã«æ¯ã«ããï¼CSSELRã§é¸æããï¼
+	- ã­ã£ãã·ã¥ã«é¢ããæ
+å ±ãèª­ã¿åºãã
+		+ write-throughï¼write-backï¼read-allocationï¼write-allocatioãã§ããã
+		+ ã»ããæ°ï¼é£æ³åº¦ï¼ã©ã¤ã³ãµã¤ãº
+	- ARMv6ä»¥åã«ã¯ãªã
+
+âã­ã£ãã·ã¥ã®æ¯èãï¼[2] B2.2.2ç¯ï¼
+
+ï¼çç¥ï¼
+
+âã­ã£ãã·ã¥ã®ã¤ãã¼ãã«ï¼ãã£ã¹ã¨ã¼ãã«ï¼[2] B2.2.3ç¯ï¼
+
+ã»ARMv7ã®ã·ã¹ãã å¶å¾¡ã¬ã¸ã¹ã¿
+	- Cãããã¨Iãããã§ï¼ã­ã£ãã·ã¥ã®ã¤ãã¼ãã«ï¼ãã£ã¹ã¨ã¼ãã«ãè¡ã
+	- Cãããï¼ãã¹ã¦ã®ã¬ãã«ã®çµ±åï¼ãã¼ã¿ã­ã£ãã·ã¥ãå¶å¾¡
+	- Iãããï¼ãã¹ã¦ã®ã¬ãã«ã®å½ä»¤ã­ã£ãã·ã¥ãå¶å¾¡
+	- ããç´°ããªå¶å¾¡ã¯å®è£
+ä¾å­
+
+ã»ARMv6ã®ã·ã¹ãã å¶å¾¡ã¬ã¸ã¹ã¿
+	- Cãããã¨Iãããã¯ï¼ã¬ãã«1ã­ã£ãã·ã¥ã®å¶å¾¡ãè¡ã
+	- Wãããã§ã©ã¤ããããã¡ã®å¶å¾¡ãè¡ã
+
+âARMv7ã«ãããã­ã£ãã·ã¥ã¨åå²äºæ¸¬ã®ã¡ã³ããã³ã¹æä½ï¼[2] B2.2.6ç¯ï¼
+
+ã»ä»¥åã®ã¢ã¼ã­ãã¯ãã£
+	- ARMv6ã«ã¤ãã¦ã¯ï¼[2] D12.7.10ç¯
+	- ARMv4, ARMv5ã«ã¤ãã¦ã¯ï¼[2] D15.7.8ç¯
+
+ã»ç¨èªã®å®ç¾©
+	- MVAï¼Modified Virtual Addressï¼
+		+ ã¡ã³ããã³ã¹ããå ´æãã¡ã¢ãªä¸­ã®ã¢ãã¬ã¹ã§æå®ãã
+		+ é«éã³ã³ãã­ã¹ãã¹ã¤ããæ¡å¼µããªãæã¯ï¼VAï¼Virtual Addressï¼ã«ä¸è´
+			ï¼é«éã³ã³ãã­ã¹ãã¹ã¤ããæ¡å¼µã¯ï¼ARMv6ä»¥éã§ã¯æ¨å¥¨ãããªã
+		+ MMUããªãæã¯PAï¼Physical Addressï¼ã«ä¸è´
+	- ã»ããï¼ã¦ã§ã¤ï¼set/wayï¼
+		+ ã¡ã³ããã³ã¹ããå ´æãã­ã£ãã·ã¥ä¸­ã®ã»ããã¨ã¦ã§ã¤ã§æå®ãã
+		+ ã¬ãã«ï¼Levelï¼â¦ ã­ã£ãã·ã¥ã®ã¬ãã«ï¼å°ããæ¹ããã­ã»ããµã«è¿ã
+		+ ã»ããï¼Setï¼
+		+ ã¦ã§ã¤ï¼Wayï¼
+	- ã¯ãªã¼ã³ï¼cleanï¼
+		+ èªåãè¡ã£ãæ´æ°ãï¼ä»ã®ãªãã¶ã¼ããããè¦ããããã«ä¿è¨¼ãã
+	- ç¡å¹åï¼invalidateï¼
+		+ ä»ã®ãªãã¶ã¼ããè¡ã£ãæ´æ°ãï¼èªåããè¦ããããã«ä¿è¨¼ãã
+		+ èªåãè¡ã£ãæ´æ°ãå¤±ããããã¨ã«ãªãå ´åããã
+	- ã¯ãªã¼ã³ã¨ç¡å¹åï¼clean and invalidateï¼
+		+ ã¯ãªã¼ã³ãè¡ã£ãå¾ã«ç¡å¹åãè¡ã
+	- PoCï¼ä¸è²«æ§ãã¤ã³ãï¼â¦ MVAã®å ´å
+		+ ãã¹ã¦ã®ã¨ã¼ã¸ã§ã³ããåç
+§ããå
+±éã®å ´æ
+		+ ä¸è¬ã«ã¯ã¡ã¤ã³ã¡ã¢ãª
+	- PoUï¼çµ±åãã¤ã³ãï¼â¦ MVAã®å ´å
+		+ ãã­ã»ããµã®PoUã¨ã¯ï¼ãã®ãã­ã»ããµã®å½ä»¤ï¼ãã¼ã¿ã¢ã¯ã»ã¹ï¼
+		  ãã¼ã¸ãã¼ãã«ã¦ã©ã¼ã¯ãåç
+§ããå
+±éã®å ´æ
+		+ Inner Shareableå
+±æãã¡ã¤ã³ã®PoUã¨ã¯ï¼ãã¡ã¤ã³å
+ã®ãã¹ã¦ã®
+		  ãã­ã»ããµã®å½ä»¤ï¼ãã¼ã¿ã¢ã¯ã»ã¹ï¼ãã¼ã¸ãã¼ãã«ã¦ã©ã¼ã¯ã
+		  åç
+§ããå
+±éã®å ´æ
+	- LoCï¼Level of Coherenceï¼
+		+ PoCã¾ã§ã®ä¸è²«æ§ãä¿ã¤ããã«ã¡ã³ããã³ã¹ãå¿
+è¦ãªæçµã­ã£ãã·ã¥
+		  ã¬ãã«
+	- LoUUï¼Level of Unification, Uniprocessorï¼
+		+ ãã­ã»ããµã®PoUã¾ã§ã®ä¸è²«æ§ãä¿ã¤ããã«ã¡ã³ããã³ã¹ãå¿
+è¦ãª
+		  æçµã­ã£ãã·ã¥ã¬ãã«
+	- LoUISï¼Level of unification, Inner Shareableï¼
+		+ Inner Shareableå
+±æãã¡ã¤ã³ã®PoUã¾ã§ã®ä¸è²«æ§ãä¿ã¤ããã«ã¡ã³
+		  ããã³ã¹ãå¿
+è¦ãªæçµã­ã£ãã·ã¥ã¬ãã«
+
+ã»ã¢ãã¬ã¹ï¼VMAï¼ãã¼ã¹ã®æä½ã«ãããã­ã£ãã·ã¥éå±¤ã®æ½è±¡å
+	- PoCãPoU
+	- ã­ã£ãã·ã¥ã¿ã¤ãã¬ã¸ã¹ã¿ï¼CTRï¼ã«ã­ã£ãã·ã¥ã®ã©ã¤ã³ãµã¤ãºãä¿æ
+		+ ãã®åä½ã§ã¡ã³ããã³ã¹ããã®ãæãå¹çç
+
+ã»ã»ããï¼ã¦ã§ã¤ãã¼ã¹ã®æä½ã«ãããã­ã£ãã·ã¥éå±¤ã®æ½è±¡å
+	- ã¯ãªã¼ã³æä½ã¯ï¼æå®ãããã¬ãã«ããï¼å°ãªãã¨ãæ¬¡ã®ã¬ãã«ã¸ã¯ãªã¼ã³ãã
+	- ç¡å¹åæä½ã¯ï¼æå®ãããã¬ãã«ã®ã¿ãç¡å¹åãã
+
+âVMSAã«ãããã­ã£ãã·ã¥ã¨åå²äºæ¸¬ã®ã¡ã³ããã³ã¹æä½ï¼[2] B4.2.1ç¯ï¼
+
+ã»ARMv7-Aï¼VMSAï¼ã«ãããã­ã£ãã·ã¥ã»åå²äºæ¸¬ã¡ã³ããã³ã¹æä½
+	- ICIALLIS, ICIALLU, ICIMVAU â¦ å½ä»¤ã­ã£ãã·ã¥ã¨åå²äºæ¸¬ã®ç¡å¹å
+	- BPIALLIS, CPIALL, CPIMVA	â¦ åå²äºæ¸¬ã®ç¡å¹å
+	- DCIMVAC, DCISW			â¦ ãã¼ã¿ï¼çµ±åã­ã£ãã·ã¥ã®ç¡å¹å
+	- DCCMVAC, DCCSW, DCCMVAU	â¦ ãã¼ã¿ï¼çµ±åã­ã£ãã·ã¥ã®ã¯ãªã¼ã³
+	- DCCIMVAC, DCCISW			â¦ ãã¼ã¿ï¼çµ±åã­ã£ãã·ã¥ã®ã¯ãªã¼ã³ï¼ç¡å¹å
+
+	----------------------------------------------------------------------
+	ICIALLUIS	ãã¹ã¦ã®å½ä»¤ã­ã£ãã·ã¥ãç¡å¹åï¼Inner ShareableããPoU
+				åå²äºæ¸¬ããã©ãã·ã¥
+	ICIALLU		PoUã¾ã§ã®ãã¹ã¦ã®å½ä»¤ã­ã£ãã·ã¥ãç¡å¹åï¼åå²äºæ¸¬ã
+	ICIMVAU		PoUã¾ã§ã®MVAã§æå®ããå½ä»¤ã­ã£ãã·ã¥ã©ã¤ã³ãç¡å¹å
+
+	BPIALLIS	ãã¹ã¦ã®åå²äºæ¸¬ã¨ã³ããªãç¡å¹åï¼Inner Sharable
+	BPIALL		ãã¹ã¦ã®åå²äºæ¸¬ã¨ã³ããªãç¡å¹å
+	BPIMVA		åå²äºæ¸¬ããMVAãç¡å¹å
+
+	DCIMVAC		PoCã¾ã§ã®MVAã§æå®ãããã¼ã¿ï¼çµ±åã­ã£ãã·ã¥ãç¡å¹å
+	DCISW		Set/wayã§æå®ãããã¼ã¿ï¼çµ±åã­ã£ãã·ã¥ãç¡å¹å
+	DCCMVAC		PoCã¾ã§ã®MVAã§æå®ãããã¼ã¿ï¼çµ±åã­ã£ãã·ã¥ãã¯ãªã¼ã³
+	DCCSW		Set/wayã§æå®ãããã¼ã¿ï¼çµ±åã­ã£ãã·ã¥ãã¯ãªã¼ã³
+	DCCMVAU		PoUã¾ã§ã®MVAã§æå®ãããã¼ã¿ï¼çµ±åã­ã£ãã·ã¥ãã¯ãªã¼ã³
+	DCCIMVAC	PoCã¾ã§ã®MVAã§æå®ãããã¼ã¿ï¼çµ±åã­ã£ãã·ã¥ãã¯ãªã¼ã³ï¼ç¡å¹å
+	DCCISW		Set/wayã§æå®ãããã¼ã¿ï¼çµ±åã­ã£ãã·ã¥ãã¯ãªã¼ã³ï¼ç¡å¹å
+	----------------------------------------------------------------------
+
+ã»ARMv6ã§ã®éãï¼[2] D12.7.10ç¯ï¼
+ã»ARMv4, ARMv5ã§ã®éãï¼[2] D15.7.8ç¯ï¼
+	- ã¬ãã«1ã­ã£ãã·ã¥ã®ã¿ãæä½ãã
+		â» ARMv7ã§ã¯è¤æ°ã®ã¬ãã«ã®ã­ã£ãã·ã¥ãæä½ãã
+	- ARMv7ã«å¯¾å¿ãããã®ãããï¼ä»¥ä¸ã§âã®å³ã¯ï¼ARMv7ã®åç­ã®æä½ï¼
+		+ Invalidate instruction cache âICIALLU
+		+ Invalidate instruction cache line by MVA âICIMVAU
+		+ Invalidate all branch predictors âBPIALL
+		+ Invalidate branch predictor entry by MVA âBPIMVA
+		+ Invalidate data cache line by MVA âDCIMVAC
+		+ Invalidate data cache line by set/way âDCISW
+		+ Clean data cache line by MVA âDCCMVAC/DCCMVAU
+		+ Clean data cache line by set/way âDCCSW
+		+ Clean and Invalidate data cache line by MVA âDCCIMVAC
+		+ Clean and Invalidate data cache line by set/way âDCCISW
+
+	- ãã¼ã¿ã­ã£ãã·ã¥å
+¨ä½ã«å¯¾ããæä½ã¯ARMv7ã«ã¯ãªã
+		+ Invalidate data cache
+		+ Clean data cacheï¼ARMv6ã®ã¿ï¼
+		+ Clean and Invalidate data cacheï¼ARMv6ã®ã¿ï¼
+	- ARMv7ã§ã¯ï¼çµ±åã­ã£ãã·ã¥ã®æä½ã¯ï¼ãã¼ã¿ã­ã£ãã·ã¥ã®æä½ã«çµ±ä¸ã
+	  ãã¦ãããï¼ARMv6ä»¥åã§ã¯å¥ã
+ã«ãã
+		+ Invalidate unified cache, or instruction cache and data cache
+		+ Invalidate unified cache line by MVA
+		+ Invalidate unified cache line by set/way
+		+ Clean entire unified cache
+		+ Clean unified cache line by MVA
+		+ Clean unified cache line by set/way
+		+ Clean and invalidate entire unified cache
+			æ³¨æï¼ãã®æä½ã¯[1]ã«æ²è¼ããã¦ãããï¼[2]ã«ã¯æ²è¼ããã¦ããªã
+		+ Clean and Invalidate unified cache line by MVA
+		+ Clean and Invalidate unified cache line by set/way
+	- Set/wayæå®ã«ããå½ä»¤ã­ã£ãã·ã¥ã®ç¡å¹åã¯ARMv7ã«ã¯ãªã
+		+ Invalidate instruction cache line by set/way
+	- ARMv6ä»¥åã®ã¿ã«ããæä½ï¼ãªãã·ã§ã³ï¼
+		+ Test and Clean data cache â¦ ä¸ã«èª¬æ
+		+ Test and Clean and Invalidate data cache â¦ ä¸ã«èª¬æ
+		+ Prefetch instruction cache line by MVA â¦ TLBã­ãã¯ãã¦ã³ã§ä½¿ã
+	- ARMv6ã®ã¿ã«ããç¹æ®ãªæä½
+		+ Cache Dirty Status Register â¦ å
+¨ä½ãã¯ãªã¼ã³ããæã«ä½¿ã
+
+ã»ARMv6ä»¥åã§ã®ï¼Test and Cleanï¼Test and Clean and Invalidateã®ä½¿ãæ¹
+	- ã¯ãªã¼ã³ï¼ã¯ãªã¼ã³ï¼ç¡å¹åãå¹ççã«è¡ãããã«ç¨æããã¦ãã
+	- æ¡ä»¶ãã©ã°ããã¹ãã£ãã¼ã·ã§ã³ã¨ããMRCå½ä»¤ãä½¿ã
+		â ã°ã­ã¼ãã«ã­ã£ãã·ã¥ãã¼ãã£ç¶æ
+ãZãã©ã°ã«å
+¥ã
+
+	- ãã¼ã¿ã­ã£ãã·ã¥å
+¨ä½ã®ã¯ãªã¼ã³
+	  tc_loop:
+		MRC p15, 0, APSR_nzcv, c7, c10, 3 ; test and clean
+		BNE tc_loop
+
+	- ãã¼ã¿ã­ã£ãã·ã¥å
+¨ä½ã®ã¯ãªã¼ã³ï¼ç¡å¹å
+	  tci_loop:
+		MRC p15, 0, APSR_nzcv, c7, c14, 3 ; test, clean and invalidate
+		BNE tci_loop
+
+âTLBã®ã¡ã³ããã³ã¹æä½
+
+âVMSAã«ãããTLBã®ã¡ã³ããã³ã¹æä½ï¼[2] B4.2.2ç¯ï¼
+
+â» Hypã¢ã¼ãã®æã¯å¥éè¦å®
+
+ã»ARMv7-Aï¼VMSAï¼ã«ãããTLBã¡ã³ããã³ã¹æä½
+	- ITLBIALL, ITLBIMVA, ITLBIASID â¦ å½ä»¤TLB
+	- DTLBIALL, DTLBIMVA, DTLBIASID â¦ ãã¼ã¿TLB
+	- TLBIALL, TLBIMVA, TLBIASID â¦ çµ±åTLB
+
+ã»ãã«ããã­ã»ããµæ¡å¼µã§ä»¥ä¸ãè¿½å ï¼åæã®ARMv7ã«ã¯ãªãï¼
+	- TLBIMVAA
+	- TLBIALLIS, TLBIMVAIS, TLBIASIDIS, TLBIMVAAIS
+
+ã»å½ä»¤ï¼ãã¼ã¿ï¼çµ±åã®ä½¿ãåã
+	- å½ä»¤TLBã¨ãã¼ã¿TLBãå¥ã«å®è£
+ããã¦ããå ´åï¼çµ±åTLBæä½ã¯ä¸¡è
+ãæä½ãã
+	- çµ±åTLBãå®è£
+ããã¦ããå ´åï¼å½ä»¤ï¼ãã¼ã¿TLBæä½ã¯çµ±åTLBãæä½ãã
+	- å½ä»¤ï¼ãã¼ã¿TLBæä½ãä½¿ããã¨ã¯æ¨å¥¨ããªã
+
+ã»æä½ã®ç¨®é¡
+	...IALL â¦ ãã¹ã¦ã®TLBãç¡å¹åãã
+	...IMVA â¦ ã¢ãã¬ã¹ï¼MVAï¼æå®ã§TLBãç¡å¹åãã
+	...IASID â¦ ASIDæå®ã§TLBãç¡å¹åãã
+	...IMVAA â¦ ã¢ãã¬ã¹ã¨ASIDã®ä¸¡æ¹ãæå®ãã¦TLBãç¡å¹åãã
+
+ã»ä»¥åã®ã¢ã¼ã­ãã¯ãã£
+	- ARMv6ã«ã¤ãã¦ã¯ï¼ARMv7-Aã¨åã
+	- ARMv4, ARMv5ã«ã¤ãã¦ã¯ï¼ä»¥ä¸ã®ã¿ãæã¤ï¼[2] D15.7.10ç¯ï¼
+		+ ITLBIALL, ITLBIMVA â¦ å½ä»¤TLB
+		+ DTLBIALL, DTLBIMVA â¦ ãã¼ã¿TLB
+		+ TLBIALL, TLBIMVA â¦ çµ±åTLB
+
+âã¡ã¢ãªã¿ã¤ãã»å±æ§ã¨ã¡ã¢ãªé åºã¢ãã«ï¼[2] A3.5ç¯ï¼
+
+âã¡ã¢ãªã¿ã¤ãï¼[2] A3.5.1ç¯ï¼
+
+ã»3ã¤ã®ã¡ã¢ãªã¿ã¤ãï¼ARMv6ä»¥éï¼
+	Normal
+	Device
+	Strongly-ordered
+
+ã»Strongly-orderedï¼Deviceã¡ã¢ãªã«ã¯ï¼ä»¥ä¸ã®å¶éãããï¼
+	- ã¢ã¯ã»ã¹ã®åæ°ï¼é åºï¼ãµã¤ãºãä¿å­ãããï¼ã­ã£ãã·ã¥ãããªãï¼ï¼
+	- ãªã¼ãã»ã©ã¤ãã¨ãï¼ææ©çã«å®è¡ãããªãï¼
+		+ ãã ãï¼ãã¼ã¸ãã¼ãã«ã¦ã©ã¼ã¯ã¯ææ©çã«å®è¡ãããï¼
+	- ãªã¼ãã»ã©ã¤ãã¢ã¯ã»ã¹ãç¹°ãè¿ãããªãï¼
+
+âã¡ã¢ãªå±æ§ï¼[2] A3.5.2ç¯ï¼
+
+ã»å
+±æå¯è½æ§ï¼Shareabilityï¼
+	- Normalã¨ï¼LPAEãå«ã¾ãªãå®è£
+ã§ã¯ï¼Deviceã«é©ç¨ãããï¼
+		â» LPAEï¼Large Physical Address Extension
+		+ LPAEãå«ãå®è£
+ã§ã¯ï¼Deviceã¯å¸¸ã«Outer Shareable
+		+ DeviceãShareableã¨Outer Shareableä»¥å¤ã«ãããã¨ã¯æ¨å¥¨ããªãï¼
+	- Outer Shareable
+	- Inner Shareable
+	- Non-shareable
+	- Outer Shareableã¨Inner Shareableã®åºå¥ã¯ARMv7ãã
+
+ã»ã­ã£ãã·ã¥å¯è½æ§ï¼Cacheabilityï¼
+	- Normalã«é©ç¨ãããï¼
+		+ Innerã¨Outerã­ã£ãã·ã¥é åã«ç¬ç«ã«è¨­å®ã§ããï¼
+	- Non-cacheable
+	- Write-Through Cacheable
+	- Write-Back Cacheable
+
+âAtomicityï¼åå­æ§ï¼[2] A3.5.3ç¯ï¼
+
+	- Single-copy atomicity
+	- Multi-copy atomicity
+
+âConcurrent modification and execution of instructionsï¼[2] A3.5.4ç¯ï¼
+
+âNormalã¡ã¢ãªï¼[2] A3.5.5ç¯ï¼
+
+âDeviceã¨Strongly-orderedã¡ã¢ãªï¼[2] A3.5.6ç¯ï¼
+	- ARMv7ã§ã¯ï¼Deviceã¨Strongly-orderedã®éãã¯shareabilityã®ã¿
+		+ ARMv6ã§ã¯ï¼CPSRå¤æ´æã®æ¯èãã«ãéããããï¼
+	- Deviceã¨Strongly-orderedã®ã¢ã¼ã­ãã¯ãã£è¦æ±ã®éãã¯ï¼
+		+ Strongly-orderedã¡ã¢ãªã¸ã®ã©ã¤ãã¯ï¼ã¡ã¢ãªï¼ããªãã§ã©ã«ï¼ã«
+		  å°éããå¾ã§ãªãã¨å®äºããªã
+		+ Deviceã¡ã¢ãªã¸ã®ã©ã¤ãã¯ï¼ã¡ã¢ãªï¼ããªãã§ã©ã«ï¼ã«å°éããå
+		  ã§ãå®äºã§ãã
+
+âã¡ã¢ãªé åºã¢ãã«ï¼[1] B2.1ç¯ï¼
+
+ã»ARMv5ã¾ã§ã¯ï¼ã¡ã¢ãªã¢ã¯ã»ã¹é åºã«é¢ãã¦æ´çããã¦ããªãã£ã
+	- å®è£
+ã«åºã¥ãã¦ä»¥ä¸ã®ãããªæ¦å¿µããã£ã
+		+ Write-Through Cacheable, Write-Back Cacheable
+		+ Non-Cacheable Bufferable, Non-Cacheable, Non-Bufferable
+	- VMSA/PMSAã®Bï¼bufferableï¼ãããã¨Cï¼cacheableï¼ãããã§å¶å¾¡
+	- äºææ§ããªããªã©ã®èª²é¡ãçãã¦ãã
+
+ã»ã¡ã¢ãªå±æ§
+	Shareableï¼ã¾ãã¯ Sharedï¼â¦ è¤æ°ã®è¦³æ¸¬è
+ããä¸è²«ãã¦è¦ããã
+
+ã»ä»ã®é¢ä¿è¨è¿°
+	VMSA on MMUï¼PMSA on MPUï¼ã­ã£ãã·ã¥ã¨åå²äºæ¸¬
+		VMSAï¼Virtual Memory System Architecture
+		PMSAï¼Protected Memory System Architecture
+
+âã¡ã¢ãªã¢ã¯ã»ã¹é åºï¼[2] A3.8ç¯ï¼
+
+âãªã¼ãã¨ã©ã¤ã
+
+ã»æç¤ºçã§ãªãã¡ã¢ãªã¢ã¯ã»ã¹ï¼ã¡ã¢ãªã¢ã¯ã»ã¹é åºã®è­°è«ã¯å½ã¦ã¯ã¾ããªãï¼
+	- å½ä»¤ãã§ãã
+	- ã­ã£ãã·ã¥ã®ã­ã¼ãã¨ã©ã¤ãããã¯
+	- å¤æãã¼ãã«ã®ã¦ã©ã¼ã¯
+
+ã»ãªã¼ã â¦ æç¤ºçãªã¡ã¢ãªã¢ã¯ã»ã¹
+	- LDR, LDRB, LDRH, LDRSB, LDRSH
+	- LDRT, LDRBT, LDRHT, LDRSBT, LDRSHT
+	- LDREX, LDREXB, LDREXD, LDREXH â¦ åæããªããã£ã
+	- LDM, LDRD, POP, RFE
+	- LDC, LDC2, VLDM, VLDR, VLD1, VLD2, VLD3, VLD4, VPOP
+	- STREX, STREXB, STREXD, STREXH ã«ããã¹ãã¼ã¿ã¹å¤ã®è¿å´
+	- SWP, SWPBï¼ARMå½ä»¤ã»ããï¼â¦ åæããªããã£ãï¼ARMv6ä»¥éã§ã¯éæ¨å¥¨
+	- TBB, TBHï¼Thumbå½ä»¤ã»ããï¼
+	ï¼ä»ã«Jazelleé¢ä¿
+
+ã»ã©ã¤ã â¦ æç¤ºçãªã¡ã¢ãªã¢ã¯ã»ã¹
+	- STR, STRB, STRH
+	- STRT, STRBT, STRHT
+	- STREX, STREXB, STREXD, STREXH â¦ åæããªããã£ã
+	- STM, STRD, PUSH, SRS
+	- STC, STC2, VPUSH, VSTM, VSTR, VST1, VST2, VST3, VST4
+	- SWP, SWPBï¼ARMå½ä»¤ã»ããï¼â¦ åæããªããã£ãï¼ARMv6ä»¥éã§ã¯éæ¨å¥¨
+	ï¼ä»ã«Jazelleé¢ä¿
+
+ã»è¦³æ¸¬è
+
+	- è¦³æ¸¬è
+ï¼observerï¼ã¨ã¯ï¼ã·ã¹ãã ä¸­ã§ã¡ã¢ãªã«ã¢ã¯ã»ã¹ã§ãããã®
+	- ãã­ã»ããµã®ä»¥ä¸ã®æ©æ§ã¯ç¬ç«ããè¦³æ¸¬è
+ã¨æ±ã
+		+ ã¡ã¢ãªã®ãªã¼ãã¨ã©ã¤ããè¡ãæ©æ§
+		+ å½ä»¤ãã§ããï¼å½ä»¤ã­ã£ãã·ã¥ã®ãã£ã«ï¼ç´æ¥ãã§ããï¼ã®æ©æ§
+		+ å¤æãã¼ãã«ã¦ã©ã¼ã¯ãè¡ãæ©æ§
+
+ã»è¦³æ¸¬ã§ããï¼ã°ã­ã¼ãã«ã«è¦³æ¸¬ã§ããã¨ã¯ï¼
+
+	ï¼ã¡ã¢ãªã¸ã®ã¢ã¯ã»ã¹é åºã¯ï¼ãã¹ã¦ã®ãªãã¶ã¼ãã§ä¸è²«ãã¦ãããã¨ãæ³å®
+
+	- ããã¡ã¢ãªä½ç½®ã¸ã®ã©ã¤ããï¼ããè¦³æ¸¬è
+ããè¦³æ¸¬ã§ããã¨è¨ãã®ã¯â¦
+		+ åãè¦³æ¸¬è
+ããã®ã¡ã¢ãªä½ç½®ãããä»¥éã«ãªã¼ãããå ´åã«ï¼ä»¥ä¸ã®ã
+		  ãããã«ãªã
+			* æ¸ãè¾¼ãã å¤ãåç
+§ã§ããï¼
+			* ä»»æã®è¦³æ¸¬è
+ã«ãã£ã¦ï¼ããããå¾ã«æ¸ãè¾¼ã¾ããå¤ãåç
+§ã§ãã
+		+ ãã¤ï¼åãè¦³æ¸¬è
+ããã®ã¡ã¢ãªä½ç½®ã«ããä»¥éã«æ¸ãè¾¼ãã å ´åã«ï¼
+				å¾è
+ã®ã©ã¤ãã®æ¹ãå¾ã«å®è¡ããããã®ã¨é åºä»ããããæ
+
+	- ããShareableãªã¡ã¢ãªä½ç½®ã¸ã®ã©ã¤ããï¼ã°ã­ã¼ãã«ã«è¦³æ¸¬ã§ããã¨è¨
+	  ãã®ã¯â¦
+		+ ä»»æã®è¦³æ¸¬è
+ããã®ã¡ã¢ãªä½ç½®ãããä»¥éã«ãªã¼ãããå ´åã«ï¼ä»¥ä¸ã®
+		  ããããã«ãªã
+			* æ¸ãè¾¼ãã å¤ãåç
+§ã§ããï¼
+			* ä»»æã®è¦³æ¸¬è
+ã«ãã£ã¦ï¼ããããå¾ã«æ¸ãè¾¼ã¾ããå¤ãåç
+§ã§ãã
+		+ ãã¤ï¼ä»»æã®è¦³æ¸¬è
+ããã®ã¡ã¢ãªä½ç½®ã«ããä»¥éã«æ¸ãè¾¼ãã å ´åã«ï¼
+				å¾è
+ã®ã©ã¤ãã®æ¹ãå¾ã«å®è¡ããããã®ã¨é åºä»ããããæ
+
+	- ããã¡ã¢ãªä½ç½®ã¸ã®ãªã¼ããï¼ããè¦³æ¸¬è
+ããè¦³æ¸¬ã§ããã¨è¨ãã®ã¯â¦
+		+ åãè¦³æ¸¬è
+ããã®ã¡ã¢ãªä½ç½®ã«ããä»¥éã«æ¸ãè¾¼ãã å ´åã§ãï¼
+								ãªã¼ãã«ãã£ã¦è¿ãå¤ãå½±é¿ãããªãæ
+
+	- ããShareableãªã¡ã¢ãªä½ç½®ã¸ã®ãªã¼ããï¼ã°ã­ã¼ãã«ã«è¦³æ¸¬ã§ããã¨
+	  è¨ãã®ã¯â¦
+		+ ä»»æã®è¦³æ¸¬è
+ããã®ã¡ã¢ãªä½ç½®ã«ããä»¥éã«æ¸ãè¾¼ãã å ´åã§ãï¼
+								ãªã¼ãã«ãã£ã¦è¿ãå¤ãå½±é¿ãããªãæ
+
+	Strongly-orderedã¡ã¢ãªã®å ´åã«ã¯ï¼ããã«ï¼
+
+	- å¯ä½ç¨ã®ããããªãã§ã©ã«ãã¡ã¢ãªããããããã¡ã¢ãªä½ç½®ã®ãªã¼ãã¾
+	  ãã¯ã©ã¤ããè¦³æ¸¬ã§ããã¨ã¯ï¼ãªã¼ãã»ã©ã¤ããä»¥ä¸ã®æ¡ä»¶ãæºã
+	  ãæ
+		+ ãªã¹ãã¢ããããã¦ããä¸è¬çãªæ¡ä»¶ãæºãã
+		+ ããªãã§ã©ã«ã®ç¶æ
+ã«å½±é¿ãéå§ãã
+		+ ä»ã®ããªãã§ã©ã«ï¼ãã­ã»ããµï¼ã¡ã¢ãªã«å½±é¿ããå ´åã«ã¯ï¼é¢é£ã
+		  ãå¯ä½ç¨ãããªã¬ãã
+		ï¼è¨ãæããã¨ï¼ã¡ã¢ãªã¢ã¯ã»ã¹ãããªãã§ã©ã«ã«å°éãããã¨
+
+ã»ãªã¼ãã»ã©ã¤ãã®å®äºã¨ã¯â¦ ï¼çç¥ï¼
+
+ã»Strongly-orderãDeviceã¡ã¢ãªã¢ã¯ã»ã¹ã®å®äºã¯ï¼ãã¹ã¦ã®å¯ä½ç¨ããã¹ã¦
+ãã®è¦³æ¸¬è
+ã«è¦ããããã«ãªã£ããã¨ãæå³ããªã
+
+âã¡ã¢ãªã¢ã¯ã»ã¹ã®é åºè¦æ±ï¼[2] A3.8.2ï¼
+
+ã»ç¨èªã®å®ç¾©
+
+	ã¢ãã¬ã¹ä¾å­æ§ï¼ãªã¼ãã¢ã¯ã»ã¹ã«ãã£ã¦è¿ãããå¤ãï¼å¾ç¶ã®èª­ã¿åº
+	ããã©ã¤ãã¢ã¯ã»ã¹ã®ä»®æ³ã¢ãã¬ã¹ã®è¨ç®ã«ä½¿ãããï¼å¿
+ãããï¼ä»®æ³
+	ã¢ãã¬ã¹ãå¤ããã¨ã¯éããªãï¼æï¼ã¢ãã¬ã¹ä¾å­æ§ãããã¨è¨ãï¼
+
+	å¶å¾¡ä¾å­æ§ï¼ãªã¼ãã¢ã¯ã»ã¹ã«ãã£ã¦è¿ãããå¤ãï¼æ¡ä»¶ãã©ã°ãæ±ºå®
+	ãï¼æ¡ä»¶ãã©ã°ã®å¤ãï¼å¾ç¶ã®ãªã¼ãã¢ã¯ã»ã¹ã®ã¢ãã¬ã¹æ±ºå®ã«ä½¿ãã
+	ãï¼æ¡ä»¶ä»ãå®è¡ãæ¡ä»¶åå²ï¼æï¼å¶å¾¡ä¾å­æ§ãããã¨è¨ãï¼
+
+ã»ä¸ã®è¡¨ã¯ï¼æç¤ºçãªã¢ã¯ã»ã¹A1ã¨A2ããã®ãã­ã°ã©ã é åºã§å®è¡ãããæã®
+ãã¡ã¢ãªã¢ã¯ã»ã¹é åºãç¤ºãï¼"<"ã¯ï¼ã¡ã¢ãªããããããããªãã§ã©ã«ã¾ãã¯
+ãã¡ã¢ãªãã­ãã¯ã«ï¼ãã­ã°ã©ã é åºã§ã¢ã¯ã»ã¹ãå±ããã¨ãç¤ºãï¼
+
+						A2
+	A1					Normal		Device		Strongly-ordered
+	Normal				-			-			-
+	Device				-			<			<
+	Strongly-ordered	-			<			<
+
+ãï¼ã¡ã¢ãªããããããããªãã§ã©ã«ã¨ã¡ã¢ãªãã­ãã¯ã®ãµã¤ãºã¯ï¼å®è£
+å®ç¾©
+	ï¼ãã ãï¼1KBä»¥ä¸ï¼ã§ããï¼éã«è¨ãã¨ï¼1KBãè¶
+ãããµã¤ãºã®ã¡ã¢ãªã
+	ã­ãã¯ã«ã¯ï¼ã¡ã¢ãªã¢ã¯ã»ã¹é åºã®ä¿è¨¼ãå®è£
+ä¾å­ã«ãªãï¼
+
+ã»æç¤ºçã§ãªãã¡ã¢ãªã¢ã¯ã»ã¹ã«ã¯ï¼ã¢ã¯ã»ã¹é åºè¦æ±ããªãï¼
+
+ã»ãã®ä»ã«ï¼ä»¥ä¸ã®å¶ç´ãããï¼
+	- åä¸ã®è¦³æ¸¬è
+ããã®ã¢ã¯ã»ã¹ã¯ï¼ã¦ããã­ã»ããµã®ã»ãã³ãã£ãã¯ã¹ï¼å½
+	  ä»¤éã®ä¾å­é¢ä¿ï¼ã³ãã¼ã¬ã³ã·ï¼ãç¶­æãããï¼
+	- ã¢ãã¬ã¹ä¾å­æ§ãããã°ï¼ã©ã®ãªãã¶ã¼ãããããã­ã°ã©ã é åºã«è¦ããï¼
+	- å¶å¾¡ä¾å­æ§ã ãã§ã¯ï¼ä¸ã®å¶ç´ã¯ä¿è¨¼ãããªãï¼
+	- ãªã¼ãã¢ã¯ã»ã¹ãè¿ããå¤ãï¼å¾ç¶ã®ã©ã¤ãã¢ã¯ã»ã¹ã«ãã£ã¦ä½¿ãã
+	  ãå ´åï¼
+
+	ï¼æªå®æï¼
+
+ã»å½ä»¤å®è¡ã®ãã­ã°ã©ã é åº
+	- å½ä»¤å®è¡ã®ãã­ã°ã©ã é åºã¯ï¼ãã­ã°ã©ã ã®åç´ãªã·ã¼ã±ã³ã·ã£ã«å®è¡
+	  ã«ãããå½ä»¤ã®é åºã§ããï¼
+
+	- å®è¡ã«ãããæç¤ºçãªã¡ã¢ãªã¢ã¯ã»ã¹ã¯ï¼ä»¥ä¸ã®ããããã§ãã
+		Strictly Ordered	<		å³å¯ã«é åºéãèµ·ãã
+		Ordered				<=		é åºéãèµ·ãããï¼åæã«èµ·ãã
+
+	ï¼æªå®æï¼
+
+âã¡ã¢ãªããªã¢ï¼[2] A3.8.3ï¼
+
+ã»ARMv6ã¨ARMv7ã¯ï¼3ã¤ã®æç¤ºçãªã¡ã¢ãªããªã¢æ©è½ãæã¤ï¼
+	- ARMv7ã§ã¯ï¼ã¡ã¢ãªããªã¢ã¯å½ä»¤ã§å®ç¾ãããï¼
+	- ARMv6ã§ã¯ï¼ã¡ã¢ãªããªã¢ã¯CP15ã¬ã¸ã¹ã¿ã¸ã®ã©ã¤ãã§å®ç¾ãããï¼
+
+	- ãã¼ã¿ã¡ã¢ãªããªã¢ï¼DMBï¼
+	- ãã¼ã¿åæããªã¢ï¼DSBï¼
+	- å½ä»¤åæããªã¢ï¼ISBï¼
+
+	- DMBã¨DSBã¯ï¼ã­ã¼ãï¼ã¹ãã¢å½ä»¤ã«ããã¡ã¢ãªã¢ã¯ã»ã¹ãï¼ãã­ã»ããµ
+	  ã«ãããã¼ã¿ã¾ãã¯çµ±åã­ã£ãã·ã¥ã®ä¿å®æä½ã«å½±é¿ããï¼å½ä»¤ãã§ã
+	  ãããã¼ãã¦ã§ã¢å¤æãã¼ãã«ã¢ã¯ã»ã¹ã«ããã¡ã¢ãªã¢ã¯ã»ã¹ã¯ï¼æç¤º
+	  çãªã¢ã¯ã»ã¹ã§ã¯ãªãï¼ãããã«ã¯å½±é¿ããªãï¼ï¼
+
+ã»ãã¼ã¿ã¡ã¢ãªããªã¢ï¼DMBï¼
+
+ããARMv6ã§ã®èª¬æï¼[1] B.2.6.1ï¼ã
+	- DMBããåã®ãã­ã°ã©ã é åºã®å½ä»¤ã«ãããã¹ã¦ã®æç¤ºçãªã¡ã¢ãªã¢ã¯ã»
+	  ã¹ã¯ï¼DMBããå¾ã®ãã­ã°ã©ã é åºã®å½ä»¤ã«ãããã¹ã¦ã®æç¤ºçãªã¡ã¢ãª
+	  ã¢ã¯ã»ã¹ãè¦³æ¸¬ãããåã«ï¼ã°ã­ã¼ãã«ã«è¦³æ¸¬ã§ããï¼
+	- DMBã¯ï¼ãã®ãã­ã»ããµã§å®è¡ãããä»ã®å½ä»¤ã®å®è¡é åºã«ã¯å½±é¿ããªãï¼
+	âDMBã¯ï¼åå¾ã®å½ä»¤ã®æç¤ºçãªã¡ã¢ãªæä½ã®é åºãä¿è¨¼ããï¼ãããã®å®
+	  äºã¯ä¿è¨¼ããªãï¼ãã®æã¯æå³ä¸æï¼ï¼
+
+ããARMv7ã§ã®éãã
+	- å
+±æå¯è½ãã¡ã¤ã³ã¨ã¢ã¯ã»ã¹ã¿ã¤ããå¼æ°ã«åãï¼
+		+ ããã©ã«ãã¯ï¼ã·ã¹ãã å
+¨ä½ã§ï¼ãªã¼ãã»ã©ã¤ãã®ä¸¡æ¹ï¼
+	- ã¢ã¯ã»ã¹ã®ç¨®é¡ãã°ã«ã¼ãAã¨ã°ã«ã¼ãBã«åãï¼ããã«è©³ç´°ã«å®ç¾©ï¼
+
+ã»ãã¼ã¿åæããªã¢ï¼DSBï¼
+
+ããARMv6ã§ã®èª¬æï¼[1] B.2.6.2ï¼ã
+	- DSBãå®äºããã®ã¯ï¼DSMã®åã®æç¤ºçãªã¡ã¢ãªã¢ã¯ã»ã¹ããã¹ã¦å®äºãï¼
+	  ãã¤ï¼ãã®å½ä»¤ã«å
+è¡ããã­ã£ãã·ã¥ï¼åå²äºæ¸¬ï¼TLBä¿å®æä½ããã¹ã¦
+	  å®äºããå¾ã§ããï¼
+	- DSBã®å¾ç¶ã®å½ä»¤ã¯ï¼DSBãããã¾ã§å®è¡ãããªãï¼
+
+ããARMv7ã§ã®éãã
+	- å
+±æå¯è½ãã¡ã¤ã³ã¨ã¢ã¯ã»ã¹ã¿ã¤ããå¼æ°ã«åãï¼
+		+ ããã©ã«ãã¯ï¼ã·ã¹ãã å
+¨ä½ã§ï¼ãªã¼ãã»ã©ã¤ãã®ä¸¡æ¹ï¼
+	- å
+è¡ããã­ã£ãã·ã¥ï¼åå²äºæ¸¬ï¼TLBä¿å®æä½ã®å®äºãå¾
+ã¤ã®ã¯ï¼ã¢ã¯ã»
+	  ã¹ã¿ã¤ãããªã¼ãã»ã©ã¤ãã®ä¸¡æ¹ã®å ´åã«éãï¼
+
+	- ARMv6ä»¥åã¯ï¼DWBï¼DrainWriteBufferã¾ãã¯DataWriteBarrierï¼ã¨ãå¼
+	  ã°ãã¦ããï¼
+
+ã»å½ä»¤åæããªã¢ï¼ISBï¼
+	- ISBã®å¾ç¶ã®å½ä»¤ãï¼ISBãå®äºããå¾ã«ã­ã£ãã·ã¥ã¾ãã¯ã¡ã¢ãªãã
+	  ãã§ãããããããã«ï¼ãã­ã»ããµã®ãã¤ãã©ã¤ã³ããã©ãã·ã¥ããï¼
+
+	- ARMv6ã§ã¯ï¼PrefetchFlushã¨å¼ã°ãã¦ããï¼
+
+	- ISBã®åã«å®è¡ãããã³ã³ãã­ã¹ãå¤æ´æä½ãï¼ISBã®å¾ã«ãã§ãããã
+	  ãå½ä»¤ããè¦ãããã¨ãä¿è¨¼ããï¼ã³ã³ãã­ã¹ãå¤æ´æä½ã®ä¾ã¯ï¼
+		+ ASIDã®å¤æ´ â¦ [2]ã«æ¸ããã¦ãã
+		+ å®äºããï¼âæå³ä¸æï¼ã­ã£ãã·ã¥ã»TLBã»åå²äºæ¸¬ä¿å®æä½
+		+ ã·ã¹ãã å¶å¾¡ã¬ã¸ã¹ã¿ï¼CP15ã¬ã¸ã¹ã¿ï¼ã®å¤æ´ãªã©
+
+	- ISBã®å¾ã®åå²å½ä»¤ãï¼ISBã®å¾ã«è¦ããã³ã³ãã­ã¹ãã®åå²äºæ¸¬ã­ã¸ã
+	  ã¯ã«æ¸ãè¾¼ã¾ãããã¨ãä¿è¨¼ããï¼ããã¯ï¼å½ä»¤åãæ­£ããå®è¡ããã
+	  ãã¨ãä¿è¨¼ããããã«å¿
+è¦ï¼
+	- å½ä»¤ãåçã«æ¸ãæããå ´åã«ã¯ï¼ISBã¨DMBï¼DSBã®ä¸¡æ¹ãä½¿ãå¿
+è¦ãã
+	  ãï¼
+
+âCPSRã®å¤æ´ã¨ã¡ã¢ãªé åºã¢ãã«ï¼[1] B2.7.7ï¼
+
+ã»CPSï¼SETENDï¼MSRå½ä»¤ã«ããCPSRã®å¤æ´ï¼ä¾å¤ã®çºçï¼ãªã¿ã¼ã³ãä¼´ããªã
+ãCPSRã«å¯¾ããæä½ï¼ã¯ï¼
+	- æåã®å½ä»¤ã«å½±é¿ããªããã¨ãä¿è¨¼ãããï¼
+	- ä»¥ä¸ãé¤ãã¦ï¼å¾ç¶ã®å½ä»¤ããè¦ãããã¨ãä¿è¨¼ãããï¼
+		+ å½ä»¤ãã¼ããã·ã§ã³ã®ãã§ãã¯ã«å¯¾ããå¹æ
+
+ã»CPSRã®å¤æ´ã«ããï¼ç¹æ¨©ï¼ã¾ãã¯ã»ã­ã¥ãªãã£ï¼ç¶æ
+ãå¤æ´ãããå ´åã«ã¯ï¼
+ãå½ä»¤ãã¼ããã·ã§ã³ã®å¹æãè¦ããããã«ã¯ï¼ISBï¼ä¾å¤ã®çºçï¼ä¾å¤ããã®
+ããªã¿ã¼ã³ã®ãããããçµãªããã°ãªããªãï¼
+
+ã»ARMv6ã§ã¯ï¼CPSRã®å²è¾¼ã¿ãã¹ã¯ãå¤æ´ããå½ä»¤ã¯ï¼æåã®Strongly-ordered
+ãã¢ã¯ã»ã¹ãå®äºããã®ãå¾
+ã¤ãï¼ãã®ä»æ§ã¯ARMv7ã«ã¯é©ç¨ãããªãï¼åæã
+ãå¿
+è¦ãªå ´åã«ã¯ï¼Strongly-orderedã¢ã¯ã»ã¹ãããå½ä»¤ã®ç´å¾ã«ï¼DSBãä½¿ã
+ãå¿
+è¦ãããï¼ï¼[2] D12.3.4ï¼
+	- MSRå½ä»¤ã¨ï¼PCãæ¸ãæããå½ä»¤ã§SPSRãCPSRã«ã³ãã¼ãããã®ãè©²å½ï¼
+	- ARMv6ã§ãï¼ãã®æ¯èãã«ä¾å­ãããã¨ã¯æ¨å¥¨ããªãï¼
+	- Deviceã¢ã¯ã»ã¹ã«ã¯é©ç¨ãããªãï¼â¦ ã©ãã«æ¸ãã¦ãã£ããä¸æ
+
+âããªã¢å½ä»¤ã®ä½¿ç¨ä¾ï¼[2] D7ï¼
+
+ã»SEMï¼Sequential Execution Modelï¼ã¨ã¯ï¼ããå½ä»¤ãå®è¡éå§ããåã«ï¼æ
+ãåã®å½ä»¤ã®å®è¡ãå®äºãã¦ãããããªå®è¡ã¢ãã«ï¼æè¿ã®ãã­ã»ããµã§ã¯ï¼
+ãå
+é¨çã«ã¯SEMã«ãªã£ã¦ãããï¼ããªã¢å½ä»¤ãå¿
+è¦ã«ãªãï¼
+
+ã»ããã§ã¯ï¼ARMv6ä»¥éã®DMBã¨DSBã®ä½¿ç¨ä¾ãèª¬æ
+
+ã»weakly consistent ordering ã®åç´ãªä¾
+
+		åæå [r1]=0, [r2]=0, r5=0x55, r6=0x66
+	P1:
+		str		r5, [r1]
+		ldr		r6, [r2]
+	P2:
+		str		r6, [r2]
+		ldr		r5, [r1]
+
+	â P1ã§r6=0ï¼P2ã§r5=0ã«ãªããã¨ããã
+			strã«ããã©ã¤ããï¼ldrã«ãããªã¼ãããå¾åãã«ãããå ´å
+
+ã»Weely ordered ã«ãããã¡ãã»ã¼ã¸æ¸¡ã
+
+		åæå r0=1, r5=0x55
+	P1:
+		str		r5, [r1]
+		str		r0, [r2]
+	P2:
+		wait until [r2]==1
+		ldr		r5, [r1]
+
+	â P2ã§r5=0ã«ãªããã¨ããã
+			P1ã®2ã¤ã®strã«ããã©ã¤ãã®é åºãå
+¥ãæ¿ãã£ãå ´å
+
+	ï¼P2ã¨åãå¦çãè¡ããã­ã»ããµãè¤æ°ããã¨ï¼ãã­ã»ããµã«ãã£ã¦ï¼r5ã«
+		ã­ã¼ããã¦ããå¤ãç°ãªãå ´åããã
+
+ãããªã¢ã«ããè§£æ±º
+	P1:
+		str		r5, [r1]
+		dmb		[ST]		â¦ ã·ã¹ãã å
+¨ä½ï¼ã©ã¤ãã®ã¿
+		str		r0, [r2]
+	P2:
+		wait until [r2]==1
+		dmb
+		ldr		r5, [r1]
+
+ãã¢ãã¬ã¹ä¾å­æ§ã«ããè§£æ±º
+	P1:
+		str		r5, [r1]
+		dmb		[ST]		â¦ ã·ã¹ãã å
+¨ä½ï¼ã©ã¤ãã®ã¿
+		str		r0, [r2]
+	P2:
+		wait until [r2]==1	â¦ ãã®ä¸­ã§r12ãä½¿ã£ã¦ããã¨æ³å®
+		and		r12, r12, #0
+		ldr		r5, [r1,r12]
+
+	â æå¾ã®ldrã®ã¢ãã¬ã¹è¨ç®ã«r12ãå¿
+è¦ããã£ã¦ï¼r12ã¸ã®ãªã¼ãã¯ï¼ãã®
+		ldrå½ä»¤ã«å¿
+ãå
+è¡ããï¼ãããªãã¨ï¼ã¢ãã¬ã¹ãè¨ç®ã§ããªãï¼
+
+ã»ã¢ãã¬ã¹ä¾å­æ§ã¨å¶å¾¡ä¾å­æ§
+
+	(a) ã¢ãã¬ã¹ä¾å­æ§
+		ldr		r1, [r0]
+		ldr		r2, [r1]
+	â ã¢ãã¬ã¹ä¾å­æ§ãããããï¼éé ã«ãªããªã
+
+	(b) ã¢ãã¬ã¹ä¾å­æ§
+		ldr		r1, [r0]
+		and		r1, r1, #0
+		ldr		r2, [r3,r1]
+	â [r0]ããã­ã¼ãããr1ã®å¤ã¯ï¼å®éã«ã¯[r3,r1]ã«å½±é¿ããªããï¼
+		å½¢å¼çã«ã¯ã¢ãã¬ã¹ä¾å­æ§ãããããï¼éé ã«ãªããªã
+
+	(c) å¶å¾¡ä¾å­æ§
+		ldr		r1, [r0]
+		cmp		r1, #55
+		ldrne	r2, [r3]
+	â r1ã®å¤ã§ldrneãå®è¡ãããã©ãããå¤ãããï¼ã¢ãã¬ã¹ä¾å­æ§ã¯
+		ãªãï¼å¶å¾¡ä¾å­æ§ã¯ããï¼ããï¼ldrneãå
+ã«ï¼ææ©çã«ï¼å®è¡
+		ããã¦ãããï¼ã­ã¼ãããã¢ãã¬ã¹ã¯å¤ãããªãï¼
+
+	(d) å¶å¾¡ä¾å­æ§ï¼âå¾®å¦âï¼
+		ldr		r1, [r0]
+		cmp		r1, #55
+		movne	r4, #22
+		ldr		r2, [r3,r4]
+	â r1ã®å¤ã§movneãå®è¡ãããã©ãããå¤ããï¼æå¾ã®ldrã§ã­ã¼ãã
+		ãã¢ãã¬ã¹ãå¤ãããï¼ãã©ã°çµç±ã§ã®çµåã¯ã¢ãã¬ã¹ä¾å­æ§ã¨
+		ã¯æ±ãããï¼ldrãå
+ã«ï¼ææ©çã«ï¼å®è¡ããã¦ãããï¼ã­ã¼ãã
+		ãã¢ãã¬ã¹ã¯å¤ããï¼
+
+âããã¤ãçç¥
+	- è¤æ°ã®ãªãã¶ã¼ããããã¡ãã»ã¼ã¸æ¸¡ãï¼ä¸ã«è¨è¼ï¼
+	- ãªãã¸ã§ã¯ãã®æ§ææã®ã¢ãã¬ã¹ä¾å­æ§
+			ãªã¼ãå´ã¯ã¢ãã¬ã¹ä¾å­æ§ãä½¿ãããã¨ãå¤ã
+	- è¤æ°ã®ãªãã¶ã¼ããããå ´åã®å æé¢ä¿
+			å æé¢ä¿ãå´©ããããã«æ¯ãèããã¨ããã
+	- è¤æ°ã®ãªãã¶ã¼ããããè¤æ°ã¢ãã¬ã¹ã¸ã®æ¸ãè¾¼ã¿
+
+ï¼æªå®æï¼
+
+âããªã¢å½ä»¤ã®å¿
+è¦ãªç¶æ³ï¼èå¯ï¼
+
+ã»DMBã¯ï¼ãã«ããã­ã»ããµï¼å³å¯ã«ã¯ï¼ãã«ããã¹ã¿ï¼åãã®æ©è½
+	- ã·ã³ã°ã«ãã­ã»ããµã§ã¯ä½¿ãç¶æ³ã¯ãªãã¨æãããï¼
+
+ã»DSBã¯ï¼ã¡ã¢ãªã¢ã¯ã»ã¹ãå¯ä½ç¨ãæã¤æã«ï¼ãã®å¯ä½ç¨ãèµ·ããã®ãå¾
+ã¤ã
+ããã«ä½¿ãæ©è½
+	- å²è¾¼ã¿ã³ã³ãã­ã¼ã©ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¬ã¸ã¹ã¿ï¼GICã§ã¯ï¼
+	  GICC_PMRï¼ã«æ¸ãè¾¼ããã¨ã§å²è¾¼ã¿ãç¦æ­¢ããå¾ã¯ï¼DSBãå¿
+è¦ã§ããï¼
+	  ããã¯ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¬ã¸ã¹ã¿ã¸ã®æ¸ãè¾¼ã¿ãã¹ãã¢ãããã¡ã«
+	  èç©ãããç¶æ
+ã§ï¼æ¬¡ã®å½ä»¤ãå®è¡ãï¼ãã®å¾ã«å²è¾¼ã¿ãå
+¥ã£ã¦ãã¾ã
+	  å¯è½æ§ãããããã§ããï¼
+	- åªå
+åº¦ãã¹ã¯ã¬ã¸ã¹ã¿ã«æ¸ãè¾¼ããã¨ã§å²è¾¼ã¿ãè¨±å¯ããå¾ã«ï¼å¿
+ãå²
+	  è¾¼ã¿ãå
+¥ãã¿ã¤ãã³ã°ãä½ãããå ´åã¯ï¼DSBãå¿
+è¦ã§ããï¼å²è¾¼ã¿ãå
+¥
+	  ãã¿ã¤ãã³ã°ãä½ãå¿
+è¦ããªãï¼å²è¾¼ãè¨±å¯ãããã¿ã¤ãã³ã°ãé
+ããªã£
+	  ã¦ãåé¡ãªããã°ï¼DSBã¯å¿
+é ã§ã¯ãªãï¼
+
+ã»ISBã¯ï¼ãã­ã°ã©ã ãæ¸ãæããããï¼ã¾ãã¯ï¼ã·ã¹ãã ç¶æ
+ã®å¤åã«ããå®
+ãè¡ãã¹ããã­ã°ã©ã ãå¤ãã£ãï¼æã«ï¼æ°ãããã­ã°ã©ã ãèª­ã¿è¾¼ããã¨ã
+ãä¿è¨¼ããããã®å½ä»¤
+	- ã«ã¼ãã«ã§ã¯ï¼ãã­ã°ã©ã ãæ¸ãæãããã¨ã¯æ³å®ãã¦ããªãï¼
+	- ã·ã¹ãã å¶å¾¡ã¬ã¸ã¹ã¿ã®å¤æ´ãªã©ï¼å¿
+è¦ãªå ´é¢ã¯éãããã¨æãããï¼
+
+âCPSRãæ¸ãæããåã«ï¼ã¡ã¢ãªããªã¢ãå¿
+è¦ï¼
+	â¦ ã©ãã«æ¸ãã¦ãã£ããä¸æï¼[2] D12.3.4ã®ãã¨ãï¼ï¼ï¼
+	- CPSRã®ã©ã®ãã©ã°ãæ¸ãæãããã«ãã£ã¦ãè©±ããéã
+
+âã³ãã­ã»ããµ
+
+âã³ãã­ã»ããµãµãã¼ãï¼[2] A2.9ï¼
+
+ã»16åã¾ã§ã®ã³ãã­ã»ããµããµãã¼ã
+ã»ä»¥ä¸ã®ã³ãã­ã»ããµã¯ARMãäºç´
+
+ã»ã³ãã­ã»ããµ15ï¼CP15ï¼
+	- ã·ã¹ãã å¶å¾¡
+	- ä»®æ³ã¡ã¢ãªã·ã¹ãã ã¢ã¼ã­ãã¯ãã£ï¼VMSAï¼ã§ã®ã¬ã¸ã¹ã¿
+	- ç©çã¡ã¢ãªã·ã¹ãã ã¢ã¼ã­ãã¯ãã£ï¼PMSAï¼ã§ã®ã¬ã¸ã¹ã¿
+	- ããã©ã¼ãã³ã¹ã¢ãã¿ã¬ã¸ã¹ã¿
+
+ã»ã³ãã­ã»ããµ14ï¼CP14ï¼
+	- ãããã°æ¯æ´
+
+ã»ã³ãã­ã»ããµ10ã¨11ï¼CP10ã¨CP11ï¼
+	- 2ã¤ãããã¦ï¼æµ®åå°æ°ç¹ã¨Advanced SIMD
+
+ã»ã³ãã­ã»ããµ8,9,12,13
+	- å°æ¥ã®æ¡å¼µã®ããã«ARMãäºç´
+
+âã³ãã­ã»ããµå½ä»¤
+
+ã»ã³ãã­ã»ããµã®ãã¼ã¿å¦çã®éå§
+	- CDP, CDP2
+		CDP<c> <coproc>, <opc1>, <CRd>, <CRn>, <CRm>, <opc2>
+
+ã»ARMã³ã¢ã¬ã¸ã¹ã¿ã¨ã³ãã­ã»ããµã¬ã¸ã¹ã¿ã®éãã¼ã¿ã®è»¢é
+	- MCR, MCR2 â¦ ARMã³ã¢ã¬ã¸ã¹ã¿âã³ãã­ã»ããµ
+					'2'ã¯ï¼æ¡ä»¶ãä»ããããªãï¼CP14,15ã«ã¯ä½¿ããªã
+		MCR<c> <coproc>, <opc1>, <Rt>, <CRn>, <CRm>{, <opc2>}
+	- MCRR, MCRR2 â¦ 2ã¤ã®ARMã³ã¢ã¬ã¸ã¹ã¿âã³ãã­ã»ããµ
+		MCRR<c> <coproc>, <opc1>, <Rt>, <Rt2>, <CRm>
+	- MRC, MRC2 â¦ ã³ãã­ã»ããµ â ARMã³ã¢ã¬ã¸ã¹ã¿
+		MRC<c> <coproc>, <opc1>, <Rt>, <CRn>, <CRm>{, <opc2>}
+	- MRRC, MRRC2 â¦ ã³ãã­ã»ããµ â 2ã¤ã®ARMã³ã¢ã¬ã¸ã¹ã¿
+		MRRC<c> <coproc>, <opc>, <Rt>, <Rt2>, <CRm>
+
+ã»ã³ãã­ã»ããµã¬ã¸ã¹ã¿ã®ã­ã¼ãï¼ã¹ãã¢
+	- LDC, LDC2 (immediate) â¦ ã¡ã¢ãªâã³ãã­ã»ããµ
+		LDC{L}<c> <coproc>, <CRd>, [<Rn>, #+/-<imm>]{!}
+		LDC{L}<c> <coproc>, <CRd>, [<Rn>], #+/-<imm>
+		LDC{L}<c> <coproc>, <CRd>, [<Rn>], <option>
+	- LDC, LDC2 (literal) â¦ ã¡ã¢ãªâã³ãã­ã»ããµ
+		LDC{L}<c> <coproc>, <CRd>, <label>
+		LDC{L}<c> <coproc>, <CRd>, [PC, #-0] â¦ Special case
+		LDC{L}<c> <coproc>, <CRd>, [PC], <option>
+	- STC, STC2 â¦ ã³ãã­ã»ããµâã¡ã¢ãª
+		STC{L}<c> <coproc>, <CRd>, [<Rn>, #+/-<imm>]{!}
+		STC{L}<c> <coproc>, <CRd>, [<Rn>], #+/-<imm>
+		STC{L}<c> <coproc>, <CRd>, [<Rn>], <option>
+
+ã»CP10ã¨CP11ã¯ï¼æµ®åå°æ°ç¹ï¼Advanced SIMDå½ä»¤ã§ãæä½ã§ãã
+
+âCP15
+
+âä»®æ³ã¡ã¢ãªã·ã¹ãã ã¢ã¼ã­ãã¯ãã£ï¼VMSAï¼ã§ã®ã¬ã¸ã¹ã¿
+
+âç©çã¡ã¢ãªã·ã¹ãã ã¢ã¼ã­ãã¯ãã£ï¼PMSAï¼ã§ã®ã¬ã¸ã¹ã¿
+
+âããã©ã¼ãã³ã¹ã¢ãã¿ã¬ã¸ã¹ã¿
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/arch/arm_gcc/doc/arm_vmsa_memo.txt
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/doc/arm_vmsa_memo.txt	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/doc/arm_vmsa_memo.txt	(revision 302)
@@ -0,0 +1,477 @@
+													TOPPERS Confidential
+		TOPPERSãã­ã¸ã§ã¯ã è¨­è¨ã¡ã¢
+		ARMã®VMSAã«é¢ããã¡ã¢
+
+		ä½æè
+: é«ç°åºç« ï¼åå¤å±å¤§å­¦ï¼
+		æçµæ´æ°: 2015å¹´8æ6æ¥
+
+âã¡ã¢ã®ä½ç½®ã¥ã
+
+ãã®ã¡ã¢ã¯ï¼ARMã®VMSAï¼Virtual Memory System Architectureï¼ã«é¢ãã¦ï¼
+TOPPERSã«ã¼ãã«ããã¼ãã£ã³ã°ããã«ããã£ã¦å¿
+è¦ã¨ãªãäºé 
+ãã¾ã¨ãããã®
+ã§ããï¼
+
+ARMã®VMSAã¯ï¼ARMv5ä»¥åã¨ARMv6ä»¥éã§ã¯ããªãéã£ã¦ããï¼ã¾ãï¼ARMv7ã§ã¯ï¼
+ã»ã­ã¥ãªãã£æ¡å¼µï¼ã©ã¼ã¸ç©çã¢ãã¬ã¹æ¡å¼µï¼LPAS; Large Physical Address
+Extensionï¼ï¼ä»®æ³åæ¡å¼µãªã©ãè¿½å ããã¦ããï¼
+
+ãã®ã¡ã¢ã§ã¯ï¼ARMv5ä»¥åã¨ARMv6ä»¥éã®ä¸¡æ¹ã«ã¤ãã¦æ±ããï¼ARMv7ã«ãããæ¡
+å¼µã«ã¤ãã¦ã¯ï¼TOPPERSã«ã¼ãã«ã§ã¯ç´æ¥ãµãã¼ãããªãããï¼æ±ããªããã¨ã¨
+ããï¼ç¾æç¹ã§ã¯ï¼ARMv6ãä¸­å¿ã«è¨è¿°ãã¦ããï¼ï¼
+
+âç®æ¬¡
+
+ã»åèæç®
+
+âåèæç®
+
+[1] ARM Architecture Reference Manual, 2005
+DDI 01001.pdf
+â» ARMv6ä»¥åã®å®ç¾©
+
+[2] ARM Architecture Reference Manual - ARMv7-A and ARv7-R edition, 2014
+DDI0406C_C_arm_architecture_reference_manual.pdf
+â» ARMv7ã®å®ç¾©ï¼ARMv6ä»¥åã¨ã®å·®åã«ã¤ãã¦ãè¨è¼ãã
+
+âARMã®VMSAã®æ¦è¦
+
+âä¸»ãªç¹å¾´
+
+ã»2ã¬ãã«ã®ãã¼ãã«ãç¨ãããã¼ãã¦ã§ã¢ã«ããã¢ãã¬ã¹å¤æ
+ã»ãããã³ã°ãµã¤ãºï¼4KBï¼16KBï¼1MBï¼16MB
+ã»ã»ã¯ã·ã§ã³ï¼1MBï¼16MBï¼åä½ã§ã®ã¢ã¯ã»ã¹è¨±å¯æå®ãå¯è½
+ã»ã©ã¼ã¸ãã¼ã¸ï¼64KBï¼ã¨ã¹ã¢ã¼ã«ãã¼ã¸ï¼4KBï¼åä½ã§ã®ã¢ã¯ã»ã¹è¨±å¯æå®
+ã»ã¨ã³ããªã«8ãããã®ASIDï¼ã¢ãã¬ã¹ç©ºéè­å¥å­ï¼ãä»ä¸å¯è½ï¼ARMv6ä»¥éï¼
+ã»ã¨ã³ããªãã°ã­ã¼ãã«ã«è¨­å®å¯è½ï¼ARMv6ä»¥éï¼
+ã»16åã®ãã¡ã¤ã³
+
+âã»ã¯ã·ã§ã³ã¨ãã¼ã¸
+
+ã¹ã¼ãã¼ã»ã¯ã·ã§ã³ï¼16MBåä½ï¼ARMv6ä»¥éï¼ARMv5ã§ã¯ãªãã·ã§ã³ï¼
+ã»ã¯ã·ã§ã³ï¼1MBåä½
+ã©ã¼ã¸ãã¼ã¸ï¼64KBåä½
+ã¹ã¢ã¼ã«ãã¼ã¸ï¼4KBåä½
+ã¿ã¤ãã¼ãã¼ã¸ï¼1KBåä½ï¼ARMv6ã§ã¯ãµãã¼ããããªãï¼
+
+âARMv5ããARMb6ã¸ã®æ¡å¼µç¹
+
+ARMv6ã®MMUã¯ï¼ARMv5ã«å¯¾ãã¦æ§ã
+ãªæ¡å¼µãããã¦ããï¼ARMv6ã®ï¼æ°ããï¼ã¢
+ãã¬ã¹å¤ææ©æ§ã¯ï¼éå»ã®ãã®ã¨äºææ§ããªãããï¼éå»ã¨äºæã®ã¢ãã¬ã¹å¤
+ææ©æ§ããµãã¼ããã¦ããï¼ARMv6ã§ã®ä¸»ãªæ¡å¼µç¹ã¯æ¬¡ã®éãï¼
+
+ã»ã¡ã¢ãªé åã®ã¿ã¤ããæ¡å¼µï¼ã¡ã¢ãªã¢ãã«ã®æå®ãªã©ï¼ï¼
+ã»ãã­ã»ã¹ï¼ASIDï¼æ¯ã®ãã¼ã¸ã¨ã°ã­ã¼ãã«ãã¼ã¸ããµãã¼ãï¼
+ã»ã¢ã¯ã»ã¹è¨±å¯ãæ¡å¼µï¼å®è¡ç¦æ­¢é åãæå®å¯è½ï¼
+ã»è¤æ°ã®ãã­ã»ããµã§å
+±æããã¡ã¢ãªé åãæå®å¯è½ï¼
+ã»å¤æãã¼ãã«ãã¼ã¹ã¬ã¸ã¹ã¿ï¼TTBRï¼ã2ã¤ããï¼
+ã»ãã¡ã¤ã³ãã¼ã¸ãã¼ãã«ã¨ã¿ã¤ãã¼ãã¼ã¸ï¼1KBï¼ãå»æ­¢ï¼
+
+ãã­ã»ã¹ï¼ASIDï¼æ¯ã®ãã¼ã¸ã¨ã°ã­ã¼ãã«ãã¼ã¸ã¯ï¼TLBã®ãã©ãã·ã¥ãä¸å¿
+è¦
+ã«ãï¼TLBãã¹ãæ¸ãããï¼ARMv6ã§ã¯æ°ããã¢ãã¬ã¹å¤ææ©æ§ãä½¿ç¨ãã¹ãã§
+ããï¼
+
+åèï¼ARM11 MPCoreã®VMSAã®ç¹å¾´
+
+ã»ã©ã¦ã³ãã­ãã³ãªãã¬ã¼ã¹ã¡ã³ã
+ã»64ã¨ã³ããªã®çµ±åTLBã¨8ã¨ã³ããªã®ã­ãã¯ãã¦ã³TLB
+ã»ãã¤ã¯ã­TLBã¨ãã¯ã­TLBã®2éå±¤ã®TLBï¼å®è£
+ã®åé¡ï¼
+
+âãã¡ã¤ã³
+
+ãã¡ã¤ã³ã¯ï¼ã¡ã¢ãªé åã®éåã§ããï¼ãã¹ã¦ã®ã¡ã¢ãªé åã¯ï¼ããããã®ã
+ã¡ã¤ã³ã«å±ããï¼ãã¡ã¤ã³ã®æå¤§æ°ã¯16åã§ããï¼
+
+ãã¡ã¤ã³ã¢ã¯ã»ã¹å¶å¾¡ã¬ã¸ã¹ã¿ï¼DACR; Domain Access Control Registerï¼ã«
+ããï¼åãã¡ã¤ã³ã«å¯¾ãã¦æ¬¡ã®ããããã®ã¢ã¯ã»ã¹è¨±å¯ãè¨­å®ã§ããï¼
+
+ã»ã¢ã¯ã»ã¹ã§ããªã
+ã»TLBã¨ã³ããªã®ã¢ã¯ã»ã¹è¨±å¯ã«å¾ãï¼clientï¼
+ã»TLBã¨ã³ããªã®ã¢ã¯ã»ã¹è¨±å¯ã«ãããããå¿
+ãã¢ã¯ã»ã¹ã§ããï¼managerï¼
+
+ã¡ã¢ãªé åãã©ã®ãã¡ã¤ã³ã«å±ãããã¯ï¼ç¬¬1ã¬ãã«ãã£ã¹ã¯ãªãã¿ä¸­ã§æå®ã
+ããï¼ãã®ããï¼ç°ãªããã¡ã¤ã³ã«å±ããããã«è¨­å®ã§ããã®ã¯ï¼1MBåä½ã¨ã
+ããã¨ã«ãªãï¼
+
+ã¹ã¼ãã¼ã»ã¯ã·ã§ã³ï¼16MBåä½ã®ã¡ã¢ãªé åï¼ã¯ï¼å¿
+ããã¡ã¤ã³0ã«å±ããï¼
+
+âãã¼ã¸ãã¼ãã«ã®ãããã³ã°å¶é
+
+ä»®æ³ã¤ã³ããã¯ã¹ç©çã¿ã°ï¼VIPTï¼ã­ã£ãã·ã¥ã«ãããã¨ã¤ãªã¢ã¹ã®å¦çãå®¹
+æã«ããããã®å¶éã¨ãã¦ï¼ä»¥ä¸ãè¨­ããï¼å½ä»¤ã­ã£ãã·ã¥ã§ã¯ç¡å®³ï¼ï¼
+
+ã»è¤æ°ã®è«çã¢ãã¬ã¹ãåãç©çã¢ãã¬ã¹ã«ãããã³ã°ãããå ´åã«ï¼è«çã¢
+ãã¬ã¹ã®ããã[13:12]ã¨ï¼ãããã³ã°ãããç©çã¢ãã¬ã¹ã®ããã[13:12]ã
+å¿
+ãä¸è´ããããã¨ï¼
+
+ã»ã¾ãã¯ï¼ãã¹ã¦ã®ãããã³ã°ã4KBåä½ã®å ´åã«ã¯ï¼åãç©çã¢ãã¬ã¹ã«ãã
+ãã³ã°ãããè«çã¢ãã¬ã¹ã®ããã[13:12]ããã¹ã¦åãã§ãããã¨ï¼
+
+MPCoreã§ã¯ï¼ç©çã¤ã³ããã¯ã¹ç©çã¿ã°ï¼PIPTï¼ã­ã£ãã·ã¥ãç¨ãã¦ããããï¼
+ãã®å¶éã¯é©ç¨ãããªãï¼PIPTã­ã£ãã·ã¥ã§é«éã¢ã¯ã»ã¹ãå®ç¾ããããã«ï¼
+è¶
+é«éã»å°å®¹éã®ãã¤ã¯ã­TLBãåãã¦ããï¼
+
+â HRP3ã«ã¼ãã«ã§ã¯ï¼è«çã¢ãã¬ã¹ã¨ç©çã¢ãã¬ã¹ãä¸è´ããã¦ããããï¼ä¸
+ã®å¶éãå¸¸ã«æºããããï¼
+
+âã¢ãã¬ã¹å¤ææ©æ§
+
+âARMv6ã®æ°ããã¢ãã¬ã¹å¤ææ©æ§
+
+ããã§ã¯ï¼ï¼éå»ã¨äºæã®ã¢ãã¬ã¹å¤ææ©æ§ã§ã¯ãªãï¼ARMv6ã®ï¼æ°ããï¼ã¢ã
+ã¬ã¹å¤ææ©æ§ã«ã¤ãã¦èª¬æããï¼CP15å¶å¾¡ã¬ã¸ã¹ã¿c1ã®XPãããï¼ããã23ï¼
+ã§ï¼ãµããã¼ã¸APãããããã£ã¹ã¨ã¼ãã«ãããã¨ã§ï¼ARMv6ã®ï¼æ°ããï¼ã¢ã
+ã¬ã¹å¤ææ©æ§ãä½¿ãããï¼
+
+è«çã¢ãã¬ã¹ããç©çã¢ãã¬ã¹ã¸ã®å¤æã¯ï¼2ã¬ãã«ã®å¤æãã¼ãã«ã«ãã£ã¦è¡
+ãããï¼1æ®µç®ã®å¤æãã¼ãã«ãç¬¬1ã¬ãã«ãã¼ãã«ï¼2æ®µç®ã®å¤æãã¼ãã«ãç¬¬
+2ã¬ãã«ãã¼ãã«ã¨å¼ã¶ï¼
+
+ï¼å¤æãã¼ãã«ãã¼ã¹ã¬ã¸ã¹ã¿
+
+ç¬¬1ã¬ãã«ãã¼ãã«ã¯ï¼å¤æãã¼ãã«ãã¼ã¹ã¬ã¸ã¹ã¿ï¼TTBRï¼ã«ãã£ã¦æå®ãã
+ãï¼ARMv6ã«ã¯ï¼2ã¤ã®å¤æãã¼ãã«ãã¼ã¹ã¬ã¸ã¹ã¿ï¼TTBR0ã¨TTBR1ï¼ãããï¼
+è«çã¢ãã¬ã¹ã®ä¸ä½ãããã«ãã£ã¦ä½¿ãåãããã¨ãã§ããï¼å
+·ä½çã«ã¯ï¼è«
+çã¢ãã¬ã¹ã®ä¸ä½Nãããããã¹ã¦0ã®å ´åã«TTBR0ãä½¿ããï¼ããã§ãªãæã«
+TTBR1ãä½¿ãããï¼Nã¯ï¼å¤æãã¼ãã«ãã¼ã¹å¶å¾¡ã¬ã¸ã¹ã¿ï¼TTBCRï¼ã§è¨­å®ããï¼
+Nã«0ãè¨­å®ããã¨ï¼å¸¸ã«TTBR0ãä½¿ãããï¼
+
+TTBRã«ã¯ï¼ç¬¬1ã¬ãã«ãã¼ãã«ã®ã¢ãã¬ã¹ã«å ãã¦ï¼ã­ã£ãã·ã¥å¯è½/ä¸å¯è½ã
+å¶å¾¡ããããããããï¼è©³ç´°çç¥ï¼ï¼
+
+â TTBR1ãã«ã¼ãã«ï¼TTBR0ãã¦ã¼ã¶ãã­ã»ã¹ã«ä½¿ããã¨ãæ³å®ããæ©æ§ã§ãã
+ãï¼HRP3ã§ã¯ã¢ãã¬ã¹å¤æãè¡ããªãããï¼TTBR1ããã¾ãæ´»ç¨ã§ããªãï¼å¸¸ã«
+TTBR0ãä½¿ãè¨­å®ã§ç¨ãããã¨ã«ããï¼
+
+ï¼ç¬¬1ã¬ãã«ãã£ã¹ã¯ãªãã¿
+
+è«çã¢ãã¬ã¹ã®ããã[31:20]ï¼ä¸ä½12ãããï¼ãã¤ã³ããã¯ã¹ã¨ãã¦ï¼ç¬¬1ã¬
+ãã«ãã¼ãã«ãæ¤ç´¢ãï¼ç¬¬1ã¬ãã«ãã£ã¹ã¯ãªãã¿ãåãåºãï¼ãã®ããï¼ç¬¬1
+ã¬ãã«ãã£ã¹ã¯ãªãã¿ã¯ï¼1MBã®ã¡ã¢ãªé åã«å¯¾å¿ããï¼
+
+ç¬¬1ã¬ãã«ãã£ã¹ã¯ãªãã¿ã«ã¯ï¼æ¬¡ã®ç¨®é¡ãããï¼
+
+ãã©ã«ã
+ã»ä¸ä½2ãããã00ã¾ãã¯11
+ã»å¤æãã©ã«ããå¼ãèµ·ãã
+â»ãµããã¼ã¸ãä½¿ãæï¼ARMv5äºæã¢ã¼ãï¼ã¯ï¼ä¸ä½2ãããã11ã¯äºç´
+
+ã³ã¢ã¼ã¹ãã¼ã¸ãã¼ãã«
+ã»ä¸ä½2ãããã01
+ã»ç¬¬2ã¬ãã«ãã¼ãã«ï¼ã³ã¢ã¼ã¹ãã¼ã¸ãã¼ãã«ï¼ãæã
+	ããã31ã10ï¼22ãããï¼ï¼ç¬¬2ã¬ãã«ãã¼ãã«ã®ã¢ãã¬ã¹
+	ããã9ï¼å®è£
+å®ç¾©ï¼MPCoreã§ã¯Pãããï¼ECCãæå¹ã§ãããã¨ãç¤ºãï¼
+	ããã8ã5ï¼å±ãããã¡ã¤ã³
+	ããã4ã2ï¼0ã«è¨­å®ï¼æªä½¿ç¨ï¼
+	ããã1ã0ï¼01ã«è¨­å®ï¼ã³ã¢ã¼ã¹ãã¼ã¸ãã¼ãã«ãç¤ºãï¼
+
+ã»ã¯ã·ã§ã³
+ã»ä¸ä½2ãããã10ã§ï¼ããã18ã0
+ã»ã»ã¯ã·ã§ã³ï¼1MBåä½ã®ã¡ã¢ãªé åï¼ãç¤ºã
+	ããã31ã20ï¼12ãããï¼ï¼ã»ã¯ã·ã§ã³ã®ã¢ãã¬ã¹
+	ããã19ï¼0ã«è¨­å®ï¼æªä½¿ç¨ï¼
+	ããã18ï¼0ã«è¨­å®ï¼ã»ã¯ã·ã§ã³ãç¤ºãï¼
+	ããã17ï¼nGãããï¼ã°ã­ã¼ãã«ã§ãªãï¼
+	ããã16ï¼Sãããï¼ãã­ã»ããµéã§å
+±æï¼
+	ããã15ï¼APXããã
+	ããã14ã12ï¼TEXããã
+	ããã11ã10ï¼APããã
+	ããã9ï¼å®è£
+å®ç¾©ï¼MPCoreã§ã¯Pãããï¼ECCãæå¹ã§ãããã¨ãç¤ºãï¼
+	ããã8ã5ï¼å±ãããã¡ã¤ã³
+	ããã4ï¼XNãããï¼å®è¡ç¦æ­¢ï¼
+	ããã3ï¼Cããã
+	ããã2ï¼Bããã
+	ããã1ã0ï¼10ã«è¨­å®ï¼ã»ã¯ã·ã§ã³/ã¹ã¼ãã¼ã»ã¯ã·ã§ã³ãç¤ºãï¼
+
+ã¹ã¼ãã¼ã»ã¯ã·ã§ã³
+ã»ä¸ä½2ãããã10ã§ï¼ããã18ã1
+ã»ã»ã¯ã·ã§ã³ï¼16MBåä½ã®ã¡ã¢ãªé åï¼ãç¤ºã
+	ããã31ã24ï¼8ãããï¼ï¼ã»ã¯ã·ã§ã³ã®ã¢ãã¬ã¹
+	ããã23ã19ï¼0ã«è¨­å®ï¼æªä½¿ç¨ï¼
+	ããã18ï¼1ã«è¨­å®ï¼ã¹ã¼ãã¼ã»ã¯ã·ã§ã³ãç¤ºãï¼
+	ä»¥éï¼ã»ã¯ã·ã§ã³ã¨åãï¼nGï¼Sï¼APXï¼TEXï¼APï¼Pï¼XNï¼Cï¼Bï¼
+	ãã ãï¼ãã¡ã¤ã³ã¯ç¡è¦ãããï¼å¿
+ããã¡ã¤ã³0ï¼
+ã»ç¬¬1ã¬ãã«ãã¼ãã«ã«ã¯ï¼åããã£ã¹ã¯ãªãã¿ã16åç¹°ãè¿ãã¦å
+¥ãã¦ãã
+
+ï¼ç¬¬2ã¬ãã«ãã£ã¹ã¯ãªãã¿
+
+ç¬¬1ã¬ãã«ãã£ã¹ã¯ãªãã¿ãï¼ã³ã¢ã¼ã¹ãã¼ã¸ãã¼ãã«ãæãå ´åã«ã¯ï¼è«çã¢
+ãã¬ã¹ã®ããã[19:12]ï¼ä¸­å¤®ã®8ãããï¼ãã¤ã³ããã¯ã¹ã¨ãã¦ãã®ãã¼ãã«
+ãæ¤ç´¢ãï¼ç¬¬2ã¬ãã«ãã£ã¹ã¯ãªãã¿ãåãåºãï¼ãã®ããï¼ç¬¬2ã¬ãã«ãã£ã¹
+ã¯ãªãã¿ã¯ï¼4KBã®ã¡ã¢ãªé åã«å¯¾å¿ããï¼
+
+ç¬¬2ã¬ãã«ãã£ã¹ã¯ãªãã¿ã«ã¯ï¼æ¬¡ã®ç¨®é¡ãããï¼
+
+ãã©ã«ã
+ã»ä¸ä½2ãããã00
+ã»ã¡ã¢ãªã¢ã¯ã»ã¹ãã©ã«ããå¼ãèµ·ãã
+
+ã¹ã¢ã¼ã«ãã¼ã¸
+ã»ä¸ä½2ãããã10ã¾ãã¯11
+ã»ã¹ã¢ã¼ã«ãã¼ã¸ï¼4KBåä½ã®ã¡ã¢ãªé åï¼ãç¤ºã
+	ããã31ã12ï¼20ãããï¼ï¼ãã¼ã¸ã®ã¢ãã¬ã¹
+	ããã11ï¼nGãããï¼ã°ã­ã¼ãã«ã§ãªãï¼
+	ããã10ï¼Sãããï¼ãã­ã»ããµéã§å
+±æï¼
+	ããã9ï¼APXããã
+	ããã8ã6ï¼TEXããã
+	ããã5ã4ï¼APããã
+	ããã3ï¼Cããã
+	ããã2ï¼Bããã
+	ããã1ï¼1ã«è¨­å®ï¼ã¹ã¢ã¼ã«ãã¼ã¸ãç¤ºãï¼
+	ããã0ï¼XNãããï¼å®è¡ç¦æ­¢ï¼
+â» ã»ã¯ã·ã§ã³ã¨æ¯ã¹ãã¨ï¼ãã¡ã¤ã³ã¨Pãããããªãï¼
+
+ã©ã¼ã¸ãã¼ã¸
+ã»ä¸ä½2ãããã01
+ã»ã©ã¼ã¸ãã¼ã¸ï¼64KBåä½ã®ã¡ã¢ãªé åï¼ãç¤ºã
+	ããã31ã16ï¼16ãããï¼ï¼ãã¼ã¸ã®ã¢ãã¬ã¹
+	ããã15ï¼XNãããï¼å®è¡ç¦æ­¢ï¼
+	ããã14ã12ï¼TEXããã
+	ããã11ï¼nGãããï¼ã°ã­ã¼ãã«ã§ãªãï¼
+	ããã10ï¼Sãããï¼ãã­ã»ããµéã§å
+±æï¼
+	ããã9ï¼APXããã
+	ããã8ã6ï¼0ã«è¨­å®ï¼æªä½¿ç¨ï¼
+	ããã5ã4ï¼APããã
+	ããã3ï¼Cããã
+	ããã2ï¼Bããã
+	ããã1ã0ï¼01ã«è¨­å®ï¼ã©ã¼ã¸ãã¼ã¸ãç¤ºãï¼
+ã»ç¬¬2ã¬ãã«ãã¼ãã«ã«ã¯ï¼åããã£ã¹ã¯ãªãã¿ã16åç¹°ãè¿ãã¦å
+¥ãã¦ãã
+
+âã¢ã¯ã»ã¹è¨±å¯ã¨å±æ§
+
+ã¢ã¯ã»ã¹è¨±å¯ï¼è©³ããã¯ä¸è¨ï¼
+	APXãããï¼1ãããï¼æ¸è¾¼ã¿ã¢ã¯ã»ã¹ç¦æ­¢ã®å ´åã«1
+	APãããï¼2ãããï¼	ã¦ã¼ã¶ã¢ã¯ã»ã¹ãå¶å¾¡
+
+ã­ã£ãã·ã¥ã¨ã¡ã¢ãªã¢ãã«
+	TEXãããï¼3ãããï¼ã¿ã¤ãæ¡å¼µãã£ã¼ã«ã
+	Cãããï¼1ãããï¼	ï¼å
+ã
+ã¯ï¼ã­ã£ãã·ã¥å¯è½
+	Bãããï¼1ãããï¼	ï¼å
+ã
+ã¯ï¼ãããã¡å¯è½
+
+ãã®ä»
+	nGãããï¼1ãããï¼	ã°ã­ã¼ãã«ãªã¡ã¢ãªé åã§ãªãå ´åã«1
+	Sãããï¼1ãããï¼	ãã­ã»ããµéã§å
+±æããã¡ã¢ãªé åã®å ´åã«1
+	XNãããï¼1ãããï¼	å®è¡ä¸å¯ã®ã¡ã¢ãªé åã®å ´åã«1
+
+âã¢ã¯ã»ã¹è¨±å¯
+
+CPã®Sãããã¨Rããããå
+±ã«0ã«è¨­å®ããå ´åï¼ããä»¥å¤ã®ä½¿ãæ¹ã¯æ¨å¥¨ãããª
+ãï¼
+
+   APX	  AP	ç¹æ¨©ã¢ã¯ã»ã¹	ã¦ã¼ã¶ã¢ã¯ã»ã¹
+Ã	0	0	0	ã¢ã¯ã»ã¹ç¦æ­¢	ã¢ã¯ã»ã¹ç¦æ­¢		å¸¸ã«ã¢ã¯ã»ã¹ç¦æ­¢
+	0	0	1	R/W				ã¢ã¯ã»ã¹ç¦æ­¢
+	0	1	0	R/W				RO
+	0	1	1	R/W				R/W
+Ã	1	0	0										ï¼äºç´ï¼
+	1	0	1	RO				ã¢ã¯ã»ã¹ç¦æ­¢
+	1	1	0	RO				RO
+Ã	1	1	1	RO				RO
+
+å¡ä¾ï¼Ãã¯ï¼HRP3ã§ã¯ç¨ããªããã¨ãç¤ºãï¼
+
+âã­ã£ãã·ã¥ã¨ã¡ã¢ãªã¢ãã«ï¼ARMv6ä»¥éï¼
+
+	TEX		C	B
+	000		0	0		ã¹ãã­ã³ã°ãªã¼ãï¼å
+±æå¯è½
+	000		0	1		ããã¤ã¹ï¼å
+±æå¯è½
+	000		1	0		å¤å´ã»å
+å´ã©ã¤ãã¹ã«ã¼ï¼no write allocateï¼Sãããã§
+Ã	000		1	1		å¤å´ã»å
+å´ã©ã¤ãããã¯ï¼no write allocateï¼Sãããã§
+	001		0	0		å¤å´ã»å
+å´ã­ã£ãã·ã¥ä¸å¯
+	001		1	1		å¤å´ã»å
+å´ã©ã¤ãããã¯ï¼write allocateï¼Sãããã§
+Ã	010		0	0		ããã¤ã¹ï¼éå
+±æ
+Ã	1BB		A	A		ã­ã£ãã·ã¥ãããã¡ã¢ãªï¼å
+±æãã©ããã¯Sãããã§
+						BB â¦ å¤å´ã®ã­ã£ãã·ã¥ããªã·ã¼
+						AA â¦ å
+å´ã®ã­ã£ãã·ã¥ããªã·ã¼ï¼L1ã­ã£ãã·ã¥ï¼
+
+					AAã¨BBã®å¤
+						00 â¦ ã­ã£ãã·ã¥ä¸å¯ï¼ãããã¡ä¸å¯
+						01 â¦ ã©ã¤ãããã¯ï¼write allocateï¼ãããã¡å¯
+						10 â¦ ã©ã¤ãã¹ã«ã¼ï¼no write allocateï¼ãããã¡å¯
+						11 â¦ ã©ã¤ãããã¯ï¼no write allocateï¼ãããã¡å¯
+
+å¡ä¾ï¼Ãã¯ï¼HRP3ã§ã¯ç¨ããªããã¨ãç¤ºãï¼
+
+ã¹ãã­ã³ã°ãªã¼ãã¡ã¢ãªå±æ§ â¦ åå¾ã«ã¡ã¢ãªããªã¢å½ä»¤ãããã®ã¨åç­
+ããã¤ã¹ã¡ã¢ãªå±æ§ â¦ ãããã¡ã¯ãããï¼ã­ã£ãã·ã¥ã¯ãããªãï¼åæ°ãä¿å­
+éå¸¸ã¡ã¢ãªå±æ§
+
+âã­ã£ãã·ã¥ã¨ã¡ã¢ãªã¢ãã«ï¼ARMv5ä»¥åï¼
+
+ARMv5TEããåã¯ï¼TEXãããã¯ãµãã¼ãããã¦ããªãï¼ã¾ãï¼ç¬¬2ã¬ãã«ã®ã¹ã¢ã¼
+ã«ãã¼ã¸ãã£ã¹ã¯ãªãã¿ã«ã¯ï¼TEXãããããªãï¼ããã§ï¼æ¨æºã§ã¯ï¼TEXãã
+ããä½¿ããªãã³ã¼ããåºããã¨ã«ããï¼
+
+	C	B
+	0	0		ã¹ãã­ã³ã°ãªã¼ã
+	0	1		ããã¤ã¹
+	1	0		å
+å´ã©ã¤ãã¹ã«ã¼
+	1	1		å
+å´ã©ã¤ãããã¯
+
+âCP15ã³ãã­ã»ããµã®æ§æ
+
+âTTBCRï¼Translation Table Base Control Registerï¼â¦ (0, c2, c0, 2)
+
+ã»TTBR0ãä½¿ããï¼TTBR1ãä½¿ãããå¶å¾¡ãã
+ã»TTBR0ãæãã»ã¯ã·ã§ã³ãã¼ãã«ã®ãµã¤ãºãå¶å¾¡ãã
+ã»ä¸ä½3ãããï¼Nï¼ã®æå³
+	000		TTBR0ã®ã¿ãä½¿ãï¼ARMv5ã¨ã®äºæã¢ã¼ã
+			TTBR0ãæãã»ã¯ã·ã§ã³ãã¼ãã«ã®ãµã¤ãºã¯16KBï¼4Kã¨ã³ããªï¼
+	001		ã¢ãã¬ã¹ã®MSBã0ãªãTTBR0ãä½¿ãï¼ããã§ãªããã°TTBR1ãä½¿ã
+			TTBR0ãæãã»ã¯ã·ã§ã³ãã¼ãã«ã®ãµã¤ãºã¯8KBï¼2Kã¨ã³ããªï¼
+	010		ã¢ãã¬ã¹ã®ä¸ä½2ãããããã¹ã¦0ãªãTTBR0ãä½¿ãï¼ä»¥ä¸åã
+			TTBR0ãæãã»ã¯ã·ã§ã³ãã¼ãã«ã®ãµã¤ãºã¯4KBï¼1Kã¨ã³ããªï¼
+	â¦		â¦
+	111		ã¢ãã¬ã¹ã®ä¸ä½7ãããããã¹ã¦0ãªãTTBR0ãä½¿ãï¼ä»¥ä¸åã
+			TTBR0ãæãã»ã¯ã·ã§ã³ãã¼ãã«ã®ãµã¤ãºã¯128Bï¼32ã¨ã³ããªï¼
+ã»ä¸ä½29ãããã¯æªä½¿ç¨
+
+â HRP3ã§ã¯ï¼TTBR0ã®ã¿ãä½¿ãããï¼ä¸ä½3ãããã000ã«è¨­å®ããï¼
+
+âTTBR0ï¼Translation Table Base Register 0ï¼â¦ (0, c2, c0, 0)
+
+ã»ç¬¬1ã¬ãã«ãã¼ãã«ã®ç©çã¢ãã¬ã¹ãä¿æããã¬ã¸ã¹ã¿
+ã»ãã­ã»ã¹åæãæã«æ¸ãæãã
+
+ã»ä¸ä½18+Nããã
+	ç¬¬1ã¬ãã«ãã¼ãã«ã®ç©çã¢ãã¬ã¹
+ã»ããã[4:3]
+	ãã¼ã¸ãã¼ãã«é åã«å¯¾ããå¤å´ã®ã­ã£ãã·ã¥ããªã·ã¼
+	00ï¼Outer Noncachable
+	01ï¼Outer Cachable Write-Back cached, Write Allocate
+	10ï¼Outer Cachable Write-Through, No Allocate on Write
+	11ï¼Outer Cachable Write-Back, No Allocate on Write
+ã»ããã[1]
+	ãã¼ã¸ãã¼ãã«é åãå
+±æï¼1ï¼ãéå
+±æï¼0ï¼ã
+ã»ä»ã®ãããã¯æªä½¿ç¨
+
+âTTBR1ï¼Translation Table Base Register 1ï¼â¦ (0, c2, c0, 1)
+
+â HRP3ã§ã¯ä½¿ããªãï¼
+
+âDACRï¼Domain Access Control Registerï¼â¦ (0, c3, c0, 0)
+
+ã»åãã¡ã¤ã³ã«å¯¾ãã¦ï¼ä»¥ä¸ã®ãããããè¨­å®ããï¼
+	00ï¼ã¢ã¯ã»ã¹ã§ããªã
+	01ï¼TLBã¨ã³ããªã®ã¢ã¯ã»ã¹è¨±å¯ã«å¾ãï¼clientï¼
+	10ï¼ï¼äºç´ï¼
+	11ï¼TLBã¨ã³ããªã®ã¢ã¯ã»ã¹è¨±å¯ã«ãããããå¿
+ãã¢ã¯ã»ã¹ã§ããï¼managerï¼
+
+ã»ããã[31:30] â¦ ãã¡ã¤ã³15ã®è¨­å®
+	â¦
+ãããã[1:0] â¦ ãã¡ã¤ã³0ã®è¨­å®
+
+â HRP3ã«ã¼ãã«ã§ã¯ï¼0x01Uï¼ãã¡ã¤ã³0ã«å¯¾ãã¦TLBã¨ã³ããªã®ã¢ã¯ã»ã¹è¨±å¯
+ã«å¾ãï¼ä»ã®ãã¡ã¤ã³ã¯ã¢ã¯ã»ã¹ã§ããªãï¼ã«è¨­å®ããï¼
+
+âå®æ°å®ç¾©
+
+/*
+ *  ãµã¤ãºã®å®ç¾©
+ */
+#define ARM_SSECTION_SIZE	0x1000000		/* ã¹ã¼ãã¼ã»ã¯ã·ã§ã³ï¼16MBï¼*/
+#define ARM_SECTION_SIZE	0x0100000		/* ã»ã¯ã·ã§ã³ï¼1MBï¼*/
+#define ARM_LPAGE_SIZE		0x0010000		/* ã©ã¼ã¸ãã¼ã¸ï¼64KBï¼*/
+#define ARM_PAGE_SIZE		0x0001000		/* ã¹ã¢ã¼ã«ãã¼ã¸ï¼4KBï¼*/
+
+/*
+ *  ç¬¬1ã¬ãã«ãã£ã¹ã¯ãªãã¿ã®è¨­å®å¤
+ */
+#define ARMV6_MMU_DSCR1_FAULT		0x00000		/* ãã©ã«ã */
+#define ARMV6_MMU_DSCR1_PAGETABLE	0x00001		/* ã³ã¢ã¼ã¹ãã¼ã¸ãã¼ãã« */
+#define ARMV6_MMU_DSCR1_SECTION		0x00002		/* ã»ã¯ã·ã§ã³ */
+#define ARMV6_MMU_DSCR1_SSECTION	0x40002		/* ã¹ã¼ãã¼ã»ã¯ã·ã§ã³ */
+
+#define ARMV6_MMU_DSCR1_NONGLOBAL	0x20000		/* ã°ã­ã¼ãã«ã§ãªã */
+#define ARMV6_MMU_DSCR1_SHARED		0x10000		/* ãã­ã»ããµéã§å
+±æ */
+#define ARMV6_MMU_DSCR1_APX0		0x00000		/* APXãããã0 */
+#define ARMV6_MMU_DSCR1_APX1		0x08000		/* APXãããã1 */
+#define ARMV6_MMU_DSCR1_TEX000		0x00000		/* TEXãããã000 */
+#define ARMV6_MMU_DSCR1_TEX001		0x01000		/* TEXãããã001 */
+#define ARMV6_MMU_DSCR1_TEX010		0x02000		/* TEXãããã010 */
+#define ARMV6_MMU_DSCR1_TEX100		0x04000		/* TEXãããã100 */
+#define ARMV6_MMU_DSCR1_AP01		0x00400		/* APãããã01 */
+#define ARMV6_MMU_DSCR1_AP10		0x00800		/* APãããã10 */
+#define ARMV6_MMU_DSCR1_AP11		0x00c00		/* APãããã11 */
+#define ARMV6_MMU_DSCR1_ECC			0x00200		/* ECCãæå¹ï¼MPCoreï¼*/
+#define ARMV6_MMU_DSCR1_NOEXEC		0x00010		/* å®è¡ä¸å¯ */
+#define ARMV6_MMU_DSCR1_CB00		0x00000		/* Cãããã0ï¼Bãããã0 */
+#define ARMV6_MMU_DSCR1_CB01		0x00004		/* Cãããã0ï¼Bãããã1 */
+#define ARMV6_MMU_DSCR1_CB10		0x00008		/* Cãããã1ï¼Bãããã0 */
+#define ARMV6_MMU_DSCR1_CB11		0x0000c		/* Cãããã1ï¼Bãããã1 */
+
+/*
+ *  ç¬¬2ã¬ãã«ãã£ã¹ã¯ãªãã¿ã®è¨­å®å¤
+ */
+#define ARMV6_MMU_DSCR2_FAULT		0x0000		/* ãã©ã«ã */
+#define ARMV6_MMU_DSCR2_LARGE		0x0001		/* ã©ã¼ã¸ãã¼ã¸ */
+#define ARMV6_MMU_DSCR2_SMALL		0x0002		/* ã¹ã¢ã¼ã«ãã¼ã¸ */
+
+#define ARMV6_MMU_DSCR2_NONGLOBAL	0x0800		/* ã°ã­ã¼ãã«ã§ãªã */
+#define ARMV6_MMU_DSCR2_SHARED		0x0400		/* ãã­ã»ããµéã§å
+±æ */
+#define ARMV6_MMU_DSCR2_APX0		0x0000		/* APXãããã0 */
+#define ARMV6_MMU_DSCR2_APX1		0x0200		/* APXãããã1 */
+#define ARMV6_MMU_DSCR2_AP01		0x0010		/* APãããã01 */
+#define ARMV6_MMU_DSCR2_AP10		0x0020		/* APãããã10 */
+#define ARMV6_MMU_DSCR2_AP11		0x0030		/* APãããã11 */
+#define ARMV6_MMU_DSCR2_CB00		0x0000		/* Cãããã0ï¼Bãããã0 */
+#define ARMV6_MMU_DSCR2_CB01		0x0004		/* Cãããã0ï¼Bãããã1 */
+#define ARMV6_MMU_DSCR2_CB10		0x0008		/* Cãããã1ï¼Bãããã0 */
+#define ARMV6_MMU_DSCR2_CB11		0x000c		/* Cãããã1ï¼Bãããã1 */
+
+/* ã©ã¼ã¸ãã¼ã¸ã®ãã£ã¹ã¯ãªãã¿ç¨ */
+#define ARMV6_MMU_DSCR2L_TEX000		0x0000		/* TEXãããã000 */
+#define ARMV6_MMU_DSCR2L_TEX001		0x1000		/* TEXãããã001 */
+#define ARMV6_MMU_DSCR2L_TEX010		0x2000		/* TEXãããã010 */
+#define ARMV6_MMU_DSCR2L_TEX100		0x4000		/* TEXãããã100 */
+#define ARMV6_MMU_DSCR2L_NOEXEC		0x8000		/* å®è¡ä¸å¯ */
+
+/* ã¹ã¢ã¼ã«ãã¼ã¸ã®ãã£ã¹ã¯ãªãã¿ç¨ */
+#define ARMV6_MMU_DSCR2S_TEX000		0x0000		/* TEXãããã000 */
+#define ARMV6_MMU_DSCR2S_TEX001		0x0040		/* TEXãããã001 */
+#define ARMV6_MMU_DSCR2S_TEX010		0x0080		/* TEXãããã010 */
+#define ARMV6_MMU_DSCR2S_TEX100		0x0100		/* TEXãããã100 */
+#define ARMV6_MMU_DSCR2S_NOEXEC		0x0001		/* å®è¡ä¸å¯ */
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/arch/arm_gcc/doc/gic_design.txt
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/doc/gic_design.txt	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/doc/gic_design.txt	(revision 302)
@@ -0,0 +1,288 @@
+
+		TOPPERS/ASP3ã«ã¼ãã«
+		GICï¼ARM Generic Interrupt Controllerï¼ä¾å­é¨ è¨­è¨ã¡ã¢
+
+		å¯¾å¿ãã¼ã¸ã§ã³: Release 3.B.0
+		æçµæ´æ°: 2015å¹´7æ24æ¥
+
+----------------------------------------------------------------------
+
+âç®æ¬¡
+
+ã»åèæç®
+ã»GICä¾å­é¨ã®ä½ç½®ã¥ã
+	- GICä¾å­é¨ãæ§æãããã¡ã¤ã«
+ã»ãããä¾å­ã®ãã©ã¡ã¼ã¿
+ã»GICã«ãããå²è¾¼ã¿ãã³ãã©ããã³CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦ç
+	- GICã«ãããå²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦ç
+
+âåèæç®
+
+[1] TOPPERSãã­ã¸ã§ã¯ã è¨­è¨ã¡ã¢ãGICï¼ARM Generic Interrupt
+Controllerï¼ã«é¢ããã¡ã¢ãï¼
+
+âGICä¾å­é¨ã®ä½ç½®ã¥ã
+
+GICä¾å­é¨ã¯ï¼ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã®ä¸­ã§ï¼GICã¢ã¼ã­ãã¯ãã£
+ï¼GICv1ããã³GICv2ï¼ã«æºæ ããå²è¾¼ã¿ã³ã³ãã­ã¼ã©ãæã¤ãããã«å
+±éã«ä½¿
+ç¨ã§ããé¨åã§ããï¼ã¾ãï¼GICã®åèº«ã¨æãããARM11 MPCoreã®Distributed
+Interrupt Controllerã«ãé©ç¨ã§ããããã«å®è£
+ããï¼
+
+TOPPERS_SAFEG_SECUREããã¯ã­å®ç¾©ããã¦ããå ´åã«ã¯ï¼GICãã»ã­ã¥ãªãã£æ¡
+å¼µããã¦ãããã¨ãæ³å®ãï¼ã»ã­ã¥ã¢ã¢ã¼ãã§ä½¿ç¨ãããã®ã¨ããï¼
+
+GICv1ã¨GICv2ã§ã¬ã¸ã¹ã¿åãå¤æ´ã«ãªã£ã¦ãããï¼ã½ã¼ã¹ã³ã¼ãä¸­ã§ã¯ï¼
+GICv2ã®ã¬ã¸ã¹ã¿åãä½¿ç¨ããï¼
+
+âGICä¾å­é¨ãæ§æãããã¡ã¤ã«
+
+GICä¾å­é¨ã¯ï¼æ¬¡ã®3ã¤ã®ãã¡ã¤ã«ã§æ§æãããï¼
+
+gic_kernel_impl.h
+gic_kernel_impl.c
+gic_support.S
+
+âãããä¾å­ã®ãã©ã¡ã¼ã¿
+
+TMIN_INTPRI
+TMAX_INTPRI
+
+ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã®ããããã¡ã¤ã«ããgic_kernel_impl.hãã¤ã³ã¯
+ã«ã¼ãããåã«ï¼å¿
+è¦ã«å¿ãã¦ï¼ä»¥ä¸ã®å®æ°ããã¯ã­å®ç¾©ãã¦ããï¼
+
+(1) GIC_TNUM_INTNO		å²è¾¼ã¿ã®æ°
+
+ã¿ã¼ã²ãããããã®GICããµãã¼ãããå²è¾¼ã¿ã®æ°ï¼SGIï¼Software Generated
+Interruptï¼ï¼PPIï¼Private Peripheral Interruptï¼ï¼SPIï¼Shared
+Peripheral Interruptï¼ã®åè¨æ°ï¼
+
+(2) GIC_PRI_LEVEL		å²è¾¼ã¿åªå
+åº¦ã®æ®µæ°
+
+ã¿ã¼ã²ãããããã®GICããµãã¼ãããå²è¾¼ã¿åªå
+åº¦ã®æ®µæ°ï¼16ï¼32ï¼64ï¼128ï¼
+256ã®ããããï¼
+
+(3) GICC_BASE			CPUã¤ã³ã¿ãã§ã¼ã¹ã®ãã¼ã¹ã¢ãã¬ã¹
+(4) GICD_BASE			ãã£ã¹ããªãã¥ã¼ã¿ã®ãã¼ã¹ã¢ãã¬ã¹
+
+GICã®CPUã¤ã³ã¿ãã§ã¼ã¹ããã³ãã£ã¹ããªãã¥ã¼ã¿ã®ãã¼ã¹ã¢ãã¬ã¹ï¼
+
+(5) TOPPERS_SAFEG_SECURE	ã»ã­ã¥ã¢ã¢ã¼ãï¼ãªãã·ã§ã³ï¼
+
+ã»ã­ã¥ã¢ã¢ã¼ãã§ã«ã¼ãã«ãåä½ããï¼FIQãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ã¨æ±ãå ´å
+ã«ï¼ãã®ã·ã³ãã«ããã¯ã­å®ç¾©ããï¼
+
+(6) GIC_ARM11MOCORE		ARM11 MPCoreã¸ã®å¯¾å¿ï¼ãªãã·ã§ã³ï¼
+
+ARM11 MPCoreã®Distributed Interrupt Controllerã®å ´åã«ã¯ï¼ãã®ã·ã³ãã«
+ããã¯ã­å®ç¾©ããï¼
+
+âGICã«ãããå²è¾¼ã¿ãã³ãã©ããã³CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦ç
+
+âGICã«ãããå²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦ç
+
+GICã«ãããå²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦çï¼irc_begin_intããã³irc_end_intï¼
+ã®å®ç¾æ¹æ³ã«ã¯ï¼ããã¤ãã®ã¢ãã­ã¼ããããï¼
+
+ãã¢ãã­ã¼ã1ã
+
+ãã®ã¢ãã­ã¼ãã¯ï¼GICã®æ³å®ãã¦ããï¼ãã£ã¦ï¼æãã·ã³ãã«ãªï¼ãã®ã§ããï¼
+å²è¾¼ã¿ãã³ãã©ã®å
+¥å£ã§ã¯ä½ãè¡ããï¼å²è¾¼ã¿ãã³ãã©ã®åºå£ã§EOIãçºè¡ããï¼
+
+----------------------------------------
+ALABEL(irc_begin_int)
+	/*
+	 *  å²è¾¼ã¿è¦å ãåå¾ããï¼
+	 */
+	ldr		r1, =GICC_IAR
+	ldr		r3, [r1]
+	push	{r3}				/* irc_end_intã§ç¨ããæ
+å ±ãä¿å­ */
+
+	/*
+	 *  å²è¾¼ã¿çªå·ãè¿å¤ã¨ãã¦ãªã¿ã¼ã³ããï¼
+	 */
+	lsl		r0, r3, #22			/* ä¸ä½10ããããåãåºã */
+	lsr		r0, r0, #22
+	bx		lr
+
+ALABEL(irc_end_int)
+	/*
+	 *  EOIãçºè¡ãã¦ãªã¿ã¼ã³ããï¼
+	 */
+	pop		{r3}				/* irc_begin_intã§ä¿å­ããæ
+å ±ãå¾©å¸° */
+	ldr		r1, =GICC_EOIR		/* EOIã¬ã¸ã¹ã¿ã¸ã®æ¸è¾¼ã¿ */
+	str		r3, [r1]
+	bx		lr
+----------------------------------------
+
+ãã®ã¢ãã­ã¼ãã«ã¯ï¼æ¬¡ã®åé¡ç¹ãããï¼
+
+(1) å²è¾¼ã¿ãã³ãã©ããã®ãªã¿ã¼ã³æã«ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ãã¨ã
+ãä»æ§ãå®è£
+ãã¦ããã¨è¨ãããå¾®å¦ã§ããï¼ç¹ã«ï¼CPUä¾å¤ãã³ãã©ãããã¨
+æ´åããããã«å®è£
+ããå ´åï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãä¸åæä½ããªãã¨ããå®
+è£
+ã«ãªãï¼ä»æ§ã«æºæ ãã¦ããªãããã«æãããï¼
+
+(2) å²è¾¼ã¿åªå
+åº¦ã256æ®µéããæï¼ãã®å ´åï¼ARM GICã§ã¯ï¼å²è¾¼ã¿åªå
+åº¦ã®
+ãã¹ã¦ã®ããããããªã¨ã³ãã·ã§ã³ã«ä½¿ãã¨ããè¨­å®ãã§ããªãï¼ã«ï¼ãã®ã¢
+ãã­ã¼ãã§ã¯ï¼å²è¾¼ã¿åªå
+åº¦ã®ãã¹ã¦ã®ããããããªã¨ã³ãã·ã§ã³ã«ä½¿ããã¨
+ãã§ããï¼TOPPERSæ¨æºå²è¾¼ã¿å¦çã¢ãã«ããã®é¸è±ã¨ãªãï¼
+
+(3) å²è¾¼ã¿ãã³ãã©ããå²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãåç
+§ï¼è¨­å®ãããã¨ãã§ããªãï¼
+ASP3ã«ã¼ãã«ã§ã¯åé¡ãªããï¼ATK2ã«ã¼ãã«ã§ã¯ï¼ãã®ã¢ãã­ã¼ãã¯ç¨ããã
+ã¨ãã§ããªãï¼
+
+ãã¢ãã­ã¼ã2ã
+
+åé¡ç¹(1)ã¨(3)ãè§£æ±ºããããã«ã¯ï¼çºçããå²è¾¼ã¿è¦å ã®å²è¾¼ã¿åªå
+åº¦ãï¼
+å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã«è¨­å®ãã¦ããæ¹æ³ãèããããï¼
+
+----------------------------------------
+ALABEL(irc_begin_int)
+	/*
+	 *  å²è¾¼ã¿è¦å ãåå¾ããï¼
+	 */
+	ldr		r1, =GICC_IAR
+	ldr		r3, [r1]
+
+	/*
+	 *  å²è¾¼ã¿è¦å ã®å²è¾¼ã¿åªå
+åº¦ãæ±ãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã«è¨­å®ããï¼
+	 */
+	ldr		r1, =GICC_RPR		/* åãä»ããå²è¾¼ã¿ã®å²è¾¼ã¿åªå
+åº¦ãåå¾ */
+	ldr		r0, [r1]
+	ldr		r1, =GICC_PMR		/* å²è¾¼ã¿çºçåã®å²è¾¼ã¿åªå
+åº¦ãåå¾ */
+	ldr		r2, [r1]
+	str		r0, [r1]			/* æ°ããå²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãã»ãããã */
+	DATA_SYNC_BARRIER			/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãã»ãããããã®ãå¾
+ã¤ */
+	push	{r2,r3}				/* irc_end_intã§ç¨ããæ
+å ±ãä¿å­ */
+
+	/*
+	 *  å²è¾¼ã¿çªå·ãè¿å¤ã¨ãã¦ãªã¿ã¼ã³ããï¼
+	 */
+	lsl		r0, r3, #22			/* ä¸ä½10ããããåãåºã */
+	lsr		r0, r0, #22
+	bx		lr
+
+ALABEL(irc_end_int)
+	/*
+	 *  EOIãçºè¡ããï¼
+	 */
+	pop		{r2,r3}				/* irc_begin_intã§ä¿å­ããæ
+å ±ãå¾©å¸° */
+	ldr		r1, =GICC_EOIR		/* EOIã¬ã¸ã¹ã¿ã¸ã®æ¸è¾¼ã¿ */
+	str		r3, [r1]
+
+	/*
+	 *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ãã¦ãªã¿ã¼ã³ããï¼
+	 */
+	ldr		r1, =GICC_PMR
+	str		r2, [r1]
+	bx		lr
+----------------------------------------
+
+ãããï¼ãã®ã¢ãã­ã¼ãã§ã¯ï¼ã¢ãã­ã¼ã1ã®2ã¤ãã®æ¬ ç¹ã¯è§£æ±ºã§ããªãï¼
+
+ãã¢ãã­ã¼ã3ã
+
+ã¢ãã­ã¼ã1ã®2ã¤ãã®æ¬ ç¹ãè§£æ±ºããããã«ã¯ï¼å²è¾¼ã¿ãã³ãã©ã®å
+¥å£å¦çã§
+EOIãçºè¡ãã¦ãã¾ãæ¹æ³ãèããããï¼
+
+----------------------------------------
+ALABEL(irc_begin_int)
+	/*
+	 *  å²è¾¼ã¿è¦å ãåå¾ããï¼
+	 */
+	ldr		r1, =GICC_IAR
+	ldr		r3, [r1]
+
+	/*
+	 *  å²è¾¼ã¿è¦å ã®å²è¾¼ã¿åªå
+åº¦ãæ±ãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã«è¨­å®ããï¼
+	 */
+	ldr		r1, =GICC_RPR		/* åãä»ããå²è¾¼ã¿ã®å²è¾¼ã¿åªå
+åº¦ãåå¾ */
+	ldr		r0, [r1]
+	ldr		r1, =GICC_PMR		/* å²è¾¼ã¿çºçåã®å²è¾¼ã¿åªå
+åº¦ãåå¾ */
+	ldr		r2, [r1]
+	str		r0, [r1]			/* æ°ããå²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãã»ãããã */
+	DATA_SYNC_BARRIER			/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãã»ãããããã®ãå¾
+ã¤ */
+	push	{r2}				/* irc_end_intã§ç¨ããæ
+å ±ãä¿å­ */
+
+	/*
+	 *  EOIãçºè¡ããï¼
+	 */
+	ldr		r1, =GICC_EOIR		/* EOIã¬ã¸ã¹ã¿ã¸ã®æ¸è¾¼ã¿ */
+	str		r3, [r1]
+
+	/*
+	 *  å²è¾¼ã¿çªå·ãè¿å¤ã¨ãã¦ãªã¿ã¼ã³ããï¼
+	 */
+	lsl		r0, r3, #22			/* ä¸ä½10ããããåãåºã */
+	lsr		r0, r0, #22
+	bx		lr
+
+ALABEL(irc_end_int)
+	/*
+	 *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ãã¦ãªã¿ã¼ã³ããï¼
+	 */
+	pop		{r2}				/* irc_begin_intã§ä¿å­ããæ
+å ±ãå¾©å¸° */
+	ldr		r1, =GICC_PMR		/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ã */
+	str		r2, [r1]
+	bx		lr
+----------------------------------------
+
+ç¾å¨ã®å®è£
+ã§ã¯ï¼ã¢ãã­ã¼ã3ãæ¡ç¨ãã¦ããï¼
+
+âGICã«ãããCPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦ç
+
+
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/arch/arm_gcc/doc/gic_memo.txt
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/doc/gic_memo.txt	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/doc/gic_memo.txt	(revision 302)
@@ -0,0 +1,637 @@
+
+		TOPPERSãã­ã¸ã§ã¯ã è¨­è¨ã¡ã¢
+		GICï¼ARM Generic Interrupt Controllerï¼ã«é¢ããã¡ã¢
+
+		ä½æè
+: é«ç°åºç« ï¼åå¤å±å¤§å­¦ï¼
+		æçµæ´æ°: 2015å¹´7æ25æ¥
+
+âã¡ã¢ã®ä½ç½®ã¥ã
+
+ãã®ã¡ã¢ã¯ï¼ARM Generic Interrupt Controllerï¼GICï¼ã«é¢ãã¦ï¼TOPPERSã«ã¼
+ãã«ããã¼ãã£ã³ã°ããã«ããã£ã¦å¿
+è¦ã¨ãªãäºé 
+ãã¾ã¨ãããã®ã§ããï¼
+
+âç®æ¬¡
+
+ã»åèæç®
+ã»GICã®ã¢ã¼ã­ãã¯ãã£ä»æ§
+ã»PrimeCell GICï¼Generic Interrupt Controllerï¼PL390
+ã»ARM11 MPCore Distributed Interrupt Controller
+
+âåèæç®
+
+[1] ARM Generic Interrupt Controller - Architecture version 2.0
+Architecture Specification, 2013
+IHI0048B_b_gic_architecture_specification.pdf
+
+[2] PrimeCell Generic Interrupt Controller (PL390) Technical Reference Manual
+Revision: r0p0
+DDI0416B_gic_pl390_r0p0_trm.pdf
+
+[3] ARM11 MPCoreTM Processor Technical Reference Manual
+Revision: r2p0
+DDI0360F_arm11_mpcore_r2p0_trm.pdf
+
+âGICã®ã¢ã¼ã­ãã¯ãã£ä»æ§ï¼[1]ï¼
+
+GICã®ã¢ã¼ã­ãã¯ãã£ã«ãï¼GICv1ã¨GICv2ã®2ã¤ã®ãã¼ã¸ã§ã³ãããï¼ãã¼ã¸ã§
+ã³ã«ããã¬ã¸ã¹ã¿åãç°ãªãï¼ããã§ã¯ï¼GICv2ã®ã¢ã¼ã­ãã¯ãã£ã«ã¤ãã¦è¨è¿°
+ããï¼ä»®æ³åæ¡å¼µã«ã¤ãã¦ã¯è¨è¿°ãçç¥ããï¼
+
+âç¨èªã®å®ç¾©
+
+å²è¾¼ã¿ç¶æ
+
+	- Inactiveï¼Activeã§ãPendingã§ããªãç¶æ
+
+	- Pendingï¼è¦æ±ã¯èªè­ããã¦ããï¼ãµã¼ãã¹ãå¾
+ã£ã¦ããç¶æ
+
+	- Activeï¼ãã­ã»ããµã«ãã£ã¦åãä»ãããï¼ãµã¼ãã¹ããã¦ããç¶æ
+
+	- Active and pendingï¼ãã­ã»ããµããµã¼ãã¹ãã¦ãããï¼åãå²è¾¼ã¿æº
+	  ããã®è¦æ±ãããã«ããå ´å
+
+å²è¾¼ã¿ã®ã¿ã¤ã
+	- ããªãã§ã©ã«å²è¾¼ã¿ï¼Peripheral Interruptï¼
+		+ ãã©ã¤ãã¼ãããªãã§ã©ã«å²è¾¼ã¿ï¼PPI, Private Peripheral Interruptï¼
+			ï¼ç¹å®ã®ãã­ã»ããµåãã®å²è¾¼ã¿
+		+ å
+±æããªãã§ã©ã«å²è¾¼ã¿ï¼SPI, Shared Peripheral Interruptï¼
+			ï¼ãã­ã»ããµãéå®ããªãå²è¾¼ã¿
+	- ã½ããã¦ã§ã¢ã§çæããå²è¾¼ã¿ï¼SGI, Software Generated Interruptï¼
+	- ä»®æ³å²è¾¼ã¿ï¼Virtual Interruptï¼â¦ ä»®æ³åæ¡å¼µã®ã¿
+	- ã¡ã³ããã³ã¹å²è¾¼ã¿ï¼Maintenance Interruptï¼â¦ ä»®æ³åæ¡å¼µã®ã¿
+
+å²è¾¼ã¿ãã³ããªã³ã°ã®ã¢ãã« â¦ ãã«ããã­ã»ããµã®å ´å
+	- 1-Nã¢ãã«ï¼ã¿ã¼ã²ãããã­ã»ããµã®å
+ã®1ã¤ã®ã¿ãå²è¾¼ã¿ãå¦çãã
+	- N-Nã¢ãã«ï¼ãã¹ã¦ã®ã¿ã¼ã²ãããã­ã»ããµãå²è¾¼ã¿ãå¦çãã
+	ï¼GICã¯ï¼SGIã¯N-Nã¢ãã«ï¼ããªãã§ã©ã«å²è¾¼ã¿ã¯1-Nã¢ãã«ã§æ±ã
+
+âå²è¾¼ã¿ã°ã«ã¼ã
+
+2ã¤ã®å²è¾¼ã¿ã°ã«ã¼ãï¼ã»ã­ã¥ã¢ã¢ã¼ãç¨ã®ã°ã«ã¼ã0ï¼ãã³ã»ã­ã¥ã¢ã¢ã¼ãç¨
+ã®ã°ã«ã¼ã1ï¼ããµãã¼ãï¼GICv1ã§ã¯ï¼ã»ã­ã¥ãªãã£æ¡å¼µãããæã®ã¿ï¼å²è¾¼
+ã¿ã°ã«ã¼ãããµãã¼ãï¼
+
+ã»åå²è¾¼ã¿ãã°ã«ã¼ã0ã¾ãã¯ã°ã«ã¼ã1ã«è¨­å®å¯è½
+ã»ã°ã«ã¼ã0ã¯ï¼ã¿ã¼ã²ãããã­ã»ããµã«ï¼IRQã¾ãã¯FIQã§éç¥
+ã»ã°ã«ã¼ã1ã¯ï¼ã¿ã¼ã²ãããã­ã»ããµã«ï¼IRQã§éç¥
+ã»ä¸¡ã°ã«ã¼ãã®å²è¾¼ã¿ã®åªå
+åº¦ãçµ±ä¸ãã¦æ±ãã
+ã»ã°ã«ã¼ã0ã®å²è¾¼ã¿ã®è¨­å®ãã­ãã¯ãã¦ã³ãããªãã·ã§ã³ãã
+
+æ³¨æï¼åªå
+åº¦ã°ã«ã¼ãã¯ï¼å²è¾¼ã¿ã°ã«ã¼ãã¨ã¯å¥ã®æ¦å¿µãªã®ã§ï¼æ··åããªããã¨ï¼
+ãããåªå
+åº¦ã°ã«ã¼ãã¯ï¼ã»ã­ã¥ãªãã£æ¡å¼µã¨ã¯ç¡é¢ä¿ã®æ©è½
+
+âãã£ã¹ããªãã¥ã¼ã¿
+
+ãã£ã¹ããªãã¥ã¼ã¿ã®æ©è½ï¼ã½ããã¦ã§ã¢ããè¦ãããã®ï¼
+	- å²è¾¼ã¿è¦æ±ãCPUã¤ã³ã¿ãã§ã¼ã¹ã«éã
+	- åå²è¾¼ã¿ã®ç¦æ­¢ï¼è¨±å¯
+	- åå²è¾¼ã¿ã®åªå
+åº¦ã¬ãã«ã®è¨­å®
+	- åå²è¾¼ã¿ã®ã¿ã¼ã²ãããã­ã»ããµãªã¹ãã®è¨­å®
+	- åããªãã§ã©ã«å²è¾¼ã¿ã®ã¬ãã«ããªã¬ï¼ã¨ãã¸ããªã¬ã®è¨­å®
+		â»ã¬ãã«ããªã¬ã¯ï¼level-sensitiveã¨æ¸ããã¦ãã
+	- åå²è¾¼ã¿ã®ã°ã«ã¼ã0ï¼ã°ã«ã¼ã1ã®è¨­å®
+	- SGIã1ã¤ã¾ãã¯è¤æ°ã®ã¿ã¼ã²ãããã­ã»ããµã«éã
+	- åå²è¾¼ã¿ã®ç¶æ
+ã®åç
+§
+	- ããªãã§ã©ã«å²è¾¼ã¿ã®ãã³ãã£ã³ã°ç¶æ
+ã®ã½ããã¦ã§ã¢ããã®æä½
+
+å²è¾¼ã¿ID
+	- æå¤§ã§1020ã®å²è¾¼ã¿IDï¼ãã³ã¯ãä½¿ãã¨ããã«å¤ãã®å²è¾¼ã¿ãæ±ãã
+	- å²è¾¼ã¿IDã®æ§æ
+		0ã15ï¼SGI â¦ CPUã¤ã³ã¿ãã§ã¼ã¹æ¯
+			0ã7ï¼ãã³ã»ã­ã¥ã¢ç¨ã«ä½¿ããã¨ãå¼·ãæ¨å¥¨
+			8ã15ï¼ã»ã­ã¥ã¢ç¨ã«ä½¿ããã¨ãå¼·ãæ¨å¥¨
+		16ã31ï¼PPI â¦ CPUã¤ã³ã¿ãã§ã¼ã¹æ¯
+		32ã1019ï¼SPI
+		1020ã1023ï¼ç¹æ®ç®çã«äºç´
+			1020ã1021ï¼äºç´
+			1022ï¼å²è¾¼ã¿ã°ã«ã¼ãã«ä¼´ãã¹ããªã¢ã¹å²è¾¼ã¿ï¼è©³ç´°çç¥ï¼
+			1023ï¼ã¹ããªã¢ã¹å²è¾¼ã¿
+
+âCPUã¤ã³ã¿ãã§ã¼ã¹
+
+CPUã¤ã³ã¿ãã§ã¼ã¹ã®æ©è½ï¼ã½ããã¦ã§ã¢ããè¦ãããã®ï¼
+	- ãã­ã»ããµã¸ã®å²è¾¼ã¿è¦æ±ä¿¡å·ã®è¨±å¯
+	- å²è¾¼ã¿ã®åä»ãï¼acknowledgingï¼
+	- å²è¾¼ã¿å¦çå®äºã®éç¥
+	- å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®è¨­å®
+	- ããªã¨ã³ãã·ã§ã³ããªã·ã¼ã®è¨­å®
+	- ãã³ãã£ã³ã°ãã¦ããæé«åªå
+åº¦å²è¾¼ã¿ã®åå¾
+
+å²è¾¼ã¿ã®åä»ã
+	- ãã­ã»ããµãå²è¾¼ã¿ã¢ã¯ãã¼ã¬ãã¸ã¬ã¸ã¹ã¿ï¼IARï¼ãèª­ããã¨ã§ï¼å²è¾¼
+	  ã¿ãåãä»ãããã
+	- IARããã¯ï¼å²è¾¼ã¿IDãè¿ãï¼ã¹ããªã¢ã¹å²è¾¼ã¿ã®IDã§ããå ´åãï¼
+	- å²è¾¼ã¿ç¶æ
+ã¯ï¼pendingããactiveï¼ã¾ãã¯active and pendingï¼ã«é·ç§»
+
+å²è¾¼ã¿ã®å®äº
+	- ãã­ã»ããµãå²è¾¼ã¿å®äºã¬ã¸ã¹ã¿ï¼GICC_EOIRï¼ã«æ¸ããã¨ã§ï¼å²è¾¼ã®å®
+	  äºãéç¥ããã
+	- GICã¯æ¬¡ã®2ã¤ã®å¦çãå®è¡ãã
+		+ åªå
+åº¦ãã¹ã¯ãä¸ãã
+		+ å²è¾¼ã¿ãdeactivateããï¼activeããä»ã®ç¶æ
+ã«é·ç§»ãããï¼
+	- GICv2ã§ã¯ï¼è¨­å®ã«ããï¼GICC_EOIRã¸ã®æ¸ãè¾¼ã¿ã§ã¯1ã¤ãã®ã¹ãããã®
+	  ã¿è¡ãï¼å¥ã®ã¬ã¸ã¹ã¿ï¼GICC_DIRï¼ã¸ã®æ¸ãè¾¼ã¿ã§2ã¤ãã®ã¹ããããå®
+	  è¡ããããã¨ãã§ãã
+
+å²è¾¼ã¿ä¿¡å·ãã¤ãã¹ã¨ãã¤ãã¹ç¦æ­¢ ï¼è©³ç´°çç¥ï¼
+	- ã¬ã¬ã·ã¼å²è¾¼ã¿ãæ±ãããã«ï¼å²è¾¼ã¿è¦æ±ããã¤ãã¹ããæ©è½ããã
+	- GICv2ã§ã¯ï¼ãã¤ãã¹ãç¦æ­¢ããæ©è½ããã
+
+âå²è¾¼ã¿ã®ãã³ããªã³ã°ï¼ã»ã­ã¥ãªãã£æ¡å¼µããªãå ´åï¼
+
+ã»å²è¾¼ã¿ãã³ããªã³ã°ç¶æ
+ãã·ã³ã§ï¼4ã¤ã®å²è¾¼ã¿ç¶æ
+ã®éã®é·ç§»ãå®ç¾©
+
+ã»GICã®å²è¾¼ã¿ãã³ããªã³ã°ã·ã¼ã±ã³ã¹
+	1. å²è¾¼ã¿ãã¤ãã¼ãã«ããã¦ãããã©ãããå¤å®
+	2. ãã³ãã£ã³ã°ãã¦ããå²è¾¼ã¿ã«å¯¾ãã¦ï¼ã¿ã¼ã²ãããã­ã»ããµãæ±ºå®
+	3. ãã£ã¹ããªãã¥ã¼ã¿ã¯ï¼åãã­ã»ããµã«å¯¾ãã¦ï¼ãã³ãã£ã³ã°ãã¦ãã
+	   æé«åªå
+åº¦å²è¾¼ã¿ãæ±ºå®ãï¼CPUã¤ã³ã¿ãã§ã¼ã¹ã«éã
+	4. CPUã¤ã³ã¿ãã§ã¼ã¹ã¯ï¼ãã£ã¹ããªãã¥ã¼ã¿ããéããã¦ããå²è¾¼ã¿ã
+	   ååã«é«ãåªå
+åº¦ãæ±ºå®ãï¼ååã«é«ããã°ï¼ãã­ã»ããµã«éã
+	5. ãã­ã»ããµãå²è¾¼ã¿ãåãä»ããã¨ï¼GICã¯å²è¾¼ã¿IDãè¿ãï¼å²è¾¼ã¿ç¶æ
+
+	   ãæ´æ°ãã
+	6. å²è¾¼ã¿ã®å¦çãçµããã¨ï¼ãã­ã»ããµã¯å²è¾¼ã¿å®äºãGICã«éç¥ãã
+
+âå²è¾¼ã¿ã®åªå
+åº¦ä»ãï¼å²è¾¼ã¿ã°ã«ã¼ãã¨ã»ã­ã¥ãªãã£æ¡å¼µããªãå ´åï¼
+
+ã»GICããµãã¼ãããå²è¾¼ã¿åªå
+åº¦ã®æ°ã¯ï¼16ã256
+ã»å²è¾¼ã¿åªå
+åº¦ã¯ï¼8ãããã®ç¬¦å·ç¡ãæ´æ°ã§è¡¨ã
+	å¤ãå°ããæ¹ãåªå
+åº¦ãé«ã
+	åªå
+åº¦ã®æ°ã256ããå°ãªãã¨ãã¯ï¼ä¸ä½ãããããä½¿ç¨ãã
+	ä½¿ããªãä¸ä½ãããã¯RAZ/WI
+ã»åå²è¾¼ã¿ã®åªå
+åº¦ãåå¥ã«è¨­å®ã§ãã
+	å®è£
+ã«ãã£ã¦ï¼ç¹å®ã®å²è¾¼ã¿ã®åªå
+åº¦ãåºå®ãã¦ããã
+ã»åãåªå
+åº¦ã®å²è¾¼ã¿ã®ä¸­ã§ã©ããåãä»ãããã¯å®è£
+ä¾å­
+
+ã»å²è¾¼ã¿ã®ããªã¨ã³ãã·ã§ã³ã¯æ¬¡ã®2ã¤ã®æ¡ä»¶ãæã£ãæã«èµ·ãã
+	- å²è¾¼ã¿ã®åªå
+åº¦ãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãããé«ã
+	- å²è¾¼ã¿ã®ã°ã«ã¼ãåªå
+åº¦ãï¼å®è¡ä¸­åªå
+åº¦ã®ã°ã«ã¼ãåªå
+åº¦ãããé«ã
+
+ã»å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼GICC_PMRï¼
+	- CPUã¤ã³ã¿ãã§ã¼ã¹ã®GICC_PMRãããé«ãå²è¾¼ã¿ã®ã¿ãåãä»ãã
+		+ ãã®å¤å®ã«ï¼åªå
+åº¦ã®ã°ã«ã¼ãã¯å½±é¿ããªã
+	- å²è¾¼ã¿ã«æä½åªå
+åº¦ï¼å¤ã¨ãã¦ã¯æå¤§ï¼ãå²ãä»ããã¨ï¼ãã®å²è¾¼ã¿ã¯
+	  åãä»ããããªã
+
+ã»åªå
+åº¦ã°ã«ã¼ãã³ã°
+	- ãã¤ããªãã¤ã³ãã¬ã¸ã¹ã¿(GICC_BPRï¼ã®è¨­å®ã«ããï¼å²è¾¼ã¿åªå
+åº¦ãï¼
+	  ã°ã«ã¼ãåªå
+åº¦ã¨ãµãåªå
+åº¦ã«åãããã¨ãã§ãã
+	- ããªã¨ã³ãã·ã§ã³ã«ããã¦ã¯ï¼åãã°ã«ã¼ãã®åªå
+åº¦ã¯ï¼åãåªå
+åº¦ã¨
+	  è¦ãªãããï¼ã¤ã¾ãï¼åãã°ã«ã¼ãå
+ã§ã¯ããªã¨ã³ãã·ã§ã³ã¯èµ·ããªãï¼
+
+ãï¼å²è¾¼ã¿åªå
+åº¦ã8ãããã®æã¯ï¼ãã¹ã¦ã§ããªã¨ã³ãã·ã§ã³ãèµ·ããè¨­å®ã¯
+	ã§ããªã
+
+âå²è¾¼ã¿ã°ã«ã¼ãã¨å²è¾¼ã¿ã®ãã³ããªã³ã°ï¼ã»ã­ã¥ãªãã£æ¡å¼µï¼
+
+âå²è¾¼ã¿ã°ã«ã¼ãã¨å²è¾¼ã¿ã®åªå
+åº¦ä»ãï¼ã»ã­ã¥ãªãã£æ¡å¼µï¼
+
+ã»æ¬¡ã®ãã¨ãå¼·ãæ¨å¥¨ãã
+	- ã°ã«ã¼ã0ã«ã¯ï¼ååããé«ãåªå
+åº¦ï¼æä¸ä½ãããã0ï¼ãå²ãå½ã¦ã
+	- ã°ã«ã¼ã1ã«ã¯ï¼ååããä½ãåªå
+åº¦ï¼æä¸ä½ãããã1ï¼ãå²ãå½ã¦ã
+
+ã»ãã³ã»ã­ã¥ã¢ã¢ã¼ãããè¦ããå²è¾¼ã¿åªå
+åº¦
+	- ãã³ã»ã­ã¥ã¢ã¢ã¼ãããã¯ï¼ã°ã«ã¼ã1ã®å²è¾¼ã¿ã®ã¿ãæ±ãã
+	- æ¸ãè¾¼ã¿æã«ã¯ï¼1ãããå³ã«ã·ããããï¼æä¸ä½ãããã1ã«ãªã
+	- èª­ã¿åºãæã«ã¯ï¼1ãããå·¦ã«ã·ãããããï¼æä¸ä½ãããã¯ãªããªãï¼
+
+ã»åã°ã«ã¼ãã®å²è¾¼ã¿ã®ããªã¨ã³ãã·ã§ã³ã®å¶å¾¡
+	- GICC_BPRã«ã¯ï¼ã»ã­ã¥ã¢ã³ãã¼ã¨ãã³ã»ã­ã¥ã¢ã³ãã¼ããã
+		+ ã»ã­ã¥ã¢ã¢ã¼ãããã¢ã¯ã»ã¹ããã¨ï¼ã»ã­ã¥ã¢ã³ãã¼ã«ã¢ã¯ã»ã¹
+		+ ãã³ã»ã­ã¥ã¢ã¢ã¼ãããã¢ã¯ã»ã¹ããã¨ï¼ãã³ã»ã­ã¥ã¢ã³ãã¼ã«ã¢ã¯ã»ã¹
+	- ã°ã«ã¼ã0ã¯ï¼GICC_BPRã®ã»ã­ã¥ã¢ã³ãã¼ã§å¶å¾¡ããã
+	- ã°ã«ã¼ã1ã¯ï¼
+		GICC_CTLR.CBPRã0ã®æï¼GICC_BPRã®ãã³ã»ã­ã¥ã¢ã³ãã¼ã§å¶å¾¡ããã
+		GICC_CTLR.CBPRã1ã®æï¼GICC_BPRã®ã»ã­ã¥ã¢ã³ãã¼ã§å¶å¾¡ããã
+	- GICC_ABPRã¯ï¼ã»ã­ã¥ã¢ã¢ã¼ãããï¼GICC_BPRã®ãã³ã»ã­ã¥ã¢ã³ãã¼ã«ã¢
+	  ã¯ã»ã¹ããããã®ã¬ã¸ã¹ã¿
+
+ã»GICC_BPRã®ãã³ã»ã­ã¥ã¢ã³ãã¼ã®è¨­å®
+	- GICC_CTLR.CBPRã0ã®æï¼ã°ã«ã¼ã1ã®ããªã¨ã³ãã·ã§ã³ã«ã¯ï¼GICC_BPRã®
+	  ãã³ã»ã­ã¥ã¢ã³ãã¼ããã1å¼ããå¤ããä½¿ããã
+	- GICC_BPRã®ãã³ã»ã­ã¥ã¢ã³ãã¼ã«ï¼0ã¯è¨­å®ã§ããªã
+
+âãã­ã°ã©ãã³ã°ã¢ãã«ï¼Programmers' Modelï¼
+
+ã¬ã¸ã¹ã¿åã®ã³ã³ãã³ã·ã§ã³
+	GICD_xxxx â¦ ãã£ã¹ããªãã¥ã¼ã¿ã®ã¬ã¸ã¹ã¿
+	GICC_xxxx â¦ CPUã¤ã³ã¿ãã§ã¼ã¹ã®ã¬ã¸ã¹ã¿
+	GICH_xxxx â¦ ä»®æ³ã¤ã³ã¿ãã§ã¼ã¹å¶å¾¡ã¬ã¸ã¹ã¿ï¼ãã¤ããã¤ã¶ãä½¿ãï¼
+	GICV_xxxx â¦ ä»®æ³CPUã¤ã³ã¿ãã§ã¼ã¹ã®ã¬ã¸ã¹ã¿
+
+ã¬ã¸ã¹ã¿ã«é¢ããåå
+	ã»ãã¹ã¦ã®ã¬ã¸ã¹ã¿ã¯32ãããå¹
+
+	ã»äºç´ã¯ãã¹ã¦RAZ/WI
+
+âãã£ã¹ããªãã¥ã¼ã¿ã®ãã­ã°ã©ãã³ã°ã¢ãã«
+
+ãã£ã¹ããªãã¥ã¼ã¿å¶å¾¡ã¬ã¸ã¹ã¿ï¼GICD_CTLRï¼0x000
+	[31:2]	äºç´
+	[1]		EnableGrp1 â¦ ã»ã­ã¥ãªãã£æ¡å¼µã®å ´åã®ã¿
+				0ï¼ã°ã«ã¼ã1ã®å²è¾¼ã¿ããã©ã¯ã¼ãããªã
+				1ï¼ã°ã«ã¼ã1ã®å²è¾¼ã¿ããã©ã¯ã¼ããã
+	[0]		Enable â¦ ã»ã­ã¥ãªãã£æ¡å¼µãªãï¼EnableGrp0 â¦ ã»ã­ã¥ãªãã£æ¡å¼µ
+				0ï¼ï¼ã°ã«ã¼ã0ã®ï¼å²è¾¼ã¿ããã©ã¯ã¼ãããªã
+				1ï¼ï¼ã°ã«ã¼ã0ã®ï¼å²è¾¼ã¿ããã©ã¯ã¼ããã
+
+å²è¾¼ã¿ã³ã³ãã­ã¼ã©ã¿ã¤ãã¬ã¸ã¹ã¿ï¼GICD_TYPERï¼0x004ï¼RO
+
+ãã£ã¹ããªãã¥ã¼ã¿å®è£
+IDã¬ã¸ã¹ã¿ï¼GICD_IIDRï¼0x008ï¼RO
+
+å²è¾¼ã¿ã°ã«ã¼ãã¬ã¸ã¹ã¿ï¼GICD_IGROUPRnï¼0x080 â¦ ã»ã­ã¥ãªãã£æ¡å¼µ
+
+å²è¾¼ã¿ã¤ãã¼ãã«ã»ããã¬ã¸ã¹ã¿ï¼GICD_ISENABLERnï¼0x100ã0x17c
+å²è¾¼ã¿ã¤ãã¼ãã«ã¯ãªã¢ã¬ã¸ã¹ã¿ï¼GICD_ICENABLERnï¼0x180ã0x1fc
+	- åå²è¾¼ã¿ãã¤ãã¼ãã«ãããã©ãããå¶å¾¡ããã¬ã¸ã¹ã¿
+	- ã»ããã¬ã¸ã¹ã¿ã®å¯¾å¿ãããããã«1ãæ¸ãã¨ã¤ãã¼ãã«
+	- ã¯ãªã¢ã¬ã¸ã¹ã¿ã®å¯¾å¿ãããããã«1ãæ¸ãã¨ãã£ã¹ã¨ã¼ãã«
+	- ã©ã¡ãã®ã¬ã¸ã¹ã¿ãèª­ãã§ãï¼ã¤ãã¼ãã«ããã¦ããå²è¾¼ã¿ã«å¯¾ãã¦1ãè¿ã
+
+å²è¾¼ã¿ãã³ãã£ã³ã°ã»ããã¬ã¸ã¹ã¿ï¼GICD_ISPENDRnï¼0x200ã0x27c
+å²è¾¼ã¿ãã³ãã£ã³ã°ã¯ãªã¢ã¬ã¸ã¹ã¿ï¼GICD_ICPENDRnï¼0x280ã0x2fc
+	- åå²è¾¼ã¿ããã³ãã£ã³ã°ç¶æ
+ãã©ãããå¶å¾¡ããã¬ã¸ã¹ã¿
+	- SGIã¯ï¼ãã®ã¬ã¸ã¹ã¿ã§ã»ããï¼ã¯ãªã¢ã§ããªãï¼å¥ã®ã¬ã¸ã¹ã¿ãä½¿ãï¼
+	- ã»ããã¬ã¸ã¹ã¿ã®å¯¾å¿ãããããã«1ãæ¸ãã¨ãã³ãã£ã³ã°ç¶æ
+ã«
+		+ ã¢ã¯ãã£ãç¶æ
+ã®å ´åã¯ï¼"active and pending"ã«
+	- ã¯ãªã¢ã¬ã¸ã¹ã¿ã®å¯¾å¿ãããããã«1ãæ¸ãã¨ãã³ãã£ã³ã°ç¶æ
+ãè§£é¤
+		+ "active and pending"ã®å ´åã¯ï¼ã¢ã¯ãã£ãç¶æ
+ã«
+	- ã¬ãã«ããªã¬ã®å ´åã§ãï¼ãã®ã¬ã¸ã¹ã¿ã§è¦æ±ããå²è¾¼ã¿ã¯ã¨ãã¸ããªã¬ã®
+	  ããã«æ¯ãèãï¼ãã®ã¬ã¸ã¹ã¿ã§è¦æ±ããå²è¾¼ã¿ãè¨æ¶ããFFãããï¼
+	- ã©ã¡ãã®ã¬ã¸ã¹ã¿ãèª­ãã§ãï¼ãã³ãã£ã³ã°ããã¦ããå²è¾¼ã¿ã«å¯¾ãã¦1ãè¿ã
+			ãã«ããã­ã»ããµã®SGIã¨PPIã«é¢ãã¦ã¯ï¼èªãã­ã»ããµã«å¯¾ãã¦
+			ãã³ãã£ã³ã°ããã¦ãããã©ãããè¿ã
+
+å²è¾¼ã¿ã¢ã¯ãã£ãã»ããã¬ã¸ã¹ã¿ï¼GICD_ISACTIVERnï¼0x300ã0x37c
+							â¦ GICv1ã§ã¯å²è¾¼ã¿ã¢ã¯ãã£ããããã¬ã¸ã¹ã¿ã§RO
+å²è¾¼ã¿ã¢ã¯ãã£ãã¯ãªã¢ã¬ã¸ã¹ã¿ï¼GICD_ICACTIVERnï¼0x380ã0x3fc
+
+å²è¾¼ã¿åªå
+åº¦ã¬ã¸ã¹ã¿ï¼GICD_IPRIORITYRnï¼0x400ã0x7f8
+	- åå²è¾¼ã¿ã®åªå
+åº¦ã8ãããã§è¨­å®
+	ï¼ãã¤ãåä½ã§ã¢ã¯ã»ã¹å¯è½
+
+å²è¾¼ã¿ã¿ã¼ã²ããã¬ã¸ã¹ã¿ï¼GICD_ITARGETSRnï¼0x800ã0xbf8 â¦ ãã«ãã³ã¢ã®ã¿
+							â¦ æåã®32åï¼ã¿ã¼ã²ããåºå®ï¼ã¯RO
+	- åå²è¾¼ã¿ã®ã¿ã¼ã²ãããã­ã»ããµã®ãªã¹ãã8ãããã®ããããããã§è¨­å®
+	ï¼ãã¤ãåä½ã§ã¢ã¯ã»ã¹å¯è½
+
+å²è¾¼ã¿ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¬ã¸ã¹ã¿ï¼GICD_ICFGRnï¼0xc00ã0xcfc
+	- åå²è¾¼ã¿ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã2ãããã§è¨­å®
+	- ã¬ãã«ããªã¬ãã¨ãã¸ããªã¬ããè¨­å®
+	- GICv1ããåã®ä¸é¨ã®å®è£
+ã§ã¯ï¼N-Nã¢ãã«ã1-Nã¢ãã«ããããã§è¨­å®
+			0ï¼N-Nã¢ãã«
+			1ï¼1-Nã¢ãã«
+
+å²è¾¼ã¿ãã³ã»ã­ã¥ã¢ã¢ã¯ã»ã¹å¶å¾¡ã¬ã¸ã¹ã¿ï¼GICD_NSCARnï¼0xe00ã0xefc â¦ ãªãã·ã§ã³
+
+SGIã¬ã¸ã¹ã¿ï¼GICD_SGIRï¼0xf00ï¼WO
+	- SGIãçºçãããã¬ã¸ã¹ã¿
+
+SGIãã³ãã£ã³ã°ã¯ãªã¢ã¬ã¸ã¹ã¿ï¼GICD_CPENDSGIRnï¼0xf10ã0xf1c
+SGIãã³ãã£ã³ã°ã»ããã¬ã¸ã¹ã¿ï¼GICD_SPENDSGIRnï¼0xf20ã0xf2c
+	- SIGããã³ãã£ã³ã°ç¶æ
+ãã©ãããå¶å¾¡ããã¬ã¸ã¹ã¿
+
+ä»ã«ï¼å®è£
+å®ç¾©ã¬ã¸ã¹ã¿ããã
+
+âCPUã¤ã³ã¿ãã§ã¼ã¹ã®ãã­ã°ã©ãã³ã°ã¢ãã«
+
+CPUã¤ã³ã¿ãã§ã¼ã¹å¶å¾¡ã¬ã¸ã¹ã¿ï¼GICC_CTLRï¼0x000
+
+å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¬ã¸ã¹ã¿ï¼GICC_PMRï¼0x004
+
+ãã¤ããªãã¤ã³ãã¬ã¸ã¹ã¿ï¼GICC_BPRï¼0x008
+	- å²è¾¼ã¿åªå
+åº¦ãï¼ã°ã«ã¼ãåªå
+åº¦ã¨ãµãåªå
+åº¦ã«åããä½ç½®ãè¨­å®
+		[31:3]	äºç´
+		[2:0]	åå²ä½ç½®ï¼gãã°ã«ã¼ãåªå
+åº¦ï¼sããµãåªå
+åº¦ï¼
+					0ï¼ä¸ä½7ããããã°ã«ã¼ãåªå
+åº¦	ggggggg.s
+					1ï¼ä¸ä½6ããããã°ã«ã¼ãåªå
+åº¦	gggggg.ss
+					6ï¼åä¸ä½ããããã°ã«ã¼ãåªå
+åº¦	g.sssssss
+					7ï¼ããªã¨ã³ãã·ã§ã³ããªã		ssssssss
+	ï¼åªå
+åº¦ã8ãããã®æã¯ï¼å
+¨ããããã°ã«ã¼ãåªå
+åº¦ã«ãããã¨ã¯ã§ããªã
+
+å²è¾¼ã¿ã¢ã¯ãã¼ã¬ãã¸ã¬ã¸ã¹ã¿ï¼GICC_IARï¼0x00cï¼RO
+
+å²è¾¼ã¿å®äºã¬ã¸ã¹ã¿ï¼GICC_EOIRï¼0x010ï¼WO
+
+å®è¡ä¸­åªå
+åº¦ã¬ã¸ã¹ã¿ï¼GICC_RPRï¼0x014ï¼RO
+
+æé«åªå
+åº¦ãã³ãã£ã³ã°å²è¾¼ã¿ã¬ã¸ã¹ã¿ï¼GICC_HPPIRï¼0x018ï¼RO
+
+ï¼çç¥ï¼ã»ã­ã¥ãªãã£æ¡å¼µã®ããã®ã¬ã¸ã¹ã¿ï¼
+
+CPUã¤ã³ã¿ãã§ã¼ã¹IDã¬ã¸ã¹ã¿ï¼GICC_IIDRï¼0x00fcï¼RO
+
+å²è¾¼ã¿ãã£ã¢ã¯ãã£ãã¼ãã¬ã¸ã¹ã¿ï¼GICC_DIRï¼0x1000ï¼WO â¦ GICv2ã®ã¿
+
+âPrimeCell GICï¼Generic Interrupt Controllerï¼PL390ï¼[2]ï¼
+
+ãã®GICã¯ï¼ãARM Generic Interrupt Controller Architectureãï¼æè¨ãã¦
+ããªããï¼GICv1ã¨æãããï¼ã«æºæ 
+
+ããã§è¨ããã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¨ã¯ï¼ãã¼ãã¦ã§ã¢IPã®ã³ã³ãã£ã®ã¥
+ã¬ã¼ã·ã§ã³ã®ãã¨
+
+âGICã®æ§æ
+
+	- ãã£ã¹ããªãã¥ã¼ã¿ â¦ 1ã¤ã ã
+		+ å¤é¨ããã®å²è¾¼ã¿ãåãåãï¼æé«åªå
+åº¦ã®ãã®ãCPUã¤ã³ã¿ãã§ã¼ã¹ã«éã
+	- CPUã¤ã³ã¿ãã§ã¼ã¹ â¦ ãã­ã»ããµæ¯ã«
+	- ãã®ä»ã®ãã­ãã¯
+		+ AMBAã¹ã¬ã¼ãã¤ã³ã¿ãã§ã¼ã¹
+		+ ã¯ã­ãã¯ã¨ãªã»ãã
+		+ enableã¨matchä¿¡å·
+			ï¼å¶å¾¡ã¬ã¸ã¹ã¿ãæä½ã§ãããã­ã»ããµãéå®ããæ©è½
+
+âGICã®æ©è½
+
+ã»3ã¿ã¤ãã®å²è¾¼ã¿ï¼SIGï¼PPIï¼SPIï¼ããµãã¼ã
+	â»ãã®ä»ã«ã¬ã¬ã·ã¼å²è¾¼ã¿ï¼legacy interruptï¼ããã
+
+ã»å²è¾¼ã¿ãæ¬¡ã®ããã«ãã­ã°ã©ã å¯è½
+	- ã»ã­ã¥ãªãã£ç¶æ
+
+	- å²è¾¼ã¿ã¬ãã«
+	- å²è¾¼ã¿ã®ç¦æ­¢/è¨±å¯
+	- å²è¾¼ã¿ãåãåããã­ã»ããµ
+
+ã»ã»ã­ã¥ãªãã£æ¡å¼µã«å¯¾å¿å¯è½
+
+âã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãªãã·ã§ã³ ï¼é¢ä¿ããããªé 
+ç®ã®ã¿ï¼
+
+	- ã»ã­ã¥ãªãã£æ¡å¼µã®ãµãã¼ãã®æç¡
+	- CPUã¤ã³ã¿ãã§ã¼ã¹ã®æ°
+	- ã­ãã¯å¯è½ãªSPIï¼è¦èª¿æ»ï¼ã®æ°
+	- PPIé¢é£
+		+ CPUã¤ã³ã¿ãã§ã¼ã¹æ¯ã®æ°ï¼0ã16ï¼
+		+ ã¬ãã«ããªã¬ãã¨ãã¸ããªã¬ã
+		+ ç´ éããç»é²ãåæã
+	- ãã­ã»ããµæ¯ã®SGIã®æ°ï¼0ã16ï¼
+	- SPIé¢é£
+		+ æ°ï¼1ã988ï¼
+		+ ç´ éããç»é²ãåæã
+	- ã¬ã¬ã·ã¼å²è¾¼ã¿é¢é£
+		+ ãµãã¼ãã®æç¡ï¼0ã2ï¼
+		+ ã¬ãã«ããªã¬ãã¨ãã¸ããªã¬ã
+		+ ç´ éããç»é²ãåæã
+	- åªå
+åº¦ã¬ãã«ã®æ°
+	- The number of register slices in the highest pending interrupt logic.
+
+âå²è¾¼ã¿åä»ï¼ãã£ã¹ããªãã¥ã¼ã¿ã®æ©è½ï¼
+
+	- å²è¾¼ã¿ã®ç»é²ï¼registeringï¼ã¨åæï¼synchronizingï¼
+		+ ç´ éãã»ç»é²ã»åæã®3ã¤ãã1ã¤ãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã§æ±ºãã
+		+ ç»é² â¦ å²è¾¼ã¿è¦æ±ãæ¬¡ã®ã¯ã­ãã¯ã§åãåã
+		+ åæ â¦ å²è¾¼ã¿è¦æ±ãæ¬¡ã®æ¬¡ã®ã¯ã­ãã¯ã§åãåã
+	- ã¨ãã¸æ¤åº
+		+ ã¬ãã«ããªã¬ï¼ã¨ãã¸ããªã¬ã®2ã¤ãã1ã¤ãé¸ã¹ã
+		+ PPIã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³æã«æ±ºãã
+				
+âCPUã¤ã³ã¿ãã§ã¼ã¹
+
+	- æ¬¡ã®ä¸¡æ¹ãããåªå
+åº¦ãé«ãå²è¾¼ã¿ãåãä»ãã
+		+ ãã­ã°ã©ã ã§ããå²è¾¼ã¿åªå
+åº¦ãã¹ã¯
+		+ ãã­ã»ããµããµã¼ãã¹ä¸­ã®å²è¾¼ã¿								   
+
+âå®è£
+å®ç¾©äºé 
+ ï¼é¢ä¿ããããªé 
+ç®ã®ã¿ï¼
+
+ãARM Generic Interrupt Controller Architectureãã§å®è£
+å®ç¾©ã¨ããã¦ãã
+äºé 
+ãï¼ãã®GICã§ã¯æ¬¡ã®ããã«å®ç¾©ãã¦ããï¼
+
+	- PPIã®ããªã¬ã¢ã¼ãã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³æã«æ±ºå®ãï¼ã¬ã¸ã¹ã¿ã®
+	  è¨­å®ã§å¤ããããªã
+
+	- ã¢ã¯ãã£ãã¾ãã¯ã¢ã¯ãã£ããã³ãã£ã³ã°ã®å²è¾¼ã¿ã®åªå
+åº¦ã¬ãã«ãå¤æ´
+	  ããå ´åã®æ¯èãï¼ãã®GICã¯æ°ããåªå
+åº¦ã¬ãã«ãããã«ä½¿ã
+
+	- åãåªå
+åº¦ã®å²è¾¼ã¿éã®åªå
+é¢ä¿ï¼ç¥
+
+	- ã¿ã¼ã²ãããã­ã»ããµãè¤æ°ã®SPIã®èª¿åï¼ãã®GICã¯èª¿åãããªãï¼ã
+	  ã¹ã¦ã®ã¿ã¼ã²ãããã­ã»ããµã«åæã«å²è¾¼ã¿è¦æ±ãéãï¼æåã«å¿ç­ã
+	  ãï¼IARãèª­ãã ãã­ã»ããµï¼ãå²è¾¼ã¿IDãåãåãï¼ä»ã®ãã­ã»ããµã«
+	  ã¯ï¼ã¹ããªã¢ã¹å²è¾¼ã¿ãè¿ãï¼
+
+âARM11 MPCore Distributed Interrupt Controllerï¼[3]ã®ç¬¬10ç« ï¼
+
+â»ARM11 MPCoreã®Distributed Interrupt Controllerã¯ï¼GICã®åèº«ã¨æãããï¼
+ããã¥ã¢ã«ä¸­ã«GICã¨ããç¨èªã¯åºã¦ããªããï¼GICã¨ã»ã¼äºæã§ä½¿ç¨ã§ããï¼
+
+Distributed Interrupt Controllerã¯ï¼æ¬¡ã®2ã¤ã§æ§æãããï¼
+	- å²è¾¼ã¿ãã£ã¹ããªãã¥ã¼ã¿
+	- CPUå²è¾¼ã¿ã¤ã³ã¿ãã§ã¼ã¹
+
+âå²è¾¼ã¿ãã£ã¹ããªãã¥ã¼ã¿
+
+ã»å²è¾¼ã¿è¦æ±ããã­ã»ããµã«åé
+ããã¦ãããï¼å²è¾¼ã¿æ¯ã«ï¼åªå
+åº¦ã¨ï¼ã¿ã¼
+ã²ãããã­ã»ããµã®ãªã¹ããè¨­å®ã§ããï¼
+
+ã»å²è¾¼ã¿æºã«ã¯ï¼ä»¥ä¸ã®ãã®ãããï¼
+	- ãã­ã»ããµéå²è¾¼ã¿ï¼IPIï¼â¦ GICã®SGIã«ç¸å½
+		+ ã½ããã¦ã§ã¢ããè¦æ±ããå²è¾¼ã¿ï¼ID0ãID15
+	- ãã©ã¤ãã¼ãã¿ã¤ãã¨ã¦ã©ããããã° â¦ GICã®PPIã«ç¸å½
+		+ ARM11 MPCoreå
+èµã¿ã¤ãããã®å²è¾¼ã¿ï¼ID29ã¨ID30
+	- ã¬ã¬ã·ã¼ãªnIRQãã³ â¦ GICã®å²è¾¼ã¿ãã¤ãã¹ã«ç¸å½
+		+ åãã­ã»ããµã«ç´çµï¼ID31
+	- ãã¼ãã¦ã§ã¢å²è¾¼ã¿ â¦ GICã®SPIã«ç¸å½
+		+ åå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾å¿ããå²è¾¼ã¿ï¼ID32ãæå¤§ID255
+
+ã»nFIQã¯æ±ããªãï¼nFIQã®è¦æ±ã©ã¤ã³ã¯ï¼åãã­ã»ããµã«ç´çµãããï¼
+
+ã»å²è¾¼ã¿ãã£ã¹ããªãã¥ã¼ã¿ã¯ï¼ãã­ã»ããµæ¯ã«ãã³ãã£ã³ã°ãã¦ããå²è¾¼ã¿
+ãã®ãªã¹ããæã¡ï¼ãã®ä¸­ã§æãåªå
+åº¦ã®é«ããã®ãé¸ãã§ï¼CPUå²è¾¼ã¿ã¤ã³ã¿
+ããã§ã¼ã¹ã«éç¥ããï¼
+
+	- åªå
+åº¦ãåãå²è¾¼ã¿ã®éã§ã¯ï¼IDãå°ããæ¹ãåªå
+
+
+	- 1-Nã¢ãã«ã¨N-Nã¢ãã«ã®ä¸¡æ¹ããµãã¼ã
+		+ 1-Nã¢ãã«ã§ï¼è¤æ°ã®ãã­ã»ããµãåæã«IARã«ã¢ã¯ã»ã¹ããã¨ï¼å
+		  ãå²è¾¼ã¿ãéç¥ããã
+		ï¼å²è¾¼ã¿å¦çã®ã½ããã¦ã§ã¢ã§è§£æ±ºããªããã°ãªããªãï¼
+		â»è¤æ°ã®ã¿ã¼ã²ãããã­ã»ããµã¸ã®éç¥ã¯ä½¿ããªãæ¹ãç¡é£
+
+âå²è¾¼ã¿ãã£ã¹ããªãã¥ã¼ã¿ã®ã¬ã¸ã¹ã¿
+
+ã»å²è¾¼ã¿ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¬ã¸ã¹ã¿ã§ï¼1-Nã¢ãã«ãN-Nã¢ãã«ããè¨­å®ãã
+	ãGICv1ããåã®ä¸é¨ã®å®è£
+ãã«è©²å½
+
+âCPUå²è¾¼ã¿ã¤ã³ã¿ãã§ã¼ã¹ã®ã¬ã¸ã¹ã¿
+
+ã»ã¬ã¸ã¹ã¿ã®ä¸è¦§
+
+ã¬ã¸ã¹ã¿å						ãªãã»ãã
+---------------------------------------------------
+Control Register					0x00		R/W
+Priority Mask Register				0x04		R/W
+Binary Pointer Register				0x08		R/W
+Interrupt Acknowledge Register		0x0c		RO
+End of Interrupt Register			0x10		WO
+Running Priority Register			0x14		RO
+Highest Pending Interrupt Register	0x18		RO
+
+ã»å¶å¾¡ã¬ã¸ã¹ã¿
+	[31:1]	äºç´
+	[1]		Enable
+				0ï¼å¤é¨nIRQå
+¥åã®ã¿ãæå¹
+				1ï¼ãã¹ã¦ã®å²è¾¼ã¿å
+¥åãæå¹
+
+ã»åªå
+åº¦ãã¹ã¯ã¬ã¸ã¹ã¿
+	[31:8]	SBZ
+	[7:4]	åªå
+åº¦ãã¹ã¯
+				0x0ï¼ãã¹ã¦ã®å²è¾¼ã¿ããã¹ã¯
+				...
+				0xEï¼å²è¾¼ã¿åªå
+åº¦14ã15ããã¹ã¯
+				0xFï¼å²è¾¼ã¿åªå
+åº¦15ã®ã¿ãã¹ã¯
+				â»å²è¾¼ã¿åªå
+åº¦15ã¯åãä»ããããªã
+	[3:0]	SBZ
+
+	â»ã«ã¼ãã«ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¨ã®å¯¾å¿
+		0x0		-15
+		...
+		0xE		-1
+		0xF		0
+
+ã»ãã¤ããªãã¤ã³ãã¬ã¸ã¹ã¿
+	[31:3]	äºç´
+	[2:0]	Binary point	å²è¾¼ã¿åªå
+åº¦ã®ã©ã®ããããããªã¨ã³ãã·ã§ã³ã®
+							å¤æ­ã«ä½¿ããï¼
+				0x3ï¼ãã¹ã¦ã®ããããä½¿ãï¼ããã©ã«ãï¼
+				0x4ï¼ä¸ä½3ããããä½¿ã
+				0x5ï¼ä¸ä½2ããããä½¿ã
+				0x6ï¼æä¸ä½ãããã®ã¿ä½¿ã
+				0x7ï¼ããªã¨ã³ãã·ã§ã³ããªã
+				ä»ã®å¤ãæ¸ãã¨ï¼0x03ãæ¸ããã®ã¨åãã«ãªã
+
+ã»å²è¾¼ã¿ã¢ã¯ãã¼ã¬ãã¸ã¬ã¸ã¹ã¿
+	[31:13]	SBZ/RAZ
+	[12:10]	ã½ã¼ã¹CPU ID	ãã­ã»ããµéå²è¾¼ã¿ãè¦æ±ãããã­ã»ããµID
+	[9:0]	å²è¾¼ã¿ID
+				1023ï¼ã¹ããªã¢ã¹å²è¾¼ã¿
+
+ã»å²è¾¼ã¿å®äºã¬ã¸ã¹ã¿
+	å²è¾¼ã¿å¦çã®å®äºãéç¥ããããã®ã¬ã¸ã¹ã¿
+	å²è¾¼ã¿ã¢ã¯ãã¼ã¬ãã¸ã¬ã¸ã¹ã¿ã¨åããã©ã¼ããã
+
+ã»å®è¡ä¸­åªå
+åº¦ã¬ã¸ã¹ã¿
+	æå¾ã«ã¢ã¯ãã¼ã¬ãã¸ãã¦ï¼ã¾ã å®äºãã¦ããªãå²è¾¼ã¿ã®åªå
+åº¦
+	[31:8]	äºç´
+	[7:4]	åªå
+åº¦
+	[3:0]	SBZ
+
+ã»æé«åªå
+åº¦ãã³ãã£ã³ã°å²è¾¼ã¿ã¬ã¸ã¹ã¿
+	ãã³ãã£ã³ã°ãã¦ããå²è¾¼ã¿ã®ä¸­ã§æé«åªå
+åº¦ã®ãã®ãåå¾ããããã®ã¬ã¸ã¹ã¿
+	ãã³ãã£ã³ã°ãã¦ããå²è¾¼ã¿ããªãæã¯ï¼å²è¾¼ã¿IDã¨ãã¦1023ãè¿ã
+	å²è¾¼ã¿ã¢ã¯ãã¼ã¬ãã¸ã¬ã¸ã¹ã¿ã¨åããã©ã¼ããã
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/arch/arm_gcc/doc/mpcore_memo.txt
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/doc/mpcore_memo.txt	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/doc/mpcore_memo.txt	(revision 302)
@@ -0,0 +1,243 @@
+
+		TOPPERSãã­ã¸ã§ã¯ã è¨­è¨ã¡ã¢
+		MPCoreããã³ãããç¨ãããããï¼ãã¼ãã«é¢ããã¡ã¢
+
+		ä½æè
+: é«ç°åºç« ï¼åå¤å±å¤§å­¦ï¼
+		æçµæ´æ°: 2015å¹´8æ9æ¥
+
+âã¡ã¢ã®ä½ç½®ã¥ã
+
+ãã®ã¡ã¢ã¯ï¼MPCoreã¨ï¼ãããç¨ããä»¥ä¸ã®ãããï¼ãã¼ãã«é¢ãã¦ï¼
+TOPPERSã«ã¼ãã«ããã¼ãã£ã³ã°ããã«ããã£ã¦å¿
+è¦ã¨ãªãäºé 
+ãã¾ã¨ãããã®
+ã§ããï¼
+
+ã»ARM11 MPCore
+ã»Core Tile for ARM11 MPCoreï¼CT11MPCoreï¼
+ã»RealView Platform Baseboard for ARM11 MPCore
+
+âç®æ¬¡
+
+ã»åèæç®
+ã»ARM CT11MPcore with RealView Emulation Baseboard
+	- ç¨èªã®æ´ç
+	- ARM11 MPCoreãã¹ããããã®å²è¾¼ã¿æ©è½
+	- CoreTile for ARM11 MPcoreã®å²è¾¼ã¿æ©è½
+	- ããã¤ã¹ã¬ã¸ã¹ã¿ã®ã¢ãã¬ã¹
+ã»ARM11 MPCoreå
+èµã¿ã¤ã
+	- ã¿ã¤ã
+	- ã¦ã©ããããã°
+
+âåèæç®
+
+[1] ARM11 MPCore Processor Technical Reference Manual, 2008
+Revision: r2p0
+DDI0360F_arm11_mpcore_r2p0_trm.pdf
+
+[2] Cortex-A9 MPCore Technical Reference Manual, 2012
+Revision: r4p1
+DDI0407I_cortex_a9_mpcore_r4p1_trm
+
+[3] Core Tile for ARM11 MPCore User Guide
+HBI-0146
+DUI0318F_core_tile_for_arm11_mpcore_ug.pdf
+
+[4] Using a CT11MPCore with the RealView Emulation Baseboard, 2008
+ARM DAI 0152E
+DAI0152E_ct11mpcore_on_emulation_baseboard.pdf
+
+[5] RealView Platform Baseboard for ARM11 MPCore User Guide, 2011
+HBI-0159, HBI-0175, HBI-0176
+DUI0351E_realview_platform_baseboard_for_arm11_mpcore_ug.pdf
+
+âARM CT11MPcore with RealView Emulation Baseboard
+
+âç¨èªã®æ´ç
+
+ã»Emulation Baseboardï¼EBï¼
+	- ã³ã¢ãå«ã¾ãªããã¼ã¹ãã¼ã
+	- ã¡ã¢ãªãåç¨®ã®ããªãã§ã©ã«ãæ­è¼ãã
+
+ã»Platform Baseboardï¼PBï¼
+	- ã³ã¢ãæ­è¼ãããã¼ã¹ãã¼ã
+	- ã¡ã¢ãªãåç¨®ã®ããªãã§ã©ã«ãæ­è¼ãã
+
+ã»CoreTileï¼CTï¼
+	- Emulation Baseboardï¼EBï¼ã«è¼ããããã®ã³ã¢ãæ­è¼ããå°åãã¼ã
+
+ã»Core Tile for ARM11 MPCoreï¼CT11MPCoreï¼
+	- ARM11 MPCoreã®ãã¹ãããããæ­è¼ããCoreTile
+		+ 4ãã­ã»ããµæ§æã®ARM11 MPCore
+		+ L220 ã¬ãã«2 ã­ã£ãã·ã¥ã³ã³ãã­ã¼ã©
+
+ã»HDRXï¼HDRYï¼HDRZï¼ä½ã®ç¥ãä¸æï¼
+	- Baseboardã¨CoreTileãæ¥ç¶ãã3ã¤ã®ã³ãã¯ã¿ã®åç§°
+
+ã»DCCï¼Debug Communications Controllerï¼
+
+âARM11 MPCoreãã¹ããããã®å²è¾¼ã¿æ©è½ï¼[3] 4.3.2ç¯ï¼
+
+ã»æ­è¼ããã¦ããå²è¾¼ã¿ã³ã³ãã­ã¼ã©
+	- DICï¼Distributed Interrupt Controllerï¼
+	- GICã®åèº«ã¨ãªãä»æ§ï¼GICv0ã«ç¸å½ï¼
+
+ã»ãããå¤ããã®å²è¾¼ã¿è¦æ±ã©ã¤ã³
+	- nIRQ[3:0] â¦ DICã®å²è¾¼ã¿ID31ã«
+	- nFIQ[3:0] â¦ åãã­ã»ããµã®FIQã«ç´çµ
+	- INT[15:0] â¦ DICã®å²è¾¼ã¿ID32ã47ã«
+
+ã»CPSRä¸­ã®Fããããç¡å¹ã«ãã¦ï¼FIQãNMIæ±ãã§ãã
+	- ãã¹ããããå²è¾¼ã¿å¶å¾¡ã¬ã¸ã¹ã¿ã§è¨­å®
+		PERIPHBASEï¼0x3004U
+
+ã»DICã¯32æ¬ã®å²è¾¼ã¿è¦æ±ã©ã¤ã³ãæã¤
+	- ãã¼ãã¦ã§ã¢å²è¾¼ã¿ï¼GICã®SPIã«ç¸å½ï¼ã®æ¬æ°ã®ãã¨ã¨æããã
+
+ã»ãã¹ããããã®INT[31:16]ã¯ï¼ãããå
+ã«éãã¦ä½¿ç¨
+	- INT[31:29]ï¼L220ããã®å²è¾¼ã¿ï¼3æ¬ï¼
+	- INT[17:28]ï¼åãã­ã»ããµããã³SCUããã®å²è¾¼ã¿ï¼12æ¬ï¼PMUIRQ[0:11]
+	- INT[16]ï¼æªä½¿ç¨ï¼1æ¬ï¼
+
+âCoreTile for ARM11 MPcoreã®å²è¾¼ã¿æ©è½ï¼[3] 3.4.2ç¯ï¼
+
+ã»3ã¤ã®å²è¾¼ã¿ã¢ã¼ãããµãã¼ã
+	- Legacy mode
+	- Normal mode with DCC interrupt routing
+	- Normal mode without DCC interrupt routing â¦ ããã§ä½¿ã£ã¦ãã
+	- EBã·ã¹ãã FPGAã®SYS_PLD_CTL1ã¬ã¸ã¹ã¿ã®INTMODE[2:0]ã§è¨­å®ãã
+
+ã»Normal mode without DCC
+	- Emulation Baseboardããã®16æ¬ã«å²è¾¼ã¿è¦æ±ã©ã¤ã³ãï¼ãã®ã¾ã¾
+	  INT[15:0]ã«æ¥ç¶ï¼nIRQ[3:0]ã¨nFIQ[3:0]ã¯ä½¿ããªã
+	- å²è¾¼ã¿çªå·ã®ã¢ãµã¤ã³
+		INT[0]ï¼ACCI
+		INT[1]ï¼EB_TIMER0/1
+		INT[2]ï¼EB_TIMER2/3
+		INT[3]ï¼USB
+		INT[4]ï¼EB_UART0
+		INT[5]ï¼EB_UART1
+		â¦
+		INT[10]ï¼EB_GIC1_nIRQ
+		INT[11]ï¼EB_GIC2_nIRQ
+		INT[12]ï¼EB_GIC1_nFIQ
+		INT[13]ï¼EB_GIC2_nFIQ
+		â¦
+
+âããã¤ã¹ã¬ã¸ã¹ã¿ã®ã¢ãã¬ã¹
+
+ã»ããªãã§ã©ã«ãã¼ã¹ã¢ãã¬ã¹ï¼PERIPHBASEï¼ï¼[3] 3.10.1ç¯ï¼
+	- ä»¥ä¸ã®ã¬ã¸ã¹ã¿ã®ã¢ãã¬ã¹ãæ±ºãã
+		+ ARM11 MPCoreã®ã¬ã¸ã¹ã¿
+			Snoop Control Unitï¼SCUï¼ã®å¶å¾¡ã¬ã¸ã¹ã¿
+		+ L220ã­ã£ãã·ã¥ã³ã³ãã­ã¼ã©ã®ã¬ã¸ã¹ã¿
+		+ ARM11 MPCoreãã¹ããããã®ã¬ã¸ã¹ã¿
+			Test chip PLL control register
+			Test chip interrupt control register
+			Test chip cluster ID register
+			Test chip power status register
+			Test chip way map register
+			Test chip clock divider register
+	- CT11MPCoreã§ã¯ï¼CoreTileä¸ã®ã¸ã£ã³ãã¹ã¤ããã§è¨­å®å¯è½
+		+ ããã©ã«ãã¯ï¼0x1F000000
+	- QEMUã§ã¯ï¼0x10100000ã«è¨­å®ããã¦ããï¼qemu-2.1.0/hw/arm/realview.cï¼
+
+ã»Emulation Baseboardä¸ã®ãªã½ã¼ã¹ã®ã¢ãã¬ã¹ï¼[4] 5.2ç¯ï¼[5] 4ç« ï¼
+	- ãã¼ã¹ã¢ãã¬ã¹ã¯ï¼0x10000000
+	- ã¬ã¸ã¹ã¿ãã¢ã³ã­ãã¯ããæ¹æ³
+		+ base+0x20ã«ï¼0xA05Fãæ¸ãè¾¼ã
+	- ã¡ã¢ãªããã
+		0x10000000ã0x10000fff		ã·ã¹ãã ã¬ã¸ã¹ã¿
+		0x10001000ã0x10001fff		ã·ã¹ãã ã³ã³ãã­ã¼ã©ï¼SP810ï¼
+		â¦ä¸­ç¥â¦
+		0x10009000ã0x10009fff		UART0 â¦ ARM UART PL011 r1p3
+		0x1000a000ã0x1000afff		UART1 â¦ ARM UART PL011 r1p3
+		0x1000b000ã0x1000bfff		UART2 â¦ ARM UART PL011 r1p3
+		0x1000c000ã0x1000cfff		UART3 â¦ ARM UART PL011 r1p3
+		â¦ä¸­ç¥â¦
+		0x10010000ã0x10010fff		Watchdog â¦ ARM WDOG SP805 r2p0
+		0x10011000ã0x10011fff		Timer 0&1 â¦ ARM Dual-Timer SP804 r1p2
+		0x10012000ã0x10012fff		Timer 2&3 â¦ ARM Dual-Timer SP804 r1p2
+		â¦ä¸­ç¥â¦
+
+âARM11 MPCoreå
+èµã¿ã¤ãï¼[1] 9.2ç¯ï¼
+
+ARM11 MPCoreã¯ï¼ã³ã¢æ¯ã«ï¼ã¿ã¤ãã¨ã¦ã©ããããã°ãæã¤ï¼ã¦ã©ããããã°
+ã¯ï¼ã¿ã¤ãã¨ãã¦ä½¿ç¨ãããã¨ãã§ããï¼
+
+âã¿ã¤ã
+
+ã¿ã¤ãã­ã¼ãã¬ã¸ã¹ã¿ï¼MPCORE_TMR_LRï¼â¦ 32ããã
+	- ã«ã¦ã³ãã¬ã¸ã¹ã¿ã0ã«ãªã£ãæã«ãªã­ã¼ãããå¤ãä¿æããã¬ã¸ã¹ã¿ï¼
+	- ãã®ã¬ã¸ã¹ã¿ã«æ¸ãè¾¼ãã¨ï¼ã«ã¦ã³ãã¬ã¸ã¹ã¿ã«ãæ¸ãè¾¼ã¾ããï¼
+
+ã¿ã¤ãã«ã¦ã³ãã¬ã¸ã¹ã¿ï¼MPCORE_TMR_CNTï¼â¦ 32ããã
+	- ãã¦ã³ã«ã¦ã³ã¿ï¼
+	- 0ã«ãªã£ããï¼å²è¾¼ã¿ãè¦æ±ããï¼
+	- ãªã¼ããªã­ã¼ãã¢ã¼ãã§ã¯ï¼0ã«ãªã£ããï¼ã­ã¼ãã¬ã¸ã¹ã¿ã®å¤ã«æ»ãï¼
+	- ã­ã¼ãã¬ã¸ã¹ã¿ãã«ã¦ã³ã¿ã¬ã¸ã¹ã¿ã«æ¸ãè¾¼ãã¨ï¼æ°ããå¤ããã«ã¦ã³ãï¼
+
+ã¿ã¤ãå¶å¾¡ã¬ã¸ã¹ã¿ï¼MPCORE_TMR_CTRLï¼â¦ 32ããã
+	[31:16]	äºç´ï¼SBZ/RAZï¼
+	[15:8]	ããªã¹ã±ã¼ã©
+	[7:3]	äºç´ï¼SBZ/RAZï¼
+	[2]		å²è¾¼ã¿ã¤ãã¼ãã«
+	[1]		ãªã¼ããªã­ã¼ã
+	[0]		ã¿ã¤ãã¤ãã¼ãã«
+
+ã¿ã¤ãå²è¾¼ã¿ç¶æ
+ã¬ã¸ã¹ã¿ï¼MPCORE_TMR_ISRï¼â¦ 32ããã
+	[31:1]	äºç´
+	[0]		ã¤ãã³ããã©ã°
+				- ã«ã¦ã³ã¿ã¬ã¸ã¹ã¿ã0ã«ãªã£ãæã«ã»ãããããï¼
+				- 1ãæ¸ãè¾¼ãã¨ã¯ãªã¢ãããï¼
+
+âã¦ã©ããããã°
+
+ã¦ã©ããããã°ã­ã¼ãã¬ã¸ã¹ã¿ï¼MPCORE_WDG_LRï¼â¦ 32ããã
+	- ã«ã¦ã³ãã¬ã¸ã¹ã¿ã0ã«ãªã£ãæã«ãªã­ã¼ãããå¤ãä¿æããã¬ã¸ã¹ã¿ï¼
+	- ãã®ã¬ã¸ã¹ã¿ã«æ¸ãè¾¼ãã¨ï¼ã«ã¦ã³ãã¬ã¸ã¹ã¿ã«ãæ¸ãè¾¼ã¾ããï¼
+
+ã¦ã©ããããã°ã«ã¦ã³ãã¬ã¸ã¹ã¿ï¼MPCORE_WDG_CNTï¼â¦ 32ããã
+	- ãã¦ã³ã«ã¦ã³ã¿ï¼
+ã+ ã¿ã¤ãã¢ã¼ã
+	- 0ã«ãªã£ããï¼å²è¾¼ã¿ãè¦æ±ããï¼
+	- ãªã¼ããªã­ã¼ãã¢ã¼ãã§ã¯ï¼0ã«ãªã£ããï¼ã­ã¼ãã¬ã¸ã¹ã¿ã®å¤ã«æ»ãï¼
+	- ã­ã¼ãã¬ã¸ã¹ã¿ãã«ã¦ã³ã¿ã¬ã¸ã¹ã¿ã«æ¸ãè¾¼ãã¨ï¼æ°ããå¤ããã«ã¦ã³ãï¼
+ã+ ã¦ã©ããããã°ã¢ã¼ã
+	- 0ã«ãªã£ããï¼ãªã»ãããè¦æ±ããï¼
+	- ãã®ã¬ã¸ã¹ã¿ã¸ã¯æ¸ãè¾¼ããªãï¼
+
+ã¦ã©ããããã°å¶å¾¡ã¬ã¸ã¹ã¿ï¼MPCORE_WDG_CTRLï¼â¦ 32ããã
+	[31:16]	äºç´ï¼SBZ/RAZï¼
+	[15:8]	ããªã¹ã±ã¼ã©
+	[7:4]	äºç´ï¼SBZ/RAZï¼
+	[3]		ã¦ã©ããããã°ã¢ã¼ãï¼ããã«0ãæ¸ãã¦ãå¤æ´ã§ããªãï¼
+	[2]		å²è¾¼ã¿ã¤ãã¼ãã«
+	[1]		ãªã¼ããªã­ã¼ã
+	[0]		ã¦ã©ããããã°ã¤ãã¼ãã«
+
+ã¦ã©ããããã°å²è¾¼ã¿ç¶æ
+ã¬ã¸ã¹ã¿ï¼MPCORE_WDG_ISRï¼â¦ 32ããã
+	[31:1]	äºç´
+	[0]		ã¤ãã³ããã©ã°
+				- ã¿ã¤ãã¢ã¼ãã§ï¼ã«ã¦ã³ã¿ã¬ã¸ã¹ã¿ã0ã«ãªã£ãæã«ã»ããï¼
+				- 1ãæ¸ãè¾¼ãã¨ã¯ãªã¢ï¼
+
+ã¦ã©ããããã°ãªã»ããç¶æ
+ã¬ã¸ã¹ã¿ï¼MPCORE_WDG_RSTï¼â¦ 32ããã
+	[31:1]	äºç´
+	[0]		ãªã»ãããã©ã°
+				- ã¦ã©ããããã°ã¢ã¼ãã§ï¼ã«ã¦ã³ã¿ã¬ã¸ã¹ã¿ã0ã«ãªã£ãæã«
+				  ã»ããï¼
+				- 1ãæ¸ãè¾¼ãã¨ã¯ãªã¢ï¼
+
+ã¦ã©ããããã°ãã£ã¹ã¨ã¼ãã«ã¬ã¸ã¹ã¿ï¼MPCORE_WDG_DISï¼â¦ 32ããã
+	0x12345678ã¨0x87654321ããã®é ã§æ¸ãã¨ï¼ã¦ã©ããããã°ããã£ã¹ã¨ã¼
+	ãã«ãããï¼å¶å¾¡ã¬ã¸ã¹ã¿ä¸­ã®ã¦ã©ããããã°ã¢ã¼ããããã0ã«ãªãï¼ï¼
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/arch/arm_gcc/doc/timer_memo.txt
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/doc/timer_memo.txt	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/doc/timer_memo.txt	(revision 302)
@@ -0,0 +1,124 @@
+
+		TOPPERSãã­ã¸ã§ã¯ã è¨­è¨ã¡ã¢
+		Dual-Timer Moduleï¼SP804ï¼ã«é¢ããã¡ã¢
+
+		ä½æè
+: é«ç°åºç« ï¼åå¤å±å¤§å­¦ï¼
+		æçµæ´æ°: 2015å¹´8æ9æ¥
+
+âã¡ã¢ã®ä½ç½®ã¥ã
+
+ãã®ã¡ã¢ã¯ï¼ARM Dual-Timer Moduleï¼SP804ï¼ã«é¢ãã¦ï¼TOPPERSã«ã¼ãã«ããã¼
+ãã£ã³ã°ããã«ããã£ã¦å¿
+è¦ã¨ãªãäºé 
+ãã¾ã¨ãããã®ã§ããï¼
+
+âç®æ¬¡
+
+ã»åèæç®
+ã»æ¦è¦
+ã»åä½ã¢ã¼ã
+ã»ãã­ã°ã©ãã³ã°ã¢ãã«
+
+âåèæç®
+
+[1] ARM Dual-Timer Module (SP804) Technical Reference Manual, 2004
+Revision: r1p0
+DDI0271.pdf
+
+âæ¦è¦ï¼[1] ç¬¬1ç« ï¼
+
+ã»AMBAã®APBã«æ¥ç¶ãããã¹ã¬ã¼ãã¢ã¸ã¥ã¼ã«
+ã»2ã¤ã®ãã­ã°ã©ããã«32/16ããããã¦ã³ã«ã¦ã³ã¿
+	- ããªã¼ã©ã³ï¼å¨æï¼ã¯ã³ã·ã§ããã¢ã¼ã
+ã»2ã¤ã®ã«ã¦ã³ã¿ã§å
+±éã®ã¯ã­ãã¯ï¼ã¯ã­ãã¯ã¤ãã¼ãã«ä¿¡å·ãåå¥ã«æã¤
+ã»0ã«å°éããã¨å²è¾¼ã¿ãããããã¨ãã§ãã
+
+âåä½ã¢ã¼ãï¼[2] 2.1ç¯ï¼2.2.6ç¯ï¼
+
+ã»ããªã¼ã©ã³ãã³ã°
+	- 0ã«åãã¦ãã¦ã³ã«ã¦ã³ããï¼0ã«å°éãããæå¤§å¤ã«æ»ã
+	- å¶å¾¡ã¬ã¸ã¹ã¿ã®ã¿ã¤ãã¢ã¼ãã1ï¼ã¯ã³ã·ã§ããã0ã«è¨­å®
+		â
+æ³¨æï¼ç¬¬3ç« ã®è¨è¿°ã¨ä¸è´ãã¦ãããï¼ééãã¨æããã
+
+ã»å¨æ
+	- 0ã«åãã¦ãã¦ã³ã«ã¦ã³ããï¼0ã«å°éããããªã­ã¼ãå¤ã«æ»ã
+	- å¶å¾¡ã¬ã¸ã¹ã¿ã®ã¿ã¤ãã¢ã¼ãã0ï¼ã¯ã³ã·ã§ããã0ã«è¨­å®
+		â
+æ³¨æï¼ç¬¬3ç« ã®è¨è¿°ã¨ä¸è´ãã¦ãããï¼ééãã¨æããã
+
+ã»ã¯ã³ã·ã§ãã
+	- 0ã«åãã¦ãã¦ã³ã«ã¦ã³ããï¼0ã«å°éãããæ­¢ã¾ã
+	- å¶å¾¡ã¬ã¸ã¹ã¿ã®ã¯ã³ã·ã§ããã1ã«è¨­å®
+
+âãã­ã°ã©ãã³ã°ã¢ãã«ï¼Programmers' Modelï¼ï¼[1] ç¬¬3ç« ï¼
+
+â»å¡ä¾ï¼
+	ã¬ã¸ã¹ã¿åï¼ã¬ã¸ã¹ã¿ç¥ç§°ï¼ãªãã»ããï¼ãããå¹
+
+
+ã¿ã¤ã1ã­ã¼ãã¬ã¸ã¹ã¿ï¼Timer1Loadï¼LRï¼0x00ï¼32ï¼RWï¼
+	- å¨æã¢ã¼ãã§ï¼ã«ã¦ã³ãã¬ã¸ã¹ã¿ã0ã«ãªã£ãæã«ï¼ã«ã¦ã³ã¿ã«ãªã­ã¼
+	  ãããå¤ãä¿æããã¬ã¸ã¹ã¿ï¼
+	- ãã®ã¬ã¸ã¹ã¿ã«æ¸ãè¾¼ãã¨ï¼ã«ã¦ã³ãã¬ã¸ã¹ã¿ã«ãæ¸ãè¾¼ã¾ããï¼
+	- æå°å¤ã¯1ï¼0ãæ¸ãè¾¼ãã¨å³åº§ã«å²è¾¼ã¿ãçºçãã
+	- ããã¯ã°ã©ã³ãã­ã¼ãã¬ã¸ã¹ã¿ã¸ã®æ¸ãè¾¼ã¿ã«ãã£ã¦ãï¼ä¸æ¸ãããã
+		+ ãã®å ´åï¼ç¾å¨ã®ã«ã¦ã³ãå¤ã¯å¤ãããªã
+
+ã¿ã¤ã1ç¾å¨å¤ã¬ã¸ã¹ã¿ï¼Timer1Valueï¼CVRï¼0x04ï¼32ï¼ROï¼
+	- ãã¦ã³ã«ã¦ã³ã¿ãä¿æãããªã¼ããªã³ãªã¼ã®ã¬ã¸ã¹ã¿ï¼
+
+ã¿ã¤ã1å¶å¾¡ã¬ã¸ã¹ã¿ï¼Timer1Controlï¼CRï¼0x08ï¼8ãããï¼RWï¼
+	[31:8]	äºç´
+	[7]		ã¿ã¤ãã¤ãã¼ãã«
+	[6]		ã¿ã¤ãã¢ã¼ãï¼0ï¼ããªã¼ã©ã³ï¼1ï¼å¨æï¼
+	[5]		å²è¾¼ã¿ã¤ãã¼ãã«
+	[4]		äºç´
+	[3:2]	ããªã¹ã±ã¼ã©ï¼00ï¼1åå²ï¼01ï¼16åå²ï¼10ï¼256åå²ï¼
+	[1]		ã¿ã¤ããµã¤ãºï¼0ï¼16ãããï¼1ï¼32ãããï¼
+	[0]		ã¯ã³ã·ã§ããï¼0ï¼ã©ããã³ã°ã¢ã¼ãï¼1ï¼ã¯ã³ã·ã§ããã¢ã¼ãï¼
+	- ã¿ã¤ãã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãå¤æ´ããæã¯ï¼ä¸åº¦ï¼ã¿ã¤ããæ­¢ã
+	  ãªããã°ãªããªãï¼
+
+ã¿ã¤ã1å²è¾¼ã¿ã¯ãªã¢ï¼Timer1IntClrï¼ICRï¼0x0cï¼-ï¼WOï¼
+	- æ¸è¾¼ã¿ã«ããå²è¾¼ã¿è¦æ±ãã¯ãªã¢ããã
+
+ã¿ã¤ã1å
+å²è¾¼ã¿ç¶æ
+ï¼Timer1RISï¼RISï¼0x10ï¼1ãããï¼ROï¼
+	[31:1]	äºç´
+	[0]		çã®å²è¾¼ã¿ç¶æ
+
+
+ã¿ã¤ã1ãã¹ã¯å²è¾¼ã¿ç¶æ
+ï¼Timer1MISï¼MISï¼0x14ï¼1ãããï¼ROï¼
+	[31:1]	äºç´
+	[0]		è¨±å¯ãããå²è¾¼ã¿ç¶æ
+
+				çã®å²è¾¼ã¿ç¶æ
+ã¨ï¼å²è¾¼ã¿ã¤ãã¼ãã«ã®AND
+
+ã¿ã¤ã1ããã¯ã°ã©ã¦ã³ãã­ã¼ãã¬ã¸ã¹ã¿ï¼Timer1BGLoadï¼BGLRï¼0x18ï¼32ãããï¼RWï¼
+	- ã«ã¦ã³ã¿ã«ãªã­ã¼ãããå¤ã«ã¢ã¯ã»ã¹ããï¼
+	- ã­ã¼ãã¬ã¸ã¹ã¿ã¨ã®éãã¯ï¼ç¾å¨ã®ã«ã¦ã³ãå¤ãããã«ã¯å¤ãããªããã¨ï¼
+	- æ¬¡ã®ãªã­ã¼ãã®ã¿ã¤ãã³ã°ã§æå¹ã«ãªãï¼
+
+ã¿ã¤ã2ã«å¯¾ãã¦ãåãã¬ã¸ã¹ã¿ããã
+
+çµ±åãã¹ãå¶å¾¡ã¬ã¸ã¹ã¿ï¼TimerITCRï¼0xf00ï¼1ãããï¼RWï¼
+çµ±åãã¹ãåºåã»ããã¬ã¸ã¹ã¿ï¼TimerITORï¼0xf04ï¼2ãããï¼WOï¼
+
+âããªãã§ã©ã«ã®ç¨®é¡ãè­å¥ããããã®ã¬ã¸ã¹ã¿
+
+ã¿ã¤ãããªãã§ã©ã«ID0ã¬ã¸ã¹ã¿ï¼TimerPeriphID0ï¼0xfe0, 8/-ï¼ROï¼
+ã¿ã¤ãããªãã§ã©ã«ID1ã¬ã¸ã¹ã¿ï¼TimerPeriphID1ï¼0xfe4, 8/-ï¼ROï¼
+ã¿ã¤ãããªãã§ã©ã«ID2ã¬ã¸ã¹ã¿ï¼TimerPeriphID2ï¼0xfe8, 8/-ï¼ROï¼
+ã¿ã¤ãããªãã§ã©ã«ID3ã¬ã¸ã¹ã¿ï¼TimerPeriphID3ï¼0xfec, 8/-ï¼ROï¼
+ã¿ã¤ã PCell ID0ã¬ã¸ã¹ã¿ï¼TimerPCellID0ï¼0xff0, 8/-ï¼ROï¼
+ã¿ã¤ã PCell ID1ã¬ã¸ã¹ã¿ï¼TimerPCellID1ï¼0xff4, 8/-ï¼ROï¼
+ã¿ã¤ã PCell ID2ã¬ã¸ã¹ã¿ï¼TimerPCellID2ï¼0xff8, 8/-ï¼ROï¼
+ã¿ã¤ã PCell ID3ã¬ã¸ã¹ã¿ï¼TimerPCellID3ï¼0xffc, 8/-ï¼ROï¼
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/arch/arm_gcc/doc/uart_memo.txt
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/doc/uart_memo.txt	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/doc/uart_memo.txt	(revision 302)
@@ -0,0 +1,170 @@
+
+		TOPPERSãã­ã¸ã§ã¯ã è¨­è¨ã¡ã¢
+		PrimeCell UARTï¼PL11ï¼ã«é¢ããã¡ã¢
+
+		ä½æè
+: é«ç°åºç« ï¼åå¤å±å¤§å­¦ï¼
+		æçµæ´æ°: 2015å¹´7æ26æ¥
+
+âã¡ã¢ã®ä½ç½®ã¥ã
+
+ãã®ã¡ã¢ã¯ï¼ARM PrimeCell UARTï¼PL011ï¼ã«é¢ãã¦ï¼TOPPERSã«ã¼ãã«ããã¼
+ãã£ã³ã°ããã«ããã£ã¦å¿
+è¦ã¨ãªãäºé 
+ãã¾ã¨ãããã®ã§ããï¼
+
+âç®æ¬¡
+
+ã»åèæç®
+ã»æ¦è¦
+ã»ãã­ã°ã©ãã³ã°ã¢ãã«
+
+âåèæç®
+
+[1] PrimeCell UART (PL011) Technical Reference Manual, 2007
+Revision: r1p5
+DDI0183G_uart_pl011_r1p5_trm.pdf
+
+âæ¦è¦ï¼[1] ç¬¬1ç« ï¼
+
+ã»AMBAã®APBã«æ¥ç¶ãããã¹ã¬ã¼ãã¢ã¸ã¥ã¼ã«
+ã»UARTã¨IrDA SIRï¼Serial InfraRedï¼ã«å¯¾å¿
+ã»éåä¿¡ç¨ã®FIFOãããã¡ãæã¤ï¼ãã£ã¹ã¨ã¼ãã«ãããã¨ãå¯è½
+	- éä¿¡FIFOã¯8ãããå¹
+
+	- åä¿¡FIFOã¯12ãããå¹
+
+ã»DMAã«ãå¯¾å¿
+ã»ãã¼ã¸ã§ã³ãr1p0ãr1p5ã¾ã§ããï¼å°ããã¤ãã¼ã¸ã§ã³ã¢ããããã¦ãã
+	- r1p5ã§ï¼FIFOãããã¡ã®ãµã¤ãºãå¤§ãããªã£ã
+ã»PrimeCell UARTï¼PL010ï¼ã¨ã¯ï¼å¾æ¹äºææ§ããªã
+
+âãã­ã°ã©ãã³ã°ã¢ãã«ï¼Programmers' Modelï¼ï¼[1] ç¬¬3ç« ï¼
+
+â»å¡ä¾ï¼
+	ã¬ã¸ã¹ã¿åï¼ã¬ã¸ã¹ã¿ç¥ç§°ï¼ãªãã»ããï¼ãããå¹
+
+
+ãã¼ã¿ã¬ã¸ã¹ã¿ï¼UADRï¼0x000, 12/8
+	- ãã¼ã¿ï¼8ãããï¼ãã©ã¤ãããã¨ï¼éä¿¡FIFOã«éããã
+	- ãªã¼ãããã¨ï¼åä¿¡FIFOããï¼ãã¼ã¿ï¼8ãããï¼ã¨ã¹ãã¼ã¿ã¹ï¼4ãã
+	  ãï¼ãåãåºããã
+	- ã¹ãã¼ã¿ã¹ã®æ§æ
+		+ OEï¼Overrun errorï¼
+		+ BEï¼Break errorï¼
+		+ PEï¼Parity errorï¼
+		+ FEï¼Framing errorï¼
+
+åä¿¡ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼UARTRSRï¼0x004, 4/0
+ã¨ã©ã¼ã¯ãªã¢ã¬ã¸ã¹ã¿ï¼UARTECRï¼
+	- ãªã¼ãããã¨ï¼ã¹ãã¼ã¿ã¹ï¼4ãããï¼ãèª­ã¿åºããã
+		+ ãã¼ã¿ã¬ã¸ã¹ã¿ãå
+ã«èª­ãå¿
+è¦ããã
+		+ OEã¯ï¼ææ°ã®ç¶æ
+ãèª­ãã
+		+ BE,PE,FEã¯ï¼FIFOã®å
+é ­ã®ç¶æ
+ãèª­ãã
+	- ã©ã¤ãããã¨ï¼ã¹ãã¼ã¿ã¹ãã¯ãªã¢ãããï¼ãã¼ã¿ã¯ç¡è¦ï¼
+
+ãã©ã°ã¬ã¸ã¹ã¿ï¼UARTFRï¼0x018, 9/-ï¼ROï¼
+	- ä»¥ä¸ã®ç¶æ
+ããããã1ãããã§åç
+§ã§ãã
+		+ RIï¼Ring Indicatorï¼å¤é¨ããã®ä¿¡å·ï¼
+		+ TXFEï¼éä¿¡FIFOãç©º
+		+ RXFFï¼åä¿¡FIFOããã«
+		+ TXFFï¼éä¿¡FIFOããã«
+		+ RXFEï¼åä¿¡FIFOãç©º
+		+ BUSYï¼ãã¼ã¿éä¿¡ä¸­
+		+ DCDï¼Data Carrir Detectï¼å¤é¨ããã®ä¿¡å·ï¼
+		+ DSRï¼Data Set Readyï¼å¤é¨ããã®ä¿¡å·ï¼
+		+ CTSï¼Clear To Sendï¼å¤é¨ããã®ä¿¡å·ï¼
+
+IrDAã­ã¼ãã¯ã¼ã«ã¦ã³ã¿ã¬ã¸ã¹ã¿ï¼UARTILPRï¼0x20, 8
+	ï¼çç¥ï¼
+
+ãã¼ã¬ã¼ãï¼æ´æ°é¨ï¼ã¬ã¸ã¹ã¿ï¼UARTIBRDï¼0x24, 16
+	- ãã¼ã¬ã¼ãã®æ´æ°é¨ï¼16ãããï¼ãè¨­å®ããã¬ã¸ã¹ã¿
+	- ãã®ã¬ã¸ã¹ã¿æ¸ãè¾¼ãã å¾ã«ï¼ã©ã¤ã³å¶å¾¡ã¬ã¸ã¹ã¿ã«æ¸ãè¾¼ããã¨ãå¿
+è¦
+
+ãã¼ã¬ã¼ãï¼å°æ°é¨ï¼ã¬ã¸ã¹ã¿ï¼UARTFBRDï¼0x28, 6
+	- ãã¼ã¬ã¼ãã®å°æ°é¨ï¼6ãããï¼ãè¨­å®ããã¬ã¸ã¹ã¿
+	- ãã®ã¬ã¸ã¹ã¿æ¸ãè¾¼ãã å¾ã«ï¼ã©ã¤ã³å¶å¾¡ã¬ã¸ã¹ã¿ã«æ¸ãè¾¼ããã¨ãå¿
+è¦
+
+ã©ã¤ã³å¶å¾¡ã¬ã¸ã¹ã¿ï¼UARTLCR_Hï¼0x2c, 8
+	- ã·ãªã¢ã«éä¿¡ã®è¦æ ¼ãè¨­å®ããããã®ã¬ã¸ã¹ã¿
+		[7] SPSï¼ã¹ãã£ãã­ã¼ããªãã£ã«
+		[6:5] WLENï¼ãã¼ã¿é·ï¼8ãããï¼7ãããï¼6ãããï¼5ãããããé¸æï¼
+		[4] FENï¼FIFOã¤ãã¼ãã«
+		[3] STP2ï¼ã¹ããããããã2ãããã«
+		[2] EPSï¼å¶æ°ããªãã£ã«
+		[1] PENï¼ããªãã£ãç¨ãã
+		[0] BRKï¼ãã¬ã¼ã¯ãéä¿¡ãã
+	- ãããã®3ã¤ã®ã¬ã¸ã¹ã¿ã¯ï¼UARTããã£ã¹ã¨ã¼ãã«ãã¦æä½ãã
+
+å¶å¾¡ã¬ã¸ã¹ã¿ï¼UARTCRï¼0x30, 16
+	- UARTãåä½ãè¨­å®ããããã®ã¬ã¸ã¹ã¿
+		[15] CTSEnï¼CTSãã¼ãã¦ã§ã¢ãã­ã¼å¶å¾¡ãè¡ã
+		[14] RTSEnï¼RTSãã¼ãã¦ã§ã¢ãã­ã¼å¶å¾¡ãè¡ã
+		[13] Out2ï¼UART Out2ã®åè»¢ï¼RIã«ä½¿ããï¼
+		[12] Out1ï¼UART Out1ã®åè»¢ï¼DCDã«ä½¿ããï¼
+		[11] RTSï¼RTSï¼Request To Sendï¼ã®åè»¢
+		[10] DTRï¼DTRï¼Data Transmit Readyï¼ã®åè»¢
+		[9] RXEï¼åä¿¡ã¤ãã¼ãã«
+		[8] TXEï¼éä¿¡ã¤ãã¼ãã«
+		[7] LBEï¼ã«ã¼ãããã¯ã¤ãã¼ãã«
+		[6:3] äºç´
+		[2] SIRLPï¼SIRã­ã¼ãã¯ã¼IrDAã¢ã¼ã
+		[1] SIRENï¼SIRã¤ãã¼ãã«
+		[0] UARTENï¼UARTã¤ãã¼ãã«
+
+å²è¾¼ã¿FIFOã¬ãã«é¸æã¬ã¸ã¹ã¿ï¼UARTIFLSï¼0x34, 6
+	- éåä¿¡ç¬ç«ã«ï¼FIFOã®ãã¼ã¿éãã©ãã ãã«ãªã£ãã¨ããã§å²è¾¼ã¿ãã
+	  ããããè¨­å®ã§ãã
+		+ 1/8, 1/4, 1/2, 3/4, 7/8
+	- ããã©ã«ãã§ã¯ï¼éåä¿¡ã¨ãï¼FIFOãååã®ã¨ããã§å²è¾¼ã¿ãããã
+
+å²è¾¼ã¿ãã¹ã¯ã»ããï¼ã¯ãªã¢ã¬ã¸ã¹ã¿ï¼UARTIMSCï¼0x38, 11
+	- å²è¾¼ã¿ãã¹ã¯ãè¨­å®ããã¬ã¸ã¹ã¿
+		+ 1ï¼å²è¾¼ã¿ãè¨±å¯ï¼å²è¾¼ã¿ããã¹ã¯ãã»ããã¨æ¸ãã¦ãããâ¦ï¼
+		+ 0ï¼å²è¾¼ã¿ãç¦æ­¢ï¼å²è¾¼ã¿ããã¹ã¯ãã¯ãªã¢ã¨æ¸ãã¦ãããâ¦ï¼
+	- ä»¥ä¸ã®å²è¾¼ã¿ã«å¯¾ããå²è¾¼ã¿ãã¹ã¯ãã»ããï¼ã¯ãªã¢ã§ãã
+		+ OEIMï¼Overrun Error Interrupt Mask
+		+ BEIM
+		+ PEIM
+		+ FEIM
+		+ RTIMï¼åä¿¡ã¿ã¤ã ã¢ã¦ãå²è¾¼ã¿ãã¹ã¯
+		+ TXIMï¼éä¿¡å²è¾¼ã¿ãã¹ã¯
+		+ RXIMï¼åä¿¡å²è¾¼ã¿ãã¹ã¯
+		+ DSRMIM
+		+ DCDMIM
+		+ CTSMIM
+		+ RIMIM
+	â»ããã¥ã¢ã«ã¯ï¼ãã¹ã¯ã®ã»ããï¼ã¯ãªã¢ã¨ï¼å²è¾¼ãè¨±å¯ï¼ç¦æ­¢ã®é¢ä¿ãï¼
+	ãåéããã¦æ¸ãã¦ããã¨æãããï¼å¥ã®ç®æã«ã¯ï¼1ãå²è¾¼ã¿ã¤ãã¼ãã«
+	ãã§ããã¨æç¢ºã«è¨è¼ãã¦ããï¼
+
+çã®å²è¾¼ã¿ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼UARTRISï¼0x3c, 11/-ï¼ROï¼
+
+ãã¹ã¯ãããå²è¾¼ã¿ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼UARTMISï¼0x40, 11/-ï¼ROï¼
+
+å²è¾¼ã¿ã¯ãªã¢ã¬ã¸ã¹ã¿ï¼UARTICRï¼0x44, -/11ï¼WOï¼
+
+DMAå¶å¾¡ã¬ã¸ã¹ã¿ï¼UARTDMACRï¼0x48, 3
+
+âããªãã§ã©ã«ã®ç¨®é¡ãè­å¥ããããã®ã¬ã¸ã¹ã¿
+
+UARTããªãã§ã©ã«ID0ã¬ã¸ã¹ã¿ï¼UARTPeriphID0ï¼0xfe0, 8/-ï¼ROï¼
+UARTããªãã§ã©ã«ID1ã¬ã¸ã¹ã¿ï¼UARTPeriphID1ï¼0xfe4, 8/-ï¼ROï¼
+UARTããªãã§ã©ã«ID2ã¬ã¸ã¹ã¿ï¼UARTPeriphID2ï¼0xfe8, 8/-ï¼ROï¼
+UARTããªãã§ã©ã«ID3ã¬ã¸ã¹ã¿ï¼UARTPeriphID3ï¼0xfec, 8/-ï¼ROï¼
+UART PCell ID0ã¬ã¸ã¹ã¿ï¼UARTPCellID0ï¼0xff0, 8/-ï¼ROï¼
+UART PCell ID1ã¬ã¸ã¹ã¿ï¼UARTPCellID1ï¼0xff4, 8/-ï¼ROï¼
+UART PCell ID2ã¬ã¸ã¹ã¿ï¼UARTPCellID2ï¼0xff8, 8/-ï¼ROï¼
+UART PCell ID3ã¬ã¸ã¹ã¿ï¼UARTPCellID3ï¼0xffc, 8/-ï¼ROï¼
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/MANIFEST
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/MANIFEST	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/MANIFEST	(revision 302)
@@ -0,0 +1,15 @@
+PACKAGE asp3_arch_arm_gcc
+
+MANIFEST
+Makefile.chip
+chip_kernel.h
+chip_kernel_impl.c
+chip_kernel_impl.h
+chip_rename.def
+chip_rename.h
+chip_stddef.h
+chip_timer.c
+chip_timer.cfg
+chip_timer.h
+chip_unrename.h
+mpcore.h
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/Makefile.chip
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/Makefile.chip	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/Makefile.chip	(revision 302)
@@ -0,0 +1,42 @@
+#
+#		Makefileã®ãããä¾å­é¨ï¼MPCoreç¨ï¼
+#
+#  $Id: Makefile.chip 484 2016-01-03 15:13:38Z ertl-hiro $
+# 
+
+#
+#  ãããä¾å­é¨ãã£ã¬ã¯ããªåã®å®ç¾©
+#
+CHIPDIR = $(SRCDIR)/arch/$(CORE)_$(TOOL)/$(CHIP)
+
+#
+#  ã³ã³ãã¤ã«ãªãã·ã§ã³
+#
+INCLUDES := $(INCLUDES) -I$(CHIPDIR)
+
+#
+#  ARM11ã¨Cortex-A9ã®åãåã
+#  
+ifeq ($(MPCORE_TYPE),ARM11)
+	COPTS := $(COPTS) -mcpu=mpcore
+	LDFLAGS := $(LDFLAGS) -mcpu=mpcore
+	CDEFS := $(CDEFS) -D__TARGET_ARCH_ARM=6
+endif
+ifeq ($(MPCORE_TYPE),CA9)
+	COPTS := $(COPTS) -mcpu=cortex-a9
+	LDFLAGS := $(LDFLAGS) -mcpu=cortex-a9
+	CDEFS := $(CDEFS) -D__TARGET_ARCH_ARM=7
+endif
+
+#
+#  ã«ã¼ãã«ã«é¢ããå®ç¾©
+#
+KERNEL_DIRS := $(KERNEL_DIRS) $(CHIPDIR)
+KERNEL_ASMOBJS := $(KERNEL_ASMOBJS) gic_support.o
+KERNEL_COBJS := $(KERNEL_COBJS) chip_kernel_impl.o gic_kernel_impl.o \
+															chip_timer.o
+
+#
+#  ã³ã¢ä¾å­é¨
+#
+include $(SRCDIR)/arch/$(CORE)_$(TOOL)/common/Makefile.core
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_kernel.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_kernel.h	(revision 302)
@@ -0,0 +1,92 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2006-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: chip_kernel.h 390 2015-08-01 02:03:34Z ertl-hiro $
+ */
+
+/*
+ *		kernel.hã®ãããä¾å­é¨ï¼MPCoreç¨ï¼
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼target_kernel.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ã
+ *  ããããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ããç´æ¥ã¤
+ *  ã³ã¯ã«ã¼ããã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_CHIP_KERNEL_H
+#define TOPPERS_CHIP_KERNEL_H
+
+/*
+ *  ãµãã¼ãã§ããæ©è½ã®å®ç¾©
+ */
+#define TOPPERS_TARGET_SUPPORT_ENA_INT		/* ena_int */
+#define TOPPERS_TARGET_SUPPORT_DIS_INT		/* dis_int */
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æ
+ *
+ *  ã¿ã¤ãå¨æã2^32ã®å ´åã«ã¯ï¼ãã®ãã¯ã­ãå®ç¾©ããªãï¼
+ */
+#undef TCYC_HRTCNT
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã®é²ã¿å¹
+
+ */
+#define TSTEP_HRTCNT	1U
+
+/*
+ *  ã³ã¢ã§å
+±éãªå®ç¾©
+ */
+#include "core_kernel.h"
+
+#endif /* TOPPERS_CHIP_KERNEL_H */
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 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_kernel_impl.c	(revision 302)
@@ -0,0 +1,157 @@
+/*
+ *  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) 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: chip_kernel_impl.c 357 2015-07-25 12:05:26Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®ãããä¾å­é¨ï¼MPCoreç¨ï¼
+ */
+
+#include "kernel_impl.h"
+#include <sil.h>
+#include "arm.h"
+
+/*
+ *  ãããä¾å­ã®åæå
+ */
+void
+chip_initialize(void)
+{
+	/*
+	 *  ã³ã¢ä¾å­ã®åæå
+	 */
+	core_initialize();
+
+	/*
+	 *  ã­ã£ãã·ã¥ããã£ã¹ã¨ã¼ãã«
+	 */
+	arm_disable_cache();
+
+	/*
+	 *  MMUãæå¹ã«
+	 */
+	arm_mmu_initialize();
+
+	/*
+	 *  MPCoreãSMPã¢ã¼ãã«è¨­å®
+	 */
+	mpcore_enable_smp();
+
+	/*
+	 *  SCUãã¤ãã¼ãã«
+	 */
+	mpcore_enable_scu();
+
+#ifdef CORE0
+	/*
+	 *  ãã¹ã¦ã®ãã­ã»ããµããã¼ãã«ã¢ã¼ãã«
+	 */
+	sil_wrw_mem(MPCORE_SCU_CPUSTAT, 0x00U);
+#endif
+
+	/*
+	 *  ã­ã£ãã·ã¥ãã¤ãã¼ãã«
+	 */
+	arm_enable_cache();
+
+#ifdef CORE0
+	/*
+	 * GICã®ãã£ã¹ããªãã¥ã¼ã¿ã®åæå
+	 */
+	gicd_initialize();
+#endif
+
+	/*
+	 * GICã®CPUã¤ã³ã¿ãã§ã¼ã¹ã®åæå
+	 */
+	gicc_initialize();
+}
+
+/*
+ *  ãããä¾å­é¨ã®çµäºå¦ç
+ */
+void
+chip_terminate(void)
+{
+	extern void    software_term_hook(void);
+	void (*volatile fp)(void) = software_term_hook;
+
+	/*
+	 *  software_term_hookã¸ã®ãã¤ã³ã¿ãï¼ä¸æ¦volatileæå®ã®ããfpã«ä»£
+	 *  å
+¥ãã¦ããä½¿ãã®ã¯ï¼0ã¨ã®æ¯è¼ãæé©åã§åé¤ãããªãããã«ããã
+	 *  ãã§ããï¼
+	 */
+	if (fp != 0) {
+		(*fp)();
+	}
+
+	/*
+	 *  GICã®CPUã¤ã³ã¿ãã§ã¼ã¹ã®çµäºå¦ç
+	 */
+	gicc_terminate();
+
+#ifdef CORE0
+	/*
+	 *  GICã®ãã£ã¹ããªãã¥ã¼ã¿ã®çµäºå¦ç
+	 */
+	gicd_terminate();
+#endif
+
+	/*
+	 *  ã³ã¢ä¾å­ã®çµäºå¦ç
+	 */
+	core_terminate();
+}
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_kernel_impl.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_kernel_impl.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_kernel_impl.h	(revision 302)
@@ -0,0 +1,98 @@
+/*
+ *  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) 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: chip_kernel_impl.h 388 2015-07-31 22:42:21Z ertl-hiro $
+ */
+
+/*
+ *		kernel_impl.hã®ãããä¾å­é¨ï¼MPCoreç¨ï¼
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼target_kernel_impl.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯
+ *  ã«ã¼ãããããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ãã
+ *  ç´æ¥ã¤ã³ã¯ã«ã¼ããã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_CHIP_KERNEL_IMPL_H
+#define TOPPERS_CHIP_KERNEL_IMPL_H
+
+#include "mpcore.h"
+
+/*
+ *  MMUã®ä½¿ç¨ã«é¢ããè¨­å®
+ */
+#define USE_ARM_MMU
+#define USE_ARM_SSECTION
+
+/*
+ *  GICã«é¢ããå®ç¾©ï¼ã³ã¢ã§å
+±éãªå®ç¾©
+ *
+ *  core_kernel_impl.hã¯ï¼gic_kernel_impl.hããã¤ã³ã¯ã«ã¼ããããï¼
+ */
+#include "gic_kernel_impl.h"
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãããä¾å­ã®åæå
+ */
+extern void chip_initialize(void);
+
+/*
+ *  ãããä¾å­ã®çµäºå¦ç
+ */
+extern void chip_terminate(void);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_CHIP_KERNEL_IMPL_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_rename.def
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_rename.def	(revision 302)
@@ -0,0 +1,10 @@
+# chip_kernel_impl.c
+chip_initialize
+chip_terminate
+
+# chip_timer.c
+target_hrt_initialize
+target_hrt_terminate
+target_hrt_handler
+
+INCLUDE "core"
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_rename.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_rename.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_rename.h	(revision 302)
@@ -0,0 +1,40 @@
+/* This file is generated from chip_rename.def by genrename. */
+
+#ifndef TOPPERS_CHIP_RENAME_H
+#define TOPPERS_CHIP_RENAME_H
+
+/*
+ *  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
+
+
+#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"
+
+#endif /* TOPPERS_CHIP_RENAME_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_stddef.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_stddef.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_stddef.h	(revision 302)
@@ -0,0 +1,77 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: chip_stddef.h 357 2015-07-25 12:05:26Z ertl-hiro $
+ */
+
+/*
+ *		t_stddef.hã®ãããä¾å­é¨ï¼MPCoreç¨ï¼
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼target_stddef.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ã
+ *  ããããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ããç´æ¥ã¤
+ *  ã³ã¯ã«ã¼ããã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_CHIP_STDDEF_H
+#define TOPPERS_CHIP_STDDEF_H
+
+/*
+ *  ã¿ã¼ã²ãããè­å¥ããããã®ãã¯ã­ã®å®ç¾©
+ */
+#define TOPPERS_MPCORE					/* ãããç¥ç§° */
+
+/*
+ *  ã³ã¢ã§å
+±éãªå®ç¾©
+ */
+#include "core_stddef.h"
+
+#endif /* TOPPERS_CHIP_STDDEF_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_timer.c
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_timer.c	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_timer.c	(revision 302)
@@ -0,0 +1,157 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: chip_timer.c 358 2015-07-26 10:26:23Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ããã©ã¤ãï¼MPCoreå
+èµã¿ã¤ãç¨ï¼
+ *
+ *  MPCoreããã­ã»ããµæ¯ã«æã£ã¦ãããã©ã¤ãã¼ãã¿ã¤ãã¨ã¦ã©ããããã°
+ *  ãç¨ãã¦ï¼é«åè§£è½ã¿ã¤ããã©ã¤ããå®ç¾ããï¼
+ */
+
+#include "kernel_impl.h"
+#include "time_event.h"
+#include "target_timer.h"
+#include <sil.h>
+#include "mpcore.h"
+
+/*
+ *  ã¿ã¤ãå²è¾¼ã¿è¦æ±ã®ã¯ãªã¢
+ *
+ *  ã¿ã¤ãã®å²è¾¼ã¿ãã³ãã£ã³ã°ããããã¯ãªã¢ããï¼
+ */
+Inline void
+target_hrt_int_clear()
+{
+	sil_wrw_mem(MPCORE_TMR_ISR, MPCORE_TMR_ISR_EVENTFLAG);
+}
+
+/*
+ *  ã¿ã¤ãã®èµ·åå¦ç
+ */
+void
+target_hrt_initialize(intptr_t exinf)
+{
+	/*
+	 *  ã¿ã¤ãã¨ã¦ã©ããããã°ãåæ­¢ããï¼
+	 */
+	sil_wrw_mem(MPCORE_TMR_CTRL, MPCORE_TMR_CTRL_DISABLE);
+	sil_wrw_mem(MPCORE_WDG_CTRL, MPCORE_WDG_CTRL_DISABLE);
+
+	/*
+	 *  ã¦ã©ããããã°ãã¿ã¤ãã¢ã¼ãã«è¨­å®ããï¼
+	 */
+	sil_wrw_mem(MPCORE_WDG_DIS, 0x12345678);
+	sil_wrw_mem(MPCORE_WDG_DIS, 0x87654321);
+	sil_wrw_mem(MPCORE_WDG_CTRL, MPCORE_WDG_CTRL_DISABLE);
+
+	/*
+	 *  ã¦ã©ããããã°ã®ãªã­ã¼ãå¤ã0xffffffffã«è¨­å®ãï¼åä½ãéå§ããï¼
+	 */
+	sil_wrw_mem(MPCORE_WDG_LR, 0xffffffffU);
+	sil_wrw_mem(MPCORE_WDG_CTRL,
+				MPCORE_WDG_CTRL_ENABLE | MPCORE_WDG_CTRL_AUTORELOAD
+					| (MPCORE_WDG_PS_1MHZ << MPCORE_WDG_CTRL_PS_SHIFT));
+
+	/*
+	 *  ã¿ã¤ãã®ã«ã¦ã³ãå¤ã0ï¼ã«ã¦ã³ããã¦ã³ãã¦åæ­¢ããç¶æ
+ï¼ã«è¨­å®ãï¼
+	 *  åä½ãéå§ããï¼
+	 */
+	sil_wrw_mem(MPCORE_TMR_CNT, 0U);
+	sil_wrw_mem(MPCORE_TMR_CTRL,
+				MPCORE_TMR_CTRL_ENABLE | MPCORE_TMR_CTRL_ENAINT
+					| (MPCORE_TMR_PS_1MHZ << MPCORE_TMR_CTRL_PS_SHIFT));
+
+	/*
+	 *  ã¿ã¤ãå²è¾¼ã¿è¦æ±ãã¯ãªã¢ããï¼
+	 */
+	target_hrt_int_clear();
+}
+
+/*
+ *  ã¿ã¤ãã®åæ­¢å¦ç
+ */
+void
+target_hrt_terminate(intptr_t exinf)
+{
+	/*
+	 *  ã¿ã¤ãã¨ã¦ã©ããããã°ãåæ­¢ããï¼
+	 */
+	sil_wrw_mem(MPCORE_TMR_CTRL, MPCORE_TMR_CTRL_DISABLE);
+	sil_wrw_mem(MPCORE_WDG_CTRL, MPCORE_WDG_CTRL_DISABLE);
+
+	/*
+	 *  ã¿ã¤ãå²è¾¼ã¿è¦æ±ãã¯ãªã¢ããï¼
+	 */
+	target_hrt_int_clear();
+}
+
+/*
+ *  ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+void
+target_hrt_handler(void)
+{
+	/*
+	 *  ã¿ã¤ãå²è¾¼ã¿è¦æ±ãã¯ãªã¢ããï¼
+	 */
+	target_hrt_int_clear();
+
+	/*
+	 *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ãå¦çããï¼
+	 */
+	signal_time();
+}
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_timer.cfg
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_timer.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_timer.cfg	(revision 302)
@@ -0,0 +1,10 @@
+/*
+ *		ã¿ã¤ããã©ã¤ãã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: chip_timer.cfg 387 2015-07-31 22:41:43Z ertl-hiro $
+ */
+
+ATT_INI({ TA_NULL, 0, _kernel_target_hrt_initialize });
+ATT_TER({ TA_NULL, 0, _kernel_target_hrt_terminate });
+CFG_INT(INTNO_TIMER, { TA_ENAINT|INTATR_TIMER, INTPRI_TIMER });
+DEF_INH(INHNO_TIMER, { TA_NULL, _kernel_target_hrt_handler });
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_timer.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_timer.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_timer.h	(revision 302)
@@ -0,0 +1,148 @@
+/*
+ *  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: chip_timer.h 358 2015-07-26 10:26:23Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ããã©ã¤ãï¼MPCoreå
+èµã¿ã¤ãç¨ï¼
+ *
+ *  ARM11 MPCoreã«ã¯ï¼ã³ã¢æ¯ã«ã¿ã¤ãã¨ã¦ã©ããããã°ãããï¼ã¦ã©ãããã
+ *  ã°ã¯ï¼ã¿ã¤ãã¨ãã¦ä½¿ç¨ãããã¨ãã§ããããï¼ãã®2ã¤ã®ã¿ã¤ããä½¿ã£ã¦
+ *  é«åè§£è½ã¿ã¤ããå®ç¾ããï¼å
+·ä½çã«ã¯ï¼ã¦ã©ããããã°ãã¿ã¤ãã¢ã¼ã
+ *  ã«è¨­å®ãã¦ç¾å¨æå»ã®ç®¡çã®ããã«ç¨ãï¼ã¿ã¤ããç¸å¯¾æéå²è¾¼ã¿ã®çºç
+ *  ã®ããã«ç¨ããï¼
+ */
+
+#ifndef TOPPERS_CHIP_TIMER_H
+#define TOPPERS_CHIP_TIMER_H
+
+#include <sil.h>
+#include "mpcore.h"
+
+/*
+ *  ã¿ã¤ãå²è¾¼ã¿ãã³ãã©ç»é²ã®ããã®å®æ°
+ */
+#define INHNO_TIMER		MPCORE_IRQNO_TMR	/* å²è¾¼ã¿ãã³ãã©çªå· */
+#define INTNO_TIMER		MPCORE_IRQNO_TMR	/* å²è¾¼ã¿çªå· */
+#define INTPRI_TIMER	(TMAX_INTPRI - 1)	/* å²è¾¼ã¿åªå
+åº¦ */
+#define INTATR_TIMER	TA_NULL				/* å²è¾¼ã¿å±æ§ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®èµ·åå¦ç
+ */
+extern void	target_hrt_initialize(intptr_t exinf);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®åæ­¢å¦ç
+ */
+extern void	target_hrt_terminate(intptr_t exinf);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ç¾å¨ã®ã«ã¦ã³ãå¤ã®èª­åºã
+ */
+Inline HRTCNT
+target_hrt_get_current(void)
+{
+	/*
+	 *  ã¦ã©ããããã°ã®ã«ã¦ã³ãå¤ãèª­ã¿åºãï¼ãã¦ã³ã«ã¦ã³ã¿ã§ããããï¼
+	 *  ãããåè»¢ãã¦è¿ãï¼
+	 */
+	return((HRTCNT) ~(sil_rew_mem(MPCORE_WDG_CNT)));
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã¸ã®å²è¾¼ã¿ã¿ã¤ãã³ã°ã®è¨­å®
+ *
+ *  é«åè§£è½ã¿ã¤ããï¼hrtcntã§æå®ããå¤ã«ã¦ã³ãã¢ãããããå²è¾¼ã¿ãçº
+ *  çãããããã«è¨­å®ããï¼
+ */
+Inline void
+target_hrt_set_event(HRTCNT hrtcnt)
+{
+	/*
+	 *  ã¿ã¤ãã®ã«ã¦ã³ãå¤ãhrtcntã«è¨­å®ããï¼
+	 */
+	sil_wrw_mem(MPCORE_TMR_CNT, hrtcnt);
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®è¦æ±
+ *
+ *  æ«å®çã«ï¼1Î¼ç§å¾ã«é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ããããããã«è¨­å®ãã¦ãããï¼
+ *  å³åº§ã«å²è¾¼ã¿ãè¦æ±ããæ¹æ³ããããã°ï¼Set-pending Registerãä½¿ãã
+ *  ã¨æãããï¼ï¼ããã«å·®ãæããï¼
+ */
+Inline void target_hrt_raise_event(void)
+{
+	target_hrt_set_event(1U);
+}
+
+/*
+ *  å²è¾¼ã¿ã¿ã¤ãã³ã°ã«æå®ããæå¤§å¤
+ */
+#define HRTCNT_BOUND	4000000002U
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+extern void	target_hrt_handler(void);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_CHIP_TIMER_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 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/chip_unrename.h	(revision 302)
@@ -0,0 +1,41 @@
+/* This file is generated from chip_rename.def by genrename. */
+
+/* This file is included only when chip_rename.h has been included. */
+#ifdef TOPPERS_CHIP_RENAME_H
+#undef TOPPERS_CHIP_RENAME_H
+
+/*
+ *  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
+
+
+#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"
+
+#endif /* TOPPERS_CHIP_RENAME_H */
Index: asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/mpcore.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/mpcore.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_gcc/mpcore/mpcore.h	(revision 302)
@@ -0,0 +1,228 @@
+/*
+ *  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: mpcore.h 357 2015-07-25 12:05:26Z ertl-hiro $
+ */
+
+/*
+ *		MPCoreãµãã¼ãã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_MPCORE_H
+#define TOPPERS_MPCORE_H
+
+#include <sil.h>
+#include "arm.h"
+
+/*
+ *  CP15ã®è£å©å¶å¾¡ã¬ã¸ã¹ã¿ï¼ACTLRï¼ã®è¨­å®å¤
+ */
+#if __TARGET_ARCH_ARM == 6
+#define CP15_ACTLR_SMP			UINT_C(0x00000020)
+#else /* __TARGET_ARCH_ARM == 6 */
+#define CP15_ACTLR_SMP			UINT_C(0x00000040)
+#endif /* __TARGET_ARCH_ARM == 6 */
+
+/*
+ *  SCUï¼ã¹ãã¼ãå¶å¾¡ã¦ãããï¼é¢é£ã®å®ç¾©
+ */
+
+/*
+ *  SCUã¬ã¸ã¹ã¿ã®çªå°ã®å®ç¾©
+ */
+#define MPCORE_SCU_BASE		(MPCORE_PMR_BASE + 0x0000U)
+#define MPCORE_SCU_CTRL		((uint32_t *)(MPCORE_SCU_BASE + 0x00U))
+#define MPCORE_SCU_CONFIG	((uint32_t *)(MPCORE_SCU_BASE + 0x04U))
+#define MPCORE_SCU_CPUSTAT	((uint32_t *)(MPCORE_SCU_BASE + 0x08U))
+#define MPCORE_SCU_INVALL	((uint32_t *)(MPCORE_SCU_BASE + 0x0cU))
+
+/*
+ *  SCUå¶å¾¡ã¬ã¸ã¹ã¿ï¼SCU_CTRLï¼ã®è¨­å®å¤
+ */
+#define MPCORE_SCU_CTRL_ENABLE		UINT_C(0x00000001)
+
+/*
+ *  SCUã¤ã³ããªãã¼ããªã¼ã«ã¬ã¸ã¹ã¿ï¼SCU_INVALLï¼ã®è¨­å®å¤
+ */
+#define MPCORE_SCU_INVALL_ALLWAYS	UINT_C(0x0000ffff)
+
+/*
+ *  GICé¢é£ã®å®ç¾©
+ */
+
+/*
+ *  GICã¬ã¸ã¹ã¿ã®ãã¼ã¹ã¢ãã¬ã¹ã®å®ç¾©
+ */
+#define GICC_BASE			(MPCORE_PMR_BASE + UINT_C(0x0100))
+#define GICD_BASE			(MPCORE_PMR_BASE + UINT_C(0x1000))
+
+/*
+ *  ãã©ã¤ãã¼ãã¿ã¤ãã¨ã¦ã©ããããã°é¢é£ã®å®ç¾©
+ */
+
+/*
+ *  ãã©ã¤ãã¼ãã¿ã¤ãã¨ã¦ã©ããããã°ã®å²è¾¼ã¿çªå·
+ */
+#define MPCORE_IRQNO_TMR	29U			/* ãã©ã¤ãã¼ãã¿ã¤ãã®å²è¾¼ã¿çªå· */
+#define MPCORE_IRQNO_WDG	30U			/* ã¦ã©ããããã°ã®å²è¾¼ã¿çªå· */
+
+/*
+ *  ãã©ã¤ãã¼ãã¿ã¤ãã¨ã¦ã©ããããã°ã¬ã¸ã¹ã¿ã®çªå°ã®å®ç¾©
+ */
+#define MPCORE_TMR_BASE		(MPCORE_PMR_BASE + 0x0600U)
+#define MPCORE_TMR_LR		((uint32_t *)(MPCORE_TMR_BASE + 0x00U))
+#define MPCORE_TMR_CNT		((uint32_t *)(MPCORE_TMR_BASE + 0x04U))
+#define MPCORE_TMR_CTRL		((uint32_t *)(MPCORE_TMR_BASE + 0x08U))
+#define MPCORE_TMR_ISR		((uint32_t *)(MPCORE_TMR_BASE + 0x0cU))
+#define MPCORE_WDG_LR		((uint32_t *)(MPCORE_TMR_BASE + 0x20U))
+#define MPCORE_WDG_CNT		((uint32_t *)(MPCORE_TMR_BASE + 0x24U))
+#define MPCORE_WDG_CTRL		((uint32_t *)(MPCORE_TMR_BASE + 0x28U))
+#define MPCORE_WDG_ISR		((uint32_t *)(MPCORE_TMR_BASE + 0x2cU))
+#define MPCORE_WDG_RST		((uint32_t *)(MPCORE_TMR_BASE + 0x30U))
+#define MPCORE_WDG_DIS		((uint32_t *)(MPCORE_TMR_BASE + 0x34U))
+
+/*
+ *  ãã©ã¤ãã¼ãã¿ã¤ãå¶å¾¡ã¬ã¸ã¹ã¿ï¼MPCORE_TMR_CTRLï¼ã®è¨­å®å¤
+ */
+#define MPCORE_TMR_CTRL_DISABLE			0x00U
+#define MPCORE_TMR_CTRL_ENABLE			0x01U
+#define MPCORE_TMR_CTRL_AUTORELOAD		0x02U
+#define MPCORE_TMR_CTRL_ENAINT			0x04U
+#define MPCORE_TMR_CTRL_PS_SHIFT		8
+
+/*
+ *  ãã©ã¤ãã¼ãã¿ã¤ãå²è¾¼ã¿ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼MPCORE_TMR_ISRï¼ã®è¨­å®å¤
+ */
+#define MPCORE_TMR_ISR_EVENTFLAG		0x01U
+
+/*
+ *  ã¦ã©ããããã°å¶å¾¡ã¬ã¸ã¹ã¿ï¼MPCORE_WDG_CTRLï¼ã®åç
+§å¤
+ */
+#define MPCORE_WDG_CTRL_DISABLE			0x00U
+#define MPCORE_WDG_CTRL_ENABLE			0x01U
+#define MPCORE_WDG_CTRL_AUTORELOAD		0x02U
+#define MPCORE_WDG_CTRL_ENAINT			0x04U
+#define MPCORE_WDG_CTRL_WDGMODE			0x08U
+#define MPCORE_WDG_CTRL_PS_SHIFT		8
+
+/*
+ *  ã¦ã©ããããã°å²è¾¼ã¿ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼MPCORE_WDG_ISRï¼ã®åç
+§å¤
+ */
+#define MPCORE_WDG_ISR_EVENTFLAG		0x01U
+
+/*
+ *  ã°ã­ã¼ãã«ã¿ã¤ãé¢é£ã®å®ç¾©
+ */
+#if __TARGET_ARCH_ARM == 7
+
+/*
+ *  ã°ã­ã¼ãã«ã¿ã¤ãã¬ã¸ã¹ã¿ã®çªå°ã®å®ç¾©
+ */
+#define MPCORE_GTC_BASE		(MPCORE_PMR_BASE + 0x0200U)
+#define MPCORE_GTC_COUNT_L	((uint32_t *)(MPCORE_GTC_BASE + 0x00U))
+#define MPCORE_GTC_COUNT_U	((uint32_t *)(MPCORE_GTC_BASE + 0x04U))
+#define MPCORE_GTC_CTRL		((uint32_t *)(MPCORE_GTC_BASE + 0x08U))
+#define MPCORE_GTC_ISR		((uint32_t *)(MPCORE_GTC_BASE + 0x0cU))
+#define MPCORE_GTC_CVR_L	((uint32_t *)(MPCORE_PMR_BASE + 0x10U))
+#define MPCORE_GTC_CVR_U	((uint32_t *)(MPCORE_PMR_BASE + 0x14U))
+
+/*
+ *  ã°ã­ã¼ãã«ã¿ã¤ãå¶å¾¡ã¬ã¸ã¹ã¿ï¼MPCORE_GTC_CTRLï¼ã®è¨­å®å¤
+ */
+#define MPCORE_GTC_CTRL_ENABLE			0x01U
+
+#endif /* __TARGET_ARCH_ARM == 7 */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  SMPã¢ã¼ãã«è¨­å®
+ */
+Inline void
+mpcore_enable_smp(void)
+{
+	uint32_t	reg;
+
+	CP15_READ_ACTLR(reg);
+	reg |= CP15_ACTLR_SMP;
+	CP15_WRITE_ACTLR(reg);
+}
+
+/*
+ *  SCUï¼ã¹ãã¼ãå¶å¾¡ã¦ãããï¼ã®æä½
+ */
+
+/*
+ *  SCUã®ã¤ãã¼ãã«
+ */
+Inline void
+mpcore_enable_scu(void)
+{
+	uint32_t	reg;
+
+	/*
+	 *  SCUã®ãã¹ã¦ã®ã¿ã°ãç¡å¹åããï¼
+	 */
+	sil_wrw_mem(MPCORE_SCU_INVALL, MPCORE_SCU_INVALL_ALLWAYS);
+
+	/*
+	 *  SCUãæå¹ã«ããï¼
+	 */
+	reg = sil_rew_mem(MPCORE_SCU_CTRL);
+	reg |= MPCORE_SCU_CTRL_ENABLE;
+	sil_wrw_mem(MPCORE_SCU_CTRL, reg);
+	data_sync_barrier();
+}
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_MPCORE_H */
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/MANIFEST
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/MANIFEST	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/MANIFEST	(revision 302)
@@ -0,0 +1,27 @@
+PACKAGE asp3_arch_arm_m_gcc
+VERSION 3.A.0
+
+MANIFEST
+README.txt
+
+common/Makefile.core
+common/arm_m.h
+common/core.tf
+common/core_asm.inc
+common/core_cfg1_out.h
+common/core_check.tf
+common/core_def.csv
+common/core_insn.h
+common/core_kernel.h
+common/core_kernel_impl.c
+common/core_kernel_impl.h
+common/core_offset.tf
+common/core_rename.def
+common/core_rename.h
+common/core_sil.h
+common/core_stddef.h
+common/core_support.S
+common/core_test.h
+common/core_unrename.h
+common/core_user.txt
+common/start.S
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/README.txt
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/README.txt	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/README.txt	(revision 302)
@@ -0,0 +1,28 @@
+                  ARM-Mä¾å­é¨(GCCç) ãã£ã¬ã¯ããªè§£èª¬
+
+                                   Last Modified: 2011 Nov 23 01:06:46
+
+
+æ¬ãã£ã¬ã¯ããªï¼./arch/arm_m_gccï¼ã¯ï¼armv7mã¢ã¼ã­ãã¯ãã£ã®ã³ã¢åã³ï¼
+armv7mã¢ã¼ã­ãã¯ãã£ã®ã³ã¢ãç¨ãããããã«ä¾å­ãï¼ã³ã³ãã¤ã©ã¨ãã¦GCC
+ãå¯¾è±¡ããè¨è¿°ãç½®ãããã®ãã£ã¬ã¯ããªã§ããï¼
+
+ã¿ã¼ã²ãããã£ã¬ã¯ããªï¼./targetï¼ã¨ã®åãåãã¯ï¼æ¬ãã£ã¬ã¯ããªã¯ï¼ç¹
+å®ã®ãã¼ãã«ä¾å­ããªãåå©ç¨å¯è½ãªè¨è¿°ãç½®ãã¨ã¨ãï¼ã¿ã¼ã²ãããã£ã¬ã¯
+ããªã¯åå©ç¨ã®å¯è½æ§ãä½ããã¼ãã«ä¾å­ããè¨è¿°ãç½®ããã¨ã¨ããï¼
+
+åå©ç¨å¯è½ãªç¯å²ã¨ãã¦ã¯ï¼armv7mã¢ã¼ã­ãã¯ãã£ã®ã³ã¢ãç¨ããããããã¾
+ã§ãæ³å®ãã¦ããï¼ãã®ããï¼æ¬ãã£ã¬ã¯ããªã«ç½®ãä¾å­é¨ããããä¾å­é¨ã¨
+å¼ã¶ï¼åãããä¾å­é¨ã¯ãããåã§ãã£ã¬ã¯ããªãä½æãï¼ãã®ä¸ã«é¢é£ãã
+ãã¡ã¤ã«ãç½®ãï¼
+
+ä¸æ¹ï¼armv7mã¢ã¼ã­ãã¯ãã£ã®ã³ã¢ã«ä¾å­ããè¨è¿°ã¯ï¼ã³ã¢ä¾å­é¨ã¨å¼ã³ï¼
+commonãã£ã¬ã¯ããªä»¥ä¸ã«ç½®ãï¼åãããä¾å­é¨ã¯å¿
+è¦ã«å¿ãã¦ã³ã¢ä¾å­é¨ã®
+ãã¡ã¤ã«ãä½¿ç¨ããï¼ã³ã¢ä¾å­é¨ã«é¢ãã¦ã¯ï¼common/core_user.txt ãåç
+§
+ã®ãã¨ï¼
+
+ãããã«ãã£ã¦ã¯ï¼ã³ã¢ä¾å­é¨ã¨åç­ã®æ©è½ãæããªãå ´åãããï¼ãã®å ´å
+ã¯ï¼ãããä¾å­é¨ãä½æããï¼ã¿ã¼ã²ããä¾å­é¨ã¨ã³ã¢ä¾å­é¨ã®ãã¡ã¤ã«ãçµ
+ã¿åãããã°ããï¼
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/Makefile.core
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/Makefile.core	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/Makefile.core	(revision 302)
@@ -0,0 +1,96 @@
+# 
+#   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: Makefile.core 301 2015-01-07 04:57:01Z ertl-ishikawa $
+# 
+
+#
+#		Makefile ã®ãã­ã»ããµä¾å­é¨ï¼ARM-Mç¨ï¼
+#
+
+# 
+#  ã³ã¢ä¾å­é¨ãã£ã¬ã¯ããªåã®å®ç¾© 
+# 
+COREDIR = $(SRCDIR)/arch/$(PRC)_$(TOOL)/common
+
+#
+#  ã³ã³ãã¤ã«ãªãã·ã§ã³
+#
+COPTS := $(COPTS) -mthumb 
+INCLUDES := $(INCLUDES) -I$(COREDIR)
+LDFLAGS := -nostdlib -nostartfiles $(LDFLAGS) 
+CFG1_OUT_LDFLAGS := $(CFG1_OUT_LDFLAGS) $(LDFLAGS)
+CDEFS := $(CDEFS)
+LIBS := $(LIBS)  -lgcc
+
+vpath %.c $(COREDIR)
+vpath %.S $(COREDIR)
+
+#
+#  ã«ã¼ãã«ã«é¢ããå®ç¾©
+#
+KERNEL_DIR := $(KERNEL_DIR) $(COREDIR)
+KERNEL_ASMOBJS := $(KERNEL_ASMOBJS) core_support.o
+KERNEL_COBJS := $(KERNEL_COBJS) core_kernel_impl.o
+
+#
+#  ä¾å­é¢ä¿ã®å®ç¾©
+#
+cfg1_out.c: $(COREDIR)/core_def.csv
+kernel_cfg.timestamp: $(COREDIR)/core.tf
+
+#
+#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
+#
+CFG_TABS := $(CFG_TABS) --cfg1-def-table $(COREDIR)/core_def.csv
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/arm_m.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/arm_m.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/arm_m.h	(revision 302)
@@ -0,0 +1,217 @@
+/*
+ *  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: arm_m.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *  ARMVx-Mã®ãã¼ãã¦ã§ã¢è³æºã®å®ç¾©
+ */
+
+#ifndef ARM_M_H
+#define ARM_M_H
+
+/*
+ *  EPSRã®Tããã
+ */
+#define EPSR_T   0x01000000
+
+/*
+ * IPSRã® ISR NUMBER
+ */
+#define IPSR_ISR_NUMBER 0x1ff
+
+/*
+ *  ä¾å¤ã»å²è¾¼ã¿çºçæã«ã¹ã¿ãã¯ä¸ã«ç©ã¾ããä¿å­é åã®ãµã¤ãº
+ *  æ¬ã«ã¼ãã«ã§ã¯ä¾å¤ãã¬ã¼ã ã¨å¼ã¶
+ */
+#ifdef TOPPERS_SUPPORT_FPV4
+#define EXC_FRAME_SIZE         (26*4)
+#else /* TOPPERS_SUPPORT_FPV4 */
+#define EXC_FRAME_SIZE         (8*4)
+#endif /* TOPPERS_SUPPORT_FPV4 */
+
+/*
+ *  ä¾å¤ã»å²è¾¼ã¿çºçæã«LRã«è¨­å®ãããEXC_RETURNã®å¤
+ */
+#define EXC_RETURN_HANDLER      0x0
+#define EXC_RETURN_THREAD       0x8
+#define EXC_RETURN_MSP          0x0
+#define EXC_RETURN_PSP          0x4
+
+/*
+ *  CONTROLã¬ã¸ã¹ã¿
+ */
+#define CONTROL_PSP            0x02
+#define CONTROL_MSP            0x00
+
+/*
+ *  ä¾å¤çªå·
+ */
+#define EXCNO_NMI         2
+#define EXCNO_HARD        3
+#define EXCNO_MPU         4
+#define EXCNO_BUS         5
+#define EXCNO_USAGE       6
+#define EXCNO_SVCALL     11          
+#define EXCNO_DEBUG      12
+#define EXCNO_PENDSV     14
+
+/*
+ *  ä¾å¤çªå·ã®æå°å¤ã¨æå¤§å¤
+ */
+#define TMIN_EXCNO   2
+#define TMAX_EXCNO  14
+
+/*
+ *  å²è¾¼ã¿çªå·
+ */
+#define IRQNO_SYSTICK    15
+
+/*
+ *  å²è¾¼ã¿çªå·ã®æå°å¤
+ */
+#define TMIN_INTNO       15
+
+/*
+ *  ä¾å¤ãã¬ã¼ã ã®ãªãã»ãã
+ */
+#define P_EXCINF_OFFSET_EXC_RETURN  0x00
+#define P_EXCINF_OFFSET_BASEPRI     0x01
+#define P_EXCINF_OFFSET_XPSR        0x09
+#define P_EXCINF_OFFSET_PC          0x08
+
+/*
+ *  NVICé¢é£
+ */
+
+/*
+ *  ã³ã³ãã­ã¼ã«ã¬ã¸ã¹ã¿
+ */
+#define NVIC_INT_CTRL       0xe000ed04
+
+#define NVIC_PENDSVSET      0x10000000
+
+/*
+ *  ã·ã¹ãã ãã³ãã©ã¼ã³ã³ãã­ã¼ã«ã¬ã¸ã¹ã¿
+ */
+#define NVIC_SYS_HND_CTRL   0xE000ED24
+
+/*
+ *  åä¾å¤ã®è¨±å¯ããã
+ */
+#define NVIC_SYS_HND_CTRL_USAGE 0x00040000
+#define NVIC_SYS_HND_CTRL_BUS   0x00020000
+#define NVIC_SYS_HND_CTRL_MEM   0x00010000
+
+/*
+ *  åªå
+åº¦è¨­å®ã¬ã¸ã¹ã¿
+ */
+#define NVIC_SYS_PRI1       0xE000ED18  // Sys. Handlers 4 to 7 Priority
+#define NVIC_SYS_PRI2       0xE000ED1C  // Sys. Handlers 8 to 11 Priority
+#define NVIC_SYS_PRI3       0xE000ED20  // Sys. Handlers 12 to 15 Priority
+#define NVIC_PRI0           0xE000E400  // IRQ 0 to 3 Priority Register
+
+/*
+ *  å²è¾¼ã¿è¨±å¯ã¬ã¸ã¹ã¿
+ */
+#define NVIC_SETENA0        0xE000E100  // IRQ 0 to 31 Set Enable Register
+
+/*
+ *  å²è¾¼ã¿ç¦æ­¢ã¬ã¸ã¹ã¿
+ */
+#define NVIC_CLRENA0        0xE000E180  // IRQ 0 to 31 Set Disable Register
+
+/*
+ *  å²è¾¼ã¿ã»ãããã³ãã£ã³ã°ã¬ã¸ã¹ã¿
+ */
+#define NVIC_ISER0          0xE000E200  // IRQ 0 to 31 Set-Pending Register
+
+/*
+ *  å²è¾¼ã¿ã¯ãªã¢ãã³ãã£ã³ã°ã¬ã¸ã¹ã¿
+ */
+#define NVIC_ICER0          0xE000E280  // IRQ 0 to 31 Clear-Pending Register
+
+/*
+ *  ãã¯ã¿ãã¼ãã«ãªãã»ããã¬ã¸ã¹ã¿
+ */
+#define NVIC_VECTTBL        0xE000ED08
+
+
+/*
+ *  SYSTICé¢é£ã¬ã¸ã¹ã¿
+ */
+#define SYSTIC_CONTROL_STATUS 0xE000E010
+#define SYSTIC_RELOAD_VALUE   0xE000E014
+#define SYSTIC_CURRENT_VALUE  0xE000E018
+#define SYSTIC_CALIBRATION    0xE000E01C
+
+#define SYSTIC_ENABLE    0x01
+#define SYSTIC_TICINT    0x02
+#define SYSTIC_CLKSOURCE 0x04
+#define SYSTIC_COUNTFLAG 0x10000
+
+#define SYSTIC_SKEW      0x40000000
+#define SYSTIC_NOREF     0x80000000
+#define SYSTIC_TENMS     0x00ffffff
+
+/*
+ *  Configuration Control Register
+ */
+#define CCR_BASE        0xE000ED14
+#define CCR_STKALIGN    0x00000200
+#define CPACR_BASE      0xE000ED88U                            /*!< System Control Space Base Address  */
+
+#endif  /* ARM_M_H */
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core.tf
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core.tf	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core.tf	(revision 302)
@@ -0,0 +1,242 @@
+$ ======================================================================
+$ 
+$   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$
+__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_asm.inc
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_asm.inc	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_asm.inc	(revision 302)
@@ -0,0 +1,94 @@
+/*
+ *  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_asm.inc 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+#ifndef TOPPERS_CORE_ASM_INC
+#define TOPPERS_CORE_ASM_INC
+
+/*
+ *  ATHUMBç¸å½ã®å®ç¾©
+ */
+.macro __athumb name
+	.syntax unified
+	.thumb
+	.thumb_func
+	.type name, function
+.endm
+
+/*
+ *  ãã£ã¬ã¯ãã£ãã®ãã¯ã­å®ç¾©
+ */
+#define ASECTION(name) .section name,"a"
+#define ATEXT          .text
+#define AGLOBAL(name)  .global name
+#define AALIGN(x)      .align x
+#define ALONG          .long
+#define ALABEL(label)  label:
+#define AOR            |
+#define ATHUMB(name)        __athumb name
+
+
+/*
+ *  ã»ã¯ã·ã§ã³æ
+å ±
+ */
+#define DATA_START  __data_start
+#define IDATA_START __idata_start
+#define IDATA_END   __idata_end
+#define BSS_START   __bss_start
+#define BSS_END     __bss_end
+
+#endif /* TOPPERS_CORE_ASM_INC */
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 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_cfg1_out.h	(revision 302)
@@ -0,0 +1,71 @@
+/*
+ *  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_cfg1_out.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *		cfg1_out.cããªã³ã¯ããããã«å¿
+è¦ãªã¹ã¿ãã®å®ç¾©
+ */
+
+void sta_ker(void){}
+
+/* 
+ *  ãªãã»ãããã¡ã¤ã«ãçæããããã®å®ç¾© 
+ */ 
+const uint8_t   MAGIC_1 = 0x12; 
+const uint16_t  MAGIC_2 = 0x1234; 
+const uint32_t  MAGIC_4 = 0x12345678;
+
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 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_check.tf	(revision 302)
@@ -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ç¨ï¼
+$  
+$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_def.csv
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_def.csv	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_def.csv	(revision 302)
@@ -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_insn.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_insn.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_insn.h	(revision 302)
@@ -0,0 +1,174 @@
+/*
+ *  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_insn.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+
+/*
+ *  ã³ã¢ä¾å­ã®ç¹æ®å½ä»¤ã®ã¤ã³ã©ã¤ã³é¢æ°å®ç¾©ï¼ARM-Mç¨ï¼
+ */
+
+#ifndef CORE_INSN_H
+#define CORE_INSN_H
+
+#include <arm_m.h>
+
+/*
+ *  ã¡ã¢ãªãå¤æ´ããããã¨ãã³ã³ãã¤ã©ã«ä¼ããããã®ãã¯ã­
+ */
+#define ARM_MEMORY_CHANGED Asm("":::"memory")
+
+/*
+ *  FAULTMASKã®ã»ãã
+ */
+Inline void
+set_faultmask(void){
+	Asm("cpsid f":::"memory");
+}
+
+/*
+ *  FAULTMASKã®ã¯ãªã¢
+ */
+Inline void
+clear_faultmask(void){
+	Asm("cpsie f":::"memory");
+}
+
+/*
+ *  PRIMASKã®ã»ãã
+ */
+Inline void
+set_primask(void){
+	Asm("cpsid i":::"memory");
+}
+
+/*
+ *  PRIMASKã®ã¯ãªã¢
+ */
+Inline void
+clear_primask(void){
+	Asm("cpsie i":::"memory");
+}
+
+/*
+ *  BASEPRIã®ã»ãã
+ */
+Inline void
+set_basepri(uint32_t val){
+	Asm("msr BASEPRI, %0" : : "r"(val) : "memory");
+}
+
+/*
+ *  BASEPRIã®åå¾
+ */
+Inline uint32_t
+get_basepri(void){
+	uint32_t val;
+	Asm("mrs  %0, BASEPRI" : "=r"(val));
+	return(val);
+}
+
+/*
+ *  CONTROLã®ã»ãã
+ */
+Inline void
+set_control(uint32_t val){
+	/*
+	 *  controlã¬ã¸ã¹ã¿ã»ããå¾ã«ã¯isbãå¿
+é 
+	 *  [ARMv7-M Architecture Reference Manaual(DDI0403B) A3-37]
+	 */
+	Asm("msr control, %0 \n"
+		" isb"
+		: : "r"(val) : "memory");
+}
+
+/*
+ *  CONTROLã®åå¾
+ */
+Inline uint32_t
+get_control(void){
+	uint32_t val;
+	Asm("mrs  %0, CONTROL" : "=r"(val));
+	return(val);
+}
+
+/*
+ *  ã¹ãã¼ã¿ã¹ã¬ã¸ã¹ã¿ï¼CPSRï¼ã®ç¾å¨å¤ã®èª­åºã
+ */
+Inline uint32_t
+get_ipsr(void)
+{
+    uint32_t sr;
+    Asm("mrs  %0, ipsr" : "=r"(sr));
+    return(sr);
+}
+
+Inline void
+delay_for_interrupt(void)
+{
+    Asm("nop" : : : "memory");
+}
+
+/*
+ *  SCS(NVICç­)ãæä½å¾ã«æä½ã®å½±é¿ãåæ ããã¦ããæ¬¡ã®å½ä»¤ãå®è¡ããããã®åæ
+ */
+#if defined(TOPPERS_CORTEX_M4) || defined(TOPPERS_CORTEX_M3) || defined(TOPPERS_CORTEX_M0) || defined(TOPPERS_CORTEX_M0PLUS)
+#define SCS_SYNC Asm("isb")
+#else /* !defined(TOPPERS_CORTEX_M4) || defined(TOPPERS_CORTEX_M3) || defined(TOPPERS_CORTEX_M0) || defined(TOPPERS_CORTEX_M0PLUS) */
+#define SCS_SYNC Asm("isb \n dsb \n")
+#endif /* defined(TOPPERS_CORTEX_M4) || defined(TOPPERS_CORTEX_M3) || defined(TOPPERS_CORTEX_M0) || defined(TOPPERS_CORTEX_M0PLUS) */
+
+#endif /* CORE_INSN_H */
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_kernel.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_kernel.h	(revision 302)
@@ -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_kernel.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *		kernel.hã®ã³ã¢ä¾å­é¨ï¼ARM-Mç¨ï¼
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼target_kernel.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯
+ *  ã«ã¼ãããããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ãã
+ *  ç´æ¥ã¤ã³ã¯ã«ã¼ããã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_CORE_KERNEL_H
+#define TOPPERS_CORE_KERNEL_H
+
+/*
+ *  ãµãã¼ãããæ©è½ã®å®ç¾©
+ */
+#define TOPPERS_TARGET_SUPPORT_DIS_INT      /* dis_intããµãã¼ããã */
+#define TOPPERS_TARGET_SUPPORT_ENA_INT      /* ena_intããµãã¼ããã */
+
+#define TMAX_INTPRI		(-1)		/* å²è¾¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+
+#endif /* TOPPERS_CORE_KERNEL_H */
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_kernel_impl.c
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_kernel_impl.c	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_kernel_impl.c	(revision 302)
@@ -0,0 +1,321 @@
+/*
+ *  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_kernel_impl.c 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *		ã³ã¢ä¾å­ã¢ã¸ã¥ã¼ã«ï¼ARM-Mç¨ï¼
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+
+/*
+ *  CPUã­ãã¯ãã©ã°å®ç¾ã®ããã®å¤æ°
+ */
+volatile bool_t		lock_flag;		/* CPUã­ãã¯ãã©ã°ã®å¤ãä¿æããå¤æ° */
+volatile uint32_t	saved_iipm;		/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãä¿å­ããå¤æ° */
+
+/*
+ *  ãã¯ã¿ãã¼ãã«(kernel_cfg.c)
+ */
+extern const FP vector_table[];
+
+/*
+ *  ã·ã¹ãã ä¾å¤ã»å²è¾¼ã¿ã®ï¼ä¾å¤çªå· 4ã15ï¼
+ *  å²è¾¼ã¿åªå
+åº¦è¨­å®ã¬ã¸ã¹ã¿ã¸ã®ã¢ã¯ã»ã¹ã®ããã®é
+å
+ */
+static const unsigned int nvic_sys_pri_reg[] = {
+	0,
+	NVIC_SYS_PRI1,
+	NVIC_SYS_PRI2,
+	NVIC_SYS_PRI3
+};
+
+/*
+ *  ä¾å¤ã¨å²è¾¼ã¿ã®å²è¾¼ã¿åªå
+åº¦ãã»ãã
+ *
+ *  excnoã¯ARM-Mã§å®ãããã¦ãã Exception Number ãæå®ï¼
+ */
+void
+set_exc_int_priority(uint32_t excno, uint32_t iipm){
+	uint32_t tmp, reg;
+
+	/*
+	 *  å²è¾¼ã¿åªå
+åº¦è¨­å®ã¬ã¸ã¹ã¿ã®æ±ºå®
+	 */
+	if ((EXCNO_MPU <= excno) && (excno <= IRQNO_SYSTICK)) {
+		/*
+		 * Exception Number 4(Memory Management)ãã
+		 * Exception Number 15(SysTick)ã¾ã§ã®å²è¾¼ã¿åªå
+åº¦ã¯ã·ã¹ãã åªå
+åº¦
+		 * ã¬ã¸ã¹ã¿ã«ããè¨­å®ï¼
+		 */
+		reg = nvic_sys_pri_reg[excno >> 2];
+	}
+	else if ((TMIN_INTNO < excno) && (excno <= TMAX_INTNO)){
+		/*
+		 * IRQå²è¾¼ã¿ãªã
+		 */
+		reg = NVIC_PRI0 + (((excno - (TMIN_INTNO + 1)) >> 2) * 4);
+	}
+	else {
+		return ;
+	}
+	
+	tmp = sil_rew_mem((void *)reg);
+	tmp &= ~(0xFF << (8 * (excno & 0x03)));
+	tmp |= iipm << (8 * (excno & 0x03));
+	sil_wrw_mem((void *)reg, tmp);
+}
+
+/*
+ *  ä¾å¤ã®è¨±å¯
+ *
+ *  Memory Management, Bus Fault, Usage Fault ã¯ç¦æ­¢ã»è¨±å¯ãå¯è½
+ */
+void
+enable_exc(EXCNO excno)
+{
+	uint32_t tmp;
+
+	switch (excno) {
+	  case EXCNO_MPU:
+		tmp = sil_rew_mem((void *)NVIC_SYS_HND_CTRL);
+		tmp |= NVIC_SYS_HND_CTRL_MEM;
+		sil_wrw_mem((void *)NVIC_SYS_HND_CTRL, tmp);
+		break;
+	  case EXCNO_BUS:
+		tmp = sil_rew_mem((void *)NVIC_SYS_HND_CTRL);
+		tmp |= NVIC_SYS_HND_CTRL_BUS;
+		sil_wrw_mem((void *)NVIC_SYS_HND_CTRL, tmp);
+		break;
+	  case EXCNO_USAGE:
+		tmp = sil_rew_mem((void *)NVIC_SYS_HND_CTRL);
+		tmp |= NVIC_SYS_HND_CTRL_USAGE;
+		sil_wrw_mem((void *)NVIC_SYS_HND_CTRL, tmp);
+		break;
+	}
+}
+
+/*
+ *  ä¾å¤ã®ç¦æ­¢
+ */
+void
+disable_exc(EXCNO excno)
+{
+	uint32_t tmp;
+
+	switch (excno) {
+	  case EXCNO_MPU:
+		tmp = sil_rew_mem((void *)NVIC_SYS_HND_CTRL);
+		tmp &= ~NVIC_SYS_HND_CTRL_MEM;
+		sil_wrw_mem((void *)NVIC_SYS_HND_CTRL, tmp);
+		break;
+	  case EXCNO_BUS:
+		tmp = sil_rew_mem((void *)NVIC_SYS_HND_CTRL);
+		tmp &= ~NVIC_SYS_HND_CTRL_BUS;
+		sil_wrw_mem((void *)NVIC_SYS_HND_CTRL, tmp);
+		break;
+	  case EXCNO_USAGE:
+		tmp = sil_rew_mem((void *)NVIC_SYS_HND_CTRL);
+		tmp &= ~NVIC_SYS_HND_CTRL_USAGE;
+		sil_wrw_mem((void *)NVIC_SYS_HND_CTRL, tmp);
+		break;
+	}
+}
+
+
+/*
+ *  ã³ã¢ä¾å­ã®åæå
+ */
+void
+core_initialize(void)
+{
+	/*
+	 *  CPUã­ãã¯ãã©ã°å®ç¾ã®ããã®å¤æ°ã®åæå
+	 */
+	lock_flag = true;
+	saved_iipm = IIPM_ENAALL;
+
+	/*
+	 *  ãã¯ã¿ãã¼ãã«ãè¨­å®
+	 */
+	sil_wrw_mem((void*)NVIC_VECTTBL, (uint32_t)vector_table);
+
+	/*
+	 *  åä¾å¤ã®åªå
+åº¦ãè¨­å®
+	 *  CPUã­ãã¯ç¶æ
+ã§ãçºçããããã«ï¼BASEPRIã¬ã¸ã¹ã¿ã§ãã¹ã¯ã§ã
+	 *  ãªã'0'ã¨ããï¼
+	 */
+	set_exc_int_priority(EXCNO_HARD, 0);
+	set_exc_int_priority(EXCNO_MPU, 0);
+	set_exc_int_priority(EXCNO_BUS, 0);
+	set_exc_int_priority(EXCNO_USAGE, 0);
+	set_exc_int_priority(EXCNO_SVCALL, 0);
+	set_exc_int_priority(EXCNO_DEBUG, 0);
+	set_exc_int_priority(EXCNO_PENDSV, INT_IPM(-1));
+
+	/*
+	 *  SVCãã³ãã©ãæå¹ã«
+	 */
+	enable_int(EXCNO_SVCALL);
+
+    /*
+     *  Configuration Control Registerã®STKALIGNãããã0ã«ãã
+     *  ã¹ã¿ãã¯ã¯8byteã¢ã©ã¤ã³ã§ãªãã4byteã¢ã©ã¤ã³
+     */
+    sil_andw((void *)CCR_BASE, ~CCR_STKALIGN);
+}
+
+/*
+ *  ã³ã¢ä¾å­ã®çµäºå¦ç
+ */
+void
+core_terminate(void)
+{
+	extern void    software_term_hook(void);
+	void (*volatile fp)(void) = software_term_hook;
+
+	/*
+	 *  software_term_hookã¸ã®ãã¤ã³ã¿ãï¼ä¸æ¦volatileæå®ã®ããfpã«ä»£
+	 *  å
+¥ãã¦ããä½¿ãã®ã¯ï¼0ã¨ã®æ¯è¼ãæé©åã§åé¤ãããªãããã«ããã
+	 *  ãã§ããï¼
+	 */
+	if (fp != 0) {
+		(*fp)();
+	}
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã©ã¤ã³å±æ§ã®è¨­å®
+ */
+void
+config_int(INTNO intno, ATR intatr, PRI intpri)
+{
+	assert(VALID_INTNO_CFGINT(intno));
+	assert(TMIN_INTPRI <= intpri && intpri <= TMAX_INTPRI);
+
+	/* 
+	 *  ä¸æ¦å²è¾¼ã¿ãç¦æ­¢ãã
+	 */    
+	(void)disable_int(intno);
+
+	/*
+	 *  å²è¾¼ã¿åªå
+åº¦ãã»ãã
+	 */
+	set_exc_int_priority(intno, INT_IPM(intpri));
+
+	/*
+	 *  å²è¾¼ã¿è¦æ±ãã¹ã¯è§£é¤(å¿
+è¦ãªå ´å)
+	 */
+	if ((intatr & TA_ENAINT) != 0U) {
+		(void)enable_int(intno);
+	}    
+}
+
+
+#ifndef OMIT_DEFAULT_EXC_HANDLER
+/*
+ *  Trapaä»¥å¤ã®ä¾å¤ã§ç»é²ããã¦ããªãä¾å¤ãçºçããã¨å¼ã³åºããã
+ */
+void
+default_exc_handler(void *p_excinf)
+{
+	uint32_t basepri = *(((uint32_t*)p_excinf) + P_EXCINF_OFFSET_BASEPRI);
+	uint32_t pc      = *(((uint32_t*)p_excinf) + P_EXCINF_OFFSET_PC);
+	uint32_t xpsr    = *(((uint32_t*)p_excinf) + P_EXCINF_OFFSET_XPSR);
+	uint32_t excno   = get_ipsr() & IPSR_ISR_NUMBER;
+
+	syslog(LOG_EMERG, "\nUnregistered Exception occurs.");
+	syslog(LOG_EMERG, "Excno = %08x PC = %08x XPSR = %08x basepri = %08X, p_excinf = %08X",
+		   excno, pc, xpsr, basepri, p_excinf);
+
+	target_exit();
+}
+#endif /* OMIT_DEFAULT_EXC_HANDLER */
+
+#ifndef OMIT_DEFAULT_INT_HANDLER
+/*
+ *  æªç»é²ã®å²è¾¼ã¿ãçºçããå ´åã«å¼ã³åºããã
+ */
+void
+default_int_handler(void *p_excinf)
+{
+	uint32_t basepri = *(((uint32_t*)p_excinf) + P_EXCINF_OFFSET_BASEPRI);
+	uint32_t pc      = *(((uint32_t*)p_excinf) + P_EXCINF_OFFSET_PC);
+	uint32_t xpsr    = *(((uint32_t*)p_excinf) + P_EXCINF_OFFSET_XPSR);
+	uint32_t excno   = get_ipsr() & IPSR_ISR_NUMBER;
+
+	syslog(LOG_EMERG, "\nUnregistered Interrupt occurs.");
+	syslog(LOG_EMERG, "Excno = %08x PC = %08x XPSR = %08x basepri = %08X, p_excinf = %08X",
+		   excno, pc, xpsr, basepri, p_excinf);
+
+	target_exit();
+}
+#endif /* OMIT_DEFAULT_INT_HANDLER */
+
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 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_kernel_impl.h	(revision 302)
@@ -0,0 +1,797 @@
+/*
+ *  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_kernel_impl.h 322 2015-04-30 13:23:48Z ertl-ishikawa $
+ */
+
+/*
+ *		ãã­ã»ããµä¾å­ã¢ã¸ã¥ã¼ã«ï¼ARM-Mç¨ï¼
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼target_config.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯
+ *  ã«ã¼ãããããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ãã
+ *  ç´æ¥ã¤ã³ã¯ã«ã¼ããã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_CORE_KERNEL_IMPL_H
+#define TOPPERS_CORE_KERNEL_IMPL_H
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãã­ã»ããµã®ç¹æ®å½ä»¤ã®ã¤ã³ã©ã¤ã³é¢æ°å®ç¾©
+ */
+#include <core_insn.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®ãªãã¸ã§ã¯ãå±æ§
+ */
+#define TARGET_INHATR  TA_NONKERNEL /* ã¿ã¼ã²ããå®ç¾©ã®å²è¾¼ã¿ãã³ãã©å±æ§ */
+
+/*
+ *  ã¨ã©ã¼ãã§ãã¯æ¹æ³ã®æå®
+ */
+#define CHECK_STKSZ_ALIGN	8	/* ã¹ã¿ãã¯ãµã¤ãºã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_FUNC_ALIGN	1	/* é¢æ°ã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_FUNC_NONNULL		/* é¢æ°ã®éNULLãã§ãã¯ */
+#define CHECK_STACK_ALIGN	8	/* ã¹ã¿ãã¯é åã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_STACK_NONNULL		/* ã¹ã¿ãã¯é åã®éNULLãã§ãã¯ */
+#define CHECK_MPF_ALIGN		4	/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_MPF_NONNULL		/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®éNULLãã§ãã¯ */
+#define CHECK_MB_ALIGN		4	/* ç®¡çé åã®ã¢ã©ã¤ã³åä½ */
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯åæå¤
+ */
+#define TOPPERS_ISTKPT(istk, istksz) ((STK_T *)((char *)(istk) + (istksz)))
+
+/*
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ã®å®ç¾©
+ */
+typedef struct task_context_block {
+    uint32_t    *sp;         /* ã¹ã¿ãã¯ãã¤ã³ã¿ */
+	intptr_t    pc;			/* ãã­ã°ã©ã ã«ã¦ã³ã¿ */
+} TSKCTXB;
+
+/*
+ *	ã¿ã¹ã¯åæåã³ã³ãã­ã¹ããã­ãã¯
+ */
+#define USE_TSKINICTXB	/*  TSKINICTXBãä½¿ç¨ãã  */
+
+typedef struct task_initialization_context_block {
+	size_t		stksz;			/* ã¹ã¿ãã¯é åã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
+	void		*stk_bottom;			/* ã¹ã¿ãã¯é åã®å
+é ­çªå° */
+} TSKINICTXB;
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  SVCã®ãã©ã¡ã¼ã¿
+ */
+#define NO_DISPATCHER   0   /* dispatcheræã®svcã®å¼æ° */
+
+#ifndef TOPPERS_MACRO_ONLY
+/*
+ *  ã³ã³ãã­ã¹ãã®åç
+§
+ *
+ */
+Inline bool_t
+sense_context(void)
+{
+	/*
+	 *  PSPãæå¹ãªãã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼MSPãæå¹ãªãéã¿ã¹ã¯ã³ã³ãã­ã¹ã
+	 *  ã¨ããï¼ 
+	 */
+	if ((get_control() & CONTROL_PSP) == CONTROL_PSP){
+		return false;
+	}
+	else {
+		return true;
+	}
+}
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  TOPPERSæ¨æºå²è¾¼ã¿å¦çã¢ãã«ã®å®ç¾
+ *
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¨ãã¦ã¯ï¼BASEPRIãç¨ããï¼å
+¨å²è¾¼ã¿ãç¦æ­¢ãã
+ *  æ©è½ã¨ãã¦ï¼FAULTMASKãPRIMASKããããï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã
+ *  ãµãã¼ãããããï¼ãããã¯CPUã­ãã¯ã®ããã«ç¨ããªãï¼
+ *  ãã®ããï¼BASEPRIãç¨ãã¦æ¬ä¼¼çã«CPUã­ãã¯ãã©ã°ãå®ç¾ããï¼
+ *
+ *  ã¾ãï¼CPUã­ãã¯ç¶æ
+ãç®¡çãããã®å¤æ°(lock_flag)ãç¨æããï¼
+ *
+ *  CPUã­ãã¯ãã©ã°ãã¯ãªã¢ããã¦ããéã¯ï¼BASEPRIãã¢ãã«ä¸ã®å²è¾¼ã¿
+ *  åªå
+åº¦ãã¹ã¯ã®å¤ã«è¨­å®ããï¼ãã®éã¯ï¼ã¢ãã«ä¸ã®å²è¾¼ã¿åªå
+åº¦ãã¹
+ *  ã¯ã¯ï¼BASEPRIãç¨ããï¼
+ * 
+ *  ããã«å¯¾ãã¦CPUã­ãã¯ãã©ã°ãã»ããããããéã¯ï¼BASEPRIãï¼ã«ã¼ã
+ *  ã«ç®¡çå¤ã®ãã®ãé¤ããã¹ã¦ã®å²è¾¼ã¿è¦æ±ããã¹ã¯ããå¤(TIPM_LOCK)ã¨ï¼
+ *  ã¢ãã«ä¸ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¨ã®é«ãæ¹ã«è¨­å®ããï¼ãã®éã®ã¢ãã«ä¸
+ *  ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¯ï¼ãã®ããã®å¤æ°(saved_iipm, å
+é¨è¡¨ç¾ã§ä¿æ)
+ *  ãç¨æãã¦ä¿æããï¼
+ */
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®å¤é¨è¡¨ç¾ã¨å
+é¨è¡¨ç¾ã®å¤æ
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ããã¤ã³ã¯ã«ã¼ãããå ´åã®ããã«ï¼
+ *  CASTãä½¿ç¨
+ *  å²è¾¼ã¿åªå
+åº¦ã®ãããå¹
+(TBITW_IPRI)ã 8 ã®å ´åã¯ï¼å
+é¨åªå
+åº¦ 255
+ *  ã¯ï¼å¤é¨åªå
+åº¦ -1 ã«å¯¾å¿ããï¼
+ */
+#define EXT_IPM(iipm)   (CAST(PRI,((iipm >> (8 - TBITW_IPRI)) - (1 << TBITW_IPRI))))       /* å
+é¨è¡¨ç¾ãå¤é¨è¡¨ç¾ã« */
+#define INT_IPM(ipm)    (((1 << TBITW_IPRI) - CAST(uint8_t, -(ipm)))  << (8 - TBITW_IPRI)) /* å¤é¨è¡¨ç¾ãå
+é¨è¡¨ç¾ã« */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã§ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯
+ */
+#define TIPM_LOCK    TMIN_INTPRI
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã§ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®å
+é¨è¡¨ç¾
+ *
+ *  TIPM_LOCKã¯ï¼CPUã­ãã¯ç¶æ
+ã§ã®BASEPRIã®å¤ï¼ã«ã¼ãã«ç®¡çå¤ã®ãã®ã
+ *  é¤ããã¹ã¦ã®å²è¾¼ã¿ããã¹ã¯ããå¤ã«å®ç¾©ããï¼  
+ */
+#define IIPM_LOCK    INT_IPM(TIPM_LOCK)
+
+/*
+ *  TIPM_ENAALLï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ï¼ã®å
+é¨è¡¨ç¾
+ *
+ *  BASEPRIã« '0' ãè¨­å®ãããã¨ã§ï¼å
+¨å²è¾¼ã¿ãè¨±å¯ããï¼
+ */
+#define IIPM_ENAALL  (0)
+
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  CPUã­ãã¯ãã©ã°å®ç¾ã®ããã®å¤æ°
+ * 
+ *  ãããã®å¤æ°ã¯ï¼CPUã­ãã¯ç¶æ
+ã®æã®ã¿æ¸ãæãã¦ãããã¨ããï¼
+ *  ã¤ã³ã©ã¤ã³é¢æ°ä¸­ã§ï¼ã¢ã¯ã»ã¹ã®é åºãå¤åããªãããï¼volatile ãæå®ï¼ 
+ */
+extern volatile bool_t  lock_flag;    /* CPUã­ãã¯ãã©ã°ã®å¤ãä¿æããå¤æ° */
+extern volatile uint32_t saved_iipm;  /* å²è¾¼ã¿åªå
+åº¦ããã¹ã¯ããå¤æ° */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã¸ã®ç§»è¡
+ *
+ *  BASEPRIï¼ãã¼ãã¦ã§ã¢ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼ãï¼saved_iipmã«ä¿å­ãï¼
+ *  ã«ã¼ãã«ç®¡çå¤ã®ãã®ãé¤ããã¹ã¦ã®å²è¾¼ã¿ããã¹ã¯ããå¤ï¼TIPM_LOCKï¼
+ *  ã«è¨­å®ããï¼ã¾ãï¼lock_flagãtrueã«ããï¼
+ *
+ *  BASEPRIãï¼æåããTIPM_LOCKã¨åããããããé«ãå ´åã«ã¯ï¼ããã
+ *  saved_iipmã«ä¿å­ããã®ã¿ã§ï¼TIPM_LOCKã«ã¯è¨­å®ããªãï¼ããã¯ï¼ã¢ãã«
+ *  ä¸ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãï¼TIPM_LOCKã¨åããããããé«ãã¬ãã«ã«è¨­å®
+ *  ããã¦ããç¶æ
+ã«ãããï¼
+ *
+ *  ãã®é¢æ°ã¯ï¼CPUã­ãã¯ç¶æ
+ï¼lock_flagãtrueã®ç¶æ
+ï¼ã§å¼ã°ãããã¨ã¯
+ *  ãªããã®ã¨æ³å®ãã¦ããï¼
+ */
+Inline void
+lock_cpu(void)
+{
+	uint32_t iipm;
+
+	/*
+	 *  get_basepri()ã®è¿ãå¤ãç´æ¥saved_iipmã«ä¿å­ããï¼ä¸æå¤æ°iipm
+	 *  ãç¨ãã¦ããã®ã¯ï¼get_baespri()ãå¼ãã ç´å¾ã«å²è¾¼ã¿ãçºçãï¼
+	 *  èµ·åãããå²è¾¼ã¿å¦çã§saved_iipmãå¤æ´ãããå¯è½æ§ãããããã§
+	 *  ããï¼
+	 */
+	iipm = get_basepri();
+	/*
+	 *  BASEPRIã¬ã¸ã¹ã¿ã¯å¤ãå°ããã»ã©åªå
+åº¦ãé«ããï¼IIPM_ENAALL ã
+	 *  '0'ã§ããããï¼åç´ã«åªå
+åº¦æ¯è¼ã ãã§ã¯ä¸ååã§ããï¼
+	 */
+	if ((IIPM_LOCK < iipm) || (IIPM_ENAALL == iipm)) {
+		set_basepri(IIPM_LOCK);
+        SCS_SYNC;
+	}
+	saved_iipm = iipm;
+	lock_flag = true;
+	/* ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åå¾ã§ã¡ã¢ãªãæ¸ãæããå¯è½æ§ããã */
+	ARM_MEMORY_CHANGED;
+}
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®è§£é¤
+ *
+ *  lock_flagãfalseã«ãï¼IPMï¼ãã¼ãã¦ã§ã¢ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼ãï¼
+ *  saved_iipmã«ä¿å­ããå¤ã«æ»ãï¼
+ *
+ *  ãã®é¢æ°ã¯ï¼CPUã­ãã¯ç¶æ
+ï¼lock_flagãtrueã®ç¶æ
+ï¼ã§ã®ã¿å¼ã°ããã
+ *  ã®ã¨æ³å®ãã¦ããï¼
+ */
+Inline void
+unlock_cpu(void)
+{
+	/* ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åå¾ã§ã¡ã¢ãªãæ¸ãæããå¯è½æ§ããã */
+	ARM_MEMORY_CHANGED;
+	lock_flag = false;
+	set_basepri(saved_iipm);
+}
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®åç
+§
+ */
+Inline bool_t
+sense_lock(void)
+{
+	return(lock_flag);
+}
+
+/*
+ *  chg_ipmã§æå¹ãªå²è¾¼ã¿åªå
+åº¦ã®ç¯å²ã®å¤å®
+ *
+ *  TMIN_INTPRIã®å¤ã«ãããï¼chg_ipmã§ã¯ï¼-(1 << TBITW_IPRI)ãTIPM_ENAALLï¼ï¼0ï¼
+ *  ã®ç¯å²ã«è¨­å®ã§ãããã¨ã¨ããï¼ã¿ã¼ã²ããå®ç¾©ã®æ¡å¼µï¼ï¼
+ *  å²è¾¼ã¿åªå
+åº¦ã®ãããå¹
+(TBITW_IPRI)ã 8 ã®å ´åã¯ï¼-256 ã 0 ãæå®å¯è½ã§ããï¼
+ *   
+ */
+#define VALID_INTPRI_CHGIPM(intpri) \
+				((-((1 << TBITW_IPRI) - 1) <= (intpri) && (intpri) <= TIPM_ENAALL))
+
+/*
+ * ï¼ã¢ãã«ä¸ã®ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®è¨­å®
+ *
+ *  CPUã­ãã¯ãã©ã°ãã¯ãªã¢ããã¦ããæã¯ï¼ãã¼ãã¦ã§ã¢ã®å²è¾¼ã¿åªå
+åº¦ã
+ *  ã¹ã¯ãè¨­å®ããï¼CPUã­ãã¯ãã©ã°ãã»ããããã¦ããæã¯ï¼saved_iipm
+ *  ãè¨­å®ãï¼ããã«ï¼ãã¼ãã¦ã§ã¢ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãï¼è¨­å®ãããã¨
+ *  ããï¼ã¢ãã«ä¸ã®ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¨TIPM_LOCKã®é«ãæ¹ã«è¨­å®ããï¼
+ */
+Inline void
+t_set_ipm(PRI intpri)
+{
+	uint8_t   iipm = INT_IPM(intpri);
+
+	if (intpri == TIPM_ENAALL){
+		iipm = IIPM_ENAALL;
+	}
+
+	if (!lock_flag) {
+		set_basepri(iipm);
+	}
+	else {
+		saved_iipm = iipm;
+		/*
+		 *  BASEPRIã¬ã¸ã¹ã¿ã¯å¤ãå°ããã»ã©åªå
+åº¦ãé«ããï¼IIPM_ENAALL ã
+		 *  '0'ã§ããããï¼åç´ã«åªå
+åº¦æ¯è¼ã ãã§ã¯ä¸ååã§ããï¼
+		 */
+		if ((iipm < IIPM_LOCK ) && (IIPM_ENAALL != iipm)) {
+			set_basepri(iipm);
+		}
+		else {
+			set_basepri(IIPM_LOCK);
+		}
+	}
+    SCS_SYNC;
+}
+
+/*
+ * ï¼ã¢ãã«ä¸ã®ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®åç
+§
+ *
+ *  CPUã­ãã¯ãã©ã°ãã¯ãªã¢ããã¦ããæã¯ãã¼ãã¦ã§ã¢ã®å²è¾¼ã¿åªå
+åº¦ã
+ *  ã¹ã¯ãï¼ã»ããããã¦ããæã¯saved_iipmãåç
+§ããï¼
+ */
+Inline PRI
+t_get_ipm(void)
+{
+	uint8_t iipm;
+
+	if (!lock_flag) {
+		iipm = get_basepri();
+	}
+	else {
+		iipm = saved_iipm;
+	}
+
+	if (iipm == IIPM_ENAALL) {
+		return(TIPM_ENAALL);
+	}
+	else {
+		return(EXT_IPM(iipm));
+	}
+}
+
+#define lock_cpu_dsp lock_cpu
+#define unlock_cpu_dsp unlock_cpu
+
+/*
+ *  ã¹ã¿ã¼ãã¢ããã«ã¼ãã³ï¼start.Sï¼
+ */
+extern void _start(void);
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã¸ã®ãã£ã¹ãããï¼core_support.Sï¼
+ *
+ *  dispatchã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºããããµã¼ãã¹ã³ã¼ã«å¦çã
+ *  ãå¼ã³åºãã¹ããã®ã§ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»ãã£ã¹ãã
+ *  ãè¨±å¯ç¶æ
+ã»ï¼ã¢ãã«ä¸ã®ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§å¼ã³åºããª
+ *  ããã°ãªããªãï¼
+ */
+extern void _dispatch(void);
+
+Inline void
+dispatch(void)
+{
+    /*
+     * issue PendSV
+     * ICSR.PENDSVSET([28]) = 1
+     */
+    sil_orw((void *)0xE000ED04, (uint32_t)(0x10000000U));
+    unlock_cpu();
+    /* ããã§ _dispatchã¸ã¸ã£ã³ã */
+    SCS_SYNC;
+    lock_cpu();
+}
+
+Inline void
+request_dispatch(void)
+{
+    /*
+     * issue PendSV
+     * ICSR.PENDSVSET([28]) = 1
+     */
+    sil_orw((void *)0xE000ED04, (uint32_t)(0x10000000U));
+    /* ããã§ã¯å¿
+ããã£ã¹ãããã£ã¸ã¸ã£ã³ãããªãããï¼CPUã­ãã¯è§£é¤ããªã */
+}
+
+/*
+ *  ãã£ã¹ãããã£ã®åä½éå§ï¼core_support.Sï¼
+ *
+ *  start_dispatchã¯ï¼ã«ã¼ãã«èµ·åæã«å¼ã³åºãã¹ããã®ã§ï¼ãã¹ã¦ã®å²è¾¼
+ *  ã¿ãç¦æ­¢ããç¶æ
+ï¼å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨åç­ã®ç¶æ
+ï¼ã§å¼ã³åºããªããã°
+ *  ãªããªãï¼
+ */
+extern void start_dispatch(void) NoReturn;
+
+/*
+ *  ç¾å¨ã®ã³ã³ãã­ã¹ããæ¨ã¦ã¦ãã£ã¹ãããï¼core_support.Sï¼
+ *
+ *  exit_and_dispatchã¯ï¼ext_tskããå¼ã³åºãã¹ããã®ã§ï¼ã¿ã¹ã¯ã³ã³ãã­
+ *  ã¹ãã»CPUã­ãã¯ç¶æ
+ã»ãã£ã¹ãããè¨±å¯ç¶æ
+ã»ï¼ã¢ãã«ä¸ã®ï¼å²è¾¼ã¿åªå
+
+ *  åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§å¼ã³åºããªããã°ãªããªãï¼
+ */
+extern void exit_and_dispatch(void) NoReturn;
+extern void _exit_and_dispatch(void) NoReturn;
+
+/*
+ *  ã«ã¼ãã«ã®çµäºå¦çã®å¼åºãï¼core_support.Sï¼
+ *
+ *  call_exit_kernelã¯ï¼ã«ã¼ãã«ã®çµäºæã«å¼ã³åºãã¹ããã®ã§ï¼éã¿ã¹ã¯
+ *  ã³ã³ãã­ã¹ãã«åãæãã¦ï¼ã«ã¼ãã«ã®çµäºå¦çï¼exit_kernelï¼ãå¼ã³åº
+ *  ãï¼
+ */
+extern void call_exit_kernel(void) NoReturn;
+
+/*
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãã®åæå
+ *
+ *  ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã«ç§»è¡ããæã«å¼ã°ããï¼ãã®æç¹
+ *  ã§ã¹ã¿ãã¯é åãä½¿ã£ã¦ã¯ãªããªãï¼
+ *
+ *  activate_contextãï¼ã¤ã³ã©ã¤ã³é¢æ°ã§ã¯ãªããã¯ã­å®ç¾©ã¨ãã¦ããã®ã¯ï¼
+ *  ãã®æç¹ã§ã¯TCBãå®ç¾©ããã¦ããªãããã§ããï¼
+ */
+extern ER    ext_tsk(void);
+#define activate_context(p_tcb)                                         \
+{\
+	(p_tcb)->tskctxb.sp = (p_tcb)->p_tinib->tskinictxb.stk_bottom;	\
+    *(--((p_tcb)->tskctxb.sp)) = (uint32_t)EPSR_T; \
+    *(--((p_tcb)->tskctxb.sp)) = (uint32_t)(p_tcb)->p_tinib->task; \
+    *(--((p_tcb)->tskctxb.sp)) = (uint32_t)ext_tsk; \
+    (p_tcb)->tskctxb.sp -= 4; \
+    *(--((p_tcb)->tskctxb.sp)) = (uint32_t)(p_tcb)->p_tinib->exinf; \
+    (p_tcb)->tskctxb.sp -= 8; \
+	(p_tcb)->tskctxb.pc = (intptr_t)0xfffffffdU;	\
+}
+
+/*
+ *  å²è¾¼ã¿çªå·ã»å²è¾¼ã¿ãã³ãã©çªå·
+ *
+ *  å²è¾¼ã¿ãã³ãã©çªå·(inhno)ã¨å²è¾¼ã¿çªå·(intno)ã¯ï¼å²ãè¾¼ã¿çºçæã«
+ *  EPSRã«è¨­å®ãããä¾å¤çªå·ã¨ããï¼ 
+ */
+
+/*
+ *  å²è¾¼ã¿çªå·ã®ç¯å²ã®å¤å®
+ */
+#define VALID_INTNO(intno)           ((TMIN_INTNO <= (intno)) && ((intno) <= TMAX_INTNO))
+#define VALID_INTNO_DISINT(intno)    VALID_INTNO(intno)
+#define VALID_INTNO_CFGINT(intno)    VALID_INTNO(intno)
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©ã®è¨­å®
+ *
+ *  ãã¯ãã«çªå·inhnoã®å²è¾¼ã¿ãã³ãã©ã®èµ·åçªå°int_entryã«è¨­å®ããï¼å²è¾¼ã¿
+ *  ãã³ãã©ãã¼ãã«
+ */
+Inline void
+define_inh(INHNO inhno, FP int_entry)
+{
+
+}
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦çã®çæãã¯ã­
+ *
+ */
+#define INT_ENTRY(inhno, inthdr)    inthdr
+#define INTHDR_ENTRY(inhno, inhno_num, inthdr) extern void inthdr(void);
+
+/*
+ *  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°
+ */
+
+/*
+ *  å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããããå¤å¥ããããã®å¤æ°ï¼kernel_cfg.cï¼
+ */
+extern const uint32_t	bitpat_cfgint[];
+
+/*
+ *  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ã»ãã
+ *
+ *  å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªãå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦å²è¾¼ã¿è¦æ±ç¦æ­¢
+ *  ãã©ã°ãã¯ãªã¢ãããã¨ããå ´åã«ã¯ï¼falseãè¿ãï¼  
+ */
+Inline bool_t
+disable_int(INTNO intno)
+{
+	uint32_t tmp;
+
+	/*
+	 *  å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªãå ´å
+	 */
+	if ((bitpat_cfgint[intno >> 5] & (1 << (intno & 0x1f))) == 0x00) {
+		return(false);
+	}
+
+	if (intno == IRQNO_SYSTICK) {
+		tmp = sil_rew_mem((void *)SYSTIC_CONTROL_STATUS);
+		tmp &= ~SYSTIC_TICINT;
+		sil_wrw_mem((void *)SYSTIC_CONTROL_STATUS, tmp);
+	}else {
+		tmp = intno - 16;
+		sil_wrw_mem((void *)((uint32_t *)NVIC_CLRENA0 + (tmp >> 5)),
+					(1 << (tmp & 0x1f)));
+	}
+    SCS_SYNC;
+
+	return(true);
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®è§£é¤
+ *
+ *  å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªãå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦å²è¾¼ã¿è¦æ±ç¦æ­¢
+ *  ãã©ã°ãã¯ãªã¢ãããã¨ããå ´åã«ã¯ï¼falseãè¿ãï¼
+ */
+Inline bool_t
+enable_int(INTNO intno)
+{
+	uint32_t tmp;
+
+	/*
+	 *  å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªãå ´å
+	 */
+	if ((bitpat_cfgint[intno >> 5] & (1 << (intno & 0x1f))) == 0x00) {
+		return(false);
+	}
+
+	if (intno == IRQNO_SYSTICK) {
+		tmp = sil_rew_mem((void *)SYSTIC_CONTROL_STATUS);
+		tmp |= SYSTIC_TICINT;
+		sil_wrw_mem((void *)SYSTIC_CONTROL_STATUS, tmp);
+	}else {
+		tmp = intno - 16;
+		sil_wrw_mem((void *)((uint32_t *)NVIC_SETENA0 + (tmp >> 5)),
+					(1 << (tmp & 0x1f)));
+	}
+    
+	return(true);
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ã®è¨­å®
+ */
+extern void config_int(INTNO intno, ATR intatr, PRI intpri);
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©å
+¥å£ã§å¿
+è¦ãªIRCæä½
+ */
+Inline void
+i_begin_int(INTNO intno)
+{
+}
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©ã®åºå£ã§å¿
+è¦ãªIRCæä½
+ */
+Inline void
+i_end_int(INTNO intno)
+{
+}
+
+/*
+ *  CPUä¾å¤ãã³ãã©é¢ä¿
+ */ 
+
+/*
+ *  CPUä¾å¤ãã³ãã©çªå·
+ */
+#define VALID_EXCNO_DEFEXC(excno)    (TMIN_EXCNO <= (excno) && (excno) <= TMAX_EXCNO)
+
+/*
+ *  CPUä¾å¤ãã³ãã©ã®è¨±å¯
+ */
+extern void enable_exc(EXCNO excno);
+
+/*
+ *  CPUä¾å¤ãã³ãã©ã®ç¦æ­¢
+ */
+extern void disable_exc(EXCNO excno);
+
+/*
+ *  CPUä¾å¤ãã³ãã©ã®è¨­å®
+ */
+Inline void
+define_exc(EXCNO excno, FP exc_entry)
+{
+	/*
+	 *  ä¸é¨ã®ä¾å¤ã¯è¨±å¯ãè¡ãå¿
+è¦ããã
+	 */
+	enable_exc(excno);
+}
+
+/*
+ *  CPUä¾å¤ãã³ãã©ã®å
+¥å£å¦çã®çæãã¯ã­
+ */
+#define EXC_ENTRY(excno, exchdr)    exchdr
+#define EXCHDR_ENTRY(excno, excno_num, exchdr) extern void exchdr(void *p_excinf);
+
+/*
+ *  CPUä¾å¤ã®çºçããæã®ã³ã³ãã­ã¹ãã®åç
+§
+ *
+ *  CPUä¾å¤ã®çºçããæã®ã³ã³ãã­ã¹ããï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã®æã«falseï¼
+ *  ããã§ãªãæã«trueãè¿ãï¼
+ */
+Inline bool_t
+exc_sense_context(void *p_excinf)
+{
+	uint32_t exc_return;
+
+	exc_return = *((uint32_t *)p_excinf + P_EXCINF_OFFSET_EXC_RETURN);
+	if ((exc_return & EXC_RETURN_PSP) == EXC_RETURN_PSP){
+		return false;
+	}
+	else {
+		return true;
+	}
+}
+
+/*
+ *  CPUä¾å¤ã®çºçããæã®IPMï¼ãã¼ãã¦ã§ã¢ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼å
+é¨è¡¨
+ *  ç¾ï¼ã®åç
+§
+ */
+Inline uint32_t
+exc_get_iipm(void *p_excinf)
+{
+	return(*((uint32_t *)p_excinf + P_EXCINF_OFFSET_BASEPRI));
+}
+
+/*
+ *  CPUä¾å¤ã®çºçããæã®ã³ã³ãã­ã¹ãã¨å²è¾¼ã¿ã®ãã¹ã¯ç¶æ
+ã®åç
+§
+ *
+ *  CPUä¾å¤ã®çºçããæã®ã·ã¹ãã ç¶æ
+ãï¼ã«ã¼ãã«å®è¡ä¸­ã§ãªãï¼ã¿ã¹ã¯ã³
+ *  ã³ãã­ã¹ãã§ããï¼å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§ãªãï¼CPUã­ãã¯ç¶æ
+ã§ãªãï¼ï¼ã¢
+ *  ãã«ä¸ã®ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§ããæã«trueï¼ããã§ãªãæ
+ *  ã«falseãè¿ãï¼CPUä¾å¤ãã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿å¦çä¸­ã§çºçããå ´å
+ *  ã«ãfalseãè¿ãï¼ï¼
+ *
+ *  PUä¾å¤ã®çºçããæã®BASEPRIï¼ãã¼ãã¦ã§ã¢ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼
+ *  ããã¹ã¦ã®å²è¾¼ã¿ãè¨±å¯ããç¶æ
+ã§ãããã¨ããã§ãã¯ãããã¨ã§ï¼ã«ã¼
+ *  ãã«å®è¡ä¸­ã§ãªããã¨ï¼å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§ãªããã¨ï¼CPUã­ãã¯ç¶æ
+ã§ãª
+ *  ããã¨ï¼ï¼ã¢ãã«ä¸ã®ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§ãããã¨ã®4ã¤ã®
+ *  æ¡ä»¶ããã§ãã¯ãããã¨ãã§ããï¼CPUä¾å¤ãçºçããæã®lock_flagãå
+ *  ç
+§ããå¿
+è¦ã¯ãªãï¼ï¼
+ */
+Inline bool_t
+exc_sense_intmask(void *p_excinf)
+{
+	return(!exc_sense_context(p_excinf)
+		   && (exc_get_iipm(p_excinf) == IIPM_ENAALL));
+}
+
+/*
+ *  CPUä¾å¤ã¨ã³ããªï¼core_support.Sï¼
+ */
+extern void core_exc_entry(void);
+
+/*
+ *  å²è¾¼ã¿ã¨ã³ããªï¼core_support.Sï¼
+ */
+extern void core_int_entry(void);
+
+/*
+ *  ãã£ã¹ãããã£ï¼core_support.Sï¼
+ */
+extern void dispatcher(void);
+
+/*
+ *  ãã­ã»ããµä¾å­ã®åæå
+ */
+extern void core_initialize(void);
+
+/*
+ *  ãã­ã»ããµä¾å­ã®çµäºæå¦ç
+ */
+extern void core_terminate(void);
+
+/*
+ * ç»é²ããã¦ããªãä¾å¤ãçºçããã¨å¼ã³åºããã
+ */
+extern void default_exc_handler(void *p_excinf);
+
+/*
+ * æªç»é²ã®å²è¾¼ã¿ãçºçããå ´åã«å¼ã³åºããã
+ */
+extern void default_int_handler(void *p_excinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_CORE_KERNEL_IMPL_H */
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 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_offset.tf	(revision 302)
@@ -0,0 +1,74 @@
+$ ======================================================================
+$ 
+$   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ç¨ï¼
+$
+
+$
+$  ãªãã»ããå¤ã®ãã¯ã­å®ç¾©ã®çæ
+$
+$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_rename.def
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_rename.def	(revision 302)
@@ -0,0 +1,31 @@
+# core_kernel_impl.c
+exc_tbl
+vector_table
+lock_flag
+saved_iipm
+default_exc_handler
+default_int_handler
+config_int
+core_initialize
+core_terminate
+bitpat_cfgint
+set_exc_int_priority
+enable_exc
+disable_exc
+
+# core_support.S
+core_int_entry
+core_exc_entry
+ret_int
+ret_int_r
+ret_exc
+svc_handler
+svc_vector_tbl
+start_r
+dispatcher
+dispatch
+dispatch_r
+start_dispatch
+exit_and_dispatch
+call_exit_kernel
+
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 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_rename.h	(revision 302)
@@ -0,0 +1,83 @@
+/* This file is generated from core_rename.def by genrename. */
+
+#ifndef TOPPERS_CORE_RENAME_H
+#define TOPPERS_CORE_RENAME_H
+
+/*
+ *  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
+
+
+#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_sil.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_sil.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_sil.h	(revision 302)
@@ -0,0 +1,104 @@
+/*
+ *  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_sil.h 322 2015-04-30 13:23:48Z ertl-ishikawa $
+ */
+
+/*
+ *   sil.hã®ã³ã¢ä¾å­é¨ï¼ARM-Mç¨ï¼
+ */
+#ifndef TOPPERS_CORE_SIL_H
+#define TOPPERS_CORE_SIL_H
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  NMIãé¤ããã¹ã¦ã®å²è¾¼ã¿ã®ç¦æ­¢
+ */
+Inline bool_t
+TOPPERS_disint(void)
+{
+	uint32_t val;
+
+	Asm("mrs  %0, PRIMASK" : "=r"(val));
+	Asm("cpsid i":::"memory");
+
+	if (val == 1) {
+		return (true);
+	}
+	else {
+		return (false);
+	}
+}
+
+Inline void
+TOPPERS_enaint(bool_t locked)
+{
+	if (!locked) {
+	  Asm("cpsie i":::"memory");
+	}
+}
+
+/*
+ *  å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®å¶å¾¡
+ */
+#define SIL_PRE_LOC      bool_t  TOPPERS_locked
+#define SIL_LOC_INT()    ((void)(TOPPERS_locked = TOPPERS_disint()))
+#define SIL_UNL_INT()    (TOPPERS_enaint(TOPPERS_locked))
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+#endif /* TOPPERS_CORE_SIL_H */
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_stddef.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_stddef.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_stddef.h	(revision 302)
@@ -0,0 +1,82 @@
+/*
+ *  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_stddef.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *  t_stddef.hã®ã³ã¢ä¾å­é¨ï¼ARM-Mç¨ï¼
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼target_stddef.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯
+ *  ã«ã¼ãããããã¡ã¤ã«ï¼ã®ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ãã
+ *  ç´æ¥ã¤ã³ã¯ã«ã¼ããã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_CORE_STDDEF_H
+#define TOPPERS_CORE_STDDEF_H
+
+/*
+ *  ã¿ã¼ã²ãããè­å¥ããããã®ãã¯ã­ã®å®ç¾©
+ */
+#define TOPPERS_ARM_M           /* ã³ã¢ç¥ç§° */
+
+/*
+ *  ã¹ã¿ãã¯ã®å
+ *  ARMã§ã¯ï¼ã¹ã¿ãã¯ã8byteå¢çã«é
+ç½®ããå¿
+è¦ããã
+ */
+#define TOPPERS_STK_T  long long
+
+#endif /* TOPPERS_CORE_STDDEF_H */
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_support.S
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_support.S	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_support.S	(revision 302)
@@ -0,0 +1,782 @@
+/*
+ *  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_support.S 323 2015-05-28 08:48:22Z ertl-ishikawa $
+ */
+
+/*
+ *  ãã­ã»ããµä¾å­ã¢ã¸ã¥ã¼ã« ã¢ã»ã³ããªè¨èªé¨ï¼ARM-Mç¨ï¼
+ */
+
+#define TOPPERS_MACRO_ONLY
+#define UINT_C(val)		(val)		/* uint_tåã®å®æ°ãä½ããã¯ã­ */
+#define ULONG_C(val)	(val)		/* ulong_tåã®å®æ°ãä½ããã¯ã­ */
+#define CAST(type, val)	(val)		/* åã­ã£ã¹ããè¡ããã¯ã­ */
+
+#include "kernel_impl.h"
+#include "arm_m.h"
+#include "offset.h"
+#include "target_asm.inc"
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããã£
+ */
+	ATEXT
+	AALIGN(2)
+	ATHUMB(_dispatch)
+	AGLOBAL(_dispatch)
+ALABEL(_dispatch)
+#ifdef TOPPERS_SUPPORT_OVRHDR
+    push    {lr}
+    bl      ovrtimer_stop
+    pop     {lr}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	/*
+	 *
+	 *  ãã®ã«ã¼ãã³ã¯ï¼PendSVã«ãã£ã¦å¼ã³åºããã
+     *  * Handler mode
+     *  * use msp
+     *  * lr = EXC_RETURN
+     *  * scratch registers -> psp
+     *  * CONTROL.FPCA -> EXC_RETURN && CONTROL.FPCA == 0
+	 */
+    cpsid   f                   /* FAULTMASK = 1 */
+    mrs     r3, psp 
+	stmfd   r3!, {r4-r11}         /* ã¬ã¸ã¹ã¿ã®ä¿å­ */
+#ifdef __TARGET_FPU_VFPUV4_D16
+    /*
+     * å¼åºãå
+ã³ã³ãã­ã¹ãã§æµ®åå°æ°ç¹æ¼ç®ããããï¼
+     *  EXC_RETURN[4]ããã§ãã¯
+     */
+    tst     lr, #0x10
+    /*  EXC_RETURN[4] == 1ãªãã°ã¹ã­ãã */
+    bne     _dispatch_1
+	vstmdb  r3!, {s16-s31}         /* ã¬ã¸ã¹ã¿ã®ä¿å­ */
+    /*fpscrã¯ä¾å¤ãã¬ã¼ã ã«ä¿å­æ¸ã¿*/
+ALABEL(_dispatch_1)
+#endif /* __TARGET_FPU_VFPUV4_D16 */
+	ldr   r1, =p_runtsk           /* p_runtskãèª­ã¿è¾¼ã */
+	ldr   r1, [r1]
+	str   r3, [r1,#TCB_sp]        /* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãä¿å­ */
+	str   lr, [r1,#TCB_pc]        
+    b     dispatcher
+
+/*
+ *  CPUä¾å¤ã¨ã³ããª
+ *
+ *  å²è¾¼ã¿ã¨ã³ããªã¨å¦çã®å
+å®¹ã¯åç­ã ãï¼ã­ã°ã®ç¨®é¡ãç°ãªãããï¼
+ *  åãã¦ããï¼
+ */
+	AALIGN(2)
+	ATEXT
+	ATHUMB(core_exc_entry)
+	AGLOBAL(core_exc_entry)
+ALABEL(core_exc_entry)
+	/*
+	 *  ä¾å¤/å²è¾¼ã¿ãçºçããã¨ï¼çºçæã«ã¢ã¯ãã£ããªã¹ã¿ãã¯ã«ã¹ã¯ã©
+	 *  ããã¬ã¸ã¹ã¿ç­ãä¿å­ãããï¼
+	 *  ãã®å
+å®¹ã«å ãã¦ï¼CPUä¾å¤ãã³ãã©ã¸ã®æ
+å ±ã¨ãã¦ï¼basepri ã®å¤ã¨ï¼
+	 *  EXC_RETURNã®æ
+å ±ãå ãã¦ä¿å­ããï¼basepriã®å¤ã¯ï¼CPUä¾å¤ããã®
+	 *  ãªã¿ã¼ã³æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®å¤ãå
+ã«æ»ãããã«ãç¨ããããï¼
+	 *
+	 *   -----------
+	 *  | EXC_RETURN|  
+	 *   -----------
+	 *  |  basepri  |  
+	 *   -----------
+	 *  |    R0     |  
+	 *   -----------
+	 *  |    R1     |
+	 *   -----------
+	 *  |    R2     |
+	 *   -----------
+	 *  |    R3     |
+	 *   -----------
+	 *  |    R12    |
+	 *   -----------
+	 *  |    LR     |
+	 *   -----------
+	 *  |    PC     |
+	 *   -----------
+	 *  |   xPSR    |
+	 *   -----------
+	 *
+	 */
+
+	/*
+	 *  ã«ã¼ãã«ç®¡çå¤ã®ä¾å¤ããã§ãã¯
+	 *  ã«ã¼ãã«å
+ã®ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®å®è¡ä¸­ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ï¼
+	 *  CPUã­ãã¯ç¶æ
+ï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©å®è¡ä¸­ã®ããããã§
+	 *  çºçããCPUä¾å¤ãï¼ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã¨å¼ã¶
+	 *  å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¯FAULTMASKã'1'ã®å ´å
+	 *  CPUã­ãã¯ç¶æ
+ã¯basepriãIIPM_LOCKãã§å¤æ­ããï¼
+	 */
+	mrs   r2, FAULTMASK           /* å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ãªãã«ã¼ãã«ç®¡çå¤ä¾å¤å¦çã¸ */
+	cbnz  r2, core_nonkernel_exc_entry
+
+	mrs   r2, basepri             /* baepriã®å¤ãåå¾ */
+	cmp   r2, #IIPM_LOCK          /* CPUã­ãã¯ç¶æ
+ãªãã«ã¼ãã«ç®¡çå¤ä¾å¤å¦çã¸ */
+	beq   core_nonkernel_exc_entry
+
+
+	/*
+	 * ã¹ã¿ãã¯ãå¤æ´ããå¿
+è¦ãããããã§ãã¯
+	 * EXC_RETURNï¼å²è¾¼ã¿æã«LRã«è¨­å®ãããå¤ï¼ããã§ãã¯ãã¦ï¼ä¾å¤çºçæã«
+	 * ã¢ã¯ãã£ããªã¹ã¿ãã¯ãç¹å®ãããã¨ã§å¤éå²è¾¼ã¿ãå¤å®ããï¼
+	 */
+	tst   lr, #EXC_RETURN_PSP    /* å²è¾¼ã¿å
+ãMSPãªãå¤éå²è¾¼ã¿ */
+	beq   core_exc_entry_1       /* å¤éå²è¾¼ã¿ãªãcore_exc_entry_1ã¸ */
+	mrs   r0, psp                /* ä¸æ®µç®ã®å²è¾¼ã¿ã®å ´åã¯PSPä¸ã« */
+	stmfd r0!,{r2}               /* å²è¾¼ã¿çºçæã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãç©ã */
+	stmfd r0!,{lr}               /* EXC_RETURN ãç©ã             */
+	msr   psp, r0                /* CPUä¾å¤ãã³ãã©ã¸ã®å¼æ°ã¨ãªã */
+	push  {lr}                   /* MSPä¸ã«ãEXC_RETURN ãç©ã    */ 
+#ifdef TOPPERS_SUPPORT_OVRHDR
+    push    {r0}
+    bl      ovrtimer_stop
+    pop     {r0}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	b     core_exc_entry_2
+ALABEL(core_exc_entry_1)         /* å¤éå²è¾¼ã¿ã®å ´å */
+	push  {r2}                   /* å²è¾¼ã¿çºçæã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãç©ã */
+	push  {lr}                   /* EXC_RETURN ãç©ã             */ 
+	mov   r0, sp                 /* CPUä¾å¤ãã³ãã©ã¸ã®å¼æ°ã¨ãªã */
+
+	/*
+	 *  å
+±éå¦ç
+	 */
+ALABEL(core_exc_entry_2)
+	mrs   r3, ipsr               /* ãã³ãã©ã¢ãã¬ã¹ãåå¾ */
+ALABEL(core_exc_entry_3)
+	ldr   r1, =_kernel_exc_tbl
+	ldr   r2, [r1, r3, lsl #2]
+
+#ifdef LOG_EXC_ENTER
+	push  {r0,r2,r3}
+	mov   r0, r3                 /* ä¾å¤çªå·ããã©ã¡ã¼ã¿ã«  */
+	bl    log_exc_enter          /* log_exc_enterãå¼ã³åºã */
+	pop   {r0,r2,r3}
+	push  {r3}                   /* ä¾å¤çªå·ãã¹ã¿ãã¯ã¸    */
+#endif /* LOG_EXC_ENTER */
+
+	/*
+	 *  CPUä¾å¤ãã³ãã©ã®å¼ã³åºã
+	 */
+	blx   r2
+
+#ifdef LOG_EXC_ENTER
+	pop   {r0}                   /* ä¾å¤çªå·ãå¼æ°ã«        */
+	bl    log_exc_leave          /* log_exc_leaveãå¼ã³åºã */
+#endif /* LOG_EXC_ENTER */
+
+	b     ret_exc
+
+/*
+ *  ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã®åºå
+¥å£å¦ç
+ */
+ALABEL(core_nonkernel_exc_entry)
+	tst   lr, #EXC_RETURN_PSP    /* å²è¾¼ã¿å
+ãMSPãªãå¤éå²è¾¼ã¿ */
+	beq   core_nonkernel_exc_entry_1  /* å¤éå²è¾¼ã¿ãªã */
+	mrs   r0, psp                /* ä¸æ®µç®ã®å²è¾¼ã¿ã®å ´åã¯PSPä¸ã« */
+	stmfd r0!,{r2}               /* å²è¾¼ã¿çºçæã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãç©ã */
+	stmfd r0!,{lr}               /* EXC_RETURN ãç©ã             */
+	msr   psp, r0                /* CPUä¾å¤ãã³ãã©ã¸ã®å¼æ°ã¨ãªã */
+	push  {lr}                   /* MSPä¸ã«ãEXC_RETURN ãç©ã    */ 
+	b     core_nonkernel_exc_entry_2
+ALABEL(core_nonkernel_exc_entry_1) /* å¤éå²è¾¼ã¿ã®å ´å */
+	push  {r2}                   /* å²è¾¼ã¿çºçæã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãç©ã */
+	push  {lr}                   /* EXC_RETURN ãç©ã             */ 
+	mov   r0, sp                 /* CPUä¾å¤ãã³ãã©ã¸ã®å¼æ°ã¨ãªã */
+
+ALABEL(core_nonkernel_exc_entry_2)
+	mrs   r3, ipsr               /* CPUä¾å¤ãã³ãã©ã®ã¢ãã¬ã¹ãåå¾ */
+	ldr   r1, =_kernel_exc_tbl
+	ldr   r2, [r1, r3, lsl #2]
+
+	/*
+	 *  CPUä¾å¤ãã³ãã©ã®å¼ã³åºã
+	 */
+	blx   r2
+
+	/*
+	 *  å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨ããï¼
+	 */
+	cpsid f
+
+	/*
+	 *  æ»ãå
+ã®ã³ã³ãã­ã¹ãã®å¤å®
+	 * 
+	 *  å²è¾¼ã¿ãã³ãã©å®è¡ã«LRã«ã»ãããããEXC_RETURNããã§ãã¯ãã¦ï¼æ»ã
+	 *  å
+ã§MSPãä½¿ããã¦ããã°ï¼å²è¾¼ã¿å
+ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãã¨å¤å®ããï¼
+	 */
+	pop   {r3}                     /* lrãã¹ã¿ãã¯ããåå¾         */
+	tst   r3, #EXC_RETURN_PSP      /* æ»ãå
+ãPSPãªã              */
+	bne   core_nonkernel_ret_exc_1
+	pop   {r1}                     /* å
+ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯(basepri) */
+	b     core_nonkernel_ret_exc_2 /* ã®å¤ãMSPããåå¾ */
+
+ALABEL(core_nonkernel_ret_exc_1)
+	/*
+	 *  PSPä¸ããEXC_RETURNãåé¤
+	 */
+	mrs   r2, psp
+	add   r2, r2, #4
+	/*
+	 *  å
+ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯(basepri)ã®å¤ãPSPããåå¾
+	 */
+	ldmfd r2!, {r1} 
+	msr   psp, r2
+
+ALABEL(core_nonkernel_ret_exc_2)
+	msr   basepri, r1             /* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå²è¾¼ã¿åã«ç¶æ
+ã¸ */
+	bx    r3                      /* ãªã¿ã¼ã³ */
+
+/*
+ *  å²è¾¼ã¿ã¨ã³ããª
+ */
+	ATHUMB(core_int_entry)
+	AGLOBAL(core_int_entry)
+ALABEL(core_int_entry)
+	/*
+	 *  å²è¾¼ã¿çºçæã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãã¹ã¿ãã¯ã«ä¿å­ããããåå¾
+	 */
+	mrs   r2, basepri             /* baepriã®å¤ãåå¾ */
+
+	/*
+	 * å¤éå²è¾¼ã¿ããã§ãã¯
+	 * EXC_RETURNï¼å²è¾¼ã¿æã«LRã«è¨­å®ãããå¤ï¼ããã§ãã¯ãã¦ï¼ä¾å¤çºçæã«
+	 * ã¢ã¯ãã£ããªã¹ã¿ãã¯ãç¹å®ãããã¨ã§å¤éå²è¾¼ã¿ãå¤å®ããï¼
+	 */
+	tst   lr, #EXC_RETURN_PSP    /* å²è¾¼ã¿å
+ãMSPãªãå¤éå²è¾¼ã¿ */
+	beq   core_int_entry_1       /* å¤éå²è¾¼ã¿ãªãcore_int_entry_1ã¸ */
+	mrs   r0, psp                /* ä¸æ®µç®ã®å²è¾¼ã¿ã®å ´åã¯PSPä¸ã« */
+	stmfd r0!,{r2}               /* å²è¾¼ã¿çºçæã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãç©ã */
+	stmfd r0!,{lr}               /* EXC_RETURN ãç©ã             */
+	msr   psp, r0                /* CPUä¾å¤ãã³ãã©ã¸ã®å¼æ°ã¨ãªã */
+	push  {lr}                   /* MSPä¸ã«ãEXC_RETURN ãç©ã    */ 
+#ifdef TOPPERS_SUPPORT_OVRHDR
+    push    {r0}
+    bl      ovrtimer_stop
+    pop     {r0}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	b     core_int_entry_2
+ALABEL(core_int_entry_1)         /* å¤éå²è¾¼ã¿ã®å ´å */
+	push  {r2}                   /* å²è¾¼ã¿çºçæã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãç©ã */
+	push  {lr}                   /* EXC_RETURN ãç©ã             */ 
+	mov   r0, sp                 /* æªå®ç¾©ã®å²è¾¼ã¿ãçºçããå ´åã®æ
+å ±ã¨ãã */
+
+	/*
+	 *  å
+±éå¦ç
+	 */
+ALABEL(core_int_entry_2)
+	mrs   r3, ipsr               /* ãã³ãã©ã¢ãã¬ã¹ãåå¾ */
+	ldr   r1, =_kernel_exc_tbl
+	ldr   r2, [r1, r3, lsl #2]
+
+	/*
+	 *  basepriã®è¨­å®
+	 *  NVICåªå
+åº¦ãã¹ã¯ãèªåçã«è¨­å®ãããããåªå
+åº¦ãã¹ã¯ã®ç¹ã§ã¯å¿
+è¦ãª
+	 *  ããï¼x_get_ipm()ãbasepriãåç
+§ããããï¼basepriãæ´æ°ããï¼
+	 */
+	ldr   r1, =_kernel_int_iipm_tbl
+	ldr   lr, [r1, r3, lsl #2]
+	msr   basepri, lr
+    isb
+
+#ifdef LOG_INH_ENTER
+	push  {r0,r2,r3}
+	mov   r0, r3                 /* ä¾å¤çªå·ããã©ã¡ã¼ã¿ã«  */
+	bl    log_inh_enter          /* log_exc_enterãå¼ã³åºã */
+	pop   {r0,r2,r3}
+	push  {r3}                   /* ä¾å¤çªå·ãã¹ã¿ãã¯ã¸    */
+#endif /* LOG_EXC_ENTER */
+
+	/*
+	 *  å²è¾¼ã¿ãã³ãã©ã®å¼ã³åºã
+	 */
+	blx   r2
+
+#ifdef LOG_INH_LEAVE
+	pop   {r0}                   /* ä¾å¤çªå·ãå¼æ°ã«        */
+	bl    log_exc_leave          /* log_exc_leaveãå¼ã³åºã */
+#endif /* LOG_INH_LEAVE */
+
+/*
+ *  å²è¾¼ã¿/ä¾å¤åºå£
+ *
+ *  ret_exc/ret_intã¯ï¼CPUä¾å¤/å²è¾¼ã¿ãã³ãã©ããæ»ã£ãç´å¾ã«å®è¡ãã
+ *  ã«ã¼ãã³ã§ããï¼
+ */
+ALABEL(ret_exc)
+ALABEL(ret_int)
+	/*
+	 *  å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨ããï¼ãã®æç¹ã§ã¯ï¼CPUã­ãã¯ç¶æ
+ã«ã¯ãªããªã
+	 * ï¼basepriã¨lock_flagã¨saved_iipmã¯æ´æ°ããªãï¼ï¼
+	 *
+	 *  å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨ããã®ã¯ï¼æ»ãå
+ã®ã³ã³ãã­ã¹ãã®ãã§ãã¯ã¨ï¼
+	 *  æ»ãå
+ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãã§ãã£ãå ´åã®ãªã¿ã¼ã³ãã¢ãããã¯
+	 *  ã«è¡ãããã§ããï¼bsepriãCPUã­ãã¯ã®å¤ã«ãããã¨ã§ãã¢ããã
+	 *  ã¯ãªãã§ãã¯ã¨å¾©å¸°ã¯å¯è½ã§ãããï¼å²è¾¼ã¿ãããªã¿ã¼ã³ãã¦ãï¼
+	 *  basepri ã®è¨­å®å
+å®¹ã¯å
+ã«æ»ããªãããï¼ä½¿ç¨ãããã¨ãã§ããªãï¼ 
+	 *  ä¸æ¹ï¼FAULTMASKã¯ï¼å²è¾¼ã¿ããã®ãªã¿ã¼ã³å¦çã«ãã£ã¦ï¼'0'ã«ã¯ãª
+	 *  ã¢ãããï¼
+	 */
+	cpsid f
+
+	/*
+	 *  æ»ãå
+ã®ã³ã³ãã­ã¹ãã®å¤å®
+	 * 
+	 *  å²è¾¼ã¿ãã³ãã©å®è¡ã«LRã«ã»ãããããEXC_RETURNããã§ãã¯ãã¦ï¼æ»ã
+	 *  å
+ã§MSPãä½¿ããã¦ããã°ï¼å²è¾¼ã¿å
+ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãã¨å¤å®ããï¼
+	 */
+	pop   {r3}                     /* lrãã¹ã¿ãã¯ããåå¾         */
+	tst   r3, #EXC_RETURN_PSP      /* æ»ãå
+ãPSPãªã ret_int_1 ã¸ */
+	bne   ret_int_1
+	pop   {r1}                     /* å
+ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯(basepri)ãr1ã¸ */
+	b     ret_int_2                
+
+	/*
+	 *  ä¸æ®µç®ã®å²è¾¼ã¿ã®åºå£å¦ç
+	 */
+ALABEL(ret_int_1)
+	/*
+	 *  PSPä¸ããï¼EXC_RETURN(r0)ã¨å
+ã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯(basepri)(r1)
+	 *  ãåå¾
+	 */
+	mrs   r2, psp
+	ldmfd r2!, {r0,r1} 
+	msr   psp, r2
+
+    /*
+     *  å²è¾¼ã¿ãã³ãã©ã«ãããã£ã¹ãããè¦æ±ããã£ãå ´åã«ã¯ï¼
+     *  request_dispatchã«ãã£ã¦ï¼PendSVè¦æ±ãçºè¡ããã¦ããï¼
+     *  ãã®å ´åï¼ãã®ã¾ã¾å²è¾¼ã¿ãã³ãã©ãããªã¿ã¼ã³ããå¾ï¼
+     *  PendSVã®å²è¾¼ã¿ãå
+¥ãï¼ããã§ãã£ã¹ãããã£ãå®è¡ããã
+     *  ãã£ã¦ï¼ããã§ã¯ãã£ã¹ããããããã©ããã®ãã§ãã¯å¦çã¯
+     *  ä¸è¦ã§ãã
+     */
+
+#ifdef TOPPERS_SUPPORT_OVRHDR
+    push    {r1,r3}
+    bl      ovrtimer_start
+    pop     {r1,r3}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+ALABEL(ret_int_2)
+	/*
+	 *  ããã«ã¯å²è¾¼ã¿ã­ãã¯ç¶æ
+ï¼FAULTMASKãã»ããï¼ãããç¶æ
+ã§æ¥ãï¼
+	 *  Handlerã¢ã¼ãããã®ãªã¿ã¼ã³ã«ããèªåçã«å²è¾¼ã¿ã­ãã¯è§£é¤ç¶æ
+ã«ãªãï¼
+	 *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¯å²è¾¼ã¿åã«ç¶æ
+ã«æ»ãï¼
+	 */ 
+	msr   basepri, r1             /* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå²è¾¼ã¿åã®ç¶æ
+ã¸ */
+	bx    r3                      /* ãªã¿ã¼ã³ */
+
+/*
+ *  ãã£ã¹ãããã£ã®åä½éå§
+ */
+	ATHUMB(start_dispatch)
+	AGLOBAL(start_dispatch)
+ALABEL(start_dispatch)
+	/*
+	 *  ãã®ã«ã¼ãã³ã¯ï¼ã«ã¼ãã«èµ·åæã«ï¼ãã¹ã¦ã®å²è¾¼ã¿ãç¦æ­¢ããç¶æ
+
+	 * ï¼å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨åç­ï¼ã§å¼ã³åºãããï¼ã¾ãï¼å²è¾¼ã¿ã¢ã¼ãï¼é
+	 *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãã¨åç­ï¼ã§å¼ã³åºããããã¨ãæ³å®ãã¦ããï¼
+	 *
+	 *  core_initializeã§ï¼lock_flagãtrueã«ï¼saved_iipmãIIPM_ENAALLã«
+	 *  åæåãã¦ããããï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãè¨±å¯ãããã¨ã§ï¼
+	 *  CPUã­ãã¯ç¶æ
+ã»ï¼ã¢ãã«ä¸ã®ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã«ãªãï¼
+	 *  ã¾ãï¼task_initializeã§disdspãfalseã«åæåãã¦ããããï¼ãã£
+	 *  ã¹ãããè¨±å¯ç¶æ
+ã«ãªã£ã¦ããï¼
+	 */
+	ldr   r0,=istkpt              /* MSPãåæå   */
+	ldr   r1,[r0]                 /* start_dispatchå¼ã³åºãæã«å¼ã³åºãç¨ã« */
+	msr   msp, r1                 /* ä½¿ç¨ãã¦ããããåæåãã             */
+	/* 
+     * ã¹ã¿ãã¯ãIDã1ã®ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åã«åãæãã
+     */
+	mov   r0, #CONTROL_PSP        /* PSPãæå¹ã«  */
+	msr   control, r0
+	isb                           /* control ã®æä½å¾ã«å¿
+è¦ */
+    ldr   r1, =tinib_table
+    ldr   sp, [r1, #TINIB_stk_bottom]
+    /* 
+     * ID1ã®ã¿ã¹ã¯ããã§ã«activate_contextããã¦ããå ´åï¼
+     * ã¹ã¿ãã¯ã®å
+é ­ã«spãåæåãã¦ãã¾ãã¨ï¼svcã«ãã
+     * activate_contextã§æºåããå
+å®¹ãæ¶ããã¦ãã¾ãããï¼
+     * ãã®åãé£ã°ããã¢ãã¬ã¹ãï¼ã«ã¼ãã«åä½éå§æã®
+     * ã¹ã¿ãã¯å
+é ­ã¢ãã¬ã¹ã¨ãã
+     */
+    add   sp, sp, #(4*16)         
+	ldr   r1, =IIPM_LOCK          /* ã«ã¼ãã«ç®¡çå
+ã®å²è¾¼ã¿ãç¦æ­¢ */
+	msr   basepri, r1 
+    isb
+	cpsie f                       /* ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãè¨±å¯ */
+    /*
+     *  _exit_and_dispatchã§CPUã­ãã¯è§£é¤&FAULTMASK=1ããã¦ããã«ã
+     *  ãããããï¼ããã§CPUã­ãã¯&FAULTMASK=0ã¨ãã¦ããã®ã¯ï¼
+     *  ãã£ã¹ãããã£ãsvcçºè¡æã®ç¶æ
+ã§å¼ãã§ããï¼ãã¤ï¼
+     *  FAULTMASKç¶æ
+ã§svcãçºè¡ããã¨double faultã§ãªã»ãããããã
+     *  ããã§ãã
+     */
+
+	ATHUMB(exit_and_dispatch)
+	AGLOBAL(exit_and_dispatch)
+ALABEL(exit_and_dispatch)
+    /*
+     *  r3=pspã¯svcã®çºè¡å¾ã§ããããï¼ã¹ã¿ãã¯ä½¿ç¨éãå¤ããªãããï¼
+     *  svcåã®pspãr3ã«ä¿å­ãã¦ãã
+     */
+    svc    #NO_DISPATCHER
+
+/*
+ *  ç¾å¨ã®ã³ã³ãã­ã¹ããæ¨ã¦ã¦ãã£ã¹ããã
+ */
+	ATHUMB(_exit_and_dispatch)
+	AGLOBAL(_exit_and_dispatch)
+ALABEL(_exit_and_dispatch)
+	cpsid f                       /* FAULTMASK = 1 */
+	mov   r0, #0
+	ldr   r1, =lock_flag          /* CPUã­ãã¯è§£é¤ç¶æ
+ã¸ */
+	str   r0, [r1]
+	ldr   r1, =IIPM_ENAALL        /* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤ç¶æ
+ã«è¨­å® */
+	msr   basepri, r1             
+    mrs     r3, psp 
+	/* ãã£ã¹ãããã£æ¬ä½ï¼dispatcherï¼ã¸ */ 
+
+/*
+ *  ãã£ã¹ãããã£æ¬ä½
+ */
+	ATHUMB(dispatcher)
+	AGLOBAL(dispatcher)
+ALABEL(dispatcher)
+	/*
+	 *  ãã®ã«ã¼ãã³ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»ãã£ã¹ããã
+	 *  è¨±å¯ç¶æ
+ã»ï¼ã¢ãã«ä¸ã®ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§å¼ã³åºã
+	 *  ããï¼
+	 *
+	 *  ããªãã¡ï¼Handlerã¢ã¼ãã»lock_flagãtrueã»disdspãfalseã»dspflg
+	 *  ãtrueã»saved_iipmãIIPM_ENAALLã¨ãªã£ã¦ããï¼å®è¡åéçªå°ã¸ãã
+	 *  ã®ç¶æ
+ã®ã¾ã¾åå²ããï¼
+     *  ã¾ãï¼MSPã¯ï¼istkptï¼åæå¤ï¼ã¨ãªã£ã¦ãã
+     *  
+     *  from dispatch: 
+     *    svcå½ä»¤ã«ããHandlerã¢ã¼ãã¨ãªãï¼pspã«æ»ãå
+çªå°dispatch_rã
+     *    ç©ãã ç¶æ
+ï¼TCB.spã«pspãï¼TCB.pcã«EXC_RETURN_PSPãä¿å­æ¸ã¿ï¼
+     *  from start_dispatch/exit_and_dispatch: 
+     *    svcå½ä»¤ã«ããHandlerã¢ã¼ãã¨ãªã£ãç¶æ
+
+     *    ï¼ä»¥åã«å®è¡ç¶æ
+ã§ãã£ãã¿ã¹ã¯orID0ã®ã¿ã¹ã¯ã®ã¹ã¿ãã¯ã«æ»ãå
+
+     *      ãªã©ãç©ã¾ãããï¼æ¬¡åã«ã¿ã¹ã¯ãèµ·åããéã«ç ´æ£ãããï¼
+     *  from ret_int: 
+     *    ãã§ã«Handlerã¢ã¼ãã§ããããï¼åãªãã¸ã£ã³ãå½ä»¤ã§ããã«ãã
+     *    ï¼TCB.spã«pspãï¼TCB.pcã«ret_int_rãä¿å­æ¸ã¿ï¼
+
+     *  to dispatch_r: 
+     *    TCB.pcããEXC_RETURN_PSPãã­ã¼ããï¼bxå½ä»¤ã«ãããªã¿ã¼ã³ãã
+     *    ãã¨ã§ï¼Threadã¢ã¼ãã¨ãªãï¼TCB.spã®pspã«ç©ã¾ããdispatch_r
+     *    ã«æ»ãï¼TCB.pc/spã¯dispatchã§ã»ããæ¸ã¿ï¼
+     *  to start_r: 
+     *    TCB.pcããstart_rãã­ã¼ããï¼bxå½ä»¤ã«ããã¸ã£ã³ããããã¨ï¼
+     *    ã¿ã¹ã¯èµ·åæã®å¼æ°ã¬ã¸ã¹ã¿å¤ï¼pcãTCB.spã®pspã«ç©ã¿ï¼bx 
+     *    EXC_RETURN_PSP å½ä»¤ã«ãã£ã¦Threadã¢ã¼ãã¨ãªãï¼ã¿ã¹ã¯èµ·åçªå°
+     *    ã¸ã¸ã£ã³ããã
+     *    ï¼TCB.pc/spã¯activate_contextã§ã»ããæ¸ã¿ï¼
+     *  to ret_int_r: 
+     *    TCB.pcããret_int_rãã­ã¼ããï¼bxå½ä»¤ã«ããã¸ã£ã³ããããã¨ï¼
+     *    å²è¾¼ã¿ãã³ãã©ã®åºå£å¦çã«ããï¼Threadã¢ã¼ãã«æ»ãï¼å²è¾¼ã¿å
+ã«
+     *    æ»ãï¼TCB.pc/spã¯ret_intã§ã»ããæ¸ã¿ï¼
+	 */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+    bl    ovrtimer_stop
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+#ifdef LOG_DSP_ENTER
+	ldr   r1, =p_runtsk     /* p_runtskããã©ã¡ã¼ã¿ã« */
+	ldr   r0, [r1]        
+	bl    log_dsp_enter
+#endif /* LOG_DSP_ENTER */
+ALABEL(dispatcher_0)
+	ldr   r0, =p_schedtsk   /* p_schedtskãp_runtskã« */
+	ldr   r1, [r0]
+	ldr   r2, =p_runtsk   
+	str   r1, [r2]        
+	cbz   r1, idle_loop     /* p_runtskãNULLãªãidle_loopã¸ */           
+	ldr   lr, [r1,#TCB_pc]  /* å®è¡åéçªå°ãå¾©å¸°   */    
+	ldr   r0, [r1,#TCB_sp]  /* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãå¾©å¸° */
+#ifdef __TARGET_FPU_VFPUV4_D16
+    /*
+     *  æ»ãå
+ã®ã³ã³ãã­ã¹ãã§æµ®åå°æ°ç¹æ¼ç®ããããï¼
+     *  EXC_RETURN[4]ããã§ãã¯
+     */
+    tst     lr, #0x10
+    /*  EXC_RETURN[4] == 1ãªãã°ã¹ã­ãã */
+    bne     dispatcher_2
+    /*fpscrã¯ä¾å¤ãã¬ã¼ã ããå¾©å¸°ãã*/
+	vldmia  r0!, {s16-s31}         /* ã¬ã¸ã¹ã¿ã®å¾©å¸° */
+ALABEL(dispatcher_2)
+#endif /* __TARGET_FPU_VFPUV4_D16 */
+    ldmfd   r0!, {r4-r11}       /* ã¬ã¸ã¹ã¿ã®å¾©å¸° */
+    msr     psp, r0           /* psp = p_runtsk->sp */
+
+#ifdef LOG_DSP_LEAVE
+	mov   r0, r1            /* p_runtskããã©ã¡ã¼ã¿ã« */
+	mov   r4, r1            /* r1ã¯ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãªã®ã§ä¿å­ */
+	bl    log_dsp_leave
+	mov   r1, r4
+#endif /* LOG_DSP_LEAVE */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+    push    {lr}
+    bl      ovrtimer_start
+    pop     {lr}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+    /*
+     *  ARM<->Thumbã¢ã¼ãå¤æãæå¶ããããã«pcã«ç´æ¥æ»ãçªå°ã
+     *  å
+¥ãã
+     *  å²è¾¼ã¿å
+ã«æ»ãå ´åã«ããã¦ãï¼EXC_RETURNãç´æ¥pcã«ä»£å
+¥ãã¦
+     *  ï¼bxå½ä»¤ãä½¿ããã«æ»ã£ã¦ãï¼åé¡ãªã
+     */
+	bx     lr  /* å®è¡åéçªå°ãå¾©å¸°   */    
+
+ALABEL(idle_loop)
+	/*
+	 * å²è¾¼ã¿ãè¨±å¯ãããCPUã­ãã¯è§£é¤ç¶æ
+ã«ãªãããæºåãã
+	 * CPUã­ãã¯ç¶æ
+ã®è§£é¤ã¨ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãå®è¡ç¶æ
+ã¸ã®
+	 * æºåããã
+	 */
+    /*
+     *  pspã«ããã¼ãã¬ã¼ã ãç©ãã§bx lrã«ããï¼threadã¢ã¼ããã¤idleã¸
+     *  ãã®æç¹ã§ã¯ï¼r3=pspã§ãã
+     *  r3ã«ã¯ï¼dispatchã§callee-saved-registerãä¿å­ããããã¨ã®
+     *  ã¹ã¿ãã¯ãã¤ã³ã¿ãå
+¥ã£ã¦ããï¼ãã®ç¶ãããã¹ã¿ãã¯ãä½¿ç¨ãã
+     */
+	ldr   r0, =_idle_loop         /* PC   */
+	ldr   r1, =EPSR_T             /* xPSR(Tãããã'1'ã§ããå¿
+è¦ããã) */
+    /*
+     *  ã¢ã¤ãã«ã«ã¼ãä¸­ã®FPã¯ä»»æãªã®ã§è¨­å®ããªã
+     */
+    ldr   lr, =0xfffffffd
+	stmfd r3!, {r0-r1}            /* ããã¼ãã¬ã¼ã ãã¹ã¿ãã¯ä¸ã«ç©ã   */
+	sub   r3, #(6*4) /* r0-r3,r12,lrã®å
+å®¹ã¯è¨­å®ããå¿
+è¦ããªã */
+	msr   psp, r3                  
+    bx    lr
+
+ALABEL(_idle_loop)
+    /* ããã§ã¯ãã§ã«å²è¾¼ã¿è¨±å¯ç¶æ
+ */
+#ifdef TOPPERS_CUSTOM_IDLE
+	toppers_asm_custom_idle
+#else
+ALABEL(_idle_loop_1)
+    /*
+     *  basepriãå
+¨å²è¾¼ã¿è¨±å¯ã«è¨­å®ãã¦ããwfiãçºè¡ãããã¾ã§ã«
+     *  å²è¾¼ã¿ãå
+¥ã£ãå ´åï¼ããã§ãã£ã¹ããããå¿
+è¦ãªç¶æ
+ã«ãªãã°
+     *  å²è¾¼ã¿ã®åºå£å¦çã§é
+å»¶ãã£ã¹ããããï¼ããã«ã¯æ»ã£ã¦ããªãï¼
+     *  é
+å»¶ãã£ã¹ãããããªãã£ãå ´åã¯ããã«æ»ã£ã¦ãã¦æ¬¡ã®å²è¾¼ã¿ã
+     *  wfiã§å¾
+ã¤ããï¼æ³å®ã©ããã®åä½ã¨ãªã
+     */
+    wfi
+    b     _idle_loop_1
+    nop
+#endif /* TOPPERS_CUSTOM_IDLE */
+
+/*
+ *  ã«ã¼ãã«ã®çµäºå¦çã®å¼åºã
+ *
+ *  ã¹ã¿ãã¯ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã«åãæ¿ãï¼
+ *  
+ */
+	ATHUMB(call_exit_kernel)
+	AGLOBAL(call_exit_kernel)
+ALABEL(call_exit_kernel)
+	mov   r0, #CONTROL_MSP
+	msr   control, r0       /* MSPãæå¹ã«  */
+	isb                     /* control ã®æä½å¾ã«å¿
+è¦ */
+	ldr   r0, =exit_kernel  /* ã«ã¼ãã«ã®çµäºå¦çãå¼ã¶ */
+	bx    r0
+
+/*
+ *  å¾®å°æéå¾
+ã¡
+ */
+	AALIGN(2)
+	ATEXT
+	ATHUMB(sil_dly_nse)
+	AGLOBAL(sil_dly_nse)
+ALABEL(sil_dly_nse)
+	sub   r0, r0, #SIL_DLY_TIM1
+	cmp   r0, #0
+	bgt   sil_dly_nse1
+	bx    lr
+ALABEL(sil_dly_nse1)
+	sub   r0, r0, #SIL_DLY_TIM2
+	cmp   r0, #0
+	bgt   sil_dly_nse1
+	bx    lr
+
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_test.h
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_test.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_test.h	(revision 302)
@@ -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_test.h 321 2015-04-30 09:34:22Z ertl-ishikawa $
+ */
+
+/*
+ *		ãã¹ããã­ã°ã©ã ã®ãããä¾å­å®ç¾©ï¼ARM-Mç¨ï¼
+ */
+
+#ifndef TOPPERS_CORE_TEST_H
+#define TOPPERS_CORE_TEST_H
+
+/*
+ *  ãããã§å
+±éãªå®ç¾©
+ */
+#define CPUEXC1 3   /* Hard Fault */
+#define RAISE_CPU_EXCEPTION {   \
+    Asm("mov r0, #0x00");       \
+    Asm("push {r0}");           \
+    Asm("pop  {pc}");           \
+}
+#define CANNOT_RETURN_CPUEXC
+
+
+#endif /* TOPPERS_CORE_TEST_H */
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 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_unrename.h	(revision 302)
@@ -0,0 +1,84 @@
+/* This file is generated from core_rename.def by genrename. */
+
+/* This file is included only when core_rename.h has been included. */
+#ifdef TOPPERS_CORE_RENAME_H
+#undef TOPPERS_CORE_RENAME_H
+
+/*
+ *  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
+
+
+#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/common/core_user.txt
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_user.txt	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/core_user.txt	(revision 302)
@@ -0,0 +1,564 @@
+=====================================================================
+                         ARM-Mãã­ã»ããµä¾å­é¨
+                                  Last Modified: 2015 Jan 7 01:27:34
+=====================================================================
+
+
+(1) å¯¾å¿ãã¦ããã¿ã¼ã²ããã·ã¹ãã ã®ç¨®é¡ã»æ§æ
+
+ARM-Mä¾å­é¨ã¯ï¼ARMVx-Mã¢ã¼ã­ãã¯ãã£ãã¿ã¼ã²ããã¨ãã¦ããï¼ARMVx-Mã¯ï¼
+ARMã¨ã¯ç°ãªãï¼ARMå½ä»¤ãå®è¡ã§ããªãããï¼ARMä¾å­é¨ã¨åãã¦ããï¼
+
+
+(2) ä½¿ç¨ããéçºç°å¢ã¨åä½æ¤è¨¼ããæ¡ä»¶ï¼ãã¼ã¸ã§ã³ï¼ãªãã·ã§ã³ç­ï¼
+
+ã«ã¼ãã«ã¯GCCãç¨ãã¦ã³ã³ãã¤ã«ããï¼åä½ç¢ºèªãããã¼ã¸ã§ã³ã¯åã¿ã¼ã²
+ããä¾å­é¨ã®ãã­ã¥ã¡ã³ãã«è¨è¼ããï¼
+
+
+(3) ã¿ã¼ã²ããå®ç¾©äºé 
+ã®è¦å®
+
+(3-1) ãã¼ã¿åã«é¢ããè¦å®
+
+ãã¼ã¿åã¯ arch/gcc/tool_stddef.h ã§å®ç¾©ããã¦ããå
+å®¹ã§ï¼floatåã¨
+doubleåã¯ï¼ããããIEEE754æºæ ã®åç²¾åº¦æµ®åå°æ°ç¹æ°ã¨åç²¾åº¦æµ®åå°æ°ç¹
+æ°ã§ããï¼
+
+(3-2) å²è¾¼ã¿å¦çã«é¢ããè¦å®
+
+âå²è¾¼ã¿ãã³ãã©çªå·ã¨å²è¾¼ã¿çªå·ã®å²å½ã¦ï¼ä¸¡è
+ã®å¯¾å¿
+
+å²è¾¼ã¿ãã³ãã©çªå·ã¨å²è¾¼ã¿çªå·ã¯ï¼ä¾å¤çºçæã«IPSRã«ã»ãããããä¾å¤çª
+å·ãç¨ããï¼SYSTICKã¯15çªã§ï¼å¤é¨å²è¾¼ã¿ã¯16çªããã®çªå·ãå²ãä»ããã
+ã¦ããï¼
+
+âå²è¾¼ã¿åªå
+åº¦ã®æ®µéæ°ã¨TMIN_INTPRIã®å¤
+
+å²è¾¼ã¿åªå
+åº¦ã®æ®µéæ°ã¯ï¼SoCæ¯ã«ãã¼ãã¦ã§ã¢çã«ãµãã¼ãããå²è¾¼ã¿åªå
+
+åº¦ãããå¹
+ãç°ãªãã®ã§ï¼ã¿ã¼ã²ããä¾å­é¨æ¯ã«ç°ãªãï¼ã¿ã¼ã²ããä¾å­é¨ã§
+ã¯ï¼å²è¾¼ã¿åªå
+åº¦ã®ãããå¹
+ï¼TBITW_IPRIï¼ã¨ãã®å²è¾¼ã¿åªå
+åº¦ä¸­ã®ãµãåªå
+
+åº¦ã®ãããå¹
+ï¼TBITW_SUBPRIï¼ãå®ç¾©ããï¼
+
+åãããå¹
+ã®å¤ã¨CFG_INTã§ä½¿ç¨å¯è½ãªå²è¾¼ã¿åªå
+åº¦ã®ç¯å²ã¯æ¬¡ã®éãã§ããï¼
+
+   -(2^(TBIW_IPRI)) + (2^TBITW_SUBIPRI) ã -1
+
+ä¾ãã°åªå
+åº¦ã®ãããå¹
+(TBITW_IPRI)ã8bitï¼ãµãåªå
+åº¦ã®ãããå¹
+
+(TBITW_SUBIPRI) ã1bitã®å ´åã¯ï¼-254 ã -1 ã®ç¯å²ã§ããï¼
+
+åªå
+åº¦ã®ãããå¹
+(TBITW_IPRI)ã3bitï¼ãµãåªå
+åº¦ã®ãããå¹
+(TBITW_SUBIPRI) 
+ã0bitã®å ´åã¯ï¼-8 ã -1 ã®ç¯å²ã§ããï¼
+
+æå¤§åªå
+åº¦(3bitã®ä¾ã§ã¯-8)ã¯ï¼å
+é¨åªå
+åº¦ã¨ãã¦ã¯"0x00"ã¨ãªãï¼ãã®åªå
+
+åº¦ã¯CPUã­ãã¯ã§ç¨ããBASEPRIã¬ã¸ã¹ã¿ã§ã¯ãã¹ã¯ã§ããªãããï¼ã«ã¼ãã«ç®¡
+çå
+ã®å²è¾¼ã¿ã®æé«åªå
+åº¦ï¼TMIN_INTPRIï¼ã¯ï¼æå¤§å¤ãã1ã¤åªå
+åº¦ãä½ãå¤
+ä»¥ä¸ã®å¤ãæå®ããï¼
+
+ãã®ç¯å²ã§ï¼ã«ã¼ãã«ç®¡çå
+ã®å²è¾¼ã¿ã®æé«åªå
+åº¦ï¼TMIN_INTPRIï¼ãã¿ã¼ã²
+ããä¾å­é¨ã§è¨­å®ããï¼
+
+âdis_intã¨ena_intã®ãµãã¼ãã®æç¡ï¼ãã®å¶éäºé 
+
+
+dis_intã¨ena_intããµãã¼ãããï¼å¶éäºé 
+ã¯ç¹ã«ãªãï¼
+
+âCFG_INTã®å¶éäºé 
+ã¨æ¡å¼µï¼ã¿ã¼ã²ããå®ç¾©ã§ä½¿ç¨ã§ããå²è¾¼ã¿å±æ§ï¼
+
+CFG_INTã®å¶éäºé 
+ã¯ãªãï¼ã¿ã¼ã²ããå®ç¾©ã§ä½¿ç¨å¯è½ãªå²è¾¼ã¿å±æ§ã¯ç¹ã«ãª
+ãï¼
+
+âã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿
+
+ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ããµãã¼ãããï¼æå®æ¹æ³ã¯ï¼å²è¾¼ã¿åªå
+åº¦ã®æ®µéæ°
+ã§æå®ããï¼ãµãã¼ãããå²è¾¼ã¿åªå
+åº¦ã®æé«å¤ï¼æå°å¤ï¼ããï¼
+TMIN_INTPRIã®å¤ãå¤§ããï¼åªå
+åº¦ãä½ãï¼è¨­å®ããã¨ï¼TMIN_INTPRIããå¤ã
+å°ãï¼é«åªå
+åº¦ï¼ãªå²è¾¼ã¿åªå
+åº¦ãè¨­å®ããå²è¾¼ã¿ãå²è¾¼ã¿åªå
+åº¦ã¨ãã¦æ±ãï¼
+
+ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã¯OSå®è¡ä¸­ãç¦æ­¢ã«ãªããã¨ã¯ãªãï¼å³å¯ã«ã¯å²è¾¼ã¿
+ã®åºå£ã§ããç­ãåºéç¦æ­¢ãããï¼ï¼å²è¾¼ã¿çºçæã¯ï¼ã«ã¼ãã«ã®ã³ã¼ããçµ
+ç±ããã«å¼ã³åºãããï¼
+
+ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã«å¯¾ããï¼DEF_INH,CFG_INTã¯ãµãã¼ãããï¼
+
+(3-3) CPUä¾å¤å¦çã«é¢ããè¦å®
+
+âCPUä¾å¤ãã³ãã©çªå·
+
+CPUä¾å¤ãã³ãã©çªå·ã¨ãã¦ã¯ï¼ä¾å¤çºçæã«IPSRã«ã»ãããããï¼ä¾å¤çªå·
+ãç¨ããï¼åä¾å¤ã®ä¾å¤çªå·ã¯ä»¥ä¸ã®éãã§ããï¼
+
+        ä¾å¤              ä¾å¤çªå·
+  Reset                      1
+  Non-makable Interrupt      2
+  Hard Fault                 3
+  Memory Management          4
+  Bus Fault                  5
+  Usage Fault                6
+  SVCall                    11
+  Debug Monitor             12
+  PendSV                    14
+
+ãªãï¼Resetã¨ï¼SVCallã«ã¤ãã¦ã¯ï¼ã«ã¼ãã«ãä½¿ç¨ããããï¼ã¦ã¼ã¶ã¼ã¯ä½¿
+ç¨ãããã¨ãã§ããªãï¼
+
+ARM-Mã¢ã¼ã­ãã¯ãã£ã§ã¯CPUä¾å¤ã«åªå
+åº¦ãè¨­å®ãããã¨ãå¯è½ã§ããï¼
+ARM-Mä¾å­é¨ã§ã¯ï¼å
+¨ã¦ã®CPUä¾å¤ã®åªå
+åº¦ãCPUã­ãã¯ã§ã¯ãã¹ã¯ã§ããªãã
+ã¹ã¯åºæ¥ãªãå¤ï¼å
+é¨åªå
+åº¦0ï¼ã«åæåãã¦ããï¼
+
+(3-4) CPUã­ãã¯ã»å²è¾¼ã¿ã­ãã¯
+
+CPUã­ãã¯ã¯ï¼basepriãTMIN_INTPRIã®åªå
+åº¦ã®å²è¾¼ã¿ãç¦æ­¢ããå¤ã«è¨­å®ã
+ãï¼å²è¾¼ã¿ã­ãã¯ã¯ï¼FAULTMASKã'1'ã«è¨­å®ãããã¨ã§å®ç¾ãã¦ããï¼
+
+(3-5) æ§è½è©ä¾¡ç¨ã·ã¹ãã æå»ã®åç
+§ã«é¢ããè¦å®
+
+get_utmããµãã¼ãããï¼ç²¾åº¦ã«é¢ãã¦ã¯ï¼ã¿ã¼ã²ããæ¯ã«ç°ãªãï¼
+
+(3-6) ã¹ã¿ã¼ãã¢ããã«ã¼ãã³ã§ã®åæåå
+å®¹
+
+ã¹ã¿ã¼ãã¢ããã«ã¼ãã³ã¯ï¼Threadã¢ã¼ãã§å¼ã³åºããããã¨ãåæã¨ãã¦ã
+ãï¼å®è¡å¾ï¼å²è¾¼ã¿ã­ãã¯ç¶æ
+ï¼FAULTMASKãã»ããï¼ã¨ããï¼å²è¾¼ã¿ã­ãã¯
+ç¶æ
+ã¯ï¼ã«ã¼ãã«ã®åæåçµäºæã«è¨±å¯ããï¼ã¹ã¿ã¼ãã¢ããã«ã¼ãã³ã§ï¼
+MSPãã¢ã¯ãã£ããªã¹ã¿ãã¯ã¨ãï¼MSPã®å
+å®¹ãåæåããããã«ã¯ï¼INIT_MSP
+ãã¿ã¼ã²ããä¾å­é¨ã§å®ç¾©ããï¼
+
+(3-7) ãã¯ã¿ãã¼ãã«ãªãã»ããã®åæå
+
+ãã­ã»ããµä¾å­ã®åæåå¦çã§ï¼Vector Table Offset Register ãã¿ã¼ã²ã
+ãä¾å­é¨ã®åæåã«ã¼ãã³ã§è¨­å®ããï¼ãªãï¼ãã¯ã¿ã¼ãã¼ãã«ã¯ï¼.vector
+ã®ã»ã¯ã·ã§ã³å±æ§ãä»å ããã¦ããããï¼ãªã³ã«ã¹ã¯ãªããã§ãã®ã»ã¯ã·ã§ã³
+ãæå®ãã¦é
+ç½®ããï¼
+
+(4) ã¿ã¼ã²ããä¾å­é¨ã§ã®è¨­å®é 
+ç®
+
+ã¿ã¼ã²ããä¾å­é¨ã§ã¯ä»¥ä¸ã®ãã¯ã­ãå®ç¾©ããå¿
+è¦ãããï¼
+
+   ã»TMAX_INTNO     : å²è¾¼ã¿çªå·ã®æå¤§å¤(éå¸¸ã®å²è¾¼ã¿çªå· + 15)
+   ã»TBITW_IPRI     : å²è¾¼ã¿åªå
+åº¦ã®ãããå¹
+
+   ã»TBITW_SUBIPRI  : å²è¾¼ã¿åªå
+åº¦ã®ãããå¹
+ä¸­ã®ãµãåªå
+åº¦ã®ãããå¹
+
+   ã»TMIN_INTPRI    : å²è¾¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼
+   ã»TIC_NUME       : ã¿ã¤ã ãã£ãã¯ã®å¨æã®åå­
+   ã»TIC_DENO       : ã¿ã¤ã ãã£ãã¯ã®å¨æã®åæ¯
+   ã»TIMER_CLOCK    : ã¿ã¤ãå¤ã®å
+é¨è¡¨ç¾ã¨ããªç§åä½ã¨ã®å¤æ
+   ã»INTPRI_TIMER   : ã¿ã¤ãå²è¾¼ã¿å²è¾¼ã¿åªå
+åº¦
+   ã»INTATR_TIMER   : ã¿ã¤ãå²è¾¼ã¿ã®å²è¾¼ã¿å±æ§
+   ã»INIT_MSP       : ã¹ã¿ã¼ãã¢ããã«ã¼ãã³ã§MSPãåæåããå ´åã¯å®ç¾©
+   ã»DEFAULT_ISTKSZ : ã¹ã¿ãã¯ãµã¤ãºï¼8byteåä½ã§æå®ï¼
+   ã»SIL_DLY_TIM1   : å¾®å°æéå¾
+ã¡ã®ããã®å®ç¾©
+   ã»SIL_DLY_TIM2   : å¾®å°æéå¾
+ã¡ã®ããã®å®ç¾©
+
+(5) ãã£ã¬ã¯ããªæ§æã»ãã¡ã¤ã«æ§æ
+  ./arch/arm_m_gcc/common
+    ./arm_m.h
+    ./core.tf
+    ./core_asm.inc
+    ./core_cfg1_out.h
+    ./core_check.tf
+    ./core_kernel_impl.c
+    ./core_kernel_impl.h
+    ./core_def.csv
+    ./core_design.txt
+    ./core_insn.h
+    ./core_kernel.h
+    ./core_offset.tf
+    ./core_rename.def
+    ./core_rename.h
+    ./core_sil.h
+    ./core_stddef.h
+    ./core_support.S
+    ./core_test.h
+    ./core_unrename.h
+    ./core_user.txt
+    ./Makefile.core
+    ./start.S
+
+(6)ARMCCå
+±æã³ã¼ãã®è¨è¿°æ¹æ³
+
+ARMCCã¨å
+±æããã³ã¼ãã¯ï¼æ¬¡ã®ã«ã¼ã«ã«å¾ã£ã¦ã³ã¼ããè¨è¿°ããå¿
+è¦ãããï¼
+
+1.ã¡ã¢ãªããªã¢å½ä»¤(Asm("":::"memory"))ã®ãã¯ã­å
+
+ã¿ã¼ã²ããä¾å­é¨ ãã¼ãã£ã³ã°ã¬ã¤ãã®(1-6-2)(c)ã«ã¯ï¼æ¬¡ã®ããã«è¨è¿°ã
+ãã¦ããï¼
+
+-----
+(c) ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã®æ¬è³ªçãªé¨åãï¼ãã¯ã­ãã¤ã³ã©ã¤
+	ã³é¢æ°å¼åºãã§å®ç¾ãã¦ããå ´åã«ã¯ï¼ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã«å
+¥ãå¦
+	çã®æå¾ã¨åºãå¦çã®å
+é ­ã«ï¼Asm("":::"memory")ã¨ããè¨è¿°ãå
+¥ããï¼
+-----
+
+ã¡ã¢ãªããªã¢å½ä»¤(Asm("":::"memory"))ã¯ï¼ARMCCã¨äºææ§ããªãããï¼ãã®
+è¨è¿°ãããç®æã¯ï¼æ¬¡ã®ãã¯ã­ã§è¨è¿°ããã¨ï¼ã³ã³ãã¤ã«æã«é©åãªã¡ã¢ãªã
+ãªã¢å½ä»¤ã«ç½®ãæããããï¼
+
+  ARM_MEMORY_CHANGED
+
+2.ã¤ã³ã¯ã«ã¼ãæ¹æ³
+
+ã¿ã¼ã²ããä¾å­é¨ ãã¼ãã£ã³ã°ã¬ã¤ãã®1.5ã«ã¯ï¼æ¬¡ã®ããã«è¨è¿°ããã¦ããï¼
+
+-----
+ãã®ä»ã®ããããã¡ã¤ã«ã¯ï¼ã#include "..."ãã«ããã¤ã³ã¯ã«ã¼ãããï¼ãã
+ããã¡ã¤ã«ãï¼ã«ã¬ã³ããã£ã¬ã¯ããªãã¤ã³ã¯ã«ã¼ããããã¡ã¤ã«ã¨åããã£
+ã¬ã¯ããªä»¥å¤ã®ãã£ã¬ã¯ããªã«ç½®ããã¦ããå ´åã«ã¯ï¼æ¬¡ã®ããã«ãã¹æå®ã
+è¡ãï¼
+-----
+
+GCCä¾å­é¨ã¨ARMCCä¾å­é¨ã§ããããã¡ã¤ã«ãå
+±æã§ããªãå ´åã«ã¯ï¼ãããã
+ã§åãååã®ãã¡ã¤ã«ãæã¤ï¼ããã¦ï¼ã³ã³ãã¤ã«ãªãã·ã§ã³ã§ã¤ã³ã¯ã«ã¼ã
+ãã¹ããã¡ã¤ã«ãå
+ã«æå®ãã¦ããï¼ãã®ããï¼ARMCCã¨å
+±æãããã¡ã¤ã«ã§
+ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããå ´åã«ã¯ï¼ã#include "..."ãã§ã¯ãªãï¼
+ã#include <...>ãã§è¨è¿°ãï¼ç¸å¯¾ãã¹ã§ã¯ãªããã¡ã¤ã«åã®ã¿ãè¨è¼ããã
+ã¨ï¼
+
+3.ã¢ã»ã³ãã©ãã£ã¬ã¯ãã£ã
+
+GCCã¨ARMCCã®ã¢ã»ã³ãã©ãã£ã¬ã¯ãã£ãã¯äºææ§ããªãï¼ãã®ããï¼ARMCCã¨
+å
+±æãããã¡ã¤ã«ã¯æ¬¡ã«ç¤ºããã¯ã­ãã£ã¬ã¯ãã£ãã§è¨è¿°ãããã¨ï¼
+
+ãã¯ã­ãã£ã¬ã¯ãã£ã     GCCãã£ã¬ã¯ãã£ã
+ ASECTION(name)          .section name,"a"
+ ATEXT                   .text
+ AGLOBAL(name)           .global name
+ AALIGN(x)               .align x
+ ALONG                   .long
+ ALABEL(label)           label:
+ AOR                       |
+ ATHUMB(name)            __athumb name
+
+
+(7)ARMCCå
+±æã³ã¼ãã®è¨è¿°æ¹æ³
+
+âã¢ã¤ãã«å¦ç
+
+å®è¡ããã¹ãã¿ã¹ã¯ããªãå ´åã¯ï¼ãã£ã¹ãããã£ã¼ã§å²è¾¼ã¿ãè¨±å¯ãã¦ï¼å²
+è¾¼ã¿ãå¾
+ã¤ï¼dispatcher_2ï¼ï¼ARM-Mä¾å­é¨ã®ã³ã¼ãã§ã¯ï¼æ¬¡ã®ããã«ãªã£ã¦
+ããï¼
+
+       å²è¾¼ã¿ãè¨±å¯
+       nop
+       å²ãè¾¼ã¿ç¦æ­¢
+
+ã¿ã¼ã²ããä¾å­ã§ï¼ä¸è¨ã®å¦çã®ä»£ããã«ï¼çé»åã¢ã¼ãç­ã«ç§»è¡ããå¦çã
+è¨è¿°ãããå ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ï¼TOPPERS_CUSTOM_IDLEãå®ç¾©ãï¼
+ä»£ããã«å®è¡ããå¦çã toppers_asm_custom_idle ã¨ããã¢ã»ã³ãã©ãã¯ã­
+ã¨ãã¦è¨è¿°ããï¼
+
+ãªãï¼toppers_asm_custom_idle ã®è¨è¿°ã«ããã£ã¦ã¯ï¼æ¬¡ã®ã¬ã¸ã¹ã¿ã¯
+oppers_asm_custom_idleã®åå¾ã§ä½¿ç¨ããããï¼oppers_asm_custom_idle å
+
+ã§ä½¿ç¨ããå ´åã¯ï¼åå¾ã§ä¿å­å¾©å¸°ãããã¨ï¼ãããã®ã¬ã¸ã¹ã¿ã¯ Calee 
+saved ã¬ã¸ã¹ã¿ã§ããããï¼ oppers_asm_custom_idle ã¨ãã¦é¢æ°å¼ã³åºãã
+ããå ´åã¯ï¼å¼ã³åºããé¢æ°ã§èªåçã«ä¿å­å¾©å¸°ãããããï¼ã¢ã»ã³ãã©ã¬ã
+ã«ã§ã®ä¿å­å¾©å¸°ã¯å¿
+è¦ãªãï¼
+
+ã¬ã¸ã¹ã¿ : å
+å®¹
+r4      : '0'
+r5      : 'IIPM_LOCK'
+r6      : reqflgã®ã¢ãã¬ã¹
+r7      : lock_flgã®ã¢ãã¬ã¹
+sp      : éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã®å
+é ­ã¢ãã¬ã¹(msp)
+
+ã¢ã»ã³ãã©ãã¯ã­ã¯Cè¨èªè¨è¿°ä¸­ã«å±éããã¨ã¨ã©ã¼ã¨ãªãï¼core_support.S ã§
+ã¯ï¼TOPPERS_ASM_MACRO ã¨ãããã¯ã­ãå®ç¾©ãã¦ããããï¼ã¿ã¼ã²ããä¾å­é¨
+ã§ toppers_asm_custom_idle ã¢ã»ã³ãã©ãã¯ã­ãå®ç¾©ããéã«ã¯ï¼
+TOPPERS_ASM_MACRO ãæ¡ä»¶ã³ã³ãã¤ã«ã®æ¡ä»¶ã¨ãã¦ç¨ãããã¨ï¼
+
+
+(8) ãã¼ã¸ã§ã³å±¥æ­´
+
+2015/01/07
+ã»ASP3ã«ã¼ãã«å¯¾å¿
+
+2012/02/29
+ã»Makefile.core
+  ã»CDEFSã«TOPPERS_LABEL_ASMãæå®ãã¦ãããï¼ARMç¨ã®gccã§ã¯ã¢ã»ã³ãã©
+    ã®ã·ã³ãã«ã®åã«_ãä»ããªãããåé¤ï¼
+  
+2012/02/02
+ã»core_config.h
+  ã»x_set_ipm()ã§ï¼iipmã'0'(IIPM_ENAALL)ã®æã®åé¡ãä¿®æ­£ï¼
+ã»core_support.S
+  ã»toppers_asm_custom_idleã®åå¾ã§ä½¿ç¨ããã¬ã¸ã¹ã¿ãå¤æ´ï¼ãã®å¤æ´ã«
+    ããï¼toppers_asm_custom_idle ã§é¢æ°å¼ã³åºããããå ´åã¯ï¼ã¢ã»ã³ã
+    ã©ã¬ãã«ã§ã®ã¬ã¸ã¹ã¿ã®ä¿å­ãå¿
+è¦ãªããªã£ãï¼
+    
+2012/02/23
+ã»core_support.S
+  ã»core_exc_entryã§basepriãèª­ã¿è¾¼ãã ãã¨ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®ãã§
+    ãã¯ããã«ä¸æ¸ããã¦ããåé¡ãä¿®æ­£
+  ã»call_texrtnã¨call_texrtnã®å¼ã³åºããbå½ä»¤ã§è¨è¿°ããã¨ï¼16bitå½ä»¤ã¨
+    ãã¦è§£éããã³ã³ãã¤ã©ãããããï¼ã¡ã¢ãªé
+ç½®ã«ãã£ã¦ã¯ã¬ã³ã¸ãè¶³ã
+    ãªããªãï¼bxå½ä»¤ã«å¤æ´ãããã¨ã§åé¡ãä¿®æ­£ï¼
+
+2012/01/31
+ã»core_timer.c
+ ã»ã¿ã¤ãå²è¾¼ã¿ãã³ãã©ã«ã¦ï¼probe_int ã®ããï¼COUNTFLAGãã¯ãªã¢ããã
+   ãã«èª­ã¿è¾¼ãã§ããã¬ã¸ã¹ã¿ãèª¤ã£ã¦ããåé¡ãä¿®æ­£ï¼
+ 
+2011/12/03
+ã»core_test.h ã®å¤éã¤ã³ã¯ã«ã¼ãé²æ­¢ãã¯ã­ã®åç§°ä¿®æ­£
+ ã»CHIP ã CORE ã«ä¿®æ­£ï¼
+
+ã»ARMCCå¯¾å¿ã«ä¼´ãå¤æ´
+  ã»core_asm.inc(è¿½å )
+    ã»GCCã®ã¢ã»ã³ãã©ã®ãã£ã¬ã¯ãã£ãã®å®ç¾©ãè¨è¿°ãããã¡ã¤ã«ãè¿½å ï¼
+  ã»core_config.h(å¤æ´)
+    ã»core_insn.h ã®ã¤ã³ã¯ã«ã¼ãæ¹æ³ã""ãã<>ã«å¤æ´ãã¦ï¼ã³ã³ãã¤ã©ã®
+      å¼æ°ã§æå®ãããé ã§ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ããµã¼ãããããå¤æ´ï¼
+   ã»ã¡ã¢ãªããªã¢å½ä»¤(Asm("":::"memory"))ããã¯ã­åãã¦core_insn.h ã«
+     å®ç¾©ãä½¿ç¨ããããå¤æ´ï¼     
+  ã»core_insn.h(å¤æ´)
+   ã»ã¡ã¢ãªããªã¢å½ä»¤(Asm("":::"memory"))ã®ãã¯ã­å®ç¾©ãè¿½å 
+  ã»core_support.S(å¤æ´)
+   ã»ARMCCã¨ãã¡ã¤ã«ãå
+±æããããï¼ãã£ã¬ã¯ãã£ãããã¯ã­ã«æ¸ãæãï¼      
+  ã»start.S(å¤æ´)
+   ã»ARMCCã¨ãã¡ã¤ã«ãå
+±æããããï¼ãã£ã¬ã¯ãã£ãããã¯ã­ã«æ¸ãæãï¼  
+   
+2011/07/26
+ã»CCRã®STKALIGNã'1'ã®å ´åã¸ã®å¯¾å¿
+  å²è¾¼ã¿ã»ä¾å¤ã®åºå
+¥å£å¦çã§ã¯ï¼ã¹ã¿ãã¯ã¯å¸¸ã«8byteå¢çã¨ãªãããã«å¤
+  æ´ï¼
+  
+2011/07/25
+ã»CPUä¾å¤ã®åªå
+åº¦ã®åæå
+  CPUã­ãã¯ã§ãã¹ã¯ã§ããªãåªå
+åº¦ï¼å
+é¨åªå
+åº¦0ï¼ã«åæåããå¦çãè¿½å ï¼
+  
+ã»CFG_INTã§ä½¿ç¨ã§ããå²è¾¼ã¿åªå
+åº¦ã®æå¤§å¤ã®ä¿®æ­£(core.tf)
+  ã»æå¤§å¤ã1ã¤å¤§ããªå¤ã¨ãªã£ã¦ããï¼
+  
+ã»ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã®æ±ãã®å¤æ´
+  ã»å
+±éé¨ã§ã®æ±ãã®å¤æ´ã«ä¼´ãå¤æ´ï¼
+  
+ã»ã¿ã¤ãå²è¾¼ã¿ãã³ãã©ã§ã®COUNTFLAGã®ã¯ãªã¢å¦çã®ä¿®æ­£
+  SYSTIC_CONTROL_STATUSã¬ã¸ã¹ã¿ã®COUNTFLAGãã¯ãªã¢ããã«ã¯ï¼
+  SYSTIC_CURRENT_VALUEã¬ã¸ã¹ã¿ãèª­ã¿è¾¼ãå¿
+è¦ããããï¼èª¤ã£ã¦
+  SYSTIC_CONTROL_STATUSã¬ã¸ã¹ã¿ãèª­ã¿è¾¼ãã§ããï¼
+
+ã»core_int_entryã«ãããbasepriã®è¨­å®
+  NVICåªå
+åº¦ãã¹ã¯ãèªåçã«è¨­å®ãããããåªå
+åº¦ãã¹ã¯ã®ç¹ã§ã¯å¿
+è¦ãª
+  ããï¼x_get_ipm()ãbasepriãåç
+§ããããï¼basepriãæ´æ°ããããå¤æ´ï¼
+
+2011/07/24
+ã»_ret_int_2/svc_handler ã®å¤æ´
+  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤ç¶æ
+ã§ããã¿ã¹ã¯ä¾å¤ãå¼ã³åºããªãããã«
+  ä»æ§ãå¤æ´ãããããï¼_ret_int_2ã§ã¯ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãï¼å
+¨è§£é¤
+  ç¶æ
+ï¼TIPM_ENAALLï¼ã«è¨­å®ããããå¤æ´ï¼
+  svc_handlerã¯ã¿ã¹ã¯ã«ãªã¿ã¼ã³ããæã«basepriãIIPM_ENAALLã«ãããã
+  ã«å¤æ´ï¼
+  
+ã»x_config_int()/set_exc_int_priority()ã®ä¿®æ­£  
+  x_config_int()ããï¼set_exc_int_priority()ã«å¯¾ãã¦å¤é¨åªå
+åº¦ãå¼æ°ã«
+  ãã¦å¼ã³åºãããããï¼å
+é¨åªå
+åº¦ãå¼æ°ã§å¼ã³åºãããä¿®æ­£ï¼
+  set_exc_int_priority()ãåãåã£ãå¼æ°ãå
+é¨åªå
+åº¦ã¨ãã¦åªå
+åº¦ãè¨­å®
+  ããããã«ä¿®æ­£ï¼
+
+2011/07/23
+ã»å
+±éé¨ã1.4.0ã«update.
+
+ã»armä¾å­é¨ã¨åæ§ã«ãããä¾å­é¨ãç½®ããããã«ãã£ã¬ã¯ããªæ§é ãå¤æ´
+
+ã»armä¾å­é¨ã¨åæ§ã«ãã¡ã¤ã«åã®ããªãã£ãã¯ã¹ãcoreã«å¤æ´ï¼
+
+ã»call_atexitã®åé¤
+  software_term_hook ã®å¼ã³åºãã¯ï¼core_terminate()ã«ç§»åï¼
+  
+ã»å
+±éé¨ã1.7.0ã«update.  
+
+ã»ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ã®ååã®å¤æ´
+  CTXBåãTSKCTXBåã«åç§°å¤æ´ï¼
+
+ã»ã¿ã¼ã²ããä¾å­é¨ã§ãµãã¼ãããæ©è½ãç¤ºããã¯ã­ã®å¤æ´
+  TOPPERS_SUPPORT_DIS_INTãTOPPERS_TARGET_SUPPORT_DIS_INTã«ï¼
+  TOPPERS_SUPPORT_ENA_INTãTOPPERS_TARGET_SUPPORT_ENA_INTã«ï¼
+  å¤æ´ï¼
+  
+ã»exc_sense_unlockã®å®ç¾©ãåé¤ï¼  
+  
+ã»ãªãã»ãããã¡ã¤ã«ãã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã§çæããæ¹æ³ã¸ã®å¯¾å¿
+
+ã»CHECK_FUNC_ALIGNï¼CHECK_FUNC_NONNULLï¼CHECK_STACK_ALIGNï¼
+  CHECK_STACK_NONNULLï¼CHECK_MPF_ALIGNï¼CHECK_MPF_NONNULLã®å®ç¾©ãï¼ã¿
+  ã¼ã²ããä¾å­é¨ã®ãã³ãã¬ã¼ããã¡ã¤ã«ï¼ãã¹3ï¼ããããããã¡ã¤ã«ã«ç§»
+  åï¼
+
+ã»å²è¾¼ã¿ã¨ä¾å¤ã®å
+¥ãå£å¦çã®ååãå¤æ´
+  int_entryãcore_int_entryã¸exc_entryãcore_exc_entryã«å¤æ´ï¼
+  ãªãã»ããã®åå¾æ¹æ³ãå¤æ´ã¨ãªã£ãããï¼å
+ã®ååã®ã¾ã¾ã ã¨cfg1_out.c
+  ãã³ã³ãã¤ã«ã¨ã©ã¼ã¨ãªãããã«å¤æ´ï¼
+  
+ã»ã¿ã¼ã²ããä¾å­é¨ã§å®ç¾©ããåç§°ã®ãªãã¼ã ã®è¿½å 
+
+ã»call_texrtnãå¼ã³åºãæ¡ä»¶ã«ãipmflgãtrueããè¿½å 
+ 
+ã»ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã®æ±ãã®å¤æ´
+
+2011/07/22
+ã»x_disable_int() : prc_config.h ã®ä¿®æ­£   
+ å²è¾¼ã¿ç¦æ­¢ã¬ã¸ã¹ã¿ã®ã¢ãã¬ã¹ãåå¾ããéã«ï¼ãã¼ã¹ã®å¤ãuint32_tã®
+ ãã¤ã³ã¿ã«ã­ã£ã¹ããã¦ããªã£ãããï¼æ­£ããã¢ãã¬ã¹ãçæã§ãã¦ããª
+ ãã£ãåé¡ãä¿®æ­£ï¼
+ 
+ã»éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã®åæå¤ãã¯ã­(TOPPERS_ISTKPT)ã®ä¿®æ­£ 
+  : prc_config.h
+ ãã¤ãåä½ã§åå¾ããããã«ï¼(char_t *) ã«ã­ã£ã¹ããã¦æ²è¼ããããã«ä¿®
+ æ­£ï¼
+  
+ã»LOG_INH_ENTRYã¨LOG_INH_LEAVEã®èª¤è¨ : prc_support.S
+  LOG_INH_ENTRYã¨LOG_INH_LEAVEã§ããã¹ãç®æã LOG_EXC_ENTRYã¨
+  LOG_EXC_ENTRYã«ãªã£ã¦ããåé¡ãä¿®æ­£ï¼
+
+ã»TOPPERS_CUSTOM_IDLE ã®typoã®ä¿®æ­£ : prc_support.S
+
+ã»svn_hanlderã®ä¿®æ­£ :  prc_support.S
+  ä¸å¾EXC_FRAME_SIZEåã®ã¹ã¿ãã¯ãæ¨ã¦ã¦ãããï¼Configureation and 
+  Control Register(CCR)ã®STKALIGNã'1'ã®å ´  åã¯ï¼8byteå¢çã«ã¢ã©ã¤ã³
+  ãããããï¼æ¨ã¦ããµã¤ãºãç°ãªãï¼ã¢ã©ã¤ã³ããããã¯ï¼xPSRã®9ãã
+  ãããã§ãã¯ãããã¨ã«ããå¤å®ããï¼
+  
+ã»prc.tfã®ä¿®æ­£
+  boostã®ãã¼ã¸ã§ã³ã«ãã£ã¦å¤ããæåãå¸åï¼
+  http://www.toppers.jp/TOPPERS-USERS/201004/msg00034.html
+  
+ã»_kernel_istkpt ã®åé¤ : prc_cfg1_out.h
+  _kernel_istkpt ãå¿
+è¦ãªãã¿ã¼ã²ãããå­å¨ããããï¼å¿
+è¦ãªãï¼ã¿ã¼ã²
+  ããä¾å­é¨ã§å®ç¾©ããããã«å¤æ´ï¼
+
+2008/08/22
+ã»prc_user.txt/prc_design.txt
+  ã»2008/8/21ã®æè¡æ¤è¨ä¼ã§ã®è­°è«çµæãåæ ï¼
+  
+ã»prc_support.S/prc_config.c/prc_config.h/arm_m.h
+  ã»ã³ã³ãã­ã¹ãå¤å®ãexc_ncntããã¢ã¯ãã£ããªã¹ã¿ãã¯ã«å¤æ´
+  
+ã»prc_config.c
+  ã»set_exc_int_priority() ã§ãµãã¼ãå¯è½ãªIRQã®ä¸éã239ã«æ¡å¼µï¼
+  
+ã»start.S 
+  ã»èµ·åæã¯Threadã¢ã¼ããåæã¨ãã¦ãããã¨ãæè¨ï¼
+  ã»ãã¼ãã­ã¼ãã¼ç­ããèµ·åãããå ´åãæ³å®ãï¼MSPãæå¹ã«ããããã«
+    å¤æ´ï¼
+    
+ã»prc_timer.c
+  ã»ã³ã¡ã³ããä¿®æ­£
+  ã»ãããã°ç¨ã³ã¼ããåé¤
+
+2008/07/11
+ã»æåã®ãªãªã¼ã¹
Index: asp3_wo_tecs/trunk/arch/arm_m_gcc/common/start.S
===================================================================
--- asp3_wo_tecs/trunk/arch/arm_m_gcc/common/start.S	(revision 302)
+++ asp3_wo_tecs/trunk/arch/arm_m_gcc/common/start.S	(revision 302)
@@ -0,0 +1,163 @@
+/*
+ *  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: start.S 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+                
+/*
+ *   ã«ã¼ãã«ç¨ã®ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«(ARM-Mç¨)
+ */
+#define TOPPERS_MACRO_ONLY
+#define UINT_C(val)		(val)		/* uint_tåã®å®æ°ãä½ããã¯ã­ */
+#define ULONG_C(val)	(val)		/* ulong_tåã®å®æ°ãä½ããã¯ã­ */
+#define CAST(type, val)	(val)		/* åã­ã£ã¹ããè¡ããã¯ã­ */
+
+#include "kernel_impl.h"
+#include "arm_m.h"
+#include "target_asm.inc"
+
+/*
+ *  ã¹ã¿ã¼ãã¢ããã«ã¼ãã³
+ *
+ *  Threadã¢ã¼ãã§å¼ã³åºããããã¨ãåæã¨ãã¦ãï¼
+ */
+	ATEXT
+	AALIGN(2)
+	ATHUMB(_start)
+	AGLOBAL(_start) 
+ALABEL(_start)
+	cpsid f                 /* å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¸ */
+
+#ifdef INIT_MSP
+	/*
+	 * MSPã®è¨­å®
+	 */
+	mov   r0, #CONTROL_MSP  /* MSPãæå¹ã«  */
+	msr   control, r0
+	isb                     /* control ã®æä½å¾ã«å¿
+è¦ */
+	ldr  r0,=_kernel_istkpt
+	ldr  r1,[r0]
+	msr  msp, r1
+#endif /* INIT_MSP */
+
+	/*
+	 * hardware_init_hookã®å¼ã³åºã ï¼0ã§ãªãå ´åï¼
+	 *
+	 * ã¿ã¼ã²ãããã¼ãã¦ã§ã¢ã«ä¾å­ãã¦å¿
+è¦ãªåæåå¦çãããå ´å
+	 * ã¯ï¼hardware_init_hook ã¨ããé¢æ°ãç¨æãã
+	 */
+	ldr  r0, =hardware_init_hook
+	cbz  r0, start_1
+	blx  r0
+
+ALABEL(start_1)
+#ifndef OMIT_BSS_INIT
+	/*
+	 *  BSSã»ã¯ã·ã§ã³åæå
+	 */
+	mov  r0, #0
+	ldr  r1, =BSS_START
+	ldr  r2, =BSS_END
+	cmp  r1, r2
+	bhs  start_3
+ALABEL(start_2)
+	str  r0, [r1]
+	add  r1,r1, #4    
+	cmp  r1, r2
+	blo  start_2
+#endif /* OMIT_BSS_INIT */
+
+
+ALABEL(start_3)
+#ifndef OMIT_DATA_INIT
+	/*
+	 *  DATAã»ã¯ã·ã§ã³åæå
+	 *  __idata_start ãã __idata_end ã¾ã§ãï¼__data_start ä»¥éã«
+	 *  ã³ãã¼ãã
+	 */
+	ldr  r1, =IDATA_START
+	ldr  r2, =IDATA_END
+	cmp  r1, r2
+	bhs  start_5
+	ldr  r3, =DATA_START
+ALABEL(start_4)
+	ldr  r0, [r1]
+	str  r0, [r3]
+	add  r1, #4
+	add  r3, #4
+	cmp  r1, r2
+	blo  start_4
+#endif /* OMIT_DATA_INIT */
+
+	/*
+	 *  software_init_hook ãå¼åºãï¼0 ã§ãªãå ´åï¼
+	 *
+	 *  ã½ããã¦ã§ã¢ç°å¢ï¼ç¹ã«ã©ã¤ãã©ãªï¼ã«ä¾å­ãã¦å¿
+è¦ãªåæåå¦
+	 *  çãããå ´åã¯ï¼software_init_hook ã¨ããé¢æ°ãç¨æããã°
+	 *  ããï¼
+	 */
+ALABEL(start_5)
+	ldr  r0, =software_init_hook
+	cbz  r0, start_6
+	blx  r0
+
+ALABEL(start_6)
+	bl   sta_ker
+
+ALABEL(l_end)
+	b   l_end
Index: asp3_wo_tecs/trunk/arch/gcc/tool_stddef.h
===================================================================
--- asp3_wo_tecs/trunk/arch/gcc/tool_stddef.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/gcc/tool_stddef.h	(revision 302)
@@ -0,0 +1,218 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-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: tool_stddef.h 251 2014-10-01 18:01:30Z ertl-hiro $
+ */
+
+/*
+ *		t_stddef.hã®éçºç°å¢ä¾å­é¨ï¼GCCç¨ï¼
+ */
+
+#ifndef TOPPERS_TOOL_STDDEF_H
+#define TOPPERS_TOOL_STDDEF_H
+
+/*
+ *  ã³ã³ãã¤ã©ã®æ¡å¼µæ©è½ã®ããã®ãã¯ã­å®ç¾©
+ */
+#ifndef __cplusplus					/* C++ã«ã¯inline ããã */
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
+									/* C99ã«ã¯inline ããã */
+#define inline	__inline__			/* ã¤ã³ã©ã¤ã³é¢æ° */
+#endif /* !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L */
+#endif /* __cplusplus */
+
+#define Inline	static inline		/* ã¤ã³ã©ã¤ã³é¢æ° */
+
+#ifndef __cplusplus					/* C++ã«ã¯asmããã */
+#define asm		__asm__				/* ã¤ã³ã©ã¤ã³ã¢ã»ã³ãã© */
+#endif /* __cplusplus */
+
+#define Asm		__asm__ volatile	/* ã¤ã³ã©ã¤ã³ã¢ã»ã³ãã©ï¼æé©åææ­¢ï¼*/
+
+#define NoReturn	__attribute__((__noreturn__))
+									/* ãªã¿ã¼ã³ããªãé¢æ° */
+
+/*
+ *  éçºç°å¢ã®æ¨æºã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã®å©ç¨
+ *
+ *  NULLã®å®ç¾©ãstddef.hããï¼INT_MAXï¼INT_MINï¼UINT_MAXï¼LONG_MAXï¼
+ *  LONG_MINï¼ULONG_MAXï¼CHAR_BITã®å®ç¾©ãlimits.hããåãè¾¼ãï¼
+ *
+ *  C++/EC++ã§ã¯ï¼æ¨æºä»æ§ä¸ã¯ãããã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ãç¨æããã¦
+ *  ããã¨ã¯éããªãã®ã§æ³¨æãå¿
+è¦ã§ããï¼ã»ã¨ãã©ã®éçºç°å¢ã§ç¨æãã
+ *  ã¦ããï¼ï¼
+ */
+#ifndef TOPPERS_MACRO_ONLY
+#include <stddef.h>
+#include <limits.h>
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  stdint.hã®ä»£ç¨ã¨ãªãå®ç¾©
+ *
+ *  éçºç°å¢ã«stdint.hãç¨æããã¦ãããï¼åæ´æ°åã®ãµã¤ãºããããã¿ã¼
+ *  ã³ã«å½ã¦ã¯ã¾ãå ´åã«ï¼stdint.hã®ä»£ç¨ã¨ãªãå®ç¾©ãä¸ããï¼
+ *
+ *  TOPPERS_STDINT_TYPE1: char/short/int/long longã®ãããé·ããããã
+ *                        8/16/32/64ãããã§ï¼ãã¤ã³ã¿ã®ãããé·ãlong
+ *                        ã®ãããé·ã¨ä¸è´ããå ´å
+ */
+#ifdef TOPPERS_STDINT_TYPE1
+
+/*
+ *  ã³ã³ãã¤ã©ä¾å­ã®ãã¼ã¿åã®å®ç¾©
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+typedef signed char			int8_t;		/* ç¬¦å·ä»ã8ãããæ´æ° */
+typedef unsigned char		uint8_t;	/* ç¬¦å·ç¡ã8ãããæ´æ° */
+
+typedef signed short		int16_t;	/* ç¬¦å·ä»ã16ãããæ´æ° */
+typedef unsigned short		uint16_t;	/* ç¬¦å·ç¡ã16ãããæ´æ° */
+
+typedef signed int			int32_t;	/* ç¬¦å·ä»ã32ãããæ´æ° */
+typedef unsigned int		uint32_t;	/* ç¬¦å·ç¡ã32ãããæ´æ° */
+
+typedef signed long long	int64_t;	/* ç¬¦å·ä»ã64ãããæ´æ° */
+typedef unsigned long long	uint64_t;	/* ç¬¦å·ç¡ã64ãããæ´æ° */
+
+typedef int8_t				int_least8_t;	/* 8ãããä»¥ä¸ã®ç¬¦å·ä»ãæ´æ° */
+typedef uint8_t				uint_least8_t;	/* 8ãããä»¥ä¸ã®ç¬¦å·ç¡ãæ´æ° */
+
+typedef long				intptr_t;	/* ãã¤ã³ã¿ãæ ¼ç´ã§ããç¬¦å·ä»ãæ´æ° */
+typedef unsigned long		uintptr_t;	/* ãã¤ã³ã¿ãæ ¼ç´ã§ããç¬¦å·ç¡ãæ´æ° */
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ã³ã³ãã¤ã©ä¾å­ã®ãã¼ã¿åã®æ´æ°å®æ°ãä½ããã¯ã­
+ */
+#ifndef INT8_C
+#define INT8_C(val)			(val)
+#endif /* INT8_C */
+
+#ifndef UINT8_C
+#define UINT8_C(val)		(val ## U)
+#endif /* UINT8_C */
+
+#ifndef INT16_C
+#define INT16_C(val)		(val)
+#endif /* INT16_C */
+
+#ifndef UINT16_C
+#define UINT16_C(val)		(val ## U)
+#endif /* UINT16_C */
+
+#ifndef INT32_C
+#define INT32_C(val)		(val)
+#endif /* INT32_C */
+
+#ifndef UINT32_C
+#define UINT32_C(val)		(val ## U)
+#endif /* UINT32_C */
+
+#ifndef INT64_C
+#define INT64_C(val)		(val ## LL)
+#endif /* INT64_C */
+
+#ifndef UINT64_C
+#define UINT64_C(val)		(val ## ULL)
+#endif /* UINT64_C */
+
+/*
+ *  ã³ã³ãã¤ã©ä¾å­ã®ãã¼ã¿åã«æ ¼ç´ã§ããæå¤§å¤ã¨æå°å¤ã®å®ç¾©
+ */
+#define INT8_MAX			SCHAR_MAX
+#define INT8_MIN			SCHAR_MIN
+#define UINT8_MAX			UCHAR_MAX
+
+#define INT16_MAX			SHRT_MAX
+#define INT16_MIN			SHRT_MIN
+#define UINT16_MAX			USHRT_MAX
+
+#define INT32_MAX			INT_MAX
+#define INT32_MIN			INT_MIN
+#define UINT32_MAX			UINT_MAX
+
+#define INT64_MAX			LLONG_MAX
+#define INT64_MIN			LLONG_MIN
+#define UINT64_MAX			ULLONG_MAX
+
+#define INT_LEAST8_MAX		INT8_MAX
+#define INT_LEAST8_MIN		INT8_MIN
+#define UINT_LEAST8_MAX		INT8_MAX
+
+#endif /* TOPPERS_STDINT_TYPE1 */
+
+/*
+ *  æµ®åå°æ°ç¹åã«é¢ããå®ç¾©
+ *
+ *  TOPPERS_STDFLOAT_TYPE1: floatãIEEE754æºæ ã®åç²¾åº¦æµ®åå°æ°ç¹æ°ï¼
+ *							doubleãåç²¾åº¦æµ®åå°æ°ç¹æ°ã®å ´å
+ */
+#ifdef TOPPERS_STDFLOAT_TYPE1
+#ifndef TOPPERS_MACRO_ONLY
+
+typedef float		float32_t;			/* IEEE754æºæ ã®åç²¾åº¦æµ®åå°æ°ç¹æ° */
+typedef double		double64_t;			/* IEEE754æºæ ã®åç²¾åº¦æµ®åå°æ°ç¹æ° */
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+#define FLOAT32_MIN		1.17549435e-38F
+#define FLOAT32_MAX		3.40282347e+38F
+#define DOUBLE64_MIN	2.2250738585072014e-308
+#define DOUBLE64_MAX	1.7976931348623157e+308
+
+#endif /* TOPPERS_STDFLOAT_TYPE1 */
+#endif /* TOPPERS_TOOL_STDDEF_H */
Index: asp3_wo_tecs/trunk/arch/logtrace/trace_config.c
===================================================================
--- asp3_wo_tecs/trunk/arch/logtrace/trace_config.c	(revision 302)
+++ asp3_wo_tecs/trunk/arch/logtrace/trace_config.c	(revision 302)
@@ -0,0 +1,278 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-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: trace_config.c 502 2016-01-11 23:59:50Z ertl-hiro $
+ */
+
+/*
+ *		ãã¬ã¼ã¹ã­ã°æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "task.h"
+#include "time_event.h"
+#include <sil.h>
+
+/*
+ *  ã­ã°æå»ã®åãåºã
+ *
+ *  ããã©ã«ãã§ã¯ï¼ã­ã°æå»ã¨ãã¦ï¼é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ãç¨ãã¦
+ *  ããï¼ã¿ã¼ã²ããä¾å­ã§å¤æ´ããå ´åã«ã¯ï¼SYSLOG_GET_LOGTIMã«ï¼ã­ã°æ
+ *  å»ãåãåºããã¯ã­ãå®ç¾©ããï¼
+ */
+#ifndef SYSLOG_GET_LOGTIM
+#define SYSLOG_GET_LOGTIM(p_logtim) \
+				(*(p_logtim) = target_hrt_get_current())
+#endif /* SYSLOG_GET_LOGTIM */
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãããã¡ã¨ããã«ã¢ã¯ã»ã¹ããããã®ãã¤ã³ã¿
+ */
+SYSLOG	trace_buffer[TCNT_TRACE_BUFFER];	/* ãã¬ã¼ã¹ã­ã°ãããã¡ */
+uint_t	trace_count;				/* ãã¬ã¼ã¹ã­ã°ãããã¡ä¸­ã®ã­ã°ã®æ° */
+uint_t	trace_head;					/* å
+é ­ã®ãã¬ã¼ã¹ã­ã°ã®æ ¼ç´ä½ç½® */
+uint_t	trace_tail;					/* æ¬¡ã®ãã¬ã¼ã¹ã­ã°ã®æ ¼ç´ä½ç½® */
+MODE	trace_mode;					/* ãã¬ã¼ã¹ã¢ã¼ã */
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°æ©è½ã®åæå
+ */
+void
+trace_initialize(intptr_t exinf)
+{
+	MODE	mode = ((MODE) exinf);
+
+	trace_count = 0U;
+	trace_head = 0U;
+	trace_tail = 0U;
+	trace_mode = mode;
+}     
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã®éå§
+ */
+ER
+trace_sta_log(MODE mode)
+{
+	if ((mode & TRACE_CLEAR) != 0U) {
+		trace_count = 0U;
+		trace_head = 0U;
+		trace_tail = 0U;
+		mode &= ~TRACE_CLEAR;
+	}
+	trace_mode = mode;
+	return(E_OK);
+}     
+
+/* 
+ *  ãã¬ã¼ã¹ã­ã°ã®æ¸è¾¼ã¿
+ */
+ER
+trace_wri_log(TRACE *p_trace)
+{
+	SIL_PRE_LOC;
+
+	if ((trace_mode & (TRACE_RINGBUF | TRACE_AUTOSTOP)) != 0U) {
+		SIL_LOC_INT();
+
+		/*
+		 *  ãã¬ã¼ã¹æå»ã®è¨­å®
+		 *
+		 *  LOG_SYSLOG_WRI_LOG_ENTERããå¼ã°ããå ´åã«p_trace->logtimã
+		 *  æ¸ãæãã¦ãã¾ãã®ã¯æ°æã¡ãæªããï¼syslog_wri_logã®æ¹ã§ä¸
+		 *  æ¸ãããããåé¡ã¯ãªãï¼
+		 */
+		SYSLOG_GET_LOGTIM(&(p_trace->logtim));
+
+		/*
+		 *  ãã¬ã¼ã¹ãããã¡ã«è¨é²
+		 */
+		trace_buffer[trace_tail] = *p_trace;
+		trace_tail++;
+		if (trace_tail >= TCNT_TRACE_BUFFER) {
+			trace_tail = 0U;
+		}
+		if (trace_count < TCNT_TRACE_BUFFER) {
+			trace_count++;
+			if (trace_count >= TCNT_TRACE_BUFFER
+						&& (trace_mode & TRACE_AUTOSTOP) != 0U) {
+				trace_mode = TRACE_STOP;
+			}
+		}
+		else {
+			trace_head = trace_tail;
+		}
+
+		SIL_UNL_INT();
+	}
+	return(E_OK);
+}
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã®èª­åºã
+ */
+ER
+trace_rea_log(TRACE *p_trace)
+{
+	ER_UINT	ercd;
+	SIL_PRE_LOC;
+
+	SIL_LOC_INT();
+
+	/*
+	 *  ãã¬ã¼ã¹ã­ã°ãããã¡ããã®ååºã
+	 */
+	if (trace_count > 0U) {
+		*p_trace = trace_buffer[trace_head];
+		trace_count--;
+		trace_head++;
+		if (trace_head >= TCNT_TRACE_BUFFER) {
+			trace_head = 0U;
+		}
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_OBJ;
+	}
+
+	SIL_UNL_INT();
+	return(ercd);
+}
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãåºåããããã®ã©ã¤ãã©ãªé¢æ°
+ */
+
+void
+trace_write_0(uint_t type)
+{
+	TRACE	trace;
+
+	trace.logtype = type;
+	(void) trace_wri_log(&trace);
+}
+
+void
+trace_write_1(uint_t type, intptr_t arg1)
+{
+	TRACE	trace;
+
+	trace.logtype = type;
+	trace.logpar[0] = arg1;
+	(void) trace_wri_log(&trace);
+}
+
+void
+trace_write_2(uint_t type, intptr_t arg1, intptr_t arg2)
+{
+	TRACE	trace;
+
+	trace.logtype = type;
+	trace.logpar[0] = arg1;
+	trace.logpar[1] = arg2;
+	(void) trace_wri_log(&trace);
+}
+
+void
+trace_write_3(uint_t type, intptr_t arg1, intptr_t arg2, intptr_t arg3)
+{
+	TRACE	trace;
+
+	trace.logtype = type;
+	trace.logpar[0] = arg1;
+	trace.logpar[1] = arg2;
+	trace.logpar[2] = arg3;
+	(void) trace_wri_log(&trace);
+}
+
+/*
+ *  ã¢ã»ã³ããªè¨èªã§è¨è¿°ãããã³ã¼ããããã¬ã¼ã¹ã­ã°ãåºåããããã®é¢
+ *  æ°
+ */
+
+void
+log_dsp_enter(TCB *p_tcb)
+{
+	trace_1(LOG_TYPE_DSP|LOG_ENTER, p_tcb);
+}
+
+void
+log_dsp_leave(TCB *p_tcb)
+{
+	trace_1(LOG_TYPE_DSP|LOG_LEAVE, p_tcb);
+}
+
+void
+log_inh_enter(INHNO inhno)
+{
+	trace_1(LOG_TYPE_INH|LOG_ENTER, inhno);
+}
+
+void
+log_inh_leave(INHNO inhno)
+{
+	trace_1(LOG_TYPE_INH|LOG_LEAVE, inhno);
+}
+
+void
+log_exc_enter(EXCNO excno)
+{
+	trace_1(LOG_TYPE_EXC|LOG_ENTER, excno);
+}
+
+void
+log_exc_leave(EXCNO excno)
+{
+	trace_1(LOG_TYPE_EXC|LOG_LEAVE, excno);
+}
Index: asp3_wo_tecs/trunk/arch/logtrace/trace_config.cfg
===================================================================
--- asp3_wo_tecs/trunk/arch/logtrace/trace_config.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/arch/logtrace/trace_config.cfg	(revision 302)
@@ -0,0 +1,9 @@
+/*
+ *		ãã¬ã¼ã¹ã­ã°æ©è½ãçµã¿è¾¼ãããã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: trace_config.cfg 401 2015-08-02 05:19:13Z ertl-hiro $
+ */
+
+#include "arch/logtrace/trace_config.h"
+ATT_INI({ TA_NULL, TRACE_AUTOSTOP, trace_initialize });
+ATT_TER({ TA_NULL, target_fput_log, trace_dump });
Index: asp3_wo_tecs/trunk/arch/logtrace/trace_config.h
===================================================================
--- asp3_wo_tecs/trunk/arch/logtrace/trace_config.h	(revision 302)
+++ asp3_wo_tecs/trunk/arch/logtrace/trace_config.h	(revision 302)
@@ -0,0 +1,192 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-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: trace_config.h 502 2016-01-11 23:59:50Z ertl-hiro $
+ */
+
+/*
+ *		ãã¬ã¼ã¹ã­ã°ã«é¢ããè¨­å®
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼target_config.hããã³target_syssvc.hã®
+ *  ã¿ããã¤ã³ã¯ã«ã¼ããããï¼ã¾ãï¼ãã¬ã¼ã¹ã­ã°æ©è½ã®åæåãè¨é²ã®é
+ *  å§ï¼åæ­¢ï¼ãã¬ã¼ã¹ã­ã°ã®ãã³ããè¡ããã­ã°ã©ã ããã¤ã³ã¯ã«ã¼ããã
+ *  ãã¨ãæ³å®ãã¦ããï¼
+ */
+
+#ifndef TOPPERS_TRACE_CONFIG_H
+#define TOPPERS_TRACE_CONFIG_H
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãããã¡ã®ãµã¤ãº
+ */
+#ifndef TCNT_TRACE_BUFFER
+#define TCNT_TRACE_BUFFER	1024
+#endif /* TCNT_TRACE_BUFFER */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã®ãã¼ã¿æ§é 
+ *
+ *  ã·ã¹ãã ã­ã°æ©è½ã®ã­ã°æ
+å ±ã®ãã¼ã¿æ§é ã¨åããã®ãç¨ããï¼
+ */
+#include <t_syslog.h>
+typedef	SYSLOG	TRACE;
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãããã¡ã¨ããã«ã¢ã¯ã»ã¹ããããã®ãã¤ã³ã¿
+ */
+extern TRACE	trace_buffer[];		/* ãã¬ã¼ã¹ã­ã°ãããã¡ */
+extern uint_t	trace_count;		/* ãã¬ã¼ã¹ã­ã°ãããã¡ä¸­ã®ã­ã°ã®æ° */
+extern uint_t	trace_head;			/* å
+é ­ã®ãã¬ã¼ã¹ã­ã°ã®æ ¼ç´ä½ç½® */
+extern uint_t	trace_tail;			/* æ¬¡ã®ãã¬ã¼ã¹ã­ã°ã®æ ¼ç´ä½ç½® */
+extern uint_t	trace_lost;			/* å¤±ããããã¬ã¼ã¹ã®æ° */
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ãã¬ã¼ã¹ã¢ã¼ãã®å®ç¾©
+ */
+#define TRACE_STOP			UINT_C(0x00)	/* ãã¬ã¼ã¹åæ­¢ */
+#define TRACE_RINGBUF		UINT_C(0x01)	/* ãªã³ã°ãããã¡ã¢ã¼ã */
+#define TRACE_AUTOSTOP		UINT_C(0x02)	/* èªååæ­¢ã¢ã¼ã */
+#define TRACE_CLEAR			UINT_C(0x04)	/* ãã¬ã¼ã¹ã­ã°ã®ã¯ãªã¢ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°æ©è½ã®åæå
+ *
+ *  ãã¬ã¼ã¹ã­ã°æ©è½ãåæåããï¼åæåã«ã¼ãã³ã¨ãã¦ç»é²ãããã¨ãæ³
+ *  å®ãã¦ããï¼å¼æ°ã«ããæ¬¡ã®åä½ãè¡ãï¼
+ *
+ *  TRACE_STOPï¼åæåã®ã¿ã§ãã¬ã¼ã¹ã¯éå§ããªãï¼
+ *  TRACE_RINGBUFï¼ãªã³ã°ãããã¡ã¢ã¼ãã§ãã¬ã¼ã¹ãéå§ï¼
+ *  TRACE_AUTOSTOPï¼èªååæ­¢ã¢ã¼ãã§ãã¬ã¼ã¹ãéå§ï¼
+ */
+extern void	trace_initialize(intptr_t exinf);
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã®éå§
+ *
+ *  ãã¬ã¼ã¹ã­ã°ã®è¨é²ãéå§ï¼åæ­¢ããï¼å¼æ°ã«ããæ¬¡ã®åä½ãè¡ãï¼
+ *
+ *  TRACE_STOPï¼ãã¬ã¼ã¹ãåæ­¢ï¼
+ *  TRACE_RINGBUFï¼ãªã³ã°ãããã¡ã¢ã¼ãã§ãã¬ã¼ã¹ãéå§ï¼
+ *  TRACE_AUTOSTOPï¼èªååæ­¢ã¢ã¼ãã§ãã¬ã¼ã¹ãéå§ï¼
+ *  TRACE_CLEARï¼ãã¬ã¼ã¹ã­ã°ãã¯ãªã¢ï¼
+ */
+extern ER	trace_sta_log(MODE mode);
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã®æ¸è¾¼ã¿
+ */
+extern ER	trace_wri_log(TRACE *p_trace);
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã®èª­åºã
+ */
+extern ER	trace_rea_log(TRACE *p_trace);
+
+/* 
+ *  ãã¬ã¼ã¹ã­ã°ã®ãã³ãï¼trace_dump.cï¼
+ *
+ *  ãã¬ã¼ã¹ã­ã°ããã³ãããï¼çµäºå¦çã«ã¼ãã³ã¨ãã¦ç»é²ãããã¨ãæ³å®
+ *  ãã¦ããï¼å¼æ°ã¨ãã¦ï¼ãã³ãå
+ã¨ãªãæå­åºåé¢æ°ã¸ã®ãã¤ã³ã¿ãæ¸¡ãï¼
+ *  ã¿ã¼ã²ããä¾å­ã®ä½ã¬ãã«æå­åºåãå©ç¨ããå ´åã«ã¯ï¼target_putcãæ¸¡
+ *  ãï¼
+ */
+extern void	trace_dump(intptr_t exinf);
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãåºåããããã®ã©ã¤ãã©ãªé¢æ°
+ */
+extern void	trace_write_0(uint_t type);
+extern void	trace_write_1(uint_t type, intptr_t arg1);
+extern void	trace_write_2(uint_t type, intptr_t arg1, intptr_t arg2);
+extern void	trace_write_3(uint_t type, intptr_t arg1, intptr_t arg2,
+														intptr_t arg3);
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãåºåããããã®ãã¯ã­
+ */
+
+#define trace_0(type) \
+				trace_write_0(type)
+
+#define trace_1(type, arg1) \
+				trace_write_1(type, (intptr_t)(arg1))
+
+#define trace_2(type, arg1, arg2) \
+				trace_write_2(type, (intptr_t)(arg1), (intptr_t)(arg2))
+
+#define trace_3(type, arg1, arg2, arg3) \
+				trace_write_3(type, (intptr_t)(arg1), (intptr_t)(arg2), \
+						(intptr_t)(arg3))
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°æ¹æ³ã®è¨­å®
+ */
+#define LOG_TSKSTAT(p_tcb)		trace_2(LOG_TYPE_TSKSTAT, p_tcb, p_tcb->tstat)
+
+#define LOG_DSP_LEAVE(p_tcb)	trace_1(LOG_TYPE_DSP|LOG_LEAVE, p_tcb)
+
+#define LOG_SYSLOG_WRI_LOG_ENTER(prio, p_syslog) \
+								trace_wri_log((TRACE *) p_syslog)
+
+#endif /* TOPPERS_TRACE_CONFIG_H */
Index: asp3_wo_tecs/trunk/arch/logtrace/trace_dump.c
===================================================================
--- asp3_wo_tecs/trunk/arch/logtrace/trace_dump.c	(revision 302)
+++ asp3_wo_tecs/trunk/arch/logtrace/trace_dump.c	(revision 302)
@@ -0,0 +1,169 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: trace_dump.c 292 2014-11-29 21:16:57Z ertl-hiro $
+ */
+
+/*
+ *		ãã¬ã¼ã¹ã­ã°ã®ãã³ã
+ */
+
+#include "kernel_impl.h"
+#include "task.h"
+#include <log_output.h>
+
+/* 
+ *  ã«ã¼ãã«æ
+å ±ã®ååºã
+ */
+static intptr_t
+get_tskid(intptr_t info)
+{
+	TCB		*p_tcb;
+	ID		tskid;
+
+	p_tcb = (TCB *) info;
+	if (p_tcb == NULL) {
+		tskid = 0;
+	}
+	else {
+		tskid = TSKID(p_tcb);
+	}
+	return((intptr_t) tskid);
+}
+
+static intptr_t
+get_tskstat(intptr_t info)
+{
+	uint_t		tstat;
+	const char	*tstatstr;
+
+	tstat = (uint_t) info;
+	if (TSTAT_DORMANT(tstat)) {
+		tstatstr = "DORMANT";
+	}
+	else {
+		if (TSTAT_SUSPENDED(tstat)) {
+			if (TSTAT_WAITING(tstat)) {
+				tstatstr = "WAITING-SUSPENDED";
+			}
+			else {
+				tstatstr = "SUSPENDED";
+			}
+		}
+		else if (TSTAT_WAITING(tstat)) {
+			tstatstr = "WAITING";
+		}
+		else {
+			tstatstr = "RUNNABLE";
+		}
+	}
+	return((intptr_t) tstatstr);
+}
+
+/* 
+ *  ãã¬ã¼ã¹ã­ã°ã®è¡¨ç¤º
+ */
+static void
+trace_print(TRACE *p_trace, void (*putc)(char))
+{
+	intptr_t	traceinfo[TNUM_LOGPAR + 1];
+	const char	*tracemsg;
+	int_t		i;
+
+	traceinfo[0] = (intptr_t)(p_trace->logtim);
+	syslog_printf("[%d] ", traceinfo, putc);
+
+	switch (p_trace->logtype) {
+	case LOG_TYPE_TSKSTAT:
+		traceinfo[0] = get_tskid(p_trace->logpar[0]);
+		traceinfo[1] = get_tskstat(p_trace->logpar[1]);
+		tracemsg = "task %d becomes %s.";
+		break;
+	case LOG_TYPE_DSP|LOG_LEAVE:
+		traceinfo[0] = get_tskid(p_trace->logpar[0]);
+		tracemsg = "dispatch to task %d.";
+		break;
+	case LOG_TYPE_COMMENT:
+		for (i = 1; i < TNUM_LOGPAR; i++) {
+			traceinfo[i-1] = p_trace->logpar[i];
+		}
+		tracemsg = (const char *)(p_trace->logpar[0]);
+		break;
+	case LOG_TYPE_ASSERT:
+		traceinfo[0] = p_trace->logpar[0];
+		traceinfo[1] = p_trace->logpar[1];
+		traceinfo[2] = p_trace->logpar[2];
+		tracemsg = "%s:%u: Assertion `%s' failed.";
+		break;
+	default:
+		traceinfo[0] = p_trace->logtype;
+		tracemsg = "unknown trace log type: %d.";
+		break;
+	}
+	syslog_printf(tracemsg, traceinfo, putc);
+	(*putc)('\n');
+}
+
+/* 
+ *  ãã¬ã¼ã¹ã­ã°ã®ãã³ã
+ */
+void
+trace_dump(intptr_t exinf)
+{
+	TRACE	trace;
+	void	(*putc)(char);
+
+	putc = (void (*)(char)) exinf;
+	while (trace_rea_log(&trace) >= 0) {
+		trace_print(&trace, putc);
+	}
+}
Index: asp3_wo_tecs/trunk/configure
===================================================================
--- asp3_wo_tecs/trunk/configure	(revision 302)
+++ asp3_wo_tecs/trunk/configure	(revision 302)
@@ -0,0 +1,275 @@
+#! /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/doc/asp_spec.txt
===================================================================
--- asp3_wo_tecs/trunk/doc/asp_spec.txt	(revision 302)
+++ asp3_wo_tecs/trunk/doc/asp_spec.txt	(revision 302)
@@ -0,0 +1,879 @@
+
+		TOPPERS/ASP3ã«ã¼ãã«ã®ä»æ§æ¦è¦
+
+		å¯¾å¿ãã¼ã¸ã§ã³: Release 3.0
+		æçµæ´æ°: 2016å¹´1æ10æ¥
+
+ãã®ãã­ã¥ã¡ã³ãã¯ï¼TOPPERS/ASP3ã«ã¼ãã«ï¼TOPPERS/ASPã«ã¼ãã« Release
+3.Xï¼ã®ä»æ§æ¦è¦ã«ã¤ãã¦èª¬æãããã®ã§ããï¼Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ã
+ãã­ãã¡ã¤ã«ã«å¯¾ããæ¡å¼µããã³å¤æ´ç®æãä¸­å¿ã«èª¬æãããï¼TOPPERS/JSPã«ã¼
+ãã«ããã³TOPPERS/ASPã«ã¼ãã«Release 1.Xããã®å¤æ´ç®æããããããã«èª¬
+æããï¼
+
+ãªãï¼TOPPERS/ASP3ã«ã¼ãã«ã®è©³ç´°ãªä»æ§ã«ã¤ãã¦ã¯ï¼ãTOPPERSç¬¬3ä¸ä»£ã«ã¼
+ãã«ï¼ITRONç³»ï¼çµ±åä»æ§æ¸ããåç
+§ãããã¨ï¼
+
+----------------------------------------------------------------------
+ TOPPERS/ASP Kernel
+     Toyohashi Open Platform for Embedded Real-Time Systems/
+     Advanced Standard Profile Kernel
+
+ 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: asp_spec.txt 493 2016-01-10 07:17:13Z ertl-hiro $
+----------------------------------------------------------------------
+
+âç®æ¬¡
+
+ã»åæã¨ãªãæç« 
+ã»ãã®ãã­ã¥ã¡ã³ãã®èª­ã¿æ¹
+ã»ä»æ§ã®æ¦ç¥
+ã»ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«å¤ã®æ©è½ã®ä¸é¨å°å
+¥
+	(1-1) ã¤ãã³ããã©ã°ã®è¤æ°ã¿ã¹ã¯å¾
+ã¡
+	(1-2) ãã¥ã¼ããã¯ã¹
+	(1-3) ã¢ã©ã¼ã ãã³ãã©
+	(1-4) å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+	(1-5) å²è¾¼ã¿ç®¡çæ©è½
+	(1-6) ãªãã¸ã§ã¯ãã®ç¶æ
+åç
+§
+ã»ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«ã®æ©è½ã®ä¸é¨å»æ­¢
+	(2-1) ã¿ã¹ã¯ä¾å¤å¦çæ©è½
+	(2-2) ã¡ã¼ã«ããã¯ã¹
+ã»ç¬èªã®æ¡å¼µæ©è½
+	(3-1) ã¿ã¹ã¯çµäºè¦æ±æ©è½
+	(3-2) åªå
+åº¦ãã¼ã¿ã­ã¥ã¼
+	(3-3) ã·ã¹ãã æå»ã®èª¿æ´
+	(3-4) åæã»éä¿¡ãªãã¸ã§ã¯ãã®ååæå
+	(3-5) å¨æéç¥æ©è½ã¨ã¢ã©ã¼ã éç¥æ©è½
+	(3-6) ã¿ã¹ã¯ã¨ã¹ã±ã¸ã¥ã¼ãªã³ã°ç¶æ
+ã®åç
+§
+	(3-7) èµ·åè¦æ±ãã­ã¥ã¼ã¤ã³ã°ããªãã¿ã¹ã¯
+	(3-8) èªã¿ã¹ã¯ã®æ¡å¼µæ
+å ±ã®åç
+§
+	(3-9) é«åè§£è½ã¿ã¤ãã®åç
+§
+	(3-10) ã«ã¼ãã«åä½ç¶æ
+ã®åç
+§
+	(3-11) ã«ã¼ãã«ã®çµäº
+	(3-12) å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ã®è¨­å®
+	(3-13) éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã®è¨­å®
+	(3-14) çµäºå¦çã«ã¼ãã³
+ã»Î¼ITRON4.0ä»æ§ã«å¯¾ããä¿®æ­£
+	(4-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãããµã¼ãã¹ã³ã¼ã«ã®åç§°
+	(4-2) ITRONæ¨æºãã¼ã¿å
+	(4-3) å¤ã0ã®å®æ°ï¼ãªãã¸ã§ã¯ãå±æ§ç­ï¼
+	(4-4) ã«ã¼ãã«ã®ç¨ããç®¡çé åã®åé¢ã¨æå®æ¹æ³
+	(4-5) å¦çåä½ã¨ã¡ã¢ãªé åã®ãã¼ã¿å
+	(4-6) å²è¾¼ã¿å¦çï¼ä¾å¤å¦çé¢é£ã®åã®å®ç¾©
+	(4-7) æéç®¡çé¢é£ã®ãã¼ã¿åã¨æéåä½
+	(4-8) å¦çåä½ã®å®è¡éå§ï¼ãªã¿ã¼ã³æã®ã·ã¹ãã ç¶æ
+
+	(4-9) ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã®æ±ãã®è¦å®
+	(4-10) CPUä¾å¤ãã³ãã©ã§è¡ããæä½
+	(4-11) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®ext_tsk
+	(4-12) å¼·å¶å¾
+ã¡è¦æ±ãã¹ãã®å»æ­¢
+	(4-13) ã·ã¹ãã æå»ã®æ´æ°æ©æ§ã®æ±ã
+	(4-14) ã·ã¹ãã æå»ã®è¨­å®æ©è½ã®ãã©ã¡ã¼ã¿ã®å¤æ´
+	(4-15) å¨æãã³ãã©ã®ä»æ§å¤æ´
+	(4-16) ã¢ããªã±ã¼ã·ã§ã³åãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã®æ§æ
+ã»ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³å¦çã®è¦ç´ã
+ã»æ¡å¼µããã±ã¼ã¸ã®ãµãã¼ã
+ã»TOPPERSçµè¾¼ã¿ã³ã³ãã¼ãã³ãã·ã¹ãã ï¼TECSï¼ã®å°å
+¥
+
+âåæã¨ãªãææ¸
+
+[1] ãã­ã³åä¼: Î¼ITRON4.0ä»æ§ï¼Ver.4.02.00ï¼2004å¹´ï¼
+
+[2] ãã­ã³åä¼: Î¼ITRON4.0ä»æ§ ä¿è­·æ©è½æ¡å¼µï¼Î¼ITRON4.0/PXä»æ§ï¼,
+	Ver.1.00.00ï¼2002å¹´ï¼
+
+[3] TOPPERSãã­ã¸ã§ã¯ã: TOPPERS/JSPã«ã¼ãã« ã¦ã¼ã¶ãºããã¥ã¢ã«
+	Release 1.4.3å¯¾å¿ï¼æçµæ´æ°: 2007å¹´4æ23æ¥ï¼
+
+[4] TOPPERSãã­ã¸ã§ã¯ã: TOPPERSæ°ä¸ä»£ã«ã¼ãã«çµ±åä»æ§æ¸ï¼Release
+	1.7.1ï¼æçµæ´æ°: 2015å¹´5æ30æ¥ï¼
+
+[5] TOPPERSãã­ã¸ã§ã¯ã: TOPPERS/ASPã«ã¼ãã« ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ï¼
+	Release 1.9.2ï¼æçµæ´æ°: 2015å¹´2æ8æ¥ï¼
+
+[6] TOPPERSãã­ã¸ã§ã¯ã: TOPPERSç¬¬3ä¸ä»£ã«ã¼ãã«ï¼ITRONç³»ï¼çµ±åä»æ§æ¸ï¼
+	Release 3.B.0ï¼æçµæ´æ°: 2015å¹´6æ29æ¥ï¼
+
+âãã®ãã­ã¥ã¡ã³ãã®èª­ã¿æ¹
+
+ãã®ãã­ã¥ã¡ã³ãã§ã¯ï¼TOPPERS/ASP3ã«ã¼ãã«ï¼TOPPERS/ASPã«ã¼ãã«
+Release 3.Xï¼ä»¥ä¸ï¼ASP3ã«ã¼ãã«ï¼ã®ä»æ§ã®æ¦è¦ã«ã¤ãã¦ï¼Î¼ITRON4.0ä»æ§ã®
+ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«ã«å¯¾ãã¦ã©ã®ãããªæ¡å¼µããã³å¤æ´ãè¡ã£ããã¨ã
+ãè¦³ç¹ããè¨è¿°ããï¼ã¾ãï¼TOPPERS/JSPã«ã¼ãã«ï¼ä»¥ä¸ï¼JSPã«ã¼ãã«ï¼ãã
+ã³TOPPERS/ASPã«ã¼ãã« Release 1.Xï¼ä»¥ä¸ï¼ASP1ã«ã¼ãã«ï¼ã¨ã®éãã«ã¤ãã¦
+ãè¨è¿°ããï¼
+
+JSPã«ã¼ãã«ã®ä»æ§ã¯ï¼åºæ¬çã«ã¯Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«
+ã«æºæ ãã¦ããï¼Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«ã«é¢ããè¨è¿°ã¯ï¼
+æç¤ºçã«è¨è¿°ããªãéãï¼JSPã«ã¼ãã«ã«ãå½ã¦ã¯ã¾ãï¼
+
+ASP1ã«ã¼ãã«ã®ä»æ§ã¯ï¼Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«ããã¯ï¼
+ASP3ã«ã¼ãã«ã®ä»æ§ã«è¿ãï¼ããã§ï¼ãã®ãã­ã¥ã¡ã³ãã§åã«ãASPã«ã¼ãã«ã§
+ã¯ãã¨è¨è¿°ããå ´åã«ã¯ï¼ASP1ã«ã¼ãã«ã¨ASP3ã«ã¼ãã«ã®ä¸¡æ¹ã«å½ã¦ã¯ã¾ãã
+ã¨ãç¤ºãï¼ASP1ã«ã¼ãã«ã¾ãã¯ASP3ã«ã¼ãã«ã®ããããã«ããå½ã¦ã¯ã¾ããªã
+å ´åã«ã¯ï¼æç¤ºçã«ãASP1ã«ã¼ãã«ã§ã¯ããASP3ã«ã¼ãã«ã§ã¯ãã¨è¨è¿°ããï¼
+
+âä»æ§ã®æ¦ç¥
+
+ASPã«ã¼ãã«ã®ä»æ§ã¯ï¼Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«ããã¼ã¹ã«ï¼
+æ§ã
+ãªæ¡å¼µããã³å¤æ´ãå ãããã®ã§ããï¼
+
+ASPã«ã¼ãã«ã§ã¯ï¼Î¼ITRON4.0ä»æ§ã§å®è£
+å®ç¾©ã®ä»æ§ãå¤ãæ®ã£ã¦ããå²è¾¼ã¿å¦
+çæ©è½ã«ã¤ãã¦ï¼TOPPERSæ¨æºå²è¾¼ã¿å¦çã¢ãã«ã«å¾ã£ã¦ï¼ã¿ã¼ã²ããå®ç¾©ã®ä»
+æ§ãæå°éã«ãªãããã«è¦å®ãã¦ããï¼
+
+Î¼ITRON4.0ä»æ§ã§ã¯ï¼å®è£
+ç¬èªã«ç¨æããéçAPIããã³ãµã¼ãã¹ã³ã¼ã«ã®åç§°
+ã«ã¯ï¼å
+é ­ã«ãããã"V"ããã³"v"ã®æå­ãä»å ãããã®ã¨ãã¦ãããï¼ASPã«ã¼
+ãã«ã§ã¯ãã®è¦å®ã¯æ¡ç¨ãã¦ããªãï¼
+
+ã¾ãï¼Î¼ITRON4.0ä»æ§ããã³ASP1ã«ã¼ãã«ã§ã¯ï¼ãµã¼ãã¹ã³ã¼ã«åã"i"ã§å§ã¾
+ããµã¼ãã¹ã³ã¼ã«ãï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãå°ç¨ã®ãµã¼ãã¹ã³ã¼ã«ã¨å¼ã³ï¼å
+åã®éãï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãã®ã¿ããå¼ã³åºããã¨ãã§ãããã®ã¨ãã¦ã
+ããï¼ASP3ã«ã¼ãã«ã§ã¯ãã®ä»æ§ã¯æ¡ç¨ãã¦ãããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãã
+ããã¿ã¹ã¯ã³ã³ãã­ã¹ãã¨åãåç§°ã®ãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºããã¨ã«ãã¦ã
+ãï¼ããã«ä¼´ãï¼ASP3ã«ã¼ãã«ã§ã¯ï¼åç§°ã"i"ã§å§ã¾ããµã¼ãã¹ã³ã¼ã«ã¯ï¼
+"i"ãåã£ããµã¼ãã¹ã³ã¼ã«ã«ãã¯ã­å®ç¾©ãã¦ããï¼
+
+âã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«å¤ã®æ©è½ã®ä¸é¨å°å
+¥
+
+Î¼ITRON4.0ä»æ§ã«ã¯è¦å®ããã¦ãããï¼ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«ã«å«ã¾ããª
+ãï¼ã¾ãã¯ï¼å«ã¾ããã¨ã¯éããªãï¼æ©è½ã¨ãã¦ï¼ASPã«ã¼ãã«ã§ã¯ï¼æ¬¡ã®æ©è½
+ãå®è£
+ãã¦ããï¼
+
+(1-1) ã¤ãã³ããã©ã°ã®è¤æ°ã¿ã¹ã¯å¾
+ã¡
+
+ã¤ãã³ããã©ã°ã«å¯¾ããè¤æ°ã¿ã¹ã¯å¾
+ã¡ã®æ©è½ï¼TA_WMULå±æ§ã®ã¤ãã³ããã©ã°ï¼
+ãå®è£
+ãã¦ããï¼
+
+ããã«ããï¼ã¤ãã³ããã©ã°ã®ã»ããï¼set_flgï¼ã§è¤æ°ã®ã¿ã¹ã¯ãèµ·åºããã
+å¯è½æ§ãçããï¼å¤ãã®ã¿ã¹ã¯ãåæã«å¾
+ã¡è§£é¤ããå ´åï¼ã«ã¼ãã«å
+ã§ã®å²
+è¾¼ã¿ç¦æ­¢æéãé·ããªãããï¼ä½¿ç¨ã«ããã£ã¦ã¯æ³¨æãå¿
+è¦ã§ããï¼
+
+(1-2) ãã¥ã¼ããã¯ã¹
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ãã¥ã¼ããã¯ã¹ã®æ©è½ï¼åªå
+åº¦ç¶æ¿å±æ§ãé¤ãï¼ãå®è£
+ã
+ã¦ããï¼ãã ãï¼ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤ã¯ï¼ã­ãã¯ããã®ã¨éé ã§è¡ã
+ãªããã°ãªããªããã®ã¨å¶éãã¦ããï¼ã¾ãï¼chg_priã«ããã¦ï¼å¯¾è±¡ã¿ã¹ã¯ã
+åãåªå
+åº¦ã®ã¿ã¹ã¯ã®ä¸­ã§æä½ã®åªå
+é ä½ã¨ãªãæ¡ä»¶ãå¤æ´ãã¦ããï¼
+
+ãã¥ã¼ããã¯ã¹æ©è½ã®ããã«å®è£
+ãã¦ããéçAPIããã³ãµã¼ãã¹ã³ã¼ã«ã¯æ¬¡ã®
+éãã§ããï¼
+
+	CRE_MTX		ãã¥ã¼ããã¯ã¹ã®çæï¼éçAPIï¼
+	loc_mtx		ãã¥ã¼ããã¯ã¹ã®ã­ãã¯
+	ploc_mtx	ãã¥ã¼ããã¯ã¹ã®ã­ãã¯ï¼ãã¼ãªã³ã°ï¼
+	tloc_mtx	ãã¥ã¼ããã¯ã¹ã®ã­ãã¯ï¼ã¿ã¤ã ã¢ã¦ãä»ãï¼
+	unl_mtx		ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤
+
+ãªãï¼ASP1ã«ã¼ãã«ã§ã¯ï¼ãã¥ã¼ããã¯ã¹ã®æ©è½ããã¥ã¼ããã¯ã¹æ©è½æ¡å¼µãã
+ã±ã¼ã¸ã§ãµãã¼ããã¦ããï¼ASP1ã«ã¼ãã«ã®ãã¥ã¼ããã¯ã¹æ©è½æ¡å¼µããã±ã¼
+ã¸ã«ã¯ï¼ã­ãã¯è§£é¤é ã«é¢ããå¶éã¯ãªãï¼
+
+(1-3) ã¢ã©ã¼ã ãã³ãã©
+
+ã¢ã©ã¼ã ãã³ãã©ï¼ASP3ã«ã¼ãã«ã§ã¯ï¼ã¢ã©ã¼ã éç¥ï¼ã®æ©è½ãå®è£
+ãã¦ããï¼
+ã¢ã©ã¼ã ãã³ãã©æ©è½ã®ããã«å®è£
+ãã¦ããéçAPIããã³ãµã¼ãã¹ã³ã¼ã«ã¯æ¬¡
+ã®éãã§ããï¼
+
+	CRE_ALM		ã¢ã©ã¼ã ãã³ãã©ã®çæï¼éçAPIï¼
+	sta_alm		ã¢ã©ã¼ã ãã³ãã©ã®åä½éå§
+	stp_alm		ã¢ã©ã¼ã ãã³ãã©ã®åä½åæ­¢
+
+(1-4) å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+
+Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«ã§ã¯ï¼å²è¾¼ã¿ãã³ãã©ã¨å²è¾¼ã¿ãµã¼
+ãã¹ã«ã¼ãã³ã®ããããããµãã¼ãããã°ãããã¨ã«ãªã£ã¦ããï¼JSPã«ã¼ãã«
+ã§ã¯å²è¾¼ã¿ãã³ãã©ã®ã¿ãå®è£
+ãã¦ãããï¼ASPã«ã¼ãã«ã§ã¯ãã®ä¸¡è
+ãå®è£
+ã
+ã¦ããï¼
+
+å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®ä»æ§ã«ã¤ãã¦ã¯ï¼TOPPERSæ¨æºå²è¾¼ã¿å¦çã¢ãã«ã®è¦
+å®ã«æºæ ãã¦ããï¼ASP3ã«ã¼ãã«ã§ã¯ï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ãç»é²ãããµã¼
+ãã¹ã³ã¼ã«ã¨ãã¦ï¼æ¬¡ã®éçAPIãå®è£
+ãã¦ããï¼
+
+	CRE_ISR		å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®çæï¼éçAPIï¼
+
+ãªãï¼ASP1ã«ã¼ãã«ã§ã¯ï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ãç»é²ããããã®éçAPIã¨
+ãã¦ï¼ATT_ISRãå®è£
+ãã¦ããï¼ASP1ã«ã¼ãã«ã®ATT_ISRã§ã¯ï¼Î¼ITRON4.0ä»æ§
+ã®ATT_ISRã«å¯¾ãã¦ï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®ãã©ã¡ã¼ã¿ãè¿½å ãã¦ã
+ããï¼ASP3ã«ã¼ãã«ã®CRE_ISRããã®ãã©ã¡ã¼ã¿ãæã£ã¦ããï¼
+
+(1-5) å²è¾¼ã¿ç®¡çæ©è½
+
+Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«ã«å«ã¾ããªãå²è¾¼ã¿ç®¡çæ©è½ã¨ã
+ã¦ï¼æ¬¡ã®ãµã¼ãã¹ã³ã¼ã«ãå®è£
+ãã¦ããï¼JSPã«ã¼ãã«ã§ã¯ï¼ãããã®ãµã¼ãã¹
+ã³ã¼ã«ãå®è£
+ãããã©ããã¯ã¿ã¼ã²ããä¾å­ã¨ãªã£ã¦ãããï¼ASPã«ã¼ãã«ã§ã¯ï¼
+TOPPERSæ¨æºå²è¾¼ã¿å¦çã¢ãã«ã®è¦å®ã«æºæ ãã¦ï¼ã¿ã¼ã²ããéä¾å­ã«å®è£
+ãã¦
+ããï¼
+
+	dis_int		å²è¾¼ã¿ã®ç¦æ­¢
+	ena_int		å²è¾¼ã¿ã®è¨±å¯
+	chg_ipm		å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®å¤æ´
+	get_ipm		å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®åç
+§
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼dis_intã¨ena_intã¯ï¼CPUã­ãã¯ç¶æ
+ã§ãï¼éã¿ã¹ã¯ã³ã³ã
+ã­ã¹ããããå¼ã³åºãããã®ã¨ãã¦ããï¼ASP1ã«ã¼ãã«ã§ã¯ï¼CPUã­ãã¯ç¶æ
+ã
+ãã¯å¼ã³åºãããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã¯å¼ã³åºããªãï¼
+
+(1-6) ãªãã¸ã§ã¯ãã®ç¶æ
+åç
+§
+
+ãããã°æåãã®æ©è½ã¨ãã¦ï¼ãªãã¸ã§ã¯ãã®ç¶æ
+åç
+§æ©è½ãå®è£
+ãã¦ããï¼
+å
+·ä½çã«ã¯ï¼æ¬¡ã®ãµã¼ãã¹ã³ã¼ã«ãå®è£
+ãã¦ããï¼
+
+	ref_tsk		ã¿ã¹ã¯ã®ç¶æ
+åç
+§
+	ref_sem		ã»ããã©ã®ç¶æ
+åç
+§
+	ref_flg		ã¤ãã³ããã©ã°ã®ç¶æ
+åç
+§
+	ref_dtq		ãã¼ã¿ã­ã¥ã¼ã®ç¶æ
+åç
+§
+	ref_mtx		ãã¥ã¼ããã¯ã¹ã®ç¶æ
+åç
+§
+	ref_mpf		åºå®é·ã¡ã¢ãªãã¼ã«ã®ç¶æ
+åç
+§
+	ref_cyc		å¨æãã³ãã©ã®ç¶æ
+åç
+§
+	ref_alm		ã¢ã©ã¼ã ãã³ãã©ã®ç¶æ
+åç
+§
+
+âã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«ã®æ©è½ã®ä¸é¨å»æ­¢
+
+Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«ã«å«ã¾ããæ©è½ã®ä¸­ã§ï¼ASP3ã«ã¼
+ãã«ã§ã¯æ¬¡ã®æ©è½ã¯å®è£
+ãã¦ããªãï¼ãªãï¼ASP1ã«ã¼ãã«ã§ã¯ï¼ãããã®æ©è½
+ãå®è£
+ãã¦ããï¼
+
+(2-1) ã¿ã¹ã¯ä¾å¤å¦çæ©è½
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼å®è£
+ãè¤éåããã®ã«å¯¾ãã¦ï¼ä½¿ç¨é »åº¦ãä½ããã¨ããï¼
+ã¿ã¹ã¯ä¾å¤å¦çæ©è½ã¯å®è£
+ãã¦ããªãï¼å
+·ä½çã«ã¯ï¼Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³
+ãã¼ããã­ãã¡ã¤ã«ã«å«ã¾ããéçAPIããã³ãµã¼ãã¹ã³ã¼ã«ã®ä¸­ã§ï¼æ¬¡ã®éç
+APIããã³ãµã¼ãã¹ã³ã¼ã«ãå®è£
+ãã¦ããªãï¼
+
+	DEF_TEX		ã¿ã¹ã¯ä¾å¤å¦çã«ã¼ãã³ã®å®ç¾©ï¼éçAPIï¼
+	ras_tex		ã¿ã¹ã¯ä¾å¤å¦çã®è¦æ±
+	dis_tex		ã¿ã¹ã¯ä¾å¤å¦çã®ç¦æ­¢
+	ena_tex		ã¿ã¹ã¯ä¾å¤å¦çã®è¨±å¯
+	sns_tex		ã¿ã¹ã¯ä¾å¤å¦çç¦æ­¢ç¶æ
+ã®åç
+§
+
+ASP1ã«ã¼ãã«ã§ã¯ï¼ä¸ã«å ãã¦ï¼æ¬¡ã®ãµã¼ãã¹ã³ã¼ã«ãå®è£
+ãã¦ãããï¼ASP3
+ã«ã¼ãã«ã§ã¯å®è£
+ãã¦ããªãï¼
+
+	ref_tex		ã¿ã¹ã¯ä¾å¤å¦çã®ç¶æ
+åç
+§
+
+ãªãï¼ASP3ã«ã¼ãã«ã§ã¯ï¼ã¿ã¹ã¯ä¾å¤å¦çæ©è½ãå»æ­¢ããä»£ããã«ï¼å¾è¿°ã®ã¿
+ã¹ã¯çµäºè¦æ±æ©è½ãå®è£
+ãã¦ããï¼
+
+(2-2) ã¡ã¼ã«ããã¯ã¹
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ä¿è­·æ©è½å¯¾å¿ã«ã¼ãã«ã¨ã®äºææ§ãéè¦ãï¼ã¡ã¼ã«ããã¯
+ã¹ã®æ©è½ã¯å®è£
+ãã¦ããªãï¼å
+·ä½çã«ã¯ï¼Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ããã­
+ãã¡ã¤ã«ã«å«ã¾ããéçAPIããã³ãµã¼ãã¹ã³ã¼ã«ã®ä¸­ã§ï¼æ¬¡ã®éçAPIããã³
+ãµã¼ãã¹ã³ã¼ã«ãå®è£
+ãã¦ããªãï¼
+
+	CRE_MBX		ã¡ã¼ã«ããã¯ã¹ã®çæï¼éçAPIï¼
+	snd_mbx		ã¡ã¼ã«ããã¯ã¹ã¸ã®éä¿¡
+	rcv_mbx		ã¡ã¼ã«ããã¯ã¹ããã®åä¿¡
+	prcv_mbx	ã¡ã¼ã«ããã¯ã¹ããã®åä¿¡ï¼ãã¼ãªã³ã°ï¼
+	trcv_mbx	ã¡ã¼ã«ããã¯ã¹ããã®åä¿¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+
+ASP1ã«ã¼ãã«ã§ã¯ï¼ä¸ã«å ãã¦ï¼æ¬¡ã®ãµã¼ãã¹ã³ã¼ã«ãå®è£
+ãã¦ãããï¼ASP3
+ã«ã¼ãã«ã§ã¯å®è£
+ãã¦ããªãï¼
+
+	ref_mbx		ã¡ã¼ã«ããã¯ã¹ã®ç¶æ
+åç
+§
+
+ãªãï¼ã¡ã¼ã«ããã¯ã¹ã®æ©è½ã¯ï¼ãã¼ã¿ã­ã¥ã¼ããã³åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®æ©
+è½ã§ä»£æ¿ãããã¨ãã§ããï¼
+
+âç¬èªã®æ¡å¼µæ©è½
+
+ASPã«ã¼ãã«ã§ã¯ï¼Î¼ITRON4.0ä»æ§ã«å¯¾ããç¬èªã®æ¡å¼µæ©è½ã¨ãã¦ï¼æ¬¡ã®æ©è½ã
+å®è£
+ãã¦ããï¼
+
+(3-1) ã¿ã¹ã¯çµäºè¦æ±æ©è½
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ã¿ã¹ã¯ä¾å¤å¦çæ©è½ã«ä»£ãã¦ï¼ã¿ã¹ã¯çµäºè¦æ±æ©è½ãè¿½å 
+ãã¦ããï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®ãµã¼ãã¹ã³ã¼ã«ãå®è£
+ãã¦ããï¼
+
+	ras_ter		ã¿ã¹ã¯ã®çµäºè¦æ±
+	dis_ter		ã¿ã¹ã¯çµäºã®ç¦æ­¢
+	ena_ter		ã¿ã¹ã¯çµäºã®è¨±å¯
+	sns_ter		ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã®åç
+§
+
+ã¾ãï¼ref_tskã§åç
+§ã§ããæ
+å ±ã«ï¼ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ï¼rasterï¼ã¨ã¿ã¹ã¯çµ
+äºç¦æ­¢ç¶æ
+ãå¦ãï¼disterï¼ãè¿½å ãã¦ããï¼
+
+ã¿ã¹ã¯ã«å¯¾ãã¦çµäºè¦æ±ãåºãããå ´åï¼å¾
+ã¡ç¶æ
+ã«å
+¥ããã¹ã¦ã®ãµã¼ãã¹ã³ã¼
+ã«ããï¼E_RASTERãè¿ãå¯è½æ§ãããï¼E_RASTERã¯ï¼Î¼ITRON4.0ä»æ§ãASP1ã«ã¼
+ãã«ã§ã¯å®ç¾©ãã¦ããªãã¨ã©ã¼ã³ã¼ãã§ããï¼
+
+(3-2) åªå
+åº¦ãã¼ã¿ã­ã¥ã¼
+
+åªå
+åº¦ä»ãã®ãã¼ã¿ã­ã¥ã¼ã®æ©è½ãè¿½å ãã¦ããï¼åªå
+åº¦ä»ããã¼ã¿ã­ã¥ã¼æ©
+è½ã®ããã«å®è£
+ãã¦ããéçAPIããã³ãµã¼ãã¹ã³ã¼ã«ã¯æ¬¡ã®éãã§ããï¼
+
+	CRE_PDQ		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®çæ
+	snd_pdq		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡
+	psnd_pdq	åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ï¼ãã¼ãªã³ã°ï¼
+	tsnd_pdq	åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+	rcv_pdq		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡
+	prcv_pdq	åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡ï¼ãã¼ãªã³ã°ï¼
+	trcv_pdq	åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+	ref_pdq		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®ç¶æ
+åç
+§
+
+ããã§ï¼åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã«èç©ããããã¼ã¿ã®æ°ãå¤ãå ´åï¼åªå
+åº¦ãã¼
+ã¿ã­ã¥ã¼ã¸ã®ãã¼ã¿ã®éä¿¡ãè¡ããµã¼ãã¹ã³ã¼ã«ï¼snd_pdqï¼psnd_pdqï¼
+tsnd_pdqï¼ã®å¦çæéãé·ããªãï¼ã«ã¼ãã«å
+ã§ã®å²è¾¼ã¿ç¦æ­¢æéãé·ããªã
+ããï¼ä½¿ç¨ã«ããã£ã¦ã¯æ³¨æãå¿
+è¦ã§ããï¼
+
+(3-3) ã·ã¹ãã æå»ã®èª¿æ´
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ã·ã¹ãã æå»ãèª¿æ´ããããã®æ©è½ãè¿½å ãã¦ããï¼ãã®
+æ©è½ã®ããã®ãµã¼ãã¹ã³ã¼ã«ã¯æ¬¡ã®éãã§ããï¼
+
+	adj_tim		ã·ã¹ãã æå»ã®èª¿æ´
+
+(3-4) åæã»éä¿¡ãªãã¸ã§ã¯ãã®ååæå
+
+åæã»éä¿¡ãªãã¸ã§ã¯ããåæç¶æ
+ã«æ»ãããã®æ©è½ã¨ãã¦ï¼æ¬¡ã®ãµã¼ãã¹ã³ã¼
+ã«ãå®è£
+ãã¦ããï¼
+
+	ini_sem		ã»ããã©ã®ååæå
+	ini_flg		ã¤ãã³ããã©ã°ã®ååæå
+	ini_dtq		ãã¼ã¿ã­ã¥ã¼ã®ååæå
+	ini_pdq		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®ååæå
+	ini_mtx		ãã¥ã¼ããã¯ã¹ã®ååæå
+	ini_mpf		åºå®é·ã¡ã¢ãªãã¼ã«ã®ååæå
+
+åæã»éä¿¡ãªãã¸ã§ã¯ãã®ååæåã®éã«ï¼ãã®åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾
+ãã¦å¾
+ã¡ç¶æ
+ã¨ãªã£ã¦ããã¿ã¹ã¯ã¯ãã¹ã¦å¾
+ã¡è§£é¤ãããï¼å¾
+ã¡è§£é¤ãããã¿
+ã¹ã¯ã«å¯¾ãã¦ã¯ï¼E_DLTãè¿ãï¼E_DLTã¯ï¼Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ããã­
+ãã¡ã¤ã«ã§ã¯ä½¿ç¨ãã¦ããªãã¨ã©ã¼ã³ã¼ãã§ããï¼
+
+ãã®ããï¼ãããã®ãµã¼ãã¹ã³ã¼ã«ã«ããï¼è¤æ°ã®ã¿ã¹ã¯ãèµ·åºãããå¯è½æ§
+ãçããï¼å¤ãã®ã¿ã¹ã¯ãåæã«å¾
+ã¡è§£é¤ããå ´åï¼ã«ã¼ãã«å
+ã§ã®å²è¾¼ã¿ç¦
+æ­¢æéãé·ããªãããï¼ä½¿ç¨ã«ããã£ã¦ã¯æ³¨æãå¿
+è¦ã§ããï¼
+
+åæã»éä¿¡ãªãã¸ã§ã¯ããååæåããéã«ï¼ã¢ããªã±ã¼ã·ã§ã³å´ã¨ã®æ´åæ§
+ãä¿ã¤ã®ã¯ã¢ããªã±ã¼ã·ã§ã³ã®è²¬ä»»ã§ããï¼ä¾ãã°ï¼åºå®é·ã¡ã¢ãªãã¼ã«ãå
+åæåããéã«ã¯ï¼ããããç²å¾æ¸ã¿ã®ã¡ã¢ãªãã­ãã¯ãããä»¥éä½¿ããªãã
+ãã«ããªããã°ãªããªãï¼
+
+(3-5) å¨æéç¥æ©è½ã¨ã¢ã©ã¼ã éç¥æ©è½
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼å¨æãã³ãã©æ©è½ã¨ã¢ã©ã¼ã ãã³ãã©æ©è½ãæ¡å¼µãï¼å¨æ
+éç¥æ©è½ã¨ã¢ã©ã¼ã éç¥æ©è½ãå®è£
+ãã¦ããï¼
+
+ããã«ãã£ã¦ï¼æ¬¡ã®éçAPIã®ãã©ã¡ã¼ã¿ã¨æ©è½ãå¤æ´ãã¦ããï¼
+
+	CRE_CYC		å¨æéç¥ã®çæ
+	CRE_ALM		ã¢ã©ã¼ã éç¥ã®çæ
+
+(3-6) ã¿ã¹ã¯ã¨ã¹ã±ã¸ã¥ã¼ãªã³ã°ç¶æ
+ã®åç
+§
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ã¿ã¹ã¯ã¨ã¹ã±ã¸ã¥ã¼ãªã³ã°ç¶æ
+ãåç
+§ããããã®æ©è½ã¨ã
+ã¦ï¼æ¬¡ã®ãµã¼ãã¹ã³ã¼ã«ãå®è£
+ãã¦ããï¼
+
+	get_tst		ã¿ã¹ã¯ç¶æ
+ã®åç
+§
+	get_lod		å®è¡ã§ããã¿ã¹ã¯ã®æ°ã®åç
+§
+	get_nth		æå®ããåªå
+é ä½ã®ã¿ã¹ã¯IDã®åç
+§
+
+(3-7) èµ·åè¦æ±ãã­ã¥ã¼ã¤ã³ã°ããªãã¿ã¹ã¯
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼èµ·åè¦æ±ãã­ã¥ã¼ã¤ã³ã°ããªãã¿ã¹ã¯ãè¡¨ãã¿ã¹ã¯å±æ§ã¨
+ãã¦ï¼TA_NOACTQUEãè¿½å ãã¦ããï¼
+
+(3-8) èªã¿ã¹ã¯ã®æ¡å¼µæ
+å ±ã®åç
+§
+
+ã©ã¤ãã©ãªç­ã®ä¸­ã§ç¨ãããã¨ãæ³å®ãã¦ï¼èªã¿ã¹ã¯ã®æ¡å¼µæ
+å ±ãåç
+§ããã
+ãã®ãµã¼ãã¹ã³ã¼ã«ãè¿½å ãã¦ããï¼
+
+	get_inf		èªã¿ã¹ã¯ã®æ¡å¼µæ
+å ±ã®åç
+§
+
+(3-9) é«åè§£è½ã¿ã¤ãã®åç
+§
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ã«ã¼ãã«ä¸ã§åä½ããã¿ã¹ã¯ãã«ã¼ãã«èªèº«ã®æ§è½è©ä¾¡ã«
+ç¨ãããã¨ãç®çã«ï¼é«åè§£è½ã¿ã¤ããåç
+§ããããã®ãµã¼ãã¹ã³ã¼ã«ãè¿½å 
+ãã¦ããï¼
+
+	fch_hrt		é«åè§£è½ã¿ã¤ãã®åç
+§
+
+ãªãï¼ASP1ã«ã¼ãã«ã§ã¯ï¼æ§è½è©ä¾¡ã«ç¨ããããã®ãµã¼ãã¹ã³ã¼ã«ã¨ãã¦ï¼
+get_utmï¼æ§è½è©ä¾¡ç¨ã·ã¹ãã æå»åç
+§ï¼ããµãã¼ããã¦ããï¼ã¾ãJSPã«ã¼ã
+ã«ã§ã¯ï¼åãç®çã®ãµã¼ãã¹ã³ã¼ã«ã¨ãã¦ï¼vxget_timããµãã¼ããã¦ããï¼
+
+(3-10) ã«ã¼ãã«åä½ç¶æ
+ã®åç
+§
+
+ã«ã¼ãã«ä¸ã§åä½ããã¿ã¹ã¯ããå¼ã³åºãããé¢æ°ãï¼ã«ã¼ãã«ã®åæåå®äº
+åãçµäºå¦çéå§å¾ã«ãå¼ã³åºãããå¯è½æ§ãããå ´åã«ã¯ï¼ãã®ä¸­ã§ã«ã¼ã
+ã«ã®ãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºããããå¤å¥ãããã¨ãå¿
+è¦ã¨ãªãï¼ãã®æ©è½ã®
+ããã®ãµã¼ãã¹ã³ã¼ã«ã¯æ¬¡ã®éãã§ããï¼
+
+	sns_ker		ã«ã¼ãã«éåä½ç¶æ
+ã®åç
+§
+
+ãªãï¼JSPã«ã¼ãã«ã§ã¯ï¼ç¬èªã®æ¡å¼µæ©è½ã¨ãã¦ãã®æ©è½ããµãã¼ããã¦ãããï¼
+ãµã¼ãã¹ã³ã¼ã«ã®åç§°ã¯vsns_iniã¨ãã¦ããï¼
+
+(3-11) ã«ã¼ãã«ã®çµäº
+
+è´å½çãªã¨ã©ã¼ãèµ·ãã£ãå ´åãªã©ã«ã«ã¼ãã«ãçµäºãããããã®ãµã¼ãã¹ã³ã¼
+ã«ãè¿½å ãã¦ããï¼
+
+	ext_ker		ã«ã¼ãã«ã®çµäº
+
+ASPã«ã¼ãã«ã§ã¯ãã®ãµã¼ãã¹ã³ã¼ã«ãããªã¿ã¼ã³ãããã¨ã¯ãªããï¼ä¿è­·æ©è½
+ãæã£ãã«ã¼ãã«ã§ã¯ã¨ã©ã¼ãªã¿ã¼ã³ããå¯è½æ§ãããããï¼è¿ãå¤ã®åãER
+ã¨ãã¦ããï¼
+
+JSPã«ã¼ãã«ã§ã¯ï¼kernel_exitã¨ããåç§°ã§ï¼å®è³ªçã«ãã®æ©è½ãç¨æãã¦ã
+ãï¼ã¾ãï¼ã«ã¼ãã«ã®å®è¡ãéå§ããé¢æ°ãï¼JSPã«ã¼ãã«ã§ã¯kernel_startã¨
+ããåç§°ã¨ãã¦ããã®ãï¼ASPã«ã¼ãã«ã§ã¯sta_kerã«åç§°å¤æ´ããï¼sta_kerã¯ï¼
+ãµã¼ãã¹ã³ã¼ã«ã¨ã¯è¦ãªããªããã¨ã«ãã¦ããï¼
+
+(3-12) å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ã®è¨­å®
+
+å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ãè¨­å®ããæ©è½ã¨ãã¦ï¼TOPPERSæ¨æºå²è¾¼ã¿å¦çã¢ãã«
+ã§è¦å®ãããæ¬¡ã®éçAPIãå®è£
+ãã¦ããï¼
+
+	CFG_INT		å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ã®è¨­å®ï¼éçAPIï¼
+
+(3-13) éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã®è¨­å®
+
+éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã®å
+é ­çªå°ã¨ãµã¤ãºãæå®ããããã®
+éçAPIãæ°è¨­ãã¦ããï¼ã¾ãï¼ãã®éçAPIã«ããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨
+ã®ã¹ã¿ãã¯é åã®ãµã¤ãºã®ã¿ãæå®ãããã¨ãã§ããï¼
+
+	DEF_ICS		éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã®è¨­å®
+
+(3-14) çµäºå¦çã«ã¼ãã³
+
+ã·ã¹ãã ã®çµäºæã«å¼ã³åºãããçµäºå¦çã«ã¼ãã³ãç»é²ããããã®æ©è½ããµ
+ãã¼ããã¦ããï¼ãã®æ©è½ã®ããã®éçAPIã¯æ¬¡ã®éãã§ããï¼
+
+	ATT_TER		çµäºå¦çã«ã¼ãã³ã®è¿½å ï¼éçAPIï¼
+
+ãªãï¼JSPã«ã¼ãã«ã§ã¯ï¼ç¬èªã®æ¡å¼µæ©è½ã¨ãã¦ãã®æ©è½ããµãã¼ããã¦ãããï¼
+éçAPIã®åç§°ã¯VATT_TERã¨ãã¦ããï¼
+
+âÎ¼ITRON4.0ä»æ§ã«å¯¾ããå¤æ´
+
+ASPã«ã¼ãã«ã§ã¯ï¼Î¼ITRON4.0ä»æ§ã§ã®è¦å®ã«å¯¾ãã¦ï¼æ¬¡ã®å¤æ´ãè¡ã£ã¦ããï¼
+
+(4-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãããµã¼ãã¹ã³ã¼ã«ã®åç§°
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãå°ç¨ã®ãµã¼ãã¹ã³ã¼ã«ã®æ¦å¿µãå»æ­¢
+ãï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ããããï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã¨åãåç§°ã®ãµã¼ãã¹
+ã³ã¼ã«ãå¼ã³åºããã¨ã«ãã¦ããï¼ããã«ä¼´ãï¼åç§°ã"i"ã§å§ã¾ããµã¼ãã¹ã³ã¼
+ã«ã¯ï¼"i"ãåã£ããµã¼ãã¹ã³ã¼ã«ã«ãã¯ã­å®ç¾©ãã¦ããï¼
+
+(4-2) æ¨æºãã¼ã¿å
+
+ITRONæ¨æºãã¼ã¿åã®ä¸­ã§ï¼C90ãC99ã«ããã«ç¸å½ãããã®ãããå ´åã«ã¯ï¼
+C90ãC99ã«æºæ ããåã®åç§°ã«å¤æ´ãã¦ããï¼ä¾ãã°ï¼ãµã¤ãºã®æ±ºã¾ã£ãæ´æ°
+åï¼Bï¼Hï¼Wãªã©ï¼ã¯C99ã«æºæ ããåã®åç§°ï¼int8_tï¼int16_tï¼int32_tãªã©ï¼
+ã«ï¼VP_INTã¯C99æºæ ã®intptr_tã«ï¼INTã¨UINTã¯C99ã®ååã¨ç¸æ§ãè¯ãint_t
+ã¨uint_tã«ï¼BOOLãbool_tã«ï¼ããããå¤æ´ããï¼VPã¯ï¼void *ã¨ç­ä¾¡ã§ãã
+ããï¼ç¨æããªããã¨ã«ããï¼éã«ï¼ããã¤ãã®ãã¼ã¿åãæ°ãã«ç¨ãããã¨
+ã«ããï¼ããã«ASP3ã«ã¼ãã«ã§ã¯ï¼SIZEã¯C90æºæ ã®size_tã«å¤æ´ããï¼
+
+ãªãï¼ITRONæ¨æºãã¼ã¿åï¼Bï¼Hï¼Wãªã©ï¼ãå¿
+è¦ã¨ããã¢ããªã±ã¼ã·ã§ã³ã®ã
+ãã«ï¼itron.hãç¨æãã¦ããï¼
+
+(4-3) å¤ã0ã®å®æ°ï¼ãªãã¸ã§ã¯ãå±æ§ç­ï¼
+
+ã³ã¼ãã£ã³ã°ãã¹ãé²ãããã«ï¼å¤ã0ã®å®æ°ã®æ±ããè¦ç´ããï¼ãªãã¸ã§ã¯ã
+å±æ§ï¼TA_TFIFOç­ï¼ã«ã¤ãã¦ã¯ï¼å¤ã0ã®ãã®ã¯ããã©ã«ãæ±ããã¦å»æ­¢ãï¼å®
+ç¾©ãitron.hã«ç§»ããï¼å¤ã0ã®ãµã¼ãã¹ã³ã¼ã«ã®åä½ã¢ã¼ãï¼TWF_ANDWï¼ããª
+ãã¸ã§ã¯ãã®ç¶æ
+ï¼TCYC_STPç­ï¼ã«ã¤ãã¦ã¯ï¼å¤ãå¤æ´ããï¼
+
+(4-4) ã«ã¼ãã«ã®ç¨ããç®¡çé åã®åé¢ã¨æå®æ¹æ³
+
+Î¼ITRON4.0/PXä»æ§ã«ããã¦å°å
+¥ãããÎ¼ITRON4.0ä»æ§ã«å¯¾ããå¤æ´ã¨ãã¦ï¼ã«ã¼
+ãã«ã®ç¨ããç®¡çé åã®åé¢ã«é¢ããä»æ§ãä¸é¨æ¡ç¨ãã¦ããï¼
+
+ã¾ãï¼åºå®é·ã¡ã¢ãªãã¼ã«ã«ããã¦ï¼ã«ã¼ãã«ã®ç¨ããç®¡çé åãåé¢ããã
+ã¨ã«ä¼´ãï¼åºå®é·ã¡ã¢ãªãã¼ã«ãçæããéçAPIï¼CRE_MPFï¼ã®ãã©ã¡ã¼ã¿ã«ï¼
+åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çé åã®å
+é ­çªå°ï¼mpfmbï¼ãè¿½å ãã¦ããï¼
+
+ã¾ãï¼ããã«æ´åãããããã«ï¼ãã¼ã¿ã­ã¥ã¼ãçæããéçAPIï¼CRE_DTQï¼
+ã®æå¾ã®ãã©ã¡ã¼ã¿ã®åç§°ãï¼ãã¼ã¿ã­ã¥ã¼ç®¡çé åã®å
+é ­çªå°ï¼dtqmbï¼ã«å¤
+æ´ãã¦ããï¼
+
+JSPã«ã¼ãã«ã§ã¯ï¼ã«ã¼ãã«ã®ç¨ããé åã¯ãã¹ã¦èªåå²ä»ãã®ã¿ããµãã¼ãã
+ã¦ãããï¼ASPã«ã¼ãã«ã§ã¯ï¼ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åã¨åºå®é·ã¡ã¢ãªãã¼ã«ã®åº
+å®é·ã¡ã¢ãªãã¼ã«é åã«ã¤ãã¦ã¯ï¼éçAPIã§å
+é ­çªå°ãæå®ãããã¨ãã§ãã
+ãã®ã¨ãã¦ããï¼èªåå²ä»ãããµãã¼ããã¦ããï¼ï¼
+
+(4-5) å¦çåä½ã¨ã¡ã¢ãªé åã®ãã¼ã¿å
+
+å¦çåä½ã®ã¨ã³ããªçªå°ã®ãã¼ã¿åãï¼ãã©ã¡ã¼ã¿ãåæ ãããªãFPåã§ã¯ãª
+ãï¼å¦çåä½æ¯ã®å°ç¨ã®ãã¼ã¿åã¨ãã¦ããï¼ä¾ãã°ï¼ã¿ã¹ã¯ã®ã¡ã¤ã³ã«ã¼ã
+ã³ã®å
+é ­çªå°ã®ãã¼ã¿åãTASKåï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®å
+é ­çªå°ã®ãã¼
+ã¿åãISRåã¨ãã¦ããï¼
+
+ã¾ãï¼ã¹ã¿ãã¯é åã¨åºå®é·ã¡ã¢ãªãã¼ã«é åã®å
+é ­çªå°ã®ãã¼ã¿åãï¼ãã
+ããSTK_Tåã¨MPF_Tåã¨ãã¦ããï¼
+
+(4-6) å²è¾¼ã¿å¦çï¼ä¾å¤å¦çé¢é£ã®åã®å®ç¾©
+
+å²è¾¼ã¿ãã³ãã©çªå·ã®åï¼INHNOï¼ï¼å²è¾¼ã¿çªå·ã®åï¼INTNOï¼ï¼CPUä¾å¤ãã³ã
+ã©çªå·ã®åï¼EXCNOï¼ãï¼ã¿ã¼ã²ããéä¾å­é¨ã§ï¼ããããuint_tåã«å®ç¾©ãã¦
+ããï¼
+
+(4-7) æéç®¡çé¢é£ã®ãã¼ã¿åã¨æéåä½
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ã·ã¹ãã æå»ï¼SYSTIMåï¼ï¼ç¸å¯¾æéï¼RELTIMåï¼ï¼ã¿ã¤
+ã ã¢ã¦ãæéï¼TMOåï¼ã®æéåä½ãï¼ãã¤ã¯ã­ç§ã«å¤æ´ããï¼ã¾ãï¼SYSTIMã®
+ãµã¤ãºã¯64ãããï¼ãã ãï¼64ãããã®æ´æ°åããµãã¼ãããã¦ããªãã¿ã¼ã²ã
+ãã§ã¯32ãããï¼ï¼RELTIMã¨TMOã®ãµã¤ãºã¯32ãããã¨è¦å®ããï¼ããã«ï¼TMO
+ã¯ç¬¦å·ç¡ãæ´æ°åã«å¤æ´ããï¼
+
+Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«ã¨ASP1ã«ã¼ãã«ã§ã¯ï¼ãããã®æ
+éã®æéåä½ã¯ããªç§ã§ããï¼ã¾ãï¼ãµã¤ãºã¯å®è£
+å®ç¾©ï¼æä½ã®é·ãã¯è¦å®ã
+ãã¦ããï¼ã¨ãªã£ã¦ããï¼
+
+(4-8) å¦çåä½ã®å®è¡éå§ï¼ãªã¿ã¼ã³æã®ã·ã¹ãã ç¶æ
+
+
+å¦çåä½ã®å®è¡éå§ï¼ãªã¿ã¼ã³æã®ã·ã¹ãã ç¶æ
+ã«ã¤ãã¦ï¼Î¼ITRON4.0ä»æ§ã«
+ããã¦å®è£
+ä¾å­ã§ãã£ãç¹ãå³å¯ã«è¦å®ãï¼ã¿ã¼ã²ããã«ããéããçããªã
+ããã«ãã¦ããï¼
+
+ASP1ã«ã¼ãã«ã¨ASP3ã«ã¼ãã«ã§ã¯ï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã¨ã¿ã¤ã ã¤ãã³ã
+ãã³ãã©ã®å®è¡éå§ï¼ãªã¿ã¼ã³æã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®æ±ããç°ãªã£ã¦ããï¼
+
+(4-9) ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã®æ±ãã®è¦å®
+
+JSPã«ã¼ãã«ã§ã¯ã¿ã¼ã²ããæ¯ã«å®ãã¦ããã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã®æ±ããï¼
+ASPã«ã¼ãã«ã§ã¯ï¼TOPPERSæ¨æºå²è¾¼ã¿å¦çã¢ãã«ã®è¦å®ã«æºæ ãã¦ï¼å¯è½ãªç¯
+å²ã§æ¨æºåãã¦ããï¼ãã ãï¼NMIä»¥å¤ã«ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãè¨­ããããï¼
+ã©ã®å²è¾¼ã¿åªå
+åº¦ããé«ããã®ãã«ã¼ãã«ç®¡çå¤ã¨ãããã¯ï¼ã¿ã¼ã²ããæ¯ã«
+å®ãããã¨ã¨ãã¦ããï¼
+
+(4-10) CPUä¾å¤ãã³ãã©ã§è¡ããæä½
+
+CPUä¾å¤ãã³ãã©ã§è¡ããæä½ã«ã¤ãã¦ã¯ï¼TOPPERSæ¨æºå²è¾¼ã¿å¦çã¢ãã«ã«æº
+æ ãããã¨ã¨ãï¼Î¼ITRON4.0ä»æ§ã«ã¯å¾ã£ã¦ããªãï¼ãã®ããã®ãµã¼ãã¹ã³ã¼
+ã«ã¨ãã¦ï¼æ¬¡ã®ãµã¼ãã¹ã³ã¼ã«ãå®è£
+ãã¦ããï¼
+
+	xsns_dpn	CPUä¾å¤çºçæã®ãã£ã¹ãããä¿çç¶æ
+ã®åç
+§
+
+ASP1ã«ã¼ãã«ã§ã¯ï¼ä¸ã«å ãã¦ï¼CPUä¾å¤çºçæã®ã¿ã¹ã¯ä¾å¤å¦çä¿çç¶æ
+ãå
+ç
+§ãããµã¼ãã¹ã³ã¼ã«ï¼xsns_xpnï¼ãå®è£
+ãã¦ãããï¼ASP3ã«ã¼ãã«ã§ã¯ï¼ã¿
+ã¹ã¯ä¾å¤å¦çæ©è½ã®å»æ­¢ã«ä¼´ã£ã¦å»æ­¢ããï¼
+
+(4-11) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®ext_tsk
+
+éã¿ã¹ã¯ã³ã³ãã­ã¹ãããext_tskãå¼ã°ããå ´åï¼E_CTXã¨ã©ã¼ãè¿ããã®ã¨
+ããï¼ããã«ã¨ããªã£ã¦ï¼ext_tskããªã¿ã¼ã³ããå¯è½æ§ããããã®ã¨ãï¼è¿ã
+å¤ã®åãERã¨ããï¼
+
+(4-12) å¼·å¶å¾
+ã¡è¦æ±ãã¹ãã®å»æ­¢
+
+å¼·å¶å¾
+ã¡è¦æ±ããã¹ãããæ©è½ãå»æ­¢ããï¼è¨ãæããã¨ï¼å¼·å¶å¾
+ã¡è¦æ±ãã¹
+ãæ°ã®æå¤§å¤ã1ã«åºå®ããï¼ããã«ä¼´ãï¼frsm_tskã¯å»æ­¢ãï¼itron.hã«ãã
+ã¦frsm_tskãrsm_tskã«ãã¯ã­å®ç¾©ãã¦ããï¼ref_tskã§åç
+§ã§ããæ
+å ±ããï¼
+å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ï¼suscntï¼ãåé¤ããï¼ã¾ãï¼TMAX_SUSCNTã®å®ç¾©ã
+itron.hã«ç§»ããï¼
+
+(4-13) ã·ã¹ãã æå»ã®æ´æ°æ©æ§ã®æ±ã
+
+ã·ã¹ãã æå»ãæ´æ°ããæ©æ§ãã«ã¼ãã«å
+é¨ã«æã¤æ±ãã¨ãï¼ãµã¼ãã¹ã³ã¼ã«
+ã¨ãã¦ã®isig_timã¯å»æ­¢ããï¼
+
+(4-14) ã·ã¹ãã æå»ã®è¨­å®æ©è½ã®ãã©ã¡ã¼ã¿ã®å¤æ´
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼set_timï¼ã·ã¹ãã æå»ã®è¨­å®ï¼ã®ãã©ã¡ã¼ã¿ãï¼ã·ã¹ãã 
+æå»ã¸ã®ãã¤ã³ã¿ãæ¸¡ãä»æ§ããï¼ã·ã¹ãã æå»ãã®ãã®ãæ¸¡ãä»æ§ã«å¤æ´ã
+ãï¼
+
+ãªãï¼ASP1ã«ã¼ãã«ã§ã¯ï¼set_timã¯ãµãã¼ããã¦ããªãï¼
+
+(4-15) å¨æãã³ãã©ã®ä»æ§å¤æ´
+
+sta_cycãå¼ã³åºããå¾ï¼æåã«å¨æãã³ãã©ï¼ASP3ã«ã¼ãã«ã§ã¯å¨æéç¥ï¼ã
+èµ·åãããæå»ãå¤æ´ããï¼Î¼ITRON4.0ä»æ§ã§ã¯ï¼sta_cycãå¼ã³åºãã¦ããå¨
+æãã³ãã©ã®èµ·åå¨æã§æå®ããç¸å¯¾æéå¾ã¨ãã¦ãããï¼ASPã«ã¼ãã«ã§ã¯ï¼
+èµ·åä½ç¸ã§æå®ããç¸å¯¾æéå¾ã¨ãã¦ããï¼
+
+(4-16) ã¢ããªã±ã¼ã·ã§ã³åãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã®æ§æ
+
+ã«ã¼ãã«ãå¼ã³åºãã¢ããªã±ã¼ã·ã§ã³ããã¯kernel.hãï¼SILãå¼ã³åºãã¢ããª
+ã±ã¼ã·ã§ã³ããã¯sil.hãã¤ã³ã¯ã«ã¼ãããã°ãããã®ã¨ãã¦ããï¼
+
+ã¾ãï¼kernel.hã¨sil.hã®å
+±éé¨åã¨ãã¦t_stddef.hãç¨æãï¼ã«ã¼ãã«ã¨SIL
+ã®ããããå¼ã³åºããªãã¢ããªã±ã¼ã·ã§ã³ããã¯ï¼t_stddef.hãã¤ã³ã¯ã«ã¼ã
+ããã°ãããã®ã¨ãã¦ããï¼itron.hã¯ï¼Î¼ITRON4.0ä»æ§ã¨ã®äºææ§ãå¿
+è¦ãªå ´
+åã«ã¤ã³ã¯ã«ã¼ããããã®ã¨ãã¦ããï¼
+
+JSPã«ã¼ãã«ã«ãããt_services.hã¨s_services.hã¯å»æ­¢ããï¼
+
+âã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³å¦çã®è¦ç´ã
+
+ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³å¦çãå
+¨é¢çã«è¦ç´ãï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥
+ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ä¸­ã«ãããCè¨èªã®ããªãã­ã»ããµãã£ã¬ã¯ãã£ãã®æ±ãã¨
+éçAPIã®ãã©ã¡ã¼ã¿ã®åé¡ãå¤æ´ããï¼
+
+âæ¡å¼µããã±ã¼ã¸ã®ãµãã¼ã
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ããã¤ãã®æ¡å¼µæ©è½ãå®è£
+ããããã«ï¼æ¬¡ã®æ¡å¼µããã±ã¼
+ã¸ããµãã¼ããã¦ããï¼
+
+ã»ããªããèª¿æ´æ©è½æ¡å¼µããã±ã¼ã¸
+ã»ã¡ãã»ã¼ã¸ãããã¡æ©è½æ¡å¼µããã±ã¼ã¸
+ã»ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸
+ã»ã¿ã¹ã¯åªå
+åº¦æ¡å¼µããã±ã¼ã¸
+ã»å¶ç´ã¿ã¹ã¯æ¡å¼µããã±ã¼ã¸
+ã»ãµãåªå
+åº¦æ©è½æ¡å¼µããã±ã¼ã¸
+ã»åççææ©è½æ¡å¼µããã±ã¼ã¸
+
+ASP1ã«ã¼ãã«ã§ã¯ï¼ãããã®æ¡å¼µããã±ã¼ã¸ä»¥å¤ã«ï¼ãã¥ã¼ããã¯ã¹æ©è½æ¡å¼µ
+ããã±ã¼ã¸ããµãã¼ããã¦ãããï¼ASP3ã«ã¼ãã«ã§ã¯ï¼ãã¥ã¼ããã¯ã¹ã¯æ¨æº
+ã§ãµãã¼ããã¦ãããã¨ããï¼æ¡å¼µããã±ã¼ã¸ã¨ãã¦ã¯å»æ­¢ããï¼ASP1ã«ã¼ã
+ã«ã§ã¯ï¼ããªããèª¿æ´æ©è½æ¡å¼µããã±ã¼ã¸ã¨ãµãåªå
+åº¦æ©è½æ¡å¼µããã±ã¼ã¸ã¯
+ãµãã¼ããã¦ããªãï¼
+
+âTOPPERSçµè¾¼ã¿ã³ã³ãã¼ãã³ãã·ã¹ãã ï¼TECSï¼ã®å°å
+¥
+
+ããã¤ã¹ãã©ã¤ããã·ã¹ãã ã­ã°æ©è½ãªã©ã®ã·ã¹ãã ãµã¼ãã¹ãï¼TOPPERSçµè¾¼
+ã¿ã³ã³ãã¼ãã³ãã·ã¹ãã ï¼TECSï¼ãç¨ãã¦å®è£
+ãã¦ããï¼ã¾ãï¼ã«ã¼ãã«ãª
+ãã¸ã§ã¯ããTECSã®ã³ã³ãã¼ãã³ãã¨ãã¦æ±ããããã«ãã¦ããï¼
+
+ãªãï¼ASP1ã«ã¼ãã«ã§ã¯ï¼TECSã«å¯¾å¿ããããã®ä¿®æ­£ã¯ï¼TECSã®é
+å¸ããã±ã¼
+ã¸ã«å«ã¾ãã¦ããï¼ASP1ã«ã¼ãã«ã®é
+å¸ããã±ã¼ã¸ã«ã¯å«ã¾ãã¦ããªãï¼
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/doc/configurator.txt
===================================================================
--- asp3_wo_tecs/trunk/doc/configurator.txt	(revision 302)
+++ asp3_wo_tecs/trunk/doc/configurator.txt	(revision 302)
@@ -0,0 +1,1690 @@
+
+		TOPPERS/ASP3ã«ã¼ãã«
+		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ä»æ§
+
+		å¯¾å¿ãã¼ã¸ã§ã³: Release 3.0.0
+		æçµæ´æ°: 2015å¹´8æ8æ¥
+
+ãã®ãã­ã¥ã¡ã³ãã¯ï¼TOPPERS/ASP3ã«ã¼ãã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãæ¨æºçã«
+çæãã¹ããã¡ã¤ã«ã®å
+å®¹ã«ã¤ãã¦è§£èª¬ãããã®ã§ããï¼ã¿ã¼ã²ããä¾å­ã«ç
+æããå
+å®¹ã«ã¤ãã¦ã¯ï¼ãã®ãã­ã¥ã¡ã³ãã®ç¯å²å¤ã§ããï¼
+
+----------------------------------------------------------------------
+ TOPPERS/ASP Kernel
+     Toyohashi Open Platform for Embedded Real-Time Systems/
+     Advanced Standard Profile Kernel
+
+ 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: configurator.txt 431 2015-08-08 12:05:02Z ertl-hiro $
+----------------------------------------------------------------------
+
+âç®æ¬¡
+
+ï¼ï¼çæãããã¡ã¤ã«ã®ç¨®é¡
+ï¼ï¼éçAPIä¸è¦§
+ï¼ï¼ã«ã¼ãã«æ§æã»åæåããããã¡ã¤ã«ï¼kernel_cfg.hï¼
+	3.1 åºå®çæé¨å
+	3.2 ãªãã¸ã§ã¯ãæ°ã®å®ç¾©
+	3.3 ãªãã¸ã§ã¯ãã®IDçªå·ã®å®ç¾©
+ï¼ï¼ã«ã¼ãã«æ§æã»åæåãã¡ã¤ã«ï¼kernel_cfg.cï¼
+	4.1 åºå®çæé¨å
+	4.2 ã«ã¼ãã«ã®ç¨®é¡ã®ãã§ãã¯
+	4.3 ã¤ã³ã¯ã«ã¼ããã£ã¬ã¯ãã£ãï¼#includeï¼ã®å¦ç
+	4.4 ãªãã¸ã§ã¯ãã®IDçªå·ãä¿æããå¤æ°ã®å®ç¾©
+	4.5 åã«ã¼ãã«ãªãã¸ã§ã¯ãã«é¢ããå®ç¾©
+		4.5.1 ã«ã¼ãã«ãªãã¸ã§ã¯ãã«é¢ããå®ç¾©ã®æ¨æºæ§æ
+		4.5.2 ã¿ã¹ã¯ã«é¢ããå®ç¾©
+		4.5.3 ã»ããã©ã«é¢ããå®ç¾©
+		4.5.4 ã¤ãã³ããã©ã°ã«é¢ããå®ç¾©
+		4.5.5 ãã¼ã¿ã­ã¥ã¼ã«é¢ããå®ç¾©
+		4.5.6 åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã«é¢ããå®ç¾©
+		4.5.7 ãã¥ã¼ããã¯ã¹ã«é¢ããå®ç¾©
+		4.5.8 åºå®é·ã¡ã¢ãªãã¼ã«ã«é¢ããå®ç¾©
+		4.5.9 å¨æéç¥ã«é¢ããå®ç¾©
+		4.5.10 ã¢ã©ã¼ã éç¥ã«é¢ããå®ç¾©
+	4.6 éç¥ãã³ãã©ã®çæ
+	4.7 å²è¾¼ã¿ã«é¢ããå®ç¾©
+		4.7.1 å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã«é¢ããå®ç¾©
+		4.7.2 å²è¾¼ã¿ãã³ãã©ã«é¢ããå®ç¾©
+		4.7.3 å²è¾¼ã¿è¦æ±ã©ã¤ã³ã«é¢ããå®ç¾©
+	4.8 CPUä¾å¤ã«é¢ããå®ç¾©
+	4.9 éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã«é¢ããå®ç¾©
+	4.10 ã¿ã¤ã ã¤ãã³ãç®¡çã«é¢ããå®ç¾©
+	4.11 åã¢ã¸ã¥ã¼ã«ã®åæåé¢æ°ã®å®ç¾©
+	4.12 åæåã«ã¼ãã³ã®å®è¡é¢æ°ã®å®ç¾©
+	4.13 çµäºå¦çã«ã¼ãã³ã®å®è¡é¢æ°ã®å®ç¾©
+
+
+ï¼ï¼çæãããã¡ã¤ã«ã®ç¨®é¡
+
+ASP3ã«ã¼ãã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡
+ã¤ã«ãå¦çãã¦ï¼ã«ã¼ãã«æ§æã»åæåãã¡ã¤ã«ï¼kernel_cfg.cï¼ã¨æ§æã»å
+æåããããã¡ã¤ã«ï¼kernel_cfg.hï¼ãçæããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®å¦ç
+ã®éä¸­ã«ï¼ãã®ä»ã«ããã¤ãã®ä¸­éãã¡ã¤ã«ãçæããï¼
+
+
+ï¼ï¼éçAPIä¸è¦§
+
+ASP3ã«ã¼ãã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãå¦çããéçAPIã¯æ¬¡ã®éãï¼
+
+(1) ã¿ã¹ã¯ç®¡çæ©è½
+	CRE_TSK(ID tskid, { ATR tskatr, intptr_t exinf, TASK task,
+								PRI itskpri, SIZE stksz, STK_T *stk })
+
+(2) åæã»éä¿¡æ©è½
+	CRE_SEM(ID semid, { ATR sematr, uint_t isemcnt, uint_t maxsem })
+	CRE_FLG(ID flgid, { ATR flgatr, FLGPTN iflgptn })
+	CRE_DTQ(ID dtqid, { ATR dtqatr, uint_t dtqcnt, void *dtqmb })
+	CRE_PDQ(ID pdqid, { ATR pdqatr, uint_t pdqcnt, PRI maxdpri, void *pdqmb })
+	CRE_MTX(ID mtxid, { ATR mtxatr, PRI ceilpri })
+
+â» dtqmbï¼pdqmbãNULLã§ãªãå ´åã¯ãµãã¼ãããªãï¼
+
+(3) ã¡ã¢ãªãã¼ã«ç®¡çæ©è½
+	CRE_MPF(ID mpfid, { ATR mpfatr, uint_t blkcnt, uint_t blksz,
+										MPF_T *mpf, void *mpfmb })
+
+â» mpfmbãNULLã§ãªãå ´åã¯ãµãã¼ãããªãï¼
+
+(4) æéç®¡çæ©è½
+	CRE_CYC(ID cycid, { ATR cycatr, ï¼éç¥æ¹æ³ã®æå®ï¼,
+										RELTIM cyctim, RELTIM cycphs })
+	CRE_ALM(ID almid, { ATR almatr, ï¼éç¥æ¹æ³ã®æå®ï¼ })
+
+(5) å²è¾¼ã¿ç®¡çæ©è½
+	CFG_INT(INTNO intno, { ATR intatr, PRI intpri })
+	CRE_ISR(ID isrid, { ATR isratr, intptr_t exinf,
+								INTNO intno, ISR isr, PRI isrpri })
+	DEF_INH(INHNO inhno, { ATR inhatr, INTHDR inthdr })
+
+(6) CPUä¾å¤ç®¡çæ©è½
+	DEF_EXC(EXCNO excno, { ATR excatr, EXCHDR exchdr })
+
+(7) ã·ã¹ãã æ§æç®¡çæ©è½
+	DEF_ICS({ SIZE istksz, STK_T *istk })
+	ATT_INI({ ATR iniatr, intptr_t exinf, INIRTN inirtn })
+	ATT_TER({ ATR teratr, intptr_t exinf, TERRTN terrtn })
+
+
+ï¼ï¼ã«ã¼ãã«æ§æã»åæåããããã¡ã¤ã«ï¼kernel_cfg.hï¼
+
+ãã®ç« ã§ã¯ï¼ã«ã¼ãã«æ§æã»åæåããããã¡ã¤ã«ï¼kernel_cfg.hï¼ã«çæã
+ã¹ãå®ç¾©ã«ã¤ãã¦èª¬æããï¼ãªãï¼çæä½ç½®ãæç¤ºããã¦ãããã®ãé¤ãã¦ã¯ï¼
+å®ç¾©ã®çæé åºã¯ä»¥ä¸ã®é ã§ãªãã¦ãããï¼
+
+3.1 åºå®çæé¨å
+
+kernel_cfg.hãè¤æ°åã¤ã³ã¯ã«ã¼ããããã®ãé²ãããã®è¨è¿°ãçæããï¼å
+·
+ä½çã«ã¯ï¼ãã¡ã¤ã«ã®å
+é ­ã«æ¬¡ã®è¡ãçæããï¼
+
+#ifndef	TOPPERS_KERNEL_CFG_H
+#define	TOPPERS_KERNEL_CFG_H
+
+ã¾ãï¼ãã¡ã¤ã«ã®æ«å°¾ã«æ¬¡ã®è¡ãçæããï¼
+
+#endif	/* TOPPERS_KERNEL_CFG_H */
+
+3.2 ãªãã¸ã§ã¯ãæ°ã®å®ç¾©
+
+ã«ã¼ãã«ããµãã¼ããããªãã¸ã§ã¯ãã®æ°ããã¯ã­å®ç¾©ããããªãã­ã»ããµãã£
+ã¬ã¯ãã£ãï¼#defineï¼ãçæããï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®ãããªè¨è¿°ãçæããï¼
+
+#define TNUM_TSKID	<ã¿ã¹ã¯ã®æ°>
+#define TNUM_SEMID	<ã»ããã©ã®æ°>
+#define TNUM_FLGID	<ã¤ãã³ããã©ã°ã®æ°>
+#define TNUM_DTQID	<ãã¼ã¿ã­ã¥ã¼ã®æ°>
+#define TNUM_PDQID	<åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®æ°>
+#define TNUM_MTXID	<ãã¥ã¼ããã¯ã¹ã®æ°>
+#define TNUM_MPFID	<åºå®é·ã¡ã¢ãªãã¼ã«ã®æ°>
+#define TNUM_CYCID	<å¨æãã³ãã©ã®æ°>
+#define TNUM_ALMID	<ã¢ã©ã¼ã ãã³ãã©ã®æ°>
+#define TNUM_ISRID	<å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®æ°>
+
+3.3 ãªãã¸ã§ã¯ãã®IDçªå·ã®å®ç¾©
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãIDçªå·ãå²ãä»ãããªãã¸ã§ã¯ãã®ååãï¼å²ãä»ãã
+IDçªå·ã«ãã¯ã­å®ç¾©ããããªãã­ã»ããµãã£ã¬ã¯ãã£ãï¼#defineï¼ãçæããï¼
+ä¾ãã°ï¼æ¬¡ã®ãããªè¨è¿°ãçæããï¼
+
+#define TASK1	1
+#define TASK2	2
+#define SEM1	1
+
+
+ï¼ï¼ã«ã¼ãã«æ§æã»åæåãã¡ã¤ã«ï¼kernel_cfg.cï¼
+
+ãã®ç« ã§ã¯ï¼ã«ã¼ãã«æ§æã»åæåãã¡ã¤ã«ï¼kernel_cfg.cï¼ã«çæãã¹ãå®
+ç¾©ã«ã¤ãã¦èª¬æããï¼ãªãï¼çæä½ç½®ãæç¤ºããã¦ãããã®ãé¤ãã¦ã¯ï¼å®ç¾©
+ã®çæé åºã¯ä»¥ä¸ã®é ã§ãªãã¦ãããï¼
+
+4.1 åºå®çæé¨å
+
+kernel_cfg.cç¨ã®ããããã¡ã¤ã«ã¨ï¼ã«ã¼ãã«æ§æã»åæåããããã¡ã¤ã«ã
+ã¤ã³ã¯ã«ã¼ãããããªãã­ã»ããµãã£ã¬ã¯ãã£ãï¼#includeï¼ãçæããï¼å
+·
+ä½çã«ã¯ï¼æ¬¡ã®è¡ãçæããï¼
+
+#include "kernel/kernel_int.h"
+#include "kernel_cfg.h"
+
+4.2 ã«ã¼ãã«ã®ç¨®é¡ã®ãã§ãã¯
+
+kernel_cfg.cã¨ã«ã¼ãã«ã®ç¨®é¡ãä¸è´ãã¦ãããããã§ãã¯ããããã«ï¼æ¬¡ã®
+è¡ãçæããï¼
+
+#if !(TKERNEL_PRID == 0x0007U && (TKERNEL_PRVER & 0xf000U) == 0x3000U)
+#error The kernel does not match this configuration file.
+#endif
+
+4.3 ã¤ã³ã¯ã«ã¼ããã£ã¬ã¯ãã£ãï¼#includeï¼ã®å¦ç
+
+ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«å«ã¾ããCè¨èªããªãã­ã»ããµã®ã¤
+ã³ã¯ã«ã¼ããã£ã¬ã¯ãã£ãï¼#includeï¼ã¨åä¸ã®ãã£ã¬ã¯ãã£ãï¼#includeï¼
+ãçæããï¼ä¾ãã°ï¼
+
+#include "sample1.h"
+
+ã¨ããã¤ã³ã¯ã«ã¼ããã£ã¬ã¯ãã£ãã«å¯¾ãã¦ï¼
+
+#include "sample1.h"
+
+ã¨ãããã£ã¬ã¯ãã£ããçæããï¼çæãããã£ã¬ã¯ãã£ãã®é åºã¯ï¼ã·ã¹ã
+ã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ä¸­ã§ã®ã¤ã³ã¯ã«ã¼ããã£ã¬ã¯ãã£ãã®è¨è¿°
+é åºã«ä¸è´ãããï¼
+
+4.4 ãªãã¸ã§ã¯ãã®IDçªå·ãä¿æããå¤æ°ã®å®ç¾©
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«å¯¾ãããªãã·ã§ã³æå®ï¼--external-idï¼ã«ããï¼ã³ã³ãã£
+ã®ã¥ã¬ã¼ã¿ãIDçªå·ãå²ãä»ãããªãã¸ã§ã¯ãã®ååã®æ«å°¾ã«"_id"ãä»å ãã
+ååã®å¤æ°ãçæããï¼å¤æ°ã¯ï¼constå±æ§ãä»å ããIDåã®å¤æ°ã¨ãï¼å²ãä»
+ããIDçªå·ãå¤ã¨ããï¼ä¾ãã°ï¼æ¬¡ã®ãããªè¨è¿°ãçæããï¼
+
+const ID TASK1_id = 1;
+const ID TASK2_id = 2;
+const ID SEM1_id = 1;
+
+4.5 åã«ã¼ãã«ãªãã¸ã§ã¯ãã«é¢ããå®ç¾©
+
+4.5.1 ã«ã¼ãã«ãªãã¸ã§ã¯ãã«é¢ããå®ç¾©ã®æ¨æºæ§æ
+
+ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ä¸­ã«ï¼ãªãã¸ã§ã¯ããçæããéç
+APIãCRE_XXXããå«ã¾ããåã«ã¼ãã«ãªãã¸ã§ã¯ãã«é¢ãã¦ï¼ãªãã¸ã§ã¯ãç
+æã®ããã®å®ç¾©ãçæããï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã¯ï¼åãç¨®é¡ã®ãªãã¸ã§ã¯ããçæããéçAPIãéãï¼å
+ãªãã¸ã§ã¯ãã«IDçªå·ãå²ãä»ããï¼IDçªå·ã¯ï¼ä»ã®ãªãã¸ã§ã¯ãã®IDçªå·ã¨
+éè¤ããªãï¼IDçªå·ã1ããé£ç¶ããããã«å²ãä»ããï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«å¯¾ãããªãã·ã§ã³æå®ï¼--id-input-fileï¼ã«ããï¼ã³ã³
+ãã£ã®ã¥ã¬ã¼ã¿ããªãã¸ã§ã¯ãã«å²ãä»ããIDçªå·ãæå®ãããã¨ãã§ããï¼
+åãç¨®é¡ã®ç°ãªããªãã¸ã§ã¯ãã«å¯¾ãã¦åãIDçªå·ãæå®ãããï¼ã³ã³ãã£ã®ã¥
+ã¬ã¼ã¿ãIDçªå·ãã§ããéãé£ç¶ããããã«å²ãä»ããã¨ãã¦ãIDçªå·ãé£ç¶
+ããªãå ´åã«ã¯ï¼ASP3ã«ã¼ãã«ã¯ï¼ãªãã¸ã§ã¯ãã®IDçªå·ãé£ç¶ãã¦ãããã¨
+ãä»®å®ãã¦å®è£
+ãã¦ããï¼ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã¯ã¨ã©ã¼ãå ±åããï¼
+
+ã¾ãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«å¯¾ãããªãã·ã§ã³æå®ï¼--id-output-fileï¼ã«ã
+ãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãIDçªå·ãå²ãä»ãããªãã¸ã§ã¯ãã®ååã¨å²ãä»ã
+ãIDçªå·ã®çµãï¼ãªãã·ã§ã³ã§æå®ãããã¡ã¤ã«ã«åºåããï¼
+
+åã«ã¼ãã«ãªãã¸ã§ã¯ãã«é¢ããå®ç¾©ã®æ¨æºçãªæ§æã¯ï¼æ¬¡ã®éãã§ããï¼ãª
+ãã¸ã§ã¯ãã«ãã£ã¦ä¾å¤ãããå ´åã«ã¯ï¼ãªãã¸ã§ã¯ãæ¯ã®é 
+ã§èª¬æããï¼
+
+(a) ãªãã¸ã§ã¯ãIDã®æå¤§å¤ã®å¤æ°ã®å®ç¾©
+
+ãªãã¸ã§ã¯ãIDã®æå¤§å¤ãä¿æããå¤æ°ã®å®ç¾©ãçæããï¼å
+·ä½çã«ã¯ï¼ãªã
+ã¸ã§ã¯ãã®çç¥è¨å·ããXXXï¼xxxãã¨ããã¨ï¼æ¬¡ã®ãããªè¡ãçæããï¼
+
+const ID _kernel_tmax_xxxid = (TMIN_XXXID + TNUM_XXXID - 1);
+
+(b) ãªãã¸ã§ã¯ãã«å¿
+è¦ãªã¡ã¢ãªé åã®å®ç¾©
+
+ãªãã¸ã§ã¯ãã«ãã£ã¦ã¯ï¼ãªãã¸ã§ã¯ãã«å¿
+è¦ãªã¡ã¢ãªé åã®å®ç¾©ãçæããï¼
+å
+·ä½çã«ã¯ï¼ãªãã¸ã§ã¯ãæ¯ã®é 
+ã§èª¬æããï¼
+
+(c) ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å®ç¾©
+
+ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å®ç¾©ãçæããï¼å
+·ä½çã«ã¯ï¼ãªãã¸ã§ã¯ã
+ã®çç¥è¨å·ããXXXï¼xxxãã¨ããã¨ï¼æ¬¡ã®ãããªè¡ãçæããï¼
+
+const XXXINIB _kernel_xxxinib_table[TNUM_XXXID] = {
+	<ãªãã¸ã§ã¯ãIDã1ã®ãªãã¸ã§ã¯ãã®åæåæ
+å ±>,
+	<ãªãã¸ã§ã¯ãIDã2ã®ãªãã¸ã§ã¯ãã®åæåæ
+å ±>,
+				â¦â¦
+	<ãªãã¸ã§ã¯ãIDãTNUM_XXXIDã®ãªãã¸ã§ã¯ãã®åæåæ
+å ±>
+};
+
+ãªãã¸ã§ã¯ãã®åæåæ
+å ±ã®å½¢å¼ã¯ï¼ãªãã¸ã§ã¯ãæ¯ã«ç°ãªãï¼å
+·ä½çã«ã¯ï¼
+ãªãã¸ã§ã¯ãæ¯ã®é 
+ã§èª¬æããï¼
+
+ãªãã¸ã§ã¯ãã1ã¤ãçæãããªãã£ãå ´åã«ã¯ï¼æ¬¡ã®ãããªè¡ãçæããï¼
+
+	TOPPERS_EMPTY_LABEL(const XXXINIB, _kernel_xxxinib_table);
+
+(d) ãªãã¸ã§ã¯ãã®ã³ã³ãã­ã¼ã«ãã­ãã¯ã®å®ç¾©
+
+ãªãã¸ã§ã¯ãã®ã³ã³ãã­ã¼ã«ãã­ãã¯ã®å®ç¾©ãçæããï¼å
+·ä½çã«ã¯ï¼ãªãã¸ã§
+ã¯ãã®çç¥è¨å·ããXXXï¼xxxãã¨ããã¨ï¼æ¬¡ã®ãããªè¡ãçæããï¼
+
+XXXCB _kernel_xxxcb_table[TNUM_XXXID];
+
+ãªãã¸ã§ã¯ãã1ã¤ãçæãããªãã£ãå ´åã«ã¯ï¼æ¬¡ã®ãããªè¡ãçæããï¼
+
+	TOPPERS_EMPTY_LABEL(XXXCB, _kernel_xxxcb_table);$NL$
+
+4.5.2 ã¿ã¹ã¯ã«é¢ããå®ç¾©
+
+ASP3ã«ã¼ãã«ã¯ï¼ã¿ã¹ã¯ã1ã¤ããªãã±ã¼ã¹ã«å¯¾å¿ãã¦ããªãï¼ã¿ã¹ã¯ãçæã
+ãéçAPIã1ã¤ããªãã£ãå ´åï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã¯ã¨ã©ã¼ãå ±åããï¼
+
+ã¿ã¹ã¯ã®çç¥è¨å·ã¯ãTSKï¼tskãã§ããï¼ãã ãï¼ã¿ã¹ã¯åæåãã­ãã¯ã®ãã¼
+ã¿åã¯TINIBï¼ãã®å¤æ°åã¯_kernel_tinib_tableï¼ã¿ã¹ã¯ã³ã³ãã­ã¼ã«ãã­ã
+ã¯ã®ãã¼ã¿åã¯TCBï¼ãã®å¤æ°åã¯_kernel_tcb_table ã§ããï¼ãããããTSKï¼
+tskãã«ä»£ãã¦ãTï¼tããç¨ãã¦ããï¼ï¼
+
+ä»¥ä¸ã§ã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®éçAPIãå«ã¾ã
+ã¦ããæã«çæãã¹ãæ
+å ±ã«ã¤ãã¦è¿°ã¹ãï¼
+
+	CRE_TSK(tskid, { tskatr, exinf, task, itskpri, stksz, stk });
+
+4.5.2.1 ã¿ã¹ã¯ã«å¿
+è¦ãªã¡ã¢ãªé åã®å®ç¾©
+
+ã¿ã¹ã¯ã«å¿
+è¦ãªã¡ã¢ãªé åã¨ãã¦ï¼ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åãããï¼stkãNULLã®
+å ´åã«ã¯ï¼çæããã¿ã¹ã¯æ¯ã«ï¼æå®ããããµã¤ãºã®ã¹ã¿ãã¯é åãç¢ºä¿ããï¼
+å
+·ä½çã«ã¯ï¼ä¸è¨ã®éçAPIã«å¯¾ãã¦ï¼æ¬¡ã®å®ç¾©ãçæããï¼
+
+ï¼stkãNULLã®å ´åã®ã¿çæ
+static STK_T _kernel_stack_<ã¿ã¹ã¯å>[COUNT_STK_T(stksz)];
+
+ãã ãï¼ãã®æ¹æ³ã§ã¹ã¿ãã¯é åãç¢ºä¿ã§ããªãã¿ã¼ã²ããã«ããã¦ã¯ï¼ã¿ã¼
+ã²ããä¾å­ã®æ¹æ³ã§ã¹ã¿ãã¯é åãç¢ºä¿ããï¼
+
+4.5.2.2 ã¿ã¹ã¯ã®åæåæ
+å ±
+
+ã¿ã¹ã¯åæåãã­ãã¯ä¸­ã«çæããã¿ã¹ã¯ã®åæåæ
+å ±ã¯ï¼æ¬¡ã®å½¢å¼ã¨ããï¼
+
+ï¼stkãNULLã§ãªãå ´å
+	{ (tskatr), (intptr_t)(exinf), (TASK)(task), INT_PRIORITY(itskpri),
+											(stksz), (void *)(stk) }
+
+ï¼stkãNULLã®å ´å
+	{ (tskatr), (intptr_t)(exinf), (TASK)(task), INT_PRIORITY(itskpri),
+							ROUND_STK_T(stksz), _kernel_stack_<ã¿ã¹ã¯å> }
+
+4.5.2.3 ã¿ã¹ã¯çæé åºãã¼ãã«ã®å®ç¾©
+
+ã¿ã¹ã¯ã®çæãããé åºã§ï¼ã¿ã¹ã¯ã®åæåï¼ããå
+·ä½çã«ã¯ï¼ã¿ã¹ã¯ã®èµ·åï¼
+ãè¡ãå¿
+è¦ããããã¨ããã«ï¼ã¿ã¹ã¯ãçæãããé åºï¼ã¿ã¹ã¯ãçæããé
+çAPIãè¨è¿°ãããé åºï¼ããã¼ãã«ã«åºåããï¼
+
+å
+·ä½çã«ã¯ï¼æ¬¡ã®ãããªè¡ãçæããï¼
+
+const ID _kernel_torder_table[TNUM_TSKID] = {
+	<æåã«çæãããã¿ã¹ã¯ã®ã¿ã¹ã¯ID>,
+	<2çªç®ã«çæãããã¿ã¹ã¯ã®ã¿ã¹ã¯ID>,
+				â¦â¦
+	<æå¾ã«çæãããã¿ã¹ã¯ã®ã¿ã¹ã¯ID>
+};
+
+(6-1-4) ã¨ã©ã¼æ¡ä»¶
+
+ã¿ã¹ã¯ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿æ¬ä½ãæ¤åºãããã®
+ã»åãtskidã«å¯¾ããCRE_TSKãè¤æ°ããå ´åï¼E_OBJï¼ï¼»NGKI1040ï¼½
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»ã¿ã¹ã¯ã1ã¤ãç»é²ããã¦ããªãå ´åï¼»NGKI0033ï¼½
+ã»tskatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1028ï¼½
+ãï¼TA_ACTï¼TA_NOACTQUEï¼TARGET_TSKATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+	â» TAGET_TSKATRã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§è¿½å ããã¿ã¹ã¯å±æ§
+ã»(TMIN_TPRI <= itskpri && itskpri <= TMAX_TPRI)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI1034ï¼½
+ã»stkszã0ä»¥ä¸ãï¼ã¿ã¼ã²ããå®ç¾©ã®æå°å¤ï¼TARGET_MIN_STKSZï¼ãããå°ã
+ããå ´åï¼E_PARï¼ï¼»NGKI1042ï¼½
+ã»stkszãã¹ã¿ãã¯é åã®ãµã¤ãºã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI1056ï¼½
+	- ã¿ã¼ã²ããä¾å­ã®å¤ï¼CHECK_STKSZ_ALIGNï¼ã®åæ°ã§ãªãå ´å
+	â» ãã®ã¨ã©ã¼ãã§ãã¯ã¯ï¼stkãNULLã§ãªãå ´åã«ã®ã¿è¡ã
+
+ï¼ãã¹3ã§æ¤åºãããã®
+ã»taskããã­ã°ã©ã ã®éå§çªå°ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI1033ï¼½
+	- ã¿ã¼ã²ããä¾å­ã®å¤ï¼CHECK_FUNC_ALIGNï¼ã®åæ°ã§ãªãå ´å
+	- NULLã®å ´åï¼ã¿ã¼ã²ããä¾å­ï¼CHECK_FUNC_NONNULLï¼
+ã»stkãã¹ã¿ãã¯é åã®å
+é ­çªå°ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI1056ï¼½
+	- ã¿ã¼ã²ããä¾å­ã®å¤ï¼CHECK_STACK_ALIGNï¼ã®åæ°ã§ãªãå ´å
+	- NULLã®å ´åï¼ã¿ã¼ã²ããä¾å­ï¼CHECK_STACK_NONNULLï¼
+
+4.5.3 ã»ããã©ã«é¢ããå®ç¾©
+
+ã»ããã©ã®çç¥è¨å·ã¯ãSEMï¼semãã§ããï¼ä»¥ä¸ã§ã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼
+ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®éçAPIãå«ã¾ãã¦ããæã«çæãã¹ãæ
+å ±ã«ã¤ãã¦è¿°ã¹
+ãï¼ãªãï¼ã»ããã©ã«å¿
+è¦ãªã¡ã¢ãªé åã¯ãªãï¼
+
+	CRE_SEM(semid, { sematr, isemcnt, maxsem });
+
+4.5.3.1 ã»ããã©ã®åæåæ
+å ±
+
+ã»ããã©åæåãã­ãã¯ä¸­ã«çæããã»ããã©ã®åæåæ
+å ±ã¯ï¼æ¬¡ã®å½¢å¼ã¨ã
+ãï¼
+
+	{ (sematr), (isemcnt), (maxsem) }
+
+4.5.3.2 ã¨ã©ã¼æ¡ä»¶
+
+ã»ããã©ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿æ¬ä½ãæ¤åºãããã®
+ã»åãsemidã«å¯¾ããCRE_SEMãè¤æ°ããå ´åï¼E_OBJï¼ï¼»NGKI1463ï¼½
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»sematrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1456ï¼½
+ãï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+ã»(1 <= maxsem && maxsem <= TMAX_MAXSEM)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI1468ï¼½
+ã»(0 <= isemcnt && isemcnt <= maxsem)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI1466ï¼½
+
+4.5.4 ã¤ãã³ããã©ã°ã«é¢ããå®ç¾©
+
+ã¤ãã³ããã©ã°ã®çç¥è¨å·ã¯ãFLGï¼flgãã§ããï¼ä»¥ä¸ã§ã¯ï¼ã·ã¹ãã ã³ã³ãã£
+ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®éçAPIãå«ã¾ãã¦ããæã«çæãã¹ãæ
+å ±ã«ã¤
+ãã¦è¿°ã¹ãï¼ãªãï¼ã¤ãã³ããã©ã°ã«å¿
+è¦ãªã¡ã¢ãªé åã¯ãªãï¼
+
+	CRE_FLG(flgid, { flgatr, iflgptn });
+
+4.5.4.1 ã¤ãã³ããã©ã°ã®åæåæ
+å ±
+
+ã¤ãã³ããã©ã°åæåãã­ãã¯ä¸­ã«çæããã¤ãã³ããã©ã°ã®åæåæ
+å ±ã¯ï¼
+æ¬¡ã®å½¢å¼ã¨ããï¼
+
+	{ (flgatr), (iflgptn) }
+
+4.5.4.2 ã¨ã©ã¼æ¡ä»¶
+
+ã¤ãã³ããã©ã°ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿æ¬ä½ãæ¤åºãããã®
+ã»åãflgidã«å¯¾ããCRE_FLGãè¤æ°ããå ´åï¼E_OBJï¼ï¼»NGKI1569ï¼½
+
+ï¼ãã¹1ã§æ¤åºãããã®
+ã»iflgptnãFLGPTNã«æ ¼ç´ã§ããªãå ´åï¼E_PARï¼
+	â iflgptnãuint32_tã«æ ¼ç´ã§ããªãå ´åã¯ï¼cfg1_out.cã®ã³ã³ãã¤ã«æ
+	   ã«ã¨ã©ã¼ã¨ãªãï¼
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»flgatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1562ï¼½
+ãï¼TA_TPRIï¼TA_WMULï¼TA_CLRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+ã»iflgptnãFLGPTNã«æ ¼ç´ã§ããªãå ´åï¼E_PARï¼ï¼»NGKI3275ï¼½
+	â iflgptnãuint32_tã«ã¯æ ¼ç´ã§ãããï¼FLGPTNã«æ ¼ç´ã§ããªãå ´åã¯ï¼
+	   ãã¹2ã§ã¨ã©ã¼ãæ¤åºããï¼
+
+4.5.5 ãã¼ã¿ã­ã¥ã¼ã«é¢ããå®ç¾©
+
+ãã¼ã¿ã­ã¥ã¼ã®çç¥è¨å·ã¯ãDTQï¼dtqãã§ããï¼ä»¥ä¸ã§ã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥
+ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®éçAPIãå«ã¾ãã¦ããæã«çæãã¹ãæ
+å ±ã«ã¤ãã¦
+è¿°ã¹ãï¼
+
+	CRE_DTQ(dtqid, { dtqatr, dtqcnt, dtqmb });
+
+4.5.5.1 ãã¼ã¿ã­ã¥ã¼ã«å¿
+è¦ãªã¡ã¢ãªé åã®å®ç¾©
+
+ãã¼ã¿ã­ã¥ã¼ã«å¿
+è¦ãªã¡ã¢ãªé åã¨ãã¦ï¼ãã¼ã¿ã­ã¥ã¼ç®¡çé åãããï¼çæ
+ãããã¼ã¿ã­ã¥ã¼æ¯ã«ï¼å¿
+è¦ãªãµã¤ãºã®ãã¼ã¿ã­ã¥ã¼ç®¡çé åãå®ç¾©ããï¼å
+·
+ä½çã«ã¯ï¼ä¸è¨ã®éçAPIã«å¯¾ãã¦ï¼æ¬¡ã®å®ç¾©ãçæããï¼
+
+ï¼dtqcntã0ã§ãªãå ´åã®ã¿çæ
+static DTQMB _kernel_dtqmb_<ãã¼ã¿ã­ã¥ã¼å>[dtqcnt];
+
+4.5.5.2 ãã¼ã¿ã­ã¥ã¼ã®åæåæ
+å ±
+
+ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯ä¸­ã«çæãããã¼ã¿ã­ã¥ã¼ã®åæåæ
+å ±ã¯ï¼æ¬¡ã®
+å½¢å¼ã¨ããï¼
+
+	{ (dtqatr), (dtqcnt), _kernel_dtqmb_<ãã¼ã¿ã­ã¥ã¼å> }
+
+ããã§ï¼dtqcntã0ã®å ´åã«ã¯ï¼_kernel_dtqmb_<ãã¼ã¿ã­ã¥ã¼å>ã«ä»£ãã¦ï¼
+NULLãç¨ããï¼
+
+4.5.5.3 ã¨ã©ã¼æ¡ä»¶
+
+ãã¼ã¿ã­ã¥ã¼ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿æ¬ä½ãæ¤åºãããã®
+ã»åãdtqidã«å¯¾ããCRE_DTQãè¤æ°ããå ´åï¼E_OBJï¼ï¼»NGKI1677ï¼½
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»dtqatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1669ï¼½
+ãï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+ã»dtqcntãè² ã®å¤ã®å ´åï¼E_PARï¼ï¼»NGKI3288ï¼½
+ã»dtqmbãNULLã§ãªãå ´åï¼E_NOSPTï¼ï¼»ASPS0132ï¼½
+
+4.5.6 åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã«é¢ããå®ç¾©
+
+åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®çç¥è¨å·ã¯ãPDQï¼pdqãã§ããï¼ä»¥ä¸ã§ã¯ï¼ã·ã¹ãã ã³
+ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®éçAPIãå«ã¾ãã¦ããæã«çæãã¹ãæ
+
+å ±ã«ã¤ãã¦è¿°ã¹ãï¼
+
+	CRE_PDQ(ID pdqid, { pdqatr, pdqcnt, maxdpri, pdqmb });
+
+4.5.6.1 åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã«å¿
+è¦ãªã¡ã¢ãªé åã®å®ç¾©
+
+åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã«å¿
+è¦ãªã¡ã¢ãªé åã¨ãã¦ï¼åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé å
+ãããï¼çæããåªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ¯ã«ï¼å¿
+è¦ãªãµã¤ãºã®åªå
+åº¦ãã¼ã¿ã­ã¥ã¼
+ç®¡çé åãå®ç¾©ããï¼å
+·ä½çã«ã¯ï¼ä¸è¨ã®éçAPIã«å¯¾ãã¦ï¼æ¬¡ã®å®ç¾©ãçæã
+ãï¼
+
+ï¼pdqcntã0ã§ãªãå ´åã®ã¿çæ
+static PDQMB _kernel_pdqmb_<åªå
+åº¦ãã¼ã¿ã­ã¥ã¼å>[pdqcnt];
+
+4.5.6.2 åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®åæåæ
+å ±
+
+åªå
+åº¦ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯ä¸­ã«çæããåªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®åæå
+æ
+å ±ã¯ï¼æ¬¡ã®å½¢å¼ã¨ããï¼
+
+	{ (pdqatr), (pdqcnt), (maxdpri), _kernel_pdqmb_<åªå
+åº¦ãã¼ã¿ã­ã¥ã¼å> }
+
+ããã§ï¼pdqcntã0ã®å ´åã«ã¯ï¼_kernel_pdqmb_<åªå
+åº¦ãã¼ã¿ã­ã¥ã¼å>ã«ä»£ã
+ã¦ï¼NULLãç¨ããï¼
+
+4.5.6.3 ã¨ã©ã¼æ¡ä»¶
+
+åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿æ¬ä½ãæ¤åºãããã®
+ã»åãpdqidã«å¯¾ããCRE_PDQãè¤æ°ããå ´åï¼E_OBJï¼ï¼»NGKI1812ï¼½
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»pdqatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI1804ï¼½
+ãï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+ã»pdqcntãè² ã®å¤ã®å ´åï¼E_PARï¼ï¼»NGKI3289ï¼½
+ã»(TMIN_DPRI <= maxdpri && maxdpri <= TMAX_DPRI)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI1819ï¼½
+ã»pdqmbãNULLã§ãªãå ´åï¼E_NOSPTï¼ï¼»ASPS0142ï¼½
+
+4.5.7 ãã¥ã¼ããã¯ã¹ã«é¢ããå®ç¾©
+
+ãã¥ã¼ããã¯ã¹ã®çç¥è¨å·ã¯ãMTXï¼mtxãã§ããï¼ä»¥ä¸ã§ã¯ï¼ã·ã¹ãã ã³ã³ãã£
+ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®éçAPIãå«ã¾ãã¦ããæã«çæãã¹ãæ
+å ±ã«ã¤
+ãã¦è¿°ã¹ãï¼ãªãï¼ãã¥ã¼ããã¯ã¹ã«å¿
+è¦ãªã¡ã¢ãªé åã¯ãªãï¼
+
+	CRE_MTX(mtxid, { mtxatr, maxmpri, mprihd });
+
+4.5.7.1 ãã¥ã¼ããã¯ã¹ã®åæåæ
+å ±
+
+ãã¥ã¼ããã¯ã¹åæåãã­ãã¯ä¸­ã«çæãããã¥ã¼ããã¯ã¹ã®åæåæ
+å ±ã¯ï¼
+æ¬¡ã®å½¢å¼ã¨ããï¼
+
+	{ (mtxatr), (maxmpri) }
+
+4.5.7.2 ã¨ã©ã¼æ¡ä»¶
+
+ãã¥ã¼ããã¯ã¹ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿æ¬ä½ãæ¤åºãããã®
+ã»åãmtxidã«å¯¾ããCRE_MTXãè¤æ°ããå ´åï¼E_OBJï¼ï¼»NGKI2032ï¼½
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»mtxatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2025ï¼½
+ãï¼TA_NULLï¼TA_TPRIï¼TA_CEILINGã®ãããã§ããªãå ´åï¼
+ã»åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã§ï¼(TMIN_MPRI <= maxmpri && maxmpri <=
+ãTMAX_MPRI)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI2037ï¼½
+
+4.5.8 åºå®é·ã¡ã¢ãªãã¼ã«ã«é¢ããå®ç¾©
+
+åºå®é·ã¡ã¢ãªãã¼ã«ã®çç¥è¨å·ã¯ãMPFï¼mpfãã§ããï¼ä»¥ä¸ã§ã¯ï¼ã·ã¹ãã ã³
+ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®éçAPIãå«ã¾ãã¦ããæã«çæãã¹ãæ
+
+å ±ã«ã¤ãã¦è¿°ã¹ãï¼
+
+	CRE_MPF(mpfid, { mpfatr, blkcnt, blksz, mpf, mpfmb });
+
+4.5.8.1 åºå®é·ã¡ã¢ãªãã¼ã«ã«å¿
+è¦ãªã¡ã¢ãªé åã®å®ç¾©
+
+åºå®é·ã¡ã¢ãªãã¼ã«ã«å¿
+è¦ãªã¡ã¢ãªé åã¨ãã¦ï¼åºå®é·ã¡ã¢ãªãã¼ã«é åã¨åº
+å®é·ã¡ã¢ãªãã¼ã«ç®¡çé åãããï¼çæããåºå®é·ã¡ã¢ãªãã¼ã«æ¯ã«ï¼å¿
+è¦ãª
+ãµã¤ãºã®åºå®é·ã¡ã¢ãªãã¼ã«é åï¼mpfãNULLã®å ´åã®ã¿ï¼ã¨åºå®é·ã¡ã¢ãªãã¼
+ã«ç®¡çé åãç¢ºä¿ããï¼å
+·ä½çã«ã¯ï¼ä¸è¨ã®éçAPIã«å¯¾ãã¦ï¼æ¬¡ã®å®ç¾©ãçæ
+ããï¼
+
+ï¼mpfãNULLã®å ´åã®ã¿çæ
+static MPF_T _kernel_mpf_<åºå®é·ã¡ã¢ãªãã¼ã«å>[(blkcnt) * COUNT_MPF_T(blksz)];
+								
+ï¼å¿
+ãçæ
+static MPFMB _kernel_mpfmb_<åºå®é·ã¡ã¢ãªãã¼ã«å>[blkcnt];
+
+4.5.8.2 åºå®é·ã¡ã¢ãªãã¼ã«ã®åæåæ
+å ±
+
+åºå®é·ã¡ã¢ãªãã¼ã«åæåãã­ãã¯ä¸­ã«çæããåºå®é·ã¡ã¢ãªãã¼ã«ã®åæå
+æ
+å ±ã¯ï¼æ¬¡ã®å½¢å¼ã¨ããï¼
+
+ï¼mpfãNULLã§ãªãå ´å
+	{ (mpfatr), (blkcnt), ROUND_MPF_T(blksz), (void *)(mpf),
+						_kernel_mpfmb_<åºå®é·ã¡ã¢ãªãã¼ã«å> }
+
+ï¼mpfãNULLã®å ´å
+	{ (mpfatr), (blkcnt), ROUND_MPF_T(blksz),
+						_kernel_mpf_<åºå®é·ã¡ã¢ãªãã¼ã«å>,
+						_kernel_mpfmb_<åºå®é·ã¡ã¢ãªãã¼ã«å> }
+
+4.5.8.3 ã¨ã©ã¼æ¡ä»¶
+
+åºå®é·ã¡ã¢ãªãã¼ã«ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿æ¬ä½ãæ¤åºãããã®
+ã»åãmpfidã«å¯¾ããCRE_MPFãè¤æ°ããå ´åï¼E_OBJï¼ï¼»NGKI2236ï¼½
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»mpfatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2225ï¼½
+ãï¼TA_TPRIä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+ã»blkcntã0ä»¥ä¸ã®å ´åï¼E_PARï¼ï¼»NGKI2229ï¼½
+ã»blkszã0ä»¥ä¸ã®å ´åï¼E_PARï¼ï¼»NGKI2230ï¼½
+ã»mpfmbãNULLã§ãªãå ´åï¼E_NOSPTï¼ï¼»ASPS0166ï¼½
+
+ï¼ãã¹3ã§æ¤åºãããã®
+ã»mpfãåºå®é·ã¡ã¢ãªãã¼ã«é åã®å
+é ­çªå°ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼
+ãï¼»NGKI2249ï¼½
+	- ã¿ã¼ã²ããä¾å­ã®å¤ï¼CHECK_MPF_ALIGNï¼ã®åæ°ã§ãªãå ´å
+	- NULLã®å ´åï¼ã¿ã¼ã²ããä¾å­ï¼CHECK_MPF_NONNULLï¼
+
+4.5.9 å¨æéç¥ã«é¢ããå®ç¾©
+
+å¨æéç¥ã®çç¥è¨å·ã¯ãCYCï¼cycãã§ããï¼ä»¥ä¸ã§ã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥
+ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®éçAPIãå«ã¾ãã¦ããæã«çæãã¹ãæ
+å ±ã«ã¤ãã¦
+è¿°ã¹ãï¼ãªãï¼å¨æéç¥ã«å¿
+è¦ãªã¡ã¢ãªé åã¯ãªãï¼
+
+	CRE_CYC(cycid, { cycatr, ï¼éç¥æ¹æ³ã®æå®ï¼, cyctim, cycphs });
+
+4.5.9.1 éç¥ãã³ãã©ã®çæ
+
+éçAPIä¸­ã®ï¼éç¥æ¹æ³ã®æå®ï¼ã«å¾ã£ã¦ï¼éç¥ãã³ãã©ãçæããï¼ä»¥ä¸ã§ã¯ï¼
+çæããéç¥ãã³ãã©ã®é¢æ°åãnfyhdrï¼æ¡å¼µæ
+å ±ãexinfã¨è¨è¿°ããï¼
+
+ãã ãï¼ï¼éç¥æ¹æ³ã®æå®ï¼ã®æåã®ãã©ã¡ã¼ã¿ã§ããéç¥å¦çã¢ã¼ã
+ï¼nfymodeï¼ãTNFY_HANDLERï¼ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºãã«ããéç¥ï¼ã§
+ããå ´åã«ã¯ï¼ç¶ã2ã¤ã®ãã©ã¡ã¼ã¿ï¼ã¿ã¤ã ã¤ãã³ããã³ãã©ã®æ¡å¼µæ
+å ±ã¨å
+
+é ­çªå°ï¼ã®æå®ã«å¾ã£ã¦ã¿ã¤ã ã¤ãã³ããã³ãã©ãå¼ã³åºããã®ã¨ãï¼éç¥ã
+ã³ãã©ã¯çæããªãï¼ãã®å ´åï¼nfyhdrã¨exinfã¯ï¼æ¬¡ã®éãã¨ããï¼
+
+	nfyhdr		(NFYHDR)(ï¼ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å
+é ­çªå°ï¼)
+	exinf		ï¼ã¿ã¤ã ã¤ãã³ããã³ãã©ã®æ¡å¼µæ
+å ±ï¼
+
+ãªãï¼éç¥ãã³ãã©ã®çææ¹æ³ã«ã¤ãã¦ã¯ï¼ã4.6 éç¥ãã³ãã©ã®çæãã®ç¯
+ãåç
+§ãããã¨ï¼
+
+4.5.9.2 å¨æéç¥ã®åæåæ
+å ±
+
+å¨æéç¥åæåãã­ãã¯ä¸­ã«çæããå¨æéç¥ã®åæåæ
+å ±ã¯ï¼æ¬¡ã®å½¢å¼ã¨ã
+ãï¼
+
+	{ (cycatr), (intptr_t)(exinf), nfyhdr, (cyctim), (cycphs) }
+
+4.5.9.3 ã¨ã©ã¼æ¡ä»¶
+
+å¨æéç¥ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿æ¬ä½ãæ¤åºãããã®
+ã»åãcycidã«å¯¾ããCRE_CYCãè¤æ°ããå ´åï¼E_OBJï¼ï¼»NGKI2392ï¼½
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»cycatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2383ï¼½
+ãï¼TA_STAä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+ã»(0 < cyctim && cyctim <= TMAX_RELTIM)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI2397ï¼½
+ã»(0 <= cycphs && cycphs <= TMAX_RELTIM)ã§ãªãå ´åï¼E_PARï¼ï¼»NGKI2399ï¼½
+ã»ãã®ä»ï¼éç¥ãã³ãã©ã®çæã«é¢ããã¨ã©ã¼ï¼4.6.13ç¯ï¼ãåç
+§
+
+ï¼ãã¹3ã§æ¤åºãããã®
+ã»éç¥æ¹æ³ä¸­ã®ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å
+é ­çªå°ã¾ãã¯å¤æ°ã®çªå°ãæ­£ãã
+ããªãï¼E_PARï¼ï¼»NGKI3693ï¼½
+	- ã¿ã¼ã²ããä¾å­ã®å¤ï¼CHECK_FUNC_ALIGNï¼ã®åæ°ã§ãªãå ´å
+	- NULLã®å ´åï¼ã¿ã¼ã²ããä¾å­ï¼CHECK_FUNC_NONNULLï¼
+ã»ãã®ä»ï¼éç¥ãã³ãã©ã®çæã«é¢ããã¨ã©ã¼ï¼4.6.13ç¯ï¼ãåç
+§
+
+4.5.10 ã¢ã©ã¼ã éç¥ã«é¢ããå®ç¾©
+
+ã¢ã©ã¼ã éç¥ã®çç¥è¨å·ã¯ãALMï¼almãã§ããï¼ä»¥ä¸ã§ã¯ï¼ã·ã¹ãã ã³ã³ãã£
+ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®éçAPIãå«ã¾ãã¦ããæã«çæãã¹ãæ
+å ±ã«ã¤
+ãã¦è¿°ã¹ãï¼ãªãï¼ã¢ã©ã¼ã éç¥ã«å¿
+è¦ãªã¡ã¢ãªé åã¯ãªãï¼
+
+	CRE_ALM(ID almid, { almatr, ï¼éç¥æ¹æ³ã®æå®ï¼ });
+
+4.5.10.1 éç¥ãã³ãã©ã®çæ
+
+éçAPIä¸­ã®ï¼éç¥æ¹æ³ã®æå®ï¼ã«å¾ã£ã¦ï¼éç¥ãã³ãã©ãçæããï¼ä»¥ä¸ã§ã¯ï¼
+çæããéç¥ãã³ãã©ã®é¢æ°åãnfyhdrï¼æ¡å¼µæ
+å ±ãexinfã¨è¨è¿°ããï¼
+
+ãã ãï¼ï¼éç¥æ¹æ³ã®æå®ï¼ã®æåã®ãã©ã¡ã¼ã¿ã§ããéç¥å¦çã¢ã¼ã
+ï¼nfymodeï¼ãTNFY_HANDLERï¼ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºãã«ããéç¥ï¼ã§
+ããå ´åã«ã¯ï¼ç¶ã2ã¤ã®ãã©ã¡ã¼ã¿ï¼ã¿ã¤ã ã¤ãã³ããã³ãã©ã®æ¡å¼µæ
+å ±ã¨å
+
+é ­çªå°ï¼ã®æå®ã«å¾ã£ã¦ã¿ã¤ã ã¤ãã³ããã³ãã©ãå¼ã³åºããã®ã¨ãï¼éç¥ã
+ã³ãã©ã¯çæããªãï¼ãã®å ´åï¼nfyhdrã¨exinfã¯ï¼æ¬¡ã®éãã¨ããï¼
+
+	nfyhdr		(NFYHDR)(ï¼ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å
+é ­çªå°ï¼)
+	exinf		ï¼ã¿ã¤ã ã¤ãã³ããã³ãã©ã®æ¡å¼µæ
+å ±ï¼
+
+ãªãï¼éç¥ãã³ãã©ã®çææ¹æ³ã«ã¤ãã¦ã¯ï¼ã4.6 éç¥ãã³ãã©ã®çæãã®ç¯
+ãåç
+§ãããã¨ï¼
+
+4.5.10.2 ã¢ã©ã¼ã éç¥ã®åæåæ
+å ±
+
+ã¢ã©ã¼ã éç¥åæåãã­ãã¯ä¸­ã«çæããã¢ã©ã¼ã éç¥ã®åæåæ
+å ±ã¯ï¼æ¬¡ã®
+å½¢å¼ã¨ããï¼
+
+	{ (almatr), ï¼intptr_t)(exinf), nfyhdr }
+
+4.5.10.3 ã¨ã©ã¼æ¡ä»¶
+
+ã¢ã©ã¼ã éç¥ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿æ¬ä½ãæ¤åºãããã®
+ã»åãalmidã«å¯¾ããCRE_ALMãè¤æ°ããå ´åï¼E_OBJï¼ï¼»NGKI2500ï¼½
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»almatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2491ï¼½
+ãï¼TA_STAä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+ã»ãã®ä»ï¼éç¥ãã³ãã©ã®çæã«é¢ããã¨ã©ã¼ï¼4.6.13ç¯ï¼ãåç
+§
+
+ï¼ãã¹3ã§æ¤åºãããã®
+ã»éç¥æ¹æ³ä¸­ã®ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å
+é ­çªå°ã¾ãã¯å¤æ°ã®çªå°ãæ­£ãã
+ããªãï¼E_PARï¼ï¼»NGKI3693ï¼½
+	- ã¿ã¼ã²ããä¾å­ã®å¤ï¼CHECK_FUNC_ALIGNï¼ã®åæ°ã§ãªãå ´å
+	- NULLã®å ´åï¼ã¿ã¼ã²ããä¾å­ï¼CHECK_FUNC_NONNULLï¼
+ã»ãã®ä»ï¼éç¥ãã³ãã©ã®çæã«é¢ããã¨ã©ã¼ï¼4.6.13ç¯ï¼ãåç
+§
+
+4.6 éç¥ãã³ãã©ã®çæ
+
+éç¥ãã³ãã©ã¯ï¼å¨æéç¥æ©è½ã¨ã¢ã©ã¼ã éç¥æ©è½ã®ããã®ã¤ãã³ãã®éç¥ã
+ãã³ã¤ãã³ãéç¥æã«çºçããã¨ã©ã¼ã®éç¥ãè¡ãããã®ãã³ãã©ã§ããï¼é
+ç¥ãã³ãã©ã¯ï¼ã«ã¼ãã«å®è£
+ä¸ã®æ¦å¿µã§ããï¼å¤é¨ä»æ§æ¸ã«ã¯ç»å ´ããªãï¼ã¿
+ã¤ã ã¤ãã³ããã³ãã©ã¨ä½ç½®ä»ããé¡ä¼¼ãã¦ããããï¼æ··åããªãããã«æ³¨æ
+ãããã¨ï¼ï¼
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«ããï¼å¨æéç¥æ¯ããã³ã¢ã©ã¼ã é
+ç¥æ¯ã«éç¥ãã³ãã©ãçæããï¼ãã ãï¼ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºãã«
+ããéç¥ã®å ´åã«ã¯ï¼éç¥ãã³ãã©ãçæããï¼ç´æ¥ã¿ã¤ã ã¤ãã³ããã³ãã©
+ãå¼ã³åºãï¼
+
+çæããéç¥ãã³ãã©ã®æ çµã¿ã¯æ¬¡ã®éãï¼
+
+(a) ã¨ã©ã¼ã®éç¥ãè¡ããªãå ´å
+
+static void
+_kernel_nfyhdr_<cycid ã¾ãã¯ almid>(intptr_t exinf)
+{
+	(void) ï¼ã¤ãã³ãã®éç¥å¦çï¼;
+}
+
+(b) ã¨ã©ã¼ã®éç¥ãè¡ãå ´å
+
+static void
+_kernel_nfyhdr_<cycid ã¾ãã¯ almid>(intptr_t exinf)
+{
+	ER		ercd;
+
+	ercd = ï¼ã¤ãã³ãã®éç¥å¦çï¼;
+	if (ercd != E_OK) {
+		(void) ï¼ã¨ã©ã¼ã®éç¥å¦çï¼;
+	}
+}
+
+ï¼ã¤ãã³ãã®éç¥å¦çï¼ã¨ï¼ã¨ã©ã¼ã®éç¥å¦çï¼ã¯ï¼ï¼éç¥æ¹æ³ã®æå®ï¼ã®æ
+åã®ãã©ã¡ã¼ã¿ã§ããéç¥å¦çã¢ã¼ãï¼nfymodeï¼ã«ããå®ã¾ãï¼å
+·ä½çã«ã¯ï¼
+nfymodeã®ä¸ä½4ãããï¼ä»¥ä¸ï¼ãããnfymode1ã¨æ¸ãï¼ã§ã¤ãã³ãã®éç¥æ¹æ³
+ãï¼æ®ãã®ãããï¼ä»¥ä¸ï¼ãããnfymode2ã¨æ¸ãï¼ã§ã¨ã©ã¼ã®éç¥æ¹æ³ãæå®
+ããï¼
+
+4.6.1 å¤æ°ã®è¨­å®ã«ããã¤ãã³ãéç¥
+
+nfymode1ãTNFY_SETVERï¼å¤æ°ã®è¨­å®ã«ããã¤ãã³ãéç¥ï¼ã®å ´åã«ã¯ï¼ç¶ã2
+ã¤ã®ãã©ã¡ã¼ã¿ï¼å¤æ°ã®çªå°ã¨è¨­å®ããå¤ï¼ã®æå®ã«å¾ã£ã¦å¤æ°ãè¨­å®ããã
+ã®ã¨ããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã§ã®ã¨ã©ã¼ãã§ãã¯ãå¯è½ã«ããããã«ï¼
+å¤æ°ã®çªå°ã¯ï¼exinfã¨ãã¦éç¥ãã³ãã©ã«æ¸¡ãï¼
+
+å
+·ä½çã«ã¯ï¼ï¼ã¤ãã³ãã®éç¥å¦çï¼ã«ã¯ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	*((intptr_t *) exinf) = (ï¼è¨­å®ããå¤ï¼);
+
+å¨æï¼ã¢ã©ã¼ã éç¥åæåãã­ãã¯ã«ç»é²ããnfyhdrã¨exinfã¯ï¼æ¬¡ã®éãã¨ã
+ãï¼
+
+	nfyhdr		_kernel_nfyhdr_<cycid ã¾ãã¯ almid>
+	exinf		ï¼å¤æ°ã®çªå°ï¼
+
+ãªãï¼å¤æ°ã®è¨­å®ã«ããã¤ãã³ãéç¥ã®å ´åï¼ã¨ã©ã¼ãæ¤åºããããã¨ã¯ãªã
+ããï¼ã¨ã©ã¼ã®éç¥ã¯æå³ããªãï¼ã¨ã©ã¼ã®éç¥ãæå®ããã¦ããå ´åï¼ã³ã³
+ãã£ã®ã¥ã¬ã¼ã¿ã¯ã¨ã©ã¼ãå ±åããï¼
+
+4.6.2 ã¿ã¹ã¯ã®èµ·åã«ããã¤ãã³ãéç¥
+
+nfymode1ãTNFY_ACTTSKï¼ã¿ã¹ã¯ã®èµ·åã«ããã¤ãã³ãéç¥ï¼ã®å ´åã«ã¯ï¼ç¶ã
+1ã¤ã®ãã©ã¡ã¼ã¿ï¼ã¿ã¹ã¯IDï¼ã®æå®ã«å¾ã£ã¦ã¿ã¹ã¯ãèµ·åãããã®ã¨ããï¼ã³
+ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã§ã®ã¨ã©ã¼ãã§ãã¯ãå¯è½ã«ããããã«ï¼ã¿ã¹ã¯IDã¯ï¼
+exinfã¨ãã¦éç¥ãã³ãã©ã«æ¸¡ãï¼
+
+å
+·ä½çã«ã¯ï¼ï¼ã¤ãã³ãã®éç¥å¦çï¼ã«ã¯ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	act_tsk((ID) exinf);
+
+å¨æï¼ã¢ã©ã¼ã éç¥åæåãã­ãã¯ã«ç»é²ããnfyhdrã¨exinfã¯ï¼æ¬¡ã®éãã¨ã
+ãï¼
+
+	nfyhdr		_kernel_nfyhdr_<cycid ã¾ãã¯ almid>
+	exinf		ï¼ã¿ã¹ã¯IDï¼
+
+4.6.3 ã¿ã¹ã¯ã®èµ·åºã«ããã¤ãã³ãéç¥
+
+nfymode1ãTNFY_WUPTSKï¼ã¿ã¹ã¯ã®èµ·åºã«ããã¤ãã³ãéç¥ï¼ã®å ´åã«ã¯ï¼ç¶ã
+1ã¤ã®ãã©ã¡ã¼ã¿ï¼ã¿ã¹ã¯IDï¼ã®æå®ã«å¾ã£ã¦ã¿ã¹ã¯ãèµ·åºãããã®ã¨ããï¼ã³
+ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã§ã®ã¨ã©ã¼ãã§ãã¯ãå¯è½ã«ããããã«ï¼ã¿ã¹ã¯IDã¯ï¼
+exinfã¨ãã¦éç¥ãã³ãã©ã«æ¸¡ãï¼
+
+å
+·ä½çã«ã¯ï¼ï¼ã¤ãã³ãã®éç¥å¦çï¼ã«ã¯ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	wup_tsk((ID) exinf);
+
+å¨æï¼ã¢ã©ã¼ã éç¥åæåãã­ãã¯ã«ç»é²ããnfyhdrã¨exinfã¯ï¼æ¬¡ã®éãã¨ã
+ãï¼
+
+	nfyhdr		_kernel_nfyhdr_<cycid ã¾ãã¯ almid>
+	exinf		ï¼ã¿ã¹ã¯IDï¼
+
+4.6.4 ã»ããã©ã®è¿å´ã«ããã¤ãã³ãéç¥
+
+nfymode1ãTNFY_SIGSEMï¼ã»ããã©ã®è¿å´ã«ããã¤ãã³ãéç¥ï¼ã®å ´åã«ã¯ï¼ç¶
+ã1ã¤ã®ãã©ã¡ã¼ã¿ï¼ã»ããã©IDï¼ã®æå®ã«å¾ã£ã¦ã»ããã©ãè¿å´ãèµ·åããã
+ã®ã¨ããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã§ã®ã¨ã©ã¼ãã§ãã¯ãå¯è½ã«ããããã«ï¼
+ã»ããã©IDã¯ï¼exinfã¨ãã¦éç¥ãã³ãã©ã«æ¸¡ãï¼
+
+å
+·ä½çã«ã¯ï¼ï¼ã¤ãã³ãã®éç¥å¦çï¼ã«ã¯ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	sig_sem((ID) exinf);
+
+å¨æï¼ã¢ã©ã¼ã éç¥åæåãã­ãã¯ã«ç»é²ããnfyhdrã¨exinfã¯ï¼æ¬¡ã®éãã¨ã
+ãï¼
+
+	nfyhdr		_kernel_nfyhdr_<cycid ã¾ãã¯ almid>
+	exinf		ï¼ã»ããã©IDï¼
+
+4.6.5 ã¤ãã³ããã©ã°ã®ã»ããã«ããã¤ãã³ãéç¥
+
+nfymode1ãTNFY_SETFLGï¼ã¤ãã³ããã©ã°ã®ã»ããã«ããã¤ãã³ãéç¥ï¼ã®å ´å
+ã«ã¯ï¼ç¶ã2ã¤ã®ãã©ã¡ã¼ã¿ï¼ã¤ãã³ããã©ã°IDã¨ã»ããããããããã¿ã¼ã³ï¼
+ã®æå®ã«å¾ã£ã¦ã¤ãã³ããã©ã°ãã»ãããããã®ã¨ããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿
+ã®ãã¹3ã§ã®ã¨ã©ã¼ãã§ãã¯ãå¯è½ã«ããããã«ï¼ã¤ãã³ããã©ã°IDã¯ï¼exinf
+ã¨ãã¦éç¥ãã³ãã©ã«æ¸¡ãï¼
+
+å
+·ä½çã«ã¯ï¼ï¼ã¤ãã³ãã®éç¥å¦çï¼ã«ã¯ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	set_flg((ID) exinf, ï¼ã»ããããããããã¿ã¼ã³ï¼);
+
+å¨æï¼ã¢ã©ã¼ã éç¥åæåãã­ãã¯ã«ç»é²ããnfyhdrã¨exinfã¯ï¼æ¬¡ã®éãã¨ã
+ãï¼
+
+	nfyhdr		_kernel_nfyhdr_<cycid ã¾ãã¯ almid>
+	exinf		ï¼ã¤ãã³ããã©ã°IDï¼
+
+4.6.6 ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ã«ããã¤ãã³ãéç¥
+
+nfymode1ãTNFY_SNDDTQï¼ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ã«ããã¤ãã³ãéç¥ï¼ã®å ´åã«
+ã¯ï¼ç¶ã2ã¤ã®ãã©ã¡ã¼ã¿ï¼ãã¼ã¿ã­ã¥ã¼IDã¨éä¿¡ããå¤ï¼ã®æå®ã«å¾ã£ã¦ãã¼
+ã¿ã­ã¥ã¼ã¸éä¿¡ãããã®ã¨ããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã§ã®ã¨ã©ã¼ãã§ã
+ã¯ãå¯è½ã«ããããã«ï¼ãã¼ã¿ã­ã¥ã¼IDã¯ï¼exinfã¨ãã¦éç¥ãã³ãã©ã«æ¸¡ãï¼
+
+å
+·ä½çã«ã¯ï¼ï¼ã¤ãã³ãã®éç¥å¦çï¼ã«ã¯ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	snd_dtq((ID) exinf, ï¼éä¿¡ããå¤ï¼);
+
+å¨æï¼ã¢ã©ã¼ã éç¥åæåãã­ãã¯ã«ç»é²ããnfyhdrã¨exinfã¯ï¼æ¬¡ã®éãã¨ã
+ãï¼
+
+	nfyhdr		_kernel_nfyhdr_<cycid ã¾ãã¯ almid>
+	exinf		ï¼ãã¼ã¿ã­ã¥ã¼IDï¼
+
+4.6.7 å¤æ°ã®è¨­å®ã«ããã¨ã©ã¼éç¥
+
+nfymode2ãTENFY_SETVERï¼å¤æ°ã®è¨­å®ã«ããã¨ã©ã¼éç¥ï¼ã®å ´åã«ã¯ï¼ç¶ã1ã¤
+ã®ãã©ã¡ã¼ã¿ï¼å¤æ°ã®çªå°ï¼ã®æå®ã«å¾ã£ã¦ï¼ã¨ã©ã¼ã³ã¼ããå¤æ°ã«è¨­å®ãã
+ãã®ã¨ããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã§ã®ã¨ã©ã¼ãã§ãã¯ãå¯è½ã«ãããã
+ã«ï¼å¤æ°ã®çªå°ã¯ï¼ã°ã­ã¼ãã«å¤æ°ãéãã¦ã¦éç¥ãã³ãã©ã«æ¸¡ãï¼
+
+å
+·ä½çã«ã¯ï¼éç¥ãã³ãã©ã®å®ç¾©ã«å
+ç«ã¡ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	intptr_t *const _kernel_nfyhdr_<cycid ã¾ãã¯ almid>_p_evar
+										= (intptr_t *)(ï¼å¤æ°ã®çªå°ï¼);
+
+ã¾ãï¼ï¼ã¨ã©ã¼ã®éç¥å¦çï¼ã«ã¯ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	*((intptr_t *) _kernel_nfyhdr_<cycid ã¾ãã¯ almid>_p_evar)
+													= (intptr_t) ercd;
+
+4.6.8 ã¿ã¹ã¯ã®èµ·åã«ããã¨ã©ã¼éç¥
+
+nfymode2ãTENFY_ACTTSKï¼ã¿ã¹ã¯ã®èµ·åã«ããã¨ã©ã¼éç¥ï¼ã®å ´åã«ã¯ï¼ç¶ã
+1ã¤ã®ãã©ã¡ã¼ã¿ï¼ã¿ã¹ã¯IDï¼ã®æå®ã«å¾ã£ã¦ã¿ã¹ã¯ãèµ·åãããã®ã¨ããï¼ã³
+ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã§ã®ã¨ã©ã¼ãã§ãã¯ãå¯è½ã«ããããã«ï¼ã¿ã¹ã¯IDã¯ï¼
+ã°ã­ã¼ãã«å¤æ°ãéãã¦éç¥ãã³ãã©ã«æ¸¡ãï¼
+
+å
+·ä½çã«ã¯ï¼éç¥ãã³ãã©ã®å®ç¾©ã«å
+ç«ã¡ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	const ID _kernel_nfyhdr_<cycid ã¾ãã¯ almid>_etskid
+													= ï¼ã¿ã¹ã¯IDï¼;
+
+ã¾ãï¼ï¼ã¨ã©ã¼ã®éç¥å¦çï¼ã«ã¯ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	act_tsk(_kernel_nfyhdr_<cycid ã¾ãã¯ almid>_etskid);
+
+4.6.9 ã¿ã¹ã¯ã®èµ·åºã«ããã¨ã©ã¼éç¥
+
+nfymode2ãTENFY_WUPTSKï¼ã¿ã¹ã¯ã®èµ·åºã«ããã¨ã©ã¼éç¥ï¼ã®å ´åã«ã¯ï¼ç¶ã
+1ã¤ã®ãã©ã¡ã¼ã¿ï¼ã¿ã¹ã¯IDï¼ã®æå®ã«å¾ã£ã¦ã¿ã¹ã¯ãèµ·åºãããã®ã¨ããï¼ã³
+ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã§ã®ã¨ã©ã¼ãã§ãã¯ãå¯è½ã«ããããã«ï¼ã¿ã¹ã¯IDã¯ï¼
+ã°ã­ã¼ãã«å¤æ°ãéãã¦éç¥ãã³ãã©ã«æ¸¡ãï¼
+
+å
+·ä½çã«ã¯ï¼éç¥ãã³ãã©ã®å®ç¾©ã«å
+ç«ã¡ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	const ID _kernel_nfyhdr_<cycid ã¾ãã¯ almid>_etskid
+													= ï¼ã¿ã¹ã¯IDï¼;
+
+ã¾ãï¼ï¼ã¨ã©ã¼ã®éç¥å¦çï¼ã«ã¯ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	wup_tsk(_kernel_nfyhdr_<cycid ã¾ãã¯ almid>_ptskid);
+
+4.6.10 ã»ããã©ã®è¿å´ã«ããã¨ã©ã¼éç¥
+
+nfymode2ãTENFY_SIGSEMï¼ã»ããã©ã®è¿å´ã«ããã¨ã©ã¼éç¥ï¼ã®å ´åã«ã¯ï¼ç¶
+ã1ã¤ã®ãã©ã¡ã¼ã¿ï¼ã»ããã©IDï¼ã®æå®ã«å¾ã£ã¦ã»ããã©ãè¿å´ãããã®ã¨ã
+ãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã§ã®ã¨ã©ã¼ãã§ãã¯ãå¯è½ã«ããããã«ï¼ã»ã
+ãã©IDã¯ï¼ã°ã­ã¼ãã«å¤æ°ãéãã¦éç¥ãã³ãã©ã«æ¸¡ãï¼
+
+å
+·ä½çã«ã¯ï¼éç¥ãã³ãã©ã®å®ç¾©ã«å
+ç«ã¡ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	const ID _kernel_nfyhdr_<cycid ã¾ãã¯ almid>_esemid
+													= ï¼ã»ããã©IDï¼;
+
+ã¾ãï¼ï¼ã¨ã©ã¼ã®éç¥å¦çï¼ã«ã¯ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	sig_sem(_kernel_nfyhdr_<cycid ã¾ãã¯ almid>_esemid);
+
+4.6.11 ã¤ãã³ããã©ã°ã®ã»ããã«ããã¨ã©ã¼éç¥
+
+nfymode2ãTENFY_SETFIGï¼ã¤ãã³ããã©ã°ã®ã»ããã«ããã¨ã©ã¼éç¥ï¼ã®å ´å
+ã«ã¯ï¼ç¶ã2ã¤ã®ãã©ã¡ã¼ã¿ï¼ã¤ãã³ããã©ã°IDã¨ã»ããããããããã¿ã¼ã³ï¼
+ã®æå®ã«å¾ã£ã¦ã¤ãã³ããã©ã°ãã»ãããããã®ã¨ããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿
+ã®ãã¹3ã§ã®ã¨ã©ã¼ãã§ãã¯ãå¯è½ã«ããããã«ï¼ã¤ãã³ããã©ã°IDã¯ï¼ã°ã­ã¼
+ãã«å¤æ°ãéãã¦éç¥ãã³ãã©ã«æ¸¡ãï¼
+
+å
+·ä½çã«ã¯ï¼éç¥ãã³ãã©ã®å®ç¾©ã«å
+ç«ã¡ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	const ID _kernel_nfyhdr_<cycid ã¾ãã¯ almid>_eflgid
+												= ï¼ã¤ãã³ããã©ã°IDï¼;
+
+ã¾ãï¼ï¼ã¨ã©ã¼ã®éç¥å¦çï¼ã«ã¯ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	set_flg(_kernel_nfyhdr_<cycid ã¾ãã¯ almid>_eflgid,
+										ï¼ã»ããããããããã¿ã¼ã³ï¼);
+
+4.6.12 ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ã«ããã¨ã©ã¼éç¥
+
+nfymode2ãTENFY_SNDDTQï¼ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ã«ããã¨ã©ã¼éç¥ï¼ã®å ´åã«
+ã¯ï¼ç¶ã1ã¤ã®ãã©ã¡ã¼ã¿ï¼ãã¼ã¿ã­ã¥ã¼IDï¼ã®æå®ã«å¾ã£ã¦ï¼ã¨ã©ã¼ã³ã¼ãã
+ãã¼ã¿ã­ã¥ã¼ã¸éä¿¡ãããã®ã¨ããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã§ã®ã¨ã©ã¼
+ãã§ãã¯ãå¯è½ã«ããããã«ï¼ãã¼ã¿ã­ã¥ã¼IDã¯ï¼ã°ã­ã¼ãã«å¤æ°ãéãã¦é
+ç¥ãã³ãã©ã«æ¸¡ãï¼
+
+å
+·ä½çã«ã¯ï¼éç¥ãã³ãã©ã®å®ç¾©ã«å
+ç«ã¡ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	const ID _kernel_nfyhdr_<cycid ã¾ãã¯ almid>_edtqid
+												= ï¼ãã¼ã¿ã­ã¥ã¼IDï¼;
+
+ã¾ãï¼ï¼ã¨ã©ã¼ã®éç¥å¦çï¼ã«ã¯ï¼æ¬¡ã®ã³ã¼ããçæããï¼
+
+	snd_dtq(_kernel_nfyhdr_<cycid ã¾ãã¯ almid>_edtqid, (intptr_t) ercd);
+
+4.6.13 ã¨ã©ã¼æ¡ä»¶
+
+éç¥ãã³ãã©ã®çæã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»nfymodeã®å¤ãæ­£ãããªãï¼E_PARï¼ï¼»NGKI3730ï¼½ï¼»NGKI3721ï¼½
+
+ï¼ãã¹3ã§æ¤åºãããã®
+ã»éç¥æ¹æ³ä¸­ã®å¤æ°ã®çªå°ãæ­£ãããªãï¼E_PARï¼ï¼»NGKI3699ï¼½ï¼»NGKI3701ï¼½
+	- ã¿ã¼ã²ããä¾å­ã®å¤ï¼CHECK_INTPTR_ALIGNï¼ã®åæ°ã§ãªãå ´å
+	- NULLã®å ´åï¼ã¿ã¼ã²ããä¾å­ï¼CHECK_INTPTR_NONNULLï¼
+ã»éç¥æ¹æ³ä¸­ã®ã¿ã¹ã¯IDãæå¹ç¯å²å¤ã®å ´åï¼E_IDï¼ï¼»NGKI3704ï¼½
+ã»éç¥æ¹æ³ä¸­ã®ã»ããã©IDãæå¹ç¯å²å¤ã®å ´åï¼E_IDï¼ï¼»NGKI3707ï¼½
+ã»éç¥æ¹æ³ä¸­ã®ã¤ãã³ããã©ã°IDãæå¹ç¯å²å¤ã®å ´åï¼E_IDï¼ï¼»NGKI3710ï¼½
+ã»éç¥æ¹æ³ä¸­ã®ãã¼ã¿ã­ã¥ã¼IDãæå¹ç¯å²å¤ã®å ´åï¼E_IDï¼ï¼»NGKI3713ï¼½
+ãï¼»NGKI3715ï¼½
+
+4.7 å²è¾¼ã¿ã«é¢ããå®ç¾©
+
+4.7.1 å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã«é¢ããå®ç¾©
+
+4.7.1.1 ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+
+çæããå²è¾¼ã¿ãã³ãã©cã®ä¸­ã§ä½¿ç¨ãããã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ãçæããï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®è¡ãçæããï¼
+
+#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 */
+
+4.7.1.2 å²è¾¼ã¿ãã³ãã©ã®çæ
+
+ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ä¸­ã«å«ã¾ããå²è¾¼ã¿ãµã¼ãã¹ã«ã¼ã
+ã³ãè¿½å ããéçAPIãCRE_ISRãã«å¯¾ãã¦ï¼åä¸ã®å²è¾¼ã¿çªå·ã«å¯¾ãã¦è¿½å ã
+ããå²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ãé ã«å¼ã³åºãé¢æ°ãçæããï¼
+
+å
+·ä½çã«ã¯ï¼åä¸ã®å²è¾¼ã¿çªå·ã«å¯¾ãã¦å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ãè¿½å ãã
+
+	CRE_ISR(ISR_1, { isratr_1, exinf_1, intno, isr_1, isrpri_1 });
+	CRE_ISR(ISR_2, { isratr_2, exinf_2, intno, isr_2, isrpri_2 });
+		â¦â¦
+	CRE_ISR(ISR_N, { isratr_n, exinf_n, intno, isr_n, isrpri_n });
+
+ã¨ããéçAPIã«å¯¾ãã¦ï¼æ¬¡ã®ãããªé¢æ°ãçæããï¼ããã§ï¼isrpri_1ï¼
+isrpri_2ï¼â¦â¦ï¼isrpri_nã¯ï¼å¤ã®å°ããé ã«ä¸¦ã¹æ¿ãããã¦ãããã®ã¨ããï¼
+å¤ãåããã®ã®éã§ã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ä¸­ã§ã®éç
+APIã®é åºã®éãã«ä¸¦ãã§ãããã®ã¨ããï¼
+
+static void
+_kernel_inthdr_<intno>(void)
+{
+	LOG_ISR_ENTER(ISR_1);		/* ISR_1ã®å¼åºã */
+	((ISR)(isr_1))((intptr_t)(exinf_1));
+	LOG_ISR_LEAVE(ISR_1);
+
+	if (sense_lock()) {			/* ISRã®å¼åºãåã®ç¶æ
+ã«æ»ã */
+		unlock_cpu();
+	}
+
+	LOG_ISR_ENTER(ISR_2);		/* ISR_2ã®å¼åºã */
+	((ISR)(isr_2))((intptr_t)(exinf_2));
+	LOG_ISR_LEAVE(ISR_2);
+
+	if (sense_lock()) {			/* ISRã®å¼åºãåã®ç¶æ
+ã«æ»ã */
+		unlock_cpu();
+	}
+
+	â¦â¦
+
+	LOG_ISR_ENTER(ISR_N);		/* ISR_Nã®å¼åºã */
+	((ISR)(isr_n))((intptr_t)(exinf_n));
+	LOG_ISR_LEAVE(ISR_N);
+}
+
+ããã§ï¼ISR_Nã®å¼åºãã®å¾ã«å¼åºãåã®ç¶æ
+ã«æ»ããªãã®ã¯ï¼å²è¾¼ã¿ãã³ãã©
+ããã®ãªã¿ã¼ã³ã«ããï¼ã«ã¼ãã«ãå
+ã®ç¶æ
+ã«æ»ãããã§ããï¼
+
+åä¸ã®å²è¾¼ã¿çªå·ã«å¯¾ãã¦è¿½å ãããå²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã1ã¤ã®ã¿ã®å ´å
+ã«ã¯ï¼æ¬¡ã®ãããªé¢æ°ãçæããï¼
+
+static void
+_kernel_inthdr_<intno>(void)
+{
+	LOG_ISR_ENTER(ISR_1);
+	((ISR)(isr_1))((intptr_t)(exinf_1));
+	LOG_ISR_LEAVE(ISR_1);
+}
+
+4.7.1.3 å²è¾¼ã¿ãã³ãã©ã®å®ç¾©ã«ç¸å½ããå¦ç
+
+ä¸ã®ããã«å²è¾¼ã¿ãã³ãã©ãçæããå ´åã«ã¯ï¼æ¬¡ã«èª¬æããå²è¾¼ã¿ãã³ãã©
+ã«é¢ããå®ç¾©ã«ããã¦ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ä¸­ã«æ¬¡ã®é
+çAPIãå«ã¾ãã¦ããã®ã¨åæ§ã«å¦çããï¼
+
+	DEF_INH(inhno, { TA_NULL, _kernel_inthdr_<intno> });
+
+ããã§inhnoã¯ï¼intnoã«å¯¾å¿ããå²è¾¼ã¿ãã³ãã©çªå·ã§ããï¼
+
+4.7.1.4 ã¨ã©ã¼æ¡ä»¶
+
+å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿æ¬ä½ãæ¤åºãããã®
+ã»åãisridã«å¯¾ããCRE_ISRãè¤æ°ããå ´åï¼E_OBJï¼ï¼»NGKI3009ï¼½
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»isratrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2998ï¼½
+ãï¼TARGET_ISRATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+	â» TAGET_ISRATRã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§è¿½å ããå²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³å±æ§
+ã»intnoãCRE_ISRã«å¯¾ããå²è¾¼ã¿çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3003ï¼½
+	â» intnoã«å¯¾å¿ããinhnoããªãå ´åãå«ã
+ã»(TMIN_ISRPRI <= isrpri && isrpri <= TMAX_ISRPRI)ã§ãªãå ´åï¼E_PARï¼
+ãï¼»NGKI3005ï¼½
+ã»intnoã«å¯¾ããCFG_INTããªãå ´åï¼E_OBJï¼ï¼»NGKI3012ï¼½
+ã»intnoã«å¯¾å¿ããinhnoã«å¯¾ãã¦DEF_INHãããå ´åï¼E_OBJï¼ï¼»NGKI3013ï¼½
+ã»intnoã«å¯¾ãã¦CFG_INTã§è¨­å®ãããå²è¾¼ã¿åªå
+åº¦ãTMIN_INTPRIãããå°ãã
+ãå ´åï¼E_OBJï¼ï¼»NGKI3014ï¼½
+	â» ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã¯ãµãã¼ãããªããã
+
+ï¼å¯è½ã§ããã°ã¿ã¼ã²ããä¾å­é¨ã§æ¤åºãããã®ï¼»NGKI3020ï¼½
+ã»isrããã­ã°ã©ã ã®éå§çªå°ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3004ï¼½
+
+4.7.2 å²è¾¼ã¿ãã³ãã©ã«é¢ããå®ç¾©
+
+å²è¾¼ã¿ãã³ãã©ã«é¢ãã¦çæããæ
+å ±ã¯ï¼ã¿ã¼ã²ããæ¯ã«å®ãããã¨ãã§ããï¼
+ã¿ã¼ã²ããæ¯ã«å®ããªãå ´åã«ã¯ï¼ä»¥ä¸ã§è¿°ã¹ãã¿ã¼ã²ããã«ä¾å­ããªãæ¨æº
+çãªæ
+å ±ãçæããï¼
+
+å²è¾¼ã¿ãã³ãã©ãå®ç¾©ããéçAPIãDEF_INHãã§å®ç¾©ããå²è¾¼ã¿ãã³ãã©ï¼ä¸
+è¿°ã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®è¿½å ã«ããã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãçæããå²è¾¼
+ã¿ãã³ãã©ãå«ãï¼ã«é¢ããå®ç¾©ãçæããï¼å
+·ä½çã«ã¯æ¬¡ã®éãï¼
+
+ä»¥ä¸ã§ã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®éçAPIãå«ã¾ã
+ã¦ããæã«çæãã¹ãæ
+å ±ã«ã¤ãã¦è¿°ã¹ãï¼
+
+	DEF_INH(inhno, { inhatr, inthdr });
+
+4.7.2.1 å®ç¾©ããå²è¾¼ã¿ãã³ãã©ã®æ°
+
+å®ç¾©ããå²è¾¼ã¿ãã³ãã©ã®æ°ããã¯ã­å®ç¾©ããããªãã­ã»ããµãã£ã¬ã¯ãã£ã
+ï¼#defineï¼ãçæããï¼ã¾ãï¼ãã®å¤ãæã¤å¤æ°ã®å®ç¾©ãçæããï¼å
+·ä½ç
+ã«ã¯ï¼æ¬¡ã®ãããªè¡ãçæããï¼
+
+#define TNUM_DEF_INHNO <å®ç¾©ããå²è¾¼ã¿ãã³ãã©ã®æ°>
+const uint_t	_kernel_tnum_def_inhno = TNUM_DEF_INHNO;
+
+4.7.2.2 å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦ç
+
+å®ç¾©ããå²è¾¼ã¿ãã³ãã©æ¯ã«ï¼å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦çã«ã¼ãã³ãçæã
+ãï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®ãããªè¡ãçæããï¼
+
+INTHDR_ENTRY(inhno, inhno_num, inthdr)
+
+ããã§inhno_numã¯ï¼inhnoï¼å²è¾¼ã¿ãã³ãã©çªå·ï¼ãæ°å¤ã§è¡¨ç¾ãããã®ã§ï¼
+ã¢ã»ã³ããªè¨èªè¨è¿°ã«ä½¿ç¨ããããã®ãã®ã§ããï¼
+
+4.7.2.3 å²è¾¼ã¿ãã³ãã©åæåãã­ãã¯ã®å®ç¾©
+
+å²è¾¼ã¿ãã³ãã©åæåãã­ãã¯ãçæããï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®ãããªè¡ãçæ
+ããï¼
+
+const INHINIB _kernel_inhinib_table[TNUM_DEF_INHNO] = {
+	<å²è¾¼ã¿ãã³ãã©1ã®åæåæ
+å ±>,
+	<å²è¾¼ã¿ãã³ãã©2ã®åæåæ
+å ±>,
+				â¦â¦
+	<å²è¾¼ã¿ãã³ãã©TNUM_DEF_INHNOã®åæåæ
+å ±>
+};
+
+ãã®ä¸­ã®å²è¾¼ã¿ãã³ãã©ã®åæåæ
+å ±ã¯ï¼æ¬¡ã®å½¢å¼ã¨ããï¼
+
+	{ (inhno), (inhatr), (FP)(INT_ENTRY(inhno, inthdr)) }
+
+4.7.2.4 ã¨ã©ã¼æ¡ä»¶
+
+å²è¾¼ã¿ãã³ãã©ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»inhnoãå²è¾¼ã¿ãã³ãã©çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3055ï¼½
+ã»inhnoãDEF_INHã«ãã£ã¦è¨­å®æ¸ã¿ã®å ´åï¼E_OBJï¼ï¼»NGKI3063ï¼½
+ã»inhatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3052ï¼½
+ãï¼TARGET_INHATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+	â» TAGET_INHATRã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§è¿½å ããå²è¾¼ã¿ãã³ãã©å±æ§
+ã»ã«ã¼ãã«ç®¡çå¤ã«åºå®ããã¦ããinhnoã«å¯¾ãã¦ï¼inhatrã«TA_NONKERNELãæ
+ãå®ããã¦ããªãå ´åï¼E_RSATRï¼ï¼»NGKI3067ï¼½
+ã»ã«ã¼ãã«ç®¡çã«åºå®ããã¦ããinhnoã«å¯¾ãã¦ï¼inhatrã«TA_NONKERNELãæå®
+ãããã¦ããå ´åï¼E_RSATRï¼ï¼»NGKI3068ï¼½
+ã»inhnoã«å¯¾å¿ããintnoã«å¯¾ããCFG_INTããªãå ´åï¼E_OBJï¼ï¼»NGKI3062ï¼½
+	â» inhnoã«å¯¾å¿ããintnoããªãå ´åã«ã¯ï¼ãã®ãã§ãã¯ãè¡ããªã
+#ã»inhnoã«å¯¾å¿ããintnoã«å¯¾ãã¦CRE_ISRãããå ´åï¼E_OBJï¼ï¼»NGKI3063ï¼½
+#	â» inhnoã«å¯¾å¿ããintnoããªãå ´åã«ã¯ï¼ãã®ãã§ãã¯ãè¡ããªã
+#	â ãã®ãã§ãã¯ã¯ï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³å´ã§è¡ã
+ã»inhatrã«TA_NONKERNELãæå®ããã¦ãããï¼inhnoã«å¯¾å¿ããintnoã«å¯¾ãã¦
+ãCFG_INTã§è¨­å®ãããå²è¾¼ã¿åªå
+åº¦ãTMIN_INTPRIãããå°ããå ´åï¼E_OBJï¼
+ãï¼»NGKI3065ï¼½
+	â» inhnoã«å¯¾å¿ããintnoããªãå ´åã«ã¯ï¼ãã®ãã§ãã¯ãè¡ããªã
+ã»inhatrã«TA_NONKERNELãæå®ããã¦ããï¼inhnoã«å¯¾å¿ããintnoã«å¯¾ãã¦
+ãCFG_INTã§è¨­å®ãããå²è¾¼ã¿åªå
+åº¦ãTMIN_INTPRIä»¥ä¸ã§ããå ´åï¼E_OBJï¼
+ãï¼»NGKI3066ï¼½
+	â» inhnoã«å¯¾å¿ããintnoããªãå ´åã«ã¯ï¼ãã®ãã§ãã¯ãè¡ããªã
+
+ï¼å¯è½ã§ããã°ã¿ã¼ã²ããä¾å­é¨ã§æ¤åºãããã®ï¼»NGKI3080ï¼½
+ã»inthdrããã­ã°ã©ã ã®éå§çªå°ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3056ï¼½
+
+4.7.3 å²è¾¼ã¿è¦æ±ã©ã¤ã³ã«é¢ããå®ç¾©
+
+å²è¾¼ã¿è¦æ±ã©ã¤ã³ã«é¢ãã¦çæããæ
+å ±ã¯ï¼ã¿ã¼ã²ããæ¯ã«å®ãããã¨ãã§ã
+ãï¼ã¿ã¼ã²ããæ¯ã«å®ããªãå ´åã«ã¯ï¼ä»¥ä¸ã§è¿°ã¹ãã¿ã¼ã²ããã«ä¾å­ããªã
+æ¨æºçãªæ
+å ±ãçæããï¼
+
+å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ãè¨­å®ããéçAPIãCFG_INTãã§è¨­å®ããå²è¾¼ã¿è¦æ±
+ã©ã¤ã³ã«é¢ããå®ç¾©ãçæããï¼å
+·ä½çã«ã¯æ¬¡ã®éãï¼
+
+ä»¥ä¸ã§ã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®éçAPIãå«ã¾ã
+ã¦ããæã«çæãã¹ãæ
+å ±ã«ã¤ãã¦è¿°ã¹ãï¼
+
+	CFG_INT(INTNO intno, { intatr, intpri });
+
+4.7.3.1 è¨­å®ããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã®æ°
+
+è¨­å®ããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã®æ°ããã¯ã­å®ç¾©ããããªãã­ã»ããµãã£ã¬ã¯ãã£
+ãï¼#defineï¼ãçæããï¼ã¾ãï¼ãã®å¤ãæã¤å¤æ°ã®å®ç¾©ãçæããï¼å
+·ä½ç
+ã«ã¯ï¼æ¬¡ã®ãããªè¡ãçæããï¼
+
+#define TNUM_CFG_INTNO <è¨­å®ããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã®æ°>
+const uint_t	_kernel_tnum_cfg_intno = TNUM_CFG_INTNO;
+
+4.7.3.2 å²è¾¼ã¿è¦æ±ã©ã¤ã³åæåãã­ãã¯ã®å®ç¾©
+
+å²è¾¼ã¿è¦æ±ã©ã¤ã³åæåãã­ãã¯ãçæããï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®ãããªè¡ãç
+æããï¼
+
+const INTINIB _kernel_intinib_table[TNUM_CFG_INTNO] = {
+	<å²è¾¼ã¿è¦æ±ã©ã¤ã³1ã®åæåæ
+å ±>,
+	<å²è¾¼ã¿è¦æ±ã©ã¤ã³2ã®åæåæ
+å ±>,
+				â¦â¦
+	<å²è¾¼ã¿è¦æ±ã©ã¤ã³TNUM_CFG_INTNOã®åæåæ
+å ±>
+};
+
+ãã®ä¸­ã®å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®åæåæ
+å ±ã¯ï¼æ¬¡ã®å½¢å¼ã¨ããï¼
+
+	{ (intno), (intatr), (intpri) }
+
+4.7.3.3 ã¨ã©ã¼æ¡ä»¶
+
+å²è¾¼ã¿è¦æ±ã©ã¤ã³ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»intnoãå²è¾¼ã¿çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI2972ï¼½
+ã»intnoãCFG_INTã«ãã£ã¦è¨­å®æ¸ã¿ã®å ´åï¼E_OBJï¼ï¼»NGKI2976ï¼½
+ã»intatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI2969ï¼½
+ãï¼TA_ENAINTï¼TA_EDGEï¼TARGET_INTATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+	â» TAGET_INTATRã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§è¿½å ããå²è¾¼ã¿è¦æ±ã©ã¤ã³å±æ§
+ã»intpriãCFG_INTã«å¯¾ããå²è¾¼ã¿åªå
+åº¦ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI2973ï¼½
+ã»ã«ã¼ãã«ç®¡çå¤ã«åºå®ããã¦ããintnoã«å¯¾ãã¦ï¼intpriã«TMIN_INTPRIãã
+ããå°ããå¤ãæå®ãããªãã£ãå ´åï¼E_OBJï¼ï¼»NGKI2983ï¼½
+ã»ã«ã¼ãã«ç®¡çã«åºå®ããã¦ããintnoã«å¯¾ãã¦ï¼intpriã«TMIN_INTPRIããã
+ãå°ããå¤ãæå®ãããå ´åï¼E_OBJï¼ï¼»NGKI2984ï¼½
+
+ï¼å¿
+è¦ã«å¿ãã¦ã¿ã¼ã²ããä¾å­é¨ã§æ¤åºãããã®ï¼»NGKI2986ï¼½
+ã»intatrãå²è¾¼ã¿å±æ§ã¨ãã¦è¨­å®ã§ããªãå¤ã®å ´åï¼E_RSATRï¼ï¼»NGKI2985ï¼½
+ã»intpriãå²è¾¼ã¿åªå
+åº¦ã¨ãã¦è¨­å®ã§ããªãå¤ã®å ´åï¼E_PARï¼ï¼»NGKI2985ï¼½
+ã»åä¸ã®å²è¾¼ã¿åªå
+åº¦ããè¨­å®ã§ããªãå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦ï¼ç°ãªãå²
+ãè¾¼ã¿åªå
+åº¦ãè¨­å®ããå ´åï¼E_PARï¼ï¼»NGKI2985ï¼½
+
+4.8 CPUä¾å¤ã«é¢ããå®ç¾©
+
+CPUä¾å¤ã«é¢ãã¦çæããæ
+å ±ã¯ï¼ã¿ã¼ã²ããæ¯ã«å®ãããã¨ãã§ããï¼ã¿ã¼ã²ã
+ãæ¯ã«å®ããªãå ´åã«ã¯ï¼ä»¥ä¸ã§è¿°ã¹ãã¿ã¼ã²ããã«ä¾å­ããªãæ¨æºçãªæ
+å ±
+ãçæããï¼
+
+ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ä¸­ã«ï¼CPUä¾å¤ãã³ãã©ãå®ç¾©ãã
+éçAPIãDEF_EXCããå«ã¾ãã¦ããå ´åã«ï¼CPUä¾å¤ãã³ãã©ã«é¢ããå®ç¾©ã
+çæããï¼
+
+ä»¥ä¸ã§ã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®éçAPIãå«ã¾ã
+ã¦ããæã«çæãã¹ãæ
+å ±ã«ã¤ãã¦è¿°ã¹ãï¼
+
+	DEF_EXC(excno, { excatr, exchdr });
+
+4.8.1 å®ç¾©ããCPUä¾å¤ãã³ãã©ã®æ°
+
+å®ç¾©ããCPUä¾å¤ãã³ãã©ã®æ°ããã¯ã­å®ç¾©ããããªãã­ã»ããµãã£ã¬ã¯ãã£ã
+ï¼#defineï¼ãçæããï¼ã¾ãï¼ãã®å¤ãæã¤å¤æ°ã®å®ç¾©ãçæããï¼å
+·ä½çã«
+ã¯ï¼æ¬¡ã®ãããªè¡ãçæããï¼
+
+#define TNUM_DEF_EXCNO <å®ç¾©ããCPUä¾å¤ãã³ãã©ã®æ°>
+const uint_t	_kernel_tnum_def_excno = TNUM_DEF_EXCNO;
+
+4.8.2 CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦ç
+
+å®ç¾©ããCPUä¾å¤ãã³ãã©æ¯ã«ï¼CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦çã«ã¼ãã³ãçæ
+ããï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®ãããªè¡ãçæããï¼
+
+EXCHDR_ENTRY(excno, excno_num, exchdr)
+
+ããã§excno_numã¯ï¼excnoï¼CPUä¾å¤ãã³ãã©çªå·ï¼ãæ°å¤ã§è¡¨ç¾ãããã®ã§ï¼
+ã¢ã»ã³ããªè¨èªè¨è¿°ã«ä½¿ç¨ããããã®ãã®ã§ããï¼
+
+4.8.3 CPUä¾å¤ãã³ãã©åæåãã­ãã¯ã®å®ç¾©
+
+CPUä¾å¤ãã³ãã©åæåãã­ãã¯ãçæããï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®ãããªè¡ãçæ
+ããï¼
+
+const EXCINIB _kernel_excinib_table[TNUM_DEF_EXCNO] = {
+	<CPUä¾å¤ãã³ãã©1ã®åæåæ
+å ±>,
+	<CPUä¾å¤ãã³ãã©2ã®åæåæ
+å ±>,
+				â¦â¦
+	<CPUä¾å¤ãã³ãã©TNUM_DEF_EXCNOã®åæåæ
+å ±>
+};
+
+ãã®ä¸­ã®CPUä¾å¤ãã³ãã©ã®åæåæ
+å ±ã¯ï¼æ¬¡ã®å½¢å¼ã¨ããï¼
+
+	{ (excno), (excatr), (FP)(EXC_ENTRY(excno, exchdr)) }
+
+4.8.4 ã¨ã©ã¼æ¡ä»¶
+
+CPUä¾å¤ãã³ãã©ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»excnoãCPUä¾å¤ãã³ãã©çªå·ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3134ï¼½
+ã»excnoãDEF_EXCã«ãã£ã¦è¨­å®æ¸ã¿ã®å ´åï¼E_OBJï¼ï¼»NGKI3141ï¼½
+ã»excatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3131ï¼½
+ãï¼TARGET_EXCATRä»¥å¤ã®ããããã»ããããã¦ããå ´åï¼
+	â» TAGET_EXCATRã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§è¿½å ããCPUä¾å¤ãã³ãã©å±æ§
+
+ï¼å¯è½ã§ããã°ã¿ã¼ã²ããä¾å­é¨ã§æ¤åºãããã®ï¼»NGKI3149ï¼½
+ã»exchdrããã­ã°ã©ã ã®éå§çªå°ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3135ï¼½
+
+4.9 éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã«é¢ããå®ç¾©
+
+éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã«é¢ããå®ç¾©ã¯ï¼å¿
+ãçæããªããã°
+ãªããªãï¼
+
+4.9.1 DEF_ICSããªãå ´å
+
+ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«ï¼éçAPIãDEF_ICSããå«ã¾ãã¦
+ããªãå ´åã«ã¯ï¼æ¬¡ã®è¡ãçæããï¼
+
+#ifdef DEFAULT_ISTK
+
+#define TOPPERS_ISTKSZ		DEFAULT_ISTKSZ
+#define TOPPERS_ISTK		DEFAULT_ISTK
+
+#else /* DEFAULT_ISTK */
+
+static STK_T				_kernel_istack[COUNT_STK_T(DEFAULT_ISTKSZ)];
+#define TOPPERS_ISTKSZ		ROUND_STK_T(DEFAULT_ISTKSZ)
+#define TOPPERS_ISTK		_kernel_istack
+
+#endif /* DEFAULT_ISTK */
+
+4.9.2 DEF_ICSãããå ´å
+
+ä»¥ä¸ã§ã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®éçAPIãå«ã¾ãã¦
+ããæã«çæãã¹ãæ
+å ±ã«ã¤ãã¦è¿°ã¹ãï¼
+
+	DEF_ICS({ istksz, istk });
+
+istkãNULLã®å ´åã«ã¯ï¼æå®ããããµã¤ãºã®éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ã
+ã¯é åãç¢ºä¿ãï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã®åæåæ
+å ±ãçæ
+ããï¼å
+·ä½çã«ã¯ï¼ä¸è¨ã®éçAPIã«å¯¾ãã¦ï¼æ¬¡ã®è¡ãçæããï¼
+
+static STK_T				_kernel_istack[COUNT_STK_T(istksz)];
+#define TOPPERS_ISTKSZ		ROUND_STK_T(istksz)
+#define TOPPERS_ISTK		_kernel_istack
+
+istkãNULLã§ãªãå ´åã«ã¯ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã®åæå
+æ
+å ±ãï¼æ¬¡ã®å½¢å¼ã§çæããï¼
+
+#define TOPPERS_ISTKSZ		(istksz)
+#define TOPPERS_ISTK		(istk)
+
+4.9.3 å¤æ°ã®çæ
+
+DEF_ICSã®æç¡ã«ãããï¼æ¬¡ã®å®ç¾©ãçæããï¼
+
+const SIZE		_kernel_istksz = TOPPERS_ISTKSZ;
+STK_T *const	_kernel_istk = TOPPERS_ISTK;
+
+#ifdef TOPPERS_ISTKPT
+STK_T *const	_kernel_istkpt = TOPPERS_ISTKPT(TOPPERS_ISTK, TOPPERS_ISTKSZ);
+#endif /* TOPPERS_ISTKPT */
+
+4.9.4 ã¨ã©ã¼æ¡ä»¶
+
+éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»éçAPIãDEF_ICSããè¤æ°ããï¼E_OBJï¼ï¼»NGKI3216ï¼½
+ã»istkszã0ä»¥ä¸ãï¼ã¿ã¼ã²ããå®ç¾©ã®æå°å¤ï¼TARGET_MIN_ISTKSZï¼ãããå°
+ãããå ´åï¼E_PARï¼ï¼»NGKI3254ï¼½
+ã»istkszãã¹ã¿ãã¯é åã®ãµã¤ãºã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3222ï¼½
+	- ã¿ã¼ã²ããä¾å­ã®å¤ï¼CHECK_STKSZ_ALIGNï¼ã®åæ°ã§ãªãå ´å
+	â» ãã®ã¨ã©ã¼ãã§ãã¯ã¯ï¼istkãNULLã§ãªãå ´åã«ã®ã¿è¡ã
+
+ï¼ãã¹3ã§æ¤åºãããã®
+ã»istkãã¹ã¿ãã¯é åã®å
+é ­çªå°ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3222ï¼½
+	- ã¿ã¼ã²ããä¾å­ã®å¤ï¼CHECK_STACK_ALIGNï¼ã®åæ°ã§ãªãå ´å
+	- NULLã®å ´åï¼ã¿ã¼ã²ããä¾å­ï¼CHECK_STACK_NONNULLï¼
+
+4.10 ã¿ã¤ã ã¤ãã³ãç®¡çã«é¢ããå®ç¾©
+
+ã¿ã¤ã ã¤ãã³ãç®¡çã«é¢é£ãã¦ï¼æ¬¡ã®å®ç¾©ãçæããï¼
+
+TMEVTN	_kernel_tmevt_heap[TNUM_TSKID + TNUM_CYCID + TNUM_ALMID];
+
+4.11 åã¢ã¸ã¥ã¼ã«ã®åæåé¢æ°ã®å®ç¾©
+
+åã«ã¼ãã«ãªãã¸ã§ã¯ãã®ç®¡çï¼å²è¾¼ã¿ç®¡çï¼CPUä¾å¤ãã³ãã©ç®¡çã®åæ©è½ã
+åæåé¢æ°ãé ã«å¼ã³åºãé¢æ°ï¼_kernel_initialize_objectï¼ãçæããï¼æ¬¡
+ã®3ã¤ã®åæåé¢æ°ãé¤ãã¦ã¯ï¼ä½¿ç¨ããªãæ©è½ã®åæåé¢æ°ã¯å¼ã³åºããªãï¼
+
+	_kernel_initialize_task
+	_kernel_initialize_interrupt
+	_kernel_initialize_exception
+
+ãã¹ã¦ã®æ©è½ãä½¿ã£ãå ´åã«çæãããé¢æ°ã¯æ¬¡ã®éãã§ããï¼
+
+void
+_kernel_initialize_object(void)
+{
+	_kernel_initialize_task();
+	_kernel_initialize_semaphore();
+	_kernel_initialize_eventflag();
+	_kernel_initialize_dataqueue();
+	_kernel_initialize_pridataq();
+	_kernel_initialize_mutex();
+	_kernel_initialize_mempfix();
+	_kernel_initialize_cyclic();
+	_kernel_initialize_alarm();
+	_kernel_initialize_interrupt();
+	_kernel_initialize_exception();
+}
+
+4.12 åæåã«ã¼ãã³ã®å®è¡é¢æ°ã®å®ç¾©
+
+ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ä¸­ã«å«ã¾ããåæåã«ã¼ãã³ãè¿½å 
+ããéçAPIãATT_INIãã«å¯¾ãã¦ï¼è¿½å ããåæåã«ã¼ãã³ãé ã«å¼ã³åºãé¢
+æ°ãçæããï¼å
+·ä½çã«ã¯ï¼
+
+	ATT_INI({ iniatr, exinf, inirtn });
+
+ã¨ããéçAPIã«å¯¾ãã¦ï¼
+
+	((INIRTN)(inirtn))((intptr_t)(exinf));
+
+ãå¼ã³åºãé¢æ°ãï¼_kernel_call_inirtnã¨ããååã§çæããï¼åæåã«ã¼ã
+ã³ãå¼ã³åºãé åºã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ä¸­ã§ã®éç
+APIã®é åºã«ä¸è´ãããï¼
+
+ä¾ãã°ï¼
+
+	ATT_INI({ TA_NULL, 0, timer_initialize });
+	ATT_INI({ TA_NULL, CONSOLE_PORTID, serial_initialize });
+
+ã¨ãã2ã¤ã®éçAPIããã®é åºã§è¨è¿°ãããæã«çæããé¢æ°ã¯æ¬¡ã®éãã§ã
+ãï¼
+
+void
+_kernel_call_inirtn(void)
+{
+	((INIRTN)(timer_initialize))((intptr_t)(0));
+	((INIRTN)(serial_initialize))((intptr_t)(CONSOLE_PORTID));
+}
+
+4.12.1 ã¨ã©ã¼æ¡ä»¶
+
+åæåã«ã¼ãã³ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»iniatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3241ï¼½
+ãï¼TA_NULLã§ãªãå ´åï¼
+
+ï¼å¯è½ã§ããã°ã¿ã¼ã²ããä¾å­é¨ã§æ¤åºãããã®ï¼»NGKI3246ï¼½
+ã»inirtnããã­ã°ã©ã ã®éå§çªå°ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3243ï¼½
+
+4.13 çµäºå¦çã«ã¼ãã³ã®å®è¡é¢æ°ã®å®ç¾©
+
+ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ä¸­ã«å«ã¾ããçµäºå¦çã«ã¼ãã³ãè¿½
+å ããéçAPIãATT_TERãã«å¯¾ãã¦ï¼è¿½å ããçµäºå¦çã«ã¼ãã³ãé ã«å¼ã³åº
+ãé¢æ°ãçæããï¼å
+·ä½çã«ã¯ï¼
+
+	ATT_TER({ teratr, exinf, terrtn });
+
+ã¨ããéçAPIã«å¯¾ãã¦ï¼
+
+	((TERRTN)(terrtn))((intptr_t)(exinf));
+
+ãå¼ã³åºãé¢æ°ãï¼_kernel_call_terrtnã¨ããååã§çæããï¼çµäºå¦çã«ã¼
+ãã³ãå¼ã³åºãé åºã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ä¸­ã§ã®éç
+APIã®éé ã«ä¸è´ãããï¼
+
+ä¾ãã°ï¼
+
+	ATT_TER({ TA_NULL, 0, timer_terminate });
+	ATT_TER({ TA_NULL, CONSOLE_PORTID, serial_terminate });
+
+ã¨ãã2ã¤ã®éçAPIããã®é åºã§è¨è¿°ãããæã«çæããé¢æ°ã¯æ¬¡ã®éãã§ã
+ãï¼
+
+void
+_kernel_call_terrtn(void)
+{
+	((TERRTN)(serial_terminate))((intptr_t)(CONSOLE_PORTID));
+	((TERRTN)(timer_terminate))((intptr_t)(0));
+}
+
+4.13.1 ã¨ã©ã¼æ¡ä»¶
+
+çµäºå¦çã«ã¼ãã³ã«é¢ããã¨ã©ã¼æ¡ä»¶ã¯æ¬¡ã®éãã§ããï¼
+
+ï¼ãã¹2ã§æ¤åºãããã®
+ã»teratrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3248ï¼½
+ãï¼TA_NULLã§ãªãå ´åï¼
+
+ï¼å¯è½ã§ããã°ã¿ã¼ã²ããä¾å­é¨ã§æ¤åºãããã®ï¼»NGKI3253ï¼½
+ã»terrtnããã­ã°ã©ã ã®éå§çªå°ã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3250ï¼½
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/doc/design.txt
===================================================================
--- asp3_wo_tecs/trunk/doc/design.txt	(revision 302)
+++ asp3_wo_tecs/trunk/doc/design.txt	(revision 302)
@@ -0,0 +1,1385 @@
+
+		TOPPERS/ASP3ã«ã¼ãã«
+		è¨­è¨ã¡ã¢
+
+		å¯¾å¿ãã¼ã¸ã§ã³: Release 3.B.0
+		æçµæ´æ°: 2016å¹´1æ3æ¥
+
+ãã®ãã­ã¥ã¡ã³ãã¯ï¼TOPPERS/ASP3ã«ã¼ãã«ã®è¨­è¨ã¡ã¢ã§ããï¼ä½æéä¸­ã®ã
+ã®ã§ããï¼ç¶²ç¾
+çã§ã¯ãªãï¼
+
+----------------------------------------------------------------------
+ TOPPERS/ASP Kernel
+     Toyohashi Open Platform for Embedded Real-Time Systems/
+     Advanced Standard Profile Kernel
+
+ 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: design.txt 480 2016-01-03 07:37:12Z ertl-hiro $
+----------------------------------------------------------------------
+
+âç®æ¬¡
+
+ã»TOPPERS/ASP3ã«ã¼ãã«ã®å®è£
+è¨­è¨æ¹é
+ã»ã·ã¹ãã ç¶æ
+ã¨ã³ã³ãã­ã¹ãã®å®è£
+
+	- ã«ã¼ãã«åä½ç¶æ
+ã¨éåä½ç¶æ
+
+	- ã¿ã¹ã¯ã³ã³ãã­ã¹ãã¨éã¿ã¹ã¯ã³ã³ãã­ã¹ã
+	- å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨å
+¨å²è¾¼ã¿ã­ãã¯è§£é¤ç¶æ
+
+	- CPUã­ãã¯ç¶æ
+ã¨CPUã­ãã¯è§£é¤ç¶æ
+
+	- å²è¾¼ã¿åªå
+åº¦ãã¹ã¯
+	- ãã£ã¹ãããç¦æ­¢ç¶æ
+ã¨ãã£ã¹ãããè¨±å¯ç¶æ
+
+	- ãã£ã¹ãããä¿çç¶æ
+
+ã»ã¿ã¹ã¯ç¶æ
+ã®ç®¡çã¨ã¹ã±ã¸ã¥ã¼ãªã³ã°
+	- ã¿ã¹ã¯ç¶æ
+ã®ç®¡ç
+	- ã¿ã¹ã¯ã¹ã±ã¸ã¥ã¼ã©
+ã»ã¿ã¹ã¯ãã£ã¹ãããå¦çã®å®è£
+
+	- ã¿ã¹ã¯ãã£ã¹ãããå¦çã®å¿
+è¦ãªã¿ã¤ãã³ã°
+	- ã¿ã¹ã¯ãã£ã¹ãããã£ã®æ§é 
+	- ã¿ã¹ã¯ã®çµäºæã®ã¿ã¹ã¯ãã£ã¹ããã
+	- ãã£ã¹ãããã£æ¬ä½ã¨ã¢ã¤ãã«å¦ç
+ã»xsns_dpnã®å®è£
+
+	- ã«ã¼ãã«ç®¡çå¤ã®ç¶æ
+ã«é¢ããèå¯
+	- xsns_dpnã®å®è£
+
+ã»ã¨ã©ã¼ã®ãã§ãã¯é åº
+	- ã¨ã©ã¼ã®3åé¡
+	- éçã¨ã©ã¼ã®ãã§ãã¯é åº
+	- æºéçã¨ã©ã¼ã®ãã§ãã¯é åº
+ã»CHECKãã¯ã­ã¨gotoæã®ä½¿ç¨
+	- CHECKãã¯ã­ã®å®ç¾©ã¨ãã®ä½¿ç¨æ³
+	- è¨­è¨æå³
+	- CHECKãã¯ã­ãä½¿ç¨ãã¦ããæ¡ä»¶
+	- åé¡ãçãããã¨ããªãæ ¹æ 
+ã»ã«ã¼ãã«ã®ãã¼ã¿æ§é ã«å¯¾ããvolatileå®£è¨ã«ã¤ãã¦
+ã»åã­ã£ã¹ãã«ä¼´ãè­¦åã¡ãã»ã¼ã¸
+ã»kernel_cfg.hã¸ã®ä¾å­é¢ä¿ã®æ±ã
+
+
+âTOPPERS/ASP3ã«ã¼ãã«ã®å®è£
+è¨­è¨æ¹é
+
+TOPPERS/ASP3ã«ã¼ãã«ï¼ä»¥ä¸ï¼ASP3ã«ã¼ãã«ï¼ã¯ï¼TOPPERSç¬¬3ä¸ä»£ã«ã¼ãã«
+ï¼ITRONç³»ï¼ã®åºç¤ã¨ãªããªã¢ã«ã¿ã¤ã ã«ã¼ãã«ã§ããï¼TOPPERSç¬¬3ä¸ä»£ã«ã¼ã
+ã«ä»æ§ï¼ITRONç³»ï¼ã®è¨­è¨æ¹éã¨ï¼ASP3ã«ã¼ãã«ã®é©ç¨å¯¾è±¡é åã¨è¨­è¨æ¹éã«ã¤
+ãã¦ã¯ï¼TOPPERSç¬¬3ä¸ä»£ã«ã¼ãã«ï¼ITRONç³»ï¼çµ±åä»æ§æ¸ã«è¿°ã¹ããã¦ããï¼
+
+ä»¥ä¸ã§ã¯ï¼ASP3ã«ã¼ãã«ã®å®è£
+è¨­è¨æ¹éã«ã¤ãã¦è¿°ã¹ããï¼ä»æ§è¨­è¨æ¹éã¨ã
+é¢é£ãã¦ããï¼æç¢ºã«åé¢ã§ããªãé¨åãããï¼
+
+TOPPERS/ASP3ã«ã¼ãã«ã®å®è£
+è¨­è¨ãè¡ãã«ãããï¼æ¬¡ã®æ¹éãè¨­å®ããï¼
+
+(1) ã½ã¼ã¹ã³ã¼ãã®èª­ã¿ãããã»æ¹é ãããããéè¦ãããASPR0001ã
+
+ã½ã¼ã¹ã³ã¼ããèª­ã¿ããããã¨ã¯ï¼ãªã¼ãã³ã½ã¼ã¹ã½ããã¦ã§ã¢ã®åè³ªãåä¸
+ãããä¸ã§æãéè¦ãªç¹æ§ã§ããï¼ã½ã¼ã¹ã³ã¼ããçè§£ãã¦ããæè¡è
+ãå¢ã
+ããã¨ã§ï¼åé¡ãæ©æã«çºè¦ãããã¨ãã§ãï¼ãµãã¼ãä½å¶ãå
+
+å®ããããã¨
+ãã§ããï¼ã¾ãï¼ã½ã¼ã¹ã³ã¼ããèª­ã¿ããããã¨ã¯ï¼ã·ã³ãã«ãªè¨­è¨ãããã¦
+ãããã¨ãæå³ãã¦ããï¼ä¿¡é ¼æ§åä¸ã«ãã¤ãªããï¼ããã«ï¼æè¡è
+æè²ã®ã
+ãã®ææã¨ããè¦³ç¹ãããï¼ã½ã¼ã¹ã³ã¼ããèª­ã¿ããããã¨ã¯éè¦ã¨ãªãï¼
+
+æ¹é ãããããã¨ã¯ï¼ã·ã¹ãã æ¯ã®è¦æ±ã«ãããããã¥ã¼ãã³ã°ãè¡ãããã
+ãã¨ãæå³ãã¦ããï¼ããåããåã®éçºãæ¯æ´ããæ§è³ªã§ããï¼ã¾ãï¼ASP3
+ã«ã¼ãã«ãåºç¤ã¨ãã¦ä¸é£ã®TOPPERSç¬¬3ä¸ä»£ã«ã¼ãã«ï¼ITRONç³»ï¼ãéçºãã¦ã
+ãä¸ã§ãï¼æ¹é ãããããã¨ã¯å¿
+é ã®æ¡ä»¶ã§ããï¼
+
+(2) æ°ããã¿ã¼ã²ããã·ã¹ãã ã¸ã®ãã¼ãã£ã³ã°ãå®¹æãªæ§é ã¨ãã
+
+çµè¾¼ã¿ã·ã¹ãã ã«ã¯å¤æ§ãªãã¼ãã¦ã§ã¢ãç¨ããããããï¼ãããã«å®¹æã«ãã¼
+ãã£ã³ã°ã§ãããã¨ã¯éè¦ãªæ§è³ªã§ããï¼ãã®ããã«ï¼å®è¡æ§è½ã«é
+æ
+®ãã¤ã¤
+ãã¼ãã¦ã§ã¢ãæ½è±¡åãï¼ã¿ã¼ã²ããã·ã¹ãã ã«ä¾å­ããé¨åï¼ã¿ã¼ã²ããä¾
+å­é¨ï¼ã¨ä¾å­ããªãé¨åï¼ã¿ã¼ã²ããéä¾å­é¨ï¼ãæç¢ºã«åé¢ãããASPR0002ãï¼
+ã¾ãï¼éçºç°å¢ï¼ã³ã³ãã¤ã©ãªã©ï¼ã«ä¾å­ããé¨åãæç¢ºã«åé¢ãããASPR0003ãï¼
+
+(3) æ¤è¨¼ãå®¹æãªæ§é ã¨ãã
+
+ä¿¡é ¼æ§ãç¢ºä¿ããããã«ï¼æ¤è¨¼ãå®¹æãªæ§é ã¨ããï¼
+
+å
+·ä½çã«ã¯ï¼ãµã¼ãã¹ã³ã¼ã«ã®ã»ã¨ãã©å
+¨ä½ãå²è¾¼ã¿ç¦æ­¢ã§å®è¡ãããã¨ã¨ãï¼
+ãµã¼ãã¹ã³ã¼ã«ã®å¦çéä¸­ã§å²è¾¼ã¿ãè¨±å¯ããªããASPR0004ãï¼ãã®æ§é ã¯ï¼
+èª­ã¿ãããæ¹é ããããã½ã¼ã¹ã³ã¼ãã«ããããã«ãæå¹ã§ããï¼ããã«ãã
+å²è¾¼ã¿å¿ç­æ§ãç ç²ã«ãªããï¼ããã«ãã£ã¦åé¡ãçããã¢ããªã±ã¼ã·ã§ã³ã¯
+å°æ°ã§ããï¼ãããããªããã®ã¨èããï¼
+
+ã¾ãï¼æ¡ä»¶ã³ã³ãã¤ã«ç­ã«ããã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã§ããç®æãå¢ããã¨ï¼
+ç´°ããªæé©åãã§ããä¸æ¹ã§ï¼æ¤è¨¼ãã¹ãçµåããå¢ãããã¨ããï¼ã³ã³ãã£
+ã®ã¥ã¬ã¼ã·ã§ã³ã§ããç®æã¯å¿
+è¦æä½éã¨ãããASPR0005ãï¼
+
+(4) å®è¡æ§è½ã¨ã¡ã¢ãªä½¿ç¨éã«é
+æ
+®ãã
+
+ä¸è¨ã®æ¹éãæºãããä¸ã§ï¼é«ãå®è¡æ§è½ã¨å°ããã¡ã¢ãªä½¿ç¨éãéæã§ãã
+ãããªå®è£
+ãè¡ããASPR0006ãï¼å®è¡æ§è½ãåä¸ãããéã«ã¯ï¼å¹³åæ§è½ã®å
+ä¸ãããï¼ææªææ§è½ã®åä¸ãéè¦ããï¼
+
+ã½ã¼ã¹ã³ã¼ãã®èª­ã¿ããããéè¦ããã¨è¨ã£ã¦ãï¼å®è¡æ§è½ã®æªãã¢ã«ã´ãªãº
+ã ãå®æã«æ¡ç¨ãããã¨ã¯ããï¼é«ãå®è¡æ§è½ãéæã§ããã¢ã«ã´ãªãºã ãç¨
+ãããASPR0007ãï¼ãã ãï¼æ°ããã¿ã¼ã²ããã·ã¹ãã ã¸ã®ãã¼ãã£ã³ã°ãå®¹
+æã«ããããã«å¤§é¨åãCè¨èªã§å®è£
+ãã¦ããï¼ãã¹ã¦ãã¢ã»ã³ããªè¨èªã§è¨è¿°
+ããå ´åã«æ¯ã¹ã¦å®è¡æ§è½ãè½ã¡ãã®ã¯ãããããªãï¼
+
+ã¡ã¢ãªä½¿ç¨éã«ã¤ãã¦ã¯ï¼RAMã®ä½¿ç¨éãåæ¸ãããã¨ã«éç¹ãç½®ããè¨­è¨ãè¡
+ããï¼ä¸è¨ã®æ¹éããã³å®è¡æ§è½ã¨ã®ãã¬ã¼ããªããèæ
+®ãï¼ããããã¾ã§ã®
+åæ¸ã¯è¡ããªããASPR0008ãï¼
+
+(5) ã¹ã±ã¼ã©ããªãã£ã«é
+æ
+®ãã
+
+æ§ã
+ãªè¦æ¨¡ã®ã·ã¹ãã ã«é©ç¨ã§ããã¹ã±ã¼ã©ããªãã£ããã£ãæ§é ã¨ããï¼ç¹
+ã«ï¼å°è¦æ¨¡ãªã·ã¹ãã ã«é©ç¨ããéã«ï¼ä½¿ç¨ããªãæ©è½ãã«ã¼ãã«ãæã£ã¦ã
+ããã¨ã«ããã¡ã¢ãªä½¿ç¨éã®å¢å ãæå°éã«ãªãããã«é
+æ
+®ããï¼
+
+å
+·ä½çã«ã¯ï¼ã¢ããªã±ã¼ã·ã§ã³ã¨ã«ã¼ãã«ã1ã¤ã®ã­ã¼ãã¢ã¸ã¥ã¼ã«ã«ãªã³ã¯ã
+ãæ¹æ³ï¼1ãªã³ã¯ã¢ãã«ï¼ãæ³å®ãï¼ã«ã¼ãã«ãé¢æ°åä½ã§ã©ã¤ãã©ãªåãã¦ï¼
+ä½¿ç¨ããé¢æ°ã®ã¿ããªã³ã¯ã§ããæ§é ã¨ãããASPR0009ãï¼ããã¯ä¸ç¨®ã®ã³ã³
+ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã§ãããï¼ãã®æ¹æ³ã¯ï¼æ¡ä»¶ã³ã³ãã¤ã«ã«ããã³ã³ãã£ã®ã¥
+ã¬ã¼ã·ã§ã³ã¨ã¯éãï¼æ¤è¨¼å·¥æ°ã«ä¸ããå½±é¿ãå°ããï¼
+
+ã¾ãï¼åºå®çã«ä½¿ç¨ããRAMé åãæ¸ããï¼ã¹ã¿ãã¯ã«ç½®ããæ
+å ±ã¯ã§ããéã
+ã¹ã¿ãã¯ä¸ã«ç½®ããASPR0010ãï¼
+
+(6) ã¿ã¤ã ãã£ãã¯ãç¨ããªãæéç®¡çï¼ãã£ãã¯ã¬ã¹ã«ã¼ãã«ï¼
+
+æ¶è²»ã¨ãã«ã®ã¼åæ¸ã®ããï¼ä¸å¿
+è¦ãªã¿ã¤ãã³ã°ã§ãã­ã»ããµãåä½ãããªã
+ãã¨ãæ±ããããï¼å
+·ä½çã«ã¯ï¼å¦çãã¹ãã¿ã¤ã ã¤ãã³ãããªãæã«ï¼ã¿ã¤
+ãå²è¾¼ã¿ãããããªããããªå®è£
+ã¨ãããASPR0011ãï¼
+
+
+âã·ã¹ãã ç¶æ
+ã¨ã³ã³ãã­ã¹ãã®å®è£
+
+
+ãã®ç« ã§ã¯ï¼ãTOPPERSç¬¬3ä¸ä»£ã«ã¼ãã«ï¼ITRONç³»ï¼çµ±åä»æ§æ¸ãã®ã2.5 ã·ã¹
+ãã ç¶æ
+ã¨ã³ã³ãã­ã¹ããã®ç¯ã«è¦å®ããã¦ããã·ã¹ãã ç¶æ
+ã¨ã³ã³ãã­ã¹ã
+ã®å®è£
+æ¹æ³ã«ã¤ãã¦è¨è¿°ããï¼
+
+âã«ã¼ãã«åä½ç¶æ
+ã¨éåä½ç¶æ
+ï¼»NGKI0143ï¼½
+
+ã«ã¼ãã«ã®åä½ç¶æ
+ãç®¡çããããã«ï¼ã«ã¼ãã«åä½ç¶æ
+ãã©ã°ï¼kerflgï¼ã
+ç¨æããï¼kerflgã¯ï¼ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã§falseï¼ï¼0ï¼ã«åæåããï¼
+ã¾ãï¼ã«ã¼ãã«åä½ã®éå§æã«trueã«ãï¼ã«ã¼ãã«åä½ã®çµäºæã«falseã«ããï¼
+
+----------------------------------------
+bool_t	kerflg = false;
+----------------------------------------
+
+kerflgã¯ï¼sns_kerã§åç
+§ããï¼ã«ã¼ãã«éåä½ç¶æ
+ã§sns_kerä»¥å¤ã®ãµã¼ãã¹
+ã³ã¼ã«ãå¼ã³åºããå ´åã®åä½ã¯ä¿è¨¼ããå¿
+è¦ããªãããï¼ä»ã®ãµã¼ãã¹ã³ã¼
+ã«ã§ã¯kerflgãåç
+§ããªãï¼»NGKI0146ï¼½ï¼
+
+âã¿ã¹ã¯ã³ã³ãã­ã¹ãã¨éã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼»NGKI0148ï¼½
+
+ã¿ã¹ã¯ã³ã³ãã­ã¹ãã¨éã¿ã¹ã¯ã³ã³ãã­ã¹ãã®åæãã¯ï¼ã¿ã¼ã²ãããã¼ãã¦ã§
+ã¢ããã³ã¿ã¼ã²ããä¾å­é¨ã«å§ã­ãï¼ã¾ãï¼ã©ã¡ãã®ã³ã³ãã­ã¹ãã§å®è¡ä¸­ã§
+ããããå¤å¥ããé¢æ°ï¼sense_contextï¼ãï¼ã¿ã¼ã²ããä¾å­é¨ã§ç¨æãããã¨
+ã¨ããï¼
+
+âå
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨å
+¨å²è¾¼ã¿ã­ãã¯è§£é¤ç¶æ
+
+
+å
+¨å²è¾¼ã¿ã­ãã¯ãã©ã°ã®ç®¡çã¯ã¿ã¼ã²ããä¾å­é¨ã«å§ã­ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+
+ã«é·ç§»ããããã¯ã­ï¼SIL_LOC_INTï¼ã¨ï¼å
+ã®ç¶æ
+ã«æ»ããã¯ã­ï¼SIL_UNL_INTï¼
+ã¯ï¼SILã®ã¿ã¼ã²ããä¾å­é¨ã§ç¨æãããã¨ã¨ããï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§ãã
+ãå¦ããå¤å¥ããæ©è½ã¯ï¼å¿
+è¦ããªãããã«ç¨æãã¦ããªãï¼
+
+å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§sns_kerã¨ext_kerä»¥å¤ã®ãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºããå ´
+åã®åä½ã¯ä¿è¨¼ããå¿
+è¦ããªãããï¼ãµã¼ãã¹ã³ã¼ã«ä¸­ã§å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+
+ã§ãããã¨ãå¤å¥ããå¿
+è¦ã¯ãªãï¼
+
+âCPUã­ãã¯ç¶æ
+ã¨CPUã­ãã¯è§£é¤ç¶æ
+
+
+CPUã­ãã¯ãã©ã°ã®ç®¡çã¯ã¿ã¼ã²ããä¾å­é¨ã«å§ã­ï¼CPUã­ãã¯ç¶æ
+ã«é·ç§»ãã
+ãé¢æ°ï¼lock_cpuï¼ã¨ï¼CPUã­ãã¯è§£é¤ç¶æ
+ã«é·ç§»ãããé¢æ°ï¼unlock_cpuï¼ã¯ï¼
+ã¿ã¼ã²ããä¾å­é¨ã§ç¨æãããã¨ã¨ããï¼ã¾ãï¼CPUã­ãã¯ç¶æ
+ã§ãããå¦ãã
+å¤å¥ããé¢æ°ï¼sense_lockï¼ãï¼ã¿ã¼ã²ããä¾å­é¨ã§ç¨æãããã¨ã¨ããï¼
+
+âå²è¾¼ã¿åªå
+åº¦ãã¹ã¯
+
+å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®ç®¡çã¯ã¿ã¼ã²ããä¾å­é¨ã«å§ã­ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã
+ãå²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãè¨­å®ããé¢æ°ï¼t_set_ipmï¼ã¨ï¼ãããåç
+§ããé¢æ°
+ï¼t_get_ipmï¼ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ç¨æãããã¨ã¨ããï¼
+
+âãã£ã¹ãããç¦æ­¢ç¶æ
+ã¨ãã£ã¹ãããè¨±å¯ç¶æ
+ï¼»NGKI0177ï¼½
+
+ãã£ã¹ãããç¦æ­¢ãã©ã°ãç®¡çããããã«ï¼ãããåè»¢ãããã©ã°ï¼ensdspï¼
+ãç¨æããï¼enadspã¯ï¼ã«ã¼ãã«ã®åæåæã«trueã«åæåããï¼
+
+----------------------------------------
+bool_t	enadsp;
+----------------------------------------
+
+âãã£ã¹ãããä¿çç¶æ
+
+
+ãã£ã¹ãããä¿çç¶æ
+ã¯ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãã®å®è¡ä¸­ï¼CPUã­ãã¯ç¶æ
+ï¼å²
+è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤ã§ãªãç¶æ
+ï¼ãã£ã¹ãããç¦æ­¢ç¶æ
+ã®ããããï¼ã¾
+ãã¯ï¼ããããéãªã£ãç¶æ
+ï¼ã§ããï¼
+
+ãã£ã¹ãããä¿çç¶æ
+ã§ãªããã¨ï¼ã¤ã¾ãï¼ãã£ã¹ãããã§ããç¶æ
+ã§ããã
+ã¨ï¼ãå¹ççã«å¤å¥ããããã«ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§ããï¼ãã£
+ã¹ãããè¨±å¯ç¶æ
+ã§ããï¼ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§ãªãï¼ãã¨ãç¤ºããã©ã°
+ï¼dspflgï¼ãç¨æããï¼ããªãã¡ï¼å¸¸ã«ä»¥ä¸ã®é¢ä¿ãæãç«ã¤ããã«ããï¼
+
+	dspflg == ((t_get_ipm() == TIPM_ENAALL) && enadsp)
+
+dspflgã¯ï¼ã«ã¼ãã«ã®åæåæã«trueã«åæåããï¼ã¾ãï¼ã¿ã¹ã¯ã³ã³ãã­ã¹
+ãã«ããã¦å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®å¤ãå¤æ´ããããï¼å²è¾¼ã¿ç¦æ­¢ãã©ã°ãå¤æ´
+ãããåº¦ã«æ´æ°ããï¼
+
+----------------------------------------
+bool_t	dspflg;
+----------------------------------------
+
+
+âã¿ã¹ã¯ç¶æ
+ã®ç®¡çã¨ã¹ã±ã¸ã¥ã¼ãªã³ã°
+	
+âã¿ã¹ã¯ç¶æ
+ã®ç®¡ç
+
+ã¿ã¹ã¯ç®¡çãã­ãã¯ï¼TCBï¼ä¸­ã®ã¿ã¹ã¯ç¶æ
+ãç®¡çãããã£ã¼ã«ãï¼tstatï¼ã§
+ã¯ï¼ã¿ã¹ã¯ç¶æ
+ãæ¬¡ã®ãããã§ããããç®¡çããï¼
+
+ãã»å®è¡ã§ããç¶æ
+
+ãã»ä¼æ­¢ç¶æ
+
+ãã»ï¼ç­ç¾©ã®ï¼å¾
+ã¡ç¶æ
+
+ãã»å¼·å¶å¾
+ã¡ç¶æ
+
+ãã»äºéå¾
+ã¡ç¶æ
+
+
+ã¾ãï¼ã¿ã¹ã¯ãï¼ç­ç¾©ã®ï¼å¾
+ã¡ç¶æ
+ã¨äºéå¾
+ã¡ç¶æ
+ã®æã«ã¯ï¼åããã£ã¼ã«ã
+ã§å¾
+ã¡è¦å ãç®¡çããï¼
+
+ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã®æã«ï¼å®è¡ç¶æ
+ã§ãããå®è¡å¯è½ç¶æ
+ã§ãããã¯ï¼
+ãã®ãã£ã¼ã«ãã§ã¯ç®¡çããï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ã®TCBãæããã¤ã³ã¿å¤æ°
+ï¼p_runtskï¼ã«ãã£ã¦å¤å¥ããï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ããªãå ´åã¯ï¼p_runtskã¯
+NULLã«ããï¼
+
+----------------------------------------
+TCB	*p_runtsk;
+----------------------------------------
+
+p_runtskã¯ï¼ã«ã¼ãã«ã®åæåæã«NULLã«åæåãï¼ãã£ã¹ãããã£ã«ããã¦
+æ´æ°ããï¼ãµã¼ãã¹ã³ã¼ã«ã®å¦çã®ä¸­ã§èªã¿ã¹ã¯ã«é¢ããæ
+å ±ãåç
+§ããå ´å
+ã¯ï¼p_runtskãç¨ããï¼
+
+âã¿ã¹ã¯ã¹ã±ã¸ã¥ã¼ã©
+
+ã¿ã¹ã¯ã¹ã±ã¸ã¥ã¼ã©ã¯ï¼å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ã®ä¸­ããï¼å®è¡ãã¹ãã¿ã¹ã¯
+ãæ±ºå®ãï¼ãã®ã¿ã¹ã¯ã®TCBãæããã¤ã³ã¿å¤æ°ï¼p_schedtskï¼ãè¨­å®ããï¼å®
+è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ããªãå ´åã¯ï¼p_schedtskã¯NULLã«ããï¼
+
+----------------------------------------
+TCB	*p_schedtsk;
+----------------------------------------
+
+p_runtskã¯ï¼éå¸¸ã¯p_schedtskã¨ä¸è´ãã¦ãããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãå®è¡
+ä¸­ã¯ï¼ä¸è´ãã¦ããã¨ã¯éããªãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªãç¶æ
+ã®é
+ã¨ãã£ã¹ãããç¦æ­¢ç¶æ
+ã®éï¼ããªãã¡ï¼dspflgãtrueã§ããéï¼ã¯ï¼
+p_schedtskãæ´æ°ããªãï¼
+
+ã¿ã¹ã¯ã¹ã±ã¸ã¥ã¼ã©ã«å¯¾ãã¦ã¯ï¼ã©ã®ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ããããç¥ã
+ããå¿
+è¦ãããï¼ãã®ããï¼ã¿ã¹ã¯ã¹ã±ã¸ã¥ã¼ã©ã¯ï¼æ¬¡ã®2ã¤ã®é¢æ°ãç¨æããï¼
+
+ãã»ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã«é·ç§»ãããã¨ãç¥ãããé¢æ°ï¼make_runnableï¼
+ãã»ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ããä»ã®ç¶æ
+ã¸é·ç§»ãããã¨ãç¥ãããé¢æ°
+	ï¼make_non_runnableï¼
+
+ã¾ãï¼å¦çã®å¹çåã®ããã«ï¼ä¸ã®2ã¤ã®é¢æ°ãç¨ããã«ã¬ãã£ã­ã¥ã¼ãç´æ¥æ
+ä½ãã¦ã¿ã¹ã¯ã¹ã±ã¸ã¥ã¼ã«ãè¡ãé¢æ°ã¨ãã¦ï¼æ¬¡ã®2ã¤ã®é¢æ°ãç¨æããï¼
+
+ãã»ã¿ã¹ã¯ã®åªå
+åº¦ã®å¤æ´ï¼change_priorityï¼
+ãã»ã¬ãã£ã­ã¥ã¼ã®åè»¢ï¼rotate_ready_queueï¼
+
+
+âã¿ã¹ã¯ãã£ã¹ãããå¦çã®å®è£
+
+
+âã¿ã¹ã¯ãã£ã¹ãããå¦çã®å¿
+è¦ãªã¿ã¤ãã³ã°
+
+ã¿ã¹ã¯ãã£ã¹ãããã¯ï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ï¼p_runtskï¼ã¨æé«åªå
+é ä½ã®ã¿ã¹
+ã¯ï¼p_schedtskï¼ãä¸è´ãã¦ãããï¼ãã£ã¹ãããä¿çç¶æ
+ã§ãªãå ´åã«è¡ãï¼
+ãã®ãã¨ããï¼ã¿ã¹ã¯ãã£ã¹ãããå¦çãè¡ãå¿
+è¦ãããã®ã¯ï¼æ¬¡ã®3ã¤ã®å ´å
+ã§ããï¼
+
+(1) å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ãªããªã
+
+èªã¿ã¹ã¯ãåºç¾©ã®å¾
+ã¡ç¶æ
+ã«é·ç§»ããããµã¼ãã¹ã³ã¼ã«ãï¼èªã¿ã¹ã¯ãçµäºã
+ãããµã¼ãã¹ã³ã¼ã«ã«ããã¦ï¼ã¿ã¹ã¯ãã£ã¹ãããå¦çãè¡ãå¿
+è¦ãããï¼
+
+(2) æé«åªå
+é ä½ã®ã¿ã¹ã¯ãå¤åãã
+
+ã¿ã¹ã¯ã®èµ·åï¼ã¿ã¹ã¯ã®å¾
+ã¡è§£é¤ï¼ã¿ã¹ã¯ã®å¼·å¶å¾
+ã¡ããã®åéï¼ã¿ã¹ã¯ã®åª
+å
+åº¦ã®å¤æ´ï¼ã¿ã¹ã¯ã®åªå
+é ä½ã®åè»¢ãè¡ããµã¼ãã¹ã³ã¼ã«ã«ããã¦ï¼æé«åª
+å
+é ä½ã®ã¿ã¹ã¯ãå¤åãï¼ãã£ã¹ãããä¿çç¶æ
+ã§ãªãå ´åã«ã¯ï¼ã¿ã¹ã¯ãã£
+ã¹ãããå¦çãè¡ãå¿
+è¦ãããï¼
+
+(3) ãã£ã¹ãããä¿çç¶æ
+ãè§£é¤ããã
+
+ãã£ã¹ãããä¿çç¶æ
+ã¨ã¯ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãã®å®è¡ä¸­ï¼CPUã­ãã¯ç¶æ
+ï¼
+å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤ã§ãªãç¶æ
+ï¼ãã£ã¹ãããç¦æ­¢ç¶æ
+ã®ç·ç§°ã§ãã
+ããï¼ãããã®ç¶æ
+ã®ãããããé·ç§»ããã¿ã¤ãã³ã°ã§ï¼ã¿ã¹ã¯ãã£ã¹ããã
+å¦çãè¡ãå¿
+è¦ãããï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®ã¿ã¤ãã³ã°ãè©²å½ããï¼
+
+(3-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã¿ã¹ã¯ã³ã³ãã­ã¹ãã«é·ç§»ãã
+
+å²è¾¼ã¿ãã³ãã©ã¾ãã¯CPUä¾å¤ãã³ãã©ããã¿ã¹ã¯ã«ãªã¿ã¼ã³ããéã«ï¼ã¿ã¹ã¯
+ãã£ã¹ãããå¦çãè¡ãå¿
+è¦ãããï¼
+
+(3-2) CPUã­ãã¯ç¶æ
+ãè§£é¤ããã
+
+CPUã­ãã¯ç¶æ
+ã«ããã¦ã¯ï¼ä¸è¨ã®(1)ã(2)ã®ç¶æ³ãä½ãåºããµã¼ãã¹ã³ã¼ã«ã
+å¼ã³åºããã¨ãã§ããªãï¼ãã®ããï¼CPUã­ãã¯ç¶æ
+ã®è§£é¤æã«ã¯ï¼ã¿ã¹ã¯ãã£
+ã¹ãããå¦çãè¡ãå¿
+è¦ããªãï¼
+
+(3-3) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤ããã
+
+å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®å¤æ´ï¼chg_ipmï¼ã«ããå²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤ãã
+ãå ´åã«ï¼ã¿ã¹ã¯ãã£ã¹ãããå¦çãè¡ãå¿
+è¦ãããï¼
+
+ã¾ãï¼ã¿ã¹ã¯ã®çµäºï¼å²è¾¼ã¿ãã³ãã©ããã®ãªã¿ã¼ã³ï¼CPUä¾å¤ãã³ãã©ããã®
+ãªã¿ã¼ã³ã«ãã£ã¦ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤ãããå ´åãããï¼ãã®å ´å
+ã«ã¯ï¼ã¿ã¹ã¯ãã£ã¹ãããå¦çãè¡ãå¿
+è¦ãããï¼
+
+(3-4) ãã£ã¹ãããè¨±å¯ç¶æ
+ã«ãªã
+
+ãã£ã¹ãããã®è¨±å¯ï¼ena_dspï¼ã«ããã¦ï¼ã¿ã¹ã¯ãã£ã¹ãããå¦çãè¡ãå¿
+è¦
+ãããï¼
+
+ã¾ãï¼ã¿ã¹ã¯ã®çµäºã«ãã£ã¦ï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã«ãªãå ´åãããï¼ãã®
+å ´åã«ã¯ï¼ã¿ã¹ã¯ãã£ã¹ãããå¦çãè¡ãå¿
+è¦ãããï¼
+
+ä»¥ä¸ã«å ãã¦ï¼ã«ã¼ãã«ã®åä½éå§æã«ãï¼ã¿ã¹ã¯ãã£ã¹ãããå¦çãå¼ã³åº
+ãï¼
+
+âã¿ã¹ã¯ãã£ã¹ãããã£ã®æ§é 
+
+ã¿ã¹ã¯ãã£ã¹ãããã£ã®ä¸»ãªæ©è½ã¯ï¼åæãåã®ã¿ã¹ã¯ã®ã³ã³ãã­ã¹ãï¼ãã­
+ã»ããµã®æ±ç¨ã¬ã¸ã¹ã¿ç­ï¼ãã¡ã¢ãªä¸ã«ä¿å­ãï¼åæãå¾ã®ã¿ã¹ã¯ã®ã³ã³ãã­
+ã¹ããã¡ã¢ãªä¸ããå¾©å¸°ãããã¨ã§ããï¼ããã§ï¼ä¿å­ï¼å¾©å¸°ããªããã°ãªã
+ãªãã¬ã¸ã¹ã¿ã¯ï¼ã¿ã¹ã¯ãã£ã¹ãããã£ãå®è¡ãããç¶æ³ã«ãã£ã¦ï¼æ¬¡ã®ãã
+ãªéããããï¼
+
+ã»ã¿ã¹ã¯ãå²è¾¼ã¿ï¼ã¾ãã¯ï¼CPUä¾å¤ï¼ã«ããããªã¨ã³ãããããå ´åã«ã¯ï¼ã
+ãã¹ã¦ã®ã¬ã¸ã¹ã¿ãä¿å­ããªããã°ãªããªãï¼ã¾ãï¼ãã®ç¶æ
+ããå®è¡åéã
+ããå ´åã«ã¯ï¼ãã¹ã¦ã®ã¬ã¸ã¹ã¿ãå¾©å¸°ããªããã°ãªããªãï¼
+
+ã»ã¿ã¹ã¯ãèªçºçã«ã¿ã¹ã¯ãã£ã¹ãããã£ãå¼ã³åºãå ´åã«ã¯ï¼ã¹ã¯ã©ããã¬
+ãã¸ã¹ã¿ï¼caller saved registerï¼ä»¥å¤ã®ã¬ã¸ã¹ã¿ãä¿å­ããã°ããï¼ã¾ãï¼
+ããã®ç¶æ
+ããå®è¡åéããå ´åã«ã¯ï¼ã¹ã¯ã©ããã¬ã¸ã¹ã¿ä»¥å¤ã®ã¬ã¸ã¹ã¿ã
+ãå¾©å¸°ããã°ããï¼
+
+ã»ã¿ã¹ã¯ãçµäºããå ´åã«ã¯ï¼ã©ã®ã¬ã¸ã¹ã¿ãä¿å­ããå¿
+è¦ããªãï¼
+
+ã»ã¿ã¹ã¯ãå®è¡éå§ããå ´åã«ã¯ï¼ã©ã®ã¬ã¸ã¹ã¿ãå¾©å¸°ããå¿
+è¦ããªãï¼
+
+ããã§ï¼ããããã®ç¶æ³ã§å¿
+è¦æä½éã®ã¬ã¸ã¹ã¿ã®ã¿ãä¿å­ï¼å¾©å¸°ããããã«ï¼
+ã¿ã¹ã¯ãã£ã¹ãããå¦çãï¼(a) ã³ã³ãã­ã¹ãã®ä¿å­å¦çï¼(b) å®è¡ããã¿ã¹
+ã¯ã®é¸æå¦çï¼(c) ã³ã³ãã­ã¹ãã®å¾©å¸°å¦çã®3ã¤ã®ã¹ãããã§æ§æãï¼(a)ã¨
+(c)ã®ã¹ãããã«ã¤ãã¦ã¯ï¼ã¿ã¹ã¯ãã£ã¹ãããã£ãå®è¡ãããç¶æ³æ¯ã«ç¨æã
+ãï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®åå¦çãè¡ãã«ã¼ãã³ãç¨æããï¼
+
+(a) ã³ã³ãã­ã¹ãã®ä¿å­å¦ç
+	(a-1) ã¿ã¹ã¯ãèªçºçã«å¼ã³åºããå ´åã®ä¿å­å¦çï¼dispatchï¼
+	(a-2) å²è¾¼ã¿ãã³ãã©ã®åºå£ã§å¼ã³åºãããå ´åã®ä¿å­å¦çï¼ret_intï¼
+	(a-3) CPUä¾å¤ãã³ãã©ã®åºå£ã§å¼ã³åºãããå ´åã®ä¿å­å¦çï¼ret_excï¼
+	(a-4) ã¿ã¹ã¯ã®çµäºæã®å¦çï¼exit_and_dispatchï¼
+	(a-5) ã«ã¼ãã«ã®åä½éå§æã®å¦çï¼start_dispatchï¼
+(b) å®è¡ããã¿ã¹ã¯ã®é¸æï¼ãã£ã¹ãããã£æ¬ä½ï¼dispatcherï¼
+(c) ã³ã³ãã­ã¹ãã®å¾©å¸°å¦ç
+	(c-1) ã¿ã¹ã¯ãèªçºçã«å¼ã³åºããå ´åã®å¾©å¸°å¦çï¼dispatch_rï¼
+	(c-2) å²è¾¼ã¿ãã³ãã©ã®åºå£ã§å¼ã³åºãããå ´åã®å¾©å¸°å¦çï¼ret_int_rï¼
+	(c-3) CPUä¾å¤ãã³ãã©ã®åºå£ã§å¼ã³åºãããå ´åã®å¾©å¸°å¦çï¼ret_exc_rï¼
+	(c-4) ã¿ã¹ã¯ã®å®è¡éå§æã®å¦çï¼start_rï¼
+
+âã¿ã¹ã¯ã®çµäºæã®ã¿ã¹ã¯ãã£ã¹ããã
+
+ext_tskã«ããã¿ã¹ã¯ã®çµäºæã«ï¼èµ·åè¦æ±ãã­ã¥ã¼ã¤ã³ã°ããã¦ããã¨ï¼åã
+ã¿ã¹ã¯ãããã«èµ·åãããå ´åãããï¼ãã®å ´åï¼ã¿ã¹ã¯ãã£ã¹ãããã£ã«ã¨ã£
+ã¦ã¯ï¼åãã¿ã¹ã¯ã¸ã®åæãã«è¦ãï¼ã¿ã¹ã¯ãã£ã¹ãããå¦çãã¹ã­ããå¯è½
+ã«æãããï¼å®éã«ã¯ï¼åãã¿ã¹ã¯ã®ç°ãªãã¤ã³ã¹ã¿ã³ã¹ã¸ã®åæãã§ããã
+ãï¼ã¿ã¹ã¯ãã£ã¹ãããå¦çãã¹ã­ãããã¦ã¯ãªããªãï¼
+
+ä¸è¿°ã®ã¿ã¹ã¯ãã£ã¹ãããã£ã®æ§é ã«ããï¼ã¿ã¹ã¯ã®çµäºæã«ã¯ï¼ããå°ç¨ã®
+å¦çï¼exit_and_dispatchï¼ãå¼ã³åºãï¼ãã®å¦çã§ã¯ï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãå
+ç
+§ããï¼ã³ã³ãã­ã¹ãã®ä¿å­ãè¡ããã«ï¼æ¬¡ã«å®è¡ããã¿ã¹ã¯ã®é¸æå¦çãè¡
+ãããï¼ã¿ã¹ã¯ãã£ã¹ãããå¦çãã¹ã­ããããããã¨ã¯ãªãï¼
+
+ena_terããã³chg_ipmã«ããã¿ã¹ã¯ã®çµäºæãï¼ããã¨åæ§ã§ããï¼
+
+ãªãï¼ä»ã¿ã¹ã¯ããã¿ã¹ã¯ãçµäºããããµã¼ãã¹ã³ã¼ã«ï¼ras_terï¼ter_tskï¼
+ã§ã¯ï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãçµäºããããã¨ã¯ã§ããªãããï¼ãã®ãããªç¶æ³ã¯
+èµ·ãããªãï¼
+
+âãã£ã¹ãããã£æ¬ä½ã¨ã¢ã¤ãã«å¦ç
+
+ã¿ã¹ã¯ãã£ã¹ãããã£ã§ã¯ï¼ã³ã³ãã­ã¹ãã®ä¿å­å¦çãè¡ã£ãå¾ï¼ãã£ã¹ãã
+ãã£æ¬ä½ã¸åå²ããï¼
+
+ãã£ã¹ãããã£æ¬ä½ã§ã¯ï¼ã¾ãï¼p_schedtskãp_runtskã«ä»£å
+¥ããï¼p_runtsk
+ãNULLã§ãªãå ´åã¯ï¼p_runtskï¼ãã£ã¹ãããå
+ã®ã¿ã¹ã¯ï¼ã®TCBããã¹ã¿ãã¯
+ãã¤ã³ã¿ãå¾©å¸°ãï¼TCBã«ä¿å­ããã¦ããå®è¡åéçªå°ã«åå²ããï¼åå²å
+ã«ã
+ãã¦ï¼ã³ã³ãã­ã¹ãã®å¾©å¸°å¦çãè¡ãï¼
+
+p_runtskãNULLã«ãªãã®ã¯ï¼å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ããªããªã£ãå ´åã§ããï¼
+å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ããªããªãã®ã¯ï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+
+ã§ãªããªãï¼ä»ã«å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ããªãå ´åã«éãããï¼ãã®å ´åï¼
+ã¹ã±ã¸ã¥ã¼ã©ãp_schedtskãNULLã«è¨­å®ãï¼ã¿ã¹ã¯ãã£ã¹ãããã£ãå®è¡ãã
+ãï¼
+
+å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ããªããªã£ãå ´åã®å¦çãï¼ã¢ã¤ãã«å¦çã¨å¼ã¶ï¼ã¢
+ã¤ãã«å¦çã§ã¯ï¼CPUã­ãã¯ç¶æ
+ãè§£é¤ãã¦ï¼å²è¾¼ã¿ã®çºçãå¾
+ã¤ï¼å²è¾¼ã¿ãçº
+çãï¼ããããã®ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã«ãªã£ãå ´åã«ã¯ï¼å²è¾¼ã¿ãã³ãã©
+ã®åºå£å¦çã§ã¿ã¹ã¯ãã£ã¹ããããè¡ããï¼ãã£ã¹ãããã£æ¬ä½ã«ã¯æ»ããªãï¼
+å²è¾¼ã¿ã«ãã£ã¦ãããã®ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã«ãªããªãã£ãå ´åã«ã¯ï¼ãã£
+ã¹ãããã£æ¬ä½ã«æ»ãï¼ååº¦å²è¾¼ã¿ã®çºçãå¾
+ã¤ï¼
+
+ã¢ã¤ãã«å¦çããã®ããã«å®è£
+ããã¨ï¼å²è¾¼ã¿ãã³ãã©ã®åºå£å¦çï¼ret_intï¼
+ããã¿ã¹ã¯ãã£ã¹ãããã£ãå¼ã³åºãããå ´åã«ï¼p_runtskãNULLã«ãªã£ã¦ã
+ãå¯è½æ§ãããï¼ãã®ããï¼å²è¾¼ã¿ãã³ãã©ã®åºå£ã§å¼ã³åºãããå ´åã®ã³ã³
+ãã­ã¹ãã®ä¿å­å¦çã®éã«ï¼p_runtskãNULLã§ããããã§ãã¯ãï¼NULLã®å ´å
+ã«ã¯ã³ã³ãã­ã¹ãã®ä¿å­ãè¡ããªãããã«ããå¿
+è¦ãããï¼
+
+ã¢ã¤ãã«å¦çã¯ï¼æå¾ã«å®è¡ç¶æ
+ã§ãã£ãã¿ã¹ã¯ã®ã¹ã¿ãã¯é åãç¨ãã¦å®è¡
+ãããï¼ããã§ï¼ä»¥ä¸ã®2ã¤ã®èª²é¡ãçããï¼
+
+1ã¤ãã®èª²é¡ã¯ï¼ã«ã¼ãã«ã®åä½éå§æã«ã¯ï¼ãæå¾ã«å®è¡ç¶æ
+ã§ãã£ãã¿ã¹ã¯ã
+ãå­å¨ããªããã¨ã§ããï¼ã«ã¼ãã«ã®åæåå¦çãï¼ããå°ç¨ã®ã¹ã¿ãã¯é å
+ãç¨ãã¦å®è¡ããã¦ããå ´åã«ã¯ï¼ã¢ã¤ãã«å¦çããã®ã¾ã¾å®è¡ãã¦ãå·®ãæ¯
+ããªããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åãç¨ãã¦å®è¡ããã¦ããå ´
+åã«ã¯ï¼ä»ã®ã¹ã¿ãã¯é åã«åãæããå¿
+è¦ãããï¼ã¢ã¤ãã«å¦çãéã¿ã¹ã¯
+ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã§å®è¡ããã¨ï¼ã¢ã¤ãã«å¦çä¸­ã«åãä»ããå²
+è¾¼ã¿å¦çã§ï¼ã¹ã¿ãã¯ãç ´å£ãããå¯è½æ§ãããï¼ï¼ããã§ï¼ãã®ãããªå ´å
+ã«ã¯ï¼ã«ã¼ãã«ã®åä½éå§æã®å¦çï¼start_dispatchï¼ã«ããã¦ï¼ã¹ã¿ãã¯ãï¼
+IDã1ã®ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åã«åãæãããã¨ã«ããï¼ã«ã¼ãã«ã®åä½éå§ç´
+å¾ã«ã¢ã¤ãã«å¦çãå®è¡ãããæã«ã¯ï¼ãã¹ã¦ã®ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ã«ãªã£ã¦ã
+ãããï¼ã©ã®ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åãä½¿ããã¦ãããï¼ã¢ã¤ãã«å¦çã§ä½¿ç¨ã
+ã¦å·®ãæ¯ããªãï¼ASP3ã«ã¼ãã«ã§ã¯ï¼å°ãªãã¨ã1ã¤ã®ã¿ã¹ã¯ãçæããå¿
+è¦ã
+ãããã¨ããï¼IDã1ã®ã¿ã¹ã¯ã¯å¿
+ãå­å¨ããï¼
+
+ãã1ã¤ã®èª²é¡ã¯ï¼ãæå¾ã«å®è¡ç¶æ
+ã§ãã£ãã¿ã¹ã¯ã®ã¹ã¿ãã¯é åããè§£æ¾ã
+ããå¯è½æ§ã§ããï¼ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åãè§£æ¾ãããã®ã¯ï¼ã¿ã¹ã¯ãåé¤ã
+ããå ´åã§ããããï¼ASP3ã«ã¼ãã«ã§åé¡ã«ãªãã®ã¯ï¼åççææ©è½æ¡å¼µãã
+ã±ã¼ã¸ãç¨ããå ´åã®ã¿ã§ããï¼ASP3ã«ã¼ãã«ã§ã¯ï¼å²è¾¼ã¿ãã³ãã©ããã¿ã¹
+ã¯ãåé¤ãããµã¼ãã¹ã³ã¼ã«ï¼del_tskï¼ãå¼ã³åºããã¨ãã§ããï¼ã¿ã¹ã¯ã®çµ
+äºã¨åæã«ã¿ã¹ã¯ãåé¤ãããµã¼ãã¹ã³ã¼ã«ï¼exd_tskï¼ããµãã¼ããã¦ããªã
+ãã¨ããï¼ã¿ã¹ã¯ãåé¤ããã®ã¯ä»ã®ã¿ã¹ã¯ããã§ããï¼åé¤ãããã¿ã¹ã¯ã
+ãæå¾ã«å®è¡ç¶æ
+ã§ãã£ãã¿ã¹ã¯ãã«ãªã£ã¦ãããã¨ã¯ãªãï¼ä»¥ä¸ããï¼ãæ
+å¾ã«å®è¡ç¶æ
+ã§ãã£ãã¿ã¹ã¯ã®ã¹ã¿ãã¯é åããè§£æ¾ããã¦ããå¯è½æ§ã¯ãªãï¼
+
+ä¸ã®ã¢ã¤ãã«å¦çä¸­ã§å²è¾¼ã¿ã®çºçãå¾
+ã£ã¦ããéã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§
+CPUã­ãã¯è§£é¤ç¶æ
+ã§ããã«ããããããï¼p_runtskãNULLã«ãªã£ã¦ããï¼ãã®
+ç¶æ³ã¯ï¼éå¸¸ã¯ã¢ããªã±ã¼ã·ã§ã³ããè¦³æ¸¬ã§ããªããï¼ããã§ï¼ãã¼ãã¦ã§ã¢
+æ
+éãªã©ã®çç±ã§ï¼CPUä¾å¤ãçºçããã¨ï¼ã¢ããªã±ã¼ã·ã§ã³ããè¦³æ¸¬ããã¦ã
+ã¾ãï¼å
+·ä½çã«ã¯ï¼xsns_dpnãfalseãè¿ãã«ããããããï¼get_tidã
+TSK_NONEãè¿ã£ã¦ãã¾ãï¼ãã®ç¶æ³ãé²ãããã«ï¼p_runtskãNULLã®å ´åã«ã¯ï¼
+xsns_dpnãtrueãè¿ãããã«ããï¼
+
+ãã®ãããªæªç½®ãè¡ãã¨ï¼CPUä¾å¤ãã³ãã©ãè¦åéãã«å®è£
+ããã¦ããã°ï¼
+CPUä¾å¤ãã³ãã©ã®åºå£å¦çã§ã¯p_runtskãNULLã«ãªãç¶æ³ã¯ãªãã¯ãã§ãããï¼
+å®å
+¨ã®ããã«ï¼p_runtskãNULLã®å ´åã«ã¯ã³ã³ãã­ã¹ãã®ä¿å­ãè¡ããªããã
+ã«ããï¼
+
+
+âxsns_dpnã®å®è£
+è¨­è¨
+
+âã«ã¼ãã«ç®¡çå¤ã®ç¶æ
+ã«é¢ããèå¯
+
+ã«ã¼ãã«ç®¡çå¤ã®ç¶æ
+ã¨ã¯ï¼ä»¥ä¸ã®3ç¶æ
+ã®ç·ç§°ã§ããï¼
+
+ã(1) å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+
+ã(2) ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©å®è¡ä¸­
+ã(3) ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ãã³ãã©å®è¡ä¸­
+
+ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ãã³ãã©ã¨ã¯ï¼ä»¥ä¸ã®ããããã§çºçããCPUä¾å¤ã«
+ãã£ã¦èµ·åãããCPUä¾å¤ãã³ãã©ã®ãã¨ãè¨ãï¼
+
+ã(3-1) ã«ã¼ãã«éåä½ç¶æ
+
+ã(3-2) ã«ã¼ãã«å
+ã®ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®å®è¡ä¸­
+ã(3-3) å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+
+ã(3-4) CPUã­ãã¯ç¶æ
+
+ã(3-5) ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©å®è¡ä¸­
+ã(3-6) ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ãã³ãã©å®è¡ä¸­
+
+çµ±åä»æ§æ¸ã«ã¯ï¼ã«ã¼ãã«ç®¡çå¤ã®ç¶æ
+ã§ã¯ï¼å°ãªãã¨ãï¼ã«ã¼ãã«ç®¡çã®å²
+è¾¼ã¿ã¯ãã¹ã¯ããã¦ããï¼»NGKI0545ï¼½ã¨ãã¦ãããï¼ããã¯æ¬¡ã®çç±ã«ããï¼
+
+ã¾ãï¼(1)ã«ã¤ãã¦ã¯ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§ã¯NMIãé¤ããã¹ã¦ã®å²è¾¼ã¿ãã
+ã¹ã¯ãããããï¼»NGKI0160ï¼½ï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ããã¹ã¯ããã¦ããã®ã¯
+æããã§ããï¼
+
+(2)ã«ã¤ãã¦ã¯ï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ã®åªå
+åº¦ãTMIN_INTPRIã¨åããããã
+ããä½ãã®ã«å¯¾ãã¦ï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã®åªå
+åº¦ã¯TMIN_INTPRIãããé«
+ãããï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©å®è¡ä¸­ã¯ï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ã¯
+ãã¹ã¯ããã¦ãããã¨ã«ãªãï¼
+
+(3)ã«ã¤ãã¦ã¯ï¼CPUä¾å¤ãã³ãã©ã®èµ·åã«ãã£ã¦å²è¾¼ã¿ã®ãã¹ã¯ç¶æ
+ã¯å¤åã
+ãªãããï¼CPUä¾å¤ãçºçããæã®ç¶æ
+ã«ã¤ãã¦èå¯ããã°ããï¼
+
+ã«ã¼ãã«éåä½ç¶æ
+(3-1)ã§ã¯ï¼ååã¨ãã¦ï¼NMIãé¤ããã¹ã¦ã®å²è¾¼ã¿ããã¹
+ã¯ãããï¼»NGKI0144ï¼½ããï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ã¯ãã¹ã¯ããã¦ããï¼
+
+ã«ã¼ãã«å
+ã®ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³(3-2)ã¯ï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ã®ãã¹ã¯
+ã«ããå®ç¾ãã¦ãããã¨ããï¼æããã§ããï¼
+
+CPUã­ãã¯ç¶æ
+(3-4)ã§ã¯ï¼ãã¹ã¦ã®ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ããã¹ã¯ããã
+ï¼»NGKI0167ï¼½ãã¨ããï¼æ¡ä»¶ãæºããã¦ããï¼
+
+æ®ã(3-3)(3-5)(3-6)ã«ã¤ãã¦ã¯ï¼ã«ã¼ãã«ç®¡çå¤ã®ç¶æ
+ã§çºçããCPUä¾å¤ã«
+ããèµ·åãããCPUä¾å¤ãã³ãã©ã¯ï¼ã«ã¼ãã«ç®¡çå¤ã®ç¶æ
+ã§ãããã¨ãæå³ã
+ã¦ããï¼å¸°ç´çã«èª¬æãããã¨ãã§ããï¼
+
+ä»¥ä¸ã«ããï¼ã«ã¼ãã«ç®¡çå¤ã®ç¶æ
+ã§ã¯ï¼å°ãªãã¨ãï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿
+ã¯ãã¹ã¯ããã¦ããï¼»NGKI0545ï¼½ãã¨ããããï¼ãã ãï¼(3-1)ã«ã¤ãã¦ã¯ï¼
+ãååã¨ãã¦ãã¨ãããã¬ã¼ãºãããããï¼ãã®ååãå®ãããªãå ´åã¯ä¾å¤
+ã¨ãªãï¼
+
+âxsns_dpnã®å®è£
+
+
+xsns_dpnã¯ï¼å®è¡ä¸­ã®CPUä¾å¤ãã³ãã©ã®èµ·ååå ã¨ãªã£ãCPUä¾å¤ãï¼ä»¥ä¸ã®
+3æ¡ä»¶ãæºããå ´åã«falseï¼ããã§ãªãå ´åã«trueãè¿ãï¼»NGKI3151ï¼½ï¼
+
+ã(a) ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã§ãªã
+ã(b) ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç
+ã(c) CPUä¾å¤ãçºçããæã®ç¶æ
+ããã£ã¹ãããä¿çç¶æ
+ã§ãªã
+
+ããã«ï¼ãã¢ã¤ãã«å¦çãã®ç¯ã§è¿°ã¹ãéãï¼p_runtskãNULLã®å ´åã«ã¯ï¼
+xsns_dpnãtrueãè¿ãããã«ããå¿
+è¦ãããï¼ã¤ã¾ãï¼ä¸ã®3æ¡ä»¶ã«æ¬¡ã®æ¡ä»¶ã
+å ãã4æ¡ä»¶ãæºããå ´åã«falseãè¿ãï¼
+
+ã(d) p_runtskãNULLã§ãªã
+
+ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã¨ã¯ï¼ä»¥ä¸ã®ããããã§çºçããCPUä¾å¤ã®ãã¨ãè¨
+ãï¼
+
+ã(a-1) ã«ã¼ãã«éåä½ç¶æ
+
+ã(a-2) ã«ã¼ãã«å
+ã®ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®å®è¡ä¸­ï¼ã«ã¼ãã«å®è¡ä¸­ï¼
+ã(a-3) å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+
+ã(a-4) CPUã­ãã¯ç¶æ
+
+ã(a-5) ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©å®è¡ä¸­
+ã(a-6) ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ãã³ãã©å®è¡ä¸­
+
+ã¾ãï¼ãã£ã¹ãããä¿çç¶æ
+ã¨ã¯ï¼ä»¥ä¸ã®ããããã®å ´åãè¨ãï¼
+
+ã(c-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãã®å®è¡ä¸­
+ã(c-2) CPUã­ãã¯ç¶æ
+
+ã(c-3) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤ã§ãªãç¶æ
+
+ã(c-4) ãã£ã¹ãããç¦æ­¢ç¶æ
+
+
+xsns_dpnã§ã¯ï¼ãããã®æ¡ä»¶ããã¹ã¦ãã§ãã¯ããå¿
+è¦ãããï¼
+
+ãããã®æ¡ä»¶ã®ä¸­ã§ï¼ã¾ãï¼(b)ã¨(c-1)ï¼(a-4)ã¨(c-2)ã¯éè¤ãã¦ããï¼ã¾ãï¼
+(a-1)ã¯kerflgï¼(c-4)ã¯enadspï¼(d)ã¯p_runtskãåç
+§ãããã¨ã§ï¼ã¿ã¼ã²ãã
+éä¾å­é¨ã§å¤å®ãããã¨ãã§ããï¼æ®ãã®æ¡ä»¶ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ç¨æã
+ãé¢æ°exc_sense_intmaskã«ããå¤å®ããï¼
+
+ããªãã¡ï¼exc_sense_intmaskã¯ï¼CPUä¾å¤ãçºçããæã®ã·ã¹ãã ç¶æ
+ãï¼ä»¥
+ä¸ã®æ¡ä»¶ããã¹ã¦æºããå ´åã«trueï¼ããã§ãªãå ´åã«falseãè¿ããã®ã¨ããï¼
+
+ã(a-2) ã«ã¼ãã«å
+ã®ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®å®è¡ä¸­ã§ãªã
+ã(a-3) å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§ãªã
+ã(a-4) CPUã­ãã¯ç¶æ
+ã§ãªã
+ã(a-5) ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©å®è¡ä¸­ã§ãªã
+ã(a-6) ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ãã³ãã©å®è¡ä¸­ã§ãªã
+ã(b) ã¿ã¹ã¯ã³ã³ãã­ã¹ã
+ã(c-3) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤
+
+ä¸ã§èå¯ããéãï¼(a-2)ã(a-6)ã§ã¯ï¼ï¼å°ãªãã¨ãï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿
+ããã¹ã¯ããã¦ããï¼ããã§ï¼å¤ãã®å ´åï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ããã¹ã¦ã
+ã¹ã¯ããã¦ãããã¨ããã§ãã¯ãããã¨ã§ï¼(a-2)ã(a-6)ã®å¤å®ãä¸æ¬ãã¦è¡
+ããã¨ãã§ããï¼ã¾ãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå®ç¾ãã¦ãããã¼ãã¦ã§ã¢ã¬ã¸
+ã¹ã¿ããã§ãã¯ãããã¨ã§ï¼(a-2)ã(a-6)ã¨(c-3)ã®å¤å®ãä¸æ¬ãã¦è¡ããå ´å
+ãå¤ãï¼
+
+ãªãï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ããã¹ã¦ãã¹ã¯ããã¦ãããã¨ããã§ãã¯ããã
+ã¨ã§ï¼(a-1)ã®æ¡ä»¶ãå¤å®ã§ããããï¼ã¿ã¼ã²ããéä¾å­é¨ã§kerflgããã§ãã¯
+ããå¿
+è¦ã¯ãªããã¨ã«ãªããï¼ã«ã¼ãã«éåä½ç¶æ
+ã§NMIãé¤ããã¹ã¦ã®å²è¾¼ã¿
+ããã¹ã¯ãããã®ã¯ãååã¨ãã¦ãã§ããããï¼kerflgããã§ãã¯ããæ¹ãå®
+å
+¨ã§ããï¼
+
+ã¾ãï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ããã¹ã¦ãã¹ã¯ããã¦ãããã¨ããã§ãã¯ããã¨ï¼
+dis_intã«ããï¼ãã¹ã¦ã®ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãåå¥ã«ãã¹ã¯ããå ´åã«ã
+xsns_dpnãtrueãè¿ãã¦ãã¾ãå¯è½æ§ãããï¼ãã®ããã«ãªããªããã¨ãæã¾
+ãããï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãã¹ã¦ãdis_intã§åå¥ã«ãã¹ã¯ããç¶æ³ã¯ç¨ã§
+ããã¨èããããããï¼ãã®ãããªç¶æ³ã§xsns_dpnãtrueãè¿ããã¨ï¼ã¤ã¾ãï¼
+ãªã«ããªãè¡ããªããã¨ï¼ãï¼ã¿ã¼ã²ããå®ç¾©ã®å¶éã¨ãã¦ãå·®ãæ¯ããªãï¼
+
+
+âã¨ã©ã¼ã®ãã§ãã¯é åº
+
+ãµã¼ãã¹ã³ã¼ã«å
+ã«ãããã¨ã©ã¼ãã§ãã¯ã¯ï¼ä»¥ä¸ã®é åºã§è¡ããã¨ãååã¨
+ããï¼ãªãï¼ãã®ç¯ã«ã¯ï¼ä¿è­·æ©è½å¯¾å¿ã«ã¼ãã«ã«é¢ããè¨è¿°ãå«ã¾ãã¦ãã
+ãï¼ãããã®è¨è¿°ã¯å°æ¥çã«ã¯ããé©åãªãã­ã¥ã¡ã³ãã«ç§»åããäºå®ã§ããï¼
+
+âã¨ã©ã¼ã®3åé¡
+
+ãµã¼ãã¹ã³ã¼ã«ã®ã¨ã©ã¼ã¯ï¼å¤§ããä»¥ä¸ã®3ã¤ã«åé¡ãããã¨ãã§ããï¼
+
+(a) éçã¨ã©ã¼
+
+å¯¾è±¡ã®ã«ã¼ãã«ãªãã¸ã§ã¯ããç»é²ããã¦ãããå¦ããï¼ãã®ç¶æ
+ã«ä¾å­ãã
+ã«ï¼ãã§ãã¯ãããã¨ãã§ããã¨ã©ã¼ï¼
+
+(b) æºéçã¨ã©ã¼
+
+å¯¾è±¡ã®ã«ã¼ãã«ãªãã¸ã§ã¯ããç»é²ããã¦ããã°ï¼ãã®ç¶æ
+ã«ä¾å­ããã«ãã§ã
+ã¯ãããã¨ãã§ããã¨ã©ã¼ï¼
+
+(c) åçã¨ã©ã¼
+
+å¯¾è±¡ã®ã«ã¼ãã«ãªãã¸ã§ã¯ãã®ç¶æ
+ã«ä¾å­ããã¨ã©ã¼ï¼
+
+ASPã«ã¼ãã«ã«ããã¦ã¯ï¼(a)ã¨(b)ã®ã¨ã©ã¼ã¯ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®å¤å´ã§ï¼
+ãã®é åºã§ãã§ãã¯ãï¼(c)ã®ã¨ã©ã¼ã¯ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®å
+å´ã§ãã§ã
+ã¯ããï¼ãã ãï¼åççææ©è½æ¡å¼µããã±ã¼ã¸ã§ã¯ï¼(b)ã®ã¨ã©ã¼ï¼ã®ä¸é¨ï¼ã¯
+ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®å
+å´ã§å®æ½ããå¿
+è¦ãããï¼
+
+âéçã¨ã©ã¼ã®ãã§ãã¯é åº
+
+éçã¨ã©ã¼ã«ã¯ï¼å®è¡ã³ã³ãã­ã¹ãã®ã¨ã©ã¼ï¼ãã£ã¹ãããä¿çç¶æ
+ããã®å¼
+åºãã¨ã©ã¼ãå«ãï¼ï¼ãã©ã¡ã¼ã¿ã®ç¯å²ç­ã®ã¨ã©ã¼ï¼å¯¾è±¡ã®ã«ã¼ãã«ãªãã¸ã§
+ã¯ãã«ä¾å­ããã«ãã§ãã¯ã§ãããã®ï¼ãå«ã¾ããï¼
+
+ãµã¼ãã¹ã³ã¼ã«ä¸­ã§ã¯ï¼æåã«å®è¡ã³ã³ãã­ã¹ãã®ã¨ã©ã¼ããã§ãã¯ãï¼ãã®
+å¾ï¼ãã©ã¡ã¼ã¿ã®ä¸¦ã³é ã«ï¼ç¯å²ç­ã®ã¨ã©ã¼ããã§ãã¯ããï¼
+
+ä¿è­·æ©è½å¯¾å¿ã«ã¼ãã«ã§ã¯ï¼ãã©ã¡ã¼ã¿ããã¤ã³ã¿ã§ããå ´åã«ï¼ãã¤ã³ã¿ã®
+æãã¡ã¢ãªé åãã¢ã¯ã»ã¹å¯è½ã§ãããããã§ãã¯ããå¿
+è¦ããããï¼ã¡ã¢ãª
+é åã®è¨­å®ãéçã§ããå ´åã«ã¯ï¼ãã®ã¨ã©ã¼ãã§ãã¯ãããã§å®æ½ããï¼ã
+ã ãï¼ã¡ã¢ãªé åã®è¨­å®ãéçã§ãªãå ´åã«ã¯ï¼ãã®ã¨ã©ã¼ãã§ãã¯ã¯ã¯ãªãã£
+ã«ã«ã»ã¯ã·ã§ã³ã®å
+å´ã§è¡ãå¿
+è¦ãããï¼
+
+âåéçã¨ã©ã¼ã®ãã§ãã¯é åº
+
+åéçã¨ã©ã¼ã®ãã§ãã¯ã®åã«ï¼å¯¾è±¡ã®ã«ã¼ãã«ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯
+ã®å
+é ­çªå°ãï¼ã­ã¼ã«ã«å¤æ°ã«ä»£å
+¥ããï¼
+
+ä¿è­·æ©è½å¯¾å¿ã«ã¼ãã«ã§ã¯ï¼ãã®æ¬¡ã«ï¼å¯¾è±¡ã®ã«ã¼ãã«ãªãã¸ã§ã¯ããã¢ã¯ã»
+ã¹å¯è½ã§ãããããã§ãã¯ããå¦çãè¡ãï¼å½è©²ãµã¼ãã¹ã³ã¼ã«ã®å¼åºããï¼
+ã·ã¹ãã ç¶æ
+ã«å¯¾ããã¢ã¯ã»ã¹è¨±å¯ãã¯ã¿ã§ä¿è­·ããã¦ããå ´åã«ãï¼ãã®æ®µ
+éã§ãã§ãã¯ãå®æ½ããï¼
+
+ãã®å¾ã§ï¼ãã©ã¡ã¼ã¿ã®ç¯å²ç­ã®ã¨ã©ã¼ã®ä¸­ã§ï¼å¯¾è±¡ã®ã«ã¼ãã«ãªãã¸ã§ã¯ã
+ã®ç»é²æ
+å ±ï¼åæåãã­ãã¯ã«å«ã¾ãã¦ããæ
+å ±ï¼ã«ä¾å­ãã¦ãã§ãã¯ãã¹ã
+ãã®ã®ãã§ãã¯ãï¼ãã©ã¡ã¼ã¿ã®ä¸¦ã³é ã§å®æ½ããï¼
+
+
+âCHECKãã¯ã­ã¨gotoæã®ä½¿ç¨
+
+ASP3ã«ã¼ãã«ã®å®è£
+ã«ããã¦ã¯ï¼ãµã¼ãã¹ã³ã¼ã«ã®éçãªã¨ã©ã¼ããã§ãã¯ãã
+ããã«ï¼åç§°ã"CHECK_"ã§å§ã¾ãä¸é£ã®ãã¯ã­ï¼ããããï¼CHECKãã¯ã­ã¨ç·ç§°
+ããï¼ãç¨ãã¦ããï¼
+
+CHECKãã¯ã­ã®å®ç¾©ä¸­ã«ã¯gotoæãå«ãã§ãããï¼MISRA-Cãªã©ã®ã³ã¼ãã£ã³ã°
+ã«ã¼ã«ã§ã¯gotoæã®ä½¿ç¨ãç¦æ­¢ãã¦ããï¼gotoæãä½¿ãã¹ãã§ã¯ãªãã¨ããæ
+è¦ãå¤ãï¼ã¾ãï¼ãã¯ã­ã®å®ç¾©ä¸­ã«gotoæãä½¿ç¨ãããã¨ãåé¡ã§ããã¨ãã
+æè¦ãããï¼
+
+ããã§ã¯ï¼å®ç¾©ä¸­ã«gotoæãå«ãCHECKãã¯ã­ãç¨ããè¨­è¨æå³ã¨ãããä½¿ç¨ã
+ã¦ããæ¡ä»¶ï¼CHECKãã¯ã­ã®ä½¿ç¨ã«ããã½ããã¦ã§ã¢ã®ä¿¡é ¼æ§ã«åé¡ãçããã
+ã¨ããªããã¨ãè«è¨¼ããï¼
+
+ãªãï¼ASP3ã«ã¼ãã«ã®ã«ã¼ãã«æ¬ä½ã®å®è£
+ã§ã¯ï¼CHECKãã¯ã­ä»¥å¤ã«gotoæãç¨
+ãã¦ããç®æã¯ãªãï¼ä¸é¨ã®ã·ã¹ãã ãµã¼ãã¹ã§ã¯ï¼ããä»¥å¤ã®æ¹æ³ã§gotoæ
+ãç¨ãã¦ããï¼ï¼
+
+âCHECKãã¯ã­ã®å®ç¾©ã¨ãã®ä½¿ç¨æ³
+
+kernel/check.hã«ã¯ï¼25åã®CHECKãã¯ã­ãå®ç¾©ããã¦ãããï¼ããããæ¬¡ã®ã
+ã¿ã¼ã³ã§å®ç¾©ããã¦ããï¼ããã§XXXXXã«ã¯ï¼ãã§ãã¯ãããã¨ã©ã¼ã®ç¨®é¡ãè¡¨
+ãæå­åãå
+¥ãï¼
+
+----------------------------------------
+#define CHECK_XXXXX(<â¦â¦>) {				\
+	if (<ã¨ã©ã¼æ¡ä»¶>) {						\
+		ercd = <ã¨ã©ã¼ã³ã¼ã>;				\
+		goto error_exit;					\
+	}										\
+}
+----------------------------------------
+
+ãããã®CHECKãã¯ã­ã¯ï¼å¤ãã®ãµã¼ãã¹ã³ã¼ã«ã®å¦çé¢æ°ä¸­ã§ï¼æ¬¡ã®ããã«ä½¿
+ç¨ããã¦ããï¼
+
+----------------------------------------
+ER
+<ãµã¼ãã¹ã³ã¼ã«å>(â¦â¦)
+{
+	<ã­ã¼ã«ã«å¤æ°ã®å®£è¨>
+	ER		ercd;
+
+	LOG_XXX_YYY_ENTER(â¦â¦);
+	CHECK_XXXXX(â¦â¦);
+	CHECK_YYYYY(â¦â¦);
+
+	<ãµã¼ãã¹ã³ã¼ã«å¦çæ¬ä½>
+
+  error_exit:
+	LOG_XXX_YYY_LEAVE(â¦â¦);
+	return(ercd);
+}
+----------------------------------------
+
+ãã®ä¾ã§ã¯ï¼CHECKãã¯ã­ã2ã¤ä½¿ç¨ãã¦ãããï¼1ã¤ã®ã¿ä½¿ç¨ãã¦ããå ´åãã
+ãã°ï¼3ã¤ä»¥ä¸ä½¿ç¨ãã¦ããå ´åãããï¼ã¾ãï¼è¤æ°ã®CHECKãã¯ã­ã®éã«ï¼ã­ã¼
+ã«ã«å¤æ°ã¸ã®ä»£å
+¥æãå
+¥ãå ´åãããï¼ä¾ãã°ï¼ter_tskã®å¦çé¢æ°ï¼ï¼
+
+âè¨­è¨æå³
+
+CHECKãã¯ã­ãä½¿ç¨ããæå³ã¯ï¼ã»ã¨ãã©ã®ãµã¼ãã¹ã³ã¼ã«ã§å¿
+è¦ãªéçã¨ã©ã¼
+ã®ãã§ãã¯ã³ã¼ãããã¿ã¼ã³åãï¼ã½ã¼ã¹ã³ã¼ãã®ç°¡æ½ããä¿ã¤ãã¨ã§èª­ã¿ã
+ãããåä¸ãããã¨ã¨ãã«ï¼è¨è¿°ãã¹ã®å¯è½æ§ãæ¸ãããã¨ã§ããï¼
+
+ã¡ãªã¿ã«ï¼CHECKãã¯ã­ãä½¿ç¨ããªãå ´åï¼ä¸ã«ç¤ºãããµã¼ãã¹ã³ã¼ã«ã®å¦çé¢
+æ°ã¯ï¼æ¬¡ã®ããã«è¨è¿°ãããã¨ã«ãªãï¼
+
+----------------------------------------
+ER
+<ãµã¼ãã¹ã³ã¼ã«å>(â¦â¦)
+{
+	<ã­ã¼ã«ã«å¤æ°ã®å®£è¨>
+	ER		ercd;
+
+	LOG_XXX_YYY_ENTER(â¦â¦);
+	if (<XXXXXã®ã¨ã©ã¼æ¡ä»¶>) {
+		ercd = <XXXXXã®ã¨ã©ã¼ã³ã¼ã>;
+	}
+	else {
+		if (<YYYYYã®ã¨ã©ã¼æ¡ä»¶>) {
+			ercd = <YYYYYã®ã¨ã©ã¼ã³ã¼ã>;
+		}
+		else {
+
+			<ãµã¼ãã¹ã³ã¼ã«å¦çæ¬ä½>
+
+		}
+	}
+	LOG_XXX_YYY_LEAVE(â¦â¦);
+	return(ercd);
+}
+----------------------------------------
+
+CHECKãã¯ã­ã®å
+å®¹ãç¥ã£ã¦ããã¨ããåæã®ä¸ã§ã¯ï¼å
+ã®ã½ã¼ã¹ã³ã¼ãã®æ¹ã
+èª­ã¿ãããã®ã¯æããã§ããï¼
+
+ãªãï¼ãã®ãããªCHECKãã¯ã­ã®å®ç¾©ã«ã¯ï¼gotoæã®ä½¿ç¨ãä¸å¯é¿ã§ããï¼
+
+âCHECKãã¯ã­ãä½¿ç¨ãã¦ããæ¡ä»¶
+
+CHECKãã¯ã­ã¯ï¼æ¬¡ã®æ¡ä»¶ãæºããããã«ä½¿ç¨ããªããã°ãªããªãï¼
+
+(1) CHECKãã¯ã­ã¯ï¼ãµã¼ãã¹ã³ã¼ã«å¦çé¢æ°ã®å
+é ­é¨åã§ï¼ãµã¼ãã¹ã³ã¼ã«å
+¥
+ããå£ã®ã­ã°ãåºããå¾ï¼ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã«å
+¥ãåã¾ã§ã«ï¼å¦çé¢æ°
+ããã®ãããã¬ãã«ã§ç¨ããï¼
+
+(2) ãµã¼ãã¹ã³ã¼ã«å¦çé¢æ°ã®æ«å°¾é¨åã§ï¼ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ãæãã
+ããå¾ï¼ãµã¼ãã¹ã³ã¼ã«åºå£ã®ã­ã°ãåºãåã«ï¼å¦çé¢æ°ã®ãããã¬ãã«ã«ï¼
+ããerror_exitã©ãã«ãç½®ãï¼
+
+âåé¡ãçãããã¨ããªãæ ¹æ 
+
+ãã®ãããªæ¹æ³ã§gotoæãä½¿ç¨ãã¦ãï¼ã½ããã¦ã§ã¢ã®ä¿¡é ¼æ§ã«åé¡ãçãã
+ãã¨ããªããã¨ãä¸»å¼µããã«ã¯ï¼ããããï¼MISRA-Cãªã©ã®ã³ã¼ãã£ã³ã°ã«ã¼ã«
+ã§gotoæã®ä½¿ç¨ãç¦æ­¢ãã¦ããæ ¹æ ï¼è¨ãæããã¨ï¼gotoæã®ä½¿ç¨ã«ããã½ã
+ãã¦ã§ã¢ã®ä¿¡é ¼æ§ã«åé¡ãçããå¯è½æ§ã®ããçç±ãæããã«ããå¿
+è¦ãããï¼
+
+MISRA-Cã®ãã­ã¥ã¡ã³ãã§ã¯ï¼gotoæã®ä½¿ç¨ãç¦æ­¢ããæ ¹æ ã«ã¤ãã¦ãã¾ãæç¢º
+ã«ãªã£ã¦ãããï¼ããã§ã¯ãã®æ ¹æ ãæ¬¡ã®ããã«æ¨æ¸¬ããï¼
+
+ã»å¦çã®æµããè¤éã«ãªãï¼ãã­ã°ã©ã ã®æå³ãèª­ã¿ã«ãããªãï¼ããããï¼
+ãã¹ãã²ããã£ãã­ã°ã©ã ã«ãªãï¼ï¼
+
+CHECKãã¯ã­ã®å ´åã«ã¯ï¼gotoæãã¨ã©ã¼çºçæã®å¼·å¶è±åºã«ç¨ãã¦ããï¼ã©ã
+ã«ãerror_exitã¨ãããªã©ï¼ãã­ã°ã©ã ã®æå³ã¯æããã§ããï¼ä¸æ¹ï¼ãã®ã
+ãã«gotoæãã¨ã©ã¼æã®å¼·å¶è±åºã«ç¨ããå ´åã«ã¯ï¼æ¬¡ã®ç¹ãgotoæã®ä½¿ç¨ã
+ç¦æ­¢ããæ ¹æ ã«ãªãããï¼
+
+ã»gotoæã§å¼·å¶è±åºãããã¨ã«ããï¼è±åºæã«è¡ããªããã°ãªããªãå¾å¦çã
+ãé£ã°ãããããããããï¼
+
+ãã ããã®ç¹ã«ã¤ãã¦ãï¼CHECKãã¯ã­ãä¸è¨ã®ä½¿ç¨æ¡ä»¶ãæºããã¦ä½¿ãéãã¯ï¼
+è±åºæã«è¡ããªããã°ãªããªãå¾å¦çã¯ãªãï¼CHECKãã¯ã­ã®ä½¿ç¨ã«ããã½ãã
+ã¦ã§ã¢ã®ä¿¡é ¼æ§ã«åé¡ãçãããã¨ã¯ãªãï¼
+
+åé¡ãçãããã¨ããªããã¨ãè«è¨¼ãããã1ã¤æ¹æ³ã¯ï¼ã³ã¼ãã£ã³ã°ã«ã¼ã«ã«
+åè´ããªããã­ã°ã©ã ãï¼ã³ã¼ãã£ã³ã°ã«ã¼ã«ã«åè´ãããã­ã°ã©ã ã¨ç­ä¾¡ã§
+ãããã¨ãç¤ºãæ¹æ³ã§ããï¼
+
+ãã§ã«ãè¨­è¨æå³ãã®ç¯ã§è¿°ã¹ãããã«ï¼CHECKãã¯ã­ãä½¿ç¨ãããã­ã°ã©ã ã¯ï¼
+gotoæãä½¿ç¨ããªãç­ä¾¡ãªãã­ã°ã©ã ã«æ¸ãæãããã¨ãã§ãããï¼ããä¸è¬
+çã«ã¯ï¼æ¬¡ã®ãã¨ãè¨ããï¼
+
+elseé¨ãæããªãifæã®thené¨ã®æå¾ã«ï¼ifæããä¸ï¼åæ¹ï¼ã«ããï¼ifæã¨
+åããã­ãã¯å
+ã®åãéå±¤ã®ã©ãã«ã¸åå²ããgotoæãããå ´åã«ã¯ï¼ifæã¨
+ã©ãã«ã®éã®æãelseé¨ã«ãããã¨ã«ããï¼gotoæãä½¿ããªãç­ä¾¡ãªãã­ã°ã©
+ã ã«æ¸ãæãããã¨ãã§ããï¼
+
+ä¾ã¨ãã¦ï¼gotoæãä½¿ã£ãæ¬¡ã®ãã­ã°ã©ã ãèããï¼
+
+----------------------------------------
+	{
+		/* ifæã®åã®æ */
+		if (....) {
+			/* thené¨ã®æ */
+			goto <ã©ãã«>;
+		}
+		/* ifæã¨ã©ãã«ã®éã®æ */
+	  <ã©ãã«>:
+		/* ã©ãã«ããå¾ãã®æ */
+	}
+----------------------------------------
+
+ãã®ãã­ã°ã©ã ã¯ï¼gotoæãä½¿ããªãæ¬¡ã®ãã­ã°ã©ã ã¨ç­ä¾¡ã§ããï¼
+
+----------------------------------------
+	{
+		/* ifæã®åã®æ */
+		if (....) {
+			/* thené¨ã®æ */
+		}
+		else {
+			/* ifæã¨ã©ãã«ã®éã®æ */
+		}
+		/* ã©ãã«ããå¾ãã®æ */
+	}
+----------------------------------------
+
+ãã®æ¡ä»¶ã«åè´ããgotoæãè¤æ°ããå ´åã«ã¯ï¼ä¸ã«ããgotoæããé ã«ä¸è¨
+ã®æ¹æ³ã«ãã£ã¦æ¸ãæãããã¨ã§ï¼gotoæãä½¿ããªãç­ä¾¡ãªãã­ã°ã©ã ã«æ¸ã
+æãããã¨ãã§ããï¼
+
+CHECKãã¯ã­ã®ä½¿ç¨æ¹æ³ã¯ï¼ä¸è¨ã®gotoæã®ä½¿ç¨æ¹æ³ã«åè´ããããï¼gotoæã
+ä½¿ç¨ããªãç­ä¾¡ãªãã­ã°ã©ã ã«æ¸ãæãããã¨ãã§ããï¼ãã£ã¦ï¼ãã®CHECKã
+ã¯ã­ã«ããåé¡ãçãããã¨ã¯ãªãï¼
+
+
+âã«ã¼ãã«ã®ãã¼ã¿æ§é ã«å¯¾ããvolatileå®£è¨ã«ã¤ãã¦ï¼ã¯ãªãã£ã«ã«ã»ã¯ã·ã§
+ã³ã®åºå
+¥å¦çã®å®ç¾ã«é¢ããå¶ç´ï¼
+
+ã«ã¼ãã«å
+ã®ãã¼ã¿æ§é ã¯ï¼ä¸¦è¡å®è¡ãããä»ã®å¦çåä½ï¼å²è¾¼ã¿ãã³ãã©ã
+ã¿ã¹ã¯ï¼ãããã¢ã¯ã»ã¹ãããå¯è½æ§ãããããï¼volatileå®£è¨ãå¿
+è¦ã§ã¯ãª
+ããã¨èããããï¼å®éï¼ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³å
+ã§ã«ã¼ãã«å¤æ°ãèª­ãã³ã¼
+ããï¼ã³ã³ãã¤ã©ã®æé©åã«ããã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³å¤ã«ç§»åããï¼ãã
+ãåå ã¨ãªã£ãåé¡äºä¾ãå ±åããã¦ããï¼
+
+ã«ã¼ãã«å
+ã®ãã¹ã¦ã®ãã¼ã¿æ§é ã«volatileå®£è¨ãã¤ããæ¹æ³ã¯ï¼å®å
+¨ã§ã¯ã
+ããï¼æé©åãææ­¢ãããããã«ï¼ã«ã¼ãã«ã®ãµã¤ãºãæ§è½ã«ã¯æªå½±é¿ãä¸ã
+ãï¼ããã§ASP3ã«ã¼ãã«ã§ã¯ï¼æ¬¡ã®æ¹æ³ã§volatileå®£è¨ã®å¿
+è¦æ§ããªãããã¨ã¨
+ããï¼
+
+ASP3ã«ã¼ãã«ã«ããã¦ã¯ï¼ä¸¦è¡å®è¡ãããä»ã®å¦çåä½ããæ¸ãæããããå¯è½
+æ§ã®ãããã¼ã¿æ§é ã¯ï¼ãã¹ã¦ï¼CPUã­ãã¯ç¶æ
+ã¾ãã¯å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã«ã
+ãã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³å
+ã§ã¢ã¯ã»ã¹ãã¦ããï¼ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³å
+
+ã§ã®ãã¼ã¿æ§é ã®ã¢ã¯ã»ã¹ãï¼ã³ã³ãã¤ã©ã®æé©åã«ããã¯ãªãã£ã«ã«ã»ã¯ã·ã§
+ã³å¤ã«ç§»åãããªãããã«ããã«ã¯ï¼ã³ã³ãã¤ã©ã«å¯¾ãã¦ï¼ã¯ãªãã£ã«ã«ã»ã¯
+ã·ã§ã³ã®åºå
+¥å¦çã«ããï¼ã¡ã¢ãªä¸ã®ãã¼ã¿æ§é ãæ¸ãå¤ããå¯è½æ§ãããã
+ã¨ãç¥ãããã°ããï¼
+
+å
+·ä½çã«ã¯ï¼ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çãé¢æ°ã«ãã£ã¦å®ç¾ããã°ï¼
+ãã®ãããªæé©åãææ­¢ãããã¨ãã§ããï¼ãããï¼ASP3ã«ã¼ãã«ã®å¤ãã®ã¿ã¼
+ã²ããä¾å­é¨ã«ããã¦ï¼ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã¯ãã¯ã­ãã¤ã³ã©
+ã¤ã³é¢æ°ã«ããå®è£
+ããã¦ããï¼ä¸ã®ãããªæé©åãææ­¢ã§ããªãï¼
+
+ããã§ï¼ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çãå®ç¾ããå ´åã«ã¯ï¼ã¡ã¢ãªä¸ã®
+ãã¼ã¿æ§é ãæ¸ãå¤ããå¯è½æ§ããããã¨ãï¼ä½ããã®æ¹æ³ã§ã³ã³ãã¤ã©ã«ç¥
+ãããªããã°ãªããªãã¨ããå¶ç´ãè¨­ããï¼GNUéçºç°å¢ã§ã¯ï¼æ¬¡ã®ããããã®
+æ¹æ³ã§ãã®å¶ç´ãæºãããã¨ãã§ããï¼
+
+(a) ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã®å
+¨ä½ã¾ãã¯åºå
+¥å¦çã®æ¬è³ªçãªé¨å
+	ï¼å
+·ä½çã«ã¯ï¼å²è¾¼ã¿ç¦æ­¢ï¼è¨±å¯ããå¦çï¼ãï¼ã¤ã³ã©ã¤ã³ã§ãªãï¼éå¸¸
+	ã®é¢æ°ã«ããå®ç¾ããï¼
+
+(b) ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã®æ¬è³ªçãªé¨åãã¤ã³ã©ã¤ã³ã¢ã»ã³ã
+	ã©ã«ãã£ã¦å®ç¾ãã¦ããå ´åã«ã¯ï¼ãã®ã¤ã³ã©ã¤ã³ã¢ã»ã³ãã©ã®clobberå¤
+	æ°ãªã¹ãã«"memory"ãè¿½å ããï¼
+
+(c) ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã®æ¬è³ªçãªé¨åãï¼ãã¯ã­ãã¤ã³ã©ã¤
+	ã³é¢æ°å¼åºãã§å®ç¾ãã¦ããå ´åã«ã¯ï¼ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã«å
+¥ãå¦
+	çã®æå¾ã¨åºãå¦çã®å
+é ­ã«ï¼Asm("":::"memory")ã¨ããè¨è¿°ãå
+¥ããï¼
+
+ãªãï¼ãã®å¶ç´ãé©ç¨ãããã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã¯ï¼ä»¥ä¸ã®ã
+ã®ã§ããï¼
+
+	SIL_LOC_INT
+	SIL_UNL_INT
+	lock_cpu
+	unlock_cpu
+
+
+âåã­ã£ã¹ãã«ä¼´ãè­¦åã¡ãã»ã¼ã¸
+
+GCCã§-O2ãªãã·ã§ã³ãã¤ãã¦ã³ã³ãã¤ã«ããå ´åã«ï¼ã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼ã
+ä¸­ã®æ°ç®æã§ï¼æ¬¡ã®è­¦åã¡ãã»ã¼ã¸ãåºãï¼GCCã®ãã¼ã¸ã§ã³ã«ãããï¼ï¼
+
+warning: dereferencing type-punned pointer will break strict-aliasing rules
+
+ããã¯ï¼GCCã«-O2ãªãã·ã§ã³ãã¤ããã¨ï¼ã³ã³ãã¤ã©ãCè¨èªã®strict
+aliasing ruleãåæã¨ããããã§ããï¼ã³ã³ãã¤ã©ã«strict aliasing ruleã
+é©ç¨ãããªãããã«ã¯ï¼GCCã®ãªãã·ã§ã³ã«-fno-strict-aliasingãæå®ããã°
+ããï¼ããã«ããï¼è­¦åã¡ãã»ã¼ã¸ã¯ææ­¢ããããï¼strict aliasing ruleã
+åæã¨ããæé©åã¯è¡ãããªããªãï¼
+
+ASP3ã«ã¼ãã«ã«å®è£
+ã«ããã¦ã¯ï¼strict aliasing ruleãåæã¨ããæé©åãè¡ã£
+ã¦ãããï¼ãã®è­¦åã¡ãã»ã¼ã¸ãç¡è¦ãã¦ãå·®ãæ¯ããªãï¼ä»¥ä¸ã§ã¯ï¼ãã®è­¦
+åã¡ãã»ã¼ã¸ãç¡è¦ãã¦ãå·®ãæ¯ããªãçç±ãè¿°ã¹ãï¼
+
+è­¦åã¡ãã»ã¼ã¸ãåºãä¾ã¨ãã¦ï¼semaphore.cä¸­ã®æ¬¡ã®è¡ã«ã¤ãã¦æ¤è¨ããï¼
+
+	wobj_make_wait((WOBJCB *) p_semcb, (WINFO_WOBJ *) &winfo_sem);
+
+ãã®è­¦åã¡ãã»ã¼ã¸ã®åå ã¯ï¼ç´æ¥çã«ã¯ï¼&winfo_semã(WINFO_WOBJ *)ã«ã­ã£
+ã¹ããã¦ãããã¨ã§ãããï¼æ¬è³ªçãªåå ã¯ï¼ãã®ã³ã¼ããCè¨èªã®strict
+aliasing ruleã«å¾ããªãä»£å
+¥æã®åå ã«ãªãå¯è½æ§ãããï¼ãã®ã«ã¼ã«ã«ä¾å­
+ããæé©åãèª¤ã£ãçµæãå¼ãèµ·ããå¯è½æ§ããããã¨ã§ããï¼
+
+Cè¨èªã®strict aliasing ruleã¯ï¼äºææ§ã®ãªãç°ãªãåãéãã¦ï¼ãªã¼ãã©ã
+ãããã¡ã¢ãªé åãã¢ã¯ã»ã¹ããä»£å
+¥æãä½¿ç¨ãã¦ã¯ãªããªãã¨ãããã®ã§ã
+ãï¼ä½¿ç¨ããå ´åã®æ¯èãã¯æªå®ç¾©ã«ãªãï¼ï¼ãã®ã±ã¼ã¹ã§ã¯ï¼(WINFO_SEM
+*)åã®ãã¤ã³ã¿çµç±ã¨(WINFO_WOBJ *)åã®ãã¤ã³ã¿çµç±ã§ï¼ãªã¼ãã©ãããã
+ã¡ã¢ãªé åãã¢ã¯ã»ã¹ããä»£å
+¥æãä½¿ç¨ãã¦ã¯ãªããªããã¨ã«ãªãï¼ã¾ãï¼è­¦
+åã¡ãã»ã¼ã¸ã®åå ã«ãªã£ã¦ã¯ããªããï¼(SEMCB *)åã®ãã¤ã³ã¿çµç±ã¨
+(WOBJCB *)åã®ãã¤ã³ã¿çµç±ã§ï¼ãªã¼ãã©ããããã¡ã¢ãªé åãã¢ã¯ã»ã¹ãã
+ä»£å
+¥æãä½¿ç¨ãã¦ã¯ãªããªãï¼
+
+ASP3ã«ã¼ãã«ã®å®è£
+ã«ããã¦ã¯ï¼semaphore.cä¸­ã®é¢æ°ã«ããã¦ã¯ï¼(SEMCB *)å
+ããã³(WINFO_SEM *)åã®ãã¤ã³ã¿ãä½¿ç¨ãã¦ããï¼(WOBJCB *)åããã³
+(WINFO_WOBJ *)åã®ãã¤ã³ã¿çµç±ã§ã¡ã¢ãªé åãã¢ã¯ã»ã¹ãããã¨ã¯ãªãï¼ä¸
+æ¹ï¼ããããå¼ã³åºãããwait.cä¸­ã®é¢æ°ã«ããã¦ã¯ï¼(WOBJCB *)åããã³
+(WINFO_WOBJ *)åã®ãã¤ã³ã¿ãä½¿ç¨ãã¦ããï¼(SEMCB *)åããã³(WINFO_SEM
+*)åã®ãã¤ã³ã¿çµç±ã§ã¡ã¢ãªé åãã¢ã¯ã»ã¹ãããã¨ã¯ãªãï¼
+
+strict aliasing ruleã«å¾ããªãä»£å
+¥æã®åé¡ç¹ã¯ï¼ãã®ã«ã¼ã«ã«ä¾å­ããæ
+é©åãèª¤ã£ãçµæãå¼ãèµ·ããå¯è½æ§ããããã¨ã§ãããï¼ç°ãªãã³ã³ãã¤ã«
+åä½ãã¾ããã§æé©åãè¡ããããã¨ã¯ãªãããï¼ããã«ããåé¡ãèµ·ããã
+ã¨ã¯ãªãã¨è¨ããã¨ãã§ããï¼
+
+åãè­°è«ã¯ï¼ä»ã®ã½ã¼ã¹ãã¡ã¤ã«ï¼eventflag.cï¼dataqueue.cï¼pridataq.cï¼
+mailbox.cï¼mempfix.cï¼ä¸­ã®è­¦åã¡ãã»ã¼ã¸ã«ã¤ãã¦ãï¼ãã®ã¾ã¾å½ã¦ã¯ã¾ãï¼
+
+
+âkernel_cfg.hã¸ã®ä¾å­é¢ä¿ã®æ±ã
+
+ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ããã¤ã³ã¯ã«ã¼ããããããããã¡
+ã¤ã«ãå¤æ´ãããå ´åï¼åç´ã«ä¾å­é¢ä¿ããã©ãã¨ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®åå®
+è¡ãå¿
+è¦ã«ãªãï¼kernel_cfg.hãæ´æ°ãããï¼ãã®çµæï¼kernel_cfg.hã«ä¾å­
+ããã½ã¼ã¹ãã¡ã¤ã«ã®åã³ã³ãã¤ã«ãè¡ãããï¼ãããï¼ããããã¡ã¤ã«ãå¤
+æ´ããã¦ãï¼kernel_cfg.hã®å
+å®¹ã¯æ´æ°ãããªãå ´åãå¤ãï¼ãã®ãããªå ´åï¼
+åã³ã³ãã¤ã«ã¯ä¸è¦ãªã¯ãã§ããï¼
+
+ãã®åé¡ãè§£æ±ºããä¸è¬çãªææ³ã¨ãã¦ï¼move-if-changeã¹ã¯ãªãããä½¿ãï¼
+kernel_cfg.hã®å
+å®¹ãå¤ãã£ãå ´åã®ã¿ï¼ãã®ã¿ã¤ã ã¹ã¿ã³ããæ´æ°ããæ¹æ³
+ãããï¼ãã®å ´åï¼kernel_cfg.hãçæããã¿ã¼ã²ããã¯ï¼ã¿ã¤ã ã¹ã¿ã³ããã¡
+ã¤ã«ã«ãï¼çæå¾ã«ã¿ã¤ã ã¹ã¿ã³ããã¡ã¤ã«ãtouchããå¿
+è¦ãããï¼ãã®ãã
+ã«ããªãã¨ï¼kernel_cfg.hã¯ï¼å¤æ´ãããããããã¡ã¤ã«ã«ä¾å­ããããï¼æ¬¡
+åä»¥éã®makeã§ãå¿
+ãkernel_cfg.hã®çææé ãå®è¡ããã¦ãã¾ãï¼ï¼
+
+ãã ãï¼ã¿ã¤ã ã¹ã¿ã³ããã¡ã¤ã«ãtouchããæ¹æ³ã«ã¯ï¼éå»ã«ï¼Windowsã¨
+Cygwinã®ã·ã¹ãã æå»å·®ç°ã«ä¼´ãåé¡ãææããã¦ããï¼ä¸ã®URLåç
+§ï¼ï¼
+
+	http://dev.toppers.jp/trac/asp/ticket/286
+
+ãã®åé¡ãåé¿ããããã«ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«ãã£ã¦ã¿ã¤ã ã¹ã¿ã³ããã¡
+ã¤ã«ãçæããæ¹æ³ãã¨ãï¼
+
+ããã¨åãåé¡ã¯ï¼offset.hã«ãå­å¨ããããï¼åæ§ã«å¯¾å¦ããï¼
+
+ãªãï¼kernel_cfg.cã«åãæ¹æ³ãé©ç¨ãã¦ããããï¼åå®è¡ãé²ããå¯è½æ§ã
+ããå¦çãkernel_cfg.cã®ã³ã³ãã¤ã«ã ãã§ï¼ãããåå®è¡ãå¿
+è¦ãªå ´åãå¤
+ãããï¼ã¡ãªãããå°ããã¨èãã¦é©ç¨ããªããã¨ã«ããï¼
+
+ãªãï¼ASPã«ã¼ãã«ã«ãããå¯¾å¿ã¯ï¼move-if-changeãç¨ãã¦ããªãã£ãããã«ï¼
+ãã¾ãæå³ããªãã£ãï¼ããã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãå
+å®¹ãæ´æ°ããã¦ããª
+ããã¡ã¤ã«ã®ã¿ã¤ãã¹ã¿ã³ããæ¸ãæããªããã¨ãæ³å®ãã¦ããããã§ãã
+ï¼ãã®æ³å®ä¸ã§ãï¼"touch -r"ãç¨ããå¯¾å¿ã¯ä¸é©åã ã£ãï¼ï¼ã³ã³ãã£ã®ã¥
+ã¬ã¼ã¿ããã®ããã«æ¹é ãããã¨ãé£ãããªããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«ãã£
+ã¦ã¿ã¤ã ã¹ã¿ã³ããçæããæ¹æ³ã¯ä½¿ããªããªãï¼
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/doc/extension.txt
===================================================================
--- asp3_wo_tecs/trunk/doc/extension.txt	(revision 302)
+++ asp3_wo_tecs/trunk/doc/extension.txt	(revision 302)
@@ -0,0 +1,504 @@
+
+		TOPPERS/ASP3ã«ã¼ãã«
+		æ©è½æ¡å¼µã»ãã¥ã¼ãã³ã°ã¬ã¤ã
+
+		å¯¾å¿ãã¼ã¸ã§ã³: Release 3.B.0
+		æçµæ´æ°: 2015å¹´8æ21æ¥
+
+ãã®ãã­ã¥ã¡ã³ãã¯ï¼TOPPERS/ASPã«ã¼ãã«3ãï¼æ©è½æ¡å¼µã»ãã¥ã¼ãã³ã°ãã
+ããã®æ¹æ³ï¼ã¾ãã¯ãã³ãï¼ãèª¬æãããã®ã§ããï¼
+
+----------------------------------------------------------------------
+ TOPPERS/ASP Kernel
+     Toyohashi Open Platform for Embedded Real-Time Systems/
+     Advanced Standard Profile Kernel
+
+ 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: extension.txt 458 2015-08-21 14:59:09Z ertl-hiro $
+----------------------------------------------------------------------
+
+âç®æ¬¡
+
+ã»ã¨ã©ã¼ãã§ãã¯ã®çç¥
+ã»ç¹æ®ç®çã®ã¬ã¸ã¹ã¿ã®æ±ã
+ã»æ¡å¼µããã±ã¼ã¸ã®ä½¿ãæ¹
+	- ããªããèª¿æ´æ©è½æ¡å¼µããã±ã¼ã¸
+	- ã¡ãã»ã¼ã¸ãããã¡æ©è½æ¡å¼µããã±ã¼ã¸
+	- ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸
+	- ã¿ã¹ã¯åªå
+åº¦æ¡å¼µããã±ã¼ã¸
+	- å¶ç´ã¿ã¹ã¯æ¡å¼µããã±ã¼ã¸
+	- ãµãåªå
+åº¦æ©è½æ¡å¼µããã±ã¼ã¸
+	- åççææ©è½æ¡å¼µããã±ã¼ã¸
+ã»CPUä¾å¤ãã³ãã©ã®ç´æ¥å¼åºã
+	- TA_DIRECTå±æ§ã®å°å
+¥
+	- ã¿ã¼ã²ããä¾å­é¨ã®ä¿®æ­£ç®æ
+
+
+âã¨ã©ã¼ãã§ãã¯ã®çç¥
+
+ãµã¼ãã¹ã³ã¼ã«ã®ãªã¼ãããããåæ¸ããããã«ï¼éçãªã¨ã©ã¼ã®ãã§ãã¯ã
+çç¥ããæ¹æ³ãããï¼ASP3ã«ã¼ãã«ã«ããã¦ã¯ï¼éçãªã¨ã©ã¼ã®ãã§ãã¯ã¯ã
+ã¹ã¦CHECKãã¯ã­ãç¨ãã¦è¡ã£ã¦ããããï¼kernel/check.hä¸­ã®CHECKãã¯ã­ã
+å¤æ´ãããã¨ã§ï¼éçãªã¨ã©ã¼ã®ãã§ãã¯ãçç¥ãããã¨ãã§ããï¼
+
+ä¾ãã°ï¼ãªãã¸ã§ã¯ãIDã®ãã§ãã¯ãçç¥ãããå ´åã«ã¯ï¼CHECK_IDãã¯ã­ã®
+å®ç¾©ãï¼æ¬¡ã®ããã«å¤æ´ããã°ããï¼
+
+#define CHECK_ID(exp)			((void)(exp))
+
+ãã®ãã¯ã­ã®å®ç¾©ãç©ºã«ããæ¹æ³ããããï¼ãã©ã¡ã¼ã¿ã«å¯ä½ç¨ã®ããå¼ãæ¸
+ããã¦ããå¯è½æ§ãèããã¨ï¼å¯ä½ç¨ã®ããå¼ã¯æ¸ãã¹ãã§ã¯ãªããï¼æ¸ãã
+ã¦ããã³ã¼ããå
+¥ã£ã¦ããå¯è½æ§ãå
+¨ããªãã¨ã¯è¨ããªãï¼ï¼ä¸ã®å®ç¾©ã®æ¹ã
+å®å
+¨ã§ããï¼å¯ä½ç¨ã®ãªãå¼ã§ããã°ï¼æé©åã«ãã£ã¦åé¤ãããã¨ãã§ãã
+ããï¼å®è¡æå¹çã«ã¯å½±é¿ããªãã¨æå¾
+ã§ããï¼ãã ãï¼æé©åã«ãã£ã¦åé¤
+ãããªãå ´åã«ã¯ï¼å¯ä½ç¨ã®ããå¼ãæ¸ããã¦ããªããã¨ãç¢ºèªããä¸ã§ï¼ã
+ã¯ã­ã®å®ç¾©ãç©ºã«ãã¦ãããï¼
+
+ããå°ãå°ããç²åº¦ã§ã¨ã©ã¼ãã§ãã¯ãçç¥ãããå ´åã«ã¯ï¼kernel/check.h
+ä¸­ã®VALIDãã¯ã­ãå¤æ´ããæ¹æ³ãããï¼ä¾ãã°ï¼ã¿ã¹ã¯IDã®ä¸­ã§ãã§ãã¯ãç
+ç¥ãããå ´åã«ã¯ï¼VALID_TSKIDãã¯ã­ã®å®ç¾©ãï¼æ¬¡ã®ããã«å¤æ´ããã°ããï¼
+
+#define VALID_TSKID(tskid)		(true)
+
+
+âç¹æ®ç®çã®ã¬ã¸ã¹ã¿ã®æ±ã
+
+FPUã¬ã¸ã¹ã¿ãDSPã¬ã¸ã¹ã¿ãªã©ã®ç¹æ®ç®çã®ã¬ã¸ã¹ã¿ï¼ä»¥ä¸ï¼ç¹æ®ã¬ã¸ã¹ã¿ï¼
+ãæã¤ãã­ã»ããµã§ã¯ï¼ã¬ã¸ã¹ã¿ã®æ±ãã«ã¤ãã¦å¤§ããæ¬¡ã®3ã¤ã®æ¹æ³ãèãã
+ããï¼
+
+(1) ç¹æ®ã¬ã¸ã¹ã¿ãã¿ã¹ã¯ã®ã³ã³ãã­ã¹ãã«å«ããªã
+
+1ã¤ã®ã¿ã¹ã¯ã®ã¿ãç¹æ®ã¬ã¸ã¹ã¿ãä½¿ç¨ããå ´åã«ã¯ï¼ç¹æ®ã¬ã¸ã¹ã¿ãã¿ã¹ã¯ã®
+ã³ã³ãã­ã¹ãã«å«ããå¿
+è¦ããªãï¼ã«ã¼ãã«ã§ç®¡çããå¿
+è¦ããªãï¼
+
+(2) ç¹æ®ã¬ã¸ã¹ã¿ãã¿ã¹ã¯ã®ã³ã³ãã­ã¹ãã«å«ãã
+
+è¤æ°ã®ã¿ã¹ã¯ãç¹æ®ã¬ã¸ã¹ã¿ãä½¿ç¨ããå ´åã«ã¯ï¼ç¹æ®ã¬ã¸ã¹ã¿ãã¿ã¹ã¯ã®ã³
+ã³ãã­ã¹ãã«å«ããæ¹æ³ãæãåç´ã§ããï¼ãã®ããã«ã¯ï¼ã¿ã¹ã¯ãã£ã¹ãã
+ãã£ã¨å²è¾¼ã¿ãã³ãã©/CPUä¾å¤ãã³ãã©ã®åºå
+¥å£ã§ï¼ç¹æ®ã¬ã¸ã¹ã¿ãä¿å­/å¾©å¸°
+ããã³ã¼ããè¿½å ããå¿
+è¦ãããï¼å®éã®ä¿å­/å¾©å¸°å ´æã¯ï¼ã¹ã¯ã©ããã¬ã¸ã¹
+ã¿ã¨ããä»¥å¤ã®ã¬ã¸ã¹ã¿ã§ç°ãªãããï¼æ³¨æãå¿
+è¦ã§ããï¼
+
+(3) ç¹æ®ã¬ã¸ã¹ã¿ãã³ã³ãã­ã¹ãã«å«ãããã©ãããã¿ã¹ã¯æ¯ã«æå®ãã
+
+ç¹æ®ã¬ã¸ã¹ã¿ãä½¿ç¨ããã¿ã¹ã¯ã¨ä½¿ç¨ããªãã¿ã¹ã¯ãããå ´åã§ï¼ãã¹ã¦ã®ã¿
+ã¹ã¯ã®ã³ã³ãã­ã¹ãã«ç¹æ®ã¬ã¸ã¹ã¿ãå«ããæ¹æ³ã§ã¯ãªã¼ãããããåé¡ã«ãª
+ãå ´åã«ã¯ï¼ç¹æ®ã¬ã¸ã¹ã¿ãã³ã³ãã­ã¹ãã«å«ãããã©ãããã¿ã¹ã¯æ¯ã«æå®
+ããæ¹æ³ãæåã§ããï¼ãããå®ç¾ããæ¹æ³ã¯æ¬¡ã®éãã§ããï¼
+
+ã¾ãï¼ç¹æ®ã¬ã¸ã¹ã¿ãã³ã³ãã­ã¹ãã«å«ãããã©ãããæå®ããã¿ã¹ã¯å±æ§ã
+è¨­ããï¼ä¾ãã°ï¼FPUã¬ã¸ã¹ã¿ã§ããã°ï¼ã¿ã¹ã¯å±æ§ã«TA_FPUãè¨­ããï¼ã¿ã¹ã¯
+ãã£ã¹ãããã£ã§ã¯ï¼ã¿ã¹ã¯å±æ§ãè¦ã¦ï¼ãã®å±æ§ãè¨­å®ããã¦ããã°ç¹æ®ã¬
+ã¸ã¹ã¿ãä¿å­/å¾©å¸°ããï¼
+
+ãã¼ãã¦ã§ã¢çã«ç¹æ®ã¬ã¸ã¹ã¿ããã£ã¹ã¨ã¼ãã«ã§ããå ´åã«ã¯ï¼ãã®å±æ§ã
+è¨­å®ããã¦ããªãã¿ã¹ã¯ã«åãæããæã«ç¹æ®ã¬ã¸ã¹ã¿ããã£ã¹ã¨ã¼ãã«ãã
+ã¨ï¼èª¤ã£ã¦ç¹æ®ã¬ã¸ã¹ã¿ãä½¿ã£ãå ´åãæ¤åºã§ããï¼
+
+ããã«ï¼å²è¾¼ã¿ãã³ãã©ï¼ISRï¼å¨æãã³ãã©ï¼ã¢ã©ã¼ã ãã³ãã©ãå«ãï¼ã
+CPUä¾å¤ãã³ãã©ã§ç¹æ®ã¬ã¸ã¹ã¿ãä½¿ç¨ããå ´åã«ã¯ï¼ãããã®å¦çåä½ã«ã
+ç¹æ®ã¬ã¸ã¹ã¿ãä½¿ç¨ãããã©ããã®å±æ§ãè¨­ããæ¹æ³ãèããããï¼
+
+ããã§ï¼ã¿ã¹ã¯ï¼ã¾ãã¯ä»ã®å¦çåä½ï¼ãç¹æ®ã¬ã¸ã¹ã¿ãä½¿ç¨ãããã©ããã¯ï¼
+ã³ã³ãã¤ã©ãã©ã¤ãã©ãªã«ä¾å­ããå ´åãããããï¼æ³¨æãå¿
+è¦ã§ããï¼ä¾ã
+ã°ï¼æµ®åå°æ°ç¹æ¼ç®ãå«ã¾ãªããã­ã°ã©ã ã§ãã£ã¦ãï¼ã³ã³ãã¤ã©ããã®æ¹ã
+æ§è½ãé«ãã¨å¤æ­ããã°ï¼æµ®åå°æ°ç¹å½ä»¤ãçæããå ´åãããï¼
+
+
+âæ¡å¼µããã±ã¼ã¸ã®ä½¿ãæ¹
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ããã¤ãã®æ¡å¼µæ©è½ãå®è£
+ããããã«ï¼æ¡å¼µããã±ã¼ã¸ã
+ãµãã¼ããã¦ããï¼æ¡å¼µããã±ã¼ã¸ã¯ï¼extensionãã£ã¬ã¯ããªã«ç½®ãã¦ããï¼
+
+æ¡å¼µããã±ã¼ã¸ãä½¿ç¨ããå ´åã«ã¯ï¼UNIXã§ããã°ï¼ASP3ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡
+ã¤ã«ã®ããããã£ã¬ã¯ããªã§ï¼
+
+	% cp -r extension/<æ¡å¼µããã±ã¼ã¸ã®ãã£ã¬ã¯ããªå>/* .
+
+ãå®è¡ããï¼ãã®æï¼å
+ã®ï¼æ¡å¼µåã®ï¼ã½ã¼ã¹ãã¡ã¤ã«ã¯ä¸æ¸ãããã¦ãã¾ã
+ããï¼æ¡å¼µããªãã«ã¼ãã«ãä½¿ç¨ãããå ´åã«ã¯ï¼å¥ã®ãã£ã¬ã¯ããªã«ã½ã¼ã¹
+ãã¡ã¤ã«ãå±éãã¦ï¼ä¸ã®ã³ãã³ããå®è¡ãããã¨ï¼
+
+è¤æ°ã®æ¡å¼µããã±ã¼ã¸ãä½¿ããã¨ã¯èæ
+®ãã¦ããªããï¼æ¡å¼µããã±ã¼ã¸ã®çµã¿
+åããã«ãã£ã¦ã¯ï¼æä½æ¥­ã«ããè¤æ°ã®æ¡å¼µããã±ã¼ã¸ããã¼ã¸ãããã¨ã¯å¯
+è½ã§ããï¼
+
+âããªããèª¿æ´æ©è½æ¡å¼µããã±ã¼ã¸
+
+ããªããèª¿æ´æ©è½æ¡å¼µããã±ã¼ã¸ã¯ï¼ããªããã®èª¿æ´æ©è½ãè¿½å ããããã®æ¡
+å¼µããã±ã¼ã¸ã§ããï¼ããªããèª¿æ´æ©è½æ¡å¼µããã±ã¼ã¸ã¯ï¼extension/driftãã£
+ã¬ã¯ããªã«ç½®ãã¦ããï¼
+
+ããªããèª¿æ´æ©è½æ¡å¼µããã±ã¼ã¸ã§ã¯ï¼TOPPERS_SUPPORT_DRIFTãkernel.hä¸­ã§
+å®ç¾©ããã¦ããã®ã§ï¼ãããç¨ãã¦ããªããèª¿æ´æ©è½ãä½¿ç¨ã§ãããã©ããã
+å¤å¥ãããã¨ãã§ããï¼
+
+ããªããèª¿æ´æ©è½æ¡å¼µããã±ã¼ã¸ã«ããè¿½å ããããµã¼ãã¹ã³ã¼ã«
+
+	ER ercd = set_dft(int32_t drift)
+
+âã¡ãã»ã¼ã¸ãããã¡æ©è½æ¡å¼µããã±ã¼ã¸
+
+ã¡ãã»ã¼ã¸ãããã¡æ©è½æ¡å¼µããã±ã¼ã¸ã¯ï¼ã¡ãã»ã¼ã¸ãããã¡æ©è½ãè¿½å ã
+ãããã®æ¡å¼µããã±ã¼ã¸ã§ããï¼ã¡ãã»ã¼ã¸ãããã¡æ©è½æ¡å¼µããã±ã¼ã¸ã¯ï¼
+extension/messagebufãã£ã¬ã¯ããªã«ç½®ãã¦ããï¼
+
+ã¡ãã»ã¼ã¸ãããã¡æ©è½æ¡å¼µããã±ã¼ã¸ã§ã¯ï¼TOPPERS_SUPPORT_MESSAGEBUFã
+kernel.hä¸­ã§å®ç¾©ããã¦ããã®ã§ï¼ãããç¨ãã¦ã¡ãã»ã¼ã¸ãããã¡æ©è½ãä½¿
+ç¨ã§ãããã©ãããå¤å¥ãããã¨ãã§ããï¼
+
+ã¡ãã»ã¼ã¸ãããã¡æ©è½æ¡å¼µããã±ã¼ã¸ã«ããè¿½å ããããµã¼ãã¹ã³ã¼ã«
+
+	ER ercd = snd_mbf(ID mbfid, const void *msg, uint_t msgsz)
+	ER ercd = psnd_mbf(ID mbfid, const void *msg, uint_t msgsz)
+	ER ercd = tsnd_mbf(ID mbfid, const void *msg, uint_t msgsz, TMO tmout)
+	ER_UINT msgsz = rcv_mbf(ID mbfid, void *msg)
+	ER_UINT msgsz = prcv_mbf(ID mbfid, void *msg)
+	ER_UINT msgsz = trcv_mbf(ID mbfid, void *msg, TMO tmout)
+	ER ercd = ini_mbf(ID mbfid)
+	ER ercd = ref_mbf(ID mbfid, T_RMBF *pk_rmbf)
+
+ã¡ãã»ã¼ã¸ãããã¡æ©è½æ¡å¼µããã±ã¼ã¸ã«ããè¿½å ãããéçAPI
+
+	CRE_MBF(ID mbfid, { ATR mbfatr, uint_t maxmsz, size_t mbfsz, void *mbfmb })
+
+âãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸
+
+ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸ã¯ï¼ãªã¼ãã©ã³ãã³ãã©æ©è½ãè¿½å ã
+ãããã®æ¡å¼µããã±ã¼ã¸ã§ããï¼ãã ãï¼ãã®æ¡å¼µããã±ã¼ã¸ãä½¿ãããã«ã¯ï¼
+ã¿ã¼ã²ããä¾å­é¨ãå¯¾å¿ãã¦ããå¿
+è¦ãããï¼ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µãã
+ã±ã¼ã¸ã¯ï¼extension/ovrhdrãã£ã¬ã¯ããªã«ç½®ãã¦ããï¼
+
+ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸ã§ï¼ã¿ã¼ã²ããä¾å­é¨ãæ¡å¼µããã±ã¼
+ã¸ã«å¯¾å¿ãã¦ããå ´åã«ã¯ï¼TOPPERS_SUPPORT_OVRHDRãkernel.hä¸­ã§å®ç¾©ãã
+ãã®ã§ï¼ãããç¨ãã¦ãªã¼ãã©ã³ã¿ã¤ãæ©è½ãä½¿ç¨ã§ãããã©ãããå¤å¥ãã
+ãã¨ãã§ããï¼
+
+ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸ã«ããè¿½å ããããµã¼ãã¹ã³ã¼ã«
+
+	ER ercd = sta_ovr(ID tskid, PRCTIM ovrtim)
+	ER ercd = stp_ovr(ID tskid)
+	ER ercd = ref_ovr(ID tskid, T_ROVR *pk_rovr)
+
+ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸ã«ããè¿½å ãããéçAPI
+
+	DEF_OVR({ ATR ovratr, OVRHDR ovrhdr })
+
+âã¿ã¹ã¯åªå
+åº¦æ¡å¼µããã±ã¼ã¸
+
+ã¿ã¹ã¯åªå
+åº¦æ¡å¼µããã±ã¼ã¸ã¯ï¼ã¿ã¹ã¯åªå
+åº¦ãæå¤§256æ®µéã«æ¡å¼µããããã®
+æ¡å¼µããã±ã¼ã¸ã§ããï¼ãã®æ¡å¼µããã±ã¼ã¸ã¯ï¼ã¿ã¹ã¯åªå
+åº¦ã«å ãã¦ï¼ãã¼
+ã¿åªå
+åº¦ï¼ã¡ãã»ã¼ã¸åªå
+åº¦ï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã256æ®µéã«æ¡å¼µ
+ããï¼ã¿ã¹ã¯åªå
+åº¦æ¡å¼µããã±ã¼ã¸ã¯ï¼extension/pri_levelãã£ã¬ã¯ããªã«ç½®
+ãã¦ããï¼
+
+ã¿ã¹ã¯åªå
+åº¦æ¡å¼µããã±ã¼ã¸ã§ã¯ï¼TOPPERS_SUPPORT_PRI_LEVELãkernel.hä¸­ã§
+å®ç¾©ããã¦ããã®ã§ï¼ãããç¨ãã¦ã¿ã¹ã¯åªå
+åº¦ã®ç¯å²ãæ¡å¼µããã¦ãããã©
+ãããå¤å¥ãããã¨ãã§ããï¼
+
+âå¶ç´ã¿ã¹ã¯æ¡å¼µããã±ã¼ã¸
+
+å¶ç´ã¿ã¹ã¯æ¡å¼µããã±ã¼ã¸ã¯ï¼å¶ç´ã¿ã¹ã¯ã®æ©è½ãè¿½å ããããã®æ¡å¼µããã±ã¼
+ã¸ã§ããï¼å¶ç´ã¿ã¹ã¯æ¡å¼µããã±ã¼ã¸ã¯ï¼extension/rstr_taskãã£ã¬ã¯ããªã«
+ç½®ãã¦ããï¼
+
+å¶ç´ã¿ã¹ã¯æ¡å¼µããã±ã¼ã¸ã§ã¯ï¼TOPPERS_SUPPORT_RSTR_TASKãkernel.hä¸­ã§å®
+ç¾©ããã¦ããã®ã§ï¼ãããç¨ãã¦å¶ç´ã¿ã¹ã¯ã®æ©è½ãä½¿ç¨ã§ãããã©ãããå¤
+å¥ãããã¨ãã§ããï¼
+
+âãµãåªå
+åº¦æ©è½æ¡å¼µããã±ã¼ã¸
+
+ãµãåªå
+åº¦æ©è½æ¡å¼µããã±ã¼ã¸ã¯ï¼ãµãåªå
+åº¦æ©è½ãè¿½å ããããã®æ¡å¼µãã
+ã±ã¼ã¸ã§ããï¼ãµãåªå
+åº¦æ©è½æ¡å¼µããã±ã¼ã¸ã¯ï¼extension/subprioãã£ã¬ã¯
+ããªã«ç½®ãã¦ããï¼
+
+ãµãåªå
+åº¦æ©è½æ¡å¼µããã±ã¼ã¸ã§ã¯ï¼TOPPERS_SUPPORT_SUBPRIOãkernel.hä¸­ã§
+å®ç¾©ããã¦ããã®ã§ï¼ãããç¨ãã¦ãµãåªå
+åº¦æ©è½ãä½¿ç¨ã§ãããã©ãããå¤
+å¥ãããã¨ãã§ããï¼
+
+ãµãåªå
+åº¦æ©è½æ¡å¼µããã±ã¼ã¸ã«ããè¿½å ããããµã¼ãã¹ã³ã¼ã«
+
+	ER ercd = chg_spr(ID tskid, uint_t subpri)
+
+ãµãåªå
+åº¦æ©è½æ¡å¼µããã±ã¼ã¸ã«ããè¿½å ããããµã¼ãã¹ã³ã¼ã«
+
+	ENA_SPR(PRI tskpri)
+
+âåççææ©è½æ¡å¼µããã±ã¼ã¸
+
+åççææ©è½æ¡å¼µããã±ã¼ã¸ã¯ï¼ãªãã¸ã§ã¯ãã®åççææ©è½ãè¿½å ãããã
+ã®æ¡å¼µããã±ã¼ã¸ã§ããï¼TOPPERSç¬¬3ä¸ä»£ã«ã¼ãã«ï¼ITRONç³»ï¼çµ±åä»æ§æ¸ã«è¦
+å®ãããä»¥ä¸ã®ãªãã¸ã§ã¯ãçæï¼åé¤ã®ããã®ãµã¼ãã¹ã³ã¼ã«ï¼å²ä»ãå¯è½
+ãªIDçªå·ã®æ°ãæå®ããéçAPIã«å ãã¦ï¼ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åã
+è¨­å®ããéçAPI DEF_KMMãå®è£
+ãã¦ããï¼åççææ©è½æ¡å¼µããã±ã¼ã¸ã¯ï¼
+extension/dcreãã£ã¬ã¯ããªã«ç½®ãã¦ããï¼
+
+ãã ãï¼ã«ã¼ãã«å
+ã§ã®åçã¡ã¢ãªç®¡çã«é¢ãã¦ã¯ï¼ã¿ã¼ã²ããéä¾å­é¨ã§ã¯ï¼
+ã¡ã¢ãªé åãå
+é ­ããé ã«å²ãå½ã¦ï¼è§£æ¾ãããã¡ã¢ãªé åãåå©ç¨ããªãã¡
+ã¢ãªç®¡çã¢ã¸ã¥ã¼ã«ã®ã¿ãå®è£
+ãã¦ããï¼æ¬æ ¼çãªåçã¡ã¢ãªç®¡çãè¡ããã
+å ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã¾ãã¯ã¦ã¼ã¶å´ã§ï¼ãã®ããã®é¢æ°ãç¨æããå¿
+
+è¦ãããï¼ç¨æããé¢æ°ç­ã«ã¤ãã¦ã¯ï¼ãTOPPERS/ASP3ã«ã¼ãã« ã¿ã¼ã²ããä¾
+å­é¨ ãã¼ãã£ã³ã°ã¬ã¤ããã®ã6.15 åçã¡ã¢ãªç®¡çãã®ç¯ãåç
+§ãããã¨ï¼
+
+åçæ©è½æ¡å¼µæ¡å¼µããã±ã¼ã¸ã§ã¯ï¼TOPPERS_SUPPORT_DYNAMIC_CREãkernel.hä¸­
+ã§å®ç¾©ããã¦ããã®ã§ï¼ãããç¨ãã¦åççææ©è½ãä½¿ç¨ã§ãããã©ãããå¤
+å¥ãããã¨ãã§ããï¼
+
+åççææ©è½æ¡å¼µããã±ã¼ã¸ã«ããè¿½å ããããµã¼ãã¹ã³ã¼ã«
+
+	ER_ID tskid = acre_tsk(const T_CTSK *pk_ctsk)
+	ER ercd = del_tsk(ID tskid)
+	ER_ID semid = acre_sem(const T_CSEM *pk_csem)
+	ER ercd = del_sem(ID semid)
+	ER_ID flgid = acre_flg(const T_CFLG *pk_cflg)
+	ER ercd = del_flg(ID flgid)
+	ER_ID dtqid = acre_dtq(const T_CDTQ *pk_cdtq)
+	ER ercd = del_dtq(ID dtqid)
+	ER_ID pdqid = acre_pdq(const T_CPDQ *pk_cpdq)
+	ER ercd = del_pdq(ID pdqid)
+	ER_ID mtxid = acre_mtx(const T_CMTX *pk_cmtx)
+	ER ercd = del_mtx(ID mtxid)
+	ER_ID mpfid = acre_mpf(const T_CMPF *pk_cmpf)
+	ER ercd = del_mpf(ID mpfid)
+	ER_ID cycid = acre_cyc(const T_CCYC *pk_ccyc)
+	ER ercd = del_cyc(ID cycid)
+	ER_ID almid = acre_alm(const T_CALM *pk_calm)
+	ER ercd = del_alm(ID almid)
+	ER_ID isrid = acre_isr(const T_CISR *pk_cisr)
+	ER ercd = del_isr(ID isrid)
+
+åççææ©è½æ¡å¼µããã±ã¼ã¸ã«ããè¿½å ãããéçAPI
+
+	AID_TSK(uint_t notsk)
+	AID_SEM(uint_t nosem)
+	AID_FLG(uint_t noflg)
+	AID_DTQ(uint_t nodtq)
+	AID_PDQ(uint_t nopdq)
+	AID_MTX(uint_t nomtx)
+	AID_MPF(uint_t nompf)
+	AID_CYC(uint_t nocyc)
+	AID_ALM(uint_t noalm)
+	AID_ISR(uint_t noisr)
+	DEF_KMM({ SIZE kmmsz, STK_T *kmm })
+
+----------------------------------------------------------------------
+DEF_KMM		ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åã®è¨­å®ãSDã
+
+ãéçAPIã
+	DEF_KMM({ SIZE kmmsz, STK_T *kmm })
+
+ããã©ã¡ã¼ã¿ã
+ãï¼ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åã®è¨­å®æ
+å ±
+	SIZE		kmmsz		ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åã®ãµã¤ãºï¼ãã¤ãæ°ï¼
+	STK_T		kmm			ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åã®å
+é ­çªå°
+
+ãã¨ã©ã¼ã³ã¼ãã
+	E_PAR		ãã©ã¡ã¼ã¿ã¨ã©ã¼
+				ã»kmmszã0ä»¥ä¸
+				ã»ãã®ä»ã®æ¡ä»¶ã«ã¤ãã¦ã¯æ©è½ã®é 
+ãåç
+§
+	E_OBJ		ãªãã¸ã§ã¯ãç¶æ
+ã¨ã©ã¼
+				ã»ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åãè¨­å®æ¸ã¿
+
+ãæ©è½ã
+
+åãã©ã¡ã¼ã¿ã§æå®ããã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åã®è¨­å®æ
+å ±ã«å¾ã£ã¦ï¼
+ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åãè¨­å®ããï¼
+
+kmmszã¯æ´æ°å®æ°å¼ãã©ã¡ã¼ã¿ï¼kmmã¯ä¸è¬å®æ°å¼ãã©ã¡ã¼ã¿ã§ããï¼
+
+kmmãNULLã¨ããå ´åï¼kmmszã§æå®ãããµã¤ãºã®ã¡ã¢ãªé åãï¼ã³ã³ãã£ã®ã¥
+ã¬ã¼ã¿ãç¢ºä¿ããï¼kmmszã«ã¿ã¼ã²ããå®ç¾©ã®å¶ç´ã«åè´ããªããµã¤ãºãæå®ã
+ãæã«ã¯ï¼ã¿ã¼ã²ããå®ç¾©ã®å¶ç´ã«åè´ããããã«ãµã¤ãºãå¤§ããæ¹ã«ä¸¸ãã¦
+ç¢ºä¿ããï¼
+
+ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åãã¢ããªã±ã¼ã·ã§ã³ã§ç¢ºä¿ããå ´åã«ã¯ï¼
+kmmszã§æå®ãããµã¤ãºã®ã¡ã¢ãªé åãç¢ºä¿ãï¼kmmã«ãã®å
+é ­çªå°ãæå®ããï¼
+
+DEF_KMMã«ããã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åãè¨­å®ããªãå ´åï¼ã«ã¼ãã«ã
+å²ãä»ããã¡ã¢ãªé åã¯ç¢ºä¿ãããªãï¼
+
+kmmãkmmszã«ã¿ã¼ã²ããå®ç¾©ã®å¶ç´ã«åè´ããªãå
+é ­çªå°ããµã¤ãºãæå®ãã
+æã«ã¯ï¼E_PARã¨ã©ã¼ã¨ãªãï¼
+----------------------------------------------------------------------
+
+
+âCPUä¾å¤ãã³ãã©ã®ç´æ¥å¼åºã
+
+CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦çã¯ï¼CPUä¾å¤ãçºçããªãããã«å®è£
+ããªããã°
+ãªããªããï¼ãããé²ããªãã¿ã¼ã²ããã«ããã¦ã¯ï¼CPUä¾å¤ãã³ãã©ã®åºå
+¥å£
+å¦çãçµç±ããã«ï¼ã¢ããªã±ã¼ã·ã§ã³ãç¨æããCPUä¾å¤ãã³ãã©ãç´æ¥å®è¡ã
+ãæ¹æ³ãç¨æããã®ãæã¾ããï¼ãããï¼CPUä¾å¤ãã³ãã©ã®ç´æ¥å¼åºãã¨å¼ã¶ï¼
+
+ããã§ã¯ï¼ãã¼ãã¦ã§ã¢ã§ãã¯ã¿ãã¼ãã«ãæã¤ãã­ã»ããµã«ããã¦ï¼ã¿ã¼ã²ã
+ãéä¾å­é¨ã«å«ã¾ããæ¨æºã®CPUä¾å¤ç®¡çæ©è½ã®åæåå¦çãç¨ãã¦ããå ´å
+ï¼OMIT_INITILIZE_EXCEPTIONããã¯ã­å®ç¾©ãã¦ããªãå ´åï¼ã«ï¼ã¿ã¼ã²ããä¾
+å­é¨ã®ã¿ã®ä¿®æ­£ã«ããï¼CPUä¾å¤ãã³ãã©ã®ç´æ¥å¼åºãã®æ©è½ãè¿½å ããæ¹æ³ã«
+ã¤ãã¦èª¬æããï¼
+
+âTA_DIRECTå±æ§ã®å°å
+¥
+
+CPUä¾å¤ãã³ãã©ã®ç´æ¥å¼åºããæå®ããããã«ï¼CPUä¾å¤ãã³ãã©å±æ§ã«ï¼
+TA_DIRECTå±æ§ãå°å
+¥ããï¼
+
+âã¿ã¼ã²ããä¾å­é¨ã®ä¿®æ­£ç®æ
+
+TA_DIRECTã®å¤ãï¼target_kernel.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ãããããã¡
+ã¤ã«ï¼ã§å®ç¾©ãï¼ãã®å¤ãã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãåãåºããããã«ï¼
+target_def.csvï¼ã¾ãã¯ï¼ããã«ä»£ãããã¡ã¤ã«ï¼ã«æ¬¡ã®è¡ãè¿½å ããï¼
+
+TA_DIRECT,TA_DIRECT
+
+æ¬¡ã«ï¼target.tfï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼ã§ï¼
+TARGET_EXCATRã«è¨­å®ãããå¤ã«ï¼TA_DIRECTãè¿½å ããï¼ä¾ãã°ï¼ä»ã®ã¿ã¼ã²ã
+ãä¾å­ã®CPUä¾å¤ãã³ãã©å±æ§ããªãå ´åã«ã¯ï¼æ¬¡ã®ããã«è¨­å®ããï¼
+
+$TARGET_EXCATR = TA_DIRECT$
+
+æ¬¡ã«ï¼OMIT_INITILIZE_EXCEPTIONããã¯ã­å®ç¾©ãã¦ï¼CPUä¾å¤ãã³ãã©ã®åºå
+¥å£
+å¦çãçæããããã®è¨è¿°ã¨CPUä¾å¤ãã³ãã©åæåãã­ãã¯ã®æ¨æºã®å®ç¾©ãç
+æãããã®ãææ­¢ãï¼ããã«ãã£ã¦ææ­¢ãããé¨åãtarget.tfã«ã³ãã¼ããä¸
+ã§ï¼ä»¥ä¸ã®ä¿®æ­£ãå ããï¼
+
+CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦çãçæããããã®è¨è¿°ï¼EXCHDR_ENTRYã®ãªã¹ãï¼
+ãçæããé¨åã¯ï¼æ¬¡ã®ããã«ä¿®æ­£ããï¼
+
+----------------------------------------
+$FOREACH excno EXC.ORDER_LIST$
+	$IF (EXC.EXCATR[excno] & TA_DIRECT) == 0$
+		EXCHDR_ENTRY($EXC.EXCNO[excno]$, $+EXC.EXCNO[excno]$,$SPC$
+											$EXC.EXCHDR[excno]$)$NL$
+	$END$
+$END$$NL$
+----------------------------------------
+
+ã¾ãï¼CPUä¾å¤ãã³ãã©åæåãã­ãã¯ã®å®ç¾©ãçæããé¨åã¯ï¼æ¬¡ã®ããã«ä¿®
+æ­£ããï¼
+
+----------------------------------------
+$IF LENGTH(EXC.ORDER_LIST)$
+	const EXCINIB _kernel_excinib_table[TNUM_DEF_EXCNO] = {$NL$
+	$JOINEACH excno EXC.ORDER_LIST ",\n"$
+		$IF (EXC.EXCATR[excno] & TA_DIRECT) == 0$
+			$TAB${$SPC$
+				($EXC.EXCNO[excno]$),$SPC$
+				($EXC.EXCATR[excno]$),$SPC$
+				(FP)(EXC_ENTRY($EXC.EXCNO[excno]$, $EXC.EXCHDR[excno]$))$SPC$
+			}
+		$ELSE$
+			$TAB${$SPC$
+				($EXC.EXCNO[excno]$),$SPC$
+				($EXC.EXCATR[excno]$),$SPC$
+				(FP)($EXC.EXCHDR[excno]$)
+			}
+		$END$$NL$
+	$END$
+	};$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(const EXCINIB, _kernel_excinib_table);$NL$
+$END$$NL$
+----------------------------------------
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/doc/ovrhdr_memo.txt
===================================================================
--- asp3_wo_tecs/trunk/doc/ovrhdr_memo.txt	(revision 302)
+++ asp3_wo_tecs/trunk/doc/ovrhdr_memo.txt	(revision 302)
@@ -0,0 +1,591 @@
+													TOPPERS Confidential
+		TOPPERSãã­ã¸ã§ã¯ã ãã£ã¹ã«ãã·ã§ã³ã¡ã¢
+		ãªã¼ãã©ã³ãã³ãã©ã«é¢ããè¨­è¨ã¡ã¢
+
+		ä½æè
+: é«ç°åºç« ï¼åå¤å±å¤§å­¦ï¼
+		æçµæ´æ°: 2015å¹´8æ21æ¥
+
+âã¡ã¢ã®ä½ç½®ä»ã
+
+ãã®ãã­ã¥ã¡ã³ãã¯ï¼TOPPERS/ASP3ã«ã¼ãã«ã®ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µã«
+é¢ããè¨­è¨ã¡ã¢ã§ããï¼
+
+âãã¼ã¿åã¨å®æ°ã®å®ç¾©
+
+ãã­ã»ããµæéãè¡¨ç¾ãããã¼ã¿åPRCTIMã®å®ç¾©ãï¼t_stddef.hã«å«ããï¼
+
+----------------------------------------
+typedef	uint32_t		PRCTIM;		/* ãã­ã»ããµæé */
+----------------------------------------
+
+æ®ããã­ã»ããµæéã«æå®ã§ããæå¤§å¤ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ï¼target_kernel.h
+ã¾ãã¯ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼ã§å®ç¾©ãããã®ã¨ãããï¼ããã©
+ã«ãã®å®ç¾©ãkernel.hã«å«ããï¼
+
+----------------------------------------
+#ifndef TMAX_OVRTIM
+#define TMAX_OVRTIM		UINT32_MAX
+#endif /* TMAX_OVRTIM */
+----------------------------------------
+
+ã¾ãï¼ãªã¼ãã©ã³ãã³ãã©ã®ãã¼ã¿åOVRHDRã®å®ç¾©ãï¼kernel.hã«å«ããï¼
+
+----------------------------------------
+typedef void	(*OVRHDR)(ID tskid, intptr_t exinf);
+----------------------------------------
+
+ãã®ä»ã«ï¼ãªã¼ãã©ã³ãã³ãã©æ©è½ã®ãµã¼ãã¹ã³ã¼ã«ã®å®£è¨ã¨é¢é£ããå®æ°ã®
+å®ç¾©ãï¼kernelã«å«ããï¼
+
+âç¨ãããã¼ãã¦ã§ã¢è³æºã¨ãµãã¼ãã§ããªãå ´åã®æªç½®
+
+ãªã¼ãã©ã³ãã³ãã©ãå®ç¾ããããã«ï¼ã·ã¹ãã æå»ãé²ããããã®é«åè§£è½
+ã¿ã¤ãã¨ã¯å¥ã®ã¿ã¤ãï¼ä»¥ä¸ï¼ããããªã¼ãã©ã³ã¿ã¤ãã¨å¼ã¶ï¼ãç¨ããï¼ã
+ã®ããï¼ã¿ã¼ã²ããã«ãã£ã¦ã¯ï¼ãªã¼ãã©ã³ãã³ãã©ããµãã¼ãã§ããªãå ´å
+ãèããããï¼
+
+ããã§ï¼ãªã¼ãã©ã³ãã³ãã©ããµãã¼ãã§ããå ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã«
+ããã¦ï¼TOPPERS_TARGET_SUPPORT_OVRHDRããã¯ã­å®ç¾©ãããã®ã¨ããï¼
+
+ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µã®kernel.hã§ã¯ï¼TOPPERS_TARGET_SUPPORT_OVRHDR
+ããã¯ã­å®ç¾©ããã¦ããã°ï¼TOPPERS_SUPPORT_OVRHDRãå®ç¾©ããï¼
+
+----------------------------------------
+#ifdef TOPPERS_TARGET_SUPPORT_OVRHDR
+#define TOPPERS_SUPPORT_OVRHDR			/* ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µ */
+#endif /* TOPPERS_TARGET_SUPPORT_OVRHDR */
+----------------------------------------
+
+ãªã¼ãã©ã³ãã³ãã©æ©è½ã¯ï¼TOPPERS_SUPPORT_OVRHDRãå®ç¾©ããã¦ããå ´åã®
+ã¿çµã¿è¾¼ãï¼ããã«ããï¼ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µãä½¿ç¨ãï¼ã¿ã¼ã²ãã
+ä¾å­é¨ããªã¼ãã©ã³ãã³ãã©ããµãã¼ããã¦ããå ´åã®ã¿ï¼ãªã¼ãã©ã³ãã³ã
+ã©æ©è½ãçµã¿è¾¼ã¾ãããã¨ã«ãªãï¼
+
+âãªã¼ãã©ã³ãã³ãã©ã«é¢é£ãããã¼ã¿æ§é 
+
+ãªã¼ãã©ã³ãã³ãã©ãå®è£
+ããããã«ï¼TCBã«ï¼ãªã¼ãã©ã³ãã³ãã©ãåä½ç¶æ
+
+ã§ãããã¨ãç¤ºããã£ã¼ã«ãstaovrã¨ï¼æ®ããã­ã»ããµæéãè¡¨ããã£ã¼ã«ã
+leftotmãè¿½å ããï¼task.hï¼ï¼
+
+----------------------------------------
+typedef struct task_control_block {
+	...
+	BIT_FIELD_BOOL	staovr : 1;		/* ãªã¼ãã©ã³ãã³ãã©åä½ç¶æ
+ */
+	...
+	PRCTIM			leftotm;		/* æ®ããã­ã»ããµæé */
+	...
+} TCB;
+----------------------------------------
+
+ãªã¼ãã©ã³ãã³ãã©ã®åä½ç¶æ
+ã¯ï¼ã¿ã¹ã¯ã®ç»é²æã¨ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ã«é·ç§»
+ããæã«ï¼åä½ãã¦ããªãç¶æ
+ã«åæåãããï¼»NGKI2587ï¼½ãã¨ããï¼
+make_dormantã®ä¸­ã§staovrãfalseã«åæåããï¼task.cï¼ï¼
+
+----------------------------------------
+void
+make_dormant(TCB *p_tcb)
+{
+	...
+	p_tcb->staovr = false;
+	...
+}
+----------------------------------------
+
+ãªã¼ãã©ã³ãã³ãã©ã«å¯¾ãã¦ã¯ï¼ç®¡çãã­ãã¯ã¯å¿
+è¦ãªãï¼DEF_OVRã§å®ç¾©ãã
+æ
+å ±ãæ ¼ç´ããåæåãã­ãã¯ã®ã¿ãç¨æããï¼åæåãã­ãã¯ãï¼åä¸ã®è¦
+ç´ ã§ååã§ããï¼é
+åã§ããå¿
+è¦ã¯ãªãï¼overrun.hï¼ï¼
+
+----------------------------------------
+typedef struct overrun_handler_initialization_block {
+	ATR			ovratr;			/* ãªã¼ãã©ã³ãã³ãã©å±æ§ */
+	OVRHDR		ovrhdr;			/* ãªã¼ãã©ã³ãã³ãã©ã®èµ·åçªå° */
+} OVRINIB;
+----------------------------------------
+extern const OVRINIB	ovrinib;
+----------------------------------------
+
+ãªã¼ãã©ã³ã¿ã¤ããåä½ä¸­ããç¤ºããã©ã°ã¨ãã¦ï¼boot_tåã®å¤æ°
+ovrtimer_flagãç¨æããï¼overrun.hï¼overrun.cï¼ï¼
+
+----------------------------------------
+extern boot_t	ovrtimer_flag;
+----------------------------------------
+
+ã·ã³ã°ã«ãã­ã»ããµã®å ´åã«ã¯ï¼ãªã¼ãã©ã³ã¿ã¤ããåä½ä¸­ãã¯ï¼æ¬¡ã®æ¹æ³ã§
+å¤å¥ãããã¨ãã§ããï¼
+
+	ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§ã¯ï¼
+		(p_runtsk != NULL && p_runtsk->staovr)ã®æã®ã¿åä½ãã¦ããï¼
+	éã¿ã¹ã¯ã³ã³ãã­ã¹ãã§ã¯ï¼åä½ãã¦ããªãï¼
+
+ãã®ããï¼ãã®ãã©ã°ãç¨ããªãå®è£
+ãå¯è½ã§ãããï¼ãã«ããã­ã»ããµã¸ã®
+æ¡å¼µæ§ãã¿ã¼ã²ããä¾å­æ§ãä¸ããããã«ï¼ãããç¨ããå®è£
+ã¨ãã¦ããï¼å®
+éï¼Mac OS Xã¿ã¼ã²ããä¾å­é¨ã§ã¯ï¼ãããæ´»ç¨ãã¦ããï¼ï¼
+
+ovrtimer_flagãç¨ãããã¨ã«ãããã¨ããï¼å²è¾¼ã¿ï¼CPUä¾å¤åºå
+¥å£å¦çã«ã
+ãã¦ï¼p_runtskãNULLã§ãããã©ããããã§ãã¯ããã«ï¼ovrtimer_stopãå¼ã¶
+ãã¨ã¨ãã¦ããï¼ã¿ã¼ã²ããä¾å­é¨ ãã¼ãã£ã³ã°ã¬ã¤ãï¼ï¼
+
+âæ®ããã­ã»ããµæéã®ä¿å­ï¼å¾©å¸°å¦çã®å
+å®¹
+
+ãã£ã¹ãããã£ããã³å²è¾¼ã¿å¦çï¼CPUä¾å¤å¦çã®åºå
+¥å£ã§ï¼ã¿ã¹ã¯ã®æ®ããã­
+ã»ããµæéãä¿å­ï¼å¾©å¸°ããå¿
+è¦ãããï¼å
+·ä½çã«ã¯ï¼ä»¥ä¸ã®ãããªå¦çãå¿
+
+è¦ã§ããï¼
+
+(a) dispatchã¸ã®å
+¥å£
+
+ovrtimer_flagãtrueã§ããã°ï¼ã¾ãã¯ï¼p_runtsk->staovrãtrueã§ããã°ï¼ï¼
+ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ããï¼æ®ããã­ã»ããµæéãp_runtsk->leftotmã«æ ¼ç´
+ããï¼æ®ããã­ã»ããµæéããªããªã£ã¦ããå ´åã«ã¯ï¼p_runtsk->leftotmã«0
+ãæ ¼ç´ããï¼
+
+(b) dispatchããã®åºå£
+
+p_runtsk->staovrãtrueã§ããã°ï¼æ®ããã­ã»ããµæéãp_runtsk->leftotmã¨
+ãã¦ãªã¼ãã©ã³ã¿ã¤ããåä½éå§ããï¼
+
+(c) å²è¾¼ã¿å¦çï¼CPUä¾å¤å¦çã®å
+¥å£
+
+ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§å²è¾¼ã¿ï¼CPUä¾å¤ãçºçããå ´åã«ï¼ovrtimer_flagã
+trueã§ããã°ï¼ã¾ãã¯ï¼p_runtskãNULLã§ãªãï¼p_runtsk->staovrãtrueã§ã
+ãã°ï¼ï¼ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ããï¼æ®ããã­ã»ããµæéã
+p_runtsk->leftotmã«æ ¼ç´ããï¼æ®ããã­ã»ããµæéããªããªã£ã¦ããå ´åã«ã¯ï¼
+p_runtsk->leftotmã«0ãæ ¼ç´ããï¼
+
+ãã®å¦çã¯ï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ããã¹ã¦ç¦æ­¢ããç¶æ
+ã§è¡ãå¿
+è¦ãããï¼
+å²è¾¼ã¿ï¼CPUä¾å¤çºçç´å¾ã«ãã¹ã¦ã®å²è¾¼ã¿ãç¦æ­¢ãããªããã­ã»ããµã§ã¯ï¼å²
+è¾¼ã¿ãç¦æ­¢ããå¾ã«ãã®å¦çãè¡ãå¿
+è¦ãããï¼
+
+(d) å²è¾¼ã¿å¦çï¼CPUä¾å¤å¦çã®åºå£
+
+ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«æ»ãå ´åã«ï¼p_runtskãNULLã§ãªãï¼p_runtsk->staovr
+ãtrueã§ããã°ï¼æ®ããã­ã»ããµæéãp_runtsk->leftotmã¨ãã¦ãªã¼ãã©ã³ã¿
+ã¤ããåä½éå§ããï¼
+
+(e) ã¿ã¹ã¯ã®çµäºæ
+
+ovrtimer_flagãtrueã§ããã°ï¼ã¾ãã¯ï¼p_runtsk->staovrãtrueã§ããã°ï¼ï¼
+ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ãããï¼æ®ããã­ã»ããµæéãp_runtsk->leftotmã«æ ¼
+ç´ããå¿
+è¦ã¯ãªãï¼ã¿ã¹ã¯ãçµäºããã¨ï¼ãªã¼ãã©ã³ãã³ãã©ã¯åæ­¢ããã
+ãï¼ï¼
+
+(f) ã¿ã¹ã¯ã®å®è¡éå§æ
+
+p_runtsk->staovrãtrueã§ããã°ï¼æ®ããã­ã»ããµæéãp_runtsk->leftotmã¨
+ãã¦ãªã¼ãã©ã³ã¿ã¤ããåä½éå§ããï¼
+
+âã¿ã¼ã²ããä¾å­é¨ã®ã¤ã³ã¿ãã§ã¼ã¹
+
+ãªã¼ãã©ã³ãã³ãã©æ©è½ã®ã¿ã¼ã²ããä¾å­é¨ã§ã¯ï¼ãªã¼ãã©ã³ãã³ãã©ç¨ã®ã¿
+ã¤ãï¼ä»¥ä¸ï¼ãªã¼ãã©ã³ã¿ã¤ãã¨å¼ã¶ï¼ãæä½ããããã®æ©è½ãæä¾ããï¼
+
+ã¾ãï¼æ¬¡ã®å®æ°ããã¯ã­å®ç¾©ããï¼
+
+(1) TMAX_OVRTIM
+
+æ®ããã­ã»ããµæéã¨ãã¦ãªã¼ãã©ã³ãã³ãã©ç¨ã¿ã¤ãã«è¨­å®ã§ããæå¤§ã®å¤ï¼
+åä½ã¯ãã¤ã¯ã­ç§ã¨ããï¼ã¿ã¼ã²ããä¾å­é¨ã§å®ç¾©ããªãå ´åã«ã¯ï¼kernel.h
+ã§UINT32_MAXã«å®ç¾©ããï¼
+
+ã¾ãï¼æ¬¡ã®5ã¤ã®é¢æ°ãç¨æããï¼
+
+(1) void target_ovrtimer_initialize(intptr_t exinf)
+
+ãªã¼ãã©ã³ã¿ã¤ãã®åæåå¦çãè¡ãï¼ã¿ã¤ãã®åä½éå§ã¯è¡ããªãï¼
+
+ãã®é¢æ°ã¯ï¼target_timer.cfgä¸­ã«è¨è¿°ããéçAPIã«ããï¼åæåã«ã¼ãã³ã¨
+ãã¦ã«ã¼ãã«ã«ç»é²ãããã¨ãæ³å®ãã¦ããï¼
+
+(2) void target_ovrtimer_terminate(intptr_t exinf)
+
+ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢å¦çãè¡ãï¼
+
+ãã®é¢æ°ã¯ï¼target_timer.cfgä¸­ã«è¨è¿°ããéçAPIã«ããï¼çµäºå¦çã«ã¼ãã³
+ã¨ãã¦ã«ã¼ãã«ã«ç»é²ãããã¨ãæ³å®ãã¦ããï¼
+
+(3) void target_ovrtimer_start(PRCTIM ovrtim)
+
+ãªã¼ãã©ã³ã¿ã¤ããï¼ovrtimã§æå®ããæéãçµéãããå²è¾¼ã¿ãçºçããã
+ãã«è¨­å®ãï¼åä½éå§ããï¼ovrtimã0ã®å ´åã¯ï¼ã§ããéãæ©ããªã¼ãã©ã³ã¿
+ã¤ãå²è¾¼ã¿ãçºçãããï¼ovrtimã®åä½ã¯ãã¤ã¯ã­ç§ã¨ããï¼
+
+(4) PRCTIM target_ovrtimer_stop(void)
+
+ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ãï¼ã¿ã¤ãã®æ®ãæéï¼å²è¾¼ã¿çºçã¾ã§ã®æéï¼ãè¿
+ãï¼æ®ãæéããªããªã£ã¦ããå ´åã«ã¯ï¼0ãè¿ãï¼ã¾ãï¼ãªã¼ãã©ã³ã¿ã¤ãã
+ãã®å²è¾¼ã¿è¦æ±ãã¯ãªã¢ããï¼ã¯ãªã¢ããªãã¨ã¹ããªã¢ã¹å²è¾¼ã¿ãçºçãããï¼
+ã¯ãªã¢ãããã¨ã¯å¿
+é ã§ã¯ãªãï¼ï¼
+
+(5) PRCTIM target_ovrtimer_get_current(void)
+
+ãªã¼ãã©ã³ã¿ã¤ãã®æ®ãæéï¼å²è¾¼ã¿çºçã¾ã§ã®æéï¼ãèª­ã¿åºãï¼æ®ãæé
+ããªããªã£ã¦ããå ´åã«ã¯ï¼0ãè¿ãï¼ãªã¼ãã©ã³ã¿ã¤ãããã®å²è¾¼ã¿ã¯ã¯ãªã¢
+ããªãï¼
+
+âæ®ããã­ã»ããµæéã®ä¿å­ï¼å¾©å¸°ã®å®è£
+ï¼ã¿ã¼ã²ããéä¾å­é¨ï¼
+
+ã¾ãï¼(a)ã¨(b)ãå®ç¾ããé¢æ°ovrtimer_stopã¨ovrtimer_startãã¿ã¼ã²ããé
+ä¾å­é¨ã«è¨­ãï¼ã¿ã¼ã²ããä¾å­é¨ã®è©²å½ç®æããå¼ã³åºãããã«ããï¼
+
+----------------------------------------
+void
+ovrtimer_stop(void)
+{
+	if (ovrtimer_flag) {
+		assert(p_rutsk != NULL && p_runtsk->staovr);
+		p_runtsk->leftotm = target_ovrtimer_stop();
+		ovrtimer_flag = false;
+	}
+}
+----------------------------------------
+void
+ovrtimer_start(void)
+{
+	if (p_runtsk->staovr) {
+		target_ovrtimer_start(p_runtsk->leftotm);
+		ovrtimer_flag = true;
+	}
+}
+----------------------------------------
+
+
+(c)ã¯ï¼(a)ã¨åãå¦çå
+å®¹ã§ããããï¼ovrtimer_stopãå¼ã³åºãã°ããï¼(d)
+ã¯ï¼p_runtskãNULLã§ãªãå ´åã«ï¼ovrtime_startãå¼ã³åºãããã«å®ç¾ããã°
+ããï¼
+
+(e)ã¯ï¼æ®ããã­ã»ããµæéãp_runtsk->leftotmã«æ ¼ç´ããå¿
+è¦ããªãç¹ã§
+(a)ã¨å¦çå
+å®¹ãç°ãªãããï¼ext_tskã¨ena_terã«æ¬¡ã®ä¿®æ­£ãå ãã
+ï¼task_term.cï¼ï¼task_terminateã®ä¸­ã§ï¼TCBä¸­ã®staovrãåæåããããï¼
+ãããå¼ã¶åã«ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢å¦çãå
+¥ããå¿
+è¦ãããï¼
+
+----------------------------------------
+ER
+ext_tsk(void)
+{
+	...
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	if (p_runtsk->staovr) {
+		(void) target_ovrtimer_stop();
+		ovrtimer_flag = false;
+	}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	(void) task_terminate(p_runtsk);
+	exit_and_dispatch();
+	...
+}
+----------------------------------------
+ER
+ena_ter(void)
+{
+		...
+#ifdef TOPPERS_SUPPORT_OVRHDR
+		if (p_runtsk->staovr) {
+			(void) target_ovrtimer_stop();
+			ovrtimer_flag = false;
+		}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+		(void) task_terminate(p_runtsk);
+		exit_and_dispatch();
+		...
+}
+----------------------------------------
+
+(f)ã¯(b)ã¨åãå¦çå
+å®¹ã§ããããï¼ovrtimer_startãå¼ã³åºãã°ããï¼
+
+âæ®ããã­ã»ããµæéã®ä¿å­ï¼å¾©å¸°ã®å®è£
+ï¼ã¿ã¼ã²ããä¾å­é¨ï¼
+
+(a) dispatchã¸ã®å
+¥å£
+
+----------------------------------------
+void
+dispatch(void)
+{
+|#ifdef TOPPERS_SUPPORT_OVRHDR
+|	ovrtimer_stop();					/* ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢ */
+|#endif /* TOPPERS_SUPPORT_OVRHDR */
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ãã
+	...
+}
+----------------------------------------
+
+(b) dispatchããã®åºå£
+
+----------------------------------------
+void
+dispatch(void)
+{
+	...
+
+  dispatch_r:
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã
+|#ifdef TOPPERS_SUPPORT_OVRHDR
+|	ovrtimer_start();					/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+|#endif /* TOPPERS_SUPPORT_OVRHDR */
+	calltex(); â¦ (*b)
+}
+----------------------------------------
+
+(c) å²è¾¼ã¿å¦çï¼CPUä¾å¤å¦çã®å
+¥å£
+
+å²è¾¼ã¿å¦çï¼CPUä¾å¤å¦çã®å
+¥å£ã¯æ¬¡ã®éãã«ä¿®æ­£ããï¼
+
+----------------------------------------
+void
+<å²è¾¼ã¿ã®åºå
+¥å£å¦ç>(void)
+{
+	å°ãªãã¨ãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããç¶æ
+ã«ãã â¦ (*f)
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ãã
+	if (ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§å²è¾¼ã¿çºç) {
+|#ifdef TOPPERS_SUPPORT_OVRHDR
+|		ovrtimer_stop();				/* ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢ */
+|#endif /* TOPPERS_SUPPORT_OVRHDR */
+		dspflgãã¹ã¿ãã¯ã«ä¿å­ãã
+		dspflg = false;
+		ã¹ã¿ãã¯ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãï¼
+								éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã
+	}
+	...
+}
+----------------------------------------
+void
+<CPUä¾å¤ã®åºå
+¥å£å¦ç>(void)
+{
+		if (ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§CPUä¾å¤çºç) {
+			ï¼å°ãªãã¨ãï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããç¶æ
+ã«ãã
+|#ifdef TOPPERS_SUPPORT_OVRHDR
+|			ovrtimer_stop();			/* ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢ */
+|#endif /* TOPPERS_SUPPORT_OVRHDR */
+			dspflgãã¹ã¿ãã¯ã«ä¿å­ãã
+			dspflg = false;
+			ã¹ã¿ãã¯ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãï¼
+									éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã
+		}
+		...
+}
+----------------------------------------
+
+(d) å²è¾¼ã¿å¦çï¼CPUä¾å¤å¦çã®åºå£
+
+å²è¾¼ã¿å¦çï¼CPUä¾å¤å¦çã®åºå£ã¯æ¬¡ã®éãã«ä¿®æ­£ããï¼
+
+----------------------------------------
+void
+<å²è¾¼ã¿ã®åºå
+¥å£å¦ç>(void)
+{
+	...
+
+		  ret_int_r:
+			ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã
+		}
+|#ifdef TOPPERS_SUPPORT_OVRHDR
+|		if (p_runtsk != NULL) {
+|			ovrtimer_start();			/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+|		}
+|#endif /* TOPPERS_SUPPORT_OVRHDR */
+	}
+	...
+}
+----------------------------------------
+void
+<CPUä¾å¤ã®åºå
+¥å£å¦ç>(void)
+{
+	...
+
+			  ret_exc_r:
+				ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã
+			}
+|#ifdef TOPPERS_SUPPORT_OVRHDR
+|			if (p_runtsk != NULL) {
+|				ovrtimer_start();		/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+|			}
+|a#endif /* TOPPERS_SUPPORT_OVRHDR */
+		}
+		CPUä¾å¤å¦çããã®ãªã¿ã¼ã³å¾ã«ï¼CPUã­ãã¯è§£é¤ç¶æ
+ã«æ»ãããã«æºåãã
+	}
+	...
+}
+----------------------------------------
+
+(e) ã¿ã¹ã¯ã®çµäºæ
+
+ã¿ã¼ã²ããéä¾å­é¨ã®ext_tskã¨ena_terã§å¯¾å¿ããï¼
+
+(f) ã¿ã¹ã¯ã®å®è¡éå§æ
+
+----------------------------------------
+void
+activate_context(TCB *p_tcb)
+{
+	...
+
+  start_r:
+|#ifdef TOPPERS_SUPPORT_OVRHDR
+|	ovrtimer_start();					/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+|#endif /* TOPPERS_SUPPORT_OVRHDR */
+	CPUã­ãã¯è§£é¤ç¶æ
+ã«ãã
+	èªã¿ã¹ã¯ï¼p_runtskï¼ã®èµ·åçªå°ãï¼æ¡å¼µæ
+å ±ããã©ã¡ã¼ã¿ã¨ãã¦å¼ã³åºã
+	ext_tskã«åå²ãã ... (*c)
+}
+----------------------------------------
+
+âãªã¼ãã©ã³ãã³ãã©ã®å¼åºãã®å®è£
+
+
+ãªã¼ãã©ã³ã¿ã¤ããæºäºãï¼å²è¾¼ã¿ãçºçããå ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã®
+å²è¾¼ã¿ãã³ãã©ï¼ã¾ãã¯ï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ï¼ããï¼ã¿ã¼ã²ããéä¾å­
+é¨ã®call_ovrhdrãå¼ã³åºãï¼
+
+ããã§ï¼ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ãã³ãã©ã®èµ·åã¨ï¼sta_ovrï¼stp_ovrã®å¼åº
+ãã®ç«¶åã®åé¡ãããï¼å
+·ä½ä¾ã¨ãã¦ï¼ãªã¼ãã©ã³ã¿ã¤ããæºäºããç´å¾ã«ï¼
+ä»ã®é«åªå
+åº¦ã®å²è¾¼ã¿ãçºçãï¼ãã®å¦çä¸­ã§ãªã¼ãã©ã³ãã³ãã©ãååä½é
+å§ï¼æ®ããã­ã»ããµã¯æ´æ°ãããï¼ãããå ´åãåæ­¢ãããå ´åãåé¡ã«ãªãï¼
+ãã®å ´åï¼ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ãã³ãã©ã®ä¸­ã§ï¼ãªã¼ãã©ã³ãã³ãã©ãå¼
+ã³åºããªãããã«ãã¹ãã§ããï¼
+
+ã¿ã¼ã²ããéä¾å­é¨ã®call_ovrhdrã®å®è£
+ã¯æ¬¡ã®éãï¼
+
+----------------------------------------
+void
+call_ovrhdr(void)
+{
+	assert(sense_context());
+	assert(!sense_lock());
+	assert(ovrinib.ovrhdr != NULL);
+
+	lock_cpu();
+	if (p_runtsk != NULL && p_runtsk->staovr && p_runtsk->leftotm == 0U) {
+		p_runtsk->staovr = false;
+		unlock_cpu();
+
+		LOG_OVR_ENTER(p_runtsk);
+		((OVRHDR)(ovrinib.ovrhdr))(TSKID(p_runtsk), p_runtsk->p_tinib->exinf);
+		LOG_OVR_LEAVE(p_runtsk);
+	}
+	else {
+		/*
+		 *  ãã®ã«ã¼ãã³ãå¼ã³åºãããåã«ï¼ãªã¼ãã©ã³ãã³ãã©ã®èµ·åã
+		 *  ã­ã£ã³ã»ã«ãããå ´å
+		 */
+		unlock_cpu();
+	}
+}
+----------------------------------------
+
+p_runtskãNULLã®å ´åãèæ
+®ãã¦ããã®ã¯ï¼ã¹ããªã¢ã¹å²è¾¼ã¿ã«å¯¾ããã­ãã¹
+ãæ§ãç¢ºä¿ããããã§ããï¼
+
+ãªã¼ãã©ã³ãã³ãã©ã®å¼åºãå¾ã«ï¼å¼åºãåã®ç¶æ
+ï¼CPUã­ãã¯ï¼å²è¾¼ã¿åªå
+åº¦
+ãã¹ã¯ï¼ã«æ»ããªãã®ã¯ï¼ãã®ã«ã¼ãã³ããã®ãªã¿ã¼ã³å¾ã«ï¼å²è¾¼ã¿åºå£å¦ç
+ã§å
+ã®ç¶æ
+ã«æ»ãããã§ããï¼
+
+call_ovrhdrã¯ï¼å²è¾¼ã¿ãã³ãã©ããï¼ã¾ãã¯ï¼å²è¾¼ã¿ãã³ãã©ã¨ãã¦ï¼å¼ã³åº
+ãããããï¼ãã®ã«ã¼ãã³ã«æ¥ãã¾ã§ã«ï¼ovrtimer_stopãå¼ã°ãã¦ããï¼ããª
+ãã¡ï¼ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ãã¦ããï¼ï¼
+
+å²è¾¼ã¿ãã³ãã©ã®è¨­å®ã¯ï¼ä»¥ä¸ã®ãããªéçAPIãï¼target_timer.hä¸­ã«è¨è¿°ã
+ããã¨ã§è¡ããã®ã¨ããï¼ã¿ã¼ã²ããã®äºæ
+ã§å¤æ´ãã¦ããï¼ï¼
+
+----------------------------------------
+#ifdef TOPPERS_SUPPORT_OVRHDR
+ATT_INI({ TA_NULL, 0, target_ovrtimer_initialize });
+ATT_TER({ TA_NULL, 0, target_ovrtimer_terminate });
+CFG_INT(INTNO_OVRTIMER, { TA_ENAINT | INTATR_OVRTIMER, INTPRI_OVRTIMER });
+DEF_INH(INHNO_OVRTIMER, { TA_NULL, target_ovrtimer_handler });
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+----------------------------------------
+
+ãããã®éçAPIä¸­ã®ï¼INHNO_OVRTIMERï¼INTNO_OVRTIMERï¼INTPRI_OVRTIMERï¼
+INTATR_OVRTIMERã®4ã¤ã®å®æ°ã¯ï¼target_timer.hä¸­ã§å®ç¾©ããï¼
+
+âãªã¼ããããã®ä½æ¸æ¹æ³
+
+ä»¥ä¸ã§èª¬æããæ¹æ³ã§ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã®ã¢ã»ã³ããªè¨èªã§è¨è¿°ãããã¨
+ãæ³å®ããã³ã¼ãããï¼ã¿ã¼ã²ããéä¾å­é¨ã®ovrtimer_startã¨
+ovrtimer_stopãå¼ã³åºãã¦ãããï¼ãããã®é¢æ°ã¯ç­ããã®ã§ï¼ã¢ã»ã³ããªè¨
+èªã®ä¸­ã«å±éããæ¹ãå¹çãããï¼ãããã®é¢æ°ãã¢ã»ã³ããªè¨èªã®ä¸­ã«å±é
+ããå ´åã«ã¯ï¼ããããï¼OMIT_OVRTIMER_STARTã¨OMIT_OVRTIMER_STOPããã¯ã­
+å®ç¾©ããï¼
+
+âãã«ããã­ã»ããµå¯¾å¿ã«ã¼ãã«ã¸ã®å¯¾å¿ã«é¢ããã¡ã¢
+
+ãã«ããã­ã»ããµå¯¾å¿ã«ã¼ãã«ã«ããã¦ï¼sta_ovrï¼stp_ovrãï¼å¼ã³åºããå¦
+çåä½ã¨ç°ãªããã­ã»ããµã«å²ãä»ããããã¿ã¹ã¯ãå¯¾è±¡ã«çºè¡ããå ´åã®å®
+è£
+ã¯å·¥å¤«ãè¦ããï¼
+
+åºæ¬çã«ã¯ï¼å¯¾è±¡ã¿ã¹ã¯ãå²ãä»ãããããã­ã»ããµã«å¯¾ãã¦ãã­ã»ããµéå²
+è¾¼ã¿ãããããã¨ã«ãã£ã¦ï¼å¯¾è±¡ã¿ã¹ã¯ã®ãªã¼ãã©ã³ãã³ãã©ã®åä½ãéå§ï¼
+åæ­¢ããããã¨ãå¿
+è¦ã§ããï¼
+
+âMac OS Xã¿ã¼ã²ããä¾å­é¨ã«é¢ããã¡ã¢
+
+Mac OS Xã¿ã¼ã²ããä¾å­é¨ã§ã¯ï¼å²è¾¼ã¿å¦çï¼CPUä¾å¤å¦çåºå£ãããªã¿ã¼ã³ã
+ãç´å¾ï¼dispatch_handlerãåä½ããåã«ï¼ä»ã®å²è¾¼ã¿å¦çãå®è¡ãããå ´å
+ãããï¼ãã®å ´åã«ã¯ï¼ovrtimer_stopãç¶ãã¦å¼ã³åºãããç¶æ³ãçããï¼ã¿ã¼
+ã²ããéä¾å­é¨ã§ovrtimer_flagãç¨ãããã¨ã§ï¼ovrtimer_stopãç¶ãã¦å¼ã³
+åºããã¦ãåé¡ãªãããã«ãªã£ã¦ããããï¼ãã®å®è£
+ã§å·®ãæ¯ããªãï¼
+
+ã¿ã¼ã²ããéä¾å­é¨ã§ovrtimer_flagãç¨ããªãå ´åï¼å²è¾¼ã¿å¦çï¼CPUä¾å¤åº
+å£å¦çã§ã¿ã¹ã¯åæããè¡ãå ´åã«ï¼åæãåã®ã¿ã¹ã¯ã«å¯¾ãã¦ãªã¼ãã©ã³ã
+ã³ãã©ãåä½éå§ãï¼ç´å¾ã«åæ­¢ããã¨ããï¼ã ããªï¼å¦çãè¡ãå®è£
+ãèã
+ãããï¼
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/doc/porting.txt
===================================================================
--- asp3_wo_tecs/trunk/doc/porting.txt	(revision 302)
+++ asp3_wo_tecs/trunk/doc/porting.txt	(revision 302)
@@ -0,0 +1,5218 @@
+
+		TOPPERS/ASP3ã«ã¼ãã«
+		ã¿ã¼ã²ããä¾å­é¨ ãã¼ãã£ã³ã°ã¬ã¤ã
+
+		å¯¾å¿ãã¼ã¸ã§ã³: Release 3.B.0
+		æçµæ´æ°: 2016å¹´1æ12æ¥
+
+ãã®ãã­ã¥ã¡ã³ãã¯ï¼TOPPERS/ASP3ã«ã¼ãã«ãï¼æªãµãã¼ãã®ã¿ã¼ã²ããã·ã¹
+ãã ã«ãã¼ãã£ã³ã°ããããã«å¿
+è¦ã¨ãªãã¿ã¼ã²ããä¾å­é¨ã®å®è£
+æ¹æ³ãèª¬æ
+ãããã®ã§ããï¼
+
+----------------------------------------------------------------------
+ TOPPERS/ASP Kernel
+     Toyohashi Open Platform for Embedded Real-Time Systems/
+     Advanced Standard Profile Kernel
+
+ 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: porting.txt 507 2016-01-12 01:58:33Z ertl-hiro $
+----------------------------------------------------------------------
+
+âç®æ¬¡
+
+ï¼ï¼å
+±éäºé 
+
+	1.1 ã¿ã¼ã²ããä¾å­é¨ã®æ§æ
+		1.1.1 ã¿ã¼ã²ããç¥ç§°ã¨ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããª
+		1.1.2 éçºç°å¢ä¾å­é¨ãã£ã¬ã¯ããª
+		1.1.3 ãã­ã»ããµã³ã¢ä¾å­é¨ãã£ã¬ã¯ããª
+		1.1.4 ãããä¾å­é¨ãã£ã¬ã¯ããª
+	1.2 ååã®è¡çªã®é²æ­¢
+	1.3 ããããã¡ã¤ã«ã®è¨è¿°ã«ã¼ã«
+		1.3.1 ããããã¡ã¤ã«ã®èªå·±å®çµ
+		1.3.2 å¤éã¤ã³ã¯ã«ã¼ãã¸ã®å¯¾å¿
+		1.3.3 ã¢ã»ã³ããªè¨èªã¨ã®ããããã¡ã¤ã«ã®å
+±ç¨
+	1.4 ã¤ã³ã¯ã«ã¼ãè¨è¿°ã®æ¹æ³
+	1.5 ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã®å®ç¾ã«é¢ããå¶ç´
+ï¼ï¼ã·ã¹ãã æ§ç¯ç°å¢ã®ã¿ã¼ã²ããä¾å­é¨
+	2.1 ã·ã¹ãã ç¥ç§°ã»éçºç°å¢ç¥ç§°ç­ã®è¨­å®
+	2.2 ä¾å­é¨ãã£ã¬ã¯ããªã®è¨­å®
+	2.3 ã³ãã³ãåã®è¨­å®
+	2.4 ã³ã³ãã¤ã«ãªãã·ã§ã³ã¨ãªãã¸ã§ã¯ããã¡ã¤ã«ã®è¨­å®
+	2.5 ãªãã»ãããã¡ã¤ã«ã®çææ¹æ³
+	2.6 ãªã³ã¯æ¹æ³ã®è¨­å®
+	2.7 ä¾å­é¢ä¿ã®å®ç¾©
+	2.8 ãã®ä»ã®è¨­å®
+ï¼ï¼TOPPERSå
+±éå®ç¾©ã®ã¿ã¼ã²ããä¾å­é¨
+	3.1 ã¿ã¼ã²ããè­å¥ãã¯ã­
+	3.2 æ´æ°åã®æå¤§å¤ã»æå°å¤ã»ãããæ°
+	3.3 ãµã¤ãºã®æå®ãããæ´æ°åï¼ãã®æå¤§å¤ã»æå°å¤ï¼æ´æ°å®æ°ãä½ããã¯ã­
+	3.4 ãµã¤ãºã®æå®ãããæµ®åå°æ°ç¹åï¼ãã®æå¤§å¤ã»æå°å¤ã®ãã¯ã­
+	3.5 ã³ã³ãã¤ã©ã®æ¡å¼µæ©è½ã®ããã®ãã¯ã­å®ç¾©
+	3.6 æ¨æºçãªå®ç¾©ã®ä¸æ¸ã
+	3.7 ã¢ãµã¼ã·ã§ã³ã®ããã®å®ç¾©
+ï¼ï¼ã·ã¹ãã ã¤ã³ã¿ãã§ã¼ã¹ã¬ã¤ã¤ï¼SILï¼ã®ã¿ã¼ã²ããä¾å­é¨
+	4.1 å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®ç®¡ç
+	4.2 å¾®å°æéå¾
+ã¡
+	4.3 ãã­ã»ããµã®ã¨ã³ãã£ã¢ã³
+	4.4 ã¡ã¢ãªç©ºéã¢ã¯ã»ã¹é¢æ°
+	4.5 I/Oç©ºéã¢ã¯ã»ã¹é¢æ°
+ï¼ï¼ã«ã¼ãã«APIã®ã¿ã¼ã²ããä¾å­é¨
+	5.1 ã¿ã¼ã²ããå®ç¾©ã§ãµãã¼ãããæ©è½
+	5.2 å²è¾¼ã¿åªå
+åº¦ã®ç¯å²
+	5.3 é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æã¨ã«ã¦ã³ãå¤ã®é²ã¿å¹
+
+	5.4 ã¡ã¢ãªé åç¢ºä¿ã®ããã®åå®ç¾©
+	5.5 ããããã¿ã¼ã³ã®ãããæ°
+	5.6 ã¡ã¢ãªé åç¢ºä¿ã®ããã®ãã¯ã­
+	5.7 ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µã®ããã®å®ç¾©ï¼ãªãã·ã§ã³ï¼
+ï¼ï¼ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨
+	6.1 ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨ã®å
+±éäºé 
+
+	6.2 ãã¬ã¼ã¹ã­ã°æ©è½ã¸ã®å¯¾å¿
+	6.3 ã·ã¹ãã ç¶æ
+ã®ç®¡ç
+		6.3.1 å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®ç®¡ç
+		6.3.2 ã³ã³ãã­ã¹ãã®ç®¡ç
+		6.3.3 CPUã­ãã¯ç¶æ
+ã®ç®¡ç
+	6.4 å²è¾¼ã¿ã«é¢é£ããã·ã¹ãã ç¶æ
+ã®ç®¡ç
+		6.4.1 å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®ç®¡ç
+		6.4.2 å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ç®¡ç
+		6.4.3 å²è¾¼ã¿è¦æ±ã®ã¯ãªã¢
+		6.4.4 å²è¾¼ã¿è¦æ±ã®ãã­ã¼ã
+	6.5 ã¿ã¹ã¯ãã£ã¹ãããã£
+		6.5.1 ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ã¨ã¿ã¹ã¯åæåã³ã³ãã­ã¹ããã­ãã¯
+		6.5.2 ãã£ã¹ãããã£æ¬ä½
+		6.5.3 èªçºçãªãã£ã¹ããã
+		6.5.4 ãã£ã¹ãããã£ã®åä½éå§
+		6.5.5 ç¾å¨ã®ã³ã³ãã­ã¹ããæ¨ã¦ã¦ãã£ã¹ããã
+		6.5.6 ã¿ã¹ã¯ã®èµ·åæºå
+	6.6 å²è¾¼ã¿ãã³ãã©
+		6.6.1 å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦ç
+		6.6.2 å²è¾¼ã¿ãã³ãã©æ¯ã®åºå
+¥å£å¦çã®çæ
+		6.6.3 å²è¾¼ã¿ãã³ãã©ã®è¨­å®
+		6.6.4 å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ã®è¨­å®
+		6.6.5 å²è¾¼ã¿ç®¡çæ©è½ã®åæåå¦çã®å¤æ´
+		6.6.6 ããã©ã«ãã®å²è¾¼ã¿ãã³ãã©
+		6.6.7 ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿
+		6.6.8 å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®çæ
+	6.7 CPUä¾å¤ãã³ãã©ã¨CPUä¾å¤çºçæã®ã·ã¹ãã ç¶æ
+ã®åç
+§
+		6.7.1 CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦ç
+		6.7.2 CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦çã®çæ
+		6.7.3 CPUä¾å¤ãã³ãã©ã®è¨­å®
+		6.7.4 CPUä¾å¤ç®¡çæ©è½ã®åæåå¦çã®å¤æ´
+		6.7.5 ããã©ã«ãã®CPUä¾å¤ãã³ãã©
+		6.7.6 CPUä¾å¤çºçæã®ã·ã¹ãã ç¶æ
+ã®åç
+§
+	6.8 ã«ã¼ãã«ã®èµ·åã»çµäºã¨ã¹ã¿ãã¯é åãªã©
+	6.9 ã«ã¼ãã«å
+é¨ã®ãã¥ã¼ãã³ã°
+		6.9.1 ãããããããµã¼ã
+		6.9.2 ããããã£ã¼ã«ã
+	6.10 ã«ã¼ãã«å®è£
+ã«é¢ãããã®ä»ã®å®ç¾©
+		6.10.1 ãªãã¸ã§ã¯ãå±æ§ã®æ¡å¼µ
+		6.10.2 ã¨ã©ã¼ãã§ãã¯æ¹æ³ã®æå®
+		6.10.3 éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é å
+		6.10.4 ç©ºã©ãã«ã®å®ç¾©
+	6.11 ãã¬ã¼ã¹ã­ã°æ©è½ã«é¢ããè¨­å®
+		6.11.1 åå¾ã§ãããã¬ã¼ã¹ã­ã°ã®ç¨®é¡ã¨ãã¯ã­
+		6.11.2 ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ã
+	6.12 ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨ã®ããã®ãªãã¼ã è¨è¿°
+	6.13 é«åè§£è½ã¿ã¤ããã©ã¤ã
+		6.13.1 é«åè§£è½ã¿ã¤ããã©ã¤ãã®ãã¡ã¤ã«æ§æ
+		6.13.2 é«åè§£è½ã¿ã¤ãã®æä½ã¨å²è¾¼ã¿å¦ç
+		6.13.3 é«åè§£è½ã¿ã¤ããã©ã¤ãã®å®è£
+ã¢ãã­ã¼ã
+		6.13.4 ã¿ã¤ã ãã£ãã¯ãç¨ããã¿ã¤ããã©ã¤ãã®å®è£
+
+	6.14 ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ãï¼ãªãã·ã§ã³ï¼
+		6.14.1 ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ãã®ãã¡ã¤ã«æ§æ
+		6.14.2 ãªã¼ãã©ã³ã¿ã¤ãã®æä½ã¨å²è¾¼ã¿å¦ç
+	6.15 åçã¡ã¢ãªç®¡çï¼ãªãã·ã§ã³ï¼
+		6.15.1 TLSFãç¨ããã¡ã¢ãªç®¡çã¢ã¸ã¥ã¼ã«ã®ä¾
+ï¼ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿è¨­å®ãã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨
+	7.1 è¨­å®ãã¡ã¤ã«ã¨ã¿ã¼ã²ããä¾å­é¨ã®ä½ç½®ä»ã
+	7.2 ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨
+		7.2.1 ã¿ã¼ã²ããéä¾å­é¨ãã¤ã³ã¯ã«ã¼ãããåã«å®ç¾©ãã¹ãå¤æ°
+		7.2.2 ã¿ã¼ã²ããéä¾å­é¨ã§å®ç¾©ãããå¤æ°
+	7.3 ãã¹3ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨
+		7.3.1 ã¿ã¼ã²ããéä¾å­é¨ãã¤ã³ã¯ã«ã¼ãããåã«å®ç¾©ãã¹ãå¤æ°
+		7.3.2 ã¿ã¼ã²ããä¾å­é¨ã§è¡ãã¹ãã¨ã©ã¼ãã§ãã¯
+	7.4 cfg1_out.cã®ãªã³ã¯ã«å¿
+è¦ãªã¹ã¿ãã®å®ç¾©ãã¡ã¤ã«
+ï¼ï¼ã·ã¹ãã ãµã¼ãã¹ç­ã®ã¿ã¼ã²ããä¾å­é¨
+	8.0 ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­é¨
+	8.1 ã·ã¹ãã ã­ã°æ©è½ã®ã¿ã¼ã²ããä¾å­å®ç¾©
+	8.2 ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ã¿ã¼ã²ããä¾å­å®ç¾©
+	8.3 ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ã¿ã¼ã²ããä¾å­é¨
+		8.3.1 å¤æ°ï¼ãã¼ã¿åï¼ç®¡çé¢æ°
+		8.3.2 ããã¤ã¹ãµã¼ãã¹ã«ã¼ãã³
+		8.3.3 ã³ã¼ã«ããã¯ã«ã¼ãã³
+	8.4 ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºåã®ã¿ã¼ã²ããä¾å­å®ç¾©
+	8.5 ãµã³ãã«ãã­ã°ã©ã ã¨ãã¹ããã­ã°ã©ã ã®ã¿ã¼ã²ããä¾å­å®ç¾©
+	8.6 å®è¡æéåå¸éè¨ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­å®ç¾©
+ï¼ï¼ãã®ä»
+	9.1 ãã­ã¥ã¡ã³ã
+	9.2 ããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«
+ï¼ï¼ï¼ãªãã¡ã¬ã³ã¹
+	10.1 ã¿ã¼ã²ããä¾å­é¨ã®ãã¡ã¤ã«ä¸è¦§
+
+
+ï¼ï¼å
+±éäºé 
+
+
+1.1 ã¿ã¼ã²ããä¾å­é¨ã®æ§æ
+
+ã¿ã¼ã²ããä¾å­é¨ã¯ï¼targetãã£ã¬ã¯ããªã®ä¸ã«ï¼ã¿ã¼ã²ãããã¼ãã¦ã§ã¢ã¨
+éçºç°å¢ã®çµã¿åããæ¯ã«ç¨æããï¼ãã ãï¼ã¿ã¼ã²ããä¾å­é¨ã®åå©ç¨æ§ã
+èæ
+®ãï¼éçºç°å¢ï¼ãã­ã»ããµã³ã¢ï¼ãããã®ã¿ã«ä¾å­ããé¨åãï¼éçºç°å¢
+ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ã¨ããå½¢ã§åãåãã¦ãããï¼
+åãåãæ¹ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã®å®è£
+ã«ä»»ããã¦ããï¼éçºç°å¢ä¾å­é¨ï¼ã
+ã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ã¯ï¼archãã£ã¬ã¯ããªã®ä¸ã«ç½®ãï¼
+
+ASP3ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã¯ï¼ã·ã¹ãã æ§ç¯ç°å¢ã®ã¿ã¼ã²ããä¾å­é¨ï¼
+TOPPERSå
+±éå®ç¾©ã®ã¿ã¼ã²ããä¾å­é¨ï¼ã·ã¹ãã ã¤ã³ã¿ãã§ã¼ã¹ã¬ã¤ã¤ï¼SILï¼
+ã®ã¿ã¼ã²ããä¾å­é¨ï¼ã«ã¼ãã«APIã®ã¿ã¼ã²ããä¾å­é¨ï¼ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ã
+ãä¾å­é¨ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿è¨­å®ãã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨ãå«ãï¼ï¼ã·
+ã¹ãã ãµã¼ãã¹ç­ã®ã¿ã¼ã²ããä¾å­é¨ï¼ã¿ã¼ã²ããä¾å­é¨ã«é¢ãããã­ã¥ã¡ã³
+ãã§æ§æãããï¼
+
+1.1.1 ã¿ã¼ã²ããç¥ç§°ã¨ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããª
+
+æ°ããã¿ã¼ã²ããä¾å­é¨ãä½æããæã¯ï¼ã¾ãï¼ã¿ã¼ã²ããç¥ç§°ãå®ããï¼ã¿ã¼
+ã²ããç¥ç§°ã¯ï¼ã·ã¹ãã ç¥ç§°ã¨éçºç°å¢ç¥ç§°ã"_"ã§é£çµãããã®ã¨ããï¼ã·ã¹
+ãã ç¥ç§°ã«ç¨ããæå­ã¯è±å°æå­ã¨æ°å­ã¨"_"ã«ï¼éçºç°å¢ç¥ç§°ã«ç¨ããæå­ã¯
+è±å°æå­ã¨æ°å­ã«éå®ããï¼GNUéçºç°å¢ã®éçºç°å¢ç¥ç§°ã¯ï¼"gcc"ã¨ããï¼ä¾
+ãã°ï¼ã·ã¹ãã ç¥ç§°ã"ct11mpcore"ã§ï¼GNUéçºç°å¢ãç¨ããå ´åã«ã¯ï¼ã¿ã¼ã²ã
+ãç¥ç§°ã¯"ct11mpcore_gcc"ã¨ãªãï¼
+
+ã¿ã¼ã²ããä¾å­é¨ã®ãã¡ã¤ã«ãç½®ãããã«ï¼targetãã£ã¬ã¯ããªã®ä¸ã«ï¼ã¿ã¼
+ã²ããç¥ç§°ãåç§°ã¨ãããã£ã¬ã¯ããªãä½æããï¼ãããã¿ã¼ã²ããä¾å­é¨ãã£
+ã¬ã¯ããªã¨å¼ã¶ï¼
+
+1.1.2 éçºç°å¢ä¾å­é¨ãã£ã¬ã¯ããª
+
+ã¿ã¼ã²ããä¾å­é¨ããéçºç°å¢ä¾å­é¨ãåãåããå ´åã«ã¯ï¼archãã£ã¬ã¯ã
+ãªã®ä¸ã«ï¼éçºç°å¢ç¥ç§°ãåç§°ã¨ãããã£ã¬ã¯ããªãä½æããï¼ãããéçºç°
+å¢ä¾å­é¨ãã£ã¬ã¯ããªã¨å¼ã¶ï¼
+
+1.1.3 ãã­ã»ããµã³ã¢ä¾å­é¨ãã£ã¬ã¯ããª
+
+ã¿ã¼ã²ããä¾å­é¨ãããã­ã»ããµã³ã¢ä¾å­é¨ãåãåããå ´åã«ã¯ï¼ã¾ãï¼ã
+ã­ã»ããµã³ã¢ç¥ç§°ãå®ããï¼ãã­ã»ããµã³ã¢ç¥ç§°ã«ç¨ããæå­ã¯ï¼è±å°æå­ã¨
+æ°å­ã¨"_"ã«éå®ããï¼
+
+ãã­ã»ããµã³ã¢ä¾å­é¨ã®ãã¡ã¤ã«ãç½®ãããã«ï¼archãã£ã¬ã¯ããªã®ä¸ã«ï¼ã
+ã­ã»ããµã³ã¢ç¥ç§°ã¨éçºç°å¢ç¥ç§°ã"_"ã§é£çµãããã®ãåç§°ã¨ãããã£ã¬ã¯ã
+ãªãä½æããï¼ä¾ãã°ï¼ãã­ã»ããµã³ã¢ç¥ç§°ã"arm"ã§ï¼GNUéçºç°å¢ãç¨ãã
+å ´åã«ã¯ï¼ãã£ã¬ã¯ããªã®åç§°ã¯"arm_gcc"ã¨ãªãï¼
+
+ãããä¾å­é¨ãã£ã¬ã¯ããªããã­ã»ããµã³ã¢ä¾å­é¨ãã£ã¬ã¯ããªã®ä¸ã«ç½®ãå ´
+åï¼ã1.1.4 ãããä¾å­é¨ãã£ã¬ã¯ããªãã®ç¯ã®(1)ã®å ´åï¼ãé¤ãã¦ã¯ï¼ãã
+ããã­ã»ããµã³ã¢ä¾å­é¨ãã£ã¬ã¯ããªã¨å¼ã¶ï¼
+
+1.1.4 ãããä¾å­é¨ãã£ã¬ã¯ããª
+
+ã¿ã¼ã²ããä¾å­é¨ãããããä¾å­é¨ãåãåããå ´åã«ã¯ï¼ã¾ãï¼ãããç¥ç§°
+ãå®ããï¼ãããç¥ç§°ã«ç¨ããæå­ã¯ï¼è±å°æå­ã¨æ°å­ã¨"_"ã«éå®ããï¼
+
+ãããä¾å­é¨ã®ãã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªï¼ããããããä¾å­é¨ãã£ã¬ã¯ã
+ãªã¨å¼ã¶ï¼ã¯ï¼ãã®ç½®ãå ´æã«ãã£ã¦ï¼æ¬¡ã®2ã¤æ¹æ³ãããï¼
+
+(1) ãã­ã»ããµã³ã¢ä¾å­é¨ãã£ã¬ã¯ããªã®ä¸ã«ç½®ã
+
+ãããä¾å­é¨ãã£ã¬ã¯ããªãï¼ãã­ã»ããµã³ã¢ä¾å­é¨ãã£ã¬ã¯ããªã®ä¸ã«ç½®ã
+å ´åã«ã¯ï¼ãããç¥ç§°ããã£ã¬ã¯ããªã®åç§°ã¨ããï¼
+
+ãã®æ¹æ³ãåãå ´åï¼ãã­ã»ããµã³ã¢ã®ã¿ã«ä¾å­ãããã¡ã¤ã«ã¯ï¼ãã­ã»ããµ
+ã³ã¢ä¾å­é¨ãã£ã¬ã¯ããªã®ç´ä¸ã«ã¯ç½®ããï¼ãã­ã»ããµã³ã¢ä¾å­é¨ãã£ã¬ã¯ã
+ãªã®ä¸ã«"common"ã¨ããåç§°ã®ãã£ã¬ã¯ããªãä½æãï¼ãã®ä¸ã«ç½®ãï¼ãã®å ´
+åã«ã¯ï¼ãã­ã»ããµã³ã¢ã®ã¿ã«ä¾å­ãããã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªãï¼ãã­
+ã»ããµã³ã¢ä¾å­é¨ãã£ã¬ã¯ããªã¨å¼ã¶ï¼
+
+ä¾ãã°ï¼ãã­ã»ããµã³ã¢ç¥ç§°ã"arm"ï¼ãããç¥ç§°ã"mpcore"ã§ï¼GNUéçºç°å¢
+ãç¨ããå ´åã«ã¯ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ãã£ã¬ã¯ããªã¯
+arch/arm_gcc/commonï¼ãããä¾å­é¨ãã£ã¬ã¯ããªã¯arch/arm_gcc/mpcoreã¨ãª
+ãï¼
+
+(2) archãã£ã¬ã¯ããªã®ç´ä¸ã«ç½®ã
+
+ãããä¾å­é¨ãã£ã¬ã¯ããªãï¼archãã£ã¬ã¯ããªã®ç´ä¸ã«ç½®ãå ´åã«ã¯ï¼ãã
+ãç¥ç§°ã¨éçºç°å¢ç¥ç§°ã"_"ã§é£çµãããã®ãï¼ãã£ã¬ã¯ããªã®åç§°ã¨ããï¼
+
+1.2 ååã®è¡çªã®é²æ­¢
+
+TOPPERSãã­ã¸ã§ã¯ããæä¾ããã½ããã¦ã§ã¢ã®ããã«ï¼TOPPERS_ã§å§ã¾ãã·ã³
+ãã«ãäºç´ãã¦ããï¼ããããã¡ã¤ã«ä¸­ã«è¨è¿°ããï¼ã¢ããªã±ã¼ã·ã§ã³ããå
+ç
+§ã§ããå
+é¨ã·ã³ãã«ã¯ï¼TOPPERS_ã§å§ã¾ãååã¨ããï¼
+
+ã¾ãï¼_kernel_ã§å§ã¾ãã·ã³ãã«ã¯ï¼ã«ã¼ãã«å
+é¨ã®å¤æ°ãé¢æ°ã®ããã«äºç´
+ãã¦ããï¼ã«ã¼ãã«å
+é¨ã®å¤æ°ãé¢æ°ã®ååã§ï¼ãªã³ã¯æã«ã¢ããªã±ã¼ã·ã§ã³
+ã®ååã¨è¡çªããå¯è½æ§ããããã®ã¯ï¼ãªãã¼ã è¨è¿°ã«ãªã¹ãã¢ãããããã¨
+ã§ï¼ã³ã³ãã¤ã«æã«_kernel_ã§å§ã¾ãååã«ç½®ãæãããã¨ã¨ãã¦ããï¼
+
+1.3 ããããã¡ã¤ã«ã®è¨è¿°ã«ã¼ã«
+
+ããããã¡ã¤ã«ã¯ï¼ãã®ç¯ã®ã«ã¼ã«ã«å¾ã£ã¦è¨è¿°ããªããã°ãªããªãï¼ãªãï¼
+ãã®ç¯ã®è¨è¿°å
+å®¹ã¯ï¼æ¬æ¥ã¯ã³ã¼ãã£ã³ã°ã«ã¼ã«ã«å«ããã¹ãå
+å®¹ã§ããï¼
+
+1.3.1 ããããã¡ã¤ã«ã®èªå·±å®çµ
+
+ããããã¡ã¤ã«ã¯ï¼èªå·±å®çµããããã«ï¼å¿
+è¦ãªä»ã®ããããã¡ã¤ã«ãã¤ã³ã¯
+ã«ã¼ãããã®ãååã¨ããï¼è¨ãæããã¨ï¼ããããã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãã
+ãåã«ï¼ä»ã®ããããã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ããã¦ãããã¨ãä»®å®ãã¦ã¯ãªããª
+ãï¼
+
+1.3.2 å¤éã¤ã³ã¯ã«ã¼ãã¸ã®å¯¾å¿
+
+ããããã¡ã¤ã«ã«ã¯ï¼å¤éã«ã¤ã³ã¯ã«ã¼ãããã¦ãåé¡ãªãããã«ããããã®
+æ¡ä»¶ã³ã³ãã¤ã«è¨è¿°ãå«ãããã®ã¨ããï¼ä¾ãã°ï¼target_kernel_impl.hã§ã
+ãã°ï¼ãã¡ã¤ã«ã®å
+é ­ã«
+
+#ifndef TOPPERS_TARGET_KERNEL_IMPL_H
+#define TOPPERS_TARGET_KERNEL_IMPL_H
+
+ãï¼ãã¡ã¤ã«ã®æ«å°¾ã«
+
+#endif /* TOPPERS_TARGET_KERNEL_IMPL_H */
+
+ãè¨è¿°ããï¼
+
+1.3.3 ã¢ã»ã³ããªè¨èªã¨ã®ããããã¡ã¤ã«ã®å
+±ç¨
+
+ããããã¡ã¤ã«ã®ä¸­ã§ï¼ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã¤ã³ã¯ã«ã¼ã
+ãããå¯è½æ§ã®ãããã®ã¯ï¼æ¬¡ã®ã«ã¼ã«ã«å¾ã£ã¦è¨è¿°ãããã®ã¨ããï¼
+
+ã»TOPPERS_MACRO_ONLYããã¯ã­å®ç¾©ããã¦ããå ´åã«ã¯ï¼ã¢ã»ã³ããªè¨èªã§ã¯
+ãè§£éã§ããªãè¨è¿°ï¼ãã¯ã­å®ç¾©ä»¥å¤ã®è¨è¿°ï¼ãé¤ãããã«è¨è¿°ããï¼
+
+ã»ç¬¦å·ç¡ãæ´æ°åã®å®æ°å¤ã¯ï¼UINT_CãULONG_Cãªã©ã®æ´æ°å®æ°ãä½ãããã®ã
+ãã¯ã­ãç¨ãã¦è¨è¿°ããï¼ãã ãï¼ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã¤
+ãã³ã¯ã«ã¼ãããããã¡ã¤ã«ä¸­ã§ãã£ã¦ãï¼Cè¨èªã®ã¿ã§ç¨ããå®æ°ã¯ï¼ããã
+ãã®ãã¯ã­ãä½¿ã£ã¦è¨è¿°ããå¿
+è¦ã¯ãªãï¼
+
+ã»ã¢ã»ã³ããªè¨èªãããç¨ããå®æ°ã®å®ç¾©ä¸­ã«åã­ã£ã¹ããç¨ããå ´åã«ã¯ï¼
+ãCASTãã¯ã­ãç¨ãã¦è¨è¿°ããï¼
+
+ã¢ã»ã³ããªè¨èªããããããã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããéã«ã¯ï¼å¿
+è¦ã«å¿ãã¦ï¼
+TOPPERS_MACRO_ONLYï¼UINT_Cï¼ULONG_Cï¼CASTããã¯ã­å®ç¾©ãã¦ããï¼ã¤ã³ã¯ã«ã¼
+ãããªããã°ãªããªãï¼
+
+1.4 ã¤ã³ã¯ã«ã¼ãè¨è¿°ã®æ¹æ³
+
+éçºç°å¢ã§ç¨æããã¦ããæ¨æºããããã¡ã¤ã«ããã³includeãã£ã¬ã¯ããªä¸ã®
+æ¨æºããããã¡ã¤ã«ã¯ï¼ã#include <...>ãã«ããã¤ã³ã¯ã«ã¼ãããï¼
+
+ãã®ä»ã®ããããã¡ã¤ã«ã¯ï¼ã#include "..."ãã«ããã¤ã³ã¯ã«ã¼ãããï¼ãã
+ããã¡ã¤ã«ãï¼ã«ã¬ã³ããã£ã¬ã¯ããªãã¤ã³ã¯ã«ã¼ããããã¡ã¤ã«ã¨åããã£
+ã¬ã¯ããªä»¥å¤ã®ãã£ã¬ã¯ããªã«ç½®ããã¦ããå ´åã«ã¯ï¼æ¬¡ã®ããã«ãã¹æå®ã
+è¡ãï¼
+
+ã»ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããªï¼éçºç°å¢ä¾å­é¨ãã£ã¬ã¯ããªï¼ãã­ã»ããµ
+ãã³ã¢ä¾å­é¨ãã£ã¬ã¯ããªï¼ãããä¾å­é¨ãã£ã¬ã¯ããªã«ç½®ããã¦ããå ´åã¯ï¼
+ããã¹æå®ãè¡ããï¼ãã¡ã¤ã«åã®ã¿ãè¨è¿°ããï¼
+		ä¾ï¼#include "target_kernel_impl.h"
+		ä¾ï¼#include "core_kernel_impl.h"
+		ä¾ï¼#include "tool_stddef.h"
+
+ãããã¯ï¼ã³ã³ãã¤ã©ã«ä¸ãã-Iãªãã·ã§ã³ã«ããï¼ã¤ã³ã¯ã«ã¼ããããã¡ã¤
+ãã«ãå¶å¾¡ã§ããããã«ããããã§ããï¼
+
+ã»ãã®ä»ã®ãã£ã¬ã¯ããªã«ç½®ããã¦ããå ´åã«ã¯ï¼ã½ã¼ã¹ãã­ã°ã©ã ã®ã«ã¼ã
+ããã£ã¬ã¯ããªï¼configureãç½®ããã¦ãããã£ã¬ã¯ããªï¼ããã®ç¸å¯¾ãã¹ã§è¨
+ãè¿°ããï¼
+		ä¾ï¼#include "arch/logtrace/trace_config.h"
+
+ã»ã«ã¼ãã«ãæ§æãããã¡ã¤ã«ããï¼kernelãã£ã¬ã¯ããªä¸ã®ããããã¡ã¤ã«
+ããã¤ã³ã¯ã«ã¼ãããå ´åã¯ï¼ãã¹æå®ãè¡ããï¼ãã¡ã¤ã«åã®ã¿ãè¨è¿°ããï¼
+		ä¾ï¼#include "kernel_impl.h"
+
+1.5 ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã®å®ç¾ã«é¢ããå¶ç´
+
+ã«ã¼ãã«å
+ã§ç¨ããã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çãå®ç¾ããå ´åã«ã¯ï¼
+æ¬¡ã®2ã¤ã®æ¡ä»¶ãæºããããã«å®è£
+ããªããã°ãªããªãï¼
+
+(1-5-1) åºå
+¥å¦çããæããæç¹ã§ã¯ï¼å²è¾¼ã¿ã®ç¦æ­¢ï¼è¨±å¯ãå®äºãã¦ããªã
+ãã°ãªããªãï¼ä¾ãã°ï¼å²è¾¼ã¿ç¦æ­¢ï¼è¨±å¯å½ä»¤ãå®è¡ãã¦ããå®éã«å²è¾¼ã¿ã
+ç¦æ­¢ï¼è¨±å¯ãããã¾ã§ä½å½ä»¤ãé
+å»¶ãããã­ã»ããµã®å ´åã«ã¯ï¼åºå
+¥å¦çã®ä¸­
+ã«NOPå½ä»¤ãå
+¥ãããªã©ã®æ¹æ³ã§ï¼åºå
+¥å¦çãæããæç¹ã§ã¯ï¼å²è¾¼ã¿ãç¦æ­¢ï¼
+è¨±å¯ãããç¶æ
+ã«ãªã£ã¦ãããã¨ãä¿è¨¼ããªããã°ãªããªãï¼
+
+(1-5-2) ã¡ã¢ãªä¸ã®ãã¼ã¿æ§é ãæ¸ãå¤ããå¯è½æ§ããããã¨ãï¼ä½ããã®æ¹
+æ³ã§ã³ã³ãã¤ã©ã«ç¥ãããªããã°ãªããªãï¼GNUéçºç°å¢ã§ã¯ï¼æ¬¡ã®ããããã®
+æ¹æ³ã§ãã®å¶ç´ãæºãããã¨ãã§ããï¼
+
+(a) ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã®å
+¨ä½ã¾ãã¯åºå
+¥å¦çã®æ¬è³ªçãªé¨å
+	ï¼å
+·ä½çã«ã¯ï¼å²è¾¼ã¿ç¦æ­¢ï¼è¨±å¯ããå¦çï¼ãï¼ã¤ã³ã©ã¤ã³ã§ãªãï¼éå¸¸
+	ã®é¢æ°ã«ããå®ç¾ããï¼
+
+(b) ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã®æ¬è³ªçãªé¨åãã¤ã³ã©ã¤ã³ã¢ã»ã³ã
+	ã©ã«ãã£ã¦å®ç¾ãã¦ããå ´åã«ã¯ï¼ãã®ã¤ã³ã©ã¤ã³ã¢ã»ã³ãã©ã®clobberå¤
+	æ°ãªã¹ãã«"memory"ãè¿½å ããï¼
+
+(c) ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã®æ¬è³ªçãªé¨åãï¼ãã¯ã­ãã¤ã³ã©ã¤
+	ã³é¢æ°å¼åºãã§å®ç¾ãã¦ããå ´åã«ã¯ï¼ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã«å
+¥ãå¦
+	çã®æå¾ã¨åºãå¦çã®å
+é ­ã«ï¼Asm("":::"memory")ã¨ããè¨è¿°ãå
+¥ããï¼
+
+ãã®ãããªå¶ç´ãè¨­ããçç±ã«ã¤ãã¦ã¯ï¼ãTOPPERS/ASP3ã«ã¼ãã« è¨­è¨ã¡ã¢ã
+ã®ãã«ã¼ãã«ã®ãã¼ã¿æ§é ã«å¯¾ããvolatileå®£è¨ã«ã¤ãã¦ãã®ç¯ãåç
+§ããã
+ã¨ï¼
+
+
+ï¼ï¼ã·ã¹ãã æ§ç¯ç°å¢ã®ã¿ã¼ã²ããä¾å­é¨
+
+ãã®ç« ã®èª¬æã¯ï¼GNUéçºç°å¢ï¼GCCï¼GASï¼BINUTILSï¼GNU Makeï¼ãç¨ãããã¨
+ãæ³å®ãã¦è¨è¿°ãã¦ããï¼ããä»¥å¤ã®éçºç°å¢ãç¨ããå ´åã«ã¯ï¼éçºç°å¢ã«
+ãããã¦ä¿®æ­£ããå¿
+è¦ãããï¼
+
+GNUéçºç°å¢ç¨ã®ã·ã¹ãã æ§ç¯ç°å¢ã¯ï¼ãµã³ãã«ã®Makefileï¼sample/Makefileï¼ï¼
+ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããï¼configureï¼ã§æ§æãããï¼
+
+GNUéçºç°å¢ä»¥å¤ã®éçºç°å¢ãç¨ããå ´åã«ã¯ï¼ãããã®ãã¡ã¤ã«ãï¼ãã®éçº
+ç°å¢ç¨ã«ç¨æããå¿
+è¦ãããå ´åãããï¼ãã®å ´åã«ã¯ï¼ãããã®ãã¡ã¤ã«ãï¼
+ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããªãéçºç°å¢ä¾å­é¨ãã£ã¬ã¯ããªã«ç½®ããã®ã¨ã
+ãï¼ã¾ãï¼éçºç°å¢ç¨ã®ãã­ã¸ã§ã¯ããã¡ã¤ã«ãå¿
+è¦ãªå ´åã«ã¯ï¼ã¿ã¼ã²ãã
+ä¾å­é¨ãã£ã¬ã¯ããªã«ç½®ããã®ã¨ããï¼
+
+ãµã³ãã«ã®Makefileã¯ï¼ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããªã®Makefile.targetãã¤
+ã³ã¯ã«ã¼ãããï¼Makefileã®ã¿ã¼ã²ããä¾å­é¨ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯
+ããªã®Makefile.targetã¾ãã¯ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼éçºç°å¢
+ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ã§ç¨æããããã¡ã¤ã«ãªã©ï¼ã«
+å«ããï¼ä»¥ä¸ã§ã¯ï¼Makefileã®ã¿ã¼ã²ããä¾å­é¨ã«è¨è¿°ãã¹ãå
+å®¹ã«ã¤ãã¦èª¬
+æããï¼
+
+2.1 ã·ã¹ãã ç¥ç§°ã»éçºç°å¢ç¥ç§°ç­ã®è¨­å®
+
+ã·ã¹ãã ç¥ç§°ï¼éçºç°å¢ç¥ç§°ï¼ãã­ã»ããµã³ã¢ç¥ç§°ï¼ãããç¥ç§°ãè¨­å®ããã
+ãã«ï¼Makefileã®ã¿ã¼ã²ããä¾å­é¨ã§æ¬¡ã®å¤æ°ãå®ç¾©ããï¼ãªãï¼ã¿ã¼ã²ãã
+ç¥ç§°ã¯ï¼ã¿ã¼ã²ããéä¾å­ã®Makefileã«ããã¦ï¼å¤æ°TARGETã«å®ç¾©ããã¦ãã
+ãã¨ãæ³å®ããï¼
+
+(2-1-1) SYS						ã·ã¹ãã ç¥ç§°
+
+ã·ã¹ãã ç¥ç§°ã«å®ç¾©ããï¼
+
+(2-1-2) TOOL					éçºç°å¢ç¥ç§°
+
+éçºç°å¢ä¾å­é¨ãç¨ããå ´åã«ã¯ï¼éçºç°å¢ç¥ç§°ã«å®ç¾©ããï¼GNUéçºç°å¢ãç¨
+ããå ´åã«ã¯ï¼gccã«å®ç¾©ããï¼
+
+(2-1-3) CORE					ãã­ã»ããµã³ã¢ç¥ç§°
+(2-1-4) CHIP					ãããç¥ç§°
+
+ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ãç¨ããå ´åã«ã¯ï¼ããããï¼ãã­ã»ã
+ãµã³ã¢ç¥ç§°ï¼ãããç¥ç§°ã«å®ç¾©ããï¼
+
+2.2 ä¾å­é¨ãã£ã¬ã¯ããªã®è¨­å®
+
+éçºç°å¢ä¾å­é¨ãã£ã¬ã¯ããªï¼ãã­ã»ããµã³ã¢ä¾å­é¨ãã£ã¬ã¯ããªï¼ãããä¾
+å­é¨ãã£ã¬ã¯ããªãè¨­å®ããããã«ï¼Makefileã®ã¿ã¼ã²ããä¾å­é¨ã§æ¬¡ã®å¤æ°
+ãå®ç¾©ããï¼
+
+ãªãï¼ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããªã¯ï¼ã¿ã¼ã²ããéä¾å­ã®Makefileã«ãã
+ã¦ï¼å¤æ°TARGETDIRã«å®ç¾©ããã¦ãããã¨ãæ³å®ããï¼ã¾ãï¼ã½ã¼ã¹ãã­ã°ã©ã 
+ã®ã«ã¼ããã£ã¬ã¯ããªï¼configureãç½®ããã¦ãããã£ã¬ã¯ããªï¼ã¯ï¼å¤æ°
+SRCDIRã«å®ç¾©ããã¦ãããã¨ãæ³å®ããï¼
+
+(2-2-1) TOOLDIR					éçºç°å¢ä¾å­é¨ãã£ã¬ã¯ããª
+(2-2-2) COREDIR					ãã­ã»ããµã³ã¢ä¾å­é¨ãã£ã¬ã¯ããª
+(2-2-3) CHIPDIR					ãããä¾å­é¨ãã£ã¬ã¯ããª
+
+éçºç°å¢ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ãç¨ããå ´åã«ã¯ï¼ã
+ãããï¼éçºç°å¢ä¾å­é¨ãã£ã¬ã¯ããªï¼ãã­ã»ããµã³ã¢ä¾å­é¨ãã£ã¬ã¯ããªï¼
+ãããä¾å­é¨ãã£ã¬ã¯ããªã«å®ç¾©ããï¼
+
+2.3 ã³ãã³ãåã®è¨­å®
+
+(2-3-1) GCC_TARGET				GNUéçºç°å¢ã®ã¿ã¼ã²ããå
+
+GNUéçºç°å¢ãç¨ããå ´åã«ï¼GNUéçºç°å¢ãconfigureããå ´åã«æå®ããã¿ã¼
+ã²ããåã«å®ç¾©ããï¼ããã§æå®ããã¿ã¼ã²ããåã¯ï¼éçºç°å¢ã®ã³ãã³ãå
+ã®å
+é ­ã«ä»ä¸ãããæå­åã¨ãªãï¼ä¾ãã°ï¼GCC_TARGETãarm-none-eabiã«å®ç¾©
+ããå ´åã«ã¯ï¼ã³ã³ãã¤ã©ã¨ãã¦arm-none-eabi-gccãä½¿ãããï¼ãã®å¤æ°ãå®
+ç¾©ãããªãå ´åã«ã¯ï¼åãªãgccãä½¿ãããï¼
+
+(2-3-2) CC						Cã³ã³ãã¤ã©ãã©ã¤ãã®åç§°
+(2-3-3) CXX						C++ã³ã³ãã¤ã©ãã©ã¤ãã®åç§°
+(2-3-4) AS						ã¢ã»ã³ãã©ã®åç§°
+(2-3-5) LD						ãªã³ã«ã®åç§°
+(2-3-6) AR						ã¢ã¼ã«ã¤ãã®åç§°
+(2-3-7) NM						nmãã­ã°ã©ã ã®åç§°
+(2-3-8) RANLIB					ranlibãã­ã°ã©ã ã®åç§°
+(2-3-9) OBJCOPY					objcopyãã­ã°ã©ã ã®åç§°
+(2-3-10) OBJDUMP				objdumpãã­ã°ã©ã ã®åç§°
+
+GNUéçºç°å¢ä»¥å¤ã®éçºç°å¢ãç¨ããå ´åã«ï¼ããããã®ã³ãã³ãã®åç§°ã«å®ç¾©
+ããï¼å¯¾å¿ããã³ãã³ãããªãå ´åãï¼ã³ãã³ããã©ã¡ã¼ã¿ãç°ãªãå ´åã«ã¯ï¼
+Makefileä¸­ã§ãã®ã³ãã³ããå¼ã³åºãã¦ããé¨åãå¤æ´ããå¿
+è¦ãããï¼
+
+GNUéçºç°å¢ã§ã¯ï¼ãããã¯GCC_TARGETãç¨ãã¦å®ç¾©ãããã®ã§ï¼å®ç¾©ããå¿
+è¦
+ã¯ãªãï¼
+
+2.4 ã³ã³ãã¤ã«ãªãã·ã§ã³ã¨ãªãã¸ã§ã¯ããã¡ã¤ã«ã®è¨­å®
+
+Makefileã®ã¿ã¼ã²ããä¾å­é¨ã§ä»¥ä¸ã§èª¬æããå¤æ°ãå®ç¾©ããæã«ã¯ï¼":="ã
+ç¨ãã¦ï¼ããã¾ã§ã®å®ç¾©ã«è¿½å ããå½¢ã§è¡ãï¼ä¾ãã°ï¼ã³ã³ãã¤ã©ã«å¯¾ããã
+ã®ä»ã®ãªãã·ã§ã³ã¨ãã¦ã-Wall -g -O2ããè¿½å ãããå ´åã«ã¯ï¼ãCOPTS :=
+$(COPTS) -Wall -g -O2ãã¨ããè¨è¿°ãMakefileã®ã¿ã¼ã²ããä¾å­é¨ã«å«ããï¼
+
+(2-4-1) COPTS				ã³ã³ãã¤ã©ã«å¯¾ãããã®ä»ã®ãªãã·ã§ã³
+(2-4-2) CDEFS				ãã¯ã­å®ç¾©ãªãã·ã§ã³ï¼-Dãªãã·ã§ã³ï¼
+(2-4-3) INCLUDES			ããããã¡ã¤ã«ã®ç½®ããããã£ã¬ã¯ããªæå®ãª
+							ãã·ã§ã³ï¼-Iãªãã·ã§ã³ï¼
+(2-4-4) LDFLAGS				ãªã³ã«ã«å¯¾ãããã®ä»ã®ãªãã·ã§ã³
+(2-4-5) LIBS				ã©ã¤ãã©ãªãªã³ã¯æå®ã®ããã®ãªãã·ã§ã³
+
+ã¿ã¼ã²ããã«ä¾å­ãã¦ï¼ãã¹ã¦ã®ã½ã¼ã¹ãã¡ã¤ã«ã«å
+±éããã³ã³ãã¤ã«ãªãã·ã§
+ã³ã®è¿½å ãå¿
+è¦ãªå ´åã«ã¯ï¼ãªãã·ã§ã³ã®ç¨®é¡æ¯ã«ä¸ã«ç¤ºããå¤æ°ã«å®ç¾©ããï¼
+
+ã»ã¨ãã©ã®å ´åã«ï¼ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããªã®Makefile.targetã«ã¯ï¼ä»¥
+ä¸ã®è¨è¿°ãå«ããå¿
+è¦ãããï¼
+
+----------------------------------------
+INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(TOOLDIR)
+----------------------------------------
+
+ã³ã³ãã¤ã©ã®åé¡ç­ã§ï¼è­¦åã¡ãã»ã¼ã¸ãåºããã¨ãé²ããªãç¶æ³ä»¥å¤ã§ã¯ï¼
+COPTSã«-Werrorãè¿½å ãããã¨ãæ¨å¥¨ããï¼
+
+----------------------------------------
+COPTS := $(COPTS) -Werror
+----------------------------------------
+
+ã«ã¼ãã«ã®ã³ã³ãã¤ã«æã«ï¼dereferencing type-punned pointer will break
+strict-aliasing rulesã¨ããè­¦åãåºãå ´åã«ã¯ï¼ä»¥ä¸ãè¿½å ããã¨ããï¼ã
+ã®è­¦åã¡ãã»ã¼ã¸ã«é¢ããè©³ç´°ã¯ï¼ãTOPPERS/ASP3ã«ã¼ãã« è¨­è¨ã¡ã¢ãã®ãå
+ã­ã£ã¹ãã«ä¼´ãè­¦åã¡ãã»ã¼ã¸ãã®ç¯ãåç
+§ãããã¨ï¼
+
+----------------------------------------
+KERNEL_CFLAGS := $(KERNEL_CFLAGS) -fno-strict-aliasing
+----------------------------------------
+
+ã¾ãï¼ã¢ã»ã³ããªè¨èªã¬ãã«ã®è­å¥åãï¼Cè¨èªã¬ãã«ã®è­å¥åã®å
+é ­ã«"_"ã
+ä»ãããã®ã«ãªãå ´åã«ã¯ï¼CDEFSã«-DTOPPERS_LABEL_ASMãè¿½å ããï¼
+
+(2-4-6) SYSSVC_DIRS			ã·ã¹ãã ãµã¼ãã¹ã®ã½ã¼ã¹ãç½®ããããã£ã¬ã¯ããª
+(2-4-7) SYSSVC_ASMOBJS		ã¢ã»ã³ããªè¨èªã§è¨è¿°ãããã·ã¹ãã ãµã¼ãã¹ã®
+							ãªãã¸ã§ã¯ã
+(2-4-8) SYSSVC_COBJS		Cè¨èªã§è¨è¿°ãããã·ã¹ãã ãµã¼ãã¹ã®ãªãã¸ã§ã¯ã
+(2-4-9) SYSSVC_CFLAGS		ã·ã¹ãã ãµã¼ãã¹ã«å¯¾ããã³ã³ãã¤ã«ãªãã·ã§ã³
+
+ã¿ã¼ã²ããã«ä¾å­ãã¦ï¼ã·ã¹ãã ãµã¼ãã¹ï¼ã·ã¹ãã ã­ã°ã¿ã¹ã¯ãããã¤ã¹ã
+ã©ã¤ããªã©ï¼ã®ã½ã¼ã¹ãç½®ããããã£ã¬ã¯ããªï¼ã·ã¹ãã ãµã¼ãã¹ãæ§æãã
+ãªãã¸ã§ã¯ããã¡ã¤ã«ã®ãªã¹ãï¼ããããã³ã³ãã¤ã«ããéã«é©ç¨ããã³ã³ã
+ã¤ã«ãªãã·ã§ã³ãè¿½å ããå ´åã«ã¯ï¼ä¸ã«ç¤ºããå¤æ°ã«å®ç¾©ããï¼ãªãï¼
+SYSSVC_CFLAGSã«å®ç¾©ãããªãã·ã§ã³ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãçæãããã¡ã¤
+ã«ãã³ã³ãã¤ã«ããå ´åã«ã¯é©ç¨ãããªãããï¼æ³¨æãããã¨ï¼
+
+(2-4-10) KERNEL_DIRS		ã«ã¼ãã«ã®ã½ã¼ã¹ãç½®ããããã£ã¬ã¯ããª
+(2-4-11) KERNEL_ASMOBJS		ã¢ã»ã³ããªè¨èªã§è¨è¿°ãããã«ã¼ãã«ã®ãªãã¸ã§ã¯ã
+(2-4-12) KERNEL_COBJS		Cè¨èªã§è¨è¿°ãããã«ã¼ãã«ã®ãªãã¸ã§ã¯ã
+(2-4-13) KERNEL_CFLAGS		ã«ã¼ãã«ã«å¯¾ããã³ã³ãã¤ã«ãªãã·ã§ã³
+
+ã¿ã¼ã²ããã«ä¾å­ãã¦ï¼ã«ã¼ãã«ã®ã½ã¼ã¹ãç½®ããããã£ã¬ã¯ããªï¼ã«ã¼ãã«
+ãæ§æãããªãã¸ã§ã¯ããã¡ã¤ã«ã®ãªã¹ãï¼ããããã³ã³ãã¤ã«ããéã«é©ç¨
+ããã³ã³ãã¤ã«ãªãã·ã§ã³ãè¿½å ããå ´åã«ã¯ï¼ä¸ã«ç¤ºããå¤æ°ã«å®ç¾©ããï¼
+
+ã»ã¨ãã©ã®å ´åã«ï¼ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããªã®Makefile.targetã«ã¯ï¼ä»¥
+ä¸ã®è¨è¿°ãå«ããå¿
+è¦ãããï¼
+
+----------------------------------------
+KERNEL_DIRS := $(KERNEL_DIRS) $(TARGETDIR)
+KERNEL_ASMOBJS := $(KERNEL_ASMOBJS) target_support.o
+KERNEL_COBJS := $(KERNEL_COBJS) target_kernel_impl.o target_timer.o
+----------------------------------------
+
+(2-4-14) OBJ_LDFLAGS		ã«ã¼ãã«ã«å¯¾ãããªã³ã¯ãªãã·ã§ã³
+
+ã¿ã¼ã²ããã«ä¾å­ãã¦ï¼ã«ã¼ãã«ããªã³ã¯ããéã«é©ç¨ãããªãã·ã§ã³ãè¿½å 
+ããå ´åã«ã¯ï¼ä¸ã«ç¤ºããå¤æ°ã«å®ç¾©ããï¼LDFLAGSã¨ç°ãªãï¼ãã®å¤æ°ã«è¿½å 
+ãããªãã·ã§ã³ã¯ï¼cfg1_out.cããªã³ã¯ããéã«ã¯é©ç¨ãããªãï¼
+
+(2-4-15) CFG_TABS			ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«å¯¾ãããªãã·ã§ã³
+
+ã¿ã¼ã²ããã«ä¾å­ãã¦ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«å¯¾ãããªãã·ã§ã³ãè¿½å ããå ´
+åã«ã¯ï¼ä¸ã«ç¤ºããå¤æ°ã«å®ç¾©ããï¼å
+·ä½çã«ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®å¤å
+å¾ã·ã³ãã«ãã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ï¼target_def.csvï¼ãããå ´åã«ã¯ï¼
+ãããæå®ãããªãã·ã§ã³ãè¿½å ããå¿
+è¦ãããï¼
+
+ã»ã¨ãã©ã®å ´åã«ï¼ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããªã®Makefile.targetã«ã¯ï¼ä»¥
+ä¸ã®è¨è¿°ãå«ããå¿
+è¦ãããï¼
+
+----------------------------------------
+CFG_TABS := $(CFG_TABS) --cfg1-def-table $(TARGETDIR)/target_def.csv
+----------------------------------------
+
+(2-4-16) CFG1_OUT_LDFLAGS	cfg1_out.cã«å¯¾ãããªã³ã¯ãªãã·ã§ã³
+
+ã¿ã¼ã²ããã«ä¾å­ãã¦ï¼cfg1_out.cããªã³ã¯ããéã«é©ç¨ãããªãã·ã§ã³ãè¿½
+å ããå ´åã«ã¯ï¼ä¸ã«ç¤ºããå¤æ°ã«å®ç¾©ããï¼LDFLAGSã¨ç°ãªãï¼ãã®å¤æ°ã«è¿½
+å ãããªãã·ã§ã³ã¯ï¼ã«ã¼ãã«ããªã³ã¯ããéã«ã¯é©ç¨ãããªãï¼
+
+(2-4-17) CFG_ASMOBJS		ã¢ã»ã³ããªè¨èªã§è¨è¿°ãããã·ã¹ãã ã³ã³ãã£
+							ã®ã¥ã¬ã¼ã·ã§ã³ã®ããã®ãªãã¸ã§ã¯ã
+(2-4-18) CFG_COBJS			Cè¨èªã§è¨è¿°ãããã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼
+							ã·ã§ã³ã®ããã®ãªãã¸ã§ã¯ã
+
+ã¿ã¼ã²ããã«ä¾å­ãã¦ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã®ããã®ãªãã¸ã§ã¯
+ããã¡ã¤ã«ãï¼kernel_cfg.oä»¥å¤ã«ï¼è¿½å ããå ´åã«ã¯ï¼ä¸ã«ç¤ºããå¤æ°ã«å®
+ç¾©ããï¼ãã®å ´åï¼è¿½å ãããªãã¸ã§ã¯ããã¡ã¤ã«ã®ä½æã«ã¼ã«ï¼ã³ã³ãã¤ã«ï¼
+ã¢ã»ã³ãã«ã«ã¼ã«ã¨ä¾å­é¢ä¿ä½æã«ã¼ã«ï¼ãï¼Makefileã®ã¿ã¼ã²ããä¾å­é¨ã«
+è¨è¿°ããå¿
+è¦ãããï¼
+
+(2-4-19) CFG2_OUT_SRCS
+
+ã¿ã¼ã²ããã«ä¾å­ãã¦ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹2ã§kernel_cfg.cã¨
+kernel_cfg.hä»¥å¤ã®ãã¡ã¤ã«ãçæããå ´åã«ã¯ï¼ä¸ã«ç¤ºããå¤æ°ã«å®ç¾©ããï¼
+
+(2-4-20) OMIT_WARNING_ALL
+(2-4-21) OMIT_OPTIMIZATION
+
+ãµã³ãã«ã®Makefileã§ã¯ï¼ã³ã³ãã¤ã©ã«å¯¾ãããªãã·ã§ã³ã«ã-Wall -g -O2ã
+ãè¿½å ããï¼-Wallãè¿½å ããããªãå ´åã«ã¯ï¼Makefileã®ã¿ã¼ã²ããä¾å­é¨ã§
+OMIT_WARNING_ALLã"true"ã«å®ç¾©ããï¼-O2ãè¿½å ããããªãå ´åã«ã¯ï¼
+Makefileã®ã¿ã¼ã²ããä¾å­é¨ã§OMIT_OPTIMIZATIONã"true"ã«å®ç¾©ããï¼
+
+2.5 ãªãã»ãããã¡ã¤ã«ã®çææ¹æ³
+
+ã¢ã»ã³ããªè¨èªã§è¨è¿°ããããã­ã°ã©ã ããï¼Cè¨èªã®æ§é ä½ã«ã¢ã¯ã»ã¹ããå ´
+åã«ã¯ï¼æ§é ä½ã®åãã£ã¼ã«ãã®ãªãã»ããå¤ãåç
+§ãããã¨ãå¿
+è¦ã§ããï¼
+ASP3ã«ã¼ãã«ã§ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãç¨ãã¦å¿
+è¦ãªãªãã»ããå¤ãæ±ãï¼
+ãªãã»ãããã¡ã¤ã«ï¼offset.hï¼ã«çæããããã®ä»çµã¿ãç¨æãã¦ããï¼
+
+ãã®ä»çµã¿ãç¨ãããã¨ã§ï¼ä¾ãã°ï¼TCBä¸­ã®p_tinibãã£ã¼ã«ãã®ãªãã»ãã
+å¤ãTCB_p_tinibã«ãã¯ã­å®ç¾©ãããã¨ãï¼TCBä¸­ã®ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ã
+ã¯ï¼tskctxbï¼ã«å«ã¾ããpcãã£ã¼ã«ãã®ãªãã»ããå¤ãTCB_pcã«ãã¯ã­å®ç¾©ã
+ããã¨ãã§ããï¼ã¾ãï¼TCBä¸­ã®enaterãã£ã¼ã«ãã®ãªãã»ããå¤ï¼ãããä½ç½®ï¼
+ããããã¹ã¯ãï¼ããããTCB_enaterï¼TCB_enater_bitï¼TCB_enater_maskã«ã
+ã¯ã­å®ç¾©ãããã¨ãã§ããï¼
+
+ç¨æãã¦ããä»çµã¿ã«ãããªãã»ãããã¡ã¤ã«ãçæã§ããªãæã«ã¯ï¼ãªãã»ã
+ããã¡ã¤ã«ãã¿ã¼ã²ããä¾å­é¨ã§ç¨æããå¿
+è¦ãããï¼
+
+ãªãã»ãããã¡ã¤ã«ãå¿
+è¦ãªãå ´åãï¼ãªãã»ãããã¡ã¤ã«ãã¿ã¼ã²ããä¾å­
+é¨ã§ç¨æããå ´åã«ã¯ï¼Makefileã®ã¿ã¼ã²ããä¾å­é¨ã§OMIT_OFFSET_Hã
+"true"ã«å®ç¾©ããï¼
+
+æ¡å¼µããã±ã¼ã¸ã®ä¸­ã«ã¯ï¼TCBã«ãã£ã¼ã«ããè¿½å ãããã®ãããããï¼TCBä¸­
+ã®ãã£ã¼ã«ãã®ãªãã»ããå¤ã¯å¤åããï¼offset.hãçæããå ´åã§ãï¼ã¿ã¼
+ã²ããä¾å­é¨ã§ç¨æããå ´åã§ãï¼æ¡å¼µããã±ã¼ã¸ã«å¯¾å¿ããããã«ã¯ï¼ãã®
+ãã¨ãèæ
+®ããå¿
+è¦ãããï¼
+
+ä»¥ä¸ã§ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãç¨ãã¦offset.hãçæããæ¹æ³ã«ã¤ãã¦èª¬æ
+ããï¼ãã®æ¹æ³ã§ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹1ã§çæããcfg1_out.cãã³ã³
+ãã¤ã«ãã¦çæãããªãã¸ã§ã¯ããã¡ã¤ã«ããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«ãã£ã¦
+offset.hãçæããï¼
+
+ãã®æ¹æ³ãç¨ããããã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ãªãã»ãããã¡ã¤ã«çæç¨ã
+ã³ãã¬ã¼ããã¡ã¤ã«ãç¨æãï¼target_cfg1_out.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼
+ãããããã¡ã¤ã«ï¼ã¨target_def.csvï¼ã¾ãã¯ï¼åç­ã®å½¹å²ãæã¤ãã¡ã¤ã«ï¼
+ã«è¨è¿°ãè¿½å ããå¿
+è¦ãããï¼ãªãï¼ãããã®ãã¡ã¤ã«ãæ°ãã«ç¨æããéã
+ä¿®æ­£ããéã«ã¯ï¼offset.hã«å¦¥å½ãªå®ç¾©ãçæããã¦ãããã¨ãç¢ºèªãã¹ãã§
+ããï¼
+
+ãªãã»ãããã¡ã¤ã«çæç¨ãã³ãã¬ã¼ããã¡ã¤ã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ï¼
+target_offset.tfã«ç¨æããï¼ãªãã»ãããã¡ã¤ã«çæç¨ãã³ãã¬ã¼ããã¡ã¤
+ã«ãå¥ã®ãã£ã¬ã¯ããªã¾ãã¯å¥ã®ãã¡ã¤ã«åã§ç¨æããå ´åã«ã¯ï¼ãã®ãã¡ã¤
+ã«åãï¼Makefileã®ã¿ã¼ã²ããä¾å­é¨ã§OFFSET_TFã«å®ç¾©ããï¼
+
+ãªãã»ãããã¡ã¤ã«çæç¨ãã³ãã¬ã¼ããã¡ã¤ã«ã«ã¯ï¼ä»¥ä¸ã®å
+å®¹ãè¨è¿°ããï¼
+
+(1) æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
+
+ãªãã»ãããã¡ã¤ã«çæç¨ã®æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ï¼kernel/genoffset.tfï¼
+ãã¤ã³ã¯ã«ã¼ãããï¼æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã«ã¯ï¼ä»¥ä¸ã§ç¨ããDEFINEé¢
+æ°ãDEFINE_BITé¢æ°ã®å®ç¾©ãªã©ãå«ã¾ãã¦ããï¼
+
+----------------------------------------
+$ æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
+$INCLUDE "kernel/genoffset.tf"$
+----------------------------------------
+
+(2) ãªãã»ããå¤ã®ãã¯ã­å®ç¾©ã®çæ
+
+DEFINEé¢æ°ãç¨ãã¦ï¼ãªãã»ããå¤ã®ãã¯ã­å®ç¾©ãçæããï¼ä¾ãã°ï¼TCBä¸­ã®
+ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ï¼tskctxbï¼ã«å«ã¾ããpcãã£ã¼ã«ãã®ãªãã»ãã
+å¤ãï¼TCB_pcã«ãã¯ã­å®ç¾©ããå ´åã«ã¯ï¼æ¬¡ã®ããã«è¨è¿°ããï¼
+
+----------------------------------------
+$ ãªãã»ããå¤ã®ãã¯ã­å®ç¾©ã®çæ
+$DEFINE("TCB_pc", offsetof_TCB_pc)$
+----------------------------------------
+
+ããã§ï¼DEFINEé¢æ°ã®ç¬¬1ãã©ã¡ã¼ã¿ã¯ãã¯ã­å®ç¾©ããã·ã³ãã«ï¼ç¬¬2ãã©ã¡ã¼
+ã¿ã¯ï¼ãªãã»ããå¤ãä¿æããã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®å¤æ°ã§ããï¼
+
+ã¾ãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãï¼ãªãã»ããå¤ãä¿æããå¤æ°ï¼ä¸ã®ä¾ã§ã¯
+offsetof_TCB_pcï¼ã«å¤ãè¨­å®ããããã«ï¼target_def.csvï¼ã¾ãã¯ï¼åç­ã®å½¹
+å²ãæã¤ãã¡ã¤ã«ï¼ã«æ¬¡ã®ä¾ã®ãããªè¡ãè¿½å ããï¼
+
+----------------------------------------
+offsetof_TCB_pc,"offsetof(TCB,tskctxb.pc)"
+----------------------------------------
+
+ãã ãï¼åãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®ã¿ã¼ã²ããéä¾å­ã®ãã£ã¼ã«ãã®
+ãªãã»ããå¤ãåå¾ããããã®è¨è¿°ã¯ï¼kernel/kernel_def.csvã«å«ã¾ãã¦ããï¼
+kernel/kernel_def.csvã«å«ã¾ãã¦ããè¨è¿°ã¯ï¼target_def.csvï¼ã¾ãã¯ï¼åç­
+ã®å½¹å²ãæã¤ãã¡ã¤ã«ï¼ã«è¿½å ããå¿
+è¦ã¯ãªãï¼
+
+(3) ããããªãã»ããå¤ç­ã®ãã¯ã­å®ç¾©ã®çæ
+
+DEFINE_BITé¢æ°ãç¨ãã¦ï¼ãããã®ãªãã»ããå¤ï¼ãããä½ç½®ï¼ããããã¹ã¯
+ã®ãã¯ã­å®ç¾©ãçæããï¼ä¾ãã°ï¼TCBä¸­ã®enaterãã£ã¼ã«ãã®ãªãã»ããå¤ï¼
+ãããä½ç½®ï¼ããããã¹ã¯ãï¼ããããTCB_enaterï¼TCB_enater_bitï¼
+TCB_enater_maskã«ãã¯ã­å®ç¾©ããå ´åã«ã¯ï¼æ¬¡ã®ããã«è¨è¿°ããï¼
+
+----------------------------------------
+$DEFINE_BIT("TCB_enater", sizeof_TCB, "B")$
+----------------------------------------
+
+ããã§ï¼DEFINE_BITé¢æ°ã®ç¬¬1ãã©ã¡ã¼ã¿ã¯ãã¯ã­å®ç¾©ããã·ã³ãã«ï¼ã®å
+é ­é¨
+åï¼ï¼ç¬¬2ãã©ã¡ã¼ã¿ã¯æ§é ä½ã®ãµã¤ãºã§ããï¼ç¬¬3ãã©ã¡ã¼ã¿ã«ã¯ï¼ãããã®
+ãªãã»ããï¼ãããä½ç½®ï¼ããããã¹ã¯ãï¼8ãããåä½ï¼ãã¤ãåä½ï¼ã§æ±ã
+ãå ´åã«ã¯"B"ãï¼16ãããåä½ã§æ±ããå ´åã«ã¯"H"ãï¼32ãããåä½ã§æ±ã
+ãå ´åã«ã¯"W"ãæå®ããï¼ãªãï¼ãããä½ç½®ã¯ï¼LSBã0ã¨ããå¤ï¼ããããªã
+ã«ã¨ã³ãã£ã¢ã³ãæ³å®ï¼ãæ±ããï¼
+
+ã¾ãï¼target_cfg1_out.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼ã«ï¼
+ããããªãã»ããå¤ç­ãæ±ããããã®æ§é ä½ã®å¤æ°å®ç¾©ãè¿½å ããï¼ãã®æ§é 
+ä½ã®å¤æ°ã¯ï¼åç§°ããã¯ã­å®ç¾©ããã·ã³ãã«ï¼DEFINE_BITé¢æ°ã®ç¬¬1ãã©ã¡ã¼ã¿ï¼
+ã¨ãï¼å¯¾è±¡ã®ãããã®ã¿ã1ã§ï¼ä»ã®ãã¹ã¦ã®ãããã0ã«ãªãããã«åæåã
+ãï¼ã¾ãï¼constä¿®é£¾å­ãä»å ããï¼ä¾ãã°ï¼TCBä¸­ã®enaterãã£ã¼ã«ãã®ãã
+ããªãã»ããå¤ç­ãæ±ããå ´åã«ã¯ï¼æ¬¡ã®ãããªå®ç¾©ãè¿½å ããï¼tskctxbã®å
+æå¤ã¯ï¼ã¿ã¼ã²ããä¾å­ãªã®ã§æ³¨æãããã¨ï¼ï¼
+
+----------------------------------------
+const TCB	TCB_enater = {
+	{ NULL, NULL },			/* task_queue */
+	NULL,					/* p_tinib */
+	0U,						/* tstat */
+	0U,						/* bpriority */
+	0U,						/* priority */
+	false,					/* actque */
+	false,					/* wupque */
+	false,					/* raster */
+	true,					/* enater */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	false,					/* staovr */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+#ifdef TOPPERS_SUPPORT_SUBPRIO
+	0U,						/* subpri */
+#endif /* TOPPERS_SUPPORT_SUBPRIO */
+	NULL,					/* p_winifo */
+	NULL,					/* p_lastmtx */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	0U,						/* leftotm */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	{ NULL, NULL }			/* tskctxb */
+};
+----------------------------------------
+
+ããã«ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãï¼æ§é ä½ã®ãµã¤ãºï¼ä¸ã®ä¾ã§ã¯sizeof_TCBï¼ã«
+å¤ãè¨­å®ããããã«ï¼target_def.csvï¼ã¾ãã¯ï¼åç­ã®å½¹å²ãæã¤ãã¡ã¤ã«ï¼
+ã«æ¬¡ã®ä¾ã®ãããªè¡ãè¿½å ããï¼
+
+----------------------------------------
+sizeof_TCB,sizeof(TCB)
+----------------------------------------
+
+ãã ãï¼åè¿°ããéãï¼kernel/kernel_def.csvã«å«ã¾ãã¦ããè¨è¿°ã¯ï¼
+target_def.csvï¼ã¾ãã¯ï¼åç­ã®å½¹å²ãæã¤ãã¡ã¤ã«ï¼ã«è¿½å ããå¿
+è¦ã¯ãªãï¼
+
+æå¾ã«ï¼target_cfg1_out.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼
+ã«ï¼offset.hãçæããä»çµã¿ãæ­£ããåä½ãã¦ãããã¨ãç¢ºèªããããã®æ¬¡
+ã®è¨è¿°ãè¿½å ããï¼
+
+----------------------------------------
+const uint8_t	MAGIC_1 = 0x12;
+const uint16_t	MAGIC_2 = 0x1234;
+const uint32_t	MAGIC_4 = 0x12345678;
+----------------------------------------
+
+2.6 ãªã³ã¯æ¹æ³ã®è¨­å®
+
+(2-6-1) LDSCRIPT				ãªã³ã«ã¹ã¯ãªããã®ãã¡ã¤ã«å
+
+éçºç°å¢ã«æ¨æºã®ãªã³ã«ã¹ã¯ãªãããä½¿ç¨ã§ããªãå ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­
+é¨ã§ãªã³ã«ã¹ã¯ãªãããç¨æãï¼ãã®ãã¡ã¤ã«åããã®å¤æ°ã«å®ç¾©ããï¼
+
+(2-6-2) TEXT_START_ADDRESS		ãã­ã¹ãã»ã¯ã·ã§ã³ã®å
+é ­çªå°
+(2-6-3) DATA_START_ADDRESS		ãã¼ã¿ã»ã¯ã·ã§ã³ã®å
+é ­çªå°
+
+åã»ã¯ã·ã§ã³ã®å
+é ­çªå°ã®æå®ãå¿
+è¦ãªå ´åã«ã¯ï¼ãããã®å¤æ°ã«å
+é ­çªå°ã
+å®ç¾©ããï¼
+
+(2-6-4) START_OBJS				å
+é ­ã«ãªã³ã¯ãã¹ãã¢ã¸ã¥ã¼ã«å
+(2-6-5) END_OBJS				æå¾ã«ãªã³ã¯ãã¹ãã¢ã¸ã¥ã¼ã«å
+
+ã¿ã¼ã²ããã«ãã£ã¦ã¯ï¼ã­ã¼ãã¢ã¸ã¥ã¼ã«ã®å
+é ­ã¨æå¾ã«ãªã³ã¯ãã¹ãã¢ã¸ã¥ã¼
+ã«ãï¼ã¿ã¼ã²ããä¾å­é¨ã§ç¨æããå¿
+è¦ãããï¼å¤ãã®å ´åï¼ã¹ã¿ã¼ãã¢ãã
+ã¢ã¸ã¥ã¼ã«ãã­ã¼ãã¢ã¸ã¥ã¼ã«ã®å
+é ­ã«ãªã³ã¯ããå¿
+è¦ãããï¼
+
+ã­ã¼ãã¢ã¸ã¥ã¼ã«ã®å
+é ­ã«ãªã³ã¯ãã¹ããã­ã°ã©ã ãããå ´åã«ã¯ï¼Makefile
+ã®ã¿ã¼ã²ããä¾å­é¨ã«ããã¦ï¼ãã®ãªãã¸ã§ã¯ããã¡ã¤ã«åãSTART_OBJSã«å®
+ç¾©ãï¼ããã«å¯¾ããã³ã³ãã¤ã«ã«ã¼ã«ã¨ä¾å­é¢ä¿ä½æã«ã¼ã«ãå®ç¾©ããï¼ã­ã¼
+ãã¢ã¸ã¥ã¼ã«ã®æå¾ã«ãªã³ã¯ãã¹ãã¢ã¸ã¥ã¼ã«ãããå ´åã«ã¯ï¼ãã®ãªãã¸ã§
+ã¯ããã¡ã¤ã«åãEND_OBJSã«å®ç¾©ãï¼ããã«å¯¾ããã³ã³ãã¤ã«ã«ã¼ã«ã¨ä¾å­é¢
+ä¿ä½æã«ã¼ã«ãå®ç¾©ããï¼ã¾ãï¼æ¨æºã®ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ï¼crt0.oï¼
+ããªã³ã¯ããªãããã«ï¼LDFLAGSã¨CFG1_OUT_LDFLAGSã«-nostdlibãè¿½å ããå¿
+
+è¦ãããï¼ããã«ï¼-nostdlibãã¤ãããã¨ã§æ¨æºã©ã¤ãã©ãªããªã³ã¯ãããªã
+ãªãããï¼LIBSã«-lgccãè¿½å ããªããã°ãªããªãï¼
+
+ä¾ãã°ï¼ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã®ã½ã¼ã¹ãã¡ã¤ã«ãstart.Sã®å ´åã«ã¯ï¼
+Makefileã®ã¿ã¼ã²ããä¾å­é¨ã«æ¬¡ã®ãããªè¨è¿°ãå
+¥ããã¨ããï¼
+
+----------------------------------------
+# ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã®ãªãã¸ã§ã¯ããã¡ã¤ã«å
+START_OBJS = start.o
+
+# ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã®ã³ã³ãã¤ã«ã«ã¼ã«
+$(START_OBJS): %.o: %.S
+	$(CC) -c $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+# ãªã³ã«ã«å¯¾ãããªãã·ã§ã³
+LDFLAGS := -nostdlib $(LDFLAGS)
+CFG1_OUT_LDFLAGS := -nostdlib $(CFG1_OUT_LDFLAGS)
+LIBS := $(LIBS) -lgcc
+----------------------------------------
+
+ã¾ãï¼GNUéçºç°å¢ã§ï¼ã³ã³ãã¤ã©ã«æ¨æºã®crtbegin.oã¨crtend.oãç¨ããå ´å
+ã«ã¯ï¼Makefile ã®ã¿ã¼ã²ããä¾å­é¨ã«æ¬¡ã®ãããªè¨è¿°ãå
+¥ããã¨ããï¼
+
+----------------------------------------
+# ãªãã¸ã§ã¯ããã¡ã¤ã«å
+START_OBJS = $(shell $(CC) -print-file-name=crtbegin.o)
+END_OBJS = $(shell $(CC) -print-file-name=crtend.o)
+
+# ãªã³ã«ã«å¯¾ãããªãã·ã§ã³
+LDFLAGS := -nostdlib $(LDFLAGS)
+CFG1_OUT_LDFLAGS := -nostdlib $(CFG1_OUT_LDFLAGS)
+LIBS := $(LIBS) -lgcc
+----------------------------------------
+
+ãã®å ´åï¼ãããã®ãã¡ã¤ã«ãã³ã³ãã¤ã«ãããã¨ã¯ãªãããï¼ã³ã³ãã¤ã«ã«ã¼
+ã«ã¯ä¸è¦ã§ããï¼ã¾ãï¼ä¾å­é¢ä¿ä½æã«ã¼ã«ã¯ããã¼ã§ããï¼ä¾å­é¢ä¿ä½æã«ã¼
+ã«ããªãã¨ã¨ã©ã¼ã«ãªãï¼ï¼
+
+(2-6-6) HIDDEN_OBJS				æå®ããªãã¦ããªã³ã¯ãããã¢ã¸ã¥ã¼ã«å
+
+ã­ã¼ãã¢ã¸ã¥ã¼ã«ã«ãªã³ã¯ãã¹ãã¢ã¸ã¥ã¼ã«ãï¼ãªã³ã«ã«å¯¾ãããã©ã¡ã¼ã¿ã§
+ã¯ãªãï¼ãªã³ã«ã¹ã¯ãªããä¸­ã«ï¼ä¾ãã°ï¼GNUéçºç°å¢ã®ãªã³ã«ã¹ã¯ãªããã®
+STARTUPãä½¿ã£ã¦ï¼è¨è¿°ããå ´åã«ã¯ï¼ãã®ãªãã¸ã§ã¯ããã¡ã¤ã«åãï¼
+ï¼START_OBJSã¾ãã¯END_OBJSã§ã¯ãªãï¼HIDDEN_OBJSã«å®ç¾©ãï¼ããã«å¯¾ããã³
+ã³ãã¤ã«ã«ã¼ã«ã¨ä¾å­é¢ä¿ä½æã«ã¼ã«ãå®ç¾©ããï¼HIDDEN_OBJSã«å®ç¾©ããã¢
+ã¸ã¥ã¼ã«ã¯ï¼ãªã³ã«ã«å¯¾ãããã©ã¡ã¼ã¿ããã¯é¤å¤ãããï¼LDFLAGSã¨
+CFG1_OUT_LDFLAGSï¼LIBSã«ã¤ãã¦ã¯ï¼START_OBJSã¾ãã¯END_OBJSãç¨ããå ´å
+ã¨åæ§ã§ããï¼
+
+ä¾ãã°ï¼ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã®ã½ã¼ã¹ãã¡ã¤ã«ãstart.Sã§ï¼start.oã
+ãªã³ã¯ãããã¨ããªã³ã«ã¹ã¯ãªããä¸­ã«è¨è¿°ããå ´åã«ã¯ï¼Makefileã®ã¿ã¼ã²ã
+ãä¾å­é¨ã«æ¬¡ã®ãããªè¨è¿°ãå
+¥ããã¨ããï¼
+
+----------------------------------------
+# ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã®ãªãã¸ã§ã¯ããã¡ã¤ã«å
+HIDDEN_OBJS = start.o
+
+# ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã®ã³ã³ãã¤ã«ã«ã¼ã«
+$(HIDDEN_OBJS): %.o: %.S
+	$(CC) -c $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+# ãªã³ã«ã«å¯¾ãããªãã·ã§ã³
+LDFLAGS := -nostdlib $(LDFLAGS)
+CFG1_OUT_LDFLAGS := -nostdlib $(CFG1_OUT_LDFLAGS)
+LIBS := $(LIBS) -lgcc
+----------------------------------------
+
+2.7 ä¾å­é¢ä¿ã®å®ç¾©ï¼ãªãã·ã§ã³ï¼
+
+ã¿ã¼ã²ããä¾å­é¨ã®éçºä¸­ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®åãã¹ã«å¯¾ãã¦ï¼ã¿ã¼ã²ã
+ãä¾å­é¨ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã¸ã®ä¾å­é¢ä¿ãå®ç¾©ããã¨ä¾¿å©ã§ããï¼å
+·ä½
+çã«ã¯ï¼ãã¹1ï¼ãã¹2ï¼ãã¹3ãä¾å­ãããã¡ã¤ã«ãï¼ããããcfg1_out.cï¼
+kernel_cfg.timestampï¼$(OBJFILE)ã«å¯¾ããä¾å­é¢ä¿ã®å½¢ã§è¨è¿°ããï¼
+
+ã»ã¨ãã©ã®å ´åï¼ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããªã®Makefile.targetã«å«ããè¨
+è¿°ã¯ï¼ä»¥ä¸ã®ããã«ãªãï¼
+
+----------------------------------------
+cfg1_out.c: $(TARGETDIR)/target_def.csv
+kernel_cfg.timestamp: $(TARGETDIR)/target.tf
+$(OBJFILE): $(TARGETDIR)/target_check.tf
+----------------------------------------
+
+2.8 ãã®ä»ã®è¨­å®
+
+(2-8-1) CLEAN_FILES				cleanã«ããåé¤ãããã¡ã¤ã«å
+
+cleanã«ããåé¤ãããã¡ã¤ã«ãã¿ã¼ã²ããä¾å­é¨ã§è¿½å ãããå ´åã«ã¯ï¼ãã¡
+ã¤ã«åããã®å¤æ°ã«è¿½å å®ç¾©ããï¼
+
+(2-8-2) REALCLEAN_FILES			realcleanã«ããåé¤ãããã¡ã¤ã«å
+
+realcleanã«ããåé¤ãããã¡ã¤ã«ãã¿ã¼ã²ããä¾å­é¨ã§è¿½å ãããå ´åã«ã¯ï¼
+ãã¡ã¤ã«åããã®å¤æ°ã«è¿½å å®ç¾©ããï¼
+
+
+ï¼ï¼TOPPERSå
+±éå®ç¾©ã®ã¿ã¼ã²ããä¾å­é¨
+
+TOPPERSå
+±éå®ç¾©ï¼t_stddef.hï¼ã®ã¿ã¼ã²ããä¾å­é¨ã¯ï¼target_stddef.hã¾ã
+ã¯ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼éçºç°å¢ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾
+å­é¨ï¼ãããä¾å­é¨ã§ç¨æãããããããã¡ã¤ã«ãªã©ï¼ã«å«ããï¼
+
+3.1 ã¿ã¼ã²ããè­å¥ãã¯ã­
+
+ã¢ããªã±ã¼ã·ã§ã³ãã·ã¹ãã ãµã¼ãã¹ã§ã¿ã¼ã²ãããè­å¥ããããã«ï¼
+"TOPPERS_"ã«ã·ã¹ãã ç¥ç§°ãå¤§æå­ã«ããæå­åãé£çµãããã®ï¼ä¾ãã°ï¼
+"TOPPERS_CT11MPCORE"ï¼ããã¯ã­å®ç¾©ããï¼
+
+ã¾ãï¼ã¿ã¼ã²ããä¾å­é¨ãããã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ãåãåã
+ãå ´åã«ã¯ï¼"TOPPERS_"ã«ãã­ã»ããµã³ã¢ç¥ç§°ï¼ãããç¥ç§°ãå¤§æå­ã«ããæ
+å­åãé£çµãããã®ï¼ä¾ãã°ï¼"TOPPERS_ARM"ï¼ããã¯ã­å®ç¾©ããï¼
+
+3.2 æ´æ°åã®æå¤§å¤ã»æå°å¤ã»ãããæ°
+
+(3-2-1) INT_MAX				intã«æ ¼ç´ã§ããæå¤§å¤ï¼C90æºæ ï¼
+(3-2-2) INT_MIN				intã«æ ¼ç´ã§ããæå°å¤ï¼C90æºæ ï¼
+(3-2-3) UINT_MAX			unsigned intã«æ ¼ç´ã§ããæå¤§å¤ï¼C90æºæ ï¼
+(3-2-4) LONG_MAX			longã«æ ¼ç´ã§ããæå¤§å¤ï¼C90æºæ ï¼
+(3-2-5) LONG_MIN			longã«æ ¼ç´ã§ããæå°å¤ï¼C90æºæ ï¼
+(3-2-6) ULONG_MAX			unsigned longã«æ ¼ç´ã§ããæå¤§å¤ï¼C90æºæ ï¼
+(3-2-7) CHAR_BIT			charåã®ãããæ°ï¼C90æºæ ï¼
+
+æ´æ°åã®æå¤§å¤ã»æå°å¤ã»ãããæ°ãï¼ãããã®ã·ã³ãã«ã«ãã¯ã­ã«å®ç¾©ããï¼
+
+ãããã®ãã¯ã­ã¯ï¼C90ã«æºæ ãããã®ã§ããï¼éçºç°å¢ã«C90ã«æºæ ãã
+limits.hãç¨æããã¦ããå ´åã«ã¯ï¼ãããã®ãã¯ã­ãå®ç¾©ãããã¨ã«ä»£ãã¦ï¼
+limits.hãã¤ã³ã¯ã«ã¼ãããã°ããï¼
+
+3.3 ãµã¤ãºã®æå®ãããæ´æ°åï¼ãã®æå¤§å¤ã»æå°å¤ï¼æ´æ°å®æ°ãä½ããã¯ã­
+
+(3-3-1) int8_t				ç¬¦å·ä»ã8ãããæ´æ°ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-2) uint8_t				ç¬¦å·ç¡ã8ãããæ´æ°ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-3) int16_t				ç¬¦å·ä»ã16ãããæ´æ°ï¼C99æºæ ï¼
+(3-3-4) uint16_t			ç¬¦å·ç¡ã16ãããæ´æ°ï¼C99æºæ ï¼
+(3-3-5) int32_t				ç¬¦å·ä»ã32ãããæ´æ°ï¼C99æºæ ï¼
+(3-3-6) uint32_t			ç¬¦å·ç¡ã32ãããæ´æ°ï¼C99æºæ ï¼
+(3-3-7) int64_t				ç¬¦å·ä»ã64ãããæ´æ°ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-8) uint64_t			ç¬¦å·ç¡ã64ãããæ´æ°ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-9) int128_t			ç¬¦å·ä»ã128ãããæ´æ°ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-10) uint128_t			ç¬¦å·ç¡ã128ãããæ´æ°ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-11) int_least8_t		8ãããä»¥ä¸ã®ç¬¦å·ä»ãæ´æ°ï¼C99æºæ ï¼
+(3-3-12) uint_least8_t		8ãããä»¥ä¸ã®ç¬¦å·ç¡ãæ´æ°ï¼C99æºæ ï¼
+(3-3-13) size_t				ã¡ã¢ãªé åã®ãµã¤ãºãè¡¨ãç¬¦å·ç¡ãæ´æ°ï¼C90æºæ ï¼
+(3-3-14) intptr_t			ãã¤ã³ã¿ãæ ¼ç´ã§ãããµã¤ãºã®ç¬¦å·ä»ãæ´æ°ï¼C99æºæ ï¼
+(3-3-15) uintptr_t			ãã¤ã³ã¿ãæ ¼ç´ã§ãããµã¤ãºã®ç¬¦å·ç¡ãæ´æ°ï¼C99æºæ ï¼
+(3-3-16) INT8_MAX			int8_tã«æ ¼ç´ã§ããæå¤§å¤ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-17) INT8_MIN			int8_tã«æ ¼ç´ã§ããæå°å¤ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-18) UINT8_MAX			uint8_tã«æ ¼ç´ã§ããæå¤§å¤ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-19) INT16_MAX			int16_tã«æ ¼ç´ã§ããæå¤§å¤ï¼C99æºæ ï¼
+(3-3-20) INT16_MIN			int16_tã«æ ¼ç´ã§ããæå°å¤ï¼C99æºæ ï¼
+(3-3-21) UINT16_MAX			uint16_tã«æ ¼ç´ã§ããæå¤§å¤ï¼C99æºæ ï¼
+(3-3-22) INT32_MAX			int32_tã«æ ¼ç´ã§ããæå¤§å¤ï¼C99æºæ ï¼
+(3-3-23) INT32_MIN			int32_tã«æ ¼ç´ã§ããæå°å¤ï¼C99æºæ ï¼
+(3-3-24) UINT32_MAX			uint32_tã«æ ¼ç´ã§ããæå¤§å¤ï¼C99æºæ ï¼
+(3-3-25) INT64_MAX			int64_tã«æ ¼ç´ã§ããæå¤§å¤ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-26) INT64_MIN			int64_tã«æ ¼ç´ã§ããæå°å¤ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-27) UINT64_MAX			uint64_tã«æ ¼ç´ã§ããæå¤§å¤ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-28) INT128_MAX			int128_tã«æ ¼ç´ã§ããæå¤§å¤ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-29) INT128_MIN			int128_tã«æ ¼ç´ã§ããæå°å¤ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-30) UINT128_MAX		uint128_tã«æ ¼ç´ã§ããæå¤§å¤ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-31) INT_LEAST8_MAX		int_least8_tã«æ ¼ç´ã§ããæå¤§å¤ï¼C99æºæ ï¼
+(3-3-32) INT_LEAST8_MIN		int_least8_tã«æ ¼ç´ã§ããæå°å¤ï¼C99æºæ ï¼
+(3-3-33) UINT_LEAST8_MAX	uint_least8_tã«æ ¼ç´ã§ããæå¤§å¤ï¼C99æºæ ï¼
+(3-3-34) INT8_C(val)		int_least8_tåã®å®æ°ãä½ããã¯ã­ï¼C99æºæ ï¼
+(3-3-35) UINT8_C(val)		uint_least8_tåã®å®æ°ãä½ããã¯ã­ï¼C99æºæ ï¼
+(3-3-36) INT16_C(val)		int16_tåã®å®æ°ãä½ããã¯ã­ï¼C99æºæ ï¼
+(3-3-37) UINT16_C(val)		uint16_tåã®å®æ°ãä½ããã¯ã­ï¼C99æºæ ï¼
+(3-3-38) INT32_C(val)		int32_tåã®å®æ°ãä½ããã¯ã­ï¼C99æºæ ï¼
+(3-3-39) UINT32_C(val)		uint32_tåã®å®æ°ãä½ããã¯ã­ï¼C99æºæ ï¼
+(3-3-40) INT64_C(val)		int64_tåã®å®æ°ãä½ããã¯ã­ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-41) UINT64_C(val)		uint64_tåã®å®æ°ãä½ããã¯ã­ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-42) INT128_C(val)		int128_tåã®å®æ°ãä½ããã¯ã­ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+(3-3-43) UINT128_C(val)		uint128_tåã®å®æ°ãä½ããã¯ã­ï¼ãªãã·ã§ã³ï¼C99æºæ ï¼
+
+æå®ããããµã¤ãºã®æ´æ°åãï¼ãããã®ã·ã³ãã«ã«åå®ç¾©ããï¼ã¾ãï¼ãã¼ã¿
+åã«æ ¼ç´ã§ããæå¤§å¤ã»æå°å¤ã¨ï¼æ´æ°å®æ°ãä½ããã¯ã­ãï¼ãããã®ã·ã³ã
+ã«ã«ãã¯ã­å®ç¾©ããï¼
+
+size_tåã¯ï¼C90ã«æºæ ãããã®ã§ããï¼C90æºæ ã®Cè¨èªç°å¢ã§ã¯ï¼size_tã®å®
+ç¾©ã¯stddef.hç­ã«å«ã¾ãã¦ããããï¼ãããã¤ã³ã¯ã«ã¼ããã¦ãããï¼
+
+ãã®ä»ã®ãã¼ã¿åããã³ãã¯ã­ã¯ï¼C99ã«æºæ ãããã®ã§ããï¼éçºç°å¢ã«C99
+ã«æºæ ããstdint.hãç¨æããã¦ããå ´åã«ã¯ï¼ãããã®ãã¼ã¿åããã³ãã¯
+ã­ãå®ç¾©ãããã¨ã«ä»£ãã¦ï¼stdint.hãã¤ã³ã¯ã«ã¼ãããã°ããï¼
+
+ä¸ã§ãªãã·ã§ã³ã¨è¨è¿°ãããã®ã¯ï¼è©²å½ãããã¼ã¿åãã³ã³ãã¤ã©ã§ãµãã¼ã
+ããã¦ããå ´åã«ã®ã¿å®ç¾©ãããã¨ãç¤ºãï¼
+
+3.4 ãµã¤ãºã®æå®ãããæµ®åå°æ°ç¹åï¼ãã®æå¤§å¤ã»æå°å¤ã®ãã¯ã­
+
+(3-4-1) float32_t			IEEE754æºæ ã®32ãããåç²¾åº¦æµ®åå°æ°ç¹æ°ï¼ãªã
+							ã·ã§ã³ï¼
+(3-4-2) double64_t			IEEE754æºæ ã®64ãããåç²¾åº¦æµ®åå°æ°ç¹æ°ï¼ãªã
+							ã·ã§ã³ï¼
+(3-4-3) FLOAT32_MIN			float32_tã«æ ¼ç´ã§ããæå°ã®æ­£è¦åãããæ­£ã®æµ®
+							åå°æ°ç¹æ°ï¼ãªãã·ã§ã³ï¼
+(3-4-4) FLOAT32_MAX			float32_tã«æ ¼ç´ã§ããè¡¨ç¾å¯è½ãªæå¤§ã®æéæµ®å
+							å°æ°ç¹æ°ï¼ãªãã·ã§ã³ï¼
+(3-4-5) DOUBLE64_MIN		double64_tã«æ ¼ç´ã§ããæå°ã®æ­£è¦åãããæ­£ã®æµ®
+							åå°æ°ç¹æ°ï¼ãªãã·ã§ã³ï¼
+(3-4-6) DOUBLE64_MAX		double64_tã«æ ¼ç´ã§ããè¡¨ç¾å¯è½ãªæå¤§ã®æéæµ®å
+							å°æ°ç¹æ°ï¼ãªãã·ã§ã³ï¼
+
+æå®ããããµã¤ãºã»è¡¨ç¾å½¢å¼ã®æµ®åå°æ°ç¹åãï¼ãããã®ã·ã³ãã«ã«åå®ç¾©ã
+ãï¼ã¾ãï¼ãã¼ã¿åã«æ ¼ç´ã§ããæå¤§å¤ã»æå°å¤ãï¼ãããã®ã·ã³ãã«ã«ãã¯
+ã­å®ç¾©ããï¼
+
+ããããï¼è©²å½ãããã¼ã¿åãã³ã³ãã¤ã©ã§ãµãã¼ãããã¦ããå ´åã«ã®ã¿å®
+ç¾©ããï¼
+
+3.5 ã³ã³ãã¤ã©ã®æ¡å¼µæ©è½ã®ããã®ãã¯ã­å®ç¾©
+
+ã³ã³ãã¤ã©ã®æ¡å¼µæ©è½ãç¨ããããã®ãã¯ã­ã¨ãã¦ï¼å¿
+è¦ã«å¿ãã¦ï¼ä»¥ä¸ã®ã
+ã¯ã­ã®å®ç¾©ãå«ããï¼
+
+(3-5-1) inlineï¼ãªãã·ã§ã³ï¼ããã©ã«ãã¯æªå®ç¾©ï¼
+(3-5-2) Inlineï¼ãªãã·ã§ã³ï¼ããã©ã«ãã¯static inlineï¼
+
+ã¤ã³ã©ã¤ã³é¢æ°ã§ãããã¨ãç¤ºãæå®ï¼Inlineã¯ï¼ã³ã³ãã¤ã«åä½ã«ã­ã¼ã«ã«
+ãªã¤ã³ã©ã¤ã³é¢æ°ã§ãããã¨ãç¤ºãï¼
+
+(3-5-3) asmï¼ãªãã·ã§ã³ï¼ããã©ã«ãã¯æªå®ç¾©ï¼
+(3-5-4) Asmï¼ãªãã·ã§ã³ï¼ããã©ã«ãã¯æªå®ç¾©ï¼
+
+ã¤ã³ã©ã¤ã³ã¢ã»ã³ãã©ãè¨è¿°ããããã®æå®ï¼Asmã¯ï¼æé©åã«ããåé¤ãã¦ã¯
+ãªããªããã¨ãç¤ºãï¼ãããã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ã®ã¿ä½¿ããã¯ã­ã§ããã
+ãï¼ã¿ã¼ã²ããä¾å­é¨ã§ä½¿ããªããªãå®ç¾©ããå¿
+è¦ã¯ãªãï¼
+
+(3-5-5) offsetof(structure, field)ï¼ãªãã·ã§ã³ï¼ããã©ã«ãã®å®ç¾©ããï¼
+
+æ§é ä½structureã®ä¸­ã§ã®ï¼ãã£ã¼ã«ãfieldã®ãªãã»ãããæ±ãããã¯ã­ï¼
+C90æºæ ã®Cè¨èªç°å¢ã§ã¯ï¼offsetofã®å®ç¾©ã¯stddef.hã«å«ã¾ãã¦ããããï¼ã
+ããã¤ã³ã¯ã«ã¼ããã¦ãããï¼
+
+(3-5-6) alignof(type)ï¼ãªãã·ã§ã³ï¼ããã©ã«ãã®å®ç¾©ããï¼
+
+ãã¼ã¿åtypeã®ã¢ã©ã¤ã³ã¡ã³ãåä½ãæ±ãããã¯ã­ï¼
+
+(3-5-7) NoReturnï¼ãªãã·ã§ã³ï¼ããã©ã«ãã¯æªå®ç¾©ï¼
+
+ãªã¿ã¼ã³ãããã¨ã®ãªãé¢æ°ã§ãããã¨ãç¤ºãæå®ï¼ããã¯ï¼ã¿ã¼ã²ããä¾å­
+é¨ã®ã¿ä½¿ããã¯ã­ã§ããããï¼ã¿ã¼ã²ããä¾å­é¨ã§ä½¿ããªããªãå®ç¾©ããå¿
+è¦
+ã¯ãªãï¼
+
+3.6 æ¨æºçãªå®ç¾©ã®ä¸æ¸ã
+
+t_stddef.hã«å«ã¾ããTOPPERSå
+±éå®ç¾©ã®æ¨æºçãªå®ç¾©ãä¸æ¸ãããå ´åã«ã¯ï¼
+ä»¥ä¸ã®ãã¯ã­ãå®ç¾©ããï¼
+
+(3-6-1) TOPPERS_boolï¼ãªãã·ã§ã³ï¼ããã©ã«ãã¯intï¼
+(3-6-2) TOPPERS_fpï¼ãªãã·ã§ã³ï¼ããã©ã«ãã¯ä»ã¨äºææ§ã®ãªãé¢æ°ãã¤ã³ã¿ï¼
+
+ããããï¼bool_tï¼FPã«åå®ç¾©ãã¹ããã¼ã¿åï¼
+
+(3-6-3) UINT_C(val)ï¼ãªãã·ã§ã³ï¼ããã©ã«ãã¯Uãä»å ï¼
+(3-6-4) ULONG_C(val)ï¼ãªãã·ã§ã³ï¼ããã©ã«ãã¯ULãä»å ï¼
+
+ããããï¼unsigned uintåï¼unsigned longåã®å®æ°ãä½ãããã®ãã¯ã­ï¼
+
+(3-6-5) NULLï¼ãªãã·ã§ã³ï¼ããã©ã«ãã¯0ï¼
+
+C90æºæ ã®Cè¨èªç°å¢ã§ã¯ï¼NULLã®å®ç¾©ã¯stddef.hã«å«ã¾ãã¦ããããï¼ããã
+ã¤ã³ã¯ã«ã¼ããã¦ãããï¼
+
+(3-6-6) ERCD(mercd, sercd)ï¼ãªãã·ã§ã³ï¼
+(3-6-7) MERCD(ercd)ï¼ãªãã·ã§ã³ï¼
+(3-6-8) SERCD(ercd)ï¼ãªãã·ã§ã³ï¼
+
+ERCDï¼MERCDï¼SERCDã®æ¨æºã®å®ç¾©ã¯ï¼ç¬¦å·ä»ãæ´æ°ã2ã®è£æ°ã§è¡¨ç¾ããã¦ããï¼
+å³ã·ããæ¼ç®å­ï¼>>ï¼ãç®è¡ã·ããããããã¨ãä»®å®ãã¦ããï¼å¤ãã®ã³ã³ã
+ã¤ã©ã§ãã®ä»®å®ãæãç«ã¤ãï¼ããã§ãªãå ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ãã
+ãã®å®ç¾©ãä¸æ¸ãããå¿
+è¦ãããï¼
+
+(3-6-9) ALIGN_TYPE(addr, type)ï¼ãªãã·ã§ã³ï¼
+
+ã¢ãã¬ã¹addrãï¼ãã¼ã¿åtypeã®ã¢ã©ã¤ã³ã¡ã³ãåä½ã«ã¢ã©ã¤ã³ãã¦ããã
+ãã§ãã¯ãããã¯ã­ï¼
+
+3.7 ã¢ãµã¼ã·ã§ã³ã®ããã®å®ç¾©
+
+t_stddef.hã«ã¯ï¼assertã®å®ç¾©ãå«ã¾ããï¼assertãå¤±æããå ´åï¼assertã®
+ãã©ã¡ã¼ã¿ãfalseã«ãªã£ãå ´åï¼ã®å¦çãï¼ã¿ã¼ã²ããä¾å­ã«ç¨æããå¿
+è¦ã
+ããï¼ãããã®å®ç¾©ã¯ï¼assertãã¯ã­ãä½¿ç¨ããåã§ããã°ï¼t_stddef.hä»¥é
+ã«ã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ã«å«ã¾ãã¦ãã¦ãããï¼ãªãï¼assertãç¡å¹ã«
+ããï¼NDEBUGããã¯ã­å®ç¾©ãã¦ã³ã³ãã¤ã«ããï¼å ´åã«ã¯ï¼ããããç¨æãã
+å¿
+è¦ã¯ãªãï¼
+
+(3-7-1) TOPPERS_assert_abort(void)
+
+assertãå¤±æããå ´åã«ï¼ãã­ã°ã©ã ãåæ­¢ãããé¢æ°ï¼ã·ã¹ãã éçºä¸­ã¯ã
+ããã¬ã«è½ã¨ãã®ãçæ³çã§ããï¼ã·ã¹ãã ç¨¼åæã«ã¯ä¾å¤å¦çãè¡ãããã
+ã¨ã«ãªãï¼
+
+(3-7-2) TOPPERS_assert_fail(exp, file, line)
+
+assertãå¤±æããæã®æ
+å ±ãè¡¨ç¤º/è¨é²ããããã®ãã¯ã­ï¼ã·ã¹ãã ã­ã°æ©è½ã
+ç¨ããå ´åã«ã¯ï¼t_syslog.hã«ã·ã¹ãã ã­ã°æ©è½ã«è¨é²ããããã®å®ç¾©ãå«ã¾
+ãã¦ããã®ã§ï¼ã¿ã¼ã²ããä¾å­é¨ã§ç¨æããå¿
+è¦ã¯ãªãï¼
+
+
+ï¼ï¼ã·ã¹ãã ã¤ã³ã¿ãã§ã¼ã¹ã¬ã¤ã¤ï¼SILï¼ã®ã¿ã¼ã²ããä¾å­é¨
+
+ã·ã¹ãã ã¤ã³ã¿ãã§ã¼ã¹ã¬ã¤ã¤ï¼SILï¼sil.hï¼ã®ã¿ã¼ã²ããä¾å­é¨ã®å®ç¾©ã¯ï¼
+target_sil.hã¾ãã¯ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼éçºç°å¢ä¾å­é¨ï¼
+ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ã§ç¨æãããããããã¡ã¤ã«ãªã©ï¼ã«å«
+ããï¼
+
+SILã®ãµã¼ãã¹ã³ã¼ã«ã¯ï¼ä»»æã®ã·ã¹ãã ç¶æ
+ã§å¼ã³åºããã¨ãã§ããï¼ãã®ã
+ãï¼SILã®ã¿ã¼ã²ããä¾å­é¨ã®é¢æ°ã¯ï¼ä»»æã®ã·ã¹ãã ç¶æ
+ã§å¼ã³åºããããã«
+å®è£
+ããªããã°ãªããªãï¼
+
+4.1 å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®ç®¡ç
+
+SILã®ã¿ã¼ã²ããä¾å­é¨ã§ã¯ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¸é·ç§»ããæ©è½ã¨ï¼å
+ã®ç¶æ
+
+ã¸æ»ãæ©è½ï¼å
+ã®ç¶æ
+ãè¨æ¶ããããã«å¤æ°ãä½¿ãï¼ãæä¾ããï¼å
+¨å²è¾¼ã¿ã­ã
+ã¯ç¶æ
+ã§ããããå¤å¥ããæ©è½ã¯æä¾ããå¿
+è¦ããªãï¼
+
+SILã®æ©è½ã¯ï¼ã«ã¼ãã«ãä½¿ç¨ããªãå ´åã«ãä½¿ç¨ã§ããå¿
+è¦ãããï¼ãã®ããï¼
+å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¸ã®é·ç§»ã¨å
+ã®ç¶æ
+ã¸ã®å¾©å¸°ã¯ï¼ã«ã¼ãã«ãç¨ããï¼ãã­
+ã»ããµã®ãªã½ã¼ã¹ãç´æ¥æä½ãããã¨ã«ãã£ã¦å®ç¾ããï¼ã¾ãï¼å
+¨å²è¾¼ã¿ã­ã
+ã¯ç¶æ
+ã¸ã®é·ç§»ã¨å
+ã®ç¶æ
+ã¸ã®å¾©å¸°ã¯ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ãCPUã­ãã¯ç¶æ
+ã§
+ãè¡ããå¿
+è¦ãããï¼
+
+ä¿è­·æ©è½ãæã£ãã«ã¼ãã«ã§ã¯ï¼ã¦ã¼ã¶ã¿ã¹ã¯ãããã­ã»ããµã®ãªã½ã¼ã¹ãç´
+æ¥æä½ãããã¨ãã§ããªãããï¼ã¦ã¼ã¶ã¿ã¹ã¯ããã¯ãããã®æ©è½ãç¨ããã
+ã¨ãã§ããªãï¼ç¨ããå ´åã®æ¯èãã¯ã¿ã¼ã²ãããã­ã»ããµã«ä¾å­ãããï¼å
+¸
+åçã«ã¯ï¼ç¹æ¨©å½ä»¤éåãªã©ã®CPUä¾å¤ãçºçãããã¨ã«ãªãï¼
+
+(4-1-1) SIL_PRE_LOC
+
+å
+¨å²è¾¼ã¿ã­ãã¯ãã©ã°ã®ç¶æ
+ãä¿å­ããããã®å¤æ°ãå®ç¾©ãããã¯ã­ï¼ååã®
+å¾ã«ï¼å¤æ°åãç¶ãããã®ã«å®ç¾©ããï¼å¤æ°åã¯ï¼ä»ã®ååã¨è¡çªããªããã
+ã«ï¼"TOPPERS_"ã§å§ã¾ãååã«ããï¼
+
+(4-1-2) SIL_LOC_INT()
+
+ç¾å¨ã®å
+¨å²è¾¼ã¿ã­ãã¯ãã©ã°ã®ç¶æ
+ãSIL_PRE_LOCã§å®ç¾©ããå¤æ°ã«ä¿å­ãï¼å
+¨
+å²è¾¼ã¿ã­ãã¯ç¶æ
+ã«é·ç§»ããããã¯ã­ï¼ãã®ãã¯ã­ãå®ç¾ããéã«ã¯ï¼ã1.5
+ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã®å®ç¾ã«é¢ããå¶ç´ãã®ç¯ã«è¨è¿°ããã¦ã
+ãå¶ç´ã«å¾ããªããã°ãªããªãï¼
+
+(4-1-3) SIL_UNL_INT()
+
+SIL_LOC_INT()ã«ãã£ã¦å¤æ°ã«ä¿å­ããç¶æ
+ã«æ»ããã¯ã­ï¼ãã®ãã¯ã­ãå®ç¾ã
+ãéã«ã¯ï¼ã1.5 ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã®å®ç¾ã«é¢ããå¶ç´ãã®
+ç¯ã«è¨è¿°ããã¦ããå¶ç´ã«å¾ããªããã°ãªããªãï¼
+
+4.2 å¾®å°æéå¾
+ã¡
+
+(4-2-1) void sil_dly_nse(ulong_t dlytim)
+
+dlytimã§æå®ãããä»¥ä¸ã®æéï¼åä½ã¯ããç§ï¼ï¼ã«ã¼ããªã©ã«ãã£ã¦å¾
+ã¤é¢
+æ°ï¼
+
+ä»¥ä¸ã®é¢æ°ã¨ç­ä¾¡ãªå¦çãï¼ã¢ã»ã³ããªè¨èªã§è¨è¿°ããæ¹æ³ãï¼æ¨æºçãªå®è£
+
+æ¹æ³ã¨ããï¼ã¢ã»ã³ããªè¨èªã§è¨è¿°ããã®ã¯ï¼ã³ã³ãã¤ã©ã®æé©åã«ä¾å­ããª
+ãããã«ããããã§ããï¼ã¾ããã®é¢æ°ã¯ï¼ã­ã£ãã·ã¥ç­ã®å½±é¿ãåããªãã
+ãã«ï¼ã§ããéãã¡ã¢ãªã¢ã¯ã»ã¹ãè¡ããªãããã«å®è£
+ãã¹ãã§ããï¼
+
+	void sil_dly_nse(ulong_t dlytim)
+	{
+		dlytim -= SIL_DLY_TIM1;
+		if (çµæã0ããå¤§ãã) {
+			do {
+				dlytim -= SIL_DLY_TIM2;
+			} while (çµæã0ããå¤§ãã);
+		}
+	}
+
+ãã®é¢æ°ã®åä½ã¯æ¬¡ã®éãã§ããï¼dlytimãSIL_DLY_TIM1ä»¥ä¸ã®å ´åã«ã¯ï¼æ
+åã®ifæã®æ¡ä»¶ãæç«ããï¼ããã«é¢æ°ããæããï¼dlytimãSIL_DLY_TIM1ã
+ãå¤§ããï¼(SIL_DLY_TIM1+SIL_DLY_TIM2)ä»¥ä¸ã®å ´åã«ã¯ï¼æåã®ifæã®æ¡ä»¶ã¯
+æç«ãããï¼doã«ã¼ãã¯1åãåããã«é¢æ°ããæããï¼dlytimã
+(SIL_DLY_TIM1+SIL_DLY_TIM2)ããå¤§ããï¼(SIL_DLY_TIM1+SIL_DLY_TIM2*2)ä»¥
+ä¸ã®å ´åã«ã¯ï¼doã«ã¼ãã1åã ãåã£ã¦é¢æ°ããæããï¼ãã®å¾ï¼dlytimã
+SIL_DLY_TIM2å¤§ãããªãåº¦ã«ï¼whileã«ã¼ããåãåæ°ã1åãã¤å¢ããï¼
+
+ãªãï¼ãã®é¢æ°ãã¢ã»ã³ããªè¨èªï¼ã¾ãã¯ï¼Cè¨èªï¼ã§è¨è¿°ããå ´åï¼ã©ã®ãã¡
+ã¤ã«ã«è¨è¿°ããããåé¡ã«ãªãï¼SILã®ã¿ã¼ã²ããä¾å­é¨ã«ã¯ï¼æ¨æºã§ã¯ï¼ã¢ã»
+ã³ããªè¨èªï¼ã¾ãã¯ï¼Cè¨èªï¼ã®é¢æ°å®ç¾©ãè¨è¿°ããããã®ãã¡ã¤ã«ãç¨æãã¦
+ããªãï¼ã¿ã¼ã²ããä¾å­ã§ç¨æãã¦ããããï¼ä¾å¤çã«ï¼ã«ã¼ãã«å®è£
+ã®ã¿ã¼
+ã²ããä¾å­ã¢ã¸ã¥ã¼ã«ï¼target_support.Sã¾ãã¯target_kernel_impl.cï¼ã«è¨
+è¿°ãã¦ããããã¨ã«ããï¼
+
+(4-2-2) SIL_DLY_TIM1ï¼ãªãã·ã§ã³ï¼
+(4-2-3) SIL_DLY_TIM2ï¼ãªãã·ã§ã³ï¼
+
+sil_dly_nseãä¸è¨ã®æ¨æºçãªæ¹æ³ã§å®ç¾ããå ´åï¼ãã®2ã¤ã®å®æ°ãã¿ã¼ã²ã
+ãä¾å­é¨ã§ãã¯ã­å®ç¾©ããï¼
+
+SIL_DLY_TIM2ã¯ï¼ä¸è¨ã®é¢æ°ã«ããã¦ï¼doã«ã¼ã1åã®å®è¡æéï¼åä½ã¯ããç§ï¼
+ã«è¨­å®ããï¼ã¿ã¼ã²ãããã­ã»ããµã®å½ä»¤ã»ããã«ããããï¼ããããï¼æ¸ç®
+å½ä»¤ã¨æ¡ä»¶åå²å½ä»¤å1åã®å®è¡æéã«ãªãï¼SIL_DLY_TIM2ãæ±ºã¾ãã°ï¼é¢æ°å¼
+åºããå«ããå
+¨ä½ã®æéãdlytimã§æå®ãããä»¥ä¸ã®æéã«ãªãããã«ï¼
+SIL_DLY_TIM1ãæ±ºããï¼
+
+ãã®2ã¤ã®å®æ°å¤ã®æ±ºå®ãæ¯æ´ãããã­ã°ã©ã ã¨ãã¦ï¼testãã£ã¬ã¯ããªã«ï¼
+test_dlynseãç¨æãã¦ããï¼test_dlynseãå®è¡ããã¨ï¼æ¬¡ã®ãããªåºåãå¾
+ãããï¼
+
+-- for fitting parameters --
+sil_dly_nse(0): 430 OK
+sil_dly_nse(420): 430 OK
+sil_dly_nse(510): 520 OK
+sil_dly_nse(600): 610 OK
+<ä¸­ç¥>
+-- for checking boundary conditions --
+sil_dly_nse(421): 520 OK
+sil_dly_nse(511): 610 OK
+sil_dly_nse(601): 700 OK
+
+"for fitting parameters"ã«ç¶ãåºåã¯ï¼sil_dly_nse(dlytim)ãå¼ã³åºããå ´
+åã®å¾
+ã¡æéãæ¸¬å®ããçµæã§ããï¼ãã®ãã­ã°ã©ã ãç¨ãã¦ï¼":"ã®å³å´ã®æ°
+å¤ãï¼dlytimãããå¤§ããç¯å²ã§ãªãã¹ãè¿ãå¤ã«ãªãããã«ï¼2ã¤ã®å®æ°å¤ã
+èª¿æ´ããï¼"for checking boundary conditions"ã«ç¶ãåºåã¯ï¼ãã­ã°ã©ã ã®
+å¦¥å½æ§ããã§ãã¯ããããã®ãã®ã§ï¼":"ã®å³å´ã®æ°å¤ãï¼dlytimãããå¤§ãã
+ãã¨ãç¢ºèªããï¼è¿ãå¤ã«ãªãå¿
+è¦ã¯ãªãï¼ï¼
+
+4.3 ãã­ã»ããµã®ã¨ã³ãã£ã¢ã³
+
+(4-3-1) SIL_ENDIAN_BIG
+(4-3-2) SIL_ENDIAN_LITTLE
+
+ãã­ã»ããµã®ã¨ã³ãã£ã¢ã³ã«ããï¼ããããçæ¹ã®ã·ã³ãã«ããã¯ã­å®ç¾©ããï¼
+
+(4-3-3) TOPPERS_SIL_REV_ENDIAN_UINT16ï¼ãªãã·ã§ã³ï¼
+(4-3-4) TOPPERS_SIL_REV_ENDIAN_UINT32ï¼ãªãã·ã§ã³ï¼
+
+ããããï¼16ãããï¼32ãããã®ç¬¦å·ç¡ãæ´æ°ã®ã¨ã³ãã£ã¢ã³ãåè»¢ãããã
+ã¯ã­ï¼ãã­ã»ããµãã¨ã³ãã£ã¢ã³åè»¢ã®ããã®å½ä»¤ãæã¤å ´åã«ã¯ï¼ãã®å½ä»¤
+ãç¨ãã¦å®ç¾ããï¼ãããã®ã·ã³ãã«ããã¯ã­å®ç¾©ããªãå ´åã«ã¯ï¼ããã©ã«
+ãã®å®ç¾©ãä½¿ãããï¼
+
+4.4 ã¡ã¢ãªç©ºéã¢ã¯ã»ã¹é¢æ°
+
+(4-4-1) TOPPERS_OMIT_SIL_ACCESS
+
+æ¨æºã®ã¡ã¢ãªç©ºéã¢ã¯ã»ã¹é¢æ°ãä½¿ç¨ããï¼ã¿ã¼ã²ããä¾å­é¨ã§ç¨æããå ´å
+ã«ã¯ï¼ãã®ã·ã³ãã«ããã¯ã­å®ç¾©ããï¼
+
+(4-4-2) TOPPERS_OMIT_SIL_REH_LEM
+(4-4-3) TOPPERS_OMIT_SIL_WRH_LEM
+(4-4-4) TOPPERS_OMIT_SIL_REH_BEM
+(4-4-5) TOPPERS_OMIT_SIL_WRH_BEM
+(4-4-6) TOPPERS_OMIT_SIL_REW_LEM
+(4-4-7) TOPPERS_OMIT_SIL_WRW_LEM
+(4-4-8) TOPPERS_OMIT_SIL_REW_BEM
+(4-4-9) TOPPERS_OMIT_SIL_WRW_BEM
+
+ããããï¼æ¨æºã®sil_reh_lemï¼sil_wrh_lemï¼sil_reh_bemï¼sil_wrh_bemï¼
+sil_rew_lemï¼sil_wrw_lemï¼sil_rew_bemï¼sil_wrw_bemãä½¿ç¨ããï¼ã¿ã¼ã²ã
+ãä¾å­é¨ã§ç¨æããå ´åã«ã¯ï¼ãããã®ã·ã³ãã«ããã¯ã­å®ç¾©ããï¼
+
+4.5 I/Oç©ºéã¢ã¯ã»ã¹é¢æ°
+
+ã¡ã¢ãªç©ºéã¨ã¯å¥ã«I/Oç©ºéãæã¤ãã­ã»ããµã§ã¯ï¼I/Oç©ºéã«ããããã¤ã¹ã¬
+ã¸ã¹ã¿ãã¢ã¯ã»ã¹ããããã®é¢æ°ã¨ãã¦ï¼sil_reb_iopï¼sil_wrb_iopï¼
+sil_reh_iopï¼sil_wrh_iopï¼sil_reh_lepï¼sil_wrh_lepï¼sil_reh_bepï¼
+sil_wrh_bepï¼sil_rew_iopï¼sil_wrw_iopï¼sil_rew_lepï¼sil_wrw_lepï¼
+sil_rew_bepï¼sil_wrw_bepã®ä¸­ã§å¿
+è¦ãªãã®ãï¼ã¿ã¼ã²ããä¾å­é¨ã§ç¨æããï¼
+
+
+ï¼ï¼ã«ã¼ãã«APIã®ã¿ã¼ã²ããä¾å­é¨
+
+ã«ã¼ãã«APIï¼kernel.hï¼ã®ã¿ã¼ã²ããä¾å­é¨ã®å®ç¾©ã¯ï¼target_kernel.hã¾ã
+ã¯ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼éçºç°å¢ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾
+å­é¨ï¼ãããä¾å­é¨ã§ç¨æãããããããã¡ã¤ã«ãªã©ï¼ã«å«ããï¼
+
+5.1 ã¿ã¼ã²ããå®ç¾©ã§ãµãã¼ãããæ©è½
+
+(5-1-1) TOPPERS_TARGET_SUPPORT_DIS_INT		dis_intããµãã¼ããã
+(5-1-2) TOPPERS_TARGET_SUPPORT_ENA_INT		ena_intããµãã¼ããã
+
+dis_intï¼ena_intããµãã¼ãããå ´åã«ï¼ããããã®ã·ã³ãã«ããã¯ã­å®ç¾©ã
+ãï¼
+
+5.2 å²è¾¼ã¿åªå
+åº¦ã®ç¯å²
+
+(5-2-1) TMIN_INTPRI				å²è¾¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼
+(5-2-2) TMAX_INTPRI				å²è¾¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼
+
+ããããï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿åªå
+åº¦ã®æå°å¤ï¼ï¼åªå
+åº¦ãæé«ï¼ï¼ã«ã¼ã
+ã«ç®¡çã®å²è¾¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼åªå
+åº¦ãæä½ï¼ã«å®ç¾©ããï¼TMAX_INTPRIã¯-1
+ã«åºå®ããã¦ãããï¼å¯¾ç§°æ§ã®ããã«ï¼ã¿ã¼ã²ããä¾å­é¨ã§å®ç¾©ãããã¨ã«ã
+ã¦ããï¼
+
+5.3 é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æã¨ã«ã¦ã³ãå¤ã®é²ã¿å¹
+
+
+é«åè§£è½ã¿ã¤ããã©ã¤ãã«é¢ãã¦ï¼ã¢ããªã±ã¼ã·ã§ã³ããåç
+§ã§ãããã¯ã­ã
+å®ç¾©ããï¼é«åè§£è½ã¿ã¤ããã©ã¤ãã®è©³ç´°ã«é¢ãã¦ã¯ï¼ã6.13 é«åè§£è½ã¿ã¤ã
+ãã©ã¤ããã®ç¯ãåç
+§ãããã¨ï¼
+
+(5-3-1) TCYC_HRTCNT		é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æ
+
+é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æãï¼ãã®ãã¯ã­ã«å®ç¾©ããï¼ã¿ã¤ãå¨æã2^32ã®
+å ´åã«ã¯ï¼ãã®ãã¯ã­ãå®ç¾©ããªãï¼
+
+(5-3-2) TSTEP_HRTCNT	é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã®é²ã¿å¹
+
+
+é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã®é²ã¿å¹
+ãï¼ãã®ãã¯ã­ã«å®ç¾©ããï¼ä¾ãã°ï¼é«
+åè§£è½ã¿ã¤ããï¼2ãã¤ã¯ã­ç§æ¯ã«2ãã¤ã«ã¦ã³ãã¢ããããå ´åã«ã¯ï¼
+TSTEP_HRTCNTã2ã«å®ç¾©ããï¼
+
+5.4 ã¡ã¢ãªé åç¢ºä¿ã®ããã®åå®ç¾©
+
+(5-4-1) TOPPERS_STK_T	ã¹ã¿ãã¯é åãç¢ºä¿ããããã®åï¼ãªãã·ã§ã³ï¼
+(5-4-2) TOPPERS_MPF_T	åºå®é·ã¡ã¢ãªãã¼ã«é åãç¢ºä¿ããããã®åï¼ãªãã·ã§ã³ï¼
+
+ã¹ã¿ãã¯é åã¨åºå®é·ã¡ã¢ãªãã¼ã«é åã¯ï¼æ¨æºã§ã¯intptr_tåã®é
+åã¨ãã¦
+ç¢ºä¿ãããï¼ããå¤§ããåä½ã§ã¢ã©ã¤ã³ãããããªã©ã®çç±ã§ããä»¥å¤ã®åã®
+é
+åã¨ãã¦ç¢ºä¿ããå ´åã«ã¯ï¼ããããTOPPERS_STK_Tã¨TOPPERS_MPF_Tãï¼é
+
+åã®ãã¼ã¹ã¨ãªããã¼ã¿åã«ãã¯ã­å®ç¾©ããï¼
+
+5.5 ããããã¿ã¼ã³ã®ãããæ°
+
+(5-5-1) TBIT_FLGPTN		ã¤ãã³ããã©ã°ã®ãããæ°ï¼ãªãã·ã§ã³ï¼
+
+TBIT_FLGPTNã®æ¨æºã®å®ç¾©ã§ã¯ï¼æ´æ°åã®æå¹ãããæ°ãï¼ãã®åã®sizeofã«
+CHAR_BITãä¹ãããã®ã¨ä¸è´ãã¦ãããã¨ãä»®å®ãã¦ããï¼å¤ãã®ã³ã³ãã¤ã©
+ã§ãã®ä»®å®ãæãç«ã¤ãï¼ããã§ãªãå ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ãããã®
+å®ç¾©ãä¸æ¸ãããå¿
+è¦ãããï¼ãã ãï¼ãããã®å¤ã¯16ä»¥ä¸ã§ãªããã°ãªããª
+ãï¼
+
+5.6 ã¡ã¢ãªé åç¢ºä¿ã®ããã®ãã¯ã­
+
+(5-6-1) TOPPERS_ROUND_SZï¼ãªãã·ã§ã³ï¼
+(5-6-2) TOPPERS_COUNT_SZï¼ãªãã·ã§ã³ï¼
+
+TOPPERS_COUNT_SZ(sz, unit)ã¯ï¼sz/unitãåãä¸ããå¤ãæ±ãããã¯ã­ã§ï¼ãµ
+ã¤ãºãszã®ã¡ã¢ãªé åããµã¤ãºãunitã®ãã¼ã¿åã®é
+åã§ç¢ºä¿ããå ´åã®è¦ç´ 
+æ°ãæ±ããããã«ç¨ããï¼TOPPERS_ROUND_SZ(sz, unit)ã¯ï¼sz/unitãåãä¸ã
+ããã®ã«unitããããå¤ãæ±ãããã¯ã­ã§ï¼ãµã¤ãºãszã®ã¡ã¢ãªé åããµã¤ãº
+ãunitã®ãã¼ã¿åã®é
+åã§ç¢ºä¿ããå ´åã®ãã¼ã¿ã«ãµã¤ãºãæ±ããããã«ç¨ã
+ãï¼
+
+ããããï¼æ¨æºã®TOPPERS_ROUND_SZï¼TOPPERS_COUNT_SZãé©åã§ãªãï¼ã¿ã¼ã²ã
+ãä¾å­é¨ã§ç¨æããå ´åã«ã¯ï¼ãããã®ã·ã³ãã«ãé©åãªå¤ã«ãã¯ã­å®ç¾©ããï¼
+
+5.7 ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µã®ããã®å®ç¾©ï¼ãªãã·ã§ã³ï¼
+
+ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸ããµãã¼ãããï¼ä½¿ç¨ã§ããããã«ã
+ãï¼å ´åã«ã¯ï¼æ¬¡ã®3ã¤ãå®æ½ãããã¨ãå¿
+è¦ã§ããï¼
+
+ã»ãã®ç¯ã§èª¬æããå®ç¾©ãè¡ãï¼
+ã»ï¼ç« ã«ç¤ºãã³ã¼ãä¸­ã§ï¼TOPPERS_SUPPORT_OVRHDRããã¯ã­å®ç¾©ããã¦ããå ´
+ãåã«ã®ã¿æå¹ã¨ãªãã³ã¼ããå®è£
+ããï¼
+ã»ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ããç¨æããï¼ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ãã«ã¤ãã¦
+ãã¯ï¼ã6.14 ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ããã®ç¯ãåç
+§ãããã¨ï¼
+
+(5-7-1) TOPPERS_TARGET_SUPPORT_OVRHDR
+
+ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸ããµãã¼ãããå ´åã«ã¯ï¼ãã®ã·ã³ã
+ã«ããã¯ã­å®ç¾©ããï¼
+
+(5-7-2) TMAX_OVRTIMï¼ãªãã·ã§ã³ï¼ããã©ã«ãã¯UINT32_MAXï¼
+
+ãã­ã»ããµæéã¨ãã¦ãªã¼ãã©ã³ã¿ã¤ãã«è¨­å®ã§ããæå¤§å¤ï¼åä½ã¯ãã¤ã¯ã­
+ç§ï¼ã«ãã¯ã­å®ç¾©ããï¼
+
+
+ï¼ï¼ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨
+
+ãTOPPERS/ASP1ã«ã¼ãã«ã¨ã®é¢ä¿ã
+
+ASP1ã«ã¼ãã«ã§ã¯ï¼ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨ãæ§æããé¢æ°ãï¼ã¿ã¹
+ã¯ã³ã³ãã­ã¹ãå°ç¨ï¼t_ã§å§ã¾ããã®ï¼ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãå°ç¨ï¼i_ã§å§
+ã¾ããã®ï¼ï¼ãããã®ã³ã³ãã­ã¹ãããã§ãå¼ã³åºããã¨ãã§ãããã®ï¼x_ã§
+å§ã¾ããã®ï¼ã«åãã¦ãããï¼ASP3ã«ã¼ãã«ã§ã¯åããªããã¨ã«ããï¼
+
+6.1 ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨ã®å
+±éäºé 
+
+
+ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨ã¯ï¼ä»¥ä¸ã®è¦ç´ ã§æ§æãããï¼
+
+(a) ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+
+ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããéä¾å­é¨ããåç
+§ãããã¿ã¼ã²ããä¾å­ã®å®ç¾©ã¯ï¼
+target_kernel_impl.hã¾ãã¯ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼éçºç°å¢
+ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ã§ç¨æãããããããã¡ã¤ã«ãª
+ã©ï¼ã«å«ããï¼
+
+ã¿ã¼ã²ããã®ãã¼ãã¦ã§ã¢è³æºï¼å²è¾¼ã¿ãã³ãã©çªå·ãCPUä¾å¤ãã³ãã©çªå·ï¼
+ããã¤ã¹ã¬ã¸ã¹ã¿ã®çªå°ãªã©ï¼ã®å®ç¾©ã¯ï¼ã·ã¹ãã ãµã¼ãã¹ãã¢ããªã±ã¼ã·ã§
+ã³ã«ãæç¨ã§ããããï¼ã«ã¼ãã«å®è£
+ã®ã¿ã«æç¨ãªå®ç¾©ãå«ããã¡ã¤ã«ã¨ã¯å
+ãåãã¦ï¼ç¬ç«ããããããã¡ã¤ã«ã«å«ããï¼ãã®ããããã¡ã¤ã«ã®æ¨æºçãª
+åç§°ãï¼ã·ã¹ãã ç¥ç§°.hï¼ã¾ãã¯ï¼ãããç¥ç§°.hï¼ãã­ã»ããµç¥ç§°.hï¼ã¨ããï¼
+
+(b) ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­ã¢ã¸ã¥ã¼ã«
+
+ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­ã®å¤æ°å®ç¾©ãé¢æ°ãå«ãã¢ã¸ã¥ã¼ã«ï¼Cè¨èªã§è¨
+è¿°ãããé¨åãtarget_kernel_impl.cï¼ã¢ã»ã³ããªè¨èªã§è¨è¿°ãããé¨åã
+target_support.Sã«å«ããï¼éçºç°å¢ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ããã
+ä¾å­é¨ãåãåãããã¨ãï¼ãã¡ã¤ã«ãå¤§ãããªãå ´åã«è¤æ°ã®ãã¡ã¤ã«ã«å
+å²ãããã¨ãå¯è½ã§ããï¼
+
+(c) ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨ã®ããã®ãªãã¼ã è¨è¿°
+
+ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨ã®å¤æ°åãé¢æ°åãï¼å
+é ­ã«_kernel_ãä»ä¸
+ããååã«ãªãã¼ã ããããã®ã¢ã¸ã¥ã¼ã«ï¼target_rename.defãç¨æãï¼ãã¼
+ã«ï¼utils/genrenameï¼ã«ããï¼target_rename.hã¨target_unrename.hãçæã
+ãï¼éçºç°å¢ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ãåãåããå ´å
+ã«ã¯ï¼ãªãã¼ã è¨è¿°ãåãåããï¼
+
+(d) ã¿ã¤ããã©ã¤ã
+
+ã«ã¼ãã«ãã·ã¹ãã æå»ã®æ´æ°ã«ç¨ããããé«åè§£è½ã¿ã¤ããæ½è±¡åãããã
+ã®é«åè§£è½ã¿ã¤ããã©ã¤ãã®ããããã¡ã¤ã«ï¼å®è£
+ãã¡ã¤ã«ï¼ã·ã¹ãã ã³ã³ãã£
+ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ãï¼ããããï¼target_timer.hï¼target_timer.cï¼
+target_timer.cfgã«å«ããï¼éçºç°å¢ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ããã
+ä¾å­é¨ãåãåãããã¨ãå¯è½ã§ããï¼
+
+ã¾ãï¼ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸ããµãã¼ãããå ´åã«ã¯ï¼ãªã¼
+ãã©ã³ãã³ãã©ãèµ·åããããã®ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ããï¼åããã¡ã¤ã«
+ã«å«ããï¼
+
+ãªãï¼ãã®ç« ã«ç¤ºãã³ã¼ãä¸­ã§ï¼TOPPERS_SUPPORT_OVRHDRããã¯ã­å®ç¾©ããã¦
+ããå ´åã«ã®ã¿æå¹ã¨ãªãã³ã¼ãã¯ï¼ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸
+ããµãã¼ãããªãå ´åã«ã¯ï¼å®è£
+ããå¿
+è¦ããªãï¼
+
+(e) ã³ã³ãã£ã®ã¥ã¬ã¼ã¿è¨­å®ãã¡ã¤ã«
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®è¨­å®ãã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨ãï¼target_def.csvï¼
+target.tfï¼target_check.tfã«ç¨æããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿è¨­å®ãã¡ã¤ã«ã®
+è¨è¿°æ¹æ³ã«ã¤ãã¦ã¯ï¼ï¼ç« ã§èª¬æããï¼
+
+6.2 ãã¬ã¼ã¹ã­ã°æ©è½ã¸ã®å¯¾å¿
+
+ã«ã¼ãã«ã®ãã¬ã¼ã¹ã­ã°æ©è½ã®ä¸­ã§ï¼ãã£ã¹ãããã£ï¼å²è¾¼ã¿ãã³ãã©ï¼CPUä¾
+å¤ãã³ãã©ã®éå§ã»çµäºã®ãã¬ã¼ã¹ã­ã°åå¾ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§å®è£
+ãã
+å¿
+è¦ãããï¼ã»ã¨ãã©ã®ã¿ã¼ã²ããã·ã¹ãã ã«ããã¦ï¼ãããã®å¦çã¯ã¢ã»ã³
+ããªè¨èªã§è¨è¿°ããã¦ããï¼ã¿ã¼ã²ããéä¾å­é¨åãã®ãã¬ã¼ã¹ã­ã°ãã¯ã­ã¨
+åãæ¹æ³ï¼ãã¬ã¼ã¹ã­ã°ãã¯ã­ãï¼ãã¬ã¼ã¹ã­ã°åå¾å¦çã®Cè¨èªè¨è¿°ã«ãã¯ã­
+å®ç¾©ããæ¹æ³ï¼ã¯ï¼ç¨ãããã¨ãã§ããªãï¼
+
+ããã§ï¼ã¢ã»ã³ããªè¨èªã§è¨è¿°ããã¦ããå¦çä¸­ã«ãã¬ã¼ã¹ã­ã°åå¾ãåãè¾¼
+ãå ´åã«ã¯ï¼ãã¬ã¼ã¹ã­ã°ãã¯ã­ãå®ç¾©ããã¦ããã°ï¼ãããä½ã«å®ç¾©ããã¦
+ãããã¯ç¡è¦ãã¦ï¼æ¨æºçãªãã¬ã¼ã¹ã­ã°é¢æ°ãCè¨èªã§è¨è¿°ããã¦ããã¨æ³å®
+ãã¦ï¼ãããå¼ã³åºãããã«ã³ã¼ãã£ã³ã°ããï¼
+
+å
+·ä½çã«ã¯ï¼ä¸ã®è¡¨ã®å·¦å´ã«ç¤ºãããã¬ã¼ã¹ã­ã°ãã¯ã­ãå®ç¾©ããã¦ããã°ï¼
+è¡¨ã®å³å´ã«ç¤ºããCè¨èªè¨è¿°ã¨åç­ã®å¦çãè¡ãããã«ã³ã¼ãã£ã³ã°ããï¼
+
+	ãã¬ã¼ã¹ã­ã°ãã¯ã­		ãã¬ã¼ã¹ã­ã°åå¾å¦ç
+	-----------------------------------------------
+	LOG_DSP_ENTER			log_dsp_enter(p_runtsk)
+	LOG_DSP_LEAVE			log_dsp_leave(p_runtsk)
+	LOG_INH_ENTER			log_inh_enter(inhno)
+	LOG_INH_LEAVE			log_inh_leave(inhno)
+	LOG_EXC_ENTER			log_exc_enter(excno)
+	LOG_EXC_LEAVE			log_exc_leave(excno)
+
+6.3 ã·ã¹ãã ç¶æ
+ã®ç®¡ç
+
+ASP3ã«ã¼ãã«ãæ°ããªã¿ã¼ã²ããã·ã¹ãã ã«ãã¼ãã£ã³ã°ããéã«ï¼æãéè¦
+ãªä½æ¥­ã¯ï¼ã«ã¼ãã«ãå®ç¾©ããã·ã¹ãã ç¶æ
+ãï¼ãã¼ãã¦ã§ã¢ï¼ãã­ã»ããµï¼
+ä¸ã§ã©ã®ããã«å®ç¾ãããã§ããï¼ä»¥ä¸ã®èª¬æã¯ï¼TOPPERSæ°ä¸ä»£ã«ã¼ãã«ã«ã
+ããã·ã¹ãã ç¶æ
+ã®å®ç¾©ã»æå³ãç¥ã£ã¦ãããã¨ãåæã«è¨è¿°ãã¦ããï¼
+
+6.3.1 å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®ç®¡ç
+
+å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¯ï¼NMIãé¤ããã¹ã¦ã®å²è¾¼ã¿ããã¹ã¯ããç¶æ
+ã§ããï¼å
+¨
+å²è¾¼ã¿ã­ãã¯ç¶æ
+ãç®¡çããæ©è½ã¯ï¼ã·ã¹ãã ã¤ã³ã¿ãã§ã¼ã¹ã¬ã¤ã¤ï¼SILï¼ã«
+ãã£ã¦æä¾ããï¼ã«ã¼ãã«ã¯å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ãç®¡çããªãï¼
+
+å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§ã¯ï¼sns_kerã¨ext_kerä»¥å¤ã®ã«ã¼ãã«ã®ãµã¼ãã¹ã³ã¼ã«
+ãå¼ã¶ãã¨ã¯ã§ããªããã®ã¨ãã¦ããï¼å¼ãã å ´åã«ã¯ä½ãèµ·ãããä¿è¨¼ãã¦
+ããªãï¼sns_kerã¨ext_kerããå¼ã³åºãå¦çã¯ï¼ãã¬ã¼ã¹ã­ã°åå¾å¦çã¨SILã®
+ãµã¼ãã¹ã³ã¼ã«ãé¤ãã¨ï¼call_exit_kernelã®ã¿ã§ããï¼ãã®ããï¼
+call_exit_kernelããå¼ã³åºããã®ãé¤ãã¦ï¼ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã®
+é¢æ°ãï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§å¼ã³åºãããç¶æ³ã¯èããå¿
+è¦ããªãï¼
+
+6.3.2 ã³ã³ãã­ã¹ãã®ç®¡ç
+
+å¦çåä½ãå®è¡ãããã³ã³ãã­ã¹ãã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã¨éã¿ã¹ã¯ã³ã³ã
+ã­ã¹ãã«åé¡ãããï¼
+
+ã¿ã¼ã²ããä¾å­é¨ã¯ï¼å®è¡ä¸­ã®å¦çåä½ãï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§å®è¡ããã¦
+ãããéã¿ã¹ã¯ã³ã³ãã­ã¹ãã§å®è¡ããã¦ããããå¤å¥ããæ©è½ãæä¾ããï¼
+ã¾ãï¼CPUä¾å¤ãçºçããã³ã³ãã­ã¹ãã«ã¤ãã¦å¤å¥ããæ©è½ãæä¾ããï¼
+
+ã¿ã¼ã²ããä¾å­é¨ã§ã¯ï¼å²è¾¼ã¿ãã³ãã©ã¨CPUä¾å¤ãã³ãã©ã®å
+¥å£å¦çã§éã¿ã¹
+ã¯ã³ã³ãã­ã¹ãã«åãæãï¼ãããã®åºå£å¦çã§å
+ã®ã³ã³ãã­ã¹ãã«æ»ãï¼
+
+(6-3-2-1) bool_t sense_context(void)
+
+å®è¡ä¸­ã®å¦çåä½ãï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§å®è¡ããã¦ããå ´åã«ã¯falseï¼é
+ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§å®è¡ããã¦ããå ´åã«ã¯trueãè¿ãé¢æ°ï¼ãã®é¢æ°ã¯ï¼
+CPUã­ãã¯ç¶æ
+ã§ãCPUã­ãã¯è§£é¤ç¶æ
+ã§ãå¼ã³åºããããã«å®è£
+ããªããã°ãª
+ããªãï¼
+
+6.3.3 CPUã­ãã¯ç¶æ
+ã®ç®¡ç
+
+ã¿ã¼ã²ããä¾å­é¨ã¯ï¼CPUã­ãã¯ç¶æ
+ã¸é·ç§»ããæ©è½ï¼CPUã­ãã¯è§£é¤ç¶æ
+ã¸é·
+ç§»ããæ©è½ï¼CPUã­ãã¯ç¶æ
+ã§ããããå¤å¥ããæ©è½ãæä¾ããï¼
+
+(6-3-3-1) void lock_cpu(void)
+
+CPUã­ãã¯è§£é¤ç¶æ
+ããï¼CPUã­ãã¯ç¶æ
+ã¸é·ç§»ãããé¢æ°ï¼ãã®é¢æ°ã¯ï¼CPUã­ã
+ã¯ç¶æ
+ã§å¼ã³åºããããã¨ã¯ãªãï¼å¼ã³åºãããå ´åã®åä½ã¯ä¿è¨¼ããå¿
+è¦ã
+ãªãï¼
+
+ãã®é¢æ°ãå®ç¾ããéã«ã¯ï¼ã1.5 ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã®å®ç¾
+ã«é¢ããå¶ç´ãã®ç¯ã«è¨è¿°ããã¦ããå¶ç´ã«å¾ããªããã°ãªããªãï¼
+
+(6-3-3-2) void lock_cpu_dsp(void)
+
+ã¿ã¹ã¯ãã£ã¹ãããã§ããç¶æ
+ã«ããã¦ï¼CPUã­ãã¯è§£é¤ç¶æ
+ããï¼CPUã­ãã¯
+ç¶æ
+ã¸é·ç§»ãããé¢æ°ï¼
+
+ãã®é¢æ°ã¯ï¼ãã£ã¹ãããã§ããç¶æ
+ã§ã®ã¿å¼ã³åºãããï¼ãã£ã¹ãããã§ã
+ãç¶æ
+ã«ããã¦ã¯ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§ããããï¼ãã­ã»ããµã«
+ãã£ã¦ã¯ï¼lock_cpuããå¹ççã«å®è£
+ã§ããå ´åãããï¼ããã§ãªãå ´åã«ã¯ï¼
+lock_cpuã«å®ç¾©ããã°ããï¼
+
+lock_cpu_dspã«ãã£ã¦CPUã­ãã¯ç¶æ
+ã«é·ç§»ããå¾ï¼unlock_cpuã«ãã£ã¦CPUã­ã
+ã¯ç¶æ
+ãè§£é¤ããå ´åãããï¼ãã®ããï¼lock_cpuã§CPUã­ãã¯ç¶æ
+ã«é·ç§»ãã
+åã®ç¶æ
+ãå¤æ°ã«ä¿å­ããå ´åã«ã¯ï¼lock_cpu_dspã§ããã®å¤æ°ãè¨­å®ããå¿
+
+è¦ãããï¼
+
+(6-3-3-3) void unlock_cpu(void)
+
+CPUã­ãã¯ç¶æ
+ããï¼CPUã­ãã¯è§£é¤ç¶æ
+ã¸é·ç§»ãããé¢æ°ï¼ãã®é¢æ°ã¯ï¼CPUã­ã
+ã¯è§£é¤ç¶æ
+ã§å¼ã³åºããããã¨ã¯ãªãï¼å¼ã³åºãããå ´åã®åä½ã¯ä¿è¨¼ããå¿
+
+è¦ããªãï¼
+
+ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§CPUã­ãã¯ç¶æ
+ã«é·ç§»ããå ´åã«ã¯ï¼CPUã­ãã¯è§£é¤ç¶æ
+
+ã«æ»ãã®ã¯ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«éããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãã§CPUã­ãã¯è§£
+é¤ç¶æ
+ã«æ»ããã¨ã¯ãªãï¼åæ§ã«ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãã§CPUã­ãã¯ç¶æ
+ã«é·
+ç§»ããå ´åã«ã¯ï¼CPUã­ãã¯è§£é¤ç¶æ
+ã«æ»ãã®ã¯éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«éããï¼
+ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§CPUã­ãã¯è§£é¤ç¶æ
+ã«æ»ããã¨ã¯ãªãï¼
+
+ãããã®é¢æ°ãå®ç¾ããéã«ã¯ï¼ã1.5 ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®åºå
+¥å¦çã®
+å®ç¾ã«é¢ããå¶ç´ãã®ç¯ã«è¨è¿°ããã¦ããå¶ç´ã«å¾ããªããã°ãªããªãï¼
+
+(6-3-3-4) void unlock_cpu_dsp(void)
+
+ã¿ã¹ã¯ãã£ã¹ãããã§ããç¶æ
+ã«æ»ãç¶æ³ã«ããã¦ï¼CPUã­ãã¯ç¶æ
+ããï¼CPU
+ã­ãã¯è§£é¤ç¶æ
+ã¸é·ç§»ãããé¢æ°ï¼
+
+ãã®é¢æ°ã¯ï¼CPUã­ãã¯è§£é¤å¾ã¯ï¼ãã£ã¹ãããã§ããç¶æ
+ã«æ»ãç¶æ³ã§ã®ã¿å¼
+ã³åºãããï¼ãã£ã¹ãããã§ããç¶æ
+ã«ããã¦ã¯ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤
+ç¶æ
+ã§ããããï¼ãã­ã»ããµã«ãã£ã¦ã¯ï¼unlock_cpuããå¹ççã«å®è£
+ã§ãã
+å ´åãããï¼ããã§ãªãå ´åã«ã¯ï¼unlock_cpuã«å®ç¾©ããã°ããï¼
+
+(6-3-3-5) bool_t sense_lock(void)
+
+ç¾å¨ã®ã·ã¹ãã ç¶æ
+ãï¼CPUã­ãã¯ç¶æ
+ã®å ´åã¯trueï¼CPUã­ãã¯è§£é¤ç¶æ
+ã®å ´
+åã«ã¯falseãè¿ãé¢æ°ï¼
+
+ãã®é¢æ°ãå
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§å¼ã³åºãããç¶æ³ã¯èããå¿
+è¦ããªããã¨ã
+ãï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨CPUã­ãã¯ç¶æ
+ãåºå¥ã§ããå¿
+è¦ã¯ãªãï¼NMIä»¥å¤ã«
+ã«ã¼ãã«ã®ç®¡çå¤ã®å²è¾¼ã¿ãè¨­ããªãå ´åã«ã¯ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨CPUã­ã
+ã¯ç¶æ
+ãå
+¨ãåä¸ã®ç¶æ
+ã§ããã¾ããªãï¼
+
+(6-3-3-6) void delay_for_interrupt(void)
+
+å²è¾¼ã¿ãåãä»ããããããã«å¦çãé
+å»¶ãããé¢æ°ï¼
+
+ã«ã¼ãã«å
+ã§ï¼CPUã­ãã¯ç¶æ
+ã§ã®å®è¡ãé·ããªãå ´åã«ï¼ä¸æçã«CPUã­ãã¯
+ç¶æ
+ãè§£é¤ãã¦ï¼å²è¾¼ã¿ãåãä»ããããã«ãã¦ããï¼ãã®æï¼unlock_cpuã¨
+lock_cpuããã®é ã§å¼ã³åºããï¼ãã®2ã¤ã®é¢æ°ãé£ç¶ãã¦å¼ã³åºãã¨ï¼ã¿ã¼ã²ã
+ãã«ãã£ã¦ã¯å²è¾¼ã¿ãåãä»ããããªãå ´åãããï¼ããã§ï¼unlock_cpuã¨
+lock_cpuãå¼ã³åºãéã«ï¼ãã®é¢æ°ï¼delay_for_interruptï¼ãå¼ã³åºãï¼2ã¤
+ã®é¢æ°ãé£ç¶ãã¦å¼ã³åºãã¨å²è¾¼ã¿ãåãä»ããããªãã¿ã¼ã²ããã§ã¯ï¼ãã®
+é¢æ°ã«ããï¼å²è¾¼ã¿ãåãä»ããããããã«å®è£
+ããï¼
+
+6.4 å²è¾¼ã¿ã«é¢é£ããã·ã¹ãã ç¶æ
+ã®ç®¡ç
+
+å²è¾¼ã¿çªå·ã¨å²è¾¼ã¿ãã³ãã©çªå·ã¯ã¿ã¼ã²ããå®ç¾©ã§ä»ä¸ãããããï¼ããã
+ãæå¹ãªå¤ãã©ãããå¤æ­ããæ©è½ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ç¨æããå¿
+è¦ãã
+ãï¼
+
+(6-4-0-1) bool_t VALID_INTNO(INTNO intno)
+
+intnoãï¼å²è¾¼ã¿çªå·ã¨ãã¦æå¹ãªå¤ã§ããå ´åã«trueï¼ããã§ãªãå ´åã«
+falseãè¿ããã¯ã­ï¼
+
+VALID_INTNO_DISINTï¼VALID_INTNO_CREISRãåå¥ã«å®ç¾©ãï¼ã¿ã¼ã²ããä¾å­é¨
+ã§ããã®ãã¯ã­ãä½¿ç¨ããªãå ´åã«ã¯ï¼ç¨æããå¿
+è¦ããªãï¼
+
+(6-4-0-2) bool_t VALID_INHNO(INHNO inhno)ï¼ãªãã·ã§ã³ï¼
+
+inhnoãï¼å²è¾¼ã¿ãã³ãã©çªå·ã¨ãã¦æå¹ãªå¤ã§ããå ´åã«trueï¼ããã§ãªãå ´
+åã«falseãè¿ããã¯ã­ï¼ãªãï¼ASP3ã«ã¼ãã«ã§ã¯ï¼å²è¾¼ã¿ãã³ãã©çªå·ãç¨ã
+ãAPIã¯ï¼DEF_INHã®ã¿ã§ããï¼
+
+ASP3ã«ã¼ãã«ã®ã¿ã¼ã²ããéä¾å­é¨ã§ã¯ï¼ãã®ãã¯ã­ã¯ä½¿ããã¦ããªãããï¼
+ã¿ã¼ã²ããä¾å­é¨ã§ãä½¿ç¨ããªãå ´åã«ã¯ï¼ç¨æããå¿
+è¦ããªãï¼
+
+6.4.1 å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®ç®¡ç
+
+ã¿ã¼ã²ããä¾å­é¨ã¯ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãè¨­å®ããæ©è½ã¨ï¼å²è¾¼ã¿åªå
+åº¦ã
+ã¹ã¯ãåç
+§ããæ©è½ãæä¾ããï¼
+
+(6-4-1-1) bool_t VALID_INTPRI_CHGIPM(PRI intpri)ï¼ãªãã·ã§ã³ï¼
+
+intpriãï¼chg_ipmã«å¯¾ããå²è¾¼ã¿åªå
+åº¦ã¨ãã¦æå¹ãªå¤ã§ããå ´åã«trueï¼ã
+ãã§ãªãå ´åã«falseãè¿ããã¯ã­ï¼æ¨æºã§ã¯ï¼TMIN_INTPRIä»¥ä¸ï¼TIPM_ENAALL
+ï¼ï¼0ï¼ä»¥ä¸ã®å¤ãchg_ipmã«å¯¾ããå²è¾¼ã¿åªå
+åº¦ã¨ãã¦æå¹ã§ãããï¼ã¿ã¼ã²ã
+ãä¾å­é¨ã§ãã®ãã¯ã­ãå®ç¾©ãããã¨ã§ï¼TMIN_INTPRIãããå°ããå¤ãæå¹ã¨
+ãããã¨ãã§ããï¼æå¹ãªå¤ã®ç¯å²ãç­ãã¦ã¯ãªããªãï¼ï¼
+
+(6-4-1-2) void t_set_ipm(PRI intpri)
+
+å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®å¤ãintpriã«è¨­å®ããé¢æ°ï¼
+
+ãã®é¢æ°ã¯ï¼ã¿ã¼ã²ããéä¾å­é¨ããã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§ï¼CPUã­ãã¯ç¶
+æ
+ã®å ´åã«ã®ã¿å¼ã³åºãããï¼
+
+ã¾ãï¼ãã®é¢æ°ã¯ï¼VALID_INTPRI_CHGIPM(intpri)ãtrueãè¿ãintpriã«å¯¾ãã¦
+ã®ã¿å¼ã°ããï¼intpriã«ããã§ãªãå¤ãæ¸¡ãããå ´åã®åä½ã¯ä¿è¨¼ããå¿
+è¦ã
+ãªãï¼
+
+(6-4-1-3) PRI t_get_ipm(void)
+
+å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®å¤ãåç
+§ãã¦è¿ãé¢æ°ï¼
+
+ãã®é¢æ°ã¯ï¼ã¿ã¼ã²ããéä¾å­é¨ããã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§ï¼CPUã­ãã¯ç¶
+æ
+ã®å ´åã«ã®ã¿å¼ã³åºãããï¼
+
+å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãç¨ãã¦ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ããã¹ã¦ãã¹ã¯ããç¶æ
+ã¯ï¼
+CPUã­ãã¯ç¶æ
+ã¨åºå¥ã§ãããã¨ãå¿
+è¦ã§ããï¼å
+·ä½çã«ã¯ï¼CPUã­ãã¯è§£é¤ç¶
+æ
+ã«ããã¦ï¼t_set_ipmãç¨ãã¦ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ããã¹ã¦ãã¹ã¯ããå ´å
+ã§ãï¼sense_lockã¯falseãè¿ãï¼
+
+ããã«å¯¾ãã¦ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãç¨ãã¦NMIãé¤ããã¹ã¦ã®å²è¾¼ã¿ããã¹ã¯
+ã§ããå ´åï¼ãã®ç¶æ
+ã¨å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ãåºå¥ã§ããå¿
+è¦ã¯ãªãï¼å
+¨ãå
+ä¸ã®ç¶æ
+ã§ããã¾ããªãï¼
+
+6.4.2 å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ç®¡ç
+
+ã¿ã¼ã²ããä¾å­é¨ã¯ï¼å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ãã»ããããæ©è½ã¨ã¯ãªã¢ããæ©
+è½ãæä¾ããï¼
+
+(6-4-2-1) bool_t VALID_INTNO_DISINT(INTNO intno)ï¼ãªãã·ã§ã³ï¼
+
+intnoãï¼dis_intï¼ena_intã«å¯¾ããå²è¾¼ã¿çªå·ã¨ãã¦æå¹ãªå¤ã§ããå ´åã«
+trueï¼ããã§ãªãå ´åã«falseãè¿ããã¯ã­ï¼å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ãã»ããï¼
+ã¯ãªã¢ã§ããªãintnoã«å¯¾ãã¦ã¯ï¼ãã®ãã¯ã­ãfalseãè¿ãããã«ããï¼
+
+ãã®ãã¯ã­ãå®ç¾©ããªãå ´åï¼VALID_INTNOãä½¿ãããï¼VALID_INTNOã§æå¹ã¨
+å¤æ­ãããå²è¾¼ã¿çªå·ãï¼dis_intï¼ena_intã«å¯¾ãã¦æå¹ãªå²è¾¼ã¿çªå·ã¨ä¸è´
+ãã¦ããå ´åï¼ãã®ãã¯ã­ãç¨æããå¿
+è¦ã¯ãªãï¼
+
+(6-4-2-2) bool_t disable_int(INTNO intno)
+
+intnoã§æå®ãããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ããå²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ãã»ãããï¼
+trueãè¿ãé¢æ°ï¼æå®ãããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦ï¼å²è¾¼ã¿å±æ§ãè¨­å®ã
+ãã¦ããªãå ´åã«ã¯ï¼falseãè¿ãï¼
+
+ãã®é¢æ°ã¯ï¼ã¿ã¼ã²ããéä¾å­é¨ãCPUã­ãã¯è§£é¤ç¶æ
+ã§å¼ã³åºããã¨ã¯ãªãã
+ãï¼CPUã­ãã¯è§£é¤ç¶æ
+ã§å¼ã³åºãããå ´åã®åä½ã¯ä¿è¨¼ããå¿
+è¦ããªãï¼ãã 
+ãï¼ã¿ã¼ã²ããä¾å­é¨ããCPUã­ãã¯è§£é¤ç¶æ
+ã§å¼ã³åºãå ´åã«ã¯ï¼ä¿è¨¼ããå¿
+
+è¦ãããï¼
+
+ã¾ãï¼ãã®é¢æ°ã¯ï¼VALID_INTNO_DISINT(intno)ãtrueã¨ãªãintnoã«å¯¾ãã¦ã®
+ã¿å¼ã°ããï¼intnoã«ããã§ãªãå¤ãæ¸¡ãããå ´åã®åä½ã¯ä¿è¨¼ããå¿
+è¦ããªãï¼
+
+dis_intãµã¼ãã¹ã³ã¼ã«ããµãã¼ãããå ´åï¼TOPPERS_SUPPORT_DIS_INTããã¯
+ã­å®ç¾©ããå ´åï¼ã«ã¯ï¼disable_intãç¨æããã¦ããªããã°ãªããªãï¼
+
+(6-4-2-3) bool_t enable_int(INTNO intno)
+
+intnoã§æå®ãããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ããå²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ãã¯ãªã¢ãï¼
+trueãè¿ãé¢æ°ï¼æå®ãããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦ï¼å²è¾¼ã¿å±æ§ãè¨­å®ã
+ãã¦ããªãå ´åã«ã¯ï¼falseãè¿ãï¼
+
+ãã®é¢æ°ã¯ï¼ã¿ã¼ã²ããéä¾å­é¨ãCPUã­ãã¯è§£é¤ç¶æ
+ã§å¼ã³åºããã¨ã¯ãªãã
+ãï¼CPUã­ãã¯è§£é¤ç¶æ
+ã§å¼ã³åºãããå ´åã®åä½ã¯ä¿è¨¼ããå¿
+è¦ããªãï¼ãã 
+ãï¼ã¿ã¼ã²ããä¾å­é¨ããCPUã­ãã¯è§£é¤ç¶æ
+ã§å¼ã³åºãå ´åã«ã¯ï¼ä¿è¨¼ããå¿
+
+è¦ãããï¼
+
+ã¾ãï¼ãã®é¢æ°ã¯ï¼VALID_INTNO_DISINT(intno)ãtrueã¨ãªãintnoã«å¯¾ãã¦ã®
+ã¿å¼ã°ããï¼intnoã«ããã§ãªãå¤ãæ¸¡ãããå ´åã®åä½ã¯ä¿è¨¼ããå¿
+è¦ããªãï¼
+
+ena_intãµã¼ãã¹ã³ã¼ã«ããµãã¼ãããå ´åï¼TOPPERS_SUPPORT_ENA_INTããã¯
+ã­å®ç¾©ããå ´åï¼ã«ã¯ï¼t_enable_intãç¨æããã¦ããªããã°ãªããªãï¼
+
+6.4.3 å²è¾¼ã¿è¦æ±ã®ã¯ãªã¢
+
+(6-4-3-1) void clear_int(INTNO intno)
+
+intnoã§æå®ãããå²è¾¼ã¿è¦æ±ã©ã¤ã³ãã¨ãã¸ããªã¬ã§ããå ´åã«ï¼ããªã¬ãã
+ãå²è¾¼ã¿è¦æ±ãã¯ãªã¢ããé¢æ°ï¼intnoã§æå®ãããå²è¾¼ã¿è¦æ±ã©ã¤ã³ãã¬ãã«
+ããªã¬ã§ããå ´åã«ã¯ä½ãããªãï¼
+
+ASP3ã«ã¼ãã«ã®ã¿ã¼ã²ããéä¾å­é¨ã§ã¯ï¼ãã®é¢æ°ãå¼ã³åºãã¦ããªããï¼ã¿ã¼
+ã²ããä¾å­é¨ãã·ã¹ãã ãµã¼ãã¹ã§å¼ã³åºãå¯è½æ§ãé«ãããï¼ç¨æãããã¨
+ã¨ãã¦ããï¼ãã®ããï¼ãã®é¢æ°ãã©ã®ãããªã·ã¹ãã ç¶æ
+ã§å¼ã³åºãããã¯ï¼
+ã¿ã¼ã²ããä¾å­é¨å
+ã§ä¸è²«ãã¦ããã°ããï¼
+
+6.4.4 å²è¾¼ã¿è¦æ±ã®ãã­ã¼ã
+
+(6-4-4-1) bool_t probe_int(INTNO intno)
+
+intnoã§æå®ãããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦ï¼å²è¾¼ã¿ãè¦æ±ããã¦ããå ´åã«
+trueï¼ããã§ãªãå ´åã«falseãè¿ãé¢æ°ï¼
+
+ASP3ã«ã¼ãã«ã®ã¿ã¼ã²ããéä¾å­é¨ã§ã¯ï¼ãã®é¢æ°ãå¼ã³åºãã¦ããªããï¼ã¿ã¼
+ã²ããä¾å­é¨ãã·ã¹ãã ãµã¼ãã¹ã§å¼ã³åºãå¯è½æ§ãé«ãããï¼ç¨æãããã¨
+ã¨ãã¦ããï¼ãã®ããï¼ãã®é¢æ°ãã©ã®ãããªã·ã¹ãã ç¶æ
+ã§å¼ã³åºãããã¯ï¼
+ã¿ã¼ã²ããä¾å­é¨å
+ã§ä¸è²«ãã¦ããã°ããï¼
+
+6.5 ã¿ã¹ã¯ãã£ã¹ãããã£
+
+6.5.1 ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ã¨ã¿ã¹ã¯åæåã³ã³ãã­ã¹ããã­ãã¯
+
+(6-5-1-1) TSKCTXB
+
+ã¿ã¼ã²ããä¾å­ã®ã¿ã¹ã¯ã³ã³ãã­ã¹ããä¿å­ããããã«ï¼TCBä¸­ã«æã¤ãã¨ãå¿
+
+è¦ãªãã¼ã¿æ§é ã®åãï¼TSKCTXBã«å®ç¾©ããï¼æ¨æºçã«ã¯ï¼TSKCTXBã«ã¯ï¼ã¿ã¹
+ã¯ã®ã¹ã¿ãã¯ãã¤ã³ã¿ã¨å®è¡åéçªå°ãæ ¼ç´ããï¼
+
+(6-5-1-2) USE_TSKINICTXBï¼ãªãã·ã§ã³ï¼
+(6-5-1-3) TSKINICTXBï¼ãªãã·ã§ã³ï¼
+
+ã¿ã¼ã²ããä¾å­ã®æ
+å ±ãã¿ã¹ã¯åæåãã­ãã¯ï¼TINIBï¼ã«å
+¥ãããå ´åãï¼
+TINIBä¸­ã®ã¹ã¿ãã¯é åã®ãµã¤ãºã¨å
+é ­çªå°ã®æã¡æ¹ãã¿ã¼ã²ããä¾å­ã«å¤æ´ã
+ããå ´åã«ã¯ï¼USE_TSKINICTXBããã¯ã­å®ç¾©ãï¼TINIBä¸­ã«æã¤ãã¨ãå¿
+è¦ãªãã¼
+ã¿æ§é ã®åãï¼TSKINICTXBã«å®ç¾©ããï¼
+
+USE_TSKINICTXBããã¯ã­å®ç¾©ããã¨ï¼TINIBä¸­ã«ã¹ã¿ãã¯é åã¨ãµã¤ãºã¨å
+é ­çª
+å°ãå«ã¾ããªããªãããï¼ããã«ä»£ããæ
+å ±ãTSKINICTXBä¸­ã«æã¤å¿
+è¦ãããï¼
+ã¾ãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããéä¾å­
+é¨ã§ï¼TSKINICTXBã®åæåæ
+å ±ãçæããããã®GENERATE_TSKINICTXBãï¼ãã¹
+3ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããéä¾å­é¨ã§ï¼TINIBããã¹ã¿ãã¯é åã®
+å
+é ­çªå°ãåãåºãããã®GET_STK_TSKINICTXBãå®ç¾©ããå¿
+è¦ãããï¼
+
+6.5.2 ãã£ã¹ãããã£æ¬ä½
+
+ãã£ã¹ãããã£æ¬ä½ï¼dispatcherï¼ã¯ï¼ã¿ã¼ã²ããéä¾å­é¨ããç´æ¥å¼ã³åºã
+ãããã¨ã¯ãªãï¼ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã®å
+é¨ããã®ã¿å¼ã³åºãããï¼
+
+dispatcherã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£
+é¤ç¶æ
+ã»ãã£ã¹ãããè¨±å¯ç¶æ
+ã§å¼ã³åºãããï¼
+
+dispatcherã®å¦çå
+å®¹ã¯æ¬¡ã®éãï¼
+
+----------------------------------------
+void
+dispatcher(void)
+{
+#ifdef LOG_DSP_ENTER
+	log_dsp_enter(p_runtsk);
+#endif /* LOG_DSP_ENTER */
+
+  dispatcher_0:
+	p_runtsk = p_schedtsk;
+	if (p_runtsk != NULL) {
+		èªã¿ã¹ã¯ï¼p_runtskï¼ã®TCBããã¹ã¿ãã¯ãã¤ã³ã¿ãå¾©å¸°ãã
+#ifdef LOG_DSP_LEAVE
+		log_dsp_leave(p_runtsk);
+#endif /* LOG_DSP_LEAVE */
+		èªã¿ã¹ã¯ã®TCBããå®è¡åéçªå°ãå¾©å¸°ãï¼ããã¸åå²ãã â¦ (*a)
+	}
+
+	/*
+	 *  ã¢ã¤ãã«å¦ç
+	 */
+	å²è¾¼ã¿ãè¨±å¯ãããCPUã­ãã¯è§£é¤ç¶æ
+ã«ãªãããæºåãã
+	å²è¾¼ã¿ããã¹ã¦è¨±å¯ãã
+	while (true) {
+		å²è¾¼ã¿çºçãå¾
+ã¤ â¦ (*b)
+	}
+}
+----------------------------------------
+
+(*b)ã«ããã¦ï¼å²è¾¼ã¿çºçãå¾
+ã¤å½ä»¤ãç¨æããã¦ããªãå ´åãï¼ãããçºè¡
+ããã®ãä¸é½åãªå ´åã«ã¯ï¼å²è¾¼ã¿çºçãå¾
+ã¤å¦çãçãï¼whileã«ã¼ãã«ãã£
+ã¦å²è¾¼ã¿çºçãå¾
+ã¤ããã«ãã¦ãè¯ãï¼
+
+å²è¾¼ã¿å¾
+ã¡ã®éã¯ï¼p_runtskãNULLï¼ï¼0ï¼ã«è¨­å®ããªããã°ãªããªãï¼ä¸ã®å¦
+çå
+å®¹ããã®ã¾ã¾å®è£
+ããã°ãããªãï¼ï¼ãã®ããã«è¨­å®ããªãã¨ï¼å²è¾¼ã¿ã
+ã³ãã©ããget_tidãå¼ã³åºããéã®åä½ãä»æ§ã«åè´ããªããªãï¼
+
+dispatcherãã¢ã»ã³ããªè¨èªã§è¨è¿°ããå ´åã«ã¯ï¼ãã¬ã¼ã¹ã­ã°åå¾å¦çã¯ï¼
+ã6.2 ãã¬ã¼ã¹ã­ã°æ©è½ã¸ã®å¯¾å¿ãã®ç¯ã§è¨è¿°ããæ¹æ³ã§ã³ã¼ãã£ã³ã°ããã
+ã¨ï¼ãªãï¼log_dsp_enterã¯åæãåã®ã¿ã¹ã¯ã®ã¹ã¿ãã¯ã§ï¼log_dsp_leaveã¯
+åæãå¾ã®ã¿ã¹ã¯ã®ã¹ã¿ãã¯ã§å®è¡ããï¼
+
+ãªãï¼dispatcherã«åå²ãã¦ããæï¼ã¹ã¿ãã¯ãã¤ã³ã¿ã¯ï¼æå¾ã«å®è¡ç¶æ
+ã§
+ãã£ãã¿ã¹ã¯ã®ã¹ã¿ãã¯ãæãã¦ããï¼ãã ãï¼ã«ã¼ãã«åä½éå§ç´å¾ã«ã¢ã¤
+ãã«ã«ãªã£ãæã«ã¯ï¼IDã1ã®ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãæãã¦ããï¼
+
+ãTOPPERS/ASP1ã«ã¼ãã«ã¨ã®é¢ä¿ã
+
+ã¢ã¤ãã«å¦çã®è¨­è¨ãä¸æ°ããï¼è©³ããã¯ï¼ãTOPPERS/ASP3ã«ã¼ãã« è¨­è¨ã¡ã¢ã
+ã®ãã¢ã¤ãã«å¦çãã®ç¯ãåç
+§ãããã¨ï¼
+
+6.5.3 èªçºçãªãã£ã¹ããã
+
+(6-5-3-1) void dispatch(void)
+
+ã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã°ãããµã¼ãã¹ã³ã¼ã«å¦çã«ããã¦ï¼ã¿ã¹ã¯åæã
+ãå¿
+è¦ã«ãªã£ãå ´åã«ã¯ï¼ã¿ã¹ã¯ããã®èªçºçãªãã£ã¹ãããå¦çï¼dispatchï¼
+ãå¼ã³åºãããï¼
+
+dispatchã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤
+ç¶æ
+ã»ãã£ã¹ãããè¨±å¯ç¶æ
+ã§å¼ã³åºãããï¼
+
+dispatchã®å¦çå
+å®¹ã¯æ¬¡ã®éãï¼
+
+----------------------------------------
+void
+dispatch(void)
+{
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	ovrtimer_stop();					/* ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿(*)ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ãã
+	ã¹ã¿ãã¯ãã¤ã³ã¿ãèªã¿ã¹ã¯ï¼p_runtskï¼ã®TCBã«ä¿å­ãã
+	dispatch_rãï¼å®è¡åéçªå°ã¨ãã¦èªã¿ã¹ã¯ã®TCBã«ä¿å­ãã â¦ (*a)
+	dispatcherã«åå²ãã
+
+  dispatch_r:
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	ovrtimer_start();					/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+}
+----------------------------------------
+
+ããã§ã¹ã¯ã©ããã¬ã¸ã¹ã¿(*)ã¨ã¯ï¼é¢æ°å¼åºãã«ããä¿å­ãããªãã¬ã¸ã¹ã¿ã®
+ãã¨ã§ããï¼å¿
+è¦ãªå ´åã«ã¯ï¼é¢æ°ãå¼ã³åºãå´ã§ä¿å­ããªããã°ãªããªãã
+ãï¼caller saved registerã¨å¼ã°ããå ´åãããï¼
+
+dispatchãå¼ã³åºããã¿ã¹ã¯ãæ¬¡ã«å®è¡ãããæã«ã¯ï¼å®è¡åéçªå°ã¨ãã¦ç»
+é²ããdispatch_rã«æ»ã£ã¦ããï¼dispatch_rã«ã¯ï¼dispatcherã®ã¿ããåå²ãï¼
+ãã®æã®ç¶æ
+ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨
+è§£é¤ç¶æ
+ã»ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ããï¼
+
+(6-5-3-2) void request_dispatch(void)
+
+éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«ããã¦ã¿ã¹ã¯åæããå¿
+è¦ã«ãªã£ãå ´åã«ã¯ï¼éã¿ã¹
+ã¯ã³ã³ãã­ã¹ãããã®èªçºçãªãã£ã¹ãããè¦æ±ï¼request_dispatchï¼ãå¼ã³
+åºãããï¼
+
+å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦çãï¼æ¨æºéãã«å®è£
+ããï¼dispatchãæç¤ºçã«å¼
+ã³åºãï¼å ´åã«ã¯ï¼request_dispatchã§ã¯ä½ãããå¿
+è¦ããªãï¼
+
+6.5.4 ãã£ã¹ãããã£ã®åä½éå§
+
+(6-5-4-1) void start_dispatch(void)
+
+ãã£ã¹ãããã£ã®åä½éå§å¦çï¼start_dispatchï¼ã¯ï¼ã«ã¼ãã«èµ·åæã«ï¼ã«ã¼
+ãã«ã®åæåå¦çããå¼ã³åºãããï¼start_dispatchã¯ï¼ãªã¿ã¼ã³ãããã¨ã®
+ãªãé¢æ°ã§ããï¼
+
+start_dispatchã¯ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãã§ï¼NMIãé¤ããã¹ã¦ã®å²è¾¼ã¿ããã¹
+ã¯ããç¶æ
+ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨åç­ã®ç¶æ
+ï¼ã§å¼ã³åºãããï¼
+start_dispatchå
+ã§ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãï¼CPUã­ãã¯ç¶æ
+ã»å²è¾¼ã¿
+åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã«ããªããã°ãªããªãï¼ã¾ãï¼ã¹ã¿ãã¯ãï¼IDã1ã®ã¿
+ã¹ã¯ã®ã¹ã¿ãã¯é åã«åãæããï¼
+
+start_dispatchã®å¦çå
+å®¹ã¯æ¬¡ã®éãï¼
+
+----------------------------------------
+void
+start_dispatch(void)
+{
+	ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã
+	ã¹ã¿ãã¯ãIDã1ã®ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åã«åãæãã
+	CPUã­ãã¯ç¶æ
+ã»å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã«ãã
+	dispatcher_0ã«åå²ãã
+}
+----------------------------------------
+
+6.5.5 ç¾å¨ã®ã³ã³ãã­ã¹ããæ¨ã¦ã¦ãã£ã¹ããã
+
+(6-5-5-1) void exit_and_dispatch(void)
+
+èªã¿ã¹ã¯ãçµäºããããµã¼ãã¹å¦çããã¯ï¼ç¾å¨ã®ã³ã³ãã­ã¹ããæ¨ã¦ã¦ãã£
+ã¹ãããããå¦çï¼exit_and_dispatchï¼ãå¼ã³åºãããï¼exit_and_dispatch
+ã¯ï¼ãªã¿ã¼ã³ãããã¨ã®ãªãé¢æ°ã§ããï¼
+
+exit_and_dispatchã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»å²è¾¼ã¿åªå
+åº¦ã
+ã¹ã¯å
+¨è§£é¤ç¶æ
+ã»ãã£ã¹ãããè¨±å¯ç¶æ
+ã§å¼ã³åºãããï¼
+
+exit_and_dispatchã®å¦çå
+å®¹ã¯æ¬¡ã®éãï¼
+
+----------------------------------------
+void
+exit_and_dispatch(void)
+{
+	dispatcherã«åå²ãã
+}
+----------------------------------------
+
+6.5.6 ã¿ã¹ã¯ã®èµ·åæºå
+
+(6-5-6-1) void activate_context(TCB *p_tcb)
+
+ã¿ã¹ã¯ã®èµ·åæºåå¦çï¼activate_contextï¼ã¯ï¼ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ããå®è¡ã§
+ããç¶æ
+ã«ããæã«å¼ã°ãï¼p_tcbã§æå®ãããã¿ã¹ã¯ï¼å¯¾è±¡ã¿ã¹ã¯ï¼ã®TCBä¸­
+ã®ã¹ã¿ãã¯ãã¤ã³ã¿ãåæåãï¼å®è¡åéçªå°ãã¿ã¹ã¯éå§æå¦çï¼start_rï¼
+ã«è¨­å®ããï¼ãã®æç¹ã§ã¯ï¼å¾è¿°ããçç±ã§ï¼å¯¾è±¡ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åãä½¿ã£
+ã¦ã¯ãªããªãï¼
+
+å¯¾è±¡ã¿ã¹ã¯ãæåã«å®è¡ãããæã«ã¯ï¼å¯¾è±¡ã¿ã¹ã¯ãèªã¿ã¹ã¯ã¨ãã¦ï¼å®è¡å
+éçªå°ã¨ãã¦ç»é²ããstart_rã«åå²ãã¦ããï¼start_rã«ã¯ï¼dispatcherã®ã¿
+ããåå²ãï¼ãã®æã®ç¶æ
+ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»å²è¾¼ã¿åª
+å
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã»ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ããï¼
+
+start_rã¯ï¼CPUã­ãã¯ç¶æ
+ãè§£é¤ããå¾ï¼ã¿ã¹ã¯ã®èµ·åçªå°ãå¼ã³åºãï¼ãã
+ã«ï¼ã¿ã¹ã¯ã®èµ·åçªå°ããæ»ã£ã¦ããå ´åã«ã¯ï¼ext_tskãå¼ã³åºãï¼
+
+activate_contextã¨start_rã®å¦çå
+å®¹ã¯æ¬¡ã®éãï¼
+
+----------------------------------------
+void
+activate_context(TCB *p_tcb)
+{
+	æå®ãããã¿ã¹ã¯ï¼p_tcbï¼ã®TCBä¸­ã®ã¹ã¿ãã¯ãã¤ã³ã¿ãåæåãã
+	start_rãï¼å®è¡åéçªå°ã¨ãã¦èªã¿ã¹ã¯ã®TCBã«ä¿å­ãã â¦ (*a)
+	return;
+
+  start_r:
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	ovrtimer_start();					/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	CPUã­ãã¯è§£é¤ç¶æ
+ã«ãã
+	èªã¿ã¹ã¯ï¼p_runtskï¼ã®èµ·åçªå°ãï¼æ¡å¼µæ
+å ±ããã©ã¡ã¼ã¿ã¨ãã¦å¼ã³åºã
+	ext_tskã«åå²ãã ... (*c)
+}
+----------------------------------------
+
+(*c)ã§ext_tskãå¼ã¶ä»£ããã«ï¼èªã¿ã¹ã¯ã®èµ·åçªå°ãå¼ã³åºãæã®è¿ãçªå°ã
+ext_tskã®çªå°ã¨ãã¦ããæ¹æ³ãããï¼
+
+ããã§ï¼ã¿ã¹ã¯ã®èµ·åå¦çã«ããã¦å¯¾è±¡ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åãä½¿ã£ã¦ã¯ãªã
+ãªãçç±ã¯ï¼æ¬¡ã®éãï¼å¶ç´ã¿ã¹ã¯æ¡å¼µããã±ã¼ã¸ã«ããã¦ï¼è¤æ°ã®å¶ç´ã¿ã¹
+ã¯ãã¹ã¿ãã¯é åãå
+±æãã¦ããå ´åã«ï¼ã¿ã¹ã¯ã®èµ·åæç¹ã§ã¯ï¼ãã®ã¿ã¹ã¯
+ã¨ã¹ã¿ãã¯é åãå
+±æãã¦ããã¿ã¹ã¯ãï¼ã¹ã¿ãã¯é åãä½¿ç¨ãã¦ããå¯è½æ§
+ãããããã§ããï¼
+
+ãã®ãã¼ãã£ã³ã°ã¬ã¤ãã§ã¯ï¼ã¿ã¹ã¯ã®å®è¡åéçªå°ãTCBã«ä¿å­ãã¦ãã
+(*a)ï¼ãããã¹ã¿ãã¯ã«ä¿å­ããæ¹æ³ãèãããããï¼ã¿ã¹ã¯ã®èµ·åå¦çã§ã¹
+ã¿ãã¯é åãä½¿ããªããã¨ããï¼ã¿ã¹ã¯ã®èµ·åå¦çã ãã¯ä¾å¤æ±ãããªããã°
+ãªããªãï¼ä¾ãã°ï¼ã¿ã¹ã¯ã®èµ·åå¦çã«ããã¦ã¯TCBä¸­ã®ã¹ã¿ãã¯ãã¤ã³ã¿ãç¹
+æ®ãªå¤ï¼ä¾ãã°0ï¼ã«è¨­å®ãã¦ããï¼ãã£ã¹ãããã£æ¬ä½ã§TCBä¸­ã®ã¹ã¿ãã¯ã
+ã¤ã³ã¿ããã®å¤ã®å ´åã«ã¯start_rã«åå²ããï¼start_rã«ããã¦ã¹ã¿ãã¯ãã¤
+ã³ã¿ãåæåããæ¹æ³ãèããããï¼
+
+6.6 å²è¾¼ã¿ãã³ãã©
+
+6.6.1 å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦ç
+
+ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦çã¯ï¼ä»¥ä¸ã®æ¬ä¼¼ã³ã¼ãã¨ç­ä¾¡ã«ãª
+ãããã«å®è£
+ããï¼å¦çå
+å®¹ãç­ä¾¡ã§ããã°ï¼å¦çé åºãå¤æ´ãã¦ããã¾ããª
+ãï¼
+
+ãã­ã»ããµã«ãã£ã¦ã¯ï¼æ¬ä¼¼ã³ã¼ãã«å«ã¾ããå¦çããã¼ãã¦ã§ã¢ã§å®ç¾ãã
+ã¦ããå ´åããããï¼ãã®ãããªå¦çã¯ã½ããã¦ã§ã¢ã§è¡ãå¿
+è¦ã¯ãªãï¼
+
+æ¬ä¼¼ã³ã¼ãä¸­ã§ï¼ãå°ãªãã¨ãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããç¶æ
+ãã¨ã¯ï¼
+ã«ã¼ãã«å
+é¨ã§ç¨ããä¸æçãªç¶æ
+ã§ããï¼ãã®ç¶æ
+ã®ã¾ã¾ã§ã«ã¼ãã«å¤ã«åº
+ããã¨ã¯ãªãï¼ãã®ããï¼ãã®ç¶æ
+ã§ã¯ï¼CPUã­ãã¯ç¶æ
+ã§ããã¨è­å¥ã§ããªã
+ã¦ãããï¼ä¾ãã°ï¼CPUã­ãã¯ç¶æ
+ã§ãããã¨ãç¤ºãå¤æ°ãç¨æãã¦ããå ´åã«
+ã¯ï¼ãã®ç¶æ
+ã§ã¯ãã®å¤æ°ãCPUã­ãã¯ç¶æ
+ãç¤ºãå¤ã«å¤æ´ããå¿
+è¦ã¯ãªãï¼ã¾
+ãï¼ãã®ç¶æ
+ã§ã¯ï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ï¼ã®ä¸é¨ï¼ãç¦æ­¢ããã¦ãã¦ãã
+ãï¼
+
+----------------------------------------
+void
+<å²è¾¼ã¿ã®åºå
+¥å£å¦ç>(void)
+{
+	å°ãªãã¨ãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããç¶æ
+ã«ãã â¦ (*d)
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ãã
+	if (å²è¾¼ã¿ãã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç) {
+#ifdef TOPPERS_SUPPORT_OVRHDR
+		ovrtimer_stop();				/* ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢ */ â¦ (*e)
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+		ã¹ã¿ãã¯ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãï¼
+								éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã
+	}
+	å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãï¼åãä»ããå²è¾¼ã¿ã®å²è¾¼ã¿åªå
+åº¦ã«è¨­å®ãã
+	CPUã­ãã¯è§£é¤ç¶æ
+ã«ããï¼åãä»ããå²è¾¼ã¿ãããåªå
+åº¦ã®é«ãå²è¾¼ã¿ã
+												åãä»ããããã«ããï¼
+	å²è¾¼ã¿ãã³ãã©ã®å
+¥å£ã§å¿
+è¦ãªIRCã®æä½ãè¡ãï¼å²è¾¼ã¿è¦æ±ã©ã¤ã³ãã¨ã
+				ã¸ããªã¬ã§ããå ´åã®ããªã¬ãããå²è¾¼ã¿è¦æ±ã®ã¯ãªã¢ãªã©ï¼
+
+#ifdef LOG_INH_ENTER
+	log_inh_enter(å²è¾¼ã¿ãã³ãã©çªå·);
+#endif /* LOG_INH_ENTER */
+	å²è¾¼ã¿ãã³ãã©ãå¼ã³åºã
+#ifdef LOG_INH_LEAVE
+	log_inh_leave(å²è¾¼ã¿ãã³ãã©çªå·);
+#endif /* LOG_INH_LEAVE */
+
+	å²è¾¼ã¿ãã³ãã©ã®åºå£ã§å¿
+è¦ãªIRCã®æä½ãè¡ãï¼IRCã«å¯¾ããå²è¾¼ã¿å¦ç
+														ã®çµäºéç¥ãªã©ï¼
+	å°ãªãã¨ãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããç¶æ
+ã«ãã
+	å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãï¼å²è¾¼ã¿ãåãä»ããåã®å¤ã«æ»ã â¦ (*f)
+
+	if (å²è¾¼ã¿ãã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç) {
+		ã¹ã¿ãã¯ãã¿ã¹ã¯ç¨ã®ã¹ã¿ãã¯ã«æ»ãï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã
+																â¦ (*g)
+		if (p_runtsk != p_schedtsk) {
+			CPUã­ãã¯ç¶æ
+ã«ãã â¦ (*h)
+			å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¯ï¼å
+¨è§£é¤ç¶æ
+ï¼TIPM_ENAALLï¼ã«ãªã£ã¦
+												ããªããã°ãªããªã â¦ (*i)
+			if (p_runtsk != NULL) {
+				ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ãã
+				ã¹ã¿ãã¯ãã¤ã³ã¿ãèªã¿ã¹ã¯ï¼p_runtskï¼ã®TCBã«ä¿å­ãã
+				ret_int_rãï¼å®è¡åéçªå°ã¨ãã¦èªã¿ã¹ã¯ã®TCBã«ä¿å­ãã â¦ (*a)
+				dispatcherã«åå²ãã
+			}
+			else {
+				dispatcher_0ã«åå²ãã
+			}
+
+		  ret_int_r:
+			ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã
+#ifdef TOPPERS_SUPPORT_OVRHDR
+			ovrtimer_start();			/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+		}
+#ifdef TOPPERS_SUPPORT_OVRHDR
+		else {
+			if (p_runtsk != NULL) {
+				ovrtimer_start();		/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+			}
+		}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	}
+	å²è¾¼ã¿å¦çããã®ãªã¿ã¼ã³ã«ããï¼CPUã­ãã¯è§£é¤ç¶æ
+ã«æ»ãããã«æºåãã
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã
+	å²è¾¼ã¿å¦çããã®ãªã¿ã¼ã³
+}
+----------------------------------------
+
+å²è¾¼ã¿ã®åä»ãã«ããå²è¾¼ã¿ãç¦æ­¢ãããªããã­ã»ããµã§ã¯ï¼(*d)ã«ããã¦ï¼
+å°ãªãã¨ãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããï¼ããã¯ï¼ovrtimer_stopãã¹ã¿ã
+ã¯ãåãæããå¦çç­ã«ããã¦ï¼ã«ã¼ãã«ã®å
+é¨å¤æ°ãã¢ã¯ã»ã¹ããï¼å ´åã
+ããï¼ããï¼ãããã«å¯¾ããæä»å¶å¾¡ãå¿
+è¦ãªããã§ããï¼ãªã¼ãã©ã³ã¿ã¤ã
+ããµãã¼ãããï¼ãã®ä»ã®å¦çã§ãã«ã¼ãã«ã®å
+é¨å¤æ°ãã¢ã¯ã»ã¹ããªãå ´å
+ã«ã¯ï¼(*d)ãçç¥ã§ããå ´åãããï¼
+
+ãã ãï¼ãã¼ãã¦ã§ã¢ã«ããã¹ã¿ãã¯ãã¤ã³ã¿ãåãæããæ©è½ããªããã­ã»ã
+ãµã§ã¯ï¼å²è¾¼ã¿ãã³ãã©ã®å
+¥å£å¦çã®ã§ããéãæ©ãã¿ã¤ãã³ã°ã§ï¼ã«ã¼ãã«
+ç®¡çå¤ã®å²è¾¼ã¿ãå«ãã¦ï¼ãã¹ã¦ã®å²è¾¼ã¿ãç¦æ­¢ããã®ãæã¾ããï¼è©³ããã¯ï¼
+ãå¤éå²è¾¼ã¿ã¨ã¹ã¿ãã¯ãã®é 
+ãåç
+§ãããã¨ï¼
+
+å²è¾¼ã¿ã®åä»ãã«ããå²è¾¼ã¿ãç¦æ­¢ãããªããã­ã»ããµã§ã¯ï¼(*e)ã®å¦çãï¼
+ifæã®æåã§ï¼ã¤ã¾ãï¼å²è¾¼ã¿ãçºçããã³ã³ãã­ã¹ãã«ä¾ããã«ï¼è¡ãã¹ã
+ã§ããï¼ããã¯ï¼(*d)ã«ããã¦å²è¾¼ã¿ãç¦æ­¢ããåã«å¤éå²è¾¼ã¿ãåãä»ãã
+ããå ´åã«ï¼ãã®å²è¾¼ã¿å¦çã®éããªã¼ãã©ã³ã¿ã¤ãã®åä½ãæ­¢ãã¦ãããã
+ã«å¿
+è¦ã§ããï¼ãªãï¼ovrtimer_stopã¯ï¼ãªã¼ãã©ã³ã¿ã¤ããåä½ãã¦ããªãæ
+ã¯ä½ãè¡ããªãããï¼éå°ã«å¼ã³åºãã¦ãå·®ãæ¯ããªãï¼
+
+(*f)ã«ããã¦ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå²è¾¼ã¿ãåãä»ããåã®å¤ã«æ»ãå¦çã¯ï¼
+å²è¾¼ã¿å¦çãããªã¿ã¼ã³ããã¾ã§ã«è¡ãã°ããï¼å²è¾¼ã¿å¦çããã®ãªã¿ã¼ã³ã«
+ããå²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ãæ©è½ãããå ´åã«ã¯ï¼ããã«å§ã­ã¦ãããï¼
+ãã ãï¼ãã®ããã«ããå ´åã«ã¯ï¼(*i)ã«ããã¦ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¯å
+¨è§£
+é¤ç¶æ
+ï¼TIPM_ENAALLï¼ã«ããå¦çãè¡ãå¿
+è¦ãããï¼
+
+(*g)ã«ããã¦ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæããå¦çã¯ï¼å²è¾¼ã¿å¦çããã®ãªã¿ã¼
+ã³ã«ããã¹ã¿ãã¯ã¨ã³ã³ãã­ã¹ããå
+ã«æ»ããã­ã»ããµã§ã¯ï¼dispatcherã«å
+å²ããå ´åã«ã®ã¿è¡ãã°ããï¼dispatcherã«åå²ããªãå ´åã«ã¯ï¼éã¿ã¹ã¯ã³
+ã³ãã­ã¹ãã®ã¾ã¾å¦çãç¶ãï¼å²è¾¼ã¿å¦çããã®ãªã¿ã¼ã³ã§ã¿ã¹ã¯ã³ã³ãã­ã¹
+ãã«æ»ããã¨ã«ãªãï¼
+
+(*h)ã«ããã¦CPUã­ãã¯ç¶æ
+ã«ããã®ã¯ï¼dispatcherã«åå²ããéã«ï¼CPUã­ã
+ã¯ç¶æ
+ã«ãªã£ã¦ããå¿
+è¦ãããããã§ããï¼
+
+(*i)ã®å¦çã«å°éããã®ã¯ï¼å²è¾¼ã¿å¦çåã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤ç¶æ
+
+ï¼TIPM_ENAALLï¼ã§ãã£ãå ´åã«éãããããï¼(*f)ã«ããã¦å²è¾¼ã¿åªå
+åº¦ãã¹
+ã¯ãå²è¾¼ã¿ãåãä»ããåã®å¤ã«æ»ãã¦ããã°ï¼ããã§ã¯ä½ãããªãã¦ãè¯ãï¼
+ãã ãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãæ»ãå¦çãå¾ã§è¡ãå ´åã«ã¯ï¼(*i)ã«ããã¦ï¼
+å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤ç¶æ
+ã«è¨­å®ããªããã°ãªããªãï¼ãªãï¼ããã§å²
+è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤ç¶æ
+ã«ãªã£ã¦ããªããã°ãªããªãã®ã¯ï¼dispatcher
+ã«åå²ããéã«ã¯ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã«ãªã£ã¦ããå¿
+è¦ãããã
+ãã§ããï¼
+
+ã¿ã¹ã¯ã®å®è¡ä¸­ã«å²è¾¼ã¿ãçºçãï¼å²è¾¼ã¿ããã®åºå£å¦çä¸­ã§dispatcherã«å
+å²ããå ´åï¼ãã®ã¿ã¹ã¯ãæ¬¡ã«å®è¡ãããæã«ã¯ï¼å®è¡åéçªå°ã¨ãã¦ç»é²ã
+ãret_int_rã«æ»ã£ã¦ããï¼ret_int_rã«ã¯ï¼dispatcherã®ã¿ããåå²ãï¼ãã®
+æã®ç¶æ
+ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤
+ç¶æ
+ã»ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ããï¼
+
+å²è¾¼ã¿ã®åºå
+¥å£å¦çãã¢ã»ã³ããªè¨èªã§è¨è¿°ããå ´åã«ã¯ï¼ãã¬ã¼ã¹ã­ã°åå¾
+å¦çã¯ï¼ã6.2 ãã¬ã¼ã¹ã­ã°æ©è½ã¸ã®å¯¾å¿ãã®ç¯ã§è¨è¿°ããæ¹æ³ã§ã³ã¼ãã£ã³
+ã°ãããã¨ï¼
+
+ãå¤éå²è¾¼ã¿ã¨ã¹ã¿ãã¯ã
+
+ãã¼ãã¦ã§ã¢ã«ããã¹ã¿ãã¯ãã¤ã³ã¿ãåãæããæ©è½ããªããã­ã»ããµã§ã¯ï¼
+å²è¾¼ã¿ã®å
+¥å£å¦çã«ããã¦ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãã
+åã«å¤éå²è¾¼ã¿ãåãä»ããã¨ï¼ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åãä½¿ç¨ãããï¼ãã®ã
+ãï¼åã¿ã¹ã¯ã®ã¹ã¿ãã¯é åãç¢ºä¿ããéã«ï¼ããã§åãä»ããå²è¾¼ã¿ãä½¿ç¨
+ããã¹ã¿ãã¯ãè¦è¾¼ãã§ç¢ºä¿ããªããã°ãªããªãï¼
+
+åã¿ã¹ã¯ã®ã¹ã¿ãã¯é åããªãã¹ãå°ããããããã«ã¯ï¼ã¹ã¿ãã¯ããªãã¹ã
+ä½¿ç¨ããªãå
+ã«ï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãå«ãã¦ï¼å¤éå²è¾¼ã¿ãç¦æ­¢ããã®
+ãæã¾ããï¼ä¸æ¹ã§ï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã®ç¦æ­¢æéãé·ããªãã¨ï¼ã«ã¼
+ãã«ç®¡çå¤ã®å²è¾¼ã¿ã®å¿ç­æ§ãä½ä¸ããããï¼ã¦ã¼ã¶ã«æ³¨æãä¿ãå¿
+è¦ãããï¼
+
+ç¹ã«ï¼å²è¾¼ã¿ã®åä»ã«ããå²è¾¼ã¿ãç¦æ­¢ãããï¼ãã¼ãã¦ã§ã¢ã«ããã¹ã¿ãã¯
+ãã¤ã³ã¿ãåãæããæ©è½ããªããã­ã»ããµã§ã¯ï¼æ¬¡ã®ç¹ã«æ³¨æãå¿
+è¦ã§ããï¼
+
+ãã®ãããªãã­ã»ããµã§ã¯ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãã
+åã«ï¼æå¤§ã§å²è¾¼ã¿åªå
+åº¦ã®æ®µæ°åã®å¤éå²è¾¼ã¿ãçºçãããã¨ãé²ããã¨ã¯
+ã§ããï¼åã¿ã¹ã¯ã®ã¹ã¿ãã¯é åããã®åãè¦è¾¼ãã§ç¢ºä¿ããªããã°ãªããªãï¼
+ããã§ï¼ã¹ã¿ãã¯ããªãã¹ãä½¿ç¨ããªãå
+ã«å¤éå²è¾¼ã¿ãç¦æ­¢ããããã«ï¼ã¹
+ã¯ã©ããã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ããåã«ï¼ãã¹ã¦ã®å²è¾¼ã¿ãç¦æ­¢ããã®ã
+æã¾ããï¼ãã ãï¼å²è¾¼ã¿ã®ç¦æ­¢å¦çã«å¿
+è¦ãªæä½éã®ã¬ã¸ã¹ã¿ã«ã¤ãã¦ã¯ï¼
+å²è¾¼ã¿ã®ç¦æ­¢ã«å
+ç«ã£ã¦ã¹ã¿ãã¯ã«ä¿å­ããå¿
+è¦ãããï¼
+
+ã«ã¼ãã«ã®ç®¡è½å¤ã§ã¯ãããï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿å¦çã«ããã¦ãï¼éã¿
+ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ï¼ã¾ãã¯ï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿å¦çç¨ã®ã¹
+ã¿ãã¯ï¼ã«åãæãããã¨ãæã¾ããï¼
+
+ãTOPPERS/ASP1ã«ã¼ãã«ã¨ã®é¢ä¿ã
+
+æ¬ä¼¼ã³ã¼ãã®æ§æãè¦ç´ããï¼æ¬ä¼¼ã³ã¼ãã§æ³å®ãã¦ãããã­ã»ããµã®ã¿ã¤ã
+ãå¤ããï¼ï¼
+
+reqflgãå»æ­¢ããï¼ã¾ãï¼ã¿ã¹ã¯åæãã®æ¡ä»¶å¤å®ã§ï¼dspflgããã§ãã¯ãã
+å¿
+è¦ããªããªã£ãï¼
+
+ã¢ã¤ãã«å¦çã®è¨­è¨ãå¤æ´ããããï¼å²è¾¼ã¿ãã³ãã©ã®åºå£å¦çã«ãããã¿ã¹
+ã¯åæãã«ããã¦ï¼p_runtskãNULLã¨ãªã£ã¦ããç¶æ³ãèããå¿
+è¦ãçããï¼
+
+6.6.2 å²è¾¼ã¿ãã³ãã©æ¯ã®åºå
+¥å£å¦çã®çæ
+
+å²è¾¼ã¿ãã¯ãã«ããã¼ãã¦ã§ã¢ã§å®ç¾ãã¦ããå ´åãªã©ï¼å²è¾¼ã¿ãã³ãã©æ¯ã«
+åºå
+¥å£å¦çãç¨æããæ¹ãå¹çãè¯ããã­ã»ããµã®ããã«ï¼å²è¾¼ã¿ãã³ãã©æ¯
+ã«åºå
+¥å£å¦çãçæããæ©æ§ãç¨æãã¦ããï¼
+
+ä»¥ä¸ã®ãã¯ã­ã¯ï¼æ¨æºã®å²è¾¼ã¿ç®¡çæ©è½ã®åæåå¦çãç¨ããå ´åã®ã¿ï¼ã¿ã¼
+ã²ããéä¾å­é¨ã§ä½¿ãããï¼å²è¾¼ã¿ç®¡çæ©è½ã®åæåå¦çãã¿ã¼ã²ããä¾å­é¨
+ã§ç¨æãï¼ãã®ä¸­ã§ãããã®ãã¯ã­ãä½¿ããªãå ´åã«ã¯ï¼ãããã®ãã¯ã­ãç¨
+æããå¿
+è¦ã¯ãªãï¼
+
+(6-6-2-1) INT_ENTRY(inhno, inthdr)
+
+å²è¾¼ã¿ãã³ãã©çªå·ãinhnoï¼å²è¾¼ã¿ãã³ãã©ã®é¢æ°åãinthdrã§ããå²è¾¼ã¿ã
+ã³ãã©ã®åºå
+¥å£å¦çã®ã©ãã«ãä½ããã¯ã­ï¼INTHDR_ENTRYãç¨ãã¦å²è¾¼ã¿ãã³
+ãã©æ¯ã«åºå
+¥å£å¦çãçæããå ´åã«ã¯ï¼æ¬¡ã®ããã«å®ç¾©ããï¼
+
+#define INT_ENTRY(inhno, inthdr)	_kernel_##inthdr##_##inhno
+
+å²è¾¼ã¿ãã³ãã©æ¯ã«åºå
+¥å£å¦çãä½ãå¿
+è¦ããªãå ´åã«ã¯ï¼æ¬¡ã®ããã«å®ç¾©ã
+ã¦ï¼å²è¾¼ã¿ãã³ãã©ã®é¢æ°åããã®ã¾ã¾è¿ãï¼
+
+#define INT_ENTRY(inhno, inthdr)	inthdr
+
+(6-6-2-2) INTHDR_ENTRY(inhno, inhno_num, inthdr)
+
+å²è¾¼ã¿ãã³ãã©çªå·ãinhnoï¼å²è¾¼ã¿ãã³ãã©ã®é¢æ°åãinthdrã§ããå²è¾¼ã¿ã
+ã³ãã©ã®åºå
+¥å£å¦çãçæãããã¯ã­ï¼inhno_numã«ã¯ï¼ã¢ã»ã³ããªè¨èªè¨è¿°ç¨
+ã«ï¼å²è¾¼ã¿ãã³ãã©çªå·ãæ°å¤ã§æ¸¡ãããï¼å²è¾¼ã¿ãã³ãã©æ¯ã«åºå
+¥å£å¦çã
+ä½ãå¿
+è¦ããªãå ´åã«ã¯ï¼ç©ºã«å®ç¾©ããï¼
+
+6.6.3 å²è¾¼ã¿ãã³ãã©ã®è¨­å®
+
+(6-6-3-1) void define_inh(INHNO inhno, FP int_entry)
+
+inhnoã§æå®ãããå²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦çã®çªå°ãint_entryã«è¨­å®ããï¼
+
+ãã®é¢æ°ã¯ï¼æ¨æºã®å²è¾¼ã¿ç®¡çæ©è½ã®åæåå¦çãç¨ããå ´åã®ã¿ï¼ã¿ã¼ã²ã
+ãéä¾å­é¨ããå¼ã³åºãããï¼å²è¾¼ã¿ç®¡çæ©è½ã®åæåå¦çãã¿ã¼ã²ããä¾å­
+é¨ã§ç¨æãï¼ãã®ä¸­ã§ãã®é¢æ°ãå¼ã³åºããªãå ´åã«ã¯ï¼ãã®é¢æ°ãç¨æãã
+å¿
+è¦ã¯ãªãï¼
+
+ãã®é¢æ°ã¯ï¼ã¿ã¼ã²ããéä¾å­é¨ã®ã«ã¼ãã«åæåå¦çããå¼ã³åºãããããï¼
+ã«ã¼ãã«ã®åæåå¦çï¼NMIãé¤ããã¹ã¦ã®å²è¾¼ã¿ããã¹ã¯ããã¦ããï¼ããå¼
+ã³åºããããã«å®è£
+ããã°ããï¼
+
+æå®ãããå²è¾¼ã¿ãã³ãã©çªå·ãDEF_INHã«å¯¾ãããã®ã¨ãã¦æå¹ãªå¤ã§ãªãå ´
+åã®åä½ã¯ä¿è¨¼ããå¿
+è¦ããªãï¼assertã§ã¨ã©ã¼ã¨ããã®ãæã¾ããï¼ï¼ãã
+ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãï¼ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨
+ã§å®ç¾©ããINHNO_DEFINH_VALIDãç¨ãã¦ã¨ã©ã¼ãæ¤åºããããã§ããï¼
+
+6.6.4 å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ã®è¨­å®
+
+(6-6-4-1) void config_int(INTNO intno, ATR intatr, PRI intpri)
+
+intnoã§æå®ãããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å²è¾¼ã¿å±æ§ãï¼intatrã§æå®ãããéã
+ã«è¨­å®ããï¼ã¾ãï¼å²è¾¼ã¿åªå
+åº¦ãï¼intpriã§æå®ãããå¤ã«è¨­å®ããï¼
+
+ãã®é¢æ°ã¯ï¼æ¨æºã®å²è¾¼ã¿ç®¡çæ©è½ã®åæåå¦çãç¨ããå ´åã®ã¿ï¼ã¿ã¼ã²ã
+ãéä¾å­é¨ããå¼ã³åºãããï¼å²è¾¼ã¿ç®¡çæ©è½ã®åæåå¦çãã¿ã¼ã²ããä¾å­
+é¨ã§ç¨æãï¼ãã®ä¸­ã§ãã®é¢æ°ãå¼ã³åºããªãå ´åã«ã¯ï¼ãã®é¢æ°ãç¨æãã
+å¿
+è¦ã¯ãªãï¼
+
+ãã®é¢æ°ã¯ï¼ã¿ã¼ã²ããéä¾å­é¨ã®ã«ã¼ãã«åæåå¦çããå¼ã³åºãããããï¼
+ã«ã¼ãã«ã®åæåå¦çï¼NMIãé¤ããã¹ã¦ã®å²è¾¼ã¿ããã¹ã¯ããã¦ããï¼ããå¼
+ã³åºããããã«å®è£
+ããã°ããï¼
+
+intatrã¨ãã¦è¨­å®ã§ããå²è¾¼ã¿å±æ§ã¯æ¬¡ã®éãï¼
+
+	TA_ENAINT		0x01	å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ãã¯ãªã¢
+	TA_EDGE			0x02	ã¨ãã¸ããªã¬
+
+ãã®ä»ã«ï¼ã¿ã¼ã²ããå®ç¾©ã§å²è¾¼ã¿å±æ§ãè¿½å ãã¦ãããï¼ã¿ã¼ã²ããå®ç¾©ã§
+è¿½å ããããã«ï¼ä»¥ä¸ã®å±æ§åãäºç´ããã¦ããï¼
+
+	TA_POSEDGE				ãã¸ãã£ãã¨ãã¸ããªã¬
+	TA_NEGEDGE				ãã¬ãã£ãã¨ãã¸ããªã¬
+	TA_BOTHEDGE				ä¸¡ã¨ãã¸ããªã¬
+	TA_LOWLEVEL				ã­ã¼ã¬ãã«ããªã¬
+	TA_HIGHLEVEL			ãã¤ã¬ãã«ããªã¬
+
+ãããã®å±æ§åãã¿ã¼ã²ããå®ç¾©ã§è¿½å ããå ´åã«ã¯ï¼ãã®å±æ§å¤ãæ±ºå®ãï¼
+å®ç¾©ãtarget_kernel.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼ã«å«
+ããï¼ã¾ãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãã³ãã¬ã¼ããã¡ã¤ã«ããåç
+§ã§ããããã«ï¼
+target_def.csvï¼ã¾ãã¯ï¼åç­ã®å½¹å²ãæã¤ãã¡ã¤ã«ï¼ã«å«ãï¼ã³ã³ãã£ã®ã¥
+ã¬ã¼ã¿ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããéä¾å­é¨ã§ã¨ã©ã¼ã¨ãªããªãããã«ï¼
+target.tfï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼ã§TARGET_INTATR
+ã«è¨­å®ããï¼
+
+æå®ãããå²è¾¼ã¿çªå·ãæå¹ãªå¤ã§ãªãå ´åãï¼ãã®å²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ã
+ã¦è¨­å®ã§ããªãå±æ§ãæå®ããå ´åï¼è¨­å®ã§ããªãå²è¾¼ã¿åªå
+åº¦ãæå®ããå ´
+åã®åä½ã¯ä¿è¨¼ããå¿
+è¦ããªãï¼assertã§ã¨ã©ã¼ã¨ããã®ãæã¾ããï¼ï¼ãã®
+ãããªã±ã¼ã¹ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã§ã¨ã©ã¼ãæ¤åºãã¹ãã§ããï¼ã³ã³ãã£
+ã®ã¥ã¬ã¼ã¿ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããéä¾å­é¨ã¯ï¼ãã¹2ã®ãã³ãã¬ã¼
+ããã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨ã§å®ç¾©ããINTNO_CFGINT_VALIDï¼
+TARGET_INTATRï¼INTPRI_CFGINT_VALIDãç¨ãã¦ã¨ã©ã¼ãæ¤åºãããï¼æ¨æºã®å²
+è¾¼ã¿å±æ§ï¼TA_ENAINTï¼TA_EDGEï¼ãè¨­å®ã§ããªãå ´åãï¼è¨­å®ã§ããªãå±æ§ã
+å²è¾¼ã¿åªå
+åº¦ãå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«ãã£ã¦ç°ãªãå ´åã«ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼
+ã¿ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨ã§æ¤åºããªããã°ãªããªãï¼
+
+6.6.5 å²è¾¼ã¿ç®¡çæ©è½ã®åæåå¦çã®å¤æ´
+
+(6-6-5-1) OMIT_INITIALIZE_INTERRUPTï¼ãªãã·ã§ã³ï¼
+
+å²è¾¼ã¿ç®¡çæ©è½ã®åæåå¦çãã¿ã¼ã²ããä¾å­é¨ã§ç¨æãï¼ã¿ã¼ã²ããéä¾å­
+é¨ã«å«ã¾ããæ¨æºã®å²è¾¼ã¿ç®¡çæ©è½ã®åæåå¦çãç¨ããªãå ´åã«ã¯ï¼ãã®ã·
+ã³ãã«ããã¯ã­å®ç¾©ããï¼
+
+ãã®ã·ã³ãã«ããã¯ã­å®ç¾©ããã¨ï¼INHINIBï¼INTINIBï¼initialize_interrupt
+ã®å®ç¾©ãï¼ã«ã¼ãã«ã®ã¿ã¼ã²ããéä¾å­é¨ããåãé¤ãããï¼ã¾ãï¼
+TNUM_DEF_INHNOï¼tnum_def_inhnoï¼inhinib_tableï¼TNUM_CFG_INTNOï¼
+tnum_cfg_intnoï¼intinib_tableã®å®ç¾©ã¨ï¼å²è¾¼ã¿ãã³ãã©æ¯ã®åºå
+¥å£å¦çãç
+æããããã®è¨è¿°ï¼INTHDR_ENTRYãã¯ã­ã®ãªã¹ãï¼ãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®
+ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããéä¾å­é¨ã«ãã£ã¦kernel_cfg.cã«ç
+æãããªããªãï¼
+
+(6-6-5-2) void initialize_interrupt(void)ï¼ãªãã·ã§ã³ï¼
+
+OMIT_INITIALIZE_INTERRUPTããã¯ã­å®ç¾©ããå ´åã«ã¯ï¼ãã®é¢æ°ãã¿ã¼ã²ãã
+ä¾å­é¨ã§ç¨æããï¼OMIT_INITIALIZE_INTERRUPTããã¯ã­å®ç¾©ãããã¨ã«ããå
+ãé¤ããããã®ä»ã®ãã¼ã¿åï¼å¤æ°ï¼ãã¯ã­ã¯ï¼ãã®é¢æ°ã§ä½¿ç¨ããå ´åã«ã®
+ã¿ç¨æããã°ããï¼
+
+(6-6-5-3) USE_INHINIB_TABLEï¼ãªãã·ã§ã³ï¼
+
+OMIT_INITIALIZE_INTERRUPTããã¯ã­å®ç¾©ãããï¼å²è¾¼ã¿ãã³ãã©ã®åæåã«å¿
+
+è¦ãªæ
+å ±ãkernel_cfg.cã«çæãããå ´åã«ã¯ï¼ãã®ã·ã³ãã«ããã¯ã­å®ç¾©ã
+ãï¼
+
+ãã®ã·ã³ãã«ããã¯ã­å®ç¾©ããã¨ï¼INHINIBã®å®ç¾©ãï¼ã«ã¼ãã«ã®ã¿ã¼ã²ããé
+ä¾å­é¨ããåãé¤ãããªãï¼ã¾ãï¼TNUM_DEF_INHNOï¼tnum_def_inhnoï¼
+inhinib_tableã®å®ç¾©ã¨ï¼å²è¾¼ã¿ãã³ãã©æ¯ã®åºå
+¥å£å¦çãçæããããã®è¨è¿°
+ï¼INTHDR_ENTRYãã¯ã­ã®ãªã¹ãï¼ãï¼ã¿ã¼ã²ããéä¾å­é¨ã«ãã£ã¦çæãããï¼
+
+(6-6-5-4) USE_INTINIB_TABLEï¼ãªãã·ã§ã³ï¼
+
+OMIT_INITIALIZE_INTERRUPTããã¯ã­å®ç¾©ãããï¼å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®åæåã«
+å¿
+è¦ãªæ
+å ±ãkernel_cfg.cã«çæãããå ´åã«ã¯ï¼ãã®ã·ã³ãã«ããã¯ã­å®ç¾©
+ããï¼
+
+ãã®ã·ã³ãã«ããã¯ã­å®ç¾©ããã¨ï¼INTINIBã®å®ç¾©ãï¼ã«ã¼ãã«ã®ã¿ã¼ã²ããé
+ä¾å­é¨ããåãé¤ãããªãï¼ã¾ãï¼TNUM_CFG_INTNOï¼tnum_cfg_intnoï¼
+intinib_tableã®å®ç¾©ãï¼ã¿ã¼ã²ããéä¾å­é¨ã«ãã£ã¦çæãããï¼
+
+6.6.6 ããã©ã«ãã®å²è¾¼ã¿ãã³ãã©
+
+(6-6-6-1) void default_int_handler(void)ï¼ãªãã·ã§ã³ï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«ããå²è¾¼ã¿ãã³ãã©ã®ãã¼ãã«ãçæããå ´åãªã©ã«ã¯ï¼
+å²è¾¼ã¿ãã³ãã©ãç»é²ããªãã£ãå²è¾¼ã¿ãã³ãã©çªå·ã«å¯¾ãã¦ï¼ããã©ã«ãã®
+å²è¾¼ã¿ãã³ãã©ã¨ãã¦ï¼default_int_handlerãç»é²ããï¼
+
+default_int_handlerã¯ï¼æ¨æºã®ãã®ãã¿ã¼ã²ããä¾å­é¨ã§ç¨æãããï¼ã¦ã¼ã¶
+ãç¨æãããã®ã§ç½®ãæããããããã«ï¼OMIT_DEFAULT_INT_HANDLERããã¯ã­
+å®ç¾©ããå ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§å®ç¾©ããªãããã«ããï¼ãªãï¼ã¦ã¼ã¶
+ãç¨æããå ´åã®åç§°ã¯ï¼_kernel_default_int_handlerã¨ãªãï¼
+
+6.6.7 ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿
+
+ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©ã¯ï¼ã«ã¼ãã«å
+ã®å²è¾¼ã¿åºå
+¥å£å¦çãçµç±ã
+ãã«å®è¡ããã®ãåºæ¬ã§ããï¼
+
+ãã ãï¼ãã¹ã¦ã®å²è¾¼ã¿ã§åãã¢ãã¬ã¹ã«åå²ãããã­ã»ããµã§ã¯ï¼ã«ã¼ãã«
+å
+ã®å²è¾¼ã¿åºå
+¥å£å¦çãå
+¨ãçµç±ããã«ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©ãå®
+è¡ãããã¨ãã§ããªãããï¼å²è¾¼ã¿åºå
+¥å£å¦çã®ãªãã¹ãæ©ãã¿ã¤ãã³ã°ã§ï¼
+ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã§ããããå¤å¥ãï¼å¦çå
+å®¹ãåããå¿
+è¦ãããï¼å
+·
+ä½çã«ã¯ï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã®åºå
+¥å£å¦çã§ã¯ï¼ãªã¼ãã©ã³ãã³ãã©ã®
+åæ­¢ã¨åä½éå§ãè¡ã£ã¦ã¯ãªããªãï¼ã¾ãï¼ã¿ã¹ã¯åæããè¡ãå¿
+è¦ããªãï¼
+ããã«ï¼NMIã®åºå
+¥å£å¦çã§ã¯ï¼ãã¬ã¼ã¹ã­ã°åå¾å¦çï¼log_inh_enterããã³
+log_inh_leaveï¼ãå¼ã³åºãã¦ã¯ãªããªãï¼
+
+ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©ãå®è¡ããéã«ï¼ã«ã¼ãã«å
+ã®å²è¾¼ã¿åºå
+¥å£
+å¦çã®ä¸é¨åãçµç±ããå ´åã«ã¯ï¼CPUä¾å¤ãèµ·ããå¯è½æ§ãæ¥µåæ¸ããã¨ã¨ã
+ã«ï¼CPUä¾å¤ãèµ·ããå¯è½æ§ãããå ´åã«ã¯ï¼ãã®å¯è½æ§ãã¿ã¼ã²ããä¾å­é¨ã®
+ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ã«è¨è¼ããªããã°ãªããªãï¼
+
+æ¬¡ã«ï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã®è¨­å®æ¹æ³ã«é¢ãã¦ï¼ãTOPPERSæ°ä¸ä»£ã«ã¼ãã«
+çµ±åä»æ§æ¸ãã®ã2.7.8 ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã®è¨­å®æ¹æ³ãã®ç¯ã®3ã¤ã®æ¹æ³
+ã®ããããæ¡ç¨ããããæ±ºå®ããï¼
+
+(a-1)ã¾ãã¯(a-2)ãæ¡ç¨ãï¼ã«ã¼ãã«ç®¡çå¤ã¨ããå²è¾¼ã¿ã«å¯¾ãã¦ï¼ã«ã¼ãã«
+ã®APIã«ããå²è¾¼ã¿ãã³ãã©ã®ç»é²ã¨å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ã®è¨­å®ããµãã¼ã
+ããªãå ´åã«ã¯ï¼ããã«ä»£ããæ¹æ³ãã¿ã¼ã²ããä¾å­é¨ã®ã¦ã¼ã¶ã¼ãºããã¥ã¢
+ã«ã«è¨è¿°ããï¼
+
+(a-1)ã¾ãã¯(a-2)ãæ¡ç¨ãã¦ã«ã¼ãã«ã®APIã«ããå²è¾¼ã¿ãã³ãã©ã®ç»é²ãå²è¾¼
+ã¿è¦æ±ã©ã¤ã³ã®å±æ§ã®è¨­å®ããµãã¼ãããå ´åãï¼(b)ãæ¡ç¨ããå ´åã«ã¯ï¼ã¿ã¼
+ã²ããä¾å­é¨ã«ããã¦ãããå®ç¾ããå¿
+è¦ãããï¼
+
+ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã«å¯¾ãã¦ï¼DEF_INHã«ããå²è¾¼ã¿ãã³ãã©ã®ç»é²ããµãã¼
+ãããã«ã¯ï¼æ¬¡ã®è¨­å®ãå¿
+è¦ã«ãªãï¼
+
+ã»TARGET_INHATRã«ï¼TA_NONKERNELãè¨­å®ããï¼
+
+ã»(a-1)ã¾ãã¯(a-2)ãæ¡ç¨ããå ´åã«ã¯ï¼INHNO_DEFINH_VALIDã«ï¼ã«ã¼ãã«ç®¡
+ãçå¤ã¨ããå²è¾¼ã¿ã«å¯¾å¿ããå²è¾¼ã¿ãã³ãã©çªå·ãå«ããï¼ã¾ãï¼
+ãVALID_INHNOãï¼ã«ã¼ãã«ç®¡çå¤ã¨ããå²è¾¼ã¿ãã³ãã©çªå·ãæå¹ãªå¤ã¨å¤å®
+ãããããã«ããï¼
+
+ã»(a-1)ã¾ãã¯(a-2)ãæ¡ç¨ããå ´åã«ã¯ï¼INHNO_FIX_KERNELã«ã«ã¼ãã«ç®¡çã¨
+ãããå²è¾¼ã¿ãã³ãã©çªå·ã®ãªã¹ããï¼INHNO_FIX_NONKERNELã«ã«ã¼ãã«ç®¡çå¤
+ãã¨ããå²è¾¼ã¿ãã³ãã©çªå·ã®ãªã¹ãè¨­å®ããï¼
+
+ã»DEF_INHãã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã«å¯¾å¿ã§ããããã«ããï¼æ¨æºã®å²è¾¼ã¿ç®¡
+ãçæ©è½ã®åæåå¦çãç¨ããå ´åã«ã¯ï¼define_inhãã«ã¼ãã«ç®¡çå¤ã®å²è¾¼
+ãã¿ã«å¯¾å¿ãããï¼
+
+ã»å¿
+è¦ãªå ´åã«ã¯ï¼TA_NONKERNELå±æ§ãè¨­å®ãããå²è¾¼ã¿ãã³ãã©ãã«ã¼ãã«
+ãç®¡çå¤ã¨æ±ãããã«ï¼ã«ã¼ãã«å
+ã®å²è¾¼ã¿åºå
+¥å£å¦çãä¿®æ­£ããï¼æ¨æºã®å²
+ãè¾¼ã¿ç®¡çæ©è½ã®åæåå¦çãç¨ããå ´åï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã«å¯¾ãã¦
+ãã¯ï¼ã«ã¼ãã«å
+ã®å²è¾¼ã¿åºå
+¥å£å¦çãçæããï¼ã¢ããªã±ã¼ã·ã§ã³ãç»é²ã
+ããå²è¾¼ã¿ãã³ãã©ãç´æ¥å¼ã³åºãããã«ï¼ã¿ã¼ã²ããéä¾å­é¨ã«ããè¨­å®ã
+ãããããï¼ã¿ã¼ã²ããä¾å­é¨ã§ã¯å¯¾å¿ããå¿
+è¦ããªãï¼
+
+ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã«å¯¾ãã¦ï¼CFG_INTã«ããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ã®è¨­
+å®ããµãã¼ãããã«ã¯ï¼æ¬¡ã®è¨­å®ãå¿
+è¦ã«ãªãï¼
+
+ã»(a-1)ã¾ãã¯(a-2)ãæ¡ç¨ããå ´åã«ã¯ï¼INTNO_CFGINT_VALIDã«ï¼ã«ã¼ãã«ç®¡
+ãçå¤ã¨ããå²è¾¼ã¿ã«å¯¾å¿ããå²è¾¼ã¿çªå·ãå«ããï¼ã¾ãï¼VALID_INTNOãï¼ã«ã¼
+ããã«ç®¡çå¤ã¨ããå²è¾¼ã¿çªå·ãæå¹ãªå¤ã¨å¤å®ããããã«ããï¼å¿
+è¦ã§ãã
+ãã°ï¼VALID_INTNO_DISINTã¨VALID_INTNO_CREISRã®å®ç¾©ãè¿½å ã¾ãã¯å¤æ´ããï¼
+
+ã»(a-1)ã¾ãã¯(a-2)ãæ¡ç¨ããå ´åã«ã¯ï¼INTNO_FIX_KERNELã«ã«ã¼ãã«ç®¡çã¨
+ãããå²è¾¼ã¿çªå·ã®ãªã¹ããï¼INTNO_FIX_NONKERNELã«ã«ã¼ãã«ç®¡çå¤ã¨ããå²
+ãè¾¼ã¿çªå·ã®ãªã¹ãè¨­å®ããï¼
+
+ã»INTPRI_CFGINT_VALIDã«ï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã¨ãªãåªå
+åº¦ãå«ããï¼
+
+ã»CFG_INTãã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã«å¯¾å¿ã§ããããã«ããï¼æ¨æºã®å²è¾¼ã¿ç®¡
+ãçæ©è½ã®åæåå¦çãç¨ããå ´åã«ã¯ï¼config_intãã«ã¼ãã«ç®¡çå¤ã®å²è¾¼
+ãã¿ã«å¯¾å¿ãããï¼
+
+chg_ipmã«ããï¼ï¼NMIä»¥å¤ã®ï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ããã¹ã¯ã§ããããã«
+ããå ´åã«ã¯ï¼æ¬¡ã®è¨­å®ãå¿
+è¦ã«ãªãï¼
+
+ã»VALID_INTPRI_CHGIPMãï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã¨ãªãåªå
+åº¦ãæå¹ãªå¤ã¨
+ãå¤å®ããããã«ããï¼
+
+ã»t_set_ipmãï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã¨ãªãåªå
+åº¦ãæ±ããããã«ããï¼
+
+6.6.8 å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®çæ
+
+(6-6-8-1) bool_t VALID_INTNO_CREISR(INTNO intno)ï¼ãªãã·ã§ã³ï¼
+
+intnoãï¼acre_isrã«å¯¾ããå²è¾¼ã¿çªå·ã¨ãã¦æå¹ãªå¤ã§ããå ´åã«trueï¼ãã
+ã§ãªãå ´åã«falseãè¿ããã¯ã­ï¼åççææ©è½æ¡å¼µããã±ã¼ã¸ãä½¿ç¨ããªãå ´
+åã«ã¯ï¼å®ç¾©ããå¿
+è¦ããªãï¼
+
+ãã®ãã¯ã­ãå®ç¾©ããªãå ´åï¼VALID_INTNOãä½¿ãããï¼VALID_INTNOã§æå¹ã¨
+å¤æ­ãããå²è¾¼ã¿çªå·ãï¼acre_isrã«å¯¾ãã¦æå¹ãªå²è¾¼ã¿çªå·ã¨ä¸è´ãã¦ãã
+å ´åï¼ãã®ãã¯ã­ãç¨æããå¿
+è¦ã¯ãªãï¼
+
+6.7 CPUä¾å¤ãã³ãã©ã¨CPUä¾å¤çºçæã®ã·ã¹ãã ç¶æ
+ã®åç
+§
+
+6.7.1 CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦ç
+
+CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦çã¯ï¼ä»¥ä¸ã®æ¬ä¼¼ã³ã¼ãã¨ç­ä¾¡ã«ãªãããã«å®è£
+ã
+ãï¼å¦çå
+å®¹ãç­ä¾¡ã§ããã°ï¼å¦çé åºãå¤æ´ãã¦ããã¾ããªãï¼
+
+----------------------------------------
+void
+<CPUä¾å¤ã®åºå
+¥å£å¦ç>(void)
+{
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ãã
+	CPUä¾å¤ãçºçããç¶æ³ãå¤æ­ããããã®è¿½å æ
+å ±ãã¹ã¿ãã¯ã«ä¿å­ãã â¦ (*j)
+	ãã®æç¹ã§ã®ã¹ã¿ãã¯ãã¤ã³ã¿Â±nãï¼CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã®
+										å
+é ­çªå°ã¨ããï¼å¿
+è¦ãªãä¿å­ããï¼
+	if (ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤) {
+		if (CPUä¾å¤ãã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç) {
+			ã¹ã¿ãã¯ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãï¼
+									éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã â¦ (*k)
+		}
+		ã·ã¹ãã ç¶æ
+ï¼ã³ã³ãã­ã¹ãã¯é¤ãï¼ãï¼CPUä¾å¤çºçæã®ç¶æ
+ã«ãã
+		CPUä¾å¤ãã³ãã©ãï¼CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã®å
+é ­çªå°ã
+									ãã©ã¡ã¼ã¿ï¼p_excinfï¼ã¨ãã¦å¼ã³åºã
+		if (CPUä¾å¤ãã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç) {
+			ã¹ã¿ãã¯ãã¿ã¹ã¯ç¨ã®ã¹ã¿ãã¯ã«æ»ãï¼
+									ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã â¦ (*k)
+		}
+		CPUä¾å¤å¦çããã®ãªã¿ã¼ã³å¾ã«ï¼CPUä¾å¤çºçæã®ã·ã¹ãã ç¶æ
+ã«
+													æ»ãããã«æºåãã
+	}
+	else {
+		if (CPUä¾å¤ãã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç) {
+			å°ãªãã¨ãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããç¶æ
+ã«ãã
+#ifdef TOPPERS_SUPPORT_OVRHDR
+			ovrtimer_stop();			/* ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+			ã¹ã¿ãã¯ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãï¼
+									éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã
+		}
+		å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãï¼CPUä¾å¤çºçæã®å¤ã«è¨­å®ãã â¦ (*l)
+		CPUã­ãã¯è§£é¤ç¶æ
+ã«ããï¼CPUä¾å¤çºçæã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ããã
+							åªå
+åº¦ã®é«ãå²è¾¼ã¿ãåãä»ããããã«ããï¼
+
+#ifdef LOG_EXC_ENTER
+		log_exc_enter(CPUä¾å¤ãã³ãã©çªå·);
+#endif /* LOG_EXC_ENTER */
+		CPUä¾å¤ãã³ãã©ãï¼CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã®å
+é ­çªå°ã
+									ãã©ã¡ã¼ã¿ï¼p_excinfï¼ã¨ãã¦å¼ã³åºã
+#ifdef LOG_EXC_LEAVE
+		log_exc_leave(CPUä¾å¤ãã³ãã©çªå·);
+#endif /* LOG_EXC_LEAVE */
+
+		å°ãªãã¨ãã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãç¦æ­¢ããç¶æ
+ã«ãã â¦ (*m)
+		å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãï¼CPUä¾å¤çºçæã®å¤ã«è¨­å®ãã â¦ (*n)
+
+		if (CPUä¾å¤ãã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºç) {
+			ã¹ã¿ãã¯ãã¿ã¹ã¯ç¨ã®ã¹ã¿ãã¯ã«æ»ãï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã
+																	â¦ (*g)
+			if (p_runtsk != p_schedtsk) {
+				CPUã­ãã¯ç¶æ
+ã«ãã â¦ (*h)
+				å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¯ï¼å
+¨è§£é¤ç¶æ
+ï¼TIPM_ENAALLï¼ã«ãªã£ã¦
+												ããªããã°ãªããªã â¦ (*i)
+				if (p_runtsk != NULL) {
+					ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ãã
+					ã¹ã¿ãã¯ãã¤ã³ã¿ãèªã¿ã¹ã¯ï¼p_runtskï¼ã®TCBã«ä¿å­ãã
+					ret_exc_rãï¼å®è¡åéçªå°ã¨ãã¦èªã¿ã¹ã¯ã®TCBã«ä¿å­ãã
+																	â¦ (*a)
+					dispatcherã«åå²ãã
+				}
+				else {
+					dispatcher_0ã«åå²ãã
+				}
+
+			  ret_exc_r:
+				ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã
+#ifdef TOPPERS_SUPPORT_OVRHDR
+				ovrtimer_start();		/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+			}
+#ifdef TOPPERS_SUPPORT_OVRHDR
+			else {
+				if (p_runtsk != NULL) {
+					ovrtimer_start();	/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+				}
+			}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+		}
+		CPUä¾å¤å¦çããã®ãªã¿ã¼ã³å¾ã«ï¼CPUã­ãã¯è§£é¤ç¶æ
+ã«æ»ãããã«æºåãã
+	}
+	CPUä¾å¤ãçºçããç¶æ³ãå¤æ­ããããã®è¿½å æ
+å ±ãã¹ã¿ãã¯ä¸ããæ¨ã¦ã
+	ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã
+	CPUä¾å¤å¦çããã®ãªã¿ã¼ã³
+}
+----------------------------------------
+
+CPUä¾å¤ãã³ãã©ã¯ï¼éã³ã³ãã­ã¹ãã«åãæãããã¨ãé¤ãã¦ã¯ï¼CPUä¾å¤çº
+çæã¨åãã·ã¹ãã ç¶æ
+ã§å¼ã³åºããªããã°ãªããªãï¼ä¾ãã°ï¼CPUä¾å¤ãCPU
+ã­ãã¯ç¶æ
+ã§çºçããå ´åã«ã¯CPUã­ãã¯ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶æ
+ã§çºçãã
+å ´åã«ã¯CPUã­ãã¯è§£é¤ç¶æ
+ã§ï¼CPUä¾å¤ãã³ãã©ãå¼ã³åºããªããã°ãªããªãï¼
+CPUã­ãã¯ç¶æ
+ã§çºçããCPUä¾å¤ã¯ï¼ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã¨ãªãããï¼ã«ã¼
+ãã«ç®¡çã®CPUä¾å¤ãã³ãã©ã«ã¤ãã¦ã¯ï¼CPUã­ãã¯è§£é¤ç¶æ
+ã§å¼ã³åºããã¨ã«
+ãªãï¼
+
+(*j)ã§ã¯ï¼CPUä¾å¤ãã³ãã©ã®ä¸­ï¼ããã³ï¼ããããå¼ã³åºãããxsns_dpnï¼ã§
+ã¯ï¼CPUä¾å¤ãçºçããç¶æ³ãå¤æ­ããããã«å¿
+è¦ã¨ãªãè¿½å æ
+å ±ãã¹ã¿ãã¯ã«
+ä¿å­ããï¼è¿½å æ
+å ±ãå¿
+è¦ãªãå ´åã¯ï¼(*j)ã®å¦çã¯å¿
+è¦ãªãï¼
+
+ãã­ã»ããµã«ãã£ã¦ã¯ï¼ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ãæ­£ç¢ºã«å¤å®ããã®ãé£ãã
+å ´åãããï¼ãã®ãããªå ´åã«ã¯ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤ã§ãªãç¶æ
+ã§
+çºçããCPUä¾å¤ãï¼ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã¨æ±ã£ã¦ãããï¼ããã¯ï¼å²è¾¼
+ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤ã§ãªãå ´åã«ã¯xsns_dpnãtrueãè¿ãããï¼ã«ã¼ãã«
+æ©è½ãç¨ãããªã«ããªãã§ããªãããã§ããï¼
+
+å
+·ä½çã«ã¯ï¼å
+¨å²è¾¼ã¿ã­ãã¯ï¼ã¾ãã¯CPUã­ãã¯ï¼ãå°ãããªã¼ããããã§å®ç¾
+ãããã¨ããã¨ï¼CPUä¾å¤ãã³ãã©ã®ä¸­ã§ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ï¼ã¾ãã¯CPUã­ã
+ã¯ç¶æ
+ï¼ã¨å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãé«ãã¬ãã«ã«è¨­å®ããç¶æ
+ãåºå¥ã§ããªãå ´
+åãããï¼ã¾ãï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿å¦çä¸­ãã«ã¼ãã«å®è¡ä¸­ã§ãããã¨
+ãæ­£ç¢ºã«å¤æ­ãããã¨ãé£ããå ´åãããï¼
+
+ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã®å ´åã«ï¼(*k)ã«ããã¦ï¼ã¹ã¿ãã¯ãéã¿ã¹ã¯ã³ã³ã
+ã­ã¹ãç¨ã®ã¹ã¿ãã¯ã«åãæãï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã¦ãããï¼
+ãã®åæãã¯ã¿ã¼ã²ããå®ç¾©ã§çãã¦ãè¯ãï¼ããã¯ï¼ã«ã¼ãã«ç®¡çå¤ã®CPUä¾
+å¤ã¯ï¼ã«ã¼ãã«å
+ã®ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ä¸­ã§çºçããå¯è½æ§ãããããï¼
+å®å
+¨ã«åãæããããã¨ã¯éããªãããã§ããï¼ã¾ãï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼
+ã¿ãã³ãã©ãå¼ã¶æã®ã³ã³ãã­ã¹ããã¹ã¿ãã¯ã¯ã¿ã¼ã²ããä¾å­ãªã®ã§ï¼ã«ã¼
+ãã«ç®¡çå¤ã®CPUä¾å¤ãã³ãã©ãããã¨åæ§ã«æ±ã£ã¦è¯ãã¨èããããããã§ã
+ãï¼
+
+ä¸ã®æ¬ä¼¼ã³ã¼ãã§ã¯ï¼ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã«å¯¾ãã¦ï¼ãã¬ã¼ã¹ã­ã°åå¾å¦
+çï¼log_exc_enterããã³log_exc_leaveï¼ãå¼ã³åºãã¦ããªããï¼å
+¨å²è¾¼ã¿ã­ã
+ã¯ç¶æ
+ãNMIã®å¦çä¸­ã«CPUä¾å¤ãçºçããå ´åãé¤å¤ããã°ï¼å¼ã³åºãã¦ãã
+ã¾ããªãï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ãNMIã®å¦çä¸­ã«çºçããCPUä¾å¤ã®å ´åã«ã¯ï¼
+ãã¬ã¼ã¹ã­ã°åå¾å¦çãå¼ã³åºãã¦ã¯ãªããªãï¼
+
+(*l)ã®å¦çã¯ï¼CPUä¾å¤ã®çºçï¼åä»ã«ããï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤åããªã
+ãã­ã»ããµã§ã¯çãã¦ãããï¼ããã«å¯¾ãã¦(*n)ã®å¦çã¯ï¼CPUä¾å¤ãã³ãã©ä¸­
+ã§å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤æ´ãããå ´åã«å¯¾å¿ããããã®ãã®ãªã®ã§ï¼çãã
+ã¨ã¯ã§ããªãï¼
+
+(*m)ã®å¦çã¯ï¼ãã­ã»ããµã«ãã£ã¦ã¯ï¼CPUä¾å¤ãã¿ã¹ã¯ã³ã³ãã­ã¹ãã§çºçã
+ãæã®ã¿ã«è¡ã£ã¦ãããå ´åãããï¼
+
+CPUä¾å¤ãã³ãã©ãå®è¡ããéã«çµç±ããé¨åã§ã¯ï¼CPUä¾å¤ãèµ·ããå¯è½æ§ã
+æ¥µåæ¸ããã¨ã¨ãã«ï¼CPUä¾å¤ãèµ·ããå¯è½æ§ãããå ´åï¼ä¾ãã°ï¼ã¹ã¯ã©ãã
+ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ããæã«ï¼ãã¹ã¨ã©ã¼ãªã©ã®CPUä¾å¤ãçºçããå¯è½
+æ§ãèããããï¼ã«ã¯ï¼ãã®å¯è½æ§ãã¿ã¼ã²ããä¾å­é¨ã®ã¦ã¼ã¶ã¼ãºããã¥ã¢
+ã«ã«è¨è¼ããªããã°ãªããªãï¼
+
+CPUä¾å¤ãã³ãã©ã®åºå£å¦çã¯ï¼å²è¾¼ã¿ãã³ãã©ã®åºå£å¦çã¨å
+±éé¨åãå¤ãã
+ãï¼ãã­ã»ããµã«ãã£ã¦ã¯ï¼å
+±éã®ã«ã¼ãã³ãç¨ãããã¨ãã§ããå¯è½æ§ãã
+ãï¼
+
+CPUä¾å¤ã®åºå
+¥å£å¦çãã¢ã»ã³ããªè¨èªã§è¨è¿°ããå ´åã«ã¯ï¼ãã¬ã¼ã¹ã­ã°åå¾
+å¦çã¯ï¼ã6.2 ãã¬ã¼ã¹ã­ã°æ©è½ã¸ã®å¯¾å¿ãã®ç¯ã§è¨è¿°ããæ¹æ³ã§ã³ã¼ãã£ã³
+ã°ãããã¨ï¼
+
+ãTOPPERS/ASP1ã«ã¼ãã«ã¨ã®é¢ä¿ã
+
+æ¬ä¼¼ã³ã¼ãã®æ§æãè¦ç´ããï¼æ¬ä¼¼ã³ã¼ãã§æ³å®ãã¦ãããã­ã»ããµã®ã¿ã¤ã
+ãå¤ããï¼ï¼
+
+reqflgãå»æ­¢ããï¼ã¾ãï¼ã¿ã¹ã¯åæãã®æ¡ä»¶å¤å®ã§ï¼dspflgããã§ãã¯ãã
+å¿
+è¦ããªããªã£ãï¼
+
+ã¢ã¤ãã«å¦çã®è¨­è¨ãå¤æ´ããããï¼CPUä¾å¤ãã³ãã©ã®åºå£å¦çã«ãããã¿ã¹
+ã¯åæãã«ããã¦ï¼p_runtskãNULLã¨ãªã£ã¦ããç¶æ³ãèããå¿
+è¦ãçããï¼
+
+6.7.2 CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦çã®çæ
+
+CPUä¾å¤ãã¯ãã«ããã¼ãã¦ã§ã¢ã§å®ç¾ãã¦ããå ´åãªã©ï¼CPUä¾å¤ãã³ãã©æ¯
+ã«åºå
+¥å£å¦çãç¨æããæ¹ãå¹çãè¯ãã¿ã¼ã²ããã®ããã«ï¼CPUä¾å¤ãã³ãã©
+æ¯ã«åºå
+¥å£å¦çãçæããæ©æ§ãç¨æãã¦ããï¼
+
+ä»¥ä¸ã®ãã¯ã­ã¯ï¼æ¨æºã®CPUä¾å¤ç®¡çæ©è½ã®åæåå¦çãç¨ããå ´åã®ã¿ï¼ã¿ã¼
+ã²ããéä¾å­é¨ã§ä½¿ãããï¼CPUä¾å¤ç®¡çæ©è½ã®åæåå¦çãã¿ã¼ã²ããä¾å­é¨
+ã§ç¨æãï¼ãã®ä¸­ã§ãããã®ãã¯ã­ãä½¿ããªãå ´åã«ã¯ï¼ãããã®ãã¯ã­ãç¨
+æããå¿
+è¦ã¯ãªãï¼
+
+(6-7-2-1) EXC_ENTRY(excno, exchdr)
+
+CPUä¾å¤ãã³ãã©çªå·ãexcnoï¼CPUä¾å¤ãã³ãã©ã®é¢æ°åãexchdrã§ããCPUä¾
+å¤ãã³ãã©ã®åºå
+¥å£å¦çã®ã©ãã«ãä½ããã¯ã­ï¼EXCHDR_ENTRYãç¨ãã¦CPUä¾å¤
+ãã³ãã©æ¯ã«åºå
+¥å£å¦çãçæããå ´åã«ã¯ï¼æ¬¡ã®ããã«å®ç¾©ããï¼
+
+#define EXC_ENTRY(excno, exchdr)	_kernel_##exchdr##_##excno
+
+CPUä¾å¤ãã³ãã©æ¯ã«åºå
+¥å£å¦çãä½ãå¿
+è¦ããªãå ´åã«ã¯ï¼æ¬¡ã®ããã«å®ç¾©ã
+ã¦ï¼CPUä¾å¤ãã³ãã©ã®é¢æ°åããã®ã¾ã¾è¿ãï¼
+
+#define EXC_ENTRY(excno, exchdr)	exchdr
+
+(6-7-2-2) EXCHDR_ENTRY(excno, excno_num, exchdr)
+
+CPUä¾å¤ãã³ãã©çªå·ãexcnoï¼CPUä¾å¤ãã³ãã©ã®é¢æ°åãexchdrã§ããCPUä¾
+å¤ãã³ãã©ã®åºå
+¥å£å¦çãçæãããã¯ã­ï¼excno_numã«ã¯ï¼ã¢ã»ã³ããªè¨èªè¨
+è¿°ç¨ã«ï¼CPUä¾å¤ãã³ãã©çªå·ãæ°å¤ã§æ¸¡ãããï¼CPUä¾å¤ãã³ãã©æ¯ã«åºå
+¥å£
+å¦çãä½ãå¿
+è¦ããªãå ´åã«ã¯ï¼ç©ºã«å®ç¾©ããï¼
+
+6.7.3 CPUä¾å¤ãã³ãã©ã®è¨­å®
+
+(6-7-3-1) bool_t VALID_EXCNO(EXCNO excno)ï¼ãªãã·ã§ã³ï¼
+
+excnoãï¼CPUä¾å¤ãã³ãã©çªå·ã¨ãã¦æå¹ãªå¤ã§ããå ´åã«trueï¼ããã§ãªã
+å ´åã«falseãè¿ããã¯ã­ï¼ãªãï¼ASP3ã«ã¼ãã«ã§ã¯ï¼CPUä¾å¤ãã³ãã©çªå·ã
+ç¨ããAPIã¯ï¼DEF_EXCã®ã¿ã§ããï¼
+
+ASP3ã«ã¼ãã«ã®ã¿ã¼ã²ããéä¾å­é¨ã§ã¯ï¼ãã®ãã¯ã­ã¯ä½¿ããã¦ããªãããï¼
+ã¿ã¼ã²ããä¾å­é¨ã§ä½¿ããªããªãï¼ç¨æããå¿
+è¦ããªãï¼
+
+(6-7-3-2) void define_exc(EXCNO excno, FP exc_entry)
+
+excnoã§æå®ãããCPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦çã®çªå°ãexc_entryã«è¨­å®ããï¼
+
+ãã®é¢æ°ã¯ï¼æ¨æºã®CPUä¾å¤ç®¡çæ©è½ã®åæåå¦çãç¨ããå ´åã®ã¿ï¼ã¿ã¼ã²ã
+ãéä¾å­é¨ããå¼ã³åºãããï¼CPUä¾å¤ç®¡çæ©è½ã®åæåå¦çãã¿ã¼ã²ããä¾å­
+é¨ã§ç¨æãï¼ãã®ä¸­ã§ãã®é¢æ°ãå¼ã³åºããªãå ´åã«ã¯ï¼ãã®é¢æ°ãç¨æãã
+å¿
+è¦ã¯ãªãï¼
+
+ãã®é¢æ°ã¯ï¼ã¿ã¼ã²ããéä¾å­é¨ã®ã«ã¼ãã«åæåå¦çããå¼ã³åºãããããï¼
+ã«ã¼ãã«ã®åæåå¦çï¼NMIãé¤ããã¹ã¦ã®å²è¾¼ã¿ããã¹ã¯ããã¦ããï¼ããå¼
+ã³åºããããã«å®è£
+ããã°ããï¼
+
+æå®ãããCPUä¾å¤ãã³ãã©çªå·ãDEF_EXCã«å¯¾ãããã®ã¨ãã¦æå¹ãªå¤ã§ãªã
+å ´åã®åä½ã¯ä¿è¨¼ããå¿
+è¦ããªãï¼assertã§ã¨ã©ã¼ã¨ããã®ãæã¾ããï¼ï¼ã
+ãã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãï¼ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­
+é¨ã§å®ç¾©ããEXCNO_VALIDãç¨ãã¦ã¨ã©ã¼ãæ¤åºããããã§ããï¼
+
+6.7.4 CPUä¾å¤ç®¡çæ©è½ã®åæåå¦çã®å¤æ´
+
+(6-7-4-1) OMIT_INITIALIZE_EXCEPTIONï¼ãªãã·ã§ã³ï¼
+
+CPUä¾å¤ç®¡çæ©è½ã®åæåå¦çãã¿ã¼ã²ããä¾å­é¨ã§ç¨æãï¼ã¿ã¼ã²ããéä¾å­
+é¨ã«å«ã¾ããæ¨æºã®å²è¾¼ã¿ç®¡çæ©è½ã®åæåå¦çãç¨ããªãå ´åã«ã¯ï¼ãã®ã·
+ã³ãã«ããã¯ã­å®ç¾©ããï¼
+
+ãã®ã·ã³ãã«ããã¯ã­å®ç¾©ããã¨ï¼EXCINIBã¨initialize_exceptionã®å®ç¾©ãï¼
+ã«ã¼ãã«ã®ã¿ã¼ã²ããéä¾å­é¨ããåãé¤ãããï¼ã¾ãï¼TNUM_DEF_EXCNOï¼
+tnum_def_excnoï¼excinib_tableã®å®ç¾©ã¨ï¼CPUä¾å¤ãã³ãã©æ¯ã®åºå
+¥å£å¦çã
+çæããããã®è¨è¿°ï¼EXCHDR_ENTRYãã¯ã­ã®ãªã¹ãï¼ãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿
+ã®ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããéä¾å­é¨ã«ãã£ã¦kernel_cfg.cã«
+çæãããªããªãï¼
+
+(6-7-4-2) void initialize_exception(void)ï¼ãªãã·ã§ã³ï¼
+
+OMIT_INITIALIZE_EXCEPTIONããã¯ã­å®ç¾©ããå ´åã«ã¯ï¼ãã®é¢æ°ãã¿ã¼ã²ãã
+ä¾å­é¨ã§ç¨æããï¼OMIT_INITIALIZE_EXCEPTIONããã¯ã­å®ç¾©ãããã¨ã«ããå
+ãé¤ããããã®ä»ã®ãã¼ã¿åï¼å¤æ°ï¼ãã¯ã­ã¯ï¼ãã®é¢æ°ã§ä½¿ç¨ããå ´åã«ã®
+ã¿ç¨æããã°ããï¼
+
+6.7.5 ããã©ã«ãã®CPUä¾å¤ãã³ãã©
+
+(6-7-5-1) void default_exc_handler(void *p_excinf)ï¼ãªãã·ã§ã³ï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«ããCPUä¾å¤ãã³ãã©ã®ãã¼ãã«ãçæããå ´åãªã©ã«ã¯ï¼
+CPUä¾å¤ãã³ãã©ãç»é²ããªãã£ãCPUä¾å¤ãã³ãã©çªå·ã«å¯¾ãã¦ï¼ããã©ã«ã
+ã®CPUä¾å¤ãã³ãã©ã¨ãã¦ï¼default_exc_handlerãç»é²ããï¼
+
+default_exc_handlerã¯ï¼æ¨æºã®ãã®ãã¿ã¼ã²ããä¾å­é¨ã§ç¨æãããï¼ã¦ã¼ã¶
+ãç¨æãããã®ã§ç½®ãæããããããã«ï¼OMIT_DEFAULT_EXC_HANDLERããã¯ã­
+å®ç¾©ããå ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§å®ç¾©ããªãããã«ããï¼ãªãï¼ã¦ã¼ã¶
+ãç¨æããå ´åã®åç§°ã¯ï¼_kernel_default_exc_handlerã¨ãªãï¼
+
+6.7.6 CPUä¾å¤çºçæã®ã·ã¹ãã ç¶æ
+ã®åç
+§
+
+(6-7-6-1) bool_t exc_sense_intmask(void *p_excinf)
+
+CPUä¾å¤ãçºçããæã®ã·ã¹ãã ç¶æ
+ãï¼ä»¥ä¸ã®æ¡ä»¶ããã¹ã¦æºããå ´åã«
+trueï¼ããã§ãªãæã«falseãè¿ãé¢æ°ï¼
+
+ã(1) ã«ã¼ãã«å
+ã®ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³ã®å®è¡ä¸­ã§ãªã
+ã(2) å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§ãªã
+ã(3) CPUã­ãã¯ç¶æ
+ã§ãªã
+ã(4) ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©å®è¡ä¸­ã§ãªã
+ã(5) ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ãã³ãã©å®è¡ä¸­ã§ãªã
+ã(6) ã¿ã¹ã¯ã³ã³ãã­ã¹ã
+ã(7) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨è§£é¤
+
+å¤ãã®å ´åï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ããã¹ã¦ãã¹ã¯ããã¦ãããã¨ããã§ãã¯
+ãããã¨ã§ï¼(1)ã(5)ã®å¤å®ãä¸æ¬ãã¦è¡ããã¨ãã§ããï¼ã¾ãï¼å²è¾¼ã¿åªå
+
+åº¦ãã¹ã¯ãå®ç¾ãã¦ãããã¼ãã¦ã§ã¢ã¬ã¸ã¹ã¿ããã§ãã¯ãããã¨ã§ï¼(1)ã
+(5)ã¨(7)ã®å¤å®ãä¸æ¬ãã¦è¡ããå ´åãå¤ãï¼
+
+p_excinfã«ã¯ï¼CPUä¾å¤ã®æ
+å ±ãè¨æ¶ãã¦ããé åã®å
+é ­çªå°ãæ¸¡ãããï¼
+
+6.8 ã«ã¼ãã«ã®èµ·åã»çµäºã¨ã¹ã¿ãã¯é åãªã©
+
+(6-8-1) ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«
+
+ã«ã¼ãã«ã®ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã¯ï¼ã·ã¹ãã ã®ãªã»ããå¾ã«æåã«å®è¡
+ããããã­ã°ã©ã ã§ããï¼ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã¯ï¼æ¨æºçã«ã¯ï¼ãã­ã»ã
+ãµä¾å­é¨ã¾ãã¯ãããä¾å­é¨ã§ç¨æãä»¥ä¸ã®å¦çãè¡ããï¼ããã«ãã ããå¿
+
+è¦ã¯ãªãï¼å
+·ä½çã«ã¯ï¼éçºç°å¢ã«ç¨æããã¦ããã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«
+ãç¨ããæ¹æ³ï¼ãã®å ´åï¼ã¿ã¼ã²ããä¾å­é¨ã§mainé¢æ°ãç¨æããå¿
+è¦ãããï¼
+ãï¼ã¢ããªã±ã¼ã·ã§ã³ã§ç¨æããå ´åãèããããï¼
+
+(a) ãã­ã»ããµç¶æ
+ã®åæå
+
+ãã­ã»ããµã¢ã¼ãï¼ã¹ã¿ãã¯ãã¤ã³ã¿ï¼ãã¬ã¼ã ãã¤ã³ã¿ç­ï¼ãã­ã»ããµã®ç¶
+æ
+ãåæåããï¼ã¾ãï¼NMIãé¤ããã¹ã¦ã®å²è¾¼ã¿ããã¹ã¯ããç¶æ
+ï¼å
+¨å²è¾¼ã¿
+ã­ãã¯ç¶æ
+ã¨åç­ã®ç¶æ
+ï¼ã¨ããï¼DRAMã³ã³ãã­ã¼ã©ã®åæåãªã©ï¼ã¡ã¢ãªã
+ã¢ã¯ã»ã¹ããããã«å¿
+è¦ãªåæåå¦çãããã§è¡ã£ã¦ãããï¼æ¬¡ã®
+hardware_init_hookã§è¡ã£ã¦ãããï¼ï¼
+
+(b) hardware_init_hookãå¼ã³åºã
+
+ã·ã¹ãã ã®ãªã»ããå¾ããã«è¡ãå¿
+è¦ã®ããã¿ã¼ã²ããã·ã¹ãã ä¾å­ã®åæå
+å¦çãè¡ãããã«ï¼hardware_init_hookãå¼ã³åºãï¼hardware_init_hookãç¨
+æããã¦ããªãå ´åã¯ï¼ä½ãããªãï¼GNUéçºç°å¢ã§ã¯ï¼ãªã³ã«ã¹ã¯ãªããä¸­ã®
+weak definitionã«ããï¼hardware_init_hookãç¨æããã¦ããªãå ´åã®å¤ã0
+ã¨ãããã¨ã§ï¼ãããå®ç¾ã§ããï¼weak definitionã®æ©è½ãæããªãéçºç°å¢
+ã§ã¯ï¼hardware_init_hookãå¿
+ãå¼ã³åºããã¨ã«ããï¼
+
+hardware_init_hookã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ç¨æããã®ãæ¨æºã§ãããï¼ã·ã¹
+ãã ã®ãªã»ããå¾ããã«è¡ãå¿
+è¦ã®ããåæåå¦çãè¿½å ããããã«ï¼ã¢ããª
+ã±ã¼ã·ã§ã³ã§ç¨æãããã®ãç¨ããå ´åãããï¼
+
+ã¡ã¢ãªã¢ã¯ã»ã¹ã«å¿
+è¦ãªåæåå¦çãhardware_init_hookã§è¡ãå ´åã«ã¯ï¼ã
+ããå¼ã³åºãæç¹ã§ã¡ã¢ãªã«ã¢ã¯ã»ã¹ãããã¨ãã§ããªãããï¼é¢æ°ï¼ãµãã«ã¼
+ãã³ï¼ãå¼ã³åºãããã«ã¹ã¿ãã¯ãä½¿ç¨ãããã­ã»ããµã§ã¯ï¼æ»ãçªå°ãæ±ç¨
+ã¬ã¸ã¹ã¿ã«å
+¥ãã¦å¼ã³åºãã¨ãã£ãå·¥å¤«ãå¿
+è¦ã§ããï¼ãã®å ´åï¼
+hardware_init_hookãCè¨èªã§è¨è¿°ãããã¨ã¯ã§ããªããªããï¼ãããããªãï¼
+
+(c) bssã»ã¯ã·ã§ã³ã¨dataã»ã¯ã·ã§ã³ã®åæå
+
+bssã»ã¯ã·ã§ã³ãã¯ãªã¢ãï¼dataã»ã¯ã·ã§ã³ã«åæå¤ãè¨­å®ããï¼
+
+ãã ãï¼ã«ã¼ãã«æ¬ä½ã¯ï¼kerflgãfalseï¼ï¼0ï¼ã«åæåããããã¨ä»¥å¤ã«ï¼
+ãããã®ã»ã¯ã·ã§ã³ãåæåããããã¨ã«ä¾å­ãã¦ããªãããï¼ã¹ã¿ã¼ãã¢ã
+ãã¢ã¸ã¥ã¼ã«ãã¢ããªã±ã¼ã·ã§ã³ã§ç¨æããå ´åã§ï¼ã·ã¹ãã ãµã¼ãã¹ãã¢ã
+ãªã±ã¼ã·ã§ã³ããããã®ã»ã¯ã·ã§ã³ãåæåããããã¨ã«ä¾å­ãã¦ããªãå ´å
+ã«ã¯ï¼ã·ã¹ãã ã®èµ·åæéãç­ç¸®ããããã«ï¼kerflgãfalseã«åæåããã ã
+ã§ååã§ããï¼
+
+(d) software_init_hookãå¼ã³åºã
+
+éçºç°å¢ï¼ç¹ã«ã©ã¤ãã©ãªï¼ã«ä¾å­ãã¦å¿
+è¦ãªåæåå¦çãè¡ãããã«ï¼
+software_init_hookãå¼ã³åºãï¼software_init_hookãç¨æããã¦ããªãå ´å
+ã¯ï¼ä½ãããªãï¼GNUéçºç°å¢ã§ã¯ï¼ãªã³ã«ã¹ã¯ãªããä¸­ã®weak definitionã«
+ããï¼software_init_hookãç¨æããã¦ããªãå ´åã®å¤ã0ã¨ãããã¨ã§ï¼ãã
+ãå®ç¾ã§ããï¼weak definitionã®æ©è½ãæããªãéçºç°å¢ã§ã¯ï¼
+software_init_hookãå¿
+ãå¼ã³åºããã¨ã«ããï¼
+
+software_init_hookã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ç¨æããã®ãæ¨æºã§ããï¼
+
+(e) sta_kerã¸åå²
+
+sta_kerãå¼ã³åºãï¼sta_kerã¯ï¼NMIãé¤ããã¹ã¦ã®å²è¾¼ã¿ããã¹ã¯ããç¶æ
+
+ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¨åç­ã®ç¶æ
+ï¼ã§å¼ã³åºããªããã°ãªããªãï¼sta_kerã
+ãã¯ãªã¿ã¼ã³ãããã¨ããªãããï¼ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã«æ»ã£ã¦ããã
+ã¨ã¯èããå¿
+è¦ããªãï¼
+
+(6-8-2) void target_initialize(void)
+
+ã¿ã¼ã²ããä¾å­é¨ã®åæåãè¡ãé¢æ°ï¼sta_kerã®æåã§å¼ã³åºãããï¼éçºç°
+å¢ä¾å­ï¼ãã­ã»ããµã³ã¢ä¾å­ï¼ãããä¾å­ã®åæåå¦çãï¼ãããã®ä¾å­é¨ã«
+åãåãããã¨ãå¯è½ã§ããï¼
+
+ãã®é¢æ°ã¯ï¼ããã¾ã§ãã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã®åæåå¦çãè¡ããã
+ã®ãã®ã§ããï¼ã¢ããªã±ã¼ã·ã§ã³ã«å¿
+è¦ãªåæåå¦çã¯ï¼åæåã«ã¼ãã³ã§è¡
+ãã®ãåºæ¬ã§ãããï¼ã·ã¹ãã ã®ãªã»ããå¾ããã«è¡ãå¿
+è¦ãããå ´åã«ã¯ï¼
+hardware_init_hookãç¨ããï¼
+
+(6-8-3) void call_exit_kernel(void)
+
+éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã¦ï¼exit_kernelã¸åå²ããé¢æ°ï¼ext_kerã
+ãå¼ã³åºãããï¼exit_kernelããã¯ãªã¿ã¼ã³ãããã¨ããªãããï¼ãã®é¢æ°ã«
+æ»ã£ã¦ãããã¨ã¯èããå¿
+è¦ããªãï¼
+
+éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæããã®ã¯ï¼çµäºå¦çã«ã¼ãã³ãï¼éã¿ã¹ã¯ã³ã³
+ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ã§å®è¡ããããã§ããï¼çµäºå¦çã«ã¼ãã³ãã¿ã¹ã¯ç¨ã®
+ã¹ã¿ãã¯ã§å®è¡ããã¨ï¼åã¿ã¹ã¯ã®ã¹ã¿ãã¯é åã®ãµã¤ãºãæ±ºå®ããéã«ï¼çµ
+äºå¦çã«ã¼ãã³ãä½¿ç¨ããã¹ã¿ãã¯é åãèæ
+®ããªããã°ãªããªãï¼ããã«ã¯ï¼
+çµäºå¦çã«ã¼ãã³ãä½¿ç¨ããã¹ã¿ãã¯é åãå¤§ããå ´åã«åã¿ã¹ã¯ã®ã¹ã¿ãã¯
+é åãç¡é§ã«å¤§ããããªããã°ãªããªããã¨ã«å ãã¦ï¼æå³ããªãã¹ã¿ãã¯ãªã¼
+ãã¼ãã­ã¼ãçºçããå¯è½æ§ãé«ããã¨ããåé¡ãããï¼
+
+ãã®é¢æ°ã¯ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§å¼ã°ããããï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ããå¼
+ã³åºããã¨ãã§ããªãé¢æ°ãå¼ã°ãªãããã«å®è£
+ããªããã°ãªããªãï¼
+
+(6-8-4) void target_exit(void)
+
+ã¿ã¼ã²ããä¾å­é¨ã®çµäºå¦çãè¡ãé¢æ°ï¼ãã®é¢æ°ã¯ï¼ã«ã¼ãã«çµäºå¦çã®æ
+å¾ã«å¼ã³åºããï¼ãªã¿ã¼ã³ãã¦ã¯ãªããªãï¼éçºç°å¢ä¾å­ï¼ãã­ã»ããµã³ã¢ä¾
+å­ï¼ãããä¾å­ã®çµäºå¦çãï¼ãããã®ä¾å­é¨ã«åãåãããã¨ãå¯è½ã§ããï¼
+
+ãã®é¢æ°ã§ã¯ï¼æåã«ï¼atexitã«ãã£ã¦ç»é²ãããé¢æ°ã¨ãã¹ãã©ã¯ã¿ãå¼ã³
+åºããã¨ãæå³ãã¦ããï¼æ¨æºçã«ã¯ï¼software_term_hookãå¼ã³åºãï¼
+software_term_hookãç¨æããã¦ããªãå ´åã¯ï¼ä½ãããªãï¼GNUéçºç°å¢ã§ã¯ï¼
+ãªã³ã«ã¹ã¯ãªããä¸­ã®weak definitionã«ããï¼software_term_hookãç¨æãã
+ã¦ããªãå ´åã®å¤ã0ã¨ãããã¨ã§ï¼ãããå®ç¾ã§ããï¼weak definitionã®æ©
+è½ãæããªãéçºç°å¢ã§ã¯ï¼software_term_hookãå¿
+ãå¼ã³åºããã¨ã«ããï¼
+
+ãã®é¢æ°ã¯ï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§å¼ã°ããããï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ããå¼
+ã³åºããã¨ãã§ããªãé¢æ°ãå¼ã°ãªãããã«å®è£
+ããªããã°ãªããªãï¼
+
+6.9 ã«ã¼ãã«å
+é¨ã®ãã¥ã¼ãã³ã°
+
+6.9.1 ãããããããµã¼ã
+
+(6-9-1-1) OMIT_BITMAP_SEARCHï¼ãªãã·ã§ã³ï¼
+(6-9-1-2) uint_t bitmap_search(uint16_t bitmap)ï¼ãªãã·ã§ã³ï¼
+
+ã¿ã¼ã²ããéä¾å­é¨ã§ï¼uint16_tåã®æ´æ°å¤ï¼bitmapï¼ä¸­ã®1ã®ãããã®å
+ï¼æ
+ãä¸ä½ï¼å³ï¼ã®ãã®ããµã¼ããï¼ãã®ãããçªå·ãè¿ãé¢æ°bitmap_searchãç¨
+æãã¦ããï¼ããã§ï¼ãããçªå·ã¯æä¸ä½ãããã0ã¨ãï¼bitmapã«0ãæå®ã
+ã¦ã¯ãªããªããã®ã¨ãã¦ããï¼
+
+ããããµã¼ãå½ä»¤ãæã¤ãã­ã»ããµã§ã¯ï¼bitmap_searchãï¼ããããµã¼ãå½ä»¤
+ãä½¿ãããã«æ¸ãç´ããæ¹ãå¹çãè¯ãå ´åãããï¼ãã®ãããªå ´åã«ã¯ï¼ã¿ã¼
+ã²ããä¾å­é¨ã§ããããµã¼ãå½ä»¤ãä½¿ã£ãbitmap_searchãå®ç¾©ãï¼
+OMIT_BITMAP_SEARCHããã¯ã­å®ç¾©ããï¼
+
+æ¨æºã©ã¤ãã©ãªã«ããããµã¼ãå½ä»¤ãç¨ããffsãããå ´åï¼bitmap_searchã
+(ffs(bitmap) - 1)ã«å®ç¾©ããã¨ããï¼
+
+(6-9-1-3) uint16_t PRIMAP_BIT(PRI pri)ï¼ãªãã·ã§ã³ï¼
+
+ããããµã¼ãå½ä»¤ã®ãµã¼ãæ¹åãéãªã©ã®çç±ã§ï¼åªå
+åº¦ã¨ãããã¨ã®å¯¾å¿ã
+å¤æ´ãããå ´åã«ã¯ï¼PRIMAP_BITããã¯ã­å®ç¾©ããï¼
+
+6.9.2 ããããã£ã¼ã«ã
+
+(6-9-2-1) BIT_FIELD_UINTï¼ãªãã·ã§ã³ï¼
+
+8ãããä»¥ä¸ã®å¹
+ã®ããããã£ã¼ã«ãã§ï¼ç¬¦å·ç¡ãæ´æ°å¤ãä¿æãããå ´åã«ç¨
+ããã¹ããã¼ã¿åï¼ããã©ã«ãã®å®ç¾©ã¯unsigned intã¨ãªã£ã¦ãããï¼ã¿ã¼ã²ã
+ãããã¼ã«ä¾å­ã§ï¼unsigned charã¾ãã¯unsigned shortã«å®ç¾©ããæ¹ãå¹çã
+è¯ãå ´åãããï¼
+
+(6-9-2-2) BIT_FIELD_BOOLï¼ãªãã·ã§ã³ï¼
+
+1ãããå¹
+ã®ããããã£ã¼ã«ãã§ï¼ãã¼ã«å¤ãä¿æãããå ´åã«ç¨ããã¹ããã¼
+ã¿åï¼ããã©ã«ãã§ã¯BIT_FIELD_UINTã¨åä¸ã«å®ç¾©ãã¦ãããï¼ãã¼ã«å¤ãä¿
+æãããã¨ãæç¤ºããããã«å¥ã®ååã¨ãã¦ããï¼
+
+(6-9-2-3) TBIT_TCB_PRIORITYï¼ãªãã·ã§ã³ï¼
+
+ç¾å¨åªå
+åº¦ï¼ããã³ï¼ãã¥ã¼ããã¯ã¹æ¡å¼µã«ããããã¼ã¹åªå
+åº¦ï¼ãä¿æãã
+ããã®TCBä¸­ã®ãã£ã¼ã«ãã®ãããæ°ï¼ããã©ã«ãã§ã¯8ãããã«å®ç¾©ãã¦ãã
+ãï¼ããä»¥å¤ã«å®ç¾©ãããå ´åã«ï¼ãããæ°ããã®ååã«ãã¯ã­å®ç¾©ããï¼
+
+6.10 ã«ã¼ãã«å®è£
+ã«é¢ãããã®ä»ã®å®ç¾©
+
+6.10.1 ã¿ã¼ã²ããä¾å­ã®ãªãã¸ã§ã¯ãå±æ§
+
+(6-10-1-1) TARGET_TSKATRï¼ãªãã·ã§ã³ï¼	ã¿ã¼ã²ããå®ç¾©ã®ã¿ã¹ã¯å±æ§
+(6-10-1-2) TARGET_ISRATRï¼ãªãã·ã§ã³ï¼	ã¿ã¼ã²ããå®ç¾©ã®ISRå±æ§
+(6-10-1-3) TARGET_INHATRï¼ãªãã·ã§ã³ï¼	ã¿ã¼ã²ããå®ç¾©ã®å²è¾¼ã¿ãã³ãã©å±æ§
+(6-10-1-4) TARGET_INTATRï¼ãªãã·ã§ã³ï¼	ã¿ã¼ã²ããå®ç¾©ã®å²è¾¼ã¿å±æ§
+(6-10-1-5) TARGET_EXCATRï¼ãªãã·ã§ã³ï¼	ã¿ã¼ã²ããå®ç¾©ã®CPUä¾å¤ãã³ãã©å±æ§
+
+åãªãã¸ã§ã¯ãã®å±æ§ãï¼ã¿ã¼ã²ããå®ç¾©ã«æ¡å¼µããå ´åã«ï¼è©²å½ãããªãã¸ã§
+ã¯ãå±æ§ãç¤ºãå¤æ°ã«ï¼æ¡å¼µã«ä½¿ç¨ãããããã®è«çåãå®ç¾©ããï¼ããã«ã
+ãï¼æ¡å¼µã«ä½¿ç¨ããããããè¨­å®ããã¦ããå ´åã«ï¼ã¨ã©ã¼ã«ãªãã®ãé²ãï¼
+
+ãªãï¼TOPPERSæ°ä¸ä»£ã«ã¼ãã«çµ±åä»æ§æ¸ã§ã¯ï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ï¼ISRï¼
+å±æ§ãã¿ã¼ã²ããå®ç¾©ã§æ¡å¼µã§ããä»æ§ã¨ã¯ãªã£ã¦ããªãï¼
+
+6.10.2 ã¨ã©ã¼ãã§ãã¯æ¹æ³ã®æå®
+
+(6-10-2-1) TARGET_MIN_STKSZï¼ãªãã·ã§ã³ï¼
+
+ã¿ã¼ã²ããå®ç¾©ã§ï¼ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãºã®æå°å¤ãè¨­å®ããå ´åã«ã¯ï¼ã
+ã®å¤æ°ãã¹ã¿ãã¯ãµã¤ãºã®æå°å¤ã«å®ç¾©ããï¼
+
+(6-10-2-2) TARGET_MIN_ISTKSZï¼ãªãã·ã§ã³ï¼
+
+ã¿ã¼ã²ããå®ç¾©ã§ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãã®ã¹ã¿ãã¯ãµã¤ãºã®æå°å¤ãè¨­å®ã
+ãå ´åã«ã¯ï¼ãã®å¤æ°ãã¹ã¿ãã¯ãµã¤ãºã®æå°å¤ã«å®ç¾©ããï¼
+
+(6-10-2-3) CHECK_STKSZ_ALIGNï¼ãªãã·ã§ã³ï¼
+
+ã¹ã¿ãã¯é åã®ãµã¤ãºãããå¤ï¼ã¢ã©ã¤ã³åä½ï¼ã®åæ°ã§ãªããã°ãªããªãå ´
+åã«ï¼ãã®å¤æ°ãã¢ã©ã¤ã³åä½ã«å®ç¾©ããï¼ãã®å¤æ°ãå®ç¾©ãããã¨ã§ï¼
+kernel.tfããã³acre_tskï¼åççææ©è½æ¡å¼µããã±ã¼ã¸ã®ã¿ï¼ã«ããã¦ï¼ã¹ã¿ã
+ã¯é åã®ãµã¤ãºãæ­£ãããªãï¼ãã®å¤æ°ã«å®ç¾©ããå¤ã®åæ°ã§ãªãï¼å ´åã®ã¨
+ã©ã¼ããã§ãã¯ããããã«ãªãï¼ãã§ãã¯ãå¿
+è¦ãªãå ´åã«ã¯ï¼ãã®å¤æ°ãå®
+ç¾©ããªãï¼
+
+(6-10-2-4) CHECK_INTPTR_ALIGNï¼ãªãã·ã§ã³ï¼	intptr_tåã®å¤æ°ã®ã¢ã©ã¤ã³åä½
+(6-10-2-5) CHECK_INTPTR_NONNULLï¼ãªãã·ã§ã³ï¼intptr_tåã®å¤æ°ã®éNULLãã§ãã¯
+(6-10-2-6) CHECK_FUNC_ALIGNï¼ãªãã·ã§ã³ï¼	å¦çåä½ã®ã¢ã©ã¤ã³åä½
+(6-10-2-7) CHECK_FUNC_NONNULLï¼ãªãã·ã§ã³ï¼	å¦çåä½ã®éNULLãã§ãã¯
+(6-10-2-8) CHECK_STACK_ALIGNï¼ãªãã·ã§ã³ï¼	ã¹ã¿ãã¯é åã®ã¢ã©ã¤ã³åä½
+(6-10-2-9) CHECK_STACK_NONNULLï¼ãªãã·ã§ã³ï¼ã¹ã¿ãã¯é åã®éNULLãã§ãã¯
+(6-10-2-10) CHECK_MPF_ALIGNï¼ãªãã·ã§ã³ï¼	åºå®é·ã¡ã¢ãªãã¼ã«é åã®ã¢ã©ã¤ã³åä½
+(6-10-2-11) CHECK_MPF_NONNULLï¼ãªãã·ã§ã³ï¼	åºå®é·ã¡ã¢ãªãã¼ã«é åã®éNULL
+											ãã§ãã¯
+
+intptr_tåã®å¤æ°ï¼å¦çåä½ï¼ã¹ã¿ãã¯é åï¼åºå®é·ã¡ã¢ãªãã¼ã«é åã®å
+é ­
+çªå°ãããå¤ï¼ã¢ã©ã¤ã³åä½ï¼ã®åæ°ã§ãªããã°ãªããªãå ´åã«ï¼ããããï¼
+CHECK_INTPTR_ALIGNï¼CHECK_FUNC_ALIGNï¼CHECK_STACK_ALIGNï¼
+CHECK_MPF_ALIGNãã¢ã©ã¤ã³åä½ã«å®ç¾©ããï¼intptr_tåã®å¤æ°ï¼å¦çåä½ï¼ã¹
+ã¿ãã¯é åï¼åºå®é·ã¡ã¢ãªãã¼ã«é åã®å
+é ­çªå°ãNULLã§ãªããã®ãã§ãã¯ã
+è¡ãå ´åã«ã¯ï¼ããããCHECK_INTPTR_NULLï¼CHECK_FUNC_NONNULLï¼
+CHECK_STACK_NONNULLï¼CHECK_MPF_NONNULLãå®ç¾©ããï¼
+
+(6-10-2-12) CHECK_MB_ALIGNï¼ãªãã·ã§ã³ï¼	ç®¡çé åã®ã¢ã©ã¤ã³åä½
+
+ã«ã¼ãã«å
+ã®ç®¡çé åï¼å
+·ä½çã«ã¯ï¼ãã¼ã¿ã­ã¥ã¼ç®¡çé åï¼åªå
+åº¦ãã¼ã¿
+ã­ã¥ã¼ç®¡çé åï¼åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çé åï¼ã®å
+é ­çªå°ãããå¤ï¼ã¢ã©ã¤
+ã³åä½ï¼ã®åæ°ã§ãªããã°ãªããªãå ´åã«ï¼ãã®å¤æ°ãã¢ã©ã¤ã³åä½ã«å®ç¾©ã
+ãï¼åççææ©è½æ¡å¼µããã±ã¼ã¸ãä½¿ç¨ããªãå ´åã«ã¯ï¼å®ç¾©ããå¿
+è¦ããªãï¼
+
+6.10.3 éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é å
+
+(6-10-3-1) DEFAULT_ISTKSZ
+
+DEF_ICSã«ããéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åãæå®ãããªãå ´åã®ï¼
+ããã©ã«ãã®ã¹ã¿ãã¯é åã®ãµã¤ãºï¼
+
+(6-10-3-2) DEFAULT_ISTKï¼ãªãã·ã§ã³ï¼
+
+DEF_ICSã«ããéã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åãæå®ãããªãå ´åã®ï¼
+ããã©ã«ãã®ã¹ã¿ãã¯é åã®å
+é ­çªå°ï¼ãã®ãã¯ã­ãå®ç¾©ãããªãå ´åã«ã¯ï¼
+ãµã¤ãºãDEFAULT_ISTKSZã®ã¹ã¿ãã¯é åãï¼é
+åã«ããç¢ºä¿ãããï¼
+
+(6-10-3-3) STK_T *TOPPERS_ISTKPT(STK_T *istk, size_t istksz)ï¼ãªãã·ã§ã³ï¼
+
+éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ãã¤ã³ã¿ã®åæå¤ãä¿æããå¤æ°ï¼istkptï¼
+ãç¨ããå ´åã«ï¼ãã®ã·ã³ãã«ã«ï¼ã¹ã¿ãã¯é åã®å
+é ­çªå°ï¼istkï¼ã¨ã¹ã¿ã
+ã¯é åã®ãµã¤ãºï¼istkszï¼ããï¼ã¹ã¿ãã¯ãã¤ã³ã¿ã®åæå¤ãæ±ãããã¯ã­ã
+å®ç¾©ããï¼
+
+6.10.4 ç©ºã©ãã«ã®å®ç¾©
+
+(6-10-4-1) TOPPERS_EMPTY_LABEL(type, symbol)ï¼ãªãã·ã§ã³ï¼
+
+ãªã³ã¯ã¨ã©ã¼ãé²ãããã«ï¼ãã¼ã¿åtypeã®é
+åã§ããå¤æ°symbolã«å®ç¾©ãä¸
+ããããã®ãã¯ã­ï¼ä¸ããå®ç¾©ãåç
+§ããããã¨ã¯ãªãããï¼ã©ã®ãããªå®ç¾©
+ãä¸ãã¦ãããï¼
+
+ããã©ã«ãã§ã¯ï¼symbolãï¼è¦ç´ åãtypeã§ãµã¤ãºã0ã®é
+åã«å®ç¾©ãã¦ããï¼
+ãµã¤ãºã0ã®é
+åãã¨ã©ã¼ã¨ãªããªãã³ã³ãã¤ã©ï¼GCCã¯ããã«è©²å½ï¼ãç¨ãã
+å ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§å®ç¾©ããå¿
+è¦ã¯ãªãï¼
+
+6.11 ãã¬ã¼ã¹ã­ã°æ©è½ã«é¢ããè¨­å®
+
+ASP3ã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼ãã«ã¯ï¼ã«ã¼ãã«ã®å®è¡ãã¬ã¼ã¹ã­ã°ãåå¾ããã
+ãã®ãã¯ã­ç­ãåãè¾¼ãã§ããï¼ããã©ã«ãã§ã¯ï¼ãããã®ãã¯ã­ã¯ç©ºã«å®ç¾©
+ããã¦ãã¬ã¼ã¹ã­ã°ã®åå¾ã¯è¡ããªããï¼ãããã®ãã¯ã­ãé©åã«å®ç¾©ããã
+ã¨ã§ãã¬ã¼ã¹ã­ã°ã®åå¾ãè¡ããã¨ãã§ããï¼
+
+6.11.1 åå¾ã§ãããã¬ã¼ã¹ã­ã°ã®ç¨®é¡ã¨ãã¯ã­
+
+åå¾ã§ãããã¬ã¼ã¹ã­ã°ã®ç¨®é¡ã¨ï¼ãããåå¾ããããã«å®ç¾©ãããã¯ã­ã¯æ¬¡
+ã®éãã§ããï¼
+
+(a) ã«ã¼ãã«ã®åä½éå§ã¨çµäº
+
+æ¬¡ã®ãã¯ã­ãå®ç¾©ãããã¨ã§ï¼ã«ã¼ãã«ã®åä½éå§æã¨çµäºæã®ãã¬ã¼ã¹ã­ã°
+ãåå¾ãããã¨ãã§ããï¼
+
+	LOG_KER_ENTER		ã«ã¼ãã«ãåä½ãéå§ããç´åï¼åæåã®å®äºå¾ï¼
+	LOG_KER_LEAVE		ã«ã¼ãã«ã®çµäºï¼ext_kerï¼ãå¼ã°ããç´å¾ï¼çµäºå¦
+						çã®å®è¡åï¼
+
+(b) å¦çåä½ã®å®è¡éå§ã¨çµäº
+
+æ¬¡ã®ãã¯ã­ãå®ç¾©ãããã¨ã§ï¼å²è¾¼ã¿ãã³ãã©ï¼INHï¼ï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ã
+ã³ï¼ISRï¼ï¼å¨æãã³ãã©ï¼CYCï¼ï¼ã¢ã©ã¼ã ãã³ãã©ï¼ALMï¼ï¼CPUä¾å¤ãã³ã
+ã©ï¼EXCï¼ã®å®è¡éå§åã¨çµäºå¾ã®ãã¬ã¼ã¹ã­ã°ãåå¾ãããã¨ãã§ããï¼
+
+	LOG_<å¦çåä½ç¥å·>_ENTER	å¦çåä½ã®å®è¡éå§ç´å
+	LOG_<å¦çåä½ç¥å·>_LEAVE	å¦çåä½ã®çµäºç´å¾
+
+å²è¾¼ã¿ãã³ãã©ã¯ï¼ã¢ããªã±ã¼ã·ã§ã³ãç»é²ãããã®ã®ã¿ãå¯¾è±¡ã¨ãï¼å²è¾¼ã¿
+ãµã¼ãã¹ã«ã¼ãã³ãå¼ã³åºãããã«ã«ã¼ãã«å
+ã«çæããããã®ã¯å¯¾è±¡ã¨ããª
+ãï¼ã¿ã¹ã¯ã®å®è¡éå§ã¨çµäºã¯ï¼ä»ã®æ¹æ³ã§åå¾ã§ããããï¼ãã®æ¹æ³ã¯ç¨æ
+ãã¦ããªãï¼
+
+ãªãï¼å²è¾¼ã¿ãã³ãã©ã¨CPUä¾å¤ãã³ãã©ã®å®è¡éå§ã¨çµäºã®ãã¬ã¼ã¹ã­ã°åå¾
+ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§å®è£
+ããå¿
+è¦ãããï¼è©³ããã¯ï¼ã6.2 ãã¬ã¼ã¹ã­ã°
+æ©è½ã¸ã®å¯¾å¿ãã6.6.1 å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦çãã6.7.1 CPUä¾å¤ãã³ã
+ã©ã®åºå
+¥å£å¦çãã®ç¯ãåç
+§ãããã¨ï¼
+
+(c) ã¿ã¹ã¯ç¶æ
+ã®å¤å
+
+æ¬¡ã®ãã¯ã­ãå®ç¾©ãããã¨ã§ï¼ã¿ã¹ã¯ç¶æ
+ãå¤åããæã®ãã¬ã¼ã¹ã­ã°ãåå¾
+ãããã¨ãã§ããï¼ãã ãï¼å®è¡ç¶æ
+ã¨å®è¡å¯è½ç¶æ
+ã®éã®é·ç§»ã¯ï¼ä»ã®æ¹æ³
+ã§åå¾ã§ããããï¼ãã®ãã¯ã­ã§ã¯åå¾ã§ããªãï¼
+
+	LOG_TSKSTAT		ã¿ã¹ã¯ç¶æ
+ã®å¤å
+
+(d) ãã£ã¹ãããã£ã®å®è¡éå§ã¨çµäº
+
+æ¬¡ã®ãã¯ã­ãå®ç¾©ãããã¨ã§ï¼ãã£ã¹ãããã£ãå®è¡éå§ããæã¨ï¼çµäºãã
+æã®ãã¬ã¼ã¹ã­ã°ãåå¾ãããã¨ãã§ããï¼
+
+	LOG_DSP_ENTER	ãã£ã¹ãããã£ã®å®è¡éå§
+	LOG_DSP_LEAVE	ãã£ã¹ãããã£ã®çµäº
+
+ãã£ã¹ãããã£ã®å®è¡éå§ã¯ï¼ã¿ã¹ã¯ãå®è¡ç¶æ
+ããå®è¡å¯è½ç¶æ
+ã«é·ç§»ãã
+ã¿ã¤ãã³ã°ã§ããããï¼å®è¡å¯è½ç¶æ
+ã¸é·ç§»ããã¿ã¹ã¯ã®TCBã¸ã®ãã¤ã³ã¿ãã
+ã©ã¡ã¼ã¿ã¨ããï¼éã«ï¼ãã£ã¹ãããã£ã®çµäºã¯ï¼ã¿ã¹ã¯ãå®è¡å¯è½ç¶æ
+ãã
+å®è¡ç¶æ
+ã«é·ç§»ããã¿ã¤ãã³ã°ã§ããããï¼å®è¡ç¶æ
+ã¸é·ç§»ããã¿ã¹ã¯ã®TCBã¸
+ã®ãã¤ã³ã¿ããã©ã¡ã¼ã¿ã¨ããï¼
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼å®è¡ã§ããã¿ã¹ã¯ããªãï¼ã«ã¼ãã«ãã¢ã¤ãã«ç¶æ
+ã«ãªã
+å ´åã«ã¯ï¼ãã£ã¹ãããã£ã®ä¸­ã«çã¾ãï¼ãã®ããï¼ã¢ã¤ãã«ç¶æ
+ã¸ã®é·ç§»ã¨
+ã¢ã¤ãã«ç¶æ
+ããä»ã®ç¶æ
+ã¸ã®é·ç§»ã¯ï¼ãã®ãã¯ã­ã§ã¯åå¾ã§ããªãï¼
+
+ãªãï¼ãã£ã¹ãããã£ã®å®è¡éå§ã¨çµäºã®ãã¬ã¼ã¹ã­ã°åå¾ã¯ï¼ã¿ã¼ã²ããä¾
+å­é¨ã§å®è£
+ããå¿
+è¦ãããï¼è©³ããã¯ï¼ã6.2 ãã¬ã¼ã¹ã­ã°æ©è½ã¸ã®å¯¾å¿ãã¨
+ã6.5.2 ãã£ã¹ãããã£æ¬ä½ãã®ç¯ãåç
+§ãããã¨ï¼
+
+(e) ãµã¼ãã¹ã³ã¼ã«ã®å
+¥å£ã¨åºå£
+
+æ¬¡ã®ãã¯ã­ãå®ç¾©ãããã¨ã§ï¼åãµã¼ãã¹ã³ã¼ã«ã®å
+¥å£ã¨åºå£ã®ãã¬ã¼ã¹ã­ã°
+ãåå¾ãããã¨ãã§ããï¼
+
+	LOG_<ãµã¼ãã¹ã³ã¼ã«ã®å¤§æå­è¡¨è¨>_ENTER		ãµã¼ãã¹ã³ã¼ã«åã®å
+¥å£
+	LOG_<ãµã¼ãã¹ã³ã¼ã«ã®å¤§æå­è¡¨è¨>_LEAVE		ãµã¼ãã¹ã³ã¼ã«åã®åºå£
+
+ããããã®ãã¯ã­ã®åç§°ããã©ã¡ã¼ã¿ã®è©³ç´°ã«ã¤ãã¦ã¯ï¼ã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼
+ããåç
+§ãããã¨ï¼
+
+6.11.2 ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ã
+
+ãã¬ã¼ã¹ã­ã°ãè¨é²ããæ¹æ³ã®ä¸ä¾ã¨ãã¦ï¼ã¡ã¢ãªä¸ã«ãã¬ã¼ã¹ã­ã°ãè¨é²ã
+ãããã®ãµã³ãã«ã³ã¼ããarch/logtraceãã£ã¬ã¯ããªã«ç¨æãã¦ããï¼ãã®ãµ
+ã³ãã«ã³ã¼ãã¯ï¼ã·ã¹ãã ã­ã°æ©è½ã¨åæ§ã®ãã¬ã¼ã¹ã­ã°æ©è½ãç¨æãï¼ãã¬ã¼
+ã¹ã­ã°æ
+å ±ãã¡ã¢ãªä¸ã«è¨é²ããã¨ã¨ãã«ï¼ãããèª­ã¿åºãã¦è¡¨ç¤ºããæ©è½ã
+å®ç¾ãã¦ããï¼
+
+ãã®ãµã³ãã«ã³ã¼ããçµã¿è¾¼ãæ¹æ³ã¯æ¬¡ã®éãã§ããï¼
+
+(1) target_kernel_impl.hããã³target_syssvc.hã«ï¼æ¬¡ã®è¨è¿°ãè¿½å ããï¼
+
+	#ifdef TOPPERS_ENABLE_TRACE
+	#include "arch/logtrace/trace_config.h"
+	#endif /* TOPPERS_ENABLE_TRACE */
+
+(2) Makefile.targetã«ï¼æ¬¡ã®è¨è¿°ãè¿½å ããï¼
+
+	ifeq ($(ENABLE_TRACE),true)
+		COPTS := $(COPTS) -DTOPPERS_ENABLE_TRACE
+		KERNEL_DIRS := $(KERNEL_DIRS) $(SRCDIR)/arch/logtrace
+		KERNEL_COBJS := $(KERNEL_COBJS) trace_config.o trace_dump.o
+	endif
+
+(3) ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã§ï¼bssã»ã¯ã·ã§ã³ã®ã¯ãªã¢ãçç¥ãã¦ããå ´å
+    ã«ã¯ï¼trace_modeãTRACE_STOPï¼ï¼0ï¼ã«åæåããã³ã¼ããè¿½å ããï¼ã
+    ãã¯ï¼ãã¬ã¼ã¹ã­ã°æ©è½ãåæåãããåã«æ¸ãè¾¼ã¾ãããã¬ã¼ã¹ã­ã°ã
+    ç¡è¦ããããã§ããï¼
+
+ãã®ãµã³ãã«ã³ã¼ããç¨ãã¦ï¼ãã¬ã¼ã¹ã­ã°ãè¨é²ã»ãã³ãããæ¹æ³ã®ä¾ã«ã¤
+ãã¦ã¯ï¼ãTOPPERS/ASP3ã«ã¼ãã« ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ãã®ã11.6 ãã¬ã¼ã¹
+ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ãã®ä½¿ç¨æ¹æ³ãã®ç¯ãåç
+§ãããã¨ï¼
+
+ãªãï¼ãã®ãµã³ãã«ã³ã¼ãã§ã¯ï¼ãã£ã¹ãããã£ã®åºå£ï¼ã¿ã¹ã¯ã®ç¶æ
+é·ç§»ï¼
+ã·ã¹ãã ã­ã°ã®åºåã®3ã¤ã®ãã¬ã¼ã¹ã­ã°ã®ã¿ãè¨é²ãã¦ããï¼ä»ã®ãã¬ã¼ã¹ã­
+ã°ãè¨é²ãããå ´åã«ã¯ï¼trace_config.hï¼ããã³trace_dump.cï¼ãä¿®æ­£ãã
+å¿
+è¦ãããï¼
+
+6.12 ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨ã®ããã®ãªãã¼ã è¨è¿°
+
+ã«ã¼ãã«å
+é¨ã«éãã¦ä½¿ãããé¢æ°ãå¤æ°ãªã©ã®åç§°ã§ï¼ãªãã¸ã§ã¯ããã¡ã¤
+ã«ã®ã·ã³ãã«è¡¨ã«ç»é²ããã¦å¤é¨ããåç
+§ã§ããåç§°ã¯ï¼Cè¨èªã¬ãã«ã§ï¼å
+é ­
+ã"_kernel_"ã¾ãã¯"_KERNEL_"ã§ããåç§°ã¨ããªããã°ãªããªããï¼ASP3ã«ã¼
+ãã«ã§ã¯ï¼ã½ã¼ã¹ã³ã¼ããã³ã³ãã¯ãã«ä¿ã¡ã¤ã¤ãããå®ç¾ããããã«ï¼ãªãã¼
+ã è¨è¿°ãã¡ã¤ã«ãå°å
+¥ãã¦ããï¼
+
+å
+·ä½çã«ã¯ï¼ãªãã¼ã ãã¹ãåç§°ããªã¹ãã¢ããããxxx_rename.defãç¨æãï¼
+ãã®ãã¡ã¤ã«ãããã¼ã«ï¼utils/genrenameï¼ã«ããï¼åç§°ããªãã¼ã ãããã
+ã®ãã¯ã­å®ç¾©ãå«ãxxx_rename.hã¨ï¼ãããã®ãã¯ã­å®ç¾©ãè§£é¤ããããã®
+xxx_unrename.hãçæããï¼ãã¼ã«ã®èµ·åæ¹æ³ã¯æ¬¡ã®éãã§ããï¼
+
+	% genrename xxx
+
+xxx_rename.defã«ã¯ï¼ãªãã¼ã ãã¹ãåç§°ã1è¡ã«1ã¤è¨è¿°ããï¼xxxxã¨ããå
+ç§°ãè¨è¿°ããã¦ããå ´åï¼xxx_rename.hã«ã¯æ¬¡ã®ãããªè¨è¿°ãçæãããï¼
+
+#define xxxx				_kernel_xxxx
+#ifdef TOPPERS_LABEL_ASM
+#define _xxxx				__kernel_xxxx
+#endif /* TOPPERS_LABEL_ASM */
+
+ã¾ãï¼xxx_unrename.hã«ã¯æ¬¡ã®ãããªè¨è¿°ãçæãããï¼
+
+#undef xxxx
+#ifdef TOPPERS_LABEL_ASM
+#undef _xxxx
+#endif /* TOPPERS_LABEL_ASM */
+
+xxx_rename.defã®ä¸­ã«ã¯ï¼ä»ã®ãªãã¼ã è¨è¿°ãåãè¾¼ãããã«ï¼ãINCLUDE
+"yyy"ãã¾ãã¯ãINCLUDE <yyy>ãã¨ããè¨è¿°ãå«ãããã¨ãã§ããï¼ãã®è¨è¿°
+ãããã¦ããå ´åï¼xxx_rename.hã«ã¯ã#include "yyy_rename.h"ãã¾ãã¯
+ã#include <yyy_rename.h>ãã¨ããè¨è¿°ãï¼xxx_unrename.hã«ã¯ã#include
+"yyy_unrename.h"ãã¾ãã¯ã#include <yyy_unrename.h>ãã¨ããè¨è¿°ãçæã
+ããï¼
+
+xxx_rename.defã®ä¸­ã®"#"ã§å§ã¾ãè¡ã¯ã³ã¡ã³ãã¨ãã¦èª­ã¿é£ã°ãããï¼ã¾ãï¼
+ç©ºè¡ãç¡è¦ãããï¼
+
+ã«ã¼ãã«ã®ã¿ã¼ã²ããéä¾å­é¨ã§ä½¿ãããåç§°ããªãã¼ã ããããã«ï¼kernel
+ãã£ã¬ã¯ããªã«ï¼kernel_rename.defã¨ï¼ããããçæããkernel_rename.hã
+ãã³kernel_unrename.hãç¨æããã¦ããï¼kernel_rename.defã«ã¯ï¼
+ãINCLUDE "target"ãã¨ããè¨è¿°ãå«ã¾ãã¦ããï¼ã¿ã¼ã²ããä¾å­é¨ã®ãªãã¼
+ã è¨è¿°ãåãè¾¼ãããã«ãªã£ã¦ããï¼ã¿ã¼ã²ããä¾å­é¨ã§å®ç¾©ãï¼ã¿ã¼ã²ãã
+éä¾å­é¨ã§åç
+§ãããåç§°ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã®ãªãã¼ã è¨è¿°ã«å«ããï¼
+
+ã¿ã¼ã²ããä¾å­é¨ã§ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ä½¿ãããåç§°ããªãã¼ã ãããã
+ã«ï¼target_rename.defã¨ï¼ããããçæããtarget_rename.hããã³
+target_unrename.hãç¨æããï¼ã¿ã¼ã²ããä¾å­é¨ããéçºç°å¢ä¾å­é¨ï¼ãã­ã»ã
+ãµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ãåãåããå ´åã«ã¯ï¼target_rename.defã«
+INCLUDEè¨è¿°ãå
+¥ãï¼éçºç°å¢ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ã®
+ãªãã¼ã è¨è¿°ãåãè¾¼ãããã«ããï¼
+
+6.13 é«åè§£è½ã¿ã¤ããã©ã¤ã
+
+é«åè§£è½ã¿ã¤ããã©ã¤ãã¯ï¼ã«ã¼ãã«ãã·ã¹ãã æå»ã®æ´æ°ã«ç¨ããããé«å
+è§£è½ã¿ã¤ããæ½è±¡åããããã®ããã¤ã¹ãã©ã¤ãã§ããï¼é«åè§£è½ã¿ã¤ããã©
+ã¤ãã«é¢é£ãã¦ï¼target_kernel.hã¾ãã¯ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«
+ã«å«ããã¹ãå®ç¾©ã«ã¤ãã¦ã¯ï¼ã5.3 é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æã¨ã«ã¦ã³ã
+å¤ã®é²ã¿å¹
+ãã®ç¯ãåç
+§ãããã¨ï¼
+
+ãTOPPERS/ASP1ã«ã¼ãã«ã¨ã®é¢ä¿ã
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ã¿ã¤ã ãã£ãã¯ãç¨ããªãæéç®¡çã®ããã«ï¼é«åè§£è½ã¿
+ã¤ããç¨ãã¦ããï¼é«åè§£è½ã¿ã¤ããå¹ççã«å®ç¾ã§ããªãã¿ã¼ã²ããã·ã¹ã
+ã åãã«ã¯ï¼é«åè§£è½ã¿ã¤ããã©ã¤ããï¼ã¿ã¤ã ãã£ãã¯ãç¨ãã¦å®è£
+ããæ¹
+æ³ãããï¼ãã®å®è£
+æ¹æ³ã«ã¤ãã¦ã¯ï¼ã6.13.4 ã¿ã¤ã ãã£ãã¯ãç¨ããã¿ã¤ã
+ãã©ã¤ãã®å®è£
+ãã®ç¯ãåç
+§ãããã¨ï¼
+
+6.13.1 é«åè§£è½ã¿ã¤ããã©ã¤ãã®ãã¡ã¤ã«æ§æ
+
+é«åè§£è½ã¿ã¤ããã©ã¤ããçµã¿è¾¼ãããã®éçAPIãè¨è¿°ããã·ã¹ãã ã³ã³ãã£
+ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ãï¼target_timer.cfgã«ç¨æããï¼ãã®ãã¡ã¤ã«ã«ã¯ï¼
+é«åè§£è½ã¿ã¤ããã©ã¤ããåæåããããã®åæåã«ã¼ãã³ã®è¿½å ï¼é«åè§£è½
+ã¿ã¤ããã©ã¤ããçµäºãããããã®çµäºå¦çã«ã¼ãã³ã®è¿½å ï¼é«åè§£è½ã¿ã¤ã
+å²è¾¼ã¿ã®ããã®å²è¾¼ã¿ãã³ãã©ã®å®ç¾©ï¼ã¾ãã¯ï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®ç
+æï¼ï¼é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®ããã®å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ã®è¨­å®ã®éç
+APIãªã©ãå«ããã¨ã«ãªãï¼
+
+é«åè§£è½ã¿ã¤ããã©ã¤ããå¼ã³åºãããã«å¿
+è¦ãªå®ç¾©ãå«ãããããã¡ã¤ã«ãï¼
+target_timer.hã«ç¨æããï¼ã¾ãï¼é«åè§£è½ã¿ã¤ããã©ã¤ãã®å®è£
+ãã¡ã¤ã«ã
+target_timer.cã«ç¨æããï¼
+
+ã·ã¹ãã æå»ã®çµéããã£ããã«è¡ãå¦çã®å¤ãã¯ï¼ã¿ã¹ã¯ã®èµ·åãå¾
+ã¡è§£é¤
+ãè¡ããã®ã§ããããï¼é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å²è¾¼ã¿åªå
+åº¦ã¯ï¼å²è¾¼ã¿ã®ä¸­
+ã§æä½ã®åªå
+åº¦ã§ååã§ããï¼ãã ãï¼å¨æãã³ãã©ãã¢ã©ã¼ã ãã³ãã©ã®å®
+è¡éå§é
+ããåé¡ã«ãªãå ´åã«ã¯ï¼é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å²è¾¼ã¿åªå
+åº¦ãã
+ãé«ãå¤ã«è¨­å®ãããï¼ããã§ï¼é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å²è¾¼ã¿åªå
+åº¦ãå¤æ´
+ããæ¹æ³ãï¼ã¿ã¼ã²ããä¾å­é¨ã®ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ã«è¨è¼ãã¹ãã§ããï¼
+
+6.13.2 é«åè§£è½ã¿ã¤ãã®æä½ã¨å²è¾¼ã¿å¦ç
+
+é«åè§£è½ã¿ã¤ããã©ã¤ããæä¾ããæ½è±¡åãããé«åè§£è½ã¿ã¤ãã¯ï¼0ããï¼1
+ãã¤ã¯ã­ç§ã«1ã®ãã¼ã¹ã§ã«ã¦ã³ãã¢ãããï¼ã¿ã¤ãå¨æã«éããã0ã«æ»ãã
+ã®ã¨ããï¼1ãã¤ã¯ã­ç§ã«1ã®ãã¼ã¹ã§ã«ã¦ã³ãã¢ããããã°ï¼1ãã¤é£ç¶ãã¦ã«
+ã¦ã³ãã¢ããããªãã¦ãããï¼ä¾ãã°ï¼2ãã¤ã¯ã­ç§æ¯ã«2ãã¤ã«ã¦ã³ãã¢ãã
+ãã¦ãè¯ãï¼ï¼ã¿ã¤ãå¨æã¯ã¿ã¼ã²ããä¾å­ã§ãããï¼2^32ä»¥ä¸ã§ãããã®ã¨
+ããï¼
+
+(6-13-2-1) void target_hrt_initialize(intptr_t exinf)
+
+é«åè§£è½ã¿ã¤ããåæåãï¼é«åè§£è½ã¿ã¤ãã®åä½ãéå§ãããï¼
+
+ãã®é¢æ°ã¯ï¼target_timer.cfgä¸­ã«è¨è¿°ããéçAPIã«ããï¼åæåã«ã¼ãã³ã¨
+ãã¦ã«ã¼ãã«ã«ç»é²ããï¼ãã®ããï¼é¢æ°åãå¤æ´ãã¦ãå·®ãæ¯ããªãï¼
+
+(6-13-2-2) void target_hrt_terminate(intptr_t exinf)
+
+é«åè§£è½ã¿ã¤ãã®åä½ãåæ­¢ããï¼é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ãçºçããªãããã«
+ããï¼
+
+ãã®é¢æ°ã¯ï¼target_timer.cfgä¸­ã«è¨è¿°ããéçAPIã«ããï¼çµäºå¦çã«ã¼ãã³
+ã¨ãã¦ã«ã¼ãã«ã«ç»é²ããï¼ãã®ããï¼é¢æ°åãå¤æ´ãã¦ãå·®ãæ¯ããªãï¼
+
+(6-13-2-3) HRTCNT target_hrt_get_current(void)
+
+é«åè§£è½ã¿ã¤ãã®ç¾å¨å¤ãè¿ãï¼
+
+(6-13-2-4) void target_hrt_set_event(HRTCNT hrtcnt)
+
+é«åè§£è½ã¿ã¤ããï¼hrtcntã§æå®ããå¤ã«ã¦ã³ãã¢ãããããå²è¾¼ã¿ãçºçã
+ããããã«è¨­å®ããï¼å²è¾¼ã¿ãçºçãããã¿ã¤ãã³ã°ããã§ã«è¨­å®ããã¦ãã
+å ´åã¯ï¼ããã¾ã§ã«è¨­å®ããã¦ããã¿ã¤ãã³ã°ã¯ã­ã£ã³ã»ã«ããï¼hrtcntã«0ã
+æ¸¡ããããã¨ã¯ãªãï¼ãã®ãããªå ´åã«ã¯ï¼target_hrt_raise_eventãå¼ã°ã
+ãï¼ï¼
+
+é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã1ãã¤é£ç¶ãã¦ã«ã¦ã³ãã¢ããããªãå ´åã«ã¯ï¼
+å²è¾¼ã¿ãçºçãããã¿ã¤ãã³ã°ãé
+ãæ¹ã«ä¸¸ããï¼
+
+(6-13-2-5) void target_hrt_raise_event(void)
+
+é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ãå³åº§ã«çºçãããï¼ãã¼ãã¦ã§ã¢ã®æ©è½çã«ãããå®
+ç¾ã§ããªãå ´åã«ã¯ï¼æå°ã®ã«ã¦ã³ãã¢ããå¤ã§å²è¾¼ã¿ãçºçãããæ¹æ³ï¼è¨
+ãæããã¨ãtarget_hrt_set_event(1U)ãã§å®ç¾ãã¦ãããï¼
+
+(6-13-2-6) HRTCNT_BOUND
+
+é«åè§£è½ã¿ã¤ãã«è¨­å®ããã«ã¦ã³ãã¢ããå¤ã®ä¸éå¤ãï¼ãã®ãã¯ã­ã«å®ç¾©ã
+ãï¼HRTCNT_BOUNDã¯ï¼é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æï¼TCYC_HRTCNTï¼ããã¿ã¤ã
+å²è¾¼ã¿ã®é
+å»¶æéãããé·ãå¤ãæ¸ããå¤ã«å®ç¾©ããï¼ã«ã¼ãã«ã®å®è£
+ä¸ã®é½
+åã«ããï¼HRTCNT_BOUNDã¯ï¼4,294,000,000æªæºã®å¤ã«è¨­å®ããªããã°ãªããªãï¼
+
+HRTCNT_BOUNDãè¨­ãã¦ããçç±ã¯ï¼é«åè§£è½ã¿ã¤ããã¿ã¤ãå¨æã®ããããã§
+å²è¾¼ã¿ããããããã«è¨­å®ããå ´åï¼å²è¾¼ã¿ãã³ãã©å
+ã§é«åè§£è½ã¿ã¤ããèª­
+ãã æç¹ã§ã¿ã¤ãå¨æãè¶ãã¦ããï¼é«åè§£è½ã¿ã¤ããå¨åãããã¨ãè¦è½ã¨
+ãå¯è½æ§ãããããã§ããï¼
+
+(6-13-2-7) void target_hrt_handler(void)
+    ã¾ãã¯ void target_hrt_isr(intptr_t exinf)
+
+é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã«ããèµ·åãããå²è¾¼ã¿å¦çãã­ã°ã©ã ï¼å²è¾¼ã¿ãã³ã
+ã©ã¨ãã¦å®ç¾ããå ´åã«ã¯target_hrt_handlerï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã¨ã
+ã¦å®ç¾ããå ´åã«ã¯target_hrt_isrã®åç§°ã¨ããï¼ã¿ã¼ã²ããéä¾å­é¨ã®
+signal_timeãå¼ã³åºãï¼
+
+target_hrt_handlerã¯ï¼æ¨æºçã«ã¯æ¬¡ã®ããã«å®ç¾©ããï¼
+
+----------------------------------------
+void
+target_hrt_handler(void)
+{
+	é«åè§£è½ã¿ã¤ãå²è¾¼ã¿è¦æ±ã®ã¯ãªã¢ï¼å¿
+è¦ãªãï¼
+	signal_time();
+}
+----------------------------------------
+
+ãã®é¢æ°ã¯ï¼target_timer.cfgä¸­ã«è¨è¿°ããéçAPIã«ããï¼å²è¾¼ã¿ãã³ãã©ã¾
+ãã¯å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã¨ãã¦ã«ã¼ãã«ã«ç»é²ããï¼ãã®ããï¼é¢æ°åã
+å¤æ´ãã¦ãå·®ãæ¯ããªãï¼
+
+6.13.3 é«åè§£è½ã¿ã¤ããã©ã¤ãã®å®è£
+ã¢ãã­ã¼ã
+
+é«åè§£è½ã¿ã¤ããã©ã¤ãã¯ï¼ãã¼ãã¦ã§ã¢ã§é«æ©è½ãªã¿ã¤ããæã£ã¦ããå ´å
+ã«ã¯ï¼1ã¤ã®ã¿ã¤ãã ãã§å®è£
+ã§ããå¯è½æ§ãããï¼ã¿ã¤ãã®æ©è½ã«ããï¼ãï¼
+ããã§ãªãå ´åã«ã¯ï¼ã¿ã¤ãã2ã¤ä½¿ã£ã¦å®è£
+ãããã¨ãæ³å®ãã¦ããï¼
+
+å
+·ä½çã«ã¯ï¼çæ¹ã®ã¿ã¤ãï¼ä»¥ä¸ï¼ãããã¿ã¤ã1ã¨å¼ã¶ï¼ã¯ï¼ç¡éã«ã«ã¦ã³ã
+ããï¼å¿
+ç¶çã«å·¡åããï¼ï¼é«åè§£è½ã¿ã¤ãã®ç¾å¨å¤ãè¿ãã®ã«ç¨ãï¼ããç
+æ¹ã®ã¿ã¤ãï¼ä»¥ä¸ï¼ãããã¿ã¤ã2ã¨å¼ã¶ï¼ã¯ï¼å²è¾¼ã¿ãçºçãããããã«ç¨ã
+ãï¼
+
+ãã®æï¼2ã¤ã®ã¿ã¤ããå
+¨ãåãã¿ã¤ãã³ã°ã§ã«ã¦ã³ãã¢ããï¼ã¾ãã¯ã«ã¦ã³ã
+ãã¦ã³ï¼ãã¦ããã°åé¡ãªããï¼å®éã«ã¯ï¼2ã¤ã®ã¿ã¤ãã«å¥ã
+ã«ããªã¹ã±ã¼ã©
+ãå
+¥ã£ã¦ããå ´åãï¼2ã¤ã®ã¿ã¤ããå¥ã®ã¯ã­ãã¯ã§é§åããå ´åã«ã¯ï¼ã«ã¦ã³
+ãã¢ããã®ã¿ã¤ãã³ã°ãããããã¨ãèããããï¼ãã®ãããªå ´åã«ã¯ï¼ä»¥ä¸
+ã®å¶ç´ãæºããããã«å®è£
+ãããã¨ãå¿
+è¦ã§ããï¼
+
+target_hrt_get_current()ã§ã¿ã¤ãå¤ãèª­ã¿ï¼target_hrt_set_event(count)ã«
+ããã¿ã¤ãå²è¾¼ã¿ãçºçãããå¾ï¼target_hrt_get_current()ã§ã¿ã¤ãå¤ãèª­
+ãã å ´åã«ã¯ï¼2åã®target_hrt_get_current()ã®å¼ã³åºãã®éã«ï¼ã¿ã¤ãå¤ã
+countä»¥ä¸é²ãã§ããªããã°ãªããªãï¼
+
+ããå³å¯ã«ã¯ï¼ä»¥ä¸ã®ã·ã¼ã±ã³ã¹ã§é«åè§£è½ã¿ã¤ããã©ã¤ããå¼ã³åºããå ´å
+ã«ï¼(count2 - count1 >= count)ãæºãããªããã°ãªããªãï¼
+
+	count1 = target_hrt_get_current();
+	target_hrt_set_event(count);
+	â¦ ããã§æéãçµé â¦
+	å²è¾¼ã¿ãçºç
+	count2 = target_hrt_get_current();
+
+ç´ ç´ã«å®è£
+ããã¨ãã®æ¡ä»¶ãæºãããªãå ´åã«ã¯ï¼target_hrt_set_eventã§å²
+è¾¼ã¿ãçºçãããã¿ã¤ãã³ã°ãé
+ãæ¹ã«èª¿æ´ããï¼
+
+6.13.4 ã¿ã¤ã ãã£ãã¯ãç¨ããã¿ã¤ããã©ã¤ãã®å®è£
+
+
+ASP1ã«ã¼ãã«ã¨åæ§ã«ï¼ã¿ã¤ã ãã£ãã¯ã«ããæéç®¡çãè¡ãããå ´åã«ï¼é«
+åè§£è½ã¿ã¤ããã©ã¤ããã¿ã¤ã ãã£ãã¯ãç¨ãã¦å®è£
+ãããã¨ã§ï¼ã¿ã¼ã²ãã
+ä¾å­é¨ã®ã¿ã®ä¿®æ­£ã§å¯¾å¿ãããã¨ãã§ããï¼ãã ãï¼ãã®æ¹æ³ã¯ï¼ã«ã¼ãã«ã®
+æéç®¡çæ©è½ã«æãå ããããã§ã¯ãªãããï¼ã«ã¼ãã«ãä¸å¿
+è¦ãªä»äºããã¦
+ãã¾ããã¨ã¯è¨±å®¹ããå¿
+è¦ãããï¼
+
+ã¿ã¤ã ãã£ãã¯ãç¨ãã¦é«åè§£è½ã¿ã¤ããã©ã¤ããå®è£
+ããå ´åã«ã¯ï¼åãã¯
+ã­ããã³é¢æ°ãæ¬¡ã®ããã«å®è£
+ããï¼
+
+ã»TCYC_HRTCNTï¼é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æï¼ã¯å®ç¾©ããªãï¼ã¿ã¤ãå¨æã
+ã2^32ã®æå³ã«ãªãï¼ï¼
+ã»TSTEP_HRTCNTï¼é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã®é²ã¿å¹
+ï¼ãï¼ã¿ã¤ã ãã£ãã¯
+ãã®å¨æã«å®ç¾©ããï¼åä½ã¯ãã¤ã¯ã­ç§ï¼ï¼
+ã»é«åè§£è½ã¿ã¤ãã®ç¾æç¹ã®å¤ãä¿æããå¤æ°ï¼hrtcnt_currentï¼HRTCNTåï¼
+ããç¨æããï¼
+ã»target_hrt_initializeã§ã¯ï¼ã¿ã¤ããåæåãï¼ã¿ã¤ãå²è¾¼ã¿ãå¨æçã«çº
+ãçãããããã«ããï¼ã¾ãï¼hrtcnt_currentã0ã«åæåããï¼
+ã»target_hrt_terminateã§ã¯ï¼ã¿ã¤ãã®åä½ãåæ­¢ããï¼ã¿ã¤ãå²è¾¼ã¿ãçºç
+ãããªãããã«ããï¼
+ã»target_hrt_get_currentã¯ï¼hrtcnt_currentã®å¤ãè¿ãï¼
+ã»target_hrt_set_eventã¨target_hrt_raise_eventã§ã¯ä½ãããªãï¼
+ã»HRTCNT_BOUNDã¯ï¼4000000002ã«å®ç¾©ãããã¨ãæ¨å¥¨ããï¼
+ã»target_hrt_handlerã¾ãã¯target_hrt_isrã¯ï¼ï¼å¿
+è¦ãªãï¼ã¿ã¤ãå²è¾¼ã¿è¦
+ãæ±ãã¯ãªã¢ãï¼hrtcnt_currentã«ã¿ã¤ã ãã£ãã¯ã®å¨æãå ããå¾ï¼ã¿ã¼ã²ã
+ããéä¾å­é¨ã®signal_timeãå¼ã³åºãï¼
+
+6.14 ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ãï¼ãªãã·ã§ã³ï¼
+
+ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ãã¯ï¼ã«ã¼ãã«ããªã¼ãã©ã³ãã³ãã©æ©è½ã®å®ç¾ã«ç¨
+ããããã®ãªã¼ãã©ã³ã¿ã¤ããæ½è±¡åããããã®ããã¤ã¹ãã©ã¤ãã§ããï¼ãªã¼
+ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸ããµãã¼ãããªãå ´åã«ã¯ï¼ãªã¼ãã©ã³ã¿
+ã¤ããã©ã¤ããç¨æããå¿
+è¦ã¯ãªãï¼
+
+6.14.1 ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ãã®ãã¡ã¤ã«æ§æ
+
+ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ãã¯ï¼é«åè§£è½ã¿ã¤ããã©ã¤ãã¨åããã¡ã¤ã«ã®ä¸­ã«
+è¨è¿°ããï¼ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ãã®ããã®è¨è¿°ã¯ï¼TOPPERS_SUPPORT_OVRHDR
+ããã¯ã­å®ç¾©ããã¦ããå ´åã«ã®ã¿æå¹ã«ãªãããã«ããï¼
+
+å
+·ä½çã«ã¯ï¼ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ããçµã¿è¾¼ãããã®éçAPIã¯
+target_timer.cfgã®ä¸­ã«è¨è¿°ããï¼ãã®ãã¡ã¤ã«ã«ã¯ï¼ãªã¼ãã©ã³ã¿ã¤ããã©
+ã¤ããåæåããããã®åæåã«ã¼ãã³ã®è¿½å ï¼ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ãã
+çµäºãããããã®çµäºå¦çã«ã¼ãã³ã®è¿½å ï¼ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ã®ããã®
+å²è¾¼ã¿ãã³ãã©ã®å®ç¾©ï¼ã¾ãã¯ï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®çæï¼ï¼ãªã¼ãã©
+ã³ã¿ã¤ãå²è¾¼ã¿ã®ããã®å²è¾¼ã¿è¦æ±ã©ã¤ã³ã®å±æ§ã®è¨­å®ã®éçAPIãªã©ãå«ãã
+ã¨ã«ãªãï¼
+
+ã¾ãï¼ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ããå¼ã³åºãããã«å¿
+è¦ãªå®ç¾©ã¯
+target_timer.hã®ä¸­ã«ï¼ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ãã®å®è£
+ã¯target_timer.cã®
+ä¸­ã«è¨è¿°ããï¼
+
+ãªã¼ãã©ã³ãã³ãã©ã¯ï¼ã¿ã¹ã¯ã®ãªã¼ãã©ã³ã«å¯¾ããå¦çãè¡ããã®ã§ããã
+ãï¼ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ã®å²è¾¼ã¿åªå
+åº¦ã¯ï¼å²è¾¼ã¿ã®ä¸­ã§æä½ã®åªå
+åº¦ã§
+ååã§ããï¼ãã ãï¼ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ã®å²è¾¼ã¿åªå
+åº¦ãããé«ãå¤ã«
+è¨­å®ãããå ´åããªãã¨ã¯è¨ããªãããï¼ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ã®å²è¾¼ã¿åª
+å
+åº¦ãå¤æ´ããæ¹æ³ãï¼ã¿ã¼ã²ããä¾å­é¨ã®ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ã«è¨è¼ãã¹
+ãã§ããï¼
+
+6.14.2 ãªã¼ãã©ã³ã¿ã¤ãã®æä½ã¨å²è¾¼ã¿å¦ç
+
+(6-14-2-1) void target_ovrtimer_initialize(intptr_t exinf)
+
+ãªã¼ãã©ã³ã¿ã¤ãã®åæåå¦çãè¡ãï¼ã¿ã¤ãã®åä½éå§ã¯è¡ããªãï¼
+
+ãã®é¢æ°ã¯ï¼target_timer.cfgä¸­ã«è¨è¿°ããéçAPIã«ããï¼åæåã«ã¼ãã³ã¨
+ãã¦ã«ã¼ãã«ã«ç»é²ããï¼ãã®ããï¼é¢æ°åãå¤æ´ãã¦ãå·®ãæ¯ããªãï¼
+
+(6-14-2-2) void target_ovrtimer_terminate(intptr_t exinf)
+
+ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ããï¼ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ãçºçããªãããã«ã
+ãï¼
+
+ãã®é¢æ°ã¯ï¼target_timer.cfgä¸­ã«è¨è¿°ããéçAPIã«ããï¼çµäºå¦çã«ã¼ãã³
+ã¨ãã¦ã«ã¼ãã«ã«ç»é²ããï¼ãã®ããï¼é¢æ°åãå¤æ´ãã¦ãå·®ãæ¯ããªãï¼
+
+(6-14-2-3) void target_ovrtimer_start(PRCTIM ovrtim)
+
+ãªã¼ãã©ã³ã¿ã¤ããï¼ovrtimã§æå®ããæéãçµéãããå²è¾¼ã¿ãçºçããã
+ãã«è¨­å®ãï¼åä½éå§ããï¼ovrtimã0ã®å ´åã¯ï¼ã§ããéãæ©ããªã¼ãã©ã³ã¿
+ã¤ãå²è¾¼ã¿ãçºçãããï¼ovrtimã®åä½ã¯ãã¤ã¯ã­ç§ã¨ããï¼
+
+(6-14-2-4) PRCTIM target_ovrtimer_stop(void)
+
+ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ãï¼ã¿ã¤ãã®æ®ãæéï¼å²è¾¼ã¿çºçã¾ã§ã®æéï¼ãè¿
+ãï¼æ®ãæéããªããªã£ã¦ããå ´åã«ã¯ï¼0ãè¿ãï¼ã¾ãï¼ãªã¼ãã©ã³ã¿ã¤ãã
+ãã®å²è¾¼ã¿è¦æ±ãã¯ãªã¢ããï¼ã¯ãªã¢ããªãã¨ã¹ããªã¢ã¹å²è¾¼ã¿ãçºçãããï¼
+ã¯ãªã¢ãããã¨ã¯å¿
+é ã§ã¯ãªãï¼ï¼
+
+(6-14-2-5) PRCTIM target_ovrtimer_get_current(void)
+
+ãªã¼ãã©ã³ã¿ã¤ãã®æ®ãæéï¼å²è¾¼ã¿çºçã¾ã§ã®æéï¼ãèª­ã¿åºãï¼æ®ãæé
+ããªããªã£ã¦ããå ´åã«ã¯ï¼0ãè¿ãï¼ãªã¼ãã©ã³ã¿ã¤ãããã®å²è¾¼ã¿ã¯ã¯ãªã¢
+ããªãï¼
+
+(6-14-2-6) void target_ovrtimer_handler(void)
+    ã¾ãã¯ void target_ovrtimer_isr(intptr_t exinf)
+
+ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ã«ããèµ·åãããå²è¾¼ã¿å¦çãã­ã°ã©ã ï¼å²è¾¼ã¿ãã³
+ãã©ã¨ãã¦å®ç¾ããå ´åã«ã¯target_ovrtimer_handlerï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ã
+ã³ã¨ãã¦å®ç¾ããå ´åã«ã¯target_ovrtimer_isrã®åç§°ã¨ããï¼ã¿ã¼ã²ããéä¾
+å­é¨ã®call_ovrhdrãå¼ã³åºãï¼
+
+target_ovrtimer_handlerã¯ï¼æ¨æºçã«ã¯æ¬¡ã®ããã«å®ç¾©ããï¼
+
+----------------------------------------
+void
+target_ovrtimer_handler(void)
+{
+	ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿è¦æ±ã®ã¯ãªã¢ï¼å¿
+è¦ãªãï¼
+	call_ovrhdr();
+}
+----------------------------------------
+
+ãã®é¢æ°ã¯ï¼target_timer.cfgä¸­ã«è¨è¿°ããéçAPIã«ããï¼å²è¾¼ã¿ãã³ãã©ã¾
+ãã¯å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã¨ãã¦ã«ã¼ãã«ã«ç»é²ããï¼ãã®ããï¼é¢æ°åã
+å¤æ´ãã¦ãå·®ãæ¯ããªãï¼
+
+(6-14-2-7) OMIT_OVRTIMER_STARTï¼ãªãã·ã§ã³ï¼
+(6-14-2-8) OMIT_OVRTIMER_STOPï¼ãªãã·ã§ã³ï¼
+
+ã¿ã¼ã²ããä¾å­é¨ããå¼ã³åºãovrtimer_startã¨ovrtimer_stopãï¼ã¢ã»ã³ããª
+è¨èªã®ã½ã¼ã¹ã³ã¼ãä¸­ã«å±éãï¼Cè¨èªã®é¢æ°ãä¸è¦ã«ãªãå ´åã«ã¯ï¼ããããï¼
+OMIT_OVRTIMER_STARTã¨OMIT_OVRTIMER_STOPããã¯ã­å®ç¾©ããï¼
+
+6.15 åçã¡ã¢ãªç®¡çï¼ãªãã·ã§ã³ï¼
+
+åççææ©è½æ¡å¼µããã±ã¼ã¸ãä½¿ç¨ããå ´åã«ã¯ï¼ã«ã¼ãã«å
+ã§ã®åçã¡ã¢ãª
+ç®¡çã®æ¹æ³ãæ±ºããå¿
+è¦ãããï¼
+
+åççææ©è½æ¡å¼µããã±ã¼ã¸ã®ã¿ã¼ã²ããéä¾å­é¨ã§ã¯ï¼ã¡ã¢ãªé åãå
+é ­ã
+ãé ã«å²ãå½ã¦ï¼è§£æ¾ãããã¡ã¢ãªé åãåå©ç¨ããªãã¡ã¢ãªç®¡çã¢ã¸ã¥ã¼ã«
+ã®ã¿ãå®è£
+ãã¦ããï¼ããã©ã«ãã§ã¯ï¼ãã®ã¡ã¢ãªç®¡çã¢ã¸ã¥ã¼ã«ãä½¿ç¨ãã
+ãï¼
+
+æ¬æ ¼çãªåçã¡ã¢ãªç®¡çãè¡ãããå ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã¾ãã¯ã¦ã¼ã¶
+å´ã§ï¼ä»¥ä¸ã®é¢æ°ãå®ç¾©ããã¡ã¢ãªç®¡çã¢ã¸ã¥ã¼ã«ãç¨æããå¿
+è¦ãããï¼
+
+(6-15-1) OMIT_KMM_ALLOCONLYï¼ãªãã·ã§ã³ï¼
+
+ã¿ã¼ã²ããéä¾å­é¨ã®ã¡ã¢ãªç®¡çã¢ã¸ã¥ã¼ã«ãä½¿ç¨ããï¼ã¿ã¼ã²ããä¾å­é¨ã¾
+ãã¯ã¦ã¼ã¶å´ã§ç¨æããå ´åã«ã¯ï¼ãã®ã·ã³ãã«ããã¯ã­å®ç¾©ããï¼
+
+(6-15-2) void initialize_kmm(void)ï¼ãªãã·ã§ã³ï¼
+
+ã¡ã¢ãªç®¡çã¢ã¸ã¥ã¼ã«ãåæåããé¢æ°ï¼ã«ã¼ãã«ã®å²ãä»ããã¡ã¢ãªé åã®
+ãµã¤ãºã¨å
+é ­çªå°ã¯ï¼ããããkmmszã¨kmmã«ãã£ã¦åç
+§ã§ããï¼
+
+(6-15-3) void *kernel_malloc(size_t size)ï¼ãªãã·ã§ã³ï¼
+
+sizeã§æå®ããããµã¤ãºã®ã¡ã¢ãªé åãå²ãä»ãï¼ãã®å
+é ­çªå°ãè¿ãé¢æ°ï¼
+å²ãä»ãããã¨ãã§ããªãå ´åã«ã¯ï¼NULLãè¿ãï¼
+
+(6-15-4) void kernel_free(void *ptr)ï¼ãªãã·ã§ã³ï¼
+
+ptrã§æå®ãããã¡ã¢ãªé åãè§£æ¾ããé¢æ°ï¼
+
+6.15.1 TLSFãç¨ããã¡ã¢ãªç®¡çã¢ã¸ã¥ã¼ã«ã®ä¾
+
+ãªã¼ãã³ã½ã¼ã¹ã®ã¡ã¢ãªå²ä»ãã©ã¤ãã©ãªã§ããTLSFãç¨ãã¦åçã¡ã¢ãªç®¡ç
+ãå®ç¾ããã«ã¯ï¼OMIT_KMM_ALLOCONLYããã¯ã­å®ç¾©ãï¼ä»¥ä¸ã®é¢æ°å®ç¾©ç­ãCè¨
+èªã½ã¼ã¹ãã¡ã¤ã«ã«å«ããã°ããï¼
+
+----------------------------------------
+#include "tlsf.h"
+
+static bool_t	tlsf_initialized = false;
+
+void
+initialize_kmm(void)
+{
+	if (init_memory_pool(kmmsz, kmm) >= 0) {
+		tlsf_initialized = true;
+	}
+}
+
+void *
+kernel_malloc(size_t size)
+{
+	if (tlsf_initialized) {
+		return(malloc_ex(size, kmm));
+	}
+	else {
+		return(NULL);
+	}
+}
+
+void
+kernel_free(void *ptr)
+{
+	if (tlsf_initialized) {
+		free_ex(ptr, kmm);
+	}
+}
+----------------------------------------
+
+
+ï¼ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿è¨­å®ãã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨
+
+7.1 è¨­å®ãã¡ã¤ã«ã¨ã¿ã¼ã²ããä¾å­é¨ã®ä½ç½®ä»ã
+
+ASP3ã«ã¼ãã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã¯ï¼è¨­å®ãã¡ã¤ã«ã®è¨è¿°ã«å¾ã£ã¦ãã¡ã¤ã«
+ã®çæããã³ã¨ã©ã¼ãã§ãã¯ãè¡ãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®è¨­å®ãã¡ã¤ã«ã«ã¯ï¼
+ä»¥ä¸ã®4ã¤ãããï¼
+
+(a) éçAPIãã¼ãã«
+
+éçAPIã®ä¸è¦§ã¨ï¼åéçAPIã®ãã©ã¡ã¼ã¿ã«ã¤ãã¦è¨è¿°ãããã¡ã¤ã«ï¼éç
+APIãæ¡å¼µããå ´åä»¥å¤ã¯å¤æ´ããå¿
+è¦ããªãããï¼ã¿ã¼ã²ããéä¾å­é¨ã§ç¨æ
+ãã¦ããï¼kernel/kernel_api.csvï¼ï¼
+
+(b) å¤åå¾ã·ã³ãã«ãã¼ãã«
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹1ã«ããã¦ï¼ãã©ã¡ã¼ã¿è¨ç®ç¨Cè¨èªãã¡ã¤ã«ã«åºå
+ãï¼å¤ãæ±ãããã·ã³ãã«ï¼ä¸è¬ã«ã¯å¼ï¼ãè¨è¿°ããããã®ãã¡ã¤ã«ï¼ã¿ã¼ã²ã
+ãéä¾å­é¨ã§ã¯ï¼ã¿ã¼ã²ããã«ä¾å­ããã«å¿
+è¦ã¨ãªãã·ã³ãã«ãè¨è¿°ãããã¡
+ã¤ã«ãç¨æãã¦ããï¼kernel/kernel_def.csvï¼ï¼
+
+ã¿ã¼ã²ããã«ä¾å­ãã¦å¿
+è¦ã¨ãªãã·ã³ãã«ãããå ´åã«ã¯ï¼targetãã£ã¬ã¯ã
+ãªã«ç½®ãããtarget_def.csvä¸­ã«è¨è¿°ããï¼target_def.csvä¸­ã«è¨è¿°ãã¦å¤ã
+æ±ãããã¨ãã§ããã·ã³ãã«ã¯ï¼kernel/kernel_int.hããã³ããããã¤ã³ã¯ã«ã¼
+ãããããã¡ã¤ã«ã§å®ç¾©ããã¦ããªããã°ãªããªãï¼kernel_int.hããã¯ï¼
+target_stddef.hï¼target_kernel.hï¼target_kernel_impl.hãï¼éæ¥çã«ï¼ã¤
+ã³ã¯ã«ã¼ããã¦ããããï¼ãããã®ãã¡ã¤ã«ããã³ããããã¤ã³ã¯ã«ã¼ããã
+ããã¡ã¤ã«ã§å®ç¾©ãããã¿ã¼ã²ããä¾å­ã®ã·ã³ãã«ã¯ï¼target_def.csvä¸­ã«è¨
+è¿°ãããã¨ãã§ããï¼
+
+ããã§å¤ãæ±ããã·ã³ãã«ã®å¤ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹2ããã³ãã¹3ã®
+ãã³ãã¬ã¼ããã¡ã¤ã«ä¸­ã§åç
+§ãããã¨ãã§ããï¼
+
+(c) ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹2ã¯ï¼ãã³ãã¬ã¼ããã¡ã¤ã«ã«å¾ã£ã¦ï¼ã«ã¼ãã«ã®æ§
+æã»åæåãã¡ã¤ã«ï¼kernel_cfg.cï¼ï¼æ§æã»åæåããããã¡ã¤ã«
+ï¼kernel_cfg.hï¼ãªã©ãçæããï¼ãã®ãã³ãã¬ã¼ããã¡ã¤ã«ã¯ï¼ã¿ã¼ã²ãã
+éä¾å­é¨ã¨ã¿ã¼ã²ããä¾å­é¨ã«åãåãã¦ãããï¼ä»ã®ãã¡ã¤ã«ã®ã¿ã¼ã²ãã
+ä¾å­é¨ã¨ã¯éã«ï¼ã¿ã¼ã²ããä¾å­é¨ããã¿ã¼ã²ããéä¾å­é¨ãã¤ã³ã¯ã«ã¼ãã
+ãå½¢ã«ãªã£ã¦ããï¼
+
+å
+·ä½çã«ã¯ï¼targetãã£ã¬ã¯ããªã«ç½®ãããtarget.tfã§ï¼å¿
+è¦ãªå¤æ°ãå®ç¾©ã
+ãå¾ï¼ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããéä¾å­é¨ï¼kernel/kernel.tfï¼ãã¤
+ã³ã¯ã«ã¼ãããï¼kernel.tfã§ã¯ï¼ã«ã¼ãã«ã®ã¿ã¼ã²ããéä¾å­é¨ã§ä½¿ç¨ããå¤
+æ°å®ç¾©ç­ãçæããï¼kernel.tfãã¤ã³ã¯ã«ã¼ãããå¾ï¼target.tfã§ã¯ï¼ã«ã¼
+ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã§ä½¿ç¨ããå¤æ°å®ç¾©ç­ãçæããï¼target.tfããï¼é
+çºç°å¢ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ãåãåãã¦ãããï¼
+
+(d) ãã¹3ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã¯ï¼ãã³ãã¬ã¼ããã¡ã¤ã«ã«å¾ã£ã¦ï¼éçAPIã®ä¸
+è¬å®æ°å¼ãã©ã¡ã¼ã¿ã®ãã§ãã¯ãè¡ãï¼ãã®ãã³ãã¬ã¼ããã¡ã¤ã«ãï¼ã¿ã¼ã²ã
+ãéä¾å­é¨ã¨ã¿ã¼ã²ããä¾å­é¨ã«åãåãã¦ããï¼ã¿ã¼ã²ããä¾å­é¨ããã¿ã¼
+ã²ããéä¾å­é¨ãã¤ã³ã¯ã«ã¼ãããå½¢ã«ãªã£ã¦ããï¼
+
+å
+·ä½çã«ã¯ï¼targetãã£ã¬ã¯ããªã«ç½®ãããtarget_check.tfã§ï¼å¿
+è¦ãªå¤æ°ã
+å®ç¾©ããå¾ï¼ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããéä¾å­é¨
+ï¼kernel/kernel_check.tfï¼ãã¤ã³ã¯ã«ã¼ãããï¼kernel_check.tfã§ã¯ï¼ã«ã¼
+ãã«ã®ã¿ã¼ã²ããéä¾å­é¨ã§åæåãã­ãã¯ã«åºåããä¸è¬å®æ°å¼ãã©ã¡ã¼ã¿
+ã®ãã§ãã¯ãè¡ãï¼kernel_check.tfãã¤ã³ã¯ã«ã¼ãããå¾ï¼target_check.tf
+ã§ã¯ï¼ã¿ã¼ã²ããã«ä¾å­ãããã§ãã¯ãè¡ãï¼target_check.tfããï¼éçºç°å¢
+ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ãåãåãã¦ãããï¼
+
+ãªãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®è©³ç´°ä»æ§ã¨è¨­å®ãã¡ã¤ã«ã®è¨è¿°æ¹æ³ã«ã¤ãã¦ã¯ï¼
+å¥éPDFãã¡ã¤ã«ã®å½¢ã§é
+å¸ãã¦ãããTOPPERSæ°ä¸ä»£ã«ã¼ãã«ç¨ã³ã³ãã£ã®ã¥
+ã¬ã¼ã¿ä»æ§ãããã³ãTOPPERSæ°ä¸ä»£ã«ã¼ãã«ç¨ã³ã³ãã£ã®ã¥ã¬ã¼ã¿å
+èµãã¯ã­
+ãã­ã»ããµä»æ§ããåç
+§ãããã¨ï¼
+
+7.2 ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨
+
+ä»¥ä¸ã§ã¯ï¼ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨ãè¨è¿°ããä¸ã§å¿
+
+è¦ãªäºé 
+ã«ã¤ãã¦èª¬æããï¼
+
+7.2.1 ã¿ã¼ã²ããéä¾å­é¨ãã¤ã³ã¯ã«ã¼ãããåã«å®ç¾©ãã¹ãå¤æ°
+
+target.tfããkernel.tfãã¤ã³ã¯ã«ã¼ãããåã«ï¼æ¬¡ã®å¤æ°ãå®ç¾©ãã¦ãããª
+ããã°ãªããªãï¼
+
+(7-2-1-1) INTNO_VALID			æå¹ãªå²è¾¼ã¿çªå·ã®ãªã¹ã
+(7-2-1-2) INHNO_VALID			æå¹ãªå²è¾¼ã¿ãã³ãã©çªå·ã®ãªã¹ã
+(7-2-1-3) EXCNO_VALID			æå¹ãªCPUä¾å¤ãã³ãã©çªå·ã®ãªã¹ã
+
+æå¹ãªå²è¾¼ã¿çªå·ï¼å²è¾¼ã¿ãã³ãã©çªå·ï¼CPUä¾å¤ãã³ãã©çªå·ã®ãªã¹ããï¼å
+å¤æ°ã«å®ç¾©ããï¼
+
+(7-2-1-4) INTNO_CREISR_VALIDï¼ãªãã·ã§ã³ï¼
+(7-2-1-5) INHNO_CREISR_VALIDï¼ãªãã·ã§ã³ï¼
+
+CRE_ISRã§ä½¿ç¨ã§ããå²è¾¼ã¿çªå·ã®ãªã¹ããINTNO_CREISR_VALIDã«ï¼ããã«å¯¾å¿
+ããå²è¾¼ã¿ãã³ãã©çªå·ã®ãªã¹ããINHNO_CREISR_VALIDã«å®ç¾©ããï¼ä¸¡è
+ã¯ï¼
+é åºã¾ã§å«ãã¦å¯¾å¿ãã¦ããªããã°ãªããªãï¼
+
+ãããã®å¤æ°ãå®ç¾©ããªãå ´åï¼ããããINTNO_VALIDã¨INHNO_VALIDãä½¿ãã
+ãï¼ããã§è¯ãå ´åã«ã¯ï¼ãããã®å¤æ°ãå®ç¾©ããå¿
+è¦ã¯ãªãï¼
+
+(7-2-1-6) INTPRI_CFGINT_VALIDï¼ãªãã·ã§ã³ï¼
+
+CFG_INTã§ä½¿ç¨ã§ããå²è¾¼ã¿åªå
+åº¦ã®ãªã¹ããå®ç¾©ããå¤æ°ï¼æ¨æºã§ã¯ï¼
+TMIN_INTPRIä»¥ä¸ï¼TMIN_INTPRIï¼ï¼-1ï¼ä»¥ä¸ã®å¤ãCFG_INTã«å¯¾ããå²è¾¼ã¿åªå
+
+åº¦ã¨ãã¦æå¹ã§ãããï¼ã¿ã¼ã²ããä¾å­é¨ã§ãã®å¤æ°ãå®ç¾©ãããã¨ã§ï¼
+TMIN_INTPRIãããå°ããå¤ãæå¹ã¨ãããã¨ãã§ããï¼
+
+(7-2-1-7) INTNO_FIX_KERNELï¼ãªãã·ã§ã³ï¼	ã«ã¼ãã«ç®¡çã«åºå®ããã¦ãã
+											å²è¾¼ã¿çªå·
+(7-2-1-8) INHNO_FIX_KERNELï¼ãªãã·ã§ã³ï¼	ã«ã¼ãã«ç®¡çã«åºå®ããã¦ãã
+		 									å²è¾¼ã¿ãã³ãã©çªå·
+(7-2-1-9) INHNO_FIX_NONKERNELï¼ãªãã·ã§ã³ï¼	ã«ã¼ãã«ç®¡çå¤ã«åºå®ããã¦ãã
+											å²è¾¼ã¿çªå·
+(7-2-1-10) INHNO_FIX_NONKERNELï¼ãªãã·ã§ã³ï¼ã«ã¼ãã«ç®¡çå¤ã«åºå®ããã¦ãã
+		 									å²è¾¼ã¿ãã³ãã©çªå·
+
+ã«ã¼ãã«ç®¡çã¾ãã¯ã«ã¼ãã«ç®¡çå¤ã«åºå®ããã¦ããå²è¾¼ã¿ãããå ´åã«ã¯ï¼
+ãããã®å²è¾¼ã¿çªå·ã¨å²è¾¼ã¿ãã³ãã©çªå·ã®ãªã¹ããï¼åå¤æ°ã«å®ç¾©ããï¼
+
+(7-2-1-11) GENERATE_TSKINICTXBï¼ãªãã·ã§ã³ï¼
+
+USE_TSKINICTXBããã¯ã­å®ç¾©ããå ´åï¼TSKINICTXBã®åæåæ
+å ±ãçæããã
+ããã³ãã¬ã¼ããã¡ã¤ã«é¢æ°GENERATE_TSKINICTXBãå®ç¾©ããï¼
+GENERATE_TSKINICTXBã«ã¯ï¼ã¿ã¹ã¯IDããã©ã¡ã¼ã¿ã¨ãã¦æ¸¡ãããï¼
+
+(7-2-1-12) ALLOC_STACKï¼ãªãã·ã§ã³ï¼
+
+ã¹ã¿ãã¯é åã®çææ¹æ³ãããã©ã«ãããå¤æ´ãããå ´åã«ã¯ï¼ã¹ã¿ãã¯é å
+ãçæããããã®ãã³ãã¬ã¼ããã¡ã¤ã«é¢æ°ALLOC_STACKãå®ç¾©ããï¼
+ALLOC_STACKã«ã¯ï¼ã¹ã¿ãã¯é åã®å¤æ°åã¨ä¸¸ããåã®ãµã¤ãºããã©ã¡ã¼ã¿ã¨ã
+ã¦æ¸¡ãããã®ã§ï¼ã¹ã¿ãã¯é åãçæããã³ã¼ããçæãï¼å¤§ããæ¹ã«ä¸¸ãã
+ãµã¤ãºãè¡¨ãæå­åãè¿ãï¼
+
+7.2.2 ã¿ã¼ã²ããéä¾å­é¨ã§å®ç¾©ãããå¤æ°
+
+kernel.tfã®ä¸­ã§ã¯æ¬¡ã®å¤æ°ãå®ç¾©ãããããï¼kernel.tfãã¤ã³ã¯ã«ã¼ããã
+å¾ï¼target.tfã®ä¸­ã§ããããåç
+§ãããã¨ãã§ããï¼
+
+(7-2-2-1) INTNO[inhno]		inhnoãå¯¾å¿ããintnoã«å¤æããããã®é£æ³é
+å
+(7-2-2-2) INHNO[intno]		intnoãå¯¾å¿ããinhnoã«å¤æããããã®é£æ³é
+å
+
+7.3 ãã¹3ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨
+
+ä»¥ä¸ã§ã¯ï¼ãã¹3ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨ãè¨è¿°ããä¸ã§å¿
+
+è¦ãªäºé 
+ã«ã¤ãã¦èª¬æããï¼
+
+7.3.1 ã¿ã¼ã²ããéä¾å­é¨ãã¤ã³ã¯ã«ã¼ãããåã«å®ç¾©ãã¹ãå¤æ°
+
+target_check.tfããkernel_check.tfãã¤ã³ã¯ã«ã¼ãããåã«ï¼å¿
+è¦ã«å¿ãã¦ï¼
+æ¬¡ã®å¤æ°ãå®ç¾©ãã¦ãããªããã°ãªããªãï¼
+
+(7-3-1-1) GET_STK_TSKINICTXBï¼ãªãã·ã§ã³ï¼
+
+USE_TSKINICTXBããã¯ã­å®ç¾©ããå ´åï¼TINIBããã¹ã¿ãã¯é åã®å
+é ­çªå°ãå
+ãåºãããã®ãã³ãã¬ã¼ããã¡ã¤ã«é¢æ°GET_STK_TSKINICTXBãå®ç¾©ããï¼
+GET_STK_TSKINICTXBã«ã¯ï¼ã¿ã¹ã¯åæåãã­ãã¯ï¼TINIBï¼ã®å
+é ­çªå°ããã©ã¡ã¼
+ã¿ã¨ãã¦æ¸¡ãããï¼CHECK_STACK_ALIGNï¼CHECK_STACK_NONNULLã¨ãå®ç¾©ããªã
+å ´åã«ã¯ï¼GET_STK_TSKINICTXBãå®ç¾©ããå¿
+è¦ã¯ãªãï¼
+
+(7-3-1-2) LMA.ORDER_LISTï¼ãªãã·ã§ã³ï¼
+(7-3-1-3) LMA.START_DATA[lmano]ï¼ãªãã·ã§ã³ï¼
+(7-3-1-4) LMA.END_DATA[lmano]ï¼ãªãã·ã§ã³ï¼
+(7-3-1-5) LMA.START_IDATA[lmano]ï¼ãªãã·ã§ã³ï¼
+
+ãã¹3ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨ã§dataã»ã¯ã·ã§ã³ãããã¼ã¿
+ãåå¾ããå ´åãï¼rodataã»ã¯ã·ã§ã³ãRAMã«ç½®ãå ´åï¼ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«
+ã®ã11.8 rodataã»ã¯ã·ã§ã³ãRAMã«ç½®ãå ´åãã®ç¯ãåç
+§ï¼ã«ã¯ï¼ãããã®ã»
+ã¯ã·ã§ã³ã®å
+å®¹ãï¼é
+ç½®ã¢ãã¬ã¹ï¼ROMå
+ã®ã¢ãã¬ã¹ï¼LMAã¨å¼ã¶ï¼ããã¢ã¯ã»
+ã¹ã¢ãã¬ã¹ï¼RAMå
+ã®ã¢ãã¬ã¹ï¼VMAã¨å¼ã¶ï¼ã«ã³ãã¼ããå¿
+è¦ãããï¼
+
+ãã®ã³ãã¼ã¯ï¼LMA.ORDER_LISTã«ï¼ã³ãã¼ããã»ã¯ã·ã§ã³ã®çªå·ï¼lmanoï¼ã®ãª
+ã¹ãï¼çªå·ã¯ä»»æã«ä»ä¸ãã¦ããï¼ï¼LMA.START_DATA[lmano]ã«ã³ãã¼ããã»ã¯
+ã·ã§ã³ã®ã¢ã¯ã»ã¹ã¢ãã¬ã¹ã®å
+é ­ã®ã©ãã«ï¼LMA.END_DATA[lmano]ã«æ«å°¾ã®ã©ã
+ã«ï¼LMA.START_IDATA[lmano]ã«ãã®é
+ç½®ã¢ãã¬ã¹ã®å
+é ­ã®ã©ãã«ãè¨­å®ããã
+ã¨ã§ï¼ãã¹3ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããéä¾å­é¨ã§å®æ½ããï¼
+
+ä¾ãã°ï¼ã³ãã¼ããã»ã¯ã·ã§ã³ã®ã¢ã¯ã»ã¹ã¢ãã¬ã¹ã®å
+é ­ã®ã©ãã«ã
+"__data_start"ï¼æ«å°¾ã®ã©ãã«ã"__data_end"ï¼ãã®é
+ç½®ã¢ãã¬ã¹ã®å
+é ­ã®ã©
+ãã«ã"__idata_start"ã®å ´åã«ã¯ï¼ãã¹3ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ã
+ãä¾å­é¨ã«ä»¥ä¸ã®è¨è¿°ãå«ããï¼
+
+----------------------------------------
+$LMA.ORDER_LIST = { 1 }$
+$LMA.START_DATA[1] = "__data_start"$
+$LMA.END_DATA[1] = "__data_end"$
+$LMA.START_IDATA[1] = "__idata_start"$
+----------------------------------------
+
+7.3.2 ã¿ã¼ã²ããä¾å­é¨ã§è¡ãã¹ãã¨ã©ã¼ãã§ãã¯
+
+ä»¥ä¸ã®å
+é ­çªå°ã¯ï¼ã¿ã¼ã²ããéä¾å­é¨ã§çæãããã¼ãã«ã«åºåãããªãã
+ãï¼ãã¹3ã®ã¿ã¼ã²ããéä¾å­é¨ï¼kernel_check.tfï¼ã§ã¯ï¼ãã­ã°ã©ã ã®éå§
+çªå°ã¨ãã¦æ­£ãããªãå ´åã®ã¨ã©ã¼ããã§ãã¯ããªãï¼ãã®ããï¼ã¿ã¼ã²ãã
+ä¾å­é¨ã§ã¨ã©ã¼ãã§ãã¯ãè¡ãå¿
+è¦ãããï¼
+
+ã»å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®å
+é ­çªå°ï¼CRE_ISRã®isrï¼
+ã»å²è¾¼ã¿ãã³ãã©ã®å
+é ­çªå°ï¼DEF_INHã®inthdrï¼
+ã»CPUä¾å¤ãã³ãã©ã®å
+é ­çªå°ï¼DEF_EXCã®exchdrï¼
+ã»åæåã«ã¼ãã³ã®å
+é ­çªå°ï¼ATT_INIã®inirtnï¼
+ã»çµäºå¦çã«ã¼ãã³ã®å
+é ­çªå°ï¼ATT_TERã®terrtnï¼
+
+ãã ãï¼ã¿ã¼ã²ããä¾å­é¨ã«ããã¦ãï¼ãããã®ã¨ã©ã¼ãã§ãã¯ãè¡ããã¨ã¯
+éããªãããï¼ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ã®ã1.5 æ¢ç¥ã®åé¡ãã®ç¯ã«ã¯ï¼ã¿ã¼ã²ã
+ãä¾å­ã§ãããã®ã¨ã©ã¼ãæ¤åºãããªããã¨ãããæ¨ãè¨è¼ãã¦ããï¼
+
+7.4 cfg1_out.cã®ãªã³ã¯ã«å¿
+è¦ãªã¹ã¿ãã®å®ç¾©ãã¡ã¤ã«
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«é¢ãã¦ã¿ã¼ã²ããä¾å­ã«ç¨æããå¿
+è¦ããããã¡ã¤ã«ã¨
+ãã¦ï¼è¨­å®ãã¡ã¤ã«ä»¥å¤ã«ï¼cfg1_out.cããªã³ã¯ããããã«å¿
+è¦ãªã¹ã¿ãã®å®
+ç¾©ãã¡ã¤ã«ãããï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹1ã§ã¯ï¼éçAPIã®æ´æ°å®æ°å¼ãã©ã¡ã¼ã¿ã®å¤ãCã³ã³
+ãã¤ã©ãç¨ãã¦æ±ããããã«ï¼cfg1_out.cãçæããï¼ãããã³ã³ãã¤ã«ï¼ãª
+ã³ã¯ãã¦ãªãã¸ã§ã¯ããã¡ã¤ã«ãçæããéã«ï¼ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã
+ãåç
+§ãããã·ã³ãã«ã®å®ç¾©ãä¸ããå¿
+è¦ãããï¼
+
+ãã®å®ç¾©ãä¸ããããã«ï¼cfg1_out.cããï¼ã¿ã¼ã²ããä¾å­é¨ã®
+target_cfg1_out.hãã¤ã³ã¯ã«ã¼ããã¦ããï¼target_cfg1_out.hï¼ã¾ãã¯ï¼ã
+ãããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼ã«ã¯ï¼ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ããå
+ç
+§ãããã·ã³ãã«ã®ã¹ã¿ãã®å®ç¾©ãå«ããï¼å
+¸åçã«ã¯ï¼ä»¥ä¸ã®ãããªå®ç¾©ã
+å«ããå¿
+è¦ãããï¼
+
+----------------------------------------
+void sta_ker(void)
+{
+}
+
+void hardware_init_hook(void)
+{
+}
+
+void software_init_hook(void)
+{
+}
+
+const size_t	_kernel_istksz = 0;
+
+STK_T *const	_kernel_istk = NULL;
+----------------------------------------
+
+ã¾ãï¼target_cfg1_out.hï¼ã¾ãã¯ï¼ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼ã«
+ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãç¨ãã¦ãªãã»ãããã¡ã¤ã«ï¼offset.hï¼ãçæãã
+ããã«å¿
+è¦ãªè¨è¿°ãå«ããï¼è©³ããã¯ï¼ã2.5 ãªãã»ãããã¡ã¤ã«ã®çææ¹æ³ã
+ã®ç¯ãåç
+§ãããã¨ï¼
+
+
+ï¼ï¼ã·ã¹ãã ãµã¼ãã¹ç­ã®ã¿ã¼ã²ããä¾å­é¨
+
+8.0 ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­é¨
+
+ã·ãªã¢ã«ãã¼ãæ°ãã·ã¹ãã ã­ã°ã¿ã¹ã¯é¢é£ã®å®æ°ãªã©ï¼ã·ã¹ãã ãµã¼ãã¹ã®
+æ§æãæ±ºå®ããããã®å®ç¾©ãtarget_syssvc.hã¾ãã¯ããããã¤ã³ã¯ã«ã¼ããã
+ããã¡ã¤ã«ï¼éçºç°å¢ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ã§ç¨æã
+ããããããã¡ã¤ã«ãªã©ï¼ã«å«ããï¼
+
+ãªãï¼TOPPERSçµè¾¼ã¿ã³ã³ãã¼ãã³ãã·ã¹ãã ãå°å
+¥ãããã¨ï¼ãã®ãã¡ã¤ã«ã®
+å
+å®¹ã¯ã³ã³ãã¼ãã³ãè¨è¿°ãã¡ã¤ã«ã«è¨è¿°ããããã¨ã«ãªãï¼ãã®ãã¡ã¤ã«ã¯
+ç¡ããªãï¼ã¾ãã¯ï¼å¤§å¹
+ã«ç¸®å°ãããï¼è¦è¾¼ã¿ã§ããï¼
+
+8.1 ã·ã¹ãã ã­ã°æ©è½ã®ã¿ã¼ã²ããä¾å­å®ç¾©
+
+ã·ã¹ãã ã­ã°æ©è½ãä½¿ç¨ããå ´åã§ï¼ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã§bssã»ã¯ã·ã§
+ã³ã®ã¯ãªã¢ãçç¥ãã¦ããå ´åã«ã¯ï¼syslog_logmaskã¨syslog_lowmask_notã
+0ã«åæåããã³ã¼ããè¿½å ããï¼ããã¯ï¼ã·ã¹ãã ã­ã°æ©è½ãåæåãããå
+ã«åºåãããã­ã°æ
+å ±ãï¼ä½ã¬ãã«åºåæ©è½ãç¨ãã¦åºåããããã§ããï¼
+
+ã¿ã¼ã²ããä¾å­é¨ã§æä¾ãã¹ãã·ã¹ãã ã­ã°æ©è½ã®ããã®å®ç¾©ã¯æ¬¡ã®éãã§ã
+ãï¼
+
+(8-1-1) TCNT_SYSLOG_BUFFERï¼ãªãã·ã§ã³ï¼
+
+ã·ã¹ãã ã­ã°æ©è½ã®ã­ã°ãããã¡ã®ãµã¤ãºãå®ç¾©ãããã¯ã­ï¼å®ç¾©ããªãå ´å
+ã®ããã©ã«ãå¤ã¯32ï¼
+
+(8-1-2) void target_fput_log(char c)
+
+ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®ããã®æå­åºåé¢æ°ï¼ã¿ã¼ã²ããä¾å­ã®æ¹æ³ã§ï¼
+æå­cãè¡¨ç¤º/åºå/ä¿å­ããï¼
+
+ãã®é¢æ°ã¯ï¼ãªã¨ã³ãã©ã³ãã«å®è£
+ããªããã°ãªããªãï¼ãã®é¢æ°å
+ã§æä»å¶
+å¾¡ãå¿
+è¦ãªå ´åã«ã¯ï¼SILãç¨ãã¦å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã«ãããã¨ï¼ã¾ãï¼å
+¨å²
+è¾¼ã¿ã­ãã¯ç¶æ
+ã§å¼ã°ããå ´åãããããï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ããå¼ã³åºã
+ãã¨ãã§ããªãé¢æ°ãå¼ã°ãªãããã«å®è£
+ããªããã°ãªããªãï¼
+
+ä½ã¬ãã«åºåãã·ãªã¢ã«ãã¼ãçµç±ã§è¡ãå ´åã§ï¼ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ã
+ã©ã¤ãã¨ãã¼ããå
+±ç¨ããªããã¨ãæã¾ãããï¼ãã¼ãæ°ãè¶³ããªãããã«ã
+ããããå
+±ç¨ããå ´åã«ã¯ï¼ä¸¡è
+ãç«¶åããªãããã«æ³¨æãå¿
+è¦ã§ããï¼å
+·ä½
+çã«ã¯ï¼ä¸¡è
+ãåãè¨­å®ã§ã·ãªã¢ã«I/Oããã¤ã¹ãä½¿ãããã«ãï¼ã·ãªã¢ã«ã¤ã³
+ã¿ãã§ã¼ã¹ãã©ã¤ãã®åä½ä¸­ã«ä½ã¬ãã«åºåãè¡ããã¦ãå·®ãæ¯ããªãããã«
+è¨­è¨ããï¼ã¾ãï¼ä½ã¬ãã«åºåãåä½éå§å¾ã«ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤
+ããã·ãªã¢ã«I/Oããã¤ã¹ãåæåããã¨ï¼æå­åããèµ·ããå¯è½æ§ãããï¼ã
+ããé¿ããããã«ã¯ï¼å
+±ç¨ãããã¼ãã¯ä½ã¬ãã«åºåå´ã§åæåãï¼ã·ãªã¢ã«
+ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã§ã¯åæåããªãããã«ããã¨ããï¼
+
+ãªãï¼ãã®é¢æ°ã®æ¬ä½ãï¼ã©ã®ãã¡ã¤ã«ã«è¨è¿°ããããåé¡ã«ãªãï¼ã·ã¹ãã 
+ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­é¨ã«ã¯ï¼æ¨æºã§ã¯ï¼é¢æ°å®ç¾©ãè¨è¿°ããããã®ãã¡
+ã¤ã«ãç¨æãã¦ããªãï¼ã¿ã¼ã²ããä¾å­ã§ç¨æãã¦ããããï¼ä¾å¤çã«ï¼ã«ã¼
+ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­ã¢ã¸ã¥ã¼ã«ï¼target_kernel_impl.cï¼ã«è¨è¿°ãã¦ã
+ããï¼ãã®å ´åï¼target_fput_logãï¼ãªãã¼ã è¨è¿°ï¼target_rename.defãªã©ï¼
+ã«å«ãã¦ã¯ãªããªãï¼
+
+(8-1-3) LOGTIMï¼SYSLOG_GET_LOGTIMï¼ãªãã·ã§ã³ï¼
+
+ã·ã¹ãã ã­ã°æ©è½ã«ããã¦è¨é²ããæå»ï¼ã­ã°æå»ï¼ã®ãã¼ã¿åãLOGTIMã«ï¼
+æå»ãåå¾ããããã®å¦çãSYSLOG_GET_LOGTIMã«ãã¯ã­å®ç¾©ããï¼ããããå®
+ç¾©ããªãå ´åï¼é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ãã­ã°æå»ã«ç¨ããï¼
+
+ãªãï¼LOGTIMã®å®ç¾©ã¯ï¼target_stddef.hã¾ãã¯ããããã¤ã³ã¯ã«ã¼ãããããã¡
+ã¤ã«ã«å«ããªããã°ãªããªãï¼
+
+(8-1-4) LOGPARï¼ULOGPARï¼ãªãã·ã§ã³ï¼
+
+ã·ã¹ãã ã­ã°æ©è½ã«ããã¦è¨é²ããã­ã°ãã©ã¡ã¼ã¿ã®ãã¼ã¿åãLOGPARã«ãã¯
+ã­å®ç¾©ããï¼LOGPARã«å®ç¾©ãããã¼ã¿åã¯ï¼ç¬¦å·ä»ãã®æ´æ°åã§ãªããã°ãªã
+ãªãï¼ã¾ãï¼LOGPARã¨åããµã¤ãºã®ç¬¦å·ç¡ãã®æ´æ°åãï¼ULOGPARã«ãã¯ã­å®ç¾©
+ããï¼
+
+ãããã®å®ç¾©ããªãå ´åï¼ã­ã°ãã©ã¡ã¼ã¿ã®ãã¼ã¿åã¯intptr_tã¨ããï¼
+
+ãªãï¼LOGPARããã³ULOGPARã®å®ç¾©ã¯ï¼target_stddef.hã¾ãã¯ããããã¤ã³ã¯
+ã«ã¼ãããããã¡ã¤ã«ã«å«ããªããã°ãªããªãï¼
+
+8.2 ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ã¿ã¼ã²ããä¾å­å®ç¾©
+
+ã¿ã¼ã²ããä¾å­é¨ã§æä¾ãã¹ãã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ããã®å®ç¾©ã¯æ¬¡ã®éãã§
+ããï¼ãããã®å®ç¾©ã¯ï¼target_syssvc.hã¾ãã¯ããããã¤ã³ã¯ã«ã¼ãããããã¡
+ã¤ã«ã«å«ããï¼
+
+(8-2-1) LOGTASK_PRIORITYï¼ãªãã·ã§ã³ï¼
+
+ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®åªå
+åº¦ãå®ç¾©ãããã¯ã­ï¼å®ç¾©ããªãå ´åã®ããã©ã«ã
+å¤ã¯3ï¼
+
+(8-2-2) LOGTASK_STACK_SIZEï¼ãªãã·ã§ã³ï¼
+
+ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãºãå®ç¾©ãããã¯ã­ï¼å®ç¾©ããªãå ´åã®ã
+ãã©ã«ãå¤ã¯1024ï¼
+
+(8-2-3) LOGTASK_PORTIDï¼ãªãã·ã§ã³ï¼
+
+ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®åºåå
+ã®ã·ãªã¢ã«ãã¼ãçªå·ï¼å®ç¾©ããªãå ´åã®ããã©
+ã«ãå¤ã¯1ï¼
+
+(8-2-4) LOGTASK_INTERVALï¼ãªãã·ã§ã³ï¼
+
+ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®åä½ééï¼åä½ã¯ãã¤ã¯ã­ç§ï¼ï¼å®ç¾©ããªãå ´åã®ããã©
+ã«ãå¤ã¯10000ï¼
+
+(8-2-5) LOGTASK_FLUSH_WAITï¼ãªãã·ã§ã³ï¼
+
+ã­ã°åºåãå¾
+ã¡åãããå¦çã«ããã¦ï¼ã¿ã¹ã¯ãå¾
+ãããåä½ã¨ãªãæéï¼å
+ä½ã¯ãã¤ã¯ã­ç§ï¼ï¼å®ç¾©ããªãå ´åã®ããã©ã«ãå¤ã¯1000ï¼
+
+8.3 ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ã¿ã¼ã²ããä¾å­é¨
+
+ã¿ã¼ã²ããä¾å­é¨ã§æä¾ãã¹ãã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ããã®å®ç¾©
+ã¯æ¬¡ã®éãã§ããï¼ãããã®å®ç¾©ã¯ï¼å¥ã«æå®ããªãéãï¼target_serial.hã¾
+ãã¯ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ã«å«ãï¼å¿
+è¦ãªã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§
+ã³æ
+å ±ãtarget_serial.cfgã«è¨è¿°ããï¼é¢æ°ã®å®ä½ãå¿
+è¦ãªå ´åã«ã¯ï¼
+target_serial.cç­ã®ãã¡ã¤ã«ãç¨æããï¼
+
+ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ä¸­ã§ï¼ã¿ã¼ã²ããã®ã·ãªã¢ã«I/Oããã¤ã¹ã«
+ä¾å­ããé¨åãï¼ã·ãªã¢ã«I/Oããã¤ã¹ãã©ã¤ãã¨å¼ã¶ï¼ã·ãªã¢ã«I/Oããã¤ã¹
+ãã©ã¤ãã¯ï¼ããããï¼ITRONããã¤ã¹ãã©ã¤ãè¨­è¨ã¬ã¤ãã©ã¤ã³ã®PDICã«ç¸å½
+ããï¼
+
+8.3.1 å¤æ°ï¼ãã¼ã¿åï¼ç®¡çé¢æ°
+
+(8-3-1-1) TNUM_PORT
+
+ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãããµãã¼ãããã·ãªã¢ã«ãã¼ãæ°ãå®ç¾©ãã
+ãã¯ã­ï¼ãã®ãã¯ã­ã®å®ç¾©ã¯ï¼target_syssvc.hã¾ãã¯ããããã¤ã³ã¯ã«ã¼ãã
+ãããã¡ã¤ã«ã«å«ããï¼
+
+(8-3-1-2) void sio_initialize(intptr_t exinf)ï¼ãªãã·ã§ã³ï¼
+
+ã·ãªã¢ã«I/Oããã¤ã¹ãã©ã¤ãã®åæåå¦çï¼target_serial.cfgã«ï¼ãã®é¢æ°
+ãåæåã«ã¼ãã³ã¨ãã¦ç»é²ããéçAPIãå«ããï¼
+
+(8-3-1-3) void sio_terminate(intptr_t exinf)ï¼ãªãã·ã§ã³ï¼
+
+ã·ãªã¢ã«I/Oããã¤ã¹ãã©ã¤ãã®çµäºå¦çï¼target_serial.cfgã«ï¼ãã®é¢æ°ã
+çµäºå¦çã«ã¼ãã³ã¨ãã¦ç»é²ããéçAPIãå«ããï¼
+
+(8-3-1-4) void sio_isr(intptr_t exinf)
+
+ã·ãªã¢ã«I/Oããã¤ã¹ã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ï¼target_serial.cfgã«ï¼ãã®
+é¢æ°ãå²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã¨ãã¦ç»é²ããéçAPIãå«ããï¼ã¾ãï¼ãã®é
+çAPIã«å¿
+è¦ãªã·ãªã¢ã«I/Oããã¤ã¹ã®å²è¾¼ã¿çªå·ãªã©ã¯ï¼target_serial.hã§ã
+ã¯ã­å®ç¾©ããï¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã§ã¯ãªãï¼å²è¾¼ã¿ãã³ãã©ã¨ãããã¨
+ãã§ããï¼
+
+(8-3-1-5) SIOPCB
+
+ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®ãã¼ã¿åï¼target_serial.hã«ã¯ï¼ãã¼ã¿å
+ã®å®£è¨ã ãå«ã¾ãã¦ããã°ããï¼ï¼
+
+(8-3-1-6) SIO_RDY_SNDã¨SIO_RDY_RCV
+
+éä¿¡å¯è½ã³ã¼ã«ããã¯ã®è­å¥çªå·ãSIO_RDY_SNDã«ï¼åä¿¡éç¥ã³ã¼ã«ããã¯ã®è­
+å¥çªå·ãSIO_RDY_RCVã«ãã¯ã­å®ç¾©ããï¼ã³ã¼ã«ããã¯ã®ç¦æ­¢ï¼è¨±å¯ãè¡ãªããµã¼
+ãã¹ã³ã¼ã«ï¼sio_ena_cbrã¨sio_dis_cbrï¼ã§ç¨ããï¼
+
+8.3.2 ããã¤ã¹ãµã¼ãã¹ã«ã¼ãã³
+
+ä»¥ä¸ã®ããã¤ã¹ãµã¼ãã«ã«ã¼ãã³ã¯ï¼ï¼å°ãªãã¨ãï¼ã·ãªã¢ã«I/Oãã¼ãããã®
+å²è¾¼ã¿ããã¹ã¯ãããç¶æ
+ã§å¼ã³åºãããï¼ã¾ãï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼éã¿
+ã¹ã¯ã³ã³ãã­ã¹ãã®ãããã§å¼ã³åºãããå ´åãããï¼ãããã§å¼ã³åºããã¦
+ãåä½ããããã«ããªããã°ãªããªãï¼ï¼
+
+(8-3-2-1) SIOPCB *sio_opn_por(ID siopid, intptr_t exinf)
+
+siopidã§æå®ãããã·ãªã¢ã«I/Oãã¼ãããªã¼ãã³ããé¢æ°ï¼exinfã¯ã·ãªã¢ã«
+I/Oãã¼ãã«å¯¾ããæ¡å¼µæ
+å ±ã§ï¼ã³ã¼ã«ããã¯ãå¼ã¶æã«ãã¼ããåºå¥ããã
+ãã«æ¸¡ãï¼
+
+(8-3-2-2) void sio_cls_por(SIOPCB *siopcb)
+
+siopcbã§æå®ãããã·ãªã¢ã«I/Oãã¼ããã¯ã­ã¼ãºããé¢æ°ï¼
+
+(8-3-2-3) bool_t sio_snd_chr(SIOPCB *siopcb, char c)
+
+siopcbã§æå®ãããã·ãªã¢ã«I/Oãã¼ãã«ï¼cã§ç¤ºãããæå­ãéä¿¡ããé¢æ°ï¼
+æå­ãéä¿¡ã¬ã¸ã¹ã¿ã«å
+¥ããå ´åã«ã¯trueãï¼åã«éä¿¡ããæå­ã®éä¿¡ãçµãã£
+ã¦ããªãããã«ï¼æå­ãéä¿¡ã¬ã¸ã¹ã¿ã«å
+¥ããããªãã£ãå ´åã«ã¯falseãè¿ãï¼
+
+(8-3-2-4) int_t sio_rcv_chr(SIOPCB *siopcb)
+
+siopcbã§æå®ãããã·ãªã¢ã«I/Oãã¼ãããæå­ãèª­ãé¢æ°ï¼æå­ãåä¿¡ãã¦ã
+ãå ´åï¼èª­ãã æå­ã®ã³ã¼ãã¯æ­£ã®å¤ã¨ãã¦è¿ãï¼æå­ãåä¿¡ãã¦ããªãå ´å
+ã«ã¯-1ãè¿ãï¼
+
+(8-3-2-5) void sio_ena_cbr(SIOPCB *siopcb, uint_t cbrtn)
+
+siopcbã§æå®ãããã·ãªã¢ã«I/Oãã¼ãããã®ï¼cbrtnã§æå®ãããã³ã¼ã«ãã
+ã¯ãè¨±å¯ããï¼cbrtnã«ã¯ï¼SIO_RDY_SNDãSIO_RDY_RCVãæå®ã§ããï¼
+
+(8-3-2-6) void sio_dis_cbr(SIOPCB *siopcb, uint_t cbrtn)
+
+siopcbã§æå®ãããã·ãªã¢ã«I/Oãã¼ãããã®ï¼cbrtnã§æå®ãããã³ã¼ã«ãã
+ã¯ãç¦æ­¢ããï¼cbrtnã«ã¯ï¼SIO_RDY_SNDãSIO_RDY_RCVãæå®ã§ããï¼
+
+8.3.3 ã³ã¼ã«ããã¯ã«ã¼ãã³
+
+ã¿ã¼ã²ããä¾å­é¨ã¯ï¼å¿
+è¦ãªã¿ã¤ãã³ã°ã§ï¼ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ã
+ã®ã¿ã¼ã²ããéä¾å­é¨ã«å«ã¾ããä»¥ä¸ã®ã³ã¼ã«ããã¯ã«ã¼ãã³ãå¼ã³åºã³ã ã
+ãªããã°ãªããªãï¼ãã ãï¼ããããã®ã³ã¼ã«ããã¯ãç¦æ­¢ããã¦ããæã¯ï¼
+ã³ã¼ã«ããã¯ã«ã¼ãã³ãå¼ã³åºãã¦ã¯ãªããªãï¼
+
+ã³ã¼ã«ããã¯ã«ã¼ãã³ã¯ï¼ï¼å°ãªãã¨ãï¼ã·ãªã¢ã«I/Oãã¼ãããã®å²è¾¼ã¿ãç¦
+æ­¢ãããç¶æ
+ã§ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãã§å¼ã³åºãï¼exinfã«ã¯ï¼ã·ãªã¢ã«I/O
+ãã¼ãã®ãªã¼ãã³æã«æå®ãããæ¡å¼µæ
+å ±ãæ¸¡ãï¼
+
+(8-3-3-1) void sio_irdy_snd(intptr_t exinf)
+
+éä¿¡å¯è½ã³ã¼ã«ããã¯ã«ã¼ãã³ï¼ã·ãªã¢ã«I/Oãã¼ãã«å¯¾ãã¦æå­ãéä¿¡ã§ãã
+ç¶æ
+ã«ãªã£ãå ´åã«å¼ã³åºãï¼ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã¯ï¼ãã®ã³ã¼
+ã«ããã¯ã«ã¼ãã³ã®ä¸­ã§ï¼sio_snd_chrãå¼ã³åºãã¦æ¬¡ã®æå­ãéä¿¡ãããï¼é
+ä¿¡ãã¹ãæå­ããªãå ´åã«ã¯éä¿¡å¯è½ã³ã¼ã«ããã¯ãç¦æ­¢ããï¼
+
+(8-3-3-2) void sio_irdy_rcv(intptr_t exinf)
+
+åä¿¡éç¥ã³ã¼ã«ããã¯ã«ã¼ãã³ï¼ã·ãªã¢ã«I/Oãã¼ãããæå­ãåä¿¡ããå ´åã«
+å¼ã³åºãï¼ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã¯ï¼ãã®ã³ã¼ã«ããã¯ã«ã¼ãã³ã®
+ä¸­ã§ï¼å¿
+ãsio_rcv_chrãå¼ã³åºãã¦åä¿¡ããæå­ãåãåºãï¼
+
+8.4 ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºåã®ã¿ã¼ã²ããä¾å­å®ç¾©
+
+ã¿ã¼ã²ããä¾å­é¨ã§æä¾ãã¹ãã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºåã®ããã®å®ç¾©ã¯
+æ¬¡ã®éãã§ããï¼
+
+(8-4-1) TARGET_NAME
+
+ã¿ã¼ã²ããã®åç§°ã«å®ç¾©ããï¼
+
+(8-4-2) TARGET_COPYRIGHTï¼ãªãã·ã§ã³ï¼
+
+ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã«ï¼ã¿ã¼ã²ããä¾å­é¨ã®èä½æ¨©è¡¨ç¤ºãè¿½å ããããã®
+ãã¯ã­ï¼ããã©ã«ãã§ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã®èä½æ¨©è¡¨ç¤ºãè¿½å ããªãï¼
+
+8.5 ãµã³ãã«ãã­ã°ã©ã ã¨ãã¹ããã­ã°ã©ã ã®ã¿ã¼ã²ããä¾å­å®ç¾©
+
+ã¿ã¼ã²ããä¾å­é¨ã§æä¾ãã¹ããµã³ãã«ãã­ã°ã©ã ããã³ãã¹ããã­ã°ã©ã ã®
+ããã®å®ç¾©ã¯æ¬¡ã®éãã§ããï¼ãããã®å®ç¾©ã¯ï¼target_test.hï¼ã¾ãã¯ããã
+ããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼ã«å«ããï¼
+
+(8-5-1) STACK_SIZEï¼ãªãã·ã§ã³ï¼
+
+ãµã³ãã«ãã­ã°ã©ã ããã³ãã¹ããã­ã°ã©ã ã®ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãºãå®ç¾©
+ãããã¯ã­ï¼å®ç¾©ããªãå ´åã®ããã©ã«ãå¤ã¯4096ï¼ããã©ã«ãè¨­å®ã§ã¯ã¡ã¢
+ãªãä¸è¶³ããå ´åãï¼ã·ãã¥ã¬ã¼ã·ã§ã³ç°å¢ãªã©ã§å¤§ããã¹ã¿ãã¯é åãå¿
+è¦
+ãªå ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ãã®ãã¯ã­ãè¨­å®ããã¹ã¿ãã¯ãµã¤ãºã«å®ç¾©
+ããï¼
+
+(8-5-2) CPUEXC1ï¼ãªãã·ã§ã³ï¼
+
+ãµã³ãã«ãã­ã°ã©ã ããã³ãã¹ããã­ã°ã©ã ã§ç¨ããCPUä¾å¤ã®CPUä¾å¤ãã³ã
+ã©çªå·ãå®ç¾©ãããã¯ã­ï¼ãã®ãã¯ã­ãå®ç¾©ããªãå ´åï¼CPUä¾å¤ãã³ãã©ãä½¿
+ãé¨åããµã³ãã«ãã­ã°ã©ã ããé¤å¤ãããï¼CPUä¾å¤ãã³ãã©ã®ãã¹ãããã
+ãã¹ããã­ã°ã©ã ã¯ã³ã³ãã¤ã«ã§ããªãï¼
+
+(8-5-3) RAISE_CPU_EXCEPTIONï¼ãªãã·ã§ã³ï¼
+
+CPUEXC1ã«å®ç¾©ããCPUä¾å¤ãçºçãããCè¨èªã®ãã­ã°ã©ã ãå®ç¾©ãããã¯ã­ï¼
+CPUEXC1ãå®ç¾©ããå ´åã«ã¯å¿
+ãå®ç¾©ããªããã°ãªããªãï¼
+
+(8-5-4) PREPARE_RETURN_CPUEXCï¼ãªãã·ã§ã³ï¼
+
+CPUä¾å¤ãèµ·ãããå½ä»¤ãã¹ã­ããããããã«æ»ãçªå°ãä¿®æ­£ãããªã©ï¼CPUä¾
+å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããããã«æºåããããã®ãã¯ã­ï¼æºåãå¿
+è¦ãªã
+å ´åã«ã¯ï¼ç©ºã«å®ç¾©ããï¼
+
+ã¿ã¼ã²ããã·ã¹ãã ã®å¶ç´ã«ããï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ããå¾ã«ï¼ã¿
+ã¹ã¯ã®å®è¡ãç¶ç¶ã§ããªãå ´åã«ã¯ï¼ãã®ãã¯ã­ãå®ç¾©ããªãï¼ãã®ãã¯ã­ã
+å®ç¾©ããªãã¨ï¼CPUä¾å¤ãã³ãã©ã®ãã¹ãããããã¹ããã­ã°ã©ã ããï¼CPUä¾
+å¤ãã³ãã©ãããªã¿ã¼ã³ããå¾ã®å¦çãé¤å¤ãããï¼
+
+(8-5-5) TASK_PORTIDï¼ãªãã·ã§ã³ï¼
+
+ãµã³ãã«ãã­ã°ã©ã ã«ããã¦ï¼ã³ãã³ãæå­ãèª­ã¿è¾¼ãã·ãªã¢ã«ãã¼ãçªå·ã
+å®ç¾©ãããã¯ã­ï¼å®ç¾©ããªãå ´åã®ããã©ã«ãå¤ã¯1ï¼
+
+(8-5-6) LOOP_REFï¼ãªãã·ã§ã³ï¼
+
+ãµã³ãã«ãã­ã°ã©ã ã«ããã¦ï¼ãã­ã»ããµã®éåº¦ãè¨æ¸¬ããããã®ã«ã¼ãåæ°
+ãå®ç¾©ãããã¯ã­ï¼å®ç¾©ããªãå ´åã®ããã©ã«ãå¤ã¯1000000ï¼ããã©ã«ãè¨­å®
+ã§ã¯ï¼å¤ãå¤§ãéãã¦è¨æ¸¬ã«æéãããããããå ´åãï¼å¤ãå°ãéãã¦è¨æ¸¬
+çµæãå®å®ããªãå ´åã«ï¼ã¿ã¼ã²ããä¾å­é¨ã§ãã®ãã¯ã­ãè¨­å®ããã«ã¼ãå
+æ°ã«å®ç¾©ããï¼
+
+(8-5-7) MEASURE_TWICEï¼ãªãã·ã§ã³ï¼
+
+ãµã³ãã«ãã­ã°ã©ã ã«ããã¦ï¼ãã­ã»ããµã®éåº¦ã2åº¦è¨æ¸¬ããå ´åã«å®ç¾©ãã
+ãã¯ã­ï¼ã·ãã¥ã¬ã¼ã·ã§ã³ç°å¢ãªã©ãã­ã»ããµã®éåº¦ãå¤åããç°å¢ã§ï¼1åº¦ã®
+è¨æ¸¬ã§ã¯è¨æ¸¬çµæãå®å®ããªãå ´åã«å®ç¾©ããï¼
+
+(8-5-8) TASK_LOOPï¼ãªãã·ã§ã³ï¼
+
+ãµã³ãã«ãã­ã°ã©ã ã«ããã¦ï¼ãã­ã»ããµã®éåº¦ãè¨æ¸¬ããã«ï¼ã¿ã¹ã¯å
+ã§ã®
+ã«ã¼ãåæ°ãåºå®ããå ´åã«ï¼ã«ã¼ãåæ°ãå®ç¾©ãããã¯ã­ï¼ã«ã¼ãå
+¨ä½ã®å®
+è¡æéã0.4ç§ç¨åº¦ã«ãªããããªã«ã¼ãåæ°ãï¼ãã®ãã¯ã­ã«å®ç¾©ããï¼
+
+8.6 å®è¡æéåå¸éè¨ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­å®ç¾©
+
+å®è¡æéåå¸éè¨ãµã¼ãã¹ã®è¨­å®ãã¿ã¼ã²ããä¾å­é¨ã§å¤æ´ããå ´åã«ï¼ã¿ã¼
+ã²ããä¾å­é¨ã§æä¾ãã¹ãå®è¡æéåå¸éè¨ãµã¼ãã¹ã®ããã®å®ç¾©ã¯æ¬¡ã®éã
+ã§ããï¼ãããã®å®ç¾©ã¯ï¼target_test.hï¼ã¾ãã¯ããããã¤ã³ã¯ã«ã¼ãããã
+ãã¡ã¤ã«ï¼ã«å«ããï¼ãã®ä»ã«ï¼ã¿ã¼ã²ããä¾å­ã§å¿
+è¦ãªåæåå¦çãããå ´
+åã«ãï¼ã¿ã¼ã²ããä¾å­é¨ã«å«ããï¼
+
+(8-6-1) HISTTIMï¼ãªãã·ã§ã³ï¼
+
+å®è¡æéè¨æ¸¬ç¨ã®æå»ã®ãã¼ã¿åãå®ç¾©ãããã¯ã­ï¼å®ç¾©ããªãå ´åã®ããã©
+ã«ãã¯HRTCNTï¼
+
+(8-6-2) void HIST_GET_TIM(HISTTIM *p_time)ï¼ãªãã·ã§ã³ï¼
+
+å®è¡æéè¨æ¸¬ç¨ã®ç¾å¨æå»ã*p_timeã«åå¾ããå¦çã«å®ç¾©ãããã¯ã­ï¼å®ç¾©ã
+ãªãå ´åã®ããã©ã«ãã¯ï¼fch_hrtã®è¿å¤ã*p_timeã«åå¾ããå¦çã«ãªãï¼
+
+(8-6-3) uint_t HIST_CONV_TIM(HISTTIM time)ï¼ãªãã·ã§ã³ï¼
+
+å®è¡æéè¨æ¸¬ç¨ã®æå»ã®å·®ï¼æéï¼ãï¼å®è¡æéåå¸éè¨ç¨ã®å¤ã«å¤æããå¦
+çã«å®ç¾©ãããã¯ã­ï¼æå»ãéå»ã«æ»ã£ãããªã¼ããã­ã¼ãããã®åºå¥ãã¤ã
+ãªãå ´åã«ã¯ï¼æä¸ä½ãããã1ã®å¤ï¼INT_MAXãããå¤§ããå¤ï¼ãè¿ãï¼å®ç¾©
+ããªãå ´åã®ããã©ã«ãã¯ï¼timeãuint_tã«ã­ã£ã¹ãããå¦çã«ãªãï¼
+
+(8-6-4) void HIST_BM_HOOK(void)ï¼ãªãã·ã§ã³ï¼
+
+å®è¡æéè¨æ¸¬ç´åã«è¡ãã¹ãå¦çã«å®ç¾©ãããã¯ã­ï¼ã­ã£ãã·ã¥ã®ãã¼ã¸ããã£
+ã«ï¼ã¡ã¢ãªããªã¢å¦çç­ãè¡ãããå ´åã«ã¯ï¼ãã®ãã¯ã­ã«å®ç¾©ããï¼å®ç¾©ã
+ãªãå ´åã®ããã©ã«ãã¯ï¼ç©ºã®å¦çã«ãªãï¼
+
+
+ï¼ï¼ãã®ä»
+
+9.1 ãã­ã¥ã¡ã³ã
+
+ã¿ã¼ã²ããä¾å­é¨ã®ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ãï¼target_user.txtã«ç¨æããï¼é
+çºç°å¢ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ã®ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«
+ãåãåãã¦ããããï¼ãã¡ã¤ã«ãå¤§ãããªãå ´åã«ã¯è¤æ°ã®ãã¡ã¤ã«ã«åå²
+ãã¦ãããï¼ãã®å ´åã«ã¯ï¼target_user.txtä¸­ã«ãããã®ãã¡ã¤ã«åãè¨è¿°ã
+ããã¨ï¼
+
+ã¿ã¼ã²ããä¾å­é¨ã®ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ã«ã¯ï¼å°ãªãã¨ãæ¬¡ã®ãããªå
+å®¹ã
+è¨è¿°ãããã¨ãæã¾ããï¼
+
+(1) å¯¾å¿ãã¦ããã¿ã¼ã²ããã·ã¹ãã ã®ç¨®é¡ã»æ§æï¼ãã¼ã¸ã§ã³çªå·
+	ã»ã¿ã¼ã²ãããã¼ãã¦ã§ã¢ï¼ãã¼ãç­ï¼ã®åç§°ã¨å¯¾å¿ãã¦ããæ§æ
+	ã»ã¿ã¼ã²ããç¥ç§°
+	ã»ã¿ã¼ã²ããéä¾å­é¨ã®ãã¼ã¸ã§ã³çªå·
+	ã»éçºç°å¢ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ã®æ§æã¨ãã¼ã¸ã§
+	ãã³çªå·
+
+(2) ä½¿ç¨ããéçºç°å¢ã¨åä½æ¤è¨¼ããæ¡ä»¶ï¼ãã¼ã¸ã§ã³ï¼ãªãã·ã§ã³ç­ï¼
+	ã»è¨èªå¦çç³»ï¼ã³ã³ãã¤ã©ï¼ã¢ã»ã³ãã©ï¼ãªã³ã«ç­ï¼
+	ã»ãããã°ç°å¢
+
+(3) ã¿ã¼ã²ããå®ç¾©äºé 
+ã®è¦å®
+
+(3-1) ãã¼ã¿åã«é¢ããè¦å®
+	ã»int_tåï¼long_tåã®ãµã¤ãº
+	ã»charåï¼int_least8_tåï¼void *åï¼intptr_tåã®ãµã¤ãº
+	ã»int8_tåï¼uint8_tåï¼int64_tåï¼uint64_tåï¼int128_tåï¼
+	ãuint128_tåï¼float32_tåï¼double64_tåã®ãµãã¼ãã®æç¡
+
+(3-2) å²è¾¼ã¿å¦çã«é¢ããè¦å®
+	ã»å²è¾¼ã¿ãã³ãã©çªå·ã¨å²è¾¼ã¿çªå·ã®å²å½ã¦ï¼ä¸¡è
+ã®å¯¾å¿
+	ã»å²è¾¼ã¿åªå
+åº¦ã®æ®µéæ°ï¼TMIN_INTPRIã®å¤ï¼
+	ã»dis_intã¨ena_intã®ãµãã¼ãã®æç¡ï¼ãã®å¶éäºé 
+
+	ã»CFG_INTã®å¶éäºé 
+ã¨æ¡å¼µï¼ã¿ã¼ã²ããå®ç¾©ã§ä½¿ç¨ã§ããå²è¾¼ã¿å±æ§ï¼
+	ã»TOPPERSæ¨æºå²è¾¼ã¿å¦çã¢ãã«ããã®ãã®ä»ã®é¸è±
+	ã»ããã©ã«ãã®å²è¾¼ã¿ãã³ãã©ï¼default_int_handlerï¼ã®æç¡ã¨å¦çå
+å®¹
+
+(3-3) ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã«é¢ããè¦å®
+	ã»TMIN_INTPRIã¯åºå®ãè¨­å®ã§ãããï¼ãã®è¨­å®æ¹æ³
+	ã»NMIä»¥å¤ã«ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãè¨­ãããï¼è¨­ããããããã«ãããï¼
+	ã»ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã®è¨­å®æ¹æ³
+	ã»ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã«å¯¾ãã¦DEF_INHï¼CFG_INTããµãã¼ãããã
+	ã»ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©ãå®è¡éå§ãããæã®ã·ã¹ãã ç¶æ
+ã¨
+	ãã³ã³ãã­ã¹ã
+	ã»å²è¾¼ã¿ãã³ãã©ã®çµäºæã«è¡ãããå¦ç
+	ã»ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©ã®è¨è¿°æ¹æ³
+	ã»ã«ã¼ãã«å
+ã®å²è¾¼ã¿åºå
+¥å£å¦çã§èµ·ããå¯è½æ§ã®ããCPUä¾å¤
+
+(3-4) CPUä¾å¤å¦çã«é¢ããè¦å®
+	ã»CPUä¾å¤ãã³ãã©çªå·ã®å²å½ã¦
+	ã»å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãTMIN_INTPRIã¨åãããããããé«ãå¤ã«è¨­å®ãã¦
+	ãããç¶æ
+ã§çºçããCPUä¾å¤ãï¼ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã¨æ±ãã
+	ã»ã«ã¼ãã«å
+ã®CPUä¾å¤åºå
+¥å£å¦çã§èµ·ããå¯è½æ§ã®ããCPUä¾å¤
+	ã»ããã©ã«ãã®CPUä¾å¤ãã³ãã©ï¼default_exc_handlerï¼ã®æç¡ã¨å¦çå
+å®¹
+
+(3-5) æ§è½è©ä¾¡ç¨ã·ã¹ãã æå»ã®åç
+§ã«é¢ããè¦å®
+	ã»get_utmã®ãµãã¼ãã®æç¡ï¼ãã®å¶éäºé 
+
+
+(3-6) æ¡å¼µããã±ã¼ã¸ã«é¢ããè¦å®
+	ã»åæ¡å¼µããã±ã¼ã¸ã®ãµãã¼ãã®æç¡
+		- ãã¥ã¼ããã¯ã¹æ©è½æ¡å¼µããã±ã¼ã¸
+		- ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸
+		- ã¿ã¹ã¯åªå
+åº¦æ¡å¼µããã±ã¼ã¸
+		- å¶ç´ã¿ã¹ã¯æ¡å¼µããã±ã¼ã¸
+		- åççææ©è½æ¡å¼µããã±ã¼ã¸
+	ã»ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸ããµãã¼ãããå ´åã«ï¼æ®ãã
+	ãã­ã»ããµæéã«æå®ã§ããå¤ã®æå¤§å¤ï¼TMAX_OVRTIMã®å¤ï¼
+	ã»åççææ©è½æ¡å¼µããã±ã¼ã¸ããµãã¼ãããå ´åã«ï¼åçã¡ã¢ãªç®¡çã®
+	ãæ¹æ³
+
+(3-7) ãã®ä»
+	ã»ãã®ä»ã®å¶éäºé 
+
+	ã»ãã®ä»ã®æ¡å¼µæ©è½
+
+(4) ã«ã¼ãã«ã®èµ·åï¼çµäºå¦çã«é¢ããæ
+å ±
+	ã»ç¨æãã¦ããã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã®å¦çå
+å®¹
+	ã»ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ããhardware_init_hookãå¼ã³åºãã¦ããå ´
+	ãåã«ã¯ï¼hardware_init_hookãã¢ããªã±ã¼ã·ã§ã³ã§ç¨æããå ´åã®ä½æ
+	ãæ¹æ³ãå¶éäºé 
+ãªã©
+	ã»ã«ã¼ãã«ãçµäºããå¾ã®æ¯èã
+
+(5) ã¡ã¢ãªããã
+	ã»ããã©ã«ãã®ã¡ã¢ãªãããï¼ãã®å¤æ´æ¹æ³
+
+(6) ã¿ã¤ããã©ã¤ãé¢é£ã®æ
+å ±
+	ã»é«åè§£è½ã¿ã¤ãã®å¨æã¨ã«ã¦ã³ãã¢ããã®é²ã¿å¹
+
+	ã»ä½¿ç¨ãããªã½ã¼ã¹ï¼ã¿ã¤ãï¼
+	ã»é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å²è¾¼ã¿åªå
+åº¦ã®å¤æ´æ¹æ³
+	ã»ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ã®å²è¾¼ã¿åªå
+åº¦ã®å¤æ´æ¹æ³
+
+(7) ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®æ
+å ±
+	ã»ä½¿ç¨ãããªã½ã¼ã¹ï¼SIOã³ã³ãã­ã¼ã©ï¼
+	ã»éä¿¡ãã©ã¡ã¼ã¿ï¼ãã¼ã¬ã¼ãï¼ãããæ°ï¼ããªãã£ã®æç¡ï¼ã¹ããããããï¼
+
+(8) ã·ã¹ãã ã­ã°æ©è½ã®æ
+å ±
+	ã»ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®å®ç¾æ¹æ³
+	ã»éä¿¡ãã©ã¡ã¼ã¿ï¼ãã¼ã¬ã¼ãï¼ãããæ°ï¼ããªãã£ã®æç¡ï¼ã¹ããããããï¼
+
+(9) ã·ã¹ãã æ§ç¯æé 
+
+(10) ã¿ã¼ã²ããã·ã¹ãã åºæã®æ³¨æäºé 
+
+	ã»ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«å«ã¾ããã¬ã¸ã¹ã¿ï¼å«ã¾ããªãã¬ã¸ã¹ã¿
+
+(11) é¡ä¼¼ã®ã¿ã¼ã²ããã«ãã¼ãã£ã³ã°ããéçºè
+åãã®åèæ
+å ±
+
+(12) ãã£ã¬ã¯ããªæ§æã»ãã¡ã¤ã«æ§æ
+
+(13) ãã¼ã¸ã§ã³å±¥æ­´
+
+ã¾ãï¼å¿
+è¦ã«å¿ãã¦ï¼ã¿ã¼ã²ããä¾å­é¨ã®è¨­è¨ã¡ã¢ãï¼target_design.txtã«ç¨
+æããï¼éçºç°å¢ä¾å­é¨ï¼ãã­ã»ããµã³ã¢ä¾å­é¨ï¼ãããä¾å­é¨ã«é¢ããè¨­è¨
+ã¡ã¢ãåãåãã¦ããããï¼ãã¡ã¤ã«ãå¤§ãããªãå ´åã«ã¯è¤æ°ã®ãã¡ã¤ã«ã«
+åå²ãã¦ããããï¼ãã®å ´åã«ã¯ï¼target_design.txtä¸­ã«ãããã®ãã¡ã¤ã«å
+ãè¨è¿°ãããã¨ï¼
+
+9.2 ããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«
+
+ãªãªã¼ã¹ããã±ã¼ã¸ï¼åå¥ããã±ã¼ã¸ããã³ç°¡æããã±ã¼ã¸ï¼ãä½æãããã
+ã«ï¼ããã±ã¼ã¸ã«å«ãããã¡ã¤ã«ãè¨è¿°ããããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«ãç¨æã
+ãï¼ããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«ã®åç§°ã¯ï¼åå¥ããã±ã¼ã¸ç¨ãMANIFESTï¼ç°¡æãã
+ã±ã¼ã¸ç¨ãE_PACKAGEã¨ããï¼
+
+ä¾ãã°ï¼arch/arm_gccãã£ã¬ã¯ããªã«ç½®ãããMANIFESTãã¡ã¤ã«ãç¨ãã¦åå¥
+ããã±ã¼ã¸ãä½æããå ´åã«ã¯ï¼æ¬¡ã®ã³ãã³ããå®è¡ããï¼
+
+	% utils/makerelease arch/arm_gcc/MANIFEST
+
+ãã®ã³ãã³ãã«ããï¼RELEASE/asp3_arch_arm_gcc-<ãã¼ã¸ã§ã³çªå·>.tar.gzã
+ä½æãããï¼ã¾ãï¼target/ct11mpcore_gccãã£ã¬ã¯ããªã«ç½®ãããE_PACKAGE
+ãã¡ã¤ã«ãç¨ãã¦ç°¡æããã±ã¼ã¸ãä½æããå ´åã«ã¯ï¼æ¬¡ã®ã³ãã³ããå®è¡ã
+ãï¼
+
+	% utils/makerelease target/ct11mpcore_gcc/E_PACKAGE
+
+ãã®ã³ãã³ãã«ããï¼RELEASE/asp3_ct11mpcore_gcc-<ãã¼ã¸ã§ã³çªå·>.tar.gz
+ãä½æãããï¼RELEASEãã£ã¬ã¯ããªããªãå ´åã«ã¯ï¼ãã£ã¬ã¯ããªãä½ãã
+ãï¼ï¼
+
+ãªãï¼makereleaseã¦ã¼ãã£ãªãã£ã¯ï¼ASP3ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡ã¤ã«ãç½®ãã
+ããã£ã¬ã¯ããªãï¼asp3ã¨ããåç§°ã§ãããã¨ãä»®å®ãã¦ããï¼ç°ãªãåç§°ã®
+å ´åã§ãããã±ã¼ã¸ã¯ä½æã§ãããï¼ããã±ã¼ã¸ãå±éããæã«å±éããããã£
+ã¬ã¯ããªãasp3ã§ãªããªãï¼ï¼ã¾ãï¼æ¨æºã®tarã³ãã³ããGNU tarã§ãããã¨
+ï¼æ­£ç¢ºã«ã¯ï¼zãªãã·ã§ã³ã«å¯¾å¿ãã¦ãããã¨ï¼ãæ³å®ãã¦ããï¼
+
+ããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«ã«ã¯ï¼ããã±ã¼ã¸ã«å«ãããã¡ã¤ã«åãï¼ããã±ã¼ã¸
+è¨è¿°ãã¡ã¤ã«ãç½®ããããã£ã¬ã¯ããªããã®ç¸å¯¾ãã¹åã§ï¼1è¡ã«1ã¤ãã¤è¨è¿°
+ããï¼ã¾ãï¼å¿
+è¦ã«å¿ãã¦ï¼ä»¥ä¸ã®ãã£ã¬ã¯ãã£ããå«ããï¼
+
+(a) E_PACKAGE <ç°¡æããã±ã¼ã¸å>
+
+ç°¡æããã±ã¼ã¸åãæå®ããï¼ç°¡æããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«ï¼E_PACKAGEï¼ã®å
+
+é ­ã«è¨è¿°ããï¼ç°¡æããã±ã¼ã¸åã¯ï¼asp3_<ã¿ã¼ã²ããç¥ç§°>ã¨ããï¼ä¾ãã°ï¼
+ã¿ã¼ã²ããç¥ç§°ãct11mpcore_gccã®å ´åã«ã¯ï¼asp3_ct11mpcore_gccã¨ãªãï¼å
+å¥ããã±ã¼ã¸ã¨åºå¥ããããã«ï¼ç°¡æããã±ã¼ã¸ã®ãã¡ã¤ã«åã«ã¯"target"ã
+å«ããªãï¼
+
+(b) PACKAGE <åå¥ããã±ã¼ã¸å>
+
+åå¥ããã±ã¼ã¸åãæå®ããï¼åå¥ããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«ï¼MANIFESTï¼ã®å
+
+é ­ã«è¨è¿°ããï¼ã¾ãï¼ããããã¤ã³ã¯ã«ã¼ããããåãã¡ã¤ã«ã®å
+é ­ã«ãè¨è¿°
+ãï¼ãããã¤ã³ã¯ã«ã¼ããã¦ããåå¥ããã±ã¼ã¸åãæå®ããï¼ã¿ã¼ã²ããä¾
+å­é¨ã®åå¥ããã±ã¼ã¸åã¯ï¼åå¥ããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«ãç½®ããããã£ã¬ã¯
+ããªã®ç¸å¯¾ãã¹ä¸­ã®"/"ã"_"ã«ç½®ãæããæå­åãï¼"asp3_"ã®å¾ã«ã¤ãªããã
+ã®ã¨ããï¼ä¾ãã°ï¼åå¥ããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«ãarch/arm_gcc/MANIFESTã®å ´
+åã«ã¯ï¼asp3_arch_arm_gccã¨ãªãï¼
+
+(c) VERSION <ãã¼ã¸ã§ã³çªå·>
+
+ããã±ã¼ã¸ã®ãã¼ã¸ã§ã³çªå·ãæå®ããï¼ç°¡æããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«ããã³
+åå¥ããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«ã®ä¸­ã«è¨è¿°ããï¼ç°¡æããã±ã¼ã¸ã«ããã¦ï¼ãã¼
+ã¸ã§ã³çªå·ãããã±ã¼ã¸åããæ¥ä»ã¨ããå ´åã«ã¯ï¼ããã±ã¼ã¸çªå·ã®ä»£ãã
+ã«%dateã¨è¨è¿°ããï¼
+
+ãã¼ã¸ã§ã³çªå·ã®ä»ä¸æ¹æ³ã«ã¤ãã¦ã¯ï¼ãTOPPERS/ASP3ã«ã¼ãã« ã¦ã¼ã¶ã¼ãºã
+ãã¥ã¢ã«ãã®ã2.2 ç°¡æããã±ã¼ã¸ãããã³ã2.3 åå¥ããã±ã¼ã¸ãã®ç¯ãå
+ç
+§ãããã¨ï¼
+
+(d) INCLUDE <ãã¡ã¤ã«å>
+
+å¥ã®ããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããï¼ç°¡æããã±ã¼ã¸è¨è¿°ãã¡ã¤
+ã«ããã¯ï¼åå¥ããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«ã®ã¿ãã¤ã³ã¯ã«ã¼ãããã®ãååã¨ã
+ãï¼åå¥ããã±ã¼ã¸è¨è¿°ãã¡ã¤ã«ããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ä¸­ã§æå®ã
+ããåå¥ããã±ã¼ã¸åã¯ï¼ãã¹ã¦ä¸è´ãã¦ããªããã°ãªããªãï¼
+
+
+ï¼ï¼ï¼ãªãã¡ã¬ã³ã¹
+
+10.1 ã¿ã¼ã²ããä¾å­é¨ã®ãã¡ã¤ã«ä¸è¦§
+
+æ¨æºçãªã¿ã¼ã²ããä¾å­é¨ã®ãã¡ã¤ã«æ§æã¯æ¬¡ã®éãã§ããï¼
+
+Makefile.target		Makefileã®ã¿ã¼ã²ããä¾å­é¨ï¼ï¼ç« ï¼
+target_offset.tf	ãªãã»ãããã¡ã¤ã«çæç¨ãã³ãã¬ã¼ããã¡ã¤ã«ï¼2.5.1ç¯ï¼
+					ãªãã·ã§ã³ï¼
+
+target_stddef.h		TOPPERSå
+±éå®ç¾©ï¼t_stddef.hï¼ã®ã¿ã¼ã²ããä¾å­é¨ï¼ï¼
+					ç« ï¼ï¼ã¢ããªã±ã¼ã·ã§ã³ã¨ã«ã¼ãã«ã®ä¸¡æ¹ããã¤ã³ã¯ã«ã¼
+					ãããã
+target_sil.h		ã·ã¹ãã ã¤ã³ã¿ãã§ã¼ã¹ã¬ã¤ã¤ï¼sil.hï¼ã®ã¿ã¼ã²ããä¾
+					å­é¨ï¼ï¼ç« ï¼ï¼ã¢ããªã±ã¼ã·ã§ã³ã¨ã«ã¼ãã«ã®ä¸¡æ¹ãã
+					ã¤ã³ã¯ã«ã¼ãããã
+target_kernel.h		ã«ã¼ãã«APIï¼kernel.hï¼ã®ã¿ã¼ã²ããä¾å­é¨ï¼ï¼ç« ï¼ï¼
+					ã¢ããªã±ã¼ã·ã§ã³ã¨ã«ã¼ãã«ã®ä¸¡æ¹ããã¤ã³ã¯ã«ã¼ãã
+					ãã
+
+target_kernel_impl.h ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨ã®ããããã¡ã¤ã«ï¼ï¼
+					ç« ï¼ï¼ã«ã¼ãã«ã®ã¿ããã¤ã³ã¯ã«ã¼ãããã
+target_kernel_impl.c ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨ã®Cè¨èªã§è¨è¿°ããã
+					é¨åï¼ï¼ç« ï¼ãªãã·ã§ã³ï¼
+
+target_support.S	ã¿ã¼ã²ããä¾å­é¨ã®ã¢ã»ã³ããªè¨èªã§è¨è¿°ãããé¨åï¼ï¼
+					ç« ï¼ãªãã·ã§ã³ï¼
+target_rename.def	ã¿ã¼ã²ããä¾å­é¨ã®ããã®ãªãã¼ã è¨è¿°ï¼6.12ç¯ï¼
+target_rename.h		target_rename.defããçæããããã¡ã¤ã«ï¼6.12ç¯ï¼
+target_unrename.h	target_rename.defããçæããããã¡ã¤ã«ï¼6.12ç¯ï¼
+target_timer.cfg	ã¿ã¤ããã©ã¤ãã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡
+					ã¤ã«ï¼6.13ç¯ï¼
+target_timer.h		ã¿ã¤ããã©ã¤ãã®ããããã¡ã¤ã«ï¼6.13ç¯ï¼ï¼ã«ã¼ãã«
+					ã®ã¿ããã¤ã³ã¯ã«ã¼ãããã
+target_timer.c		ã¿ã¤ããã©ã¤ãã®å®è£
+ãã¡ã¤ã«ï¼6.13ç¯ï¼ãªãã·ã§ã³ï¼
+ã·ã¹ãã ç¥ç§°.h		ã¿ã¼ã²ããã®ãã¼ãã¦ã§ã¢è³æºï¼å²è¾¼ã¿ãã³ãã©çªå·ã
+					CPUä¾å¤ãã³ãã©çªå·ï¼ããã¤ã¹ã¬ã¸ã¹ã¿ã®çªå°ãªã©ï¼ã®
+					å®ç¾©ãå«ãããããã¡ã¤ã«ï¼ã¢ããªã±ã¼ã·ã§ã³ã¨ã«ã¼ã
+					ã«ã®ä¸¡æ¹ããã¤ã³ã¯ã«ã¼ããããï¼ï¼ç« ï¼ãªãã·ã§ã³ï¼
+
+target_def.csv		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®å¤åå¾ã·ã³ãã«ãã¼ãã«ã®ã¿ã¼ã²ã
+					ãä¾å­é¨ï¼ï¼ç« ï¼ãªãã·ã§ã³ï¼
+target.tf			ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®
+					ã¿ã¼ã²ããä¾å­é¨ï¼7.2ç¯ï¼
+target_check.tf		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã®ãã³ãã¬ã¼ããã¡ã¤ã«ï¼7.3
+					ç¯ï¼
+target_cfg1_out.h	cfg1_out.cã®ãªã³ã¯ã«å¿
+è¦ãªã¹ã¿ãã®å®ç¾©ãã¡ã¤ã«ï¼7.4
+					ç¯ï¼
+
+target_syssvc.h		ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­å®ç¾©ï¼8.0ç¯ï¼
+target_serial.cfg	ã·ãªã¢ã«ãã©ã¤ãã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡
+					ã¤ã«ï¼8.3ç¯ï¼
+target_serial.h		ã·ãªã¢ã«ãã©ã¤ãã®ããããã¡ã¤ã«ï¼8.3ç¯ï¼ï¼ã·ãªã¢ã«
+					ãã©ã¤ãã®ã¿ããã¤ã³ã¯ã«ã¼ãããã
+target_serial.c		ã·ãªã¢ã«ãã©ã¤ãã®å®è£
+ãã¡ã¤ã«ï¼8.3ç¯ï¼ãªãã·ã§ã³ï¼ï¼
+target_test.h		ãã¹ããã­ã°ã©ã ã®ã¿ã¼ã²ããä¾å­å®ç¾©ï¼8.4ç¯ï¼
+
+target_user.txt		ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ï¼9.1ç¯ï¼
+target_design.txt	è¨­è¨ã¡ã¢ï¼9.1ç¯ï¼ãªãã·ã§ã³ï¼
+MANIFEST			åå¥ããã±ã¼ã¸ã«å«ãããã¡ã¤ã«ã®ãªã¹ãï¼9.2ç¯ï¼ãªã
+					ã·ã§ã³ï¼
+E_PACKAGE			ç°¡æããã±ã¼ã¸ã«å«ãããã¡ã¤ã«ã®ãªã¹ãï¼9.2ç¯ï¼ãªã
+					ã·ã§ã³ï¼
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/doc/systim_design.txt
===================================================================
--- asp3_wo_tecs/trunk/doc/systim_design.txt	(revision 302)
+++ asp3_wo_tecs/trunk/doc/systim_design.txt	(revision 302)
@@ -0,0 +1,809 @@
+													TOPPERS Confidential
+		TOPPERS/ASP3ã«ã¼ãã« è¨­è¨ã¡ã¢
+		ASP3ã«ã¼ãã«ã«ãããã·ã¹ãã æå»ç®¡çæ©è½ã®è¨­è¨ã«ã¤ãã¦
+
+		ä½æè
+: é«ç°åºç« ï¼åå¤å±å¤§å­¦ï¼
+		æçµæ´æ°: 2014å¹´6æ22æ¥
+
+âã¡ã¢ã®ä½ç½®ä»ã
+
+ãã®ã¡ã¢ã¯ï¼TOPPERS/ASP3ã«ã¼ãã«ã«ãããã·ã¹ãã æå»ç®¡çæ©è½ã®è¨­è¨ã«ã¤
+ãã¦è¨è¿°ãããã®ã§ããï¼æçµçãªè¨­è¨ãã­ã¥ã¡ã³ãã¯ï¼ASP3ã«ã¼ãã«ã®è¨­è¨
+æ¸ã«å
+¥ãè¾¼ãäºå®ã§ãããï¼ãã®ã¡ã¢ã¯ï¼è¨­è¨ãã­ã¥ã¡ã³ããä½æããéç¨ã
+è¨é²ãããã¨ãç®çã¨ããï¼
+
+âåç
+§æç®
+
+[1] TOPPERSç¬¬3ä¸ä»£ã«ã¼ãã«ï¼ITRONç³»ï¼çµ±åä»æ§æ¸ Release 3.A.0ï¼æçµæ´æ°:
+2014å¹´5æ18æ¥ï¼ï¼
+
+[2] TOPPERSãã­ã¸ã§ã¯ã ãã£ã¹ã«ãã·ã§ã³ã¡ã¢ãTOPPERSç¬¬3ä¸ä»£ã«ã¼ãã«
+ï¼ITRONç³»ï¼ã«ãããæéç®¡çã«ã¤ãã¦ãï¼æçµæ´æ°: 2014å¹´5æ18æ¥ï¼ï¼
+
+[3] TOPPERS/ASP3ã«ã¼ãã« è¨­è¨ã¡ã¢ Release 3.A.0ï¼æçµæ´æ°: 2014å¹´5æ31
+æ¥ï¼ï¼
+
+âå®è£
+å¯¾è±¡ã¨ããå¤é¨ä»æ§
+
+ãã®ã¡ã¢ã§ã¯ï¼æç®[1]ã®ä»¥ä¸ã®é¨åã«è¨è¿°ããã¦ããä»æ§ã®ä¸­ã§ï¼ASP3ã«ã¼ã
+ã«ï¼ããªããèª¿æ´æ©è½æ¡å¼µããã±ã¼ã¸ãå«ãï¼ã§ãµãã¼ãããæ©è½ãå®è£
+ãã
+ããã®è¨­è¨ãã­ã¥ã¡ã³ããä½æããï¼
+
+	ã2.3.2 ãµã¼ãã¹ã³ã¼ã«ã¨ãã©ã¡ã¼ã¿ãã®ç¯ã®æ¬¡ã®é¨å
+		(2) ã·ã¹ãã æå»ã¨ç¸å¯¾æé
+		(3) ã¿ã¤ã ã¢ã¦ãã¨ãã¼ãªã³ã°
+
+	ã4.6.1 ã·ã¹ãã æå»ç®¡çãã®ç¯ã®å
+¨ä½
+
+ã¾ãï¼å®è£
+ã§æ³å®ãããã¼ãã¦ã§ã¢æ§æã¨ãã¦ï¼æ¬¡ã®è¨è¿°ãèæ
+®ããï¼
+
+	ã2.1.4 æ³å®ãããã¼ãã¦ã§ã¢æ§æãã®ç¯ã®(c)
+
+å
+·ä½çã«ã¯ï¼ä»¥ä¸ã®ã¿ã°ãæã¤ä»æ§ãå®è£
+å¯¾è±¡ã¨ãªãï¼ä»æ§æ¸ã«è¨è¿°ããã¦ã
+ãé ã«ãªã¹ãã¢ããããï¼ï¼ãªãï¼ä¸ã®ãªã¹ãä¸­ã®ãâãä»¥éã®è¨è¿°ã¯ï¼å¾ã®
+å·¥ç¨ã§è¿½è¨ãããã®ã§ããï¼ãã®å·¥ç¨ã§ã¯ï¼ã¾ãã¯ãªã¹ãã¢ããã®ã¿ãè¡ã£ã¦
+ããï¼
+
+â2.1.4 æ³å®ãããã¼ãã¦ã§ã¢æ§æ
+
+NGKI0556ï¼(c)ã3ã
+
+â2.3.2(2) ã·ã¹ãã æå»ã¨ç¸å¯¾æé
+
+NGKI0548ï¼(a*)ã3ã		âASPD1001ï¼ASPD1043ï¼t_stddef.h
+NGKI0041ï¼(b)			âASPD1001ï¼â¦
+NGKI0042ï¼(a)			âASPD1001ï¼â¦
+NGKI0549ï¼(a)ã3ã		âASPD1001ï¼â¦ï¼t_stddef.h
+NGKI0550ï¼(b*)ã3ã		âASPD1001ï¼ã·ã¹ãã æå»ç®¡çæ©è½ã®è¨­è¨å
+¨ä½ã«å½±é¿
+NGKI0551ï¼(b*)ã3ã		ât_stddef.h
+NGKI0046ï¼(a*)			âASPD1026ï¼ASPD1027
+NGKI0048ï¼(b)			âNGKI1233ï¼NGKI2472ï¼NGKI2481
+NGKI0049ï¼(a)			âASPD1049
+NGKI0050ï¼(a)			âASPD1049
+NGKI0552ï¼(a)ã3ã		âtime_event.c
+
+â2.3.2(3) ã¿ã¤ã ã¢ã¦ãã¨ãã¼ãªã³ã°ï¼ä¸é¨ï¼
+
+NGKI0553ï¼(b)ã3ã		âASPD1001ï¼â¦
+NGKI0554ï¼(a)ã3ã		âASPD1001ï¼â¦
+
+â4.6.1 ã·ã¹ãã æå»ç®¡ç
+
+NGKI3603ï¼(a)
+NGKI2333ï¼(a)
+NGKI3559ï¼(a)ã3ã
+NGKI2336ï¼(a)
+NGKI2337ï¼(a)
+NGKI2338ï¼(a)ãMã		âASP3å¯¾è±¡å¤
+NGKI2339ï¼(a)ãMã		âASP3å¯¾è±¡å¤
+NGKI2340ï¼(a)ãMã		âASP3å¯¾è±¡å¤
+NGKI2341ï¼(a)ãMã		âASP3å¯¾è±¡å¤
+NGKI2342ï¼(a)ãMã		âASP3å¯¾è±¡å¤
+NGKI3560ï¼(a)ã3ã
+NGKI3593ï¼(a)ã3ã		âããªããæ©è½æ¡å¼µ
+NGKI3594ï¼(b)ã3ã		âããªããæ©è½æ¡å¼µ
+NGKI3595ï¼(a)ã3Mã		âASP3å¯¾è±¡å¤
+NGKI3580ï¼(a)ã3ã
+NGKI3574ï¼(d)ã3ã
+NGKI3573ï¼(a)ã3ã
+NGKI3575ï¼(a)ã3ã
+NGKI3576ï¼(a)ã3Mã		âASP3å¯¾è±¡å¤
+NGKI3561ï¼(a)ã3ãâNGKI3594
+NGKI3562ï¼(a)ã3ã
+NGKI3578ï¼(a)ã3ã
+NGKI3579ï¼(a)ã3ã
+ASPS0224ï¼(a)ã3ã
+ASPS0225ï¼(a)ã3ã
+NGKI3563ï¼(a*)ã3ã		âtime_manage.c
+NGKI3564ï¼(a*)ã3ã		âtime_manage.c
+NGKI3565ï¼(a*)ã3ã		âtime_manage.c
+NGKI3566ï¼(a)ã3Pã		âASP3å¯¾è±¡å¤
+NGKI3567ï¼(a)ã3ã		âASPD1059ï¼ASPD1060
+NGKI3568ï¼(a)ã3Mã		âASP3å¯¾è±¡å¤
+NGKI2349ï¼(a*)			âtime_manage.c
+NGKI2350ï¼(a*)			âtime_manage.c
+NGKI2351ï¼(a*)			âtime_manage.c
+NGKI2352ï¼(a)ãPã		âASP3å¯¾è±¡å¤
+NGKI2353ï¼(a)ãPã		âASP3å¯¾è±¡å¤
+NGKI2354ï¼(a)			âASPD1057ï¼ASPD1058
+NGKI3591ï¼(a)ã3ã		âASPD1041ï¼ASPD1057ï¼ASPD1058
+NGKI3592ï¼(a)ã3ã		âASPD1059ï¼ASPD1060
+NGKI2355ï¼(a)ãMã		âASP3å¯¾è±¡å¤
+NGKI3581ï¼(a*)ã3ã		âtime_manage.c
+NGKI3583ï¼(a*)ã3ã		âtime_manage.c
+NGKI3584ï¼(a*)ã3ã		âtime_manage.c
+NGKI3585ï¼(a)ã3Pã		âASP3å¯¾è±¡å¤
+NGKI3586ï¼(a*)ã3ã		âASPD1053
+NGKI3587ï¼(a*)ã3ã		âASPD1053
+NGKI3588ï¼(a*)ã3ã		âtime_event.c
+NGKI3589ï¼(a*)ã3ã		âtime_event.c
+NGKI3590ï¼(a)ã3Mã		âASP3å¯¾è±¡å¤
+NGKI3596ï¼(a)ã3ã		âããªããæ©è½æ¡å¼µ
+NGKI3598ï¼(a)ã3ã		âããªããæ©è½æ¡å¼µ
+NGKI3599ï¼(a)ã3ãâNGKI3594		âããªããæ©è½æ¡å¼µ
+NGKI3600ï¼(a)ã3Pã		âASP3å¯¾è±¡å¤
+NGKI3601ï¼(a)ã3ã		âããªããæ©è½æ¡å¼µ
+NGKI3602ï¼(a)ã3Mã		âASP3å¯¾è±¡å¤
+ASPS0226ï¼(a)ã3ã		âãµãã¼ãç¯å²ã«é¢ããè¦æ±
+ASPS0227ï¼(a)ã3ã		âãµãã¼ãç¯å²ã«é¢ããè¦æ±
+NGKI3569ï¼(a*)ã3ã		âtime_manage.c
+NGKI3571ï¼(a*)ã3ã		âtime_manage.c
+NGKI3572ï¼(a*)ã3ã		âtime_manage.c
+NGKI3577ï¼(a)ã3Mã		âASP3å¯¾è±¡å¤
+
+ãããã®ä¸­ã§ï¼ASP3ã«ã¼ãã«ã§ãµãã¼ãããªãæ©è½ã«é¢ããã¿ã°ã«ã¯ï¼ãâ
+ASP3å¯¾è±¡å¤ãã¨è¨è¼ããï¼å
+·ä½çã«ã¯ï¼ä¿è­·æ©è½å¯¾å¿ã«ã¼ãã«ããã«ããã­ã»ã
+ãµå¯¾å¿ã«ã¼ãã«ã®ã¿ã«é©ç¨ãããã¿ã°ãããã«è©²å½ããï¼
+
+ã¾ãï¼ãâããªããæ©è½æ¡å¼µãã¨è¨è¼ããã¿ã°ã¯ï¼ï¼»ASPS0224ï¼½ã«ããæ¨æºã§
+ã¯ãµãã¼ãããªããï¼ï¼»ASPS0225ï¼½ã«ããããªããèª¿æ´æ©è½æ¡å¼µããã±ã¼ã¸ã§
+ãµãã¼ããããã¨ãç¤ºãï¼ãâãµãã¼ãç¯å²ã«é¢ããè¦æ±ãã¯ï¼ASP3ã«ã¼ãã«
+ããã³æ¡å¼µããã±ã¼ã¸ã§ï¼ã©ã®ç¯å²ã®ä»æ§ããµãã¼ããããã«é¢ããè¨è¿°ã§ã
+ãï¼
+
+å¤é¨ä»æ§æ¸ããã®è¦æ±äºé 
+ã«å ãã¦ï¼ASP3ã«ã¼ãã« è¨­è¨ã¡ã¢ï¼æç®[3]ï¼ã®
+ãTOPPERS/ASP3ã«ã¼ãã«ã®å®è£
+è¨­è¨æ¹éãã®ç« ã«è¨è¿°ããã¦ããä»¥ä¸ã®è¦æ±äº
+é 
+ãèæ
+®ããï¼
+
+(1) ã½ã¼ã¹ã³ã¼ãã®èª­ã¿ãããã»æ¹é ãããããéè¦ãã
+(2) æ°ããã¿ã¼ã²ããã·ã¹ãã ã¸ã®ãã¼ãã£ã³ã°ãå®¹æãªæ§é ã¨ãã
+(3) æ¤è¨¼ãå®¹æãªæ§é ã¨ãã
+(4) å®è¡æ§è½ã¨ã¡ã¢ãªä½¿ç¨éã«é
+æ
+®ãã
+(5) ã¹ã±ã¼ã©ããªãã£ã«é
+æ
+®ãã
+(6) ãã£ãã¯ã¬ã¹ã®æéç®¡çï¼ãã£ãã¯ã¬ã¹ã«ã¼ãã«ï¼
+
+âTOPPERS/ASP3ã«ã¼ãã«ã®å®è£
+è¨­è¨æ¹é
+
+ASPR0001ï¼(a)
+ASPR0002ï¼(a)
+ASPR0003ï¼(a)
+ASPR0004ï¼(a)
+ASPR0005ï¼(a)
+ASPR0006ï¼(a)
+ASPR0007ï¼(a)
+ASPR0008ï¼(a)
+ASPR0009ï¼(a)
+ASPR0010ï¼(a)
+ASPR0011ï¼(a)ã3ã
+
+âè¨­è¨ãã­ã¥ã¡ã³ãã®æ¬ä½
+
+âãã£ãã¯ã¬ã¹ã®ã¿ã¤ã ã¤ãã³ãå¦ç
+
+ãªã¼ãã©ã³ãã³ãã©ã®èµ·åä»¥å¤ã®ã¿ã¤ã ã¤ãã³ãå¦çï¼ã¿ã¤ã ã¢ã¦ãå¦çï¼ã¿
+ã¹ã¯ã®é
+å»¶ï¼å¨æãã³ãã©ã®èµ·åï¼ã¢ã©ã¼ã ãã³ãã©ã®èµ·åï¼ã¯ï¼ã·ã¹ãã æ
+å»ããã£ããã¨ãã¦è¡ãããï¼»NGKI3603ï¼½ï¼
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ã·ã¹ãã æå»ã¯ï¼ãã¼ãã¦ã§ã¢ãæã¤é«åè§£è½ã¿ã¤ããç¨
+ãã¦å®ç¾ããï¼é«åè§£è½ã¿ã¤ãã¯ï¼ä¸å®æéæ¯ã«ã«ã¦ã³ãã¢ãããï¼æå®ãã
+åæ°ã«ã¦ã³ãã¢ãããããï¼ã¿ã¤ãå²è¾¼ã¿ãçºçãããæ©è½ãæã¤ãã®ã¨ãã
+ï¼»NGKI0556ï¼½ï¼
+
+å¦çãã¹ãã¿ã¤ã ã¤ãã³ãããªãæã«ã¿ã¤ãå²è¾¼ã¿ãçºçãããªãããã«ãã
+ããã«ã¯ï¼»ASPR0011ï¼½ï¼çºçãå¾
+ã£ã¦ããã¿ã¤ã ã¤ãã³ãã®ä¸­ã§ï¼æãæ©ãçº
+çããã¿ã¤ã ã¤ãã³ãã®çºçæå»ã«å²è¾¼ã¿ãçºçãããããã«ï¼é«åè§£è½ã¿ã¤
+ããè¨­å®ããã®ãåºæ¬ã§ãããASPD1002ãï¼
+
+âã¿ã¤ã ã¤ãã³ããã¼ã
+
+ã¿ã¤ã ã¤ãã³ããå¹ççã«å¦çããããã«ï¼çºçãå¾
+ã£ã¦ããã¿ã¤ã ã¤ãã³ã
+ã®éåãç®¡çãï¼ãã®ä¸­ã§çºçæå»ãæãæ©ããã®ãå¹ççã«åãåºãããã¼
+ã¿æ§é ãå¿
+è¦ã§ããï¼ãã®ãã¼ã¿æ§é ã«ã¯ï¼TOPPERS/JSPã«ã¼ãã«ã§å°å
+¥ãã¦ã
+ãé·ãå®ç¸¾ã®ããã¿ã¤ã ã¤ãã³ããã¼ããç¨ããï¼ã¿ã¤ã ã¤ãã³ããã¼ãã®è¨­
+è¨ã«ã¤ãã¦ã¯ï¼å¥ã«è¨è¿°ãããã¨ã¨ããï¼
+
+ã¿ã¤ã ã¤ãã³ããã¼ãã«ç»é²ããã¦ããã¿ã¤ã ã¤ãã³ãã®ä¸­ã§ï¼çºçæå»ãæ
+ãæ©ããã®ãï¼å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã¨å¼ã¶ï¼
+
+âã¤ãã³ãæå»
+
+ã·ã¹ãã æå»ã¯64ãããã®æ´æ°åã«ãªãå ´åããããï¼»NGKI0548ï¼½ï¼ã¿ã¤ã ã¤
+ãã³ãã®çºçæå»ã64ãããã§ç®¡çããã®ã¯å¹çãæªãï¼ãªããªãï¼ã¿ã¤ã ã¤
+ãã³ãã®çºçæå»ã¯ç¸å¯¾æéã§ããæå®ã§ããï¼»NGKI0041ï¼½ï¼ç¸å¯¾æéã¯32ãã
+ãã§è¡¨ç¾ããããã¨ããï¼»NGKI0549ï¼½ï¼ããæç¹ã§ã¿ã¤ã ã¤ãã³ããã¼ãã«ç»
+é²ããã¦ããã¿ã¤ã ã¤ãã³ãã®çºçæå»ã¯ï¼ããããï¼32ãããã§è¡¨ç¾ã§ãã
+æéå¹
+ã«åã¾ãããã§ããï¼ããã§ï¼ã¿ã¤ã ã¤ãã³ããã¼ãã«ç»é²ããã¦ãã
+ã¿ã¤ã ã¤ãã³ãã®çºçæå»ã¯ï¼32ãããã®ç¬¦å·ç¡ãæ´æ°åã§è¡¨ç¾ãããã¨ã«ã
+ããASPD1001ãï¼ãã®æå»ãï¼ã¤ãã³ãæå»ã¨å¼ã¶ï¼
+
+å®éã«ã¯ï¼ããæç¹ã§ç»é²ããã¦ããã¿ã¤ã ã¤ãã³ãã®çºçæå»ã32ãããã§
+è¡¨ç¾ã§ããæéå¹
+ã«åã¾ãããã«ï¼å¤é¨ä»æ§ãå®ãã¦ããï¼ä»¥ä¸ã§ã¯ï¼ããã
+32ãããã§è¡¨ç¾ã§ããæéå¹
+ã«åã¾ããã¨ãè«è¨¼ããï¼
+
+ã¿ã¤ã ã¤ãã³ãã®çºçæå»ãç¸å¯¾æéã§æå®ããå ´åï¼ç¸å¯¾æéã®åºæºæå»ã¯ï¼
+å¨æãã³ãã©ã®èµ·åæå»ãé¤ãã¦ã¯ï¼»NGKI2372ï¼½ï¼»NGKI2373ï¼½ï¼ç¸å¯¾æéãæ
+å®ãããµã¼ãã¹ã³ã¼ã«ãå¼ã³åºããæå»ï¼è¨ãæããã¨ç¾å¨æå»ï¼ã§ãã
+ï¼»NGKI0042ï¼½ï¼ãã®ããï¼ç¸å¯¾æéã«æå®ã§ããæå¤§å¤ãTMAX_RELTIMã¨æ¸ãã
+ã¨ã«ããã¨ï¼ã¿ã¤ã ã¤ãã³ããã¼ãã«ç»é²ããã¦ããã¿ã¤ã ã¤ãã³ãã®çºçæ
+å»ã¯ï¼ããããï¼ç¾å¨æå»ä»¥éã§ï¼(ç¾å¨æå»ï¼TMAX_RELTIM)ä»¥åã§ããï¼å¨æ
+ãã³ãã©ã®èµ·åæå»ã«é¢ãã¦ã¯ï¼ãå¨æãã³ãã©ã®ã¿ã¤ã ã¤ãã³ãã®ç»é²ãã®
+ç¯ã§æ¤è¨ããï¼
+
+ãã ãï¼ä»¥ä¸ã«æããããã¤ãã®çç±ã§ï¼ç»é²ããã¦ããã¿ã¤ã ã¤ãã³ãã®çº
+çæå»ãï¼ç¾å¨æå»ããåãï¼(ç¾å¨æå»ï¼TMAX_RELTIM)ããå¾ã«ãªãå ´åãã
+ãï¼
+
+ããã§ï¼TMAX_RELTIMã4,000,000,000ã¨ãï¼»NGKI0550ï¼½ï¼32ãããã§è¡¨ç¾ã§ã
+ãæå¤§å¤ï¼4,294,967,296ï¼ã¨ã®éã«ï¼294,967,295ï¼ç´294ç§ï¼ã®ãã¼ã¸ã³ãè¨­
+ãã¦ããï¼ãã®ããï¼ä»¥ä¸ã«æããçç±æ¯ã®æå¤§å¹
+ã®åè¨ã294ç§ãè¶
+ããªãã
+ã°ï¼32ãããã§è¡¨ç¾ã§ããæéå¹
+ã«åã¾ããã¨ã«ãªãï¼
+
+ä»¥ä¸ã§ã¯ï¼ç»é²ããã¦ããã¿ã¤ã ã¤ãã³ãã®çºçæå»ãï¼ç¾å¨æå»ããåã«ãª
+ãçç±ã¨åã«ãªãæå¤§å¹
+ï¼(ç¾å¨æå»ï¼TMAX_RELTIM)ããå¾ã«ãªãçç±ã¨å¾ã«ãª
+ãæå¤§å¹
+ã«ã¤ãã¦æ¤è¨ããï¼
+
+(1) ç¾å¨æå»ããåã«ãªãçç±
+
+(1-1) ã¿ã¤ã ã¤ãã³ãå¦çã®é
+ã
+
+ã¿ã¤ã ã¤ãã³ããå¦çããããã®ã¿ã¤ãå²è¾¼ã¿ãçºçãã¦ããï¼ã¿ã¤ã ã¤ãã³
+ããå¦çãããã¾ã§ã®éã¯ï¼ã¿ã¤ã ã¤ãã³ãã®çºçæå»ã¯ï¼ç¾å¨æå»ããåã«
+ãªã£ã¦ããï¼ç¹ã«ï¼ã¿ã¤ãå²è¾¼ã¿ãé·æéãã¹ã¯ããã¦ããå ´åãï¼ã¿ã¤ãå²
+è¾¼ã¿ããåªå
+ãããå¦çãé·æéå®è¡ããã¦ããå ´åï¼ãã­ã»ããµãå¦çã§ã
+ãä»¥ä¸ã®é »åº¦ã§ã¿ã¤ã ã¤ãã³ããçºçããå ´åã«ã¯ï¼ã¿ã¤ã ã¤ãã³ãã®å¦çã¯
+å¤§å¹
+ã«é
+ãããã¨ã«ãªãï¼ã¿ã¤ã ã¤ãã³ãã®å¦çãå¤§å¹
+ã«é
+ããåå ã¯ã¢ããª
+ã±ã¼ã·ã§ã³ã«ãã£ã¦ä½ããããã®ã§ããããï¼ãã®ç¶æ³ãé²ãã®ã¯ã¢ããªã±ã¼
+ã·ã§ã³ã®è²¬ä»»ã¨ããï¼å
+·ä½çã«ã¯ï¼ã¿ã¤ã ã¤ãã³ãã®å¦çã2ç§ä»¥ä¸é
+ããç¶æ³
+ã§ã¯ï¼ã«ã¼ãã«ã®åä½ã¯ä¿è¨¼ãããªããã®ã¨ãã¦ããï¼»NGKI3608ï¼½ï¼ãã®ããï¼
+ã¿ã¤ã ã¤ãã³ãå¦çã®é
+ãã«ããï¼ç»é²ããã¦ããã¿ã¤ã ã¤ãã³ãã®çºçæå»
+ãç¾å¨æå»ããåã«ãªãæå¤§å¹
+ã¯ï¼2ç§ã¨èãã¦ããï¼
+
+(1-2) ã·ã¹ãã æå»ã®èª¿æ´ã«ããã·ã¹ãã æå»ãé²ãã
+
+ã·ã¹ãã æå»ãèª¿æ´ãããµã¼ãã¹ã³ã¼ã«ï¼adj_timï¼ã«ããã·ã¹ãã æå»ãé²ã
+ãã¨ï¼ç»é²ããã¦ããã¿ã¤ã ã¤ãã³ãã®çºçæå»ãï¼ç¾å¨æå»ããåã«ãªãå¯
+è½æ§ãããï¼ããã«é¢ãã¦ã¯ï¼adj_timã®1åã®å¼åºãã§é²ããããæéç¯å²ã
+æå¤§1ç§ã«å¶éããã¦ããï¼»NGKI3561ï¼½ï¼»NGKI3584ï¼½ãã¨ã«å ãã¦ï¼1ç§ä»¥ä¸é
+å»ã®çºçæå»ãæã¤ã¿ã¤ã ã¤ãã³ããå¦çãããã«æ®ã£ã¦ããå ´åã¯ï¼ããä»¥
+ä¸ã·ã¹ãã æå»ãé²ãããã¨ãã§ããªãï¼»NGKI3588ï¼½ãã¨ã¨ãã¦ããï¼ãã®ã
+ãï¼ã·ã¹ãã æå»ãé²ãããã¨ã«ããï¼ç»é²ããã¦ããã¿ã¤ã ã¤ãã³ãã®çºç
+æå»ãç¾å¨æå»ããåã«ãªãæå¤§å¹
+ã¯ï¼2ç§ä»¥ä¸ã§ããï¼
+
+å¤é¨ä»æ§ã®å¶éï¼»NGKI3608ï¼½ã¯ï¼ã·ã¹ãã æå»ã®èª¿æ´ã«ããã·ã¹ãã æå»ãé²
+ããå ´åã«ãé©ç¨ããããã®ã§ããï¼ãã®ããï¼(1-2)ã®çç±ã«ããã¿ã¤ã ã¤ã
+ã³ãã®çºçæå»ãç¾å¨æå»ããåã«ãªãæå¤§å¹
+ï¼2ç§ä»¥ä¸ï¼ã¯ï¼(1-1)ã®çç±ã«
+ããæå¤§å¹
+ï¼2ç§ï¼ã«å«ã¾ããï¼å®éã«ã¯ï¼(1-2)ã®æå¤§å¹
+ãèæ
+®ãã¦ï¼å¤é¨ä»
+æ§ï¼»NGKI3608ï¼½ã®å¶éæéãå®ããï¼
+
+(2) (ç¾å¨æå»ï¼TMAX_RELTIM)ããå¾ã«ãªãçç±
+
+(2-1) ç¸å¯¾æéãé·ãæ¹ã«ä¸¸ãã
+
+è©³ãããã¨ã¯å¾è¿°ãããï¼ç¸å¯¾æéãæå®ããæ°ããªã¿ã¤ã ã¤ãã³ããç»é²ã
+ãæã«ã¯ï¼ç¸å¯¾æéãé·ãæ¹ã«ä¸¸ããããã«ï¼ã¿ã¤ã ã¤ãã³ãã®çºçæå»ã«é«
+åè§£è½ã¿ã¤ãã®é²ã¿å¹
+ãå ããï¼ãã®ããï¼ç»é²ããã¿ã¤ã ã¤ãã³ãã®çºçæ
+å»ãï¼(ç¾å¨æå»ï¼TMAX_RELTIM)ããï¼é«åè§£è½ã¿ã¤ãã®é²ã¿å¹
+ã®åï¼å¾ã«ãªã
+å ´åãããï¼é«åè§£è½ã¿ã¤ãã®é²ã¿å¹
+ã¯ã¿ã¼ã²ããã«ããå®ã¾ããï¼ã¿ã¼ã²ã
+ãä¾å­é¨ã«å¯¾ãã¦ï¼1ããªç§ä»¥ä¸ã«ããã¨ããå¶ç´ãèª²ããã¨ã«ãã
+ãASPD1021ãï¼
+
+(2-2) ã·ã¹ãã æå»ã®èª¿æ´ã«ããã·ã¹ãã æå»ãæ»ãã
+
+ã·ã¹ãã æå»ãèª¿æ´ãããµã¼ãã¹ã³ã¼ã«ï¼adj_timï¼ã«ããã·ã¹ãã æå»ãæ»ã
+ã¨ï¼ç»é²ããã¦ããã¿ã¤ã ã¤ãã³ãã®çºçæå»ãï¼(ç¾å¨æå»ï¼TMAX_RELTIM)ã
+ãå¾ã«ãªãå¯è½æ§ãããï¼ããã«é¢ãã¦ã¯ï¼adj_timã®1åã®å¼åºãã§æ»ããæ
+éç¯å²ãæå¤§1ç§ã«å¶éããã¦ããï¼»NGKI3561ï¼½ï¼»NGKI3584ï¼½ãã¨ã«å ãã¦ï¼ç¾
+å¨ã®ã·ã¹ãã æå»ãï¼ã·ã¹ãã æå»ãæãé²ãã§ããæã®ã·ã¹ãã æå»ãã1ç§
+ä»¥ä¸æ»ã£ã¦ããå ´åã«ã¯ï¼ã·ã¹ãã æå»ãããä»¥ä¸æ»ããªãï¼»NGKI3589ï¼½ãã¨
+ã¨ãã¦ããï¼ãã®ããï¼ã·ã¹ãã æå»ãæ»ãããã¨ã«ããï¼ç»é²ããã¦ããã¿
+ã¤ã ã¤ãã³ãã®çºçæå»ã(ç¾å¨æå»ï¼TMAX_RELTIM)ããå¾ã«ãªãæå¤§å¹
+ã¯ï¼2
+ç§ä»¥ä¸ã§ããï¼
+
+âã¤ãã³ãæå»ã®æ¯è¼æ¹æ³
+
+ã¤ãã³ãæå»ã32ãããã§è¡¨ç¾ããã¨ï¼å¨åãããã¨ã¯é¿ããããªãï¼ã¤ãã³
+ãæå»ãå¨åããï¼UINT32_MAXãè¶
+ããï¼ã¨ï¼ã¤ãã³ãæå»ã¯0ã«æ»ãããï¼ã¤
+ãã³ãæå»ã®åå¾é¢ä¿ãï¼ã¤ãã³ãæå»ã®åç´ãªå¤§å°é¢ä¿ã§å¤å®ãããã¨ãã§
+ããªããªãï¼
+
+ã¤ãã³ãæå»ãå¨åããå ´åã§ãï¼ã¤ãã³ãæå»ã®åå¾é¢ä¿ãå¤å®ã§ãããã
+ã«ããããã«ï¼å¨åããåã®ã¤ãã³ãæå»ï¼å¤ã¨ãã¦ã¯å¤§ããï¼ã¨å¨åå¾ã®ã¤
+ãã³ãæå»ï¼å¤ã¨ãã¦ã¯å°ããï¼ã®å¢çãç¤ºãå¤ãï¼ã°ã­ã¼ãã«å¤æ°ã§ç®¡çã
+ããASPD1008ãï¼ãããï¼å¢çã¤ãã³ãæå»ã¨å¼ã¶ï¼ã¤ãã³ãæå»ã®åå¾é¢ä¿
+ã¯ï¼æ¯è¼å¯¾è±¡ã®ã¤ãã³ãæå»ããå¢çã¤ãã³ãæå»ãå¼ããå¤ï¼ãªã¼ããã­ã¼
+ã¯ç¡è¦ããï¼ã®å¤§å°é¢ä¿ã§å¤å®ãããASPD1009ãï¼
+
+åå¾é¢ä¿ã®å¤å®ãå¿
+è¦ãªã¤ãã³ãæå»ã¯ï¼ã¿ã¤ã ã¤ãã³ããã¼ãã«ç»é²ããã¦
+ãããã¹ã¦ã®ã¿ã¤ã ã¤ãã³ãã®çºçæå»ã¨ï¼ç¾å¨ã®ã¤ãã³ãæå»ã§ããï¼ãã®
+ããï¼ç´æçã«ã¯ï¼å¢çã¤ãã³ãæå»ã¯ï¼åè¿°ã®ãã¼ã¸ã³ã®ä¸­ã«è¨­å®ããã¦ã
+ãã°ããï¼å
+·ä½çã«ã¯ï¼å¢çã¤ãã³ãæå»ã¯ï¼ç¾å¨æå»ãã(1-1)ã®æå¤§å¹
+ãå¼
+ããã¤ãã³ãæå»ã¨ï¼(ç¾å¨æå»ï¼TMAX_RELTIM)ã«(2-1)ã¨(2-2)ã®æå¤§å¹
+ãå ã
+ãã¤ãã³ãæå»ã®éï¼ã¤ãã³ãæå»ã¯å¾ªç°ãã¦ããããï¼2ã¤ã®ãéãããããï¼
+ãã¼ã¸ã³ã¨ãªã£ã¦ããæ¹ã®éï¼ã«è¨­å®ããã¦ããã°ããï¼
+
+åè¿°ã®ãã¼ã¸ã³ããï¼(1-1)(2-1)(2-2)ã®æå¤§å¹
+ãå¼ãã¨ï¼ç´290ç§ã®ãã¼ã¸ã³
+ãæ®ãï¼å¢çã¤ãã³ãæå»ã¯ï¼ãã®éã®ã©ãã«ç½®ãã¦ãè¯ããï¼(1-1)ã®æå¤§å¹
+
+ã¯ã¢ããªã±ã¼ã·ã§ã³ã®è¨­è¨ãæªãã¨è¶
+ãã¦ãã¾ãå¯è½æ§ãããããï¼ãããè¶
+
+ããå ´åã®ã­ãã¹ãæ§ãèæ
+®ãã¦ï¼ç¾å¨ã®ã¤ãã³ãæå»ã®200ç§åã«è¨­å®ããã
+ã¨ã¨ãããASPD1010ãï¼
+
+âç¾å¨æå»ã®ç®åº
+
+ã¤ãã³ãæå»ã¨ï¼é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ï¼ä»¥ä¸ï¼åã«ã«ã¦ã³ãå¤ã¨å¼ã¶ï¼
+ã®å¯¾å¿ãç®¡çããããã«ï¼ç¾å¨æå»ãç®åºããåº¦ã«ï¼ç®åºããæç¹ã§ã®ã«ã¦ã³
+ãå¤ã¨ã¤ãã³ãæå»ãï¼ã°ã­ã¼ãã«å¤æ°ã«ä¿å­ãããASPD1012ãï¼ããªãã¡ï¼
+ãããã®ã°ã­ã¼ãã«å¤æ°ã«ã¯ï¼ç¾å¨æå»ãååã«ç®åºããæç¹ã§ã®ã«ã¦ã³ãå¤
+ã¨ã¤ãã³ãæå»ãä¿æãã¦ããï¼
+
+ç¾å¨æå»ï¼ç¾å¨ã®ã¤ãã³ãæå»ï¼ãå¿
+è¦ã¨ããå ´åã«ã¯ï¼æ¬¡ã®å¦çãè¡ãï¼ã¾
+ãï¼é«åè§£è½ã¿ã¤ãããï¼ç¾å¨ã®ã«ã¦ã³ãå¤ãèª­ã¿åºããASPD1013ãï¼èª­ã¿åº
+ããã«ã¦ã³ãå¤ã¨ååã®ã«ã¦ã³ãå¤ã®å·®ããï¼ã¤ãã³ãæå»ãã©ãã ãé²ãã 
+ããæ±ãããASPD1014ãï¼ãã®å¤ãï¼ååã®ã¤ãã³ãæå»ã«å ãã¦ï¼ç¾å¨ã®ã¤
+ãã³ãæå»ãç®åºãããASPD1015ãï¼ç®åºããã¤ãã³ãæå»ã¯ï¼èª­ã¿åºããç¾
+å¨ã®ã«ã¦ã³ãå¤ã¨ã¨ãã«ï¼ã°ã­ã¼ãã«å¤æ°ã«æ ¼ç´ãããASPD1016ãï¼ããã«ï¼
+å¢çã¤ãã³ãæå»ãæ´æ°ãããASPD1011ãï¼
+
+ãªãï¼æå¾ã«ç¾å¨æå»ãç®åºããæç¹ã§ã®ã¤ãã³ãæå»ã¯ï¼ã«ã¼ãã«ã®åæå
+æã«0ã«åæåãããASPD1047ãï¼ã¾ãï¼å¢çã¤ãã³ãæå»ãï¼ããã«åããã¦
+åæåãããASPD1048ãï¼
+
+âé«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ã®è¨­å®
+
+åè¿°ããããã«ï¼é«åè§£è½ã¿ã¤ãããã®å²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ã¯ï¼ã¿ã¤ã ã¤
+ãã³ããã¼ãã®å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã®çºçæå»ã«è¨­å®ããã®ãåºæ¬ã§ãã
+ï¼»ASPD1002ï¼½ï¼
+
+ãã ãï¼é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æãï¼APIã§æå®ã§ããæå¤§ç¸å¯¾æéããã
+ç­ãå ´åã«ã¯ï¼ä¸ã®ãããªè¨­å®ãã§ããªãå ´åãããï¼å
+·ä½çã«ã¯ï¼å
+é ­ã®ã¿
+ã¤ã ã¤ãã³ãã®çºçæå»ã¾ã§ã®æéãï¼é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æãããé·
+ãå ´åã«ï¼å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã®çºçæå»ã«å²è¾¼ã¿ãçºçããããã«è¨­å®ã§
+ããªãï¼ãã®å ´åï¼ã¿ã¤ãå¨æãçµéããä»¥åã«ããã¼ã®å²è¾¼ã¿ãçºçããï¼
+æå»ãæ´æ°ããå¦çãè¡ããASPD1003ãï¼ä¸å¿
+è¦ãªã¿ã¤ãã³ã°ã§å²è¾¼ã¿ãçºç
+ãããã¨ã«ãªããï¼ã¿ã¤ãå¨æãçµéããä»¥åã«æå»ãæ´æ°ããå¦çãè¡ããª
+ãã¨ï¼é«åè§£è½ã¿ã¤ããå¨åããããããããªããªãããï¼ãããããªãï¼
+
+ããã§ï¼ããã¼ã®å²è¾¼ã¿ãçºçãããã¿ã¤ãã³ã°ãåé¡ã«ãªãï¼ã¿ã¤ãå¨æã
+çµéããç´åã«å²è¾¼ã¿ããããããã«è¨­å®ããå ´åï¼ä½ããã®çç±ã§å²è¾¼ã¿å¦
+çãé
+å»¶ããã¨ï¼å²è¾¼ã¿ãã³ãã©å
+ã§é«åè§£è½ã¿ã¤ããèª­ãã æç¹ã§ã¿ã¤ãã
+å¨åãã¦ããå¯è½æ§ãããï¼ã¿ã¤ããå¨åãããã¨ãè¦è½ã¨ãå¯è½æ§ãããï¼
+ããã§ï¼ããã¼ã®å²è¾¼ã¿ãçºçãããã¾ã§ã®æéã¯ï¼ã¿ã¤ãå¨æããã¿ã¤ãå²
+è¾¼ã¿ã®æå¤§é
+å»¶æéãå¼ããæéãããç­ãæéã«è¨­å®ããªããã°ãªããªã
+ãASPD1004ãï¼ããã¼ã®å²è¾¼ã¿ãçºçãããã¾ã§ã®æéã¯ï¼ã¿ã¼ã²ããä¾å­ã«
+å®ãããã¨ã¨ãããASPD1005ãï¼
+
+åãçç±ã§ï¼ã¿ã¤ã ã¤ãã³ããã¼ãã®å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã®çºçã¾ã§ã®æé
+ãï¼ããã¼ã®å²è¾¼ã¿ãçºçãããã¾ã§ã®æéãããé·ãå ´åã«ã¯ï¼ããã¼ã®å²
+è¾¼ã¿ãçºçãããã¾ã§ã®æéãçµéããã¿ã¤ãã³ã°ã§å²è¾¼ã¿ãçºçããï¼æå»
+ãæ´æ°ããå¦çãè¡ããASPD1006ãï¼ããã¼ã®å²è¾¼ã¿ãçºçãããã¾ã§ã®æé
+ã¯ã¿ã¤ãå¨æãããç­ãè¨­å®ããããã¨ããï¼ãã®å¦çã«ããï¼»ASPD1003ï¼½ã
+å®ç¾ãããï¼
+
+ããã«ï¼ã¿ã¤ã ã¤ãã³ããã¼ããç©ºã®å ´åã«ãï¼ããã¼ã®å²è¾¼ã¿ãçºçããã
+ã¾ã§ã®æéãçµéããã¿ã¤ãã³ã°ã§å²è¾¼ã¿ãçºçããï¼æå»ãæ´æ°ããå¦çã
+è¡ããASPD1007ãï¼
+
+ã·ã¹ãã æå»ãèª¿æ´ããå ´åãï¼ä½ããã®çç±ã§å²è¾¼ã¿å¦çãé
+å»¶ããå ´åã«
+ã¯ï¼é«åè§£è½ã¿ã¤ãã®å²è¾¼ã¿çºçã¿ã¤ãã³ã°ãè¨­å®ãããã¨ããæç¹ã§ï¼å
+é ­
+ã®ã¿ã¤ã ã¤ãã³ãã®çºçæå»ãéãã¦ããå¯è½æ§ãããï¼ãã®ãããªå ´åã«ã¯ï¼
+ã¿ã¤ãå²è¾¼ã¿ãããã«çºçããããASPD1017ãï¼
+
+âé«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦ç
+
+é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ãçºçããã¨ï¼ã¾ãï¼åè¿°ã®æ¹æ³ã§ç¾å¨æå»ãç®åºãã
+ãASPD1022ãï¼æ¬¡ã«ï¼ã¿ã¤ã ã¤ãã³ããã¼ãä¸­ã®ã¿ã¤ã ã¤ãã³ãã®ä¸­ã§ï¼çºç
+æå»ãç¾å¨æå»ä»¥åã®ãã®ãï¼ä»¥ä¸ã®æé ã§å¦çããï¼
+
+ã¿ã¤ã ã¤ãã³ããã¼ããç©ºã§ãªãå ´åã«ã¯ï¼å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã®çºçæå»
+ã¨ç¾å¨æå»ãæ¯è¼ãï¼çºçæå»ãç¾å¨æå»ä»¥åã§ããå ´åã«ã¯ï¼ãã®ã¿ã¤ã ã¤
+ãã³ããã¿ã¤ã ã¤ãã³ããã¼ãããåé¤ãï¼ã¿ã¤ã ã¤ãã³ããå¦çãã
+ãASPD1018ãï¼ãããï¼ã¿ã¤ã ã¤ãã³ããã¼ããç©ºã«ãªããï¼å
+é ­ã®ã¿ã¤ã ã¤
+ãã³ãã®çºçæå»ãç¾å¨æå»ä»¥åã§ãªããªãã¾ã§ç¹°ãè¿ããASPD1019ãï¼
+
+ï¼»ASPD1019ï¼½ã®ç¹°ãè¿ãã®éã«ï¼ã¿ã¤ã ã¤ãã³ãã1ã¤ä»¥ä¸å¦çãã¦ããå ´åã«
+ã¯ï¼ãã®éã«æéãçµéãã¦ããã¨èããããããï¼ååº¦ï¼åè¿°ã®æ¹æ³ã§ç¾å¨
+æå»ãç®åºãï¼åã®æ®µè½ã«è¨è¿°ããå¦çãè¡ããASPD1020ãï¼
+
+ã¿ã¤ã ã¤ãã³ãã1ã¤ãå¦çããã«ï¼»ASPD1019ï¼½ã®ç¹°ãè¿ããçµããå ´åã«ã¯ï¼
+åè¿°ã®æ¹æ³ã§é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ãè¨­å®ãï¼å²è¾¼ã¿å¦çã
+çµãããASPD1025ãï¼
+
+âç¸å¯¾æéæå®ã«ããã¿ã¤ã ã¤ãã³ãã®ç»é²
+
+ç¸å¯¾æéãæå®ãã¦ã¿ã¤ã ã¤ãã³ããç»é²ããå ´åã«ã¯ï¼ç¾å¨æå»ãé
+ãæ¹ã«
+ä¸¸ããæå»ã«ï¼æå®ãããç¸å¯¾æéãå ãã¦ï¼ã¿ã¤ã ã¤ãã³ãã®çºçæå»ãæ±
+ãããASPD1026ãï¼
+
+ç¾å¨æå»ãé
+ãæ¹ã«ä¸¸ããã®ã¯ï¼ï¼»NGKI0046ï¼½ã«ããï¼ã¿ã¤ã ã¤ãã³ãã®å¦ç
+ãè¡ãã¾ã§ã®æéãï¼ç¸å¯¾æéã«ãã£ã¦æå®ããä»¥ä¸ã¨ããªããã°ãªããªãã
+ãã§ããï¼ããã«å¯¾ãã¦ï¼åè¿°ã®æ¹æ³ã§ç¾å¨æå»ãç®åºããã¨ï¼ç¾å¨æå»ãæ©
+ãæ¹ã«ä¸¸ããæå»ãæ±ã¾ãï¼ããã§ï¼åè¿°ã®æ¹æ³ã§ç®åºããç¾å¨æå»ã«ï¼é«å
+è§£è½ã¿ã¤ãã®é²ã¿å¹
+ï¼ãããï¼TSTEP_HRTCNTã¨æ¸ãï¼ãå ãã¦ï¼ç¾å¨æå»ãé
+
+ãæ¹ã«ä¸¸ããæå»ã¨ãããASPD1027ãï¼
+
+ä»¥ä¸ã®å¦çã®å¾ï¼ã¿ã¤ã ã¤ãã³ããã¿ã¤ã ã¤ãã³ããã¼ãã«æ¿å
+¥ãã
+ãASPD1030ãï¼ç»é²ããã¿ã¤ã ã¤ãã³ããï¼å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã«ãªã£ãå ´
+åã«ã¯ï¼åè¿°ã®æ¹æ³ã§é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ãè¨­å®ãã
+ãASPD1031ãï¼
+
+ãã ãï¼é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦çã®éä¸­ã§ã¿ã¤ã ã¤ãã³ããç»é²ãããå ´
+åã«ã¯ï¼ã¿ã¤ãå²è¾¼ã¿å¦çãçµããåã«é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³
+ã°ãè¨­å®ãããããï¼ããã§è¨­å®ããå¿
+è¦ã¯ãªãï¼ãããå®ç¾ããããã«ï¼é«
+åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦çä¸­ã§ãããã¨ãç¤ºããã©ã°ãã°ã­ã¼ãã«å¤æ°ã«ç¨æ
+ããASPD1032ãï¼ãã®ãã©ã°ãã»ããããã¦ããå ´åã«ã¯ï¼é«åè§£è½ã¿ã¤ãå²
+è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ã®è¨­å®ãè¡ããªããASPD1034ãï¼ãªãï¼ãã®ãã©ã°ã¯ï¼
+ã·ã¹ãã ã®åæåæã«ã¯ãªã¢ãï¼é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦çã®å
+¥å£ã§ã»ãã
+ãï¼åºå£ã§ã¯ãªã¢ãããASPD1033ãï¼
+
+âå¨æãã³ãã©ã®ã¿ã¤ã ã¤ãã³ãã®ç»é²
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼TA_PHSå±æ§ã®å¨æãã³ãã©ããµãã¼ãããªãï¼»ASPS0172ï¼½
+ããï¼å¨æãã³ãã©ãåä½éå§ããæå»ãï¼å¨æãã³ãã©ãèµ·åããæå»ã®åº
+æºæå»ã¨ãªãï¼»NGKI2372ï¼½ï¼
+
+å¨æãã³ãã©ã®ååã®èµ·åæå»ã¯ï¼å¨æãã³ãã©ãåä½éå§ããæå»ããï¼å¨
+æãã³ãã©ã®èµ·åä½ç¸å¾ã§ããï¼»NGKI2365ï¼½ï¼å¨æãã³ãã©ãèµ·åããã¿ã¤ã 
+ã¤ãã³ããç»é²ããå¦çã®å
+å®¹ã¯ï¼å¨æãã³ãã©ãéçAPIã«ããåä½éå§ãã
+å ´åã¨ï¼ãµã¼ãã¹ã³ã¼ã«ã«ããåä½éå§ããå ´åã§ç°ãªãï¼
+
+å¨æãã³ãã©ãéçAPIã«ããåä½éå§ããå ´åã«ã¯ï¼ã«ã¼ãã«ã®åæåå¦çã§ï¼
+ã¿ã¤ã ã¤ãã³ããç»é²ããï¼ãã®æç¹ã§ã¯ã·ã¹ãã æå»ã¯0ã§ããããï¼å¨æã
+ã³ãã©ãåä½éå§ããæå»ã¯0ã¨ãããã¨ã«ãªãï¼èµ·åä½ç¸ãçºçæå»ã¨ãã¦ï¼
+ã¿ã¤ã ã¤ãã³ããã¿ã¤ã ã¤ãã³ããã¼ãã«æ¿å
+¥ãããASPD1035ãï¼èµ·åä½ç¸ã¨
+ãã¦æå®ã§ããæéã¯0ä»¥ä¸TMAX_RELTIMä»¥ä¸ã§ããããï¼»NGKI2399ï¼½ï¼ã¿ã¤ã 
+ã¤ãã³ãã®çºçæå»ã¯ï¼ç¾å¨æå»ä»¥éï¼(ç¾å¨æå»ï¼TMAX_RELTIM)ä»¥åã¨ããç¯
+å²ã«åã¾ãï¼å¨æãã³ãã©ã®åä½éå§ã®æç¡ã«ãããããï¼ã«ã¼ãã«ã®åæå
+å¦çã®æå¾ã§ï¼é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ãè¨­å®ããå¿
+è¦ããã
+ããï¼ã¿ã¤ã ã¤ãã³ããç»é²ããæç¹ã§ã¯ï¼é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤
+ãã³ã°ã¯è¨­å®ããªãï¼
+
+å¨æãã³ãã©ããµã¼ãã¹ã³ã¼ã«ã«ããåä½éå§ããå ´åã«ã¯ï¼ç¾å¨æå»ãåºæº
+æå»ï¼èµ·åä½ç¸ãç¸å¯¾æéã¨ãã¦ã¿ã¤ã ã¤ãã³ããç»é²ããã°ããããï¼ãã§
+ã«æ¤è¨ããã¿ã¤ã ã¤ãã³ãã®çºçæå»ãç¸å¯¾æéã§æå®ããå ´åã¨åæ§ã§ãã
+ãASPD1036ãï¼
+
+å¨æãã³ãã©ã®2åç®ä»¥éã®èµ·åæå»ã¯ï¼ååã®èµ·åæå»ããï¼å¨æãã³ãã©ã®
+èµ·åå¨æå¾ã§ããï¼»NGKI2365ï¼½ï¼ãã®ããã®ã¿ã¤ã ã¤ãã³ãã®ç»é²å¦çã¯ï¼é«
+åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦çããå¼ã³åºãããå¨æãã³ãã©èµ·åã«ã¼ãã³ã®ä¸­ã§ï¼
+å¨æãã³ãã©ãå¼ã³åºãåã«ï¼å¨æãã³ãã©ãæ¬¡åèµ·åããããã®ã¿ã¤ã ã¤ã
+ã³ããç»é²ããå½¢ã§è¡ããASPD1037ãï¼ç»é²ããã¿ã¤ã ã¤ãã³ãã®çºçæå»ã¯ï¼
+å¨æãã³ãã©ã®ä»åã®èµ·åæå»ã«èµ·åå¨æãå ããæå»ã¨ãããASPD1038ãï¼
+
+å¨æãã³ãã©èµ·åã«ã¼ãã³ãå¼ã°ããæç¹ã§ï¼å¨æãã³ãã©ãä»åèµ·åããã¿
+ã¤ã ã¤ãã³ãã¯ï¼ç´åã¾ã§ï¼ã¿ã¤ã ã¤ãã³ããã¼ãã®å
+é ­ã«ãã£ãã¿ã¤ã ã¤ã
+ã³ãã§ããï¼ã¾ãï¼èµ·åå¨æã¨ãã¦æå®ã§ããæéã¯0ããå¤§ããTMAX_RELTIM
+ä»¥ä¸ã§ãããã¨ããï¼»NGKI2397ï¼½ï¼ç»é²ããã¿ã¤ã ã¤ãã³ãã®çºçæå»ã¯ï¼ç´
+åã¾ã§å
+é ­ã«ãã£ãã¿ã¤ã ã¤ãã³ãã®çºçæå»ããå¾ã§ï¼(ç´åã¾ã§å
+é ­ã«ãã£
+ãã¿ã¤ã ã¤ãã³ãã®çºçæå»ï¼TMAX_RELTIM)ä»¥åã¨ããç¯å²ã«åã¾ãï¼ã¿ã¤ã 
+ã¤ãã³ãã®å¦çã2ç§ä»¥ä¸é
+ããç¶æ³ã§ã¯ï¼ã«ã¼ãã«ã®åä½ã¯ä¿è¨¼ãããªããã®
+ã¨ãã¦ããï¼»NGKI3608ï¼½ãã¨ããï¼ç´åã¾ã§å
+é ­ã«ãã£ãã¿ã¤ã ã¤ãã³ãã®çº
+çæå»ãï¼ç¾å¨æå»ããåã«ãªãæå¤§å¹
+ã¯2ç§ã¨èãã¦ããï¼æ¢ã«æ¤è¨ãã
+(1-1)ã®æå¤§å¹
+ã®ç¯å²å
+ã§ããï¼
+
+ã¿ã¤ã ã¤ãã³ããç»é²ããå¨æãã³ãã©èµ·åã«ã¼ãã³ã¯ï¼é«åè§£è½ã¿ã¤ãå²è¾¼
+ã¿ã®å¦çããå¼ã³åºãããããï¼ããã§é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³
+ã°ãè¨­å®ããå¿
+è¦ã¯ãªãï¼
+
+âã¿ã¤ã ã¤ãã³ãã®ç»é²è§£é¤
+
+ã¿ã¤ã ã¤ãã³ãã®ç»é²ãè§£é¤ããå ´åã«ã¯ï¼ã¿ã¤ã ã¤ãã³ããã¿ã¤ã ã¤ãã³ã
+ãã¼ãããåé¤ãããASPD1039ãï¼
+
+é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦çã®éä¸­ã§ã¿ã¤ã ã¤ãã³ããç»é²è§£é¤ãããå ´åã§
+ãªãï¼åé¤ããã¿ã¤ã ã¤ãã³ããå
+é ­ã®ã¿ã¤ã ã¤ãã³ãã§ãã£ãå ´åã«ã¯ï¼å
+è¿°ã®æ¹æ³ã§é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ãè¨­å®ãããASPD1040ãï¼
+
+âã¿ã¤ã ã¤ãã³ããçºçããã¾ã§ã®æéã®è¨ç®
+
+ã¿ã¤ã ã¤ãã³ããçºçããã¾ã§ã®æéãè¨ç®ããå ´åã«ã¯ï¼ã¿ã¤ã ã¤ãã³ãã®
+çºçæå»ããï¼ç¾å¨æå»ãé
+ãæ¹ã«ä¸¸ããæå»ãå¼ããã¨ã«ãã£ã¦æ±ãã
+ãASPD1049ãï¼ç¾å¨æå»ãé
+ãæ¹ã«ä¸¸ããæå»ã¯ï¼ï¼»ASPD1027ï¼½ã®æ¹æ³ã§æ±ã
+ããASPD1050ãï¼
+
+ç¾å¨æå»ãé
+ãæ¹ã«ä¸¸ããã®ã¯ï¼ï¼»NGKI0050ï¼½ã«ããï¼ã¿ã¤ã ã¤ãã³ããçºç
+ããæå»ãç¸å¯¾æéã§è¿ãå ´åã«ã¯ï¼ã¿ã¤ã ã¤ãã³ããå¦çãããã®ã¯ï¼åºæº
+æå»ããç¸å¯¾æéã¨ãã¦è¿ãããä»¥ä¸ã®æéãçµéããå¾ã¨ããªããã°ãªããª
+ãããã§ããï¼ããã§ã®åºæºæå»ã¯ï¼ç¸å¯¾æéãè¿ããµã¼ãã¹ã³ã¼ã«ãå¼ã³åº
+ããæå»ï¼è¨ãæããã¨ç¾å¨æå»ï¼ã§ããï¼»NGKI0049ï¼½ï¼
+
+ãã ãï¼ã¿ã¤ã ã¤ãã³ãã®çºçæå»ãï¼ç¾å¨æå»ä»¥åã§ããå ´åã«ã¯ï¼ã¿ã¤ã 
+ã¤ãã³ãã¾ã§ã®æ®ãæéã¨ãã¦0ãè¿ãï¼»NGKI0552ï¼½ï¼
+
+âã·ã¹ãã æå»ã®ç®¡ç
+
+ã·ã¹ãã æå»ãåç
+§ãããµã¼ãã¹ã³ã¼ã«ï¼get_timï¼ã¯ï¼ã·ã¹ãã æå»ãæãé²
+ãã§ããæã®ã·ã¹ãã æå»ï¼adj_timã§ã·ã¹ãã æå»ãæ»ãã¦ããªãå ´åã«ã¯ï¼
+ç¾å¨ã®ã·ã¹ãã æå»ã«ä¸è´ããï¼ãè¿ãï¼»NGKI3591ï¼½ï¼ãããå®ç¾ããããã«ï¼
+ã·ã¹ãã æå»ãæãé²ãã§ããæã®ã¤ãã³ãæå»ãï¼ã°ã­ã¼ãã«å¤æ°ã§ç®¡çã
+ããASPD1041ãï¼
+
+æãé²ãã§ããæã®ã¤ãã³ãæå»ã¯ï¼ã«ã¼ãã«ã®åæåæã«0ã«åæåã
+ãASPD1046ãï¼ç¾å¨ã®ã¤ãã³ãæå»ãé²ããåº¦ã«æ´æ°ããï¼å
+·ä½çã«ã¯ï¼æã
+é²ãã§ããæã®ã¤ãã³ãæå»ã¨é²ããåã®ç¾å¨ã®ã¤ãã³ãæå»ã®å·®ãï¼ç¾å¨ã®
+ã¤ãã³ãæå»ã®é²ã¿åãããå°ããå ´åã«ã¯ï¼æãé²ãã§ããæã®ã¤ãã³ãæ
+å»ãï¼é²ããå¾ã®ç¾å¨ã®ã¤ãã³ãæå»ã«ä¸è´ããããASPD1042ãï¼
+
+ã·ã¹ãã æå»ã¨ã¤ãã³ãæå»ã¯ï¼åãéåº¦ã§é²ãããï¼ã·ã¹ãã æå»ãè¨­å®ã
+ãªãéã¯ï¼ãã®å·®ã¯ä¸å®ã§ããï¼ãã®å·®ãç®¡çããããã«ï¼get_timã§åç
+§ãã
+ããã·ã¹ãã æå»ï¼64ãããã®ç¬¦å·ç¡ãæ´æ°åï¼ãã ãï¼64ãããã®æ´æ°åã
+ãµãã¼ãããã¦ããªãã¿ã¼ã²ããã§ã¯32ãããã®ç¬¦å·ç¡ãæ´æ°åï¼»NGKI0548ï¼½ï¼
+ã¨ï¼æãé²ãã§ããæã®ã¤ãã³ãæå»ï¼32ãããã®ç¬¦å·ç¡ãæ´æ°åï¼ã®å·®ãï¼
+ã°ã­ã¼ãã«å¤æ°ã§ç®¡çãããASPD1043ãï¼ãã®å·®ãï¼ã·ã¹ãã æå»ã®ãªãã»ã
+ãã¨å¼ã¶ï¼
+
+ã«ã¼ãã«ã®åæåæã«ã¯ï¼ã·ã¹ãã æå»ã¯0ã«åæåããï¼»NGKI2333ï¼½ï¼æãé²
+ãã§ããæã®ã¤ãã³ãæå»ã0ã«åæåãããï¼»ASPD1046ï¼½ãã¨ããï¼ã·ã¹ãã 
+æå»ã®ãªãã»ããã0ã«åæåãããASPD1044ãï¼ã¾ãï¼ã·ã¹ãã æå»ã64ãã
+ãã®ç¬¦å·ç¡ãæ´æ°åã®å ´åã«ã¯ï¼æãé²ãã§ããæã®ã¤ãã³ãæå»ãé²ããçµ
+æï¼ãã®å¤ãå¨åããæã«ã¯ï¼ã·ã¹ãã æå»ã®ãªãã»ããã«2^32ãå ç®ãã
+ãASPD1045ãï¼
+
+âã·ã¹ãã æå»ã®åç
+§ã¨è¨­å®
+
+ã·ã¹ãã æå»ã®åç
+§ï¼get_timï¼ã®å¦çæ¬ä½ï¼æä»å¶å¾¡ã®å
+å´ã®å¦çï¼ã§ã¯ï¼ã¾
+ãï¼åè¿°ã®æ¹æ³ã§ç¾å¨æå»ãç®åºã»æ´æ°ãï¼ããã«ä¼´ã£ã¦ï¼æãé²ãã§ããæ
+ã®ã¤ãã³ãæå»ãæ´æ°ãããASPD1057ãï¼ãã®å¾ï¼æãé²ãã§ããæã®ã¤ãã³
+ãæå»ã«ã·ã¹ãã æå»ã®ãªãã»ãããå ãããã¨ã§ï¼æãé²ãã§ããæã®ã·ã¹
+ãã æå»ãæ±ãï¼æå®ãããã¡ã¢ãªé åã«è¿ããASPD1058ãï¼
+
+ã·ã¹ãã æå»ã®è¨­å®ï¼set_timï¼ã®å¦çæ¬ä½ï¼æä»å¶å¾¡ã®å
+å´ã®å¦çï¼ã§ã¯ï¼ã¾
+ãï¼åè¿°ã®æ¹æ³ã§ç¾å¨æå»ãç®åºã»æ´æ°ãï¼ããã«ä¼´ã£ã¦ï¼æãé²ãã§ããæ
+ã®ã¤ãã³ãæå»ãæ´æ°ãããASPD1059ãï¼ãã®å¾ï¼æå®ãããã·ã¹ãã æå»ã¨
+æãé²ãã§ããæã®ã¤ãã³ãæå»ã®å·®ãæ±ãï¼ã·ã¹ãã æå»ã®ãªãã»ããã«æ ¼
+ç´ãããASPD1060ãï¼
+
+ï¼»NGKI3592ï¼½ã§å¤åããªããã¨ãè¦æ±ããã¦ãããget_timã§åç
+§ããã·ã¹ãã 
+æå»ã®é²ã¿ãæ­¢ã¾ã£ã¦ããæéãã¯ï¼æãé²ãã§ããæã®ã¤ãã³ãæå»ã¨ç¾å¨
+ã®ã¤ãã³ãæå»ã®å·®ã§å®ç¾ããã¦ããï¼ä¸è¨ã®set_timã®å¦çæé ã§ã¯ï¼ç¾å¨æ
+å»ã¨æãé²ãã§ããæã®ã¤ãã³ãæå»ãï¼ãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºãããæç¹
+ã®ç¶æ
+ã«æ´æ°ããä»¥å¤ã«ã¯ï¼æãé²ãã§ããæã®ã¤ãã³ãæå»ã¨ç¾å¨ã®ã¤ãã³
+ãæå»ã®å·®ãå¤æ´ãããã¨ã¯ãªãï¼ãã®ããï¼ä¸ã®å¦çæé ã§ï¼»NGKI3592ï¼½ã®
+è¦æ±ãæºããã¦ããï¼
+
+âã·ã¹ãã æå»ã®èª¿æ´
+
+ã·ã¹ãã æå»ã®èª¿æ´ï¼adj_timï¼ã®å¦çæ¬ä½ï¼æä»å¶å¾¡ã®å
+å´ã®å¦çï¼ã¯ï¼ä»¥ä¸
+ã®æé ã§è¡ãï¼
+
+ã¾ãï¼åè¿°ã®æ¹æ³ã§ç¾å¨æå»ãç®åºãããASPD1051ãï¼æ¬¡ã«ï¼E_OBJã¨ã©ã¼ã®
+ãã§ãã¯ãè¡ããASPD1052ãï¼E_OBJã¨ã©ã¼ã®ãã§ãã¯ã®å
+å®¹ã¯ï¼ã·ã¹ãã æå»
+ãé²ããå ´åã¨é
+ãããå ´åã§ç°ãªãï¼ã·ã¹ãã æå»ãé²ããå ´åã«ã¯ï¼ã¿ã¤
+ã ã¤ãã³ããã¼ããç©ºã§ãªãï¼å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã®çºçæå»ãç¾å¨æå»ã
+ãã1ç§ä»¥ä¸åã§ããå ´åã«ï¼E_OBJã¨ã©ã¼ã¨ããï¼»NGKI3588ï¼½ï¼ã·ã¹ãã æå»
+ãé
+ãããå ´åã«ã¯ï¼æãé²ãã§ããæã®ã¤ãã³ãæå»ã¨ç¾å¨ã®ã¤ãã³ãæå»
+ã¨ã®å·®ã1ç§ä»¥ä¸ã®å ´åã«ï¼E_OBJã¨ã©ã¼ã¨ããï¼»NGKI3589ï¼½ï¼
+
+E_OBJã¨ã©ã¼ã§ãªãå ´åã«ã¯ï¼ç¾å¨ã®ã¤ãã³ãæå»ã«ï¼æå®ãããèª¿æ´éãå ã
+ããASPD1053ãï¼ããã«ããï¼ã·ã¹ãã æå»ã®ç¾å¨å¤ã«æå®ãããèª¿æ´éãå 
+ãããï¼»NGKI3586ï¼½ï¼ã¿ã¤ã ã¤ãã³ããçºçããã¾ã§ã®ç¸å¯¾æéãèª¿æ´ããã
+ï¼»NGKI3587ï¼½ï¼ã¾ãï¼å¢çã¤ãã³ãæå»ãæ´æ°ãããASPD1055ãï¼
+
+ããã§ï¼ã¤ãã³ãæå»ãé²ããå ´åã«ã¯ï¼ï¼»ASPD1042ï¼½ã¨åãæ¹æ³ã§ï¼æãé²
+ãã§ããæã®ã¤ãã³ãæå»ãæ´æ°ãããASPD1054ãï¼
+
+æå¾ã«ï¼åè¿°ã®æ¹æ³ã§é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ãè¨­å®ãã
+ãASPD1056ãï¼
+
+âã«ã¼ãã«ã®åæåæã®å¦ç
+
+ã«ã¼ãã«ã®åæåæã«ã¯ï¼ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«ã®åæåå¦çã«ãã
+ã¦ï¼æå¾ã«ç¾å¨æå»ãç®åºããæç¹ã§ã®ã¤ãã³ãæå»ï¼å¢çã¤ãã³ãæå»ï¼æ
+ãé²ãã§ããæã®ã¤ãã³ãæå»ï¼é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦çä¸­ã§ãããã¨ã
+ç¤ºããã©ã°ãåæåãï¼ã¿ã¤ã ã¤ãã³ããã¼ããç©ºã«åæåãããASPD1061ãï¼
+
+ãã®å¾ã«å¼ã³åºãããå¨æãã³ãã©æ©è½ã®åæåå¦çã«ããã¦ï¼éçAPIã«ãã
+åä½éå§ããå¨æãã³ãã©ã®ï¼ååã®èµ·åã®ããã®ã¿ã¤ã ã¤ãã³ããç»é²ãã
+ãASPD1062ãï¼
+
+ã«ã¼ãã«ã®åæåå¦çã®æå¾ï¼ã«ã¼ãã«åä½ãéå§ããç´åï¼ã«ï¼é«åè§£è½ã¿
+ã¤ãã®ç¾å¨ã®ã«ã¦ã³ãå¤ãèª­ã¿åºãï¼ãã®å¤ã§ï¼æå¾ã«ç¾å¨æå»ãç®åºããæ
+ç¹ã§ã®ã«ã¦ã³ãå¤ãåæåãããASPD1063ãï¼æå¾ã«ï¼åè¿°ã®æ¹æ³ã§ï¼é«åè§£
+è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ãè¨­å®ãããASPD1064ãï¼
+
+âé«åè§£è½ã¿ã¤ãã¢ã¸ã¥ã¼ã«ï¼ã¿ã¼ã²ããä¾å­é¨ï¼ã®ä»æ§
+
+â
+æªå®æ
+
+âãã¬ã¼ãµããªãã£
+
+âASPD1001ã«é¢ããè£è¶³èª¬æ
+
+ASPD1001ï¼ã¿ã¤ã ã¤ãã³ãã®çºçæå»ãï¼ã«ã¼ãã«å
+é¨ã§ã¯32ãããã§æ±ãï¼
+ã¯ï¼ããåããè¨­è¨ã®çµæã§ããï¼å
+·ä½çã«ã¯ï¼å¤é¨ä»æ§ã®å¤ãã®è¦æ±ã«ä¾å­
+ãã¦æ±ºå®ããã¦ãããã¨ã«å ãã¦ï¼ããã«ä¾å­ãã¦ä»ã®å¤ãã®è¨­è¨ãåºã¦ãã¦
+ããï¼ã¤ã¾ãï¼å¤é¨ä»æ§ã¨è¨­è¨ãå¤å¯¾å¤ã«é¢ä¿ãã¦ããä¸­ã§ï¼ASPD1001ããã
+ã«ãªã£ã¦ããï¼
+
+ã¾ãï¼ASPD1001ããå¤é¨ä»æ§ã«å¯¾ããå¶éäºé 
+ãæ½åºããã¦ããã¨ããæå³ã§
+ãï¼ããåããè¨­è¨ã«ãªã£ã¦ããï¼ãã®é¢ä¿ãç´ ç´ã«è¡¨ç¾ããã¨ï¼è¨­è¨ããå¤
+é¨ä»æ§ã«å¯¾ãã¦ãªã³ã¯ããããã¨ã«ãªããï¼ãã®ãããªéé¢ä¿ã¯é¿ããã¹ãã¨
+èããããï¼å¤é¨ä»æ§ããè¨­è¨ã¸ã®ãªã³ã¯ã¨ãã¦è¡¨ç¾ãã¦ããï¼ããã«è©²å½ã
+ããªã³ã¯ã¯ï¼ä¸ã®ãã¬ã¼ãµããªãã£ä¸è¦§ã§"#"ãã¤ãã¦åºå¥ããï¼ã¾ãï¼å¤é¨ä»
+æ§æ¸ã®ä»æ§æ±ºå®ã®çç±ã«ï¼ãããã®å¶éäºé 
+ãï¼å®è£
+ãèæ
+®ãããã®ã§ããæ¨
+ãè¨è¿°ãã¦ããï¼
+
+âè¨­è¨é 
+ç®ã«å¯¾ããä¸ä½è¦æ±ããã®ãã¬ã¼ãµããªãã£
+
+ASPD1001ï¼(a*)				âASPR0006ï¼NGKI0548ï¼NGKI0041ï¼NGKI0042ï¼
+								NGKI0549ï¼NGKI0550#ï¼NGKI0553ï¼NGKI0554ï¼
+								NGKI3608#ï¼NGKI3561#ï¼NGKI3584#ï¼NGKI3588#ï¼
+								NGKI3589ï¼NGKI2372ï¼NGKI2373ï¼ASPS0172ï¼
+								NGKI2365ï¼NGKI2397ï¼NGKI2399
+ASPD1002ï¼(a*)				âASPR0011
+ASPD1003ï¼(b*)(e:ASPD1002)
+ASPD1004ï¼(d)
+ASPD1005ï¼(d)
+ASPD1006ï¼(a*)(e:ASPD1002)	âASPD1003
+ASPD1007ï¼(a*)
+ASPD1008ï¼(a*)				âASPD1001
+ASPD1009ï¼(a*)				âASPD1001
+ASPD1010ï¼(ab*)				âASPD1001
+ASPD1011ï¼(a*)				âASPD1016ï¼ASPD1010
+ASPD1012ï¼(a*)				âNGKI3559ï¼ASPR0011
+ASPD1013ï¼(a*)				âNGKI3559
+ASPD1014ï¼(a*)				âNGKI3559
+ASPD1015ï¼(a*)				âNGKI3559
+ASPD1016ï¼(a*)				âASPD1012
+ASPD1017ï¼(a*)(e:ASPD1002)
+ASPD1018ï¼(a*)
+ASPD1019ï¼(a*)
+ASPD1020ï¼(a*)
+ASPD1021ï¼(d)
+ASPD1022ï¼(a*)
+ASPD1023ï¼æ¬ çª
+ASPD1024ï¼æ¬ çª
+ASPD1025ï¼(a*)
+ASPD1026ï¼(a*)
+ASPD1027ï¼(a*)				âASPD1050
+ASPD1028ï¼æ¬ çª
+ASPD1029ï¼æ¬ çª
+ASPD1030ï¼(a*)
+ASPD1031ï¼(a*)
+ASPD1032ï¼(a*)
+ASPD1033ï¼(a*)
+ASPD1034ï¼(a*)
+ASPD1035ï¼(a*)
+ASPD1036ï¼(a*)
+ASPD1037ï¼(a*)
+ASPD1038ï¼(a*)
+ASPD1039ï¼(a*)
+ASPD1040ï¼(a*)
+ASPD1041ï¼(a*)				âNGKI3591
+ASPD1042ï¼(a*)				âASPD1041
+ASPD1043ï¼(a*)
+ASPD1044ï¼(a*)
+ASPD1045ï¼(a*)
+ASPD1046ï¼(a*)				âASPD1041
+ASPD1047ï¼(a*)
+ASPD1048ï¼(a*)				âASPD1010
+ASPD1049ï¼(a*)				âNGKI0049ï¼NGKI0050
+ASPD1050ï¼(a*)				âASPD1027
+ASPD1051ï¼(a*)
+ASPD1052ï¼(a*)
+ASPD1053ï¼(a*)				âNGKI3586ï¼NGKI3587
+ASPD1054ï¼(a*)
+ASPD1055ï¼(a*)				âASPD1010
+ASPD1056ï¼(a*)
+ASPD1057ï¼(a*)				âNGKI2354ï¼NGKI3591
+ASPD1058ï¼(a*)				âNGKI2354ï¼NGKI3591
+ASPD1059ï¼(a*)				âNGKI3567ï¼NGKI3592
+ASPD1060ï¼(a*)				âNGKI3567ï¼NGKI3592
+ASPD1061ï¼(a*)
+ASPD1062ï¼(a*)
+ASPD1063ï¼(a*)
+ASPD1064ï¼(a*)
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/doc/user.txt
===================================================================
--- asp3_wo_tecs/trunk/doc/user.txt	(revision 302)
+++ asp3_wo_tecs/trunk/doc/user.txt	(revision 302)
@@ -0,0 +1,2728 @@
+
+		TOPPERS/ASP3ã«ã¼ãã«
+		ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«
+
+		å¯¾å¿ãã¼ã¸ã§ã³: Release 3.0
+		æçµæ´æ°: 2016å¹´1æ11æ¥
+
+ãã®ãã­ã¥ã¡ã³ãã¯ï¼TOPPERS/ASP3ã«ã¼ãã«ãä½¿ç¨ããããã«å¿
+è¦ãªäºé 
+ãèª¬
+æãããã®ã§ããï¼
+
+----------------------------------------------------------------------
+ TOPPERS/ASP Kernel
+     Toyohashi Open Platform for Embedded Real-Time Systems/
+     Advanced Standard Profile Kernel
+
+ 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: user.txt 505 2016-01-12 01:41:01Z ertl-hiro $
+----------------------------------------------------------------------
+
+âç®æ¬¡
+
+ï¼ï¼TOPPERS/ASP3ã«ã¼ãã«ã®æ¦è¦
+	1.1 TOPPERS/ASP3ã«ã¼ãã«ã®ä½ç½®ä»ã
+	1.2 TOPPERS/ASP3ã«ã¼ãã«ã®ä»æ§
+	1.3 ãã¤ã°ã¬ã¼ã·ã§ã³ã¬ã¤ã
+	1.4 æ©è½æ¡å¼µã»ãã¥ã¼ãã³ã°ã¬ã¤ã
+	1.5 æ¢ç¥ã®åé¡
+	1.6 Cygwinç°å¢ã«ãããæ³¨æäºé 
+
+ï¼ï¼ã¿ã¼ã²ããä¾å­é¨
+	2.1 ã¿ã¼ã²ããä¾å­é¨ã®æ¦è¦
+	2.2 ç°¡æããã±ã¼ã¸
+	2.3 åå¥ããã±ã¼ã¸
+ï¼ï¼ã¯ã¤ãã¯ã¹ã¿ã¼ãã¬ã¤ã
+	3.1 éçºç°å¢ã®æºå
+	3.2 ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®æ§ç¯
+	3.3 ãµã³ãã«ãã­ã°ã©ã ã®æ§ç¯ã¨å®è¡
+	3.4 ã«ã¼ãã«ãé¢æ°åä½ã§ã©ã¤ãã©ãªåããæ¹æ³
+	3.5 ã¢ããªã±ã¼ã·ã§ã³ã¨ã«ã¼ãã«ãå¥ã
+ã«æ§ç¯ããæ¹æ³
+ï¼ï¼ãã£ã¬ã¯ããªæ§æã»ãã¡ã¤ã«æ§æ
+	4.1 é
+å¸ããã±ã¼ã¸ã®ãã£ã¬ã¯ããªæ§æ
+	4.2 ã¿ã¼ã²ããéä¾å­é¨ã®ãã¡ã¤ã«æ§æ
+ï¼ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã®ä½¿ãæ¹
+ï¼ï¼Makefileã®ä¿®æ­£æ¹æ³
+	6.1 Makefileã®å¤æ°å®ç¾©
+	6.2 ã³ã³ãã¤ã«ãªãã·ã§ã³
+ï¼ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ä½¿ãæ¹
+ï¼ï¼ã·ã¹ãã ãµã¼ãã¹
+	8.1 ã·ã¹ãã ã­ã°æ©è½
+		8.1.1 ã·ã¹ãã ã­ã°æ©è½ã®ä½ç½®ä»ã
+		8.1.2 ã­ã°ãããã¡ã¸ã®è¨é²ã¨ä½ã¬ãã«åºå
+		8.1.3 ã­ã°æ
+å ±ã®ç¨®å¥
+		8.1.4 ã­ã°æ
+å ±ã®éè¦åº¦
+		8.1.5 ã­ã°æ
+å ±ã®ãã¼ã¿æ§é 
+		8.1.6 ã·ã¹ãã ã­ã°æ©è½ã®ãµã¼ãã¹ã³ã¼ã«
+		8.1.7 ã·ã¹ãã ã­ã°æ©è½ã®ããã®ã©ã¤ãã©ãªé¢æ°ã¨ãã¯ã­
+		8.1.8 ã·ã¹ãã ã­ã°æ©è½ã®ãã®ä»ã®ãµã¼ãã¹
+	8.2 ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ã
+		8.2.1 ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ãµã¼ãã¹ã³ã¼ã«
+		8.2.2 ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ãã®ä»ã®ãµã¼ãã¹
+	8.3 ã·ã¹ãã ã­ã°ã¿ã¹ã¯
+		8.3.1 ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ãµã¼ãã¹ã³ã¼ã«
+		8.3.2 ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ãã®ä»ã®ãµã¼ãã¹
+	8.4 å®è¡æéåå¸éè¨ãµã¼ãã¹
+	8.5 ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºå
+ï¼ï¼ãµãã¼ãã©ã¤ãã©ãª
+	9.1 åºæ¬çãªã©ã¤ãã©ãªé¢æ°
+	9.2 ã­ã¥ã¼æä½ã©ã¤ãã©ãªé¢æ°
+	9.3 ã·ã¹ãã ã­ã°åºåç¨ã©ã¤ãã©ãªé¢æ°
+ï¼ï¼ï¼ãã¹ããã­ã°ã©ã 
+	10.1 ãã¹ããã­ã°ã©ã ç¨ãµã¼ãã¹
+	10.2 ã«ã¼ãã«ã®æ´åæ§æ¤æ»
+	10.3 æ©è½ãã¹ããã­ã°ã©ã 
+	10.4 ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ããã­ã°ã©ã 
+	10.5 æ§è½è©ä¾¡ãã­ã°ã©ã 
+ï¼ï¼ï¼ä½¿ç¨ä¸ã®æ³¨æã¨ãã³ã
+	11.1 ã¿ã¤ããã©ã¤ãã®çµè¾¼ã¿
+	11.2 assertãã¯ã­ã®å¦ç
+	11.3 ã·ã¹ãã ã­ã°æ©è½ã®æ±ã
+	11.4 ãªãã¸ã§ã¯ãIDã®ç®¡ç
+	11.5 ã«ã¼ãã«ã®å
+é¨ã·ã³ãã«ã®ãªãã¼ã 
+	11.6 ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ãã®ä½¿ç¨æ¹æ³
+	11.7 ã·ã¹ãã ã®èµ·åæã®åæåå¦ç
+	11.8 rodataã»ã¯ã·ã§ã³ãRAMã«ç½®ãå ´å
+ï¼ï¼ï¼åèæ
+å ±
+	12.1 å©ç¨æ¡ä»¶ã¨å©ç¨å ±å
+	12.2 ä¿è¨¼ã»é©ç¨æ§ã»ãµãã¼ã
+	12.3 ãã°ã¬ãã¼ã
+	12.4 ã¦ã§ããµã¤ã
+	12.5 TOPPERSã¦ã¼ã¶ã¼ãºã¡ã¼ãªã³ã°ãªã¹ã
+	12.6 TOPPERSãã­ã¸ã§ã¯ãã®ã¡ã³ãåãã®ãµã¼ãã¹
+	12.7 TOPPERSãã­ã¸ã§ã¯ãã¸ã®åå 
+ï¼ï¼ï¼ãªãã¡ã¬ã³ã¹
+	13.1 ãµã¼ãã¹ã³ã¼ã«ä¸è¦§
+	13.2 éçAPIä¸è¦§
+	13.3 ãã¼ã¸ã§ã³å±¥æ­´
+
+
+ï¼ï¼TOPPERS/ASP3ã«ã¼ãã«ã®æ¦è¦
+
+1.1 TOPPERS/ASP3ã«ã¼ãã«ã®ä½ç½®ä»ã
+
+TOPPERS/ASP3ã«ã¼ãã«ï¼ä»¥ä¸ï¼ASP3ã«ã¼ãã«ï¼ã¯ï¼TOPPERS/ASPã«ã¼ãã«ãæ¡å¼µã»
+æ¹è¯ãããã®ã§ï¼TOPPERSç¬¬3ä¸ä»£ã«ã¼ãã«ï¼ITRONç³»ï¼ã®åºç¤ã¨ãªããã®ã¨ãã¦
+éçºãããªã¢ã«ã¿ã¤ã ã«ã¼ãã«ã§ããï¼
+
+TOPPERS/ASPã«ã¼ãã«ã¯ï¼Î¼ITRON4.0ä»æ§ã®ã¹ã¿ã³ãã¼ããã­ãã¡ã¤ã«æºæ ã®ãª
+ã¢ã«ã¿ã¤ã ã«ã¼ãã«ã§ããTOPPERS/JSPã«ã¼ãã«ãæ¡å¼µã»æ¹è¯ããå½¢ã§éçºãã
+ãã®ã§ããï¼
+
+1.2 TOPPERS/ASP3ã«ã¼ãã«ã®ä»æ§
+
+ASP3ã«ã¼ãã«ã®ä»æ§ã®æ¦è¦ã«ã¤ãã¦ã¯ï¼ãTOPPERS/ASP3ã«ã¼ãã«ã®ä»æ§æ¦è¦ã
+ãåç
+§ãããã¨ï¼ã¾ãï¼ASP3ã«ã¼ãã«ãå«ãTOPPERSç¬¬3ä¸ä»£ã«ã¼ãã«ï¼ITRONç³»ï¼
+ã®ä»æ§ã®è©³ç´°ã«ã¤ãã¦ã¯ï¼å¥éPDFãã¡ã¤ã«ã®å½¢ã§é
+å¸ãã¦ãããTOPPERSç¬¬3ä¸
+ä»£ã«ã¼ãã«ï¼ITRONç³»ï¼çµ±åä»æ§æ¸ï¼Release 3.B.0ï¼ããåç
+§ãããã¨ï¼
+
+1.3 ãã¤ã°ã¬ã¼ã·ã§ã³ã¬ã¤ã
+
+å¾æ¥ã®TOPPERSã«ã¼ãã«ãä»ã®Î¼ITRON4.0ä»æ§æºæ ã®ã«ã¼ãã«ããï¼TOPPERSç¬¬
+3ä¸ä»£ã«ã¼ãã«ã«ç§»è¡ããããã®æ¹æ³ï¼ã¾ãã¯ãã³ãï¼ãèª¬æãããTOPPERSç¬¬
+3ä¸ä»£ã«ã¼ãã«ã¸ã®ãã¤ã°ã¬ã¼ã·ã§ã³ã¬ã¤ãããï¼å¥éPDFãã¡ã¤ã«ã®å½¢ã§é
+å¸
+ãã¦ããï¼å¿
+è¦ã«å¿ãã¦åç
+§ãããã¨ï¼
+
+1.4 æ©è½æ¡å¼µã»ãã¥ã¼ãã³ã°ã¬ã¤ã
+
+ASP3ã«ã¼ãã«ãï¼æ©è½æ¡å¼µã»ãã¥ã¼ãã³ã°ããããã®æ¹æ³ï¼ã¾ãã¯ãã³ãï¼ã
+èª¬æãããæ©è½æ¡å¼µã»ãã¥ã¼ãã³ã°ã¬ã¤ãããç¨æãã¦ããï¼æ¡å¼µããã±ã¼ã¸
+ã®ä½¿ç¨æ¹æ³ã¯ï¼ãæ©è½æ¡å¼µã»ãã¥ã¼ãã³ã°ã¬ã¤ããã«å«ã¾ãã¦ããï¼å¿
+è¦ã«å¿
+ãã¦åç
+§ãããã¨ï¼
+
+1.5 æ¢ç¥ã®åé¡
+
+å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®å
+é ­çªå°ï¼CRE_ISRã®isrï¼ï¼å²è¾¼ã¿ãã³ãã©ã®å
+é ­
+çªå°ï¼DEF_INHã®inthdrï¼ï¼CPUä¾å¤ãã³ãã©ã®å
+é ­çªå°ï¼DEF_EXCã®exchdrï¼ï¼
+åæåã«ã¼ãã³ã®å
+é ­çªå°ï¼ATT_INIã®inirtnï¼ï¼çµäºå¦çã«ã¼ãã³ã®å
+é ­çªå°
+ï¼ATT_TERã®terrtnï¼ããã­ã°ã©ã ã®éå§çªå°ã¨ãã¦æ­£ãããªãå ´åã®ã¨ã©ã¼ã¯ï¼
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«ãã£ã¦æ¤åºãããªãå ´åãããï¼ã¿ã¼ã²ããã«ä¾å­ï¼ï¼
+
+kernel_cfg.cï¼ããã³cfg1_out.cï¼ã¯ï¼ã«ã¼ãã«ï¼ã·ã¹ãã ãµã¼ãã¹ï¼ã¢ããª
+ã±ã¼ã·ã§ã³ã®ãããã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ããï¼ãããã®ã·ã³
+ãã«ãåç
+§ããå¯è½æ§ãããï¼ãã®ããï¼ã«ã¼ãã«ï¼ã·ã¹ãã ãµã¼ãã¹ï¼ã¢ã
+ãªã±ã¼ã·ã§ã³ã§ã·ã³ãã«ç­ãè¡çªãã¦ããå ´åãï¼ã³ã³ãã¤ã«ãªãã·ã§ã³ãé£
+ãéã£ã¦ããå ´åã«ï¼kernel_cfg.cï¼ããã³cfg1_out.cï¼ãæ­£ããã³ã³ãã¤ã«
+ã§ããªããªãå ´åãèããããï¼ã«ã¼ãã«ã®ã·ã³ãã«ããªãã¼ã ãããªã©ã®æ¹
+æ³ã§è»½æ¸ããã¦ã¯ãããï¼åé¡ããªããªã£ã¦ããããã§ã¯ãªãï¼
+
+ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«å¯¾ãã
+INCLUDEãã£ã¬ã¯ãã£ãã«ããä»ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼
+ããã¦ããå ´åã«ï¼ãã®ä¸­ã«å«ã¾ããCè¨èªããªãã­ã»ããµã®ã¤ã³ã¯ã«ã¼ããã£
+ã¬ã¯ãã£ãï¼#includeï¼ã§ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã®ç½®ããã¦ãã
+ãã£ã¬ã¯ããªãï¼ãã¡ã¤ã«ãæ¤ç´¢ãããã¹ã«ã¯ãããªãã¨ããåé¡ãããï¼ä¾
+ãã°ï¼syssvc/syslog.cfgã«ã#include "syslog.h"ãã¨è¨è¿°ã§ããªãã®ã¯ï¼ã
+ã®åé¡ãããããã§ããï¼
+
+ç¾æç¹ã§ã¯ï¼ã¢ãã¬ã¹ã64ãããã®ç°å¢ã«ã¯å¯¾å¿ãã¦ããªãï¼64ãããã¢ãã¬
+ã¹ç°å¢ããµãã¼ãããããã®æå¤§ã®èª²é¡ã¯ï¼ã¢ãã­ã¼ã©Sã¬ã³ã¼ããã©ã¼ããã
+ã64ãããã¢ãã¬ã¹ã«å¯¾å¿ãã¦ããªããã¨ã§ããï¼
+
+1.6 Cygwinç°å¢ã«ãããæ³¨æäºé 
+
+
+Cygwinç°å¢ã«ããã¦ã¯ï¼ãã£ã¬ã¯ããªã®æå®ãç¸å¯¾ãã¹ã§è¡ããã¨ãæ¨å¥¨ããï¼
+ããã¯ï¼Cygwinç°å¢ã®çµ¶å¯¾ãã¹ã¯ï¼Windowsãã¤ãã£ãã§ãã«ãããããã¼ã«ã¯
+è§£éã§ããªãããã§ããï¼
+
+
+ï¼ï¼ã¿ã¼ã²ããä¾å­é¨
+
+2.1 ã¿ã¼ã²ããä¾å­é¨ã®æ¦è¦
+
+ASP3ã«ã¼ãã«ã®ã¿ã¼ã²ããéä¾å­é¨ã¨ï¼åç¨®ã®ã¿ã¼ã²ããã·ã¹ãã ã«å¯¾å¿ãã
+ããã®ã¿ã¼ã²ããä¾å­é¨ã¯ï¼å¥ã
+ã«éçºããã¦ããï¼ãã®ããï¼ASP3ã«ã¼ãã«
+ãå¯¾å¿ãã¦ãããã¹ã¦ã®ã¿ã¼ã²ããä¾å­é¨ãï¼ãã¼ã¸ã§ã³ãæ´åããã¦ããã±ã¼
+ã¸åãããã¨ã¯å°é£ã§ããï¼ããã§ï¼ä¸»ã«åç´ã®ã¦ã¼ã¶ãå¯¾è±¡ã«ããç°¡æãã
+ã±ã¼ã¸ã¨ï¼ä¸ç´ã®ã¦ã¼ã¶ãã«ã¼ãã«éçºè
+ãå¯¾è±¡ã«ããåå¥ããã±ã¼ã¸ãç¨æ
+ãã¦ããï¼
+
+ASP3ã«ã¼ãã«ãæªãµãã¼ãã®ã¿ã¼ã²ããã·ã¹ãã ã¸ãã¼ãã£ã³ã°ããããã«å¿
+
+è¦ãªä½æ¥­ã¯ï¼éçºç°å¢ã®æ§ç¯ã¨æ¨æºã®éçºç°å¢ã¨ã®å·®ç°ã®å¸åï¼ã«ã¼ãã«èªèº«
+ã®ãã¼ãã£ã³ã°ï¼ã·ã¹ãã ãµã¼ãã¹ã®ãã¼ãã£ã³ã°ãªã©ãããªãï¼è©³ããã¯ï¼
+ãã¿ã¼ã²ããä¾å­é¨ ãã¼ãã£ã³ã°ã¬ã¤ãããåç
+§ãããã¨ï¼
+
+2.2 ç°¡æããã±ã¼ã¸
+
+ç°¡æããã±ã¼ã¸ã¯ï¼ASP3ã«ã¼ãã«ãå¯¾å¿ãã¦ããã¿ã¼ã²ããã·ã¹ãã æ¯ã«ç¨æ
+ããï¼ãã®ã¿ã¼ã²ããã·ã¹ãã ä¸ã§ASP3ã«ã¼ãã«ãåä½ãããããã«å¿
+è¦ãªãã¡
+ã¤ã«ä¸å¼ãããã±ã¼ã¸åãããã®ã§ããï¼ç°¡æããã±ã¼ã¸ã«å«ã¾ãããã¡ã¤ã«
+ã¯ï¼ãã¼ã¸ã§ã³ãæ´åãã¦ãããã¨ãç¢ºèªããã¦ããï¼
+
+ç°¡æããã±ã¼ã¸ã®ãã¼ã¸ã§ã³çªå·ã¯ï¼ããã±ã¼ã¸åããæ¥ä»ã¨ãããã¨ãåå
+ã¨ãããï¼ã¿ã¼ã²ããã·ã¹ãã æ¯ã®äºæ
+ã«ãããã®ååã«å¾ããªãå ´åãããï¼
+
+ç°¡æããã±ã¼ã¸ã¯ï¼åºæ¬çã«ã¯ï¼æ¬¡ã«èª¬æããåå¥ããã±ã¼ã¸ãè¤æ°ã¾ã¨ãã
+ãã®ã§ããï¼ãã®ããï¼å¯¾è±¡ã¿ã¼ã²ããã·ã¹ãã ã«å¿
+è¦ã®ãªããã¡ã¤ã«ãå«ã¾
+ãã¦ããï¼ã¾ãï¼ç°¡æããã±ã¼ã¸ã«å«ã¾ãã¦ããåå¥ããã±ã¼ã¸ã®ãã¼ã¸ã§ã³
+ã¯ï¼åå¥ããã±ã¼ã¸ã®MANIFESTãã¡ã¤ã«ãåç
+§ãããã¨ã§ç¥ããã¨ãã§ããï¼
+
+2.3 åå¥ããã±ã¼ã¸
+
+åå¥ããã±ã¼ã¸ã¯ï¼ASP3ã«ã¼ãã«ã®éçºåä½æ¯ã«ï¼ãã®éçºåä½ã§éçºãæ
+å½
+ãã¦ãããã¡ã¤ã«ä¸å¼ãããã±ã¼ã¸åãããã®ã§ããï¼ASP3ã«ã¼ãã«ã®ã¿ã¼ã²ã
+ãéä¾å­é¨ãï¼ä¸ã¤ã®åå¥ããã±ã¼ã¸ã¨ãã¦é
+å¸ãããï¼ããåå¥ããã±ã¼ã¸
+ãä½¿ç¨ããããã«ã¯ï¼ä¸è¬ã«ã¯ï¼ä»ã®åå¥ããã±ã¼ã¸ãå¿
+è¦ã¨ãªãï¼ã¿ã¼ã²ã
+ãä¾å­é¨ã®åå¥ããã±ã¼ã¸ãä½¿ç¨ããããã«å¿
+è¦ã¨ãªãåå¥ããã±ã¼ã¸ã¨ãã®
+ãã¼ã¸ã§ã³ã«ã¤ãã¦ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã®ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ãåç
+§ãã
+ãã¨ï¼ä½¿ç¨ããåå¥ããã±ã¼ã¸ã®ãã¼ã¸ã§ã³ãæ´åããããã¨ã¯ï¼ã¦ã¼ã¶ã®è²¬
+ä»»ã§ããï¼
+
+åå¥ããã±ã¼ã¸ã®ãã¼ã¸ã§ã³çªå·ã¯ï¼X.Y.Zã®å½¢ã§è¡¨ç¾ãããï¼ã¿ã¼ã²ããéä¾
+å­é¨ã®ãã¼ã¸ã§ã³çªå·ãï¼ASP3ã«ã¼ãã«å
+¨ä½ã®ãªãªã¼ã¹çªå·ã¨ããï¼ã¿ã¼ã²ã
+ãä¾å­é¨ã®ãã¼ã¸ã§ã³çªå·ã¯ï¼Xã¨Yãï¼ãããä¾å­ããã¿ã¼ã²ããéä¾å­é¨ã¨
+ä¸è´ãã¦ããï¼ããã«å¯¾ãã¦ï¼Zã¯ä¸è´ãã¦ããã¨ã¯éããªãï¼ä¾ãã°ï¼ã¿ã¼ã²ã
+ãéä¾å­é¨ã®ãã¼ã¸ã§ã³3.1.0ã«å¯¾å¿ããã¿ã¼ã²ããä¾å­é¨ã¯ï¼ãã¼ã¸ã§ã³
+3.1.Zã®å½¢ã¨ãªãï¼ã¿ã¼ã²ããä¾å­é¨ã®ã¿ããã¼ã¸ã§ã³ã¢ããããå ´åã«ã¯ï¼Z
+ãå¤æ´ãããï¼
+
+ä½¿ç¨ããåå¥ããã±ã¼ã¸ã¯ï¼æ¬¡ã®ä¾ã®ããã«ï¼ã¿ã¼ã²ããéä¾å­é¨ã®åå¥ãã
+ã±ã¼ã¸ãå±éããã®ã¨åããã£ã¬ã¯ããªã§å±éããï¼
+
+	% tar xvfz asp3-3.1.0.tar.gz
+	% tar xvfz asp3_arch_arm_gcc_3.1.2.tar.gz
+
+ã¿ã¼ã²ããéä¾å­é¨ã®åå¥ããã±ã¼ã¸ã«ã¯ï¼ä»¥ä¸ã®ã¿ã¼ã²ããä¾å­é¨ãå«ã¾ã
+ã¦ãããï¼ããã¯ï¼ASP3ã«ã¼ãã«ãæ°ããã¿ã¼ã²ããã·ã¹ãã ã«ãã¼ãã£ã³ã°
+ããéã®åºçºç¹ã¨ããããã«ç¨æãããã®ã§ããï¼
+
+	target/dummy_gcc	ããã¼ï¼GNUéçºç°å¢ï¼ã®ã¿ã¼ã²ããä¾å­é¨
+
+ã¾ãã¯ãããã¿ã¼ã²ããã·ã¹ãã åãã®éçºç°å¢ã§ãã«ããï¼ãã®å¾ï¼åãã¡
+ã¤ã«ã®å
+å®¹ãã¿ã¼ã²ããã·ã¹ãã åãã«ä¿®æ­£ãã¦ãããã¨ãæ³å®ãã¦ããï¼
+
+
+ï¼ï¼ã¯ã¤ãã¯ã¹ã¿ã¼ãã¬ã¤ã
+
+ããã§ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ãç¨æããã¦ããã¿ã¼ã²ããã·ã¹ãã ä¸ã§ï¼ASP3
+ã«ã¼ãã«ä¸ã§åä½ãããµã³ãã«ãã­ã°ã©ã ãæ§ç¯ã»åä½ãããã¾ã§ã®æé ãç¤º
+ãï¼
+
+3.1 éçºç°å¢ã®æºå
+
+ASP3ã«ã¼ãã«ãç¨ããã·ã¹ãã æ§ç¯ã«ã¯ï¼ä»¥ä¸ã®ãã¼ã«ãå¿
+è¦ã§ããï¼
+
+	ãã¹ãã·ã¹ãã ç¨ã®ãã¼ã«
+		perl		åä½ç¢ºèªï¼5.10.0
+		GNU Make	åä½ç¢ºèªï¼3.81
+
+	TOPPERSæ°ä¸ä»£ã«ã¼ãã«ç¨ã³ã³ãã£ã®ã¥ã¬ã¼ã¿
+		cfg			åä½ç¢ºèªï¼1.9.4
+					â» 1.5ä»¥åã®ãã¼ã¸ã§ã³ã§ã¯åä½ããªãï¼
+
+	ã¿ã¼ã²ããã·ã¹ãã ç¨ã®ãã¼ã«ï¼ã¯ã­ã¹éçºç°å¢ï¼
+		æ¨æºè¦æ ¼ã«æºæ ããCã³ã³ãã¤ã©
+		ã¢ã»ã³ãã©ï¼ãªã³ã«ï¼ã©ã¤ãã©ãªã¢ã³
+		ã·ã³ãã«ãã¡ã¤ã«åºåãã¼ã«ï¼ãã­ãµãã¡ã¤ã«åºåãã¼ã«
+		æ¨æºCã©ã¤ãã©ãªï¼å¿
+é ã§ã¯ãªãï¼
+
+ã¿ã¼ã²ããã·ã¹ãã ç¨ã®ãã¼ã«ã«GNUéçºç°å¢ãç¨ããå ´åã«ã¯ï¼ä»¥ä¸ã®ãã¼ã«
+ãå¿
+è¦ã§ããï¼
+
+	ã¿ã¼ã²ããã·ã¹ãã ç¨ã®GNUéçºç°å¢ãã¼ã«
+		BINUTILSï¼asï¼ldï¼arï¼nmï¼ranlibï¼objcopyï¼objdumpï¼
+		GCCã¾ãã¯GCC-COREï¼gccããã³ããããå¼ã³åºããããã¼ã«ï¼
+		NEWLIBï¼æ¨æºCã©ã¤ãã©ãªï¼å¿
+é ã§ã¯ãªãï¼
+
+åä½ç¢ºèªããã¦ããã¿ã¼ã²ããã·ã¹ãã ç¨ã®ãã¼ã«ã«ã¤ãã¦ã¯ï¼ã¿ã¼ã²ããä¾
+å­é¨ã®ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ãåç
+§ãããã¨ï¼
+
+ã¿ã¼ã²ããã·ã¹ãã ç¨ã®æ¨æºCã©ã¤ãã©ãªã¯ï¼ã¢ããªã±ã¼ã·ã§ã³ãæ¨æºCã©ã¤ã
+ã©ãªãä½¿ç¨ããªãå ´åã«ã¯ï¼å¿
+è¦ãªãï¼ãã ãï¼ã³ã³ãã¤ã©ãæ¨æºCã©ã¤ãã©ãª
+é¢æ°ï¼memcpyï¼memsetãªã©ï¼ãå¼ã³åºãã³ã¼ããçæããå ´åãããï¼ãã®å ´
+åã«ã¯æ¨æºCã©ã¤ãã©ãªãå¿
+è¦ã§ããï¼æ¨æºCã©ã¤ãã©ãªãç¨æããä»£ããã«ï¼
+çæããã³ã¼ããå¼ã³åºãé¢æ°ã®ã¿ãèªåã§ç¨æãã¦ãããï¼
+
+ä»¥ä¸ã§ã¯ï¼ãããã®ãã¼ã«ãç¨æã§ãã¦ãããã¨ãåæã«ï¼UNIXãã·ã³ä¸ã§ã®
+æ§ç¯æé ãèª¬æããï¼ã¾ãä»¥ä¸ã®èª¬æã§ã¯ï¼makeã³ãã³ããGNU Makeã§ããã
+ã®ã¨ããï¼ASP3ã«ã¼ãã«ã®ãµã³ãã«ã®Makefileã¯ï¼GNU Makeã®æ¡å¼µæ©è½ãç¨ã
+ã¦ããï¼ï¼
+
+3.2 ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®æ§ç¯
+
+ã«ã¼ãã«ãæ§ç¯ããåã«ï¼ã¾ãï¼TOPPERSæ°ä¸ä»£ã«ã¼ãã«ç¨ã³ã³ãã£ã®ã¥ã¬ã¼ã¿
+ãæ§ç¯ããå¿
+è¦ãããï¼ç°¡æããã±ã¼ã¸ã«å«ã¾ãã¦ããå ´åãªã©ï¼ã³ã³ãã£ã®ã¥
+ã¬ã¼ã¿ãå®è¡ãã¡ã¤ã«å½¢å¼ã§å
+¥æããå ´åã«ã¯ï¼ãã®ã¹ãããã¯å¿
+è¦ãªãï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®æ§ç¯ã«ã¯ï¼ä»¥ä¸ã®ãã¼ã«ãå¿
+è¦ã§ããï¼
+
+	ãã¹ãã·ã¹ãã ç¨ã®ãã¼ã«ï¼ã»ã«ãéçºç°å¢ï¼
+		C++ã³ã³ãã¤ã©ï¼C++ã©ã¤ãã©ãª
+					åä½ç¢ºèªï¼Mac OS Xç°å¢ï¼ï¼GNU C++ 4.2.1
+		Boost		åä½ç¢ºèªï¼1.52.0
+		GNU Make	åä½ç¢ºèªï¼3.81
+
+æåã«ï¼ããã±ã¼ã¸ã«ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ã½ã¼ã¹ãã¡ã¤ã«ãå«ã¾ãã¦ããªã
+å ´åã«ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ããã±ã¼ã¸ãï¼ASP3ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡ã¤
+ã«ãå±éãããã£ã¬ã¯ããªã®ä¸ã«å±éããï¼
+
+	% cd asp3
+	% tar xvfz cfg-1.9.4.tar.gz
+
+ã¾ãã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ããã±ã¼ã¸ãä»ã®ãã£ã¬ã¯ããªã«å±éãï¼ASP3
+ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡ã¤ã«ãå±éãããã£ã¬ã¯ããªããã·ã³ããªãã¯ãªã³ã¯ã
+ã¯ã£ã¦ãããï¼
+
+ã½ã¼ã¹ãã¡ã¤ã«ãå±éã§ããã¨ï¼cfgãã£ã¬ã¯ããªã«ç§»åãï¼ã³ã³ãã£ã®ã¥ã¬ã¼
+ã·ã§ã³ã¹ã¯ãªããï¼configureï¼ã§Makefileã®ç°å¢ä¾å­é¨ï¼Makefile.configï¼
+ãçæããå¾ï¼makeã³ãã³ãã«ããã³ã³ãã£ã®ã¥ã¬ã¼ã¿ï¼cfgãã­ã°ã©ã ï¼ãæ§
+ç¯ã§ããï¼
+
+	% cd cfg
+	% ./configure --without-xml
+	% make depend
+	% make
+
+ãã ãï¼Boostãã¤ã³ã¹ãã¼ã«ãããã£ã¬ã¯ããªããã³åç§°ãæ¨æºã§æ³å®ãã¦ã
+ããã®ã¨ã¯éãå ´åã«ã¯ï¼configureã®--with-headersããã³--with-librariesãª
+ãã·ã§ã³ã«ããï¼ããããã¡ã¤ã«ããã³ã©ã¤ãã©ãªã®ç½®ããããã£ã¬ã¯ããªã
+æå®ããå¿
+è¦ãããï¼--without-xmlã¯ï¼AUTOSAR XMLãã¡ã¤ã«ã®èª­ã¿è¾¼ã¿æ©è½
+ï¼ASP3ã«ã¼ãã«ç¨ã«ã¯å¿
+è¦ãªãï¼ãåãè¾¼ã¾ãªããã¨ãæå®ãããªãã·ã§ã³ã§
+ããï¼AUTOSAR XMLãã¡ã¤ã«ã®èª­ã¿è¾¼ã¿æ©è½ãåãè¾¼ãã«ã¯ï¼Xerces-C++ XML
+Parserãå¿
+è¦ã«ãªãï¼ï¼
+
+ã¾ãï¼ãã¹ãã·ã¹ãã ã«ãã£ã¦ã¯ï¼æé©åã¬ãã«ãä¸ããã¨æ­£ããã³ã³ãã¤ã«
+ã§ããªããã¨ãç¥ããã¦ããï¼ãã®ãããªå ´åã«ã¯ï¼æé©åã¬ãã«ãä¸ãããï¼
+æé©åãææ­¢ããããã«ï¼Makefileãä¿®æ­£ããå¿
+è¦ãããï¼
+
+ãªãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ä½¿ç¨æ¹æ³ã«ã¤ãã¦ã¯ï¼ãï¼ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿
+ã®ä½¿ãæ¹ãã®ç« ã§èª¬æããï¼
+
+3.3 ãµã³ãã«ãã­ã°ã©ã ã®æ§ç¯ã¨å®è¡
+
+æ¬¡ã«ï¼ASP3ã«ã¼ãã«ä¸ã§åä½ãããµã³ãã«ãã­ã°ã©ã ãæ§ç¯ããæ¹æ³ãèª¬æã
+ãï¼
+
+ã¾ãï¼ãµã³ãã«ãã­ã°ã©ã ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªãä½æ
+ãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªãããå®è¡ããï¼ä¾ãã°ï¼ãªãã¸ã§ã¯ããã¡
+ã¤ã«ãç½®ããã£ã¬ã¯ããªãï¼ASP3ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡ã¤ã«ãå±éãããã£ã¬
+ã¯ããªã®ä¸ã®OBJã¨ããåç§°ã®ãã£ã¬ã¯ããªã«ããå ´åã«ã¯ï¼æ¬¡ã®ã³ãã³ããå®
+è¡ããï¼ãã£ã¬ã¯ããªã®å ´æã¨åç§°ã¯ä»»æã«æ±ºãã¦ããï¼ãã ãï¼å ´æãå¤ã
+ãå ´åã«ã¯ï¼configureã®ç¸å¯¾ãã¹ãå¤æ´ãå¿
+è¦ã§ããï¼ä»¥ä¸åæ§ï¼ï¼
+
+	% mkdir OBJ
+	% cd OBJ
+	% perl ../configure -T <ã¿ã¼ã²ããç¥ç§°>
+
+ããã§ï¼<ã¿ã¼ã²ããç¥ç§°>ã¯ï¼targetãã£ã¬ã¯ããªã®ä¸ã«ç½®ããã¦ããã¿ã¼ã²ã
+ãä¾å­é¨ãã£ã¬ã¯ããªã®åç§°ã§ããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã®ãª
+ãã·ã§ã³ã«ã¤ãã¦ã¯ï¼ãï¼ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã®ä½¿ãæ¹ãã®
+ç« ã§èª¬æããï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã®å®è¡ã«ããï¼ã«ã¬ã³ããã£ã¬ã¯ããªã«ã¯ï¼
+ãµã³ãã«ãã­ã°ã©ã ãæ§ç¯ããããã®Makefileãçæãããï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã®å®è¡å¾ï¼å¿
+è¦ã§ããã°Makefileãä¿®æ­£ã
+ãï¼Makefileã®ä¿®æ­£æ¹æ³ã«ã¤ãã¦ã¯ï¼ãï¼ï¼Makefileã®ä¿®æ­£æ¹æ³ãã®ç« ã§èª¬æ
+ããï¼
+
+ãã®å¾ï¼makeã³ãã³ãã«ãããµã³ãã«ãã­ã°ã©ã ã®ã­ã¼ãã¢ã¸ã¥ã¼ã«ï¼aspã¾ã
+ã¯asp.exeï¼ãçæã§ããï¼
+
+	% make
+
+ããã§æ§ç¯ãããµã³ãã«ãã­ã°ã©ã ï¼sampleãã£ã¬ã¯ããªã®sample1.hï¼
+sample1.cï¼sample1.cfgï¼ã¯ï¼ASP3ã«ã¼ãã«ã®åºæ¬çãªåä½ãç¢ºèªããããã®
+ãã®ã§ããï¼ãã®ãã­ã°ã©ã ã®æ¦è¦èª¬æã¯ï¼sample1.cã®å
+é ­ã®ã³ã¡ã³ãã«ããï¼
+
+3.4 ã«ã¼ãã«ãé¢æ°åä½ã§ã©ã¤ãã©ãªåããæ¹æ³
+
+åç¯ã®æé ã§ã¯ï¼ã«ã¼ãã«ããã¡ã¤ã«åä½ã§ã³ã³ãã¤ã«ãï¼ã©ã¤ãã©ãªåãã¦
+ãããï¼ã«ã¼ãã«ã®ã³ã¼ããµã¤ãºãç¸®å°ããããã«ã¯ï¼ä½¿ç¨ããªããµã¼ãã¹ã³ã¼
+ã«ã¯ãªã³ã¯ããªãæ¹ãæã¾ããï¼ããã§ASP3ã«ã¼ãã«ã§ã¯ï¼ã«ã¼ãã«ãé¢æ°å
+ä½ã§ã³ã³ãã¤ã«ãï¼ã©ã¤ãã©ãªåããæ¹æ³ãç¨æãã¦ããï¼
+
+ãã®æ¹æ³ã§ãµã³ãã«ãã­ã°ã©ã ãæ§ç¯ããã«ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯
+ãªããã«ï¼ãããæç¤ºãããªãã·ã§ã³ï¼-fï¼ãä»å ããã ãã§ããï¼ä¾ãã°ï¼
+ãªãã¸ã§ã¯ããã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªãï¼ASP3ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡ã¤ã«
+ãå±éãããã£ã¬ã¯ããªã®ä¸ã®OBJã¨ããåç§°ã®ãã£ã¬ã¯ããªã«ããå ´åã«ã¯ï¼
+æ¬¡ã®ã³ãã³ããå®è¡ããï¼
+
+	% mkdir OBJ
+	% cd OBJ
+	% perl ../configure -T <ã¿ã¼ã²ããç¥ç§°> -f
+	% make
+
+3.5 ã¢ããªã±ã¼ã·ã§ã³ã¨ã«ã¼ãã«ãå¥ã
+ã«æ§ç¯ããæ¹æ³
+
+åç¯ã§èª¬æããæ¹æ³ã§ã¯ï¼ã¢ããªã±ã¼ã·ã§ã³ã¨ã«ã¼ãã«ãåæã«çæããããï¼
+ãªãã¸ã§ã¯ããã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªã«éå¸¸ã«å¤ãã®ãã¡ã¤ã«ãä½æãã
+ã¦ï¼æ±ãã«ãããªãï¼ããã§ï¼ã«ã¼ãã«ãä¿®æ­£ããé »åº¦ãä½ãå ´åã«ã¯ï¼ã«ã¼
+ãã«ã¯äºåã«æ§ç¯ãã¦ããï¼å¾ã§ã¢ããªã±ã¼ã·ã§ã³ã ããæ§ç¯ããæ¹æ³ãç¨æ
+ãã¦ããï¼ä»¥ä¸ã§ã¯ï¼ãµã³ãã«ãã­ã°ã©ã ãæ§ç¯ãä¾ã«ï¼ãã®æé ã«ã¤ãã¦èª¬
+æããï¼
+
+ã¾ãï¼ã«ã¼ãã«ãæ§ç¯ãããã£ã¬ã¯ããªãä½æãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹
+ã¯ãªãããå®è¡ããï¼ä¾ãã°ï¼ã«ã¼ãã«ãæ§ç¯ãããã£ã¬ã¯ããªãï¼ASP3ã«ã¼
+ãã«ã®ã½ã¼ã¹ãã¡ã¤ã«ãå±éãããã£ã¬ã¯ããªã®ä¸ã®KERNEL_LIBã¨ããåç§°ã®
+ãã£ã¬ã¯ããªã«ããå ´åã«ã¯ï¼æ¬¡ã®ã³ãã³ããå®è¡ããï¼
+
+	% mkdir KERNEL_LIB
+	% cd KERNEL_LIB
+	% perl ../configure -T <ã¿ã¼ã²ããç¥ç§°> -f
+	% make libkernel.a
+
+ããã«ããï¼ã«ã¼ãã«ãæ§ç¯ãããã£ã¬ã¯ããªã«ï¼ã«ã¼ãã«ã©ã¤ãã©ãª
+ï¼libkernel.aï¼ãçæãããï¼
+
+æ¬¡ã«ï¼ã¢ããªã±ã¼ã·ã§ã³ãæ§ç¯ãããã£ã¬ã¯ããªãä½æãï¼ã³ã³ãã£ã®ã¥ã¬ã¼
+ã·ã§ã³ã¹ã¯ãªãããå®è¡ããï¼ä¾ãã°ï¼ã¢ããªã±ã¼ã·ã§ã³ãæ§ç¯ãããã£ã¬ã¯
+ããªãï¼ASP3ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡ã¤ã«ãå±éãããã£ã¬ã¯ããªã®ä¸ã®APLã¨ã
+ãåç§°ã®ãã£ã¬ã¯ããªã«ããå ´åã«ã¯ï¼æ¬¡ã®ã³ãã³ããå®è¡ããï¼
+
+	% cd ..
+	% mkdir APL
+	% cd APL
+	% perl ../configure -T <ã¿ã¼ã²ããç¥ç§°> -L ../KERNEL_LIB
+	% make
+
+ããã§-Lãªãã·ã§ã³ã«ã¯ï¼ã«ã¼ãã«ãæ§ç¯ãããã£ã¬ã¯ããªã®ãã¹ãæå®ããï¼
+
+ãã®æé ã§ã¯ï¼ã¢ããªã±ã¼ã·ã§ã³æ§ç¯æã«ã¯ã«ã¼ãã«ã®åæ§ç¯ãå¿
+è¦ããã§ã
+ã¯ããªãããï¼ã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼ããä¿®æ­£ããå ´åã«ã¯ï¼ã«ã¼ãã«ãæ§ç¯
+ãããã£ã¬ã¯ããªã§make libkernel.aãåå®è¡ããå¿
+è¦ãããï¼
+
+ä»¥ä¸ã§ã¯ï¼ã«ã¼ãã«ã¨ã¢ããªã±ã¼ã·ã§ã³ãå¥ã
+ã®ãã£ã¬ã¯ããªã§æ§ç¯ãããï¼
+-Lãªãã·ã§ã³ã«ã«ã¬ã³ããã£ã¬ã¯ããªï¼ãã ãï¼"."ã¨ããè¨è¿°ã§ã¯ä¸å¯ï¼ãæ
+å®ãããã¨ã§ï¼ã«ã¼ãã«ã¨ã¢ããªã±ã¼ã·ã§ã³ãåããã£ã¬ã¯ããªã§å¥ã
+ã«æ§ç¯
+ãããã¨ãã§ããï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®æé ã¨ãªãï¼
+
+	% mkdir OBJ
+	% cd OBJ
+	% perl ../configure -T <ã¿ã¼ã²ããç¥ç§°> -L ../OBJ
+	% make libkernel.a
+	% make cleankernel
+	% make
+
+ããã§ï¼make cleankernelã¯ï¼ã«ã¼ãã«ã©ã¤ãã©ãªãçæããããã®ä¸­éãã¡
+ã¤ã«ãåé¤ãããã®ã§ããï¼ãã®æé ã§ã¯ï¼ã«ã¼ãã«ã©ã¤ãã©ãªã«é¢ããä¾å­
+é¢ä¿ãã¤ã³ã¯ã«ã¼ãããªãããï¼ã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼ããä¿®æ­£ããå ´åã«ã¯ï¼
+å¿
+ãmake cleankernelï¼ã¾ãã¯ï¼make cleanï¼ãã¦ããï¼make libkernel.aã
+ãå¿
+è¦ãããã®ã§æ³¨æãããã¨ï¼
+
+
+ï¼ï¼ãã£ã¬ã¯ããªæ§æã»ãã¡ã¤ã«æ§æ
+
+4.1 é
+å¸ããã±ã¼ã¸ã®ãã£ã¬ã¯ããªæ§æ
+
+	doc/			ãã­ã¥ã¡ã³ã
+	include/		ã¢ããªã±ã¼ã·ã§ã³åãããããã¡ã¤ã«
+	kernel/			ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡ã¤ã«
+	syssvc/			ã·ã¹ãã ãµã¼ãã¹ã®ããããã¡ã¤ã«ï¼ã½ã¼ã¹ãã¡ã¤ã«
+	library/		ãµãã¼ãã©ã¤ãã©ãªã®ã½ã¼ã¹ãã¡ã¤ã«
+	target/			ã¿ã¼ã²ããä¾å­é¨
+	arch/			ã¿ã¼ã²ããä¾å­é¨ã®å
+±éé¨å
+		gcc/		GCCéçºç°å¢ä¾å­é¨
+		logtrace/	ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ã
+	utils/			ã¦ã¼ãã£ãªãã£ãã­ã°ã©ã 
+	sample/			ãµã³ãã«ãã­ã°ã©ã ã¨Makefile
+	test/			ãã¹ããã­ã°ã©ã 
+	extension/		æ¡å¼µããã±ã¼ã¸
+
+4.2 ã¿ã¼ã²ããéä¾å­é¨ã®ãã¡ã¤ã«æ§æ
+
+ã¿ã¼ã²ããéä¾å­é¨ï¼ãã¹ããã­ã°ã©ã ã¨æ¡å¼µããã±ã¼ã¸ã¯é¤ãï¼ã®åãã¡ã¤
+ã«ã®æ¦è¦ã¯æ¬¡ã®éãï¼
+
+	README.txt			TOPPERS/ASP3ã«ã¼ãã«ã®ç°¡åãªç´¹ä»
+	configure			ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããï¼GNUéçºç°å¢ç¨ï¼
+	MANIFEST			åå¥ããã±ã¼ã¸ã®ãã¡ã¤ã«ãªã¹ã
+
+	doc/
+		user.txt			ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«
+		asp_spec.txt		TOPPERS/ASP3ã«ã¼ãã«ã®ä»æ§æ¦è¦
+		extension.txt		æ©è½æ¡å¼µã»ãã¥ã¼ãã³ã°ã¬ã¤ã
+		porting.txt			ã¿ã¼ã²ããä¾å­é¨ ãã¼ãã£ã³ã°ã¬ã¤ã
+		configurator.txt	ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ä»æ§
+		design.txt			è¨­è¨ã¡ã¢
+		version.txt			å¤æ´å±¥æ­´
+
+	include/
+		kernel.h		ASP3ã«ã¼ãã«ãä½¿ç¨ããããã®å®ç¾©
+		sil.h			ã·ã¹ãã ã¤ã³ã¿ãã§ã¼ã¹ã¬ã¤ã¤ãä½¿ç¨ããããã®å®ç¾©
+		t_stddef.h		TOPPERSå
+±éããããã¡ã¤ã«
+		itron.h			ITRONä»æ§å
+±éè¦å®ã®ãã¼ã¿åã»å®æ°ã»ãã¯ã­
+		t_syslog.h		ã·ã¹ãã ã­ã°åºåãè¡ãããã®å®ç¾©
+		t_stdlib.h		åºæ¬çãªã©ã¤ãã©ãªé¢æ°ãä½¿ç¨ããããã®å®ç¾©
+		queue.h			ã­ã¥ã¼æä½ã©ã¤ãã©ãªãä½¿ç¨ããããã®å®ç¾©
+		log_output.h	ã·ã¹ãã ã­ã°ã®ãã©ã¼ãããåºåãä½¿ç¨ããããã®å®ç¾©
+
+	kernel/
+		Makefile.kernel		ã«ã¼ãã«ã®ãã¡ã¤ã«æ§æã®å®ç¾©
+		kernel_impl.h		ã«ã¼ãã«å®è£
+ç¨æ¨æºããããã¡ã¤ã«
+		kernel_int.h		kernel_cfg.cç¨ã®ããããã¡ã¤ã«
+		kernel_rename.def	ã«ã¼ãã«ã®å
+é¨è­å¥åã®ãªãã¼ã å®ç¾©
+		kernel_rename.h		ã«ã¼ãã«ã®å
+é¨è­å¥åã®ãªãã¼ã 
+		kernel_unrename.h	ã«ã¼ãã«ã®å
+é¨è­å¥åã®ãªãã¼ã è§£é¤	
+		kernel_api.csv		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®éçAPIãã¼ãã«
+		kernel_def.csv		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®å¤åå¾ã·ã³ãã«ãã¼ãã«
+		kernel.tf			ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+		kernel_check.tf		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+		genoffset.tf		ãªãã»ãããã¡ã¤ã«çæç¨ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+		allfunc.h		ãã¹ã¦ã®é¢æ°ãã³ã³ãã¤ã«ããããã®å®ç¾©
+		check.h			ã¨ã©ã¼ãã§ãã¯ç¨ãã¯ã­
+		startup.c		ã«ã¼ãã«ã®åæåã¨çµäºå¦ç
+		task.h			ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«é¢é£ã®å®ç¾©
+		task.c			ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«
+		task.tf			ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+		taskhook.h		ã¿ã¹ã¯ç®¡çã«é¢é£ããããã¯ã«ã¼ãã³é¢é£ã®å®ç¾©
+		taskhook.c		ã¿ã¹ã¯ç®¡çã«é¢é£ããããã¯ã«ã¼ãã³
+		wait.h			å¾
+ã¡ç¶æ
+ç®¡çã¢ã¸ã¥ã¼ã«é¢é£ã®å®ç¾©
+		wait.c			å¾
+ã¡ç¶æ
+ç®¡çã¢ã¸ã¥ã¼ã«
+		time_event.h	ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«é¢é£ã®å®ç¾©
+		time_event.c	ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«
+		task_manage.c	ã¿ã¹ã¯ç®¡çæ©è½
+		task_refer.c	ã¿ã¹ã¯ã®ç¶æ
+åç
+§æ©è½
+		task_sync.c		ã¿ã¹ã¯ä»å±åææ©è½
+		task_term.c		ã¿ã¹ã¯çµäºæ©è½
+		semaphore.h		ã»ããã©æ©è½é¢é£ã®å®ç¾©
+		semaphore.c		ã»ããã©æ©è½
+		semaphore.tf	ã»ããã©æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+		eventflag.h		ã¤ãã³ããã©ã°æ©è½é¢é£ã®å®ç¾©
+		eventflag.c		ã¤ãã³ããã©ã°æ©è½
+		eventflag.tf	ã¤ãã³ããã©ã°æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+		dataqueue.h		ãã¼ã¿ã­ã¥ã¼æ©è½é¢é£ã®å®ç¾©
+		dataqueue.c		ãã¼ã¿ã­ã¥ã¼æ©è½
+		dataqueue.tf	ãã¼ã¿ã­ã¥ã¼æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+		pridataq.h		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½é¢é£ã®å®ç¾©
+		pridataq.c		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½
+		pridataq.tf		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+		mempfix.h		åºå®é·ã¡ã¢ãªãã¼ã«æ©è½é¢é£ã®å®ç¾©
+		mempfix.c		åºå®é·ã¡ã¢ãªãã¼ã«æ©è½
+		mempfix.tf		åºå®é·ã¡ã¢ãªãã¼ã«æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+		mutex.h			ãã¥ã¼ããã¯ã¹æ©è½é¢é£ã®å®ç¾©
+		mutex.c			ãã¥ã¼ããã¯ã¹æ©è½
+		mutex.tf		ãã¥ã¼ããã¯ã¹æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+		time_manage.c	ã·ã¹ãã æå»ç®¡çæ©è½
+		cyclic.h		å¨æéç¥æ©è½é¢é£ã®å®ç¾©
+		cyclic.c		å¨æéç¥æ©è½
+		cyclic.tf		å¨æéç¥æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+		alarm.h			ã¢ã©ã¼ã éç¥æ©è½é¢é£ã®å®ç¾©
+		alarm.c			ã¢ã©ã¼ã éç¥æ©è½
+		alarm.tf		ã¢ã©ã¼ã éç¥æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+		sys_manage.c	ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+		interrupt.h		å²è¾¼ã¿ç®¡çæ©è½é¢é£ã®å®ç¾©
+		interrupt.c		å²è¾¼ã¿ç®¡çæ©è½
+		interrupt.tf	å²è¾¼ã¿ç®¡çæ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+		exception.h		CPUä¾å¤ç®¡çæ©è½é¢é£ã®å®ç¾©
+		exception.c		CPUä¾å¤ç®¡çæ©è½
+		exception.tf	CPUä¾å¤ç®¡çæ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+
+	syssvc/
+		banner.h		ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºåã®ããã®å®ç¾©
+		banner.c		ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºå
+		banner.cfg		ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºåã®ã³ã³ãã£ã®ã¥ã¬ã¼
+						ã·ã§ã³ãã¡ã¤ã«
+		histogram.h		å®è¡æéåå¸éè¨ãµã¼ãã¹ãä½¿ç¨ããããã®å®ç¾©
+		histogram.c		å®è¡æéåå¸éè¨ãµã¼ãã¹
+		logtask.h		ã·ã¹ãã ã­ã°ã¿ã¹ã¯ãä½¿ç¨ããããã®å®ç¾©
+		logtask.c		ã·ã¹ãã ã­ã°ã¿ã¹ã¯
+		logtask.cfg		ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+		serial.h		ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ããä½¿ç¨ããããã®å®ç¾©
+		serial.c		ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ã
+		serial.cfg		ã·ãªã¢ã«ãã©ã¤ãã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+		syslog.h		ã·ã¹ãã ã­ã°æ©è½ãä½¿ç¨ããããã®å®ç¾©
+		syslog.c		ã·ã¹ãã ã­ã°æ©è½
+		syslog.cfg		ã·ã¹ãã ã­ã°æ©è½ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+		test_svc.h		ãã¹ããã­ã°ã©ã ç¨ãµã¼ãã¹ãä½¿ç¨ããããã®å®ç¾©
+		test_svc.c		ãã¹ããã­ã°ã©ã ç¨ãµã¼ãã¹
+
+	library/
+		log_output.c	ã·ã¹ãã ã­ã°ã®ãã©ã¼ãããåºå
+		strerror.c		ã¨ã©ã¼ã¡ãã»ã¼ã¸æå­åãè¿ãé¢æ°
+		t_perror.c		ã¨ã©ã¼ã¡ãã»ã¼ã¸ã®åºå
+		vasyslog.c		å¯å¤æ°å¼æ°ã®ã·ã¹ãã ã­ã°ã©ã¤ãã©ãª
+
+	arch/gcc/
+		tool_stddef.h	t_stddef.hã®éçºç°å¢ä¾å­é¨ï¼GCCç¨ï¼
+
+	arch/logtrace/
+		trace_config.h	ãã¬ã¼ã¹ã­ã°ã«é¢ããè¨­å®
+		trace_config.c	ãã¬ã¼ã¹ã­ã°æ©è½
+		trace_config.cfg ãã¬ã¼ã¹ã­ã°æ©è½ãçµã¿è¾¼ãããã®ã³ã³ãã£ã®ã¥
+						ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+		trace_dump.c	ãã¬ã¼ã¹ã­ã°ã®ãã³ã
+
+	utils/
+		applyrename		ãã¡ã¤ã«ã«ãªãã¼ã ãé©ç¨
+		genrename		ãªãã¼ã ããããã¡ã¤ã«ã®çæ
+		gentest			ãã¹ããã­ã°ã©ã ã®çæ
+		makerelease		é
+å¸ããã±ã¼ã¸ã®çæ
+		move-if-change	å
+å®¹ã«æ´æ°ããã£ãå ´åã®ãã¡ã¤ã«ã®ç½®æ
+
+	sample/
+		Makefile		ãµã³ãã«ã®Makefileï¼GNUéçºç°å¢ç¨ï¼
+		sample1.h		ãµã³ãã«ãã­ã°ã©ã (1)ã«é¢ããå®ç¾©
+		sample1.c		ãµã³ãã«ãã­ã°ã©ã (1)
+		sample1.cfg		ãµã³ãã«ãã­ã°ã©ã (1)ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+
+
+ï¼ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã®ä½¿ãæ¹
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããï¼configureï¼ã¯ï¼ASP3ã«ã¼ãã«ããã³ã¢ã
+ãªã±ã¼ã·ã§ã³ãã­ã°ã©ã ãæ§ç¯ããããã«å¿
+è¦ãªåºæ¬çãªã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§
+ã³ãè¡ãããã®ãã­ã°ã©ã ã§ããï¼
+
+ASP3ã«ã¼ãã«ãç¨ãã¦ã¢ããªã±ã¼ã·ã§ã³ãä½æããå ´åã«ã¯ï¼ã¾ããªãã¸ã§ã¯
+ããã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªãä½æãï¼ãã®ãã£ã¬ã¯ããªã§ã³ã³ãã£ã®ã¥ã¬ã¼
+ã·ã§ã³ã¹ã¯ãªãããå®è¡ããï¼ãªãã¸ã§ã¯ããã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªã®å ´
+æã¨åç§°ã¯ï¼ä»»æã«æ±ºãã¦ããï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã«å¯¾ãããªãã·ã§ã³ã¯æ¬¡ã®éãï¼
+
+	-T <ã¿ã¼ã²ããç¥ç§°>
+		ã¿ã¼ã²ããã·ã¹ãã ã®åç§°ãï¼targetãã£ã¬ã¯ããªã®ä¸ã«ç½®ããã¦ã
+		ãã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããªã®åç§°ã§æå®ããï¼å¿
+é ï¼ï¼
+
+	-a <ã¢ããªã±ã¼ã·ã§ã³ã®ãã£ã¬ã¯ããªå>
+		ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã®ã½ã¼ã¹ãã¡ã¤ã«ãç½®ãããã£ã¬ã¯ããª
+		åãæå®ããï¼çç¥ããå ´åã«ã¯ï¼sampleãã£ã¬ã¯ããªï¼ASP3ã«ã¼ã
+		ã«ã®ã½ã¼ã¹ãã¡ã¤ã«ãç½®ãããã£ã¬ã¯ããªã®ä¸ã®"sample"ï¼ã¨ãªãï¼
+		""ã§å²ããã¨ã«ãã£ã¦ï¼è¤æ°ã®ãã£ã¬ã¯ããªãæå®ãããã¨ãå¯è½ã§
+		ããï¼
+
+	-A <ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã å>
+		ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã®åç§°ãæå®ããï¼çç¥ããå ´åã«ã¯ï¼
+		ãµã³ãã«ãã­ã°ã©ã ï¼sample1ï¼ã¨ãªãï¼
+
+	-t
+		ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã®ã¡ã¤ã³ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ï¼ã¢ã
+		ãªã±ã¼ã·ã§ã³ãã­ã°ã©ã åã«".o"ãä»å ãããã®ï¼ããªã³ã¯å¯¾è±¡ã«å«
+		ããªãï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã å
+¨ä½ãTECSãç¨ãã¦éçºããå ´
+		åã«ä½¿ç¨ããï¼
+
+	-c <ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«å>
+		ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ï¼.cfgï¼ã®åç§°ãæå®ããï¼
+		çç¥ããå ´åã«ã¯ï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã åã«".cfg"ãä»å ã
+		ãåç§°ã¨ããï¼
+
+	-C <ã³ã³ãã¼ãã³ãè¨è¿°ãã¡ã¤ã«å>
+		ã³ã³ãã¼ãã³ãè¨è¿°ãã¡ã¤ã«ï¼.cdlï¼ã®åç§°ãæå®ããï¼çç¥ããå ´
+		åã«ã¯ï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã åã«".cdl"ãä»å ããåç§°ã¨ã
+		ãï¼
+
+	-U <ãªãã¸ã§ã¯ããã¡ã¤ã«å>
+		ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã®ã¡ã¤ã³ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ï¼ã¢ã
+		ãªã±ã¼ã·ã§ã³ãã­ã°ã©ã åã«".o"ãä»å ãããã®ï¼ä»¥å¤ã«ï¼ãªã³ã¯ã
+		ã¹ããªãã¸ã§ã¯ããã¡ã¤ã«ã®åç§°ãï¼".o"ãä»å ããå½¢ã§æå®ããï¼
+		""ã§å²ããã¨ã«ãã£ã¦ï¼è¤æ°ã®ãã¡ã¤ã«ãæå®ãããã¨ãå¯è½ã§ããï¼
+
+	-S <ãªãã¸ã§ã¯ããã¡ã¤ã«å>
+		ã·ã¹ãã ãµã¼ãã¹ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ã®åç§°ãï¼".o"ãä»å ãã
+		å½¢ã§æå®ããï¼""ã§å²ããã¨ã«ãã£ã¦ï¼è¤æ°ã®ãã¡ã¤ã«ãæå®ããã
+		ã¨ãå¯è½ã§ããï¼
+
+	-L <ã«ã¼ãã«ã©ã¤ãã©ãªã®ãã£ã¬ã¯ããªå>
+		äºåã«æ§ç¯ããã«ã¼ãã«ã©ã¤ãã©ãªï¼libkernel.aï¼ãç¨ãã¦ï¼ã¢ããª
+		ã±ã¼ã·ã§ã³ã®ã¿ãæ§ç¯ããå ´åã«ã¯ï¼ãã®ãªãã·ã§ã³ã«ã«ã¼ãã«ã©ã¤
+		ãã©ãªã®ç½®ããããã£ã¬ã¯ããªåãæå®ããï¼ãã®ãªãã·ã§ã³ã®ä½¿ç¨
+		ä¾ã«ã¤ãã¦ã¯ï¼ã3.5 ã¢ããªã±ã¼ã·ã§ã³ã¨ã«ã¼ãã«ãå¥ã
+ã«æ§ç¯ãã
+		æ¹æ³ãã®ç¯ãåç
+§ãããã¨ï¼
+
+	-f
+		ã«ã¼ãã«ãé¢æ°åä½ã§ã³ã³ãã¤ã«ãã©ã¤ãã©ãªåããå ´åã«ï¼ãã®ãª
+		ãã·ã§ã³ãæå®ããï¼ãã®ãªãã·ã§ã³ã®ä½¿ç¨ä¾ã«ã¤ãã¦ã¯ï¼ã3.4 ã«ã¼
+		ãã«ãé¢æ°åä½ã§ã©ã¤ãã©ãªåããæ¹æ³ãã®ç¯ãåç
+§ãããã¨ï¼
+
+	-D <ASP3ã«ã¼ãã«ã®ã½ã¼ã¹ãã£ã¬ã¯ããªå>
+		ASP3ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡ã¤ã«ãç½®ãããã£ã¬ã¯ããªåãæå®ããï¼
+		çç¥ããå ´åã«ã¯ï¼configureã®ç½®ããã¦ãããã£ã¬ã¯ããªã¨ãªãï¼
+
+	-l <ãã­ã°ã©ãã³ã°è¨èª>
+		ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã®è¨è¿°ã«ç¨ãããã­ã°ã©ãã³ã°è¨èªãæ
+		å®ããï¼ç¾æç¹ã§ã¯ï¼cã¨c++ã®ã¿ããµãã¼ããã¦ããï¼
+
+	-m <ãã³ãã¬ã¼ãMakefileå>
+		Makefileã®ãã³ãã¬ã¼ãã¨ãããã¡ã¤ã«åãæå®ããï¼çç¥ããå ´å
+		ã«ã¯ï¼sampleãã£ã¬ã¯ããªã®Makefileã¨ãªãï¼
+
+	-d <ä¾å­ç°å¢ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªå>
+		ä¾å­é¢ä¿ãã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªåãæå®ããï¼çç¥ããå ´åã«
+		ã¯ï¼"deps"ã¨ãªãï¼
+
+	-w
+		TECSãä½¿ç¨ããªãå ´åã«ï¼ãã®ãªãã·ã§ã³ãæå®ããï¼
+
+	-r
+		ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ããæå¹ã«ããå ´åã«ï¼ãã®ãªãã·ã§
+		ã³ãæå®ããï¼ãã®ãªãã·ã§ã³ã®ä½¿ç¨ä¾ã«ã¤ãã¦ã¯ï¼ã11.6 ãã¬ã¼ã¹
+		ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ãã®ä½¿ç¨æ¹æ³ãã®ç¯ãåç
+§ãããã¨ï¼
+
+	-V <éçºãã¼ã«ã®ãã£ã¬ã¯ããªå>
+		éçºãã¼ã«ãç½®ããã¦ãããã£ã¬ã¯ããªãæå®ããï¼éçºãã¼ã«ï¼ã³
+		ã³ãã¤ã©ç­ï¼ãçµ¶å¯¾ãã¹ã§æå®ããå ´åã«ç¨ããï¼
+
+	-p <perlã®ãã¹å>
+		perlã®ãã¹åãæå®ããï¼çç¥ããå ´åã«ã¯ï¼åã«"perl"ã¨ãªãï¼
+
+	-g <ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹å>
+		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ï¼cfgï¼ã®ãã¹åãæå®ããï¼çç¥ããå ´åã«ã¯ï¼
+		ããã©ã«ãã®ãã¹åï¼ASP3ã«ã¼ãã«ã®ã½ã¼ã¹ãã£ã¬ã¯ããªã®ä¸ã®
+		cfg/cfg/cfgï¼ã¨ãªãï¼
+
+	-G <TECSã¸ã§ãã¬ã¼ã¿ã®ãã¹å>
+		TECSã¸ã§ãã¬ã¼ã¿ï¼tecsgenï¼ã®ãã¹åãæå®ããï¼çç¥ããå ´åã«
+		ã¯ï¼"ruby $(SRCDIR)/tecsgen/tecsgen.rb"ã¨ãªãï¼
+
+	-P <ãã­ã»ããµæ°>
+		ãã«ããã­ã»ããµå¯¾å¿ã«ã¼ãã«ã®å ´åã«ï¼ãã­ã»ããµãæå®ããï¼
+
+	-o <ãªãã·ã§ã³æå­å>
+		ã³ã³ãã¤ã©ã«ä¸ãããªãã·ã§ã³æå­åã§ï¼ã·ã³ãã«å®ç¾©ä»¥å¤ã®ãã®ï¼
+		ã·ã³ãã«å®ç¾©ã®ãªãã·ã§ã³ã¯ï¼-Oãªãã·ã§ã³ãä½¿ç¨ããï¼ãªãã·ã§ã³
+		æå­åã«ã¹ãã¼ã¹ãå«ã¾ããå ´åã«ã¯ï¼"-O2 -Wall"ã®ããã«ï¼""ã§å²
+		ãã§è¨è¿°ããå¿
+è¦ãããï¼
+
+	-O <ãªãã·ã§ã³æå­å>
+		ã³ã³ãã¤ã©ã«ä¸ããã·ã³ãã«å®ç¾©ã®ããã®ãªãã·ã§ã³æå­åï¼ãªãã·ã§
+		ã³æå­åã«ã¹ãã¼ã¹ãå«ã¾ããå ´åã«ã¯ï¼"-DTEST -DPERF"ã®ããã«ï¼
+		""ã§å²ãã§è¨è¿°ããå¿
+è¦ãããï¼
+
+	-k <ãªãã·ã§ã³æå­å>
+		ãªã³ã«ã«ä¸ãããªãã·ã§ã³æå­åï¼ãªãã·ã§ã³æå­åã«ã¹ãã¼ã¹ãå«
+		ã¾ããå ´åã«ã¯ï¼""ã§å²ãã§è¨è¿°ããå¿
+è¦ãããï¼
+
+ãªãï¼åä¸ã®ãªãã·ã§ã³ãè¤æ°æå®ãã¦ã¯ãªããªãï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªãããè¡ãå¦çã¯æ¬¡ã®éãã§ããï¼
+
+(1) ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããªã®ãã§ãã¯
+
+ã¿ã¼ã²ããä¾å­é¨ãã£ã¬ã¯ããªï¼-Tãªãã·ã§ã³ã§æå®ï¼ãããããã§ãã¯ãï¼
+ãªãå ´åã«ã¯ã¨ã©ã¼ã¨ããï¼
+
+(2) Makefileã®çæ
+
+Makefileã®ãã³ãã¬ã¼ãï¼ããã©ã«ãã§ã¯ï¼sampleãã£ã¬ã¯ããªã«ãã
+Makefileï¼ãå
+ã«ï¼å¿
+è¦ãªç®æãæ¸ãæãã¦ï¼Makefileãçæããï¼
+
+(3) ä¾å­é¢ä¿ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®ä½æ
+
+ä¾å­é¢ä¿ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªï¼ããã©ã«ãã§ã¯ï¼"deps"ï¼ãä½æããï¼
+
+
+ï¼ï¼Makefileã®ä¿®æ­£æ¹æ³
+
+åã®ç« ã§èª¬æããããã«ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã«ä¸ãããªãã·ã§
+ã³ç­ããMakefileãçæããããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã§å¯¾å¿
+ã§ããªãå ´åã«ã¯ï¼Makefileãç´æ¥ä¿®æ­£ããå¿
+è¦ãããï¼ããã§ã¯ï¼Makefile
+ã®ä¸­ã§ï¼ä¿®æ­£ãå¿
+è¦ã¨ãªãå¯è½æ§ã®é«ãç®æã«ã¤ãã¦èª¬æããï¼
+
+ãªãï¼Makefileãä¿®æ­£ããå¾ã«ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªãããåå®è¡ã
+ãã¨ï¼ä¿®æ­£ããMakefileãä¸æ¸ãããã¦ãã¾ãã®ã§æ³¨æãããã¨ï¼å¤ããã®ã
+Makefile.bakã«ä¿å­ãããï¼ï¼
+
+6.1 Makefileã®å¤æ°å®ç¾©
+
+(A) ãªãã¸ã§ã¯ããã¡ã¤ã«ã®æ¡å¼µå­
+
+ã­ã¼ãã¢ã¸ã¥ã¼ã«ã®ãã¡ã¤ã«åã«æ¡å¼µå­ãä»å ãããå ´åã«ã¯ï¼OBJEXTã«æ¡å¼µ
+å­ãå®ç¾©ããå¿
+è¦ãããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã¯ï¼Cygwinç°å¢
+ã§ããã¨å¤å®ããå ´åã«ï¼OBJEXTã"exe"ã«å®ç¾©ããï¼
+
+(B) ã­ã¼ãã¢ã¸ã¥ã¼ã«ã®ãã¡ã¤ã«å
+
+æ¨æºã®ã­ã¼ãã¢ã¸ã¥ã¼ã«ã®ãã¡ã¤ã«åãOBJNAMEã«å®ç¾©ããï¼ããã©ã«ãã¯asp
+ã§ããï¼
+
+(C) å
+±éã³ã³ãã¤ã«ãªãã·ã§ã³
+
+ãã¹ã¦ã®ãã­ã°ã©ã ã«å
+±éããã³ã³ãã¤ã«ãªãã·ã§ã³ã®è¿½å ãå¿
+è¦ãªå ´åã«ã¯ï¼
+ä¸ã®å¤æ°ã®å®ç¾©ãå¤æ´ããï¼ãã®ã³ã³ãã¤ã«ãªãã·ã§ã³ãï¼ç¹å®ã®ã¿ã¼ã²ãã
+ã§å¸¸ã«å¿
+è¦ãªå ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­ã®å®ç¾©ãå
+¥ããMakefile.targetç­ãä¿®
+æ­£ãã¹ãã§ããï¼
+
+	CDEFS		ã³ã³ãã¤ã©ã«å¯¾ãã-Dãªãã·ã§ã³ãè¨è¿°ããï¼
+	INCLUDES	ã³ã³ãã¤ã©ã«å¯¾ãã-Iãªãã·ã§ã³ãè¨è¿°ããï¼
+	COPTS		ã³ã³ãã¤ã©ã«å¯¾ãããã®ä»ã®ãªãã·ã§ã³ãè¨è¿°ããï¼
+	LDFLAGS		ãªã³ã«ã«å¯¾ãããªãã·ã§ã³ãè¨è¿°ããï¼
+	LIBS		ã©ã¤ãã©ãªãªã³ã¯ã®ããã®ãªãã·ã§ã³ãè¨è¿°ããï¼
+
+ãã®å
+ï¼CDEFSï¼COPTSï¼LDFLAGSã¯ï¼ããããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãª
+ããã®-Oãªãã·ã§ã³ï¼-oãªãã·ã§ã³ï¼-kãªãã·ã§ã³ã§è¿½å è¨­å®ãããã¨ãã§ã
+ãï¼
+
+è¿½å ã®å¯è½æ§ã®ããã³ã³ãã¤ã«ãªãã·ã§ã³ã«ã¤ãã¦ã¯ï¼ã6.2 ã³ã³ãã¤ã«ãªã
+ã·ã§ã³ãã®ç¯ãåç
+§ã®ãã¨ï¼
+
+(D) ã¢ããªã±ã¼ã·ã§ã³ã®ãªãã¸ã§ã¯ããã¡ã¤ã«å
+
+ã¢ããªã±ã¼ã·ã§ã³ãæ§æãããªãã¸ã§ã¯ããã¡ã¤ã«åãï¼è¨è¿°è¨èªã«å¿ãã¦ï¼
+APPL_ASMOBJSï¼APPL_COBJSï¼APPL_CXXOBJSã«åæããï¼ãã®å
+ï¼APPL_COBJSã
+APPL_CXXOBJSã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã®-Aãªãã·ã§ã³ã§è¨­å®ã
+ãï¼-Uãªãã·ã§ã³ã§è¿½å è¨­å®ãããã¨ãã§ããï¼
+
+(E) ã¢ããªã±ã¼ã·ã§ã³ã®ã³ã³ãã¤ã«ãªãã·ã§ã³
+
+ã¢ããªã±ã¼ã·ã§ã³ã®ã³ã³ãã¤ã«ã«å¿
+è¦ãªã³ã³ãã¤ã«ãªãã·ã§ã³ãããå ´åã«ã¯ï¼
+APPL_CFLAGSã«å®ç¾©ããï¼ãªãï¼APPL_CFLAGSã«å®ç¾©ãããªãã·ã§ã³ã¯ï¼ã³ã³ãã£
+ã®ã¥ã¬ã¼ã¿ãçæãããã¡ã¤ã«ãã³ã³ãã¤ã«ããå ´åã«ã¯é©ç¨ãããªãããï¼
+æ³¨æãããã¨ï¼
+
+(F) ã·ã¹ãã ãµã¼ãã¹ã®ãã£ã¬ã¯ããª
+
+ã·ã¹ãã ãµã¼ãã¹ã®ã½ã¼ã¹ãã¡ã¤ã«ãç½®ãããã£ã¬ã¯ããªãï¼SYSSVC_DIRSã«å®
+ç¾©ããï¼
+
+(G) ã·ã¹ãã ãµã¼ãã¹ã®ãªãã¸ã§ã¯ããã¡ã¤ã«å
+
+ã·ã¹ãã ãµã¼ãã¹ãæ§æãããªãã¸ã§ã¯ããã¡ã¤ã«åãï¼è¨è¿°è¨èªã«å¿ãã¦ï¼
+SYSSVC_ASMOBJSã¨SYSSV_COBJSã«åæããï¼ãã®å
+ï¼SYSSVC_COBJã¯ï¼ã³ã³ãã£
+ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã®-Sãªãã·ã§ã³ã§è¿½å è¨­å®ãããã¨ãã§ããï¼
+
+(H) ã·ã¹ãã ãµã¼ãã¹ã®ã³ã³ãã¤ã«ãªãã·ã§ã³
+
+ã·ã¹ãã ãµã¼ãã¹ã®ã³ã³ãã¤ã«ã«å¿
+è¦ãªã³ã³ãã¤ã«ãªãã·ã§ã³ãããå ´åã«ã¯ï¼
+SYSSVC_CFLAGSã«å®ç¾©ããï¼ãªãï¼SYSSVC_CFLAGSã«å®ç¾©ãããªãã·ã§ã³ã¯ï¼ã³
+ã³ãã£ã®ã¥ã¬ã¼ã¿ãçæãããã¡ã¤ã«ãã³ã³ãã¤ã«ããå ´åã«ã¯é©ç¨ãããªã
+ããï¼æ³¨æãããã¨ï¼
+
+(I) ã¿ã¼ã²ãããã¡ã¤ã«ã®å®ç¾©
+
+ã¿ã¼ã²ãã"all"ã®ä¾å­ãã¡ã¤ã«ã¨ãã¦ï¼ã­ã¼ãã¢ã¸ã¥ã¼ã«ã®å½¢å¼ãæå®ããï¼
+å
+·ä½çã«ã¯ï¼ELFå½¢å¼ã®æã¯$(OBJFILE)ï¼ãã¤ããªå½¢å¼ã®æã¯$(OBJNAME).binï¼
+ã¢ãã­ã¼ã© Så½¢å¼ã®æã¯$(OBJNAME).srecãæå®ããï¼$(OBJFILE)ã¯ï¼OBJEXTã
+å®ç¾©ããå ´åã«ã¯$(OBJNAME).$(OBJEXT)ï¼ããã§ãªãå ´åã«ã¯$(OBJNAME)ã¨ãª
+ãï¼
+
+6.2 ã³ã³ãã¤ã«ãªãã·ã§ã³
+
+ASP3ã«ã¼ãã«ã®ã³ã¼ãä¸­ã«ã¯ï¼assertãã¯ã­ãä½¿ããã¦ããï¼assertãã¯ã­ã¯ï¼
+NDEBUGãå®ç¾©ãããã¨ã§ï¼ãªãã¸ã§ã¯ãã³ã¼ãä¸­ããæ¶ããã¨ãã§ããï¼ã«ã¼
+ãã«ã®ãããã°ãçµäºããã°ï¼-DNDEBUGãæå®ãã¦ã³ã³ãã¤ã«ããæ¹ãå¹çã
+ãããªãï¼
+
+ã¿ã¼ã²ããä¾å­é¨ã«ããã¦ï¼ã³ã³ãã¤ã«ãªãã·ã§ã³ã«-Werrorï¼è­¦åãã¨ã©ã¼æ±
+ãããï¼ãæå®ãã¦ããå ´åãããï¼ãã®ãããªã¿ã¼ã²ããã«ããã¦ï¼ã¢ããª
+ã±ã¼ã·ã§ã³ã§è­¦åãé¿ããããªãå ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ãä¿®æ­£ãã¦ã³ã³
+ãã¤ã«ãªãã·ã§ã³ãåé¤ããå¿
+è¦ãããï¼
+
+TOPPERS_OMIT_SYSLOGãå®ç¾©ãã¦ã³ã³ãã¤ã«ãããã¨ã§ï¼ã·ã¹ãã ã­ã°åºåãæ
+æ­¢ãããã¨ãã§ããï¼
+
+
+ï¼ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ä½¿ãæ¹
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ï¼cfgï¼ã¯ï¼TOPPERSç¬¬3ä¸ä»£ã«ã¼ãã«ï¼ITRONç³»ï¼çµ±åä»æ§
+æ¸ã®2.12.5ç¯ã®è¨è¿°ã®éãï¼3ã¤ã®ãã¹ã§æ§æãããï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«åããã©ã¡ã¼
+ã¿ã«åãï¼ä»¥ä¸ã®ãªãã·ã§ã³ãæã¤ï¼éè¦ãªãã®ã®ã¿ï¼ï¼
+
+	--help
+		ãªãã·ã§ã³ã®ãªã¹ãã¨èª¬æãè¡¨ç¤ºããï¼
+
+	-vï¼»--versionï¼½
+		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¼ã¸ã§ã³ãè¡¨ç¤ºããï¼
+
+	-kï¼»--kernelï¼½<ã«ã¼ãã«å>
+		ã«ã¼ãã«ã®åç§°ãæå®ããï¼ããã©ã«ãã¯aspï¼
+
+	-pï¼»--passï¼½<ãã¹çªå·>
+		ãã¹çªå·ãæå®ããï¼1ã3ã®ããããï¼
+
+	-Iï¼»--include-pathï¼½<ã¤ã³ã¯ã«ã¼ããã¹å>
+		INCLUDEãã£ã¬ã¯ãã£ãã«ããã¦ï¼ã¤ã³ã¯ã«ã¼ãããã³ã³ãã£ã®ã¥ã¬ã¼
+		ã·ã§ã³ãã¡ã¤ã«ãæ¢ããã¹åãæå®ããï¼
+
+	-Tï¼»--template-fileï¼½<ãã³ãã¬ã¼ããã¡ã¤ã«å>
+		ãã³ãã¬ã¼ããã¡ã¤ã«ã®åç§°ãæå®ããï¼ãã¹2ã¨ãã¹3ã§æå¹ï¼
+
+	--api-table <éçAPIãã¼ãã«ãã¡ã¤ã«å>
+		éçAPIãã¼ãã«ã®ãã¡ã¤ã«åãæå®ããï¼
+
+	--cfg1-def-table <å¤åå¾ã·ã³ãã«ãã¼ãã«ãã¡ã¤ã«å>
+		å¤åå¾ã·ã³ãã«ãã¼ãã«ã®ãã¡ã¤ã«åãæå®ããï¼
+
+	-rï¼»--rom-imageï¼½<ã­ã¼ãã¢ã¸ã¥ã¼ã«å>
+		ã­ã¼ãã¢ã¸ã¥ã¼ã«ãSã¬ã³ã¼ããã©ã¼ãããã®å½¢ã«å¤æãããã¡ã¤ã«ã®
+		åç§°ãæå®ããï¼ãã¹3ã§ã®ã¿æå¹ï¼
+
+	-s [--symbol-table] <ã·ã³ãã«ãã¡ã¤ã«å>
+		ã­ã¼ãã¢ã¸ã¥ã¼ã«ä¸­ã®åã·ã³ãã«ã¨ã¢ãã¬ã¹ã®å¯¾å¿è¡¨ãå«ãã·ã³ãã«
+		ãã¡ã¤ã«ã®åç§°ãæå®ããï¼ãã¹3ã§ã®ã¿æå¹ï¼
+
+	--id-output-file <IDçªå·åºåãã¡ã¤ã«å>
+		ãªãã¸ã§ã¯ãã®IDçªå·ã®å²ä»ãçµæãï¼æå®ããååã®ãã¡ã¤ã«ã«æ¸
+		ãåºãï¼ãã¹2ã§ã®ã¿æå¹ï¼
+
+	--id-input-file <IDçªå·å
+¥åãã¡ã¤ã«å>
+		ãªãã¸ã§ã¯ãã®IDçªå·ã®å²ä»ããï¼æå®ããååã®ãã¡ã¤ã«ããåã
+		è¾¼ãï¼ãã¹2ã§ã®ã¿æå¹ï¼
+
+	--external-id
+		ãªãã¸ã§ã¯ãã®IDçªå·ãä¿æããå¤æ°ã®å®ç¾©ãçæããï¼ãã¹2ã§ã®ã¿
+		æå¹ï¼
+
+	-Mï¼»--print-dependenciesï¼½<ã¿ã¼ã²ããã·ã³ãã«>
+		ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã®ä¾å­é¢ä¿ãåºåããï¼
+		Makefileä¸­ã®ä¾å­é¢ä¿ãçæããéã«ç¨ããï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®è©³ç´°ä»æ§ã«ã¤ãã¦ã¯ï¼å¥éPDFãã¡ã¤ã«ã®å½¢ã§é
+å¸ãã¦ã
+ããTOPPERSæ°ä¸ä»£ã«ã¼ãã«ç¨ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ä»æ§ããåç
+§ãããã¨ï¼
+
+
+ï¼ï¼ã·ã¹ãã ãµã¼ãã¹
+
+8.1 ã·ã¹ãã ã­ã°æ©è½
+
+ã·ã¹ãã ã­ã°æ©è½ã¯ï¼ã«ã¼ãã«å
+ã§çºçããç°å¸¸äºè±¡ããã¬ã¼ã¹ã­ã°ï¼ã·ã¹ã
+ã ãµã¼ãã¹ãã¢ããªã±ã¼ã·ã§ã³ã§çºçããç°å¸¸äºè±¡ããã¬ã¼ã¹ã­ã°ãï¼ã­ã°æ
+
+å ±ã¨ãã¦è¨é²ããããã®æ©è½ã§ããï¼ã¾ãï¼è¨é²ããã­ã°æ
+å ±ãåãåºãæ©è½
+ãæã¤ï¼
+
+ã·ã¹ãã ã­ã°æ©è½ã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã§syslog.cfg
+ãã¤ã³ã¯ã«ã¼ããããã¨ã§ï¼ã·ã¹ãã ã«çµã¿è¾¼ããã¨ãã§ããï¼ã·ã¹ãã ã­ã°
+åºåãè¡ãã½ã¼ã¹ãã¡ã¤ã«ã§ã¯ï¼t_syslog.hãã¤ã³ã¯ã«ã¼ãããï¼ã¾ãï¼ã·ã¹
+ãã ã­ã°æ©è½ã®ãã®ä»ã®ãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºãã½ã¼ã¹ãã¡ã¤ã«ã§ã¯ï¼
+syslog.hãã¤ã³ã¯ã«ã¼ãããï¼
+
+8.1.1 ã·ã¹ãã ã­ã°æ©è½ã®ä½ç½®ä»ã
+
+ã·ã¹ãã ã­ã°æ©è½ã¯ï¼ã«ã¼ãã«å
+ãããå¼ã³åºããã¨ãã§ããããï¼ã«ã¼ãã«
+ããä¸ã®éå±¤ã®ã¢ã¸ã¥ã¼ã«ã¨ä½ç½®ä»ãããã¨ãã§ããï¼ãã®æå³ã§ã¯ï¼ä»ã®ã·
+ã¹ãã ãµã¼ãã¹ã¨ã¯ä½ç½®ä»ããç°ãªãï¼
+
+ä¸æ¹ï¼ã­ã°æ
+å ±ãã·ã¹ãã å¤é¨ã«åºåããããã«ã¯ï¼ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹
+ãã©ã¤ããªã©ï¼ã«ã¼ãã«ä¸ã§åä½ããã·ã¹ãã ãµã¼ãã¹ãç¨ããå¿
+è¦ãããï¼
+ããã§ï¼ã­ã°æ
+å ±ãã·ã¹ãã å¤é¨ã«åºåããããã®ãµã¼ãã¹ï¼ãããï¼ã·ã¹ã
+ã ã­ã°ã¿ã¹ã¯ã¨å¼ã¶ï¼ã¯ï¼ã·ã¹ãã ã­ã°æ©è½ã¨ã¯åé¢ãã¦å®è£
+ãããã¨ã¨ãï¼
+ã·ã¹ãã ã­ã°æ©è½ã¯ã­ã°æ
+å ±ã®è¨é²ã»ååºãã®ããã®æ©è½ã«çµã£ã¦ããï¼
+
+ä»¥ä¸ã®ããã«ï¼ã·ã¹ãã ã­ã°æ©è½ã¯ã«ã¼ãã«ããä¸ã®éå±¤ã®ã¢ã¸ã¥ã¼ã«ã§ãã
+ãï¼ã·ã¹ãã ã­ã°æ©è½ã®ä¸­ã§ã­ã°æå»ãåãåºãããã«ï¼ã«ã¼ãã«ã®æ©è½ãå¿
+
+è¦ã¨ããï¼å®è£
+ä¸ã¯ï¼ã«ã¼ãã«ã®å
+é¨å¤æ°ãç´æ¥åç
+§ãã¦ããï¼ãã®ããï¼ã«ã¼
+ãã«ã®å®è¡éå§åãçµäºå¾ã¯ï¼ã­ã°æå»ã¯æ­£ããè¨é²ãããªãï¼
+
+8.1.2 ã­ã°ãããã¡ã¸ã®è¨é²ã¨ä½ã¬ãã«åºå
+
+ä¸è¿°ããããã«ï¼ã­ã°æ
+å ±ãã·ã¹ãã ã®å¤é¨ã«åºåããããã«ã¯ï¼ã«ã¼ãã«ä¸
+ã§åä½ããã·ã¹ãã ãµã¼ãã¹ãç¨ããå¿
+è¦ãããããï¼ã«ã¼ãã«ã®åä½ãç¶ç¶
+ã§ããªããããªéå¤§ãªç°å¸¸äºè±¡ãèµ·ãã£ãå ´åã«ã¯ï¼ã­ã°æ
+å ±ãåºåã§ããªã
+ãªãï¼ã¾ãï¼ãããã®ã·ã¹ãã ãµã¼ãã¹èªèº«ããããã°ããå ´åã«ãï¼ã­ã°æ
+
+å ±ã®åºåãã§ããªãï¼
+
+ããã§ï¼ã«ã¼ãã«ä¸ã§åä½ããã·ã¹ãã ãµã¼ãã¹ãä½¿ããªãå ´åã«ã§ãã­ã°æ
+
+å ±ãåºåããããã«ï¼ä½ã¬ãã«åºåæ©è½ãç¨æããï¼ä½ã¬ãã«åºåæ©è½ã¯ï¼ã¿ã¼
+ã²ããä¾å­ã«ç¨æããä½ã¬ãã«ã®æå­åºåé¢æ°ãç¨ãã¦ã­ã°æ
+å ±ãåºåããæ©
+è½ã§ããï¼ä½ã¬ãã«ã®æå­åºåé¢æ°ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ç¨æãããã¨ã¨ã
+ã¦ãããï¼æçµè£½åã«çµã¿è¾¼ã¾ããå ´åãªã©ã§ã¯ï¼æå­ãåºåããæ¹æ³ããªã
+ç¶æ³ãèããããï¼ãã®ãããªå ´åï¼ä½ã¬ãã«ã®æå­åºåé¢æ°ã«éãããæå­
+ã¯ï¼ã¡ã¢ãªä¸ã«æ®ãã¦ãããï¼æ¨ã¦ã¦ãã¾ããããªãï¼
+
+ã­ã°æ
+å ±ãï¼ã­ã°ãããã¡ã¸è¨é²ãããä½ã¬ãã«åºåæ©è½ãç¨ãã¦åºåããã
+ã®è¨­å®ã¯ï¼ã·ã¹ãã ã­ã°æ©è½ã®ãµã¼ãã¹ã³ã¼ã«ï¼syslog_msk_logï¼ã«ãã£ã¦è¡
+ããã¨ãã§ããï¼syslog_msk_logã®ä½¿ãæ¹ã«ã¤ãã¦ã¯å¾è¿°ããï¼ããã©ã«ãã§
+ã¯ï¼ã·ã¹ãã ã­ã°ã¿ã¹ã¯ãåä½ãããï¼syslog_msk_logãå¼ã³åºããªãå ´åï¼ï¼
+ãã¹ã¦ã®ã­ã°æ
+å ±ãä½ã¬ãã«åºåæ©è½ãç¨ãã¦åºåãï¼ã­ã°ãããã¡ã«ã¯è¨é²
+ããªãï¼
+
+ä½ã¬ãã«åºåæ©è½ãç¨ããã¨ï¼ã­ã°ã¡ãã»ã¼ã¸ã®ä½æå¦çï¼printfç¸å½ã®å¦çï¼
+ã¨ä½ã¬ãã«ã®æå­åºåå¦çãã«ã¼ãã«å
+ã§è¡ãããã«ï¼ã«ã¼ãã«ã®å¿ç­æ§ãæª
+ããªããã¨ã«æ³¨æããªããã°ãªããªãï¼ç¹ã«ï¼ä½ã¬ãã«ã®æå­åºåå¦çã¯ãã
+ã¤ã¹ããã¼ãªã³ã°ããå½¢ã§å®è£
+ããã®ãéå¸¸ã§ï¼ãã®å ´åã«ã¯ï¼ã«ã¼ãã«ã®å¿
+ç­æ§ã¯å®ç¨çã¨è¨ããªãç¨ã«æªããªãï¼
+
+8.1.3 ã­ã°æ
+å ±ã®ç¨®å¥
+
+ã·ã¹ãã ã­ã°æ©è½ã¯ï¼ã­ã°æ
+å ±ã«ä»¥ä¸ã®ç¨®å¥ãè¨­ãã¦ããï¼
+
+		LOG_TYPE_COMMENT	ã³ã¡ã³ã
+		LOG_TYPE_ASSERT		ã¢ãµã¼ã·ã§ã³ã®å¤±æ
+		LOG_TYPE_INH		å²è¾¼ã¿ãã³ãã©
+		LOG_TYPE_ISR		å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+		LOG_TYPE_CYC		å¨æãã³ãã©
+		LOG_TYPE_ALM		ã¢ã©ã¼ã ãã³ãã©
+		LOG_TYPE_OVR		ãªã¼ãã©ã³ãã³ãã©
+		LOG_TYPE_EXC		CPUä¾å¤ãã³ãã©
+		LOG_TYPE_TEX		ã¿ã¹ã¯ä¾å¤å¦çã«ã¼ãã³
+		LOG_TYPE_TSKSTAT	ã¿ã¹ã¯ç¶æ
+å¤å
+		LOG_TYPE_DSP		ãã£ã¹ãããã£
+		LOG_TYPE_SVC		ãµã¼ãã¹ã³ã¼ã«
+
+ã­ã°æ
+å ±ã®ç¨®å¥ã®ä¸­ã§ï¼LOG_TYPE_COMMENTã¨LOG_TYPE_ASSERTä»¥å¤ã¯ï¼ã«ã¼ãã«
+ã®ãã¬ã¼ã¹ã­ã°ã«ç¨ããããã®ãã®ã§ãããï¼ä½¿ç¨ãããã©ããã¯ã¿ã¼ã²ãã
+ä¾å­é¨ã«ä»»ããã¦ããï¼
+
+8.1.4 ã­ã°æ
+å ±ã®éè¦åº¦
+
+ã·ã¹ãã ã­ã°æ©è½ã¯ï¼ã­ã°æ
+å ±ãåºåããéã«æå®ããéè¦åº¦ã«åºã¥ãã¦ï¼å®
+éã«åºåããã­ã°æ
+å ±ãåçã«è¨­å®ãããã¨ãã§ããï¼ããã¯ï¼UNIXã®ã·ã¹ã
+ã ã­ã°æ©è½ãã¾ã­ããã®ã§ï¼ã­ã°ã®éè¦åº¦ã®ç¨®é¡ãæå®æ¹æ³ãUNIXã®APIãåè
+ã«ãã¦ããï¼ã¾ãï¼ä½ã¬ãã«åºåæ©è½ãç¨ãã¦åºåããã­ã°æ
+å ±ãï¼éè¦åº¦ã«
+åºã¥ãã¦åçã«è¨­å®ãããã¨ãã§ããï¼
+
+å
+·ä½çã«ã¯ï¼ã­ã°ã®éè¦åº¦ã¨ãã¦æ¬¡ã®8æ®µéãç¨æãã¦ããï¼
+
+		LOG_EMERG		ã«ã¼ãã«ã®åä½ãç¶ç¶ã§ããªãã¨ã©ã¼
+		LOG_ALERT
+		LOG_CRIT
+		LOG_ERROR		éè¦æ§ã®ä½ãã·ã¹ãã ã¨ã©ã¼
+		LOG_WARNING		è­¦åã¡ãã»ã¼ã¸ï¼ã·ã¹ãã ã¯å®å
+¨ã«ç¶ç¶åä½ã§ãã
+		LOG_NOTICE
+		LOG_INFO
+		LOG_DEBUG		ãããã°ã®ããã®ã¡ãã»ã¼ã¸
+
+ã©ã®éè¦åº¦ã®ã­ã°æ
+å ±ãã­ã°ãããã¡ã«è¨é²ãããã¨ï¼ã©ã®éè¦åº¦ã®ã­ã°æ
+å ±
+ãä½ã¬ãã«åºåæ©è½ãç¨ãã¦åºåãããã¯ï¼ã·ã¹ãã ã­ã°æ©è½ã®ãµã¼ãã¹ã³ã¼
+ã«ï¼syslog_msk_logï¼ã«ãã£ã¦è¨­å®ãããã¨ãã§ããï¼
+
+8.1.5 ã­ã°æ
+å ±ã®ãã¼ã¿æ§é 
+
+ã­ã°æ
+å ±ãæ ¼ç´ããããã®ãã¼ã¿åã¨ãã¦ï¼SYSLOGæ§é ä½ãç¨æãã¦ããï¼
+SYSLOGæ§é ä½ã«ã¯ï¼ã­ã°æ
+å ±ã®ç¨®å¥ï¼logtypeãã£ã¼ã«ãï¼ï¼ã­ã°æå»
+ï¼logtimãã£ã¼ã«ãï¼ã¨6ã¤ã®ã­ã°ãã©ã¡ã¼ã¿ï¼logparãã£ã¼ã«ãï¼ãå«ã¾ããï¼
+
+ã­ã°æå»ã®ãã¼ã¿åï¼LOGTIMï¼ã¨ã­ã°ãã©ã¡ã¼ã¿ã®ãã¼ã¿åï¼LOGPARï¼ã¯ï¼æ¨
+æºã§ã¯ããããHRTCNTï¼é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã®ãã¼ã¿åï¼ã¨intptr_t
+ã«å®ç¾©ããã¦ãããï¼ã¿ã¼ã²ããä¾å­é¨ï¼target_stddef.hã¾ãã¯ããããã¤ã³
+ã¯ã«ã¼ãããããã¡ã¤ã«ï¼ã«ããå¤æ´ãããã¨ãã§ããï¼
+
+SYSLOGæ§é ä½ã«æ ¼ç´ãããã­ã°æ
+å ±ãåºåããå ´åï¼ã­ã°æå»ï¼logtimãã£ã¼
+ã«ãï¼ã¯åºåé¢æ°ï¼syslog_wri_logï¼ã«ãã£ã¦æ¸ãè¾¼ã¾ããããï¼åºåé¢æ°ã
+å¼ã¶å´ã§æ¸ãè¾¼ãå¿
+è¦ã¯ãªãï¼
+
+8.1.6 ã·ã¹ãã ã­ã°æ©è½ã®ãµã¼ãã¹ã³ã¼ã«
+
+ã·ã¹ãã ã­ã°æ©è½ã®æä¾ãããµã¼ãã¹ã³ã¼ã«ã¯æ¬¡ã®éãã§ããï¼ãããã®ãµã¼
+ãã¹ã³ã¼ã«ãå¼ã³åºãã½ã¼ã¹ãã¡ã¤ã«ã§ã¯ï¼syslog.hãã¤ã³ã¯ã«ã¼ãããå¿
+è¦
+ãããï¼
+
+(1) ER syslog_wri_log(uint_t prio, const SYSLOG *p_syslog)
+
+ã·ã¹ãã ã­ã°æ©è½ã«ï¼p_syslogã§æå®ãããã­ã°æ
+å ±ãï¼prioã§æå®ãããé
+è¦åº¦ã§åºåããï¼ã­ã°ãããã¡ã¸è¨é²ãããä½ã¬ãã«åºåæ©è½ãç¨ãã¦åºåã
+ãï¼ï¼
+
+ãã­ãã¿ã¤ãå®£è¨ã«ããã¦ï¼*p_syslogã«constæå®ãããã¦ãããï¼å®éã«ã¯ï¼
+ãã®é¢æ°ã®ä¸­ã§ï¼*p_syslogã®logtimãã£ã¼ã«ãã«ã·ã¹ãã æå»ãæ¸ãè¾¼ãã§ã
+ãï¼
+
+(2) ER_UINT syslog_rea_log(SYSLOG *p_syslog)
+
+ã­ã°ãããã¡ããã­ã°æ
+å ±ã1ã¤åãåºãï¼ã­ã°ãããã¡ãç©ºã®æã¯E_OBJï¼ã
+ãã§ãªãå ´åã¯ï¼ã­ã°ãããã¡ã®ãªã¼ããã­ã¼ã«ããå¤±ãããã­ã°æ
+å ±ã®æ°
+ï¼ã­ã°æ
+å ±ãå¤±ããã¦ããªãå ´åã¯0ï¼ãè¿ãï¼ã·ã¹ãã ã­ã°ã¿ã¹ã¯ãç¨ããã
+ã¨ãæ³å®ãã¦ããï¼
+
+(3) ER syslog_msk_log(uint_t logmask, uint_t lowmask)
+
+ã­ã°ãããã¡ã«è¨é²ãã¹ãã­ã°æ
+å ±ã®éè¦åº¦ã®ç¤ºãããããããï¼logmaskï¼ã¨ï¼
+ä½ã¬ãã«åºåæ©è½ãç¨ãã¦åºåãã¹ãã­ã°æ
+å ±ã®éè¦åº¦ãç¤ºããããããã
+ï¼lowmaskï¼ãè¨­å®ããï¼ãããããããä½ãããã®ãã¯ã­ã¨ãã¦ï¼LOG_MASKã¨
+LOG_UPTOãç¨æãã¦ããï¼
+
+(4) ER syslog_ref_log(T_SYSLOG_RLOG *pk_rlog)
+
+ã·ã¹ãã ã­ã°æ©è½ã®ç¶æ
+ãåç
+§ããï¼å
+·ä½çã«ã¯ï¼ã­ã°ãããã¡ã«è¨é²ããã¦
+ããã­ã°æ
+å ±ã®æ°ï¼T_SYSLOG_RLOGæ§é ä½ã®countãã£ã¼ã«ãï¼ï¼ã­ã°ãããã¡
+ã®ãªã¼ããã­ã¼ã«ããå¤±ãããã­ã°æ
+å ±ã®æ°ï¼lostãã£ã¼ã«ãï¼ï¼ã­ã°ãããã¡
+ã«è¨é²ãã¹ãã­ã°æ
+å ±ã®éè¦åº¦ã®ç¤ºãããããããï¼logmaskãã£ã¼ã«ãï¼ï¼ä½
+ã¬ãã«åºåæ©è½ãç¨ãã¦åºåãã¹ãã­ã°æ
+å ±ã®éè¦åº¦ãç¤ºããããããã
+ï¼lowmaskãã£ã¼ã«ãï¼ãåç
+§ãããã¨ãã§ããï¼
+
+(5) ER syslog_fls_log(void)
+
+ã­ã°ãããã¡ã«è¨é²ããã¦ããã­ã°æ
+å ±ããã¹ã¦åãåºãï¼ä½ã¬ãã«åºåæ©è½
+ãç¨ãã¦åºåããï¼
+
+8.1.7 ã·ã¹ãã ã­ã°æ©è½ã®ããã®ã©ã¤ãã©ãªé¢æ°ã¨ãã¯ã­
+
+ã·ã¹ãã ã­ã°åºåã®ããã®ã©ã¤ãã©ãªé¢æ°ã¨ãã¯ã­ã¯æ¬¡ã®éãã§ããï¼ããã
+ã ããå¼ã³åºãã½ã¼ã¹ãã¡ã¤ã«ã§ã¯ï¼t_syslog.hãã¤ã³ã¯ã«ã¼ãããã°ããï¼
+
+(1) void _syslog_n(uint_t prio, uint_t type, LOGPAR arg1, ..., LOGPAR argn)
+    â» nã¯0ã6ã®ããããï¼
+
+ã­ã°ç¨®å¥ãtypeï¼ã­ã°ãã©ã¡ã¼ã¿ãarg1ãargnã®ã­ã°æ
+å ±ãï¼éè¦åº¦prioã§åº
+åããããã®é¢æ°ï¼
+
+(2) void syslog_n(uint_t prio, const char *format, arg1, ..., argn)
+    â» nã¯0ã5ã®ããããï¼
+
+formatæå­åããã³ããã«ç¶ãå¼æ°ããä½æãããã¡ãã»ã¼ã¸ãï¼ã­ã°ç¨®å¥ã
+LOG_TYPE_COMMENTã®ã­ã°æ
+å ±ã¨ãã¦ï¼éè¦åº¦prioã§åºåããããã®ãã¯ã­ï¼
+
+formatã¯ã¡ãã»ã¼ã¸ã®ãã©ã¼ãããè¨è¿°ï¼printfã®ãã©ã¼ãããè¨è¿°ã¨é¡ä¼¼ï¼ï¼
+arg1ãargnã¯ãã©ã¼ãããè¨è¿°ä¸­ã§åç
+§ãããå¤ã§ããï¼arg1ãargnã¯ï¼ãã®
+ãã¯ã­ä¸­ã§LOGPARåã«ã­ã£ã¹ããããããï¼LOGPARåã«åå¤æã§ããä»»æã®å
+ãæ¸¡ããã¨ãã§ãï¼åãã§ãã¯ã¯ãããªãï¼formatããã³arg1ãargnã«ã¯ï¼æ¬¡
+ã®å¶éãããï¼
+
+ã»formatã®ãã©ã¼ãããè¨è¿°ã¯ï¼å®æ°æå­åãæ¸¡ããã¨ãæ³å®ãã¦ããï¼ãã®
+ãã¯ã­å¦çãçµããå¾ãå¤åãã¦ã¯ãªããªãï¼
+
+ã»formatä¸­ã«ä½¿ãããã©ã¼ãããæå®ã¯æ¬¡ã®éãï¼
+
+	%d		å¼æ°ãint_tåã¨ã¿ãªãï¼10é²æ°ã§è¡¨ç¤º
+	%u		å¼æ°ãuint_tåã¨ã¿ãªãï¼10é²æ°ã§è¡¨ç¤º
+	%x		å¼æ°ãuint_tåã¨ã¿ãªãï¼16é²æ°ï¼è±æå­ã¯å°æå­ï¼ã§è¡¨ç¤º
+	%X		å¼æ°ãuint_tåã¨ã¿ãªãï¼16é²æ°ï¼è±æå­ã¯å¤§æå­ï¼ã§è¡¨ç¤º
+	%p		å¼æ°ããã¤ã³ã¿ã¨ã¿ãªãï¼16é²æ°ï¼è±æå­ã¯å°æå­ï¼ã§è¡¨ç¤º
+	%c		å¼æ°ãæå­ã³ã¼ãã¨ã¿ãªãï¼æå­ãè¡¨ç¤º
+	%s		å¼æ°ãæå­åãç¤ºããã¤ã³ã¿ã¨ã¿ãªãï¼æå­åãè¡¨ç¤º
+	%%		'%'ãè¡¨ç¤ºï¼å¼æ°ã¯åããªãï¼
+
+%d, %u, %x, %Xã«ããã¦ã¯ï¼'%'ã®ç´å¾ã«è¡¨ç¤ºæ¡æ°ãæå®ãã10é²æ°å¤ãè¨è¿°ã
+ããã¨ãã§ããï¼ãã®å ´åï¼è¡¨ç¤ºãã¹ãæå­åãæå®ããæ¡æ°ã«æºããªãå ´å
+ã«ã¯ï¼æå®ããæ¡æ°å
+ã«å³è©°ãã§è¡¨ç¤ºããï¼10é²æ°å¤ã'0'ã§å§ã¾ãå ´åã«ã¯ï¼
+ãã®éã«'0'ãåããï¼
+
+ã¾ãï¼ãµã¤ãºæå®ãä»ä¸ããæ¬¡ã®ãã©ã¼ãããæå®ãä½¿ããã¨ãã§ããï¼
+
+	%ld		å¼æ°ãlong_tåã¨ã¿ãªãï¼10é²æ°ã§è¡¨ç¤º
+	%lu		å¼æ°ãulong_tåã¨ã¿ãªãï¼10é²æ°ã§è¡¨ç¤º
+	%lx		å¼æ°ãulong_tåã¨ã¿ãªãï¼16é²æ°ï¼è±æå­ã¯å°æå­ï¼ã§è¡¨ç¤º
+	%lX		å¼æ°ãulong_tåã¨ã¿ãªãï¼16é²æ°ï¼è±æå­ã¯å¤§æå­ï¼ã§è¡¨ç¤º
+
+	%td		å¼æ°ãint32_tåã¨ã¿ãªãï¼10é²æ°ã§è¡¨ç¤º
+	%tu		å¼æ°ãuint32_tåã¨ã¿ãªãï¼10é²æ°ã§è¡¨ç¤º
+	%tx		å¼æ°ãuint32_tåã¨ã¿ãªãï¼16é²æ°ï¼è±æå­ã¯å°æå­ï¼ã§è¡¨ç¤º
+	%tX		å¼æ°ãuint32_tåã¨ã¿ãªãï¼16é²æ°ï¼è±æå­ã¯å¤§æå­ï¼ã§è¡¨ç¤º
+
+	%Tu		å¼æ°ãSYSTIMåã¨ã¿ãªãï¼10é²æ°ã§è¡¨ç¤º
+	%Tx		å¼æ°ãSYSTIMåã¨ã¿ãªãï¼16é²æ°ï¼è±æå­ã¯å°æå­ï¼ã§è¡¨ç¤º
+	%TX		å¼æ°ãSYSTIMåã¨ã¿ãªãï¼16é²æ°ï¼è±æå­ã¯å¤§æå­ï¼ã§è¡¨ç¤º
+
+ãã ãï¼å¼æ°ãã­ã°æ
+å ±ã«åºåããéã«ã¯ï¼LOGPARåã«ã­ã£ã¹ããããï¼ãã®
+ããï¼LOGPARåï¼æ¨æºã§ã¯intptr_tã«å®ç¾©ï¼ããå¤§ãããµã¤ãºã®ãã¼ã¿ã¯ï¼æ­£
+ããè¡¨ç¤ºãããªãï¼æ­£ããè¡¨ç¤ºãããå ´åã«ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§LOGPARå
+ã®å®ç¾©ãå¤æ´ããã°è¯ãï¼
+
+%tuï¼%txï¼%tXã¯ï¼RELTIMåãTMOåã®å¤æ°ãè¡¨ç¤ºããããã«ä½¿ããã¨ãæ³å®ã
+ãæ©è½ã§ããï¼
+
+ã»arg1ãargnã«ãã¤ã³ã¿ãæ¸¡ãå ´åï¼%sã«å¯¾å¿ããå¼æ°ã®å ´åï¼ï¼ãã¤ã³ã¿ã®
+ã®æããã¼ã¿ã¯ï¼ãã®ãã¯ã­å¦çãçµããå¾ãå¤åãã¦ã¯ãªããªãï¼å®æ°æå­
+åãæ¸¡ããã¨ãæ³å®ãã¦ããï¼
+
+(3) void syslog(uint_t prio, const char *format, ...)
+
+formatæå­åããã³ããã«ç¶ãå¼æ°ããä½æãããã¡ãã»ã¼ã¸ãï¼ã­ã°ç¨®å¥ã
+LOG_TYPE_COMMENTã®ã­ã°æ
+å ±ã¨ãã¦ï¼éè¦åº¦prioã§åºåããããã®é¢æ°ã§ï¼å¼
+æ°ã®æ°ãå¯å¤ã«ãããã®ï¼formatã«ç¶ãå¼æ°ã¯æå¤§5åã¾ã§ï¼formatããã³ãã
+ã«ç¶ãå¼æ°ã«ã¯ï¼syslog_nã¨åæ§ã®å¶éãããï¼
+
+ãã®ã©ã¤ãã©ãªé¢æ°ã¯ï¼å¯å¤æ°å¼æ°ãå¦çããããã«å
+é¨ã§æå­åãã¹ã­ã£ã³
+ããï¼ãã®ããï¼å®è¡æéãé·ããªãå¯è½æ§ãããï¼å²è¾¼ã¿ç¦æ­¢ç¶æ
+ã§å¼ã³åº
+ãã¹ãã§ã¯ãªãï¼ä¸»ã«ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ãç¨ãããã¨ãæ³å®ãã¦ã
+ãï¼
+
+(4) UINT LOG_MASK(UINT prio)
+
+éè¦åº¦prioã®ã¿ã»ããããããããããããä½ããã¯ã­ï¼syslog_msk_logã«æ¸¡
+ãå¼æ°ãä½ãããã«ç¨ããï¼
+
+(5) UINT LOG_UPTO(UINT prio)
+
+éè¦åº¦prioä»¥ä¸ã®éè¦åº¦ããã¹ã¦ã»ããããããããããããä½ããã¯ã­ï¼
+syslog_msk_logã«æ¸¡ãå¼æ°ãä½ãããã«ç¨ããï¼
+
+8.1.8 ã·ã¹ãã ã­ã°æ©è½ã®ãã®ä»ã®ãµã¼ãã¹
+
+ã·ã¹ãã ã­ã°æ©è½ã¯ï¼åè¨ã®ãµã¼ãã¹ã³ã¼ã«ç­ã«å ãã¦ï¼åæåå¦çã®ããã®
+é¢æ°ãæã¤ï¼
+
+(1) void syslog_initialize(intptr_t exinf)
+
+ã·ã¹ãã ã­ã°æ©è½ãåæåããï¼ã­ã°ãããã¡ã«ã­ã°æ
+å ±ãè¨é²ããã¦ããå ´
+åã«ã¯ï¼æ¶å»ãããï¼syslog.cfgã«ãã£ã¦ï¼ã«ã¼ãã«ã«åæåã«ã¼ãã³ã¨ãã¦
+ç»é²ãããï¼exinfã¯ç¡è¦ãããï¼
+
+8.2 ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ã
+
+ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã¯ï¼ã·ãªã¢ã«ãã¼ããæ±ãããã®ãã©ã¤ãã§
+ããï¼
+
+ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤
+ã«ã§serial.cfgãã¤ã³ã¯ã«ã¼ããããã¨ã§ï¼ã·ã¹ãã ã«çµã¿è¾¼ããã¨ãã§ããï¼
+ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ããå¼ã³åºãã½ã¼ã¹ãã¡ã¤ã«ã§ã¯ï¼serial.hã
+ã¤ã³ã¯ã«ã¼ãããï¼
+
+ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã¯ï¼ãã¼ãæ¯ã«ã»ããã©ã2åãã¤ä½¿ç¨ããï¼
+ã»ããã©ãçæããéçAPIã¯ï¼serial.cfgã«å«ã¾ãã¦ããï¼
+
+8.2.1 ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ãµã¼ãã¹ã³ã¼ã«
+
+ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ããå¼ã³åºããµã¼ãã¹ã³ã¼ã«ã®ä»æ§ã¯æ¬¡ã®éã
+ã§ããï¼ãã®ä¸­ã§ï¼ã·ãªã¢ã«ãã¼ãã®IDçªå·ï¼portidï¼ã®è§£éã¯ã¿ã¼ã²ããä¾
+å­ã¨ãªãï¼
+
+ãããã®ãµã¼ãã¹ã³ã¼ã«ã¯ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºããã¨ã¯ã§ããª
+ãï¼ã¾ãï¼serial_rea_datã¨serial_wri_datã¯ï¼ãã£ã¹ãããä¿çç¶æ
+ã§å¼ã³
+åºããã¨ã¯ã§ããªãï¼ããããï¼å¼ã³åºããå ´åã«ã¯E_CTXã¨ã©ã¼ã¨ãªãï¼
+
+(1) ER serial_opn_por(ID portid)
+
+portidã§æå®ãããã·ãªã¢ã«ãã¼ãããªã¼ãã³ãï¼åä¿¡ï¼éä¿¡ãå¯è½ãªç¶æ
+ã«
+ããï¼
+
+(2) ER serial_cls_por(ID portid)
+
+portidã§æå®ãããã·ãªã¢ã«ãã¼ããã¯ã­ã¼ãºããï¼
+
+(3) ER_UINT serial_rea_dat(ID portid, char *buf, uint_t len)
+
+portidã§æå®ãããã·ãªã¢ã«ãã¼ãããï¼lenãã¤ãã®æå­åãåä¿¡ãï¼bufã
+ãã®é åã«å
+¥ããï¼lenãã¤ãåä¿¡ããã¾ã§ï¼å¾
+ã¡ç¶æ
+ã¨ãªãï¼åä¿¡ããæå­æ°
+ã¾ãã¯ã¨ã©ã¼ã³ã¼ããè¿ãï¼
+
+(4) ER_UINT serial_wri_dat(ID portid, const char *buf, uint_t len)
+
+portidã§æå®ãããã·ãªã¢ã«ãã¼ãã«ï¼bufããã®lenãã¤ãã®æå­åãéä¿¡ã
+ãï¼lenãã¤ãéä¿¡ãããã¡ã«å
+¥ããã¾ã§ï¼å¾
+ã¡ç¶æ
+ã¨ãªãï¼éä¿¡ããæå­æ°ã¾
+ãã¯ã¨ã©ã¼ã³ã¼ããè¿ãï¼
+
+(5) ER serial_ctl_por(ID portid, uint_t ioctl)
+
+portidã§æå®ãããã·ãªã¢ã«ãã¼ãã®å¶å¾¡æ
+å ±ãï¼ioctlã§ç¤ºãããå¤ã«è¨­å®ã
+ãï¼
+
+ioctlã«ã¯ï¼ä»¥ä¸ã®å¶å¾¡æ
+å ±ãè¡¨ãå®æ°ãï¼ãããæ¯ã«è«çåãã¨ã£ããã®ã
+æå®ããï¼
+
+	IOCTL_ECHOï¼ã¨ã³ã¼ããã¯ã¢ã¼ãï¼
+		ãã®ããããè¨­å®ããã¨ï¼ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ããã¨ã³ã¼
+		ããã¯ãè¡ãï¼å
+·ä½çã«ã¯ï¼ãããã¡ããæå­ãåãåºãåº¦ã«ï¼ãã®
+		æå­ãæ¸ãåºãï¼
+
+	IOCTL_CRLFï¼æ¹è¡ã¢ã¼ãï¼
+		LFï¼line feedï¼ãæ¸ãåºãã¨ï¼CRï¼carriage returnï¼ï¼LFã«å¤æã
+		ã¦æ¸ãåºãï¼
+
+	IOCTL_FCSNDï¼éä¿¡ãã­ã¼å¶å¾¡ï¼
+		æå­ãéä¿¡ããå¦çã«å¯¾ãã¦ï¼XON/XOFFã«ãããã­ã¼å¶å¾¡ãè¡ãï¼
+		ããªãã¡ï¼STOPï¼ã³ã³ãã­ã¼ã«-Sï¼ãåä¿¡ããã¨éä¿¡ãåæ­¢ãï¼
+		STARTï¼ã³ã³ãã­ã¼ã«-Qï¼ãåä¿¡ããã¨éä¿¡ãåéããï¼
+
+	IOCTL_FCANYï¼éä¿¡ãã­ã¼å¶å¾¡ã§ä»»æã®æå­ã§éä¿¡åéï¼
+		IOCTL_FCSNDãæå®ãã¦ããæã«ï¼éä¿¡åæ­¢ä¸­ã«åä¿¡ããä»»æã®æå­
+		ã§éä¿¡ãåéããï¼
+
+	IOCTL_FCRCVï¼åä¿¡ãã­ã¼å¶å¾¡ï¼
+		æå­ãåä¿¡ããå¦çã«å¯¾ãã¦ï¼XON/XOFFã«ãããã­ã¼å¶å¾¡ãè¡ãï¼
+		ããªãã¡ï¼åä¿¡ãããã¡ã®æ®ãé åãå°ãªããªãã¨STOPï¼ã³ã³ãã­ã¼
+		ã«-Sï¼ãéåºãï¼æ®ãé åãå¢ããã°STARTï¼ã³ã³ãã­ã¼ã«-Qï¼ãé
+		åºããï¼
+
+ãªãï¼ãªã¼ãã³ç´å¾ã®ããã©ã«ãã®è¨­å®å¤ã¯(IOCTL_ECHO | IOCTL_CRLF |
+IOCTL_FCSND | IOCTL_FCRCV)ã§ããï¼
+
+(6) ER serial_ref_por(ID portid, T_SERIAL_RPOR *pk_rpor)
+
+portidã§æå®ãããã·ãªã¢ã«ãã¼ãã®ç¶æ
+ãåç
+§ãï¼pk_rporã§æå®ããããã±ã
+ãã«è¿ãï¼ãã±ããä¸­ã®reacntã«ã¯åä¿¡ãããã¡ä¸­ã®æå­æ°ãï¼wricntã«ã¯é
+ä¿¡ãããã¡ä¸­ã®æå­æ°ãè¿ãï¼
+
+8.2.2 ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ãã®ä»ã®ãµã¼ãã¹
+
+ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã¯ï¼åè¨ã®ãµã¼ãã¹ã³ã¼ã«ã«å ãã¦ï¼åæå
+å¦çã¨æªéä¿¡æå­ã®ååºãå¦çãæã¤ï¼åæåå¦çã¯ï¼ã«ã¼ãã«ã«åæåã«ã¼
+ãã³ã¨ãã¦ç»é²ããï¼ã¾ãï¼ã¿ã¼ã²ããä¾å­ã§ï¼åæåå¦çï¼çµäºå¦çï¼å²è¾¼
+ã¿ãµã¼ãã¹ã«ã¼ãã³ãæã¤ï¼ãããã®ç»é²å¦çã¯serial.cfgã«å«ã¾ããï¼
+
+(1) void serial_initialize(intptr_t exinf)
+
+ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ããåæåããï¼ã«ã¼ãã«ã«åæåã«ã¼ãã³ã¨
+ãã¦ç»é²ããï¼exinfã¯ç¡è¦ããï¼
+
+(2) bool_t serial_get_chr(ID portid, char *p_c)
+
+portidã§æå®ãããã·ãªã¢ã«ãã¼ãã®éä¿¡ãããã¡ä¸­ã®æå­ãï¼p_cã®æãçªå°
+ã«åãåºãï¼trueãè¿ãé¢æ°ï¼æå­ããªãã£ãæã«ã¯ï¼falseãè¿ãï¼çµäºå¦ç
+ã«ã¼ãã³ä¸­ã§å¼ã³åºããã¨ãæ³å®ãã¦ããï¼
+
+8.3 ã·ã¹ãã ã­ã°ã¿ã¹ã¯
+
+ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã¯ï¼ã·ã¹ãã ã­ã°æ©è½ããã­ã°æ
+å ±ãåãåºãï¼ãããã·
+ã¹ãã ã®å¤é¨ã«åºåããããã®ãµã¼ãã¹ã§ããï¼
+
+ASP3ã«ã¼ãã«ã®é
+å¸ããã±ã¼ã¸ã«å«ã¾ããã·ã¹ãã ã­ã°ã¿ã¹ã¯ã¯ï¼ã·ãªã¢ã«ãã¼
+ãã«ã­ã°æ
+å ±ãæå­åã®å½¢ã§åºåãããã®ã§ï¼ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ä¸ä¾ã¨ã
+ãä½ç½®ä»ãã§æä¾ãã¦ããï¼
+
+ãã®ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã§
+logtask.cfgãã¤ã³ã¯ã«ã¼ããããã¨ã§ï¼ã·ã¹ãã ã«çµã¿è¾¼ããã¨ãã§ããï¼ã·
+ã¹ãã ã­ã°ã¿ã¹ã¯ã®ãµã¼ãã¹ãå¼ã³åºãã½ã¼ã¹ãã¡ã¤ã«ã§ã¯ï¼logtask.hãã¤ã³
+ã¯ã«ã¼ãããï¼
+
+ã·ã¹ãã ã­ã°ã¿ã¹ã¯ãå®è¡éå§ãããã¨ï¼éè¦åº¦ãLOG_EMERGã®ã­ã°æ
+å ±ãä½ã¬
+ãã«åºåæ©è½ãç¨ãã¦åºåãï¼éè¦åº¦ãLOG_NOTICEãããããé«ãã­ã°æ
+å ±ã
+ã­ã°ãããã¡ã«è¨é²ããããã«ï¼ã·ã¹ãã ã­ã°æ©è½ã®è¨­å®ãå¤æ´ãããï¼
+
+8.3.1 ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ãµã¼ãã¹ã³ã¼ã«
+
+ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ãµã¼ãã¹ãå¼ã³åºããµã¼ãã¹ã³ã¼ã«ã®ä»æ§ã¯æ¬¡ã®éãã§
+ããï¼
+
+(1) ER logtask_flush(uint_t count)
+
+ã·ã¹ãã ã­ã°æ©è½ã®ã­ã°ãããã¡ä¸­ã®ã­ã°æ
+å ±ã®æ°ãcountä»¥ä¸ã«ãªãã¾ã§å¾
+ã¤ï¼
+countã0ã®å ´åã«ã¯ï¼ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®éä¿¡ãããã¡ãç©ºã«
+ãªãã®ãå¾
+ã¤ï¼
+
+8.3.2 ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ãã®ä»ã®ãµã¼ãã¹
+
+ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã¯ï¼åè¨ã®ãµã¼ãã¹ã³ã¼ã«ã«å ãã¦ï¼ã¡ã¤ã³å¦çã¨çµäºå¦
+çãæã¤ï¼ã¡ã¤ã³å¦çã¯ã¿ã¹ã¯ã¨ãã¦ï¼çµäºå¦çã¯çµäºå¦çã«ã¼ãã³ã¨ãã¦ç»
+é²ããï¼ãããã®ç»é²å¦çã¯logtask.cfgã«å«ã¾ããï¼
+
+(1) void logtask_main(intptr_t exinf)
+
+ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ã¡ã¤ã³å¦çï¼exinfã«ã¯ï¼ã­ã°æ
+å ±ãåºåããã·ãªã¢ã«ãã¼
+ãã®IDçªå·ãæ¸¡ãï¼
+
+(2) void logtask_terminate(intptr_t exinf)
+
+ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®çµäºå¦çï¼ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®éä¿¡ãã
+ãã¡ã«èç©ããããã¼ã¿ã¨ï¼ã­ã°ãããã¡ã«è¨é²ãããã­ã°æ
+å ±ãï¼ä½ã¬ãã«
+åºåæ©è½ãç¨ãã¦åºåããï¼åºåãã¹ãã­ã°æ
+å ±ãããå ´åã«ã¯ï¼ãããåºå
+ããåã«ï¼"-- buffered messages --"ã¨ããæå­åãåºåããï¼exinfã¯ç¡è¦
+ããï¼
+
+ãã®é¢æ°ãçµäºå¦çã«ã¼ãã³ã¨ãã¦ç»é²ãããã¨ã§ï¼ã«ã¼ãã«çµäºæç¹ã§æªåº
+åã®ã­ã°æ
+å ±ã®ã»ã¨ãã©ãåºåãããã¨ãã§ããï¼ãã ãï¼æªåºåã®ã­ã°æ
+å ±
+ã®å
+ï¼ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ã¡ã¤ã³å¦çãï¼ã­ã°ãããã¡ããåãåºãããï¼
+ã¾ã ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã«éä¿¡ãã¦ããªãæ
+å ±ã¯ï¼ãã®é¢æ°ã§ã¯
+åºåã§ããªãï¼
+
+8.4 å®è¡æéåå¸éè¨ãµã¼ãã¹
+
+å®è¡æéåå¸éè¨ãµã¼ãã¹ã¯ï¼ã·ã¹ãã ã®ãªã¢ã«ã¿ã¤ã æ§è½ãè©ä¾¡ããããã«ï¼
+ãã­ã°ã©ã åºéã®å®è¡æéãè¨æ¸¬ãï¼ãã®åå¸ãéè¨ã»è¡¨ç¤ºããããã®ã·ã¹ã
+ã ãµã¼ãã¹ã§ããï¼
+
+å®è¡æéåå¸éè¨ãµã¼ãã¹ãç¨ããå ´åã«ã¯ï¼histogram.hãã¤ã³ã¯ã«ã¼ããï¼
+histogram.cãã³ã³ãã¤ã«ã»ãªã³ã¯ããï¼
+
+å®è¡æéåå¸éè¨ãµã¼ãã¹ã¯ï¼è¤æ°ã®ãã­ã°ã©ã åºéã®å®è¡æéãè¨æ¸¬ã»éè¨ã»
+è¡¨ç¤ºãããã¨ãã§ããï¼ãã­ã°ã©ã åºéæ¯ã«ï¼å®è¡æéåå¸ãè¨é²ããããã®
+ãã¼ã¿æ§é ãæã¤ï¼ã©ã®ãã¼ã¿æ§é ãç¨ããããï¼IDçªå·ï¼histidï¼ã§æå®ã
+ãï¼ä½¿ç¨ã§ãããã¼ã¿æ§é ã®æ°ã¯ï¼TNUM_HISTã§å®ç¾©ãããï¼ããªãã¡ï¼IDçªå·
+ã¨ãã¦ï¼1ãTNUM_HISTãæå®ãããã¨ãã§ããï¼TNUM_HISTã¯ï¼ããã©ã«ãå¤ã
+histgram.cã®ä¸­ã§å®ç¾©ããã¦ããï¼ã³ã³ãã¤ã«ãªãã·ã§ã³ãã¿ã¼ã²ããä¾å­é¨
+ï¼target_test.hã¾ãã¯ããããã¤ã³ã¯ã«ã¼ãããããã¡ã¤ã«ï¼ã«ããå¤æ´ãã
+ãã¨ãã§ããï¼
+
+ã¿ã¼ã²ããä¾å­é¨ã§è¨­å®ãå¤æ´ãã¦ããªãå ´åï¼å®è¡æéåå¸éè¨ãµã¼ãã¹ã¯ï¼
+ã«ã¼ãã«ã®é«åè§£è½ã¿ã¤ããåç
+§ããæ©è½ï¼fch_hrtï¼ãç¨ãã¦å®è¡æéãè¨æ¸¬
+ããï¼ãã®ããï¼å®è¡æéã¯ãã¤ã¯ã­ç§åä½ã§è¨é²ãããï¼ç²¾åº¦ã¯ã¿ã¼ã²ãã
+ä¾å­ï¼ï¼ã¾ãï¼è¨é²ãããæéã«ã¯ï¼è¨æ¸¬ã®ããã®ãªã¼ããããï¼fch_hrtã®å®
+è¡æéï¼Î±ï¼ãå«ã¾ããï¼
+
+ã¿ã¼ã²ããä¾å­é¨ã§è¨­å®ãå¤æ´ãã¦ããå ´åã®ä»æ§ã«ã¤ãã¦ã¯ï¼ã¿ã¼ã²ããä¾
+å­é¨ã®ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ãåç
+§ãããã¨ï¼
+
+(1) void init_hist(ID histid, uint_t maxval, uint_t histarea[])
+
+histidã§æå®ããããã¼ã¿æ§é ãåæåããï¼maxvalã«ã¯è¨é²ããæå¤§æéãï¼
+histareaã«ã¯è¨é²é åã®å
+é ­çªå°ãæå®ããï¼histareaã§å§ã¾ãè¨æ¶é åã¯ï¼
+è¦ç´ æ°ãmaxvalã«æå®ããå¤+1ã®uint_tåã®é
+åã¨ãã¦ç¢ºä¿ããï¼ä¾ãã°ï¼
+maxvalã«1000ãæå®ããå ´åã«ã¯ï¼histareaã«ã¯è¦ç´ æ°ã1001ã®uint_tåã®é
+
+åã®å
+é ­çªå°ãæ¸¡ãï¼
+
+(2) void begin_measure(ID histid)
+
+å®è¡æéãè¨æ¸¬ãããã­ã°ã©ã åºéã®ç´åã«å¼ã³åºãé¢æ°ï¼histidã§æå®ãã
+ããã¼ã¿æ§é ã«ï¼ç¾å¨ã®ã·ã¹ãã æå»ãè¨é²ããï¼
+
+(3) void end_measure(ID histid)
+
+å®è¡æéãè¨æ¸¬ãããã­ã°ã©ã åºéã®ç´å¾ã«å¼ã³åºãé¢æ°ï¼ç¾å¨ã®ã·ã¹ãã æ
+å»ã¨ï¼histidã§æå®ããããã¼ã¿æ§é ã«è¨é²ãããéå§æå»ããï¼ãã­ã°ã©ã 
+åºéã®å®è¡æéãæ±ãï¼ãã®çµæãè¨é²ããï¼
+
+(4) void print_hist(ID histid, void (*flush)(void))
+
+ã·ã¹ãã ã­ã°æ©è½ãç¨ãã¦ï¼å®è¡æéåå¸ã®è¨æ¸¬çµæãåºåããï¼ã­ã°ãããã¡
+ãæº¢ããã®ãé²ãããã«ï¼è¨æ¸¬çµæã®åºåä¸­ããã³åºåå¾ã«ï¼flushã§æå®ãã
+ãé¢æ°ãå¼ã³åºãï¼
+
+8.5 ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºå
+
+ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºåã¯ï¼ã«ã¼ãã«ã®èµ·åæã«ï¼ã«ã¼ãã«ã®åç§°ããã¼
+ã¸ã§ã³çªå·ï¼èä½æ¨©è¡¨ç¤ºãªã©ãåºåããããã®æ©è½ã§ããï¼
+
+ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºåã¯ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ã§banner.cfgãã¤ã³ã¯ã«ã¼ããããã¨ã§ï¼ã·ã¹ãã ã«çµã¿è¾¼ããã¨ãã§ããï¼
+
+ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºåã¯ï¼æ¬¡ã®é¢æ°ã§æ§æãããï¼
+
+(1) void print_banner(intptr_t exinf)
+
+ã·ã¹ãã ã­ã°æ©è½ãç¨ãã¦ï¼ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ãåºåããï¼banner.cfg
+ã«ãã£ã¦ï¼ã«ã¼ãã«ã«åæåã«ã¼ãã³ã¨ãã¦ç»é²ãããï¼exinfã¯ç¡è¦ãããï¼
+
+
+ï¼ï¼ãµãã¼ãã©ã¤ãã©ãª
+
+ãµãã¼ãã©ã¤ãã©ãªã¯ï¼ã¢ããªã±ã¼ã·ã§ã³ãã·ã¹ãã ãµã¼ãã¹ãä½æãããã
+ã«å©ç¨ã§ããã©ã¤ãã©ãªé¢æ°ç¾¤ã§ããï¼
+
+9.1 åºæ¬çãªã©ã¤ãã©ãªé¢æ°
+
+åºæ¬çãªã©ã¤ãã©ãªé¢æ°ãç¨ããå ´åã«ã¯ï¼t_stdlib.hãã¤ã³ã¯ã«ã¼ããï¼å¿
+
+è¦ã«å¿ãã¦strerror.cã¨t_perror.cãã³ã³ãã¤ã«ã»ãªã³ã¯ããï¼
+
+(1) const char *itron_strerror(ER ercd)
+
+ercdã§ç¤ºãããã¨ã©ã¼ã³ã¼ãã«å¯¾å¿ããã¡ã¤ã³ã¨ã©ã¼ã³ã¼ãã®æå­åãè¿ãï¼
+
+(2) void t_perror(uint_t prio, const char *file, int_t line,
+										const char *expr, ER ercd);
+
+ãµã¼ãã¹ã³ã¼ã«ãã¨ã©ã¼ãè¿ããå ´åã«ç¨ãããã¨ãæ³å®ããé¢æ°ã§ï¼ãã¡ã¤
+ã«åï¼è¡çªå·ï¼ã¡ã¤ã³ã¨ã©ã¼ã³ã¼ãç­ãï¼éè¦åº¦prioã§ï¼ã·ã¹ãã ã­ã°æ©è½ã
+ç¨ãã¦åºåããï¼
+
+9.2 ã­ã¥ã¼æä½ã©ã¤ãã©ãªé¢æ°
+
+ã­ã¥ã¼æä½ã©ã¤ãã©ãªã¯ï¼ã­ã¥ã¼ããããå«ããªã³ã°æ§é ã®ããã«ãªã³ã¯ã­ã¥ã¼
+ãæ±ãã©ã¤ãã©ãªã§ããï¼ã­ã¥ã¼ãããã®æ¬¡ã¨ã³ããªã¯ã­ã¥ã¼ã®å
+é ­ã®ã¨ã³ã
+ãªï¼åã¨ã³ããªã¯ã­ã¥ã¼ã®æ«å°¾ã®ã¨ã³ããªã¨ããï¼ã¾ãï¼ã­ã¥ã¼ã®å
+é ­ã®ã¨ã³
+ããªã®åã¨ã³ããªã¨ï¼ã­ã¥ã¼ã®æ«å°¾ã®ã¨ã³ããªã®æ¬¡ã¨ã³ããªã¯ï¼ã­ã¥ã¼ããã
+ã¨ããï¼ç©ºã®ã­ã¥ã¼ã¯ï¼æ¬¡ã¨ã³ããªï¼åã¨ã³ããªã¨ãèªåèªèº«ãæãã­ã¥ã¼ãã
+ãã§ããããï¼
+
+ã­ã¥ã¼æä½ã©ã¤ãã©ãªé¢æ°ãç¨ããå ´åã«ã¯ï¼queue.hãã¤ã³ã¯ã«ã¼ãããï¼
+
+ã­ã¥ã¼ãããã¨ã¨ã³ããªã®ããã®ãã¼ã¿æ§é ã¨ãã¦ï¼QUEUEæ§é ä½ãç¨ããï¼
+QUEUEæ§é ä½ã®å®ç¾©ã¯æ¬¡ã®éãï¼
+
+	typedef struct queue {
+		struct queue *p_next;		/* æ¬¡ã¨ã³ããªã¸ã®ãã¤ã³ã¿ */
+		struct queue *p_prev;		/* åã¨ã³ããªã¸ã®ãã¤ã³ã¿ */
+	} QUEUE;
+
+ã­ã¥ã¼æä½ã®ããã«ç¨æãã¦ããé¢æ°ã¯æ¬¡ã®éãï¼
+
+(1) void queue_initialize(QUEUE *p_queue);
+
+ã­ã¥ã¼ãåæåããï¼p_queueã«ã¯ã­ã¥ã¼ããããæå®ããï¼
+
+(2) void queue_insert_prev(QUEUE *p_queue, QUEUE *p_entry);
+
+p_queueã§æå®ããã¨ã³ããªã®åã«ï¼p_entryã§æå®ããã¨ã³ããªãæ¿å
+¥ããï¼
+p_queueã«ã­ã¥ã¼ããããæå®ããå ´åã«ã¯ï¼ã­ã¥ã¼ã®æ«å°¾ã«p_entryã§æå®ã
+ãã¨ã³ããªãæ¿å
+¥ãããã¨ã«ãªãï¼
+
+(3) void queue_insert_next(QUEUE *p_queue, QUEUE *p_entry);
+
+p_queueã§æå®ããã¨ã³ããªã®æ¬¡ã«ï¼p_entryã§æå®ããã¨ã³ããªãæ¿å
+¥ããï¼
+p_queueã«ã­ã¥ã¼ããããæå®ããå ´åã«ã¯ï¼ã­ã¥ã¼ã®å
+é ­ã«p_entryã§æå®ã
+ãã¨ã³ããªãæ¿å
+¥ãããã¨ã«ãªãï¼
+
+(4) void queue_delete(QUEUE *p_entry);
+
+p_entryã§æå®ããã¨ã³ããªãï¼ã­ã¥ã¼ããåé¤ããï¼
+
+(5) QUEUE *queue_delete_next(QUEUE *p_queue);
+
+p_queueã§æå®ããã¨ã³ããªã®æ¬¡ã®ã¨ã³ããªãã­ã¥ã¼ããåé¤ãï¼åé¤ããã¨ã³
+ããªãè¿ãï¼p_queueã«ã­ã¥ã¼ããããæå®ããå ´åã«ã¯ï¼ã­ã¥ã¼ã®å
+é ­ã®ã¨ã³
+ããªãåãåºããã¨ã«ãªãï¼p_queueã«ç©ºã®ã­ã¥ã¼ãæå®ãã¦å¼ã³åºãã¦ã¯ãªã
+ãªãï¼
+
+(6) bool_t queue_empty(QUEUE *p_queue);
+
+ã­ã¥ã¼ãç©ºã®å ´åã«ã¯trueï¼ããã§ãªãå ´åã«ã¯falseãè¿ãï¼p_queueã«ã¯
+ã­ã¥ã¼ããããæå®ããï¼
+
+9.3 ã·ã¹ãã ã­ã°åºåç¨ã©ã¤ãã©ãªé¢æ°
+
+ã·ã¹ãã ã­ã°åºåç¨ã©ã¤ãã©ãªé¢æ°ã¯ï¼ã­ã°æ
+å ±ããã©ã¼ãããåºåãããã
+ã«ï¼ã·ã¹ãã ã­ã°ã¿ã¹ã¯ããã³ã·ã¹ãã ã­ã°æ©è½ã§ç¨ããããã®é¢æ°ç¾¤ã§ããï¼
+
+ã·ã¹ãã ã­ã°åºåç¨ã©ã¤ãã©ãªé¢æ°ãç¨ããå ´åã«ã¯ï¼log_output.hãã¤ã³ã¯
+ã«ã¼ããï¼log_output.cãã³ã³ãã¤ã«ã»ãªã³ã¯ããï¼
+
+(1) void syslog_printf(const char *format, const intptr_t *p_args,
+												void (*putc)(char))
+
+formatã§æå®ããããã©ã¼ãããè¨è¿°ã¨p_argsã§æå®ãããå¼æ°åããä½æã
+ãã¡ãã»ã¼ã¸ãï¼1æå­åºåé¢æ°putcãç¨ãã¦åºåããï¼
+
+(2) void syslog_print(const SYSLOG *p_syslog, void (*putc)(char))
+
+p_syslogã§æå®ãããã­ã°æ
+å ±ãæå­åã«ç´ãï¼1æå­åºåé¢æ°putcãç¨ãã¦åº
+åããï¼
+
+(3) void syslog_lostmsg(uint_t lost, void (*putc)(char))
+
+loståã®ã­ã°æ
+å ±ãå¤±ãããæ¨ã®ã¡ãã»ã¼ã¸ãï¼1æå­åºåé¢æ°putcãç¨ãã¦åº
+åããï¼
+
+
+ï¼ï¼ï¼ãã¹ããã­ã°ã©ã 
+
+ãã¹ããã­ã°ã©ã ã¯ï¼ã«ã¼ãã«ã®æ©è½ãã¹ãããã³æ§è½è©ä¾¡ãè¡ãããã®ãã­
+ã°ã©ã ç¾¤ã§ããï¼
+
+10.1 ãã¹ããã­ã°ã©ã ç¨ãµã¼ãã¹
+
+ãã¹ããã­ã°ã©ã ç¨ãµã¼ãã¹ã¯ï¼ãã­ã°ã©ã ä¸­ã®ãã§ãã¯ãã¤ã³ããæ­£ããé 
+åºã§å®è¡ããããã¨ãªã©ï¼ãã­ã°ã©ã ãæ­£ããåä½ãã¦ãããã¨ããã§ãã¯ã
+ãããã®ã·ã¹ãã ãµã¼ãã¹ã§ããï¼ãã­ã°ã©ã ãæ­£ããåä½ãã¦ããªããã¨ã
+æ¤åºããå ´åã«ã¯ï¼ãã­ã°ã©ã ãçµäºãããï¼
+
+ãã¹ããã­ã°ã©ã ç¨ãµã¼ãã¹ãç¨ããå ´åã«ã¯ï¼test_svc.hãã¤ã³ã¯ã«ã¼ããï¼
+test_svc.cãã³ã³ãã¤ã«ã»ãªã³ã¯ããï¼
+
+(1) void test_start(char *progname)
+
+ãã¹ããã­ã°ã©ã ã®éå§æã«å¼ã³åºãé¢æ°ï¼prognameã«ã¯ï¼ãã¹ããã­ã°ã©ã 
+åãæ¸¡ãï¼
+
+(2) void set_bit_func(BIT_FUNC bit_func)
+
+ãã§ãã¯ãã¤ã³ãã«ããã¦å¼ã³åºãèªå·±è¨ºæ­é¢æ°ãè¨­å®ããããã®é¢æ°ï¼
+
+(3) void check_point(uint_t count)
+
+ãã§ãã¯ãã¤ã³ããééããéã«å¼ã³åºãé¢æ°ï¼countã«ã¯ï¼ä½çªç®ã®ãã§ãã¯
+ãã¤ã³ãã§ããããæå®ããï¼æåã®ãã§ãã¯ãã¤ã³ãã§ã¯1ãæå®ããï¼ï¼
+countã®å¤ãï¼æåã®ãã§ãã¯ãã¤ã³ãã«ããã¦ã¯1ã§ãªãå ´åã«ï¼ããä»¥éã®
+ãã§ãã¯ãã¤ã³ãã«ããã¦ã¯ï¼åã®ãã§ãã¯ãã¤ã³ãééæã«countã«æå®ãã
+å¤ã«1ãå ããå¤ã§ãªãå ´åã«ï¼ãã­ã°ã©ã ãæ­£ããåä½ãã¦ããªãã¨è¦ãªãï¼
+ãã­ã°ã©ã ãçµäºãããï¼
+
+(4) void check_finish(uint_t count)
+
+æå¾ã®ãã§ãã¯ãã¤ã³ãã«å°éããéã«å¼ã³åºãé¢æ°ï¼countã«ã¯ï¼ä½çªç®ã®
+ãã§ãã¯ãã¤ã³ãã§ããããæå®ããï¼æåã®ãã§ãã¯ãã¤ã³ãã§ã¯1ãæå®ã
+ãï¼ï¼countã®å¤ãï¼åã®ãã§ãã¯ãã¤ã³ãééæã«countã«æå®ããå¤ã«1ãå 
+ããå¤ã§ãªãå ´åã«ï¼ãã­ã°ã©ã ãæ­£ããåä½ãã¦ããªãã¨è¦ãªãï¼ãã®é¢æ°
+ã¯ï¼ãã­ã°ã©ã ãæ­£ããåä½ãã¦ããï¼ããªãã«é¢ãããï¼ãã­ã°ã©ã ãçµäº
+ãããï¼
+
+ãã§ãã¯ãã¤ã³ããä½¿ç¨ããªããã¹ããã­ã°ã©ã ã®å ´åã«ã¯ï¼countã«0ãæå®
+ãã¦ãã®é¢æ°ãå¼ã³åºãï¼ãã­ã°ã©ã ãçµäºãããï¼
+
+(5) void check_assert(bool_t exp)
+
+expãçã§ãããã¨ããã§ãã¯ãããå ´åã«å¼ã³åºãé¢æ°ï¼expãå½ã§ããå ´å
+ã«ï¼ãã­ã°ã©ã ãæ­£ããåä½ãã¦ããªãã¨è¦ãªãï¼ãã­ã°ã©ã ãçµäºãããï¼
+
+(6) void check_ercd(ER ercd, ER expected_ercd)
+
+ercdãexpected_ercdã«ä¸è´ãã¦ãããã¨ããã§ãã¯ãããå ´åã«å¼ã³åºãé¢æ°ï¼
+ercdãexpected_ercdã«ä¸è´ãã¦ããªãå ´åã«ï¼ãã­ã°ã©ã ãæ­£ããåä½ãã¦ã
+ãªãã¨è¦ãªãï¼ãã­ã°ã©ã ãçµäºãããï¼
+
+(7) void check_state(bool_t ctx, bool_t loc,
+						bool_t dsp, bool_t dpn, bool_t ter)
+
+ã·ã¹ãã ç¶æ
+ãæå¾
+ãããã®ã«ãªã£ã¦ããããã§ãã¯ãããæã«å¼ã³åºãé¢æ°ï¼
+ctxï¼locï¼dspï¼dpnï¼terã«ã¯ï¼ããããsns_ctx()ï¼sns_loc()ï¼sns_dsp()ï¼
+sns_dpn()ï¼sns_ter()ã®è¿å¤ã¨ãã¦æå¾
+ãããå¤ãæå®ããï¼ãã®å
+ã®ããã
+ããæå¾
+ãããå¤ã¨ä¸è´ãã¦ããªãå ´åã«ï¼ãã­ã°ã©ã ãæ­£ããåä½ãã¦ããª
+ãã¨è¦ãªãï¼ãã­ã°ã©ã ãçµäºãããï¼
+
+(8) void check_ipm(PRI ipm)
+
+å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãæå¾
+ããå¤ã«ãªã£ã¦ããããã§ãã¯ãããæã«å¼ã³åºã
+é¢æ°ï¼ipmã«ã¯ï¼get_ipm()ã§åç
+§ã§ããå²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã¨ãã¦æå¾
+ããã
+å¤ãæå®ããï¼æå¾
+ãããå¤ã¨ä¸è´ãã¦ããªãå ´åã«ï¼ãã­ã°ã©ã ãæ­£ããå
+ä½ãã¦ããªãã¨è¦ãªãï¼ãã­ã°ã©ã ãçµäºãããï¼
+
+10.2 ã«ã¼ãã«ã®æ´åæ§æ¤æ»
+
+ãã§ãã¯ãã¤ã³ãã«ããã¦å¼ã³åºãèªå·±è¨ºæ­ã«ä½¿ãããã®ãã­ã°ã©ã ã¨ãã¦ï¼
+ã«ã¼ãã«ã®æ´åæ§æ¤æ»ãç¨æãã¦ããï¼ã«ã¼ãã«ã®æ´åæ§æ¤æ»ã¯ï¼ã«ã¼ãã«å
+
+ã®åãã¼ã¿æ§é ã®ä¸è²«æ§ãæ¤æ»ããï¼ç¾æç¹ã§ã¯æªå®æï¼ï¼
+
+ã«ã¼ãã«ã®æ´åæ§æ¤æ»ãç¨ããå ´åã«ã¯ï¼ããããï¼bit_kernel.cï¼
+bit_mutex.cãã³ã³ãã¤ã«ã»ãªã³ã¯ããï¼
+
+(1) ER bit_kernel(void)
+
+ã«ã¼ãã«å
+ã®åãã¼ã¿æ§é ã®ä¸è²«æ§ãæ¤æ»ãï¼ä¸è²«æ§ãç¢ºèªã§ããå ´åã«E_OKï¼
+ã§ããªãã£ãå ´åã«E_SYSã¨ã©ã¼ãè¿ãé¢æ°ï¼E_SYSã¨ã©ã¼ãè¿ãéã®ãµãã¨ã©ã¼
+ã³ã¼ãã¨ãã¦ï¼ä¸è²«æ§ãç¢ºèªã§ããªãã£ãé 
+ç®ãç¤ºãã³ã¼ããè¿ãï¼
+
+(2) ER bit_mutex(void)
+
+ã«ã¼ãã«å
+ã®ãã¥ã¼ããã¯ã¹é¢é£ã®ãã¼ã¿æ§é ã®ä¸è²«æ§ãæ¤æ»ãï¼ä¸è²«æ§ãç¢º
+èªã§ããå ´åã«E_OKï¼ã§ããªãã£ãå ´åã«E_SYSã¨ã©ã¼ãè¿ãé¢æ°ï¼E_SYSã¨ã©ã¼
+ãè¿ãéã®ãµãã¨ã©ã¼ã³ã¼ãã¨ãã¦ï¼ä¸è²«æ§ãç¢ºèªã§ããªãã£ãé 
+ç®ãç¤ºãã³ã¼
+ããè¿ãï¼
+
+10.3 æ©è½ãã¹ããã­ã°ã©ã 
+
+testãã£ã¬ã¯ããªã«ç½®ããã"test"ã§å§ã¾ããã­ã°ã©ã ã¯ï¼ã«ã¼ãã«ã®æ©è½ã
+ã¹ããè¡ãããã®ãã­ã°ã©ã ã§ããï¼
+
+æ©è½ãã¹ããã­ã°ã©ã ã¯ãã¹ããã­ã°ã©ã ç¨ãµã¼ãã¹ãä½¿ç¨ãã¦ããããï¼æ§
+ç¯ããå ´åã«ã¯ï¼Makefileã®SYSSVC_COBJSã«ï¼test_svc.oãè¿½å ããå¿
+è¦ãã
+ãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªãããä½¿ç¨ããå ´åã«ã¯ï¼-Sãªãã·ã§ã³ã§
+test_svc.oãæå®ããï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®ã³ãã³ããå®è¡ããã°ããï¼æ§ç¯ç¨
+ã®ãã£ã¬ã¯ããªãï¼ASP3ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡ã¤ã«ãå±éãããã£ã¬ã¯ããªã®
+ç´ä¸ã«ããã¨ä»®å®ãã¦ããï¼ï¼
+
+	% perl ../configure -T <ã¿ã¼ã²ããç¥ç§°> -A <ãã¹ããã­ã°ã©ã å> \
+											-a ../test -S test_svc.o
+
+ãã ãï¼CPUä¾å¤å¦çã®ãã¹ã(1)ã(13)ã¯ï¼åä¸ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼
+ã·ã§ã³ãå
+±ç¨ãã¦ããããï¼test_cpuexc.cfgãæ¬¡ã®ããã«ã³ãã¼ãã¦ããå¿
+è¦
+ãããï¼
+
+	% cp ../test/test_cpuexc.cfg test_cpuexc<ãã¹ãçªå·>.cfg
+
+ã¾ãï¼ããã¤ãã®ãã¹ããã­ã°ã©ã ã§ã¯ï¼ã«ã¼ãã«ã®æ´åæ§æ¤æ»ãå®æ½ãã¦ã
+ãï¼è©²å½ãããã¹ããã­ã°ã©ã ãæ§ç¯ããå ´åã«ã¯ï¼Makefileã®SYSSVC_COBJS
+ã«ï¼bit_kernel.oã¾ãã¯bit_mutex.oãè¿½å ããå¿
+è¦ãããï¼ã³ã³ãã£ã®ã¥ã¬ã¼
+ã·ã§ã³ã¹ã¯ãªãããä½¿ç¨ããå ´åã«ã¯ï¼-Sãªãã·ã§ã³ã§ãããã®ãã¡ã¤ã«ãæ
+å®ããï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®ã³ãã³ããå®è¡ããã°ããï¼
+
+	% perl ../configure -T <ã¿ã¼ã²ããç¥ç§°> -A <ãã¹ããã­ã°ã©ã å> \
+				-a ../test -S "test_svc.o bit_kernel.o bit_mutex.o"
+
+ç¾ãã¼ã¸ã§ã³ã§ç¨æãã¦ããæ©è½ãã¹ããã­ã°ã©ã ã¯æ¬¡ã®éãï¼
+
+(1) test_cpuexc1			CPUä¾å¤å¦çã®ãã¹ã(1)
+(2) test_cpuexc2			CPUä¾å¤å¦çã®ãã¹ã(2)
+(3) test_cpuexc3			CPUä¾å¤å¦çã®ãã¹ã(3)
+(4) test_cpuexc4			CPUä¾å¤å¦çã®ãã¹ã(4)
+(5) test_cpuexc5			CPUä¾å¤å¦çã®ãã¹ã(5)
+(6) test_cpuexc6			CPUä¾å¤å¦çã®ãã¹ã(6)
+(7) test_cpuexc7			CPUä¾å¤å¦çã®ãã¹ã(7)
+(8) test_cpuexc8			CPUä¾å¤å¦çã®ãã¹ã(8)
+(9) test_cpuexc9			CPUä¾å¤å¦çã®ãã¹ã(9)
+(10) test_cpuexc10			CPUä¾å¤å¦çã®ãã¹ã(10)
+(11) test_dlynse			sil_dly_nseã«é¢ãããã¹ã
+(12) test_hrt1.c			fch_hrtã«é¢ãããã¹ã(1)
+(13) test_mutex1.c			ãã¥ã¼ããã¯ã¹æ©è½ã®ãã¹ã(1)
+(14) test_mutex2.c			ãã¥ã¼ããã¯ã¹æ©è½ã®ãã¹ã(2)
+(15) test_mutex3.c			ãã¥ã¼ããã¯ã¹æ©è½ã®ãã¹ã(3)
+(16) test_mutex4.c			ãã¥ã¼ããã¯ã¹æ©è½ã®ãã¹ã(4)
+(17) test_mutex5.c			ãã¥ã¼ããã¯ã¹æ©è½ã®ãã¹ã(5)
+(18) test_mutex6.c			ãã¥ã¼ããã¯ã¹æ©è½ã®ãã¹ã(6)
+(19) test_mutex7.c			ãã¥ã¼ããã¯ã¹æ©è½ã®ãã¹ã(7)
+(20) test_mutex8.c			ãã¥ã¼ããã¯ã¹æ©è½ã®ãã¹ã(8)
+(21) test_notify1.c			éç¥å¦çã®ãã¹ã(1)
+(22) test_raster1.c			ã¿ã¹ã¯çµäºè¦æ±æ©è½ã«é¢ãããã¹ã(1)
+(23) test_raster2.c			ã¿ã¹ã¯çµäºè¦æ±æ©è½ã«é¢ãããã¹ã(2)
+(24) test_sem1				ã»ããã©æ©è½ã®ãã¹ã(1)
+(25) test_sem2				ã»ããã©æ©è½ã®ãã¹ã(2)
+(26) test_sysman1			ã·ã¹ãã ç¶æ
+ç®¡çæ©è½ã®ãã¹ã(1)
+(27) test_sysstat1			ã·ã¹ãã ç¶æ
+ã«é¢ãããã¹ã(1)
+(28) test_task1				ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®ãã¹ã(1)
+(29) test_tmevt1.c			ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«ã®ãã¹ã(1)
+
+CPUä¾å¤å¦çã®ãã¹ããã­ã°ã©ã ã®ä¸é¨ã¯ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ãã
+å ´åã«ï¼CPUä¾å¤ãçºçãããå½ä»¤ã®æ¬¡ããå®è¡ãç¶ç¶ããããã¨ãåæã«ä½æ
+ããã¦ããï¼ãã®åæãæãç«ããªãå ´åã«ã¯ï¼ãã¹ããã­ã°ã©ã ã®ã¿ã¼ã²ã
+ãä¾å­å®ç¾©ã«ããã¦ï¼PREPARE_RETURN_CPUEXCã®å®ç¾©ã§å¯¾å¿ãããã¨ãå¿
+è¦ã§ã
+ãï¼è©³ããã¯ï¼ãã¿ã¼ã²ããä¾å­é¨ ãã¼ãã£ã³ã°ã¬ã¤ãããåç
+§ãããã¨ï¼
+
+10.4 ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ããã­ã°ã©ã 
+
+testãã£ã¬ã¯ããªã«ç½®ããã"hrt"ã§å§ã¾ããã­ã°ã©ã ã¯ï¼é«åè§£è½ã¿ã¤ããç¨
+ãã¦å®ç¾ããã·ã¹ãã æå»ç®¡çæ©è½ã«é¢ãããã¹ããè¡ãããã®ãã­ã°ã©ã ã§
+ããï¼
+
+ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ããã­ã°ã©ã ã¯ï¼ãã¹ããã¼ã¿ã«é§åããã¦åä½ã
+ããã¹ãç¨ã®é«åè§£è½ã¿ã¤ãã¢ã¸ã¥ã¼ã«ãå¿
+è¦ã¨ããï¼ãã®ããï¼ãã¹ãç¨ã®
+é«åè§£è½ã¿ã¤ãã¢ã¸ã¥ã¼ã«ãçµã¿è¾¼ãã ã¿ã¼ã²ããä¾å­é¨ãç¨ãã¦ãã¹ããè¡
+ããªããã°ãªããªãï¼
+
+ãã¹ãç¨ã®é«åè§£è½ã¿ã¤ãã¢ã¸ã¥ã¼ã«ãç¨ããã«ã¼ãã«ãã³ã³ãã¤ã«ããéã«
+ã¯ï¼é«åè§£è½ã¿ã¤ãã¢ã¸ã¥ã¼ã«ã®æ§è³ªãåãæããããã®ãã¯ã­å®ç¾©ãå¿
+è¦ã§
+ããï¼å
+·ä½çã«ã¯ï¼-DHRT_CONFIG1ã¾ãã¯-DHRT_CONFIG2ã®ããããã®ã³ã³ãã¤
+ã«ãªãã·ã§ã³ãã¤ããå¿
+è¦ãããï¼ã©ã¡ãã®ã³ã³ãã¤ã«ãªãã·ã§ã³ãä»ããã¹
+ããã¯ï¼ãã¹ããã­ã°ã©ã æ¯ã«æ±ºã¾ã£ã¦ããï¼
+
+ã¾ãï¼ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ããã­ã°ã©ã ã¯ï¼æ©è½ãã¹ããã­ã°ã©ã ã¨å
+æ§ã«ï¼ãã¹ããã­ã°ã©ã ç¨ãµã¼ãã¹ãä½¿ç¨ãã¦ããï¼
+
+ä»¥ä¸ããï¼ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ããã­ã°ã©ã ãã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³
+ã¹ã¯ãªãããä½¿ç¨ãã¦æ§ç¯ããå ´åã«ã¯ï¼æ¬¡ã®ã³ãã³ããå®è¡ããã°ããï¼æ§
+ç¯ç¨ã®ãã£ã¬ã¯ããªãï¼ASP3ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡ã¤ã«ãå±éãããã£ã¬ã¯ã
+ãªã®ç´ä¸ã«ããã¨ä»®å®ãã¦ããï¼ï¼
+
+	% perl ../configure -T <ãã¹ãç¨ã®ã¿ã¼ã²ããç¥ç§°> \
+				 -A <ãã¹ããã­ã°ã©ã å> -a ../test -S test_svc.o \
+				-O -DHRT_CONFIG<1ã¾ãã¯2>
+
+ç¾ãã¼ã¸ã§ã³ã§ç¨æãã¦ããã·ã¹ãã æå»ç®¡çæ©è½ãã¹ããã­ã°ã©ã ã¯æ¬¡ã®é
+ãï¼
+
+(1) hrt_systim1				ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(1)
+(2) hrt_systim2				ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(2)
+(3) hrt_systim3				ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(3)
+(4) hrt_systim4				ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(4)
+
+ãã®å
+ï¼hrt_systim4ã¯-DHRT_CONFIG2ãã¤ãã¦ï¼ä»ã¯-DHRT_CONFIG1ãã¤ãã¦ã³
+ã³ãã¤ã«ãããã¨ï¼
+
+10.5 æ§è½è©ä¾¡ãã­ã°ã©ã 
+
+testãã£ã¬ã¯ããªã«ç½®ããã"perf"ã§å§ã¾ããã­ã°ã©ã ã¯ï¼ã«ã¼ãã«ã®æ§è½è©
+ä¾¡ãè¡ãããã®ãã­ã°ã©ã ã§ããï¼
+
+æ§è½è©ä¾¡ãã­ã°ã©ã ã¯ï¼è¨æ¸¬å¯¾è±¡ã¨ãªãå¦çãç¹°ãè¿ãå®è¡ãï¼ãã®å®è¡æé
+ãè¨æ¸¬ãã¦ï¼å®è¡æéåå¸ãè¡¨ç¤ºããï¼
+
+è¨æ¸¬ããå®è¡æéã«ã¯ï¼æéè¨æ¸¬ã®ãªã¼ããããï¼æéè¨æ¸¬å¦çã®å®è¡ã«ãã
+ãæéï¼ãå«ã¾ããï¼è¨æ¸¬å¯¾è±¡ã®å¦çã®æ­£å³ã®å®è¡æéãæ±ããããã«ã¯ï¼è¨
+æ¸¬ãããæéããï¼æéè¨æ¸¬ã®ãªã¼ãããããè¨æ¸¬ããããã®ãã­ã°ã©ã 
+ï¼perf0ï¼ã§è¨æ¸¬ãããæéãæ¸ç®ããå¿
+è¦ãããï¼
+
+ã¾ãï¼å®è¡æéã®è¨æ¸¬ã¯ï¼å¥ã«è¨è¿°ããªãéãå²è¾¼ã¿ãè¨±å¯ããã¾ã¾è¡ãããï¼
+å²è¾¼ã¿ãã³ãã©ï¼å°ãªãã¨ãï¼ã¿ã¤ãå²è¾¼ã¿ãã³ãã©ï¼ã®å¦çæéãå«ã¾ãã
+å®è¡çµæãè¨æ¸¬ãããï¼
+
+ã«ã¼ãã«ã®æ§è½è©ä¾¡ã«ããã£ã¦ã¯ï¼ãã¼ãã¦ã§ã¢ï¼ç¹ã«ã­ã£ãã·ã¥ï¼ã®è¨­å®ã«
+çæããå¿
+è¦ãããï¼
+
+æ§è½è©ä¾¡ãã­ã°ã©ã ã¯ãã¹ããã­ã°ã©ã ç¨ãµã¼ãã¹ã¨å®è¡æéåå¸éè¨ãµã¼ã
+ã¹ãä½¿ç¨ãã¦ããããï¼æ§ç¯ããå ´åã«ã¯ï¼Makefileã®SYSSVC_COBJSã«ï¼
+test_svc.oã¨histogram.oãè¿½å ããå¿
+è¦ãããï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯
+ãªãããä½¿ç¨ããå ´åã«ã¯ï¼-Sãªãã·ã§ã³ã§test_svc.oã¨histgram.oãæå®ã
+ãï¼å
+·ä½çã«ã¯ï¼æ¬¡ã®ã³ãã³ããå®è¡ããã°ããï¼æ§ç¯ç¨ã®ãã£ã¬ã¯ããªãï¼
+ASP3ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡ã¤ã«ãå±éãããã£ã¬ã¯ããªã®ç´ä¸ã«ããã¨ä»®å®ã
+ã¦ããï¼ï¼
+
+	% perl ../configure -T <ã¿ã¼ã²ããç¥ç§°> -A <æ§è½è©ä¾¡ãã­ã°ã©ã å> \
+									-a ../test -S "test_svc.o histogram.o"
+
+ç¾ãã¼ã¸ã§ã³ã§ç¨æãã¦ããæ§è½è©ä¾¡ãã­ã°ã©ã ã¯æ¬¡ã®éãï¼
+
+(1) perf0		æéè¨æ¸¬ã®ãªã¼ããããã®è©ä¾¡
+
+æéè¨æ¸¬ã®ãªã¼ãããããè¨æ¸¬ããããã®ãã­ã°ã©ã ï¼å
+·ä½çã«ã¯ï¼ç©ºã®ãã­
+ã°ã©ã ï¼begin_mearsureã¨end_measureãç¶ãã¦å¼ã³åºããã­ã°ã©ã ï¼ã®å®è¡æ
+éãè¨æ¸¬ããï¼
+
+ä»ã®æ§è½è©ä¾¡ãã­ã°ã©ã ã§è¨æ¸¬ãããæéããï¼ãã®ãã­ã°ã©ã ã§è¨æ¸¬ããã
+æéãæ¸ç®ããæéãï¼è¨æ¸¬å¯¾è±¡ã®å¦çã®æ­£å³ã®å®è¡æéã§ããï¼
+
+(2) perf1		slp_tskï¼wup_tskã«ããã¿ã¹ã¯åæãæéã®è©ä¾¡
+
+slp_tskï¼wup_tskã«ããã¿ã¹ã¯åæãæéãè¨æ¸¬ããããã®ãã­ã°ã©ã ï¼å
+·ä½
+çã«ã¯ï¼é«ãåªå
+åº¦ã®ã¿ã¹ã¯ãèµ·åºå¾
+ã¡ç¶æ
+ã§ããæã«ï¼ä½ãåªå
+åº¦ã®ã¿ã¹ã¯
+ãwup_tskã«ããé«ãåªå
+åº¦ã®ã¿ã¹ã¯ãèµ·åºãï¼é«ãåªå
+åº¦ã®ã¿ã¹ã¯ã«åãæã
+ãã¾ã§ã®æéã¨ï¼é«ãåªå
+åº¦ã®ã¿ã¹ã¯ãslp_tskã«ããèµ·åºå¾
+ã¡ç¶æ
+ã¨ãªãï¼ä½
+ãåªå
+åº¦ã®ã¿ã¹ã¯ã«åãæããã¾ã§ã®æéãè¨æ¸¬ããï¼
+
+(3) perf2		snd_pdqã®å¦çæéã®è©ä¾¡
+
+åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã«èç©ããã¦ãããã¼ã¿ã®æ°ã«ããï¼snd_pdqã®å¦çæéã
+ã©ã®ããã«å¤åããããè¨æ¸¬ããããã®ãã­ã°ã©ã ï¼å
+·ä½çã«ã¯ï¼åªå
+åº¦ãã¼
+ã¿ã­ã¥ã¼ä¸­ã«é«ãåªå
+åº¦ã®ãã¼ã¿ãnåèç©ããã¦ããæã«ï¼snd_dtqã«ããä½
+ãåªå
+åº¦ã®ãã¼ã¿ãå
+¥ããã®ã«ãããæéãè¨æ¸¬ããï¼nã0ï¼10ï¼20ï¼30ï¼40ï¼
+50ï¼100ï¼200ï¼300ã¨å¤åããã¦è¨æ¸¬ããï¼
+
+(4) perf3		set_flgã®å¦çæéã®è©ä¾¡
+
+å¾
+ã¡è§£é¤ããã¿ã¹ã¯ã®æ°ã«ããï¼set_flgã®å¦çæéãã©ã®ããã«å¤åãããã
+è¨æ¸¬ããããã®ãã­ã°ã©ã ï¼å
+·ä½çã«ã¯ï¼TA_WMULå±æ§ã®ã¤ãã³ããã©ã°ã«å¯¾ã
+ã¦ï¼nåã®ã¿ã¹ã¯ãå¾
+ã£ã¦ããæã«ï¼set_flgã«ãããã®ãã¹ã¦ãå¾
+ã¡è§£é¤ãã
+ã®ã«ãããæéãè¨æ¸¬ããï¼nã0ï¼1ï¼2ï¼3ï¼4ï¼5ï¼10ï¼20ã¨å¤åããã¦è¨æ¸¬ã
+ãï¼
+
+(5) perf4		act_tskã®å¦çæéã¨ã¿ã¹ã¯åæãæéã®è©ä¾¡
+
+act_tskã®å¦çæéã¨ã¿ã¹ã¯åæãæéãè¨æ¸¬ããããã®ãã­ã°ã©ã ï¼å
+·ä½çã«
+ã¯ï¼(1) ã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãï¼ã¿ã¹ã¯åæããèµ·ãããªã
+act_tskã®å¦çæéï¼(2) ã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãï¼ã¿ã¹ã¯åæããèµ·
+ããact_tskã®å¦çæéï¼ã¿ã¹ã¯åæãæéãå«ãï¼ï¼(3) éã¿ã¹ã¯ã³ã³ãã­ã¹
+ãããå¼ã³åºãï¼ã¿ã¹ã¯åæããèµ·ããact_tskã®å¦çæéï¼ã¿ã¹ã¯åæãæé
+ã¨ã¿ã¤ãå²è¾¼ã¿ä¸­ã§å®è¡ãããã·ã¹ãã æå»ã®æ´æ°å¦çæéãå«ãï¼ã®3ã¤ã®æ
+éãè¨æ¸¬ããï¼
+
+(6) perf5		ã¿ã¤ã ã¤ãã³ãå¦çæéã®è©ä¾¡
+
+ã¿ã¤ã ã¤ãã³ããã¼ãæä½ã®ãªã¼ããããã«ããï¼sta_almï¼stp_almã®å¦çæ
+éãã©ã®ããã«å¤åããããè¨æ¸¬ããããã®ãã­ã°ã©ã ï¼å
+·ä½çã«ã¯ï¼ã¿ã¤ã 
+ã¤ãã³ããã¼ãä¸­ã§ã®ãã¼ãã®äº¤æåæ°ãï¼ãªãå ´åï¼å°ãªãå ´åï¼å¤ãå ´å
+ã§ï¼sta_almã¨stp_almã®å¦çæéãè¨æ¸¬ããï¼
+
+
+ï¼ï¼ï¼ä½¿ç¨ä¸ã®æ³¨æã¨ãã³ã
+
+11.1 ã¿ã¤ããã©ã¤ãã®çµè¾¼ã¿
+
+ã¿ã¤ããã©ã¤ããã·ã¹ãã ã«çµã¿è¾¼ãããã«ï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§
+ã³ãã¡ã¤ã«ã®å
+é ­ã§target_timer.cfgãã¤ã³ã¯ã«ã¼ãããå¿
+è¦ãããï¼
+
+11.2 assertãã¯ã­ã®å¦ç
+
+ASP3ã«ã¼ãã«ã®ã³ã¼ãä¸­ã«ã¯ï¼assertãã¯ã­ãä½¿ããã¦ããï¼assertãã¯ã­ã®
+å®ç¾©ã¯t_stddef.hã«å«ã¾ãï¼assertãå¤±æããå ´åã®æå¾ã®å¦çï¼éå¸¸ã¯ï¼ã
+ã­ã°ã©ã ãåæ­¢ãããå¦çï¼ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã®TOPPERS_assert_abortã§
+æ±ºå®ãããï¼
+
+assertãå¤±æããå ´åï¼ã·ã¹ãã éçºä¸­ã¯ãããã¬ã«è½ã¨ãã®ãæã¾ãããï¼
+ã·ã¹ãã ç¨¼åæã®å¯¾å¦æ³ã¯ï¼ã·ã¹ãã ã«å¯¾ããè¦ä»¶ã«ä¾å­ããï¼ããã§ï¼ã¿ã¼
+ã²ããä¾å­é¨ã®TOPPERS_assert_abortãï¼ã·ã¹ãã è¦ä»¶ã«åè´ããé©åãªå¦ç
+ã«ç½®ãæããå¿
+è¦ãããï¼ã·ã¹ãã è¦ä»¶ã«ãã£ã¦ã¯ï¼NDEBUGãå®ç¾©ãã¦assert
+ãã¯ã­ã®å¦çããªãã¸ã§ã¯ãã³ã¼ãä¸­ããæ¶ãï¼ã6.2 ã³ã³ãã¤ã«ãªãã·ã§ã³ã
+ã®ç¯ãåç
+§ï¼æ¹æ³ãèããããï¼
+
+11.3 ã·ã¹ãã ã­ã°æ©è½ã®æ±ã
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ã·ã¹ãã éçºæã®å©ä¾¿æ§ãèæ
+®ãï¼ã·ã¹ãã ã­ã°æ©è½ãçµ
+ã¿è¾¼ãè¨­å®ãããã©ã«ãã¨ãã¦ããï¼
+
+ããã«å¯¾ãã¦ï¼ASP3ã«ã¼ãã«ãç¨ããã·ã¹ãã ãæ©å¨ã«çµã¿è¾¼ãå ´åã¯ï¼ã·ã¹
+ãã ã­ã°æ©è½ãæå³ããªãå ´åãå¤ãï¼æ©å¨ã¸ã®çµè¾¼ã¿ã«éãã¦ã®ã·ã¹ãã ã­
+ã°æ©è½ã®è¨­å®æ¹æ³ã«ã¯ï¼ä»¥ä¸ã®æ¹æ³ãèããããï¼
+
+(1) ã·ã¹ãã ã­ã°æ©è½ãç¨ããªã
+
+ã·ã¹ãã ã­ã°æ©è½ãä¸åä½¿ç¨ããªãå ´åã«ã¯ï¼ã·ã¹ãã ã­ã°æ©è½ãã·ã¹ãã ã«
+çµã¿è¾¼ã¾ãï¼ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã§syslog.cfgãã¤ã³ã¯
+ã«ã¼ãããªãï¼ï¼ã·ã¹ãã ã­ã°æ©è½ã®ãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºãã½ã¼ã¹ãã¡ã¤
+ã«ãTOPPERS_OMIT_SYSLOGãå®ç¾©ãã¦ã³ã³ãã¤ã«ããã°ããï¼
+
+(2) ã­ã°æ
+å ±ã®èç©ã®ã¿ãè¡ã
+
+æ©å¨ã«çµã¿è¾¼ãã ç¶æ
+ã§ï¼ã·ãªã¢ã«ãã¼ãç­ãä»ãã¦ã·ã¹ãã ãå¤é¨ã¨æ¥ç¶ã
+ããã¨ãã§ããå ´åã«ã¯ï¼ã·ã¹ãã ç¨¼åæã«ã¯ã­ã°æ
+å ±ã®èç©ã®ã¿ãè¡ãï¼ã·
+ã¹ãã ã«éå®³ãèµ·ããæãªã©ã«ã­ã°æ
+å ±ãåãåºããã¨ã§ï¼éå®³ã®åå åæã®
+å©ãã¨ãããã¨ãã§ããï¼
+
+å
+·ä½çãªè¨­å®æ¹æ³ã¨ãã¦ï¼æ¬¡ã®2ã¤ã®æ¹æ³ãèããããï¼
+
+(2-1) ä½ã¬ãã«åºåãã¡ã¢ãªã«èç©ãã
+
+å¿
+è¦ãªã­ã°æ
+å ±ãä½ã¬ãã«åºåæ©è½ãç¨ãã¦åºåããããã«è¨­å®ãï¼ä½ã¬ãã«
+ã®æå­åºåé¢æ°ã«éãããæå­ãã¡ã¢ãªï¼å
+¸åçã«ã¯ãªã³ã°ãããã¡ï¼ã«èç©
+ããããã«ããï¼ã·ã¹ãã ã®éå®³æã«ã¯ï¼ãã®ã¡ã¢ãªé åãèª­ã¿åºãï¼ã¿ã¼ã²ã
+ãä¾å­é¨ã®ä½ã¬ãã«åºåã®å¤æ´ãå¿
+è¦ã§ããï¼
+
+(2-2) ã·ã¹ãã ã­ã°æ©è½ã®ã­ã°ãããã¡ã«èç©ãã
+
+å¿
+è¦ãªã­ã°æ
+å ±ãã·ã¹ãã ã­ã°æ©è½ã®ã­ã°ãããã¡ã«è¨é²ããããã«è¨­å®ããï¼
+ã·ã¹ãã ã­ã°ã¿ã¹ã¯ãåä½ãããªãã¨ï¼ã­ã°æ
+å ±ã¯ã­ã°ãããã¡ã«èç©ããã¦
+ããï¼ã·ã¹ãã ã®éå®³æã«ã¯ï¼ã­ã°ãããã¡ã®é åãèª­ã¿åºããï¼ã·ã¹ãã ã­
+ã°ã¿ã¹ã¯ãåä½ããã¦ã­ã°æ
+å ±ãåºåãããï¼
+
+(3) éçºæã®è¨­å®ã®ã¾ã¾ã¨ãã
+
+ã·ã¹ãã ã­ã°æ©è½ã®è¨­å®ãï¼ã·ã¹ãã éçºæã®ã¾ã¾å¤æ´ããï¼ã·ãªã¢ã«ãã¼ã
+ç­ã«ã­ã°æ
+å ±ãåãæµãæ¹æ³ãèããããï¼
+
+11.4 ãªãã¸ã§ã¯ãIDã®ç®¡ç
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ãªãã¸ã§ã¯ãã®IDçªå·ãï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãå²ãä»ã
+ãæ¹æ³ãåºæ¬ã¨ãªã£ã¦ããï¼
+
+ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ä¸­ã§ãªãã¸ã§ã¯ãã®IDçªå·ãåç
+§ããå ´åã«ã¯ï¼
+æ¬¡ã®2ã¤ã®æ¹æ³ãèããããï¼
+
+(1) ãªãã¸ã§ã¯ãè­å¥åãç¨ãã
+
+ãªãã¸ã§ã¯ãçæã®ããã®éçAPIï¼CRE_YYYï¼ã®ç¬¬1ãã©ã¡ã¼ã¿ã«è¨è¿°ãããªã
+ã¸ã§ã¯ãè­å¥åãï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ä¸­ã§ãç¨ããæ¹æ³ï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã¯ï¼ãªãã¸ã§ã¯ãè­å¥åãï¼å²ãä»ããIDçªå·ã«ãã¯ã­å®
+ç¾©ããCè¨èªããªãã­ã»ããµã®ãã£ã¬ã¯ãã£ãï¼#defineï¼ãkernel_cfg.hã«ç
+æããããï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ããkernel_cfg.hãã¤ã³ã¯ã«ã¼ãã
+ãå¿
+è¦ãããï¼
+
+ãã®æ¹æ³ã¯ï¼ãªãã¸ã§ã¯ãã³ã¼ãä¸­ã«IDçªå·ãç´æ¥åãè¾¼ã¾ããããã«å®è¡å¹
+çãè¯ãä¸æ¹ã§ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãå®è¡ããã¦kernel_cfg.hãæ¸ãæãã
+åº¦ã«ï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã®åã³ã³ãã¤ã«ãå¿
+è¦ã«ãªãã¨ããæ¬ ç¹ã
+ããï¼ãã®ããï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ãæ§æãããã¡ã¤ã«ã®ä¸­ã§ï¼ä¸
+é¨ã®ãã¡ã¤ã«ã®ã¿ã§ãªãã¸ã§ã¯ãè­å¥åãåç
+§ããæ§æã«ããã¨ãã£ãå·¥å¤«ã
+ãããã¨ãæã¾ããï¼
+
+(2) ãªãã¸ã§ã¯ãã®IDçªå·ãä¿æããå¤æ°ãç¨ãã
+
+ãªãã¸ã§ã¯ãã®IDçªå·ãä¿æããconstå±æ§ãä»å ããå¤æ°ãç¨æãï¼ã¢ããªã±ã¼
+ã·ã§ã³ãã­ã°ã©ã ä¸­ã§ã¯ï¼ãã®å¤æ°ãç¨ããæ¹æ³ï¼
+
+ä¾ãã°ï¼TASK1ã¨ãããªãã¸ã§ã¯ãè­å¥åã®ã¿ã¹ã¯ã«å¯¾ãã¦ï¼æ¬¡ã®ãããªå¤æ°ã
+ç¨æããï¼
+
+const ID TASK1_id = TASK1;
+
+ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ä¸­ã§ã¯ï¼ãã®å¤æ°ï¼TASK1_idï¼ãç¨ãããã¨ã§ï¼
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãå®è¡ããã¦kernel_cfg.hãæ¸ãæããåº¦ã«ï¼ä¸è¨ã®å¤æ°
+å®ç¾©ãå«ãã ãã¡ã¤ã«ã®ã¿ãåã³ã³ãã¤ã«ããã°ãããã¨ã«ãªãï¼
+
+ãã®æ¹æ³ã¯ï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã®åã³ã³ãã¤ã«ãæå°éã«ã§ããå©
+ç¹ãããä¸æ¹ã§ï¼å¤æ°ã®ããã®ã¡ã¢ãªé åãå¿
+è¦ã«ãªããã¨ã«å ãã¦ï¼ï¼ãã­
+ã»ããµã«ãã£ã¦ã¯ï¼å¤æ°ã¢ã¯ã»ã¹ã®ããã®ãªã¼ãããããçããã¨ããæ¬ ç¹ã
+ããï¼ã¾ãï¼å®æ°ã§ã¯ãªãå¤æ°ã§ãããã¨ããï¼ä»ã®å¤æ°ã®åæåã«ã¯ä½¿ããª
+ãã¨ããå¶éãããï¼
+
+ãªãï¼ASP3ã«ã¼ãã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã¯ï¼--external-idãªãã·ã§ã³ãä»å 
+ãããã¨ã«ããï¼ä¸è¨ã®å¤æ°å®ç¾©ãkernel_cfg.cä¸­ã«çæããæ©è½ãæã£ã¦ã
+ãã®ã§ï¼ãã¹ã¦ã®ãªãã¸ã§ã¯ãIDããã®æ¹æ³ã§åç
+§ããå ´åã«ã¯ï¼ãã®æ©è½ã
+ç¨ãããã¨ãæ¨å¥¨ããï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«ããIDçªå·å²ä»ãã®ãã1ã¤ã®èª²é¡ã¨ãã¦ï¼ã³ã³ãã£ã®ã¥
+ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã®ä¿®æ­£ã«ããï¼ãªãã¸ã§ã¯ãIDã®å²ä»ããå¤ãã£ã¦ãã¾ã
+ãã¨ãæããããï¼ããã¯ï¼ã¢ããªã±ã¼ã·ã§ã³ã½ããã¦ã§ã¢ã®è¨­è¨ä»æ§æ¸ã«ID
+çªå·ãè¨è¼ããã¦ããå ´åãï¼ãããã°ä½æ¥­ã«ããã¦IDçªå·ãç´æ¥æ±ã£ã¦ãã
+å ´åã«ï¼ä½æ¥­å¹çãä½ä¸ãããå¯è½æ§ãèããããï¼
+
+ãã®åé¡ã«å¯¾å¿ããããã«ï¼ASP3ã«ã¼ãã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«ï¼IDçªå·ã®
+å²ä»ãçµæããã¡ã¤ã«ã«æ¸ãåºãæ©è½ï¼--id-output-fileãªãã·ã§ã³ï¼ã¨ï¼ID
+çªå·ã®å²ä»ãããã¡ã¤ã«ããåãè¾¼ãæ©è½ï¼--id-input-fileãªãã·ã§ã³ï¼ãç¨
+æãã¦ããï¼ãããã®æ©è½ãç¨ãã¦ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãå®è¡ããåº¦ã«ï¼å
+åã«å®è¡ããæã«ãã¡ã¤ã«ã«æ¸ãåºããIDçªå·ã®å²ä»ããåãè¾¼ããã¨ã§ï¼å
+åå®è¡æã¨åãå²ä»ããè¡ããã¨ãã§ããï¼ãã ãï¼ASP3ã«ã¼ãã«ã§ã¯ï¼IDçª
+å·ã«æããããã®ã¯è¨±ãããªãããï¼ãªãã¸ã§ã¯ãã®æ°ãæ¸ã£ãå ´åã«ã¯ï¼ID
+çªå·ãå¤§ããæ¹ã®ãªãã¸ã§ã¯ããæ¸ã£ãå ´åãé¤ãã¦ï¼ã¨ã©ã¼ã¨ãªãï¼ãã®å ´
+åã«ã¯ï¼ããã¼ã®ãªãã¸ã§ã¯ããçæããæ¹æ³ã§åé¿ãããããªãï¼
+
+11.5 ã«ã¼ãã«ã®å
+é¨ã·ã³ãã«ã®ãªãã¼ã 
+
+ASP3ã«ã¼ãã«ã§ã¯ï¼ã¢ã¸ã¥ã¼ã«å
+é¨ã®åç§°ãä»ã®ã¢ã¸ã¥ã¼ã«å
+é¨ã®åç§°ã¨è¡çª
+ãããã¨ãé¿ããããã«ï¼ã«ã¼ãã«ã®å
+é¨ã·ã³ãã«ã¯ï¼Cè¨èªã¬ãã«ã§ï¼å
+é ­ã
+"_kernel_"ã¾ãã¯"_KERNEL_"ã§ããåç§°ã¨ãã¦ããï¼
+
+ãããã½ã¼ã¹ã³ã¼ãã®å¯èª­æ§ã¨ä¸¡ç«ãããããã«ï¼ASP3ã«ã¼ãã«ã§ã¯ï¼ã½ã¼ã¹
+ã³ã¼ãã¯èªç¶ãªååãç¨ãã¦è¨è¿°ãï¼Cè¨èªããªãã­ã»ããµã®ãã¯ã­å®ç¾©
+ï¼#defineï¼ãç¨ãã¦ï¼ããã"_kernel_"ã¾ãã¯"_KERNEL_"ã§å§ã¾ãååï¼èªç¶
+ãªååãyyyyyã®å ´åã«ã¯ï¼_kernel_yyyyyï¼ã«ãªãã¼ã ããä»çµã¿ãç¨ãã¦ã
+ãï¼
+
+å
+·ä½çã«ã¯ï¼é¢é£ãããã£ã¬ã¯ããªã«xxx_rename.defãç½®ãï¼ãããããªãã¼
+ã ã®ããã®ããããã¡ã¤ã«ï¼xxx_rename.hããã³xxx_unrename.hï¼ãçæãã
+ãã¼ã«ï¼utils/genrenameï¼ãç¨æãã¦ããï¼
+
+ãã®ä»çµã¿ã¯ï¼ã½ã¼ã¹ã³ã¼ãã®å¯èª­æ§åä¸ã«å½¹ç«ã¤ä¸æ¹ã§ï¼å¼å®³ãããï¼ä¾ã
+ã°ï¼å¤ãã®ãããã¬ã§ï¼ã½ã¼ã¹ã³ã¼ãä¸­ã®åç§°ã¨ãªãã¸ã§ã¯ãã³ã¼ãä¸­ã®åç§°
+ãç°ãªãããã«ï¼ã½ã¼ã¹ã³ã¼ãä¸­ã®å¤æ°åãæå®ãã¦å¤ãèª­ãã ãï¼é¢æ°åã
+æå®ãã¦ãã¬ã¼ã¯ãã¤ã³ããç½®ãã¨ãã£ããã¨ãã§ããªãï¼
+
+ãã®ç¶æ³ã«å¯¾å¿ããããã«ï¼ASP3ã«ã¼ãã«ã§ã¯ï¼ã½ã¼ã¹ã³ã¼ãä¸­ã®è©²å½ããå
+ç§°ããªãã¼ã ããããã®ã¦ã¼ãã£ãªãã£ï¼utils/applyrenameï¼ãç¨æãã¦ããï¼
+applyrenameã¦ã¼ãã£ãªãã£ã«ï¼ãªãã¼ã å®ç¾©ãã¡ã¤ã«ï¼xxx_rename.defï¼ã®ã
+ãªãã£ãã¯ã¹ï¼xxxã®é¨åï¼ã¨ï¼ãªãã¼ã ããããã¡ã¤ã«ãªã¹ããä¸ããã¨ï¼ãª
+ãã¼ã å¦çãè¡ãªãï¼ä¾ãã°ï¼kernelãã£ã¬ã¯ããªã®ãã¹ã¦ã®ãã¡ã¤ã«ã«å¯¾ã
+ã¦ï¼ã«ã¼ãã«ã®å
+é¨ã·ã³ãã«ããªãã¼ã ããã«ã¯ï¼æ¬¡ã®ã³ãã³ããå®è¡ããã°
+ããï¼
+
+	% cd kernel
+	% ../utils/applyrename kernel *
+
+ã¾ãï¼ã¿ã¼ã²ããä¾å­é¨ã®ãã£ã¬ã¯ããªã®ãã¹ã¦ã®ãã¡ã¤ã«ã«å¯¾ãã¦ï¼ã«ã¼ã
+ã«ã®å
+é¨ã·ã³ãã«ããªãã¼ã ããã«ã¯ï¼æ¬¡ã®ãããªã³ãã³ããå®è¡ããã°ããï¼
+
+	% cd target/ct11mpcore_gcc/
+	% ../../utils/applyrename target *
+	% ../../utils/applyrename ../../kernel/kernel *
+
+11.6 ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ãã®ä½¿ç¨æ¹æ³
+
+ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ããã¿ã¼ã²ããä¾å­é¨ã«çµã¿è¾¼ã¾ãã¦ããå ´
+åã«ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã¹ã¯ãªããã«ãããä½¿ç¨ãããã¨ãæç¤ºãã
+ãªãã·ã§ã³ï¼-rï¼ãä»å ãããã¨ã§ï¼ã¡ã¢ãªä¸ã«ãã¬ã¼ã¹ã­ã°ãè¨é²ããæ©è½
+ãæå¹ã«ãªãï¼
+
+ãã¬ã¼ã¹ã­ã°è¨é²ã®ä½¿ç¨æ¹æ³ã®ä¸ä¾ã¨ãã¦ï¼ã·ã¹ãã èµ·åæã«ãã¬ã¼ã¹ã­ã°ã®
+è¨é²ãéå§ãï¼ã·ã¹ãã çµäºæã«è¨é²ãããã¬ã¼ã¹ã­ã°ããã³ãããããã«ã¯ï¼
+ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã«æ¬¡ã®ãããªè¨è¿°ãè¿½å ããï¼
+
+	#include "arch/logtrace/trace_config.h"
+	ATT_INI({ TA_NULL, TRACE_AUTOSTOP, trace_initialize });
+	ATT_TER({ TA_NULL, target_fput_log, trace_dump });
+
+ããã§ï¼åæåã«ã¼ãã³ï¼trace_initializeï¼ã¸ã®å¼æ°ã¯ï¼åæåç´å¾ã®ãã¬ã¼
+ã¹ã­ã°ã®åä½ã¢ã¼ããæå®ãããã®ã§ããï¼æå®ã§ããåä½ã¢ã¼ãã«ã¤ãã¦ã¯ï¼
+arch/logtrace/trace_config.hä¸­ã®ã³ã¡ã³ãã«èª¬æãããï¼
+
+çµäºå¦çã«ã¼ãã³ï¼trace_dumpï¼ã¯ï¼è¨é²ããããã¬ã¼ã¹ã­ã°ãã¿ã¼ã²ããä¾
+å­ã®ä½ã¬ãã«åºåæ©è½ãå©ç¨ãã¦ãã³ãããããã®ãã®ã§ããï¼ãã¬ã¼ã¹ã­ã°
+ãå¥ã®æ¹æ³ã§åãåºãå ´åã«ã¯ï¼çµäºå¦çã«ã¼ãã³ãç»é²ããå¿
+è¦ã¯ãªãï¼
+
+ä»¥ä¸ã®æ¹æ³ã§ã¯ï¼trace_initializeãåæåã«ã¼ãã³ã§ï¼trace_dumpãçµäºå¦
+çã«ã¼ãã³ã§å¼ã³åºãã¦ããããï¼åæåã«ã¼ãã³ãå¼ã³åºãåãçµäºå¦çã«ã¼
+ãã³ãå¼ã³åºããå¾ã«ã¯ï¼ãã¬ã¼ã¹ã­ã°è¨é²ã®æ©è½ãå©ç¨ã§ããªãï¼åæåã«ã¼
+ãã³ãå¼ã³åºãåãçµäºå¦çã«ã¼ãã³ãå¼ã³åºããå¾ã«å®è¡ãããå¦çï¼ä¾ã
+ã°ï¼ã«ã¼ãã«ãªãã¸ã§ã¯ãã®åæåå¦çãï¼trace_initializeãããå
+ã«ç»é²
+ããåæåã«ã¼ãã³ï¼trace_dumpãããå
+ã«ç»é²ããçµäºå¦çã«ã¼ãã³ï¼ã§ã
+ã¬ã¼ã¹ã­ã°è¨é²ã®æ©è½ãå©ç¨ããããã«ã¯ï¼trace_initializeã¨trace_dumpã
+é©åãªå ´æã§å¼ã¶ããã«ä¿®æ­£ãããã¨ãå¿
+è¦ã§ããï¼
+
+11.7 ã·ã¹ãã ã®èµ·åæã®åæåå¦ç
+
+ã·ã¹ãã ã®èµ·åæã«ã¢ããªã±ã¼ã·ã§ã³ã§å¿
+è¦ã¨ãªãåæåå¦çãè¡ãããã®æ©
+è½ã¨ãã¦åæåã«ã¼ãã³ãç¨æããã¦ãããï¼åæåã«ã¼ãã³ãå®è¡ãããã
+ããæ©ãã¿ã¤ãã³ã°ã§å®è¡ãããã¨ãå¿
+è¦ãªåæåå¦çãããå ´åãããï¼
+
+ãã®ãããªå ´åã«ç¨ããããã«ï¼æ¨æºçãªã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ããï¼ã¿ã¼
+ã²ããã·ã¹ãã ä¾å­ã®åæåããã¯ï¼hardware_init_hookï¼ãå¼ã³åºããã¨ã¨
+ãã¦ããï¼hardware_init_hookã¯ï¼ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã§ç¨æããã¦
+ããã®ãæ¨æºã§ãããï¼ãããã¢ããªã±ã¼ã·ã§ã³ã§ç¨æãããã®ã«ç½®ãæãï¼
+ãã®ä¸­ã§ã¢ããªã±ã¼ã·ã§ã³ã§å¿
+è¦ã¨ãªãåæåå¦çãè¡ããã¨ãã§ããï¼
+
+ãã ãï¼hardware_init_hookã®ä½æããå ´åã«ã¯ï¼bssã»ã¯ã·ã§ã³ã¨dataã»ã¯ã·ã§
+ã³ãåæåããã¦ããªããã¨ãï¼ã©ã¤ãã©ãªãåæåããã¦ããªããã¨ï¼Cè¨èª
+ã§è¨è¿°ã§ããã¨ã¯éããªããã¨ãªã©ã«æ³¨æãå¿
+è¦ã§ããï¼ä½æã«ããã£ã¦ã¯ï¼
+ãã¿ã¼ã²ããä¾å­é¨ ãã¼ãã£ã³ã°ã¬ã¤ãããåç
+§ãããã¨ï¼
+
+ã«ã¼ãã«ã®ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ãhardware_init_hookãå¼ã³åºãããã«
+å®è£
+ããã¦ããªãå ´åã«ã¯ï¼ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ãã¢ããªã±ã¼ã·ã§ã³ã§
+ç¨æãããã®ã«ç½®ãæããæ¹æ³ãæ¨å¥¨ããï¼
+
+11.8 rodataã»ã¯ã·ã§ã³ãRAMã«ç½®ãå ´å
+
+ä½ããã®çç±ã§rodataã»ã¯ã·ã§ã³ãRAMã«ç½®ãå ´åï¼dataã»ã¯ã·ã§ã³ã¨åæ§ã«ï¼
+ãã®åæå¤ã¯ROMã«ç½®ãï¼ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã§RAMã«ã³ãã¼ããã®ãç´ 
+ç´ã§ããï¼ãããå®ç¾ããã«ã¯ï¼dataã»ã¯ã·ã§ã³ã®åæ±ããåèã«ï¼ãªã³ã«ã¹
+ã¯ãªããã¨ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ãä¿®æ­£ããå¿
+è¦ããããï¼ããã«å ãã¦ï¼
+ä»¥ä¸ã®æªç½®ãå¿
+è¦ã§ããï¼
+
+ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã¯ï¼ãã¹1ã¨ãã¹3ã«ããã¦ï¼ã­ã¼ãã¢ã¸ã¥ã¼ã«ã®ã·ã³ãã«
+ãã¡ã¤ã«ãç¨ãã¦ï¼ã­ã¼ãã¢ã¸ã¥ã¼ã«å
+ã®rodataã»ã¯ã·ã§ã³ãèª­ã¿è¾¼ããã¨ã§ï¼
+åç¨®ã®å®æ°å¤ãåå¾ããï¼ãã®ããï¼rodataã»ã¯ã·ã§ã³ãdataã»ã¯ã·ã§ã³ã¨å
+æ§ã«æ±ãã¨ï¼ãã®ã¢ã¯ã»ã¹ã¢ãã¬ã¹ï¼RAMå
+ã®ã¢ãã¬ã¹ï¼VMAã¨å¼ã¶ï¼ã¨é
+ç½®ã¢
+ãã¬ã¹ï¼ROMå
+ã®ã¢ãã¬ã¹ï¼LMAã¨å¼ã¶ï¼ãä¸è´ããªããªãããã«ï¼å®æ°å¤ãå
+å¾ãããã¨ãã§ããï¼ã¨ã©ã¼ã¨ãªãï¼
+
+ãã¹1ã§ã®ã¨ã©ã¼ãåé¿ããããã«ã¯ï¼ãã¹1ã®ãªã³ã¯æï¼cfg1_outããªã³ã¯ã
+ãæï¼ã«ã¯ï¼rodataã»ã¯ã·ã§ã³ã®ã¢ã¯ã»ã¹ã¢ãã¬ã¹ã¨é
+ç½®ã¢ãã¬ã¹ãä¸è´ãã
+ããªã³ã«ã¹ã¯ãªããï¼æ¨æºã®ãªã³ã«ã¹ã¯ãªããã¯ãã®ããã«ãªã£ã¦ããï¼ãç¨
+ããï¼ãµã³ãã«ã®Makefileã§ã¯ï¼LDSCRIPTã«ãããªã³ã«ã¹ã¯ãªãããæå®ãã
+ã®ã§ã¯ãªãï¼LDFLAGSã¨CFG1_OUT_LDFLAGSã«ç°ãªããªã³ã«ã¹ã¯ãªãããç¨ãããª
+ãã·ã§ã³ãè¨­å®ããã°ããï¼
+
+ãã¹3ã§ã®ã¨ã©ã¼ãåé¿ããããã«ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹3ã®ãã³ãã¬ã¼
+ããã¡ã¤ã«ã«ããã¦ï¼rodataã»ã¯ã·ã§ã³ã®å
+å®¹ãï¼é
+ç½®ã¢ãã¬ã¹ããã¢ã¯ã»ã¹
+ã¢ãã¬ã¹ã«ã³ãã¼ããï¼ãã®ããã«ã¯ï¼ãã¹3ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ã
+ãä¾å­é¨ã§ï¼LMA.ORDER_LISTç­ã®ãã³ãã¬ã¼ããã¡ã¤ã«å¤æ°ãè¨­å®ããã°ããï¼
+å
+·ä½çãªæ¹æ³ã¯ï¼ãã¿ã¼ã²ããä¾å­é¨ ãã¼ãã£ã³ã°ã¬ã¤ãããåç
+§ãããã¨ï¼
+
+
+ï¼ï¼ï¼åèæ
+å ±
+
+12.1 å©ç¨æ¡ä»¶ã¨å©ç¨å ±å
+
+ASP3ã«ã¼ãã«ã®å©ç¨æ¡ä»¶ã¯ï¼åãã¡ã¤ã«ã®å
+é ­ã«è¡¨ç¤ºããã¦ããï¼èä½æ¨©ã¯ï¼
+åãã¡ã¤ã«ã®å
+é ­ã«è¡¨ç¤ºããã¦ããèä½æ¨©è
+ãä¿æãã¦ããï¼
+
+å©ç¨æ¡ä»¶ã®(3)ã®(b)ã«ããã¦ï¼å©ç¨ã®å½¢æ
+ãTOPPERSãã­ã¸ã§ã¯ãã«å ±åããæ¹
+æ³ã¨ãã¦ã¯ï¼ASP3ã«ã¼ãã«ãå©ç¨ããè£½åã®åç§°ã¨å¿ç¨åéï¼è£½ååããä¼ç¤¾
+åã¨æ¥­ç¨®ç­ã®æ
+å ±ãï¼ä»¥ä¸ã®URLã®ãã¼ã¸ããå ±åãããã®ã¨ããï¼
+
+	http://www.toppers.jp/report.html
+
+ã¾ããã®éã«ï¼ASP3ã«ã¼ãã«ãä½¿ç¨ãã¦ã®ã³ã¡ã³ãããæè¦ãããã ããã¨å¹¸
+ãã§ããï¼
+
+12.2 ä¿è¨¼ã»é©ç¨æ§ã»ãµãã¼ã
+
+ASP3ã«ã¼ãã«ã¯ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼éçºè
+ããã³TOPPERSãã­
+ã¸ã§ã¯ãã¯ï¼ASP3ã«ã¼ãã«ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®çã«å¯¾ããé©åæ§ãå«ãã¦ï¼
+ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼ASP3ã«ã¼ãã«ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥
+çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ãã®è²¬ä»»ãè² ããªãï¼
+
+éçºè
+ããã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼ASP3ã«ã¼ãã«ã«é¢ãããµãã¼ãã®ç´æã¯
+ãã¦ããªãï¼ASP3ã«ã¼ãã«ã«é¢ãã¦è³ªåãããå ´åã¯ï¼å¾è¿°ã®TOPPERSã¦ã¼ã¶ã¼
+ãºã¡ã¼ãªã³ã°ãªã¹ããå©ç¨ãã¦ããã ããã¨å¹¸ãã§ããï¼ç¢ºå®ãªãµãã¼ããå¿
+
+è¦ãªå ´åã«ã¯ï¼æåã§ãµãã¼ããµã¼ãã¹ãæä¾ãã¦ããä¼ç¤¾ã«ç¸è«ããããï¼
+
+12.3 ãã°ã¬ãã¼ã
+
+ASP3ã«ã¼ãã«ã«ãã°ãåé¡ç¹ãçºè¦ãããå ´åã«ã¯ï¼å¾è¿°ã®TOPPERSã¦ã¼ã¶ã¼ãº
+ã¡ã¼ãªã³ã°ãªã¹ãã«å ±åãã¦æ¬²ããï¼
+
+ã¡ã¼ãªã³ã°ãªã¹ãã«ãã°ãåé¡ç¹ãªã©ãå ±åããå ´åã«ã¯ï¼å¿
+è¦ã«å¿ãã¦æ¬¡ã®
+æ
+å ±ãç¥ããã¦æ¬²ããï¼
+
+	ä½¿ç¨ãã¦ããã«ã¼ãã«ã«é¢ããæ
+å ±
+		ã»ã¿ã¼ã²ããéä¾å­é¨ã®ãã¼ã¸ã§ã³
+		ã»ä½¿ç¨ãã¦ããã¿ã¼ã²ããä¾å­é¨ã¨ãã®ãã¼ã¸ã§ã³
+		ã»TOPPERSãã­ã¸ã§ã¯ãããã®ãªãªã¼ã¹ã«å¯¾ããæ¹é ç®æï¼ããã°ï¼
+
+	ã¿ã¼ã²ããã·ã¹ãã ã«é¢ããæ
+å ±
+		ã»ã¿ã¼ã²ãããã­ã»ããµã®ç¨®é¡
+		ã»ã¿ã¼ã²ãããã¼ãç­ã®ç¨®é¡
+
+	ãã¹ãã«é¢ããæ
+å ±
+		ã»OSã®ãã¼ã¸ã§ã³ï¼ãµã¼ãã¹ããã¯ã®é©ç¨ç¶æ³ãï¼
+		ã»ã³ã³ãã¤ã©ãªã©ã®éçºç°å¢ã®ãã¼ã¸ã§ã³ï¼Cygwinã®ãã¼ã¸ã§ã³ãï¼
+
+12.4 ã¦ã§ããµã¤ã
+
+TOPPERSãã­ã¸ã§ã¯ãã®ã¦ã§ããµã¤ãã¯ï¼ä»¥ä¸ã®URLã«ããï¼
+
+	http://www.toppers.jp/
+
+TOPPERSãã­ã¸ã§ã¯ããASP3ã«ã¼ãã«ã«é¢ããææ°æ
+å ±ã¯ï¼ãã®ã¦ã§ããµã¤ãã
+ãå¾ããã¨ãã§ããï¼ã¾ãï¼ASP3ã«ã¼ãã«ã®ææ°çã¯ï¼ãã®ã¦ã§ããµã¤ããã
+ãã¦ã³ã­ã¼ããããã¨ãã§ããï¼
+
+12.5 TOPPERSã¦ã¼ã¶ã¼ãºã¡ã¼ãªã³ã°ãªã¹ã
+
+ASP3ã«ã¼ãã«ãå«ãTOPPERSãã­ã¸ã§ã¯ãã®éçºææç©ã®ã¦ã¼ã¶ã«å¯¾ããæ
+å ±æ
+ä¾ããã³ã¦ã¼ã¶ç¸äºéã®æ
+å ±äº¤æãå®¹æã«ããããã«ï¼TOPPERSã¦ã¼ã¶ã¼ãºã¡ã¼
+ãªã³ã°ãªã¹ãï¼users@toppers.jpï¼ãç¨æãã¦ããï¼
+
+ãã®ã¡ã¼ãªã³ã°ãªã¹ãã«ã¯ï¼èª°ã§ãèªç±ã«ç»é²ãï¼ã¡ã¼ã«ãéä»ãããã¨ãã§
+ããï¼ç»é²è
+ä»¥å¤ã¯ã¡ã¼ã«ãéä»ã§ããªãï¼ï¼ã¾ãï¼éä»ãããã¡ã¼ã«ã¯ï¼èª°
+ã§ãèªç±ã«ã¦ã§ããµã¤ãã§èª­ããã¨ãã§ããï¼
+
+ã¡ã¼ãªã³ã°ãªã¹ãã¸ã®ç»é²æ¹æ³ã«ã¤ãã¦ã¯ï¼ä»¥ä¸ã®URLã®ãã¼ã¸ã«èª¬æãããï¼
+
+	http://www.toppers.jp/community.html
+
+12.6 TOPPERSãã­ã¸ã§ã¯ãã®ã¡ã³ãåãã®ãµã¼ãã¹
+
+TOPPERSãã­ã¸ã§ã¯ãã®ã¡ã³ãã«å¯¾ãã¦ã¯ï¼ä¸è¨ã«å ãã¦ï¼ASP3ã«ã¼ãã«ã«é¢é£
+ãã¦æ¬¡ã®ãµã¼ãã¹ãç¨æãã¦ããï¼
+
+(1) TOPPERSéçºè
+ã¡ã¼ãªã³ã°ãªã¹ã
+
+TOPPERSãã­ã¸ã§ã¯ãã®ã¡ã³ãã¯ï¼ASP3ã«ã¼ãã«ã«é¢ããè³ªåï¼ãã°ãåé¡ç¹ãª
+ã©ã®å ±åã«ï¼TOPPERSéçºè
+ã¡ã¼ãªã³ã°ãªã¹ãï¼dev@toppers.jpï¼ãå©ç¨ããã
+ã¨ãã§ããï¼
+
+(2) ASP3ã«ã¼ãã«ã®éçºæ¯æ´ãµã¤ã
+
+ASP3ã«ã¼ãã«ã®éçºæ¯æ´ã®ããã®TRACï¼ãã°ãã©ãã­ã³ã°ã·ã¹ãã ï¼ãï¼ä»¥ä¸
+ã®URLã«ããï¼TRACã¸ã®ã¢ã¯ã»ã¹ã«ã¯ï¼ä¼å¡ãã¹ã¯ã¼ããå¿
+è¦ã§ããï¼ï¼
+
+	http://dev.toppers.jp/trac/asp3/
+
+TOPPERSãã­ã¸ã§ã¯ãã®ã¡ã³ãã¯ï¼ãã®ãµã¤ãããï¼ã¦ã§ãã¤ã³ã¿ãã§ã¼ã¹ãã
+ã³subversionãµã¼ãã«ããï¼ASP3ã«ã¼ãã«ã®éçºä¸­ã®ãã¼ã¸ã§ã³ãå¾ããã¨ã
+ã§ããï¼ã¾ãï¼ãã°ãã©ãã­ã³ã°ãã¼ã¿ãã¼ã¹ã«ã¢ã¯ã»ã¹ãããã¨ãã§ãï¼é
+å»ã®ãã°å±¥æ­´ã¸ã®ã¢ã¯ã»ã¹ãï¼ãã°ã®ç»é²ããããã¨ãã§ããï¼
+
+12.7 TOPPERSãã­ã¸ã§ã¯ãã¸ã®åå 
+
+TOPPERSãã­ã¸ã§ã¯ãã§ã¯ï¼ä½ããã®å½¢ã§ãã­ã¸ã§ã¯ãã«è²¢ç®ãã¦ããã ããæ¹ï¼
+ãã­ã¸ã§ã¯ãã§éçºããã½ããã¦ã§ã¢ããä½¿ãã®æ¹ï¼ãã­ã¸ã§ã¯ãã«èå³ãã
+æã¡ã®æ¹ã®åå ãæ±ãã¦ããï¼TOPPERSãã­ã¸ã§ã¯ãã¸ã®åå æ¹æ³ã«ã¤ãã¦ã¯ï¼
+ä»¥ä¸ã®ãã¼ã¸ã«èª¬æãããï¼
+
+	http://www.toppers.jp/joinus.html
+
+
+ï¼ï¼ï¼ãªãã¡ã¬ã³ã¹
+
+13.1 ãµã¼ãã¹ã³ã¼ã«ä¸è¦§
+
+(1) ã¿ã¹ã¯ç®¡çæ©è½
+
+	ER ercd = act_tsk(ID tskid)
+	ER_UINT	actcnt = can_act(ID tskid)
+	ER ercd = get_tst(ID tskid, STAT *p_tskstat)
+	ER ercd = chg_pri(ID tskid, PRI tskpri)
+	ER ercd = get_pri(ID tskid, PRI *p_tskpri)
+	ER ercd = get_inf(intptr_t *p_exinf)
+	ER ercd = ref_tsk(ID tskid, T_RTSK *pk_rtsk)
+
+(2) ã¿ã¹ã¯ä»å±åææ©è½
+
+	ER ercd = slp_tsk(void)
+	ER ercd = tslp_tsk(TMO tmout)
+	ER ercd = wup_tsk(ID tskid)
+	ER_UINT wupcnt = can_wup(ID tskid)
+	ER ercd = rel_wai(ID tskid)
+	ER ercd = sus_tsk(ID tskid)
+	ER ercd = rsm_tsk(ID tskid)
+	ER ercd = dly_tsk(RELTIM dlytim)
+
+(3) ã¿ã¹ã¯çµäºæ©è½
+
+	ER ercd = ext_tsk(void)
+	ER ercd = ras_ter(ID tskid)
+	ER ercd = dis_ter(void)
+	ER ercd = ena_ter(void)
+	bool_t state = sns_ter(void)
+	ER ercd = ter_tsk(ID tskid)
+
+(4) åæã»éä¿¡æ©è½
+
+	ER ercd = sig_sem(ID semid)
+	ER ercd = wai_sem(ID semid)
+	ER ercd = pol_sem(ID semid)
+	ER ercd = twai_sem(ID semid, TMO tmout)
+	ER ercd = ini_sem(ID semid)
+	ER ercd = ref_sem(ID semid, T_RSEM *pk_rsem)
+
+	ER ercd = set_flg(ID flgid, FLGPTN setptn)
+	ER ercd = clr_flg(ID flgid, FLGPTN clrptn)
+	ER ercd = wai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn)
+	ER ercd = pol_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn)
+	ER ercd = twai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn, TMO tmout)
+	ER ercd = ini_flg(ID flgid)
+	ER ercd = ref_flg(ID flgid, T_RFLG *pk_rflg)
+
+	ER ercd = snd_dtq(ID dtqid, intptr_t data)
+	ER ercd = psnd_dtq(ID dtqid, intptr_t data)
+	ER ercd = tsnd_dtq(ID dtqid, intptr_t data, TMO tmout)
+	ER ercd = fsnd_dtq(ID dtqid, intptr_t data)
+	ER ercd = rcv_dtq(ID dtqid, intptr_t *p_data)
+	ER ercd = prcv_dtq(ID dtqid, intptr_t *p_data)
+	ER ercd = trcv_dtq(ID dtqid, intptr_t *p_data, TMO tmout)
+	ER ercd = ini_dtq(ID dtqid)
+	ER ercd = ref_dtq(ID dtqid, T_RDTQ *pk_rdtq)
+
+	ER ercd = snd_pdq(ID pdqid, intptr_t data, PRI datapri)
+	ER ercd = psnd_pdq(ID pdqid, intptr_t data, PRI datapri)
+	ER ercd = tsnd_pdq(ID pdqid, intptr_t data, PRI datapri, TMO tmout)
+	ER ercd = rcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri)
+	ER ercd = prcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri)
+	ER ercd = trcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri, TMO tmout)
+	ER ercd = ini_pdq(ID pdqid)
+	ER ercd = ref_pdq(ID pdqid, T_RPDQ *pk_rpdq)
+
+	ER ercd = loc_mtx(ID mtxid)
+	ER ercd = ploc_mtx(ID mtxid)
+	ER ercd = tloc_mtx(ID mtxid, TMO tmout) 
+	ER ercd = unl_mtx(ID mtxid)
+	ER ercd = ini_mtx(ID mtxid)
+	ER ercd = ref_mtx(ID mtxid, T_RMTX *pk_rmtx)
+
+(5) ã¡ã¢ãªãã¼ã«ç®¡çæ©è½
+
+	ER ercd = get_mpf(ID mpfid, void **p_blk)
+	ER ercd = pget_mpf(ID mpfid, void **p_blk)
+	ER ercd = tget_mpf(ID mpfid, void **p_blk, TMO tmout)
+	ER ercd = rel_mpf(ID mpfid, void *blk)
+	ER ercd = ini_mpf(ID mpfid)
+	ER ercd = ref_mpf(ID mpfid, T_RMPF *pk_rmpf)
+
+(6) æéç®¡çæ©è½
+
+	ER ercd = set_tim(SYSTIM systim)
+	ER ercd = get_tim(SYSTIM *p_systim)
+	ER ercd = adj_tim(int32_t adjtim)
+	HRTCNT ercd = fch_hrt(void)
+
+	ER ercd = sta_cyc(ID cycid)
+	ER ercd = stp_cyc(ID cycid)
+	ER ercd = ref_cyc(ID cycid, T_RCYC *pk_rcyc)
+
+	ER ercd = sta_alm(ID almid, RELTIM almtim)
+	ER ercd = stp_alm(ID almid)
+	ER ercd = ref_alm(ID almid, T_RALM *pk_ralm)
+
+(7) ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+
+	ER ercd = rot_rdq(PRI tskpri)
+	ER ercd = get_tid(ID *p_tskid)
+	ER ercd = get_lod(PRI tskpri, uint_t *p_load)
+	ER ercd = get_nth(PRI tskpri, uint_t nth, ID *p_tskid)
+	ER ercd = loc_cpu(void)
+	ER ercd = unl_cpu(void)
+	ER ercd = dis_dsp(void)
+	ER ercd = ena_dsp(void)
+	bool_t state = sns_ctx(void)
+	bool_t state = sns_loc(void)
+	bool_t state = sns_dsp(void)
+	bool_t state = sns_dpn(void)
+	bool_t state = sns_ker(void)
+	ER ercd = ext_ker(void)
+
+(8) å²è¾¼ã¿ç®¡çæ©è½
+
+	ER ercd = dis_int(INTNO intno)
+	ER ercd = ena_int(INTNO intno)
+	ER ercd = chg_ipm(PRI intpri)
+	ER ercd = get_ipm(PRI *p_intpri)
+
+(9) CPUä¾å¤ç®¡çæ©è½
+
+	bool_t stat = xsns_dpn(void *p_excinf)
+
+13.2 éçAPIä¸è¦§
+
+(1) ã¿ã¹ã¯ç®¡çæ©è½
+
+	CRE_TSK(ID tskid, { ATR tskatr, intptr_t exinf, TASK task,
+								PRI itskpri, size_t stksz, STK_T *stk })
+
+(4) åæã»éä¿¡æ©è½
+
+	CRE_SEM(ID semid, { ATR sematr, uint_t isemcnt, uint_t maxsem })
+	CRE_FLG(ID flgid, { ATR flgatr, FLGPTN iflgptn })
+	CRE_DTQ(ID dtqid, { ATR dtqatr, uint_t dtqcnt, void *dtqmb })
+	CRE_PDQ(ID pdqid, { ATR pdqatr, uint_t pdqcnt, PRI maxdpri, void *pdqmb })
+	CRE_MTX(ID mtxid, { ATR mtxatr, PRI ceilpri })
+
+(5) ã¡ã¢ãªãã¼ã«ç®¡çæ©è½
+
+	CRE_MPF(ID mpfid, { ATR mpfatr, uint_t blkcnt, uint_t blksz,
+										MPF_T *mpf, void *mpfmb })
+
+(6) æéç®¡çæ©è½
+
+	CRE_CYC(ID cycid, { ATR cycatr, ï¼éç¥æ¹æ³ã®æå®ï¼,
+										RELTIM cyctim, RELTIM cycphs })
+	CRE_ALM(ID almid, { ATR almatr, ï¼éç¥æ¹æ³ã®æå®ï¼ })
+
+(8) å²è¾¼ã¿ç®¡çæ©è½
+
+	CFG_INT(INTNO intno, { ATR intatr, PRI intpri })
+	CRE_ISR(ID isrid, { ATR isratr, intptr_t exinf,
+								INTNO intno, ISR isr, PRI isrpri })
+	DEF_INH(INHNO inhno, { ATR inhatr, INTHDR inthdr })
+
+(9) CPUä¾å¤ç®¡çæ©è½
+
+	DEF_EXC(EXCNO excno, { ATR excatr, EXCHDR exchdr })
+
+(10) ã·ã¹ãã æ§æç®¡çæ©è½
+
+	DEF_ICS({ size_t istksz, STK_T *istk })
+	ATT_INI({ ATR iniatr, intptr_t exinf, INIRTN inirtn })
+	ATT_TER({ ATR teratr, intptr_t exinf, TERRTN terrtn })
+
+13.3 ãã¼ã¸ã§ã³å±¥æ­´
+
+	2014å¹´11æ24æ¥	Release	3.A.0		æåã®ãªãªã¼ã¹
+	2015å¹´8æ5æ¥	Release	3.B.0
+	2016å¹´ æ æ¥	Release	3.0.0		æåã®ä¸è¬å
+¬é
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/doc/version.txt
===================================================================
--- asp3_wo_tecs/trunk/doc/version.txt	(revision 302)
+++ asp3_wo_tecs/trunk/doc/version.txt	(revision 302)
@@ -0,0 +1,423 @@
+
+		TOPPERS/ASP3ã«ã¼ãã«
+		å¤æ´å±¥æ­´
+
+		å¯¾å¿ãã¼ã¸ã§ã³: Release 3.0.0
+		æçµæ´æ°: 2016å¹´1æ10æ¥
+
+ãã®ãã­ã¥ã¡ã³ãã¯ï¼TOPPERS/ASP3ã«ã¼ãã«ã®å¤æ´å±¥æ­´ãï¼æ°ããæ¹ããé ã«
+è¨è¿°ãããã®ã§ããï¼ã¾ãï¼TOPPERS/ASPã«ã¼ãã« Release 1.9.1ã¨ã®ä¸»ãªéã
+ã«ã¤ãã¦ãè¨è¼ãã¦ããï¼
+
+----------------------------------------------------------------------
+ TOPPERS/ASP Kernel
+     Toyohashi Open Platform for Embedded Real-Time Systems/
+     Advanced Standard Profile Kernel
+
+ Copyright (C) 2014-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: version.txt 507 2016-01-12 01:58:33Z ertl-hiro $
+----------------------------------------------------------------------
+
+		TOPPERS/ASP3ã«ã¼ãã«
+		Release 3.B.0 ãã 3.0.0 ã¸ã®ä¸»ãªå¤æ´ç¹
+
+âå¤æ´ç¹ã®ãªã¹ã
+
+ã»lock_cpu_dspï¼unlock_cpu_dspã®å°å
+¥
+	- ã¿ã¹ã¯ãã£ã¹ãããã§ããç¶æ
+ã«ããã¦ï¼CPUã­ãã¯ç¶æ
+ã«é·ç§»ï¼å¾©å¸°ã
+	  ããé¢æ°ã¨ãã¦ï¼lock_cpu_dspï¼unlock_cpu_dspãå°å
+¥ããï¼
+
+ã»éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®ãã£ã¹ãããè¦æ±
+	- éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«ããã¦ã¿ã¹ã¯åæããå¿
+è¦ã«ãªã£ãå ´åã«ï¼
+	  request_dispatchãå¼ã¶ããã«ä¿®æ­£ããï¼ARM Cortex-Må¯¾å¿ï¼ï¼
+
+ã»ãã®ä»ã®ãã°ãã£ãã¯ã¹
+	- éç¥ãã³ãã©ã®ããã®å¤æ°ã«staticãä»ããã®ããããï¼
+
+ã»ãã¹ããã­ã°ã©ã ã®è¿½å 
+	- ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (5)ï¼perf5ï¼ãè¿½å ï¼
+
+ã»kernel_cfg.hï¼offset.hã¸ã®ä¾å­é¢ä¿ã®ä¿®æ­£
+	- move-if-changeãç¨ãã¦ï¼ä¸å¿
+è¦ãªåã³ã³ãã¤ã«ãè¡ãããªãããã«ï¼
+	  Makefileã¨åãã³ãã¬ã¼ããã¡ã¤ã«ãä¿®æ­£ï¼
+	- utils/move-if-changeãè¿½å ï¼
+
+ã»Makefileã®ä¿®æ­£
+	- ä¾å­é¢ä¿ãã¡ã¤ã«ãï¼GCCã®-MDãªãã·ã§ã³ãç¨ãã¦çæããããã«ä¿®æ­£ï¼
+	- APPLDIRï¼APPL_DIRï¼SYSSVC_DIRï¼KERNEL_DIRãï¼ããããï¼â¦DIRSï¼è¤
+	  æ°å½¢ï¼ã«ãªãã¼ã ï¼
+	- DBGENVã®å»æ­¢ï¼
+	- ä¸è¦ã«ãªã£ãå¤æ°ç­ã®åé¤ï¼
+
+ã»configureã®å¤§å¹
+ãªä»æ§å¤æ´
+	- ãµã³ãã«ãã­ã°ã©ã ãçæããå¦çãåé¤ï¼
+	- -uãªãã·ã§ã³ãå»æ­¢ï¼-aãªãã·ã§ã³ã«çµ±åï¼ï¼
+	- -tãªãã·ã§ã³ã¨-dãªãã·ã§ã³ã®å½¹å²ãå¤æ´ï¼
+	- -cãªãã·ã§ã³ï¼-Cãªãã·ã§ã³ï¼-wãªãã·ã§ã³ï¼-Vãªãã·ã§ã³ï¼-Gãªãã·ã§
+	  ã³ãè¿½å ï¼
+	- perlã®ãã­ã°ã©ã ã®å ´æãæ¤ç´¢ããå¦çãåé¤ï¼
+	- ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãç¨æã§ãã¦ãããã®ãã§ãã¯ãåé¤ï¼
+
+ã»ãã®ä»ã®ä¿®æ­£
+	- OVRTIMåãPRCTIMåã«ãªãã¼ã ï¼
+	- bit_kernel.cï¼bit_mutex.cãè¦ç´ãï¼ASP3å¯¾å¿ãèæ
+®ï¼ï¼
+	- test_raster1ãï¼bit_kernelãä½¿ç¨ããããã«ä¿®æ­£ï¼
+	- æ§è½è©ä¾¡ãã­ã°ã©ã ã§å®è¡æéåå¸ãè¡¨ç¤ºããéã«ï¼ã·ã¹ãã ã­ã°æ©è½
+	  ã®ãã©ãã·ã¥ãå¼ã¶ã®ããããï¼ä½ã¬ãã«åºåãä½¿ãã®ã§ä¸è¦ï¼ï¼
+	- ãã¹ããã­ã°ã©ã ç¨ãµã¼ãã¹ã®é¢æ°å®ç¾©æ¹æ³ãå¤æ´ï¼
+	- ãã¬ã¼ã¹ã­ã°æ©è½ã®ã­ã°æå»ãåãåºããã¯ã­åãå¤æ´ï¼
+	- ãã¬ã¼ã¹ã­ã°æ©è½ã®ã¢ã¼ãã®æ±ãã®è¦ç´ãï¼
+
+ã»ãã­ã¥ã¡ã³ãã®å
+
+å®ï¼ã³ã¡ã³ãã®ä¿®æ­£
+
+ã»ãã¼ã¸ã§ã³çªå·ã®æ´æ°
+	- ã«ã¼ãã«ã®ãã¼ã¸ã§ã³çªå·ãæ´æ°ï¼
+
+âã¿ã¼ã²ããä¾å­é¨ã®è¦ä¿®æ­£ç®æï¼3.B.0 â 3.0.0ï¼
+
+(1) lock_cpu_dspï¼unlock_cpu_dspã®å®ç¾©ãè¿½å 
+	- lock_cpu_dspï¼unlock_cpu_dspã®å®ç¾©ãè¿½å ããï¼æé©åãããªãã®ã§
+	  ããã°ï¼lock_cpuï¼unlock_cpuã«å®ç¾©ããã°ããï¼
+
+(2) request_dispatchã®å®ç¾©ãè¿½å 
+	- request_dispatchã®å®ç¾©ãè¿½å ããï¼æ¨æºéãã®å®è£
+ã®å ´åã¯ï¼ç©ºã«å®
+	  ç¾©ããã°ããï¼
+
+(3) OVRTIMåãPRCTIMåã«ãªãã¼ã 
+	- ã¿ã¼ã²ããä¾å­é¨ã§OVRTIMåãä½¿ã£ã¦ããç®æãããã°ï¼PRCTIMåã«ä¿®
+	  æ­£ããï¼
+
+(4) kernel_cfg.hã¨offset.hã®ãã¡ã¤ã«å
+	- ã¿ã¼ã²ããä¾å­é¨ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã§ï¼åºåå
+ãkernel_cfg.hã
+	  offset.hã«ããFILEè¨è¿°ãããã°ï¼ããããï¼kernel_cfg.h.newã¨
+	  offset.h.newã«ãã¡ã¤ã«åãå¤æ´ããï¼
+
+(5) ãã£ã¬ã¯ããªãæå®ããå¤æ°åã®ãªãã¼ã 
+	- Makefileã®ã¿ã¼ã²ããä¾å­é¨ã§ï¼APPL_DIRï¼SYSSVC_DIRï¼KERNEL_DIRã
+	  è¨­å®ãã¦ããè¨è¿°ãããã°ï¼ããããï¼APPL_DIRSï¼SYSSVC_DIRSï¼
+	  KERNEL_DIRSã«ãªãã¼ã ããï¼
+
+(6) éçºç°å¢ä¾å­ã®ã³ã³ãã¤ã«ãªãã·ã§ã³
+	- Makefileã®ã¿ã¼ã²ããä¾å­é¨ã§ï¼DBGENVãè¨­å®ãã¦ããè¨è¿°ãããã°ï¼
+	  COPTSãç¨ããè¨­å®ã«å¤æ´ããï¼
+
+----------------------------------------------------------------------
+
+		TOPPERS/ASP3ã«ã¼ãã«
+		Release 3.A.0 ãã 3.B.0 ã¸ã®ä¸»ãªå¤æ´ç¹
+
+âå¤æ´ç¹ã®ãªã¹ã
+
+ã»å¨æãã³ãã©æ©è½ã¨ã¢ã©ã¼ã ãã³ãã©æ©è½ãï¼å¨æéç¥æ©è½ã¨ã¢ã©ã¼ã éç¥
+ãæ©è½ã«æ¡å¼µ
+
+ã»æå¹ãªå²è¾¼ã¿çªå·ï¼å²è¾¼ã¿ãã³ãã©çªå·ï¼CPUä¾å¤ãã³ãã©çªå·ï¼å²è¾¼ã¿åªå
+
+ãåº¦ãã¿ã¼ã²ããä¾å­é¨ã§å®ç¾©ããæ¹æ³ã®å¤æ´
+
+ã»delay_for_interruptã®å°å
+¥
+	- ä¸æçã«CPUã­ãã¯ç¶æ
+ãè§£é¤ããæã«ï¼å²è¾¼ã¿ãåãä»ããããããã«
+	  ããããã®é¢æ°ã¨ãã¦ï¼delay_for_interruptãå¼ã³åºãããã«ããï¼
+
+ã»ãã¹ããã­ã°ã©ã ç¨ã©ã¤ãã©ãªã®ä¿®æ­£
+	- ãã¹ããã­ã°ã©ã ç¨ãµã¼ãã¹ã®ä½ç½®ä»ãã¨ãï¼ãã¡ã¤ã«åã¨ãã£ã¬ã¯ã
+	  ãªãå¤æ´ï¼
+	- test_finishã¯ãµã¼ãã¹ã®å
+é¨é¢æ°ã¨ãï¼å¤é¨ããã¯check_finish(0U)ã
+	  å¼ã¶ããã«å¤æ´ï¼ä¿è­·æ©è½å¯¾å¿ã«ã¼ãã«ãèæ
+®ããä¿®æ­£ï¼ï¼
+	- check_stateããï¼check_ipmãåé¢ï¼check_state_iãå»æ­¢ï¼
+	- syslog_flushãï¼syslog_fls_logã¨ãªãã¼ã ãï¼ã·ã¹ãã ã­ã°æ©è½ã®ãµã¼
+	  ãã¹ã³ã¼ã«ã¨ä½ç½®ä»ãããã¨ã«ï¼
+
+ã»å®è¡æéåå¸éè¨ã¢ã¸ã¥ã¼ã«ã®ä¿®æ­£
+	- å®è¡æéåå¸éè¨ãµã¼ãã¹ã®ä½ç½®ä»ãã¨ãï¼ãã£ã¬ã¯ããªãå¤æ´ï¼
+	- print_histã§ï¼ã­ã°æ
+å ±ã®åºåé¢æ°ããã©ã¡ã¼ã¿ã¨ãã¦æ¸¡ãããã«å¤æ´ï¼
+
+ã»ãã¹ããã­ã°ã©ã ã®è¿½å 
+	- éç¥å¦çã®ãã¹ã(1)ï¼test_notify1ï¼ãè¿½å ï¼
+	- ããªããèª¿æ´æ©è½æ¡å¼µããã±ã¼ã¸ã«ããªããèª¿æ´æ©è½ã®ãã¹ã(1)
+	  ï¼test_drift1ï¼ãè¿½å ï¼
+
+ã»ãã®ä»ã®ãã°ãã£ãã¯ã¹
+	- ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ãã®ä¿®æ­£ï¼SYSLOGåã®å¤æ´ã¸ã®è¿½å¾æ¼ãï¼ï¼
+	- test_cpuexc10.cã®ãã§ãã¯å¤ã®èª¤ãã®ä¿®æ­£ï¼
+	- makereleaseã®ã¨ã©ã¼ãã§ãã¯ã³ã¼ãã®ä¿®æ­£ï¼
+
+ã»ãã®ä»ã®ä¿®æ­£
+	- LOG_DSP_ENTERã®å¼åºãç®æãå¤æ´ããï¼ãã¼ãã£ã³ã°ã¬ã¤ãï¼ï¼
+	- USE_INHINIB_TABLEã¨USE_INTINIB_TABLEã®å®ç¾©æ¹æ³ãå¤æ´ããï¼
+	- CANNOT_RETURN_CPUEXCãPREPARE_RETURN_CPUEXCã«ç½®ãæããï¼
+	- kernel_chk.tfã®ãªãã¡ã¯ã¿ãªã³ã°ï¼
+	- ããããã¡ã¤ã«ãèªå·±å®çµããããã«ä¿®æ­£ï¼
+	- ã¤ã³ã¯ã«ã¼ãè¨è¿°ã®æ¹æ³ãå¤æ´ï¼
+	- syslog_ref_logã®åºå£ã®ã­ã°åºåãã¯ã­ï¼LOG_SYSLOG_REF_LOG_LEAVEï¼
+	  ã®ãã©ã¡ã¼ã¿ã«ã¨ã©ã¼ã³ã¼ããè¿½å ï¼
+	- Makefileã«ãããLDFLAGSã®æå³ãå¤æ´ï¼
+	- trace_config.cfgãè¿½å ï¼
+
+ã»ãã­ã¥ã¡ã³ãã®å
+
+å®ï¼ã³ã¡ã³ãã®ä¿®æ­£
+
+ã»ãã¼ã¸ã§ã³çªå·ã®æ´æ°
+	- ã«ã¼ãã«ã®ãã¼ã¸ã§ã³çªå·ãæ´æ°ï¼
+
+âã¿ã¼ã²ããä¾å­é¨ã®è¦ä¿®æ­£ç®æï¼3.A.0 â 3.B.0ï¼
+
+(1) CHECK_INTPTR_ALIGNã¨CHECK_INTPTR_NONNULLã®è¿½å 
+	- å¿
+è¦ã§ããã°ï¼CHECK_INTPTR_ALIGNã¨CHECK_INTPTR_NONNULLã®å®ç¾©ãè¿½
+	  å ããï¼
+
+(2) æå¹ãªå²è¾¼ã¿çªå·ï¼å²è¾¼ã¿ãã³ãã©çªå·ï¼CPUä¾å¤ãã³ãã©çªå·ï¼å²è¾¼ã¿åª
+	å
+åº¦ã®å®ç¾©æ¹æ³ã®å¤æ´
+	- VALID_INTNOãç¨æããï¼å¿
+è¦ãªãå ´åãããï¼ï¼
+	- VALID_INTNO_DISINTï¼VALID_INTNO_CREISRã®å®ç¾©ãVALID_INTNOã¨ä¸è´ã
+	  ã¦ããã°ï¼å®ç¾©ãåé¤ããï¼
+	- VALID_INTNO_CFGINTãVALID_INTNOã«ï¼INTNO_CFGINT_VALIDãINTNO_VALIDã«ï¼
+	  ããããç½®ãæããï¼
+	- VALID_INHNO_DEFINHãVALID_INHNOã«ï¼INHNO_DEFINH_VALIDãINHNO_VALIDã«ï¼
+	  ããããç½®ãæããï¼
+	- VALID_EXCNO_DEFEXCãVALID_EXCNOã«ï¼EXCNO_DEFEXC_VALIDãEXCNO_VALIDã«ï¼
+	  ããããç½®ãæããï¼
+	- INTNO_CREISR_VALIDï¼INHNO_CREISR_VALIDã®å®ç¾©ãï¼ããããINTNO_VALIDï¼
+      INHNO_VALIDã¨ä¸è´ãã¦ããã°ï¼å®ç¾©ãåé¤ããï¼
+	- INTPRI_CFGINT_VALIDã®å®ç¾©ãæ¨æºéãã§ããå ´åã«ã¯ï¼å®ç¾©ãåé¤ããï¼
+
+(3) Makefileã«ãããLDFLAGSã®æå³ã®å¤æ´
+	- ããã¾ã§ï¼LDFLAGSã¯ã«ã¼ãã«ã®ãªã³ã¯æã«ã®ã¿é©ç¨ããï¼cfg1_out.cã®
+	  ãªã³ã¯æã«ã¯é©ç¨ãããªãã£ããï¼ãã®ä¸¡æ¹ã«é©ç¨ãããããã«ãªã£ãï¼
+	  ãã®ããï¼ä¸¡è
+ã®ãªã³ã¯æã«å¿
+è¦ãªãªãã·ã§ã³ã¯ï¼LDFLAGSã«è¿½å ããã°ï¼
+	  CFG1_OUT_LDFLAGSã«ã¯è¿½å ããªãã¦ãããªã£ãï¼ä¸æ¹ï¼ã«ã¼ãã«ã®ãªã³
+	  ã¯æã®ã¿ã«é©ç¨ããããªãã·ã§ã³ã¯ï¼OBJ_LDFLAGSã«è¿½å ããï¼
+
+(4) delay_for_interruptã®è¿½å 
+	- delay_for_interruptã®å®è£
+ãè¿½å ããï¼
+
+(5) USE_INHINIB_TABLEã¨USE_INTINIB_TABLEã®å®ç¾©æ¹æ³ã®å¤æ´
+	- ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¿ã¼ã²ããä¾å­é¨
+	  ã§ï¼USE_INHINIB_TABLEï¼USE_INTINIB_TABLEãè¨­å®ãã¦ããå ´åã«ã¯ï¼
+	  ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã§ã®ãã¯ã­å®ç¾©ã«å¤æ´ããï¼ã¾ãï¼ã¿ã¼ã²ã
+	  ãä¾å­é¨ã§å®ç¾©ãã¦ããINHINIBï¼INTINIBãï¼å¿
+è¦ã«å¿ãã¦åé¤ããï¼
+
+(6) CANNOT_RETURN_CPUEXCãPREPARE_RETURN_CPUEXCã«ç½®ãæã
+	- PREPARE_RETURN_CPUEXCã®å®ç¾©ãè¿½å ããï¼CANNOT_RETURN_CPUEXCãå®ç¾©
+	  ããã¦ããå ´åã«ã¯ï¼PREPARE_RETURN_CPUEXCãå®ç¾©ããªãï¼
+
+(7) LOG_DSP_ENTERã®å¼åºãç®æãå¤æ´ã«å¯¾å¿
+	- ãã¼ãã£ã³ã°ã¬ã¤ãã«ããã¦ï¼LOG_DSP_ENTERã®å¼åºãç®æãå¤æ´ãï¼
+	  dispatcher_0ã®ã©ãã«ãè¨­ããã®ã«å¯¾å¿ããï¼æ¬è³ªçã«ã¯åããã¨ãªã®
+	  ã§ï¼ã³ã¼ããä¿®æ­£ããªãã¦ãåé¡ãªãï¼ï¼
+
+(8) ã¤ã³ã¯ã«ã¼ãè¨è¿°ã®æ¹æ³ã®å¤æ´ã«å¯¾å¿
+	- éçºç°å¢ï¼ãã­ã»ããµã³ã¢ï¼ãããä¾å­é¨ãã£ã¬ã¯ããªã«ç½®ããã¦ãã
+	  ããããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ãæ¹æ³ãå¤æ´ããï¼è©³ããã¯ï¼ãã¿ã¼ã²ã
+	  ãä¾å­é¨ ãã¼ãã£ã³ã°ã¬ã¤ããã®ã1.4 ã¤ã³ã¯ã«ã¼ãè¨è¿°ã®æ¹æ³ãã®ç¯
+	  ãåç
+§ãããã¨ï¼
+
+----------------------------------------------------------------------
+
+		TOPPERS/ASP3ã«ã¼ãã«
+		Release 1.9.1 ãã 3.A.0 ã¸ã®ä¸»ãªå¤æ´ç¹
+
+âä¸»ãªå¤æ´ç¹ã®ãªã¹ã
+
+â» ä»¥ä¸ã®å¤æ´ç¹ã®ãªã¹ãã¯ï¼ä¸»ãªãã®ã®ã¿ããªã¹ãã¢ãããããã®ã§ããï¼ç¶²
+   ç¾
+çãªãªã¹ãã§ã¯ãªãï¼
+
+ã»æ©è½ã®è¿½å ï¼å»æ­¢
+	- ãã¥ã¼ããã¯ã¹æ©è½ãæ¨æºããã±ã¼ã¸ã«è¿½å ï¼ä¸é¨æ©è½å¶éããï¼ï¼
+	- ã¿ã¹ã¯ä¾å¤å¦çæ©è½ãå»æ­¢ãï¼ã¿ã¹ã¯çµäºè¦æ±æ©è½ãè¿½å ï¼
+	- ã¡ã¼ã«ããã¯ã¹æ©è½ãå»æ­¢ï¼
+	- ã·ã¹ãã æå»ã®èª¿æ´æ©è½ã¨è¨­å®æ©è½ãè¿½å ï¼
+	- èµ·åè¦æ±ãã­ã¥ã¼ã¤ã³ã°ããªãã¿ã¹ã¯ãè¿½å ï¼
+	- ã¿ã¹ã¯ã¨ã¹ã±ã¸ã¥ã¼ãªã³ã°ç¶æ
+ã®åç
+§æ©è½ãè¿½å ï¼
+
+ã»æ¡å¼µããã±ã¼ã¸ã®è¿½å ï¼å»æ­¢
+	- ããªããèª¿æ´æ©è½æ¡å¼µããã±ã¼ã¸ãè¿½å ï¼
+	- ãµãåªå
+åº¦æ©è½æ¡å¼µããã±ã¼ã¸ãè¿½å ï¼
+	- ãã¥ã¼ããã¯ã¹æ©è½æ¡å¼µããã±ã¼ã¸ãå»æ­¢ï¼æ¨æºããã±ã¼ã¸ã«ï¼ï¼
+
+ã»ä»æ§ã®å¤æ´
+	- SIZEåãsize_tåã«å¤æ´ï¼
+	- ã·ã¹ãã æå»ï¼ç¸å¯¾æéï¼ã¿ã¤ã ã¢ã¦ãæéã®æéåä½ãï¼ãã¤ã¯ã­ç§
+	  ã«å¤æ´ï¼ã·ã¹ãã æå»ã®ãµã¤ãºã64ãããã«å¤æ´ï¼ç¸å¯¾æéã¨ã¿ã¤ã ã¢
+	  ã¦ãæéã®ãµã¤ãºã32ãããã¨è¦å®ï¼ã¿ã¤ã ã¢ã¦ãæéãç¬¦å·ç¡ãæ´æ°
+	  åã«å¤æ´ï¼
+	- ãµã¼ãã¹ã³ã¼ã«åã"i"ã§å§ã¾ãéã¿ã¹ã¯ã³ã³ãã­ã¹ãå°ç¨ã®ãµã¼ãã¹ã³ã¼
+	  ã«ãå»æ­¢ãï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ããããã¿ã¹ã¯ã³ã³ãã­ã¹ãã¨åãå
+	  ç§°ã®ãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºããããã«ï¼
+	- ena_intã¨ena_intãï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºããããã«ï¼
+	- ATT_ISRãå»æ­¢ãã¦ï¼CRE_ISRãè¿½å ï¼
+	- get_utmãå»æ­¢ãã¦ï¼fch_hrtãè¿½å ï¼
+	- å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã¨ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å®è¡éå§ï¼ãªã¿ã¼
+	  ã³æã®å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®æ±ããå¤æ´ï¼
+
+ã»ã¿ã¤ã ã¤ãã³ãå¦çã®ãã£ãã¯ã¬ã¹å
+	- ã¿ã¤ã ã¤ãã³ãå¦çã¢ã¸ã¥ã¼ã«ãå
+¨é¢çã«ä¿®æ­£ï¼
+
+ã»ã¹ã±ã¸ã¥ã¼ã©ã®å®è£
+ã®å¤æ´
+	- ã¢ã¤ãã«å¦çã®å®è£
+æ¹æ³ãå¤æ´ï¼ä¸»ã«ã¿ã¼ã²ããä¾å­é¨ï¼ï¼
+	- reqflgã¨ipmflgãå»æ­¢ï¼disdspãenadspã«å¤æ´ï¼
+	- ã¹ã±ã¸ã¥ã¼ã©ã®é¢æ°ãï¼ãã£ã¹ãããã®è¦å¦ãè¿ãã®ããããï¼
+	- p_schedtskã®æå³ãï¼æé«åªå
+é ä½ã®ã¿ã¹ã¯ããï¼å®è¡ãã¹ãã¿ã¹ã¯ã«
+	  å¤æ´ï¼ãã£ã¹ãããä¿çç¶æ
+ã§ã®æ±ããç°ãªãï¼ï¼
+
+ã»ãã®ä»ã®å®è£
+ã®å¤æ´
+	- kernel.tfãï¼æ©è½ã¢ã¸ã¥ã¼ã«æ¯ã«åå²ï¼
+	- éçã¨ã©ã¼ã®ãã§ãã¯æ¹æ³ï¼CHECKãã¯ã­ã®æ§æï¼ãå¤æ´ï¼
+	- ãµã¼ãã¹ã³ã¼ã«ã®åºå£ã­ã°ãã¯ã­ã®ãã©ã¡ã¼ã¿ãå¤æ´ï¼
+	- lock_cpuï¼unlock_cpuï¼sense_lockãï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã¨éã¿ã¹
+	  ã¯ã³ã³ãã­ã¹ãç¨ã§å¥ã
+ã«ç¨æããã®ããããï¼
+	- TCBä¸­ã§ã®å¾
+ã¡ç¶æ
+ã®è¡¨ç¾æ¹æ³ãå¤æ´ï¼
+	- WINFO_FLGä¸­ã®waiptnã¨flgptnãå
+±ç¨ï¼flgptnãå»æ­¢ï¼ï¼
+	- WINFO_SDTQã¨WINFO_RDTQãåºå¥ãã¦æ±ãããã«ä¿®æ­£ï¼
+
+ã»ãã¼ã¸ã§ã³çªå·ã®æ´æ°
+	- ã«ã¼ãã«ã®ãã¼ã¸ã§ã³çªå·ãæ´æ°ï¼
+
+âã¿ã¼ã²ããä¾å­é¨ã®ä¸»ãªè¦ä¿®æ­£ç®æï¼1.9.0 â 3.A.0ï¼
+
+(1) target_config.[hc]ãï¼target_kernel_impl.[hc]ã«ãªãã¼ã 
+
+(2) ãªãã»ãããã¡ã¤ã«ã®çææ¹æ³ã®å¤æ´
+	- target_cfg1_out.hã«ï¼TCBã®ãã¼ã¿å®ç¾©ãå«ã¾ãã¦ããå ´åã«ã¯ï¼æ°ã
+	  ãTCBã®æ§é ã«åããã¦ä¿®æ­£ããï¼
+	- ãªãã»ãããã¡ã¤ã«ï¼offset.hï¼ãï¼makeoffset.cã¨genoffsetãç¨ãã¦
+	  çæãã¦ããå ´åã«ã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãç¨ããæ¹æ³ã«å¤æ´ããï¼
+
+(3) ã¡ã¢ãªé åããµã¤ãºãè¡¨ããã¼ã¿åã®å¤æ´
+	- t_stddef.hã«ï¼size_tåã®å®ç¾©ãå«ã¾ããããã«ããï¼
+	- TOPPERS_sizeã®å®ç¾©ãåé¤ããï¼
+	- SIZEåãä½¿ã£ã¦ããã¨ãããï¼size_tåã«å¤æ´ããï¼
+
+(4) ã³ã³ãã­ã¹ãä¾å­ã§å¼ã³åºãé¢æ°ã®å¤æ´
+	- x_lock_cpuï¼x_unlock_cpuï¼x_sense_lockï¼x_disable_intï¼x_enable_intï¼
+	  x_clear_intï¼x_probe_intãï¼"x_"ãå¤ããååã«å¤æ´ããï¼ãããã®
+	  é¢æ°ã«å¯¾å¿ãã"t_"ã¾ãã¯"i_"ã§å§ã¾ãé¢æ°ã¯åé¤ããï¼
+	- x_define_inhï¼x_config_intï¼x_define_excãä½¿ç¨ãã¦ããå ´åã«ã¯ï¼
+	  ããããï¼"x_"ãå¤ããååã«å¤æ´ããï¼
+	- x_set_ipmï¼i_set_ipmï¼x_get_ipmï¼i_get_ipmãåé¤ããï¼"t_"ã§å§ã¾
+	  ãé¢æ°ã¯æ®ãï¼ï¼
+	- i_begin_intã¨i_end_intãåé¤ããï¼
+
+(5) ãã£ã¹ãããã£æ¬ä½ã®å¤æ´
+	- dispatcherä¸­ã®ã¢ã¤ãã«å¦çã®å®è£
+ãå¤æ´ããï¼
+	- log_dsp_enterãå¼ã¶å¦çãï¼ãã£ã¹ãããã£æ¬ä½ããï¼ãããå¼ã¶å¦ç
+	  ã®å´ï¼dispatchï¼exit_and_dispatchï¼å²è¾¼ã¿ã®åºå
+¥å£å¦çï¼CPUä¾å¤ã®
+	  åºå
+¥å£å¦çï¼ã«ç§»åããï¼
+
+(6) ãã£ã¹ãããã£ã®åä½éå§å¦çã®å¤æ´
+	- start_dispatchã«ï¼ã¹ã¿ãã¯ãIDã1ã®ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åã«åãæã
+	  ãå¦çãè¿½å ããï¼
+
+(7) å²è¾¼ã¿ãã³ãã©ï¼CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦çã®å¤æ´
+	- reqflgã®å»æ­¢ã«å¯¾å¿ããï¼
+	- ã¿ã¹ã¯åæãã®æ¡ä»¶å¤å®ã§ï¼dspflgããã§ãã¯ããå¿
+è¦ããªããªã£ãã
+	  ã¨ã«å¯¾å¿ããï¼
+	- ã¢ã¤ãã«å¦çã®å®è£
+å¤æ´ã«ããï¼ret_intï¼ret_excããã®ã¿ã¹ã¯åæã
+	  ã«ããã¦ï¼p_runtskãNULLã¨ãªã£ã¦ããç¶æ³ãèããå¿
+è¦ãçãããã¨
+	  ã«å¯¾å¿ããï¼
+
+(8) ãã³ãã¬ã¼ããã¡ã¤ã«å¤æ°ã®å¤æ´
+	- INTNO_ATTISR_VALIDã¨INHNO_ATTISR_VALIDãï¼INTNO_CREISR_VALIDã¨
+	  INHNO_CREISR_VALIDã«å¤æ´ããï¼
+
+(9) é«åè§£è½ã¿ã¤ããã©ã¤ãã®å®è£
+
+	- ãã£ãã¯ãã¼ã¹ã®ã¿ã¤ããã©ã¤ããåé¤ãï¼é«åè§£è½ã¿ã¤ããã©ã¤ãã
+	  å®è£
+ããï¼
+
+----------------------------------------------------------------------
Index: asp3_wo_tecs/trunk/extension/MANIFEST
===================================================================
--- asp3_wo_tecs/trunk/extension/MANIFEST	(revision 302)
+++ asp3_wo_tecs/trunk/extension/MANIFEST	(revision 302)
@@ -0,0 +1,180 @@
+PACKAGE asp3
+
+MANIFEST
+
+drift/include/kernel.h
+
+drift/kernel/Makefile.kernel
+drift/kernel/allfunc.h
+drift/kernel/kernel_rename.def
+drift/kernel/kernel_rename.h
+drift/kernel/kernel_unrename.h
+drift/kernel/time_event.c
+drift/kernel/time_event.h
+drift/kernel/time_manage.c
+
+drift/test/hrt_drift1.c
+drift/test/hrt_drift1.cfg
+drift/test/hrt_drift1.h
+
+messagebuf/include/kernel.h
+
+messagebuf/kernel/Makefile.kernel
+messagebuf/kernel/allfunc.h
+messagebuf/kernel/check.h
+messagebuf/kernel/kernel.tf
+messagebuf/kernel/kernel_api.csv
+messagebuf/kernel/kernel_def.csv
+messagebuf/kernel/kernel_impl.h
+messagebuf/kernel/kernel_int.h
+messagebuf/kernel/kernel_rename.def
+messagebuf/kernel/kernel_rename.h
+messagebuf/kernel/kernel_unrename.h
+messagebuf/kernel/messagebuf.c
+messagebuf/kernel/messagebuf.h
+messagebuf/kernel/messagebuf.tf
+messagebuf/kernel/task.h
+messagebuf/kernel/task_refer.c
+messagebuf/kernel/taskhook.c
+messagebuf/kernel/taskhook.h
+messagebuf/kernel/wait.c
+messagebuf/kernel/wait.h
+
+messagebuf/test/bit_kernel.c
+messagebuf/test/test_messagebuf1.c
+messagebuf/test/test_messagebuf1.cfg
+messagebuf/test/test_messagebuf1.h
+messagebuf/test/test_messagebuf2.c
+messagebuf/test/test_messagebuf2.cfg
+messagebuf/test/test_messagebuf2.h
+
+ovrhdr/include/kernel.h
+
+ovrhdr/kernel/Makefile.kernel
+ovrhdr/kernel/allfunc.h
+ovrhdr/kernel/check.h
+ovrhdr/kernel/interrupt.c
+ovrhdr/kernel/kernel.tf
+ovrhdr/kernel/kernel_api.csv
+ovrhdr/kernel/kernel_check.tf
+ovrhdr/kernel/kernel_def.csv
+ovrhdr/kernel/kernel_int.h
+ovrhdr/kernel/kernel_rename.def
+ovrhdr/kernel/kernel_rename.h
+ovrhdr/kernel/kernel_unrename.h
+ovrhdr/kernel/overrun.c
+ovrhdr/kernel/overrun.h
+ovrhdr/kernel/overrun.tf
+ovrhdr/kernel/sys_manage.c
+ovrhdr/kernel/task.c
+ovrhdr/kernel/task.h
+ovrhdr/kernel/task_term.c
+
+ovrhdr/sample/sample1.c
+ovrhdr/sample/sample1.cfg
+ovrhdr/sample/sample1.h
+
+ovrhdr/test/test_ovrhdr1.c
+ovrhdr/test/test_ovrhdr1.cfg
+ovrhdr/test/test_ovrhdr1.h
+
+pri_level/include/kernel.h
+pri_level/kernel/kernel_rename.def
+pri_level/kernel/kernel_rename.h
+pri_level/kernel/kernel_unrename.h
+pri_level/kernel/task.c
+pri_level/kernel/task.h
+pri_level/test/test_task1.h
+
+rstr_task/include/kernel.h
+
+rstr_task/kernel/check.h
+rstr_task/kernel/kernel_def.csv
+rstr_task/kernel/sys_manage.c
+rstr_task/kernel/task.tf
+rstr_task/kernel/task_manage.c
+rstr_task/kernel/task_sync.c
+
+rstr_task/test/test_rstr1.c
+rstr_task/test/test_rstr1.cfg
+rstr_task/test/test_rstr1.h
+rstr_task/test/test_rstr2.c
+rstr_task/test/test_rstr2.cfg
+rstr_task/test/test_rstr2.h
+
+subprio/include/kernel.h
+
+subprio/kernel/Makefile.kernel
+subprio/kernel/allfunc.h
+subprio/kernel/kernel_api.csv
+subprio/kernel/kernel_rename.def
+subprio/kernel/kernel_rename.h
+subprio/kernel/kernel_unrename.h
+subprio/kernel/mutex.tf
+subprio/kernel/sys_manage.c
+subprio/kernel/task.c
+subprio/kernel/task.h
+subprio/kernel/task.tf
+subprio/kernel/task_manage.c
+subprio/kernel/task_refer.c
+
+subprio/test/test_subprio1.c
+subprio/test/test_subprio1.cfg
+subprio/test/test_subprio1.h
+subprio/test/test_subprio2.c
+subprio/test/test_subprio2.cfg
+subprio/test/test_subprio2.h
+
+dcre/include/kernel.h
+
+dcre/kernel/Makefile.kernel
+dcre/kernel/alarm.c
+dcre/kernel/alarm.h
+dcre/kernel/alarm.tf
+dcre/kernel/allfunc.h
+dcre/kernel/check.h
+dcre/kernel/cyclic.c
+dcre/kernel/cyclic.h
+dcre/kernel/cyclic.tf
+dcre/kernel/dataqueue.c
+dcre/kernel/dataqueue.h
+dcre/kernel/dataqueue.tf
+dcre/kernel/eventflag.c
+dcre/kernel/eventflag.h
+dcre/kernel/eventflag.tf
+dcre/kernel/interrupt.c
+dcre/kernel/interrupt.h
+dcre/kernel/interrupt.tf
+dcre/kernel/kernel.tf
+dcre/kernel/kernel_api.csv
+dcre/kernel/kernel_check.tf
+dcre/kernel/kernel_def.csv
+dcre/kernel/kernel_impl.h
+dcre/kernel/kernel_rename.def
+dcre/kernel/kernel_rename.h
+dcre/kernel/kernel_unrename.h
+dcre/kernel/mempfix.c
+dcre/kernel/mempfix.h
+dcre/kernel/mempfix.tf
+dcre/kernel/mutex.c
+dcre/kernel/mutex.h
+dcre/kernel/mutex.tf
+dcre/kernel/pridataq.c
+dcre/kernel/pridataq.h
+dcre/kernel/pridataq.tf
+dcre/kernel/semaphore.c
+dcre/kernel/semaphore.h
+dcre/kernel/semaphore.tf
+dcre/kernel/startup.c
+dcre/kernel/task.c
+dcre/kernel/task.h
+dcre/kernel/task.tf
+dcre/kernel/task_manage.c
+dcre/kernel/task_refer.c
+dcre/kernel/task_sync.c
+dcre/kernel/task_term.c
+dcre/kernel/time_manage.c
+
+dcre/sample/sample1.c
+dcre/sample/sample1.cfg
+dcre/sample/sample1.h
Index: asp3_wo_tecs/trunk/extension/dcre/include/kernel.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/include/kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/include/kernel.h	(revision 302)
@@ -0,0 +1,786 @@
+/*
+ *  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) 2004-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.h 463 2015-10-18 14:25:55Z ertl-hiro $
+ */
+
+/*
+ *		TOPPERS/ASPã«ã¼ãã« æ¨æºããããã¡ã¤ã«
+ *
+ *  TOPPERS/ASPã«ã¼ãã«ããµãã¼ããããµã¼ãã¹ã³ã¼ã«ã®å®£è¨ã¨ï¼å¿
+è¦ãªãã¼
+ *  ã¿åï¼å®æ°ï¼ãã¯ã­ã®å®ç¾©ãå«ãããããã¡ã¤ã«ï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ããï¼ããã«ããï¼ãã¯ã­å®ç¾©ä»¥å¤ã
+ *  é¤ãããã«ãªã£ã¦ããï¼
+ */
+
+#ifndef TOPPERS_KERNEL_H
+#define TOPPERS_KERNEL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *	TOPPERSå
+±éã®ãã¼ã¿åã»å®æ°ã»ãã¯ã­
+ */
+#include <t_stddef.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨
+ */
+#include "target_kernel.h"
+
+/*
+ *  ãµãã¼ãããæ©è½
+ */
+#ifdef TOPPERS_TARGET_SUPPORT_DIS_INT
+#define TOPPERS_SUPPORT_DIS_INT			/* dis_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_DIS_INT */
+
+#ifdef TOPPERS_TARGET_SUPPORT_ENA_INT
+#define TOPPERS_SUPPORT_ENA_INT			/* ena_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_ENA_INT */
+
+#define TOPPERS_SUPPORT_DYNAMIC_CRE		/* åççææ©è½æ¡å¼µ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãã¼ã¿åã®å®ç¾©
+ */
+
+/*
+ *  ããããã¿ã¼ã³ããªãã¸ã§ã¯ãçªå·ã®åå®ç¾©
+ */
+typedef	uint_t		FLGPTN;		/* ã¤ãã³ããã©ã°ã®ããããã¿ã¼ã³ */
+typedef	uint_t		INTNO;		/* å²è¾¼ã¿çªå· */
+typedef	uint_t		INHNO;		/* å²è¾¼ã¿ãã³ãã©çªå· */
+typedef	uint_t		EXCNO;		/* CPUä¾å¤ãã³ãã©çªå· */
+
+/*
+ *  å¦çåä½ã®åå®ç¾©
+ */
+typedef void	(*TASK)(intptr_t exinf);
+typedef void	(*TMEHDR)(intptr_t exinf);
+typedef void	(*ISR)(intptr_t exinf);
+typedef void	(*INTHDR)(void);
+typedef void	(*EXCHDR)(void *p_excinf);
+typedef void	(*INIRTN)(intptr_t exinf);
+typedef void	(*TERRTN)(intptr_t exinf);
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®åå®ç¾©
+ */
+#ifndef TOPPERS_STK_T
+#define TOPPERS_STK_T	intptr_t
+#endif /* TOPPERS_STK_T */
+typedef	TOPPERS_STK_T	STK_T;	/* ã¹ã¿ãã¯é åãç¢ºä¿ããããã®å */
+
+#ifndef TOPPERS_MPF_T
+#define TOPPERS_MPF_T	intptr_t
+#endif /* TOPPERS_MPF_T */
+typedef	TOPPERS_MPF_T	MPF_T;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åãç¢ºä¿ããããã®å */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãã®éç¥æ¹æ³ã®ãã±ããå½¢å¼ã®å®ç¾©
+ */
+typedef struct {
+	intptr_t	exinf;		/* ã¿ã¤ã ã¤ãã³ããã³ãã©ã®æ¡å¼µæ
+å ± */
+	TMEHDR		tmehdr;		/* ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å
+é ­çªå° */
+} T_NFY_HDR;
+
+typedef struct {
+	intptr_t	*p_var;		/* å¤æ°ã®çªå° */
+	intptr_t	value;		/* è¨­å®ããå¤ */
+} T_NFY_VAR;
+
+typedef struct {
+	intptr_t	*p_var;		/* å¤æ°ã®çªå° */
+} T_NFY_IVAR;
+
+typedef struct {
+	ID			tskid;		/* ã¿ã¹ã¯ID */
+} T_NFY_TSK;
+
+typedef struct {
+	ID			semid;		/* ã»ããã©ID */
+} T_NFY_SEM;
+
+typedef struct {
+	ID			flgid;		/* ã¤ãã³ããã©ã°ID */
+	FLGPTN		flgptn;		/* ã»ããããããããã¿ã¼ã³ */
+} T_NFY_FLG;
+
+typedef struct {
+	ID			dtqid;		/* ãã¼ã¿ã­ã¥ã¼ID */
+	intptr_t	data;		/* éä¿¡ããå¤ */
+} T_NFY_DTQ;
+
+typedef struct {
+	intptr_t	*p_var;		/* å¤æ°ã®çªå° */
+} T_ENFY_VAR;
+
+typedef struct {
+	ID			dtqid;		/* ãã¼ã¿ã­ã¥ã¼ID */
+} T_ENFY_DTQ;
+
+typedef struct {
+	MODE	nfymode;			/* éç¥å¦çã¢ã¼ã */
+	union {						/* ã¿ã¤ã ã¤ãã³ãã®éç¥ã«é¢ããä»éæ
+å ± */
+		T_NFY_HDR	handler;
+		T_NFY_VAR	setvar;		
+		T_NFY_IVAR	incvar;		
+		T_NFY_TSK	acttsk;
+		T_NFY_TSK	wuptsk;
+		T_NFY_SEM	sigsem;
+		T_NFY_FLG	setflg;
+		T_NFY_DTQ	snddtq;
+	} nfy;
+	union {						/* ã¨ã©ã¼ã®éç¥ã«é¢ããä»éæ
+å ± */
+		T_ENFY_VAR	setvar;
+		T_NFY_IVAR	incvar;		
+		T_NFY_TSK	acttsk;
+		T_NFY_TSK	wuptsk;
+		T_NFY_SEM	sigsem;
+		T_NFY_FLG	setflg;
+		T_ENFY_DTQ	snddtq;
+	} enfy;
+} T_NFYINFO;
+
+/*
+ *  ãã±ããå½¢å¼ã®å®ç¾©
+ */
+typedef struct t_ctsk {
+	ATR			tskatr;		/* ã¿ã¹ã¯å±æ§ */
+	intptr_t	exinf;		/* ã¿ã¹ã¯ã®æ¡å¼µæ
+å ± */
+	TASK		task;		/* ã¿ã¹ã¯ã®ã¡ã¤ã³ã«ã¼ãã³ã®å
+é ­çªå° */
+	PRI			itskpri;	/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ */
+	size_t		stksz;		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åã®ãµã¤ãº */
+	STK_T 		*stk;		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åã®å
+é ­çªå° */
+} T_CTSK;
+
+typedef struct t_rtsk {
+	STAT	tskstat;	/* ã¿ã¹ã¯ç¶æ
+ */
+	PRI		tskpri;		/* ã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ */
+	PRI		tskbpri;	/* ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+	STAT	tskwait;	/* å¾
+ã¡è¦å  */
+	ID		wobjid;		/* å¾
+ã¡å¯¾è±¡ã®ãªãã¸ã§ã¯ãã®ID */
+	TMO		lefttmo;	/* ã¿ã¤ã ã¢ã¦ãããã¾ã§ã®æé */
+	uint_t	actcnt;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	uint_t	wupcnt;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	bool_t	raster;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	bool_t	dister;		/* ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ */
+} T_RTSK;
+
+typedef struct t_csem {
+	ATR		sematr;		/* ã»ããã©å±æ§ */
+	uint_t	isemcnt;	/* ã»ããã©ã®åæè³æºæ° */
+	uint_t	maxsem;		/* ã»ããã©ã®æå¤§è³æºæ° */
+} T_CSEM;
+
+typedef struct t_rsem {
+	ID		wtskid;		/* ã»ããã©ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	semcnt;		/* ã»ããã©ã®ç¾å¨ã®è³æºæ° */
+} T_RSEM;
+
+typedef struct t_cflg {
+	ATR		flgatr;		/* ã¤ãã³ããã©ã°å±æ§ */
+	FLGPTN	iflgptn;	/* ã¤ãã³ããã©ã°ã®åæããããã¿ã¼ã³ */
+} T_CFLG;
+
+typedef struct t_rflg {
+	ID		wtskid;		/* ã¤ãã³ããã©ã°ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	FLGPTN	flgptn;		/* ã¤ãã³ããã©ã°ã®ç¾å¨ã®ããããã¿ã¼ã³ */
+} T_RFLG;
+
+typedef struct t_cdtq {
+	ATR		dtqatr;		/* ãã¼ã¿ã­ã¥ã¼å±æ§ */
+	uint_t	dtqcnt;		/* ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ã§ãããã¼ã¿æ° */
+	void 	*dtqmb;		/* ãã¼ã¿ã­ã¥ã¼ç®¡çé åã®å
+é ­çªå° */
+} T_CDTQ;
+
+typedef struct t_rdtq {
+	ID		stskid;		/* ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	ID		rtskid;		/* ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	sdtqcnt;	/* ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼ã¿ã®æ° */
+} T_RDTQ;
+
+typedef struct t_cpdq {
+	ATR		pdqatr;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼å±æ§ */
+	uint_t	pdqcnt;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ã§ãããã¼ã¿æ° */
+	PRI		maxdpri;	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã«éä¿¡ã§ãããã¼ã¿åªå
+åº¦ã®æ
+						   å¤§å¤ */
+	void 	*pdqmb;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã®å
+é ­çªå° */
+} T_CPDQ;
+
+typedef struct t_rpdq {
+	ID		stskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	ID		rtskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	uint_t	spdqcnt;	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼
+						   ã¿ã®æ° */
+} T_RPDQ;
+
+typedef struct t_cmtx {
+	ATR		mtxatr;		/* ãã¥ã¼ããã¯ã¹å±æ§ */
+	PRI		ceilpri;	/* ãã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ */
+} T_CMTX;
+
+typedef struct t_rmtx {
+	ID		htskid;		/* ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã¿ã¹ã¯ã®IDçªå· */
+	ID		wtskid;		/* ãã¥ã¼ããã¯ã¹ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+} T_RMTX;
+
+typedef struct t_cmpf {
+	ATR		mpfatr;		/* åºå®é·ã¡ã¢ãªãã¼ã«å±æ§ */
+	uint_t	blkcnt;		/* ç²å¾ã§ããåºå®é·ã¡ã¢ãªãã­ãã¯ã®æ° */
+	uint_t	blksz;		/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ãµã¤ãº */
+	MPF_T 	*mpf;		/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®å
+é ­çªå° */
+	void 	*mpfmb;		/* åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çé åã®å
+é ­çªå° */
+} T_CMPF;
+
+typedef struct t_rmpf {
+	ID		wtskid;		/* åºå®é·ã¡ã¢ãªãã¼ã«ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®
+						   IDçªå· */
+	uint_t	fblkcnt;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®ç©ºãã¡ã¢ãªé åã«å²ã
+						   ä»ãããã¨ãã§ããåºå®é·ã¡ã¢ãªãã­ãã¯ã®æ° */
+} T_RMPF;
+
+typedef struct t_ccyc {
+	ATR			cycatr;		/* å¨æéç¥å±æ§ */
+	T_NFYINFO	nfyinfo;	/* å¨æéç¥ã®éç¥æ¹æ³ */
+	RELTIM		cyctim;		/* å¨æéç¥ã®éç¥å¨æ */
+	RELTIM		cycphs;		/* å¨æéç¥ã®éç¥ä½ç¸ */
+} T_CCYC;
+
+typedef struct t_rcyc {
+	STAT	cycstat;	/* å¨æéç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* æ¬¡åéç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RCYC;
+
+typedef struct t_calm {
+	ATR			almatr;		/* ã¢ã©ã¼ã éç¥å±æ§ */
+	T_NFYINFO	nfyinfo;	/* ã¢ã©ã¼ã éç¥ã®éç¥æ¹æ³ */
+} T_CALM;
+
+typedef struct t_ralm {
+	STAT	almstat;	/* ã¢ã©ã¼ã éç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* éç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RALM;
+
+typedef struct t_cisr {
+	ATR			isratr;		/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³å±æ§ */
+	intptr_t	exinf;		/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®æ¡å¼µæ
+å ± */
+	INTNO		intno;		/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ãç»é²ããå²è¾¼ã¿çªå· */
+	ISR			isr;		/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®å
+é ­çªå° */
+	PRI			isrpri;		/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ */
+} T_CISR;
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å®£è¨
+ */
+
+/*
+ *  ã¿ã¹ã¯ç®¡çæ©è½
+ */
+extern ER_UINT	acre_tsk(const T_CTSK *pk_ctsk) throw();
+extern ER		del_tsk(ID tskid) throw();
+extern ER		act_tsk(ID tskid) throw();
+extern ER_UINT	can_act(ID tskid) throw();
+extern ER		get_tst(ID tskid, STAT *p_tskstat) throw();
+extern ER		chg_pri(ID tskid, PRI tskpri) throw();
+extern ER		get_pri(ID tskid, PRI *p_tskpri) throw();
+extern ER		get_inf(intptr_t *p_exinf) throw();
+extern ER		ref_tsk(ID tskid, T_RTSK *pk_rtsk) throw();
+
+/*
+ *  ã¿ã¹ã¯ä»å±åææ©è½
+ */
+extern ER		slp_tsk(void) throw();
+extern ER		tslp_tsk(TMO tmout) throw();
+extern ER		wup_tsk(ID tskid) throw();
+extern ER_UINT	can_wup(ID tskid) throw();
+extern ER		rel_wai(ID tskid) throw();
+extern ER		sus_tsk(ID tskid) throw();
+extern ER		rsm_tsk(ID tskid) throw();
+extern ER		dly_tsk(RELTIM dlytim) throw();
+
+/*
+ *  ã¿ã¹ã¯çµäºæ©è½
+ */
+extern ER		ext_tsk(void) throw();
+extern ER		ras_ter(ID tskid) throw();
+extern ER		dis_ter(void) throw();
+extern ER		ena_ter(void) throw();
+extern bool_t	sns_ter(void) throw();
+extern ER		ter_tsk(ID tskid) throw();
+
+/*
+ *  åæã»éä¿¡æ©è½
+ */
+extern ER_ID	acre_sem(const T_CSEM *pk_csem) throw();
+extern ER		del_sem(ID semid) throw();
+extern ER		sig_sem(ID semid) throw();
+extern ER		wai_sem(ID semid) throw();
+extern ER		pol_sem(ID semid) throw();
+extern ER		twai_sem(ID semid, TMO tmout) throw();
+extern ER		ini_sem(ID semid) throw();
+extern ER		ref_sem(ID semid, T_RSEM *pk_rsem) throw();
+
+extern ER_ID	acre_flg(const T_CFLG *pk_cflg) throw();
+extern ER		del_flg(ID flgid) throw();
+extern ER		set_flg(ID flgid, FLGPTN setptn) throw();
+extern ER		clr_flg(ID flgid, FLGPTN clrptn) throw();
+extern ER		wai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		pol_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		twai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn, TMO tmout) throw();
+extern ER		ini_flg(ID flgid) throw();
+extern ER		ref_flg(ID flgid, T_RFLG *pk_rflg) throw();
+
+extern ER_ID	acre_dtq(const T_CDTQ *pk_cdtq) throw();
+extern ER		del_dtq(ID dtqid) throw();
+extern ER		snd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		psnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		tsnd_dtq(ID dtqid, intptr_t data, TMO tmout) throw();
+extern ER		fsnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		rcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		prcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		trcv_dtq(ID dtqid, intptr_t *p_data, TMO tmout) throw();
+extern ER		ini_dtq(ID dtqid) throw();
+extern ER		ref_dtq(ID dtqid, T_RDTQ *pk_rdtq) throw();
+
+extern ER_ID	acre_pdq(const T_CPDQ *pk_cpdq) throw();
+extern ER		del_pdq(ID pdqid) throw();
+extern ER		snd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		psnd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		tsnd_pdq(ID pdqid, intptr_t data,
+										PRI datapri, TMO tmout) throw();
+extern ER		rcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		prcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		trcv_pdq(ID pdqid, intptr_t *p_data,
+										PRI *p_datapri, TMO tmout) throw();
+extern ER		ini_pdq(ID pdqid) throw();
+extern ER		ref_pdq(ID pdqid, T_RPDQ *pk_rpdq) throw();
+
+extern ER_ID	acre_mtx(const T_CMTX *pk_cmtx) throw();
+extern ER		del_mtx(ID mtxid) throw();
+extern ER		loc_mtx(ID mtxid) throw();
+extern ER		ploc_mtx(ID mtxid) throw();
+extern ER		tloc_mtx(ID mtxid, TMO tmout) throw();
+extern ER		unl_mtx(ID mtxid) throw();
+extern ER		ini_mtx(ID mtxid) throw();
+extern ER		ref_mtx(ID mtxid, T_RMTX *pk_rmtx) throw();
+
+/*
+ *  ã¡ã¢ãªãã¼ã«ç®¡çæ©è½
+ */
+extern ER_ID	acre_mpf(const T_CMPF *pk_cmpf) throw();
+extern ER		del_mpf(ID mpfid) throw();
+extern ER		get_mpf(ID mpfid, void **p_blk) throw();
+extern ER		pget_mpf(ID mpfid, void **p_blk) throw();
+extern ER		tget_mpf(ID mpfid, void **p_blk, TMO tmout) throw();
+extern ER		rel_mpf(ID mpfid, void *blk) throw();
+extern ER		ini_mpf(ID mpfid) throw();
+extern ER		ref_mpf(ID mpfid, T_RMPF *pk_rmpf) throw();
+
+/*
+ *  æéç®¡çæ©è½
+ */
+extern ER		set_tim(SYSTIM systim) throw();
+extern ER		get_tim(SYSTIM *p_systim) throw();
+extern ER		adj_tim(int32_t adjtim) throw();
+extern HRTCNT	fch_hrt(void) throw();
+
+extern ER_ID	acre_cyc(const T_CCYC *pk_ccyc) throw();
+extern ER		del_cyc(ID cycid) throw();
+extern ER		sta_cyc(ID cycid) throw();
+extern ER		stp_cyc(ID cycid) throw();
+extern ER		ref_cyc(ID cycid, T_RCYC *pk_rcyc) throw();
+
+extern ER_ID	acre_alm(const T_CALM *pk_calm) throw();
+extern ER		del_alm(ID almid) throw();
+extern ER		sta_alm(ID almid, RELTIM almtim) throw();
+extern ER		stp_alm(ID almid) throw();
+extern ER		ref_alm(ID almid, T_RALM *pk_ralm) throw();
+
+/*
+ *  ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+ */
+extern ER		rot_rdq(PRI tskpri) throw();
+extern ER		get_tid(ID *p_tskid) throw();
+extern ER		get_lod(PRI tskpri, uint_t *p_load) throw();
+extern ER		get_nth(PRI tskpri, uint_t nth, ID *p_tskid) throw();
+extern ER		loc_cpu(void) throw();
+extern ER		unl_cpu(void) throw();
+extern ER		dis_dsp(void) throw();
+extern ER		ena_dsp(void) throw();
+extern bool_t	sns_ctx(void) throw();
+extern bool_t	sns_loc(void) throw();
+extern bool_t	sns_dsp(void) throw();
+extern bool_t	sns_dpn(void) throw();
+extern bool_t	sns_ker(void) throw();
+extern ER		ext_ker(void) throw();
+
+/*
+ *  å²è¾¼ã¿ç®¡çæ©è½
+ */
+extern ER_ID	acre_isr(const T_CISR *pk_cisr) throw();
+extern ER		del_isr(ID isrid) throw();
+extern ER		dis_int(INTNO intno) throw();
+extern ER		ena_int(INTNO intno) throw();
+extern ER		chg_ipm(PRI intpri) throw();
+extern ER		get_ipm(PRI *p_intpri) throw();
+
+/*
+ *  CPUä¾å¤ç®¡çæ©è½
+ */
+extern bool_t	xsns_dpn(void *p_excinf) throw();
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãããµã¼ãã¹ã³ã¼ã«
+ */
+#define iact_tsk(tskid)						act_tsk(tskid)
+#define iwup_tsk(tskid)						wup_tsk(tskid)
+#define irel_wai(tskid)						rel_wai(tskid)
+#define isns_ter()							sns_ter()
+#define isig_sem(semid)						sig_sem(semid)
+#define iset_flg(flgid, setptn)				set_flg(flgid, setptn)
+#define ipsnd_dtq(dtqid, data)				psnd_dtq(dtqid, data)
+#define ifsnd_dtq(dtqid, data)				fsnd_dtq(dtqid, data)
+#define ipsnd_pdq(pdqid, data, datapri)		psnd_pdq(pdqid, data, datapri)
+#define ifch_hrt()							fch_hrt()
+#define ista_alm(almid, almtim)				sta_alm(almid, almtim)
+#define istp_alm(almid)						stp_alm(almid)
+#define irot_rdq(tskpri)					rot_rdq(tskpri)
+#define iget_tid(p_tskid)					get_tid(p_tskid)
+#define iloc_cpu()							loc_cpu()
+#define iunl_cpu()							unl_cpu()
+#define isns_ctx()							sns_ctx()
+#define isns_loc()							sns_loc()
+#define isns_dsp()							sns_dsp()
+#define isns_dpn()							sns_dpn()
+#define isns_ker()							sns_ker()
+#define iext_ker()							ext_ker()
+#define idis_int(intno)						dis_int(intno)
+#define iena_int(intno)						ena_int(intno)
+#define ixsns_dpn(p_excinf)					xsns_dpn(p_excinf)
+
+/*
+ *  ãªãã¸ã§ã¯ãå±æ§ã®å®ç¾©
+ */
+#define TA_ACT			UINT_C(0x01)	/* ã¿ã¹ã¯ãèµ·åãããç¶æ
+ã§çæ */
+#define TA_NOACTQUE		UINT_C(0x02)	/* èµ·åè¦æ±ãã­ã¥ã¼ã¤ã³ã°ããªã */
+
+#define TA_TPRI			UINT_C(0x01)	/* ã¿ã¹ã¯ã®å¾
+ã¡è¡åãåªå
+åº¦é ã« */
+
+#define TA_WMUL			UINT_C(0x02)	/* è¤æ°ã®å¾
+ã¡ã¿ã¹ã¯ */
+#define TA_CLR			UINT_C(0x04)	/* ã¤ãã³ããã©ã°ã®ã¯ãªã¢æå® */
+
+#define TA_CEILING		UINT_C(0x03)	/* åªå
+åº¦ä¸éãã­ãã³ã« */
+
+#define TA_STA			UINT_C(0x02)	/* å¨æéç¥ãåä½ç¶æ
+ã§çæ */
+
+#define TA_NONKERNEL	UINT_C(0x02)	/* ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ */
+
+#define TA_ENAINT		UINT_C(0x01)	/* å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ãã¯ãªã¢ */
+#define TA_EDGE			UINT_C(0x02)	/* ã¨ãã¸ããªã¬ */
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®åä½ã¢ã¼ãã®å®ç¾©
+ */
+#define TWF_ORW			UINT_C(0x01)	/* ã¤ãã³ããã©ã°ã®ORå¾
+ã¡ */
+#define TWF_ANDW		UINT_C(0x02)	/* ã¤ãã³ããã©ã°ã®ANDå¾
+ã¡ */
+
+/*
+ *  éç¥å¦çã¢ã¼ãã®å®ç¾©
+ */
+#define TNFY_HANDLER	UINT_C(0x00)		/* ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºã */
+#define TNFY_SETVAR		UINT_C(0x01)		/* å¤æ°ã®è¨­å® */
+#define TNFY_INCVAR		UINT_C(0x02)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TNFY_ACTTSK		UINT_C(0x03)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TNFY_WUPTSK		UINT_C(0x04)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TNFY_SIGSEM		UINT_C(0x05)		/* ã»ããã©ã®è³æºã®è¿å´ */
+#define TNFY_SETFLG		UINT_C(0x06)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TNFY_SNDDTQ		UINT_C(0x07)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+#define TENFY_SETVAR	UINT_C(0x10)		/* å¤æ°ã®è¨­å® */
+#define TENFY_INCVAR	UINT_C(0x20)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TENFY_ACTTSK	UINT_C(0x30)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TENFY_WUPTSK	UINT_C(0x40)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TENFY_SIGSEM	UINT_C(0x50)		/* ã»ããã©ã®è¿å´ */
+#define TENFY_SETFLG	UINT_C(0x60)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TENFY_SNDDTQ	UINT_C(0x70)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+/*
+ *  ãªãã¸ã§ã¯ãã®ç¶æ
+ã®å®ç¾©
+ */
+#define TTS_RUN			UINT_C(0x01)	/* å®è¡ç¶æ
+ */
+#define TTS_RDY			UINT_C(0x02)	/* å®è¡å¯è½ç¶æ
+ */
+#define TTS_WAI			UINT_C(0x04)	/* å¾
+ã¡ç¶æ
+ */
+#define TTS_SUS			UINT_C(0x08)	/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+#define TTS_WAS			UINT_C(0x0c)	/* äºéå¾
+ã¡ç¶æ
+ */
+#define TTS_DMT			UINT_C(0x10)	/* ä¼æ­¢ç¶æ
+ */
+
+#define TTW_SLP			UINT_C(0x0001)	/* èµ·åºå¾
+ã¡ */
+#define TTW_DLY			UINT_C(0x0002)	/* æéçµéå¾
+ã¡ */
+#define TTW_SEM			UINT_C(0x0004)	/* ã»ããã©ã®è³æºç²å¾å¾
+ã¡ */
+#define TTW_FLG			UINT_C(0x0008)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TTW_SDTQ		UINT_C(0x0010)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RDTQ		UINT_C(0x0020)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_SPDQ		UINT_C(0x0100)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RPDQ		UINT_C(0x0200)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_MTX			UINT_C(0x0080)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ç¶æ
+ */
+#define TTW_MPF			UINT_C(0x2000)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TCYC_STP		UINT_C(0x01)	/* å¨æéç¥ãåä½ãã¦ããªã */
+#define TCYC_STA		UINT_C(0x02)	/* å¨æéç¥ãåä½ãã¦ãã */
+
+#define TALM_STP		UINT_C(0x01)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ããªã */
+#define TALM_STA		UINT_C(0x02)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ãã */
+
+/*
+ *  ãã®ä»ã®å®æ°ã®å®ç¾©
+ */
+#define TSK_SELF		0			/* èªã¿ã¹ã¯æå® */
+#define TSK_NONE		0			/* è©²å½ããã¿ã¹ã¯ããªã */
+
+#define TPRI_SELF		0			/* èªã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+#define TPRI_INI		0			/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ */
+
+#define TIPM_ENAALL		0			/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ */
+
+/*
+ *  æ§æå®æ°ã¨ãã¯ã­
+ */
+
+/*
+ *  åªå
+åº¦ã®ç¯å²
+ */
+#define TMIN_TPRI		1			/* ã¿ã¹ã¯åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_TPRI		16			/* ã¿ã¹ã¯åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_DPRI		1			/* ãã¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_DPRI		16			/* ãã¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_ISRPRI		1			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå°å¤ */
+#define TMAX_ISRPRI		16			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå¤§å¤ */
+
+/*
+ *  ãã¼ã¸ã§ã³æ
+å ±
+ */
+#define TKERNEL_MAKER	UINT_C(0x0118)	/* ã«ã¼ãã«ã®ã¡ã¼ã«ã¼ã³ã¼ã */
+#define TKERNEL_PRID	UINT_C(0x0007)	/* ã«ã¼ãã«ã®è­å¥çªå· */
+#define TKERNEL_SPVER	UINT_C(0xf630)	/* ã«ã¼ãã«ä»æ§ã®ãã¼ã¸ã§ã³çªå· */
+#define TKERNEL_PRVER	UINT_C(0x30b0)	/* ã«ã¼ãã«ã®ãã¼ã¸ã§ã³çªå· */
+
+/*
+ *  ã­ã¥ã¼ã¤ã³ã°åæ°ã®æå¤§å¤
+ */
+#define TMAX_ACTCNT		UINT_C(1)		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+#define TMAX_WUPCNT		UINT_C(1)		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+
+/*
+ *  ããããã¿ã¼ã³ã®ãããæ°
+ */
+#ifndef TBIT_FLGPTN					/* ã¤ãã³ããã©ã°ã®ãããæ° */
+#define TBIT_FLGPTN		(sizeof(FLGPTN) * CHAR_BIT)
+#endif /* TBIT_FLGPTN */
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´ã§ããç¯å²ï¼åä½ï¼Î¼ç§ï¼
+ */
+#define TMIN_ADJTIM		-1000000		/* ã·ã¹ãã æå»ã®æå°èª¿æ´æé */
+#define TMAX_ADJTIM		1000000			/* ã·ã¹ãã æå»ã®æå¤§èª¿æ´æé */
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®ãã¯ã­
+ *
+ *  ä»¥ä¸ã®TOPPERS_COUNT_SZã¨TOPPERS_ROUND_SZã®å®ç¾©ã¯ï¼unitã2ã®å·¾ä¹ã§ã
+ *  ããã¨ãä»®å®ãã¦ããï¼
+ */
+#ifndef TOPPERS_COUNT_SZ
+#define TOPPERS_COUNT_SZ(sz, unit)	(((sz) + (unit) - 1) / (unit))
+#endif /* TOPPERS_COUNT_SZ */
+#ifndef TOPPERS_ROUND_SZ
+#define TOPPERS_ROUND_SZ(sz, unit)	(((sz) + (unit) - 1) & ~((unit) - 1))
+#endif /* TOPPERS_ROUND_SZ */
+
+#define COUNT_STK_T(sz)		TOPPERS_COUNT_SZ(sz, sizeof(STK_T))
+#define ROUND_STK_T(sz)		TOPPERS_ROUND_SZ(sz, sizeof(STK_T))
+
+#define COUNT_MPF_T(blksz)	TOPPERS_COUNT_SZ(blksz, sizeof(MPF_T))
+#define ROUND_MPF_T(blksz)	TOPPERS_ROUND_SZ(blksz, sizeof(MPF_T))
+
+#define TSZ_DTQMB(dtqcnt)	(sizeof(intptr_t) * (dtqcnt))
+#define TCNT_DTQMB(dtqcnt)	TOPPERS_COUNT_SZ(TSZ_DTQMB(dtqcnt), sizeof(MB_T))
+
+#ifndef TSZ_PDQMB
+#define TSZ_PDQMB(pdqcnt)	(sizeof(intptr_t) * 3 * (pdqcnt))
+#endif /* TSZ_PDQMB */
+#define TCNT_PDQMB(pdqcnt)	TOPPERS_COUNT_SZ(TSZ_PDQMB(pdqcnt), sizeof(MB_T))
+
+#define TSZ_MPFMB(blkcnt)	(sizeof(uint_t) * (blkcnt))
+#define TCNT_MPFMB(blkcnt)	TOPPERS_COUNT_SZ(TSZ_MPFMB(blkcnt), sizeof(MB_T))
+
+/*
+ *  ãã®ä»ã®æ§æå®æ°
+ */
+#define TMAX_MAXSEM		UINT_MAX	/* ã»ããã©ã®æå¤§è³æºæ°ã®æå¤§å¤ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_KERNEL_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/Makefile.kernel
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/Makefile.kernel	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/Makefile.kernel	(revision 302)
@@ -0,0 +1,157 @@
+#
+#  TOPPERS/ASP Kernel
+#      Toyohashi Open Platform for Embedded Real-Time Systems/
+#      Advanced Standard Profile Kernel
+# 
+#  Copyright (C) 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: Makefile.kernel 333 2015-06-21 13:23:37Z ertl-hiro $
+# 
+
+#
+#		ã«ã¼ãã«ã®ãã¡ã¤ã«æ§æã®å®ç¾©
+#
+
+#
+#  1ã¤ã®ã½ã¼ã¹ãã¡ã¤ã«ããè¤æ°ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ãçæããããã«ä½
+#  æãããã½ã¼ã¹ãã¡ã¤ã«ã®ãªã¹ã
+#
+KERNEL_FCSRCS = startup.c task.c taskhook.c wait.c time_event.c \
+				task_manage.c task_refer.c task_sync.c task_term.c \
+				semaphore.c eventflag.c dataqueue.c pridataq.c mutex.c \
+				mempfix.c time_manage.c cyclic.c alarm.c \
+				sys_manage.c interrupt.c exception.c
+
+#
+#  åã½ã¼ã¹ãã¡ã¤ã«ããçæããããªãã¸ã§ã¯ããã¡ã¤ã«ã®ãªã¹ã
+#
+startup = sta_ker.o ext_ker.o kermem.o
+
+task = tskini.o tsksched.o tskrun.o tsknrun.o \
+		tskdmt.o tskact.o tskpri.o tskrot.o tskterm.o
+
+taskhook = mtxhook.o
+
+wait = waimake.o waicmp.o waitmo.o waitmook.o \
+		wobjwai.o wobjwaitmo.o iniwque.o
+
+time_event = tmeini.o tmeup.o tmedown.o tmecur.o tmeset.o \
+		tmereg.o tmeenq.o tmedeq.o tmechk.o tmeltim.o sigtim.o
+
+task_manage = acre_tsk.o del_tsk.o act_tsk.o can_act.o get_tst.o \
+		chg_pri.o get_pri.o get_inf.o
+
+task_refer = ref_tsk.o
+
+task_sync = slp_tsk.o tslp_tsk.o wup_tsk.o can_wup.o \
+		rel_wai.o sus_tsk.o rsm_tsk.o dly_tsk.o
+
+task_term = ext_tsk.o ras_ter.o ena_ter.o dis_ter.o sns_ter.o ter_tsk.o
+
+semaphore = semini.o acre_sem.o del_sem.o sig_sem.o \
+		wai_sem.o pol_sem.o twai_sem.o ini_sem.o ref_sem.o
+
+eventflag = flgini.o flgcnd.o acre_flg.o del_flg.o set_flg.o clr_flg.o \
+		wai_flg.o pol_flg.o twai_flg.o ini_flg.o ref_flg.o
+
+dataqueue = dtqini.o dtqenq.o dtqfenq.o dtqdeq.o dtqsnd.o dtqfsnd.o dtqrcv.o \
+		acre_dtq.o del_dtq.o snd_dtq.o psnd_dtq.o tsnd_dtq.o fsnd_dtq.o \
+		rcv_dtq.o prcv_dtq.o trcv_dtq.o ini_dtq.o ref_dtq.o
+
+pridataq = pdqini.o pdqenq.o pdqdeq.o pdqsnd.o pdqrcv.o \
+		acre_pdq.o del_pdq.o snd_pdq.o psnd_pdq.o tsnd_pdq.o \
+		rcv_pdq.o prcv_pdq.o trcv_pdq.o ini_pdq.o ref_pdq.o
+
+mutex = mtxini.o mtxchk.o mtxscan.o mtxdrop.o mtxacq.o mtxrel.o mtxrela.o \
+		acre_mtx.o del_mtx.o loc_mtx.o ploc_mtx.o tloc_mtx.o \
+		unl_mtx.o ini_mtx.o ref_mtx.o
+
+mempfix = mpfini.o mpfget.o acre_mpf.o del_mpf.o get_mpf.o \
+		pget_mpf.o tget_mpf.o rel_mpf.o ini_mpf.o ref_mpf.o
+
+time_manage = set_tim.o get_tim.o adj_tim.o fch_hrt.o chknfy.o nfyhdr.o
+
+cyclic = cycini.o acre_cyc.o del_cyc.o sta_cyc.o stp_cyc.o ref_cyc.o cyccal.o
+
+alarm = almini.o acre_alm.o del_alm.o sta_alm.o stp_alm.o ref_alm.o almcal.o
+
+sys_manage = rot_rdq.o get_tid.o get_lod.o get_nth.o \
+		loc_cpu.o unl_cpu.o dis_dsp.o ena_dsp.o \
+		sns_ctx.o sns_loc.o sns_dsp.o sns_dpn.o sns_ker.o
+
+interrupt = isrini.o isrcal.o acre_isr.o del_isr.o \
+		intini.o dis_int.o ena_int.o chg_ipm.o get_ipm.o
+
+exception = excini.o xsns_dpn.o
+
+#
+#  çæããããªãã¸ã§ã¯ããã¡ã¤ã«ã®ä¾å­é¢ä¿ã®å®ç¾©
+#
+$(startup) $(startup:.o=.s) $(startup:.o=.d): startup.c
+$(task) $(task:.o=.s) $(task:.o=.d): task.c
+$(taskhook) $(taskhook:.o=.s) $(taskhook:.o=.d): taskhook.c
+$(wait) $(wait:.o=.s) $(wait:.o=.d): wait.c
+$(time_event) $(time_event:.o=.s) $(time_event:.o=.d): time_event.c
+$(task_manage) $(task_manage:.o=.s) $(task_manage:.o=.d): task_manage.c
+$(task_refer) $(task_refer:.o=.s) $(task_refer:.o=.d): task_refer.c
+$(task_sync) $(task_sync:.o=.s) $(task_sync:.o=.d): task_sync.c
+$(task_term) $(task_term:.o=.s) $(task_term:.o=.d): task_term.c
+$(semaphore) $(semaphore:.o=.s) $(semaphore:.o=.d): semaphore.c
+$(eventflag) $(eventflag:.o=.s) $(eventflag:.o=.d): eventflag.c
+$(dataqueue) $(dataqueue:.o=.s) $(dataqueue:.o=.d): dataqueue.c
+$(pridataq) $(pridataq:.o=.s) $(pridataq:.o=.d): pridataq.c
+$(mutex) $(mutex:.o=.s) $(mutex:.o=.d): mutex.c
+$(mempfix) $(mempfix:.o=.s) $(mempfix:.o=.d): mempfix.c
+$(time_manage) $(time_manage:.o=.s) $(time_manage:.o=.d): time_manage.c
+$(cyclic) $(cyclic:.o=.s) $(cyclic:.o=.d): cyclic.c
+$(alarm) $(alarm:.o=.s) $(alarm:.o=.d): alarm.c
+$(sys_manage) $(sys_manage:.o=.s) $(sys_manage:.o=.d): sys_manage.c
+$(interrupt) $(interrupt:.o=.s) $(interrupt:.o=.d): interrupt.c
+$(exception) $(exception:.o=.s) $(exception:.o=.d): exception.c
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/alarm.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/alarm.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/alarm.c	(revision 302)
@@ -0,0 +1,414 @@
+/*
+ *  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: alarm.c 451 2015-08-14 15:29:07Z ertl-hiro $
+ */
+
+/*
+ *		ã¢ã©ã¼ã éç¥æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "alarm.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ALM_ENTER
+#define LOG_ALM_ENTER(p_almcb)
+#endif /* LOG_ALM_ENTER */
+
+#ifndef LOG_ALM_LEAVE
+#define LOG_ALM_LEAVE(p_almcb)
+#endif /* LOG_ALM_LEAVE */
+
+#ifndef LOG_ACRE_ALM_ENTER
+#define LOG_ACRE_ALM_ENTER(pk_calm)
+#endif /* LOG_ACRE_ALM_ENTER */
+
+#ifndef LOG_ACRE_ALM_LEAVE
+#define LOG_ACRE_ALM_LEAVE(ercd)
+#endif /* LOG_ACRE_ALM_LEAVE */
+
+#ifndef LOG_DEL_ALM_ENTER
+#define LOG_DEL_ALM_ENTER(almid)
+#endif /* LOG_DEL_ALM_ENTER */
+
+#ifndef LOG_DEL_ALM_LEAVE
+#define LOG_DEL_ALM_LEAVE(ercd)
+#endif /* LOG_DEL_ALM_LEAVE */
+
+#ifndef LOG_STA_ALM_ENTER
+#define LOG_STA_ALM_ENTER(almid, almtim)
+#endif /* LOG_STA_ALM_ENTER */
+
+#ifndef LOG_STA_ALM_LEAVE
+#define LOG_STA_ALM_LEAVE(ercd)
+#endif /* LOG_STA_ALM_LEAVE */
+
+#ifndef LOG_STP_ALM_ENTER
+#define LOG_STP_ALM_ENTER(almid)
+#endif /* LOG_STP_ALM_ENTER */
+
+#ifndef LOG_STP_ALM_LEAVE
+#define LOG_STP_ALM_LEAVE(ercd)
+#endif /* LOG_STP_ALM_LEAVE */
+
+#ifndef LOG_REF_ALM_ENTER
+#define LOG_REF_ALM_ENTER(almid, pk_ralm)
+#endif /* LOG_REF_ALM_ENTER */
+
+#ifndef LOG_REF_ALM_LEAVE
+#define LOG_REF_ALM_LEAVE(ercd, pk_ralm)
+#endif /* LOG_REF_ALM_LEAVE */
+
+/*
+ *  ã¢ã©ã¼ã éç¥ã®æ°
+ */
+#define tnum_alm	((uint_t)(tmax_almid - TMIN_ALMID + 1))
+#define tnum_salm	((uint_t)(tmax_salmid - TMIN_ALMID + 1))
+
+/*
+ *  ã¢ã©ã¼ã éç¥IDããã¢ã©ã¼ã éç¥ç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_ALM(almid)	((uint_t)((almid) - TMIN_ALMID))
+#define get_almcb(almid)	(&(almcb_table[INDEX_ALM(almid)]))
+
+#ifdef TOPPERS_almini
+
+/*
+ *  ä½¿ç¨ãã¦ããªãã¢ã©ã¼ã éç¥ç®¡çãã­ãã¯ã®ãªã¹ã
+ *
+ *  ã¢ã©ã¼ã éç¥ç®¡çãã­ãã¯ã®å
+é ­ã«ã¯ã­ã¥ã¼ã«ã¤ãªãããã®é åããªãã
+ *  ãï¼ã¿ã¤ã ã¤ãã³ããã­ãã¯ï¼tmevtbï¼ã®é åãç¨ããï¼
+ */
+QUEUE	free_almcb;
+
+/*
+ *  ã¢ã©ã¼ã éç¥æ©è½ã®åæå
+ */
+void
+initialize_alarm(void)
+{
+	uint_t	i, j;
+	ALMCB	*p_almcb;
+	ALMINIB	*p_alminib;
+
+	for (i = 0; i < tnum_salm; i++) {
+		p_almcb = &(almcb_table[i]);
+		p_almcb->p_alminib = &(alminib_table[i]);
+		p_almcb->almsta = false;
+		p_almcb->tmevtb.callback = (CBACK) call_alarm;
+		p_almcb->tmevtb.arg = (void *) p_almcb;
+	}
+	queue_initialize(&free_almcb);
+	for (j = 0; i < tnum_alm; i++, j++) {
+		p_almcb = &(almcb_table[i]);
+		p_alminib = &(aalminib_table[j]);
+		p_alminib->almatr = TA_NOEXS;
+		p_almcb->p_alminib = ((const ALMINIB *) p_alminib);
+		p_almcb->tmevtb.callback = (CBACK) call_alarm;
+		p_almcb->tmevtb.arg = (void *) p_almcb;
+		queue_insert_prev(&free_almcb, ((QUEUE *) &(p_almcb->tmevtb)));
+	}
+}
+
+#endif /* TOPPERS_almini */
+
+/*
+ *  ã¢ã©ã¼ã éç¥ã®çæ
+ */
+#ifdef TOPPERS_acre_alm
+
+ER_UINT
+acre_alm(const T_CALM *pk_calm)
+{
+	ALMCB		*p_almcb;
+	ALMINIB		*p_alminib;
+	T_NFYINFO	*p_nfyinfo;
+	ER			ercd, rercd;
+
+	LOG_ACRE_ALM_ENTER(pk_calm);
+	CHECK_TSKCTX_UNL();
+	CHECK_RSATR(pk_calm->almatr, TA_NULL);
+	rercd = check_nfyinfo(&(pk_calm->nfyinfo));
+	if (rercd != E_OK) {
+		ercd = rercd;
+		goto error_exit;
+	}
+
+	lock_cpu();
+	if (tnum_alm == 0 || queue_empty(&free_almcb)) {
+		ercd = E_NOID;
+	}
+	else {
+		p_almcb = ((ALMCB *)(((char *) queue_delete_next(&free_almcb))
+												- offsetof(ALMCB, tmevtb)));
+		p_alminib = (ALMINIB *)(p_almcb->p_alminib);
+		p_alminib->almatr = pk_calm->almatr;
+		if (pk_calm->nfyinfo.nfymode == TNFY_HANDLER) {
+			p_alminib->exinf = pk_calm->nfyinfo.nfy.handler.exinf;
+			p_alminib->nfyhdr = (NFYHDR)(pk_calm->nfyinfo.nfy.handler.tmehdr);
+		}
+		else {
+			p_nfyinfo = &aalm_nfyinfo_table[p_alminib - aalminib_table];
+			*p_nfyinfo = pk_calm->nfyinfo;
+			p_alminib->exinf = (intptr_t) p_nfyinfo;
+			p_alminib->nfyhdr = notify_handler;
+		}
+		p_almcb->almsta = false;
+		ercd = ALMID(p_almcb);
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ACRE_ALM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_acre_alm */
+
+/*
+ *  ã¢ã©ã¼ã éç¥ã®åé¤
+ */
+#ifdef TOPPERS_del_alm
+
+ER
+del_alm(ID almid)
+{
+	ALMCB	*p_almcb;
+	ALMINIB	*p_alminib;
+	ER		ercd;
+
+	LOG_DEL_ALM_ENTER(almid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_ALMID(almid));
+	p_almcb = get_almcb(almid);
+
+	lock_cpu();
+	if (p_almcb->p_alminib->almatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (almid <= tmax_salmid) {
+		ercd = E_OBJ;
+	}
+	else {
+		if (p_almcb->almsta) {
+			p_almcb->almsta = false;
+			tmevtb_dequeue(&(p_almcb->tmevtb));
+		}
+
+		p_alminib = (ALMINIB *)(p_almcb->p_alminib);
+		p_alminib->almatr = TA_NOEXS;
+		queue_insert_prev(&free_almcb, ((QUEUE *) &(p_almcb->tmevtb)));
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_DEL_ALM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_del_alm */
+
+/*
+ *  ã¢ã©ã¼ã éç¥ã®åä½éå§
+ */
+#ifdef TOPPERS_sta_alm
+
+ER
+sta_alm(ID almid, RELTIM almtim)
+{
+	ALMCB	*p_almcb;
+	ER		ercd;
+
+	LOG_STA_ALM_ENTER(almid, almtim);
+	CHECK_UNL();
+	CHECK_ID(VALID_ALMID(almid));
+	CHECK_PAR(VALID_RELTIM(almtim));
+	p_almcb = get_almcb(almid);
+
+	lock_cpu();
+	if (p_almcb->p_alminib->almatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		if (p_almcb->almsta) {
+			tmevtb_dequeue(&(p_almcb->tmevtb));
+		}
+		else {
+			p_almcb->almsta = true;
+		}
+		tmevtb_enqueue(&(p_almcb->tmevtb), almtim);
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_STA_ALM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_sta_alm */
+
+/*
+ *  ã¢ã©ã¼ã éç¥ã®åä½åæ­¢
+ */
+#ifdef TOPPERS_stp_alm
+
+ER
+stp_alm(ID almid)
+{
+	ALMCB	*p_almcb;
+	ER		ercd;
+
+	LOG_STP_ALM_ENTER(almid);
+	CHECK_UNL();
+	CHECK_ID(VALID_ALMID(almid));
+	p_almcb = get_almcb(almid);
+
+	lock_cpu();
+	if (p_almcb->p_alminib->almatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		if (p_almcb->almsta) {
+			p_almcb->almsta = false;
+			tmevtb_dequeue(&(p_almcb->tmevtb));
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_STP_ALM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_stp_alm */
+
+/*
+ *  ã¢ã©ã¼ã éç¥ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_alm
+
+ER
+ref_alm(ID almid, T_RALM *pk_ralm)
+{
+	ALMCB	*p_almcb;
+	ER		ercd;
+    
+	LOG_REF_ALM_ENTER(almid, pk_ralm);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_ALMID(almid));
+	p_almcb = get_almcb(almid);
+
+	lock_cpu();
+	if (p_almcb->p_alminib->almatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		if (p_almcb->almsta) {
+			pk_ralm->almstat = TALM_STA;
+			pk_ralm->lefttim = tmevt_lefttim(&(p_almcb->tmevtb));
+		}
+		else {
+			pk_ralm->almstat = TALM_STP;
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_ALM_LEAVE(ercd, pk_ralm);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_alm */
+
+/*
+ *  ã¢ã©ã¼ã éç¥èµ·åã«ã¼ãã³
+ */
+#ifdef TOPPERS_almcal
+
+void
+call_alarm(ALMCB *p_almcb)
+{
+	/*
+	 *  ã¢ã©ã¼ã éç¥ãåæ­¢ç¶æ
+ã«ããï¼
+	 */
+	p_almcb->almsta = false;
+
+	/*
+	 *  éç¥ãã³ãã©ãï¼CPUã­ãã¯è§£é¤ç¶æ
+ã§å¼ã³åºãï¼
+	 */
+	unlock_cpu();
+
+	LOG_ALM_ENTER(p_almcb);
+	(*(p_almcb->p_alminib->nfyhdr))(p_almcb->p_alminib->exinf);
+	LOG_ALM_LEAVE(p_almcb);
+
+	if (!sense_lock()) {
+		lock_cpu();
+	}
+}
+
+#endif /* TOPPERS_almcal */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/alarm.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/alarm.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/alarm.h	(revision 302)
@@ -0,0 +1,131 @@
+/*
+ *  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: alarm.h 333 2015-06-21 13:23:37Z ertl-hiro $
+ */
+
+/*
+ *		ã¢ã©ã¼ã éç¥æ©è½
+ */
+
+#ifndef TOPPERS_ALARM_H
+#define TOPPERS_ALARM_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "time_event.h"
+
+/*
+ *  ã¢ã©ã¼ã éç¥åæåãã­ãã¯
+ */
+typedef struct alarm_handler_initialization_block {
+	ATR			almatr;			/* ã¢ã©ã¼ã éç¥å±æ§ */
+	intptr_t	exinf;			/* éç¥ãã³ãã©ã®æ¡å¼µæ
+å ± */
+	NFYHDR		nfyhdr;			/* éç¥ãã³ãã©ã®èµ·åçªå° */
+} ALMINIB;
+
+/*
+ *  ã¢ã©ã¼ã éç¥ç®¡çãã­ãã¯
+ */
+typedef struct alarm_handler_control_block {
+	const ALMINIB *p_alminib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	bool_t		almsta;			/* ã¢ã©ã¼ã éç¥ã®åä½ç¶æ
+ */
+	TMEVTB		tmevtb;			/* ã¿ã¤ã ã¤ãã³ããã­ãã¯ */
+} ALMCB;
+
+/*
+ *  ä½¿ç¨ãã¦ããªãã¢ã©ã¼ã éç¥ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+extern QUEUE	free_almcb;
+
+/*
+ *  ã¢ã©ã¼ã éç¥IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_almid;
+extern const ID	tmax_salmid;
+
+/*
+ *  ã¢ã©ã¼ã éç¥åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const ALMINIB	alminib_table[];
+extern ALMINIB			aalminib_table[];
+
+/*
+ *  ã¢ã©ã¼ã éç¥ã®éç¥æ¹æ³ã®æ ¼ç´ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern T_NFYINFO	aalm_nfyinfo_table[];
+
+/*
+ *  ã¢ã©ã¼ã éç¥ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern ALMCB	almcb_table[];
+
+/*
+ *  ã¢ã©ã¼ã éç¥ç®¡çãã­ãã¯ããã¢ã©ã¼ã éç¥IDãåãåºãããã®ãã¯ã­
+ */
+#define	ALMID(p_almcb)	((ID)(((p_almcb) - almcb_table) + TMIN_ALMID))
+
+/*
+ *  ã¢ã©ã¼ã éç¥æ©è½ã®åæå
+ */
+extern void	initialize_alarm(void);
+
+/*
+ *  ã¢ã©ã¼ã éç¥èµ·åã«ã¼ãã³
+ */
+extern void	call_alarm(ALMCB *p_almcb);
+
+#endif /* TOPPERS_ALARM_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/alarm.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/alarm.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/alarm.tf	(revision 302)
@@ -0,0 +1,174 @@
+$
+$   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 $
+$ 
+
+$
+$		ã¢ã©ã¼ã éç¥æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  AID_ALMã®å¦ç
+$
+$num_aalmid = 0$
+$FOREACH i AALM.ORDER_LIST$
+$	// noalmãè² ã®å ´åï¼E_PARï¼
+	$IF AALM.NOALM[i] < 0$
+		$ERROR AALM.TEXT_LINE[i]$E_PAR:$SPC$
+			$FORMAT(_("illegal %1% `%2%\' in %3%"),
+									"noalm", AALM.NOALM[i], "AID_ALM")$
+		$END$
+	$END$
+	$num_aalmid = num_aalmid + AALM.NOALM[i]$
+$END$
+$num_almid = LENGTH(ALM.ID_LIST) + num_aalmid$
+
+$
+$  kernel_cfg.hã®çæ
+$
+$FILE "kernel_cfg.h.new"$
+
+#define TNUM_ALMID	$num_almid$$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$
+
+$
+$  éçã«çæãããã¢ã©ã¼ã éç¥ã®æ°
+$
+#define TNUM_SALMID	$LENGTH(ALM.ID_LIST)$$NL$
+$NL$
+
+$
+$  ã¢ã©ã¼ã éç¥IDçªå·ã®æå¤§å¤
+$
+const ID _kernel_tmax_almid = (TMIN_ALMID + TNUM_ALMID - 1);$NL$
+const ID _kernel_tmax_salmid = (TMIN_ALMID + TNUM_SALMID - 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_SALMID] = {$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 num_aalmid > 0$
+	ALMINIB _kernel_aalminib_table[$num_aalmid$];$NL$
+	T_NFYINFO _kernel_aalm_nfyinfo_table[$num_aalmid$];$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(ALMINIB, _kernel_aalminib_table);$NL$
+	TOPPERS_EMPTY_LABEL(T_NFYINFO, _kernel_aalm_nfyinfo_table);$NL$
+$END$$NL$
+
+$
+$  ã¢ã©ã¼ã éç¥ç®¡çãã­ãã¯ã¨ã¢ã©ã¼ã éç¥æ©è½åæåé¢æ°
+$
+$IF num_almid > 0$
+	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/extension/dcre/kernel/allfunc.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/allfunc.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/allfunc.h	(revision 302)
@@ -0,0 +1,281 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: allfunc.h 333 2015-06-21 13:23:37Z ertl-hiro $
+ */
+
+/*
+ *		ãã¹ã¦ã®é¢æ°ãã³ã³ãã¤ã«ããããã®å®ç¾©
+ */
+
+#ifndef TOPPERS_ALLFUNC_H
+#define TOPPERS_ALLFUNC_H
+
+/* startup.c */
+#define TOPPERS_sta_ker
+#define TOPPERS_ext_ker
+#define TOPPERS_kermem
+
+/* task.c */
+#define TOPPERS_tskini
+#define TOPPERS_tsksched
+#define TOPPERS_tskrun
+#define TOPPERS_tsknrun
+#define TOPPERS_tskdmt
+#define TOPPERS_tskact
+#define TOPPERS_tskpri
+#define TOPPERS_tskrot
+#define TOPPERS_tskterm
+
+/* taskhook.c */
+#define TOPPERS_mtxhook
+
+/* wait.c */
+#define TOPPERS_waimake
+#define TOPPERS_waicmp
+#define TOPPERS_waitmo
+#define TOPPERS_waitmook
+#define TOPPERS_wobjwai
+#define TOPPERS_wobjwaitmo
+#define TOPPERS_iniwque
+
+/* time_event.c */
+#define TOPPERS_tmeini
+#define TOPPERS_tmeup
+#define TOPPERS_tmedown
+#define TOPPERS_tmecur
+#define TOPPERS_tmeset
+#define TOPPERS_tmereg
+#define TOPPERS_tmeenq
+#define TOPPERS_tmedeq
+#define TOPPERS_tmechk
+#define TOPPERS_tmeltim
+#define TOPPERS_sigtim
+
+/* task_manage.c */
+#define TOPPERS_acre_tsk
+#define TOPPERS_del_tsk
+#define TOPPERS_act_tsk
+#define TOPPERS_can_act
+#define TOPPERS_get_tst
+#define TOPPERS_chg_pri
+#define TOPPERS_get_pri
+#define TOPPERS_get_inf
+
+/* task_refer.c */
+#define TOPPERS_ref_tsk
+
+/* task_sync.c */
+#define TOPPERS_slp_tsk
+#define TOPPERS_tslp_tsk
+#define TOPPERS_wup_tsk
+#define TOPPERS_can_wup
+#define TOPPERS_rel_wai
+#define TOPPERS_sus_tsk
+#define TOPPERS_rsm_tsk
+#define TOPPERS_dly_tsk
+
+/* task_term.c */
+#define TOPPERS_ext_tsk
+#define TOPPERS_ras_ter
+#define TOPPERS_dis_ter
+#define TOPPERS_ena_ter
+#define TOPPERS_sns_ter
+#define TOPPERS_ter_tsk
+
+/* semaphore.c */
+#define TOPPERS_semini
+#define TOPPERS_acre_sem
+#define TOPPERS_del_sem
+#define TOPPERS_sig_sem
+#define TOPPERS_wai_sem
+#define TOPPERS_pol_sem
+#define TOPPERS_twai_sem
+#define TOPPERS_ini_sem
+#define TOPPERS_ref_sem
+
+/* eventflag.c */
+#define TOPPERS_flgini
+#define TOPPERS_flgcnd
+#define TOPPERS_acre_flg
+#define TOPPERS_del_flg
+#define TOPPERS_set_flg
+#define TOPPERS_clr_flg
+#define TOPPERS_wai_flg
+#define TOPPERS_pol_flg
+#define TOPPERS_twai_flg
+#define TOPPERS_ini_flg
+#define TOPPERS_ref_flg
+
+/* dataqueue.c */
+#define TOPPERS_dtqini
+#define TOPPERS_dtqenq
+#define TOPPERS_dtqfenq
+#define TOPPERS_dtqdeq
+#define TOPPERS_dtqsnd
+#define TOPPERS_dtqfsnd
+#define TOPPERS_dtqrcv
+#define TOPPERS_acre_dtq
+#define TOPPERS_del_dtq
+#define TOPPERS_snd_dtq
+#define TOPPERS_psnd_dtq
+#define TOPPERS_tsnd_dtq
+#define TOPPERS_fsnd_dtq
+#define TOPPERS_rcv_dtq
+#define TOPPERS_prcv_dtq
+#define TOPPERS_trcv_dtq
+#define TOPPERS_ini_dtq
+#define TOPPERS_ref_dtq
+
+/* pridataq.c */
+#define TOPPERS_pdqini
+#define TOPPERS_pdqenq
+#define TOPPERS_pdqdeq
+#define TOPPERS_pdqsnd
+#define TOPPERS_pdqrcv
+#define TOPPERS_acre_pdq
+#define TOPPERS_del_pdq
+#define TOPPERS_snd_pdq
+#define TOPPERS_psnd_pdq
+#define TOPPERS_tsnd_pdq
+#define TOPPERS_rcv_pdq
+#define TOPPERS_prcv_pdq
+#define TOPPERS_trcv_pdq
+#define TOPPERS_ini_pdq
+#define TOPPERS_ref_pdq
+
+/* mutex.c */
+#define TOPPERS_mtxini
+#define TOPPERS_mtxchk
+#define TOPPERS_mtxscan
+#define TOPPERS_mtxdrop
+#define TOPPERS_mtxacq
+#define TOPPERS_mtxrel
+#define TOPPERS_mtxrela
+#define TOPPERS_acre_mtx
+#define TOPPERS_del_mtx
+#define TOPPERS_loc_mtx
+#define TOPPERS_ploc_mtx
+#define TOPPERS_tloc_mtx
+#define TOPPERS_unl_mtx
+#define TOPPERS_ini_mtx
+#define TOPPERS_ref_mtx
+
+/* mempfix.c */
+#define TOPPERS_mpfini
+#define TOPPERS_mpfget
+#define TOPPERS_acre_mpf
+#define TOPPERS_del_mpf
+#define TOPPERS_get_mpf
+#define TOPPERS_pget_mpf
+#define TOPPERS_tget_mpf
+#define TOPPERS_rel_mpf
+#define TOPPERS_ini_mpf
+#define TOPPERS_ref_mpf
+
+/* time_manage.c */
+#define TOPPERS_set_tim
+#define TOPPERS_get_tim
+#define TOPPERS_adj_tim
+#define TOPPERS_fch_hrt
+#define TOPPERS_chknfy
+#define TOPPERS_nfyhdr
+
+/* cyclic.c */
+#define TOPPERS_cycini
+#define TOPPERS_acre_cyc
+#define TOPPERS_del_cyc
+#define TOPPERS_sta_cyc
+#define TOPPERS_stp_cyc
+#define TOPPERS_ref_cyc
+#define TOPPERS_cyccal
+
+/* alarm.c */
+#define TOPPERS_almini
+#define TOPPERS_acre_alm
+#define TOPPERS_del_alm
+#define TOPPERS_sta_alm
+#define TOPPERS_stp_alm
+#define TOPPERS_ref_alm
+#define TOPPERS_almcal
+
+/* sys_manage.c */
+#define TOPPERS_rot_rdq
+#define TOPPERS_get_tid
+#define TOPPERS_get_lod
+#define TOPPERS_get_nth
+#define TOPPERS_loc_cpu
+#define TOPPERS_unl_cpu
+#define TOPPERS_dis_dsp
+#define TOPPERS_ena_dsp
+#define TOPPERS_sns_ctx
+#define TOPPERS_sns_loc
+#define TOPPERS_sns_dsp
+#define TOPPERS_sns_dpn
+#define TOPPERS_sns_ker
+
+/* interrupt.c */
+#define TOPPERS_isrini
+#define TOPPERS_isrcal
+#define TOPPERS_acre_isr
+#define TOPPERS_del_isr
+#define TOPPERS_intini
+#define TOPPERS_dis_int
+#define TOPPERS_ena_int
+#define TOPPERS_chg_ipm
+#define TOPPERS_get_ipm
+
+/* exception.c */
+#define TOPPERS_excini
+#define TOPPERS_xsns_dpn
+
+#endif /* TOPPERS_ALLFUNC_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/check.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/check.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/check.h	(revision 302)
@@ -0,0 +1,279 @@
+/*
+ *  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: check.h 356 2015-07-25 10:44:32Z ertl-hiro $
+ */
+
+/*
+ *		ã¨ã©ã¼ãã§ãã¯ç¨ãã¯ã­
+ */
+
+#ifndef TOPPERS_CHECK_H
+#define TOPPERS_CHECK_H
+
+#include "kernel_impl.h"
+
+/*
+ *  ãªãã¸ã§ã¯ãIDã®ç¯å²ã®å¤å®
+ */
+#define VALID_TSKID(tskid)	(TMIN_TSKID <= (tskid) && (tskid) <= tmax_tskid)
+#define VALID_SEMID(semid)	(TMIN_SEMID <= (semid) && (semid) <= tmax_semid)
+#define VALID_FLGID(flgid)	(TMIN_FLGID <= (flgid) && (flgid) <= tmax_flgid)
+#define VALID_DTQID(dtqid)	(TMIN_DTQID <= (dtqid) && (dtqid) <= tmax_dtqid)
+#define VALID_PDQID(pdqid)	(TMIN_PDQID <= (pdqid) && (pdqid) <= tmax_pdqid)
+#define VALID_MTXID(mtxid)	(TMIN_MTXID <= (mtxid) && (mtxid) <= tmax_mtxid)
+#define VALID_MPFID(mpfid)	(TMIN_MPFID <= (mpfid) && (mpfid) <= tmax_mpfid)
+#define VALID_CYCID(cycid)	(TMIN_CYCID <= (cycid) && (cycid) <= tmax_cycid)
+#define VALID_ALMID(almid)	(TMIN_ALMID <= (almid) && (almid) <= tmax_almid)
+#define VALID_ISRID(isrid)	(TMIN_ISRID <= (isrid) && (isrid) <= tmax_isrid)
+
+/*
+ *  ãªãã¸ã§ã¯ãçªå·ã®ç¯å²ã®å¤å®
+ */
+#ifndef VALID_INTNO_DISINT
+#define VALID_INTNO_DISINT(intno)    VALID_INTNO(intno)
+#endif /* VALID_INTNO_DISINT */
+
+#ifndef VALID_INTNO_CREISR
+#define VALID_INTNO_CREISR(intno)    VALID_INTNO(intno)
+#endif /* VALID_INTNO_CREISR */
+
+/*
+ *  åªå
+åº¦ã®ç¯å²ã®å¤å®
+ */
+#define VALID_TPRI(tpri)	(TMIN_TPRI <= (tpri) && (tpri) <= TMAX_TPRI)
+
+#define VALID_DPRI(dpri)	(TMIN_DPRI <= (dpri) && (dpri) <= TMAX_DPRI)
+
+#define VALID_ISRPRI(isrpri) \
+				(TMIN_ISRPRI <= (isrpri) && (isrpri) <= TMAX_ISRPRI)
+
+#ifndef VALID_INTPRI_CHGIPM
+#define VALID_INTPRI_CHGIPM(intpri) \
+				(TMIN_INTPRI <= (intpri) && (intpri) <= TIPM_ENAALL)
+#endif /* VALID_INTPRI_CHGIPM */
+
+/*
+ *  ç¸å¯¾æéã®ç¯å²ã®å¤å®
+ */
+#define VALID_RELTIM(reltim)	((reltim) <= TMAX_RELTIM)
+
+/*
+ *  ã¿ã¤ã ã¢ã¦ãæå®å¤ã®ç¯å²ã®å¤å®
+ */
+#define VALID_TMOUT(tmout)	((tmout) <= TMAX_RELTIM || (tmout) == TMO_FEVR \
+													|| (tmout) == TMO_POL)
+
+/*
+ *  ã¢ã©ã¤ã³ãã¦ãããã®å¤å®
+ */
+#define ALIGNED(val, align)		((((uintptr_t)(val)) & ((align) - 1U)) == 0U)
+
+#ifdef CHECK_STKSZ_ALIGN
+#define STKSZ_ALIGN(stksz)		ALIGNED(stksz, CHECK_STKSZ_ALIGN)
+#else /* CHECK_STKSZ_ALIGN */
+#define STKSZ_ALIGN(stksz)		true
+#endif /* CHECK_STKSZ_ALIGN */
+
+#ifdef CHECK_INTPTR_ALIGN
+#define INTPTR_ALIGN(p_var)		ALIGNED(p_var, CHECK_INTPTR_ALIGN)
+#else /* CHECK_INTPTR_ALIGN */
+#define INTPTR_ALIGN(p_var)		true
+#endif /* CHECK_INTPTR_ALIGN */
+
+#ifdef CHECK_FUNC_ALIGN
+#define FUNC_ALIGN(func)		ALIGNED(func, CHECK_FUNC_ALIGN)
+#else /* CHECK_FUNC_ALIGN */
+#define FUNC_ALIGN(func)		true
+#endif /* CHECK_FUNC_ALIGN */
+
+#ifdef CHECK_STACK_ALIGN
+#define STACK_ALIGN(stack)		ALIGNED(stack, CHECK_STACK_ALIGN)
+#else /* CHECK_STACK_ALIGN */
+#define STACK_ALIGN(stack)		true
+#endif /* CHECK_STACK_ALIGN */
+
+#ifdef CHECK_MPF_ALIGN
+#define MPF_ALIGN(mpf)			ALIGNED(mpf, CHECK_MPF_ALIGN)
+#else /* CHECK_MPF_ALIGN */
+#define MPF_ALIGN(mpf)			true
+#endif /* CHECK_MPF_ALIGN */
+
+#ifdef CHECK_MB_ALIGN
+#define MB_ALIGN(mb)			ALIGNED(mb, CHECK_MB_ALIGN)
+#else /* CHECK_MB_ALIGN */
+#define MB_ALIGN(mb)			true
+#endif /* CHECK_MB_ALIGN */
+
+/*
+ *  NULLã§ãªããã¨ã®å¤å®
+ */
+#ifdef CHECK_INTPTR_NONNULL
+#define INTPTR_NONNULL(p_var)	((p_var) != NULL)
+#else /* CHECK_INTPTR_NONNULL */
+#define INTPTR_NONNULL(p_var)	true
+#endif /* CHECK_INTPTR_NONNULL */
+
+#ifdef CHECK_FUNC_NONNULL
+#define FUNC_NONNULL(func)		((func) != NULL)
+#else /* CHECK_FUNC_NONNULL */
+#define FUNC_NONNULL(func)		true
+#endif /* CHECK_FUNC_NONNULL */
+
+/*
+ *  å¼åºãã³ã³ãã­ã¹ãã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_TSKCTX() do {									\
+	if (sense_context()) {									\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_UNL() do {									\
+	if (sense_lock()) {										\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  å¼åºãã³ã³ãã­ã¹ãã¨CPUã­ãã¯ç¶æ
+ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_TSKCTX_UNL() do {								\
+	if (sense_context() || sense_lock()) {					\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã£ã¹ãããä¿çç¶æ
+ã§ãªããã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_DISPATCH() do {								\
+	if (sense_context() || sense_lock() || !dspflg) {		\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã®ä»ã®ã³ã³ãã­ã¹ãã¨ã©ã¼ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_CTX(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãªãã¸ã§ã¯ãIDã®ãã§ãã¯ï¼E_IDï¼
+ */
+#define CHECK_ID(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_ID;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  äºç´å±æ§ã¨ã©ã¼ã®ãã§ãã¯ï¼E_PARï¼
+ */
+#define CHECK_RSATR(atr, valid_atr) do {					\
+	if (((atr) & ~(valid_atr)) != 0U) {						\
+		ercd = E_RSATR;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã©ã¡ã¼ã¿ã¨ã©ã¼ã®ãã§ãã¯ï¼E_PARï¼
+ */
+#define CHECK_PAR(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_PAR;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ä¸æ­£ä½¿ç¨ã¨ã©ã¼ã®ãã§ãã¯ï¼E_ILUSEï¼
+ */
+#define CHECK_ILUSE(exp) do {								\
+	if (!(exp)) {											\
+		ercd = E_ILUSE;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  éçãªãªãã¸ã§ã¯ãç¶æ
+ã¨ã©ã¼ã®ãã§ãã¯ï¼E_OBJï¼
+ */
+#define CHECK_OBJ(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_OBJ;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+#endif /* TOPPERS_CHECK_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/cyclic.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/cyclic.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/cyclic.c	(revision 302)
@@ -0,0 +1,438 @@
+/*
+ *  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: cyclic.c 451 2015-08-14 15:29:07Z ertl-hiro $
+ */
+
+/*
+ *		å¨æéç¥æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "cyclic.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_CYC_ENTER
+#define LOG_CYC_ENTER(p_cyccb)
+#endif /* LOG_CYC_ENTER */
+
+#ifndef LOG_CYC_LEAVE
+#define LOG_CYC_LEAVE(p_cyccb)
+#endif /* LOG_CYC_LEAVE */
+
+#ifndef LOG_ACRE_CYC_ENTER
+#define LOG_ACRE_CYC_ENTER(pk_ccyc)
+#endif /* LOG_ACRE_CYC_ENTER */
+
+#ifndef LOG_ACRE_CYC_LEAVE
+#define LOG_ACRE_CYC_LEAVE(ercd)
+#endif /* LOG_ACRE_CYC_LEAVE */
+
+#ifndef LOG_DEL_CYC_ENTER
+#define LOG_DEL_CYC_ENTER(cycid)
+#endif /* LOG_DEL_CYC_ENTER */
+
+#ifndef LOG_DEL_CYC_LEAVE
+#define LOG_DEL_CYC_LEAVE(ercd)
+#endif /* LOG_DEL_CYC_LEAVE */
+
+#ifndef LOG_STA_CYC_ENTER
+#define LOG_STA_CYC_ENTER(cycid)
+#endif /* LOG_STA_CYC_ENTER */
+
+#ifndef LOG_STA_CYC_LEAVE
+#define LOG_STA_CYC_LEAVE(ercd)
+#endif /* LOG_STA_CYC_LEAVE */
+
+#ifndef LOG_STP_CYC_ENTER
+#define LOG_STP_CYC_ENTER(cycid)
+#endif /* LOG_STP_CYC_ENTER */
+
+#ifndef LOG_STP_CYC_LEAVE
+#define LOG_STP_CYC_LEAVE(ercd)
+#endif /* LOG_STP_CYC_LEAVE */
+
+#ifndef LOG_REF_CYC_ENTER
+#define LOG_REF_CYC_ENTER(cycid, pk_rcyc)
+#endif /* LOG_REF_CYC_ENTER */
+
+#ifndef LOG_REF_CYC_LEAVE
+#define LOG_REF_CYC_LEAVE(ercd, pk_rcyc)
+#endif /* LOG_REF_CYC_LEAVE */
+
+/*
+ *  å¨æéç¥ã®æ°
+ */
+#define tnum_cyc	((uint_t)(tmax_cycid - TMIN_CYCID + 1))
+#define tnum_scyc	((uint_t)(tmax_scycid - TMIN_CYCID + 1))
+
+/*
+ *  å¨æéç¥IDããå¨æéç¥ç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_CYC(cycid)	((uint_t)((cycid) - TMIN_CYCID))
+#define get_cyccb(cycid)	(&(cyccb_table[INDEX_CYC(cycid)]))
+
+#ifdef TOPPERS_cycini
+
+/*
+ *  ä½¿ç¨ãã¦ããªãå¨æéç¥ç®¡çãã­ãã¯ã®ãªã¹ã
+ *
+ *  å¨æéç¥ç®¡çãã­ãã¯ã®å
+é ­ã«ã¯ã­ã¥ã¼ã«ã¤ãªãããã®é åããªãããï¼
+ *  ã¿ã¤ã ã¤ãã³ããã­ãã¯ï¼tmevtbï¼ã®é åãç¨ããï¼
+ */
+QUEUE	free_cyccb;
+
+/*
+ *  å¨æéç¥æ©è½ã®åæå
+ */
+void
+initialize_cyclic(void)
+{
+	uint_t	i, j;
+	CYCCB	*p_cyccb;
+	CYCINIB	*p_cycinib;
+
+	for (i = 0; i < tnum_scyc; i++) {
+		p_cyccb = &(cyccb_table[i]);
+		p_cyccb->p_cycinib = &(cycinib_table[i]);
+		p_cyccb->tmevtb.callback = (CBACK) call_cyclic;
+		p_cyccb->tmevtb.arg = (void *) p_cyccb;
+		if ((p_cyccb->p_cycinib->cycatr & TA_STA) != 0U) {
+			/*
+			 *  ååã®èµ·åã®ããã®ã¿ã¤ã ã¤ãã³ããç»é²ããï¼»ASPD1035ï¼½
+			 *  ï¼»ASPD1062ï¼½ï¼
+			 */
+			p_cyccb->cycsta = true;
+			p_cyccb->tmevtb.evttim = (EVTTIM)(p_cyccb->p_cycinib->cycphs);
+			tmevtb_register(&(p_cyccb->tmevtb));
+		}
+		else {
+			p_cyccb->cycsta = false;
+		}
+	}
+	queue_initialize(&free_cyccb);
+	for (j = 0; i < tnum_cyc; i++, j++) {
+		p_cyccb = &(cyccb_table[i]);
+		p_cycinib = &(acycinib_table[j]);
+		p_cycinib->cycatr = TA_NOEXS;
+		p_cyccb->p_cycinib = ((const CYCINIB *) p_cycinib);
+		p_cyccb->tmevtb.callback = (CBACK) call_cyclic;
+		p_cyccb->tmevtb.arg = (void *) p_cyccb;
+		queue_insert_prev(&free_cyccb, ((QUEUE *) &(p_cyccb->tmevtb)));
+	}
+}
+
+#endif /* TOPPERS_cycini */
+
+/*
+ *  å¨æéç¥ã®çæ
+ */
+#ifdef TOPPERS_acre_cyc
+
+ER_UINT
+acre_cyc(const T_CCYC *pk_ccyc)
+{
+	CYCCB		*p_cyccb;
+	CYCINIB		*p_cycinib;
+	T_NFYINFO	*p_nfyinfo;
+	ER			ercd, rercd;
+
+	LOG_ACRE_CYC_ENTER(pk_ccyc);
+	CHECK_TSKCTX_UNL();
+	CHECK_RSATR(pk_ccyc->cycatr, TA_STA);
+	rercd = check_nfyinfo(&(pk_ccyc->nfyinfo));
+	if (rercd != E_OK) {
+		ercd = rercd;
+		goto error_exit;
+	}
+	CHECK_PAR(0 < pk_ccyc->cyctim && pk_ccyc->cyctim <= TMAX_RELTIM);
+	CHECK_PAR(0 <= pk_ccyc->cycphs && pk_ccyc->cycphs <= TMAX_RELTIM);
+
+	lock_cpu();
+	if (tnum_cyc == 0 || queue_empty(&free_cyccb)) {
+		ercd = E_NOID;
+	}
+	else {
+		p_cyccb = ((CYCCB *)(((char *) queue_delete_next(&free_cyccb))
+												- offsetof(CYCCB, tmevtb)));
+		p_cycinib = (CYCINIB *)(p_cyccb->p_cycinib);
+		p_cycinib->cycatr = pk_ccyc->cycatr;
+		if (pk_ccyc->nfyinfo.nfymode == TNFY_HANDLER) {
+			p_cycinib->exinf = pk_ccyc->nfyinfo.nfy.handler.exinf;
+			p_cycinib->nfyhdr = (NFYHDR)(pk_ccyc->nfyinfo.nfy.handler.tmehdr);
+		}
+		else {
+			p_nfyinfo = &acyc_nfyinfo_table[p_cycinib - acycinib_table];
+			*p_nfyinfo = pk_ccyc->nfyinfo;
+			p_cycinib->exinf = (intptr_t) p_nfyinfo;
+			p_cycinib->nfyhdr = notify_handler;
+		}
+		p_cycinib->cyctim = pk_ccyc->cyctim;
+		p_cycinib->cycphs = pk_ccyc->cycphs;
+
+		if ((p_cyccb->p_cycinib->cycatr & TA_STA) != 0U) {
+			p_cyccb->cycsta = true;
+			tmevtb_enqueue(&(p_cyccb->tmevtb), p_cyccb->p_cycinib->cycphs);
+		}
+		else {
+			p_cyccb->cycsta = false;
+		}
+		ercd = CYCID(p_cyccb);
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ACRE_CYC_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_acre_cyc */
+
+/*
+ *  å¨æéç¥ã®åé¤
+ */
+#ifdef TOPPERS_del_cyc
+
+ER
+del_cyc(ID cycid)
+{
+	CYCCB	*p_cyccb;
+	CYCINIB	*p_cycinib;
+	ER		ercd;
+
+	LOG_DEL_CYC_ENTER(cycid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_CYCID(cycid));
+	p_cyccb = get_cyccb(cycid);
+
+	lock_cpu();
+	if (p_cyccb->p_cycinib->cycatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (cycid <= tmax_scycid) {
+		ercd = E_OBJ;
+	}
+	else {
+		if (p_cyccb->cycsta) {
+			p_cyccb->cycsta = false;
+			tmevtb_dequeue(&(p_cyccb->tmevtb));
+		}
+
+		p_cycinib = (CYCINIB *)(p_cyccb->p_cycinib);
+		p_cycinib->cycatr = TA_NOEXS;
+		queue_insert_prev(&free_cyccb, ((QUEUE *) &(p_cyccb->tmevtb)));
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_DEL_CYC_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_del_cyc */
+
+/*
+ *  å¨æéç¥ã®åä½éå§
+ */
+#ifdef TOPPERS_sta_cyc
+
+ER
+sta_cyc(ID cycid)
+{
+	CYCCB	*p_cyccb;
+	ER		ercd;
+
+	LOG_STA_CYC_ENTER(cycid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_CYCID(cycid));
+	p_cyccb = get_cyccb(cycid);
+
+	lock_cpu();
+	if (p_cyccb->p_cycinib->cycatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		if (p_cyccb->cycsta) {
+			tmevtb_dequeue(&(p_cyccb->tmevtb));
+		}
+		else {
+			p_cyccb->cycsta = true;
+		}
+		/*
+		 *  ååã®èµ·åã®ããã®ã¿ã¤ã ã¤ãã³ããç»é²ããï¼»ASPD1036ï¼½ï¼
+		 */
+		tmevtb_enqueue(&(p_cyccb->tmevtb), p_cyccb->p_cycinib->cycphs);
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_STA_CYC_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_sta_cyc */
+
+/*
+ *  å¨æéç¥ã®åä½åæ­¢
+ */
+#ifdef TOPPERS_stp_cyc
+
+ER
+stp_cyc(ID cycid)
+{
+	CYCCB	*p_cyccb;
+	ER		ercd;
+
+	LOG_STP_CYC_ENTER(cycid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_CYCID(cycid));
+	p_cyccb = get_cyccb(cycid);
+
+	lock_cpu();
+	if (p_cyccb->p_cycinib->cycatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		if (p_cyccb->cycsta) {
+			p_cyccb->cycsta = false;
+			tmevtb_dequeue(&(p_cyccb->tmevtb));
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_STP_CYC_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_stp_cyc */
+
+/*
+ *  å¨æéç¥ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_cyc
+
+ER
+ref_cyc(ID cycid, T_RCYC *pk_rcyc)
+{
+	CYCCB	*p_cyccb;
+	ER		ercd;
+    
+	LOG_REF_CYC_ENTER(cycid, pk_rcyc);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_CYCID(cycid));
+	p_cyccb = get_cyccb(cycid);
+
+	lock_cpu();
+	if (p_cyccb->p_cycinib->cycatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		if (p_cyccb->cycsta) {
+			pk_rcyc->cycstat = TCYC_STA;
+			pk_rcyc->lefttim = tmevt_lefttim(&(p_cyccb->tmevtb));
+		}
+		else {
+			pk_rcyc->cycstat = TCYC_STP;
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_CYC_LEAVE(ercd, pk_rcyc);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_cyc */
+
+/*
+ *  å¨æéç¥èµ·åã«ã¼ãã³
+ */
+#ifdef TOPPERS_cyccal
+
+void
+call_cyclic(CYCCB *p_cyccb)
+{
+	/*
+	 *  æ¬¡åã®èµ·åã®ããã®ã¿ã¤ã ã¤ãã³ããç»é²ããï¼»ASPD1037ï¼½ï¼
+	 */
+	p_cyccb->tmevtb.evttim += p_cyccb->p_cycinib->cyctim;	/*ï¼»ASPD1038ï¼½*/
+	tmevtb_register(&(p_cyccb->tmevtb));
+
+	/*
+	 *  éç¥ãã³ãã©ãï¼CPUã­ãã¯è§£é¤ç¶æ
+ã§å¼ã³åºãï¼
+	 */
+	unlock_cpu();
+
+	LOG_CYC_ENTER(p_cyccb);
+	(*(p_cyccb->p_cycinib->nfyhdr))(p_cyccb->p_cycinib->exinf);
+	LOG_CYC_LEAVE(p_cyccb);
+
+	if (!sense_lock()) {
+		lock_cpu();
+	}
+}
+
+#endif /* TOPPERS_cyccal */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/cyclic.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/cyclic.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/cyclic.h	(revision 302)
@@ -0,0 +1,136 @@
+/*
+ *  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: cyclic.h 451 2015-08-14 15:29:07Z ertl-hiro $
+ */
+
+/*
+ *		å¨æéç¥æ©è½
+ */
+
+#ifndef TOPPERS_CYCLIC_H
+#define TOPPERS_CYCLIC_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "time_event.h"
+
+/*
+ *  å¨æéç¥åæåãã­ãã¯
+ */
+typedef struct cyclic_handler_initialization_block {
+	ATR			cycatr;			/* å¨æéç¥å±æ§ */
+	intptr_t	exinf;			/* éç¥ãã³ãã©ã®æ¡å¼µæ
+å ± */
+	NFYHDR		nfyhdr;			/* éç¥ãã³ãã©ã®èµ·åçªå° */
+	RELTIM		cyctim;			/* å¨æéç¥ã®èµ·åå¨æ */
+	RELTIM		cycphs;			/* å¨æéç¥ã®èµ·åä½ç¸ */
+} CYCINIB;
+
+/*
+ *  å¨æéç¥ç®¡çãã­ãã¯
+ *
+ *	æ¬¡ã«å¨æéç¥ãèµ·åããæå»ã¯ï¼ã¿ã¤ã ã¤ãã³ããã­ãã¯ï¼tmevtbï¼ä¸­ã®
+ *	ã¿ã¤ã ã¤ãã³ãã®çºçæå»ï¼evttimï¼ã§ä¿æããï¼
+ */
+typedef struct cyclic_handler_control_block {
+	const CYCINIB *p_cycinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	bool_t		cycsta;			/* å¨æéç¥ã®åä½ç¶æ
+ */
+	TMEVTB		tmevtb;			/* ã¿ã¤ã ã¤ãã³ããã­ãã¯ */
+} CYCCB;
+
+/*
+ *  ä½¿ç¨ãã¦ããªãå¨æéç¥ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+extern QUEUE	free_cyccb;
+
+/*
+ *  å¨æéç¥IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_cycid;
+extern const ID	tmax_scycid;
+
+/*
+ *  å¨æéç¥åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const CYCINIB	cycinib_table[];
+extern CYCINIB			acycinib_table[];
+
+/*
+ *  å¨æéç¥ã®éç¥æ¹æ³ã®æ ¼ç´ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern T_NFYINFO	acyc_nfyinfo_table[];
+
+/*
+ *  å¨æéç¥ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern CYCCB	cyccb_table[];
+
+/*
+ *  å¨æéç¥ç®¡çãã­ãã¯ããå¨æéç¥IDãåãåºãããã®ãã¯ã­
+ */
+#define	CYCID(p_cyccb)	((ID)(((p_cyccb) - cyccb_table) + TMIN_CYCID))
+
+/*
+ *  å¨æéç¥æ©è½ã®åæå
+ */
+extern void	initialize_cyclic(void);
+
+/*
+ *  å¨æéç¥èµ·åã«ã¼ãã³
+ */
+extern void	call_cyclic(CYCCB *p_cyccb);
+
+#endif /* TOPPERS_CYCLIC_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/cyclic.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/cyclic.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/cyclic.tf	(revision 302)
@@ -0,0 +1,191 @@
+$
+$   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 $
+$ 
+
+$
+$		å¨æéç¥æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  AID_CYCã®å¦ç
+$
+$num_acycid = 0$
+$FOREACH i ACYC.ORDER_LIST$
+$	// nocycãè² ã®å ´åï¼E_PARï¼
+	$IF ACYC.NOCYC[i] < 0$
+		$ERROR ACYC.TEXT_LINE[i]$E_PAR:$SPC$
+			$FORMAT(_("illegal %1% `%2%\' in %3%"),
+									"nocyc", ACYC.NOCYC[i], "AID_CYC")$
+		$END$
+	$END$
+	$num_acycid = num_acycid + ACYC.NOCYC[i]$
+$END$
+$num_cycid = LENGTH(CYC.ID_LIST) + num_acycid$
+
+$
+$  kernel_cfg.hã®çæ
+$
+$FILE "kernel_cfg.h.new"$
+
+#define TNUM_CYCID	$num_cycid$$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$
+
+$
+$  éçã«çæãããå¨æéç¥ã®æ°
+$
+#define TNUM_SCYCID	$LENGTH(CYC.ID_LIST)$$NL$
+$NL$
+
+$
+$  å¨æéç¥IDçªå·ã®æå¤§å¤
+$
+const ID _kernel_tmax_cycid = (TMIN_CYCID + TNUM_CYCID - 1);$NL$
+const ID _kernel_tmax_scycid = (TMIN_CYCID + TNUM_SCYCID - 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_SCYCID] = {$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 num_acycid > 0$
+	CYCINIB _kernel_acycinib_table[$num_acycid$];$NL$
+	T_NFYINFO _kernel_acyc_nfyinfo_table[$num_acycid$];$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(CYCINIB, _kernel_acycinib_table);$NL$
+	TOPPERS_EMPTY_LABEL(T_NFYINFO, _kernel_acyc_nfyinfo_table);$NL$
+$END$$NL$
+
+$
+$  å¨æéç¥ç®¡çãã­ãã¯ã¨å¨æéç¥æ©è½åæåé¢æ°
+$
+$IF num_cycid > 0$
+	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/extension/dcre/kernel/dataqueue.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/dataqueue.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/dataqueue.c	(revision 302)
@@ -0,0 +1,857 @@
+/*
+ *  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: dataqueue.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		ãã¼ã¿ã­ã¥ã¼æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "dataqueue.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ACRE_DTQ_ENTER
+#define LOG_ACRE_DTQ_ENTER(pk_cdtq)
+#endif /* LOG_ACRE_DTQ_ENTER */
+
+#ifndef LOG_ACRE_DTQ_LEAVE
+#define LOG_ACRE_DTQ_LEAVE(ercd)
+#endif /* LOG_ACRE_DTQ_LEAVE */
+
+#ifndef LOG_DEL_DTQ_ENTER
+#define LOG_DEL_DTQ_ENTER(dtqid)
+#endif /* LOG_DEL_DTQ_ENTER */
+
+#ifndef LOG_DEL_DTQ_LEAVE
+#define LOG_DEL_DTQ_LEAVE(ercd)
+#endif /* LOG_DEL_DTQ_LEAVE */
+
+#ifndef LOG_SND_DTQ_ENTER
+#define LOG_SND_DTQ_ENTER(dtqid, data)
+#endif /* LOG_SND_DTQ_ENTER */
+
+#ifndef LOG_SND_DTQ_LEAVE
+#define LOG_SND_DTQ_LEAVE(ercd)
+#endif /* LOG_SND_DTQ_LEAVE */
+
+#ifndef LOG_PSND_DTQ_ENTER
+#define LOG_PSND_DTQ_ENTER(dtqid, data)
+#endif /* LOG_PSND_DTQ_ENTER */
+
+#ifndef LOG_PSND_DTQ_LEAVE
+#define LOG_PSND_DTQ_LEAVE(ercd)
+#endif /* LOG_PSND_DTQ_LEAVE */
+
+#ifndef LOG_TSND_DTQ_ENTER
+#define LOG_TSND_DTQ_ENTER(dtqid, data, tmout)
+#endif /* LOG_TSND_DTQ_ENTER */
+
+#ifndef LOG_TSND_DTQ_LEAVE
+#define LOG_TSND_DTQ_LEAVE(ercd)
+#endif /* LOG_TSND_DTQ_LEAVE */
+
+#ifndef LOG_FSND_DTQ_ENTER
+#define LOG_FSND_DTQ_ENTER(dtqid, data)
+#endif /* LOG_FSND_DTQ_ENTER */
+
+#ifndef LOG_FSND_DTQ_LEAVE
+#define LOG_FSND_DTQ_LEAVE(ercd)
+#endif /* LOG_FSND_DTQ_LEAVE */
+
+#ifndef LOG_RCV_DTQ_ENTER
+#define LOG_RCV_DTQ_ENTER(dtqid, p_data)
+#endif /* LOG_RCV_DTQ_ENTER */
+
+#ifndef LOG_RCV_DTQ_LEAVE
+#define LOG_RCV_DTQ_LEAVE(ercd, p_data)
+#endif /* LOG_RCV_DTQ_LEAVE */
+
+#ifndef LOG_PRCV_DTQ_ENTER
+#define LOG_PRCV_DTQ_ENTER(dtqid, p_data)
+#endif /* LOG_PRCV_DTQ_ENTER */
+
+#ifndef LOG_PRCV_DTQ_LEAVE
+#define LOG_PRCV_DTQ_LEAVE(ercd, p_data)
+#endif /* LOG_PRCV_DTQ_LEAVE */
+
+#ifndef LOG_TRCV_DTQ_ENTER
+#define LOG_TRCV_DTQ_ENTER(dtqid, p_data, tmout)
+#endif /* LOG_TRCV_DTQ_ENTER */
+
+#ifndef LOG_TRCV_DTQ_LEAVE
+#define LOG_TRCV_DTQ_LEAVE(ercd, p_data)
+#endif /* LOG_TRCV_DTQ_LEAVE */
+
+#ifndef LOG_INI_DTQ_ENTER
+#define LOG_INI_DTQ_ENTER(dtqid)
+#endif /* LOG_INI_DTQ_ENTER */
+
+#ifndef LOG_INI_DTQ_LEAVE
+#define LOG_INI_DTQ_LEAVE(ercd)
+#endif /* LOG_INI_DTQ_LEAVE */
+
+#ifndef LOG_REF_DTQ_ENTER
+#define LOG_REF_DTQ_ENTER(dtqid, pk_rdtq)
+#endif /* LOG_REF_DTQ_ENTER */
+
+#ifndef LOG_REF_DTQ_LEAVE
+#define LOG_REF_DTQ_LEAVE(ercd, pk_rdtq)
+#endif /* LOG_REF_DTQ_LEAVE */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã®æ°
+ */
+#define tnum_dtq	((uint_t)(tmax_dtqid - TMIN_DTQID + 1))
+#define tnum_sdtq	((uint_t)(tmax_sdtqid - TMIN_DTQID + 1))
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼IDãããã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_DTQ(dtqid)	((uint_t)((dtqid) - TMIN_DTQID))
+#define get_dtqcb(dtqid)	(&(dtqcb_table[INDEX_DTQ(dtqid)]))
+
+#ifdef TOPPERS_dtqini
+
+/*
+ *  ä½¿ç¨ãã¦ããªããã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+QUEUE	free_dtqcb;
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼æ©è½ã®åæå
+ */
+void
+initialize_dataqueue(void)
+{
+	uint_t	i, j;
+	DTQCB	*p_dtqcb;
+	DTQINIB	*p_dtqinib;
+
+	for (i = 0; i < tnum_sdtq; i++) {
+		p_dtqcb = &(dtqcb_table[i]);
+		queue_initialize(&(p_dtqcb->swait_queue));
+		p_dtqcb->p_dtqinib = &(dtqinib_table[i]);
+		queue_initialize(&(p_dtqcb->rwait_queue));
+		p_dtqcb->count = 0U;
+		p_dtqcb->head = 0U;
+		p_dtqcb->tail = 0U;
+	}
+	queue_initialize(&free_dtqcb);
+	for (j = 0; i < tnum_dtq; i++, j++) {
+		p_dtqcb = &(dtqcb_table[i]);
+		p_dtqinib = &(adtqinib_table[j]);
+		p_dtqinib->dtqatr = TA_NOEXS;
+		p_dtqcb->p_dtqinib = ((const DTQINIB *) p_dtqinib);
+		queue_insert_prev(&free_dtqcb, &(p_dtqcb->swait_queue));
+	}
+}
+
+#endif /* TOPPERS_dtqini */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çé åã¸ã®ãã¼ã¿ã®æ ¼ç´
+ */
+#ifdef TOPPERS_dtqenq
+
+void
+enqueue_data(DTQCB *p_dtqcb, intptr_t data)
+{
+	(p_dtqcb->p_dtqinib->p_dtqmb + p_dtqcb->tail)->data = data;
+	p_dtqcb->count++;
+	p_dtqcb->tail++;
+	if (p_dtqcb->tail >= p_dtqcb->p_dtqinib->dtqcnt) {
+		p_dtqcb->tail = 0U;
+	}
+}
+
+#endif /* TOPPERS_dtqenq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çé åã¸ã®ãã¼ã¿ã®å¼·å¶æ ¼ç´
+ */
+#ifdef TOPPERS_dtqfenq
+
+void
+force_enqueue_data(DTQCB *p_dtqcb, intptr_t data)
+{
+	(p_dtqcb->p_dtqinib->p_dtqmb + p_dtqcb->tail)->data = data;
+	p_dtqcb->tail++;
+	if (p_dtqcb->tail >= p_dtqcb->p_dtqinib->dtqcnt) {
+		p_dtqcb->tail = 0U;
+	}
+	if (p_dtqcb->count < p_dtqcb->p_dtqinib->dtqcnt) {
+		p_dtqcb->count++;
+	}
+	else {
+		p_dtqcb->head = p_dtqcb->tail;
+	}
+}
+
+#endif /* TOPPERS_dtqfenq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çé åããã®ãã¼ã¿ã®ååºã
+ */
+#ifdef TOPPERS_dtqdeq
+
+void
+dequeue_data(DTQCB *p_dtqcb, intptr_t *p_data)
+{
+	*p_data = (p_dtqcb->p_dtqinib->p_dtqmb + p_dtqcb->head)->data;
+	p_dtqcb->count--;
+	p_dtqcb->head++;
+	if (p_dtqcb->head >= p_dtqcb->p_dtqinib->dtqcnt) {
+		p_dtqcb->head = 0U;
+	}
+}
+
+#endif /* TOPPERS_dtqdeq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®ãã¼ã¿éä¿¡
+ */
+#ifdef TOPPERS_dtqsnd
+
+bool_t
+send_data(DTQCB *p_dtqcb, intptr_t data)
+{
+	TCB		*p_tcb;
+
+	if (!queue_empty(&(p_dtqcb->rwait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_dtqcb->rwait_queue));
+		((WINFO_RDTQ *)(p_tcb->p_winfo))->data = data;
+		wait_complete(p_tcb);
+		return(true);
+	}
+	else if (p_dtqcb->count < p_dtqcb->p_dtqinib->dtqcnt) {
+		enqueue_data(p_dtqcb, data);
+		return(true);
+	}
+	else {
+		return(false);
+	}
+}
+
+#endif /* TOPPERS_dtqsnd */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®ãã¼ã¿å¼·å¶éä¿¡
+ */
+#ifdef TOPPERS_dtqfsnd
+
+void
+force_send_data(DTQCB *p_dtqcb, intptr_t data)
+{
+	TCB		*p_tcb;
+
+	if (!queue_empty(&(p_dtqcb->rwait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_dtqcb->rwait_queue));
+		((WINFO_RDTQ *)(p_tcb->p_winfo))->data = data;
+		wait_complete(p_tcb);
+	}
+	else {
+		force_enqueue_data(p_dtqcb, data);
+	}
+}
+
+#endif /* TOPPERS_dtqfsnd */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ããã®ãã¼ã¿åä¿¡
+ */
+#ifdef TOPPERS_dtqrcv
+
+bool_t
+receive_data(DTQCB *p_dtqcb, intptr_t *p_data)
+{
+	TCB		*p_tcb;
+	intptr_t data;
+
+	if (p_dtqcb->count > 0U) {
+		dequeue_data(p_dtqcb, p_data);
+		if (!queue_empty(&(p_dtqcb->swait_queue))) {
+			p_tcb = (TCB *) queue_delete_next(&(p_dtqcb->swait_queue));
+			data = ((WINFO_SDTQ *)(p_tcb->p_winfo))->data;
+			enqueue_data(p_dtqcb, data);
+			wait_complete(p_tcb);
+		}
+		return(true);
+	}
+	else if (!queue_empty(&(p_dtqcb->swait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_dtqcb->swait_queue));
+		*p_data = ((WINFO_SDTQ *)(p_tcb->p_winfo))->data;
+		wait_complete(p_tcb);
+		return(true);
+	}
+	else {
+		return(false);
+	}
+}
+
+#endif /* TOPPERS_dtqrcv */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã®çæ
+ */
+#ifdef TOPPERS_acre_dtq
+
+ER_UINT
+acre_dtq(const T_CDTQ *pk_cdtq)
+{
+	DTQCB		*p_dtqcb;
+	DTQINIB		*p_dtqinib;
+	ATR			dtqatr;
+	DTQMB		*p_dtqmb;
+	ER			ercd;
+
+	LOG_ACRE_DTQ_ENTER(pk_cdtq);
+	CHECK_TSKCTX_UNL();
+	CHECK_RSATR(pk_cdtq->dtqatr, TA_TPRI);
+	dtqatr = pk_cdtq->dtqatr;
+	p_dtqmb = pk_cdtq->dtqmb;
+
+	lock_cpu();
+	if (tnum_dtq == 0 || queue_empty(&free_dtqcb)) {
+		ercd = E_NOID;
+	}
+	else {
+		if (pk_cdtq->dtqcnt != 0 && p_dtqmb == NULL) {
+			p_dtqmb = kernel_malloc(sizeof(DTQMB) * pk_cdtq->dtqcnt);
+			dtqatr |= TA_MBALLOC;
+		}
+		if (pk_cdtq->dtqcnt != 0 && p_dtqmb == NULL) {
+			ercd = E_NOMEM;
+		}
+		else {
+			p_dtqcb = ((DTQCB *) queue_delete_next(&free_dtqcb));
+			p_dtqinib = (DTQINIB *)(p_dtqcb->p_dtqinib);
+			p_dtqinib->dtqatr = dtqatr;
+			p_dtqinib->dtqcnt = pk_cdtq->dtqcnt;
+			p_dtqinib->p_dtqmb = p_dtqmb;
+
+			queue_initialize(&(p_dtqcb->swait_queue));
+			queue_initialize(&(p_dtqcb->rwait_queue));
+			p_dtqcb->count = 0U;
+			p_dtqcb->head = 0U;
+			p_dtqcb->tail = 0U;
+			ercd = DTQID(p_dtqcb);
+		}
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ACRE_DTQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_acre_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã®åé¤
+ */
+#ifdef TOPPERS_del_dtq
+
+ER
+del_dtq(ID dtqid)
+{
+	DTQCB	*p_dtqcb;
+	DTQINIB	*p_dtqinib;
+	ER		ercd;
+
+	LOG_DEL_DTQ_ENTER(dtqid);
+	CHECK_TSKCTX_UNL();
+	CHECK_PAR(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu();
+	if (p_dtqcb->p_dtqinib->dtqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (dtqid <= tmax_sdtqid) {
+		ercd = E_OBJ;
+	}
+	else {
+		init_wait_queue(&(p_dtqcb->swait_queue));
+		init_wait_queue(&(p_dtqcb->rwait_queue));
+		p_dtqinib = (DTQINIB *)(p_dtqcb->p_dtqinib);
+		if ((p_dtqinib->dtqatr & TA_MBALLOC) != 0U) {
+			kernel_free(p_dtqinib->p_dtqmb);
+		}
+		p_dtqinib->dtqatr = TA_NOEXS;
+		queue_insert_prev(&free_dtqcb, &(p_dtqcb->swait_queue));
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_DEL_DTQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_del_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡
+ */
+#ifdef TOPPERS_snd_dtq
+
+ER
+snd_dtq(ID dtqid, intptr_t data)
+{
+	DTQCB	*p_dtqcb;
+	WINFO_SDTQ winfo_sdtq;
+	ER		ercd;
+
+	LOG_SND_DTQ_ENTER(dtqid, data);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu_dsp();
+	if (p_dtqcb->p_dtqinib->dtqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (send_data(p_dtqcb, data)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		winfo_sdtq.data = data;
+		p_runtsk->tstat = TS_WAITING_SDTQ;
+		wobj_make_wait((WOBJCB *) p_dtqcb, (WINFO_WOBJ *) &winfo_sdtq);
+		dispatch();
+		ercd = winfo_sdtq.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_SND_DTQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_snd_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_psnd_dtq
+
+ER
+psnd_dtq(ID dtqid, intptr_t data)
+{
+	DTQCB	*p_dtqcb;
+	ER		ercd;
+
+	LOG_PSND_DTQ_ENTER(dtqid, data);
+	CHECK_UNL();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu();
+	if (p_dtqcb->p_dtqinib->dtqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (send_data(p_dtqcb, data)) {
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PSND_DTQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_psnd_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_tsnd_dtq
+
+ER
+tsnd_dtq(ID dtqid, intptr_t data, TMO tmout)
+{
+	DTQCB	*p_dtqcb;
+	WINFO_SDTQ winfo_sdtq;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TSND_DTQ_ENTER(dtqid, data, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_DTQID(dtqid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu_dsp();
+	if (p_dtqcb->p_dtqinib->dtqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (send_data(p_dtqcb, data)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		winfo_sdtq.data = data;
+		p_runtsk->tstat = TS_WAITING_SDTQ;
+		wobj_make_wait_tmout((WOBJCB *) p_dtqcb, (WINFO_WOBJ *) &winfo_sdtq,
+														&tmevtb, tmout);
+		dispatch();
+		ercd = winfo_sdtq.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TSND_DTQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_tsnd_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®å¼·å¶éä¿¡
+ */
+#ifdef TOPPERS_fsnd_dtq
+
+ER
+fsnd_dtq(ID dtqid, intptr_t data)
+{
+	DTQCB	*p_dtqcb;	
+	ER		ercd;
+
+	LOG_FSND_DTQ_ENTER(dtqid, data);
+	CHECK_UNL();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+	CHECK_ILUSE(p_dtqcb->p_dtqinib->dtqcnt > 0U);
+
+	lock_cpu();
+	if (p_dtqcb->p_dtqinib->dtqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		force_send_data(p_dtqcb, data);
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_FSND_DTQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_fsnd_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡
+ */
+#ifdef TOPPERS_rcv_dtq
+
+ER
+rcv_dtq(ID dtqid, intptr_t *p_data)
+{
+	DTQCB	*p_dtqcb;
+	WINFO_RDTQ winfo_rdtq;
+	ER		ercd;
+
+	LOG_RCV_DTQ_ENTER(dtqid, p_data);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu_dsp();
+	if (p_dtqcb->p_dtqinib->dtqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (receive_data(p_dtqcb, p_data)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_RDTQ;
+		make_wait(&(winfo_rdtq.winfo));
+		queue_insert_prev(&(p_dtqcb->rwait_queue), &(p_runtsk->task_queue));
+		winfo_rdtq.p_dtqcb = p_dtqcb;
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo_rdtq.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_data = winfo_rdtq.data;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_RCV_DTQ_LEAVE(ercd, p_data);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rcv_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_prcv_dtq
+
+ER
+prcv_dtq(ID dtqid, intptr_t *p_data)
+{
+	DTQCB	*p_dtqcb;
+	ER		ercd;
+
+	LOG_PRCV_DTQ_ENTER(dtqid, p_data);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu();
+	if (p_dtqcb->p_dtqinib->dtqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (receive_data(p_dtqcb, p_data)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PRCV_DTQ_LEAVE(ercd, p_data);
+	return(ercd);
+}
+
+#endif /* TOPPERS_prcv_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_trcv_dtq
+
+ER
+trcv_dtq(ID dtqid, intptr_t *p_data, TMO tmout)
+{
+	DTQCB	*p_dtqcb;
+	WINFO_RDTQ winfo_rdtq;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TRCV_DTQ_ENTER(dtqid, p_data, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_DTQID(dtqid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu_dsp();
+	if (p_dtqcb->p_dtqinib->dtqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (receive_data(p_dtqcb, p_data)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_RDTQ;
+		make_wait_tmout(&(winfo_rdtq.winfo), &tmevtb, tmout);
+		queue_insert_prev(&(p_dtqcb->rwait_queue), &(p_runtsk->task_queue));
+		winfo_rdtq.p_dtqcb = p_dtqcb;
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo_rdtq.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_data = winfo_rdtq.data;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TRCV_DTQ_LEAVE(ercd, p_data);
+	return(ercd);
+}
+
+#endif /* TOPPERS_trcv_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã®ååæå
+ */
+#ifdef TOPPERS_ini_dtq
+
+ER
+ini_dtq(ID dtqid)
+{
+	DTQCB	*p_dtqcb;
+	ER		ercd;
+    
+	LOG_INI_DTQ_ENTER(dtqid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu();
+	if (p_dtqcb->p_dtqinib->dtqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		init_wait_queue(&(p_dtqcb->swait_queue));
+		init_wait_queue(&(p_dtqcb->rwait_queue));
+		p_dtqcb->count = 0U;
+		p_dtqcb->head = 0U;
+		p_dtqcb->tail = 0U;
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_INI_DTQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ini_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_dtq
+
+ER
+ref_dtq(ID dtqid, T_RDTQ *pk_rdtq)
+{
+	DTQCB	*p_dtqcb;
+	ER		ercd;
+    
+	LOG_REF_DTQ_ENTER(dtqid, pk_rdtq);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu();
+	if (p_dtqcb->p_dtqinib->dtqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		pk_rdtq->stskid = wait_tskid(&(p_dtqcb->swait_queue));
+		pk_rdtq->rtskid = wait_tskid(&(p_dtqcb->rwait_queue));
+		pk_rdtq->sdtqcnt = p_dtqcb->count;
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_DTQ_LEAVE(ercd, pk_rdtq);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_dtq */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/dataqueue.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/dataqueue.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/dataqueue.h	(revision 302)
@@ -0,0 +1,205 @@
+/*
+ *  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: dataqueue.h 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *		ãã¼ã¿ã­ã¥ã¼æ©è½
+ */
+
+#ifndef TOPPERS_DATAQUEUE_H
+#define TOPPERS_DATAQUEUE_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "wait.h"
+
+/*
+ *  ãã¼ã¿ç®¡çãã­ãã¯
+ */
+typedef struct data_management_block {
+	intptr_t	data;			/* ãã¼ã¿æ¬ä½ */
+} DTQMB;
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WOBJINIBï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct dataqueue_initialization_block {
+	ATR			dtqatr;			/* ãã¼ã¿ã­ã¥ã¼å±æ§ */
+	uint_t		dtqcnt;			/* ãã¼ã¿ã­ã¥ã¼ã®å®¹é */
+	DTQMB		*p_dtqmb;		/* ãã¼ã¿ã­ã¥ã¼ç®¡çé åã®å
+é ­çªå° */
+} DTQINIB;
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼
+ *  ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼æåã®2ã¤ã®
+ *  ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct dataqueue_control_block {
+	QUEUE		swait_queue;	/* ãã¼ã¿ã­ã¥ã¼éä¿¡å¾
+ã¡ã­ã¥ã¼ */
+	const DTQINIB *p_dtqinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	QUEUE		rwait_queue;	/* ãã¼ã¿ã­ã¥ã¼åä¿¡å¾
+ã¡ã­ã¥ã¼ */
+	uint_t		count;			/* ãã¼ã¿ã­ã¥ã¼ä¸­ã®ãã¼ã¿ã®æ° */
+	uint_t		head;			/* æåã®ãã¼ã¿ã®æ ¼ç´å ´æ */
+	uint_t		tail;			/* æå¾ã®ãã¼ã¿ã®æ ¼ç´å ´æã®æ¬¡ */
+} DTQCB;
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼å¾
+ã¡æ
+å ±ãã­ãã¯ã®å®ç¾©
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WINFO_WOBJï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®2ã¤ã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct dataqueue_send_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	DTQCB		*p_dtqcb;		/* å¾
+ã£ã¦ãããã¼ã¿ã­ã¥ã¼ã®ç®¡çãã­ãã¯ */
+	intptr_t	data;			/* éä¿¡ãã¼ã¿ */
+} WINFO_SDTQ;
+
+typedef struct dataqueue_receive_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	DTQCB		*p_dtqcb;		/* å¾
+ã£ã¦ãããã¼ã¿ã­ã¥ã¼ã®ç®¡çãã­ãã¯ */
+	intptr_t	data;			/* åä¿¡ãã¼ã¿ */
+} WINFO_RDTQ;
+
+/*
+ *  ä½¿ç¨ãã¦ããªããã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+extern QUEUE	free_dtqcb;
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_dtqid;
+extern const ID	tmax_sdtqid;
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const DTQINIB	dtqinib_table[];
+extern DTQINIB			adtqinib_table[];
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern DTQCB	dtqcb_table[];
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ãããã¼ã¿ã­ã¥ã¼IDãåãåºãããã®ãã¯ã­
+ */
+#define	DTQID(p_dtqcb)	((ID)(((p_dtqcb) - dtqcb_table) + TMIN_DTQID))
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼æ©è½ã®åæå
+ */
+extern void	initialize_dataqueue(void);
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çé åã¸ã®ãã¼ã¿ã®æ ¼ç´
+ */
+extern void	enqueue_data(DTQCB *p_dtqcb, intptr_t data);
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çé åã¸ã®ãã¼ã¿ã®å¼·å¶æ ¼ç´
+ */
+extern void	force_enqueue_data(DTQCB *p_dtqcb, intptr_t data);
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çé åããã®ãã¼ã¿ã®ååºã
+ */
+extern void	dequeue_data(DTQCB *p_dtqcb, intptr_t *p_data);
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®ãã¼ã¿éä¿¡
+ */
+extern bool_t	send_data(DTQCB *p_dtqcb, intptr_t data);
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®ãã¼ã¿å¼·å¶éä¿¡
+ */
+extern void	force_send_data(DTQCB *p_dtqcb, intptr_t data);
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ããã®ãã¼ã¿åä¿¡
+ */
+extern bool_t	receive_data(DTQCB *p_dtqcb, intptr_t *p_data);
+
+#endif /* TOPPERS_DATAQUEUE_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/dataqueue.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/dataqueue.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/dataqueue.tf	(revision 302)
@@ -0,0 +1,189 @@
+$
+$   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 $
+$ 
+
+$
+$		ãã¼ã¿ã­ã¥ã¼æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  AID_DTQã®å¦ç
+$
+$num_adtqid = 0$
+$FOREACH i ADTQ.ORDER_LIST$
+$	// nodtqãè² ã®å ´åï¼E_PARï¼
+	$IF ADTQ.NODTQ[i] < 0$
+		$ERROR ADTQ.TEXT_LINE[i]$E_PAR:$SPC$
+			$FORMAT(_("illegal %1% `%2%\' in %3%"),
+									"nodtq", ADTQ.NODTQ[i], "AID_DTQ")$
+		$END$
+	$END$
+	$num_adtqid = num_adtqid + ADTQ.NODTQ[i]$
+$END$
+$num_dtqid = LENGTH(DTQ.ID_LIST) + num_adtqid$
+
+$
+$  kernel_cfg.hã®çæ
+$
+$FILE "kernel_cfg.h.new"$
+
+#define TNUM_DTQID	$num_dtqid$$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$
+
+$
+$  éçã«çæããããã¼ã¿ã­ã¥ã¼ã®æ°
+$
+#define TNUM_SDTQID	$LENGTH(DTQ.ID_LIST)$$NL$
+$NL$
+
+$
+$  ãã¼ã¿ã­ã¥ã¼IDçªå·ã®æå¤§å¤
+$
+const ID _kernel_tmax_dtqid = (TMIN_DTQID + TNUM_DTQID - 1);$NL$
+const ID _kernel_tmax_sdtqid = (TMIN_DTQID + TNUM_SDTQID - 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_SDTQID] = {$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 num_adtqid > 0$
+	DTQINIB _kernel_adtqinib_table[$num_adtqid$];$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(DTQINIB, _kernel_adtqinib_table);$NL$
+$END$$NL$
+
+$
+$  ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ã¨ãã¼ã¿ã­ã¥ã¼æ©è½åæåé¢æ°
+$
+$IF num_dtqid > 0$
+	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/extension/dcre/kernel/eventflag.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/eventflag.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/eventflag.c	(revision 302)
@@ -0,0 +1,611 @@
+/*
+ *  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: eventflag.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		ã¤ãã³ããã©ã°æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "eventflag.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ACRE_FLG_ENTER
+#define LOG_ACRE_FLG_ENTER(pk_cflg)
+#endif /* LOG_ACRE_FLG_ENTER */
+
+#ifndef LOG_ACRE_FLG_LEAVE
+#define LOG_ACRE_FLG_LEAVE(ercd)
+#endif /* LOG_ACRE_FLG_LEAVE */
+
+#ifndef LOG_DEL_FLG_ENTER
+#define LOG_DEL_FLG_ENTER(flgid)
+#endif /* LOG_DEL_FLG_ENTER */
+
+#ifndef LOG_DEL_FLG_LEAVE
+#define LOG_DEL_FLG_LEAVE(ercd)
+#endif /* LOG_DEL_FLG_LEAVE */
+
+#ifndef LOG_SET_FLG_ENTER
+#define LOG_SET_FLG_ENTER(flgid, setptn)
+#endif /* LOG_SET_FLG_ENTER */
+
+#ifndef LOG_SET_FLG_LEAVE
+#define LOG_SET_FLG_LEAVE(ercd)
+#endif /* LOG_SET_FLG_LEAVE */
+
+#ifndef LOG_CLR_FLG_ENTER
+#define LOG_CLR_FLG_ENTER(flgid, clrptn)
+#endif /* LOG_CLR_FLG_ENTER */
+
+#ifndef LOG_CLR_FLG_LEAVE
+#define LOG_CLR_FLG_LEAVE(ercd)
+#endif /* LOG_CLR_FLG_LEAVE */
+
+#ifndef LOG_WAI_FLG_ENTER
+#define LOG_WAI_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn)
+#endif /* LOG_WAI_FLG_ENTER */
+
+#ifndef LOG_WAI_FLG_LEAVE
+#define LOG_WAI_FLG_LEAVE(ercd, p_flgptn)
+#endif /* LOG_WAI_FLG_LEAVE */
+
+#ifndef LOG_POL_FLG_ENTER
+#define LOG_POL_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn)
+#endif /* LOG_POL_FLG_ENTER */
+
+#ifndef LOG_POL_FLG_LEAVE
+#define LOG_POL_FLG_LEAVE(ercd, p_flgptn)
+#endif /* LOG_POL_FLG_LEAVE */
+
+#ifndef LOG_TWAI_FLG_ENTER
+#define LOG_TWAI_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn, tmout)
+#endif /* LOG_TWAI_FLG_ENTER */
+
+#ifndef LOG_TWAI_FLG_LEAVE
+#define LOG_TWAI_FLG_LEAVE(ercd, p_flgptn)
+#endif /* LOG_TWAI_FLG_LEAVE */
+
+#ifndef LOG_INI_FLG_ENTER
+#define LOG_INI_FLG_ENTER(flgid)
+#endif /* LOG_INI_FLG_ENTER */
+
+#ifndef LOG_INI_FLG_LEAVE
+#define LOG_INI_FLG_LEAVE(ercd)
+#endif /* LOG_INI_FLG_LEAVE */
+
+#ifndef LOG_REF_FLG_ENTER
+#define LOG_REF_FLG_ENTER(flgid, pk_rflg)
+#endif /* LOG_REF_FLG_ENTER */
+
+#ifndef LOG_REF_FLG_LEAVE
+#define LOG_REF_FLG_LEAVE(ercd, pk_rflg)
+#endif /* LOG_REF_FLG_LEAVE */
+
+/*
+ *  ã¤ãã³ããã©ã°ã®æ°
+ */
+#define tnum_flg	((uint_t)(tmax_flgid - TMIN_FLGID + 1))
+#define tnum_sflg	((uint_t)(tmax_sflgid - TMIN_FLGID + 1))
+
+/*
+ *  ã¤ãã³ããã©ã°IDããã¤ãã³ããã©ã°ç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_FLG(flgid)	((uint_t)((flgid) - TMIN_FLGID))
+#define get_flgcb(flgid)	(&(flgcb_table[INDEX_FLG(flgid)]))
+
+#ifdef TOPPERS_flgini
+
+/*
+ *  ä½¿ç¨ãã¦ããªãã¤ãã³ããã©ã°ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+QUEUE	free_flgcb;
+
+/*
+ *  ã¤ãã³ããã©ã°æ©è½ã®åæå
+ */
+void
+initialize_eventflag(void)
+{
+	uint_t	i, j;
+	FLGCB	*p_flgcb;
+	FLGINIB	*p_flginib;
+
+	for (i = 0; i < tnum_sflg; i++) {
+		p_flgcb = &(flgcb_table[i]);
+		queue_initialize(&(p_flgcb->wait_queue));
+		p_flgcb->p_flginib = &(flginib_table[i]);
+		p_flgcb->flgptn = p_flgcb->p_flginib->iflgptn;
+	}
+	queue_initialize(&free_flgcb);
+	for (j = 0; i < tnum_flg; i++, j++) {
+		p_flgcb = &(flgcb_table[i]);
+		p_flginib = &(aflginib_table[j]);
+		p_flginib->flgatr = TA_NOEXS;
+		p_flgcb->p_flginib = ((const FLGINIB *) p_flginib);
+		queue_insert_prev(&free_flgcb, &(p_flgcb->wait_queue));
+	}
+}
+
+#endif /* TOPPERS_flgini */
+
+/*
+ *  ã¤ãã³ããã©ã°å¾
+ã¡è§£é¤æ¡ä»¶ã®ãã§ãã¯
+ */
+#ifdef TOPPERS_flgcnd
+
+bool_t
+check_flg_cond(FLGCB *p_flgcb, FLGPTN waiptn, MODE wfmode, FLGPTN *p_flgptn)
+{
+	if ((wfmode & TWF_ORW) != 0U ? (p_flgcb->flgptn & waiptn) != 0U
+									: (p_flgcb->flgptn & waiptn) == waiptn) {
+		*p_flgptn = p_flgcb->flgptn;
+		if ((p_flgcb->p_flginib->flgatr & TA_CLR) != 0U) {
+			p_flgcb->flgptn = 0U;
+		}
+		return(true);
+	}
+	return(false);
+}
+
+#endif /* TOPPERS_flgcnd */
+
+/*
+ *  ã¤ãã³ããã©ã°ã®çæ
+ */
+#ifdef TOPPERS_acre_flg
+
+ER_UINT
+acre_flg(const T_CFLG *pk_cflg)
+{
+	FLGCB	*p_flgcb;
+	FLGINIB	*p_flginib;
+	ER		ercd;
+
+	LOG_ACRE_FLG_ENTER(pk_cflg);
+	CHECK_TSKCTX_UNL();
+	CHECK_RSATR(pk_cflg->flgatr, TA_TPRI|TA_WMUL|TA_CLR);
+
+	lock_cpu();
+	if (tnum_flg == 0 || queue_empty(&free_flgcb)) {
+		ercd = E_NOID;
+	}
+	else {
+		p_flgcb = ((FLGCB *) queue_delete_next(&free_flgcb));
+		p_flginib = (FLGINIB *)(p_flgcb->p_flginib);
+		p_flginib->flgatr = pk_cflg->flgatr;
+		p_flginib->iflgptn = pk_cflg->iflgptn;
+
+		queue_initialize(&(p_flgcb->wait_queue));
+		p_flgcb->flgptn = p_flgcb->p_flginib->iflgptn;
+		ercd = FLGID(p_flgcb);
+	}
+
+  error_exit:
+	LOG_ACRE_FLG_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_acre_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°ã®åé¤
+ */
+#ifdef TOPPERS_del_flg
+
+ER
+del_flg(ID flgid)
+{
+	FLGCB	*p_flgcb;
+	FLGINIB	*p_flginib;
+	ER		ercd;
+
+	LOG_DEL_FLG_ENTER(flgid);
+	CHECK_TSKCTX_UNL();
+	CHECK_PAR(VALID_FLGID(flgid));
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu();
+	if (p_flgcb->p_flginib->flgatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (flgid <= tmax_sflgid) {
+		ercd = E_OBJ;
+	}
+	else {
+		init_wait_queue(&(p_flgcb->wait_queue));
+		p_flginib = (FLGINIB *)(p_flgcb->p_flginib);
+ 		p_flginib->flgatr = TA_NOEXS;
+		queue_insert_prev(&free_flgcb, &(p_flgcb->wait_queue));
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_DEL_FLG_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_del_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°ã®ã»ãã
+ */
+#ifdef TOPPERS_set_flg
+
+ER
+set_flg(ID flgid, FLGPTN setptn)
+{
+	FLGCB	*p_flgcb;
+	QUEUE	*p_queue;
+	TCB		*p_tcb;
+	WINFO_FLG *p_winfo_flg;
+	ER		ercd;
+
+	LOG_SET_FLG_ENTER(flgid, setptn);
+	CHECK_UNL();
+	CHECK_ID(VALID_FLGID(flgid));
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu();
+	if (p_flgcb->p_flginib->flgatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		p_flgcb->flgptn |= setptn;
+		p_queue = p_flgcb->wait_queue.p_next;
+		while (p_queue != &(p_flgcb->wait_queue)) {
+			p_tcb = (TCB *) p_queue;
+			p_queue = p_queue->p_next;
+			p_winfo_flg = (WINFO_FLG *)(p_tcb->p_winfo);
+			if (check_flg_cond(p_flgcb, p_winfo_flg->waiptn,
+							p_winfo_flg->wfmode, &(p_winfo_flg->waiptn))) {
+				queue_delete(&(p_tcb->task_queue));
+				wait_complete(p_tcb);
+				if ((p_flgcb->p_flginib->flgatr & TA_CLR) != 0U) {
+					break;
+				}
+			}
+		}
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_SET_FLG_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_set_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°ã®ã¯ãªã¢
+ */
+#ifdef TOPPERS_clr_flg
+
+ER
+clr_flg(ID flgid, FLGPTN clrptn)
+{
+	FLGCB	*p_flgcb;
+	ER		ercd;
+
+	LOG_CLR_FLG_ENTER(flgid, clrptn);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_FLGID(flgid));
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu();
+	if (p_flgcb->p_flginib->flgatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		p_flgcb->flgptn &= clrptn; 
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_CLR_FLG_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_clr_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°å¾
+ã¡
+ */
+#ifdef TOPPERS_wai_flg
+
+ER
+wai_flg(ID flgid, FLGPTN waiptn, MODE wfmode, FLGPTN *p_flgptn)
+{
+	FLGCB	*p_flgcb;
+	WINFO_FLG winfo_flg;
+	ER		ercd;
+
+	LOG_WAI_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_FLGID(flgid));
+	CHECK_PAR(waiptn != 0U);
+	CHECK_PAR(wfmode == TWF_ORW || wfmode == TWF_ANDW);
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu_dsp();
+	if (p_flgcb->p_flginib->flgatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if ((p_flgcb->p_flginib->flgatr & TA_WMUL) == 0U
+					&& !queue_empty(&(p_flgcb->wait_queue))) {
+		ercd = E_ILUSE;
+	}
+	else if (check_flg_cond(p_flgcb, waiptn, wfmode, p_flgptn)) {
+		ercd = E_OK;
+	}
+	else {
+		winfo_flg.waiptn = waiptn;
+		winfo_flg.wfmode = wfmode;
+		p_runtsk->tstat = TS_WAITING_FLG;
+		wobj_make_wait((WOBJCB *) p_flgcb, (WINFO_WOBJ *) &winfo_flg);
+		dispatch();
+		ercd = winfo_flg.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_flgptn = winfo_flg.waiptn;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_WAI_FLG_LEAVE(ercd, p_flgptn);
+	return(ercd);
+}
+
+#endif /* TOPPERS_wai_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°å¾
+ã¡ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_pol_flg
+
+ER
+pol_flg(ID flgid, FLGPTN waiptn, MODE wfmode, FLGPTN *p_flgptn)
+{
+	FLGCB	*p_flgcb;
+	ER		ercd;
+
+	LOG_POL_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_FLGID(flgid));
+	CHECK_PAR(waiptn != 0U);
+	CHECK_PAR(wfmode == TWF_ORW || wfmode == TWF_ANDW);
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu();
+	if (p_flgcb->p_flginib->flgatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if ((p_flgcb->p_flginib->flgatr & TA_WMUL) == 0U
+					&& !queue_empty(&(p_flgcb->wait_queue))) {
+		ercd = E_ILUSE;
+	}
+	else if (check_flg_cond(p_flgcb, waiptn, wfmode, p_flgptn)) {
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_POL_FLG_LEAVE(ercd, p_flgptn);
+	return(ercd);
+}
+
+#endif /* TOPPERS_pol_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°å¾
+ã¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_twai_flg
+
+ER
+twai_flg(ID flgid, FLGPTN waiptn, MODE wfmode, FLGPTN *p_flgptn, TMO tmout)
+{
+	FLGCB	*p_flgcb;
+	WINFO_FLG winfo_flg;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TWAI_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_FLGID(flgid));
+	CHECK_PAR(waiptn != 0U);
+	CHECK_PAR(wfmode == TWF_ORW || wfmode == TWF_ANDW);
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu_dsp();
+	if (p_flgcb->p_flginib->flgatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if ((p_flgcb->p_flginib->flgatr & TA_WMUL) == 0U
+					&& !queue_empty(&(p_flgcb->wait_queue))) {
+		ercd = E_ILUSE;
+	}
+	else if (check_flg_cond(p_flgcb, waiptn, wfmode, p_flgptn)) {
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		winfo_flg.waiptn = waiptn;
+		winfo_flg.wfmode = wfmode;
+		p_runtsk->tstat = TS_WAITING_FLG;
+		wobj_make_wait_tmout((WOBJCB *) p_flgcb, (WINFO_WOBJ *) &winfo_flg,
+														&tmevtb, tmout);
+		dispatch();
+		ercd = winfo_flg.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_flgptn = winfo_flg.waiptn;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TWAI_FLG_LEAVE(ercd, p_flgptn);
+	return(ercd);
+}
+
+#endif /* TOPPERS_twai_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°ã®ååæå
+ */
+#ifdef TOPPERS_ini_flg
+
+ER
+ini_flg(ID flgid)
+{
+	FLGCB	*p_flgcb;
+	ER		ercd;
+    
+	LOG_INI_FLG_ENTER(flgid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_FLGID(flgid));
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu();
+	if (p_flgcb->p_flginib->flgatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		init_wait_queue(&(p_flgcb->wait_queue));
+		p_flgcb->flgptn = p_flgcb->p_flginib->iflgptn;
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_INI_FLG_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ini_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_flg
+
+ER
+ref_flg(ID flgid, T_RFLG *pk_rflg)
+{
+	FLGCB	*p_flgcb;
+	ER		ercd;
+    
+	LOG_REF_FLG_ENTER(flgid, pk_rflg);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_FLGID(flgid));
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu();
+	if (p_flgcb->p_flginib->flgatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		pk_rflg->wtskid = wait_tskid(&(p_flgcb->wait_queue));
+		pk_rflg->flgptn = p_flgcb->flgptn;
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_FLG_LEAVE(ercd, pk_rflg);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_flg */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/eventflag.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/eventflag.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/eventflag.h	(revision 302)
@@ -0,0 +1,174 @@
+/*
+ *  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: eventflag.h 200 2014-09-05 19:18:00Z ertl-hiro $
+ */
+
+/*
+ *		ã¤ãã³ããã©ã°æ©è½
+ */
+
+#ifndef TOPPERS_EVENTFLAG_H
+#define TOPPERS_EVENTFLAG_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "wait.h"
+
+/*
+ *  ã¤ãã³ããã©ã°åæåãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WOBJINIBï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct eventflag_initialization_block {
+	ATR			flgatr;			/* ã¤ãã³ããã©ã°å±æ§ */
+	FLGPTN		iflgptn;		/* ã¤ãã³ããã©ã°ã®ããããã¿ã¼ã³ã®åæå¤ */
+} FLGINIB;
+
+/*
+ *  ã¤ãã³ããã©ã°ç®¡çãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼
+ *  ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼æåã®2ã¤ã®
+ *  ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct eventflag_control_block {
+	QUEUE		wait_queue;		/* ã¤ãã³ããã©ã°å¾
+ã¡ã­ã¥ã¼ */
+	const FLGINIB *p_flginib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	FLGPTN		flgptn;			/* ã¤ãã³ããã©ã°ç¾å¨ãã¿ã¼ã³ */
+} FLGCB;
+
+/*
+ *  ã¤ãã³ããã©ã°å¾
+ã¡æ
+å ±ãã­ãã¯ã®å®ç¾©
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WINFO_WOBJï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®2ã¤ã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ *
+ *  waiptnã«ã¯ï¼å¾
+ã¡ç¶æ
+ã®éã¯å¾
+ã¡ãã¿ã¼ã³ãï¼å¾
+ã¡è§£é¤ãããå¾ã¯å¾
+ã¡è§£
+ *  é¤æã®ãã¿ã¼ã³ãå
+¥ããï¼1ã¤ã®ãã£ã¼ã«ãã2ã¤ã®ç®çã«å
+¼ç¨ãã¦ããï¼ï¼
+ */
+typedef struct eventflag_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	FLGCB		*p_flgcb;		/* å¾
+ã£ã¦ããã¤ãã³ããã©ã°ã®ç®¡çãã­ãã¯ */
+	FLGPTN		waiptn;			/* å¾
+ã¡ãã¿ã¼ã³ï¼å¾
+ã¡è§£é¤æã®ãã¿ã¼ã³ */
+	MODE		wfmode;			/* å¾
+ã¡ã¢ã¼ã */
+} WINFO_FLG;
+
+/*
+ *  ä½¿ç¨ãã¦ããªãã¤ãã³ããã©ã°ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+extern QUEUE	free_flgcb;
+
+/*
+ *  ã¤ãã³ããã©ã°IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_flgid;
+extern const ID	tmax_sflgid;
+
+/*
+ *  ã¤ãã³ããã©ã°åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const FLGINIB	flginib_table[];
+extern FLGINIB			aflginib_table[];
+
+/*
+ *  ã¤ãã³ããã©ã°ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern FLGCB	flgcb_table[];
+
+/*
+ *  ã¤ãã³ããã©ã°ç®¡çãã­ãã¯ããã¤ãã³ããã©ã°IDãåãåºãããã®ãã¯ã­
+ */
+#define	FLGID(p_flgcb)	((ID)(((p_flgcb) - flgcb_table) + TMIN_FLGID))
+
+/*
+ *  ã¤ãã³ããã©ã°æ©è½ã®åæå
+ */
+extern void	initialize_eventflag(void);
+
+/*
+ *  ã¤ãã³ããã©ã°å¾
+ã¡è§£é¤æ¡ä»¶ã®ãã§ãã¯
+ */
+extern bool_t	check_flg_cond(FLGCB *p_flgcb, FLGPTN waiptn,
+								MODE wfmode, FLGPTN *p_flgptn);
+
+#endif /* TOPPERS_EVENTFLAG_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/eventflag.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/eventflag.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/eventflag.tf	(revision 302)
@@ -0,0 +1,171 @@
+$
+$   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 $
+$ 
+
+$
+$		ã¤ãã³ããã©ã°æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  AID_FLGã®å¦ç
+$
+$num_aflgid = 0$
+$FOREACH i AFLG.ORDER_LIST$
+$	// noflgãè² ã®å ´åï¼E_PARï¼
+	$IF AFLG.NOFLG[i] < 0$
+		$ERROR AFLG.TEXT_LINE[i]$E_PAR:$SPC$
+			$FORMAT(_("illegal %1% `%2%\' in %3%"),
+									"noflg", AFLG.NOFLG[i], "AID_FLG")$
+		$END$
+	$END$
+	$num_aflgid = num_aflgid + AFLG.NOFLG[i]$
+$END$
+$num_flgid = LENGTH(FLG.ID_LIST) + num_aflgid$
+
+$
+$  kernel_cfg.hã®çæ
+$
+$FILE "kernel_cfg.h.new"$
+
+#define TNUM_FLGID	$num_flgid$$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$
+
+$
+$  éçã«çæãããã¤ãã³ããã©ã°ã®æ°
+$
+#define TNUM_SFLGID	$LENGTH(FLG.ID_LIST)$$NL$
+$NL$
+
+$
+$  ã¤ãã³ããã©ã°IDçªå·ã®æå¤§å¤
+$
+const ID _kernel_tmax_flgid = (TMIN_FLGID + TNUM_FLGID - 1);$NL$
+const ID _kernel_tmax_sflgid = (TMIN_FLGID + TNUM_SFLGID - 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_SFLGID] = {$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 num_aflgid > 0$
+	FLGINIB _kernel_aflginib_table[$num_aflgid$];$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(FLGINIB, _kernel_aflginib_table);$NL$
+$END$$NL$
+
+$
+$  ã¤ãã³ããã©ã°ç®¡çãã­ãã¯ã¨ã¤ãã³ããã©ã°æ©è½åæåé¢æ°
+$
+$IF num_flgid > 0$
+	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/extension/dcre/kernel/interrupt.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/interrupt.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/interrupt.c	(revision 302)
@@ -0,0 +1,513 @@
+/*
+ *  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: interrupt.c 275 2014-11-03 14:26:05Z ertl-hiro $
+ */
+
+/*
+ *		å²è¾¼ã¿ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "interrupt.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#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 */
+
+#ifndef LOG_ACRE_ISR_ENTER
+#define LOG_ACRE_ISR_ENTER(pk_cisr)
+#endif /* LOG_ACRE_ISR_ENTER */
+
+#ifndef LOG_ACRE_ISR_LEAVE
+#define LOG_ACRE_ISR_LEAVE(ercd)
+#endif /* LOG_ACRE_ISR_LEAVE */
+
+#ifndef LOG_DEL_ISR_ENTER
+#define LOG_DEL_ISR_ENTER(isrid)
+#endif /* LOG_DEL_ISR_ENTER */
+
+#ifndef LOG_DEL_ISR_LEAVE
+#define LOG_DEL_ISR_LEAVE(ercd)
+#endif /* LOG_DEL_ISR_LEAVE */
+
+#ifndef LOG_DIS_INT_ENTER
+#define LOG_DIS_INT_ENTER(intno)
+#endif /* LOG_DIS_INT_ENTER */
+
+#ifndef LOG_DIS_INT_LEAVE
+#define LOG_DIS_INT_LEAVE(ercd)
+#endif /* LOG_DIS_INT_LEAVE */
+
+#ifndef LOG_ENA_INT_ENTER
+#define LOG_ENA_INT_ENTER(intno)
+#endif /* LOG_ENA_INT_ENTER */
+
+#ifndef LOG_ENA_INT_LEAVE
+#define LOG_ENA_INT_LEAVE(ercd)
+#endif /* LOG_ENA_INT_LEAVE */
+
+#ifndef LOG_CHG_IPM_ENTER
+#define LOG_CHG_IPM_ENTER(intpri)
+#endif /* LOG_CHG_IPM_ENTER */
+
+#ifndef LOG_CHG_IPM_LEAVE
+#define LOG_CHG_IPM_LEAVE(ercd)
+#endif /* LOG_CHG_IPM_LEAVE */
+
+#ifndef LOG_GET_IPM_ENTER
+#define LOG_GET_IPM_ENTER(p_intpri)
+#endif /* LOG_GET_IPM_ENTER */
+
+#ifndef LOG_GET_IPM_LEAVE
+#define LOG_GET_IPM_LEAVE(ercd, p_intpri)
+#endif /* LOG_GET_IPM_LEAVE */
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®æ°
+ */
+#define tnum_isr	((uint_t)(tmax_isrid - TMIN_ISRID + 1))
+#define tnum_sisr	((uint_t)(tmax_sisrid - TMIN_ISRID + 1))
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³IDããå²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ç®¡çãã­ãã¯ãå
+ *  ãåºãããã®ãã¯ã­
+ */
+#define INDEX_ISR(isrid)	((uint_t)((isrid) - TMIN_ISRID))
+#define get_isrcb(isrid)	(&(isrcb_table[INDEX_ISR(isrid)]))
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã­ã¥ã¼ã¸ã®ç»é²
+ */
+Inline void
+enqueue_isr(QUEUE *p_isr_queue, ISRCB *p_isrcb)
+{
+	QUEUE	*p_entry;
+	PRI		isrpri = p_isrcb->p_isrinib->isrpri;
+
+	for (p_entry = p_isr_queue->p_next; p_entry != p_isr_queue;
+											p_entry = p_entry->p_next) {
+		if (isrpri < ((ISRCB *) p_entry)->p_isrinib->isrpri) {
+			break;
+		}
+	}
+	queue_insert_prev(p_entry, &(p_isrcb->isr_queue));
+}
+
+#ifdef TOPPERS_isrini
+
+/*
+ *  ä½¿ç¨ãã¦ããªãå²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+QUEUE	free_isrcb;
+
+/* 
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³æ©è½ã®åæå
+ */
+void
+initialize_isr(void)
+{
+	uint_t	i, j;
+	ISRCB	*p_isrcb;
+	ISRINIB	*p_isrinib;
+
+	for (i = 0; i < tnum_isr_queue; i++) {
+		queue_initialize(&(isr_queue_table[i]));
+	}
+	for (i = 0; i < tnum_sisr; i++) {
+		p_isrcb = &(isrcb_table[i]);
+		p_isrcb->p_isrinib = &(isrinib_table[i]);
+		enqueue_isr(p_isrcb->p_isrinib->p_isr_queue, p_isrcb);
+	}
+	queue_initialize(&free_isrcb);
+	for (j = 0; i < tnum_isr; i++, j++) {
+		p_isrcb = &(isrcb_table[i]);
+		p_isrinib = &(aisrinib_table[j]);
+		p_isrinib->isratr = TA_NOEXS;
+		p_isrcb->p_isrinib = ((const ISRINIB *) p_isrinib);
+		queue_insert_prev(&free_isrcb, &(p_isrcb->isr_queue));
+	}
+}
+
+#endif /* TOPPERS_isrini */
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®å¼åºã
+ */
+#ifdef TOPPERS_isrcal
+
+void
+call_isr(QUEUE *p_isr_queue)
+{
+	QUEUE	*p_queue;
+	ISRCB	*p_isrcb;
+
+	for (p_queue = p_isr_queue->p_next; p_queue != p_isr_queue;
+											p_queue = p_queue->p_next) {
+		p_isrcb = (ISRCB *) p_queue;
+		LOG_ISR_ENTER(ISRID(p_isrcb));
+		(*(p_isrcb->p_isrinib->isr))(p_isrcb->p_isrinib->exinf);
+		LOG_ISR_LEAVE(ISRID(p_isrcb));
+
+		if (p_queue->p_next != p_isr_queue) {
+			/* ISRã®å¼åºãåã®ç¶æ
+ã«æ»ã */
+			if (sense_lock()) {
+				unlock_cpu();
+			}
+		}
+	}
+}
+
+#endif /* TOPPERS_isrcal */
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³å¼åºãã­ã¥ã¼ã®æ¤ç´¢
+ */
+Inline QUEUE *
+search_isr_queue(INTNO intno)
+{
+	int_t	left, right, i;
+
+	if (tnum_isr_queue == 0) {
+		return(NULL);
+	}
+
+	left = 0;
+	right = tnum_isr_queue - 1;
+	while (left < right) {
+		i = (left + right + 1) / 2;
+		if (intno < isr_queue_list[i].intno) {
+			right = i - 1;
+		}
+		else {
+			left = i;
+		}
+	}
+	if (isr_queue_list[left].intno == intno) {
+		return(isr_queue_list[left].p_isr_queue);
+	}
+	else {
+		return(NULL);
+	}
+}
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®çæ
+ */
+#ifdef TOPPERS_acre_isr
+
+ER_UINT
+acre_isr(const T_CISR *pk_cisr)
+{
+	ISRCB	*p_isrcb;
+	ISRINIB	*p_isrinib;
+	QUEUE	*p_isr_queue;
+	ER		ercd;
+
+	LOG_ACRE_ISR_ENTER(pk_cisr);
+	CHECK_TSKCTX_UNL();
+	CHECK_RSATR(pk_cisr->isratr, TARGET_ISRATR);
+	CHECK_PAR(VALID_INTNO_CREISR(pk_cisr->intno));
+	CHECK_PAR(FUNC_ALIGN(pk_cisr->isr));
+	CHECK_PAR(FUNC_NONNULL(pk_cisr->isr));
+	CHECK_PAR(VALID_ISRPRI(pk_cisr->isrpri));
+
+	p_isr_queue = search_isr_queue(pk_cisr->intno);
+	CHECK_OBJ(p_isr_queue != NULL);
+
+	lock_cpu();
+	if (tnum_isr == 0 || queue_empty(&free_isrcb)) {
+		ercd = E_NOID;
+	}
+	else {
+		p_isrcb = ((ISRCB *) queue_delete_next(&free_isrcb));
+		p_isrinib = (ISRINIB *)(p_isrcb->p_isrinib);
+		p_isrinib->isratr = pk_cisr->isratr;
+		p_isrinib->exinf = pk_cisr->exinf;
+		p_isrinib->p_isr_queue = p_isr_queue;
+		p_isrinib->isr = pk_cisr->isr;
+		p_isrinib->isrpri = pk_cisr->isrpri;
+		enqueue_isr(p_isr_queue, p_isrcb);
+		ercd = ISRID(p_isrcb);
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ACRE_ISR_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_acre_isr */
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®åé¤
+ */
+#ifdef TOPPERS_del_isr
+
+ER
+del_isr(ID isrid)
+{
+	ISRCB	*p_isrcb;
+	ISRINIB	*p_isrinib;
+	ER		ercd;
+
+	LOG_DEL_ISR_ENTER(isrid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_ISRID(isrid));
+	p_isrcb = get_isrcb(isrid);
+
+	lock_cpu();
+	if (p_isrcb->p_isrinib->isratr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (isrid <= tmax_sisrid) {
+		ercd = E_OBJ;
+	}
+	else {
+		queue_delete(&(p_isrcb->isr_queue));
+		p_isrinib = (ISRINIB *)(p_isrcb->p_isrinib);
+		p_isrinib->isratr = TA_NOEXS;
+		queue_insert_prev(&free_isrcb, &(p_isrcb->isr_queue));
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_DEL_ISR_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_del_isr */
+
+/* 
+ *  å²è¾¼ã¿ç®¡çæ©è½ã®åæå
+ */
+#ifdef TOPPERS_intini
+#ifndef OMIT_INITIALIZE_INTERRUPT
+
+void
+initialize_interrupt(void)
+{
+	uint_t			i;
+	const INHINIB	*p_inhinib;
+	const INTINIB	*p_intinib;
+
+	for (i = 0; i < tnum_def_inhno; i++) {
+		p_inhinib = &(inhinib_table[i]);
+		define_inh(p_inhinib->inhno, p_inhinib->int_entry);
+	}
+	for (i = 0; i < tnum_cfg_intno; i++) {
+		p_intinib = &(intinib_table[i]);
+		config_int(p_intinib->intno, p_intinib->intatr, p_intinib->intpri);
+	}
+}
+
+#endif /* OMIT_INITIALIZE_INTERRUPT */
+#endif /* TOPPERS_intini */
+
+/*
+ *  å²è¾¼ã¿ã®ç¦æ­¢ï¼»NGKI3555ï¼½
+ */
+#ifdef TOPPERS_dis_int
+#ifdef TOPPERS_SUPPORT_DIS_INT					/*ï¼»NGKI3093ï¼½*/
+
+ER
+dis_int(INTNO intno)
+{
+	bool_t	locked;
+	ER		ercd;
+
+	LOG_DIS_INT_ENTER(intno);
+	CHECK_PAR(VALID_INTNO_DISINT(intno));		/*ï¼»NGKI3083ï¼½ï¼»NGKI3087ï¼½*/
+
+	locked = sense_lock();
+	if (!locked) {
+		lock_cpu();
+	}
+	if (disable_int(intno)) {					/*ï¼»NGKI3086ï¼½*/
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_OBJ;							/*ï¼»NGKI3085ï¼½*/
+	}
+	if (!locked) {
+		unlock_cpu();
+	}
+
+  error_exit:
+	LOG_DIS_INT_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_SUPPORT_DIS_INT */
+#endif /* TOPPERS_dis_int */
+
+/*
+ *  å²è¾¼ã¿ã®è¨±å¯ï¼»NGKI3556ï¼½
+ */
+#ifdef TOPPERS_ena_int
+#ifdef TOPPERS_SUPPORT_ENA_INT					/*ï¼»NGKI3106ï¼½*/
+
+ER
+ena_int(INTNO intno)
+{
+	bool_t	locked;
+	ER		ercd;
+
+	LOG_ENA_INT_ENTER(intno);
+	CHECK_PAR(VALID_INTNO_DISINT(intno));		/*ï¼»NGKI3096ï¼½ï¼»NGKI3100ï¼½*/
+
+	locked = sense_lock();
+	if (!locked) {
+		lock_cpu();
+	}
+	if (enable_int(intno)) {					/*ï¼»NGKI3099ï¼½*/
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_OBJ;							/*ï¼»NGKI3098ï¼½*/
+	}
+	if (!locked) {
+		unlock_cpu();
+	}
+
+  error_exit:
+	LOG_ENA_INT_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_SUPPORT_ENA_INT */
+#endif /* TOPPERS_ena_int */
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®å¤æ´ï¼»NGKI3107ï¼½
+ */
+#ifdef TOPPERS_chg_ipm
+
+ER
+chg_ipm(PRI intpri)
+{
+	ER		ercd;
+
+	LOG_CHG_IPM_ENTER(intpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3108ï¼½ï¼»NGKI3109ï¼½*/
+	CHECK_PAR(VALID_INTPRI_CHGIPM(intpri));		/*ï¼»NGKI3113ï¼½ï¼»NGKI3114ï¼½*/
+
+	lock_cpu();
+	t_set_ipm(intpri);							/*ï¼»NGKI3111ï¼½*/
+	if (intpri == TIPM_ENAALL && enadsp) {
+		dspflg = true;
+		p_schedtsk = search_schedtsk();
+		if (p_runtsk->raster && p_runtsk->enater) {
+			task_terminate(p_runtsk);
+			exit_and_dispatch();
+			ercd = E_SYS;
+		}
+		else {
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}
+			ercd = E_OK;
+		}
+	}
+	else {
+		dspflg = false;
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_CHG_IPM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_chg_ipm */
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®åç
+§ï¼»NGKI3115ï¼½
+ */
+#ifdef TOPPERS_get_ipm
+
+ER
+get_ipm(PRI *p_intpri)
+{
+	ER		ercd;
+
+	LOG_GET_IPM_ENTER(p_intpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3116ï¼½ï¼»NGKI3117ï¼½*/
+
+	lock_cpu();
+	*p_intpri = t_get_ipm();					/*ï¼»NGKI3120ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_IPM_LEAVE(ercd, p_intpri);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_ipm */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/interrupt.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/interrupt.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/interrupt.h	(revision 302)
@@ -0,0 +1,205 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2000 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: interrupt.h 356 2015-07-25 10:44:32Z ertl-hiro $
+ */
+
+/*
+ *		å²è¾¼ã¿ç®¡çæ©è½
+ */
+
+#ifndef TOPPERS_INTERRUPT_H
+#define TOPPERS_INTERRUPT_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åæåãã­ãã¯
+ */
+typedef struct isr_initialization_block {
+	ATR			isratr;			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³å±æ§ */
+	intptr_t	exinf;			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®æ¡å¼µæ
+å ± */
+	QUEUE		*p_isr_queue;	/* ç»é²å
+å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³å¼åºãã­ã¥ã¼ */
+	ISR			isr;			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®å
+é ­çªå° */
+	PRI			isrpri;			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ */
+} ISRINIB;
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ç®¡çãã­ãã¯
+ */
+typedef struct isr_control_block {
+	QUEUE		isr_queue;		/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³å¼åºãã­ã¥ã¼ */
+	const ISRINIB *p_isrinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+} ISRCB;
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³å¼åºãã­ã¥ã¼ãæ¤ç´¢ããããã®ãã¼ã¿æ§é 
+ */
+typedef struct {
+	INTNO		intno;			/* å²è¾¼ã¿çªå· */
+	QUEUE		*p_isr_queue;	/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³å¼åºãã­ã¥ã¼ */
+} ISR_ENTRY;
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³å¼åºãã­ã¥ã¼ã®ã¨ã³ããªæ°ï¼kernel_cfg.cï¼
+ */
+extern const uint_t tnum_isr_queue;
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³å¼åºãã­ã¥ã¼ãªã¹ãï¼kernel_cfg.cï¼
+ */
+extern const ISR_ENTRY isr_queue_list[];
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³å¼åºãã­ã¥ã¼ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern QUEUE isr_queue_table[];
+
+/*
+ *  ä½¿ç¨ãã¦ããªãå²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+extern QUEUE	free_isrcb;
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_isrid;
+extern const ID	tmax_sisrid;
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const ISRINIB	isrinib_table[];
+extern ISRINIB			aisrinib_table[];
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern ISRCB	isrcb_table[];
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ç®¡çãã­ãã¯ããå²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³IDãå
+ *  ãåºãããã®ãã¯ã­
+ */
+#define	ISRID(p_isrcb)	((ID)(((p_isrcb) - isrcb_table) + TMIN_ISRID))
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³æ©è½ã®åæå
+ */
+extern void initialize_isr(void);
+
+/*
+ *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®å¼åºã
+ */
+extern void call_isr(QUEUE *p_isr_queue);
+
+#if !defined(OMIT_INITIALIZE_INTERRUPT) || defined(USE_INHINIB_TABLE)
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©åæåãã­ãã¯
+ */
+typedef struct interrupt_handler_initialization_block {
+	INHNO		inhno;			/* å²è¾¼ã¿ãã³ãã©çªå· */
+	ATR			inhatr;			/* å²è¾¼ã¿ãã³ãã©å±æ§ */
+	FP			int_entry;		/* å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦çã®çªå° */
+} INHINIB;
+
+/*
+ *  å®ç¾©ããå²è¾¼ã¿ãã³ãã©çªå·ã®æ°ï¼kernel_cfg.cï¼
+ */
+extern const uint_t	tnum_def_inhno;
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const INHINIB	inhinib_table[];
+
+#endif /* !defined(OMIT_INITIALIZE_INTERRUPT) || defined(USE_INHINIB_TABLE) */
+
+#if !defined(OMIT_INITIALIZE_INTERRUPT) || defined(USE_INTINIB_TABLE)
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã©ã¤ã³åæåãã­ãã¯
+ */
+typedef struct interrupt_request_initialization_block {
+	INTNO		intno;			/* å²è¾¼ã¿çªå· */
+	ATR			intatr;			/* å²è¾¼ã¿å±æ§ */
+	PRI			intpri;			/* å²è¾¼ã¿åªå
+åº¦ */
+} INTINIB;
+
+/*
+ *  è¨­å®ããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã®æ°ï¼kernel_cfg.cï¼
+ */
+extern const uint_t	tnum_cfg_intno;
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã©ã¤ã³åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const INTINIB	intinib_table[];
+
+#endif /* !defined(OMIT_INITIALIZE_INTERRUPT) || defined(USE_INTINIB_TABLE) */
+
+/*
+ *  å²è¾¼ã¿ç®¡çæ©è½ã®åæå
+ */
+extern void	initialize_interrupt(void);
+
+#endif /* TOPPERS_INTERRUPT_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/interrupt.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/interrupt.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/interrupt.tf	(revision 302)
@@ -0,0 +1,556 @@
+$
+$   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 $
+$ 
+
+$
+$		å²è¾¼ã¿ç®¡çæ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  AID_ISRã®å¦ç
+$
+$num_aisrid = 0$
+$FOREACH i AISR.ORDER_LIST$
+$	// noisrãè² ã®å ´åï¼E_PARï¼
+	$IF AISR.NOISR[i] < 0$
+		$ERROR AISR.TEXT_LINE[i]$E_PAR:$SPC$
+			$FORMAT(_("illegal %1% `%2%\' in %3%"),
+									"noisr", AISR.NOISR[i], "AID_ISR")$
+		$END$
+	$END$
+	$num_aisrid = num_aisrid + AISR.NOISR[i]$
+$END$
+$num_isrid = LENGTH(ISR.ID_LIST) + num_aisrid$
+
+$
+$  kernel_cfg.hã®çæ
+$
+$FILE "kernel_cfg.h.new"$
+
+#define TNUM_ISRID	$num_isrid$$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$
+
+$
+$  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$
+	$END$
+$END$
+
+$
+$  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ï¼ISRï¼ç®¡çã®ãã¼ã¿æ§é 
+$
+$intno_isr_list = {}$
+$FOREACH intno INTNO_CREISR_VALID$
+	$inhno = INHNO[intno]$
+	$IF LENGTH(INT.INTNO[intno]) && !LENGTH(INH.INHNO[inhno])$
+		$intno_isr_list = APPEND(intno_isr_list, intno)$
+	$END$
+$END$
+
+$INTNO_ISR = {}$
+$i = 0$
+$FOREACH intno SORT(intno_isr_list, "INT.INTNO")$
+	$INTNO_ISR = APPEND(INTNO_ISR, intno)$
+	$ISR_QUEUE_HEADER[intno] = FORMAT("&(_kernel_isr_queue_table[%d])", i)$
+	$i = i + 1$
+$END$
+
+const uint_t _kernel_tnum_isr_queue = $LENGTH(INTNO_ISR)$;$NL$
+$NL$
+
+$IF LENGTH(INTNO_ISR)$
+	const ISR_ENTRY _kernel_isr_queue_list[$LENGTH(INTNO_ISR)$] = {$NL$
+	$JOINEACH intno INTNO_ISR ",\n"$
+		$TAB${ $intno$, $ISR_QUEUE_HEADER[intno]$ }
+	$END$$NL$
+	};$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(QUEUE, _kernel_isr_queue_table);$NL$
+$END$$NL$
+
+$IF LENGTH(INTNO_ISR)$
+	QUEUE _kernel_isr_queue_table[$LENGTH(INTNO_ISR)$];$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(QUEUE, _kernel_isr_queue_table);$NL$
+$END$$NL$
+
+$
+$  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ï¼ISRï¼å¼åºãã®ããã®å²è¾¼ã¿ãã³ãã©
+$
+$FOREACH intno INTNO_ISR$
+	$inhno = INHNO[intno]$
+
+$	// 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$
+	$TAB$_kernel_call_isr($ISR_QUEUE_HEADER[intno]$);$NL$
+	}$NL$
+	$NL$
+$END$
+
+$
+$  éçã«çæãããå²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®æ°
+$
+#define TNUM_SISRID	$LENGTH(ISR.ID_LIST)$$NL$
+$NL$
+
+$
+$  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³IDçªå·ã®æå¤§å¤
+$
+const ID _kernel_tmax_isrid = (TMIN_ISRID + TNUM_ISRID - 1);$NL$
+const ID _kernel_tmax_sisrid = (TMIN_ISRID + TNUM_SISRID - 1);$NL$
+$NL$
+
+$
+$  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åæåãã­ãã¯ã®çæ
+$
+$IF LENGTH(ISR.ID_LIST)$
+	const ISRINIB _kernel_isrinib_table[TNUM_SISRID] = {$NL$
+	$JOINEACH id ISR.ID_LIST ",\n"$
+		$TAB${$SPC$
+		($ISR.ISRATR[id]$), ($ISR.EXINF[id]$),$SPC$
+		($ISR_QUEUE_HEADER[ISR.INTNO[id]]$),$SPC$
+		(ISR)($ISR.ISR[id]$), ($ISR.ISRPRI[id]$)$SPC$
+		}$END$$NL$
+	};$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(const ISRINIB, _kernel_isrinib_table);$NL$
+$END$
+$NL$
+
+$
+$  åççæå²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ç¨ã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åæåãã­ãã¯
+$
+$IF num_aisrid > 0$
+	ISRINIB _kernel_aisrinib_table[$num_aisrid$];$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(ISRINIB, _kernel_aisrinib_table);$NL$
+$END$
+$NL$
+
+$
+$  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ç®¡çãã­ãã¯
+$
+$IF num_isrid > 0$
+	ISRCB _kernel_isrcb_table[TNUM_ISRID];$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(ISRCB, _kernel_isrcb_table);$NL$
+$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();")$
+$IF num_isrid > 0$
+	$initfuncs = APPEND(initfuncs, "_kernel_initialize_isr();")$
+$END$
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/kernel.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/kernel.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/kernel.tf	(revision 302)
@@ -0,0 +1,483 @@
+$
+$   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ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  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$*  Memory Area Allocated by Kernel$NL$
+$SPC$*/$NL$
+$NL$
+
+$IF !LENGTH(KMM.ORDER_LIST)$
+$	// DEF_KMMããªãå ´åã®ããã©ã«ãå¤ã®è¨­å®
+	#define TOPPERS_KMMSZ		0$NL$
+	#define TOPPERS_KMM			NULL$NL$
+$ELSE$
+
+$	// éçAPIãDEF_KMMããè¤æ°ããï¼E_OBJï¼
+	$IF LENGTH(KMM.ORDER_LIST) > 1$
+		$ERROR$E_OBJ: $FORMAT(_("too many %1%"), "DEF_KMM")$$END$
+	$END$
+
+$	// kmmszã0ä»¥ä¸ã®å ´åï¼E_PARï¼
+	$IF KMM.KMMSZ[1] <= 0$
+		$ERROR KMM.TEXT_LINE[1]$E_PAR:$SPC$
+			$FORMAT(_("%1% `%2%\' is zero in %3%"),
+									"kmmsz", KMM.KMMSZ[1], "DEF_KMM")$
+		$END$
+	$END$
+
+$ 	// kmmszãã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åã®ãµã¤ãºã¨ãã¦æ­£ãããªãå ´
+$	// åï¼E_PARï¼
+	$IF !EQ(KMM.KMM[1], "NULL") && CHECK_MB_ALIGN
+							&& (KMM.KMMSZ[1] & (CHECK_MB_ALIGN - 1))$
+		$ERROR KMM.TEXT_LINE[1]$E_PAR:$SPC$
+			$FORMAT(_("%1% `%2%\' in %3% is not aligned"),
+									"kmmsz", KMM.KMMSZ[1], "DEF_KMM")$
+			$END$
+	$END$
+
+	$IF EQ(KMM.KMM[1], "NULL")$
+$		// ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åã®èªåå²ä»ã
+		static MB_T					_kernel_memory[TOPPERS_COUNT_SZ($KMM.KMMSZ[1]$, sizeof(MB_T))];$NL$
+		#define TOPPERS_KMMSZ		TOPPERS_ROUND_SZ($KMM.KMMSZ[1]$, sizeof(MB_T))$NL$
+		#define TOPPERS_KMM			_kernel_memory$NL$
+	$ELSE$
+		#define TOPPERS_KMMSZ		($KMM.KMMSZ[1]$)$NL$
+		#define TOPPERS_KMM			(void *)($KMM.KMM[1]$)$NL$
+	$END$
+$END$
+$NL$
+
+$ ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé å
+const size_t	_kernel_kmmsz = TOPPERS_KMMSZ;$NL$
+MB_T *const		_kernel_kmm = TOPPERS_KMM;$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/extension/dcre/kernel/kernel_api.csv
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_api.csv	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_api.csv	(revision 302)
@@ -0,0 +1,27 @@
+tsk,CRE_TSK,#tskid { .tskatr &exinf &task +itskpri .stksz &stk },,
+atsk,AID_TSK,.notsk,,
+sem,CRE_SEM,#semid { .sematr .isemcnt .maxsem },,
+asem,AID_SEM,.nosem,,
+flg,CRE_FLG,#flgid { .flgatr .iflgptn },,
+aflg,AID_FLG,.nosem,,
+dtq,CRE_DTQ,#dtqid { .dtqatr .dtqcnt &dtqmb },,
+adtq,AID_DTQ,.nodtq,,
+pdq,CRE_PDQ,#pdqid { .pdqatr .pdqcnt +maxdpri &pdqmb },,
+apdq,AID_PDQ,.nopdq,,
+mtx,CRE_MTX,#mtxid { .mtxatr +ceilpri? },,
+amtx,AID_MTX,.nomtx,,
+mpf,CRE_MPF,#mpfid { .mpfatr .blkcnt .blksz &mpf &mpfmb },,
+ampf,AID_MPF,.nompf,,
+cyc,CRE_CYC,#cycid { .cycatr { .nfymode &par1 &par2? &par3? &par4? } .cyctim .cycphs },,
+acyc,AID_CYC,.nocyc,,
+alm,CRE_ALM,#almid { .almatr { .nfymode &par1 &par2? &par3? &par4? } },,
+aalm,AID_ALM,.noalm,,
+int,CFG_INT,.intno { .intatr +intpri },,
+isr,CRE_ISR,#isrid { .isratr &exinf .intno &isr +isrpri },,
+aisr,AID_ISR,.noisr,,
+inh,DEF_INH,.inhno { .inhatr &inthdr },,
+exc,DEF_EXC,.excno { .excatr &exchdr },,
+ics,DEF_ICS,{ .istksz &istk },-1,
+kmm,DEF_KMM,{ .kmmsz &kmm },-1,
+ini,ATT_INI,{ .iniatr &exinf &inirtn },-1,
+ter,ATT_TER,{ .teratr &exinf &terrtn },-1,
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_check.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_check.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_check.tf	(revision 302)
@@ -0,0 +1,422 @@
+$ 
+$   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$
+
+$
+$  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã«é¢ãããã§ãã¯
+$
+$isrinib = SYMBOL("_kernel_isrinib_table")$
+$FOREACH order ISR.ORDER_LIST$
+	$isr = PEEK(isrinib + offsetof_ISRINIB_isr, sizeof_FP)$
+
+$	// å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã®å
+é ­çªå°ã®ãã§ãã¯ï¼»NGKI3004ï¼½
+	$IF CHECK_FUNC_ALIGN && (isr & (CHECK_FUNC_ALIGN - 1)) != 0$
+		$ERROR ISR.TEXT_LINE[order]$E_PAR:$SPC$
+			$FORMAT(_("%1% `%2%\' in %4% is not aligned"),
+						"isr", ISR.ISR[order], "CRE_ISR")$
+		$END$
+	$END$
+	$IF CHECK_FUNC_NONNULL && isr == 0$
+		$ERROR ISR.TEXT_LINE[order]$E_PAR:$SPC$
+			$FORMAT(_("%1% `%2%\' in %4% is null"),
+						"isr", ISR.ISR[order], "CRE_ISR")$
+		$END$
+	$END$
+
+	$isrinib = isrinib + sizeof_ISRINIB$
+$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$
+
+$ 
+$  ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åã«é¢ãããã§ãã¯
+$ 
+$kmm = PEEK(SYMBOL("_kernel_kmm"), sizeof_void_ptr)$
+
+$ ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åã®å
+é ­çªå°ã®ãã§ãã¯
+$IF CHECK_MB_ALIGN && (kmm & (CHECK_MB_ALIGN - 1)) != 0$
+	$ERROR KMM.TEXT_LINE[1]$E_PAR:$SPC$
+		$FORMAT(_("%1% `%2%\' in %3% is not aligned"),
+							"kmm", KMM.KMM[1], "DEF_KMM")$
+	$END$
+$END$
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_def.csv
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_def.csv	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_def.csv	(revision 302)
@@ -0,0 +1,140 @@
+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)
+CHECK_MB_ALIGN,#defined(CHECK_MB_ALIGN),,CHECK_MB_ALIGN
+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_ISRINIB,sizeof(ISRINIB)
+offsetof_ISRINIB_isratr,"offsetof(ISRINIB,isratr)"
+offsetof_ISRINIB_exinf,"offsetof(ISRINIB,exinf)"
+offsetof_ISRINIB_p_isr_queue,"offsetof(ISRINIB,p_isr_queue)"
+offsetof_ISRINIB_isr,"offsetof(ISRINIB,isr)"
+offsetof_ISRINIB_isrpri,"offsetof(ISRINIB,isrpri)"
+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/extension/dcre/kernel/kernel_impl.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_impl.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_impl.h	(revision 302)
@@ -0,0 +1,261 @@
+/*
+ *  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) 2004-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_impl.h 333 2015-06-21 13:23:37Z ertl-hiro $
+ */
+
+/*
+ *		TOPPERS/ASPã«ã¼ãã«å
+é¨åãæ¨æºããããã¡ã¤ã«
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼ã«ã¼ãã«ãæ§æãããã­ã°ã©ã ã®ã½ã¼ã¹ãã¡ã¤ã«
+ *  ã§å¿
+ãã¤ã³ã¯ã«ã¼ãããã¹ãæ¨æºããããã¡ã¤ã«ã§ããï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ããï¼ããã«ããï¼ãã¯ã­å®ç¾©ä»¥å¤ã
+ *  é¤ãããã«ãªã£ã¦ããï¼
+ */
+
+#ifndef TOPPERS_KERNEL_IMPL_H
+#define TOPPERS_KERNEL_IMPL_H
+
+/*
+ *  ã«ã¼ãã«ã®å
+é¨è­å¥åã®ãªãã¼ã 
+ */
+#include "kernel_rename.h"
+
+/*
+ *  ã¢ããªã±ã¼ã·ã§ã³ã¨å
+±éã®ããããã¡ã¤ã«
+ */
+#include <kernel.h>
+
+/*
+ *  ã·ã¹ãã ã­ã°æ©è½ã®ããã®å®ç¾©
+ */
+#include <t_syslog.h>
+
+/*
+ *  åã­ã£ã¹ããè¡ããã¯ã­ã®å®ç¾©
+ */
+#ifndef CAST
+#define CAST(type, val)		((type)(val))
+#endif /* CAST */
+
+/*
+ *  ã¿ã¼ã²ããä¾å­æ
+å ±ã®å®ç¾©
+ */
+#include "target_kernel_impl.h"
+
+/*
+ *  ãã¹ã¦ã®é¢æ°ãã³ã³ãã¤ã«ããããã®å®ç¾©
+ */
+#ifdef ALLFUNC
+#include "allfunc.h"
+#endif /* ALLFUNC */
+
+/*
+ *  ããããã£ã¼ã«ãã§ã®ç¬¦å·ç¡ãæ´æ°å
+ *
+ *  8ãããä»¥ä¸ã®å¹
+ã®ããããã£ã¼ã«ãã§ï¼ç¬¦å·ç¡ãæ´æ°å¤ãä¿æãããå ´å
+ *  ã«ç¨ããã¹ããã¼ã¿åï¼ANSI Cã§ã¯ï¼ããããã£ã¼ã«ãã®ãã¼ã¿åã«ã¯
+ *  intã¨unsigned intããè¨±ãããªãããï¼ããã©ã«ãã®å®ç¾©ã¯unsigned
+ *  intã¨ãã¦ãããï¼ã¿ã¼ã²ããããã³ãã¼ã«ä¾å­ã§ï¼unsigned charã¾ãã¯
+ *  unsigned shortã«å®ç¾©ããæ¹ãå¹çãè¯ãå ´åãããï¼
+ */
+#ifndef BIT_FIELD_UINT
+#define BIT_FIELD_UINT		unsigned int
+#endif /* BIT_FIELD_UINT */
+
+/*
+ *  ããããã£ã¼ã«ãã§ã®ãã¼ã«å
+ *
+ *  1ãããå¹
+ã®ããããã£ã¼ã«ãã§ï¼ãã¼ã«å¤ãä¿æãããå ´åã«ç¨ããã¹ã
+ *  ãã¼ã¿åï¼ããã©ã«ãã§ã¯BIT_FIELD_UINTã¨åä¸ã«å®ç¾©ãã¦ãããï¼ãã¼
+ *  ã«å¤ãä¿æãããã¨ãæç¤ºããããã«å¥ã®åç§°ã¨ãã¦ããï¼
+ */
+#ifndef BIT_FIELD_BOOL
+#define BIT_FIELD_BOOL		BIT_FIELD_UINT
+#endif /* BIT_FIELD_BOOL */
+
+/*
+ *  ãªãã¸ã§ã¯ãIDã®æå°å¤ã®å®ç¾©
+ */
+#define TMIN_TSKID		1		/* ã¿ã¹ã¯IDã®æå°å¤ */
+#define TMIN_SEMID		1		/* ã»ããã©IDã®æå°å¤ */
+#define TMIN_FLGID		1		/* ãã©ã°IDã®æå°å¤ */
+#define TMIN_DTQID		1		/* ãã¼ã¿ã­ã¥ã¼IDã®æå°å¤ */
+#define TMIN_PDQID		1		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼IDã®æå°å¤ */
+#define TMIN_MTXID		1		/* ãã¥ã¼ããã¯ã¹IDã®æå°å¤ */
+#define TMIN_MPFID		1		/* åºå®é·ã¡ã¢ãªãã¼ã«IDã®æå°å¤ */
+#define TMIN_CYCID		1		/* å¨æéç¥IDã®æå°å¤ */
+#define TMIN_ALMID		1		/* ã¢ã©ã¼ã éç¥IDã®æå°å¤ */
+#define TMIN_ISRID		1		/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³IDã®æå°å¤ */
+
+/*
+ *  åªå
+åº¦ã®æ®µéæ°ã®å®ç¾©
+ */
+#define TNUM_TPRI		(TMAX_TPRI - TMIN_TPRI + 1)
+#define TNUM_DPRI		(TMAX_DPRI - TMIN_DPRI + 1)
+#define TNUM_INTPRI		(TMAX_INTPRI - TMIN_INTPRI + 1)
+
+/*
+ *  ã«ã¼ãã«å
+é¨ã§ä½¿ç¨ããå±æ§ã®å®ç¾©
+ */
+#define TA_NOEXS		((ATR)(-1))			/* æªç»é²ç¶æ
+ */
+
+#ifndef TA_MEMALLOC
+#define TA_MEMALLOC		UINT_C(0x8000)		/* ã¡ã¢ãªé åãã«ã¼ãã«ã§ç¢ºä¿ */
+#endif /* TA_MEMALLOC */
+#ifndef TA_MBALLOC
+#define TA_MBALLOC		UINT_C(0x4000)		/* ç®¡çé åãã«ã¼ãã«ã§ç¢ºä¿ */
+#endif /* TA_MBALLOC */
+
+/*
+ *  ã¿ã¼ã²ããå®ç¾©ã®ã¨ã©ã¼ãã§ãã¯ãã¯ã­ã®ããã©ã«ãå¤ã®å®ç¾©
+ */
+#ifndef TARGET_TSKATR
+#define TARGET_TSKATR		0U		/* ã¿ã¼ã²ããå®ç¾©ã®ã¿ã¹ã¯å±æ§ */
+#endif /* TARGET_TSKATR */
+
+#ifndef TARGET_ISRATR
+#define TARGET_ISRATR		0U		/* ã¿ã¼ã²ããå®ç¾©ã®ISRå±æ§ */
+#endif /* TARGET_ISRATR */
+
+/*
+ *  ããããã¡ã¤ã«ãæããªãã¢ã¸ã¥ã¼ã«ã®é¢æ°ã»å¤æ°ã®å®£è¨
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  åã¢ã¸ã¥ã¼ã«ã®åæåï¼kernel_cfg.cï¼
+ */
+extern void	initialize_object(void);
+
+/*
+ *  åæåã«ã¼ãã³ã®å®è¡ï¼kernel_cfg.cï¼
+ */
+extern void	call_inirtn(void);
+
+/*
+ *  çµäºå¦çã«ã¼ãã³ã®å®è¡ï¼kernel_cfg.cï¼
+ */
+extern void	call_terrtn(void);
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åï¼kernel_cfg.cï¼
+ */
+extern const size_t	istksz;		/* ã¹ã¿ãã¯é åã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
+extern STK_T *const	istk;		/* ã¹ã¿ãã¯é åã®å
+é ­çªå° */
+#ifdef TOPPERS_ISTKPT
+extern STK_T *const	istkpt;		/* ã¹ã¿ãã¯ãã¤ã³ã¿ã®åæå¤ */
+#endif /* TOPPERS_ISTKPT */
+
+/*
+ *  ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åï¼kernel_cfg.cï¼
+ */
+extern const size_t	kmmsz;		/* ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åã®ãµã¤ãº */
+extern MB_T *const	kmm;		/* ã«ã¼ãã«ãå²ãä»ããã¡ã¢ãªé åã®å
+é ­çªå° */
+
+/*
+ *  ã«ã¼ãã«åä½ç¶æ
+ãã©ã°ï¼startup.cï¼
+ */
+extern bool_t	kerflg;
+
+/*
+ *  ã«ã¼ãã«ã®èµ·åï¼startup.cï¼
+ */
+extern void	sta_ker(void);
+
+/*
+ *  ã«ã¼ãã«ã®çµäºå¦çï¼startup.cï¼
+ */
+extern void	exit_kernel(void);
+
+/*
+ *  ã«ã¼ãã«ã®å²ãä»ããã¡ã¢ãªé åã®ç®¡çï¼startup.cï¼
+ */
+extern void initialize_kmm(void);
+extern void *kernel_malloc(size_t size);
+extern void kernel_free(void *ptr);
+
+/*
+ *  éç¥ãã³ãã©ã®åå®ç¾©
+ */
+typedef void	(*NFYHDR)(intptr_t exinf);
+
+/*
+ *  éç¥æ¹æ³ã®ã¨ã©ã¼ãã§ãã¯
+ */
+extern ER check_nfyinfo(const T_NFYINFO *p_nfyinfo);
+
+/*
+ *  éç¥ãã³ãã©
+ */
+extern void notify_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_KERNEL_IMPL_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_rename.def
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_rename.def	(revision 302)
@@ -0,0 +1,197 @@
+# startup.c
+kerflg
+exit_kernel
+initialize_kmm
+kernel_malloc
+kernel_free
+
+# task.c
+p_runtsk
+p_schedtsk
+enadsp
+dspflg
+ready_queue
+ready_primap
+free_tcb
+initialize_task
+search_schedtsk
+make_runnable
+make_non_runnable
+make_dormant
+make_active
+change_priority
+rotate_ready_queue
+task_terminate
+
+# taskhook.c
+mtxhook_check_ceilpri
+mtxhook_scan_ceilmtx
+mtxhook_release_all
+
+# wait.c
+make_wait_tmout
+wait_complete
+wait_tmout
+wait_tmout_ok
+wobj_make_wait
+wobj_make_wait_tmout
+init_wait_queue
+
+# time_event.c
+boundary_evttim
+current_evttim
+current_hrtcnt
+monotonic_evttim
+systim_offset
+in_signal_time
+initialize_tmevt
+tmevt_up
+tmevt_down
+update_current_evttim
+set_hrt_event
+tmevtb_register
+tmevtb_enqueue
+tmevtb_dequeue
+check_adjtim
+tmevt_lefttim
+signal_time
+
+# semaphore.c
+free_semcb
+initialize_semaphore
+
+# eventflag.c
+free_flgcb
+initialize_eventflag
+check_flg_cond
+
+# dataqueue.c
+free_dtqcb
+initialize_dataqueue
+enqueue_data
+force_enqueue_data
+dequeue_data
+send_data
+force_send_data
+receive_data
+
+# pridataq.c
+free_pdqcb
+initialize_pridataq
+enqueue_pridata
+dequeue_pridata
+send_pridata
+receive_pridata
+
+# mutex.c
+free_mtxcb
+initialize_mutex
+mutex_check_ceilpri
+mutex_scan_ceilmtx
+mutex_drop_priority
+mutex_acquire
+mutex_release
+mutex_release_all
+
+# mempfix.c
+free_mpfcb
+initialize_mempfix
+get_mpf_block
+
+# time_manage.c
+check_nfyinfo
+notify_handler
+
+# cyclic.c
+free_cyccb
+initialize_cyclic
+call_cyclic
+
+# alarm.c
+free_almcb
+initialize_alarm
+call_alarm
+
+# interrupt.c
+free_isrcb
+initialize_isr
+call_isr
+initialize_interrupt
+
+# exception.c
+initialize_exception
+
+# kernel_cfg.c
+initialize_object
+call_inirtn
+call_terrtn
+tmax_tskid
+tmax_stskid
+tinib_table
+atinib_table
+torder_table
+tcb_table
+tmax_semid
+tmax_ssemid
+seminib_table
+aseminib_table
+semcb_table
+tmax_flgid
+tmax_sflgid
+flginib_table
+aflginib_table
+flgcb_table
+tmax_dtqid
+tmax_sdtqid
+dtqinib_table
+adtqinib_table
+dtqcb_table
+tmax_pdqid
+tmax_spdqid
+pdqinib_table
+apdqinib_table
+pdqcb_table
+tmax_mtxid
+tmax_smtxid
+mtxinib_table
+amtxinib_table
+mtxcb_table
+tmax_mpfid
+tmax_smpfid
+mpfinib_table
+ampfinib_table
+mpfcb_table
+tmax_cycid
+tmax_scycid
+cycinib_table
+acycinib_table
+acyc_nfyinfo_table
+cyccb_table
+tmax_almid
+tmax_salmid
+alminib_table
+aalminib_table
+aalm_nfyinfo_table
+almcb_table
+tnum_isr_queue
+isr_queue_list
+isr_queue_table
+tmax_isrid
+tmax_sisrid
+isrinib_table
+aisrinib_table
+isrcb_table
+tnum_def_inhno
+inhinib_table
+tnum_cfg_intno
+intinib_table
+tnum_def_excno
+excinib_table
+tmevt_heap
+istksz
+istk
+istkpt
+kmmsz
+kmm
+
+INCLUDE "target"
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_rename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_rename.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_rename.h	(revision 302)
@@ -0,0 +1,474 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+#ifndef TOPPERS_KERNEL_RENAME_H
+#define TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  startup.c
+ */
+#define kerflg						_kernel_kerflg
+#define exit_kernel					_kernel_exit_kernel
+#define initialize_kmm				_kernel_initialize_kmm
+#define kernel_malloc				_kernel_kernel_malloc
+#define kernel_free					_kernel_kernel_free
+
+/*
+ *  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 free_tcb					_kernel_free_tcb
+#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 free_semcb					_kernel_free_semcb
+#define initialize_semaphore		_kernel_initialize_semaphore
+
+/*
+ *  eventflag.c
+ */
+#define free_flgcb					_kernel_free_flgcb
+#define initialize_eventflag		_kernel_initialize_eventflag
+#define check_flg_cond				_kernel_check_flg_cond
+
+/*
+ *  dataqueue.c
+ */
+#define free_dtqcb					_kernel_free_dtqcb
+#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 free_pdqcb					_kernel_free_pdqcb
+#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 free_mtxcb					_kernel_free_mtxcb
+#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 free_mpfcb					_kernel_free_mpfcb
+#define initialize_mempfix			_kernel_initialize_mempfix
+#define get_mpf_block				_kernel_get_mpf_block
+
+/*
+ *  time_manage.c
+ */
+#define check_nfyinfo				_kernel_check_nfyinfo
+#define notify_handler				_kernel_notify_handler
+
+/*
+ *  cyclic.c
+ */
+#define free_cyccb					_kernel_free_cyccb
+#define initialize_cyclic			_kernel_initialize_cyclic
+#define call_cyclic					_kernel_call_cyclic
+
+/*
+ *  alarm.c
+ */
+#define free_almcb					_kernel_free_almcb
+#define initialize_alarm			_kernel_initialize_alarm
+#define call_alarm					_kernel_call_alarm
+
+/*
+ *  interrupt.c
+ */
+#define free_isrcb					_kernel_free_isrcb
+#define initialize_isr				_kernel_initialize_isr
+#define call_isr					_kernel_call_isr
+#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 tmax_stskid					_kernel_tmax_stskid
+#define tinib_table					_kernel_tinib_table
+#define atinib_table				_kernel_atinib_table
+#define torder_table				_kernel_torder_table
+#define tcb_table					_kernel_tcb_table
+#define tmax_semid					_kernel_tmax_semid
+#define tmax_ssemid					_kernel_tmax_ssemid
+#define seminib_table				_kernel_seminib_table
+#define aseminib_table				_kernel_aseminib_table
+#define semcb_table					_kernel_semcb_table
+#define tmax_flgid					_kernel_tmax_flgid
+#define tmax_sflgid					_kernel_tmax_sflgid
+#define flginib_table				_kernel_flginib_table
+#define aflginib_table				_kernel_aflginib_table
+#define flgcb_table					_kernel_flgcb_table
+#define tmax_dtqid					_kernel_tmax_dtqid
+#define tmax_sdtqid					_kernel_tmax_sdtqid
+#define dtqinib_table				_kernel_dtqinib_table
+#define adtqinib_table				_kernel_adtqinib_table
+#define dtqcb_table					_kernel_dtqcb_table
+#define tmax_pdqid					_kernel_tmax_pdqid
+#define tmax_spdqid					_kernel_tmax_spdqid
+#define pdqinib_table				_kernel_pdqinib_table
+#define apdqinib_table				_kernel_apdqinib_table
+#define pdqcb_table					_kernel_pdqcb_table
+#define tmax_mtxid					_kernel_tmax_mtxid
+#define tmax_smtxid					_kernel_tmax_smtxid
+#define mtxinib_table				_kernel_mtxinib_table
+#define amtxinib_table				_kernel_amtxinib_table
+#define mtxcb_table					_kernel_mtxcb_table
+#define tmax_mpfid					_kernel_tmax_mpfid
+#define tmax_smpfid					_kernel_tmax_smpfid
+#define mpfinib_table				_kernel_mpfinib_table
+#define ampfinib_table				_kernel_ampfinib_table
+#define mpfcb_table					_kernel_mpfcb_table
+#define tmax_cycid					_kernel_tmax_cycid
+#define tmax_scycid					_kernel_tmax_scycid
+#define cycinib_table				_kernel_cycinib_table
+#define acycinib_table				_kernel_acycinib_table
+#define acyc_nfyinfo_table			_kernel_acyc_nfyinfo_table
+#define cyccb_table					_kernel_cyccb_table
+#define tmax_almid					_kernel_tmax_almid
+#define tmax_salmid					_kernel_tmax_salmid
+#define alminib_table				_kernel_alminib_table
+#define aalminib_table				_kernel_aalminib_table
+#define aalm_nfyinfo_table			_kernel_aalm_nfyinfo_table
+#define almcb_table					_kernel_almcb_table
+#define tnum_isr_queue				_kernel_tnum_isr_queue
+#define isr_queue_list				_kernel_isr_queue_list
+#define isr_queue_table				_kernel_isr_queue_table
+#define tmax_isrid					_kernel_tmax_isrid
+#define tmax_sisrid					_kernel_tmax_sisrid
+#define isrinib_table				_kernel_isrinib_table
+#define aisrinib_table				_kernel_aisrinib_table
+#define isrcb_table					_kernel_isrcb_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
+#define kmmsz						_kernel_kmmsz
+#define kmm							_kernel_kmm
+
+
+#ifdef TOPPERS_LABEL_ASM
+
+/*
+ *  startup.c
+ */
+#define _kerflg						__kernel_kerflg
+#define _exit_kernel				__kernel_exit_kernel
+#define _initialize_kmm				__kernel_initialize_kmm
+#define _kernel_malloc				__kernel_kernel_malloc
+#define _kernel_free				__kernel_kernel_free
+
+/*
+ *  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 _free_tcb					__kernel_free_tcb
+#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 _free_semcb					__kernel_free_semcb
+#define _initialize_semaphore		__kernel_initialize_semaphore
+
+/*
+ *  eventflag.c
+ */
+#define _free_flgcb					__kernel_free_flgcb
+#define _initialize_eventflag		__kernel_initialize_eventflag
+#define _check_flg_cond				__kernel_check_flg_cond
+
+/*
+ *  dataqueue.c
+ */
+#define _free_dtqcb					__kernel_free_dtqcb
+#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 _free_pdqcb					__kernel_free_pdqcb
+#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 _free_mtxcb					__kernel_free_mtxcb
+#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 _free_mpfcb					__kernel_free_mpfcb
+#define _initialize_mempfix			__kernel_initialize_mempfix
+#define _get_mpf_block				__kernel_get_mpf_block
+
+/*
+ *  time_manage.c
+ */
+#define _check_nfyinfo				__kernel_check_nfyinfo
+#define _notify_handler				__kernel_notify_handler
+
+/*
+ *  cyclic.c
+ */
+#define _free_cyccb					__kernel_free_cyccb
+#define _initialize_cyclic			__kernel_initialize_cyclic
+#define _call_cyclic				__kernel_call_cyclic
+
+/*
+ *  alarm.c
+ */
+#define _free_almcb					__kernel_free_almcb
+#define _initialize_alarm			__kernel_initialize_alarm
+#define _call_alarm					__kernel_call_alarm
+
+/*
+ *  interrupt.c
+ */
+#define _free_isrcb					__kernel_free_isrcb
+#define _initialize_isr				__kernel_initialize_isr
+#define _call_isr					__kernel_call_isr
+#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 _tmax_stskid				__kernel_tmax_stskid
+#define _tinib_table				__kernel_tinib_table
+#define _atinib_table				__kernel_atinib_table
+#define _torder_table				__kernel_torder_table
+#define _tcb_table					__kernel_tcb_table
+#define _tmax_semid					__kernel_tmax_semid
+#define _tmax_ssemid				__kernel_tmax_ssemid
+#define _seminib_table				__kernel_seminib_table
+#define _aseminib_table				__kernel_aseminib_table
+#define _semcb_table				__kernel_semcb_table
+#define _tmax_flgid					__kernel_tmax_flgid
+#define _tmax_sflgid				__kernel_tmax_sflgid
+#define _flginib_table				__kernel_flginib_table
+#define _aflginib_table				__kernel_aflginib_table
+#define _flgcb_table				__kernel_flgcb_table
+#define _tmax_dtqid					__kernel_tmax_dtqid
+#define _tmax_sdtqid				__kernel_tmax_sdtqid
+#define _dtqinib_table				__kernel_dtqinib_table
+#define _adtqinib_table				__kernel_adtqinib_table
+#define _dtqcb_table				__kernel_dtqcb_table
+#define _tmax_pdqid					__kernel_tmax_pdqid
+#define _tmax_spdqid				__kernel_tmax_spdqid
+#define _pdqinib_table				__kernel_pdqinib_table
+#define _apdqinib_table				__kernel_apdqinib_table
+#define _pdqcb_table				__kernel_pdqcb_table
+#define _tmax_mtxid					__kernel_tmax_mtxid
+#define _tmax_smtxid				__kernel_tmax_smtxid
+#define _mtxinib_table				__kernel_mtxinib_table
+#define _amtxinib_table				__kernel_amtxinib_table
+#define _mtxcb_table				__kernel_mtxcb_table
+#define _tmax_mpfid					__kernel_tmax_mpfid
+#define _tmax_smpfid				__kernel_tmax_smpfid
+#define _mpfinib_table				__kernel_mpfinib_table
+#define _ampfinib_table				__kernel_ampfinib_table
+#define _mpfcb_table				__kernel_mpfcb_table
+#define _tmax_cycid					__kernel_tmax_cycid
+#define _tmax_scycid				__kernel_tmax_scycid
+#define _cycinib_table				__kernel_cycinib_table
+#define _acycinib_table				__kernel_acycinib_table
+#define _acyc_nfyinfo_table			__kernel_acyc_nfyinfo_table
+#define _cyccb_table				__kernel_cyccb_table
+#define _tmax_almid					__kernel_tmax_almid
+#define _tmax_salmid				__kernel_tmax_salmid
+#define _alminib_table				__kernel_alminib_table
+#define _aalminib_table				__kernel_aalminib_table
+#define _aalm_nfyinfo_table			__kernel_aalm_nfyinfo_table
+#define _almcb_table				__kernel_almcb_table
+#define _tnum_isr_queue				__kernel_tnum_isr_queue
+#define _isr_queue_list				__kernel_isr_queue_list
+#define _isr_queue_table			__kernel_isr_queue_table
+#define _tmax_isrid					__kernel_tmax_isrid
+#define _tmax_sisrid				__kernel_tmax_sisrid
+#define _isrinib_table				__kernel_isrinib_table
+#define _aisrinib_table				__kernel_aisrinib_table
+#define _isrcb_table				__kernel_isrcb_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
+#define _kmmsz						__kernel_kmmsz
+#define _kmm						__kernel_kmm
+
+
+#endif /* TOPPERS_LABEL_ASM */
+
+#include "target_rename.h"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_unrename.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/kernel_unrename.h	(revision 302)
@@ -0,0 +1,475 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+/* This file is included only when kernel_rename.h has been included. */
+#ifdef TOPPERS_KERNEL_RENAME_H
+#undef TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  startup.c
+ */
+#undef kerflg
+#undef exit_kernel
+#undef initialize_kmm
+#undef kernel_malloc
+#undef kernel_free
+
+/*
+ *  task.c
+ */
+#undef p_runtsk
+#undef p_schedtsk
+#undef enadsp
+#undef dspflg
+#undef ready_queue
+#undef ready_primap
+#undef free_tcb
+#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 free_semcb
+#undef initialize_semaphore
+
+/*
+ *  eventflag.c
+ */
+#undef free_flgcb
+#undef initialize_eventflag
+#undef check_flg_cond
+
+/*
+ *  dataqueue.c
+ */
+#undef free_dtqcb
+#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 free_pdqcb
+#undef initialize_pridataq
+#undef enqueue_pridata
+#undef dequeue_pridata
+#undef send_pridata
+#undef receive_pridata
+
+/*
+ *  mutex.c
+ */
+#undef free_mtxcb
+#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 free_mpfcb
+#undef initialize_mempfix
+#undef get_mpf_block
+
+/*
+ *  time_manage.c
+ */
+#undef check_nfyinfo
+#undef notify_handler
+
+/*
+ *  cyclic.c
+ */
+#undef free_cyccb
+#undef initialize_cyclic
+#undef call_cyclic
+
+/*
+ *  alarm.c
+ */
+#undef free_almcb
+#undef initialize_alarm
+#undef call_alarm
+
+/*
+ *  interrupt.c
+ */
+#undef free_isrcb
+#undef initialize_isr
+#undef call_isr
+#undef initialize_interrupt
+
+/*
+ *  exception.c
+ */
+#undef initialize_exception
+
+/*
+ *  kernel_cfg.c
+ */
+#undef initialize_object
+#undef call_inirtn
+#undef call_terrtn
+#undef tmax_tskid
+#undef tmax_stskid
+#undef tinib_table
+#undef atinib_table
+#undef torder_table
+#undef tcb_table
+#undef tmax_semid
+#undef tmax_ssemid
+#undef seminib_table
+#undef aseminib_table
+#undef semcb_table
+#undef tmax_flgid
+#undef tmax_sflgid
+#undef flginib_table
+#undef aflginib_table
+#undef flgcb_table
+#undef tmax_dtqid
+#undef tmax_sdtqid
+#undef dtqinib_table
+#undef adtqinib_table
+#undef dtqcb_table
+#undef tmax_pdqid
+#undef tmax_spdqid
+#undef pdqinib_table
+#undef apdqinib_table
+#undef pdqcb_table
+#undef tmax_mtxid
+#undef tmax_smtxid
+#undef mtxinib_table
+#undef amtxinib_table
+#undef mtxcb_table
+#undef tmax_mpfid
+#undef tmax_smpfid
+#undef mpfinib_table
+#undef ampfinib_table
+#undef mpfcb_table
+#undef tmax_cycid
+#undef tmax_scycid
+#undef cycinib_table
+#undef acycinib_table
+#undef acyc_nfyinfo_table
+#undef cyccb_table
+#undef tmax_almid
+#undef tmax_salmid
+#undef alminib_table
+#undef aalminib_table
+#undef aalm_nfyinfo_table
+#undef almcb_table
+#undef tnum_isr_queue
+#undef isr_queue_list
+#undef isr_queue_table
+#undef tmax_isrid
+#undef tmax_sisrid
+#undef isrinib_table
+#undef aisrinib_table
+#undef isrcb_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
+#undef kmmsz
+#undef kmm
+
+
+#ifdef TOPPERS_LABEL_ASM
+
+/*
+ *  startup.c
+ */
+#undef _kerflg
+#undef _exit_kernel
+#undef _initialize_kmm
+#undef _kernel_malloc
+#undef _kernel_free
+
+/*
+ *  task.c
+ */
+#undef _p_runtsk
+#undef _p_schedtsk
+#undef _enadsp
+#undef _dspflg
+#undef _ready_queue
+#undef _ready_primap
+#undef _free_tcb
+#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 _free_semcb
+#undef _initialize_semaphore
+
+/*
+ *  eventflag.c
+ */
+#undef _free_flgcb
+#undef _initialize_eventflag
+#undef _check_flg_cond
+
+/*
+ *  dataqueue.c
+ */
+#undef _free_dtqcb
+#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 _free_pdqcb
+#undef _initialize_pridataq
+#undef _enqueue_pridata
+#undef _dequeue_pridata
+#undef _send_pridata
+#undef _receive_pridata
+
+/*
+ *  mutex.c
+ */
+#undef _free_mtxcb
+#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 _free_mpfcb
+#undef _initialize_mempfix
+#undef _get_mpf_block
+
+/*
+ *  time_manage.c
+ */
+#undef _check_nfyinfo
+#undef _notify_handler
+
+/*
+ *  cyclic.c
+ */
+#undef _free_cyccb
+#undef _initialize_cyclic
+#undef _call_cyclic
+
+/*
+ *  alarm.c
+ */
+#undef _free_almcb
+#undef _initialize_alarm
+#undef _call_alarm
+
+/*
+ *  interrupt.c
+ */
+#undef _free_isrcb
+#undef _initialize_isr
+#undef _call_isr
+#undef _initialize_interrupt
+
+/*
+ *  exception.c
+ */
+#undef _initialize_exception
+
+/*
+ *  kernel_cfg.c
+ */
+#undef _initialize_object
+#undef _call_inirtn
+#undef _call_terrtn
+#undef _tmax_tskid
+#undef _tmax_stskid
+#undef _tinib_table
+#undef _atinib_table
+#undef _torder_table
+#undef _tcb_table
+#undef _tmax_semid
+#undef _tmax_ssemid
+#undef _seminib_table
+#undef _aseminib_table
+#undef _semcb_table
+#undef _tmax_flgid
+#undef _tmax_sflgid
+#undef _flginib_table
+#undef _aflginib_table
+#undef _flgcb_table
+#undef _tmax_dtqid
+#undef _tmax_sdtqid
+#undef _dtqinib_table
+#undef _adtqinib_table
+#undef _dtqcb_table
+#undef _tmax_pdqid
+#undef _tmax_spdqid
+#undef _pdqinib_table
+#undef _apdqinib_table
+#undef _pdqcb_table
+#undef _tmax_mtxid
+#undef _tmax_smtxid
+#undef _mtxinib_table
+#undef _amtxinib_table
+#undef _mtxcb_table
+#undef _tmax_mpfid
+#undef _tmax_smpfid
+#undef _mpfinib_table
+#undef _ampfinib_table
+#undef _mpfcb_table
+#undef _tmax_cycid
+#undef _tmax_scycid
+#undef _cycinib_table
+#undef _acycinib_table
+#undef _acyc_nfyinfo_table
+#undef _cyccb_table
+#undef _tmax_almid
+#undef _tmax_salmid
+#undef _alminib_table
+#undef _aalminib_table
+#undef _aalm_nfyinfo_table
+#undef _almcb_table
+#undef _tnum_isr_queue
+#undef _isr_queue_list
+#undef _isr_queue_table
+#undef _tmax_isrid
+#undef _tmax_sisrid
+#undef _isrinib_table
+#undef _aisrinib_table
+#undef _isrcb_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
+#undef _kmmsz
+#undef _kmm
+
+
+#endif /* TOPPERS_LABEL_ASM */
+
+#include "target_unrename.h"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/mempfix.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/mempfix.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/mempfix.c	(revision 302)
@@ -0,0 +1,610 @@
+/*
+ *  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: mempfix.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		åºå®é·ã¡ã¢ãªãã¼ã«æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "mempfix.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ACRE_MPF_ENTER
+#define LOG_ACRE_MPF_ENTER(pk_cmpf)
+#endif /* LOG_ACRE_MPF_ENTER */
+
+#ifndef LOG_ACRE_MPF_LEAVE
+#define LOG_ACRE_MPF_LEAVE(ercd)
+#endif /* LOG_ACRE_MPF_LEAVE */
+
+#ifndef LOG_DEL_MPF_ENTER
+#define LOG_DEL_MPF_ENTER(mpfid)
+#endif /* LOG_DEL_MPF_ENTER */
+
+#ifndef LOG_DEL_MPF_LEAVE
+#define LOG_DEL_MPF_LEAVE(ercd)
+#endif /* LOG_DEL_MPF_LEAVE */
+
+#ifndef LOG_GET_MPF_ENTER
+#define LOG_GET_MPF_ENTER(mpfid, p_blk)
+#endif /* LOG_GET_MPF_ENTER */
+
+#ifndef LOG_GET_MPF_LEAVE
+#define LOG_GET_MPF_LEAVE(ercd, p_blk)
+#endif /* LOG_GET_MPF_LEAVE */
+
+#ifndef LOG_PGET_MPF_ENTER
+#define LOG_PGET_MPF_ENTER(mpfid, p_blk)
+#endif /* LOG_PGET_MPF_ENTER */
+
+#ifndef LOG_PGET_MPF_LEAVE
+#define LOG_PGET_MPF_LEAVE(ercd, p_blk)
+#endif /* LOG_PGET_MPF_LEAVE */
+
+#ifndef LOG_TGET_MPF_ENTER
+#define LOG_TGET_MPF_ENTER(mpfid, p_blk, tmout)
+#endif /* LOG_TGET_MPF_ENTER */
+
+#ifndef LOG_TGET_MPF_LEAVE
+#define LOG_TGET_MPF_LEAVE(ercd, p_blk)
+#endif /* LOG_TGET_MPF_LEAVE */
+
+#ifndef LOG_REL_MPF_ENTER
+#define LOG_REL_MPF_ENTER(mpfid, blk)
+#endif /* LOG_REL_MPF_ENTER */
+
+#ifndef LOG_REL_MPF_LEAVE
+#define LOG_REL_MPF_LEAVE(ercd)
+#endif /* LOG_REL_MPF_LEAVE */
+
+#ifndef LOG_INI_MPF_ENTER
+#define LOG_INI_MPF_ENTER(mpfid)
+#endif /* LOG_INI_MPF_ENTER */
+
+#ifndef LOG_INI_MPF_LEAVE
+#define LOG_INI_MPF_LEAVE(ercd)
+#endif /* LOG_INI_MPF_LEAVE */
+
+#ifndef LOG_REF_MPF_ENTER
+#define LOG_REF_MPF_ENTER(mpfid, pk_rmpf)
+#endif /* LOG_REF_MPF_ENTER */
+
+#ifndef LOG_REF_MPF_LEAVE
+#define LOG_REF_MPF_LEAVE(ercd, pk_rmpf)
+#endif /* LOG_REF_MPF_LEAVE */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ã®æ°
+ */
+#define tnum_mpf	((uint_t)(tmax_mpfid - TMIN_MPFID + 1))
+#define tnum_smpf	((uint_t)(tmax_smpfid - TMIN_MPFID + 1))
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«IDããåºå®é·ã¡ã¢ãªãã¼ã«ç®¡çãã­ãã¯ãåãåºãã
+ *  ãã®ãã¯ã­
+ */
+#define INDEX_MPF(mpfid)	((uint_t)((mpfid) - TMIN_MPFID))
+#define get_mpfcb(mpfid)	(&(mpfcb_table[INDEX_MPF(mpfid)]))
+
+/*
+ *  ç¹æ®ãªã¤ã³ããã¯ã¹å¤ã®å®ç¾©
+ */
+#define INDEX_NULL		(~0U)		/* ç©ºããã­ãã¯ãªã¹ãã®æå¾ */
+#define INDEX_ALLOC		(~1U)		/* å²å½ã¦æ¸ã¿ã®ãã­ãã¯ */
+
+#ifdef TOPPERS_mpfini
+
+/*
+ *  ä½¿ç¨ãã¦ããªãåºå®é·ã¡ã¢ãªãã¼ã«ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+QUEUE	free_mpfcb;
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«æ©è½ã®åæå
+ */
+void
+initialize_mempfix(void)
+{
+	uint_t	i, j;
+	MPFCB	*p_mpfcb;
+	MPFINIB	*p_mpfinib;
+
+	for (i = 0; i < tnum_smpf; i++) {
+		p_mpfcb = &(mpfcb_table[i]);
+		queue_initialize(&(p_mpfcb->wait_queue));
+		p_mpfcb->p_mpfinib = &(mpfinib_table[i]);
+		p_mpfcb->fblkcnt = p_mpfcb->p_mpfinib->blkcnt;
+		p_mpfcb->unused = 0U;
+		p_mpfcb->freelist = INDEX_NULL;
+	}
+	queue_initialize(&free_mpfcb);
+	for (j = 0; i < tnum_mpf; i++, j++) {
+		p_mpfcb = &(mpfcb_table[i]);
+		p_mpfinib = &(ampfinib_table[j]);
+		p_mpfinib->mpfatr = TA_NOEXS;
+		p_mpfcb->p_mpfinib = ((const MPFINIB *) p_mpfinib);
+		queue_insert_prev(&free_mpfcb, &(p_mpfcb->wait_queue));
+	}
+}
+
+#endif /* TOPPERS_mpfini */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ãããã­ãã¯ãç²å¾
+ */
+#ifdef TOPPERS_mpfget
+
+void
+get_mpf_block(MPFCB *p_mpfcb, void **p_blk)
+{
+	uint_t	blkidx;
+
+	if (p_mpfcb->freelist != INDEX_NULL) {
+		blkidx = p_mpfcb->freelist;
+		p_mpfcb->freelist = (p_mpfcb->p_mpfinib->p_mpfmb + blkidx)->next;
+	}
+	else {
+		blkidx = p_mpfcb->unused;
+		p_mpfcb->unused++;
+	}
+	*p_blk = (void *)((char *)(p_mpfcb->p_mpfinib->mpf)
+								+ p_mpfcb->p_mpfinib->blksz * blkidx);
+	p_mpfcb->fblkcnt--;
+	(p_mpfcb->p_mpfinib->p_mpfmb + blkidx)->next = INDEX_ALLOC;
+}
+
+#endif /* TOPPERS_mpfget */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ã®çæ
+ */
+#ifdef TOPPERS_acre_mpf
+
+ER_UINT
+acre_mpf(const T_CMPF *pk_cmpf)
+{
+	MPFCB	*p_mpfcb;
+	MPFINIB	*p_mpfinib;
+	ATR		mpfatr;
+	void	*mpf;
+	MPFMB	*p_mpfmb;
+	ER		ercd;
+
+	LOG_ACRE_MPF_ENTER(pk_cmpf);
+	CHECK_TSKCTX_UNL();
+	CHECK_RSATR(pk_cmpf->mpfatr, TA_TPRI);
+	CHECK_PAR(pk_cmpf->blkcnt != 0);
+	CHECK_PAR(pk_cmpf->blksz != 0);
+	if (pk_cmpf->mpf != NULL) {
+		CHECK_PAR(MPF_ALIGN(pk_cmpf->mpf));
+	}
+	if (pk_cmpf->mpfmb != NULL) {
+		CHECK_PAR(MB_ALIGN(pk_cmpf->mpfmb));
+	}
+	mpfatr = pk_cmpf->mpfatr;
+	mpf = pk_cmpf->mpf;
+	p_mpfmb = pk_cmpf->mpfmb;
+
+	lock_cpu();
+	if (tnum_mpf == 0 || queue_empty(&free_mpfcb)) {
+		ercd = E_NOID;
+	}
+	else {
+		if (mpf == NULL) {
+			mpf = kernel_malloc(ROUND_MPF_T(pk_cmpf->blksz) * pk_cmpf->blkcnt);
+			mpfatr |= TA_MEMALLOC;
+		}
+		if (mpf == NULL) {
+			ercd = E_NOMEM;
+		}
+		else {
+			if (p_mpfmb == NULL) {
+				p_mpfmb = kernel_malloc(sizeof(MPFMB) * pk_cmpf->blkcnt);
+				mpfatr |= TA_MBALLOC;
+			}
+			if (p_mpfmb == NULL) {
+				if (pk_cmpf->mpf == NULL) {
+					kernel_free(mpf);
+				}
+				ercd = E_NOMEM;
+			}
+			else {
+				p_mpfcb = ((MPFCB *) queue_delete_next(&free_mpfcb));
+				p_mpfinib = (MPFINIB *)(p_mpfcb->p_mpfinib);
+				p_mpfinib->mpfatr = mpfatr;
+				p_mpfinib->blkcnt = pk_cmpf->blkcnt;
+				p_mpfinib->blksz = ROUND_MPF_T(pk_cmpf->blksz);
+				p_mpfinib->mpf = mpf;
+				p_mpfinib->p_mpfmb = p_mpfmb;
+
+				queue_initialize(&(p_mpfcb->wait_queue));
+				p_mpfcb->fblkcnt = p_mpfcb->p_mpfinib->blkcnt;
+				p_mpfcb->unused = 0U;
+				p_mpfcb->freelist = INDEX_NULL;
+				ercd = MPFID(p_mpfcb);
+			}
+		}
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ACRE_MPF_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_acre_mpf */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ã®åé¤
+ */
+#ifdef TOPPERS_del_mpf
+
+ER
+del_mpf(ID mpfid)
+{
+	MPFCB	*p_mpfcb;
+	MPFINIB	*p_mpfinib;
+	ER		ercd;
+
+	LOG_DEL_MPF_ENTER(mpfid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MPFID(mpfid));
+	p_mpfcb = get_mpfcb(mpfid);
+
+	lock_cpu();
+	if (p_mpfcb->p_mpfinib->mpfatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (mpfid <= tmax_smpfid) {
+		ercd = E_OBJ;
+	}
+	else {
+		init_wait_queue(&(p_mpfcb->wait_queue));
+		p_mpfinib = (MPFINIB *)(p_mpfcb->p_mpfinib);
+		if ((p_mpfinib->mpfatr & TA_MEMALLOC) != 0U) {
+			kernel_free(p_mpfinib->mpf);
+		}
+		if ((p_mpfinib->mpfatr & TA_MBALLOC) != 0U) {
+			kernel_free(p_mpfinib->p_mpfmb);
+		}
+		p_mpfinib->mpfatr = TA_NOEXS;
+		queue_insert_prev(&free_mpfcb, &(p_mpfcb->wait_queue));
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_DEL_MPF_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_del_mpf */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾
+ */
+#ifdef TOPPERS_get_mpf
+
+ER
+get_mpf(ID mpfid, void **p_blk)
+{
+	MPFCB	*p_mpfcb;
+	WINFO_MPF winfo_mpf;
+	ER		ercd;
+
+	LOG_GET_MPF_ENTER(mpfid, p_blk);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_MPFID(mpfid));
+	p_mpfcb = get_mpfcb(mpfid);
+
+	lock_cpu_dsp();
+	if (p_mpfcb->p_mpfinib->mpfatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_mpfcb->fblkcnt > 0) {
+		get_mpf_block(p_mpfcb, p_blk);
+		ercd = E_OK;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_MPF;
+		wobj_make_wait((WOBJCB *) p_mpfcb, (WINFO_WOBJ *) &winfo_mpf);
+		dispatch();
+		ercd = winfo_mpf.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_blk = winfo_mpf.blk;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_GET_MPF_LEAVE(ercd, p_blk);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_mpf */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_pget_mpf
+
+ER
+pget_mpf(ID mpfid, void **p_blk)
+{
+	MPFCB	*p_mpfcb;
+	ER		ercd;
+
+	LOG_PGET_MPF_ENTER(mpfid, p_blk);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MPFID(mpfid));
+	p_mpfcb = get_mpfcb(mpfid);
+
+	lock_cpu();
+	if (p_mpfcb->p_mpfinib->mpfatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_mpfcb->fblkcnt > 0) {
+		get_mpf_block(p_mpfcb, p_blk);
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PGET_MPF_LEAVE(ercd, p_blk);
+	return(ercd);
+}
+
+#endif /* TOPPERS_pget_mpf */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_tget_mpf
+
+ER
+tget_mpf(ID mpfid, void **p_blk, TMO tmout)
+{
+	MPFCB	*p_mpfcb;
+	WINFO_MPF winfo_mpf;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TGET_MPF_ENTER(mpfid, p_blk, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_MPFID(mpfid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_mpfcb = get_mpfcb(mpfid);
+
+	lock_cpu_dsp();
+	if (p_mpfcb->p_mpfinib->mpfatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_mpfcb->fblkcnt > 0) {
+		get_mpf_block(p_mpfcb, p_blk);
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_MPF;
+		wobj_make_wait_tmout((WOBJCB *) p_mpfcb, (WINFO_WOBJ *) &winfo_mpf,
+														&tmevtb, tmout);
+		dispatch();
+		ercd = winfo_mpf.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_blk = winfo_mpf.blk;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TGET_MPF_LEAVE(ercd, p_blk);
+	return(ercd);
+}
+
+#endif /* TOPPERS_tget_mpf */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã­ãã¯ã®è¿å´
+ */
+#ifdef TOPPERS_rel_mpf
+
+ER
+rel_mpf(ID mpfid, void *blk)
+{
+	MPFCB	*p_mpfcb;
+	size_t	blkoffset;
+	uint_t	blkidx;
+	TCB		*p_tcb;
+	ER		ercd;
+    
+	LOG_REL_MPF_ENTER(mpfid, blk);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MPFID(mpfid));
+	p_mpfcb = get_mpfcb(mpfid);
+
+	lock_cpu();
+	if (p_mpfcb->p_mpfinib->mpfatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		blkoffset = ((char *) blk) - (char *)(p_mpfcb->p_mpfinib->mpf);
+		blkidx = (uint_t)(blkoffset / p_mpfcb->p_mpfinib->blksz);
+		if (!(p_mpfcb->p_mpfinib->mpf <= blk)
+				|| !(blkoffset % p_mpfcb->p_mpfinib->blksz == 0U)
+				|| !(blkoffset / p_mpfcb->p_mpfinib->blksz < p_mpfcb->unused)
+				|| !((p_mpfcb->p_mpfinib->p_mpfmb + blkidx)->next
+															== INDEX_ALLOC)) {
+			ercd = E_PAR;
+		}
+		else if (!queue_empty(&(p_mpfcb->wait_queue))) {
+			p_tcb = (TCB *) queue_delete_next(&(p_mpfcb->wait_queue));
+			((WINFO_MPF *)(p_tcb->p_winfo))->blk = blk;
+			wait_complete(p_tcb);
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}
+			ercd = E_OK;
+		}
+		else {
+			p_mpfcb->fblkcnt++;
+			(p_mpfcb->p_mpfinib->p_mpfmb + blkidx)->next = p_mpfcb->freelist;
+			p_mpfcb->freelist = blkidx;
+			ercd = E_OK;
+		}
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REL_MPF_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rel_mpf */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ã®ååæå
+ */
+#ifdef TOPPERS_ini_mpf
+
+ER
+ini_mpf(ID mpfid)
+{
+	MPFCB	*p_mpfcb;
+	ER		ercd;
+    
+	LOG_INI_MPF_ENTER(mpfid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MPFID(mpfid));
+	p_mpfcb = get_mpfcb(mpfid);
+
+	lock_cpu();
+	if (p_mpfcb->p_mpfinib->mpfatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		init_wait_queue(&(p_mpfcb->wait_queue));
+		p_mpfcb->fblkcnt = p_mpfcb->p_mpfinib->blkcnt;
+		p_mpfcb->unused = 0U;
+		p_mpfcb->freelist = INDEX_NULL;
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_INI_MPF_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ini_mpf */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_mpf
+
+ER
+ref_mpf(ID mpfid, T_RMPF *pk_rmpf)
+{
+	MPFCB	*p_mpfcb;
+	ER		ercd;
+    
+	LOG_REF_MPF_ENTER(mpfid, pk_rmpf);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MPFID(mpfid));
+	p_mpfcb = get_mpfcb(mpfid);
+
+	lock_cpu();
+	if (p_mpfcb->p_mpfinib->mpfatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		pk_rmpf->wtskid = wait_tskid(&(p_mpfcb->wait_queue));
+		pk_rmpf->fblkcnt = p_mpfcb->fblkcnt;
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_MPF_LEAVE(ercd, pk_rmpf);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_mpf */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/mempfix.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/mempfix.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/mempfix.h	(revision 302)
@@ -0,0 +1,178 @@
+/*
+ *  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: mempfix.h 200 2014-09-05 19:18:00Z ertl-hiro $
+ */
+
+/*
+ *		åºå®é·ã¡ã¢ãªãã¼ã«æ©è½
+ */
+
+#ifndef TOPPERS_MEMPFIX_H
+#define TOPPERS_MEMPFIX_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "wait.h"
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã­ãã¯ç®¡çãã­ãã¯
+ *
+ *  nextãã£ã¼ã«ãã«ã¯ï¼ã¡ã¢ãªãã­ãã¯ãå²å½ã¦æ¸ã¿ã®å ´åã¯INDEX_ALLOCãï¼
+ *  æªå²å½ã¦ã®å ´åã¯æ¬¡ã®æªå²å½ã¦ãã­ãã¯ã®ã¤ã³ããã¯ã¹çªå·ãæ ¼ç´ããï¼
+ *  æå¾ã®æªå²å½ã¦ãã­ãã¯ã®å ´åã«ã¯ï¼INDEX_NULLãæ ¼ç´ããï¼
+ */
+typedef struct fixed_memoryblock_management_block {
+	uint_t		next;			/* æ¬¡ã®æªå²å½ã¦ãã­ãã¯ */
+} MPFMB;
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«åæåãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WOBJINIBï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct fixed_memorypool_initialization_block {
+	ATR			mpfatr;			/* åºå®é·ã¡ã¢ãªãã¼ã«å±æ§ */
+	uint_t		blkcnt;			/* ã¡ã¢ãªãã­ãã¯æ° */
+	uint_t		blksz;			/* ã¡ã¢ãªãã­ãã¯ã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
+	void		*mpf;			/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®å
+é ­çªå° */
+	MPFMB		*p_mpfmb;		/* åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çé åã®å
+é ­çªå° */
+} MPFINIB;
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼
+ *  ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼æåã®2ã¤ã®
+ *  ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct fixed_memorypool_control_block {
+	QUEUE		wait_queue;		/* åºå®é·ã¡ã¢ãªãã¼ã«å¾
+ã¡ã­ã¥ã¼ */
+	const MPFINIB *p_mpfinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	uint_t		fblkcnt;		/* æªå²å½ã¦ãã­ãã¯æ° */
+	uint_t		unused;			/* æªä½¿ç¨ãã­ãã¯ã®å
+é ­ */
+	uint_t		freelist;		/* æªå²å½ã¦ãã­ãã¯ã®ãªã¹ã */
+} MPFCB;
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«å¾
+ã¡æ
+å ±ãã­ãã¯ã®å®ç¾©
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WINFO_WOBJï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®2ã¤ã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct fixed_memorypool_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	MPFCB		*p_mpfcb;		/* å¾
+ã£ã¦ããåºå®é·ã¡ã¢ãªãã¼ã«ã®ç®¡çãã­ãã¯*/
+	void		*blk;			/* ç²å¾ããã¡ã¢ãªãã­ãã¯ */
+} WINFO_MPF;
+
+/*
+ *  ä½¿ç¨ãã¦ããªãåºå®é·ã¡ã¢ãªãã¼ã«ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+extern QUEUE	free_mpfcb;
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_mpfid;
+extern const ID	tmax_smpfid;
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const MPFINIB	mpfinib_table[];
+extern MPFINIB			ampfinib_table[];
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern MPFCB	mpfcb_table[];
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çãã­ãã¯ããåºå®é·ã¡ã¢ãªãã¼ã«IDãåãåºãã
+ *  ãã®ãã¯ã­
+ */
+#define	MPFID(p_mpfcb)	((ID)(((p_mpfcb) - mpfcb_table) + TMIN_MPFID))
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«æ©è½ã®åæå
+ */
+extern void	initialize_mempfix(void);
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ãããã­ãã¯ãç²å¾
+ */
+extern void	get_mpf_block(MPFCB *p_mpfcb, void **p_blk);
+
+#endif /* TOPPERS_MEMPFIX_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/mempfix.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/mempfix.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/mempfix.tf	(revision 302)
@@ -0,0 +1,203 @@
+$
+$   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 $
+$ 
+
+$
+$		åºå®é·ã¡ã¢ãªãã¼ã«æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  AID_MPFã®å¦ç
+$
+$num_ampfid = 0$
+$FOREACH i AMPF.ORDER_LIST$
+$	// nompfãè² ã®å ´åï¼E_PARï¼
+	$IF AMPF.NOMPF[i] < 0$
+		$ERROR AMPF.TEXT_LINE[i]$E_PAR:$SPC$
+			$FORMAT(_("illegal %1% `%2%\' in %3%"),
+									"nompf", AMPF.NOMPF[i], "AID_MPF")$
+		$END$
+	$END$
+	$num_ampfid = num_ampfid + AMPF.NOMPF[i]$
+$END$
+$num_mpfid = LENGTH(MPF.ID_LIST) + num_ampfid$
+
+$
+$  kernel_cfg.hã®çæ
+$
+$FILE "kernel_cfg.h.new"$
+
+#define TNUM_MPFID	$num_mpfid$$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$
+
+$
+$  éçã«çæãããåºå®é·ã¡ã¢ãªãã¼ã«ã®æ°
+$
+#define TNUM_SMPFID	$LENGTH(MPF.ID_LIST)$$NL$
+$NL$
+
+$
+$  åºå®é·ã¡ã¢ãªãã¼ã«IDçªå·ã®æå¤§å¤
+$
+const ID _kernel_tmax_mpfid = (TMIN_MPFID + TNUM_MPFID - 1);$NL$
+const ID _kernel_tmax_smpfid = (TMIN_MPFID + TNUM_SMPFID - 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_SMPFID] = {$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 num_ampfid > 0$
+	MPFINIB _kernel_ampfinib_table[$num_ampfid$];$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(MPFINIB, _kernel_ampfinib_table);$NL$
+$END$$NL$
+
+$
+$  åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çãã­ãã¯ã¨åºå®é·ã¡ã¢ãªãã¼ã«æ©è½åæåé¢æ°
+$
+$IF num_mpfid > 0$
+	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/extension/dcre/kernel/mutex.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/mutex.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/mutex.c	(revision 302)
@@ -0,0 +1,789 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: mutex.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		ãã¥ã¼ããã¯ã¹æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "taskhook.h"
+#include "wait.h"
+#include "mutex.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ACRE_MTX_ENTER
+#define LOG_ACRE_MTX_ENTER(pk_cmtx)
+#endif /* LOG_ACRE_MTX_ENTER */
+
+#ifndef LOG_ACRE_MTX_LEAVE
+#define LOG_ACRE_MTX_LEAVE(ercd)
+#endif /* LOG_ACRE_MTX_LEAVE */
+
+#ifndef LOG_DEL_MTX_ENTER
+#define LOG_DEL_MTX_ENTER(mtxid)
+#endif /* LOG_DEL_MTX_ENTER */
+
+#ifndef LOG_DEL_MTX_LEAVE
+#define LOG_DEL_MTX_LEAVE(ercd)
+#endif /* LOG_DEL_MTX_LEAVE */
+
+#ifndef LOG_LOC_MTX_ENTER
+#define LOG_LOC_MTX_ENTER(mtxid)
+#endif /* LOG_LOC_MTX_ENTER */
+
+#ifndef LOG_LOC_MTX_LEAVE
+#define LOG_LOC_MTX_LEAVE(ercd)
+#endif /* LOG_LOC_MTX_LEAVE */
+
+#ifndef LOG_PLOC_MTX_ENTER
+#define LOG_PLOC_MTX_ENTER(mtxid)
+#endif /* LOG_PLOC_MTX_ENTER */
+
+#ifndef LOG_PLOC_MTX_LEAVE
+#define LOG_PLOC_MTX_LEAVE(ercd)
+#endif /* LOG_PLOC_MTX_LEAVE */
+
+#ifndef LOG_TLOC_MTX_ENTER
+#define LOG_TLOC_MTX_ENTER(mtxid, tmout)
+#endif /* LOG_TLOC_MTX_ENTER */
+
+#ifndef LOG_TLOC_MTX_LEAVE
+#define LOG_TLOC_MTX_LEAVE(ercd)
+#endif /* LOG_TLOC_MTX_LEAVE */
+
+#ifndef LOG_UNL_MTX_ENTER
+#define LOG_UNL_MTX_ENTER(mtxid)
+#endif /* LOG_UNL_MTX_ENTER */
+
+#ifndef LOG_UNL_MTX_LEAVE
+#define LOG_UNL_MTX_LEAVE(ercd)
+#endif /* LOG_UNL_MTX_LEAVE */
+
+#ifndef LOG_INI_MTX_ENTER
+#define LOG_INI_MTX_ENTER(mtxid)
+#endif /* LOG_INI_MTX_ENTER */
+
+#ifndef LOG_INI_MTX_LEAVE
+#define LOG_INI_MTX_LEAVE(ercd)
+#endif /* LOG_INI_MTX_LEAVE */
+
+#ifndef LOG_REF_MTX_ENTER
+#define LOG_REF_MTX_ENTER(mtxid, pk_rmtx)
+#endif /* LOG_REF_MTX_ENTER */
+
+#ifndef LOG_REF_MTX_LEAVE
+#define LOG_REF_MTX_LEAVE(ercd, pk_rmtx)
+#endif /* LOG_REF_MTX_LEAVE */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®æ°
+ */
+#define tnum_mtx	((uint_t)(tmax_mtxid - TMIN_MTXID + 1))
+#define tnum_smtx	((uint_t)(tmax_smtxid - TMIN_MTXID + 1))
+
+/*
+ *  ãã¥ã¼ããã¯ã¹IDãããã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_MTX(mtxid)	((uint_t)((mtxid) - TMIN_MTXID))
+#define get_mtxcb(mtxid)	(&(mtxcb_table[INDEX_MTX(mtxid)]))
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ãã­ãã³ã«ãå¤æ­ãããã¯ã­
+ */
+#define MTXPROTO_MASK			0x03U
+#define MTXPROTO(p_mtxcb)		((p_mtxcb)->p_mtxinib->mtxatr & MTXPROTO_MASK)
+#define MTX_CEILING(p_mtxcb)	(MTXPROTO(p_mtxcb) == TA_CEILING)
+
+#ifdef TOPPERS_mtxini
+
+/*
+ *  ä½¿ç¨ãã¦ããªããã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+QUEUE	free_mtxcb;
+
+/* 
+ *  ãã¥ã¼ããã¯ã¹æ©è½ã®åæå
+ */
+void
+initialize_mutex(void)
+{
+	uint_t	i, j;
+	MTXCB	*p_mtxcb;
+	MTXINIB	*p_mtxinib;
+
+	mtxhook_check_ceilpri = mutex_check_ceilpri;
+	mtxhook_scan_ceilmtx = mutex_scan_ceilmtx;
+	mtxhook_release_all = mutex_release_all;
+
+	for (i = 0; i < tnum_smtx; i++) {
+		p_mtxcb = &(mtxcb_table[i]);
+		queue_initialize(&(p_mtxcb->wait_queue));
+		p_mtxcb->p_mtxinib = &(mtxinib_table[i]);
+		p_mtxcb->p_loctsk = NULL;
+	}
+	queue_initialize(&free_mtxcb);
+	for (j = 0; i < tnum_mtx; i++, j++) {
+		p_mtxcb = &(mtxcb_table[i]);
+		p_mtxinib = &(amtxinib_table[j]);
+		p_mtxinib->mtxatr = TA_NOEXS;
+		p_mtxcb->p_mtxinib = ((const MTXINIB *) p_mtxinib);
+		queue_insert_prev(&free_mtxcb, &(p_mtxcb->wait_queue));
+	}
+}
+
+#endif /* TOPPERS_mtxini */
+
+/* 
+ *  ä¸éåªå
+åº¦éåã®ãã§ãã¯
+ */
+#ifdef TOPPERS_mtxchk
+
+bool_t
+mutex_check_ceilpri(TCB *p_tcb, uint_t bpriority)
+{
+	MTXCB	*p_mtxcb;
+
+	/*
+	 *  ã¿ã¹ã¯ãã­ãã¯ãã¦ããåªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã®ä¸­ã§ï¼ä¸éåªå
+
+	 *  åº¦ãbpriorityãããä½ããã®ãããã°ï¼falseãè¿ãï¼
+	 */
+	p_mtxcb = p_tcb->p_lastmtx;
+	while (p_mtxcb != NULL) {
+		if (MTX_CEILING(p_mtxcb) && bpriority < p_mtxcb->p_mtxinib->ceilpri) {
+			return(false);
+		}
+		p_mtxcb = p_mtxcb->p_prevmtx;
+	}
+
+	/*
+	 *  ã¿ã¹ã¯ãåªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã®ã­ãã¯ãå¾
+ã£ã¦ããå ´åã«ï¼ã
+	 *  ã®ä¸éåªå
+åº¦ãbpriorityãããä½ãããã°ï¼falseãè¿ãï¼
+	 */
+	if (TSTAT_WAIT_MTX(p_tcb->tstat)) {
+		p_mtxcb = ((WINFO_MTX *)(p_tcb->p_winfo))->p_mtxcb;
+		if (MTX_CEILING(p_mtxcb) && bpriority < p_mtxcb->p_mtxinib->ceilpri) {
+			return(false);
+		}
+	}
+
+	/*
+	 *  ãããã®æ¡ä»¶ã«ãå½ã¦ã¯ã¾ããªããã°trueãè¿ãï¼
+	 */
+	return(true);
+}
+
+#endif /* TOPPERS_mtxchk */
+
+/* 
+ *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ãããã®ãã§ãã¯
+ */
+#ifdef TOPPERS_mtxscan
+
+bool_t
+mutex_scan_ceilmtx(TCB *p_tcb)
+{
+	MTXCB	*p_mtxcb;
+
+	p_mtxcb = p_tcb->p_lastmtx;
+	while (p_mtxcb != NULL) {
+		if (MTX_CEILING(p_mtxcb)) {
+			return(true);
+		}
+		p_mtxcb = p_mtxcb->p_prevmtx;
+	}
+	return(false);
+}
+
+#endif /* TOPPERS_mtxscan */
+
+/* 
+ *  ã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ã®è¨ç®
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ï¼ã«è¨­å®ãã¹ãå¤ï¼ãè¨ç®ããï¼
+ */
+Inline uint_t
+mutex_calc_priority(TCB *p_tcb)
+{
+	uint_t	priority;
+	MTXCB	*p_mtxcb;
+
+	priority = p_tcb->bpriority;
+	p_mtxcb = p_tcb->p_lastmtx;
+	while (p_mtxcb != NULL) {
+		if (MTX_CEILING(p_mtxcb) && p_mtxcb->p_mtxinib->ceilpri < priority) {
+			priority = p_mtxcb->p_mtxinib->ceilpri;
+		}
+		p_mtxcb = p_mtxcb->p_prevmtx;
+	}
+	return(priority);
+}
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ãè§£æ¾ããå ´åã®ç¾å¨åªå
+åº¦å¤æ´å¦ç
+ */
+#ifdef TOPPERS_mtxdrop
+
+void
+mutex_drop_priority(TCB *p_tcb, MTXCB *p_mtxcb)
+{
+	uint_t	newpri;
+
+	if (MTX_CEILING(p_mtxcb)
+					&& p_mtxcb->p_mtxinib->ceilpri == p_tcb->priority) {
+		newpri = mutex_calc_priority(p_tcb);
+		if (newpri != p_tcb->priority) {
+			change_priority(p_tcb, newpri, true);
+		}
+	}
+}
+
+#endif /* TOPPERS_mtxdrop */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯
+ */
+#ifdef TOPPERS_mtxacq
+
+void
+mutex_acquire(TCB *p_tcb, MTXCB *p_mtxcb)
+{
+	p_mtxcb->p_loctsk = p_tcb;
+	p_mtxcb->p_prevmtx = p_tcb->p_lastmtx;
+	p_tcb->p_lastmtx = p_mtxcb;
+	if (MTX_CEILING(p_mtxcb)
+					&& p_mtxcb->p_mtxinib->ceilpri < p_tcb->priority) {
+		(void) change_priority(p_tcb, p_mtxcb->p_mtxinib->ceilpri, true);
+	}
+}
+
+#endif /* TOPPERS_mtxacq */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤
+ */
+#ifdef TOPPERS_mtxrel
+
+void
+mutex_release(MTXCB *p_mtxcb)
+{
+	TCB		*p_tcb;
+
+	if (queue_empty(&(p_mtxcb->wait_queue))) {
+		p_mtxcb->p_loctsk = NULL;
+	}
+	else {
+		/*
+		 *  ãã¥ã¼ããã¯ã¹å¾
+ã¡ã­ã¥ã¼ã®å
+é ­ã¿ã¹ã¯ï¼p_tcbï¼ã«ï¼ãã¥ã¼ãã
+		 *  ã¯ã¹ãã­ãã¯ãããï¼
+		 */
+		p_tcb = (TCB *) queue_delete_next(&(p_mtxcb->wait_queue));
+		wait_dequeue_tmevtb(p_tcb);
+		p_tcb->p_winfo->wercd = E_OK;
+
+		p_mtxcb->p_loctsk = p_tcb;
+		p_mtxcb->p_prevmtx = p_tcb->p_lastmtx;
+		p_tcb->p_lastmtx = p_mtxcb;
+		if (MTX_CEILING(p_mtxcb)) {
+			if (p_mtxcb->p_mtxinib->ceilpri < p_tcb->priority) {
+				p_tcb->priority = p_mtxcb->p_mtxinib->ceilpri;
+			}
+		}
+		make_non_wait(p_tcb);
+	}
+}
+
+#endif /* TOPPERS_mtxrel */
+
+/*
+ *  ã¿ã¹ã¯ãã­ãã¯ãã¦ãããã¹ã¦ã®ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤
+ */
+#ifdef TOPPERS_mtxrela
+
+void
+mutex_release_all(TCB *p_tcb)
+{
+	MTXCB	*p_mtxcb;
+
+	while ((p_mtxcb = p_tcb->p_lastmtx) != NULL) {
+		p_tcb->p_lastmtx = p_mtxcb->p_prevmtx;
+		mutex_release(p_mtxcb);
+	}
+}
+
+#endif /* TOPPERS_mtxrela */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®çæï¼»NGKI2022ï¼½
+ */
+#ifdef TOPPERS_acre_mtx
+
+ER_UINT
+acre_mtx(const T_CMTX *pk_cmtx)
+{
+	MTXCB	*p_mtxcb;
+	MTXINIB	*p_mtxinib;
+	ER		ercd;
+
+	LOG_ACRE_MTX_ENTER(pk_cmtx);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI2023ï¼½ï¼»NGKI2024ï¼½*/
+	if (pk_cmtx->mtxatr == TA_CEILING) {
+		CHECK_PAR(VALID_TPRI(pk_cmtx->ceilpri));	/*ï¼»NGKI2037ï¼½*/
+	}
+	else {
+		CHECK_RSATR(pk_cmtx->mtxatr, TA_TPRI);	/*ï¼»NGKI2025ï¼½*/
+	}
+
+	lock_cpu();
+	if (tnum_mtx == 0 || queue_empty(&free_mtxcb)) {
+		ercd = E_NOID;							/*ï¼»NGKI2031ï¼½*/
+	}
+	else {
+		p_mtxcb = ((MTXCB *) queue_delete_next(&free_mtxcb));
+		p_mtxinib = (MTXINIB *)(p_mtxcb->p_mtxinib);
+		p_mtxinib->mtxatr = pk_cmtx->mtxatr;
+		p_mtxinib->ceilpri = INT_PRIORITY(pk_cmtx->ceilpri);
+
+		queue_initialize(&(p_mtxcb->wait_queue));
+		p_mtxcb->p_loctsk = NULL;				/*ï¼»NGKI2033ï¼½*/
+		ercd = MTXID(p_mtxcb);
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ACRE_MTX_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_acre_mtx */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®åé¤ï¼»NGKI2056ï¼½
+ */
+#ifdef TOPPERS_del_mtx
+
+ER
+del_mtx(ID mtxid)
+{
+	MTXCB	*p_mtxcb, **pp_prevmtx;
+	MTXINIB	*p_mtxinib;
+	TCB		*p_loctsk;
+	ER		ercd;
+
+	LOG_DEL_MTX_ENTER(mtxid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI2057ï¼½ï¼»NGKI2058ï¼½*/
+	CHECK_ID(VALID_MTXID(mtxid));				/*ï¼»NGKI2059ï¼½*/
+	p_mtxcb = get_mtxcb(mtxid);
+
+	lock_cpu();
+	if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
+		ercd = E_NOEXS;							/*ï¼»NGKI2060ï¼½*/
+	}
+	else if (mtxid <= tmax_smtxid) {
+		ercd = E_OBJ;							/*ï¼»NGKI2062ï¼½*/
+	}
+	else {
+		init_wait_queue(&(p_mtxcb->wait_queue));	/*ï¼»NGKI2065ï¼½*/
+		p_loctsk = p_mtxcb->p_loctsk;
+		if (p_loctsk != NULL) {
+			/*
+			 *  p_loctskãã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ã®ãªã¹ãããå¯¾è±¡
+			 *  ãã¥ã¼ã¯ã¹ãåé¤ãï¼å¿
+è¦ãªå ´åã«ã¯p_loctskã®ç¾å¨åªå
+åº¦
+			 *  ãå¤æ´ããï¼»NGKI2064ï¼½ï¼
+			 */
+			pp_prevmtx = &(p_loctsk->p_lastmtx);
+			while (*pp_prevmtx != NULL) {
+				if (*pp_prevmtx == p_mtxcb) {
+					*pp_prevmtx = p_mtxcb->p_prevmtx;
+					break;
+				}
+				pp_prevmtx = &((*pp_prevmtx)->p_prevmtx);
+			}
+			mutex_drop_priority(p_loctsk, p_mtxcb);
+		}
+		p_mtxinib = (MTXINIB *)(p_mtxcb->p_mtxinib);
+		p_mtxinib->mtxatr = TA_NOEXS;						/*ï¼»NGKI2063ï¼½*/
+		queue_insert_prev(&free_mtxcb, &(p_mtxcb->wait_queue));
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_DEL_MTX_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_del_mtx */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯
+ */
+#ifdef TOPPERS_loc_mtx
+
+ER
+loc_mtx(ID mtxid)
+{
+	MTXCB	*p_mtxcb;
+	WINFO_MTX winfo_mtx;
+	ER		ercd;
+
+	LOG_LOC_MTX_ENTER(mtxid);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_MTXID(mtxid));
+	p_mtxcb = get_mtxcb(mtxid);
+
+	lock_cpu_dsp();
+	if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (MTX_CEILING(p_mtxcb)
+				&& p_runtsk->bpriority < p_mtxcb->p_mtxinib->ceilpri) {
+		ercd = E_ILUSE;
+	}
+	else if (p_mtxcb->p_loctsk == NULL) {
+		mutex_acquire(p_runtsk, p_mtxcb);
+		/*
+		 *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ããå ´åï¼p_runtskã®åªå
+åº¦
+		 *  ãä¸ããå¯è½æ§ããããï¼ãã£ã¹ããããå¿
+è¦ã«ãªããã¨ã¯ãªãï¼
+		 */
+		assert(p_runtsk == p_schedtsk);
+		ercd = E_OK;
+	}
+	else if (p_mtxcb->p_loctsk == p_runtsk) {
+		ercd = E_OBJ;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_MTX;
+		wobj_make_wait((WOBJCB *) p_mtxcb, (WINFO_WOBJ *) &winfo_mtx);
+		dispatch();
+		ercd = winfo_mtx.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_LOC_MTX_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_loc_mtx */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_ploc_mtx
+
+ER
+ploc_mtx(ID mtxid)
+{
+	MTXCB	*p_mtxcb;
+	ER		ercd;
+
+	LOG_PLOC_MTX_ENTER(mtxid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MTXID(mtxid));
+	p_mtxcb = get_mtxcb(mtxid);
+
+	lock_cpu();
+	if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (MTX_CEILING(p_mtxcb)
+				&& p_runtsk->bpriority < p_mtxcb->p_mtxinib->ceilpri) {
+		ercd = E_ILUSE;
+	}
+	else if (p_mtxcb->p_loctsk == NULL) {
+		mutex_acquire(p_runtsk, p_mtxcb);
+		/*
+		 *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ããå ´åï¼p_runtskã®åªå
+åº¦
+		 *  ãä¸ããå¯è½æ§ããããï¼ãã£ã¹ããããå¿
+è¦ã«ãªããã¨ã¯ãªãï¼
+		 */
+		assert(p_runtsk == p_schedtsk);
+		ercd = E_OK;
+	}
+	else if (p_mtxcb->p_loctsk == p_runtsk) {
+		ercd = E_OBJ;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PLOC_MTX_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ploc_mtx */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_tloc_mtx
+
+ER
+tloc_mtx(ID mtxid, TMO tmout)
+{
+	MTXCB	*p_mtxcb;
+	WINFO_MTX winfo_mtx;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TLOC_MTX_ENTER(mtxid, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_MTXID(mtxid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_mtxcb = get_mtxcb(mtxid);
+
+	lock_cpu_dsp();
+	if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (MTX_CEILING(p_mtxcb)
+				&& p_runtsk->bpriority < p_mtxcb->p_mtxinib->ceilpri) {
+		ercd = E_ILUSE;
+	}
+	else if (p_mtxcb->p_loctsk == NULL) {
+		mutex_acquire(p_runtsk, p_mtxcb);
+		/*
+		 *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ããå ´åï¼p_runtskã®åªå
+åº¦
+		 *  ãä¸ããå¯è½æ§ããããï¼ãã£ã¹ããããå¿
+è¦ã«ãªããã¨ã¯ãªãï¼
+		 */
+		assert(p_runtsk == p_schedtsk);
+		ercd = E_OK;
+	}
+	else if (p_mtxcb->p_loctsk == p_runtsk) {
+		ercd = E_OBJ;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_MTX;
+		wobj_make_wait_tmout((WOBJCB *) p_mtxcb, (WINFO_WOBJ *) &winfo_mtx,
+														&tmevtb, tmout);
+		dispatch();
+		ercd = winfo_mtx.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TLOC_MTX_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_tloc_mtx */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤
+ */
+#ifdef TOPPERS_unl_mtx
+
+ER
+unl_mtx(ID mtxid)
+{
+	MTXCB	*p_mtxcb;
+	ER		ercd;
+    
+	LOG_UNL_MTX_ENTER(mtxid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MTXID(mtxid));
+	p_mtxcb = get_mtxcb(mtxid);
+
+	lock_cpu();
+	if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_mtxcb != p_runtsk->p_lastmtx) {
+		ercd = E_OBJ;
+	}
+	else {
+		p_runtsk->p_lastmtx = p_mtxcb->p_prevmtx;
+		mutex_drop_priority(p_runtsk, p_mtxcb);
+		mutex_release(p_mtxcb);
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_UNL_MTX_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_unl_mtx */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ååæå
+ */
+#ifdef TOPPERS_ini_mtx
+
+ER
+ini_mtx(ID mtxid)
+{
+	MTXCB	*p_mtxcb, **pp_prevmtx;
+	TCB		*p_loctsk;
+	ER		ercd;
+    
+	LOG_INI_MTX_ENTER(mtxid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MTXID(mtxid));
+	p_mtxcb = get_mtxcb(mtxid);
+
+	lock_cpu();
+	if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		init_wait_queue(&(p_mtxcb->wait_queue));
+		p_loctsk = p_mtxcb->p_loctsk;
+		if (p_loctsk != NULL) {
+			p_mtxcb->p_loctsk = NULL;
+			pp_prevmtx = &(p_loctsk->p_lastmtx);
+			while (*pp_prevmtx != NULL) {
+				if (*pp_prevmtx == p_mtxcb) {
+					*pp_prevmtx = p_mtxcb->p_prevmtx;
+					break;
+				}
+				pp_prevmtx = &((*pp_prevmtx)->p_prevmtx);
+			}
+			mutex_drop_priority(p_loctsk, p_mtxcb);
+		}
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_INI_MTX_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ini_mtx */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_mtx
+
+ER
+ref_mtx(ID mtxid, T_RMTX *pk_rmtx)
+{
+	MTXCB	*p_mtxcb;
+	ER		ercd;
+    
+	LOG_REF_MTX_ENTER(mtxid, pk_rmtx);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MTXID(mtxid));
+	p_mtxcb = get_mtxcb(mtxid);
+
+	lock_cpu();
+	if (p_mtxcb->p_mtxinib->mtxatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		pk_rmtx->htskid = (p_mtxcb->p_loctsk != NULL) ? TSKID(p_mtxcb->p_loctsk)
+														: TSK_NONE;
+		pk_rmtx->wtskid = wait_tskid(&(p_mtxcb->wait_queue));
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_MTX_LEAVE(ercd, pk_rmtx);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_mtx */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/mutex.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/mutex.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/mutex.h	(revision 302)
@@ -0,0 +1,229 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: mutex.h 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *		ãã¥ã¼ããã¯ã¹æ©è½
+ */
+
+#ifndef TOPPERS_MUTEX_H
+#define TOPPERS_MUTEX_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "wait.h"
+
+/*
+ *  ãã¥ã¼ããã¯ã¹åæåãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WOBJINIBï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct mutex_initialization_block {
+	ATR			mtxatr;			/* ãã¥ã¼ããã¯ã¹å±æ§ */
+	uint_t		ceilpri;		/* ãã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+} MTXINIB;
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼
+ *  ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼æåã®2ã¤ã®
+ *  ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+struct mutex_control_block {
+	QUEUE		wait_queue;		/* ãã¥ã¼ããã¯ã¹å¾
+ã¡ã­ã¥ã¼ */
+	const MTXINIB *p_mtxinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	TCB			*p_loctsk;		/* ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã¿ã¹ã¯ */
+	MTXCB		*p_prevmtx;		/* ãã®åã«ã­ãã¯ãããã¥ã¼ããã¯ã¹ */
+};
+
+/*
+ *  ãã¥ã¼ããã¯ã¹å¾
+ã¡æ
+å ±ãã­ãã¯ã®å®ç¾©
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WINFO_WOBJï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  ãã¹ã¦ã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct mutex_waiting_information {
+	WINFO	winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	MTXCB	*p_mtxcb;		/* å¾
+ã£ã¦ãããã¥ã¼ããã¯ã¹ã®ç®¡çãã­ãã¯ */
+} WINFO_MTX;
+
+/*
+ *  ä½¿ç¨ãã¦ããªããã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+extern QUEUE	free_mtxcb;
+
+/*
+ *  ãã¥ã¼ããã¯ã¹IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_mtxid;
+extern const ID	tmax_smtxid;
+
+/*
+ *  ãã¥ã¼ããã¯ã¹åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const MTXINIB	mtxinib_table[];
+extern MTXINIB			amtxinib_table[];
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern MTXCB	mtxcb_table[];
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ãããã¥ã¼ããã¯ã¹IDãåãåºãããã®ãã¯ã­
+ */
+#define	MTXID(p_mtxcb)	((ID)(((p_mtxcb) - mtxcb_table) + TMIN_MTXID))
+
+/*
+ *  ãã¥ã¼ããã¯ã¹æ©è½ã®åæå
+ */
+extern void	initialize_mutex(void);
+
+/*
+ *  ä¸éåªå
+åº¦éåã®ãã§ãã¯
+ *
+ *  chg_priã®ä¸­ã§ä¸éåªå
+åº¦éåã®ãã§ãã¯ãè¡ãããã«ç¨ããé¢æ°ã§ããï¼
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã­ãã¯ãã¦ããåªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã¨ï¼
+ *  ã­ãã¯ãå¾
+ã£ã¦ããåªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã®ä¸­ã§ï¼ä¸éåªå
+åº¦ã
+ *  bpriorityãããä½ããã®ãããã°falseãï¼ããã§ãªããã°trueãè¿ãï¼
+ */
+extern bool_t	mutex_check_ceilpri(TCB *p_tcb, uint_t bpriority);
+
+/* 
+ *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ãããã®ãã§ãã¯
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãåªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã°
+ *  trueï¼ããã§ãªããã°falseãè¿ãï¼
+ */
+extern bool_t	mutex_scan_ceilmtx(TCB *p_tcb);
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ãã­ãã¯è§£é¤ããå ´åã®ç¾å¨åªå
+åº¦å¤æ´å¦ç
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãï¼p_mtxcbã§æå®ããããã¥ã¼ããã¯ã¹ãã­ã
+ *  ã¯è§£é¤ããéã®ç¾å¨åªå
+åº¦å¤æ´å¦çãè¡ãï¼
+ */
+extern void	mutex_drop_priority(TCB *p_tcb, MTXCB *p_mtxcb);
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã«ï¼p_mtxcbã§æå®ããããã¥ã¼ããã¯ã¹ãã­ã
+ *  ã¯ãããï¼
+ */
+extern void	mutex_acquire(TCB *p_tcb, MTXCB *p_mtxcb);
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤
+ *
+ *  p_mtxcbã§æå®ããããã¥ã¼ããã¯ã¹ãã­ãã¯è§£é¤ããï¼ã­ãã¯è§£é¤ãã
+ *  ãã¥ã¼ããã¯ã¹ã«ï¼ã­ãã¯å¾
+ã¡ç¶æ
+ã®ã¿ã¹ã¯ãããå ´åã«ã¯ï¼ãã®ã¿ã¹ã¯
+ *  ã«ãã¥ã¼ããã¯ã¹ãã­ãã¯ãããï¼
+ */
+extern void	mutex_release(MTXCB *p_mtxcb);
+
+/*
+ *  ã¿ã¹ã¯ãã­ãã¯ãã¦ãããã¹ã¦ã®ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã«ï¼ãããã­ãã¯ãã¦ãããã¹ã¦ã®ãã¥ã¼ããã¯
+ *  ã¹ãã­ãã¯è§£é¤ãããï¼ã­ãã¯è§£é¤ãããã¥ã¼ããã¯ã¹ã«ï¼ã­ãã¯å¾
+ã¡ç¶
+ *  æ
+ã®ã¿ã¹ã¯ãããå ´åã«ã¯ï¼ãã®ã¿ã¹ã¯ã«ãã¥ã¼ããã¯ã¹ãã­ãã¯ãããï¼
+ *
+ *  ãã®é¢æ°ã¯ï¼ã¿ã¹ã¯ã®çµäºæã«ä½¿ããããã®ã§ããããï¼p_tcbã§æå®ãã
+ *  ãã¿ã¹ã¯ã®åªå
+åº¦ãå¤æ´ããå¦çã¯è¡ããªãï¼ãã ãï¼ãã®é¢æ°ã®ä¸­ã§ä»
+ *  ã®ã¿ã¹ã¯ã®åªå
+åº¦ãå¤åãï¼å®è¡ãã¹ãã¿ã¹ã¯ãå¤ãããã¨ãããï¼ãã®
+ *  ããï¼ãã®é¢æ°ããæ»ã£ãå¾ã«ï¼ãã£ã¹ããããå¿
+è¦ãå¤å¥ãã¦ï¼å¿
+è¦ãª
+ *  å ´åã«ã¯ãã£ã¹ããããè¡ããªããã°ãªããªãï¼
+ */
+extern void	mutex_release_all(TCB *p_tcb);
+
+#endif /* TOPPERS_MUTEX_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/mutex.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/mutex.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/mutex.tf	(revision 302)
@@ -0,0 +1,180 @@
+$
+$   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 $
+$ 
+
+$
+$		ãã¥ã¼ããã¯ã¹æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  AID_MTXã®å¦ç
+$
+$num_amtxid = 0$
+$FOREACH i AMTX.ORDER_LIST$
+$	// nomtxãè² ã®å ´åï¼E_PARï¼
+	$IF AMTX.NOMTX[i] < 0$
+		$ERROR AMTX.TEXT_LINE[i]$E_PAR:$SPC$
+			$FORMAT(_("illegal %1% `%2%\' in %3%"),
+									"nomtx", AMTX.NOMTX[i], "AID_MTX")$
+		$END$
+	$END$
+	$num_amtxid = num_amtxid + AMTX.NOMTX[i]$
+$END$
+$num_mtxid = LENGTH(MTX.ID_LIST) + num_amtxid$
+
+$
+$  kernel_cfg.hã®çæ
+$
+$FILE "kernel_cfg.h.new"$
+
+#define TNUM_MTXID	$num_mtxid$$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$
+
+$
+$  éçã«çæããããã¥ã¼ããã¯ã¹ã®æ°
+$
+#define TNUM_SMTXID	$LENGTH(MTX.ID_LIST)$$NL$
+$NL$
+
+$
+$  ãã¥ã¼ããã¯ã¹IDçªå·ã®æå¤§å¤
+$
+const ID _kernel_tmax_mtxid = (TMIN_MTXID + TNUM_MTXID - 1);$NL$
+const ID _kernel_tmax_smtxid = (TMIN_MTXID + TNUM_SMTXID - 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_SMTXID] = {$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 num_amtxid > 0$
+	MTXINIB _kernel_amtxinib_table[$num_amtxid$];$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(MTXINIB, _kernel_amtxinib_table);$NL$
+$END$$NL$
+
+$
+$  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ã¨ãã¥ã¼ããã¯ã¹æ©è½åæåé¢æ°
+$
+$IF num_mtxid > 0$
+	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/extension/dcre/kernel/pridataq.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/pridataq.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/pridataq.c	(revision 302)
@@ -0,0 +1,832 @@
+/*
+ *  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: pridataq.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "pridataq.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ACRE_PDQ_ENTER
+#define LOG_ACRE_PDQ_ENTER(pk_cpdq)
+#endif /* LOG_ACRE_PDQ_ENTER */
+
+#ifndef LOG_ACRE_PDQ_LEAVE
+#define LOG_ACRE_PDQ_LEAVE(ercd)
+#endif /* LOG_ACRE_PDQ_LEAVE */
+
+#ifndef LOG_DEL_PDQ_ENTER
+#define LOG_DEL_PDQ_ENTER(pdqid)
+#endif /* LOG_DEL_PDQ_ENTER */
+
+#ifndef LOG_DEL_PDQ_LEAVE
+#define LOG_DEL_PDQ_LEAVE(ercd)
+#endif /* LOG_DEL_PDQ_LEAVE */
+
+#ifndef LOG_SND_PDQ_ENTER
+#define LOG_SND_PDQ_ENTER(pdqid, data, datapri)
+#endif /* LOG_SND_PDQ_ENTER */
+
+#ifndef LOG_SND_PDQ_LEAVE
+#define LOG_SND_PDQ_LEAVE(ercd)
+#endif /* LOG_SND_PDQ_LEAVE */
+
+#ifndef LOG_PSND_PDQ_ENTER
+#define LOG_PSND_PDQ_ENTER(pdqid, data, datapri)
+#endif /* LOG_PSND_PDQ_ENTER */
+
+#ifndef LOG_PSND_PDQ_LEAVE
+#define LOG_PSND_PDQ_LEAVE(ercd)
+#endif /* LOG_PSND_PDQ_LEAVE */
+
+#ifndef LOG_TSND_PDQ_ENTER
+#define LOG_TSND_PDQ_ENTER(pdqid, data, datapri, tmout)
+#endif /* LOG_TSND_PDQ_ENTER */
+
+#ifndef LOG_TSND_PDQ_LEAVE
+#define LOG_TSND_PDQ_LEAVE(ercd)
+#endif /* LOG_TSND_PDQ_LEAVE */
+
+#ifndef LOG_RCV_PDQ_ENTER
+#define LOG_RCV_PDQ_ENTER(pdqid, p_data, p_datapri)
+#endif /* LOG_RCV_PDQ_ENTER */
+
+#ifndef LOG_RCV_PDQ_LEAVE
+#define LOG_RCV_PDQ_LEAVE(ercd, p_data, p_datapri)
+#endif /* LOG_RCV_PDQ_LEAVE */
+
+#ifndef LOG_PRCV_PDQ_ENTER
+#define LOG_PRCV_PDQ_ENTER(pdqid, p_data, p_datapri)
+#endif /* LOG_PRCV_PDQ_ENTER */
+
+#ifndef LOG_PRCV_PDQ_LEAVE
+#define LOG_PRCV_PDQ_LEAVE(ercd, p_data, p_datapri)
+#endif /* LOG_PRCV_PDQ_LEAVE */
+
+#ifndef LOG_TRCV_PDQ_ENTER
+#define LOG_TRCV_PDQ_ENTER(pdqid, p_data, p_datapri, tmout)
+#endif /* LOG_TRCV_PDQ_ENTER */
+
+#ifndef LOG_TRCV_PDQ_LEAVE
+#define LOG_TRCV_PDQ_LEAVE(ercd, p_data, p_datapri)
+#endif /* LOG_TRCV_PDQ_LEAVE */
+
+#ifndef LOG_INI_PDQ_ENTER
+#define LOG_INI_PDQ_ENTER(pdqid)
+#endif /* LOG_INI_PDQ_ENTER */
+
+#ifndef LOG_INI_PDQ_LEAVE
+#define LOG_INI_PDQ_LEAVE(ercd)
+#endif /* LOG_INI_PDQ_LEAVE */
+
+#ifndef LOG_REF_PDQ_ENTER
+#define LOG_REF_PDQ_ENTER(pdqid, pk_rpdq)
+#endif /* LOG_REF_PDQ_ENTER */
+
+#ifndef LOG_REF_PDQ_LEAVE
+#define LOG_REF_PDQ_LEAVE(ercd, pk_rpdq)
+#endif /* LOG_REF_PDQ_LEAVE */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®æ°
+ */
+#define tnum_pdq	((uint_t)(tmax_pdqid - TMIN_PDQID + 1))
+#define tnum_spdq	((uint_t)(tmax_spdqid - TMIN_PDQID + 1))
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼IDããåªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ãåãåºãã
+ *  ãã®ãã¯ã­
+ */
+#define INDEX_PDQ(pdqid)	((uint_t)((pdqid) - TMIN_PDQID))
+#define get_pdqcb(pdqid)	(&(pdqcb_table[INDEX_PDQ(pdqid)]))
+
+#ifdef TOPPERS_pdqini
+
+/*
+ *  ä½¿ç¨ãã¦ããªãåªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+QUEUE	free_pdqcb;
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½ã®åæå
+ */
+void
+initialize_pridataq(void)
+{
+	uint_t	i, j;
+	PDQCB	*p_pdqcb;
+	PDQINIB	*p_pdqinib;
+
+	for (i = 0; i < tnum_spdq; i++) {
+		p_pdqcb = &(pdqcb_table[i]);
+		queue_initialize(&(p_pdqcb->swait_queue));
+		p_pdqcb->p_pdqinib = &(pdqinib_table[i]);
+		queue_initialize(&(p_pdqcb->rwait_queue));
+		p_pdqcb->count = 0U;
+		p_pdqcb->p_head = NULL;
+		p_pdqcb->unused = 0U;
+		p_pdqcb->p_freelist = NULL;
+	}
+	queue_initialize(&free_pdqcb);
+	for (j = 0; i < tnum_pdq; i++, j++) {
+		p_pdqcb = &(pdqcb_table[i]);
+		p_pdqinib = &(apdqinib_table[j]);
+		p_pdqinib->pdqatr = TA_NOEXS;
+		p_pdqcb->p_pdqinib = ((const PDQINIB *) p_pdqinib);
+		queue_insert_prev(&free_pdqcb, &(p_pdqcb->swait_queue));
+	}
+}
+
+#endif /* TOPPERS_pdqini */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã¸ã®ãã¼ã¿ã®æ ¼ç´
+ */
+#ifdef TOPPERS_pdqenq
+
+void
+enqueue_pridata(PDQCB *p_pdqcb, intptr_t data, PRI datapri)
+{
+	PDQMB	*p_pdqmb;
+	PDQMB	**pp_prev_next, *p_next;
+
+	if (p_pdqcb->p_freelist != NULL) {
+		p_pdqmb = p_pdqcb->p_freelist;
+		p_pdqcb->p_freelist = p_pdqmb->p_next;
+	}
+	else {
+		p_pdqmb = p_pdqcb->p_pdqinib->p_pdqmb + p_pdqcb->unused;
+		p_pdqcb->unused++;
+	}
+
+	p_pdqmb->data = data;
+	p_pdqmb->datapri = datapri;
+
+	pp_prev_next = &(p_pdqcb->p_head);
+	while ((p_next = *pp_prev_next) != NULL) {
+		if (p_next->datapri > datapri) {
+			break;
+		}
+		pp_prev_next = &(p_next->p_next);
+	}
+	p_pdqmb->p_next = p_next;
+	*pp_prev_next = p_pdqmb;
+	p_pdqcb->count++;
+}
+
+#endif /* TOPPERS_pdqenq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åããã®ãã¼ã¿ã®ååºã
+ */
+#ifdef TOPPERS_pdqdeq
+
+void
+dequeue_pridata(PDQCB *p_pdqcb, intptr_t *p_data, PRI *p_datapri)
+{
+	PDQMB	*p_pdqmb;
+
+	p_pdqmb = p_pdqcb->p_head;
+	p_pdqcb->p_head = p_pdqmb->p_next;
+	p_pdqcb->count--;
+
+	*p_data = p_pdqmb->data;
+	*p_datapri = p_pdqmb->datapri;
+
+	p_pdqmb->p_next = p_pdqcb->p_freelist;
+	p_pdqcb->p_freelist = p_pdqmb;
+}
+
+#endif /* TOPPERS_pdqdeq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®ãã¼ã¿éä¿¡
+ */
+#ifdef TOPPERS_pdqsnd
+
+bool_t
+send_pridata(PDQCB *p_pdqcb, intptr_t data, PRI datapri)
+{
+	TCB		*p_tcb;
+
+	if (!queue_empty(&(p_pdqcb->rwait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_pdqcb->rwait_queue));
+		((WINFO_RPDQ *)(p_tcb->p_winfo))->data = data;
+		((WINFO_RPDQ *)(p_tcb->p_winfo))->datapri = datapri;
+		wait_complete(p_tcb);
+		return(true);
+	}
+	else if (p_pdqcb->count < p_pdqcb->p_pdqinib->pdqcnt) {
+		enqueue_pridata(p_pdqcb, data, datapri);
+		return(true);
+	}
+	else {
+		return(false);
+	}
+}
+
+#endif /* TOPPERS_pdqsnd */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®ãã¼ã¿åä¿¡
+ */
+#ifdef TOPPERS_pdqrcv
+
+bool_t
+receive_pridata(PDQCB *p_pdqcb, intptr_t *p_data, PRI *p_datapri)
+{
+	TCB		*p_tcb;
+	intptr_t data;
+	PRI		datapri;
+
+	if (p_pdqcb->count > 0U) {
+		dequeue_pridata(p_pdqcb, p_data, p_datapri);
+		if (!queue_empty(&(p_pdqcb->swait_queue))) {
+			p_tcb = (TCB *) queue_delete_next(&(p_pdqcb->swait_queue));
+			data = ((WINFO_SPDQ *)(p_tcb->p_winfo))->data;
+			datapri = ((WINFO_SPDQ *)(p_tcb->p_winfo))->datapri;
+			enqueue_pridata(p_pdqcb, data, datapri);
+			wait_complete(p_tcb);
+		}
+		return(true);
+	}
+	else if (!queue_empty(&(p_pdqcb->swait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_pdqcb->swait_queue));
+		*p_data = ((WINFO_SPDQ *)(p_tcb->p_winfo))->data;
+		*p_datapri = ((WINFO_SPDQ *)(p_tcb->p_winfo))->datapri;
+		wait_complete(p_tcb);
+		return(true);
+	}
+	else {
+		return(false);
+	}
+}
+
+#endif /* TOPPERS_pdqrcv */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®çæ
+ */
+#ifdef TOPPERS_acre_pdq
+
+ER_UINT
+acre_pdq(const T_CPDQ *pk_cpdq)
+{
+	PDQCB	*p_pdqcb;
+	PDQINIB	*p_pdqinib;
+	ATR		pdqatr;
+	PDQMB	*p_pdqmb;
+	ER		ercd;
+
+	LOG_ACRE_PDQ_ENTER(pk_cpdq);
+	CHECK_TSKCTX_UNL();
+	CHECK_RSATR(pk_cpdq->pdqatr, TA_TPRI);
+	CHECK_PAR(VALID_DPRI(pk_cpdq->maxdpri));
+	pdqatr = pk_cpdq->pdqatr;
+	p_pdqmb = pk_cpdq->pdqmb;
+
+	lock_cpu();
+	if (tnum_pdq == 0 || queue_empty(&free_pdqcb)) {
+		ercd = E_NOID;
+	}
+	else {
+		if (pk_cpdq->pdqcnt != 0 && p_pdqmb == NULL) {
+			p_pdqmb = kernel_malloc(sizeof(PDQMB) * pk_cpdq->pdqcnt);
+			pdqatr |= TA_MBALLOC;
+		}
+		if (pk_cpdq->pdqcnt != 0 && p_pdqmb == NULL) {
+			ercd = E_NOMEM;
+		}
+		else {
+			p_pdqcb = ((PDQCB *) queue_delete_next(&free_pdqcb));
+			p_pdqinib = (PDQINIB *)(p_pdqcb->p_pdqinib);
+			p_pdqinib->pdqatr = pdqatr;
+			p_pdqinib->pdqcnt = pk_cpdq->pdqcnt;
+			p_pdqinib->maxdpri = pk_cpdq->maxdpri;
+			p_pdqinib->p_pdqmb = p_pdqmb;
+
+			queue_initialize(&(p_pdqcb->swait_queue));
+			queue_initialize(&(p_pdqcb->rwait_queue));
+			p_pdqcb->count = 0U;
+			p_pdqcb->p_head = NULL;
+			p_pdqcb->unused = 0U;
+			p_pdqcb->p_freelist = NULL;
+			ercd = PDQID(p_pdqcb);
+		}
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ACRE_PDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_acre_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®åé¤
+ */
+#ifdef TOPPERS_del_pdq
+
+ER
+del_pdq(ID pdqid)
+{
+	PDQCB	*p_pdqcb;
+	PDQINIB	*p_pdqinib;
+	ER		ercd;
+
+	LOG_DEL_PDQ_ENTER(pdqid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_PDQID(pdqid));
+	p_pdqcb = get_pdqcb(pdqid);
+
+	lock_cpu();
+	if (p_pdqcb->p_pdqinib->pdqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (pdqid <= tmax_spdqid) {
+		ercd = E_OBJ;
+	}
+	else {
+		init_wait_queue(&(p_pdqcb->swait_queue));
+		init_wait_queue(&(p_pdqcb->rwait_queue));
+		p_pdqinib = (PDQINIB *)(p_pdqcb->p_pdqinib);
+		if ((p_pdqinib->pdqatr & TA_MBALLOC) != 0U) {
+			kernel_free(p_pdqinib->p_pdqmb);
+		}
+		p_pdqinib->pdqatr = TA_NOEXS;
+		queue_insert_prev(&free_pdqcb, &(p_pdqcb->swait_queue));
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_DEL_PDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_del_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡
+ */
+#ifdef TOPPERS_snd_pdq
+
+ER
+snd_pdq(ID pdqid, intptr_t data, PRI datapri)
+{
+	PDQCB	*p_pdqcb;
+	WINFO_SPDQ winfo_spdq;
+	ER		ercd;
+
+	LOG_SND_PDQ_ENTER(pdqid, data, datapri);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_PDQID(pdqid));
+	p_pdqcb = get_pdqcb(pdqid);
+	CHECK_PAR(TMIN_DPRI <= datapri);
+
+	lock_cpu_dsp();
+	if (p_pdqcb->p_pdqinib->pdqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (datapri > p_pdqcb->p_pdqinib->maxdpri) {
+		ercd = E_PAR;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (send_pridata(p_pdqcb, data, datapri)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		winfo_spdq.data = data;
+		winfo_spdq.datapri = datapri;
+		p_runtsk->tstat = TS_WAITING_SPDQ;
+		wobj_make_wait((WOBJCB *) p_pdqcb, (WINFO_WOBJ *) &winfo_spdq);
+		dispatch();
+		ercd = winfo_spdq.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_SND_PDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_snd_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_psnd_pdq
+
+ER
+psnd_pdq(ID pdqid, intptr_t data, PRI datapri)
+{
+	PDQCB	*p_pdqcb;
+	ER		ercd;
+
+	LOG_PSND_PDQ_ENTER(pdqid, data, datapri);
+	CHECK_UNL();
+	CHECK_ID(VALID_PDQID(pdqid));
+	p_pdqcb = get_pdqcb(pdqid);
+	CHECK_PAR(TMIN_DPRI <= datapri);
+
+	lock_cpu();
+	if (p_pdqcb->p_pdqinib->pdqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (datapri > p_pdqcb->p_pdqinib->maxdpri) {
+		ercd = E_PAR;
+	}
+	else if (send_pridata(p_pdqcb, data, datapri)) {
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PSND_PDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_psnd_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_tsnd_pdq
+
+ER
+tsnd_pdq(ID pdqid, intptr_t data, PRI datapri, TMO tmout)
+{
+	PDQCB	*p_pdqcb;
+	WINFO_SPDQ winfo_spdq;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TSND_PDQ_ENTER(pdqid, data, datapri, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_PDQID(pdqid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_pdqcb = get_pdqcb(pdqid);
+	CHECK_PAR(TMIN_DPRI <= datapri);
+
+	lock_cpu_dsp();
+	if (p_pdqcb->p_pdqinib->pdqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (datapri > p_pdqcb->p_pdqinib->maxdpri) {
+		ercd = E_PAR;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (send_pridata(p_pdqcb, data, datapri)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		winfo_spdq.data = data;
+		winfo_spdq.datapri = datapri;
+		p_runtsk->tstat = TS_WAITING_SPDQ;
+		wobj_make_wait_tmout((WOBJCB *) p_pdqcb, (WINFO_WOBJ *) &winfo_spdq,
+														&tmevtb, tmout);
+		dispatch();
+		ercd = winfo_spdq.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TSND_PDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_tsnd_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡
+ */
+#ifdef TOPPERS_rcv_pdq
+
+ER
+rcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri)
+{
+	PDQCB	*p_pdqcb;
+	WINFO_RPDQ winfo_rpdq;
+	ER		ercd;
+
+	LOG_RCV_PDQ_ENTER(pdqid, p_data, p_datapri);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_PDQID(pdqid));
+	p_pdqcb = get_pdqcb(pdqid);
+
+	lock_cpu_dsp();
+	if (p_pdqcb->p_pdqinib->pdqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (receive_pridata(p_pdqcb, p_data, p_datapri)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_RPDQ;
+		make_wait(&(winfo_rpdq.winfo));
+		queue_insert_prev(&(p_pdqcb->rwait_queue), &(p_runtsk->task_queue));
+		winfo_rpdq.p_pdqcb = p_pdqcb;
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo_rpdq.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_data = winfo_rpdq.data;
+			*p_datapri = winfo_rpdq.datapri;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_RCV_PDQ_LEAVE(ercd, p_data, p_datapri);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rcv_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_prcv_pdq
+
+ER
+prcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri)
+{
+	PDQCB	*p_pdqcb;
+	ER		ercd;
+
+	LOG_PRCV_PDQ_ENTER(pdqid, p_data, p_datapri);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_PDQID(pdqid));
+	p_pdqcb = get_pdqcb(pdqid);
+
+	lock_cpu();
+	if (p_pdqcb->p_pdqinib->pdqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (receive_pridata(p_pdqcb, p_data, p_datapri)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PRCV_PDQ_LEAVE(ercd, p_data, p_datapri);
+	return(ercd);
+}
+
+#endif /* TOPPERS_prcv_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_trcv_pdq
+
+ER
+trcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri, TMO tmout)
+{
+	PDQCB	*p_pdqcb;
+	WINFO_RPDQ winfo_rpdq;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TRCV_PDQ_ENTER(pdqid, p_data, p_datapri, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_PDQID(pdqid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_pdqcb = get_pdqcb(pdqid);
+
+	lock_cpu_dsp();
+	if (p_pdqcb->p_pdqinib->pdqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (receive_pridata(p_pdqcb, p_data, p_datapri)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_RPDQ;
+		make_wait_tmout(&(winfo_rpdq.winfo), &tmevtb, tmout);
+		queue_insert_prev(&(p_pdqcb->rwait_queue), &(p_runtsk->task_queue));
+		winfo_rpdq.p_pdqcb = p_pdqcb;
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo_rpdq.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_data = winfo_rpdq.data;
+			*p_datapri = winfo_rpdq.datapri;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TRCV_PDQ_LEAVE(ercd, p_data, p_datapri);
+	return(ercd);
+}
+
+#endif /* TOPPERS_trcv_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®ååæå
+ */
+#ifdef TOPPERS_ini_pdq
+
+ER
+ini_pdq(ID pdqid)
+{
+	PDQCB	*p_pdqcb;
+	ER		ercd;
+    
+	LOG_INI_PDQ_ENTER(pdqid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_PDQID(pdqid));
+	p_pdqcb = get_pdqcb(pdqid);
+
+	lock_cpu();
+	if (p_pdqcb->p_pdqinib->pdqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		init_wait_queue(&(p_pdqcb->swait_queue));
+		init_wait_queue(&(p_pdqcb->rwait_queue));
+		p_pdqcb->count = 0U;
+		p_pdqcb->p_head = NULL;
+		p_pdqcb->unused = 0U;
+		p_pdqcb->p_freelist = NULL;
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_INI_PDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ini_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_pdq
+
+ER
+ref_pdq(ID pdqid, T_RPDQ *pk_rpdq)
+{
+	PDQCB	*p_pdqcb;
+	ER		ercd;
+    
+	LOG_REF_PDQ_ENTER(pdqid, pk_rpdq);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_PDQID(pdqid));
+	p_pdqcb = get_pdqcb(pdqid);
+
+	lock_cpu();
+	if (p_pdqcb->p_pdqinib->pdqatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		pk_rpdq->stskid = wait_tskid(&(p_pdqcb->swait_queue));
+		pk_rpdq->rtskid = wait_tskid(&(p_pdqcb->rwait_queue));
+		pk_rpdq->spdqcnt = p_pdqcb->count;
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_PDQ_LEAVE(ercd, pk_rpdq);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_pdq */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/pridataq.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/pridataq.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/pridataq.h	(revision 302)
@@ -0,0 +1,234 @@
+/*
+ *  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: pridataq.h 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½
+ */
+
+#ifndef TOPPERS_PRIDATAQ_H
+#define TOPPERS_PRIDATAQ_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "wait.h"
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ç®¡çãã­ãã¯
+ */
+typedef struct pridata_management_block PDQMB;
+
+struct pridata_management_block {
+	PDQMB		*p_next;		/* æ¬¡ã®ãã¼ã¿ */
+	intptr_t	data;			/* ãã¼ã¿æ¬ä½ */
+	PRI			datapri;		/* ãã¼ã¿åªå
+åº¦ */
+};
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WOBJINIBï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct pridataq_initialization_block {
+	ATR			pdqatr;			/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼å±æ§ */
+	uint_t		pdqcnt;			/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®å®¹é */
+	PRI			maxdpri;		/* ãã¼ã¿åªå
+åº¦ã®æå¤§å¤ */
+	PDQMB		*p_pdqmb;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã®å
+é ­çªå° */
+} PDQINIB;
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼
+ *  ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼æåã®2ã¤ã®
+ *  ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct pridataq_control_block {
+	QUEUE		swait_queue;	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼éä¿¡å¾
+ã¡ã­ã¥ã¼ */
+	const PDQINIB *p_pdqinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	QUEUE		rwait_queue;	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼åä¿¡å¾
+ã¡ã­ã¥ã¼ */
+	uint_t		count;			/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ä¸­ã®ãã¼ã¿ã®æ° */
+	PDQMB		*p_head;		/* æåã®ãã¼ã¿ */
+	uint_t		unused;			/* æªä½¿ç¨ãã¼ã¿ç®¡çãã­ãã¯ã®å
+é ­ */
+	PDQMB		*p_freelist;	/* æªå²å½ã¦ãã¼ã¿ç®¡çãã­ãã¯ã®ãªã¹ã */
+} PDQCB;
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼å¾
+ã¡æ
+å ±ãã­ãã¯ã®å®ç¾©
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WINFO_WOBJï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®2ã¤ã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct pridataq_send_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	PDQCB		*p_pdqcb;		/* å¾
+ã£ã¦ããåªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®ç®¡çãã­ãã¯*/
+	intptr_t	data;			/* éä¿¡ãã¼ã¿ */
+	PRI			datapri;		/* ãã¼ã¿åªå
+åº¦ */
+} WINFO_SPDQ;
+
+typedef struct pridataq_receive_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	PDQCB		*p_pdqcb;		/* å¾
+ã£ã¦ããåªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®ç®¡çãã­ãã¯*/
+	intptr_t	data;			/* åä¿¡ãã¼ã¿ */
+	PRI			datapri;		/* ãã¼ã¿åªå
+åº¦ */
+} WINFO_RPDQ;
+
+/*
+ *  ä½¿ç¨ãã¦ããªãåªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+extern QUEUE	free_pdqcb;
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_pdqid;
+extern const ID	tmax_spdqid;
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const PDQINIB	pdqinib_table[];
+extern PDQINIB			apdqinib_table[];
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern PDQCB	pdqcb_table[];
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ããåªå
+åº¦ãã¼ã¿ã­ã¥ã¼IDãåãåºãã
+ *  ãã®ãã¯ã­
+ */
+#define	PDQID(p_pdqcb)	((ID)(((p_pdqcb) - pdqcb_table) + TMIN_PDQID))
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½ã®åæå
+ */
+extern void	initialize_pridataq(void);
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã¸ã®ãã¼ã¿ã®æ ¼ç´
+ */
+extern void	enqueue_pridata(PDQCB *p_pdqcb, intptr_t data, PRI datapri);
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åããã®ãã¼ã¿ã®ååºã
+ */
+extern void	dequeue_pridata(PDQCB *p_pdqcb, intptr_t *p_data, PRI *p_datapri);
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®ãã¼ã¿éä¿¡
+ */
+extern bool_t	send_pridata(PDQCB *p_pdqcb, intptr_t data, PRI datapri);
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®ãã¼ã¿åä¿¡
+ */
+extern bool_t	receive_pridata(PDQCB *p_pdqcb, intptr_t *p_data,
+														PRI *p_datapri);
+
+#endif /* TOPPERS_PRIDATAQ_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/pridataq.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/pridataq.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/pridataq.tf	(revision 302)
@@ -0,0 +1,211 @@
+$
+$   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 $
+$ 
+
+$
+$		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  AID_PDQã®å¦ç
+$
+$num_apdqid = 0$
+$FOREACH i APDQ.ORDER_LIST$
+$	// nopdqãè² ã®å ´åï¼E_PARï¼
+	$IF APDQ.NOPDQ[i] < 0$
+		$ERROR APDQ.TEXT_LINE[i]$E_PAR:$SPC$
+			$FORMAT(_("illegal %1% `%2%\' in %3%"),
+									"nopdq", APDQ.NOPDQ[i], "AID_PDQ")$
+		$END$
+	$END$
+	$num_apdqid = num_apdqid + APDQ.NOPDQ[i]$
+$END$
+$num_pdqid = LENGTH(PDQ.ID_LIST) + num_apdqid$
+
+$
+$  kernel_cfg.hã®çæ
+$
+$FILE "kernel_cfg.h.new"$
+
+#define TNUM_PDQID	$num_pdqid$$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$
+
+$
+$  éçã«çæãããåªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®æ°
+$
+#define TNUM_SPDQID	$LENGTH(PDQ.ID_LIST)$$NL$
+$NL$
+
+$
+$  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼IDçªå·ã®æå¤§å¤
+$
+const ID _kernel_tmax_pdqid = (TMIN_PDQID + TNUM_PDQID - 1);$NL$
+const ID _kernel_tmax_spdqid = (TMIN_PDQID + TNUM_SPDQID - 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_SPDQID] = {$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 num_apdqid > 0$
+	PDQINIB _kernel_apdqinib_table[$num_apdqid$];$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(PDQINIB, _kernel_apdqinib_table);$NL$
+$END$$NL$
+
+$
+$  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ã¨åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½åæåé¢æ°
+$
+$IF num_pdqid > 0$
+	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/extension/dcre/kernel/semaphore.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/semaphore.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/semaphore.c	(revision 302)
@@ -0,0 +1,516 @@
+/*
+ *  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: semaphore.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		ã»ããã©æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "semaphore.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ACRE_SEM_ENTER
+#define LOG_ACRE_SEM_ENTER(pk_csem)
+#endif /* LOG_ACRE_SEM_ENTER */
+
+#ifndef LOG_ACRE_SEM_LEAVE
+#define LOG_ACRE_SEM_LEAVE(ercd)
+#endif /* LOG_ACRE_SEM_LEAVE */
+
+#ifndef LOG_DEL_SEM_ENTER
+#define LOG_DEL_SEM_ENTER(semid)
+#endif /* LOG_DEL_SEM_ENTER */
+
+#ifndef LOG_DEL_SEM_LEAVE
+#define LOG_DEL_SEM_LEAVE(ercd)
+#endif /* LOG_DEL_SEM_LEAVE */
+
+#ifndef LOG_SIG_SEM_ENTER
+#define LOG_SIG_SEM_ENTER(semid)
+#endif /* LOG_SIG_SEM_ENTER */
+
+#ifndef LOG_SIG_SEM_LEAVE
+#define LOG_SIG_SEM_LEAVE(ercd)
+#endif /* LOG_SIG_SEM_LEAVE */
+
+#ifndef LOG_WAI_SEM_ENTER
+#define LOG_WAI_SEM_ENTER(semid)
+#endif /* LOG_WAI_SEM_ENTER */
+
+#ifndef LOG_WAI_SEM_LEAVE
+#define LOG_WAI_SEM_LEAVE(ercd)
+#endif /* LOG_WAI_SEM_LEAVE */
+
+#ifndef LOG_POL_SEM_ENTER
+#define LOG_POL_SEM_ENTER(semid)
+#endif /* LOG_POL_SEM_ENTER */
+
+#ifndef LOG_POL_SEM_LEAVE
+#define LOG_POL_SEM_LEAVE(ercd)
+#endif /* LOG_POL_SEM_LEAVE */
+
+#ifndef LOG_TWAI_SEM_ENTER
+#define LOG_TWAI_SEM_ENTER(semid, tmout)
+#endif /* LOG_TWAI_SEM_ENTER */
+
+#ifndef LOG_TWAI_SEM_LEAVE
+#define LOG_TWAI_SEM_LEAVE(ercd)
+#endif /* LOG_TWAI_SEM_LEAVE */
+
+#ifndef LOG_INI_SEM_ENTER
+#define LOG_INI_SEM_ENTER(semid)
+#endif /* LOG_INI_SEM_ENTER */
+
+#ifndef LOG_INI_SEM_LEAVE
+#define LOG_INI_SEM_LEAVE(ercd)
+#endif /* LOG_INI_SEM_LEAVE */
+
+#ifndef LOG_REF_SEM_ENTER
+#define LOG_REF_SEM_ENTER(semid, pk_rsem)
+#endif /* LOG_REF_SEM_ENTER */
+
+#ifndef LOG_REF_SEM_LEAVE
+#define LOG_REF_SEM_LEAVE(ercd, pk_rsem)
+#endif /* LOG_REF_SEM_LEAVE */
+
+/*
+ *  ã»ããã©ã®æ°
+ */
+#define tnum_sem	((uint_t)(tmax_semid - TMIN_SEMID + 1))
+#define tnum_ssem	((uint_t)(tmax_ssemid - TMIN_SEMID + 1))
+
+/*
+ *  ã»ããã©IDããã»ããã©ç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_SEM(semid)	((uint_t)((semid) - TMIN_SEMID))
+#define get_semcb(semid)	(&(semcb_table[INDEX_SEM(semid)]))
+
+#ifdef TOPPERS_semini
+
+/*
+ *  ä½¿ç¨ãã¦ããªãã»ããã©ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+QUEUE	free_semcb;
+
+/* 
+ *  ã»ããã©æ©è½ã®åæå
+ */
+void
+initialize_semaphore(void)
+{
+	uint_t	i, j;
+	SEMCB	*p_semcb;
+	SEMINIB	*p_seminib;
+
+	for (i = 0; i < tnum_ssem; i++) {
+		p_semcb = &(semcb_table[i]);
+		queue_initialize(&(p_semcb->wait_queue));
+		p_semcb->p_seminib = &(seminib_table[i]);
+		p_semcb->semcnt = p_semcb->p_seminib->isemcnt;
+	}
+	queue_initialize(&free_semcb);
+	for (j = 0; i < tnum_sem; i++, j++) {
+		p_semcb = &(semcb_table[i]);
+		p_seminib = &(aseminib_table[j]);
+		p_seminib->sematr = TA_NOEXS;
+		p_semcb->p_seminib = ((const SEMINIB *) p_seminib);
+		queue_insert_prev(&free_semcb, &(p_semcb->wait_queue));
+	}
+}
+
+#endif /* TOPPERS_semini */
+
+/*
+ *  ã»ããã©ã®çæ
+ */
+#ifdef TOPPERS_acre_sem
+
+ER_UINT
+acre_sem(const T_CSEM *pk_csem)
+{
+	SEMCB	*p_semcb;
+	SEMINIB	*p_seminib;
+	ER		ercd;
+
+	LOG_ACRE_SEM_ENTER(pk_csem);
+	CHECK_TSKCTX_UNL();
+	CHECK_RSATR(pk_csem->sematr, TA_TPRI);
+	CHECK_PAR(0 <= pk_csem->isemcnt && pk_csem->isemcnt <= pk_csem->maxsem);
+	CHECK_PAR(1 <= pk_csem->maxsem && pk_csem->maxsem <= TMAX_MAXSEM);
+
+	lock_cpu();
+	if (tnum_sem == 0 || queue_empty(&free_semcb)) {
+		ercd = E_NOID;
+	}
+	else {
+		p_semcb = ((SEMCB *) queue_delete_next(&free_semcb));
+		p_seminib = (SEMINIB *)(p_semcb->p_seminib);
+		p_seminib->sematr = pk_csem->sematr;
+		p_seminib->isemcnt = pk_csem->isemcnt;
+		p_seminib->maxsem = pk_csem->maxsem;
+
+		queue_initialize(&(p_semcb->wait_queue));
+		p_semcb->semcnt = p_semcb->p_seminib->isemcnt;
+		ercd = SEMID(p_semcb);
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ACRE_SEM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_acre_sem */
+
+/*
+ *  ã»ããã©ã®åé¤
+ */
+#ifdef TOPPERS_del_sem
+
+ER
+del_sem(ID semid)
+{
+	SEMCB	*p_semcb;
+	SEMINIB	*p_seminib;
+	ER		ercd;
+
+	LOG_DEL_SEM_ENTER(semid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_SEMID(semid));
+	p_semcb = get_semcb(semid);
+
+	lock_cpu();
+	if (p_semcb->p_seminib->sematr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (semid <= tmax_ssemid) {
+		ercd = E_OBJ;
+	}
+	else {
+		init_wait_queue(&(p_semcb->wait_queue));
+		p_seminib = (SEMINIB *)(p_semcb->p_seminib);
+		p_seminib->sematr = TA_NOEXS;
+		queue_insert_prev(&free_semcb, &(p_semcb->wait_queue));
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_DEL_SEM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_del_sem */
+
+/*
+ *  ã»ããã©è³æºã®è¿å´
+ */
+#ifdef TOPPERS_sig_sem
+
+ER
+sig_sem(ID semid)
+{
+	SEMCB	*p_semcb;
+	TCB		*p_tcb;
+	ER		ercd;
+    
+	LOG_SIG_SEM_ENTER(semid);
+	CHECK_UNL();
+	CHECK_ID(VALID_SEMID(semid));
+	p_semcb = get_semcb(semid);
+
+	lock_cpu();
+	if (p_semcb->p_seminib->sematr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (!queue_empty(&(p_semcb->wait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_semcb->wait_queue));
+		wait_complete(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	else if (p_semcb->semcnt < p_semcb->p_seminib->maxsem) {
+		p_semcb->semcnt += 1;
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_QOVR;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_SIG_SEM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_sig_sem */
+
+/*
+ *  ã»ããã©è³æºã®ç²å¾
+ */
+#ifdef TOPPERS_wai_sem
+
+ER
+wai_sem(ID semid)
+{
+	SEMCB	*p_semcb;
+	WINFO_SEM winfo_sem;
+	ER		ercd;
+
+	LOG_WAI_SEM_ENTER(semid);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_SEMID(semid));
+	p_semcb = get_semcb(semid);
+
+	lock_cpu_dsp();
+	if (p_semcb->p_seminib->sematr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_semcb->semcnt >= 1) {
+		p_semcb->semcnt -= 1;
+		ercd = E_OK;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_SEM;
+		wobj_make_wait((WOBJCB *) p_semcb, (WINFO_WOBJ *) &winfo_sem);
+		dispatch();
+		ercd = winfo_sem.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_WAI_SEM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_wai_sem */
+
+/*
+ *  ã»ããã©è³æºã®ç²å¾ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_pol_sem
+
+ER
+pol_sem(ID semid)
+{
+	SEMCB	*p_semcb;
+	ER		ercd;
+
+	LOG_POL_SEM_ENTER(semid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_SEMID(semid));
+	p_semcb = get_semcb(semid);
+
+	lock_cpu();
+	if (p_semcb->p_seminib->sematr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_semcb->semcnt >= 1) {
+		p_semcb->semcnt -= 1;
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_POL_SEM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_pol_sem */
+
+/*
+ *  ã»ããã©è³æºã®ç²å¾ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_twai_sem
+
+ER
+twai_sem(ID semid, TMO tmout)
+{
+	SEMCB	*p_semcb;
+	WINFO_SEM winfo_sem;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TWAI_SEM_ENTER(semid, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_SEMID(semid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_semcb = get_semcb(semid);
+
+	lock_cpu_dsp();
+	if (p_semcb->p_seminib->sematr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_semcb->semcnt >= 1) {
+		p_semcb->semcnt -= 1;
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_SEM;
+		wobj_make_wait_tmout((WOBJCB *) p_semcb, (WINFO_WOBJ *) &winfo_sem,
+														&tmevtb, tmout);
+		dispatch();
+		ercd = winfo_sem.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TWAI_SEM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_twai_sem */
+
+/*
+ *  ã»ããã©ã®ååæå
+ */
+#ifdef TOPPERS_ini_sem
+
+ER
+ini_sem(ID semid)
+{
+	SEMCB	*p_semcb;
+	ER		ercd;
+    
+	LOG_INI_SEM_ENTER(semid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_SEMID(semid));
+	p_semcb = get_semcb(semid);
+
+	lock_cpu();
+	if (p_semcb->p_seminib->sematr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		init_wait_queue(&(p_semcb->wait_queue));
+		p_semcb->semcnt = p_semcb->p_seminib->isemcnt;
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_INI_SEM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ini_sem */
+
+/*
+ *  ã»ããã©ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_sem
+
+ER
+ref_sem(ID semid, T_RSEM *pk_rsem)
+{
+	SEMCB	*p_semcb;
+	ER		ercd;
+    
+	LOG_REF_SEM_ENTER(semid, pk_rsem);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_SEMID(semid));
+	p_semcb = get_semcb(semid);
+
+	lock_cpu();
+	if (p_semcb->p_seminib->sematr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		pk_rsem->wtskid = wait_tskid(&(p_semcb->wait_queue));
+		pk_rsem->semcnt = p_semcb->semcnt;
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_SEM_LEAVE(ercd, pk_rsem);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_sem */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/semaphore.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/semaphore.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/semaphore.h	(revision 302)
@@ -0,0 +1,153 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2000 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: semaphore.h 151 2014-05-24 23:40:24Z ertl-hiro $
+ */
+
+/*
+ *		ã»ããã©æ©è½
+ */
+
+#ifndef TOPPERS_SEMAPHORE_H
+#define TOPPERS_SEMAPHORE_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "wait.h"
+
+/*
+ *  ã»ããã©åæåãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WOBJINIBï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct semaphore_initialization_block {
+	ATR			sematr;			/* ã»ããã©å±æ§ */
+	uint_t		isemcnt;		/* ã»ããã©ã®è³æºæ°ã®åæå¤ */
+	uint_t		maxsem;			/* ã»ããã©ã®æå¤§è³æºæ° */
+} SEMINIB;
+
+/*
+ *  ã»ããã©ç®¡çãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼
+ *  ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼æåã®2ã¤ã®
+ *  ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct semaphore_control_block {
+	QUEUE		wait_queue;		/* ã»ããã©å¾
+ã¡ã­ã¥ã¼ */
+	const SEMINIB *p_seminib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	uint_t		semcnt;			/* ã»ããã©ç¾å¨ã«ã¦ã³ãå¤ */
+} SEMCB;
+
+/*
+ *  ã»ããã©å¾
+ã¡æ
+å ±ãã­ãã¯ã®å®ç¾©
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WINFO_WOBJï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  ãã¹ã¦ã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct semaphore_waiting_information {
+	WINFO	winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	SEMCB	*p_semcb;		/* å¾
+ã£ã¦ããã»ããã©ã®ç®¡çãã­ãã¯ */
+} WINFO_SEM;
+
+/*
+ *  ä½¿ç¨ãã¦ããªãã»ããã©ç®¡çãã­ãã¯ã®ãªã¹ã
+ */
+extern QUEUE	free_semcb;
+
+/*
+ *  ã»ããã©IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_semid;
+extern const ID	tmax_ssemid;
+
+/*
+ *  ã»ããã©åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const SEMINIB	seminib_table[];
+extern SEMINIB			aseminib_table[];
+
+/*
+ *  ã»ããã©ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern SEMCB	semcb_table[];
+
+/*
+ *  ã»ããã©ç®¡çãã­ãã¯ããã»ããã©IDãåãåºãããã®ãã¯ã­
+ */
+#define	SEMID(p_semcb)	((ID)(((p_semcb) - semcb_table) + TMIN_SEMID))
+
+/*
+ *  ã»ããã©æ©è½ã®åæå
+ */
+extern void	initialize_semaphore(void);
+
+#endif /* TOPPERS_SEMAPHORE_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/semaphore.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/semaphore.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/semaphore.tf	(revision 302)
@@ -0,0 +1,181 @@
+$
+$   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 $
+$ 
+
+$
+$		ã»ããã©æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  AID_SEMã®å¦ç
+$
+$num_asemid = 0$
+$FOREACH i ASEM.ORDER_LIST$
+$	// nosemãè² ã®å ´åï¼E_PARï¼
+	$IF ASEM.NOSEM[i] < 0$
+		$ERROR ASEM.TEXT_LINE[i]$E_PAR:$SPC$
+			$FORMAT(_("illegal %1% `%2%\' in %3%"),
+									"nosem", ASEM.NOSEM[i], "AID_SEM")$
+		$END$
+	$END$
+	$num_asemid = num_asemid + ASEM.NOSEM[i]$
+$END$
+$num_semid = LENGTH(SEM.ID_LIST) + num_asemid$
+
+$
+$  kernel_cfg.hã®çæ
+$
+$FILE "kernel_cfg.h.new"$
+
+#define TNUM_SEMID	$num_semid$$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$
+
+$
+$  éçã«çæãããã»ããã©ã®æ°
+$
+#define TNUM_SSEMID	$LENGTH(SEM.ID_LIST)$$NL$
+$NL$
+
+$
+$  ã»ããã©IDçªå·ã®æå¤§å¤
+$
+const ID _kernel_tmax_semid = (TMIN_SEMID + TNUM_SEMID - 1);$NL$
+const ID _kernel_tmax_ssemid = (TMIN_SEMID + TNUM_SSEMID - 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_SSEMID] = {$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 num_asemid > 0$
+	SEMINIB _kernel_aseminib_table[$num_asemid$];$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(SEMINIB, _kernel_aseminib_table);$NL$
+$END$$NL$
+
+$
+$  ã»ããã©ç®¡çãã­ãã¯ã¨ã»ããã©æ©è½åæåé¢æ°
+$
+$IF num_semid > 0$
+	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/extension/dcre/kernel/startup.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/startup.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/startup.c	(revision 302)
@@ -0,0 +1,237 @@
+/*
+ *  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: startup.c 189 2014-06-22 10:49:57Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®åæåã¨çµäºå¦ç
+ */
+
+#include "kernel_impl.h"
+#include "time_event.h"
+#include <sil.h>
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_KER_ENTER
+#define LOG_KER_ENTER()
+#endif /* LOG_KER_ENTER */
+
+#ifndef LOG_KER_LEAVE
+#define LOG_KER_LEAVE()
+#endif /* LOG_KER_LEAVE */
+
+#ifndef LOG_EXT_KER_ENTER
+#define LOG_EXT_KER_ENTER()
+#endif /* LOG_EXT_KER_ENTER */
+
+#ifndef LOG_EXT_KER_LEAVE
+#define LOG_EXT_KER_LEAVE(ercd)
+#endif /* LOG_EXT_KER_LEAVE */
+
+#ifdef TOPPERS_sta_ker
+
+/*
+ *  ã«ã¼ãã«åä½ç¶æ
+ãã©ã°
+ *
+ *  ã¹ã¿ã¼ãã¢ããã«ã¼ãã³ã§ï¼falseï¼ï¼0ï¼ã«åæåããããã¨ãæå¾
+ãã¦
+ *  ããï¼
+ */
+bool_t	kerflg = false;
+
+/*
+ *  ã«ã¼ãã«ã®èµ·å
+ */
+void
+sta_ker(void)
+{
+	/*
+	 *  ã¿ã¼ã²ããä¾å­ã®åæå
+	 */
+	target_initialize();
+
+	/*
+	 *  åã¢ã¸ã¥ã¼ã«ã®åæå
+	 *
+	 *  ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«ã¯ä»ã®ã¢ã¸ã¥ã¼ã«ããå
+ã«åæå
+	 *  ããå¿
+è¦ãããï¼
+	 */
+	initialize_kmm();
+	initialize_tmevt();								/*ï¼»ASPD1061ï¼½*/
+	initialize_object();
+
+	/*
+	 *  åæåã«ã¼ãã³ã®å®è¡
+	 */ 
+	call_inirtn();
+
+	/*
+	 *  é«åè§£è½ã¿ã¤ãã®è¨­å®
+	 */
+	current_hrtcnt = target_hrt_get_current();		/*ï¼»ASPD1063ï¼½*/
+	set_hrt_event();								/*ï¼»ASPD1064ï¼½*/
+
+	/*
+	 *  ã«ã¼ãã«åä½ã®éå§
+	 */
+	kerflg = true;
+	LOG_KER_ENTER();
+	start_dispatch();
+	assert(0);
+}
+
+#endif /* TOPPERS_sta_ker */
+
+/*
+ *  ã«ã¼ãã«ã®çµäº
+ */
+#ifdef TOPPERS_ext_ker
+
+ER
+ext_ker(void)
+{
+	SIL_PRE_LOC;
+
+	LOG_EXT_KER_ENTER();
+
+	/*
+	 *  å²è¾¼ã¿ã­ãã¯ç¶æ
+ã«ç§»è¡
+	 */
+	SIL_LOC_INT();
+
+	/*
+	 *  ã«ã¼ãã«åä½ã®çµäº
+	 */
+	LOG_KER_LEAVE();
+	kerflg = false;
+
+	/*
+	 *  ã«ã¼ãã«ã®çµäºå¦çã®å¼åºã
+	 *
+	 *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã¦ï¼exit_kernelãå¼ã³åºãï¼
+	 */
+	call_exit_kernel();
+
+	/*
+	 *  ã³ã³ãã¤ã©ã®è­¦åå¯¾ç­ï¼ããã¸æ¥ããã¨ã¯ãªãã¯ãï¼
+	 */
+	SIL_UNL_INT();
+	LOG_EXT_KER_LEAVE(E_SYS);
+	return(E_SYS);
+}
+
+/*
+ *  ã«ã¼ãã«ã®çµäºå¦ç
+ */
+void
+exit_kernel(void)
+{
+	/*
+	 *  çµäºå¦çã«ã¼ãã³ã®å®è¡
+	 */
+	call_terrtn();
+
+	/*
+	 *  ã¿ã¼ã²ããä¾å­ã®çµäºå¦ç
+	 */
+	target_exit();
+	assert(0);
+}
+
+#endif /* TOPPERS_ext_ker */
+
+/*
+ *  ã«ã¼ãã«ã®å²ãä»ããã¡ã¢ãªé åã®ç®¡ç
+ *
+ *  ã¡ã¢ãªé åãå
+é ­ããé ã«å²ãå½ã¦ï¼è§£æ¾ãããã¡ã¢ãªé åãåå©ç¨ããª
+ *  ãã¡ã¢ãªç®¡çã¢ã¸ã¥ã¼ã«ï¼
+ */
+#ifdef TOPPERS_kermem
+#ifndef OMIT_KMM_ALLOCONLY
+
+static void	*kmm_brk;
+
+void
+initialize_kmm(void)
+{
+	kmm_brk = ((char *) kmm) + kmmsz;
+}
+
+void *
+kernel_malloc(size_t size)
+{
+	if (((char *) kmm_brk) - ((char *) kmm) >= size) {
+		kmm_brk = ((char *) kmm_brk) - size;
+		return(kmm_brk);
+	}
+	else {
+		return(NULL);
+	}
+}
+
+void
+kernel_free(void *ptr)
+{
+}
+
+#endif /* OMIT_KMM_ALLOCONLY */
+#endif /* TOPPERS_kermem */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/task.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/task.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/task.c	(revision 302)
@@ -0,0 +1,490 @@
+/*
+ *  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: task.c 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#include "kernel_impl.h"
+#include "task.h"
+#include "taskhook.h"
+#include "wait.h"
+
+#ifdef TOPPERS_tskini
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯
+ */
+TCB		*p_runtsk;
+
+/*
+ *  å®è¡ãã¹ãã¿ã¹ã¯
+ */
+TCB		*p_schedtsk;
+
+/*
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+
+ */
+bool_t	enadsp;
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããå¯è½ç¶æ
+
+ */
+bool_t	dspflg;
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼
+ */
+QUEUE	ready_queue[TNUM_TPRI];
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ãµã¼ãã®ããã®ãããããã
+ */
+uint16_t	ready_primap;
+
+/*
+ *  ä½¿ç¨ãã¦ããªãTCBã®ãªã¹ã
+ */
+QUEUE	free_tcb;
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®åæå
+ */
+void
+initialize_task(void)
+{
+	uint_t	i, j;
+	TCB		*p_tcb;
+	TINIB	*p_tinib;
+
+	p_runtsk = NULL;
+	p_schedtsk = NULL;
+	enadsp = true;
+	dspflg = true;
+
+	for (i = 0; i < TNUM_TPRI; i++) {
+		queue_initialize(&(ready_queue[i]));
+	}
+	ready_primap = 0U;
+
+	for (i = 0; i < tnum_stsk; i++) {
+		j = INDEX_TSK(torder_table[i]);
+		p_tcb = &(tcb_table[j]);
+		p_tcb->p_tinib = &(tinib_table[j]);
+		p_tcb->actque = false;
+		make_dormant(p_tcb);
+		if ((p_tcb->p_tinib->tskatr & TA_ACT) != 0U) {
+			make_active(p_tcb);
+		}
+	}
+	queue_initialize(&free_tcb);
+	for (j = 0; i < tnum_tsk; i++, j++) {
+		p_tcb = &(tcb_table[i]);
+		p_tinib = &(atinib_table[j]);
+		p_tinib->tskatr = TA_NOEXS;
+		p_tcb->p_tinib = ((const TINIB *) p_tinib);
+		queue_insert_prev(&free_tcb, &(p_tcb->task_queue));
+	}
+}
+
+#endif /* TOPPERS_tskini */
+
+/*
+ *  ãããããããµã¼ãé¢æ°
+ *
+ *  bitmapå
+ã®1ã®ãããã®å
+ï¼æãä¸ä½ï¼å³ï¼ã®ãã®ããµã¼ããï¼ãã®ãã
+ *  ãçªå·ãè¿ãï¼ãããçªå·ã¯ï¼æä¸ä½ãããã0ã¨ããï¼bitmapã«0ãæå®
+ *  ãã¦ã¯ãªããªãï¼ãã®é¢æ°ã§ã¯ï¼bitmapã16ãããã§ãããã¨ãä»®å®ãï¼
+ *  uint16_tåã¨ãã¦ããï¼
+ *
+ *  ããããµã¼ãå½ä»¤ãæã¤ãã­ã»ããµã§ã¯ï¼ããããµã¼ãå½ä»¤ãä½¿ãããã«
+ *  æ¸ãç´ããæ¹ãå¹çãè¯ãå ´åãããï¼ãã®ãããªå ´åã«ã¯ï¼ã¿ã¼ã²ãã
+ *  ä¾å­é¨ã§ããããµã¼ãå½ä»¤ãä½¿ã£ãbitmap_searchãå®ç¾©ãï¼
+ *  OMIT_BITMAP_SEARCHããã¯ã­å®ç¾©ããã°ããï¼ã¾ãï¼ããããµã¼ãå½ä»¤ã®
+ *  ãµã¼ãæ¹åãéãªã©ã®çç±ã§åªå
+åº¦ã¨ãããã¨ã®å¯¾å¿ãå¤æ´ãããå ´åã«
+ *  ã¯ï¼PRIMAP_BITããã¯ã­å®ç¾©ããã°ããï¼
+ *
+ *  ã¾ãï¼ã©ã¤ãã©ãªã«ffsããããªãï¼æ¬¡ã®ããã«å®ç¾©ãã¦ã©ã¤ãã©ãªé¢æ°ã
+ *  ä½¿ã£ãæ¹ãå¹çãè¯ãå¯è½æ§ãããï¼
+ *		#define	bitmap_search(bitmap) (ffs(bitmap) - 1)
+ */
+#ifndef PRIMAP_BIT
+#define	PRIMAP_BIT(pri)		(1U << (pri))
+#endif /* PRIMAP_BIT */
+
+#ifndef OMIT_BITMAP_SEARCH
+
+static const unsigned char bitmap_search_table[] = { 0, 1, 0, 2, 0, 1, 0,
+												3, 0, 1, 0, 2, 0, 1, 0 };
+
+Inline uint_t
+bitmap_search(uint16_t bitmap)
+{
+	uint_t	n = 0U;
+
+	assert(bitmap != 0U);
+	if ((bitmap & 0x00ffU) == 0U) {
+		bitmap >>= 8;
+		n += 8;
+	}
+	if ((bitmap & 0x0fU) == 0U) {
+		bitmap >>= 4;
+		n += 4;
+	}
+	return(n + bitmap_search_table[(bitmap & 0x0fU) - 1]);
+}
+
+#endif /* OMIT_BITMAP_SEARCH */
+
+/*
+ *  åªå
+åº¦ãããããããç©ºãã®ãã§ãã¯
+ */
+Inline bool_t
+primap_empty(void)
+{
+	return(ready_primap == 0U);
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ãµã¼ã
+ */
+Inline uint_t
+primap_search(void)
+{
+	return(bitmap_search(ready_primap));
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ã»ãã
+ */
+Inline void
+primap_set(uint_t pri)
+{
+	ready_primap |= PRIMAP_BIT(pri);
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ã¯ãªã¢
+ */
+Inline void
+primap_clear(uint_t pri)
+{
+	ready_primap &= ~PRIMAP_BIT(pri);
+}
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã®ãµã¼ã
+ */
+#ifdef TOPPERS_tsksched
+
+TCB *
+search_schedtsk(void)
+{
+	uint_t	schedpri;
+
+	schedpri = primap_search();
+	return((TCB *)(ready_queue[schedpri].p_next));
+}
+
+#endif /* TOPPERS_tsksched */
+
+/*
+ *  å®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼å®è¡ã§ããã¿ã¹ã¯ããªãã£ãå ´åã¨ï¼
+ *  p_tcbã®åªå
+åº¦ãå®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã§ããï¼
+ */
+#ifdef TOPPERS_tskrun
+
+void
+make_runnable(TCB *p_tcb)
+{
+	uint_t	pri = p_tcb->priority;
+
+	queue_insert_prev(&(ready_queue[pri]), &(p_tcb->task_queue));
+	primap_set(pri);
+
+	if (dspflg) {
+		if (p_schedtsk == (TCB *) NULL || pri < p_schedtsk->priority) {
+			p_schedtsk = p_tcb;
+		}
+	}
+}
+
+#endif /* TOPPERS_tskrun */
+
+/*
+ *  å®è¡ã§ããç¶æ
+ããä»ã®ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ãå ´å
+ *  ã§ããï¼p_tcbã¨åãåªå
+åº¦ã®ã¿ã¹ã¯ãä»ã«ããå ´åã¯ï¼p_tcbã®æ¬¡ã®ã¿ã¹
+ *  ã¯ãå®è¡ãã¹ãã¿ã¹ã¯ã«ãªãï¼ããã§ãªãå ´åã¯ï¼ã¬ãã£ã­ã¥ã¼ããµã¼ã
+ *  ããå¿
+è¦ãããï¼
+ */
+#ifdef TOPPERS_tsknrun
+
+void
+make_non_runnable(TCB *p_tcb)
+{
+	uint_t	pri = p_tcb->priority;
+	QUEUE	*p_queue = &(ready_queue[pri]);
+
+	queue_delete(&(p_tcb->task_queue));
+	if (queue_empty(p_queue)) {
+		primap_clear(pri);
+		if (p_schedtsk == p_tcb) {
+			assert(dspflg);
+			p_schedtsk = primap_empty() ? (TCB *) NULL : search_schedtsk();
+		}
+	}
+	else {
+		if (p_schedtsk == p_tcb) {
+			assert(dspflg);
+			p_schedtsk = (TCB *)(p_queue->p_next);
+		}
+	}
+}
+
+#endif /* TOPPERS_tsknrun */
+
+/*
+ *  ä¼æ­¢ç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_tskdmt
+
+void
+make_dormant(TCB *p_tcb)
+{
+	p_tcb->tstat = TS_DORMANT;
+	p_tcb->bpriority = p_tcb->p_tinib->ipriority;
+	p_tcb->priority = p_tcb->p_tinib->ipriority;
+	p_tcb->wupque = false;
+	p_tcb->raster = false;
+	p_tcb->enater = true;
+	LOG_TSKSTAT(p_tcb);
+}
+
+#endif /* TOPPERS_tskdmt */
+
+/*
+ *  ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_tskact
+
+void
+make_active(TCB *p_tcb)
+{
+	activate_context(p_tcb);
+	p_tcb->tstat = TS_RUNNABLE;
+	LOG_TSKSTAT(p_tcb);
+	make_runnable(p_tcb);
+}
+
+#endif /* TOPPERS_tskact */
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+åº¦ã®å¤æ´
+ *
+ *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã®å ´åã«ã¯ï¼ã¬ãã£ã­ã¥ã¼ã®ä¸­ã§ã®ä½ç½®ãå¤æ´ã
+ *  ãï¼ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã®ä¸­ã§å¾
+ã¡ç¶æ
+ã«ãªã£ã¦ããå ´åã«ã¯ï¼å¾
+
+ *  ã¡ã­ã¥ã¼ã®ä¸­ã§ã®ä½ç½®ãå¤æ´ããï¼
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼(1) p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ã¦ï¼
+ *  ãã®åªå
+åº¦ãä¸ããå ´åï¼(2) p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ã¯ãªãï¼å¤æ´å¾
+ *  ã®åªå
+åº¦ãå®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã§ããï¼(1)ã®å ´åã«
+ *  ã¯ï¼ã¬ãã£ã­ã¥ã¼ããµã¼ãããå¿
+è¦ãããï¼
+ */
+#ifdef TOPPERS_tskpri
+
+void
+change_priority(TCB *p_tcb, uint_t newpri, bool_t mtxmode)
+{
+	uint_t	oldpri;
+
+	oldpri = p_tcb->priority;
+	p_tcb->priority = newpri;
+
+	if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		/*
+		 *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã®å ´å
+		 */
+		queue_delete(&(p_tcb->task_queue));
+		if (queue_empty(&(ready_queue[oldpri]))) {
+			primap_clear(oldpri);
+		}
+		if (mtxmode) {
+			queue_insert_next(&(ready_queue[newpri]), &(p_tcb->task_queue));
+		}
+		else {
+			queue_insert_prev(&(ready_queue[newpri]), &(p_tcb->task_queue));
+		}
+		primap_set(newpri);
+
+		if (dspflg) {
+			if (p_schedtsk == p_tcb) {
+				if (newpri >= oldpri) {
+					p_schedtsk = search_schedtsk();
+				}
+			}
+			else {
+				if (mtxmode ? newpri <= p_schedtsk->priority
+							: newpri < p_schedtsk->priority) {
+					p_schedtsk = p_tcb;
+				}
+			}
+		}
+	}
+	else {
+		if (TSTAT_WAIT_WOBJCB(p_tcb->tstat)) {
+			/*
+			 *  ã¿ã¹ã¯ãï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨
+			 *  åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ããå ´å
+			 */
+			wobj_change_priority(((WINFO_WOBJ *)(p_tcb->p_winfo))->p_wobjcb,
+																	p_tcb);
+		}
+	}
+}
+
+#endif /* TOPPERS_tskpri */
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ã®åè»¢
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãã¿ã¹ã¯ã­ã¥ã¼ã®æ«
+ *  å°¾ã«ç§»åããå ´åã§ããï¼
+ */
+#ifdef TOPPERS_tskrot
+
+void
+rotate_ready_queue(QUEUE *p_queue)
+{
+	QUEUE	*p_entry;
+
+	if (!queue_empty(p_queue) && p_queue->p_next->p_next != p_queue) {
+		p_entry = queue_delete_next(p_queue);
+		queue_insert_prev(p_queue, p_entry);
+		if (dspflg) {
+			if (p_schedtsk == (TCB *) p_entry) {
+				p_schedtsk = (TCB *)(p_queue->p_next);
+			}
+		}
+	}
+}
+
+#endif /* TOPPERS_tskrot */
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºå¦ç
+ */
+#ifdef TOPPERS_tskterm
+
+void
+task_terminate(TCB *p_tcb)
+{
+	if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		make_non_runnable(p_tcb);
+	}
+	else if (TSTAT_WAITING(p_tcb->tstat)) {
+		wait_dequeue_wobj(p_tcb);
+		wait_dequeue_tmevtb(p_tcb);
+	}
+	if (p_tcb->p_lastmtx != NULL) {
+		(*mtxhook_release_all)(p_tcb);
+	}
+	make_dormant(p_tcb);
+	if (p_tcb->actque) {
+		p_tcb->actque = false;
+		make_active(p_tcb);
+	}
+}
+
+#endif /* TOPPERS_tskterm */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/task.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/task.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/task.h	(revision 302)
@@ -0,0 +1,659 @@
+/*
+ *  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: task.h 452 2015-08-15 02:36:39Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_TASK_H
+#define TOPPERS_TASK_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "time_event.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_TSKSTAT
+#define LOG_TSKSTAT(p_tcb)
+#endif /* LOG_TSKSTAT */
+
+/*
+ *  ã¿ã¹ã¯åªå
+åº¦ã®å
+é¨è¡¨ç¾ã»å¤é¨è¡¨ç¾å¤æãã¯ã­
+ */
+#define INT_PRIORITY(x)		((uint_t)((x) - TMIN_TPRI))
+#define EXT_TSKPRI(x)		((PRI)(x) + TMIN_TPRI)
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+ã®å
+é¨è¡¨ç¾
+ *
+ *  TCBä¸­ã®ã¿ã¹ã¯ç¶æ
+ã®ãã£ã¼ã«ãã§ã¯ï¼ã¿ã¹ã¯ã®ç¶æ
+ã¨ï¼ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+
+ *  ã®æã®å¾
+ã¡è¦å ãè¡¨ãï¼ãã ãï¼å®è¡ç¶æ
+ï¼RUNNINGï¼ã¨å®è¡å¯è½ç¶æ
+
+ *  ï¼READYï¼ã¯åºå¥ããï¼ä¸¡ç¶æ
+ããããã¦å®è¡ã§ããç¶æ
+ï¼RUNNABLEï¼ã¨ã
+ *  ã¦ç®¡çããï¼äºéå¾
+ã¡ç¶æ
+ã¯ï¼(TS_WAITING_??? | TS_SUSPENDED)ã§è¡¨ãï¼
+ *
+ *  ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ãå«ãï¼ã®æã¯ï¼TS_WAITING_???ã§å¾
+ã¡
+ *  è¦å ãè¡¨ãï¼å¾
+ã¡è¦å ï¼5ãããã§è¡¨ç¾ãããï¼ã®ä¸ä½2ãããã§ï¼åæã»
+ *  éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãã£ã¦ãããã©ãããè¡¨ãï¼åæã»
+ *  éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãããªããã®ã¯ä¸ä½2ãããã00ï¼å
+ *  æã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼
+ *  ã«ã¤ãªãããã®ã¯10ã¾ãã¯11ï¼ããä»¥å¤ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãããã®ã¯01
+ *  ã¨ããï¼
+ */
+#define TS_DORMANT		0x00U			/* ä¼æ­¢ç¶æ
+ */
+#define TS_RUNNABLE		0x01U			/* å®è¡ã§ããç¶æ
+ */
+#define TS_SUSPENDED	0x02U			/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+
+#define TS_WAITING_SLP	(0x01U << 2)	/* èµ·åºå¾
+ã¡ */
+#define TS_WAITING_DLY	(0x02U << 2)	/* æéçµéå¾
+ã¡ */
+#define TS_WAITING_RDTQ	(0x08U << 2)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TS_WAITING_RPDQ	(0x09U << 2)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TS_WAITING_SEM	(0x10U << 2)	/* ã»ããã©è³æºã®ç²å¾å¾
+ã¡ */
+#define TS_WAITING_FLG	(0x11U << 2)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TS_WAITING_SDTQ	(0x12U << 2)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TS_WAITING_SPDQ	(0x13U << 2)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TS_WAITING_MTX	(0x14U << 2)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ */
+#define TS_WAITING_MPF	(0x15U << 2)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TS_WAITING_MASK	(0x1fU << 2)	/* å¾
+ã¡ç¶æ
+ã®å¤å¥ç¨ãã¹ã¯ */
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+å¤å¥ãã¯ã­
+ *
+ *  TSTAT_DORMANTã¯ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ã§ãããã©ãããï¼TSTAT_RUNNABLEã¯
+ *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ãããã©ãããå¤å¥ããï¼TSTAT_WAITINGã¯å¾
+
+ *  ã¡ç¶æ
+ã¨äºéå¾
+ã¡ç¶æ
+ã®ããããã§ãããã©ãããï¼TSTAT_SUSPENDEDã¯
+ *  å¼·å¶å¾
+ã¡ç¶æ
+ã¨äºéå¾
+ã¡ç¶æ
+ã®ããããã§ãããã©ãããå¤å¥ããï¼
+ */
+#define TSTAT_DORMANT(tstat)	((tstat) == TS_DORMANT)
+#define TSTAT_RUNNABLE(tstat)	(((tstat) & TS_RUNNABLE) != 0U)
+#define TSTAT_WAITING(tstat)	(((tstat) & TS_WAITING_MASK) != 0U)
+#define TSTAT_SUSPENDED(tstat)	(((tstat) & TS_SUSPENDED) != 0U)
+
+/*
+ *  ã¿ã¹ã¯å¾
+ã¡è¦å å¤å¥ãã¯ã­
+ *
+ *  TSTAT_WAIT_SLPã¯ã¿ã¹ã¯ãèµ·åºå¾
+ã¡ã§ãããã©ãããï¼TSTAT_WAIT_MTXã¯
+ *  ã¿ã¹ã¯ããã¥ã¼ããã¯ã¹å¾
+ã¡ã§ãããã©ãããå¤å¥ããï¼
+ *
+ *  ã¾ãï¼TSTAT_WAIT_WOBJ ã¯ã¿ã¹ã¯ãåæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡
+ *  ã§ãããï¼è¨ãæããã¨ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªã
+ *  ãã¦ãããï¼ã©ãããï¼TSTAT_WAIT_WOBJCBã¯ã¿ã¹ã¯ãåæã»éä¿¡ãªãã¸ã§
+ *  ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ãã
+ *  ãã©ãããå¤å¥ããï¼
+ */
+#define TSTAT_WAIT_SLP(tstat)	(((tstat) & ~TS_SUSPENDED) == TS_WAITING_SLP)
+#define TSTAT_WAIT_MTX(tstat)	(((tstat) & ~TS_SUSPENDED) == TS_WAITING_MTX)
+
+#define TSTAT_WAIT_WOBJ(tstat)		(((tstat) & (0x18U << 2)) != 0U)
+#define TSTAT_WAIT_WOBJCB(tstat)	(((tstat) & (0x10U << 2)) != 0U)
+
+/*
+ *  å¾
+ã¡æ
+å ±ãã­ãã¯ï¼WINFOï¼ã®å®ç¾©
+ *
+ *  ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã®éã¯ï¼TCBããã³ãã®p_winfoã§æãããWINFOãæ¬¡ã®
+ *  ããã«è¨­å®ããªããã°ãªããªãï¼
+ *
+ *  (a) TCBã®ã¿ã¹ã¯ç¶æ
+ãå¾
+ã¡ç¶æ
+ï¼TS_WAITING_???ï¼ã«ããï¼
+ *
+ *  (b) ã¿ã¤ã ã¢ã¦ããç£è¦ããããã«ï¼ã¿ã¤ã ã¤ãã³ããã­ãã¯ãç»é²ããï¼
+ *  ç»é²ããã¿ã¤ã ã¤ãã³ããã­ãã¯ã¯ï¼å¾
+ã¡ã«å
+¥ããµã¼ãã¹ã³ã¼ã«å¦çé¢æ°
+ *  ã®ã­ã¼ã«ã«å¤æ°ã¨ãã¦ç¢ºä¿ãï¼ããã¸ã®ãã¤ã³ã¿ãWINFOã®p_tmevtbã«è¨
+ *  æ¶ããï¼ã¿ã¤ã ã¢ã¦ãã®ç£è¦ãå¿
+è¦ãªãå ´åï¼æ°¸ä¹
+å¾
+ã¡ã®å ´åï¼ã«ã¯ï¼
+ *  p_tmevtbãNULLã«ããï¼
+ *
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã®å ´åã«ã¯ï¼æ¨æºã®WINFOã«
+ *  p_wobjcbãã£ã¼ã«ããè¿½å ããæ§é ä½ï¼WINFO_WOBJï¼wait.hã§å®ç¾©ï¼ã«ï¼
+ *  å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã«ä¾å­ãã¦è¨æ¶ãããã¨ãå¿
+è¦ãªæ
+å ±
+ *  ã®ããã®ãã£ã¼ã«ããè¿½å ããæ§é ä½ï¼WINFO_???ï¼ãå®ç¾©ãï¼WINFOã®ä»£
+ *  ããã«ç¨ããï¼ã¾ãï¼ä»¥ä¸ã®(c)ã(e)ã®è¨­å®ãè¡ãå¿
+è¦ãããï¼åæã»é
+ *  ä¿¡ãªãã¸ã§ã¯ãã«é¢ä¿ããªãå¾
+ã¡ï¼èµ·åºå¾
+ã¡ï¼æéçµéå¾
+ã¡ï¼ã®å ´åã«ã¯ï¼
+ *  ãããã¯å¿
+è¦ãªãï¼
+ *
+ *  (c) TCBãå¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãï¼å¾
+
+ *  ã¡ã­ã¥ã¼ã«ã¤ãªãããã«ï¼task_queueãä½¿ãï¼
+ *
+ *  (d) å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã¸ã®ãã¤ã³ã¿ãï¼
+ *  WINFO_WOBJã®p_wobjcbã«è¨æ¶ããï¼
+ *
+ *  (e) å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã«ä¾å­ãã¦è¨æ¶ãããã¨ãå¿
+è¦ãª
+ *  æ
+å ±ãããå ´åã«ã¯ï¼WINFO_???å
+ã®ãã£ã¼ã«ãã«è¨æ¶ããï¼
+ *
+ *  å¾
+ã¡ç¶æ
+ãè§£é¤ããéã«ã¯ï¼å¾
+ã¡è§£é¤ããã¿ã¹ã¯ã«å¯¾ããè¿å¤ãWINFOã®
+ *  wercdã«è¨­å®ããï¼wercdãå¿
+è¦ãªã®ã¯å¾
+ã¡è§£é¤ä»¥éã§ããã®ã«å¯¾ãã¦ï¼
+ *  p_tmevtbã¯å¾
+ã¡è§£é¤å¾ã¯å¿
+è¦ãªãããï¼ã¡ã¢ãªç¯ç´ã®ããã«å
+±ç¨ä½ãä½¿ã£
+ *  ã¦ããï¼ãã®ããï¼wercdã¸ã¨ã©ã¼ã³ã¼ããè¨­å®ããã®ã¯ï¼ã¿ã¤ã ã¤ãã³ã
+ *  ãã­ãã¯ãç»é²è§£é¤ããå¾ã«ããªããã°ãªããªãï¼
+ */
+typedef union waiting_information {
+	ER		wercd;			/* å¾
+ã¡è§£é¤æã®ã¨ã©ã¼ã³ã¼ã */
+	TMEVTB	*p_tmevtb;		/* å¾
+ã¡ç¶æ
+ç¨ã®ã¿ã¤ã ã¤ãã³ããã­ãã¯ */
+} WINFO;
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ã®åã®åæ¹åç
+§
+ */
+typedef struct mutex_control_block MTXCB;
+
+/*
+ *  ã¿ã¹ã¯åæåãã­ãã¯
+ *
+ *  ã¿ã¹ã¯ã«é¢ããæ
+å ±ãï¼å¤ãå¤ãããªãããã«ROMã«ç½®ããé¨åï¼ã¿ã¹ã¯
+ *  åæåãã­ãã¯ï¼ã¨ï¼å¤ãå¤åããããã«RAMã«ç½®ããªããã°ãªããªãé¨
+ *  åï¼ã¿ã¹ã¯ç®¡çãã­ãã¯ï¼TCBï¼ã«åé¢ãï¼TCBå
+ã«å¯¾å¿ããã¿ã¹ã¯åæå
+ *  ãã­ãã¯ãæããã¤ã³ã¿ãå
+¥ããï¼ã¿ã¹ã¯åæåãã­ãã¯å
+ã«å¯¾å¿ãã
+ *  TCBãæããã¤ã³ã¿ãå
+¥ããæ¹æ³ã®æ¹ãï¼RAMã®ç¯ç´ã®è¦³ç¹ããã¯æã¾ãã
+ *  ãï¼å®è¡å¹çãæªããªãããã«æ¡ç¨ãã¦ããªãï¼ä»ã®ãªãã¸ã§ã¯ãã«ã¤ã
+ *  ã¦ãåæ§ã«æ±ãï¼
+ *
+ *  ã¿ã¹ã¯åæåãã­ãã¯ã«ã¯ï¼DEF_TEXã§å®ç¾©ãããã¿ã¹ã¯ä¾å¤å¦çã«ã¼ã
+ *  ã³ã«é¢ããæ
+å ±ãå«ãï¼
+ */
+typedef struct task_initialization_block {
+	ATR			tskatr;			/* ã¿ã¹ã¯å±æ§ */
+	intptr_t	exinf;			/* ã¿ã¹ã¯ã®æ¡å¼µæ
+å ± */
+	TASK		task;			/* ã¿ã¹ã¯ã®èµ·åçªå° */
+	uint_t		ipriority;		/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼ */
+
+#ifdef USE_TSKINICTXB
+	TSKINICTXB	tskinictxb;		/* ã¿ã¹ã¯åæåã³ã³ãã­ã¹ããã­ãã¯ */
+#else /* USE_TSKINICTXB */
+	size_t		stksz;			/* ã¹ã¿ãã¯é åã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
+	void		*stk;			/* ã¹ã¿ãã¯é åã®å
+é ­çªå° */
+#endif /* USE_TSKINICTXB */
+} TINIB;
+
+/*
+ *  ã¿ã¹ã¯ç®¡çãã­ãã¯ï¼TCBï¼
+ *
+ *  ASPã«ã¼ãã«ã§ã¯ï¼ã¿ã¹ã¯ã®èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ï¼TMAX_ACTCNTï¼
+ *  ã¨èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ï¼TMAX_WUPCNTï¼ã¯1ã«åºå®ããã¦ãã
+ *  ããï¼ã­ã¥ã¼ã¤ã³ã°ããã¦ãããã©ããã®çå½å¤ã§è¡¨ç¾ãããã¨ãã§ããï¼
+ *  ã¾ãï¼å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ã®æå¤§å¤ï¼TMAX_SUSCNTï¼ã1ã«åºå®ããã¦ã
+ *  ãã®ã§ï¼å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ï¼suscntï¼ã¯å¿
+è¦ãªãï¼
+ *
+ *  TCBã®ããã¤ãã®ãã£ã¼ã«ãã¯ï¼ç¹å®ã®ã¿ã¹ã¯ç¶æ
+ã§ã®ã¿æå¹ãªå¤ãä¿æãï¼
+ *  ããä»¥å¤ã®å ´åã¯å¤ãä¿è¨¼ãããªãï¼ãã£ã¦ï¼åç
+§ãã¦ã¯ãªããªãï¼ï¼å
+ *  ãã£ã¼ã«ããæå¹ãªå¤ãä¿æããæ¡ä»¶ã¯æ¬¡ã®éãï¼
+ *
+ *  ã»åæåå¾ã¯å¸¸ã«æå¹ï¼
+ *  		p_tinibï¼tstatï¼actque
+ *  ã»ä¼æ­¢ç¶æ
+ä»¥å¤ã§æå¹ï¼ä¼æ­¢ç¶æ
+ã§ã¯åæå¤ã«ãªã£ã¦ããï¼ï¼
+ *  		bpriorityï¼priorityï¼wupqueï¼rasterï¼enaterï¼p_lastmtx
+ *  ã»å¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ãå«ãï¼ã§æå¹ï¼
+ *  		p_winfo
+ *  ã»å®è¡ã§ããç¶æ
+ã¨åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã§æå¹ï¼
+ *  		task_queue
+ *  ã»å®è¡å¯è½ç¶æ
+ï¼å¾
+ã¡ç¶æ
+ï¼å¼·å¶å¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ã§æå¹ï¼
+ *  		tskctxb
+ */
+typedef struct task_control_block {
+	QUEUE			task_queue;		/* ã¿ã¹ã¯ã­ã¥ã¼ */
+	const TINIB		*p_tinib;		/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+
+#ifdef UINT8_MAX
+	uint8_t			tstat;			/* ã¿ã¹ã¯ç¶æ
+ï¼å
+é¨è¡¨ç¾ï¼*/
+	uint8_t			bpriority;		/* ãã¼ã¹åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+	uint8_t			priority;		/* ç¾å¨ã®åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+#else /* UINT8_MAX */
+	BIT_FIELD_UINT	tstat : 8;		/* ã¿ã¹ã¯ç¶æ
+ï¼å
+é¨è¡¨ç¾ï¼*/
+	BIT_FIELD_UINT	bpriority : 8;	/* ãã¼ã¹åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+	BIT_FIELD_UINT	priority : 8	/* ç¾å¨ã®åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/;
+#endif /* UINT8_MAX */
+	BIT_FIELD_BOOL	actque : 1;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã° */
+	BIT_FIELD_BOOL	wupque : 1;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã° */
+	BIT_FIELD_BOOL	raster : 1;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	BIT_FIELD_BOOL	enater : 1;		/* ã¿ã¹ã¯çµäºè¨±å¯ç¶æ
+ */
+
+	WINFO			*p_winfo;		/* å¾
+ã¡æ
+å ±ãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	MTXCB			*p_lastmtx;		/* æå¾ã«ã­ãã¯ãããã¥ã¼ããã¯ã¹ */
+	TSKCTXB			tskctxb;		/* ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ */
+} TCB;
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯
+ *
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯ï¼ï¼ãã­ã»ããµãã³ã³ãã­ã¹ããæã£ã¦ããã¿ã¹ã¯ï¼ã®
+ *  TCBãæããã¤ã³ã¿ï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ããªãå ´åã¯NULLã«ããï¼
+ *
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å¦çä¸­ã§ï¼èªã¿ã¹ã¯ï¼ãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºããã¿ã¹
+ *  ã¯ï¼ã«é¢ããæ
+å ±ãåç
+§ããå ´åã¯p_runtskãä½¿ãï¼p_runtskãæ¸ãæã
+ *  ãã®ã¯ï¼ãã£ã¹ãããã£ï¼ã¨åæåå¦çï¼ã®ã¿ã§ããï¼
+ */
+extern TCB	*p_runtsk;
+
+/*
+ *  å®è¡ãã¹ãã¿ã¹ã¯
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ã®TCBãæããã¤ã³ã¿ï¼å®è¡ã§ããã¿ã¹ã¯ããªãå ´åã¯
+ *  NULLã«ããï¼
+ *
+ *  p_runtskã¯ï¼éå¸¸ã¯p_schedtskã¨ä¸è´ãã¦ãããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ã
+ *  å®è¡ä¸­ã¯ï¼ä¸è´ãã¦ããã¨ã¯éããªãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªã
+ *  ç¶æ
+ã®éã¨ãã£ã¹ãããç¦æ­¢ç¶æ
+ã®éï¼ããªãã¡ï¼dspflgãfalseã§ããéï¼
+ *  ã¯ï¼p_schedtskãæ´æ°ããªãï¼
+ */
+extern TCB	*p_schedtsk;
+
+/*
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+
+ *
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ãããã¨ãç¤ºããã©ã°ï¼
+ */
+extern bool_t	enadsp;
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããå¯è½ç¶æ
+
+ *
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§ããï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ããï¼ãã£
+ *  ã¹ãããç¦æ­¢ç¶æ
+ã§ãªãï¼ãã¨ãç¤ºããã©ã°ï¼ãã£ã¹ãããä¿çç¶æ
+ã§ãª
+ *  ããã¨ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãå®è¡ä¸­ã§ï¼CPUã­ãã¯ç¶æ
+ã§ãªãï¼dspflgã
+ *  trueã§ãããã¨ã§å¤å¥ãããã¨ãã§ããï¼
+ */
+extern bool_t	dspflg;
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã¯ï¼å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ãç®¡çããããã®ã­ã¥ã¼ã§ããï¼
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãç®¡çãã¦ããããï¼ã¬ãã£ï¼å®è¡å¯è½ï¼ã­ã¥ã¼ã¨ãã
+ *  åç§°ã¯æ­£ç¢ºã§ã¯ãªããï¼ã¬ãã£ã­ã¥ã¼ã¨ããåç§°ãå®çãã¦ããããï¼ã
+ *  ã®åç§°ã§å¼ã¶ãã¨ã«ããï¼
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã¯ï¼åªå
+åº¦ãã¨ã®ã¿ã¹ã¯ã­ã¥ã¼ã§æ§æããã¦ããï¼ã¿ã¹ã¯ã®
+ *  TCBã¯ï¼è©²å½ããåªå
+åº¦ã®ã­ã¥ã¼ã«ç»é²ãããï¼
+ */
+extern QUEUE	ready_queue[TNUM_TPRI];
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ãµã¼ãã®ããã®ãããããã
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã®ãµã¼ããå¹çããè¡ãããã«ï¼åªå
+åº¦ãã¨ã®ã¿ã¹ã¯ã­ã¥ã¼
+ *  ã«ã¿ã¹ã¯ãå
+¥ã£ã¦ãããã©ãããç¤ºããããããããç¨æãã¦ããï¼ãã
+ *  ãããããä½¿ããã¨ã§ï¼ã¡ã¢ãªã¢ã¯ã»ã¹ã®åæ°ãæ¸ãããã¨ãã§ãããï¼
+ *  ãããæä½å½ä»¤ãå
+
+å®ãã¦ããªããã­ã»ããµã§ï¼åªå
+åº¦ã®æ®µéæ°ãå°ãªã
+ *  å ´åã«ã¯ï¼ããããããæä½ã®ãªã¼ãã¼ãããã®ããã«ï¼éã«å¹çãè½ã¡
+ *  ãå¯è½æ§ãããï¼
+ *
+ *  åªå
+åº¦ã16æ®µéã§ãããã¨ãä»®å®ãã¦ããããï¼uint16_tåã¨ãã¦ããï¼
+ */
+extern uint16_t	ready_primap;
+
+/*
+ *  ä½¿ç¨ãã¦ããªãTCBã®ãªã¹ã
+ */
+extern QUEUE	free_tcb;
+
+/*
+ *  ã¿ã¹ã¯IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_tskid;
+extern const ID	tmax_stskid;
+
+/*
+ *  ã¿ã¹ã¯åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const TINIB	tinib_table[];
+extern TINIB		atinib_table[];
+
+/*
+ *  ã¿ã¹ã¯çæé åºãã¼ãã«ï¼kernel_cfg.cï¼
+ */
+extern const ID	torder_table[];
+
+/*
+ *  TCBã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern TCB	tcb_table[];
+
+/*
+ *  ã¿ã¹ã¯ã®æ°
+ */
+#define tnum_tsk	((uint_t)(tmax_tskid - TMIN_TSKID + 1))
+#define tnum_stsk	((uint_t)(tmax_stskid - TMIN_TSKID + 1))
+
+/*
+ *  ã¿ã¹ã¯IDããTCBãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_TSK(tskid)	((uint_t)((tskid) - TMIN_TSKID))
+#define get_tcb(tskid)		(&(tcb_table[INDEX_TSK(tskid)]))
+
+/*
+ *  TCBããã¿ã¹ã¯IDãåãåºãããã®ãã¯ã­
+ */
+#define	TSKID(p_tcb)	((ID)(((p_tcb) - tcb_table) + TMIN_TSKID))
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®åæå
+ */
+extern void	initialize_task(void);
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã®ãµã¼ã
+ *
+ *  ã¬ãã£ã­ã¥ã¼ä¸­ã®æé«åªå
+é ä½ã®ã¿ã¹ã¯ããµã¼ããï¼ãã®TCBã¸ã®ãã¤ã³ã¿
+ *  ãè¿ãï¼ã¬ãã£ã­ã¥ã¼ãç©ºã®å ´åã«ã¯ï¼ãã®é¢æ°ãå¼ã³åºãã¦ã¯ãªããªãï¼
+ */
+extern TCB	*search_schedtsk(void);
+
+/*
+ *  å®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ã«æ¿å
+¥ããï¼ã¬ãã£ã­ã¥ã¼ã«æ¿å
+¥
+ *  ããã¿ã¹ã¯ã®åªå
+åº¦ãï¼å®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã¯ï¼å®
+ *  è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ */
+extern void	make_runnable(TCB *p_tcb);
+
+/*
+ *  å®è¡ã§ããç¶æ
+ããä»ã®ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ããåé¤ããï¼p_tcbã§æå®ãã
+ *  ã¿ã¹ã¯ãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ãå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ã
+ *  ãï¼
+ */
+extern void	make_non_runnable(TCB *p_tcb);
+
+/*
+ *  ä¼æ­¢ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¶æ
+ãä¼æ­¢ç¶æ
+ã¨ããï¼ã¾ãï¼ã¿ã¹ã¯ã®èµ·å
+ *  æã«åæåãã¹ãå¤æ°ã®åæåã¨ï¼ã¿ã¹ã¯èµ·åã®ããã®ã³ã³ãã­ã¹ããè¨­
+ *  å®ããï¼
+ */
+extern void	make_dormant(TCB *p_tcb);
+
+/*
+ *  ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¶æ
+ãä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¨ããï¼
+ */
+extern void	make_active(TCB *p_tcb);
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+åº¦ã®å¤æ´
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®åªå
+åº¦ãnewpriï¼å
+é¨è¡¨ç¾ï¼ã«å¤æ´ããï¼ã¾ãï¼
+ *  å¿
+è¦ãªå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®åªå
+é ä½ã¯ï¼åªå
+åº¦ãåãã¿ã¹ã¯ã®ä¸­ã§ï¼
+ *  mtxmodeãfalseã®æã¯æä½ï¼mtxmodeãtrueã®æã¯æé«ã¨ããï¼
+ */
+extern void	change_priority(TCB *p_tcb, uint_t newpri, bool_t mtxmode);
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ã®åè»¢
+ *
+ *  ã¬ãã£ã­ã¥ã¼ä¸­ã®ï¼p_queueã§æå®ãããã¿ã¹ã¯ã­ã¥ã¼ãåè»¢ãããï¼ã¾ãï¼
+ *  å¿
+è¦ãªå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ */
+extern void	rotate_ready_queue(QUEUE *p_queue);
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºå¦ç
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãçµäºãããå¦çãè¡ãï¼ã¿ã¹ã¯ã®èµ·åè¦æ±ã­ã¥ã¼
+ *  ã¤ã³ã°æ°ã0ã§ãªãå ´åã«ã¯ï¼ååº¦èµ·åããããã®å¦çãè¡ãï¼
+ */
+extern void	task_terminate(TCB *p_tcb);
+
+#endif /* TOPPERS_TASK_H */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/task.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/task.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/task.tf	(revision 302)
@@ -0,0 +1,234 @@
+$
+$   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 $
+$ 
+
+$
+$		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  AID_TSKã®å¦ç
+$
+$num_atskid = 0$
+$FOREACH i ATSK.ORDER_LIST$
+$	// notskãè² ã®å ´åï¼E_PARï¼
+	$IF ATSK.NOTSK[i] < 0$
+		$ERROR ATSK.TEXT_LINE[i]$E_PAR:$SPC$
+			$FORMAT(_("illegal %1% `%2%\' in %3%"),
+									"notsk", ATSK.NOTSK[i], "AID_TSK")$
+		$END$
+	$END$
+	$num_atskid = num_atskid + ATSK.NOTSK[i]$
+$END$
+$num_tskid = LENGTH(TSK.ID_LIST) + num_atskid$
+
+$
+$  kernel_cfg.hã®çæ
+$
+$FILE "kernel_cfg.h.new"$
+
+#define TNUM_TSKID	$num_tskid$$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$
+
+$
+$  éçã«çæãããã¿ã¹ã¯ã®æ°
+$
+#define TNUM_STSKID	$LENGTH(TSK.ID_LIST)$$NL$
+$NL$
+
+$
+$  ã¿ã¹ã¯IDçªå·ã®æå¤§å¤
+$
+const ID _kernel_tmax_tskid = (TMIN_TSKID + TNUM_TSKID - 1);$NL$
+const ID _kernel_tmax_stskid = (TMIN_TSKID + TNUM_STSKID - 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_STSKID] = {$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$
+
+$
+$  åççæã¿ã¹ã¯ç¨ã®ã¿ã¹ã¯åæåãã­ãã¯ã®çæ
+$
+$IF num_atskid > 0$
+	TINIB _kernel_atinib_table[$num_atskid$];$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(TINIB, _kernel_atinib_table);$NL$
+$END$$NL$
+
+$
+$  ã¿ã¹ã¯çæé åºãã¼ãã«ã®çæ
+$
+const ID _kernel_torder_table[TNUM_STSKID] = {$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/extension/dcre/kernel/task_manage.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/task_manage.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/task_manage.c	(revision 302)
@@ -0,0 +1,534 @@
+/*
+ *  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: task_manage.c 470 2015-12-30 09:50:36Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "taskhook.h"
+#include "wait.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ACRE_TSK_ENTER
+#define LOG_ACRE_TSK_ENTER(pk_ctsk)
+#endif /* LOG_ACRE_TSK_ENTER */
+
+#ifndef LOG_ACRE_TSK_LEAVE
+#define LOG_ACRE_TSK_LEAVE(ercd)
+#endif /* LOG_ACRE_TSK_LEAVE */
+
+#ifndef LOG_DEL_TSK_ENTER
+#define LOG_DEL_TSK_ENTER(tskid)
+#endif /* LOG_DEL_TSK_ENTER */
+
+#ifndef LOG_DEL_TSK_LEAVE
+#define LOG_DEL_TSK_LEAVE(ercd)
+#endif /* LOG_DEL_TSK_LEAVE */
+
+#ifndef LOG_ACT_TSK_ENTER
+#define LOG_ACT_TSK_ENTER(tskid)
+#endif /* LOG_ACT_TSK_ENTER */
+
+#ifndef LOG_ACT_TSK_LEAVE
+#define LOG_ACT_TSK_LEAVE(ercd)
+#endif /* LOG_ACT_TSK_LEAVE */
+
+#ifndef LOG_CAN_ACT_ENTER
+#define LOG_CAN_ACT_ENTER(tskid)
+#endif /* LOG_CAN_ACT_ENTER */
+
+#ifndef LOG_CAN_ACT_LEAVE
+#define LOG_CAN_ACT_LEAVE(ercd)
+#endif /* LOG_CAN_ACT_LEAVE */
+
+#ifndef LOG_GET_TST_ENTER
+#define LOG_GET_TST_ENTER(tskid, p_tskstat)
+#endif /* LOG_GET_TST_ENTER */
+
+#ifndef LOG_GET_TST_LEAVE
+#define LOG_GET_TST_LEAVE(ercd, p_tskstat)
+#endif /* LOG_GET_TST_LEAVE */
+
+#ifndef LOG_CHG_PRI_ENTER
+#define LOG_CHG_PRI_ENTER(tskid, tskpri)
+#endif /* LOG_CHG_PRI_ENTER */
+
+#ifndef LOG_CHG_PRI_LEAVE
+#define LOG_CHG_PRI_LEAVE(ercd)
+#endif /* LOG_CHG_PRI_LEAVE */
+
+#ifndef LOG_GET_PRI_ENTER
+#define LOG_GET_PRI_ENTER(tskid, p_tskpri)
+#endif /* LOG_GET_PRI_ENTER */
+
+#ifndef LOG_GET_PRI_LEAVE
+#define LOG_GET_PRI_LEAVE(ercd, p_tskpri)
+#endif /* LOG_GET_PRI_LEAVE */
+
+#ifndef LOG_GET_INF_ENTER
+#define LOG_GET_INF_ENTER(p_exinf)
+#endif /* LOG_GET_INF_ENTER */
+
+#ifndef LOG_GET_INF_LEAVE
+#define LOG_GET_INF_LEAVE(ercd, p_exinf)
+#endif /* LOG_GET_INF_LEAVE */
+
+/*
+ *  ã¿ã¹ã¯ã®çæ
+ */
+#ifdef TOPPERS_acre_tsk
+
+#ifndef TARGET_MIN_STKSZ
+#define TARGET_MIN_STKSZ	1U		/* æªå®ç¾©ã®å ´åã¯0ã§ãªããã¨ããã§ãã¯ */
+#endif /* TARGET_MIN_STKSZ */
+
+ER_UINT
+acre_tsk(const T_CTSK *pk_ctsk)
+{
+	TCB		*p_tcb;
+	TINIB	*p_tinib;
+	ATR		tskatr;
+	void	*stk;
+	ER		ercd;
+
+	LOG_ACRE_TSK_ENTER(pk_ctsk);
+	CHECK_TSKCTX_UNL();
+	CHECK_RSATR(pk_ctsk->tskatr, TA_ACT|TARGET_TSKATR);
+	CHECK_PAR(FUNC_ALIGN(pk_ctsk->task));
+	CHECK_PAR(FUNC_NONNULL(pk_ctsk->task));
+	CHECK_PAR(VALID_TPRI(pk_ctsk->itskpri));
+	CHECK_PAR(pk_ctsk->stksz >= TARGET_MIN_STKSZ);
+	if (pk_ctsk->stk != NULL) {
+		CHECK_PAR(STKSZ_ALIGN(pk_ctsk->stksz));
+		CHECK_PAR(STACK_ALIGN(pk_ctsk->stk));
+	}
+	tskatr = pk_ctsk->tskatr;
+	stk = pk_ctsk->stk;
+
+	lock_cpu();
+	if (queue_empty(&free_tcb)) {
+		ercd = E_NOID;
+	}
+	else {
+		if (stk == NULL) {
+			stk = kernel_malloc(ROUND_STK_T(pk_ctsk->stksz));
+			tskatr |= TA_MEMALLOC;
+		}
+		if (stk == NULL) {
+			ercd = E_NOMEM;
+		}
+		else {
+			p_tcb = ((TCB *) queue_delete_next(&free_tcb));
+			p_tinib = (TINIB *)(p_tcb->p_tinib);
+			p_tinib->tskatr = tskatr;
+			p_tinib->exinf = pk_ctsk->exinf;
+			p_tinib->task = pk_ctsk->task;
+			p_tinib->ipriority = INT_PRIORITY(pk_ctsk->itskpri);
+#ifdef USE_TSKINICTXB
+			init_tskinictxb(&(p_tinib->tskinictxb), stk, pk_ctsk);
+#else /* USE_TSKINICTXB */
+			p_tinib->stksz = pk_ctsk->stksz;
+			p_tinib->stk = stk;
+#endif /* USE_TSKINICTXB */
+
+			p_tcb->actque = false;
+			make_dormant(p_tcb);
+			if ((p_tcb->p_tinib->tskatr & TA_ACT) != 0U) {
+				make_active(p_tcb);
+			}
+			ercd = TSKID(p_tcb);
+		}
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ACRE_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_acre_tsk */
+
+/*
+ *  ã¿ã¹ã¯ã®åé¤ï¼»NGKI1100ï¼½
+ */
+#ifdef TOPPERS_del_tsk
+
+ER
+del_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	TINIB	*p_tinib;
+	ER		ercd;
+
+	LOG_DEL_TSK_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1101ï¼½ï¼»NGKI1102ï¼½*/
+	CHECK_ID(VALID_TSKID(tskid));				/*ï¼»NGKI1103ï¼½*/
+	p_tcb = get_tcb(tskid);
+
+	lock_cpu();
+	if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;							/*ï¼»NGKI1104ï¼½*/
+	}
+	else if (tskid <= tmax_stskid || !TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1106ï¼½ï¼»NGKI1107ï¼½*/
+	}
+	else {
+		p_tinib = (TINIB *)(p_tcb->p_tinib);
+#ifdef USE_TSKINICTXB
+		term_tskinictxb(&(p_tinib->tskinictxb));
+#else /* USE_TSKINICTXB */
+		if ((p_tinib->tskatr & TA_MEMALLOC) != 0U) {	/*ï¼»NGKI1109ï¼½*/
+			kernel_free(p_tinib->stk);
+		}
+#endif /* USE_TSKINICTXB */
+		p_tinib->tskatr = TA_NOEXS;				/*ï¼»NGKI1108ï¼½*/
+		queue_insert_prev(&free_tcb, &(p_tcb->task_queue));
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_DEL_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_del_tsk */
+
+/*
+ *  ã¿ã¹ã¯ã®èµ·åï¼»NGKI3529ï¼½
+ */
+#ifdef TOPPERS_act_tsk
+
+ER
+act_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_ACT_TSK_ENTER(tskid);
+	CHECK_UNL();								/*ï¼»NGKI1114ï¼½*/
+	if (tskid == TSK_SELF && !sense_context()) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1121ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1115ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;							/*ï¼»NGKI1116ï¼½*/
+	}
+	else if (TSTAT_DORMANT(p_tcb->tstat)) {
+		make_active(p_tcb);						/*ï¼»NGKI1118ï¼½*/
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	else if ((p_tcb->p_tinib->tskatr & TA_NOACTQUE) != 0U || p_tcb->actque) {
+		ercd = E_QOVR;			   				/*ï¼»NGKI3528ï¼½*/
+	}
+	else {
+		p_tcb->actque = true;					/*ï¼»NGKI3527ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ACT_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_act_tsk */
+
+/*
+ *  ã¿ã¹ã¯èµ·åè¦æ±ã®ã­ã£ã³ã»ã«ï¼»NGKI1138ï¼½
+ */
+#ifdef TOPPERS_can_act
+
+ER_UINT
+can_act(ID tskid)
+{
+	TCB		*p_tcb;
+	ER_UINT	ercd;
+
+	LOG_CAN_ACT_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1139ï¼½ï¼»NGKI1140ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1146ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1141ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;							/*ï¼»NGKI1142ï¼½*/
+	}
+	else {
+		ercd = p_tcb->actque ? 1 : 0;			/*ï¼»NGKI1144ï¼½*/
+		p_tcb->actque = false;					/*ï¼»NGKI1144ï¼½*/
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_CAN_ACT_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_can_act */
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+ã®åç
+§ï¼»NGKI3613ï¼½
+ */
+#ifdef TOPPERS_get_tst
+
+ER
+get_tst(ID tskid, STAT *p_tskstat)
+{
+	TCB		*p_tcb;
+	uint_t	tstat;
+	ER		ercd;
+
+	LOG_GET_TST_ENTER(tskid, p_tskstat);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3614ï¼½ï¼»NGKI3615ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI3621ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI3616ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	tstat = p_tcb->tstat;
+	if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;							/*ï¼»NGKI3617ï¼½*/
+	}
+	else if (TSTAT_DORMANT(tstat)) {			/*ï¼»NGKI3620ï¼½*/
+		*p_tskstat = TTS_DMT;
+	}
+	else if (TSTAT_SUSPENDED(tstat)) {
+		if (TSTAT_WAITING(tstat)) {
+			*p_tskstat = TTS_WAS;
+		}
+		else {
+			*p_tskstat = TTS_SUS;
+		}
+	}
+	else if (TSTAT_WAITING(tstat)) {
+		*p_tskstat = TTS_WAI;
+	}
+	else if (p_tcb == p_runtsk) {
+		*p_tskstat = TTS_RUN;
+	}
+	else {
+		*p_tskstat = TTS_RDY;
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_TST_LEAVE(ercd, p_tskstat);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_tst */
+
+/*
+ *  ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ã®å¤æ´ï¼»NGKI1183ï¼½
+ */
+#ifdef TOPPERS_chg_pri
+
+ER
+chg_pri(ID tskid, PRI tskpri)
+{
+	TCB		*p_tcb;
+	uint_t	newbpri;
+	ER		ercd;
+
+	LOG_CHG_PRI_ENTER(tskid, tskpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1184ï¼½ï¼»NGKI1185ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1198ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1187ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+	if (tskpri == TPRI_INI) {
+		newbpri = p_tcb->p_tinib->ipriority;	/*ï¼»NGKI1199ï¼½*/
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));			/*ï¼»NGKI1188ï¼½*/
+		newbpri = INT_PRIORITY(tskpri);
+	}
+
+	lock_cpu();
+	if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;							/*ï¼»NGKI1189ï¼½*/
+	}
+	else if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1191ï¼½*/
+	}
+	else if ((p_tcb->p_lastmtx != NULL || TSTAT_WAIT_MTX(p_tcb->tstat))
+						&& !((*mtxhook_check_ceilpri)(p_tcb, newbpri))) {
+		ercd = E_ILUSE;							/*ï¼»NGKI1201ï¼½*/
+	}
+	else {
+		p_tcb->bpriority = newbpri;				/*ï¼»NGKI1192ï¼½*/
+		if (p_tcb->p_lastmtx == NULL || !((*mtxhook_scan_ceilmtx)(p_tcb))) {
+			change_priority(p_tcb, newbpri, false);		/*ï¼»NGKI1193ï¼½*/
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}									/*ï¼»NGKI1197ï¼½*/
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_CHG_PRI_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_chg_pri */
+
+/*
+ *  ã¿ã¹ã¯åªå
+åº¦ã®åç
+§ï¼»NGKI1202ï¼½
+ */
+#ifdef TOPPERS_get_pri
+
+ER
+get_pri(ID tskid, PRI *p_tskpri)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_GET_PRI_ENTER(tskid, p_tskpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1203ï¼½ï¼»NGKI1204ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1211ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1205ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;							/*ï¼»NGKI1206ï¼½*/
+	}
+	else if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1209ï¼½*/
+	}
+	else {
+		*p_tskpri = EXT_TSKPRI(p_tcb->priority);	/*ï¼»NGKI1210ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_PRI_LEAVE(ercd, p_tskpri);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_pri */
+
+/*
+ *  èªã¿ã¹ã¯ã®æ¡å¼µæ
+å ±ã®åç
+§ï¼»NGKI1212ï¼½
+ */
+#ifdef TOPPERS_get_inf
+
+ER
+get_inf(intptr_t *p_exinf)
+{
+	ER		ercd;
+
+	LOG_GET_INF_ENTER(p_exinf);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1213ï¼½ï¼»NGKI1214ï¼½*/
+
+	lock_cpu();
+	*p_exinf = p_runtsk->p_tinib->exinf;		/*ï¼»NGKI1216ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_INF_LEAVE(ercd, p_exinf);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_inf */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/task_refer.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/task_refer.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/task_refer.c	(revision 302)
@@ -0,0 +1,251 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: task_refer.c 151 2014-05-24 23:40:24Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ã®ç¶æ
+åç
+§æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "semaphore.h"
+#include "eventflag.h"
+#include "dataqueue.h"
+#include "pridataq.h"
+#include "mutex.h"
+#include "mempfix.h"
+#include "time_event.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_REF_TSK_ENTER
+#define LOG_REF_TSK_ENTER(tskid, pk_rtsk)
+#endif /* LOG_REF_TSK_ENTER */
+
+#ifndef LOG_REF_TSK_LEAVE
+#define LOG_REF_TSK_LEAVE(ercd, pk_rtsk)
+#endif /* LOG_REF_TSK_LEAVE */
+
+/*
+ *  ã¿ã¹ã¯ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_tsk
+
+ER
+ref_tsk(ID tskid, T_RTSK *pk_rtsk)
+{
+	TCB		*p_tcb;
+	uint_t	tstat;
+	ER		ercd;
+
+	LOG_REF_TSK_ENTER(tskid, pk_rtsk);
+	CHECK_TSKCTX_UNL();
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else {
+		tstat = p_tcb->tstat;
+		if (TSTAT_DORMANT(tstat)) {
+			/*
+	 		 *  å¯¾è±¡ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ã®å ´å
+			 */
+			pk_rtsk->tskstat = TTS_DMT;
+		}
+		else {
+			/*
+	 		 *  ã¿ã¹ã¯ç¶æ
+ã®ååºã
+			 */
+			if (TSTAT_SUSPENDED(tstat)) {
+				if (TSTAT_WAITING(tstat)) {
+					pk_rtsk->tskstat = TTS_WAS;
+				}
+				else {
+					pk_rtsk->tskstat = TTS_SUS;
+				}
+			}
+			else if (TSTAT_WAITING(tstat)) {
+				pk_rtsk->tskstat = TTS_WAI;
+			}
+			else if (p_tcb == p_runtsk) {
+				pk_rtsk->tskstat = TTS_RUN;
+			}
+			else {
+				pk_rtsk->tskstat = TTS_RDY;
+			}
+
+			/*
+	 		 *  ç¾å¨åªå
+åº¦ã¨ãã¼ã¹åªå
+åº¦ã®ååºã
+			 */
+			pk_rtsk->tskpri = EXT_TSKPRI(p_tcb->priority);
+			pk_rtsk->tskbpri = EXT_TSKPRI(p_tcb->bpriority);
+
+			if (TSTAT_WAITING(tstat)) {
+				/*
+		 		 *  å¾
+ã¡è¦å ã¨å¾
+ã¡å¯¾è±¡ã®ãªãã¸ã§ã¯ãã®IDã®ååºã
+				 */
+				switch (tstat) {
+				case TS_WAITING_SLP:
+					pk_rtsk->tskwait = TTW_SLP;
+					break;
+				case TS_WAITING_DLY:
+					pk_rtsk->tskwait = TTW_DLY;
+					break;
+				case TS_WAITING_SEM:
+					pk_rtsk->tskwait = TTW_SEM;
+					pk_rtsk->wobjid = SEMID(((WINFO_SEM *)(p_tcb->p_winfo))
+																->p_semcb);
+					break;
+				case TS_WAITING_FLG:
+					pk_rtsk->tskwait = TTW_FLG;
+					pk_rtsk->wobjid = FLGID(((WINFO_FLG *)(p_tcb->p_winfo))
+																->p_flgcb);
+					break;
+				case TS_WAITING_SDTQ:
+					pk_rtsk->tskwait = TTW_SDTQ;
+					pk_rtsk->wobjid = DTQID(((WINFO_SDTQ *)(p_tcb->p_winfo))
+																->p_dtqcb);
+					break;
+				case TS_WAITING_RDTQ:
+					pk_rtsk->tskwait = TTW_RDTQ;
+					pk_rtsk->wobjid = DTQID(((WINFO_RDTQ *)(p_tcb->p_winfo))
+																->p_dtqcb);
+					break;
+				case TS_WAITING_SPDQ:
+					pk_rtsk->tskwait = TTW_SPDQ;
+					pk_rtsk->wobjid = PDQID(((WINFO_SPDQ *)(p_tcb->p_winfo))
+																->p_pdqcb);
+					break;
+				case TS_WAITING_RPDQ:
+					pk_rtsk->tskwait = TTW_RPDQ;
+					pk_rtsk->wobjid = PDQID(((WINFO_RPDQ *)(p_tcb->p_winfo))
+																->p_pdqcb);
+					break;
+				case TS_WAITING_MTX:
+					pk_rtsk->tskwait = TTW_MTX;
+					pk_rtsk->wobjid = MTXID(((WINFO_MTX *)(p_tcb->p_winfo))
+																->p_mtxcb);
+					break;
+				case TS_WAITING_MPF:
+					pk_rtsk->tskwait = TTW_MPF;
+					pk_rtsk->wobjid = MPFID(((WINFO_MPF *)(p_tcb->p_winfo))
+																->p_mpfcb);
+					break;
+				}
+
+				/*
+		 		 *  ã¿ã¤ã ã¢ã¦ãããã¾ã§ã®æéã®ååºã
+				 */
+				if (p_tcb->p_winfo->p_tmevtb != NULL) {
+					pk_rtsk->lefttmo
+							= (TMO) tmevt_lefttim(p_tcb->p_winfo->p_tmevtb);
+				}
+				else {
+					pk_rtsk->lefttmo = TMO_FEVR;
+				}
+			}
+
+			/*
+	 		 *  èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®ååºã
+			 */
+			pk_rtsk->wupcnt = p_tcb->wupque ? 1U : 0U;
+
+			/*
+			 *  ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ã®ååºã
+			 */
+			pk_rtsk->raster = p_tcb->raster;
+
+			/*
+			 *  ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã®ååºã
+			 */
+			pk_rtsk->dister = !(p_tcb->enater);
+		}
+
+		/*
+		 *  èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®ååºã
+		 */
+		pk_rtsk->actcnt = p_tcb->actque ? 1U : 0U;
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_TSK_LEAVE(ercd, pk_rtsk);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_tsk */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/task_sync.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/task_sync.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/task_sync.c	(revision 302)
@@ -0,0 +1,539 @@
+/*
+ *  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: task_sync.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ä»å±åææ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_SLP_TSK_ENTER
+#define LOG_SLP_TSK_ENTER()
+#endif /* LOG_SLP_TSK_ENTER */
+
+#ifndef LOG_SLP_TSK_LEAVE
+#define LOG_SLP_TSK_LEAVE(ercd)
+#endif /* LOG_SLP_TSK_LEAVE */
+
+#ifndef LOG_TSLP_TSK_ENTER
+#define LOG_TSLP_TSK_ENTER(tmout)
+#endif /* LOG_TSLP_TSK_ENTER */
+
+#ifndef LOG_TSLP_TSK_LEAVE
+#define LOG_TSLP_TSK_LEAVE(ercd)
+#endif /* LOG_TSLP_TSK_LEAVE */
+
+#ifndef LOG_WUP_TSK_ENTER
+#define LOG_WUP_TSK_ENTER(tskid)
+#endif /* LOG_WUP_TSK_ENTER */
+
+#ifndef LOG_WUP_TSK_LEAVE
+#define LOG_WUP_TSK_LEAVE(ercd)
+#endif /* LOG_WUP_TSK_LEAVE */
+
+#ifndef LOG_CAN_WUP_ENTER
+#define LOG_CAN_WUP_ENTER(tskid)
+#endif /* LOG_CAN_WUP_ENTER */
+
+#ifndef LOG_CAN_WUP_LEAVE
+#define LOG_CAN_WUP_LEAVE(ercd)
+#endif /* LOG_CAN_WUP_LEAVE */
+
+#ifndef LOG_REL_WAI_ENTER
+#define LOG_REL_WAI_ENTER(tskid)
+#endif /* LOG_REL_WAI_ENTER */
+
+#ifndef LOG_REL_WAI_LEAVE
+#define LOG_REL_WAI_LEAVE(ercd)
+#endif /* LOG_REL_WAI_LEAVE */
+
+#ifndef LOG_SUS_TSK_ENTER
+#define LOG_SUS_TSK_ENTER(tskid)
+#endif /* LOG_SUS_TSK_ENTER */
+
+#ifndef LOG_SUS_TSK_LEAVE
+#define LOG_SUS_TSK_LEAVE(ercd)
+#endif /* LOG_SUS_TSK_LEAVE */
+
+#ifndef LOG_RSM_TSK_ENTER
+#define LOG_RSM_TSK_ENTER(tskid)
+#endif /* LOG_RSM_TSK_ENTER */
+
+#ifndef LOG_RSM_TSK_LEAVE
+#define LOG_RSM_TSK_LEAVE(ercd)
+#endif /* LOG_RSM_TSK_LEAVE */
+
+#ifndef LOG_DLY_TSK_ENTER
+#define LOG_DLY_TSK_ENTER(dlytim)
+#endif /* LOG_DLY_TSK_ENTER */
+
+#ifndef LOG_DLY_TSK_LEAVE
+#define LOG_DLY_TSK_LEAVE(ercd)
+#endif /* LOG_DLY_TSK_LEAVE */
+
+/*
+ *  èµ·åºå¾
+ã¡
+ */
+#ifdef TOPPERS_slp_tsk
+
+ER
+slp_tsk(void)
+{
+	WINFO	winfo;
+	ER		ercd;
+
+	LOG_SLP_TSK_ENTER();
+	CHECK_DISPATCH();
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_runtsk->wupque) {
+		p_runtsk->wupque = false;
+		ercd = E_OK;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_SLP;
+		make_wait(&winfo);
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_SLP_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_slp_tsk */
+
+/*
+ *  èµ·åºå¾
+ã¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_tslp_tsk
+
+ER
+tslp_tsk(TMO tmout)
+{
+	WINFO	winfo;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TSLP_TSK_ENTER(tmout);
+	CHECK_DISPATCH();
+	CHECK_PAR(VALID_TMOUT(tmout));
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_runtsk->wupque) {
+		p_runtsk->wupque = false;
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_SLP;
+		make_wait_tmout(&winfo, &tmevtb, tmout);
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TSLP_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_tslp_tsk */
+
+/*
+ *  ã¿ã¹ã¯ã®èµ·åº
+ */
+#ifdef TOPPERS_wup_tsk
+
+ER
+wup_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_WUP_TSK_ENTER(tskid);
+	CHECK_UNL();
+	if (tskid == TSK_SELF && !sense_context()) {
+		p_tcb = p_runtsk;
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;
+	}
+	else if (TSTAT_WAIT_SLP(p_tcb->tstat)) {
+		wait_complete(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	else if (!(p_tcb->wupque)) {
+		p_tcb->wupque = true;
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_QOVR;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_WUP_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_wup_tsk */
+
+/*
+ *  ã¿ã¹ã¯èµ·åºè¦æ±ã®ã­ã£ã³ã»ã«
+ */
+#ifdef TOPPERS_can_wup
+
+ER_UINT
+can_wup(ID tskid)
+{
+	TCB		*p_tcb;
+	ER_UINT	ercd;
+
+	LOG_CAN_WUP_ENTER(tskid);
+	CHECK_TSKCTX_UNL();
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;
+	}
+	else {
+		ercd = p_tcb->wupque ? 1 : 0;
+		p_tcb->wupque = false;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_CAN_WUP_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_can_wup */
+
+/*
+ *  å¾
+ã¡ç¶æ
+ã®å¼·å¶è§£é¤
+ */
+#ifdef TOPPERS_rel_wai
+
+ER
+rel_wai(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_REL_WAI_ENTER(tskid);
+	CHECK_UNL();
+	CHECK_ID(VALID_TSKID(tskid));
+	p_tcb = get_tcb(tskid);
+
+	lock_cpu();
+	if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (!TSTAT_WAITING(p_tcb->tstat)) {
+		ercd = E_OBJ;
+	}
+	else {
+		wait_dequeue_wobj(p_tcb);
+		wait_dequeue_tmevtb(p_tcb);
+		p_tcb->p_winfo->wercd = E_RLWAI;
+		make_non_wait(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REL_WAI_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rel_wai */
+
+/*
+ *  å¼·å¶å¾
+ã¡ç¶æ
+ã¸ã®ç§»è¡ï¼»NGKI1298ï¼½
+ */
+#ifdef TOPPERS_sus_tsk
+
+ER
+sus_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_SUS_TSK_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1299ï¼½ï¼»NGKI1300ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1310ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1302ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (p_tcb == p_runtsk && !dspflg) {			/*ï¼»NGKI1311ï¼½ï¼»NGKI3604ï¼½*/
+		ercd = E_CTX;
+	}
+	else if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;							/*ï¼»NGKI1303ï¼½*/
+	}
+	else if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1305ï¼½*/
+	}
+	else if (p_tcb->raster) {
+		ercd = E_RASTER;						/*ï¼»NGKI3605ï¼½*/
+	}
+	else if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		/*
+		 *  å®è¡ã§ããç¶æ
+ããå¼·å¶å¾
+ã¡ç¶æ
+ã¸ã®é·ç§»ï¼»NGKI1307ï¼½
+		 */
+		p_tcb->tstat = TS_SUSPENDED;
+		LOG_TSKSTAT(p_tcb);
+		make_non_runnable(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else if (TSTAT_SUSPENDED(p_tcb->tstat)) {
+		ercd = E_QOVR;							/*ï¼»NGKI1306ï¼½*/
+	}
+	else {
+		/*
+		 *  å¾
+ã¡ç¶æ
+ããäºéå¾
+ã¡ç¶æ
+ã¸ã®é·ç§»ï¼»NGKI1308ï¼½
+		 */
+		p_tcb->tstat |= TS_SUSPENDED;
+		LOG_TSKSTAT(p_tcb);
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_SUS_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_sus_tsk */
+
+/*
+ *  å¼·å¶å¾
+ã¡ç¶æ
+ããã®åé
+ */
+#ifdef TOPPERS_rsm_tsk
+
+ER
+rsm_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_RSM_TSK_ENTER(tskid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_TSKID(tskid));
+	p_tcb = get_tcb(tskid);
+
+	lock_cpu();
+	if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;
+	}
+	else if (!TSTAT_SUSPENDED(p_tcb->tstat)) {
+		ercd = E_OBJ;
+	}
+	else if (!TSTAT_WAITING(p_tcb->tstat)) {
+		/*
+		 *  å¼·å¶å¾
+ã¡ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+		 */
+		p_tcb->tstat = TS_RUNNABLE;
+		LOG_TSKSTAT(p_tcb);
+		make_runnable(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		/*
+		 *  äºéå¾
+ã¡ç¶æ
+ããå¾
+ã¡ç¶æ
+ã¸ã®é·ç§»
+		 */
+		p_tcb->tstat &= ~TS_SUSPENDED;
+		LOG_TSKSTAT(p_tcb);
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_RSM_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rsm_tsk */
+
+/*
+ *  èªã¿ã¹ã¯ã®é
+å»¶
+ */
+#ifdef TOPPERS_dly_tsk
+
+ER
+dly_tsk(RELTIM dlytim)
+{
+	WINFO	winfo;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_DLY_TSK_ENTER(dlytim);
+	CHECK_DISPATCH();
+	CHECK_PAR(VALID_RELTIM(dlytim));
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_DLY;
+		make_non_runnable(p_runtsk);
+		p_runtsk->p_winfo = &winfo;
+		winfo.p_tmevtb = &tmevtb;
+		tmevtb.callback = (CBACK) wait_tmout_ok;
+		tmevtb.arg = (void *) p_runtsk;
+		tmevtb_enqueue(&tmevtb, dlytim);
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_DLY_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_dly_tsk */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/task_term.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/task_term.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/task_term.c	(revision 302)
@@ -0,0 +1,359 @@
+/*
+ *  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: task_term.c 275 2014-11-03 14:26:05Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯çµäºæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_EXT_TSK_ENTER
+#define LOG_EXT_TSK_ENTER()
+#endif /* LOG_EXT_TSK_ENTER */
+
+#ifndef LOG_EXT_TSK_LEAVE
+#define LOG_EXT_TSK_LEAVE(ercd)
+#endif /* LOG_EXT_TSK_LEAVE */
+
+#ifndef LOG_RAS_TER_ENTER
+#define LOG_RAS_TER_ENTER(tskid)
+#endif /* LOG_RAS_TER_ENTER */
+
+#ifndef LOG_RAS_TER_LEAVE
+#define LOG_RAS_TER_LEAVE(ercd)
+#endif /* LOG_RAS_TER_LEAVE */
+
+#ifndef LOG_DIS_TER_ENTER
+#define LOG_DIS_TER_ENTER()
+#endif /* LOG_DIS_TER_ENTER */
+
+#ifndef LOG_DIS_TER_LEAVE
+#define LOG_DIS_TER_LEAVE(ercd)
+#endif /* LOG_DIS_TER_LEAVE */
+
+#ifndef LOG_ENA_TER_ENTER
+#define LOG_ENA_TER_ENTER()
+#endif /* LOG_ENA_TER_ENTER */
+
+#ifndef LOG_ENA_TER_LEAVE
+#define LOG_ENA_TER_LEAVE(ercd)
+#endif /* LOG_ENA_TER_LEAVE */
+
+#ifndef LOG_SNS_TER_ENTER
+#define LOG_SNS_TER_ENTER()
+#endif /* LOG_SNS_TER_ENTER */
+
+#ifndef LOG_SNS_TER_LEAVE
+#define LOG_SNS_TER_LEAVE(state)
+#endif /* LOG_SNS_TER_LEAVE */
+
+#ifndef LOG_TER_TSK_ENTER
+#define LOG_TER_TSK_ENTER(tskid)
+#endif /* LOG_TER_TSK_ENTER */
+
+#ifndef LOG_TER_TSK_LEAVE
+#define LOG_TER_TSK_LEAVE(ercd)
+#endif /* LOG_TER_TSK_LEAVE */
+
+/*
+ *  èªã¿ã¹ã¯ã®çµäºï¼»NGKI1162ï¼½
+ */
+#ifdef TOPPERS_ext_tsk
+
+ER
+ext_tsk(void)
+{
+	PRI		intpri;
+	ER		ercd;
+
+	LOG_EXT_TSK_ENTER();
+	CHECK_TSKCTX();							/*ï¼»NGKI1164ï¼½*/
+
+	if (sense_lock()) {
+		/*
+		 *  CPUã­ãã¯ç¶æ
+ã§ext_tskãå¼ã°ããå ´åã¯ï¼CPUã­ãã¯ãè§£é¤ã
+		 *  ã¦ããã¿ã¹ã¯ãçµäºããï¼å®è£
+ä¸ã¯ï¼ãµã¼ãã¹ã³ã¼ã«å
+ã§ã®CPU
+		 *  ã­ãã¯ãçç¥ããã°ããã ãï¼ï¼»NGKI1168ï¼½
+		 */
+	}
+	else {
+		lock_cpu();
+	}
+
+	intpri = t_get_ipm();
+	if (!enadsp || intpri != TIPM_ENAALL) {
+		if (!enadsp) {
+			/*
+			 *  ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§ext_tskãå¼ã°ããå ´åã¯ï¼ãã£ã¹ãã
+			 *  ãè¨±å¯ç¶æ
+ã«ãã¦ããã¿ã¹ã¯ãçµäºããï¼ï¼»NGKI1168ï¼½
+			 */
+			enadsp = true;
+		}
+		if (intpri != TIPM_ENAALL) {
+			/*
+			 *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼IPMï¼ãTIPM_ENAALLä»¥å¤ã®ç¶æ
+ã§
+			 *  ext_tskãå¼ã°ããå ´åã¯ï¼IPMãTIPM_ENAALLã«ãã¦ããã¿ã¹
+			 *  ã¯ãçµäºããï¼ï¼»NGKI1168ï¼½
+			 */
+			t_set_ipm(TIPM_ENAALL);
+		}
+		dspflg = true;
+		p_schedtsk = search_schedtsk();
+	}
+
+	task_terminate(p_runtsk);				/* ï¼»NGKI3449ï¼½*/
+	exit_and_dispatch();					/* ï¼»NGKI1169ï¼½*/
+	ercd = E_SYS;							/* ï¼»NGKI1163ï¼½*/
+
+  error_exit:
+	LOG_EXT_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ext_tsk */
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºè¦æ±ï¼»NGKI3469ï¼½
+ */
+#ifdef TOPPERS_ras_ter
+
+ER
+ras_ter(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_RAS_TER_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3470ï¼½ï¼»NGKI3471ï¼½*/
+	CHECK_ID(VALID_TSKID(tskid));				/*ï¼»NGKI3472ï¼½*/
+	p_tcb = get_tcb(tskid);
+	CHECK_ILUSE(p_tcb != p_runtsk);				/*ï¼»NGKI3475ï¼½*/
+
+	lock_cpu();
+	if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;							/*ï¼»NGKI3473ï¼½*/
+	}
+	else if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI3476ï¼½*/
+	}
+	else if (p_tcb->enater) {
+		task_terminate(p_tcb);					/*ï¼»NGKI3477ï¼½*/
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		p_tcb->raster = true;					/*ï¼»NGKI3478ï¼½*/
+		if (!TSTAT_RUNNABLE(p_tcb->tstat)) {
+			if (TSTAT_WAITING(p_tcb->tstat)) {
+				wait_dequeue_wobj(p_tcb);		/*ï¼»NGKI3479ï¼½*/
+				wait_dequeue_tmevtb(p_tcb);
+				p_tcb->p_winfo->wercd = E_RASTER;	/*ï¼»NGKI3480ï¼½*/
+			}
+			p_tcb->tstat = TS_RUNNABLE;			/*ï¼»NGKI3606ï¼½*/
+			LOG_TSKSTAT(p_tcb);
+			make_runnable(p_tcb);
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_RAS_TER_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ras_ter */
+
+/*
+ *  ã¿ã¹ã¯çµäºã®ç¦æ­¢ï¼»NGKI3482ï¼½
+ */
+#ifdef TOPPERS_dis_ter
+
+ER
+dis_ter(void)
+{
+	ER		ercd;
+
+	LOG_DIS_TER_ENTER();
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3483ï¼½ï¼»NGKI3484ï¼½*/
+
+	lock_cpu();
+	p_runtsk->enater = false;					/*ï¼»NGKI3486ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_DIS_TER_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_dis_ter */
+
+/*
+ *  ã¿ã¹ã¯çµäºã®è¨±å¯ï¼»NGKI3487ï¼½
+ */
+#ifdef TOPPERS_ena_ter
+
+ER
+ena_ter(void)
+{
+	ER		ercd;
+
+	LOG_ENA_TER_ENTER();
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3488ï¼½ï¼»NGKI3489ï¼½*/
+
+	lock_cpu();
+	if (p_runtsk->raster && dspflg) {
+		task_terminate(p_runtsk);
+		exit_and_dispatch();
+		ercd = E_SYS;
+	}
+	else {
+		p_runtsk->enater = true;				/*ï¼»NGKI3491ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ENA_TER_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ena_ter */
+
+/*
+ *  ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã®åç
+§ï¼»NGKI3494ï¼½
+ */
+#ifdef TOPPERS_sns_ter
+
+bool_t
+sns_ter(void)
+{
+	bool_t	state;
+
+	LOG_SNS_TER_ENTER();
+	/*
+	 *  enaterãå¤æ´ã§ããã®ã¯èªã¿ã¹ã¯ã®ã¿ã§ããããï¼æä»å¶å¾¡ããã«èª­
+	 *  ãã§ãåé¡ãªãï¼
+	 */
+	state = (p_runtsk != NULL && p_runtsk->enater) ? false : true;
+												/*ï¼»NGKI3495ï¼½ï¼»NGKI3496ï¼½*/
+	LOG_SNS_TER_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_ter */
+
+/*
+ *  ã¿ã¹ã¯ã®å¼·å¶çµäºï¼»NGKI1170ï¼½
+ */
+#ifdef TOPPERS_ter_tsk
+
+ER
+ter_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_TER_TSK_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1171ï¼½ï¼»NGKI1172ï¼½*/
+	CHECK_ID(VALID_TSKID(tskid));				/*ï¼»NGKI1173ï¼½*/
+	p_tcb = get_tcb(tskid);
+	CHECK_ILUSE(p_tcb != p_runtsk);				/*ï¼»NGKI1176ï¼½*/
+
+	lock_cpu();
+	if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
+		ercd = E_NOEXS;							/*ï¼»NGKI1174ï¼½*/
+	}
+	else if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1177ï¼½*/
+	}
+	else {
+		task_terminate(p_tcb);					/*ï¼»NGKI3450ï¼½*/
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_TER_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ter_tsk */
Index: asp3_wo_tecs/trunk/extension/dcre/kernel/time_manage.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/kernel/time_manage.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/kernel/time_manage.c	(revision 302)
@@ -0,0 +1,390 @@
+/*
+ *  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: time_manage.c 463 2015-10-18 14:25:55Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã æå»ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "semaphore.h"
+#include "eventflag.h"
+#include "dataqueue.h"
+#include "time_event.h"
+#include "target_timer.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_SET_TIM_ENTER
+#define LOG_SET_TIM_ENTER(systim)
+#endif /* LOG_SET_TIM_ENTER */
+
+#ifndef LOG_SET_TIM_LEAVE
+#define LOG_SET_TIM_LEAVE(ercd)
+#endif /* LOG_SET_TIM_LEAVE */
+
+#ifndef LOG_GET_TIM_ENTER
+#define LOG_GET_TIM_ENTER(p_systim)
+#endif /* LOG_GET_TIM_ENTER */
+
+#ifndef LOG_GET_TIM_LEAVE
+#define LOG_GET_TIM_LEAVE(ercd, p_systim)
+#endif /* LOG_GET_TIM_LEAVE */
+
+#ifndef LOG_ADJ_TIM_ENTER
+#define LOG_ADJ_TIM_ENTER(adjtim)
+#endif /* LOG_ADJ_TIM_ENTER */
+
+#ifndef LOG_ADJ_TIM_LEAVE
+#define LOG_ADJ_TIM_LEAVE(ercd)
+#endif /* LOG_ADJ_TIM_LEAVE */
+
+#ifndef LOG_FCH_HRT_ENTER
+#define LOG_FCH_HRT_ENTER()
+#endif /* LOG_FCH_HRT_ENTER */
+
+#ifndef LOG_FCH_HRT_LEAVE
+#define LOG_FCH_HRT_LEAVE(hrtcnt)
+#endif /* LOG_FCH_HRT_LEAVE */
+
+/*
+ *  ã·ã¹ãã æå»ã®è¨­å®ï¼»NGKI3563ï¼½
+ */
+#ifdef TOPPERS_set_tim
+
+ER
+set_tim(SYSTIM systim)
+{
+	ER		ercd;
+
+	LOG_SET_TIM_ENTER(systim);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3564ï¼½ï¼»NGKI3565ï¼½*/
+
+	lock_cpu();
+	update_current_evttim();					/*ï¼»ASPD1059ï¼½*/
+	systim_offset = systim - monotonic_evttim;	/*ï¼»ASPD1060ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_SET_TIM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_set_tim */
+
+/*
+ *  ã·ã¹ãã æå»ã®åç
+§ï¼»NGKI2349ï¼½
+ */
+#ifdef TOPPERS_get_tim
+
+ER
+get_tim(SYSTIM *p_systim)
+{
+	ER		ercd;
+
+	LOG_GET_TIM_ENTER(p_systim);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI2350ï¼½ï¼»NGKI2351ï¼½*/
+
+	lock_cpu();
+	update_current_evttim();					/*ï¼»ASPD1057ï¼½*/
+	*p_systim = systim_offset + monotonic_evttim;	/*ï¼»ASPD1058ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_TIM_LEAVE(ercd, p_systim);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_tim */
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´ï¼»NGKI3581ï¼½
+ */
+#ifdef TOPPERS_adj_tim
+
+ER
+adj_tim(int32_t adjtim)
+{
+	EVTTIM	previous_evttim;
+	ER		ercd;
+
+	LOG_ADJ_TIM_ENTER(adjtim);
+	CHECK_UNL();								/*ï¼»NGKI3583ï¼½*/
+	CHECK_PAR(TMIN_ADJTIM <= adjtim && adjtim <= TMAX_ADJTIM);
+												/*ï¼»NGKI3584ï¼½*/
+	lock_cpu();
+	update_current_evttim();					/*ï¼»ASPD1051ï¼½*/
+	if (check_adjtim(adjtim)) {					/*ï¼»ASPD1052ï¼½*/
+		ercd = E_OBJ;
+	}
+	else {
+		previous_evttim = current_evttim;
+		current_evttim += adjtim;				/*ï¼»ASPD1053ï¼½*/
+		boundary_evttim = current_evttim - BOUNDARY_MARGIN;	/*ï¼»ASPD1055ï¼½*/
+
+		if (adjtim > 0
+				&& monotonic_evttim - previous_evttim < (EVTTIM) adjtim) {
+#ifdef UINT64_MAX
+			if (current_evttim < monotonic_evttim) {
+				systim_offset += 1LLU << 32;
+			}
+#endif /* UINT64_MAX */
+			monotonic_evttim = current_evttim;	/*ï¼»ASPD1054ï¼½*/
+		}
+
+		set_hrt_event();						/*ï¼»ASPD1056ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ADJ_TIM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_adj_tim */
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®åç
+§ï¼»NGKI3569ï¼½
+ *
+ *  ä»»æã®ç¶æ
+ããå¼ã³åºããããã«ããããã«ï¼SILã®å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®
+ *  å¶å¾¡æ©è½ãç¨ãã¦ï¼æä»å¶å¾¡ãå®ç¾ãã¦ããï¼»NGKI3572ï¼½ï¼
+ */
+#ifdef TOPPERS_fch_hrt
+
+HRTCNT
+fch_hrt(void)
+{
+	HRTCNT	hrtcnt;
+	SIL_PRE_LOC;
+
+	LOG_FCH_HRT_ENTER();
+
+	SIL_LOC_INT();
+	hrtcnt = target_hrt_get_current();			/*ï¼»NGKI3571ï¼½*/
+	SIL_UNL_INT();
+
+	LOG_FCH_HRT_LEAVE(hrtcnt);
+	return(hrtcnt);
+}
+
+#endif /* TOPPERS_fch_hrt */
+
+/*
+ *  éç¥æ¹æ³ã®ã¨ã©ã¼ãã§ãã¯
+ */
+#ifdef TOPPERS_chknfy
+
+ER
+check_nfyinfo(const T_NFYINFO *p_nfyinfo)
+{
+	ER		ercd;
+
+	if (p_nfyinfo->nfymode == TNFY_HANDLER) {
+		CHECK_PAR(FUNC_ALIGN(p_nfyinfo->nfy.handler.tmehdr));
+		CHECK_PAR(FUNC_NONNULL(p_nfyinfo->nfy.handler.tmehdr));
+	}
+	else {
+		switch (p_nfyinfo->nfymode & 0x0fU) {
+		case TNFY_SETVAR:
+			CHECK_PAR((p_nfyinfo->nfymode & ~0x0fU) == 0);
+			CHECK_PAR(INTPTR_ALIGN(p_nfyinfo->nfy.setvar.p_var));
+			CHECK_PAR(INTPTR_NONNULL(p_nfyinfo->nfy.setvar.p_var));
+			break;
+		case TNFY_INCVAR:
+			CHECK_PAR((p_nfyinfo->nfymode & ~0x0fU) == 0);
+			CHECK_PAR(INTPTR_ALIGN(p_nfyinfo->nfy.incvar.p_var));
+			CHECK_PAR(INTPTR_NONNULL(p_nfyinfo->nfy.incvar.p_var));
+			break;
+		case TNFY_ACTTSK:
+			CHECK_ID(VALID_TSKID(p_nfyinfo->nfy.acttsk.tskid));
+			break;
+		case TNFY_WUPTSK:
+			CHECK_ID(VALID_TSKID(p_nfyinfo->nfy.wuptsk.tskid));
+			break;
+		case TNFY_SIGSEM:
+			CHECK_ID(VALID_SEMID(p_nfyinfo->nfy.sigsem.semid));
+			break;
+		case TNFY_SETFLG:
+			CHECK_ID(VALID_FLGID(p_nfyinfo->nfy.setflg.flgid));
+			break;
+		case TNFY_SNDDTQ:
+			CHECK_ID(VALID_DTQID(p_nfyinfo->nfy.snddtq.dtqid));
+			break;
+		default:
+			CHECK_PAR(false);
+			break;
+		}
+		switch (p_nfyinfo->nfymode & ~0x0fU) {
+		case TENFY_SETVAR:
+			CHECK_PAR(INTPTR_ALIGN(p_nfyinfo->enfy.setvar.p_var));
+			CHECK_PAR(INTPTR_NONNULL(p_nfyinfo->enfy.setvar.p_var));
+			break;
+		case TENFY_INCVAR:
+			CHECK_PAR(INTPTR_ALIGN(p_nfyinfo->enfy.incvar.p_var));
+			CHECK_PAR(INTPTR_NONNULL(p_nfyinfo->enfy.incvar.p_var));
+			break;
+		case TENFY_ACTTSK:
+			CHECK_ID(VALID_TSKID(p_nfyinfo->enfy.acttsk.tskid));
+			break;
+		case TENFY_WUPTSK:
+			CHECK_ID(VALID_TSKID(p_nfyinfo->enfy.wuptsk.tskid));
+			break;
+		case TENFY_SIGSEM:
+			CHECK_ID(VALID_SEMID(p_nfyinfo->enfy.sigsem.semid));
+			break;
+		case TENFY_SETFLG:
+			CHECK_ID(VALID_FLGID(p_nfyinfo->enfy.setflg.flgid));
+			break;
+		case TENFY_SNDDTQ:
+			CHECK_ID(VALID_DTQID(p_nfyinfo->enfy.snddtq.dtqid));
+			break;
+		default:
+			CHECK_PAR(false);
+			break;
+		}
+	}
+	ercd = E_OK;
+
+  error_exit:
+	return(ercd);
+}
+
+#endif /* TOPPERS_chknfy */
+
+/*
+ *  éç¥ãã³ãã©
+ */
+#ifdef TOPPERS_nfyhdr
+
+void
+notify_handler(intptr_t exinf)
+{
+	T_NFYINFO	*p_nfyinfo = (T_NFYINFO *) exinf;
+	ER			ercd;
+
+	switch (p_nfyinfo->nfymode & 0x0fU) {
+	case TNFY_SETVAR:
+		*(p_nfyinfo->nfy.setvar.p_var) = p_nfyinfo->nfy.setvar.value;
+		ercd = E_OK;
+		break;
+	case TNFY_INCVAR:
+		*(p_nfyinfo->nfy.incvar.p_var) += 1;
+		ercd = E_OK;
+		break;
+	case TNFY_ACTTSK:
+		ercd = act_tsk(p_nfyinfo->nfy.acttsk.tskid);
+		break;
+	case TNFY_WUPTSK:
+		ercd = wup_tsk(p_nfyinfo->nfy.wuptsk.tskid);
+		break;
+	case TNFY_SIGSEM:
+		ercd = sig_sem(p_nfyinfo->nfy.sigsem.semid);
+		break;
+	case TNFY_SETFLG:
+		ercd = set_flg(p_nfyinfo->nfy.setflg.flgid,
+							p_nfyinfo->nfy.setflg.flgptn);
+		break;
+	case TNFY_SNDDTQ:
+		ercd = snd_dtq(p_nfyinfo->nfy.snddtq.dtqid,
+							p_nfyinfo->nfy.snddtq.data);
+		break;
+	default:
+		ercd = E_SYS;
+		break;
+	}
+
+	if (ercd != E_OK) {
+		switch (p_nfyinfo->nfymode & ~0x0fU) {
+		case TENFY_SETVAR:
+			*(p_nfyinfo->enfy.setvar.p_var) = (intptr_t) ercd;
+			break;
+		case TENFY_INCVAR:
+			*(p_nfyinfo->enfy.incvar.p_var) += 1;
+			break;
+		case TENFY_ACTTSK:
+			(void) act_tsk(p_nfyinfo->enfy.acttsk.tskid);
+			break;
+		case TENFY_WUPTSK:
+			(void) wup_tsk(p_nfyinfo->enfy.wuptsk.tskid);
+			break;
+		case TENFY_SIGSEM:
+			(void) sig_sem(p_nfyinfo->enfy.sigsem.semid);
+			break;
+		case TENFY_SETFLG:
+			(void) set_flg(p_nfyinfo->enfy.setflg.flgid,
+							p_nfyinfo->enfy.setflg.flgptn);
+			break;
+		case TENFY_SNDDTQ:
+			(void) snd_dtq(p_nfyinfo->enfy.snddtq.dtqid, (intptr_t) ercd);
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+#endif /* TOPPERS_nfyhdr */
Index: asp3_wo_tecs/trunk/extension/dcre/sample/sample1.c
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/sample/sample1.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/sample/sample1.c	(revision 302)
@@ -0,0 +1,583 @@
+/*
+ *  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) 2004-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: sample1.c 333 2015-06-21 13:23:37Z ertl-hiro $
+ */
+
+/* 
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®æ¬ä½
+ *
+ *  ASPã«ã¼ãã«ã®åºæ¬çãªåä½ãç¢ºèªããããã®ãµã³ãã«ãã­ã°ã©ã ï¼
+ *
+ *  ãã­ã°ã©ã ã®æ¦è¦:
+ *
+ *  ã¦ã¼ã¶ã¤ã³ã¿ãã§ã¼ã¹ãåãæã¤ã¡ã¤ã³ã¿ã¹ã¯ï¼ã¿ã¹ã¯ID: MAIN_TASKï¼åª
+ *  å
+åº¦: MAIN_PRIORITYï¼ã¨ï¼3ã¤ã®ä¸¦è¡å®è¡ãããã¿ã¹ã¯ï¼ã¿ã¹ã¯ID:
+ *  TASK1ãTASK3ï¼åæåªå
+åº¦: MID_PRIORITYï¼ã§æ§æãããï¼ã¾ãï¼èµ·åå¨
+ *  æã2ç§ã®å¨æãã³ãã©ï¼å¨æãã³ãã©ID: CYCHDR1ï¼ãç¨ããï¼
+ *
+ *  ä¸¦è¡å®è¡ãããã¿ã¹ã¯ã¯ï¼task_loopåç©ºã«ã¼ããå®è¡ããåº¦ã«ï¼ã¿ã¹ã¯ã
+ *  å®è¡ä¸­ã§ãããã¨ãããããã¡ãã»ã¼ã¸ãè¡¨ç¤ºããï¼ç©ºã«ã¼ããå®è¡ãã
+ *  ã®ã¯ï¼ç©ºã«ã¼ããªãã§ã¡ãã»ã¼ã¸ãåºåããã¨ï¼å¤éã®ã¡ãã»ã¼ã¸ãåºå
+ *  ããï¼ãã­ã°ã©ã ã®åä½ãç¢ºèªãããããªãããã§ããï¼ã¾ãï¼ä½éãªã·
+ *  ãªã¢ã«ãã¼ããç¨ãã¦ã¡ãã»ã¼ã¸ãåºåããå ´åã«ï¼ãã¹ã¦ã®ã¡ãã»ã¼ã¸
+ *  ãåºåã§ããããã«ï¼ã¡ãã»ã¼ã¸ã®éãå¶éããã¨ããçç±ãããï¼
+ *
+ *  å¨æãã³ãã©ã¯ï¼ä¸ã¤ã®åªå
+åº¦ï¼HIGH_PRIORITYï¼MID_PRIORITYï¼
+ *  LOW_PRIORITYï¼ã®ã¬ãã£ã­ã¥ã¼ãåè»¢ãããï¼ãã­ã°ã©ã ã®èµ·åç´å¾ã¯ï¼
+ *  å¨æãã³ãã©ã¯åæ­¢ç¶æ
+ã«ãªã£ã¦ããï¼
+ *
+ *  ã¡ã¤ã³ã¿ã¹ã¯ã¯ï¼ã·ãªã¢ã«I/Oãã¼ãããã®æå­å
+¥åãè¡ãï¼æå­å
+¥åã
+ *  å¾
+ã£ã¦ããéã¯ï¼ä¸¦è¡å®è¡ãããã¿ã¹ã¯ãå®è¡ããã¦ããï¼ï¼å
+¥åããã
+ *  æå­ã«å¯¾å¿ããå¦çãå®è¡ããï¼å
+¥åãããæå­ã¨å¦çã®é¢ä¿ã¯æ¬¡ã®éãï¼
+ *  Control-Cã¾ãã¯'Q'ãå
+¥åãããã¨ï¼ãã­ã°ã©ã ãçµäºããï¼
+ *
+ *  '1' : å¯¾è±¡ã¿ã¹ã¯ãTASK1ã«åãæããï¼åæè¨­å®ï¼ï¼
+ *  '2' : å¯¾è±¡ã¿ã¹ã¯ãTASK2ã«åãæããï¼
+ *  '3' : å¯¾è±¡ã¿ã¹ã¯ãTASK3ã«åãæããï¼
+ *  'a' : å¯¾è±¡ã¿ã¹ã¯ãact_tskã«ããèµ·åããï¼
+ *  'A' : å¯¾è±¡ã¿ã¹ã¯ã«å¯¾ããèµ·åè¦æ±ãcan_actã«ããã­ã£ã³ã»ã«ããï¼
+ *  'e' : å¯¾è±¡ã¿ã¹ã¯ã«ext_tskãå¼ã³åºããï¼çµäºãããï¼
+ *  't' : å¯¾è±¡ã¿ã¹ã¯ãter_tskã«ããå¼·å¶çµäºããï¼
+ *  '>' : å¯¾è±¡ã¿ã¹ã¯ã®åªå
+åº¦ãHIGH_PRIORITYã«ããï¼
+ *  '=' : å¯¾è±¡ã¿ã¹ã¯ã®åªå
+åº¦ãMID_PRIORITYã«ããï¼
+ *  '<' : å¯¾è±¡ã¿ã¹ã¯ã®åªå
+åº¦ãLOW_PRIORITYã«ããï¼
+ *  'G' : å¯¾è±¡ã¿ã¹ã¯ã®åªå
+åº¦ãget_priã§èª­ã¿åºãï¼
+ *  's' : å¯¾è±¡ã¿ã¹ã¯ã«slp_tskãå¼ã³åºããï¼èµ·åºå¾
+ã¡ã«ãããï¼
+ *  'S' : å¯¾è±¡ã¿ã¹ã¯ã«tslp_tsk(10ç§)ãå¼ã³åºããï¼èµ·åºå¾
+ã¡ã«ãããï¼
+ *  'w' : å¯¾è±¡ã¿ã¹ã¯ãwup_tskã«ããèµ·åºããï¼
+ *  'W' : å¯¾è±¡ã¿ã¹ã¯ã«å¯¾ããèµ·åºè¦æ±ãcan_wupã«ããã­ã£ã³ã»ã«ããï¼
+ *  'l' : å¯¾è±¡ã¿ã¹ã¯ãrel_waiã«ããå¼·å¶çã«å¾
+ã¡è§£é¤ã«ããï¼
+ *  'u' : å¯¾è±¡ã¿ã¹ã¯ãsus_tskã«ããå¼·å¶å¾
+ã¡ç¶æ
+ã«ããï¼
+ *  'm' : å¯¾è±¡ã¿ã¹ã¯ã®å¼·å¶å¾
+ã¡ç¶æ
+ãrsm_tskã«ããè§£é¤ããï¼
+ *  'd' : å¯¾è±¡ã¿ã¹ã¯ã«dly_tsk(10ç§)ãå¼ã³åºããï¼æéçµéå¾
+ã¡ã«ãããï¼
+ *  'x' : å¯¾è±¡ã¿ã¹ã¯ã«ras_terã«ããçµäºè¦æ±ããï¼
+ *  'y' : å¯¾è±¡ã¿ã¹ã¯ã«dis_terãå¼ã³åºããï¼ã¿ã¹ã¯çµäºãç¦æ­¢ããï¼
+ *  'Y' : å¯¾è±¡ã¿ã¹ã¯ã«ena_terãå¼ã³åºããï¼ã¿ã¹ã¯çµäºãè¨±å¯ããï¼
+ *  'r' : 3ã¤ã®åªå
+åº¦ï¼HIGH_PRIORITYï¼MID_PRIORITYï¼LOW_PRIORITYï¼ã®ã¬
+ *        ãã£ã­ã¥ã¼ãåè»¢ãããï¼
+ *  'c' : å¨æãã³ãã©ãåä½éå§ãããï¼
+ *  'C' : å¨æãã³ãã©ãåä½åæ­¢ãããï¼
+ *  'b' : ã¢ã©ã¼ã ãã³ãã©ã5ç§å¾ã«èµ·åããããåä½éå§ãããï¼
+ *  'B' : ã¢ã©ã¼ã ãã³ãã©ãåä½åæ­¢ãããï¼
+ *  'z' : å¯¾è±¡ã¿ã¹ã¯ã«CPUä¾å¤ãçºçãããï¼ã¿ã¹ã¯ãçµäºãããï¼ï¼
+ *  'Z' : å¯¾è±¡ã¿ã¹ã¯ã«CPUã­ãã¯ç¶æ
+ã§CPUä¾å¤ãçºçãããï¼ãã­ã°ã©ã ã
+ *        çµäºããï¼ï¼
+ *  '@' : ã¿ã¹ã¯3ãacre_tskã«ããçæããï¼
+ *  '!' : å¯¾è±¡ã¿ã¹ã¯ãdel_tskã«ããåé¤ããï¼
+ *  '$' : ã¢ã©ã¼ã ãã³ãã©ãacre_almã«ããçæããï¼
+ *  '#' : ã¢ã©ã¼ã ãã³ãã©ãdel_almã«ããåé¤ããï¼
+ *  'V' : fch_hrtã§é«åè§£è½ã¿ã¤ãã2åèª­ãï¼
+ *  'v' : çºè¡ããã·ã¹ãã ã³ã¼ã«ãè¡¨ç¤ºããï¼ããã©ã«ãï¼ï¼
+ *  'q' : çºè¡ããã·ã¹ãã ã³ã¼ã«ãè¡¨ç¤ºããªãï¼
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include <t_stdlib.h>
+#include "syssvc/serial.h"
+#include "syssvc/syslog.h"
+#include "kernel_cfg.h"
+#include "sample1.h"
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®ã¨ã©ã¼ã®ã­ã°åºå
+ */
+Inline void
+svc_perror(const char *file, int_t line, const char *expr, ER ercd)
+{
+	if (ercd < 0) {
+		t_perror(LOG_ERROR, file, line, expr, ercd);
+	}
+}
+
+#define	SVC_PERROR(expr)	svc_perror(__FILE__, __LINE__, #expr, (expr))
+
+/*
+ *  ä¸¦è¡å®è¡ãããã¿ã¹ã¯ã¸ã®ã¡ãã»ã¼ã¸é å
+ */
+char	message[3];
+
+/*
+ *  ã«ã¼ãåæ°
+ */
+ulong_t	task_loop;		/* ã¿ã¹ã¯å
+ã§ã®ã«ã¼ãåæ° */
+
+/*
+ *  ä¸¦è¡å®è¡ãããã¿ã¹ã¯
+ */
+void task(intptr_t exinf)
+{
+	volatile ulong_t	i;
+	int_t		n = 0;
+	int_t		tskno = (int_t) exinf;
+	const char	*graph[] = { "|", "  +", "    *" };
+	char		c;
+
+	while (true) {
+		syslog(LOG_NOTICE, "task%d is running (%03d).   %s",
+										tskno, ++n, graph[tskno-1]);
+		for (i = 0; i < task_loop; i++);
+		c = message[tskno-1];
+		message[tskno-1] = 0;
+		switch (c) {
+		case 'e':
+			syslog(LOG_INFO, "#%d#ext_tsk()", tskno);
+			SVC_PERROR(ext_tsk());
+			assert(0);
+		case 's':
+			syslog(LOG_INFO, "#%d#slp_tsk()", tskno);
+			SVC_PERROR(slp_tsk());
+			break;
+		case 'S':
+			syslog(LOG_INFO, "#%d#tslp_tsk(10000000)", tskno);
+			SVC_PERROR(tslp_tsk(10000000));
+			break;
+		case 'd':
+			syslog(LOG_INFO, "#%d#dly_tsk(10000000)", tskno);
+			SVC_PERROR(dly_tsk(10000000));
+			break;
+		case 'y':
+			syslog(LOG_INFO, "#%d#dis_ter()", tskno);
+			SVC_PERROR(dis_ter());
+			break;
+		case 'Y':
+			syslog(LOG_INFO, "#%d#ena_ter()", tskno);
+			SVC_PERROR(ena_ter());
+			break;
+#ifdef CPUEXC1
+		case 'z':
+			syslog(LOG_NOTICE, "#%d#raise CPU exception", tskno);
+			RAISE_CPU_EXCEPTION;
+			break;
+		case 'Z':
+			SVC_PERROR(loc_cpu());
+			syslog(LOG_NOTICE, "#%d#raise CPU exception", tskno);
+			RAISE_CPU_EXCEPTION;
+			SVC_PERROR(unl_cpu());
+			break;
+#endif /* CPUEXC1 */
+		default:
+			break;
+		}
+	}
+}
+
+/*
+ *  CPUä¾å¤ãã³ãã©
+ */
+ID	cpuexc_tskid;		/* CPUä¾å¤ãèµ·ãããã¿ã¹ã¯ã®ID */
+
+#ifdef CPUEXC1
+
+void
+cpuexc_handler(void *p_excinf)
+{
+	syslog(LOG_NOTICE, "CPU exception handler (p_excinf = %08p).", p_excinf);
+	if (sns_ctx() != true) {
+		syslog(LOG_WARNING,
+					"sns_ctx() is not true in CPU exception handler.");
+	}
+	if (sns_dpn() != true) {
+		syslog(LOG_WARNING,
+					"sns_dpn() is not true in CPU exception handler.");
+	}
+	syslog(LOG_INFO, "sns_loc = %d sns_dsp = %d xsns_dpn = %d",
+								sns_loc(), sns_dsp(), xsns_dpn(p_excinf));
+
+	if (xsns_dpn(p_excinf)) {
+		syslog(LOG_NOTICE, "Sample program ends with exception.");
+		SVC_PERROR(ext_ker());
+		assert(0);
+	}
+
+	SVC_PERROR(get_tid(&cpuexc_tskid));
+	SVC_PERROR(act_tsk(EXC_TASK));
+}
+
+#endif /* CPUEXC1 */
+
+/*
+ *  å¨æãã³ãã©
+ *
+ *  HIGH_PRIORITYï¼MID_PRIORITYï¼LOW_PRIORITY ã®ååªå
+åº¦ã®ã¬ãã£ã­ã¥ã¼
+ *  ãåè»¢ãããï¼
+ */
+void cyclic_handler(intptr_t exinf)
+{
+	SVC_PERROR(rot_rdq(HIGH_PRIORITY));
+	SVC_PERROR(rot_rdq(MID_PRIORITY));
+	SVC_PERROR(rot_rdq(LOW_PRIORITY));
+}
+
+/*
+ *  ã¢ã©ã¼ã ãã³ãã©
+ *
+ *  HIGH_PRIORITYï¼MID_PRIORITYï¼LOW_PRIORITY ã®ååªå
+åº¦ã®ã¬ãã£ã­ã¥ã¼
+ *  ãåè»¢ãããï¼
+ */
+void alarm_handler(intptr_t exinf)
+{
+	SVC_PERROR(rot_rdq(HIGH_PRIORITY));
+	SVC_PERROR(rot_rdq(MID_PRIORITY));
+	SVC_PERROR(rot_rdq(LOW_PRIORITY));
+}
+
+/*
+ *  ä¾å¤å¦çã¿ã¹ã¯
+ */
+void exc_task(intptr_t exinf)
+{
+	SVC_PERROR(ras_ter(cpuexc_tskid));
+}
+
+/*
+ *  ã¡ã¤ã³ã¿ã¹ã¯
+ */
+void main_task(intptr_t exinf)
+{
+	char	c;
+	ID		tskid = TASK1;
+	int_t	tskno = 1;
+	ER_UINT	ercd;
+	PRI		tskpri;
+#ifndef TASK_LOOP
+	volatile ulong_t	i;
+	SYSTIM	stime1, stime2;
+#endif /* TASK_LOOP */
+	HRTCNT	hrtcnt1, hrtcnt2;
+	T_CTSK	ctsk;
+	ID		TASK3 = -1;
+	T_CALM	calm;
+	ID		ALMHDR1 = -1;
+
+	SVC_PERROR(syslog_msk_log(LOG_UPTO(LOG_INFO), LOG_UPTO(LOG_EMERG)));
+	syslog(LOG_NOTICE, "Sample program starts (exinf = %d).", (int_t) exinf);
+
+	/*
+	 *  ã·ãªã¢ã«ãã¼ãã®åæå
+	 *
+	 *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã¨åãã·ãªã¢ã«ãã¼ããä½¿ãå ´åãªã©ï¼ã·ãªã¢ã«
+	 *  ãã¼ãããªã¼ãã³æ¸ã¿ã®å ´åã«ã¯ããã§E_OBJã¨ã©ã¼ã«ãªããï¼æ¯éã¯
+	 *  ãªãï¼
+	 */
+	ercd = serial_opn_por(TASK_PORTID);
+	if (ercd < 0 && MERCD(ercd) != E_OBJ) {
+		syslog(LOG_ERROR, "%s (%d) reported by `serial_opn_por'.",
+									itron_strerror(ercd), SERCD(ercd));
+	}
+	SVC_PERROR(serial_ctl_por(TASK_PORTID,
+							(IOCTL_CRLF | IOCTL_FCSND | IOCTL_FCRCV)));
+
+	/*
+ 	 *  ã«ã¼ãåæ°ã®è¨­å®
+	 *
+	 *  ä¸¦è¡å®è¡ãããã¿ã¹ã¯å
+ã§ã®ç©ºã«ã¼ãã®åæ°ï¼task_loopï¼ã¯ï¼ç©ºã«ã¼
+	 *  ãã®å®è¡æéãç´0.4ç§ã«ãªãããã«è¨­å®ããï¼ãã®è¨­å®ã®ããã«ï¼
+	 *  LOOP_REFåã®ç©ºã«ã¼ãã®å®è¡æéãï¼ãã®åå¾ã§get_timãå¼ã¶ãã¨ã§
+	 *  æ¸¬å®ãï¼ãã®æ¸¬å®çµæããç©ºã«ã¼ãã®å®è¡æéã0.4ç§ã«ãªãã«ã¼ãå
+	 *  æ°ãæ±ãï¼task_loopã«è¨­å®ããï¼
+	 *
+	 *  LOOP_REFã¯ï¼ããã©ã«ãã§ã¯1,000,000ã«è¨­å®ãã¦ãããï¼æ³å®ããã
+	 *  ãé
+ããã­ã»ããµã§ã¯ï¼ãµã³ãã«ãã­ã°ã©ã ã®å®è¡éå§ã«æéããã
+	 *  ããããã¨ããåé¡ãçããï¼éã«æ³å®ããããéããã­ã»ããµã§ã¯ï¼
+	 *  LOOP_REFåã®ç©ºã«ã¼ãã®å®è¡æéãç­ããªãï¼task_loopã«è¨­å®ããå¤
+	 *  ã®èª¤å·®ãå¤§ãããªãã¨ããåé¡ãããï¼
+	 *
+	 *  ããã§ï¼ãã®ãããªã¿ã¼ã²ããã§ã¯ï¼target_test.hã§ï¼LOOP_REFãé©
+	 *  åãªå¤ã«å®ç¾©ããã®ãæã¾ããï¼
+	 *
+	 *  ã¾ãï¼task_loopã®å¤ãåºå®ãããå ´åã«ã¯ï¼ãã®å¤ãTASK_LOOPã«ã
+	 *  ã¯ã­å®ç¾©ããï¼TASK_LOOPããã¯ã­å®ç¾©ããã¦ããå ´åï¼ä¸è¨ã®æ¸¬å®ã
+	 *  è¡ããã«ï¼TASK_LOOPã«å®ç¾©ãããå¤ãç©ºã«ã¼ãã®åæ°ã¨ããï¼
+	 *
+	 * ã¿ã¼ã²ããã«ãã£ã¦ã¯ï¼ç©ºã«ã¼ãã®å®è¡æéã®1åç®ã®æ¸¬å®ã§ï¼æ¬æ¥ã
+	 * ããé·ãã«ãªããã®ãããï¼ãã®ãããªã¿ã¼ã²ããã§ã¯ï¼MEASURE_TWICE
+	 * ããã¯ã­å®ç¾©ãããã¨ã§ï¼1åç®ã®æ¸¬å®çµæãæ¨ã¦ã¦ï¼2åç®ã®æ¸¬å®çµæ
+	 * ãä½¿ãï¼
+	 */
+#ifdef TASK_LOOP
+	task_loop = TASK_LOOP;
+#else /* TASK_LOOP */
+
+#ifdef MEASURE_TWICE
+	task_loop = LOOP_REF;
+	SVC_PERROR(get_tim(&stime1));
+	for (i = 0; i < task_loop; i++);
+	SVC_PERROR(get_tim(&stime2));
+#endif /* MEASURE_TWICE */
+
+	task_loop = LOOP_REF;
+	SVC_PERROR(get_tim(&stime1));
+	for (i = 0; i < task_loop; i++);
+	SVC_PERROR(get_tim(&stime2));
+	task_loop = LOOP_REF * 400LU / (ulong_t)(stime2 - stime1) * 1000LU;
+
+#endif /* TASK_LOOP */
+
+	/*
+ 	 *  ã¿ã¹ã¯ã®èµ·å
+	 */
+	SVC_PERROR(act_tsk(TASK1));
+	SVC_PERROR(act_tsk(TASK2));
+
+	/*
+ 	 *  ã¡ã¤ã³ã«ã¼ã
+	 */
+	do {
+		SVC_PERROR(serial_rea_dat(TASK_PORTID, &c, 1));
+		switch (c) {
+		case 'e':
+		case 's':
+		case 'S':
+		case 'd':
+		case 'y':
+		case 'Y':
+		case 'z':
+		case 'Z':
+			message[tskno-1] = c;
+			break;
+		case '1':
+			tskno = 1;
+			tskid = TASK1;
+			break;
+		case '2':
+			tskno = 2;
+			tskid = TASK2;
+			break;
+		case '3':
+			tskno = 3;
+			tskid = TASK3;
+			break;
+		case 'a':
+			syslog(LOG_INFO, "#act_tsk(%d)", tskno);
+			SVC_PERROR(act_tsk(tskid));
+			break;
+		case 'A':
+			syslog(LOG_INFO, "#can_act(%d)", tskno);
+			SVC_PERROR(ercd = can_act(tskid));
+			if (ercd >= 0) {
+				syslog(LOG_NOTICE, "can_act(%d) returns %d", tskno, ercd);
+			}
+			break;
+		case 't':
+			syslog(LOG_INFO, "#ter_tsk(%d)", tskno);
+			SVC_PERROR(ter_tsk(tskid));
+			break;
+		case '>':
+			syslog(LOG_INFO, "#chg_pri(%d, HIGH_PRIORITY)", tskno);
+			SVC_PERROR(chg_pri(tskid, HIGH_PRIORITY));
+			break;
+		case '=':
+			syslog(LOG_INFO, "#chg_pri(%d, MID_PRIORITY)", tskno);
+			SVC_PERROR(chg_pri(tskid, MID_PRIORITY));
+			break;
+		case '<':
+			syslog(LOG_INFO, "#chg_pri(%d, LOW_PRIORITY)", tskno);
+			SVC_PERROR(chg_pri(tskid, LOW_PRIORITY));
+			break;
+		case 'G':
+			syslog(LOG_INFO, "#get_pri(%d, &tskpri)", tskno);
+			SVC_PERROR(ercd = get_pri(tskid, &tskpri));
+			if (ercd >= 0) {
+				syslog(LOG_NOTICE, "priority of task %d is %d", tskno, tskpri);
+			}
+			break;
+		case 'w':
+			syslog(LOG_INFO, "#wup_tsk(%d)", tskno);
+			SVC_PERROR(wup_tsk(tskid));
+			break;
+		case 'W':
+			syslog(LOG_INFO, "#can_wup(%d)", tskno);
+			SVC_PERROR(ercd = can_wup(tskid));
+			if (ercd >= 0) {
+				syslog(LOG_NOTICE, "can_wup(%d) returns %d", tskno, ercd);
+			}
+			break;
+		case 'l':
+			syslog(LOG_INFO, "#rel_wai(%d)", tskno);
+			SVC_PERROR(rel_wai(tskid));
+			break;
+		case 'u':
+			syslog(LOG_INFO, "#sus_tsk(%d)", tskno);
+			SVC_PERROR(sus_tsk(tskid));
+			break;
+		case 'm':
+			syslog(LOG_INFO, "#rsm_tsk(%d)", tskno);
+			SVC_PERROR(rsm_tsk(tskid));
+			break;
+		case 'x':
+			syslog(LOG_INFO, "#ras_ter(%d)", tskno);
+			SVC_PERROR(ras_ter(tskid));
+			break;
+		case 'r':
+			syslog(LOG_INFO, "#rot_rdq(three priorities)");
+			SVC_PERROR(rot_rdq(HIGH_PRIORITY));
+			SVC_PERROR(rot_rdq(MID_PRIORITY));
+			SVC_PERROR(rot_rdq(LOW_PRIORITY));
+			break;
+		case 'c':
+			syslog(LOG_INFO, "#sta_cyc(1)");
+			SVC_PERROR(sta_cyc(CYCHDR1));
+			break;
+		case 'C':
+			syslog(LOG_INFO, "#stp_cyc(1)");
+			SVC_PERROR(stp_cyc(CYCHDR1));
+			break;
+		case 'b':
+			syslog(LOG_INFO, "#sta_alm(1, 5000000)");
+			SVC_PERROR(sta_alm(ALMHDR1, 5000000));
+			break;
+		case 'B':
+			syslog(LOG_INFO, "#stp_alm(1)");
+			SVC_PERROR(stp_alm(ALMHDR1));
+			break;
+		case '@':
+			ctsk.tskatr = TA_NULL;
+			ctsk.exinf = 3;
+			ctsk.task = task;
+			ctsk.itskpri = MID_PRIORITY;
+			ctsk.stksz = STACK_SIZE;
+			ctsk.stk = NULL;
+			SVC_PERROR(TASK3 = acre_tsk(&ctsk));
+			syslog(LOG_NOTICE, "task3 is created with tskid = %d.",
+														(int_t) TASK3);
+			break;
+		case '!':
+			syslog(LOG_INFO, "#del_tsk(%d)", tskno);
+			SVC_PERROR(del_tsk(tskid));
+			break;
+		case '$':
+			calm.almatr = TA_NULL;
+			calm.nfyinfo.nfymode = TNFY_HANDLER;
+			calm.nfyinfo.nfy.handler.exinf = (intptr_t) 0;
+			calm.nfyinfo.nfy.handler.tmehdr = (TMEHDR) alarm_handler;
+			SVC_PERROR(ALMHDR1 = acre_alm(&calm));
+			syslog(LOG_NOTICE, "alarm handler is created with almid = %d.",
+														(int_t) ALMHDR1);
+			break;
+		case '#':
+			syslog(LOG_INFO, "#del_alm(1)");
+			SVC_PERROR(del_alm(ALMHDR1));
+			break;
+
+		case 'V':
+			hrtcnt1 = fch_hrt();
+			hrtcnt2 = fch_hrt();
+			syslog(LOG_NOTICE, "hrtcnt1 = %tu, hrtcnt2 = %tu",
+										hrtcnt1, hrtcnt2);
+			break;
+
+		case 'v':
+			SVC_PERROR(syslog_msk_log(LOG_UPTO(LOG_INFO),
+										LOG_UPTO(LOG_EMERG)));
+			break;
+		case 'q':
+			SVC_PERROR(syslog_msk_log(LOG_UPTO(LOG_NOTICE),
+										LOG_UPTO(LOG_EMERG)));
+			break;
+
+#ifdef BIT_KERNEL
+		case ' ':
+			SVC_PERROR(loc_cpu());
+			{
+				extern ER	bit_kernel(void);
+
+				SVC_PERROR(ercd = bit_kernel());
+				if (ercd >= 0) {
+					syslog(LOG_NOTICE, "bit_kernel passed.");
+				}
+			}
+			SVC_PERROR(unl_cpu());
+			break;
+#endif /* BIT_KERNEL */
+
+		default:
+			break;
+		}
+	} while (c != '\003' && c != 'Q');
+
+	syslog(LOG_NOTICE, "Sample program ends.");
+	SVC_PERROR(ext_ker());
+	assert(0);
+}
Index: asp3_wo_tecs/trunk/extension/dcre/sample/sample1.cfg
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/sample/sample1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/sample/sample1.cfg	(revision 302)
@@ -0,0 +1,25 @@
+/*
+ *  $Id: sample1.cfg 333 2015-06-21 13:23:37Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+INCLUDE("syssvc/logtask.cfg");
+
+#include "sample1.h"
+CRE_TSK(TASK1, { TA_NULL, 1, task, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(EXC_TASK, { TA_NULL, 0, exc_task, EXC_PRIORITY, STACK_SIZE, NULL });
+AID_TSK(3);
+CRE_CYC(CYCHDR1, { TA_NULL, { TNFY_HANDLER, 0, cyclic_handler }, 2000000, 0 });
+AID_ALM(1);
+#ifdef CPUEXC1
+DEF_EXC(CPUEXC1, { TA_NULL, cpuexc_handler });
+#endif /* CPUEXC1 */
+DEF_KMM({ KMM_SIZE, NULL });
Index: asp3_wo_tecs/trunk/extension/dcre/sample/sample1.h
===================================================================
--- asp3_wo_tecs/trunk/extension/dcre/sample/sample1.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/dcre/sample/sample1.h	(revision 302)
@@ -0,0 +1,120 @@
+/*
+ *  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) 2004-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: sample1.h 410 2015-08-03 21:54:44Z ertl-hiro $
+ */
+
+/*
+ *		ãµã³ãã«ãã­ã°ã©ã (1)ã®ããããã¡ã¤ã«
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+
+#define EXC_PRIORITY	1		/* ä¾å¤å¦çã¿ã¹ã¯ã®åªå
+åº¦ */
+#define MAIN_PRIORITY	5		/* ã¡ã¤ã³ã¿ã¹ã¯ã®åªå
+åº¦ */
+								/* HIGH_PRIORITYããé«ããããã¨ */
+
+#define HIGH_PRIORITY	9		/* ä¸¦è¡å®è¡ãããã¿ã¹ã¯ã®åªå
+åº¦ */
+#define MID_PRIORITY	10
+#define LOW_PRIORITY	11
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+
+#ifndef TASK_PORTID
+#define	TASK_PORTID		1			/* æå­å
+¥åããã·ãªã¢ã«ãã¼ãID */
+#endif /* TASK_PORTID */
+
+#ifndef STACK_SIZE
+#define	STACK_SIZE		4096		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãº */
+#endif /* STACK_SIZE */
+
+#ifndef KMM_SIZE
+#define	KMM_SIZE		(STACK_SIZE * 16)	/* ã«ã¼ãã«ãå²ãä»ãã   */
+#endif /* KMM_SIZE */						/*     ã¡ã¢ãªé åã®ãµã¤ãº */
+
+#ifndef LOOP_REF
+#define LOOP_REF		ULONG_C(1000000)	/* éåº¦è¨æ¸¬ç¨ã®ã«ã¼ãåæ° */
+#endif /* LOOP_REF */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+extern void	task(intptr_t exinf);
+extern void	main_task(intptr_t exinf);
+extern void exc_task(intptr_t exinf);
+#ifdef CPUEXC1
+extern void	cpuexc_handler(void *p_excinf);
+#endif /* CPUEXC1 */
+extern void	cyclic_handler(intptr_t exinf);
+extern void	alarm_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/extension/drift/include/kernel.h
===================================================================
--- asp3_wo_tecs/trunk/extension/drift/include/kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/drift/include/kernel.h	(revision 302)
@@ -0,0 +1,608 @@
+/*
+ *  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) 2004-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.h 463 2015-10-18 14:25:55Z ertl-hiro $
+ */
+
+/*
+ *		TOPPERS/ASPã«ã¼ãã« æ¨æºããããã¡ã¤ã«
+ *
+ *  TOPPERS/ASPã«ã¼ãã«ããµãã¼ããããµã¼ãã¹ã³ã¼ã«ã®å®£è¨ã¨ï¼å¿
+è¦ãªãã¼
+ *  ã¿åï¼å®æ°ï¼ãã¯ã­ã®å®ç¾©ãå«ãããããã¡ã¤ã«ï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ããï¼ããã«ããï¼ãã¯ã­å®ç¾©ä»¥å¤ã
+ *  é¤ãããã«ãªã£ã¦ããï¼
+ */
+
+#ifndef TOPPERS_KERNEL_H
+#define TOPPERS_KERNEL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *	TOPPERSå
+±éã®ãã¼ã¿åã»å®æ°ã»ãã¯ã­
+ */
+#include <t_stddef.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨
+ */
+#include "target_kernel.h"
+
+/*
+ *  ãµãã¼ãããæ©è½
+ */
+#ifdef TOPPERS_TARGET_SUPPORT_DIS_INT
+#define TOPPERS_SUPPORT_DIS_INT			/* dis_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_DIS_INT */
+
+#ifdef TOPPERS_TARGET_SUPPORT_ENA_INT
+#define TOPPERS_SUPPORT_ENA_INT			/* ena_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_ENA_INT */
+
+#define TOPPERS_SUPPORT_DRIFT			/* ããªããèª¿æ´æ©è½æ¡å¼µ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãã¼ã¿åã®å®ç¾©
+ */
+
+/*
+ *  ããããã¿ã¼ã³ããªãã¸ã§ã¯ãçªå·ã®åå®ç¾©
+ */
+typedef	uint_t		FLGPTN;		/* ã¤ãã³ããã©ã°ã®ããããã¿ã¼ã³ */
+typedef	uint_t		INTNO;		/* å²è¾¼ã¿çªå· */
+typedef	uint_t		INHNO;		/* å²è¾¼ã¿ãã³ãã©çªå· */
+typedef	uint_t		EXCNO;		/* CPUä¾å¤ãã³ãã©çªå· */
+
+/*
+ *  å¦çåä½ã®åå®ç¾©
+ */
+typedef void	(*TASK)(intptr_t exinf);
+typedef void	(*TMEHDR)(intptr_t exinf);
+typedef void	(*ISR)(intptr_t exinf);
+typedef void	(*INTHDR)(void);
+typedef void	(*EXCHDR)(void *p_excinf);
+typedef void	(*INIRTN)(intptr_t exinf);
+typedef void	(*TERRTN)(intptr_t exinf);
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®åå®ç¾©
+ */
+#ifndef TOPPERS_STK_T
+#define TOPPERS_STK_T	intptr_t
+#endif /* TOPPERS_STK_T */
+typedef	TOPPERS_STK_T	STK_T;	/* ã¹ã¿ãã¯é åãç¢ºä¿ããããã®å */
+
+#ifndef TOPPERS_MPF_T
+#define TOPPERS_MPF_T	intptr_t
+#endif /* TOPPERS_MPF_T */
+typedef	TOPPERS_MPF_T	MPF_T;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åãç¢ºä¿ããããã®å */
+
+/*
+ *  ãã±ããå½¢å¼ã®å®ç¾©
+ */
+typedef struct t_rtsk {
+	STAT	tskstat;	/* ã¿ã¹ã¯ç¶æ
+ */
+	PRI		tskpri;		/* ã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ */
+	PRI		tskbpri;	/* ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+	STAT	tskwait;	/* å¾
+ã¡è¦å  */
+	ID		wobjid;		/* å¾
+ã¡å¯¾è±¡ã®ãªãã¸ã§ã¯ãã®ID */
+	TMO		lefttmo;	/* ã¿ã¤ã ã¢ã¦ãããã¾ã§ã®æé */
+	uint_t	actcnt;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	uint_t	wupcnt;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	bool_t	raster;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	bool_t	dister;		/* ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ */
+} T_RTSK;
+
+typedef struct t_rsem {
+	ID		wtskid;		/* ã»ããã©ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	semcnt;		/* ã»ããã©ã®ç¾å¨ã®è³æºæ° */
+} T_RSEM;
+
+typedef struct t_rflg {
+	ID		wtskid;		/* ã¤ãã³ããã©ã°ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	FLGPTN	flgptn;		/* ã¤ãã³ããã©ã°ã®ç¾å¨ã®ããããã¿ã¼ã³ */
+} T_RFLG;
+
+typedef struct t_rdtq {
+	ID		stskid;		/* ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	ID		rtskid;		/* ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	sdtqcnt;	/* ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼ã¿ã®æ° */
+} T_RDTQ;
+
+typedef struct t_rpdq {
+	ID		stskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	ID		rtskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	uint_t	spdqcnt;	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼
+						   ã¿ã®æ° */
+} T_RPDQ;
+
+typedef struct t_rmtx {
+	ID		htskid;		/* ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã¿ã¹ã¯ã®IDçªå· */
+	ID		wtskid;		/* ãã¥ã¼ããã¯ã¹ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+} T_RMTX;
+
+typedef struct t_rmpf {
+	ID		wtskid;		/* åºå®é·ã¡ã¢ãªãã¼ã«ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®
+						   IDçªå· */
+	uint_t	fblkcnt;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®ç©ºãã¡ã¢ãªé åã«å²ã
+						   ä»ãããã¨ãã§ããåºå®é·ã¡ã¢ãªãã­ãã¯ã®æ° */
+} T_RMPF;
+
+typedef struct t_rcyc {
+	STAT	cycstat;	/* å¨æéç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* æ¬¡åéç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RCYC;
+
+typedef struct t_ralm {
+	STAT	almstat;	/* ã¢ã©ã¼ã éç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* éç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RALM;
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å®£è¨
+ */
+
+/*
+ *  ã¿ã¹ã¯ç®¡çæ©è½
+ */
+extern ER		act_tsk(ID tskid) throw();
+extern ER_UINT	can_act(ID tskid) throw();
+extern ER		get_tst(ID tskid, STAT *p_tskstat) throw();
+extern ER		chg_pri(ID tskid, PRI tskpri) throw();
+extern ER		get_pri(ID tskid, PRI *p_tskpri) throw();
+extern ER		get_inf(intptr_t *p_exinf) throw();
+extern ER		ref_tsk(ID tskid, T_RTSK *pk_rtsk) throw();
+
+/*
+ *  ã¿ã¹ã¯ä»å±åææ©è½
+ */
+extern ER		slp_tsk(void) throw();
+extern ER		tslp_tsk(TMO tmout) throw();
+extern ER		wup_tsk(ID tskid) throw();
+extern ER_UINT	can_wup(ID tskid) throw();
+extern ER		rel_wai(ID tskid) throw();
+extern ER		sus_tsk(ID tskid) throw();
+extern ER		rsm_tsk(ID tskid) throw();
+extern ER		dly_tsk(RELTIM dlytim) throw();
+
+/*
+ *  ã¿ã¹ã¯çµäºæ©è½
+ */
+extern ER		ext_tsk(void) throw();
+extern ER		ras_ter(ID tskid) throw();
+extern ER		dis_ter(void) throw();
+extern ER		ena_ter(void) throw();
+extern bool_t	sns_ter(void) throw();
+extern ER		ter_tsk(ID tskid) throw();
+
+/*
+ *  åæã»éä¿¡æ©è½
+ */
+extern ER		sig_sem(ID semid) throw();
+extern ER		wai_sem(ID semid) throw();
+extern ER		pol_sem(ID semid) throw();
+extern ER		twai_sem(ID semid, TMO tmout) throw();
+extern ER		ini_sem(ID semid) throw();
+extern ER		ref_sem(ID semid, T_RSEM *pk_rsem) throw();
+
+extern ER		set_flg(ID flgid, FLGPTN setptn) throw();
+extern ER		clr_flg(ID flgid, FLGPTN clrptn) throw();
+extern ER		wai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		pol_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		twai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn, TMO tmout) throw();
+extern ER		ini_flg(ID flgid) throw();
+extern ER		ref_flg(ID flgid, T_RFLG *pk_rflg) throw();
+
+extern ER		snd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		psnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		tsnd_dtq(ID dtqid, intptr_t data, TMO tmout) throw();
+extern ER		fsnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		rcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		prcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		trcv_dtq(ID dtqid, intptr_t *p_data, TMO tmout) throw();
+extern ER		ini_dtq(ID dtqid) throw();
+extern ER		ref_dtq(ID dtqid, T_RDTQ *pk_rdtq) throw();
+
+extern ER		snd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		psnd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		tsnd_pdq(ID pdqid, intptr_t data,
+										PRI datapri, TMO tmout) throw();
+extern ER		rcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		prcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		trcv_pdq(ID pdqid, intptr_t *p_data,
+										PRI *p_datapri, TMO tmout) throw();
+extern ER		ini_pdq(ID pdqid) throw();
+extern ER		ref_pdq(ID pdqid, T_RPDQ *pk_rpdq) throw();
+
+extern ER		loc_mtx(ID mtxid) throw();
+extern ER		ploc_mtx(ID mtxid) throw();
+extern ER		tloc_mtx(ID mtxid, TMO tmout) throw();
+extern ER		unl_mtx(ID mtxid) throw();
+extern ER		ini_mtx(ID mtxid) throw();
+extern ER		ref_mtx(ID mtxid, T_RMTX *pk_rmtx) throw();
+
+/*
+ *  ã¡ã¢ãªãã¼ã«ç®¡çæ©è½
+ */
+extern ER		get_mpf(ID mpfid, void **p_blk) throw();
+extern ER		pget_mpf(ID mpfid, void **p_blk) throw();
+extern ER		tget_mpf(ID mpfid, void **p_blk, TMO tmout) throw();
+extern ER		rel_mpf(ID mpfid, void *blk) throw();
+extern ER		ini_mpf(ID mpfid) throw();
+extern ER		ref_mpf(ID mpfid, T_RMPF *pk_rmpf) throw();
+
+/*
+ *  æéç®¡çæ©è½
+ */
+extern ER		set_tim(SYSTIM systim) throw();
+extern ER		get_tim(SYSTIM *p_systim) throw();
+extern ER		adj_tim(int32_t adjtim) throw();
+extern ER		set_dft(int32_t drift) throw();
+extern HRTCNT	fch_hrt(void) throw();
+
+extern ER		sta_cyc(ID cycid) throw();
+extern ER		stp_cyc(ID cycid) throw();
+extern ER		ref_cyc(ID cycid, T_RCYC *pk_rcyc) throw();
+
+extern ER		sta_alm(ID almid, RELTIM almtim) throw();
+extern ER		stp_alm(ID almid) throw();
+extern ER		ref_alm(ID almid, T_RALM *pk_ralm) throw();
+
+/*
+ *  ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+ */
+extern ER		rot_rdq(PRI tskpri) throw();
+extern ER		get_tid(ID *p_tskid) throw();
+extern ER		get_lod(PRI tskpri, uint_t *p_load) throw();
+extern ER		get_nth(PRI tskpri, uint_t nth, ID *p_tskid) throw();
+extern ER		loc_cpu(void) throw();
+extern ER		unl_cpu(void) throw();
+extern ER		dis_dsp(void) throw();
+extern ER		ena_dsp(void) throw();
+extern bool_t	sns_ctx(void) throw();
+extern bool_t	sns_loc(void) throw();
+extern bool_t	sns_dsp(void) throw();
+extern bool_t	sns_dpn(void) throw();
+extern bool_t	sns_ker(void) throw();
+extern ER		ext_ker(void) throw();
+
+/*
+ *  å²è¾¼ã¿ç®¡çæ©è½
+ */
+extern ER		dis_int(INTNO intno) throw();
+extern ER		ena_int(INTNO intno) throw();
+extern ER		chg_ipm(PRI intpri) throw();
+extern ER		get_ipm(PRI *p_intpri) throw();
+
+/*
+ *  CPUä¾å¤ç®¡çæ©è½
+ */
+extern bool_t	xsns_dpn(void *p_excinf) throw();
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãããµã¼ãã¹ã³ã¼ã«
+ */
+#define iact_tsk(tskid)						act_tsk(tskid)
+#define iwup_tsk(tskid)						wup_tsk(tskid)
+#define irel_wai(tskid)						rel_wai(tskid)
+#define isns_ter()							sns_ter()
+#define isig_sem(semid)						sig_sem(semid)
+#define iset_flg(flgid, setptn)				set_flg(flgid, setptn)
+#define ipsnd_dtq(dtqid, data)				psnd_dtq(dtqid, data)
+#define ifsnd_dtq(dtqid, data)				fsnd_dtq(dtqid, data)
+#define ipsnd_pdq(pdqid, data, datapri)		psnd_pdq(pdqid, data, datapri)
+#define ifch_hrt()							fch_hrt()
+#define ista_alm(almid, almtim)				sta_alm(almid, almtim)
+#define istp_alm(almid)						stp_alm(almid)
+#define irot_rdq(tskpri)					rot_rdq(tskpri)
+#define iget_tid(p_tskid)					get_tid(p_tskid)
+#define iloc_cpu()							loc_cpu()
+#define iunl_cpu()							unl_cpu()
+#define isns_ctx()							sns_ctx()
+#define isns_loc()							sns_loc()
+#define isns_dsp()							sns_dsp()
+#define isns_dpn()							sns_dpn()
+#define isns_ker()							sns_ker()
+#define iext_ker()							ext_ker()
+#define idis_int(intno)						dis_int(intno)
+#define iena_int(intno)						ena_int(intno)
+#define ixsns_dpn(p_excinf)					xsns_dpn(p_excinf)
+
+/*
+ *  ãªãã¸ã§ã¯ãå±æ§ã®å®ç¾©
+ */
+#define TA_ACT			UINT_C(0x01)	/* ã¿ã¹ã¯ãèµ·åãããç¶æ
+ã§çæ */
+#define TA_NOACTQUE		UINT_C(0x02)	/* èµ·åè¦æ±ãã­ã¥ã¼ã¤ã³ã°ããªã */
+
+#define TA_TPRI			UINT_C(0x01)	/* ã¿ã¹ã¯ã®å¾
+ã¡è¡åãåªå
+åº¦é ã« */
+
+#define TA_WMUL			UINT_C(0x02)	/* è¤æ°ã®å¾
+ã¡ã¿ã¹ã¯ */
+#define TA_CLR			UINT_C(0x04)	/* ã¤ãã³ããã©ã°ã®ã¯ãªã¢æå® */
+
+#define TA_CEILING		UINT_C(0x03)	/* åªå
+åº¦ä¸éãã­ãã³ã« */
+
+#define TA_STA			UINT_C(0x02)	/* å¨æéç¥ãåä½ç¶æ
+ã§çæ */
+
+#define TA_NONKERNEL	UINT_C(0x02)	/* ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ */
+
+#define TA_ENAINT		UINT_C(0x01)	/* å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ãã¯ãªã¢ */
+#define TA_EDGE			UINT_C(0x02)	/* ã¨ãã¸ããªã¬ */
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®åä½ã¢ã¼ãã®å®ç¾©
+ */
+#define TWF_ORW			UINT_C(0x01)	/* ã¤ãã³ããã©ã°ã®ORå¾
+ã¡ */
+#define TWF_ANDW		UINT_C(0x02)	/* ã¤ãã³ããã©ã°ã®ANDå¾
+ã¡ */
+
+/*
+ *  éç¥å¦çã¢ã¼ãã®å®ç¾©
+ */
+#define TNFY_HANDLER	UINT_C(0x00)		/* ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºã */
+#define TNFY_SETVAR		UINT_C(0x01)		/* å¤æ°ã®è¨­å® */
+#define TNFY_INCVAR		UINT_C(0x02)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TNFY_ACTTSK		UINT_C(0x03)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TNFY_WUPTSK		UINT_C(0x04)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TNFY_SIGSEM		UINT_C(0x05)		/* ã»ããã©ã®è³æºã®è¿å´ */
+#define TNFY_SETFLG		UINT_C(0x06)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TNFY_SNDDTQ		UINT_C(0x07)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+#define TENFY_SETVAR	UINT_C(0x10)		/* å¤æ°ã®è¨­å® */
+#define TENFY_INCVAR	UINT_C(0x20)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TENFY_ACTTSK	UINT_C(0x30)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TENFY_WUPTSK	UINT_C(0x40)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TENFY_SIGSEM	UINT_C(0x50)		/* ã»ããã©ã®è¿å´ */
+#define TENFY_SETFLG	UINT_C(0x60)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TENFY_SNDDTQ	UINT_C(0x70)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+/*
+ *  ãªãã¸ã§ã¯ãã®ç¶æ
+ã®å®ç¾©
+ */
+#define TTS_RUN			UINT_C(0x01)	/* å®è¡ç¶æ
+ */
+#define TTS_RDY			UINT_C(0x02)	/* å®è¡å¯è½ç¶æ
+ */
+#define TTS_WAI			UINT_C(0x04)	/* å¾
+ã¡ç¶æ
+ */
+#define TTS_SUS			UINT_C(0x08)	/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+#define TTS_WAS			UINT_C(0x0c)	/* äºéå¾
+ã¡ç¶æ
+ */
+#define TTS_DMT			UINT_C(0x10)	/* ä¼æ­¢ç¶æ
+ */
+
+#define TTW_SLP			UINT_C(0x0001)	/* èµ·åºå¾
+ã¡ */
+#define TTW_DLY			UINT_C(0x0002)	/* æéçµéå¾
+ã¡ */
+#define TTW_SEM			UINT_C(0x0004)	/* ã»ããã©ã®è³æºç²å¾å¾
+ã¡ */
+#define TTW_FLG			UINT_C(0x0008)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TTW_SDTQ		UINT_C(0x0010)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RDTQ		UINT_C(0x0020)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_SPDQ		UINT_C(0x0100)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RPDQ		UINT_C(0x0200)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_MTX			UINT_C(0x0080)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ç¶æ
+ */
+#define TTW_MPF			UINT_C(0x2000)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TCYC_STP		UINT_C(0x01)	/* å¨æéç¥ãåä½ãã¦ããªã */
+#define TCYC_STA		UINT_C(0x02)	/* å¨æéç¥ãåä½ãã¦ãã */
+
+#define TALM_STP		UINT_C(0x01)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ããªã */
+#define TALM_STA		UINT_C(0x02)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ãã */
+
+/*
+ *  ãã®ä»ã®å®æ°ã®å®ç¾©
+ */
+#define TSK_SELF		0			/* èªã¿ã¹ã¯æå® */
+#define TSK_NONE		0			/* è©²å½ããã¿ã¹ã¯ããªã */
+
+#define TPRI_SELF		0			/* èªã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+#define TPRI_INI		0			/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ */
+
+#define TIPM_ENAALL		0			/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ */
+
+/*
+ *  æ§æå®æ°ã¨ãã¯ã­
+ */
+
+/*
+ *  åªå
+åº¦ã®ç¯å²
+ */
+#define TMIN_TPRI		1			/* ã¿ã¹ã¯åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_TPRI		16			/* ã¿ã¹ã¯åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_DPRI		1			/* ãã¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_DPRI		16			/* ãã¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_ISRPRI		1			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå°å¤ */
+#define TMAX_ISRPRI		16			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå¤§å¤ */
+
+/*
+ *  ãã¼ã¸ã§ã³æ
+å ±
+ */
+#define TKERNEL_MAKER	UINT_C(0x0118)	/* ã«ã¼ãã«ã®ã¡ã¼ã«ã¼ã³ã¼ã */
+#define TKERNEL_PRID	UINT_C(0x0007)	/* ã«ã¼ãã«ã®è­å¥çªå· */
+#define TKERNEL_SPVER	UINT_C(0xf630)	/* ã«ã¼ãã«ä»æ§ã®ãã¼ã¸ã§ã³çªå· */
+#define TKERNEL_PRVER	UINT_C(0x30b0)	/* ã«ã¼ãã«ã®ãã¼ã¸ã§ã³çªå· */
+
+/*
+ *  ã­ã¥ã¼ã¤ã³ã°åæ°ã®æå¤§å¤
+ */
+#define TMAX_ACTCNT		UINT_C(1)		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+#define TMAX_WUPCNT		UINT_C(1)		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+
+/*
+ *  ããããã¿ã¼ã³ã®ãããæ°
+ */
+#ifndef TBIT_FLGPTN					/* ã¤ãã³ããã©ã°ã®ãããæ° */
+#define TBIT_FLGPTN		(sizeof(FLGPTN) * CHAR_BIT)
+#endif /* TBIT_FLGPTN */
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´ã§ããç¯å²ï¼åä½ï¼Î¼ç§ï¼
+ */
+#define TMIN_ADJTIM		-1000000		/* ã·ã¹ãã æå»ã®æå°èª¿æ´æé */
+#define TMAX_ADJTIM		1000000			/* ã·ã¹ãã æå»ã®æå¤§èª¿æ´æé */
+
+/*
+ *  è¨­å®ã§ããããªããéã®ç¯å²ï¼åä½ï¼ppmï¼
+ */
+#define TMIN_DRIFT		-100000			/* ããªããéã®æå°å¤ */
+#define TMAX_DRIFT		100000			/* ããªããéã®æå¤§å¤ */
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®ãã¯ã­
+ *
+ *  ä»¥ä¸ã®TOPPERS_COUNT_SZã¨TOPPERS_ROUND_SZã®å®ç¾©ã¯ï¼unitã2ã®å·¾ä¹ã§ã
+ *  ããã¨ãä»®å®ãã¦ããï¼
+ */
+#ifndef TOPPERS_COUNT_SZ
+#define TOPPERS_COUNT_SZ(sz, unit)	(((sz) + (unit) - 1) / (unit))
+#endif /* TOPPERS_COUNT_SZ */
+#ifndef TOPPERS_ROUND_SZ
+#define TOPPERS_ROUND_SZ(sz, unit)	(((sz) + (unit) - 1) & ~((unit) - 1))
+#endif /* TOPPERS_ROUND_SZ */
+
+#define COUNT_STK_T(sz)		TOPPERS_COUNT_SZ(sz, sizeof(STK_T))
+#define ROUND_STK_T(sz)		TOPPERS_ROUND_SZ(sz, sizeof(STK_T))
+
+#define COUNT_MPF_T(blksz)	TOPPERS_COUNT_SZ(blksz, sizeof(MPF_T))
+#define ROUND_MPF_T(blksz)	TOPPERS_ROUND_SZ(blksz, sizeof(MPF_T))
+
+/*
+ *  ãã®ä»ã®æ§æå®æ°
+ */
+#define TMAX_MAXSEM		UINT_MAX	/* ã»ããã©ã®æå¤§è³æºæ°ã®æå¤§å¤ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_KERNEL_H */
Index: asp3_wo_tecs/trunk/extension/drift/kernel/Makefile.kernel
===================================================================
--- asp3_wo_tecs/trunk/extension/drift/kernel/Makefile.kernel	(revision 302)
+++ asp3_wo_tecs/trunk/extension/drift/kernel/Makefile.kernel	(revision 302)
@@ -0,0 +1,154 @@
+#
+#  TOPPERS/ASP Kernel
+#      Toyohashi Open Platform for Embedded Real-Time Systems/
+#      Advanced Standard Profile Kernel
+# 
+#  Copyright (C) 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: Makefile.kernel 236 2014-09-28 16:24:33Z ertl-hiro $
+# 
+
+#
+#		ã«ã¼ãã«ã®ãã¡ã¤ã«æ§æã®å®ç¾©
+#
+
+#
+#  1ã¤ã®ã½ã¼ã¹ãã¡ã¤ã«ããè¤æ°ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ãçæããããã«ä½
+#  æãããã½ã¼ã¹ãã¡ã¤ã«ã®ãªã¹ã
+#
+KERNEL_FCSRCS = startup.c task.c taskhook.c wait.c time_event.c \
+				task_manage.c task_refer.c task_sync.c task_term.c \
+				semaphore.c eventflag.c dataqueue.c pridataq.c mutex.c \
+				mempfix.c time_manage.c cyclic.c alarm.c \
+				sys_manage.c interrupt.c exception.c
+
+#
+#  åã½ã¼ã¹ãã¡ã¤ã«ããçæããããªãã¸ã§ã¯ããã¡ã¤ã«ã®ãªã¹ã
+#
+startup = sta_ker.o ext_ker.o
+
+task = tskini.o tsksched.o tskrun.o tsknrun.o \
+		tskdmt.o tskact.o tskpri.o tskrot.o tskterm.o
+
+taskhook = mtxhook.o
+
+wait = waimake.o waicmp.o waitmo.o waitmook.o \
+		wobjwai.o wobjwaitmo.o iniwque.o
+
+time_event = tmeini.o tmeup.o tmedown.o tmecur.o tmeset.o \
+		tmereg.o tmeenq.o tmedeq.o tmechk.o tmeltim.o sigtim.o
+
+task_manage = act_tsk.o can_act.o get_tst.o chg_pri.o get_pri.o get_inf.o
+
+task_refer = ref_tsk.o
+
+task_sync = slp_tsk.o tslp_tsk.o wup_tsk.o can_wup.o \
+		rel_wai.o sus_tsk.o rsm_tsk.o dly_tsk.o
+
+task_term = ext_tsk.o ras_ter.o ena_ter.o dis_ter.o sns_ter.o ter_tsk.o
+
+semaphore = semini.o sig_sem.o \
+		wai_sem.o pol_sem.o twai_sem.o ini_sem.o ref_sem.o
+
+eventflag = flgini.o flgcnd.o set_flg.o clr_flg.o \
+		wai_flg.o pol_flg.o twai_flg.o ini_flg.o ref_flg.o
+
+dataqueue = dtqini.o dtqenq.o dtqfenq.o dtqdeq.o dtqsnd.o dtqfsnd.o dtqrcv.o \
+		snd_dtq.o psnd_dtq.o tsnd_dtq.o fsnd_dtq.o \
+		rcv_dtq.o prcv_dtq.o trcv_dtq.o ini_dtq.o ref_dtq.o
+
+pridataq = pdqini.o pdqenq.o pdqdeq.o pdqsnd.o pdqrcv.o \
+		snd_pdq.o psnd_pdq.o tsnd_pdq.o \
+		rcv_pdq.o prcv_pdq.o trcv_pdq.o ini_pdq.o ref_pdq.o
+
+mutex = mtxini.o mtxchk.o mtxscan.o mtxdrop.o mtxacq.o mtxrel.o mtxrela.o \
+		loc_mtx.o ploc_mtx.o tloc_mtx.o unl_mtx.o ini_mtx.o ref_mtx.o
+
+mempfix = mpfini.o mpfget.o get_mpf.o pget_mpf.o tget_mpf.o \
+		rel_mpf.o ini_mpf.o ref_mpf.o
+
+time_manage = set_tim.o get_tim.o adj_tim.o set_dft.o fch_hrt.o
+
+cyclic = cycini.o sta_cyc.o stp_cyc.o ref_cyc.o cyccal.o
+
+alarm = almini.o sta_alm.o stp_alm.o ref_alm.o almcal.o
+
+sys_manage = rot_rdq.o get_tid.o get_lod.o get_nth.o \
+		loc_cpu.o unl_cpu.o dis_dsp.o ena_dsp.o \
+		sns_ctx.o sns_loc.o sns_dsp.o sns_dpn.o sns_ker.o
+
+interrupt = intini.o dis_int.o ena_int.o chg_ipm.o get_ipm.o
+
+exception = excini.o xsns_dpn.o
+
+#
+#  çæããããªãã¸ã§ã¯ããã¡ã¤ã«ã®ä¾å­é¢ä¿ã®å®ç¾©
+#
+$(startup) $(startup:.o=.s) $(startup:.o=.d): startup.c
+$(task) $(task:.o=.s) $(task:.o=.d): task.c
+$(taskhook) $(taskhook:.o=.s) $(taskhook:.o=.d): taskhook.c
+$(wait) $(wait:.o=.s) $(wait:.o=.d): wait.c
+$(time_event) $(time_event:.o=.s) $(time_event:.o=.d): time_event.c
+$(task_manage) $(task_manage:.o=.s) $(task_manage:.o=.d): task_manage.c
+$(task_refer) $(task_refer:.o=.s) $(task_refer:.o=.d): task_refer.c
+$(task_sync) $(task_sync:.o=.s) $(task_sync:.o=.d): task_sync.c
+$(task_term) $(task_term:.o=.s) $(task_term:.o=.d): task_term.c
+$(semaphore) $(semaphore:.o=.s) $(semaphore:.o=.d): semaphore.c
+$(eventflag) $(eventflag:.o=.s) $(eventflag:.o=.d): eventflag.c
+$(dataqueue) $(dataqueue:.o=.s) $(dataqueue:.o=.d): dataqueue.c
+$(pridataq) $(pridataq:.o=.s) $(pridataq:.o=.d): pridataq.c
+$(mutex) $(mutex:.o=.s) $(mutex:.o=.d): mutex.c
+$(mempfix) $(mempfix:.o=.s) $(mempfix:.o=.d): mempfix.c
+$(time_manage) $(time_manage:.o=.s) $(time_manage:.o=.d): time_manage.c
+$(cyclic) $(cyclic:.o=.s) $(cyclic:.o=.d): cyclic.c
+$(alarm) $(alarm:.o=.s) $(alarm:.o=.d): alarm.c
+$(sys_manage) $(sys_manage:.o=.s) $(sys_manage:.o=.d): sys_manage.c
+$(interrupt) $(interrupt:.o=.s) $(interrupt:.o=.d): interrupt.c
+$(exception) $(exception:.o=.s) $(exception:.o=.d): exception.c
Index: asp3_wo_tecs/trunk/extension/drift/kernel/allfunc.h
===================================================================
--- asp3_wo_tecs/trunk/extension/drift/kernel/allfunc.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/drift/kernel/allfunc.h	(revision 302)
@@ -0,0 +1,257 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: allfunc.h 236 2014-09-28 16:24:33Z ertl-hiro $
+ */
+
+/*
+ *		ãã¹ã¦ã®é¢æ°ãã³ã³ãã¤ã«ããããã®å®ç¾©
+ */
+
+#ifndef TOPPERS_ALLFUNC_H
+#define TOPPERS_ALLFUNC_H
+
+/* startup.c */
+#define TOPPERS_sta_ker
+#define TOPPERS_ext_ker
+
+/* task.c */
+#define TOPPERS_tskini
+#define TOPPERS_tsksched
+#define TOPPERS_tskrun
+#define TOPPERS_tsknrun
+#define TOPPERS_tskdmt
+#define TOPPERS_tskact
+#define TOPPERS_tskpri
+#define TOPPERS_tskrot
+#define TOPPERS_tskterm
+
+/* taskhook.c */
+#define TOPPERS_mtxhook
+
+/* wait.c */
+#define TOPPERS_waimake
+#define TOPPERS_waicmp
+#define TOPPERS_waitmo
+#define TOPPERS_waitmook
+#define TOPPERS_wobjwai
+#define TOPPERS_wobjwaitmo
+#define TOPPERS_iniwque
+
+/* time_event.c */
+#define TOPPERS_tmeini
+#define TOPPERS_tmeup
+#define TOPPERS_tmedown
+#define TOPPERS_tmecur
+#define TOPPERS_tmeset
+#define TOPPERS_tmereg
+#define TOPPERS_tmeenq
+#define TOPPERS_tmedeq
+#define TOPPERS_tmechk
+#define TOPPERS_tmeltim
+#define TOPPERS_sigtim
+
+/* task_manage.c */
+#define TOPPERS_act_tsk
+#define TOPPERS_can_act
+#define TOPPERS_get_tst
+#define TOPPERS_chg_pri
+#define TOPPERS_get_pri
+#define TOPPERS_get_inf
+
+/* task_refer.c */
+#define TOPPERS_ref_tsk
+
+/* task_sync.c */
+#define TOPPERS_slp_tsk
+#define TOPPERS_tslp_tsk
+#define TOPPERS_wup_tsk
+#define TOPPERS_can_wup
+#define TOPPERS_rel_wai
+#define TOPPERS_sus_tsk
+#define TOPPERS_rsm_tsk
+#define TOPPERS_dly_tsk
+
+/* task_term.c */
+#define TOPPERS_ext_tsk
+#define TOPPERS_ras_ter
+#define TOPPERS_dis_ter
+#define TOPPERS_ena_ter
+#define TOPPERS_sns_ter
+#define TOPPERS_ter_tsk
+
+/* semaphore.c */
+#define TOPPERS_semini
+#define TOPPERS_sig_sem
+#define TOPPERS_wai_sem
+#define TOPPERS_pol_sem
+#define TOPPERS_twai_sem
+#define TOPPERS_ini_sem
+#define TOPPERS_ref_sem
+
+/* eventflag.c */
+#define TOPPERS_flgini
+#define TOPPERS_flgcnd
+#define TOPPERS_set_flg
+#define TOPPERS_clr_flg
+#define TOPPERS_wai_flg
+#define TOPPERS_pol_flg
+#define TOPPERS_twai_flg
+#define TOPPERS_ini_flg
+#define TOPPERS_ref_flg
+
+/* dataqueue.c */
+#define TOPPERS_dtqini
+#define TOPPERS_dtqenq
+#define TOPPERS_dtqfenq
+#define TOPPERS_dtqdeq
+#define TOPPERS_dtqsnd
+#define TOPPERS_dtqfsnd
+#define TOPPERS_dtqrcv
+#define TOPPERS_snd_dtq
+#define TOPPERS_psnd_dtq
+#define TOPPERS_tsnd_dtq
+#define TOPPERS_fsnd_dtq
+#define TOPPERS_rcv_dtq
+#define TOPPERS_prcv_dtq
+#define TOPPERS_trcv_dtq
+#define TOPPERS_ini_dtq
+#define TOPPERS_ref_dtq
+
+/* pridataq.c */
+#define TOPPERS_pdqini
+#define TOPPERS_pdqenq
+#define TOPPERS_pdqdeq
+#define TOPPERS_pdqsnd
+#define TOPPERS_pdqrcv
+#define TOPPERS_snd_pdq
+#define TOPPERS_psnd_pdq
+#define TOPPERS_tsnd_pdq
+#define TOPPERS_rcv_pdq
+#define TOPPERS_prcv_pdq
+#define TOPPERS_trcv_pdq
+#define TOPPERS_ini_pdq
+#define TOPPERS_ref_pdq
+
+/* mutex.c */
+#define TOPPERS_mtxini
+#define TOPPERS_mtxchk
+#define TOPPERS_mtxscan
+#define TOPPERS_mtxdrop
+#define TOPPERS_mtxacq
+#define TOPPERS_mtxrel
+#define TOPPERS_mtxrela
+#define TOPPERS_loc_mtx
+#define TOPPERS_ploc_mtx
+#define TOPPERS_tloc_mtx
+#define TOPPERS_unl_mtx
+#define TOPPERS_ini_mtx
+#define TOPPERS_ref_mtx
+
+/* mempfix.c */
+#define TOPPERS_mpfini
+#define TOPPERS_mpfget
+#define TOPPERS_get_mpf
+#define TOPPERS_pget_mpf
+#define TOPPERS_tget_mpf
+#define TOPPERS_rel_mpf
+#define TOPPERS_ini_mpf
+#define TOPPERS_ref_mpf
+
+/* time_manage.c */
+#define TOPPERS_set_tim
+#define TOPPERS_get_tim
+#define TOPPERS_adj_tim
+#define TOPPERS_set_dft
+#define TOPPERS_fch_hrt
+
+/* cyclic.c */
+#define TOPPERS_cycini
+#define TOPPERS_sta_cyc
+#define TOPPERS_stp_cyc
+#define TOPPERS_ref_cyc
+#define TOPPERS_cyccal
+
+/* alarm.c */
+#define TOPPERS_almini
+#define TOPPERS_sta_alm
+#define TOPPERS_stp_alm
+#define TOPPERS_ref_alm
+#define TOPPERS_almcal
+
+/* sys_manage.c */
+#define TOPPERS_rot_rdq
+#define TOPPERS_get_tid
+#define TOPPERS_get_lod
+#define TOPPERS_get_nth
+#define TOPPERS_loc_cpu
+#define TOPPERS_unl_cpu
+#define TOPPERS_dis_dsp
+#define TOPPERS_ena_dsp
+#define TOPPERS_sns_ctx
+#define TOPPERS_sns_loc
+#define TOPPERS_sns_dsp
+#define TOPPERS_sns_dpn
+#define TOPPERS_sns_ker
+
+/* interrupt.c */
+#define TOPPERS_intini
+#define TOPPERS_dis_int
+#define TOPPERS_ena_int
+#define TOPPERS_chg_ipm
+#define TOPPERS_get_ipm
+
+/* exception.c */
+#define TOPPERS_excini
+#define TOPPERS_xsns_dpn
+
+#endif /* TOPPERS_ALLFUNC_H */
Index: asp3_wo_tecs/trunk/extension/drift/kernel/kernel_rename.def
===================================================================
--- asp3_wo_tecs/trunk/extension/drift/kernel/kernel_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/extension/drift/kernel/kernel_rename.def	(revision 302)
@@ -0,0 +1,152 @@
+# startup.c
+kerflg
+exit_kernel
+
+# task.c
+p_runtsk
+p_schedtsk
+enadsp
+dspflg
+ready_queue
+ready_primap
+initialize_task
+search_schedtsk
+make_runnable
+make_non_runnable
+make_dormant
+make_active
+change_priority
+rotate_ready_queue
+task_terminate
+
+# taskhook.c
+mtxhook_check_ceilpri
+mtxhook_scan_ceilmtx
+mtxhook_release_all
+
+# wait.c
+make_wait_tmout
+wait_complete
+wait_tmout
+wait_tmout_ok
+wobj_make_wait
+wobj_make_wait_tmout
+init_wait_queue
+
+# time_event.c
+boundary_evttim
+current_evttim
+current_evttim_frac
+current_hrtcnt
+monotonic_evttim
+drift_rate
+evttim_step
+evttim_step_frac
+systim_offset
+in_signal_time
+initialize_tmevt
+tmevt_up
+tmevt_down
+update_current_evttim
+set_hrt_event
+tmevtb_register
+tmevtb_enqueue
+tmevtb_dequeue
+check_adjtim
+tmevt_lefttim
+signal_time
+
+# semaphore.c
+initialize_semaphore
+
+# eventflag.c
+initialize_eventflag
+check_flg_cond
+
+# dataqueue.c
+initialize_dataqueue
+enqueue_data
+force_enqueue_data
+dequeue_data
+send_data
+force_send_data
+receive_data
+
+# pridataq.c
+initialize_pridataq
+enqueue_pridata
+dequeue_pridata
+send_pridata
+receive_pridata
+
+# mutex.c
+initialize_mutex
+mutex_check_ceilpri
+mutex_scan_ceilmtx
+mutex_drop_priority
+mutex_acquire
+mutex_release
+mutex_release_all
+
+# mempfix.c
+initialize_mempfix
+get_mpf_block
+
+# cyclic.c
+initialize_cyclic
+call_cyclic
+
+# alarm.c
+initialize_alarm
+call_alarm
+
+# interrupt.c
+initialize_interrupt
+
+# exception.c
+initialize_exception
+
+# kernel_cfg.c
+initialize_object
+call_inirtn
+call_terrtn
+tmax_tskid
+tinib_table
+torder_table
+tcb_table
+tmax_semid
+seminib_table
+semcb_table
+tmax_flgid
+flginib_table
+flgcb_table
+tmax_dtqid
+dtqinib_table
+dtqcb_table
+tmax_pdqid
+pdqinib_table
+pdqcb_table
+tmax_mtxid
+mtxinib_table
+mtxcb_table
+tmax_mpfid
+mpfinib_table
+mpfcb_table
+tmax_cycid
+cycinib_table
+cyccb_table
+tmax_almid
+alminib_table
+almcb_table
+tnum_def_inhno
+inhinib_table
+tnum_cfg_intno
+intinib_table
+tnum_def_excno
+excinib_table
+tmevt_heap
+istksz
+istk
+istkpt
+
+INCLUDE "target"
Index: asp3_wo_tecs/trunk/extension/drift/kernel/kernel_rename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/drift/kernel/kernel_rename.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/drift/kernel/kernel_rename.h	(revision 302)
@@ -0,0 +1,380 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+#ifndef TOPPERS_KERNEL_RENAME_H
+#define TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  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_evttim_frac			_kernel_current_evttim_frac
+#define current_hrtcnt				_kernel_current_hrtcnt
+#define monotonic_evttim			_kernel_monotonic_evttim
+#define drift_rate					_kernel_drift_rate
+#define evttim_step					_kernel_evttim_step
+#define evttim_step_frac			_kernel_evttim_step_frac
+#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
+
+
+#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_evttim_frac		__kernel_current_evttim_frac
+#define _current_hrtcnt				__kernel_current_hrtcnt
+#define _monotonic_evttim			__kernel_monotonic_evttim
+#define _drift_rate					__kernel_drift_rate
+#define _evttim_step				__kernel_evttim_step
+#define _evttim_step_frac			__kernel_evttim_step_frac
+#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"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/extension/drift/kernel/kernel_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/drift/kernel/kernel_unrename.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/drift/kernel/kernel_unrename.h	(revision 302)
@@ -0,0 +1,381 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+/* This file is included only when kernel_rename.h has been included. */
+#ifdef TOPPERS_KERNEL_RENAME_H
+#undef TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  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_evttim_frac
+#undef current_hrtcnt
+#undef monotonic_evttim
+#undef drift_rate
+#undef evttim_step
+#undef evttim_step_frac
+#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
+
+
+#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_evttim_frac
+#undef _current_hrtcnt
+#undef _monotonic_evttim
+#undef _drift_rate
+#undef _evttim_step
+#undef _evttim_step_frac
+#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"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/extension/drift/kernel/time_event.c
===================================================================
--- asp3_wo_tecs/trunk/extension/drift/kernel/time_event.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/drift/kernel/time_event.c	(revision 302)
@@ -0,0 +1,742 @@
+/*
+ *  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: time_event.c 451 2015-08-14 15:29:07Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#include "kernel_impl.h"
+#include "time_event.h"
+
+/*
+ *  TSTEP_HRTCNTã®ç¯å²ãã§ãã¯
+ */
+#if TSTEP_HRTCNT > 4000U
+#error TSTEP_HRTCNT is too large.
+#endif /* TSTEP_HRTCNT > 4000U */
+
+/*
+ *  HRTCNT_BOUNDã®ç¯å²ãã§ãã¯
+ */
+#if HRTCNT_BOUND >= 4294000000U
+#error HRTCNT_BOUND is too large.
+#endif /* HRTCNT_BOUND >= 4294000000U */
+
+#ifdef TCYC_HRTCNT
+#if HRTCNT_BOUND >= TCYC_HRTCNT
+#error HRTCNT_BOUND is too large.
+#endif /* HRTCNT_BOUND >= TCYC_HRTCNT */
+#endif /* TCYC_HRTCNT */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãæä½ãã¯ã­
+ *
+ *  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 p_top_tmevtn	(&(tmevt_heap[1]))
+#define top_evttim		(tmevt_heap[1].p_tmevtb->evttim)
+										/* å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã®çºçæå» */
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãä¸­ã®æå¾ã®ãã¼ã
+ */
+#define p_last_tmevtn	(tmevt_heap[0].p_last)
+
+/*
+ *  ã¤ãã³ãæå»ã®åå¾é¢ä¿ã®å¤å®ï¼»ASPD1009ï¼½
+ *
+ *  ã¤ãã³ãæå»ã¯ï¼boundary_evttimããã®ç¸å¯¾å¤ã§æ¯è¼ããï¼ããªãã¡ï¼
+ *  boundary_evttimãæãæ©ãæå»ï¼boundary_evttimâ1ãæãé
+ãæå»ã¨ã¿
+ *  ãªãã¦æ¯è¼ããï¼
+ */
+#define EVTTIM_ADVANCE(t)	((t) - boundary_evttim)
+#define EVTTIM_LT(t1, t2)	(EVTTIM_ADVANCE(t1) < EVTTIM_ADVANCE(t2))
+#define EVTTIM_LE(t1, t2)	(EVTTIM_ADVANCE(t1) <= EVTTIM_ADVANCE(t2))
+
+#ifdef TOPPERS_tmeini
+
+/*
+ *  å¢çã¤ãã³ãæå»ï¼»ASPD1008ï¼½
+ */
+EVTTIM	boundary_evttim;
+
+/*
+ *  æå¾ã«ç¾å¨æå»ãç®åºããæç¹ã§ã®ã¤ãã³ãæå»ï¼»ASPD1012ï¼½
+ */
+EVTTIM		current_evttim;			/* ç¾å¨ã®ã¤ãã³ãæå» */
+uint32_t	current_evttim_frac;	/* ç¾å¨ã®ã¤ãã³ãæå»ã®ç«¯æ° */
+
+/*
+ *  æå¾ã«ç¾å¨æå»ãç®åºããæç¹ã§ã®é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ï¼»ASPD1012ï¼½
+ */
+HRTCNT	current_hrtcnt;
+
+/*
+ *  æãé²ãã§ããæã®ã¤ãã³ãæå»ï¼»ASPD1041ï¼½
+ */
+EVTTIM	monotonic_evttim;
+
+/*
+ *  ããªããç
+ */
+uint32_t	drift_rate;
+
+/*
+ *  ã¤ãã³ãæéãé
+ãæ¹ã«ä¸¸ããããã®è£æ­£å¤
+ */
+EVTTIM		evttim_step;
+uint32_t	evttim_step_frac;
+
+/*
+ *  ã·ã¹ãã æå»ã®ãªãã»ããï¼»ASPD1043ï¼½
+ */
+SYSTIM	systim_offset;
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦çä¸­ã§ãããã¨ãç¤ºããã©ã°ï¼»ASPD1032ï¼½
+ */
+bool_t	in_signal_time;
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«ã®åæåï¼»ASPD1061ï¼½
+ */
+void
+initialize_tmevt(void)
+{
+	current_evttim = 0U;							/*ï¼»ASPD1047ï¼½*/
+	current_evttim_frac = 0U;
+	boundary_evttim = current_evttim - BOUNDARY_MARGIN;
+													/*ï¼»ASPD1048ï¼½*/
+	monotonic_evttim = 0U;							/*ï¼»ASPD1046ï¼½*/
+	drift_rate = 1000000U;
+	evttim_step = (EVTTIM) TSTEP_HRTCNT;
+	evttim_step_frac = 999999U;
+	systim_offset = 0U;								/*ï¼»ASPD1044ï¼½*/
+	in_signal_time = false;							/*ï¼»ASPD1033ï¼½*/
+	p_last_tmevtn = tmevt_heap;
+}
+
+#endif /* TOPPERS_tmeini */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãã®æ¿å
+¥ä½ç½®ãä¸åãã«æ¢ç´¢
+ *
+ *  æå»evttimã«çºçããã¿ã¤ã ã¤ãã³ããæ¿å
+¥ãããã¼ããç©ºããããã«ï¼
+ *  ãã¼ãã®ä¸ã«åãã£ã¦ç©ºãã¼ããç§»åãããï¼ç§»ååã®ç©ºãã¼ãã®ä½ç½®ã
+ *  p_tmevtnã«æ¸¡ãã¨ï¼ç§»åå¾ã®ç©ºãã¼ãã®ä½ç½®ï¼ããªãã¡æ¿å
+¥ä½ç½®ï¼ãè¿ãï¼
+ */
+#ifdef TOPPERS_tmeup
+
+TMEVTN *
+tmevt_up(TMEVTN *p_tmevtn, EVTTIM evttim)
+{
+	TMEVTN	*p_parent;
+
+	while (p_tmevtn > p_top_tmevtn) {
+		/*
+		 *  è¦ªãã¼ãã®ã¤ãã³ãçºçæå»ã®æ¹ãæ©ãï¼ã¾ãã¯åãï¼ãªãã°ï¼
+		 *  p_tmevtnãæ¿å
+¥ä½ç½®ãªã®ã§ã«ã¼ããæããï¼
+		 */
+		p_parent = PARENT(p_tmevtn);
+		if (EVTTIM_LE(p_parent->p_tmevtb->evttim, evttim)) {
+			break;
+		}
+
+		/*
+		 *  è¦ªãã¼ããp_tmevtnã®ä½ç½®ã«ç§»åãããï¼
+		 */
+		*p_tmevtn = *p_parent;
+		p_tmevtn->p_tmevtb->p_tmevtn = p_tmevtn;
+
+		/*
+		 *  p_tmevtnãè¦ªãã¼ãã®ä½ç½®ã«æ´æ°ï¼
+		 */
+		p_tmevtn = p_parent;
+	}
+	return(p_tmevtn);
+}
+
+#endif /* TOPPERS_tmeup */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãã®æ¿å
+¥ä½ç½®ãä¸åãã«æ¢ç´¢
+ *
+ *  æå»evttimã«çºçããã¿ã¤ã ã¤ãã³ããæ¿å
+¥ãããã¼ããç©ºããããã«ï¼
+ *  ãã¼ãã®ä¸ã«åãã£ã¦ç©ºãã¼ããç§»åãããï¼ç§»ååã®ç©ºãã¼ãã®ä½ç½®ã
+ *  p_tmevtnã«æ¸¡ãã¨ï¼ç§»åå¾ã®ç©ºãã¼ãã®ä½ç½®ï¼ããªãã¡æ¿å
+¥ä½ç½®ï¼ãè¿ãï¼
+ */
+#ifdef TOPPERS_tmedown
+
+TMEVTN *
+tmevt_down(TMEVTN *p_tmevtn, EVTTIM evttim)
+{
+	TMEVTN	*p_child;
+
+	while ((p_child = LCHILD(p_tmevtn)) <= p_last_tmevtn) {
+		/*
+		 *  å·¦å³ã®å­ãã¼ãã®ã¤ãã³ãçºçæå»ãæ¯è¼ãï¼æ©ãæ¹ã®å­ãã¼ã
+		 *  ã®ä½ç½®ãp_childã«è¨­å®ããï¼ä»¥ä¸ã®å­ãã¼ãã¯ï¼ããã§é¸ã°ãã
+		 *  æ¹ã®å­ãã¼ãã®ãã¨ï¼
+		 */
+		if (p_child + 1 <= p_last_tmevtn
+					&& EVTTIM_LT((p_child + 1)->p_tmevtb->evttim,
+											p_child->p_tmevtb->evttim)) {
+			p_child = p_child + 1;
+		}
+
+		/*
+		 *  å­ãã¼ãã®ã¤ãã³ãçºçæå»ã®æ¹ãé
+ãï¼ã¾ãã¯åãï¼ãªãã°ï¼
+		 *  p_tmevtnãæ¿å
+¥ä½ç½®ãªã®ã§ã«ã¼ããæããï¼
+		 */
+		if (EVTTIM_LE(evttim, p_child->p_tmevtb->evttim)) {
+			break;
+		}
+
+		/*
+		 *  å­ãã¼ããp_tmevtnã®ä½ç½®ã«ç§»åãããï¼
+		 */
+		*p_tmevtn = *p_child;
+		p_tmevtn->p_tmevtb->p_tmevtn = p_tmevtn;
+
+		/*
+		 *  p_tmevtnãå­ãã¼ãã®ä½ç½®ã«æ´æ°ï¼
+		 */
+		p_tmevtn = p_child;
+	}
+	return(p_tmevtn);
+}
+
+#endif /* TOPPERS_tmedown */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãã¸ã®è¿½å 
+ *
+ *  p_tmevtbã§æå®ããã¿ã¤ã ã¤ãã³ããã­ãã¯ãï¼ã¿ã¤ã ã¤ãã³ããã¼ãã«
+ *  è¿½å ããï¼
+ */
+Inline void
+tmevtb_insert(TMEVTB *p_tmevtb)
+{
+	TMEVTN	*p_tmevtn;
+
+	/*
+	 *  p_last_tmevtnãã¤ã³ã¯ãªã¡ã³ããï¼ããããä¸ã«æ¿å
+¥ä½ç½®ãæ¢ãï¼
+	 */
+	p_tmevtn = tmevt_up(++p_last_tmevtn, p_tmevtb->evttim);
+
+	/*
+	 *  ã¿ã¤ã ã¤ãã³ããp_tmevtnã®ä½ç½®ã«æ¿å
+¥ããï¼
+	 */ 
+	p_tmevtn->p_tmevtb = p_tmevtb;
+	p_tmevtb->p_tmevtn = p_tmevtn;
+}
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãããã®åé¤
+ */
+Inline void
+tmevtb_delete(TMEVTB *p_tmevtb)
+{
+	TMEVTN	*p_tmevtn = p_tmevtb->p_tmevtn;
+	TMEVTN	*p_parent;
+	EVTTIM	event_evttim;
+
+	/*
+	 *  åé¤ã«ããã¿ã¤ã ã¤ãã³ããã¼ããç©ºã«ãªãå ´åã¯ä½ãããªãï¼
+	 */
+	if (--p_last_tmevtn < p_top_tmevtn) {
+		return;
+	}
+
+	/*
+	 *  åé¤ãããã¼ãã®ä½ç½®ã«æå¾ã®ãã¼ãï¼p_last_tmevtn + 1 ã®ä½ç½®ã®
+	 *  ãã¼ãï¼ãæ¿å
+¥ãï¼ãããé©åãªä½ç½®ã¸ç§»åãããï¼å®éã«ã¯ï¼æå¾
+	 *  ã®ãã¼ããå®éã«æ¿å
+¥ããã®ã§ã¯ãªãï¼åé¤ãããã¼ãã®ä½ç½®ãç©ºãã¼
+	 *  ãã«ãªãã®ã§ï¼æå¾ã®ãã¼ããæ¿å
+¥ãã¹ãä½ç½®ã¸åãã¦ç©ºãã¼ããç§»
+	 *  åãããï¼
+	 *
+	 *  æå¾ã®ãã¼ãã®ã¤ãã³ãçºçæå»ãï¼åé¤ãããã¼ãã®è¦ªãã¼ãã®ã¤
+	 *  ãã³ãçºçæå»ããåã®å ´åã«ã¯ï¼ä¸ã«åãã£ã¦æ¿å
+¥ä½ç½®ãæ¢ãï¼ã
+	 *  ãã§ãªãå ´åã«ã¯ï¼ä¸ã«åãã£ã¦æ¢ãï¼
+	 */
+	event_evttim = (p_last_tmevtn + 1)->p_tmevtb->evttim;
+	if (p_tmevtn > p_top_tmevtn
+			&& EVTTIM_LT(event_evttim,
+						(p_parent = PARENT(p_tmevtn))->p_tmevtb->evttim)) {
+		/*
+		 *  è¦ªãã¼ããp_tmevtnã®ä½ç½®ã«ç§»åãããï¼
+		 */
+		*p_tmevtn = *p_parent;
+		p_tmevtn->p_tmevtb->p_tmevtn = p_tmevtn;
+
+		/*
+		 *  åé¤ãããã¼ãã®è¦ªãã¼ãããä¸ã«åãã£ã¦æ¿å
+¥ä½ç½®ãæ¢ãï¼
+		 */
+		p_tmevtn = tmevt_up(p_parent, event_evttim);
+	}
+	else {
+		/*
+		 *  åé¤ãããã¼ãããä¸ã«åãã£ã¦æ¿å
+¥ä½ç½®ãæ¢ãï¼
+		 */
+		p_tmevtn = tmevt_down(p_tmevtn, event_evttim);
+	}
+
+	/*
+	 *  æå¾ã®ãã¼ããp_tmevtnã®ä½ç½®ã«æ¿å
+¥ããï¼
+	 */ 
+	*p_tmevtn = *(p_last_tmevtn + 1);
+	p_tmevtn->p_tmevtb->p_tmevtn = p_tmevtn;
+}
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãã®å
+é ­ã®ãã¼ãã®åé¤
+ */
+Inline TMEVTB *
+tmevtb_delete_top(void)
+{
+	TMEVTN	*p_tmevtn;
+	TMEVTB	*p_top_tmevtb = p_top_tmevtn->p_tmevtb;
+	EVTTIM	event_evttim;
+
+	/*
+	 *  åé¤ã«ããã¿ã¤ã ã¤ãã³ããã¼ããç©ºã«ãªãå ´åã¯ä½ãããªãï¼
+	 */
+	if (--p_last_tmevtn >= p_top_tmevtn) {
+		/*
+		 *  ã«ã¼ããã¼ãã«æå¾ã®ãã¼ãï¼p_last_tmevtn + 1 ã®ä½ç½®ã®ãã¼
+		 *  ãï¼ãæ¿å
+¥ãï¼ãããé©åãªä½ç½®ã¸ç§»åãããï¼å®éã«ã¯ï¼æå¾
+		 *  ã®ãã¼ããå®éã«æ¿å
+¥ããã®ã§ã¯ãªãï¼ã«ã¼ããã¼ããç©ºãã¼ã
+		 *  ã«ãªãã®ã§ï¼æå¾ã®ãã¼ããæ¿å
+¥ãã¹ãä½ç½®ã¸åãã¦ç©ºãã¼ãã
+		 *  ç§»åãããï¼
+		 */
+		event_evttim = (p_last_tmevtn + 1)->p_tmevtb->evttim;
+		p_tmevtn = tmevt_down(p_top_tmevtn, event_evttim);
+
+		/*
+		 *  æå¾ã®ãã¼ããp_tmevtnã®ä½ç½®ã«æ¿å
+¥ããï¼
+		 */ 
+		*p_tmevtn = *(p_last_tmevtn + 1);
+		p_tmevtn->p_tmevtb->p_tmevtn = p_tmevtn;
+	}
+	return(p_top_tmevtb);
+}
+
+/*
+ *  ç¾å¨ã®ã¤ãã³ãæå»ã®æ´æ°
+ */
+#ifdef TOPPERS_tmecur
+
+void
+update_current_evttim(void)
+{
+	HRTCNT	new_hrtcnt, hrtcnt_advance;
+	EVTTIM	previous_evttim, evttim_advance;
+
+	new_hrtcnt = target_hrt_get_current();			/*ï¼»ASPD1013ï¼½*/
+	hrtcnt_advance = new_hrtcnt - current_hrtcnt;	/*ï¼»ASPD1014ï¼½*/
+#ifdef TCYC_HRTCNT
+	if (new_hrtcnt < current_hrtcnt) {
+		hrtcnt_advance += TCYC_HRTCNT;
+	}
+#endif /* TCYC_HRTCNT */
+
+#ifdef USE_64BIT_OPS
+	evttim_advance = ((uint64_t) hrtcnt_advance) * drift_rate / 1000000U;
+	current_evttim_frac += ((uint64_t) hrtcnt_advance) * drift_rate % 1000000U;
+	if (current_evttim_frac >= 1000000U) {
+		evttim_advance += 1U;
+		current_evttim_frac -= 1000000U;
+	}
+#else /* USE_64BIT_OPS */
+	{
+		uint32_t	s1, c1, s2, c2, s3;
+
+		s1 = hrtcnt_advance / 1000000U * drift_rate;
+		c1 = hrtcnt_advance % 1000000U;
+		s2 = c1 / 1000U * drift_rate;
+		c2 = c1 % 1000U;
+		s3 = c2 * drift_rate;
+		evttim_advance = s1 + s2 / 1000 + s3 / 1000000U;
+		current_evttim_frac += s2 % 1000U * 1000U + s3 % 1000000U;
+	}
+	if (current_evttim_frac >= 2000000U) {
+		evttim_advance += 2U;
+		current_evttim_frac -= 2000000U;
+	}
+	else if (current_evttim_frac >= 1000000U) {
+		evttim_advance += 1U;
+		current_evttim_frac -= 1000000U;
+	}
+#endif /* USE_64BIT_OPS */
+
+	previous_evttim = current_evttim;
+	current_evttim += evttim_advance;
+	current_hrtcnt = new_hrtcnt;					/*ï¼»ASPD1016ï¼½*/
+	boundary_evttim = current_evttim - BOUNDARY_MARGIN;	/*ï¼»ASPD1011ï¼½*/
+
+	if (monotonic_evttim - previous_evttim < evttim_advance) {
+#ifdef UINT64_MAX
+		if (current_evttim < monotonic_evttim) {
+			systim_offset += 1LLU << 32;			/*ï¼»ASPD1045ï¼½*/
+		}
+#endif /* UINT64_MAX */
+		monotonic_evttim = current_evttim;			/*ï¼»ASPD1042ï¼½*/
+	}
+}
+
+#endif /* TOPPERS_tmecur */
+
+/*
+ *  ç¾å¨ã®ã¤ãã³ãæå»ãé
+ãæ¹ã«ä¸¸ããã¤ãã³ãæå»ã®ç®åºï¼»ASPD1027ï¼½
+ *
+ *  ç¾å¨ã®ã¤ãã³ãæå»ãæ´æ°ããå¾ã«å¼ã¶ãã¨ãæ³å®ãã¦ããï¼
+ */
+Inline EVTTIM
+calc_current_evttim_ub(void)
+{
+	EVTTIM	current_evttim_ub;
+
+	current_evttim_ub = current_evttim + evttim_step;
+	if (current_evttim_frac + evttim_step_frac >= 1000000U) {
+		current_evttim_ub += 1U;
+	}
+	return(current_evttim_ub);
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ã®è¨­å®
+ */
+#ifdef TOPPERS_tmeset
+
+void
+set_hrt_event(void)
+{
+	EVTTIM	evttim_advance;
+	HRTCNT	hrtcnt;
+
+	if (p_last_tmevtn >= p_top_tmevtn
+						&& EVTTIM_LE(top_evttim, current_evttim)) {
+		target_hrt_raise_event();
+	}
+	else {
+		if (p_last_tmevtn >= p_top_tmevtn) {
+			evttim_advance = top_evttim - current_evttim;
+		}
+		else {
+			evttim_advance = TMAX_RELTIM;
+		}
+
+#ifdef USE_64BIT_OPS
+		hrtcnt = (((uint64_t) evttim_advance) * 1000000U
+						- current_evttim_frac + drift_rate - 1U) / drift_rate;
+		if (hrtcnt > HRTCNT_BOUND) {
+			hrtcnt = HRTCNT_BOUND;
+		}
+#else /* USE_64BIT_OPS */
+		{
+			uint32_t	c1, s1, c2, s2, c3;
+
+			c1 = evttim_advance / drift_rate;
+			if (c1 > HRTCNT_BOUND / 1000000U) {
+				hrtcnt = HRTCNT_BOUND;
+			}
+			else {
+				s1 = evttim_advance % drift_rate * 1000U;
+				c2 = s1 / drift_rate;
+				s2 = s1 % drift_rate * 1000U + (drift_rate - 1U);
+				if (s2 >= current_evttim_frac) {
+					c3 = (s2 - current_evttim_frac) / drift_rate;
+					hrtcnt = c1 * 1000000U + c2 * 1000U + c3;
+				}
+				else {
+					hrtcnt = c1 * 1000000U + c2 * 1000U - 1U;
+				}
+				if (hrtcnt > HRTCNT_BOUND) {
+					hrtcnt = HRTCNT_BOUND;
+				}
+			}
+		}
+#endif /* USE_64BIT_OPS */
+		target_hrt_set_event(hrtcnt);
+	}
+}
+
+#endif /* TOPPERS_tmeset */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã­ãã¯ã®ãã¼ãã¸ã®æ¿å
+¥
+ */
+#ifdef TOPPERS_tmereg
+
+void
+tmevtb_register(TMEVTB *p_tmevtb)
+{
+	tmevtb_insert(p_tmevtb);
+}
+
+#endif /* TOPPERS_tmereg */
+
+/*
+ *  ç¸å¯¾æéæå®ã«ããã¿ã¤ã ã¤ãã³ãã®ç»é²
+ *  
+ */
+#ifdef TOPPERS_tmeenq
+
+void
+tmevtb_enqueue(TMEVTB *p_tmevtb, RELTIM time)
+{
+	/*
+	 *  ç¾å¨ã®ã¤ãã³ãæå»ã¨ã¿ã¤ã ã¤ãã³ãã®çºçæå»ãæ±ããï¼»ASPD1026ï¼½ï¼
+	 */
+	update_current_evttim();
+	p_tmevtb->evttim = calc_current_evttim_ub() + time;
+
+	/*
+	 *  ã¿ã¤ã ã¤ãã³ããã­ãã¯ããã¼ãã«æ¿å
+¥ããï¼»ASPD1030ï¼½ï¼
+	 */
+	tmevtb_insert(p_tmevtb);
+
+	/*
+	 *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ãè¨­å®ããï¼»ASPD1031ï¼½
+	 *  ï¼»ASPD1034ï¼½ï¼
+	 */
+	if (!in_signal_time && p_tmevtb->p_tmevtn == p_top_tmevtn) {
+		set_hrt_event();
+	}
+}
+
+#endif /* TOPPERS_tmeenq */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãã®ç»é²è§£é¤
+ */
+#ifdef TOPPERS_tmedeq
+
+void
+tmevtb_dequeue(TMEVTB *p_tmevtb)
+{
+	TMEVTN	*p_tmevtn;
+
+	/*
+	 *  ã¿ã¤ã ã¤ãã³ããã­ãã¯ããã¼ãããåé¤ããï¼»ASPD1039ï¼½ï¼
+	 */
+	p_tmevtn = p_tmevtb->p_tmevtn;
+	tmevtb_delete(p_tmevtb);
+
+	/*
+	 *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ãè¨­å®ããï¼»ASPD1040ï¼½ï¼
+	 */
+	if (!in_signal_time && p_tmevtn == p_top_tmevtn) {
+		update_current_evttim();
+		set_hrt_event();
+	}
+}
+
+#endif /* TOPPERS_tmedeq */
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´æã®ã¨ã©ã¼ãã§ãã¯
+ */
+#ifdef TOPPERS_tmechk
+
+bool_t
+check_adjtim(int_t adjtim)
+{
+	if (adjtim > 0) {
+		return(p_last_tmevtn >= p_top_tmevtn	/*ï¼»NGKI3588ï¼½*/
+					&& EVTTIM_LE(top_evttim, current_evttim - TMAX_ADJTIM));
+	}
+	else if (adjtim < 0) {						/*ï¼»NGKI3589ï¼½*/
+		return(monotonic_evttim - current_evttim >= -TMIN_ADJTIM);
+	}
+	return(false);
+}
+
+#endif /* TOPPERS_tmechk */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããçºçããã¾ã§ã®æéã®è¨ç®
+ */
+#ifdef TOPPERS_tmeltim
+
+RELTIM
+tmevt_lefttim(TMEVTB *p_tmevtb)
+{
+	EVTTIM	evttim, current_evttim_ub;
+
+	/*
+	 *  ç¾å¨ã®ã¤ãã³ãæå»ãé
+ãæ¹ã«ä¸¸ããæå»ãæ±ããï¼»ASPD1050ï¼½ï¼
+	 */
+	update_current_evttim();
+	current_evttim_ub = calc_current_evttim_ub();
+
+	/*
+	 *  ã¿ã¤ã ã¤ãã³ãçºçã¾ã§ã®ç¸å¯¾æéãæ±ããï¼»ASPD1049ï¼½ï¼
+	 */
+	evttim = p_tmevtb->evttim;
+	if (EVTTIM_LE(evttim, current_evttim_ub)) {
+		/*
+		 *  ã¿ã¤ã ã¤ãã³ãã®çºçæå»ãéãã¦ããå ´åã«ã¯0ãè¿ãï¼»NGKI0552ï¼½ï¼
+		 */
+		return(0U);
+	}
+	else {
+		return((RELTIM)(evttim - current_evttim_ub));
+	}
+}
+
+#endif /* TOPPERS_tmeltim */
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦ç
+ */
+#ifdef TOPPERS_sigtim
+
+void
+signal_time(void)
+{
+	TMEVTB	*p_tmevtb;
+	bool_t	callflag;
+
+	assert(sense_context());
+	assert(!sense_lock());
+
+	lock_cpu();
+	in_signal_time = true;							/*ï¼»ASPD1033ï¼½*/
+
+	do {
+		/*
+		 *  ã³ã¼ã«ããã¯é¢æ°ãå¼ã³åºããªããã°ã«ã¼ããæããï¼»ASPD1020ï¼½ï¼
+		 */
+		callflag = false;
+
+		/*
+		 *  ç¾å¨ã®ã¤ãã³ãæå»ãæ±ããï¼»ASPD1022ï¼½ï¼
+		 */
+		update_current_evttim();
+
+		/*
+		 *  çºçæå»ãcurrent_evttimä»¥åã®ã¿ã¤ã ã¤ãã³ããããã°ï¼ã¿ã¤
+		 *  ã ã¤ãã³ããã¼ãããåé¤ãï¼ã³ã¼ã«ããã¯é¢æ°ãå¼ã³åºã
+		 *  ï¼»ASPD1018ï¼½ï¼»ASPD1019ï¼½ï¼
+		 */
+		while (p_last_tmevtn >= p_top_tmevtn
+							&& EVTTIM_LE(top_evttim, current_evttim)) {
+			p_tmevtb = tmevtb_delete_top();
+			(*(p_tmevtb->callback))(p_tmevtb->arg);
+			callflag = true;
+		}
+	} while (callflag);								/*ï¼»ASPD1020ï¼½*/
+
+	/*
+	 *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ãè¨­å®ããï¼»ASPD1025ï¼½ï¼
+	 */
+	set_hrt_event();
+
+	in_signal_time = false;							/*ï¼»ASPD1033ï¼½*/
+	unlock_cpu();
+}
+
+#endif /* TOPPERS_sigtim */
Index: asp3_wo_tecs/trunk/extension/drift/kernel/time_event.h
===================================================================
--- asp3_wo_tecs/trunk/extension/drift/kernel/time_event.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/drift/kernel/time_event.h	(revision 302)
@@ -0,0 +1,233 @@
+/*
+ *  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: time_event.h 451 2015-08-14 15:29:07Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_TIME_EVENT_H
+#define TOPPERS_TIME_EVENT_H
+
+#include "kernel_impl.h"
+#include "target_timer.h"
+
+/*
+ *  ã¤ãã³ãæå»ã®ãã¼ã¿åã®å®ç¾©ï¼»ASPD1001ï¼½
+ *
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãã«ç»é²ããã¿ã¤ã ã¤ãã³ãã®çºçæå»ãè¡¨ç¾ããã
+ *  ãã®ãã¼ã¿åï¼ãªã¼ããããä½æ¸ã®ããã«ï¼32ãããã§æ±ãï¼
+ */
+typedef uint32_t	EVTTIM;
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãä¸­ã®ãã¼ãã®ãã¼ã¿åã®åæ¹åç
+§
+ */
+typedef union time_event_node TMEVTN;
+
+/* 
+ *  ã¿ã¤ã ã¤ãã³ããã­ãã¯ã®ãã¼ã¿åã®å®ç¾©
+ */
+typedef void	(*CBACK)(void *);	/* ã³ã¼ã«ããã¯é¢æ°ã®å */
+
+typedef struct time_event_block {
+	EVTTIM	evttim;			/* ã¿ã¤ã ã¤ãã³ãã®çºçæå» */
+	TMEVTN	*p_tmevtn;		/* ã¿ã¤ã ã¤ãã³ããã¼ãä¸­ã§ã®ä½ç½® */
+	CBACK	callback;		/* ã³ã¼ã«ããã¯é¢æ° */
+	void	*arg;			/* ã³ã¼ã«ããã¯é¢æ°ã¸æ¸¡ãå¼æ° */
+} TMEVTB;
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãä¸­ã®ãã¼ãã®ãã¼ã¿åã®å®ç¾©
+ *
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãã®å
+é ­ã®ãã¼ãï¼tmevt_heap[0]ï¼ã«ï¼æå¾ã®ä½¿ç¨é 
+ *  åãæããã¤ã³ã¿ï¼p_lastï¼ãæ ¼ç´ãï¼ããä»¥éãã¿ã¤ã ã¤ãã³ããã¼ã
+ *  ã¨ãã¦ä½¿ç¨ããï¼(tmevt_heap[0].p_last - tmevt_heap) ãï¼ã¿ã¤ã ã¤ã
+ *  ã³ããã¼ãã«ç»é²ããã¦ããã¿ã¤ã ã¤ãã³ãã®æ°ã¨ãªãï¼
+ */
+union time_event_node {
+	TMEVTB	*p_tmevtb;		/* å¯¾å¿ããã¿ã¤ã ã¤ãã³ããã­ãã¯ */
+	TMEVTN	*p_last;		/* ã¿ã¤ã ã¤ãã³ããã¼ãã®æå¾ã®ä½¿ç¨é å */
+};
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãï¼kernel_cfg.cï¼
+ */
+extern TMEVTN	tmevt_heap[];
+
+/*
+ *  å¢çã¤ãã³ãæå»ï¼»ASPD1008ï¼½
+ */
+extern EVTTIM	boundary_evttim;
+
+/*
+ *  ç¾å¨ã®ã¤ãã³ãæå»ã¨å¢çã¤ãã³ãæå»ã®å·®ï¼»ASPD1010ï¼½
+ */
+#define BOUNDARY_MARGIN		(200000000U)
+
+/*
+ *  æå¾ã«ç¾å¨æå»ãç®åºããæç¹ã§ã®ã¤ãã³ãæå»ï¼»ASPD1012ï¼½
+ */
+extern EVTTIM	current_evttim;			/* ç¾å¨ã®ã¤ãã³ãæå» */
+extern uint32_t	current_evttim_frac;	/* ç¾å¨ã®ã¤ãã³ãæå»ã®ç«¯æ° */
+
+/*
+ *  æå¾ã«ç¾å¨æå»ãç®åºããæç¹ã§ã®é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ï¼»ASPD1012ï¼½
+ */
+extern HRTCNT	current_hrtcnt;
+
+/*
+ *  æãé²ãã§ããæã®ã¤ãã³ãæå»ï¼»ASPD1041ï¼½
+ */
+extern EVTTIM	monotonic_evttim;
+
+/*
+ *  ããªããç
+ */
+extern uint32_t	drift_rate;
+
+/*
+ *  ã¤ãã³ãæéãé
+ãæ¹ã«ä¸¸ããããã®è£æ­£å¤
+ */
+extern EVTTIM	evttim_step;
+extern uint32_t	evttim_step_frac;
+
+/*
+ *  ã·ã¹ãã æå»ã®ãªãã»ããï¼»ASPD1043ï¼½
+ *
+ *  get_timã§åç
+§ããã·ã¹ãã æå»ã¨monotonic_evttimã®å·®ãä¿æããï¼
+ */
+extern SYSTIM	systim_offset;
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦çä¸­ã§ãããã¨ãç¤ºããã©ã°ï¼»ASPD1032ï¼½
+ */
+extern bool_t	in_signal_time;
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«ã®åæå
+ */
+extern void	initialize_tmevt(void);
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãã®æ¿å
+¥ä½ç½®ã®æ¢ç´¢
+ */
+extern TMEVTN	*tmevt_up(TMEVTN *p_tmevtn, EVTTIM evttim);
+extern TMEVTN	*tmevt_down(TMEVTN *p_tmevtn, EVTTIM evttim);
+
+/*
+ *  ç¾å¨ã®ã¤ãã³ãæå»ã®æ´æ°
+ *
+ *  current_evttimã¨current_hrtcntãï¼ç¾å¨ã®å¤ã«æ´æ°ããï¼
+ */
+extern void		update_current_evttim(void);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ã®è¨­å®
+ *
+ *  ç¾å¨ã®ã¤ãã³ãæå»ãåå¾ããå¾ã«å¼ã³åºããã¨ãæ³å®ãã¦ããï¼
+ */
+extern void		set_hrt_event(void);
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãã®ç»é²
+ *
+ *  p_tmevtbã§æå®ããã¿ã¤ã ã¤ãã³ããã­ãã¯ãç»é²ããï¼ã¿ã¤ã ã¤ãã³ã
+ *  ã®çºçæå»ï¼ã³ã¼ã«ããã¯é¢æ°ï¼ã³ã¼ã«ããã¯é¢æ°ã¸æ¸¡ãå¼æ°ã¯ï¼
+ *  p_tmevtbãæãã¿ã¤ã ã¤ãã³ããã­ãã¯ä¸­ã«è¨­å®ãã¦ããï¼
+ */
+extern void		tmevtb_register(TMEVTB *p_tmevtb);
+
+/*
+ *  ç¸å¯¾æéæå®ã«ããã¿ã¤ã ã¤ãã³ãã®ç»é²
+ *
+ *  timeã§æå®ããç¸å¯¾æéãçµéããå¾ã«ã³ã¼ã«ããã¯é¢æ°ãå¼ã³åºããã
+ *  ããã«ï¼p_tmevtbã§æå®ããã¿ã¤ã ã¤ãã³ããã­ãã¯ãç»é²ããï¼ã³ã¼ã«
+ *  ããã¯é¢æ°ï¼ã³ã¼ã«ããã¯é¢æ°ã¸æ¸¡ãå¼æ°ã¯ï¼p_tmevtbãæãã¿ã¤ã ã¤ã
+ *  ã³ããã­ãã¯ä¸­ã«è¨­å®ãã¦ããï¼
+ */
+extern void		tmevtb_enqueue(TMEVTB *p_tmevtb, RELTIM time);
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãã®ç»é²è§£é¤
+ */
+extern void		tmevtb_dequeue(TMEVTB *p_tmevtb);
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´æã®ã¨ã©ã¼ãã§ãã¯
+ *
+ *  adjtimã§æå®ãããæéã®åï¼ã·ã¹ãã æå»ãèª¿æ´ãã¦ãããå¤å®ããï¼
+ *  èª¿æ´ãã¦ã¯ãªããªãå ´åã«trueï¼ããã§ãªãå ´åã«falseãè¿ãï¼ç¾å¨ã®ã¤
+ *  ãã³ãæå»ãåå¾ããå¾ã«å¼ã³åºããã¨ãæ³å®ãã¦ããï¼
+ */
+extern bool_t	check_adjtim(int_t adjtim);
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããçºçããã¾ã§ã®æéã®è¨ç®
+ */
+extern RELTIM	tmevt_lefttim(TMEVTB *p_tmevtb);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦ç
+ */
+extern void	signal_time(void);
+
+#endif /* TOPPERS_TIME_EVENT_H */
Index: asp3_wo_tecs/trunk/extension/drift/kernel/time_manage.c
===================================================================
--- asp3_wo_tecs/trunk/extension/drift/kernel/time_manage.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/drift/kernel/time_manage.c	(revision 302)
@@ -0,0 +1,271 @@
+/*
+ *  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: time_manage.c 197 2014-06-29 09:41:46Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã æå»ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "time_event.h"
+#include "target_timer.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_SET_TIM_ENTER
+#define LOG_SET_TIM_ENTER(systim)
+#endif /* LOG_SET_TIM_ENTER */
+
+#ifndef LOG_SET_TIM_LEAVE
+#define LOG_SET_TIM_LEAVE(ercd)
+#endif /* LOG_SET_TIM_LEAVE */
+
+#ifndef LOG_GET_TIM_ENTER
+#define LOG_GET_TIM_ENTER(p_systim)
+#endif /* LOG_GET_TIM_ENTER */
+
+#ifndef LOG_GET_TIM_LEAVE
+#define LOG_GET_TIM_LEAVE(ercd, p_systim)
+#endif /* LOG_GET_TIM_LEAVE */
+
+#ifndef LOG_ADJ_TIM_ENTER
+#define LOG_ADJ_TIM_ENTER(adjtim)
+#endif /* LOG_ADJ_TIM_ENTER */
+
+#ifndef LOG_ADJ_TIM_LEAVE
+#define LOG_ADJ_TIM_LEAVE(ercd)
+#endif /* LOG_ADJ_TIM_LEAVE */
+
+#ifndef LOG_SET_DFT_ENTER
+#define LOG_SET_DFT_ENTER(drift)
+#endif /* LOG_SET_DFT_ENTER */
+
+#ifndef LOG_SET_DFT_LEAVE
+#define LOG_SET_DFT_LEAVE(ercd)
+#endif /* LOG_SET_DFT_LEAVE */
+
+#ifndef LOG_FCH_HRT_ENTER
+#define LOG_FCH_HRT_ENTER()
+#endif /* LOG_FCH_HRT_ENTER */
+
+#ifndef LOG_FCH_HRT_LEAVE
+#define LOG_FCH_HRT_LEAVE(hrtcnt)
+#endif /* LOG_FCH_HRT_LEAVE */
+
+/*
+ *  ã·ã¹ãã æå»ã®è¨­å®ï¼»NGKI3563ï¼½
+ */
+#ifdef TOPPERS_set_tim
+
+ER
+set_tim(SYSTIM systim)
+{
+	ER		ercd;
+
+	LOG_SET_TIM_ENTER(systim);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3564ï¼½ï¼»NGKI3565ï¼½*/
+
+	lock_cpu();
+	update_current_evttim();					/*ï¼»ASPD1059ï¼½*/
+	systim_offset = systim - monotonic_evttim;	/*ï¼»ASPD1060ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_SET_TIM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_set_tim */
+
+/*
+ *  ã·ã¹ãã æå»ã®åç
+§ï¼»NGKI2349ï¼½
+ */
+#ifdef TOPPERS_get_tim
+
+ER
+get_tim(SYSTIM *p_systim)
+{
+	ER		ercd;
+
+	LOG_GET_TIM_ENTER(p_systim);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI2350ï¼½ï¼»NGKI2351ï¼½*/
+
+	lock_cpu();
+	update_current_evttim();					/*ï¼»ASPD1057ï¼½*/
+	*p_systim = systim_offset + monotonic_evttim;	/*ï¼»ASPD1058ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_TIM_LEAVE(ercd, p_systim);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_tim */
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´ï¼»NGKI3581ï¼½
+ */
+#ifdef TOPPERS_adj_tim
+
+ER
+adj_tim(int32_t adjtim)
+{
+	EVTTIM	previous_evttim;
+	ER		ercd;
+
+	LOG_ADJ_TIM_ENTER(adjtim);
+	CHECK_UNL();								/*ï¼»NGKI3583ï¼½*/
+	CHECK_PAR(TMIN_ADJTIM <= adjtim && adjtim <= TMAX_ADJTIM);
+												/*ï¼»NGKI3584ï¼½*/
+	lock_cpu();
+	update_current_evttim();					/*ï¼»ASPD1051ï¼½*/
+	if (check_adjtim(adjtim)) {					/*ï¼»ASPD1052ï¼½*/
+		ercd = E_OBJ;
+	}
+	else {
+		previous_evttim = current_evttim;
+		current_evttim += adjtim;				/*ï¼»ASPD1053ï¼½*/
+		boundary_evttim = current_evttim - BOUNDARY_MARGIN;	/*ï¼»ASPD1055ï¼½*/
+
+		if (adjtim > 0
+				&& monotonic_evttim - previous_evttim < (EVTTIM) adjtim) {
+#ifdef UINT64_MAX
+			if (current_evttim < monotonic_evttim) {
+				systim_offset += 1LLU << 32;
+			}
+#endif /* UINT64_MAX */
+			monotonic_evttim = current_evttim;	/*ï¼»ASPD1054ï¼½*/
+		}
+
+		set_hrt_event();						/*ï¼»ASPD1056ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ADJ_TIM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_adj_tim */
+
+/*
+ *  ããªããéã®è¨­å®ï¼»NGKI3596ï¼½
+ */
+#ifdef TOPPERS_set_dft
+
+ER
+set_dft(int32_t drift)
+{
+	ER		ercd;
+
+	LOG_SET_DFT_ENTER(drift);
+	CHECK_UNL();								/*ï¼»NGKI3598ï¼½*/
+	CHECK_PAR(TMIN_DRIFT <= drift && drift <= TMAX_DRIFT);
+												/*ï¼»NGKI3599ï¼½*/
+	lock_cpu();
+	update_current_evttim();
+
+	drift_rate = (uint32_t)(1000000U + drift);	/*ï¼»NGKI3601ï¼½*/
+
+	evttim_step = (TSTEP_HRTCNT * drift_rate + 999999U) / 1000000U;
+	evttim_step_frac = (TSTEP_HRTCNT * drift_rate + 999999U) % 1000000U;
+
+	set_hrt_event();
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_SET_DFT_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_set_dft */
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®åç
+§ï¼»NGKI3569ï¼½
+ *
+ *  ä»»æã®ç¶æ
+ããå¼ã³åºããããã«ããããã«ï¼SILã®å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®
+ *  å¶å¾¡æ©è½ãç¨ãã¦ï¼æä»å¶å¾¡ãå®ç¾ãã¦ããï¼»NGKI3572ï¼½ï¼
+ */
+#ifdef TOPPERS_fch_hrt
+
+HRTCNT
+fch_hrt(void)
+{
+	HRTCNT	hrtcnt;
+	SIL_PRE_LOC;
+
+	LOG_FCH_HRT_ENTER();
+
+	SIL_LOC_INT();
+	hrtcnt = target_hrt_get_current();			/*ï¼»NGKI3571ï¼½*/
+	SIL_UNL_INT();
+
+	LOG_FCH_HRT_LEAVE(hrtcnt);
+	return(hrtcnt);
+}
+
+#endif /* TOPPERS_fch_hrt */
Index: asp3_wo_tecs/trunk/extension/drift/test/hrt_drift1.c
===================================================================
--- asp3_wo_tecs/trunk/extension/drift/test/hrt_drift1.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/drift/test/hrt_drift1.c	(revision 302)
@@ -0,0 +1,608 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: hrt_drift1.c 314 2015-02-08 14:54:01Z ertl-hiro $
+ */
+
+/* 
+ *		ããªããèª¿æ´æ©è½ã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  ããªããèª¿æ´æ©è½ãç¶²ç¾
+çã«ãã¹ãããï¼å
+·ä½çã«ã¯ï¼ããªããèª¿æ´æ©è½
+ *  ãè¿½å ãããã¨ã§è¿½å ã»æ¡å¼µãããé¢æ°ãä¸­å¿ã«ãã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) set_timã®è¦æ±ãã¼ã¹ãã¹ã
+ *	  (A-1) CPUã­ãã¯ç¶æ
+ããã®å¼åºãï¼»NGKI3598ï¼½
+ *	  (A-2) driftãTMIN_DRIFTããå°ããï¼»NGKI3599ï¼½
+ *	  (A-3) driftãTMAX_DRIFTããå¤§ããï¼»NGKI3599ï¼½
+ *	  (A-4) ããªããéãdriftã§æå®ããå¤ã«è¨­å®ãããï¼»NGKI3601ï¼½
+ *	(B) update_current_evttim
+ *	  (B-1) ããªããéãæ­£ã§ç«¯æ°ã®ç¹°ãä¸ããããªãæ
+ *	  (B-2) ããªããéãæ­£ã§ç«¯æ°ã®ç¹°ãä¸ãããããæ
+ *	  (B-3) ããªããéãè² ã§ç«¯æ°ã®ç¹°ãä¸ããããªãæ
+ *	  (B-4) ããªããéãè² ã§ç«¯æ°ã®ç¹°ãä¸ãããããæ
+ *	  â» (current_evttim_frac >= 2000000U)ã®ãã¹ã¯åä½ã§ãã¹ãããã
+ *	(C) calc_current_evttim_ubï¼tmevtb_enqueueããã®å¼ã³åºãï¼
+ *	  (C-1) ããªããéãæ­£ã§ç«¯æ°ã®ç¹°ãä¸ããããªãæ
+ *	  (C-2) ããªããéãæ­£ã§ç«¯æ°ã®ç¹°ãä¸ãããããæ
+ *	  (C-3) ããªããéãè² ã§ç«¯æ°ã®ç¹°ãä¸ããããªãæ
+ *	  (C-4) ããªããéãè² ã§ç«¯æ°ã®ç¹°ãä¸ãããããæ
+ *	(D) calc_current_evttim_ubï¼tmevt_lefttimããã®å¼ã³åºãï¼
+ *	  (D-1) ããªããéãæ­£ã§ç«¯æ°ã®ç¹°ãä¸ããããªãæ
+ *	  (D-2) ããªããéãæ­£ã§ç«¯æ°ã®ç¹°ãä¸ãããããæ
+ *	  (D-3) ããªããéãè² ã§ç«¯æ°ã®ç¹°ãä¸ããããªãæ
+ *	  (D-4) ããªããéãè² ã§ç«¯æ°ã®ç¹°ãä¸ãããããæ
+ *	(E) set_hrt_event
+ *	  (E-1) ããªããéãæ­£ã§ã¿ã¤ã ã¤ãã³ããã¼ããç©ºã®æ
+ *	  (E-2) ããªããéãæ­£ã§hrtcntãHRTCNT_BOUNDãè¶
+ããæ â¦ å¥ã«ãã¹ã
+ *	  (E-3) ããªããéãæ­£ã§hrtcntãHRTCNT_BOUNDãè¶
+ããªãæ
+ *	  (E-4) ããªããéãè² ã§ã¿ã¤ã ã¤ãã³ããã¼ããç©ºã®æ
+ *	  (E-5) ããªããéãè² ã§hrtcntãHRTCNT_BOUNDãè¶
+ããæ â¦ å¥ã«ãã¹ã
+ *	  (E-6) ããªããéãè² ã§hrtcntãHRTCNT_BOUNDãè¶
+ããªãæ
+ *	  â» (c1 > HRTCNT_BOUND / 1000000U)ã®ãã¹ã¯åä½ã§ãã¹ãããã
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	é«åè§£è½ã¿ã¤ãã¢ã¸ã¥ã¼ã«ã®æ§è³ªï¼HRT_CONFIG1
+ *		TCYC_HRTCNT		æªå®ç¾©ï¼2^32ã®æå³ï¼
+ *		TSTEP_HRTCNT	1U
+ *		HRTCNT_BOUND	4000000002U
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *
+ * ãè£è¶³èª¬æã
+ *
+ *	ä»¥ä¸ã®ãã¹ãã·ã¼ã±ã³ã¹ã®ã³ã¡ã³ãä¸­ã§ï¼ãçºçï¼xxxãã¨ã¯ï¼é«åè§£è½ã¿
+ *	ã¤ãã®ã«ã¦ã³ãå¤ãxxxã«ãªã£ãæã«ã¿ã¤ã ã¤ãã³ããçºçãããã¨ãæå³
+ *	ããï¼ã¿ã¤ã ã¤ãã³ãã®ã¤ãã³ãçºçæå»ã§ã¯ãªãï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== START ==
+ *	// ã«ã¼ãã«èµ·åï¼é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã¨ã¤ãã³ãæå»ã¯10ããã
+ *	1:		[target_hrt_get_current -> 10U]
+ *	2:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	// ããªããéã+1%ã«è¨­å®
+ *	//		ç¾æç¹ï¼hrtcntï¼20ï¼evttimï¼10ï¼evttim_fracï¼0
+ *	3:	set_dft(+10000)
+ *	4:		[target_hrt_get_current -> 20U]
+ *	5:		[target_hrt_set_event <- HRTCNT_EMPTY_P1P]	... (E-1)
+ *	// ã¿ã¤ã ã¤ãã³ããç»é²
+ *	6:	sta_alm(ALM1, 100)							... (C-2)
+ *	7:		[target_hrt_get_current -> 30U]
+ *	//		ç¾æç¹ï¼hrtcntï¼30ï¼evttimï¼20ï¼evttim_fracï¼100000
+ *	//		å¤§ããæ¹ã«ä¸¸ãã ï¼ evttimï¼21ï¼evttim_fracï¼110000
+ *	//		ç¸å¯¾æéï¼100ï¼ã¤ãã³ãçºçæå»ï¼122
+ *	//		ã«ã¦ã³ãå¤ï¼(101900000 / 1010000)ã®åãä¸ã â 101
+ *	8:		[target_hrt_set_event <- 101U]			... (E-3)
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	// ããªããèª¿æ´ãå¹ãç´å
+ *	9:	get_tim(&systim)							... (B-1)
+ *	10:		[target_hrt_get_current -> 119U]
+ *	//		ç¾æç¹ï¼hrtcntï¼119ï¼evttimï¼109ï¼evttim_fracï¼990000
+ *	11:	assert(systim == 109U)
+ *	// ããã§ããªããèª¿æ´ãå¹ãï¼ã·ã¹ãã æå»ã2é²ãï¼
+ *	12:	get_tim(&systim)							... (B-2)
+ *	13:		[target_hrt_get_current -> 120U]
+ *	//		ç¾æç¹ï¼hrtcntï¼120ï¼evttimï¼111ï¼evttim_fracï¼0
+ *	14:	assert(systim == 111U)
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	15:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	16:		[target_hrt_get_current -> 131U]		// ALM1ãçºç
+ *	//		ç¾æç¹ï¼hrtcntï¼131ï¼evttimï¼122ï¼evttim_fracï¼110000
+ *	== ALM1-1ï¼1åç®ï¼==
+ *	17:	RETURN
+ *	// ã¿ã¤ã ã¤ãã³ãããªããªã£ãå ´å
+ *	18:		[target_hrt_get_current -> 140U]
+ *	19:		[target_hrt_set_event <- HRTCNT_EMPTY_P1P]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	// ããªããèª¿æ´ãå¹ãç´å
+ *	20:	get_tim(&systim)							... (B-1)
+ *	21:		[target_hrt_get_current -> 219U]
+ *	//		ç¾æç¹ï¼hrtcntï¼219ï¼evttimï¼210ï¼evttim_fracï¼990000
+ *	22:	assert(systim == 210U)
+ *	// ã¿ã¤ã ã¤ãã³ããç»é²
+ *	23:	sta_alm(ALM1, 100U)							... (C-1)
+ *	24:		[target_hrt_get_current -> 219U]
+ *	//		ç¾æç¹ï¼hrtcntï¼219ï¼evttimï¼210ï¼evttim_fracï¼990000
+ *	//		å¤§ããæ¹ã«ä¸¸ãã ï¼  evttimï¼212ï¼evttim_fracï¼0
+ *	//		ç¸å¯¾æéï¼100ï¼ã¤ãã³ãçºçæå»ï¼312
+ *	//		ã«ã¦ã³ãå¤ï¼(101010000 / 1010000)ã®åãä¸ã â 101
+ *	25:		[target_hrt_set_event <- 101U]
+ *	// ããã§ããªããèª¿æ´ãå¹ã
+ *	26:	get_tim(&systim)							... (B-2)
+ *	27:		[target_hrt_get_current -> 220U]
+ *	//		ç¾æç¹ï¼hrtcntï¼220ï¼evttimï¼212ï¼evttim_fracï¼0
+ *	28:	assert(systim == 212U)
+ *
+ *	// ããªããéã-1%ã«è¨­å®ï¼ç«¯æ°ã0ã«ãªãã¿ã¤ãã³ã°ã§è¨­å®ï¼
+ *	29:	set_dft(-10000)
+ *	30:		[target_hrt_get_current -> 220U]
+ *	//		ç¾æç¹ï¼hrtcntï¼220ï¼evttimï¼212ï¼evttim_fracï¼0
+ *	//		ã«ã¦ã³ãå¤ï¼(100000000 / 990000)ã®åãä¸ã â 102
+ *	31:		[target_hrt_set_event <- 102U]			... (E-6)
+ *	// ããªããèª¿æ´ãããã«å¹ã
+ *	32:	get_tim(&systim)							... (B-3)
+ *	33:		[target_hrt_get_current -> 221U]
+ *	//		ç¾æç¹ï¼hrtcntï¼221ï¼evttimï¼212ï¼evttim_fracï¼990000
+ *	34:	assert(systim == 212U)
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	// ããªããèª¿æ´ãæ¬¡ã«å¹ãç´å
+ *	35:	get_tim(&systim)
+ *	36:		[target_hrt_get_current -> 320U]		... (B-4)
+ *	//		ç¾æç¹ï¼hrtcntï¼320ï¼evttimï¼311ï¼evttim_fracï¼0
+ *	37:	assert(systim == 311U)
+ *	// ããã§ããªããèª¿æ´ãå¹ã
+ *	38:	get_tim(&systim)
+ *	39:		[target_hrt_get_current -> 321U]		... (B-3)
+ *	//		ç¾æç¹ï¼hrtcntï¼321ï¼evttimï¼311ï¼evttim_fracï¼990000
+ *	40:	assert(systim == 311U)
+ *	41:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	42:		[target_hrt_get_current -> 322U]		// ALM1ãçºç
+ *	//		ç¾æç¹ï¼hrtcntï¼322ï¼evttimï¼312ï¼evttim_fracï¼980000
+ *	== ALM1-2ï¼2åç®ï¼==
+ *	43:	RETURN
+ *	// ã¿ã¤ã ã¤ãã³ãããªããªã£ãå ´å
+ *	44:		[target_hrt_get_current -> 330U]
+ *	//		ç¾æç¹ï¼hrtcntï¼330ï¼evttimï¼320ï¼evttim_fracï¼900000
+ *	45:		[target_hrt_set_event <- HRTCNT_EMPTY_M1P]	... (E-4)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *
+ *	// ããªããéã+1%ã«è¨­å®ï¼ç«¯æ°ã0.5ã«ãªãã¿ã¤ãã³ã°ã§è¨­å®ï¼
+ *	46:	set_dft(+10000)
+ *	47:		[target_hrt_get_current -> 370U]
+ *	//		ç¾æç¹ï¼hrtcntï¼370ï¼evttimï¼360ï¼evttim_fracï¼500000
+ *	48:		[target_hrt_set_event <- HRTCNT_EMPTY_P1P]
+ *	49:	get_tim(&systim)
+ *	50:		[target_hrt_get_current -> 370U]
+ *	//		ç¾æç¹ï¼hrtcntï¼370ï¼evttimï¼360ï¼evttim_fracï¼500000
+ *	51:	assert(systim == 360U)
+ *	// ããªããèª¿æ´ãå¹ãç´å
+ *	52:	get_tim(&systim)
+ *	53:		[target_hrt_get_current -> 419U]
+ *	//		ç¾æç¹ï¼hrtcntï¼419ï¼evttimï¼409ï¼evttim_fracï¼990000
+ *	54:	assert(systim == 409U)
+ *	// ããã§ããªããèª¿æ´ãå¹ã
+ *	55:	get_tim(&systim)
+ *	56:		[target_hrt_get_current -> 420U]
+ *	//		ç¾æç¹ï¼hrtcntï¼420ï¼evttimï¼411ï¼evttim_fracï¼0
+ *	57:	assert(systim == 411U)
+ *	58:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "hrt_drift1.h"
+#include "target_timer.h"
+
+#if !defined(HRT_CONFIG1) || defined(HRT_CONFIG2)
+#error Compiler option "-DHRT_CONFIG1" is missing.
+#endif
+
+#define HRTCNT_EMPTY		4000000000U
+#define HRTCNT_EMPTY_P1P	3960396040U
+#define HRTCNT_EMPTY_M1P	HRTCNT_BOUND
+
+#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
+
+void
+target_hrt_raise_event(void)
+{
+}
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+static uint_t	alarm1_count = 0;
+
+void
+alarm1_handler(intptr_t exinf)
+{
+
+	switch (++alarm1_count) {
+	case 1:
+		check_point(17);
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(43);
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	SYSTIM	systim;
+
+	check_point(3);
+	ercd = set_dft(+10000);
+	check_ercd(ercd, E_OK);
+
+	check_point(6);
+	ercd = sta_alm(ALM1, 100);
+	check_ercd(ercd, E_OK);
+
+	check_point(9);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	check_assert(systim == 109U);
+
+	check_point(12);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	check_assert(systim == 111U);
+
+	check_point(15);
+	target_raise_hrt_int(0U);
+
+	check_point(20);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(22);
+	check_assert(systim == 210U);
+
+	check_point(23);
+	ercd = sta_alm(ALM1, 100U);
+	check_ercd(ercd, E_OK);
+
+	check_point(26);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(28);
+	check_assert(systim == 212U);
+
+	check_point(29);
+	ercd = set_dft(-10000);
+	check_ercd(ercd, E_OK);
+
+	check_point(32);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(34);
+	check_assert(systim == 212U);
+
+	check_point(35);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(37);
+	check_assert(systim == 311U);
+
+	check_point(38);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(40);
+	check_assert(systim == 311U);
+
+	check_point(41);
+	target_raise_hrt_int(0U);
+
+	check_point(46);
+	ercd = set_dft(+10000);
+	check_ercd(ercd, E_OK);
+
+	check_point(49);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(51);
+	check_assert(systim == 360U);
+
+	check_point(52);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(54);
+	check_assert(systim == 409U);
+
+	check_point(55);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(57);
+	check_assert(systim == 411U);
+
+	check_finish(58);
+	check_point(0);
+}
+
+static uint_t	target_hrt_get_current_count = 0;
+
+HRTCNT
+target_hrt_get_current(void)
+{
+
+	switch (++target_hrt_get_current_count) {
+	case 1:
+		test_start(__FILE__);
+
+		check_point(1);
+		return(10U);
+
+		check_point(0);
+
+	case 2:
+		check_point(4);
+		return(20U);
+
+		check_point(0);
+
+	case 3:
+		check_point(7);
+		return(30U);
+
+		check_point(0);
+
+	case 4:
+		check_point(10);
+		return(119U);
+
+		check_point(0);
+
+	case 5:
+		check_point(13);
+		return(120U);
+
+		check_point(0);
+
+	case 6:
+		check_point(16);
+		return(131U);
+
+		check_point(0);
+
+	case 7:
+		check_point(18);
+		return(140U);
+
+		check_point(0);
+
+	case 8:
+		check_point(21);
+		return(219U);
+
+		check_point(0);
+
+	case 9:
+		check_point(24);
+		return(219U);
+
+		check_point(0);
+
+	case 10:
+		check_point(27);
+		return(220U);
+
+		check_point(0);
+
+	case 11:
+		check_point(30);
+		return(220U);
+
+		check_point(0);
+
+	case 12:
+		check_point(33);
+		return(221U);
+
+		check_point(0);
+
+	case 13:
+		check_point(36);
+		return(320U);
+
+		check_point(0);
+
+	case 14:
+		check_point(39);
+		return(321U);
+
+		check_point(0);
+
+	case 15:
+		check_point(42);
+		return(322U);
+
+		check_point(0);
+
+	case 16:
+		check_point(44);
+		return(330U);
+
+		check_point(0);
+
+	case 17:
+		check_point(47);
+		return(370U);
+
+		check_point(0);
+
+	case 18:
+		check_point(50);
+		return(370U);
+
+		check_point(0);
+
+	case 19:
+		check_point(53);
+		return(419U);
+
+		check_point(0);
+
+	case 20:
+		check_point(56);
+		return(420U);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+	return(0U);
+}
+
+static uint_t	target_hrt_set_event_count = 0;
+
+void
+target_hrt_set_event(HRTCNT hrtcnt)
+{
+
+	switch (++target_hrt_set_event_count) {
+	case 1:
+		check_point(2);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(5);
+		check_assert(hrtcnt == HRTCNT_EMPTY_P1P);
+
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(8);
+		check_assert(hrtcnt == 101U);
+
+		return;
+
+		check_point(0);
+
+	case 4:
+		check_point(19);
+		check_assert(hrtcnt == HRTCNT_EMPTY_P1P);
+
+		return;
+
+		check_point(0);
+
+	case 5:
+		check_point(25);
+		check_assert(hrtcnt == 101U);
+
+		return;
+
+		check_point(0);
+
+	case 6:
+		check_point(31);
+		check_assert(hrtcnt == 102U);
+
+		return;
+
+		check_point(0);
+
+	case 7:
+		check_point(45);
+		check_assert(hrtcnt == HRTCNT_EMPTY_M1P);
+
+		return;
+
+		check_point(0);
+
+	case 8:
+		check_point(48);
+		check_assert(hrtcnt == HRTCNT_EMPTY_P1P);
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/extension/drift/test/hrt_drift1.cfg
===================================================================
--- asp3_wo_tecs/trunk/extension/drift/test/hrt_drift1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/extension/drift/test/hrt_drift1.cfg	(revision 302)
@@ -0,0 +1,14 @@
+/*
+ *		ããªããèª¿æ´æ©è½ã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: hrt_drift1.cfg 327 2015-06-21 06:42:01Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "hrt_drift1.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
Index: asp3_wo_tecs/trunk/extension/drift/test/hrt_drift1.h
===================================================================
--- asp3_wo_tecs/trunk/extension/drift/test/hrt_drift1.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/drift/test/hrt_drift1.h	(revision 302)
@@ -0,0 +1,90 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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: hrt_drift1.h 197 2014-06-29 09:41:46Z ertl-hiro $
+ */
+
+/* 
+ *		ããªããèª¿æ´æ©è½ã®ãã¹ã(1)
+ */
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#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	alarm1_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/extension/messagebuf/include/kernel.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/include/kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/include/kernel.h	(revision 302)
@@ -0,0 +1,632 @@
+/*
+ *  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) 2004-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.h 463 2015-10-18 14:25:55Z ertl-hiro $
+ */
+
+/*
+ *		TOPPERS/ASPã«ã¼ãã« æ¨æºããããã¡ã¤ã«
+ *
+ *  TOPPERS/ASPã«ã¼ãã«ããµãã¼ããããµã¼ãã¹ã³ã¼ã«ã®å®£è¨ã¨ï¼å¿
+è¦ãªãã¼
+ *  ã¿åï¼å®æ°ï¼ãã¯ã­ã®å®ç¾©ãå«ãããããã¡ã¤ã«ï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ããï¼ããã«ããï¼ãã¯ã­å®ç¾©ä»¥å¤ã
+ *  é¤ãããã«ãªã£ã¦ããï¼
+ */
+
+#ifndef TOPPERS_KERNEL_H
+#define TOPPERS_KERNEL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *	TOPPERSå
+±éã®ãã¼ã¿åã»å®æ°ã»ãã¯ã­
+ */
+#include <t_stddef.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨
+ */
+#include "target_kernel.h"
+
+/*
+ *  ãµãã¼ãããæ©è½
+ */
+#ifdef TOPPERS_TARGET_SUPPORT_DIS_INT
+#define TOPPERS_SUPPORT_DIS_INT			/* dis_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_DIS_INT */
+
+#ifdef TOPPERS_TARGET_SUPPORT_ENA_INT
+#define TOPPERS_SUPPORT_ENA_INT			/* ena_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_ENA_INT */
+
+#define TOPPERS_SUPPORT_MESSAGEBUF		/* ã¡ãã»ã¼ã¸ãããã¡æ©è½æ¡å¼µ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãã¼ã¿åã®å®ç¾©
+ */
+
+/*
+ *  ããããã¿ã¼ã³ããªãã¸ã§ã¯ãçªå·ã®åå®ç¾©
+ */
+typedef	uint_t		FLGPTN;		/* ã¤ãã³ããã©ã°ã®ããããã¿ã¼ã³ */
+typedef	uint_t		INTNO;		/* å²è¾¼ã¿çªå· */
+typedef	uint_t		INHNO;		/* å²è¾¼ã¿ãã³ãã©çªå· */
+typedef	uint_t		EXCNO;		/* CPUä¾å¤ãã³ãã©çªå· */
+
+/*
+ *  å¦çåä½ã®åå®ç¾©
+ */
+typedef void	(*TASK)(intptr_t exinf);
+typedef void	(*TMEHDR)(intptr_t exinf);
+typedef void	(*ISR)(intptr_t exinf);
+typedef void	(*INTHDR)(void);
+typedef void	(*EXCHDR)(void *p_excinf);
+typedef void	(*INIRTN)(intptr_t exinf);
+typedef void	(*TERRTN)(intptr_t exinf);
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®åå®ç¾©
+ */
+#ifndef TOPPERS_STK_T
+#define TOPPERS_STK_T	intptr_t
+#endif /* TOPPERS_STK_T */
+typedef	TOPPERS_STK_T	STK_T;	/* ã¹ã¿ãã¯é åãç¢ºä¿ããããã®å */
+
+#ifndef TOPPERS_MPF_T
+#define TOPPERS_MPF_T	intptr_t
+#endif /* TOPPERS_MPF_T */
+typedef	TOPPERS_MPF_T	MPF_T;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åãç¢ºä¿ããããã®å */
+
+/*
+ *  ãã±ããå½¢å¼ã®å®ç¾©
+ */
+typedef struct t_rtsk {
+	STAT	tskstat;	/* ã¿ã¹ã¯ç¶æ
+ */
+	PRI		tskpri;		/* ã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ */
+	PRI		tskbpri;	/* ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+	STAT	tskwait;	/* å¾
+ã¡è¦å  */
+	ID		wobjid;		/* å¾
+ã¡å¯¾è±¡ã®ãªãã¸ã§ã¯ãã®ID */
+	TMO		lefttmo;	/* ã¿ã¤ã ã¢ã¦ãããã¾ã§ã®æé */
+	uint_t	actcnt;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	uint_t	wupcnt;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	bool_t	raster;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	bool_t	dister;		/* ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ */
+} T_RTSK;
+
+typedef struct t_rsem {
+	ID		wtskid;		/* ã»ããã©ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	semcnt;		/* ã»ããã©ã®ç¾å¨ã®è³æºæ° */
+} T_RSEM;
+
+typedef struct t_rflg {
+	ID		wtskid;		/* ã¤ãã³ããã©ã°ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	FLGPTN	flgptn;		/* ã¤ãã³ããã©ã°ã®ç¾å¨ã®ããããã¿ã¼ã³ */
+} T_RFLG;
+
+typedef struct t_rdtq {
+	ID		stskid;		/* ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	ID		rtskid;		/* ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	sdtqcnt;	/* ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼ã¿ã®æ° */
+} T_RDTQ;
+
+typedef struct t_rpdq {
+	ID		stskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	ID		rtskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	uint_t	spdqcnt;	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼
+						   ã¿ã®æ° */
+} T_RPDQ;
+
+typedef struct t_rmtx {
+	ID		htskid;		/* ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã¿ã¹ã¯ã®IDçªå· */
+	ID		wtskid;		/* ãã¥ã¼ããã¯ã¹ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+} T_RMTX;
+
+typedef struct t_rmbf {
+	ID		stskid;		/* ã¡ãã»ã¼ã¸ãããã¡ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	ID		rtskid;		/* ã¡ãã»ã¼ã¸ãããã¡ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	uint_t	smbfcnt;	/* ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åã«æ ¼ç´ããã¦ããã¡ã
+						   ã»ã¼ã¸ã®æ° */
+	size_t	fmbfsz;		/* ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åä¸­ã®ç©ºãé åã®ãµã¤ãº */
+} T_RMBF;
+
+typedef struct t_rmpf {
+	ID		wtskid;		/* åºå®é·ã¡ã¢ãªãã¼ã«ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®
+						   IDçªå· */
+	uint_t	fblkcnt;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®ç©ºãã¡ã¢ãªé åã«å²ã
+						   ä»ãããã¨ãã§ããåºå®é·ã¡ã¢ãªãã­ãã¯ã®æ° */
+} T_RMPF;
+
+typedef struct t_rcyc {
+	STAT	cycstat;	/* å¨æéç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* æ¬¡åéç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RCYC;
+
+typedef struct t_ralm {
+	STAT	almstat;	/* ã¢ã©ã¼ã éç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* éç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RALM;
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å®£è¨
+ */
+
+/*
+ *  ã¿ã¹ã¯ç®¡çæ©è½
+ */
+extern ER		act_tsk(ID tskid) throw();
+extern ER_UINT	can_act(ID tskid) throw();
+extern ER		get_tst(ID tskid, STAT *p_tskstat) throw();
+extern ER		chg_pri(ID tskid, PRI tskpri) throw();
+extern ER		get_pri(ID tskid, PRI *p_tskpri) throw();
+extern ER		get_inf(intptr_t *p_exinf) throw();
+extern ER		ref_tsk(ID tskid, T_RTSK *pk_rtsk) throw();
+
+/*
+ *  ã¿ã¹ã¯ä»å±åææ©è½
+ */
+extern ER		slp_tsk(void) throw();
+extern ER		tslp_tsk(TMO tmout) throw();
+extern ER		wup_tsk(ID tskid) throw();
+extern ER_UINT	can_wup(ID tskid) throw();
+extern ER		rel_wai(ID tskid) throw();
+extern ER		sus_tsk(ID tskid) throw();
+extern ER		rsm_tsk(ID tskid) throw();
+extern ER		dly_tsk(RELTIM dlytim) throw();
+
+/*
+ *  ã¿ã¹ã¯çµäºæ©è½
+ */
+extern ER		ext_tsk(void) throw();
+extern ER		ras_ter(ID tskid) throw();
+extern ER		dis_ter(void) throw();
+extern ER		ena_ter(void) throw();
+extern bool_t	sns_ter(void) throw();
+extern ER		ter_tsk(ID tskid) throw();
+
+/*
+ *  åæã»éä¿¡æ©è½
+ */
+extern ER		sig_sem(ID semid) throw();
+extern ER		wai_sem(ID semid) throw();
+extern ER		pol_sem(ID semid) throw();
+extern ER		twai_sem(ID semid, TMO tmout) throw();
+extern ER		ini_sem(ID semid) throw();
+extern ER		ref_sem(ID semid, T_RSEM *pk_rsem) throw();
+
+extern ER		set_flg(ID flgid, FLGPTN setptn) throw();
+extern ER		clr_flg(ID flgid, FLGPTN clrptn) throw();
+extern ER		wai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		pol_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		twai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn, TMO tmout) throw();
+extern ER		ini_flg(ID flgid) throw();
+extern ER		ref_flg(ID flgid, T_RFLG *pk_rflg) throw();
+
+extern ER		snd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		psnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		tsnd_dtq(ID dtqid, intptr_t data, TMO tmout) throw();
+extern ER		fsnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		rcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		prcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		trcv_dtq(ID dtqid, intptr_t *p_data, TMO tmout) throw();
+extern ER		ini_dtq(ID dtqid) throw();
+extern ER		ref_dtq(ID dtqid, T_RDTQ *pk_rdtq) throw();
+
+extern ER		snd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		psnd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		tsnd_pdq(ID pdqid, intptr_t data,
+										PRI datapri, TMO tmout) throw();
+extern ER		rcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		prcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		trcv_pdq(ID pdqid, intptr_t *p_data,
+										PRI *p_datapri, TMO tmout) throw();
+extern ER		ini_pdq(ID pdqid) throw();
+extern ER		ref_pdq(ID pdqid, T_RPDQ *pk_rpdq) throw();
+
+extern ER		loc_mtx(ID mtxid) throw();
+extern ER		ploc_mtx(ID mtxid) throw();
+extern ER		tloc_mtx(ID mtxid, TMO tmout) throw();
+extern ER		unl_mtx(ID mtxid) throw();
+extern ER		ini_mtx(ID mtxid) throw();
+extern ER		ref_mtx(ID mtxid, T_RMTX *pk_rmtx) throw();
+
+extern ER		snd_mbf(ID mbfid, const void *msg, uint_t msgsz) throw();
+extern ER		psnd_mbf(ID mbfid, const void *msg, uint_t msgsz) throw();
+extern ER		tsnd_mbf(ID mbfid, const void *msg,
+										uint_t msgsz, TMO tmout) throw();
+extern ER_UINT	rcv_mbf(ID mbfid, void *msg) throw();
+extern ER_UINT	prcv_mbf(ID mbfid, void *msg) throw();
+extern ER_UINT	trcv_mbf(ID mbfid, void *msg, TMO tmout) throw();
+extern ER		ini_mbf(ID mbfid) throw();
+extern ER		ref_mbf(ID mbfid, T_RMBF *pk_rmbf) throw();
+
+/*
+ *  ã¡ã¢ãªãã¼ã«ç®¡çæ©è½
+ */
+extern ER		get_mpf(ID mpfid, void **p_blk) throw();
+extern ER		pget_mpf(ID mpfid, void **p_blk) throw();
+extern ER		tget_mpf(ID mpfid, void **p_blk, TMO tmout) throw();
+extern ER		rel_mpf(ID mpfid, void *blk) throw();
+extern ER		ini_mpf(ID mpfid) throw();
+extern ER		ref_mpf(ID mpfid, T_RMPF *pk_rmpf) throw();
+
+/*
+ *  æéç®¡çæ©è½
+ */
+extern ER		set_tim(SYSTIM systim) throw();
+extern ER		get_tim(SYSTIM *p_systim) throw();
+extern ER		adj_tim(int32_t adjtim) throw();
+extern HRTCNT	fch_hrt(void) throw();
+
+extern ER		sta_cyc(ID cycid) throw();
+extern ER		stp_cyc(ID cycid) throw();
+extern ER		ref_cyc(ID cycid, T_RCYC *pk_rcyc) throw();
+
+extern ER		sta_alm(ID almid, RELTIM almtim) throw();
+extern ER		stp_alm(ID almid) throw();
+extern ER		ref_alm(ID almid, T_RALM *pk_ralm) throw();
+
+/*
+ *  ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+ */
+extern ER		rot_rdq(PRI tskpri) throw();
+extern ER		get_tid(ID *p_tskid) throw();
+extern ER		get_lod(PRI tskpri, uint_t *p_load) throw();
+extern ER		get_nth(PRI tskpri, uint_t nth, ID *p_tskid) throw();
+extern ER		loc_cpu(void) throw();
+extern ER		unl_cpu(void) throw();
+extern ER		dis_dsp(void) throw();
+extern ER		ena_dsp(void) throw();
+extern bool_t	sns_ctx(void) throw();
+extern bool_t	sns_loc(void) throw();
+extern bool_t	sns_dsp(void) throw();
+extern bool_t	sns_dpn(void) throw();
+extern bool_t	sns_ker(void) throw();
+extern ER		ext_ker(void) throw();
+
+/*
+ *  å²è¾¼ã¿ç®¡çæ©è½
+ */
+extern ER		dis_int(INTNO intno) throw();
+extern ER		ena_int(INTNO intno) throw();
+extern ER		chg_ipm(PRI intpri) throw();
+extern ER		get_ipm(PRI *p_intpri) throw();
+
+/*
+ *  CPUä¾å¤ç®¡çæ©è½
+ */
+extern bool_t	xsns_dpn(void *p_excinf) throw();
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãããµã¼ãã¹ã³ã¼ã«
+ */
+#define iact_tsk(tskid)						act_tsk(tskid)
+#define iwup_tsk(tskid)						wup_tsk(tskid)
+#define irel_wai(tskid)						rel_wai(tskid)
+#define isns_ter()							sns_ter()
+#define isig_sem(semid)						sig_sem(semid)
+#define iset_flg(flgid, setptn)				set_flg(flgid, setptn)
+#define ipsnd_dtq(dtqid, data)				psnd_dtq(dtqid, data)
+#define ifsnd_dtq(dtqid, data)				fsnd_dtq(dtqid, data)
+#define ipsnd_pdq(pdqid, data, datapri)		psnd_pdq(pdqid, data, datapri)
+#define ifch_hrt()							fch_hrt()
+#define ista_alm(almid, almtim)				sta_alm(almid, almtim)
+#define istp_alm(almid)						stp_alm(almid)
+#define irot_rdq(tskpri)					rot_rdq(tskpri)
+#define iget_tid(p_tskid)					get_tid(p_tskid)
+#define iloc_cpu()							loc_cpu()
+#define iunl_cpu()							unl_cpu()
+#define isns_ctx()							sns_ctx()
+#define isns_loc()							sns_loc()
+#define isns_dsp()							sns_dsp()
+#define isns_dpn()							sns_dpn()
+#define isns_ker()							sns_ker()
+#define iext_ker()							ext_ker()
+#define idis_int(intno)						dis_int(intno)
+#define iena_int(intno)						ena_int(intno)
+#define ixsns_dpn(p_excinf)					xsns_dpn(p_excinf)
+
+/*
+ *  ãªãã¸ã§ã¯ãå±æ§ã®å®ç¾©
+ */
+#define TA_ACT			UINT_C(0x01)	/* ã¿ã¹ã¯ãèµ·åãããç¶æ
+ã§çæ */
+#define TA_NOACTQUE		UINT_C(0x02)	/* èµ·åè¦æ±ãã­ã¥ã¼ã¤ã³ã°ããªã */
+
+#define TA_TPRI			UINT_C(0x01)	/* ã¿ã¹ã¯ã®å¾
+ã¡è¡åãåªå
+åº¦é ã« */
+
+#define TA_WMUL			UINT_C(0x02)	/* è¤æ°ã®å¾
+ã¡ã¿ã¹ã¯ */
+#define TA_CLR			UINT_C(0x04)	/* ã¤ãã³ããã©ã°ã®ã¯ãªã¢æå® */
+
+#define TA_CEILING		UINT_C(0x03)	/* åªå
+åº¦ä¸éãã­ãã³ã« */
+
+#define TA_STA			UINT_C(0x02)	/* å¨æéç¥ãåä½ç¶æ
+ã§çæ */
+
+#define TA_NONKERNEL	UINT_C(0x02)	/* ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ */
+
+#define TA_ENAINT		UINT_C(0x01)	/* å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ãã¯ãªã¢ */
+#define TA_EDGE			UINT_C(0x02)	/* ã¨ãã¸ããªã¬ */
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®åä½ã¢ã¼ãã®å®ç¾©
+ */
+#define TWF_ORW			UINT_C(0x01)	/* ã¤ãã³ããã©ã°ã®ORå¾
+ã¡ */
+#define TWF_ANDW		UINT_C(0x02)	/* ã¤ãã³ããã©ã°ã®ANDå¾
+ã¡ */
+
+/*
+ *  éç¥å¦çã¢ã¼ãã®å®ç¾©
+ */
+#define TNFY_HANDLER	UINT_C(0x00)		/* ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºã */
+#define TNFY_SETVAR		UINT_C(0x01)		/* å¤æ°ã®è¨­å® */
+#define TNFY_INCVAR		UINT_C(0x02)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TNFY_ACTTSK		UINT_C(0x03)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TNFY_WUPTSK		UINT_C(0x04)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TNFY_SIGSEM		UINT_C(0x05)		/* ã»ããã©ã®è³æºã®è¿å´ */
+#define TNFY_SETFLG		UINT_C(0x06)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TNFY_SNDDTQ		UINT_C(0x07)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+#define TENFY_SETVAR	UINT_C(0x10)		/* å¤æ°ã®è¨­å® */
+#define TENFY_INCVAR	UINT_C(0x20)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TENFY_ACTTSK	UINT_C(0x30)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TENFY_WUPTSK	UINT_C(0x40)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TENFY_SIGSEM	UINT_C(0x50)		/* ã»ããã©ã®è¿å´ */
+#define TENFY_SETFLG	UINT_C(0x60)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TENFY_SNDDTQ	UINT_C(0x70)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+/*
+ *  ãªãã¸ã§ã¯ãã®ç¶æ
+ã®å®ç¾©
+ */
+#define TTS_RUN			UINT_C(0x01)	/* å®è¡ç¶æ
+ */
+#define TTS_RDY			UINT_C(0x02)	/* å®è¡å¯è½ç¶æ
+ */
+#define TTS_WAI			UINT_C(0x04)	/* å¾
+ã¡ç¶æ
+ */
+#define TTS_SUS			UINT_C(0x08)	/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+#define TTS_WAS			UINT_C(0x0c)	/* äºéå¾
+ã¡ç¶æ
+ */
+#define TTS_DMT			UINT_C(0x10)	/* ä¼æ­¢ç¶æ
+ */
+
+#define TTW_SLP			UINT_C(0x0001)	/* èµ·åºå¾
+ã¡ */
+#define TTW_DLY			UINT_C(0x0002)	/* æéçµéå¾
+ã¡ */
+#define TTW_SEM			UINT_C(0x0004)	/* ã»ããã©ã®è³æºç²å¾å¾
+ã¡ */
+#define TTW_FLG			UINT_C(0x0008)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TTW_SDTQ		UINT_C(0x0010)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RDTQ		UINT_C(0x0020)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_SPDQ		UINT_C(0x0100)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RPDQ		UINT_C(0x0200)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_MTX			UINT_C(0x0080)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ç¶æ
+ */
+#define TTW_SMBF		UINT_C(0x0400)	/* ã¡ãã»ã¼ã¸ãããã¡ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RMBF		UINT_C(0x0800)	/* ã¡ãã»ã¼ã¸ãããã¡ããã®åä¿¡å¾
+ã¡ */
+#define TTW_MPF			UINT_C(0x2000)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TCYC_STP		UINT_C(0x01)	/* å¨æéç¥ãåä½ãã¦ããªã */
+#define TCYC_STA		UINT_C(0x02)	/* å¨æéç¥ãåä½ãã¦ãã */
+
+#define TALM_STP		UINT_C(0x01)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ããªã */
+#define TALM_STA		UINT_C(0x02)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ãã */
+
+/*
+ *  ãã®ä»ã®å®æ°ã®å®ç¾©
+ */
+#define TSK_SELF		0			/* èªã¿ã¹ã¯æå® */
+#define TSK_NONE		0			/* è©²å½ããã¿ã¹ã¯ããªã */
+
+#define TPRI_SELF		0			/* èªã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+#define TPRI_INI		0			/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ */
+
+#define TIPM_ENAALL		0			/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ */
+
+/*
+ *  æ§æå®æ°ã¨ãã¯ã­
+ */
+
+/*
+ *  åªå
+åº¦ã®ç¯å²
+ */
+#define TMIN_TPRI		1			/* ã¿ã¹ã¯åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_TPRI		16			/* ã¿ã¹ã¯åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_DPRI		1			/* ãã¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_DPRI		16			/* ãã¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_ISRPRI		1			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå°å¤ */
+#define TMAX_ISRPRI		16			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå¤§å¤ */
+
+/*
+ *  ãã¼ã¸ã§ã³æ
+å ±
+ */
+#define TKERNEL_MAKER	UINT_C(0x0118)	/* ã«ã¼ãã«ã®ã¡ã¼ã«ã¼ã³ã¼ã */
+#define TKERNEL_PRID	UINT_C(0x0007)	/* ã«ã¼ãã«ã®è­å¥çªå· */
+#define TKERNEL_SPVER	UINT_C(0xf630)	/* ã«ã¼ãã«ä»æ§ã®ãã¼ã¸ã§ã³çªå· */
+#define TKERNEL_PRVER	UINT_C(0x30b0)	/* ã«ã¼ãã«ã®ãã¼ã¸ã§ã³çªå· */
+
+/*
+ *  ã­ã¥ã¼ã¤ã³ã°åæ°ã®æå¤§å¤
+ */
+#define TMAX_ACTCNT		UINT_C(1)		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+#define TMAX_WUPCNT		UINT_C(1)		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+
+/*
+ *  ããããã¿ã¼ã³ã®ãããæ°
+ */
+#ifndef TBIT_FLGPTN					/* ã¤ãã³ããã©ã°ã®ãããæ° */
+#define TBIT_FLGPTN		(sizeof(FLGPTN) * CHAR_BIT)
+#endif /* TBIT_FLGPTN */
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´ã§ããç¯å²ï¼åä½ï¼Î¼ç§ï¼
+ */
+#define TMIN_ADJTIM		-1000000		/* ã·ã¹ãã æå»ã®æå°èª¿æ´æé */
+#define TMAX_ADJTIM		1000000			/* ã·ã¹ãã æå»ã®æå¤§èª¿æ´æé */
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®ãã¯ã­
+ *
+ *  ä»¥ä¸ã®TOPPERS_COUNT_SZã¨TOPPERS_ROUND_SZã®å®ç¾©ã¯ï¼unitã2ã®å·¾ä¹ã§ã
+ *  ããã¨ãä»®å®ãã¦ããï¼
+ */
+#ifndef TOPPERS_COUNT_SZ
+#define TOPPERS_COUNT_SZ(sz, unit)	(((sz) + (unit) - 1) / (unit))
+#endif /* TOPPERS_COUNT_SZ */
+#ifndef TOPPERS_ROUND_SZ
+#define TOPPERS_ROUND_SZ(sz, unit)	(((sz) + (unit) - 1) & ~((unit) - 1))
+#endif /* TOPPERS_ROUND_SZ */
+
+#define COUNT_STK_T(sz)		TOPPERS_COUNT_SZ(sz, sizeof(STK_T))
+#define ROUND_STK_T(sz)		TOPPERS_ROUND_SZ(sz, sizeof(STK_T))
+
+#define TSZ_MBFMB(msgcnt, msgsz) \
+	((msgcnt) * (sizeof(uint_t) + TOPPERS_ROUND_SZ(msgsz, sizeof(uint_t))))
+
+#define COUNT_MPF_T(blksz)	TOPPERS_COUNT_SZ(blksz, sizeof(MPF_T))
+#define ROUND_MPF_T(blksz)	TOPPERS_ROUND_SZ(blksz, sizeof(MPF_T))
+
+/*
+ *  ãã®ä»ã®æ§æå®æ°
+ */
+#define TMAX_MAXSEM		UINT_MAX	/* ã»ããã©ã®æå¤§è³æºæ°ã®æå¤§å¤ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_KERNEL_H */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/Makefile.kernel
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/Makefile.kernel	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/Makefile.kernel	(revision 302)
@@ -0,0 +1,160 @@
+#
+#  TOPPERS/ASP Kernel
+#      Toyohashi Open Platform for Embedded Real-Time Systems/
+#      Advanced Standard Profile Kernel
+# 
+#  Copyright (C) 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: Makefile.kernel 236 2014-09-28 16:24:33Z ertl-hiro $
+# 
+
+#
+#		ã«ã¼ãã«ã®ãã¡ã¤ã«æ§æã®å®ç¾©
+#
+
+#
+#  1ã¤ã®ã½ã¼ã¹ãã¡ã¤ã«ããè¤æ°ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ãçæããããã«ä½
+#  æãããã½ã¼ã¹ãã¡ã¤ã«ã®ãªã¹ã
+#
+KERNEL_FCSRCS = startup.c task.c taskhook.c wait.c time_event.c \
+				task_manage.c task_refer.c task_sync.c task_term.c \
+				semaphore.c eventflag.c dataqueue.c pridataq.c mutex.c \
+				messagebuf.c mempfix.c time_manage.c cyclic.c alarm.c \
+				sys_manage.c interrupt.c exception.c
+
+#
+#  åã½ã¼ã¹ãã¡ã¤ã«ããçæããããªãã¸ã§ã¯ããã¡ã¤ã«ã®ãªã¹ã
+#
+startup = sta_ker.o ext_ker.o
+
+task = tskini.o tsksched.o tskrun.o tsknrun.o \
+		tskdmt.o tskact.o tskpri.o tskrot.o tskterm.o
+
+taskhook = mtxhook.o mbfhook.o
+
+wait = waimake.o waiwobj.o waicmp.o waitmo.o waitmook.o \
+		wobjwai.o wobjwaitmo.o iniwque.o
+
+time_event = tmeini.o tmeup.o tmedown.o tmecur.o tmeset.o \
+		tmereg.o tmeenq.o tmedeq.o tmechk.o tmeltim.o sigtim.o
+
+task_manage = act_tsk.o can_act.o get_tst.o chg_pri.o get_pri.o get_inf.o
+
+task_refer = ref_tsk.o
+
+task_sync = slp_tsk.o tslp_tsk.o wup_tsk.o can_wup.o \
+		rel_wai.o sus_tsk.o rsm_tsk.o dly_tsk.o
+
+task_term = ext_tsk.o ras_ter.o ena_ter.o dis_ter.o sns_ter.o ter_tsk.o
+
+semaphore = semini.o sig_sem.o \
+		wai_sem.o pol_sem.o twai_sem.o ini_sem.o ref_sem.o
+
+eventflag = flgini.o flgcnd.o set_flg.o clr_flg.o \
+		wai_flg.o pol_flg.o twai_flg.o ini_flg.o ref_flg.o
+
+dataqueue = dtqini.o dtqenq.o dtqfenq.o dtqdeq.o dtqsnd.o dtqfsnd.o dtqrcv.o \
+		snd_dtq.o psnd_dtq.o tsnd_dtq.o fsnd_dtq.o \
+		rcv_dtq.o prcv_dtq.o trcv_dtq.o ini_dtq.o ref_dtq.o
+
+pridataq = pdqini.o pdqenq.o pdqdeq.o pdqsnd.o pdqrcv.o \
+		snd_pdq.o psnd_pdq.o tsnd_pdq.o \
+		rcv_pdq.o prcv_pdq.o trcv_pdq.o ini_pdq.o ref_pdq.o
+
+mutex = mtxini.o mtxchk.o mtxscan.o mtxdrop.o mtxacq.o mtxrel.o mtxrela.o \
+		loc_mtx.o ploc_mtx.o tloc_mtx.o unl_mtx.o ini_mtx.o ref_mtx.o
+
+messagebuf = mbfini.o mbfenq.o mbfdeq.o \
+		mbfsnd.o mbfsig.o mbfrcv.o mbfwobj.o \
+		snd_mbf.o psnd_mbf.o tsnd_mbf.o \
+		rcv_mbf.o prcv_mbf.o trcv_mbf.o ini_mbf.o ref_mbf.o
+
+mempfix = mpfini.o mpfget.o get_mpf.o pget_mpf.o tget_mpf.o \
+		rel_mpf.o ini_mpf.o ref_mpf.o
+
+time_manage = set_tim.o get_tim.o adj_tim.o fch_hrt.o
+
+cyclic = cycini.o sta_cyc.o stp_cyc.o ref_cyc.o cyccal.o
+
+alarm = almini.o sta_alm.o stp_alm.o ref_alm.o almcal.o
+
+sys_manage = rot_rdq.o get_tid.o get_lod.o get_nth.o \
+		loc_cpu.o unl_cpu.o dis_dsp.o ena_dsp.o \
+		sns_ctx.o sns_loc.o sns_dsp.o sns_dpn.o sns_ker.o
+
+interrupt = intini.o dis_int.o ena_int.o chg_ipm.o get_ipm.o
+
+exception = excini.o xsns_dpn.o
+
+#
+#  çæããããªãã¸ã§ã¯ããã¡ã¤ã«ã®ä¾å­é¢ä¿ã®å®ç¾©
+#
+$(startup) $(startup:.o=.s) $(startup:.o=.d): startup.c
+$(task) $(task:.o=.s) $(task:.o=.d): task.c
+$(taskhook) $(taskhook:.o=.s) $(taskhook:.o=.d): taskhook.c
+$(wait) $(wait:.o=.s) $(wait:.o=.d): wait.c
+$(time_event) $(time_event:.o=.s) $(time_event:.o=.d): time_event.c
+$(task_manage) $(task_manage:.o=.s) $(task_manage:.o=.d): task_manage.c
+$(task_refer) $(task_refer:.o=.s) $(task_refer:.o=.d): task_refer.c
+$(task_sync) $(task_sync:.o=.s) $(task_sync:.o=.d): task_sync.c
+$(task_term) $(task_term:.o=.s) $(task_term:.o=.d): task_term.c
+$(semaphore) $(semaphore:.o=.s) $(semaphore:.o=.d): semaphore.c
+$(eventflag) $(eventflag:.o=.s) $(eventflag:.o=.d): eventflag.c
+$(dataqueue) $(dataqueue:.o=.s) $(dataqueue:.o=.d): dataqueue.c
+$(pridataq) $(pridataq:.o=.s) $(pridataq:.o=.d): pridataq.c
+$(mutex) $(mutex:.o=.s) $(mutex:.o=.d): mutex.c
+$(messagebuf) $(messagebuf:.o=.s) $(messagebuf:.o=.d): messagebuf.c
+$(mempfix) $(mempfix:.o=.s) $(mempfix:.o=.d): mempfix.c
+$(time_manage) $(time_manage:.o=.s) $(time_manage:.o=.d): time_manage.c
+$(cyclic) $(cyclic:.o=.s) $(cyclic:.o=.d): cyclic.c
+$(alarm) $(alarm:.o=.s) $(alarm:.o=.d): alarm.c
+$(sys_manage) $(sys_manage:.o=.s) $(sys_manage:.o=.d): sys_manage.c
+$(interrupt) $(interrupt:.o=.s) $(interrupt:.o=.d): interrupt.c
+$(exception) $(exception:.o=.s) $(exception:.o=.d): exception.c
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/allfunc.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/allfunc.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/allfunc.h	(revision 302)
@@ -0,0 +1,275 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: allfunc.h 236 2014-09-28 16:24:33Z ertl-hiro $
+ */
+
+/*
+ *		ãã¹ã¦ã®é¢æ°ãã³ã³ãã¤ã«ããããã®å®ç¾©
+ */
+
+#ifndef TOPPERS_ALLFUNC_H
+#define TOPPERS_ALLFUNC_H
+
+/* startup.c */
+#define TOPPERS_sta_ker
+#define TOPPERS_ext_ker
+
+/* task.c */
+#define TOPPERS_tskini
+#define TOPPERS_tsksched
+#define TOPPERS_tskrun
+#define TOPPERS_tsknrun
+#define TOPPERS_tskdmt
+#define TOPPERS_tskact
+#define TOPPERS_tskpri
+#define TOPPERS_tskrot
+#define TOPPERS_tskterm
+
+/* taskhook.c */
+#define TOPPERS_mtxhook
+#define TOPPERS_mbfhook
+
+/* wait.c */
+#define TOPPERS_waimake
+#define TOPPERS_waiwobj
+#define TOPPERS_waicmp
+#define TOPPERS_waitmo
+#define TOPPERS_waitmook
+#define TOPPERS_wobjwai
+#define TOPPERS_wobjwaitmo
+#define TOPPERS_iniwque
+
+/* time_event.c */
+#define TOPPERS_tmeini
+#define TOPPERS_tmeup
+#define TOPPERS_tmedown
+#define TOPPERS_tmecur
+#define TOPPERS_tmeset
+#define TOPPERS_tmereg
+#define TOPPERS_tmeenq
+#define TOPPERS_tmedeq
+#define TOPPERS_tmechk
+#define TOPPERS_tmeltim
+#define TOPPERS_sigtim
+
+/* task_manage.c */
+#define TOPPERS_act_tsk
+#define TOPPERS_can_act
+#define TOPPERS_get_tst
+#define TOPPERS_chg_pri
+#define TOPPERS_get_pri
+#define TOPPERS_get_inf
+
+/* task_refer.c */
+#define TOPPERS_ref_tsk
+
+/* task_sync.c */
+#define TOPPERS_slp_tsk
+#define TOPPERS_tslp_tsk
+#define TOPPERS_wup_tsk
+#define TOPPERS_can_wup
+#define TOPPERS_rel_wai
+#define TOPPERS_sus_tsk
+#define TOPPERS_rsm_tsk
+#define TOPPERS_dly_tsk
+
+/* task_term.c */
+#define TOPPERS_ext_tsk
+#define TOPPERS_ras_ter
+#define TOPPERS_dis_ter
+#define TOPPERS_ena_ter
+#define TOPPERS_sns_ter
+#define TOPPERS_ter_tsk
+
+/* semaphore.c */
+#define TOPPERS_semini
+#define TOPPERS_sig_sem
+#define TOPPERS_wai_sem
+#define TOPPERS_pol_sem
+#define TOPPERS_twai_sem
+#define TOPPERS_ini_sem
+#define TOPPERS_ref_sem
+
+/* eventflag.c */
+#define TOPPERS_flgini
+#define TOPPERS_flgcnd
+#define TOPPERS_set_flg
+#define TOPPERS_clr_flg
+#define TOPPERS_wai_flg
+#define TOPPERS_pol_flg
+#define TOPPERS_twai_flg
+#define TOPPERS_ini_flg
+#define TOPPERS_ref_flg
+
+/* dataqueue.c */
+#define TOPPERS_dtqini
+#define TOPPERS_dtqenq
+#define TOPPERS_dtqfenq
+#define TOPPERS_dtqdeq
+#define TOPPERS_dtqsnd
+#define TOPPERS_dtqfsnd
+#define TOPPERS_dtqrcv
+#define TOPPERS_snd_dtq
+#define TOPPERS_psnd_dtq
+#define TOPPERS_tsnd_dtq
+#define TOPPERS_fsnd_dtq
+#define TOPPERS_rcv_dtq
+#define TOPPERS_prcv_dtq
+#define TOPPERS_trcv_dtq
+#define TOPPERS_ini_dtq
+#define TOPPERS_ref_dtq
+
+/* pridataq.c */
+#define TOPPERS_pdqini
+#define TOPPERS_pdqenq
+#define TOPPERS_pdqdeq
+#define TOPPERS_pdqsnd
+#define TOPPERS_pdqrcv
+#define TOPPERS_snd_pdq
+#define TOPPERS_psnd_pdq
+#define TOPPERS_tsnd_pdq
+#define TOPPERS_rcv_pdq
+#define TOPPERS_prcv_pdq
+#define TOPPERS_trcv_pdq
+#define TOPPERS_ini_pdq
+#define TOPPERS_ref_pdq
+
+/* mutex.c */
+#define TOPPERS_mtxini
+#define TOPPERS_mtxchk
+#define TOPPERS_mtxscan
+#define TOPPERS_mtxdrop
+#define TOPPERS_mtxacq
+#define TOPPERS_mtxrel
+#define TOPPERS_mtxrela
+#define TOPPERS_loc_mtx
+#define TOPPERS_ploc_mtx
+#define TOPPERS_tloc_mtx
+#define TOPPERS_unl_mtx
+#define TOPPERS_ini_mtx
+#define TOPPERS_ref_mtx
+
+/* messagebuf.c */
+#define TOPPERS_mbfini
+#define TOPPERS_mbfenq
+#define TOPPERS_mbfdeq
+#define TOPPERS_mbfsnd
+#define TOPPERS_mbfsig
+#define TOPPERS_mbfrcv
+#define TOPPERS_mbfwobj
+#define TOPPERS_snd_mbf
+#define TOPPERS_psnd_mbf
+#define TOPPERS_tsnd_mbf
+#define TOPPERS_rcv_mbf
+#define TOPPERS_prcv_mbf
+#define TOPPERS_trcv_mbf
+#define TOPPERS_ini_mbf
+#define TOPPERS_ref_mbf
+
+/* mempfix.c */
+#define TOPPERS_mpfini
+#define TOPPERS_mpfget
+#define TOPPERS_get_mpf
+#define TOPPERS_pget_mpf
+#define TOPPERS_tget_mpf
+#define TOPPERS_rel_mpf
+#define TOPPERS_ini_mpf
+#define TOPPERS_ref_mpf
+
+/* time_manage.c */
+#define TOPPERS_set_tim
+#define TOPPERS_get_tim
+#define TOPPERS_adj_tim
+#define TOPPERS_fch_hrt
+
+/* cyclic.c */
+#define TOPPERS_cycini
+#define TOPPERS_sta_cyc
+#define TOPPERS_stp_cyc
+#define TOPPERS_ref_cyc
+#define TOPPERS_cyccal
+
+/* alarm.c */
+#define TOPPERS_almini
+#define TOPPERS_sta_alm
+#define TOPPERS_stp_alm
+#define TOPPERS_ref_alm
+#define TOPPERS_almcal
+
+/* sys_manage.c */
+#define TOPPERS_rot_rdq
+#define TOPPERS_get_tid
+#define TOPPERS_get_lod
+#define TOPPERS_get_nth
+#define TOPPERS_loc_cpu
+#define TOPPERS_unl_cpu
+#define TOPPERS_dis_dsp
+#define TOPPERS_ena_dsp
+#define TOPPERS_sns_ctx
+#define TOPPERS_sns_loc
+#define TOPPERS_sns_dsp
+#define TOPPERS_sns_dpn
+#define TOPPERS_sns_ker
+
+/* interrupt.c */
+#define TOPPERS_intini
+#define TOPPERS_dis_int
+#define TOPPERS_ena_int
+#define TOPPERS_chg_ipm
+#define TOPPERS_get_ipm
+
+/* exception.c */
+#define TOPPERS_excini
+#define TOPPERS_xsns_dpn
+
+#endif /* TOPPERS_ALLFUNC_H */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/check.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/check.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/check.h	(revision 302)
@@ -0,0 +1,197 @@
+/*
+ *  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: check.h 356 2015-07-25 10:44:32Z ertl-hiro $
+ */
+
+/*
+ *		ã¨ã©ã¼ãã§ãã¯ç¨ãã¯ã­
+ */
+
+#ifndef TOPPERS_CHECK_H
+#define TOPPERS_CHECK_H
+
+#include "kernel_impl.h"
+
+/*
+ *  ãªãã¸ã§ã¯ãIDã®ç¯å²ã®å¤å®
+ */
+#define VALID_TSKID(tskid)	(TMIN_TSKID <= (tskid) && (tskid) <= tmax_tskid)
+#define VALID_SEMID(semid)	(TMIN_SEMID <= (semid) && (semid) <= tmax_semid)
+#define VALID_FLGID(flgid)	(TMIN_FLGID <= (flgid) && (flgid) <= tmax_flgid)
+#define VALID_DTQID(dtqid)	(TMIN_DTQID <= (dtqid) && (dtqid) <= tmax_dtqid)
+#define VALID_PDQID(pdqid)	(TMIN_PDQID <= (pdqid) && (pdqid) <= tmax_pdqid)
+#define VALID_MTXID(mtxid)	(TMIN_MTXID <= (mtxid) && (mtxid) <= tmax_mtxid)
+#define VALID_MBFID(mbfid)	(TMIN_MBFID <= (mbfid) && (mbfid) <= tmax_mbfid)
+#define VALID_MPFID(mpfid)	(TMIN_MPFID <= (mpfid) && (mpfid) <= tmax_mpfid)
+#define VALID_CYCID(cycid)	(TMIN_CYCID <= (cycid) && (cycid) <= tmax_cycid)
+#define VALID_ALMID(almid)	(TMIN_ALMID <= (almid) && (almid) <= tmax_almid)
+
+/*
+ *  ãªãã¸ã§ã¯ãçªå·ã®ç¯å²ã®å¤å®
+ */
+#ifndef VALID_INTNO_DISINT
+#define VALID_INTNO_DISINT(intno)    VALID_INTNO(intno)
+#endif /* VALID_INTNO_DISINT */
+
+#ifndef VALID_INTNO_CREISR
+#define VALID_INTNO_CREISR(intno)    VALID_INTNO(intno)
+#endif /* VALID_INTNO_CREISR */
+
+/*
+ *  åªå
+åº¦ã®ç¯å²ã®å¤å®
+ */
+#define VALID_TPRI(tpri)	(TMIN_TPRI <= (tpri) && (tpri) <= TMAX_TPRI)
+
+#ifndef VALID_INTPRI_CHGIPM
+#define VALID_INTPRI_CHGIPM(intpri) \
+				(TMIN_INTPRI <= (intpri) && (intpri) <= TIPM_ENAALL)
+#endif /* VALID_INTPRI_CHGIPM */
+
+/*
+ *  ç¸å¯¾æéã®ç¯å²ã®å¤å®
+ */
+#define VALID_RELTIM(reltim)	((reltim) <= TMAX_RELTIM)
+
+/*
+ *  ã¿ã¤ã ã¢ã¦ãæå®å¤ã®ç¯å²ã®å¤å®
+ */
+#define VALID_TMOUT(tmout)	((tmout) <= TMAX_RELTIM || (tmout) == TMO_FEVR \
+													|| (tmout) == TMO_POL)
+
+/*
+ *  å¼åºãã³ã³ãã­ã¹ãã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_TSKCTX() do {									\
+	if (sense_context()) {									\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_UNL() do {									\
+	if (sense_lock()) {										\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  å¼åºãã³ã³ãã­ã¹ãã¨CPUã­ãã¯ç¶æ
+ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_TSKCTX_UNL() do {								\
+	if (sense_context() || sense_lock()) {					\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã£ã¹ãããä¿çç¶æ
+ã§ãªããã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_DISPATCH() do {								\
+	if (sense_context() || sense_lock() || !dspflg) {		\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã®ä»ã®ã³ã³ãã­ã¹ãã¨ã©ã¼ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_CTX(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãªãã¸ã§ã¯ãIDã®ãã§ãã¯ï¼E_IDï¼
+ */
+#define CHECK_ID(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_ID;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã©ã¡ã¼ã¿ã¨ã©ã¼ã®ãã§ãã¯ï¼E_PARï¼
+ */
+#define CHECK_PAR(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_PAR;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ä¸æ­£ä½¿ç¨ã¨ã©ã¼ã®ãã§ãã¯ï¼E_ILUSEï¼
+ */
+#define CHECK_ILUSE(exp) do {								\
+	if (!(exp)) {											\
+		ercd = E_ILUSE;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+#endif /* TOPPERS_CHECK_H */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel.tf	(revision 302)
@@ -0,0 +1,430 @@
+$
+$   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ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  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/messagebuf.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/extension/messagebuf/kernel/kernel_api.csv
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_api.csv	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_api.csv	(revision 302)
@@ -0,0 +1,17 @@
+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? },,
+mbf,CRE_MBF,#mbfid { .mbfatr .maxmsz .mbfsz &mbfmb },,
+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/extension/messagebuf/kernel/kernel_def.csv
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_def.csv	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_def.csv	(revision 302)
@@ -0,0 +1,139 @@
+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_MBFID,TMIN_MBFID,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_MBFINIB,sizeof(MBFINIB)
+offsetof_MBFINIB_mbfatr,"offsetof(MBFINIB,mbfatr)"
+offsetof_MBFINIB_maxmsz,"offsetof(MBFINIB,maxmsz)"
+offsetof_MBFINIB_mbfsz,"offsetof(MBFINIB,mbfsz)"
+offsetof_MBFINIB_mbfmb,"offsetof(MBFINIB,mbfmb)"
+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/extension/messagebuf/kernel/kernel_impl.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_impl.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_impl.h	(revision 302)
@@ -0,0 +1,212 @@
+/*
+ *  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) 2004-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_impl.h 332 2015-06-21 13:20:37Z ertl-hiro $
+ */
+
+/*
+ *		TOPPERS/ASPã«ã¼ãã«å
+é¨åãæ¨æºããããã¡ã¤ã«
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼ã«ã¼ãã«ãæ§æãããã­ã°ã©ã ã®ã½ã¼ã¹ãã¡ã¤ã«
+ *  ã§å¿
+ãã¤ã³ã¯ã«ã¼ãããã¹ãæ¨æºããããã¡ã¤ã«ã§ããï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ããï¼ããã«ããï¼ãã¯ã­å®ç¾©ä»¥å¤ã
+ *  é¤ãããã«ãªã£ã¦ããï¼
+ */
+
+#ifndef TOPPERS_KERNEL_IMPL_H
+#define TOPPERS_KERNEL_IMPL_H
+
+/*
+ *  ã«ã¼ãã«ã®å
+é¨è­å¥åã®ãªãã¼ã 
+ */
+#include "kernel_rename.h"
+
+/*
+ *  ã¢ããªã±ã¼ã·ã§ã³ã¨å
+±éã®ããããã¡ã¤ã«
+ */
+#include <kernel.h>
+
+/*
+ *  ã·ã¹ãã ã­ã°æ©è½ã®ããã®å®ç¾©
+ */
+#include <t_syslog.h>
+
+/*
+ *  åã­ã£ã¹ããè¡ããã¯ã­ã®å®ç¾©
+ */
+#ifndef CAST
+#define CAST(type, val)		((type)(val))
+#endif /* CAST */
+
+/*
+ *  ã¿ã¼ã²ããä¾å­æ
+å ±ã®å®ç¾©
+ */
+#include "target_kernel_impl.h"
+
+/*
+ *  ãã¹ã¦ã®é¢æ°ãã³ã³ãã¤ã«ããããã®å®ç¾©
+ */
+#ifdef ALLFUNC
+#include "allfunc.h"
+#endif /* ALLFUNC */
+
+/*
+ *  ããããã£ã¼ã«ãã§ã®ç¬¦å·ç¡ãæ´æ°å
+ *
+ *  8ãããä»¥ä¸ã®å¹
+ã®ããããã£ã¼ã«ãã§ï¼ç¬¦å·ç¡ãæ´æ°å¤ãä¿æãããå ´å
+ *  ã«ç¨ããã¹ããã¼ã¿åï¼ANSI Cã§ã¯ï¼ããããã£ã¼ã«ãã®ãã¼ã¿åã«ã¯
+ *  intã¨unsigned intããè¨±ãããªãããï¼ããã©ã«ãã®å®ç¾©ã¯unsigned
+ *  intã¨ãã¦ãããï¼ã¿ã¼ã²ããããã³ãã¼ã«ä¾å­ã§ï¼unsigned charã¾ãã¯
+ *  unsigned shortã«å®ç¾©ããæ¹ãå¹çãè¯ãå ´åãããï¼
+ */
+#ifndef BIT_FIELD_UINT
+#define BIT_FIELD_UINT		unsigned int
+#endif /* BIT_FIELD_UINT */
+
+/*
+ *  ããããã£ã¼ã«ãã§ã®ãã¼ã«å
+ *
+ *  1ãããå¹
+ã®ããããã£ã¼ã«ãã§ï¼ãã¼ã«å¤ãä¿æãããå ´åã«ç¨ããã¹ã
+ *  ãã¼ã¿åï¼ããã©ã«ãã§ã¯BIT_FIELD_UINTã¨åä¸ã«å®ç¾©ãã¦ãããï¼ãã¼
+ *  ã«å¤ãä¿æãããã¨ãæç¤ºããããã«å¥ã®åç§°ã¨ãã¦ããï¼
+ */
+#ifndef BIT_FIELD_BOOL
+#define BIT_FIELD_BOOL		BIT_FIELD_UINT
+#endif /* BIT_FIELD_BOOL */
+
+/*
+ *  ãªãã¸ã§ã¯ãIDã®æå°å¤ã®å®ç¾©
+ */
+#define TMIN_TSKID		1		/* ã¿ã¹ã¯IDã®æå°å¤ */
+#define TMIN_SEMID		1		/* ã»ããã©IDã®æå°å¤ */
+#define TMIN_FLGID		1		/* ãã©ã°IDã®æå°å¤ */
+#define TMIN_DTQID		1		/* ãã¼ã¿ã­ã¥ã¼IDã®æå°å¤ */
+#define TMIN_PDQID		1		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼IDã®æå°å¤ */
+#define TMIN_MTXID		1		/* ãã¥ã¼ããã¯ã¹IDã®æå°å¤ */
+#define TMIN_MBFID		1		/* ã¡ãã»ã¼ã¸ãããã¡IDã®æå°å¤ */
+#define TMIN_MPFID		1		/* åºå®é·ã¡ã¢ãªãã¼ã«IDã®æå°å¤ */
+#define TMIN_CYCID		1		/* å¨æéç¥IDã®æå°å¤ */
+#define TMIN_ALMID		1		/* ã¢ã©ã¼ã éç¥IDã®æå°å¤ */
+
+/*
+ *  åªå
+åº¦ã®æ®µéæ°ã®å®ç¾©
+ */
+#define TNUM_TPRI		(TMAX_TPRI - TMIN_TPRI + 1)
+#define TNUM_DPRI		(TMAX_DPRI - TMIN_DPRI + 1)
+#define TNUM_INTPRI		(TMAX_INTPRI - TMIN_INTPRI + 1)
+
+/*
+ *  ããããã¡ã¤ã«ãæããªãã¢ã¸ã¥ã¼ã«ã®é¢æ°ã»å¤æ°ã®å®£è¨
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  åã¢ã¸ã¥ã¼ã«ã®åæåï¼kernel_cfg.cï¼
+ */
+extern void	initialize_object(void);
+
+/*
+ *  åæåã«ã¼ãã³ã®å®è¡ï¼kernel_cfg.cï¼
+ */
+extern void	call_inirtn(void);
+
+/*
+ *  çµäºå¦çã«ã¼ãã³ã®å®è¡ï¼kernel_cfg.cï¼
+ */
+extern void	call_terrtn(void);
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åï¼kernel_cfg.cï¼
+ */
+extern const size_t	istksz;		/* ã¹ã¿ãã¯é åã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
+extern STK_T *const	istk;		/* ã¹ã¿ãã¯é åã®å
+é ­çªå° */
+#ifdef TOPPERS_ISTKPT
+extern STK_T *const	istkpt;		/* ã¹ã¿ãã¯ãã¤ã³ã¿ã®åæå¤ */
+#endif /* TOPPERS_ISTKPT */
+
+/*
+ *  ã«ã¼ãã«åä½ç¶æ
+ãã©ã°ï¼startup.cï¼
+ */
+extern bool_t	kerflg;
+
+/*
+ *  ã«ã¼ãã«ã®èµ·åï¼startup.cï¼
+ */
+extern void	sta_ker(void);
+
+/*
+ *  ã«ã¼ãã«ã®çµäºå¦çï¼startup.cï¼
+ */
+extern void	exit_kernel(void);
+
+/*
+ *  éç¥ãã³ãã©ã®åå®ç¾©
+ */
+typedef void	(*NFYHDR)(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_KERNEL_IMPL_H */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_int.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_int.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_int.h	(revision 302)
@@ -0,0 +1,102 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 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: kernel_int.h 26 2014-01-11 17:24:56Z ertl-hiro $
+ */
+
+/*
+ *		kernel_cfg.cï¼ããã³cfg1_out.cï¼ç¨ããããã¡ã¤ã«
+ */
+
+#ifndef TOPPERS_KERNEL_INT_H
+#define TOPPERS_KERNEL_INT_H
+
+/*
+ *  ã«ã¼ãã«æ¨æºããããã¡ã¤ã«
+ */
+#include "kernel_impl.h"
+
+/*
+ *  ã«ã¼ãã«ã®åããããã¡ã¤ã«
+ */
+#include "task.h"
+#include "semaphore.h"
+#include "eventflag.h"
+#include "dataqueue.h"
+#include "pridataq.h"
+#include "mutex.h"
+#include "messagebuf.h"
+#include "mempfix.h"
+#include "cyclic.h"
+#include "alarm.h"
+#include "interrupt.h"
+#include "exception.h"
+#include "time_event.h"
+
+/*
+ *  ãªãã¼ã ããã·ã³ãã«ãå
+ã«æ»ãããã®ããããã¡ã¤ã«
+ */
+#include "kernel_unrename.h"
+
+/*
+ *  å
+å®¹ãç©ºã®é
+åãçæããããã®ãã¯ã­
+ */
+#ifndef TOPPERS_EMPTY_LABEL
+#define TOPPERS_EMPTY_LABEL(type, var)		type var[0]
+#endif
+
+#endif /* TOPPERS_KERNEL_INT_H */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_rename.def
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_rename.def	(revision 302)
@@ -0,0 +1,163 @@
+# startup.c
+kerflg
+exit_kernel
+
+# task.c
+p_runtsk
+p_schedtsk
+enadsp
+dspflg
+ready_queue
+ready_primap
+initialize_task
+search_schedtsk
+make_runnable
+make_non_runnable
+make_dormant
+make_active
+change_priority
+rotate_ready_queue
+task_terminate
+
+# taskhook.c
+mtxhook_check_ceilpri
+mtxhook_scan_ceilmtx
+mtxhook_release_all
+mbfhook_dequeue_wobj
+
+# wait.c
+make_wait_tmout
+wait_dequeue_wobj
+wait_complete
+wait_tmout
+wait_tmout_ok
+wobj_make_wait
+wobj_make_wait_tmout
+init_wait_queue
+
+# time_event.c
+boundary_evttim
+current_evttim
+current_hrtcnt
+monotonic_evttim
+systim_offset
+in_signal_time
+initialize_tmevt
+tmevt_up
+tmevt_down
+update_current_evttim
+set_hrt_event
+tmevtb_register
+tmevtb_enqueue
+tmevtb_dequeue
+check_adjtim
+tmevt_lefttim
+signal_time
+
+# semaphore.c
+initialize_semaphore
+
+# eventflag.c
+initialize_eventflag
+check_flg_cond
+
+# dataqueue.c
+initialize_dataqueue
+enqueue_data
+force_enqueue_data
+dequeue_data
+send_data
+force_send_data
+receive_data
+
+# pridataq.c
+initialize_pridataq
+enqueue_pridata
+dequeue_pridata
+send_pridata
+receive_pridata
+
+# mutex.c
+initialize_mutex
+mutex_check_ceilpri
+mutex_scan_ceilmtx
+mutex_drop_priority
+mutex_acquire
+mutex_release
+mutex_release_all
+
+# messagebuf.c
+mbfhook_dequeue_wobj
+initialize_messagebuf
+enqueue_message
+dequeue_message
+send_message
+messagebuf_signal
+receive_message
+messagebuf_dequeue_wobj
+
+# mempfix.c
+initialize_mempfix
+get_mpf_block
+
+# cyclic.c
+initialize_cyclic
+call_cyclic
+
+# alarm.c
+initialize_alarm
+call_alarm
+
+# interrupt.c
+initialize_interrupt
+
+# exception.c
+initialize_exception
+
+# kernel_cfg.c
+initialize_object
+call_inirtn
+call_terrtn
+tmax_tskid
+tinib_table
+torder_table
+tcb_table
+tmax_semid
+seminib_table
+semcb_table
+tmax_flgid
+flginib_table
+flgcb_table
+tmax_dtqid
+dtqinib_table
+dtqcb_table
+tmax_pdqid
+pdqinib_table
+pdqcb_table
+tmax_mtxid
+mtxinib_table
+mtxcb_table
+tmax_mbfid
+mbfinib_table
+mbfcb_table
+tmax_mpfid
+mpfinib_table
+mpfcb_table
+tmax_cycid
+cycinib_table
+cyccb_table
+tmax_almid
+alminib_table
+almcb_table
+tnum_def_inhno
+inhinib_table
+tnum_cfg_intno
+intinib_table
+tnum_def_excno
+excinib_table
+tmevt_heap
+istksz
+istk
+istkpt
+
+INCLUDE "target"
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_rename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_rename.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_rename.h	(revision 302)
@@ -0,0 +1,406 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+#ifndef TOPPERS_KERNEL_RENAME_H
+#define TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  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
+#define mbfhook_dequeue_wobj		_kernel_mbfhook_dequeue_wobj
+
+/*
+ *  wait.c
+ */
+#define make_wait_tmout				_kernel_make_wait_tmout
+#define wait_dequeue_wobj			_kernel_wait_dequeue_wobj
+#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
+
+/*
+ *  messagebuf.c
+ */
+#define mbfhook_dequeue_wobj		_kernel_mbfhook_dequeue_wobj
+#define initialize_messagebuf		_kernel_initialize_messagebuf
+#define enqueue_message				_kernel_enqueue_message
+#define dequeue_message				_kernel_dequeue_message
+#define send_message				_kernel_send_message
+#define messagebuf_signal			_kernel_messagebuf_signal
+#define receive_message				_kernel_receive_message
+#define messagebuf_dequeue_wobj		_kernel_messagebuf_dequeue_wobj
+
+/*
+ *  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_mbfid					_kernel_tmax_mbfid
+#define mbfinib_table				_kernel_mbfinib_table
+#define mbfcb_table					_kernel_mbfcb_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
+
+
+#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
+#define _mbfhook_dequeue_wobj		__kernel_mbfhook_dequeue_wobj
+
+/*
+ *  wait.c
+ */
+#define _make_wait_tmout			__kernel_make_wait_tmout
+#define _wait_dequeue_wobj			__kernel_wait_dequeue_wobj
+#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
+
+/*
+ *  messagebuf.c
+ */
+#define _mbfhook_dequeue_wobj		__kernel_mbfhook_dequeue_wobj
+#define _initialize_messagebuf		__kernel_initialize_messagebuf
+#define _enqueue_message			__kernel_enqueue_message
+#define _dequeue_message			__kernel_dequeue_message
+#define _send_message				__kernel_send_message
+#define _messagebuf_signal			__kernel_messagebuf_signal
+#define _receive_message			__kernel_receive_message
+#define _messagebuf_dequeue_wobj	__kernel_messagebuf_dequeue_wobj
+
+/*
+ *  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_mbfid					__kernel_tmax_mbfid
+#define _mbfinib_table				__kernel_mbfinib_table
+#define _mbfcb_table				__kernel_mbfcb_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"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_unrename.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_unrename.h	(revision 302)
@@ -0,0 +1,407 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+/* This file is included only when kernel_rename.h has been included. */
+#ifdef TOPPERS_KERNEL_RENAME_H
+#undef TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  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
+#undef mbfhook_dequeue_wobj
+
+/*
+ *  wait.c
+ */
+#undef make_wait_tmout
+#undef wait_dequeue_wobj
+#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
+
+/*
+ *  messagebuf.c
+ */
+#undef mbfhook_dequeue_wobj
+#undef initialize_messagebuf
+#undef enqueue_message
+#undef dequeue_message
+#undef send_message
+#undef messagebuf_signal
+#undef receive_message
+#undef messagebuf_dequeue_wobj
+
+/*
+ *  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_mbfid
+#undef mbfinib_table
+#undef mbfcb_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
+
+
+#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
+#undef _mbfhook_dequeue_wobj
+
+/*
+ *  wait.c
+ */
+#undef _make_wait_tmout
+#undef _wait_dequeue_wobj
+#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
+
+/*
+ *  messagebuf.c
+ */
+#undef _mbfhook_dequeue_wobj
+#undef _initialize_messagebuf
+#undef _enqueue_message
+#undef _dequeue_message
+#undef _send_message
+#undef _messagebuf_signal
+#undef _receive_message
+#undef _messagebuf_dequeue_wobj
+
+/*
+ *  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_mbfid
+#undef _mbfinib_table
+#undef _mbfcb_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"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/messagebuf.c
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/messagebuf.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/messagebuf.c	(revision 302)
@@ -0,0 +1,702 @@
+/*
+ *  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: messagebuf.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		ã¡ãã»ã¼ã¸ãããã¡æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "taskhook.h"
+#include "wait.h"
+#include "messagebuf.h"
+#include <string.h>
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_SND_MBF_ENTER
+#define LOG_SND_MBF_ENTER(mbfid, msg, msgsz)
+#endif /* LOG_SND_MBF_ENTER */
+
+#ifndef LOG_SND_MBF_LEAVE
+#define LOG_SND_MBF_LEAVE(ercd)
+#endif /* LOG_SND_MBF_LEAVE */
+
+#ifndef LOG_PSND_MBF_ENTER
+#define LOG_PSND_MBF_ENTER(mbfid, msg, msgsz)
+#endif /* LOG_PSND_MBF_ENTER */
+
+#ifndef LOG_PSND_MBF_LEAVE
+#define LOG_PSND_MBF_LEAVE(ercd)
+#endif /* LOG_PSND_MBF_LEAVE */
+
+#ifndef LOG_TSND_MBF_ENTER
+#define LOG_TSND_MBF_ENTER(mbfid, msg, msgsz, tmout)
+#endif /* LOG_TSND_MBF_ENTER */
+
+#ifndef LOG_TSND_MBF_LEAVE
+#define LOG_TSND_MBF_LEAVE(ercd)
+#endif /* LOG_TSND_MBF_LEAVE */
+
+#ifndef LOG_RCV_MBF_ENTER
+#define LOG_RCV_MBF_ENTER(mbfid, msg)
+#endif /* LOG_RCV_MBF_ENTER */
+
+#ifndef LOG_RCV_MBF_LEAVE
+#define LOG_RCV_MBF_LEAVE(msgsz, msg)
+#endif /* LOG_RCV_MBF_LEAVE */
+
+#ifndef LOG_PRCV_MBF_ENTER
+#define LOG_PRCV_MBF_ENTER(mbfid, msg)
+#endif /* LOG_PRCV_MBF_ENTER */
+
+#ifndef LOG_PRCV_MBF_LEAVE
+#define LOG_PRCV_MBF_LEAVE(msgsz, msg)
+#endif /* LOG_PRCV_MBF_LEAVE */
+
+#ifndef LOG_TRCV_MBF_ENTER
+#define LOG_TRCV_MBF_ENTER(mbfid, msg, tmout)
+#endif /* LOG_TRCV_MBF_ENTER */
+
+#ifndef LOG_TRCV_MBF_LEAVE
+#define LOG_TRCV_MBF_LEAVE(msgsz, msg)
+#endif /* LOG_TRCV_MBF_LEAVE */
+
+#ifndef LOG_INI_MBF_ENTER
+#define LOG_INI_MBF_ENTER(mbfid)
+#endif /* LOG_INI_MBF_ENTER */
+
+#ifndef LOG_INI_MBF_LEAVE
+#define LOG_INI_MBF_LEAVE(ercd)
+#endif /* LOG_INI_MBF_LEAVE */
+
+#ifndef LOG_REF_MBF_ENTER
+#define LOG_REF_MBF_ENTER(mbfid, pk_rmbf)
+#endif /* LOG_REF_MBF_ENTER */
+
+#ifndef LOG_REF_MBF_LEAVE
+#define LOG_REF_MBF_LEAVE(ercd, pk_rmbf)
+#endif /* LOG_REF_MBF_LEAVE */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ã®æ°
+ */
+#define tnum_mbf	((uint_t)(tmax_mbfid - TMIN_MBFID + 1))
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡IDããã¡ãã»ã¼ã¸ãããã¡ç®¡çãã­ãã¯ãåãåºãã
+ *  ãã®ãã¯ã­
+ */
+#define INDEX_MBF(mbfid)	((uint_t)((mbfid) - TMIN_MBFID))
+#define get_mbfcb(mbfid)	(&(mbfcb_table[INDEX_MBF(mbfid)]))
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡æ©è½ã®åæå
+ */
+#ifdef TOPPERS_mbfini
+
+void
+initialize_messagebuf(void)
+{
+	uint_t	i;
+	MBFCB	*p_mbfcb;
+
+	mbfhook_dequeue_wobj = messagebuf_dequeue_wobj;
+
+	for (i = 0; i < tnum_mbf; i++) {
+		p_mbfcb = &(mbfcb_table[i]);
+		queue_initialize(&(p_mbfcb->swait_queue));
+		p_mbfcb->p_mbfinib = &(mbfinib_table[i]);
+		queue_initialize(&(p_mbfcb->rwait_queue));
+		p_mbfcb->fmbfsz = p_mbfcb->p_mbfinib->mbfsz;
+		p_mbfcb->head = 0U;
+		p_mbfcb->tail = 0U;
+		p_mbfcb->smbfcnt = 0U;
+	}
+}
+
+#endif /* TOPPERS_mbfini */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åã¸ã®ã¡ãã»ã¼ã¸ã®æ ¼ç´
+ */
+#ifdef TOPPERS_mbfenq
+
+bool_t
+enqueue_message(MBFCB *p_mbfcb, const void *msg, uint_t msgsz)
+{
+	const MBFINIB	*p_mbfinib = p_mbfcb->p_mbfinib;
+	char	*mbuffer = (char *)(p_mbfinib->mbfmb);
+	uint_t	allocsz;
+	size_t	remsz;
+
+	allocsz = sizeof(uint_t) + TOPPERS_ROUND_SZ(msgsz, sizeof(uint_t));
+	if (allocsz <= p_mbfcb->fmbfsz) {
+		*((uint_t *) &(mbuffer[p_mbfcb->tail])) = msgsz;
+		p_mbfcb->tail += sizeof(uint_t);
+		if (p_mbfcb->tail >= p_mbfinib->mbfsz) {
+			p_mbfcb->tail = 0U;
+		}
+
+		remsz = p_mbfinib->mbfsz - p_mbfcb->tail;
+		if (remsz < msgsz) {
+			memcpy(&(mbuffer[p_mbfcb->tail]), msg, remsz);
+			msg = ((char *) msg) + remsz;
+			msgsz -= remsz;
+			p_mbfcb->tail = 0U;
+		}
+		memcpy(&(mbuffer[p_mbfcb->tail]), msg, msgsz);
+		p_mbfcb->tail += TOPPERS_ROUND_SZ(msgsz, sizeof(uint_t));
+		if (p_mbfcb->tail >= p_mbfinib->mbfsz) {
+			p_mbfcb->tail = 0U;
+		}
+
+		p_mbfcb->fmbfsz -= allocsz;
+		p_mbfcb->smbfcnt++;
+		return(true);
+	}
+	return(false);
+}
+
+#endif /* TOPPERS_mbfenq */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åããã®ã¡ãã»ã¼ã¸ã®ååºã
+ */
+#ifdef TOPPERS_mbfdeq
+
+uint_t
+dequeue_message(MBFCB *p_mbfcb, void *msg)
+{
+	const MBFINIB	*p_mbfinib = p_mbfcb->p_mbfinib;
+	char	*mbuffer = (char *)(p_mbfinib->mbfmb);
+	uint_t	msgsz, copysz;
+	size_t	remsz;
+
+	assert(p_mbfcb->smbfcnt > 0);
+	msgsz = *((uint_t *) &(mbuffer[p_mbfcb->head]));
+	p_mbfcb->head += sizeof(uint_t);
+	if (p_mbfcb->head >= p_mbfcb->p_mbfinib->mbfsz) {
+		p_mbfcb->head = 0U;
+	}
+
+	remsz = p_mbfcb->p_mbfinib->mbfsz - p_mbfcb->head;
+	copysz = msgsz;
+	if (remsz < copysz) {
+		memcpy(msg, &(mbuffer[p_mbfcb->head]), remsz);
+		msg = ((char *) msg) + remsz;
+		copysz -= remsz;
+		p_mbfcb->head = 0U;
+	}
+	memcpy(msg, &(mbuffer[p_mbfcb->head]), copysz);
+	p_mbfcb->head += TOPPERS_ROUND_SZ(copysz, sizeof(uint_t));
+	if (p_mbfcb->head >= p_mbfcb->p_mbfinib->mbfsz) {
+		p_mbfcb->head = 0U;
+	}
+
+	p_mbfcb->fmbfsz += sizeof(uint_t) + TOPPERS_ROUND_SZ(msgsz, sizeof(uint_t));
+	p_mbfcb->smbfcnt--;
+	return(msgsz);
+}
+
+#endif /* TOPPERS_mbfdeq */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ã¸ã®ã¡ãã»ã¼ã¸éä¿¡
+ */
+#ifdef TOPPERS_mbfsnd
+
+bool_t
+send_message(MBFCB *p_mbfcb, const void *msg, uint_t msgsz)
+{
+	TCB		*p_tcb;
+
+	if (!queue_empty(&(p_mbfcb->rwait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_mbfcb->rwait_queue));
+		memcpy(((WINFO_RMBF *)(p_tcb->p_winfo))->msg, msg, msgsz);
+		wait_complete(p_tcb);
+		p_tcb->p_winfo->wercd = (ER_UINT)(msgsz);
+		return(true);
+	}
+	else if (queue_empty(&(p_mbfcb->swait_queue))
+							&& enqueue_message(p_mbfcb, msg, msgsz)) {
+		return(true);
+	}
+	else {
+		return(false);
+	}
+}
+
+#endif /* TOPPERS_mbfsnd */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡éä¿¡å¾
+ã¡ã¿ã¹ã¯ã®ãã§ãã¯
+ *
+ *  ã¡ãã»ã¼ã¸ãããã¡éä¿¡å¾
+ã¡ã­ã¥ã¼ã®å
+é ­ã®ã¿ã¹ã¯ã®éä¿¡ã¡ãã»ã¼ã¸ãï¼
+ *  ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åã«æ ¼ç´ãããã¨ã§ããã°æ ¼ç´ãï¼å¾
+ã¡è§£é¤ã
+ *  ãï¼ãã®å¦çãï¼å
+é ­ã®ã¿ã¹ã¯ã®éä¿¡ã¡ãã»ã¼ã¸ãæ ¼ç´ã§ããªããªãã¾ã§
+ *  ç¹°ãè¿ãï¼
+ */
+#ifdef TOPPERS_mbfsig
+
+void
+messagebuf_signal(MBFCB *p_mbfcb)
+{
+	TCB		*p_tcb;
+
+	while (!queue_empty(&(p_mbfcb->swait_queue))) {
+		p_tcb = (TCB *)(p_mbfcb->swait_queue.p_next);
+		if (enqueue_message(p_mbfcb, ((WINFO_SMBF *)(p_tcb->p_winfo))->msg,
+									((WINFO_SMBF *)(p_tcb->p_winfo))->msgsz)) {
+			queue_delete(&(p_tcb->task_queue));
+			wait_complete(p_tcb);
+		}
+		else {
+			break;
+		}
+	}
+}
+
+#endif /* TOPPERS_mbfsig */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ããã®ã¡ãã»ã¼ã¸åä¿¡
+ */
+#ifdef TOPPERS_mbfrcv
+
+uint_t
+receive_message(MBFCB *p_mbfcb, void *msg)
+{
+	TCB		*p_tcb;
+	uint_t	msgsz;
+
+	if (p_mbfcb->smbfcnt > 0) {
+		msgsz = dequeue_message(p_mbfcb, msg);
+		messagebuf_signal(p_mbfcb);
+		return(msgsz);
+	}
+	else if (!queue_empty(&(p_mbfcb->swait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_mbfcb->swait_queue));
+		msgsz = ((WINFO_SMBF *)(p_tcb->p_winfo))->msgsz;
+		memcpy(msg, ((WINFO_SMBF *)(p_tcb->p_winfo))->msg, msgsz);
+		wait_complete(p_tcb);
+		return(msgsz);
+	}
+	else {
+		return(0U);
+	}
+}
+
+#endif /* TOPPERS_mbfrcv */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡éä¿¡å¾
+ã¡ã¿ã¹ã¯ã®å¾
+ã¡è§£é¤æå¦ç
+ */
+#ifdef TOPPERS_mbfwobj
+
+void
+messagebuf_dequeue_wobj(TCB *p_tcb)
+{
+	messagebuf_signal(((WINFO_SMBF *)(p_tcb->p_winfo))->p_mbfcb);
+}
+
+#endif /* TOPPERS_mbfwobj */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ã¸ã®éä¿¡
+ */
+#ifdef TOPPERS_snd_mbf
+
+ER
+snd_mbf(ID mbfid, const void *msg, uint_t msgsz)
+{
+	MBFCB	*p_mbfcb;
+	WINFO_SMBF winfo_smbf;
+	ER		ercd;
+
+	LOG_SND_MBF_ENTER(mbfid, msg, msgsz);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_MBFID(mbfid));
+	p_mbfcb = get_mbfcb(mbfid);
+	CHECK_PAR(0 < msgsz && msgsz <= p_mbfcb->p_mbfinib->maxmsz);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (send_message(p_mbfcb, msg, msgsz)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		winfo_smbf.msg = msg;
+		winfo_smbf.msgsz = msgsz;
+		p_runtsk->tstat = TS_WAITING_SMBF;
+		wobj_make_wait((WOBJCB *) p_mbfcb, (WINFO_WOBJ *) &winfo_smbf);
+		dispatch();
+		ercd = winfo_smbf.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_SND_MBF_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_snd_mbf */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ã¸ã®éä¿¡ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_psnd_mbf
+
+ER
+psnd_mbf(ID mbfid, const void *msg, uint_t msgsz)
+{
+	MBFCB	*p_mbfcb;
+	ER		ercd;
+
+	LOG_PSND_MBF_ENTER(mbfid, msg, msgsz);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MBFID(mbfid));
+	p_mbfcb = get_mbfcb(mbfid);
+	CHECK_PAR(0 < msgsz && msgsz <= p_mbfcb->p_mbfinib->maxmsz);
+
+	lock_cpu();
+	if (send_message(p_mbfcb, msg, msgsz)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PSND_MBF_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_psnd_mbf */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ã¸ã®éä¿¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_tsnd_mbf
+
+ER
+tsnd_mbf(ID mbfid, const void *msg, uint_t msgsz, TMO tmout)
+{
+	MBFCB	*p_mbfcb;
+	WINFO_SMBF winfo_smbf;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TSND_MBF_ENTER(mbfid, msg, msgsz, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_MBFID(mbfid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_mbfcb = get_mbfcb(mbfid);
+	CHECK_PAR(0 < msgsz && msgsz <= p_mbfcb->p_mbfinib->maxmsz);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (send_message(p_mbfcb, msg, msgsz)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		winfo_smbf.msg = msg;
+		winfo_smbf.msgsz = msgsz;
+		p_runtsk->tstat = TS_WAITING_SMBF;
+		wobj_make_wait_tmout((WOBJCB *) p_mbfcb, (WINFO_WOBJ *) &winfo_smbf,
+														&tmevtb, tmout);
+		dispatch();
+		ercd = winfo_smbf.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TSND_MBF_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_tsnd_mbf */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ããã®åä¿¡
+ */
+#ifdef TOPPERS_rcv_mbf
+
+ER_UINT
+rcv_mbf(ID mbfid, void *msg)
+{
+	MBFCB	*p_mbfcb;
+	WINFO_RMBF winfo_rmbf;
+	uint_t	msgsz;
+	ER_UINT	ercd;
+
+	LOG_RCV_MBF_ENTER(mbfid, msg);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_MBFID(mbfid));
+	p_mbfcb = get_mbfcb(mbfid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if ((msgsz = receive_message(p_mbfcb, msg)) > 0U) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = (ER_UINT) msgsz;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_RMBF;
+		make_wait(&(winfo_rmbf.winfo));
+		queue_insert_prev(&(p_mbfcb->rwait_queue), &(p_runtsk->task_queue));
+		winfo_rmbf.p_mbfcb = p_mbfcb;
+		winfo_rmbf.msg = msg;
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo_rmbf.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_RCV_MBF_LEAVE(ercd, msg);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rcv_mbf */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ããã®åä¿¡ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_prcv_mbf
+
+ER
+prcv_mbf(ID mbfid, void *msg)
+{
+	MBFCB	*p_mbfcb;
+	uint_t	msgsz;
+	ER_UINT	ercd;
+
+	LOG_PRCV_MBF_ENTER(mbfid, msg);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MBFID(mbfid));
+	p_mbfcb = get_mbfcb(mbfid);
+
+	lock_cpu();
+	if ((msgsz = receive_message(p_mbfcb, msg)) > 0U) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = (ER_UINT) msgsz;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PRCV_MBF_LEAVE(ercd, msg);
+	return(ercd);
+}
+
+#endif /* TOPPERS_prcv_mbf */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ããã®åä¿¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_trcv_mbf
+
+ER
+trcv_mbf(ID mbfid, void *msg, TMO tmout)
+{
+	MBFCB	*p_mbfcb;
+	WINFO_RMBF winfo_rmbf;
+	TMEVTB	tmevtb;
+	uint_t	msgsz;
+	ER_UINT	ercd;
+
+	LOG_TRCV_MBF_ENTER(mbfid, msg, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_MBFID(mbfid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_mbfcb = get_mbfcb(mbfid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if ((msgsz = receive_message(p_mbfcb, msg)) > 0U) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = (ER_UINT) msgsz;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_RMBF;
+		make_wait_tmout(&(winfo_rmbf.winfo), &tmevtb, tmout);
+		queue_insert_prev(&(p_mbfcb->rwait_queue), &(p_runtsk->task_queue));
+		winfo_rmbf.p_mbfcb = p_mbfcb;
+		winfo_rmbf.msg = msg;
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo_rmbf.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TRCV_MBF_LEAVE(ercd, msg);
+	return(ercd);
+}
+
+#endif /* TOPPERS_trcv_mbf */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ã®ååæå
+ */
+#ifdef TOPPERS_ini_mbf
+
+ER
+ini_mbf(ID mbfid)
+{
+	MBFCB	*p_mbfcb;
+	ER		ercd;
+    
+	LOG_INI_MBF_ENTER(mbfid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MBFID(mbfid));
+	p_mbfcb = get_mbfcb(mbfid);
+
+	lock_cpu();
+	init_wait_queue(&(p_mbfcb->swait_queue));
+	init_wait_queue(&(p_mbfcb->rwait_queue));
+	p_mbfcb->fmbfsz = p_mbfcb->p_mbfinib->mbfsz;
+	p_mbfcb->head = 0U;
+	p_mbfcb->tail = 0U;
+	p_mbfcb->smbfcnt = 0U;
+	if (p_runtsk != p_schedtsk) {
+		dispatch();
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_INI_MBF_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ini_mbf */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_mbf
+
+ER
+ref_mbf(ID mbfid, T_RMBF *pk_rmbf)
+{
+	MBFCB	*p_mbfcb;
+	ER		ercd;
+    
+	LOG_REF_MBF_ENTER(mbfid, pk_rmbf);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MBFID(mbfid));
+	p_mbfcb = get_mbfcb(mbfid);
+
+	lock_cpu();
+	pk_rmbf->stskid = wait_tskid(&(p_mbfcb->swait_queue));
+	pk_rmbf->rtskid = wait_tskid(&(p_mbfcb->rwait_queue));
+	pk_rmbf->smbfcnt = p_mbfcb->smbfcnt;
+	pk_rmbf->fmbfsz = p_mbfcb->fmbfsz;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_MBF_LEAVE(ercd, pk_rmbf);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_mbf */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/messagebuf.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/messagebuf.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/messagebuf.h	(revision 302)
@@ -0,0 +1,198 @@
+/*
+ *  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: messagebuf.h 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *		ã¡ãã»ã¼ã¸ãããã¡æ©è½
+ */
+
+#ifndef TOPPERS_MESSAGEBUF_H
+#define TOPPERS_MESSAGEBUF_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "wait.h"
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡åæåãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WOBJINIBï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct messagebuf_initialization_block {
+	ATR			mbfatr;			/* ã¡ãã»ã¼ã¸ãããã¡å±æ§ */
+	uint_t		maxmsz;			/* ã¡ãã»ã¼ã¸ã®æå¤§é· */
+	size_t		mbfsz;			/* ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åã®ãµã¤ãº */
+	void		*mbfmb;			/* ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åã®å
+é ­çªå° */
+} MBFINIB;
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ç®¡çãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼
+ *  ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼æåã®2ã¤ã®
+ *  ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct messagebuf_control_block {
+	QUEUE		swait_queue;	/* ã¡ãã»ã¼ã¸ãããã¡éä¿¡å¾
+ã¡ã­ã¥ã¼ */
+	const MBFINIB *p_mbfinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	QUEUE		rwait_queue;	/* ã¡ãã»ã¼ã¸ãããã¡åä¿¡å¾
+ã¡ã­ã¥ã¼ */
+	size_t		fmbfsz;			/* ç©ºãé åã®ãµã¤ãº */
+	size_t		head;			/* æåã®ã¡ãã»ã¼ã¸ã®æ ¼ç´å ´æ */
+	size_t		tail;			/* æå¾ã®ã¡ãã»ã¼ã¸ã®æ ¼ç´å ´æã®æ¬¡ */
+	uint_t		smbfcnt;		/* ç®¡çé åã«æ ¼ç´ããã¦ããã¡ãã»ã¼ã¸ã®æ° */
+} MBFCB;
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡å¾
+ã¡æ
+å ±ãã­ãã¯ã®å®ç¾©
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WINFO_WOBJï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®2ã¤ã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct messagebuf_send_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	MBFCB		*p_mbfcb;		/* å¾
+ã£ã¦ããã¡ãã»ã¼ã¸ãããã¡ã®ç®¡çãã­ãã¯ */
+	const void	*msg;			/* éä¿¡ã¡ãã»ã¼ã¸ */
+	uint_t		msgsz;			/* éä¿¡ã¡ãã»ã¼ã¸ãµã¤ãº */
+} WINFO_SMBF;
+
+typedef struct messagebuf_receive_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	MBFCB		*p_mbfcb;		/* å¾
+ã£ã¦ããã¡ãã»ã¼ã¸ãããã¡ã®ç®¡çãã­ãã¯ */
+	void		*msg;			/* åä¿¡ã¡ãã»ã¼ã¸ã®æ ¼ç´å ´æ */
+} WINFO_RMBF;
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_mbfid;
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const MBFINIB	mbfinib_table[];
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern MBFCB	mbfcb_table[];
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ç®¡çãã­ãã¯ããã¡ãã»ã¼ã¸ãããã¡IDãåãåºãã
+ *  ãã®ãã¯ã­
+ */
+#define	MBFID(p_mbfcb)	((ID)(((p_mbfcb) - mbfcb_table) + TMIN_MBFID))
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡æ©è½ã®åæå
+ */
+extern void	initialize_messagebuf(void);
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åã¸ã®ã¡ãã»ã¼ã¸ã®æ ¼ç´
+ */
+extern bool_t	enqueue_message(MBFCB *p_mbfcb, const void *msg, uint_t msgsz);
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åããã®ã¡ãã»ã¼ã¸ã®ååºã
+ */
+extern uint_t	dequeue_message(MBFCB *p_mbfcb, void *msg);
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ã¸ã®ã¡ãã»ã¼ã¸éä¿¡
+ */
+extern bool_t	send_message(MBFCB *p_mbfcb, const void *msg, uint_t msgsz);
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡éä¿¡å¾
+ã¡ã¿ã¹ã¯ã®ãã§ãã¯
+ */
+extern void	messagebuf_signal(MBFCB *p_mbfcb);
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡ããã®ã¡ãã»ã¼ã¸åä¿¡
+ */
+extern uint_t	receive_message(MBFCB *p_mbfcb, void *msg);
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡éä¿¡å¾
+ã¡ã¿ã¹ã¯ã®å¾
+ã¡è§£é¤æå¦ç
+ */
+extern void	messagebuf_dequeue_wobj(TCB *p_tcb);
+
+#endif /* TOPPERS_MESSAGEBUF_H */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/messagebuf.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/messagebuf.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/messagebuf.tf	(revision 302)
@@ -0,0 +1,167 @@
+$
+$   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: messagebuf.tf 480 2016-01-03 07:37:12Z ertl-hiro $
+$ 
+
+$
+$		ã¡ãã»ã¼ã¸ãããã¡æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  kernel_cfg.hã®çæ
+$
+$FILE "kernel_cfg.h.new"$
+
+#define TNUM_MBFID	$LENGTH(MBF.ID_LIST)$$NL$
+$FOREACH id MBF.ID_LIST$
+	#define $id$	$+id$$NL$
+$END$
+
+$
+$  kernel_cfg.cã®çæ
+$
+$FILE "kernel_cfg.c"$
+
+/*$NL$
+$SPC$*  Message Buffer Functions$NL$
+$SPC$*/$NL$
+$NL$
+
+$
+$  ã¡ãã»ã¼ã¸ãããã¡ã®IDçªå·ãä¿æããå¤æ°
+$
+$IF USE_EXTERNAL_ID$
+	$FOREACH id MBF.ID_LIST$
+		const ID $id$_id = $+id$;$NL$
+	$END$
+$END$
+
+$
+$  ã¡ãã»ã¼ã¸ãããã¡IDçªå·ã®æå¤§å¤
+$
+const ID _kernel_tmax_mbfid = (TMIN_MBFID + TNUM_MBFID - 1);$NL$
+$NL$
+
+$
+$  ã¡ãã»ã¼ã¸ãããã¡åæåãã­ãã¯
+$
+$IF LENGTH(MBF.ID_LIST)$
+	$FOREACH mbfid MBF.ID_LIST$
+$		// mbfatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3303ï¼½
+$		//ï¼TA_NULLã§ãªãå ´åï¼
+		$IF MBF.MBFATR[mbfid] != TA_NULL$
+			$ERROR MBF.TEXT_LINE[mbfid]$E_RSATR:$SPC$
+				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
+							"mbfatr", MBF.MBFATR[mbfid], mbfid, "CRE_MBF")$
+			$END$
+		$END$
+
+$		// maxmszã0ä»¥ä¸ã®å ´åï¼E_PARï¼ï¼»NGKI3307ï¼½
+		$IF MBF.MAXMSZ[mbfid] <= 0$
+			$ERROR MBF.TEXT_LINE[mbfid]$E_PAR:$SPC$
+				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
+							"maxmsz", MBF.MAXMSZ[mbfid], mbfid, "CRE_MBF")$
+			$END$
+		$END$
+
+$		// mbfszãè² ã®å ´åï¼E_PARï¼ï¼»NGKI3308ï¼½
+		$IF MBF.MBFSZ[mbfid] < 0$
+			$ERROR MBF.TEXT_LINE[mbfid]$E_PAR:$SPC$
+				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
+							"mbfsz", MBF.MBFSZ[mbfid], mbfid, "CRE_MBF")$
+			$END$
+		$END$
+
+$		// mbfmbãNULLã§ãªãå ´åï¼E_NOSPTï¼ï¼»ASPS0205ï¼½
+		$IF !EQ(MBF.MBFMB[mbfid], "NULL")$
+			$ERROR MBF.TEXT_LINE[mbfid]$E_NOSPT:$SPC$
+				$FORMAT(_("illegal %1% `%2%\' of `%3%\' in %4%"),
+							"mbfmb", MBF.MBFMB[mbfid], mbfid, "CRE_MBF")$
+			$END$
+		$END$
+
+$		// ã¡ãã»ã¼ã¸ãããã¡ç®¡çé å
+		$IF MBF.MBFSZ[mbfid]$
+			static uint_t _kernel_mbfmb_$mbfid$
+					[TOPPERS_COUNT_SZ($MBF.MBFSZ[mbfid]$, sizeof(uint_t))];$NL$
+		$END$
+	$END$
+
+$	// ã¡ãã»ã¼ã¸ãããã¡åæåãã­ãã¯
+	const MBFINIB _kernel_mbfinib_table[TNUM_MBFID] = {$NL$
+	$JOINEACH mbfid MBF.ID_LIST ",\n"$
+		$TAB${$SPC$
+			($MBF.MBFATR[mbfid]$),$SPC$
+			($MBF.MAXMSZ[mbfid]$),$SPC$
+			TOPPERS_ROUND_SZ($MBF.MBFSZ[mbfid]$, sizeof(uint_t)),$SPC$
+			$IF MBF.MBFSZ[mbfid]$
+				_kernel_mbfmb_$mbfid$
+			$ELSE$
+				NULL
+			$END$$SPC$
+		}$END$$NL$
+	};$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(const MBFINIB, _kernel_mbfinib_table);$NL$
+$END$$NL$
+
+$
+$  ã¡ãã»ã¼ã¸ãããã¡ç®¡çãã­ãã¯ã¨ã¡ãã»ã¼ã¸ãããã¡æ©è½åæåé¢æ°
+$
+$IF LENGTH(MBF.ID_LIST)$
+	MBFCB _kernel_mbfcb_table[TNUM_MBFID];$NL$
+	$initfuncs = APPEND(initfuncs, "_kernel_initialize_messagebuf();")$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(MBFCB, _kernel_mbfcb_table);$NL$
+$END$$NL$
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/task.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/task.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/task.h	(revision 302)
@@ -0,0 +1,652 @@
+/*
+ *  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: task.h 452 2015-08-15 02:36:39Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_TASK_H
+#define TOPPERS_TASK_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "time_event.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_TSKSTAT
+#define LOG_TSKSTAT(p_tcb)
+#endif /* LOG_TSKSTAT */
+
+/*
+ *  ã¿ã¹ã¯åªå
+åº¦ã®å
+é¨è¡¨ç¾ã»å¤é¨è¡¨ç¾å¤æãã¯ã­
+ */
+#define INT_PRIORITY(x)		((uint_t)((x) - TMIN_TPRI))
+#define EXT_TSKPRI(x)		((PRI)(x) + TMIN_TPRI)
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+ã®å
+é¨è¡¨ç¾
+ *
+ *  TCBä¸­ã®ã¿ã¹ã¯ç¶æ
+ã®ãã£ã¼ã«ãã§ã¯ï¼ã¿ã¹ã¯ã®ç¶æ
+ã¨ï¼ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+
+ *  ã®æã®å¾
+ã¡è¦å ãè¡¨ãï¼ãã ãï¼å®è¡ç¶æ
+ï¼RUNNINGï¼ã¨å®è¡å¯è½ç¶æ
+
+ *  ï¼READYï¼ã¯åºå¥ããï¼ä¸¡ç¶æ
+ããããã¦å®è¡ã§ããç¶æ
+ï¼RUNNABLEï¼ã¨ã
+ *  ã¦ç®¡çããï¼äºéå¾
+ã¡ç¶æ
+ã¯ï¼(TS_WAITING_??? | TS_SUSPENDED)ã§è¡¨ãï¼
+ *
+ *  ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ãå«ãï¼ã®æã¯ï¼TS_WAITING_???ã§å¾
+ã¡
+ *  è¦å ãè¡¨ãï¼å¾
+ã¡è¦å ï¼5ãããã§è¡¨ç¾ãããï¼ã®ä¸ä½2ãããã§ï¼åæã»
+ *  éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãã£ã¦ãããã©ãããè¡¨ãï¼åæã»
+ *  éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãããªããã®ã¯ä¸ä½2ãããã00ï¼å
+ *  æã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼
+ *  ã«ã¤ãªãããã®ã¯10ã¾ãã¯11ï¼ããä»¥å¤ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãããã®ã¯01
+ *  ã¨ããï¼
+ */
+#define TS_DORMANT		0x00U			/* ä¼æ­¢ç¶æ
+ */
+#define TS_RUNNABLE		0x01U			/* å®è¡ã§ããç¶æ
+ */
+#define TS_SUSPENDED	0x02U			/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+
+#define TS_WAITING_SLP	(0x01U << 2)	/* èµ·åºå¾
+ã¡ */
+#define TS_WAITING_DLY	(0x02U << 2)	/* æéçµéå¾
+ã¡ */
+#define TS_WAITING_RDTQ	(0x08U << 2)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TS_WAITING_RPDQ	(0x09U << 2)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TS_WAITING_RMBF	(0x0aU << 2)	/* ã¡ãã»ã¼ã¸ãããã¡ããã®åä¿¡å¾
+ã¡ */
+#define TS_WAITING_SEM	(0x10U << 2)	/* ã»ããã©è³æºã®ç²å¾å¾
+ã¡ */
+#define TS_WAITING_FLG	(0x11U << 2)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TS_WAITING_SDTQ	(0x12U << 2)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TS_WAITING_SPDQ	(0x13U << 2)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TS_WAITING_MTX	(0x14U << 2)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ */
+#define TS_WAITING_SMBF	(0x15U << 2)	/* ã¡ãã»ã¼ã¸ãããã¡ã¸ã®éä¿¡å¾
+ã¡ */
+#define TS_WAITING_MPF	(0x16U << 2)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TS_WAITING_MASK	(0x1fU << 2)	/* å¾
+ã¡ç¶æ
+ã®å¤å¥ç¨ãã¹ã¯ */
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+å¤å¥ãã¯ã­
+ *
+ *  TSTAT_DORMANTã¯ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ã§ãããã©ãããï¼TSTAT_RUNNABLEã¯
+ *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ãããã©ãããå¤å¥ããï¼TSTAT_WAITINGã¯å¾
+
+ *  ã¡ç¶æ
+ã¨äºéå¾
+ã¡ç¶æ
+ã®ããããã§ãããã©ãããï¼TSTAT_SUSPENDEDã¯
+ *  å¼·å¶å¾
+ã¡ç¶æ
+ã¨äºéå¾
+ã¡ç¶æ
+ã®ããããã§ãããã©ãããå¤å¥ããï¼
+ */
+#define TSTAT_DORMANT(tstat)	((tstat) == TS_DORMANT)
+#define TSTAT_RUNNABLE(tstat)	(((tstat) & TS_RUNNABLE) != 0U)
+#define TSTAT_WAITING(tstat)	(((tstat) & TS_WAITING_MASK) != 0U)
+#define TSTAT_SUSPENDED(tstat)	(((tstat) & TS_SUSPENDED) != 0U)
+
+/*
+ *  ã¿ã¹ã¯å¾
+ã¡è¦å å¤å¥ãã¯ã­
+ *
+ *  TSTAT_WAIT_SLPã¯ã¿ã¹ã¯ãèµ·åºå¾
+ã¡ã§ãããã©ãããï¼TSTAT_WAIT_MTXã¯
+ *  ã¿ã¹ã¯ããã¥ã¼ããã¯ã¹å¾
+ã¡ã§ãããã©ãããå¤å¥ããï¼
+ *
+ *  ã¾ãï¼TSTAT_WAIT_WOBJ ã¯ã¿ã¹ã¯ãåæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡
+ *  ã§ãããï¼è¨ãæããã¨ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªã
+ *  ãã¦ãããï¼ã©ãããï¼TSTAT_WAIT_WOBJCBã¯ã¿ã¹ã¯ãåæã»éä¿¡ãªãã¸ã§
+ *  ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ãã
+ *  ãã©ãããå¤å¥ããï¼
+ */
+#define TSTAT_WAIT_SLP(tstat)	(((tstat) & ~TS_SUSPENDED) == TS_WAITING_SLP)
+#define TSTAT_WAIT_MTX(tstat)	(((tstat) & ~TS_SUSPENDED) == TS_WAITING_MTX)
+#define TSTAT_WAIT_SMBF(tstat)	(((tstat) & ~TS_SUSPENDED) == TS_WAITING_SMBF)
+
+#define TSTAT_WAIT_WOBJ(tstat)		(((tstat) & (0x18U << 2)) != 0U)
+#define TSTAT_WAIT_WOBJCB(tstat)	(((tstat) & (0x10U << 2)) != 0U)
+
+/*
+ *  å¾
+ã¡æ
+å ±ãã­ãã¯ï¼WINFOï¼ã®å®ç¾©
+ *
+ *  ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã®éã¯ï¼TCBããã³ãã®p_winfoã§æãããWINFOãæ¬¡ã®
+ *  ããã«è¨­å®ããªããã°ãªããªãï¼
+ *
+ *  (a) TCBã®ã¿ã¹ã¯ç¶æ
+ãå¾
+ã¡ç¶æ
+ï¼TS_WAITING_???ï¼ã«ããï¼
+ *
+ *  (b) ã¿ã¤ã ã¢ã¦ããç£è¦ããããã«ï¼ã¿ã¤ã ã¤ãã³ããã­ãã¯ãç»é²ããï¼
+ *  ç»é²ããã¿ã¤ã ã¤ãã³ããã­ãã¯ã¯ï¼å¾
+ã¡ã«å
+¥ããµã¼ãã¹ã³ã¼ã«å¦çé¢æ°
+ *  ã®ã­ã¼ã«ã«å¤æ°ã¨ãã¦ç¢ºä¿ãï¼ããã¸ã®ãã¤ã³ã¿ãWINFOã®p_tmevtbã«è¨
+ *  æ¶ããï¼ã¿ã¤ã ã¢ã¦ãã®ç£è¦ãå¿
+è¦ãªãå ´åï¼æ°¸ä¹
+å¾
+ã¡ã®å ´åï¼ã«ã¯ï¼
+ *  p_tmevtbãNULLã«ããï¼
+ *
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã®å ´åã«ã¯ï¼æ¨æºã®WINFOã«
+ *  p_wobjcbãã£ã¼ã«ããè¿½å ããæ§é ä½ï¼WINFO_WOBJï¼wait.hã§å®ç¾©ï¼ã«ï¼
+ *  å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã«ä¾å­ãã¦è¨æ¶ãããã¨ãå¿
+è¦ãªæ
+å ±
+ *  ã®ããã®ãã£ã¼ã«ããè¿½å ããæ§é ä½ï¼WINFO_???ï¼ãå®ç¾©ãï¼WINFOã®ä»£
+ *  ããã«ç¨ããï¼ã¾ãï¼ä»¥ä¸ã®(c)ã(e)ã®è¨­å®ãè¡ãå¿
+è¦ãããï¼åæã»é
+ *  ä¿¡ãªãã¸ã§ã¯ãã«é¢ä¿ããªãå¾
+ã¡ï¼èµ·åºå¾
+ã¡ï¼æéçµéå¾
+ã¡ï¼ã®å ´åã«ã¯ï¼
+ *  ãããã¯å¿
+è¦ãªãï¼
+ *
+ *  (c) TCBãå¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãï¼å¾
+
+ *  ã¡ã­ã¥ã¼ã«ã¤ãªãããã«ï¼task_queueãä½¿ãï¼
+ *
+ *  (d) å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã¸ã®ãã¤ã³ã¿ãï¼
+ *  WINFO_WOBJã®p_wobjcbã«è¨æ¶ããï¼
+ *
+ *  (e) å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã«ä¾å­ãã¦è¨æ¶ãããã¨ãå¿
+è¦ãª
+ *  æ
+å ±ãããå ´åã«ã¯ï¼WINFO_???å
+ã®ãã£ã¼ã«ãã«è¨æ¶ããï¼
+ *
+ *  å¾
+ã¡ç¶æ
+ãè§£é¤ããéã«ã¯ï¼å¾
+ã¡è§£é¤ããã¿ã¹ã¯ã«å¯¾ããè¿å¤ãWINFOã®
+ *  wercdã«è¨­å®ããï¼wercdãå¿
+è¦ãªã®ã¯å¾
+ã¡è§£é¤ä»¥éã§ããã®ã«å¯¾ãã¦ï¼
+ *  p_tmevtbã¯å¾
+ã¡è§£é¤å¾ã¯å¿
+è¦ãªãããï¼ã¡ã¢ãªç¯ç´ã®ããã«å
+±ç¨ä½ãä½¿ã£
+ *  ã¦ããï¼ãã®ããï¼wercdã¸ã¨ã©ã¼ã³ã¼ããè¨­å®ããã®ã¯ï¼ã¿ã¤ã ã¤ãã³ã
+ *  ãã­ãã¯ãç»é²è§£é¤ããå¾ã«ããªããã°ãªããªãï¼
+ */
+typedef union waiting_information {
+	ER		wercd;			/* å¾
+ã¡è§£é¤æã®ã¨ã©ã¼ã³ã¼ã */
+	TMEVTB	*p_tmevtb;		/* å¾
+ã¡ç¶æ
+ç¨ã®ã¿ã¤ã ã¤ãã³ããã­ãã¯ */
+} WINFO;
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ã®åã®åæ¹åç
+§
+ */
+typedef struct mutex_control_block MTXCB;
+
+/*
+ *  ã¿ã¹ã¯åæåãã­ãã¯
+ *
+ *  ã¿ã¹ã¯ã«é¢ããæ
+å ±ãï¼å¤ãå¤ãããªãããã«ROMã«ç½®ããé¨åï¼ã¿ã¹ã¯
+ *  åæåãã­ãã¯ï¼ã¨ï¼å¤ãå¤åããããã«RAMã«ç½®ããªããã°ãªããªãé¨
+ *  åï¼ã¿ã¹ã¯ç®¡çãã­ãã¯ï¼TCBï¼ã«åé¢ãï¼TCBå
+ã«å¯¾å¿ããã¿ã¹ã¯åæå
+ *  ãã­ãã¯ãæããã¤ã³ã¿ãå
+¥ããï¼ã¿ã¹ã¯åæåãã­ãã¯å
+ã«å¯¾å¿ãã
+ *  TCBãæããã¤ã³ã¿ãå
+¥ããæ¹æ³ã®æ¹ãï¼RAMã®ç¯ç´ã®è¦³ç¹ããã¯æã¾ãã
+ *  ãï¼å®è¡å¹çãæªããªãããã«æ¡ç¨ãã¦ããªãï¼ä»ã®ãªãã¸ã§ã¯ãã«ã¤ã
+ *  ã¦ãåæ§ã«æ±ãï¼
+ */
+typedef struct task_initialization_block {
+	ATR			tskatr;			/* ã¿ã¹ã¯å±æ§ */
+	intptr_t	exinf;			/* ã¿ã¹ã¯ã®æ¡å¼µæ
+å ± */
+	TASK		task;			/* ã¿ã¹ã¯ã®èµ·åçªå° */
+	uint_t		ipriority;		/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼ */
+
+#ifdef USE_TSKINICTXB
+	TSKINICTXB	tskinictxb;		/* ã¿ã¹ã¯åæåã³ã³ãã­ã¹ããã­ãã¯ */
+#else /* USE_TSKINICTXB */
+	size_t		stksz;			/* ã¹ã¿ãã¯é åã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
+	void		*stk;			/* ã¹ã¿ãã¯é åã®å
+é ­çªå° */
+#endif /* USE_TSKINICTXB */
+} TINIB;
+
+/*
+ *  ã¿ã¹ã¯ç®¡çãã­ãã¯ï¼TCBï¼
+ *
+ *  ASPã«ã¼ãã«ã§ã¯ï¼ã¿ã¹ã¯ã®èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ï¼TMAX_ACTCNTï¼
+ *  ã¨èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ï¼TMAX_WUPCNTï¼ã¯1ã«åºå®ããã¦ãã
+ *  ããï¼ã­ã¥ã¼ã¤ã³ã°ããã¦ãããã©ããã®çå½å¤ã§è¡¨ç¾ãããã¨ãã§ããï¼
+ *  ã¾ãï¼å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ã®æå¤§å¤ï¼TMAX_SUSCNTï¼ã1ã«åºå®ããã¦ã
+ *  ãã®ã§ï¼å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ï¼suscntï¼ã¯å¿
+è¦ãªãï¼
+ *
+ *  TCBã®ããã¤ãã®ãã£ã¼ã«ãã¯ï¼ç¹å®ã®ã¿ã¹ã¯ç¶æ
+ã§ã®ã¿æå¹ãªå¤ãä¿æãï¼
+ *  ããä»¥å¤ã®å ´åã¯å¤ãä¿è¨¼ãããªãï¼ãã£ã¦ï¼åç
+§ãã¦ã¯ãªããªãï¼ï¼å
+ *  ãã£ã¼ã«ããæå¹ãªå¤ãä¿æããæ¡ä»¶ã¯æ¬¡ã®éãï¼
+ *
+ *  ã»åæåå¾ã¯å¸¸ã«æå¹ï¼
+ *  		p_tinibï¼tstatï¼actque
+ *  ã»ä¼æ­¢ç¶æ
+ä»¥å¤ã§æå¹ï¼ä¼æ­¢ç¶æ
+ã§ã¯åæå¤ã«ãªã£ã¦ããï¼ï¼
+ *  		bpriorityï¼priorityï¼wupqueï¼rasterï¼enaterï¼p_lastmtx
+ *  ã»å¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ãå«ãï¼ã§æå¹ï¼
+ *  		p_winfo
+ *  ã»å®è¡ã§ããç¶æ
+ã¨åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã§æå¹ï¼
+ *  		task_queue
+ *  ã»å®è¡å¯è½ç¶æ
+ï¼å¾
+ã¡ç¶æ
+ï¼å¼·å¶å¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ã§æå¹ï¼
+ *  		tskctxb
+ */
+typedef struct task_control_block {
+	QUEUE			task_queue;		/* ã¿ã¹ã¯ã­ã¥ã¼ */
+	const TINIB		*p_tinib;		/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+
+#ifdef UINT8_MAX
+	uint8_t			tstat;			/* ã¿ã¹ã¯ç¶æ
+ï¼å
+é¨è¡¨ç¾ï¼*/
+	uint8_t			bpriority;		/* ãã¼ã¹åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+	uint8_t			priority;		/* ç¾å¨ã®åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+#else /* UINT8_MAX */
+	BIT_FIELD_UINT	tstat : 8;		/* ã¿ã¹ã¯ç¶æ
+ï¼å
+é¨è¡¨ç¾ï¼*/
+	BIT_FIELD_UINT	bpriority : 8;	/* ãã¼ã¹åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+	BIT_FIELD_UINT	priority : 8	/* ç¾å¨ã®åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/;
+#endif /* UINT8_MAX */
+	BIT_FIELD_BOOL	actque : 1;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã° */
+	BIT_FIELD_BOOL	wupque : 1;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã° */
+	BIT_FIELD_BOOL	raster : 1;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	BIT_FIELD_BOOL	enater : 1;		/* ã¿ã¹ã¯çµäºè¨±å¯ç¶æ
+ */
+
+	WINFO			*p_winfo;		/* å¾
+ã¡æ
+å ±ãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	MTXCB			*p_lastmtx;		/* æå¾ã«ã­ãã¯ãããã¥ã¼ããã¯ã¹ */
+	TSKCTXB			tskctxb;		/* ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ */
+} TCB;
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯
+ *
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯ï¼ï¼ãã­ã»ããµãã³ã³ãã­ã¹ããæã£ã¦ããã¿ã¹ã¯ï¼ã®
+ *  TCBãæããã¤ã³ã¿ï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ããªãå ´åã¯NULLã«ããï¼
+ *
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å¦çä¸­ã§ï¼èªã¿ã¹ã¯ï¼ãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºããã¿ã¹
+ *  ã¯ï¼ã«é¢ããæ
+å ±ãåç
+§ããå ´åã¯p_runtskãä½¿ãï¼p_runtskãæ¸ãæã
+ *  ãã®ã¯ï¼ãã£ã¹ãããã£ï¼ã¨åæåå¦çï¼ã®ã¿ã§ããï¼
+ */
+extern TCB	*p_runtsk;
+
+/*
+ *  å®è¡ãã¹ãã¿ã¹ã¯
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ã®TCBãæããã¤ã³ã¿ï¼å®è¡ã§ããã¿ã¹ã¯ããªãå ´åã¯
+ *  NULLã«ããï¼
+ *
+ *  p_runtskã¯ï¼éå¸¸ã¯p_schedtskã¨ä¸è´ãã¦ãããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ã
+ *  å®è¡ä¸­ã¯ï¼ä¸è´ãã¦ããã¨ã¯éããªãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªã
+ *  ç¶æ
+ã®éã¨ãã£ã¹ãããç¦æ­¢ç¶æ
+ã®éï¼ããªãã¡ï¼dspflgãfalseã§ããéï¼
+ *  ã¯ï¼p_schedtskãæ´æ°ããªãï¼
+ */
+extern TCB	*p_schedtsk;
+
+/*
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+
+ *
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ãããã¨ãç¤ºããã©ã°ï¼
+ */
+extern bool_t	enadsp;
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããå¯è½ç¶æ
+
+ *
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§ããï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ããï¼ãã£
+ *  ã¹ãããç¦æ­¢ç¶æ
+ã§ãªãï¼ãã¨ãç¤ºããã©ã°ï¼ãã£ã¹ãããä¿çç¶æ
+ã§ãª
+ *  ããã¨ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãå®è¡ä¸­ã§ï¼CPUã­ãã¯ç¶æ
+ã§ãªãï¼dspflgã
+ *  trueã§ãããã¨ã§å¤å¥ãããã¨ãã§ããï¼
+ */
+extern bool_t	dspflg;
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã¯ï¼å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ãç®¡çããããã®ã­ã¥ã¼ã§ããï¼
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãç®¡çãã¦ããããï¼ã¬ãã£ï¼å®è¡å¯è½ï¼ã­ã¥ã¼ã¨ãã
+ *  åç§°ã¯æ­£ç¢ºã§ã¯ãªããï¼ã¬ãã£ã­ã¥ã¼ã¨ããåç§°ãå®çãã¦ããããï¼ã
+ *  ã®åç§°ã§å¼ã¶ãã¨ã«ããï¼
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã¯ï¼åªå
+åº¦ãã¨ã®ã¿ã¹ã¯ã­ã¥ã¼ã§æ§æããã¦ããï¼ã¿ã¹ã¯ã®
+ *  TCBã¯ï¼è©²å½ããåªå
+åº¦ã®ã­ã¥ã¼ã«ç»é²ãããï¼
+ */
+extern QUEUE	ready_queue[TNUM_TPRI];
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ãµã¼ãã®ããã®ãããããã
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã®ãµã¼ããå¹çããè¡ãããã«ï¼åªå
+åº¦ãã¨ã®ã¿ã¹ã¯ã­ã¥ã¼
+ *  ã«ã¿ã¹ã¯ãå
+¥ã£ã¦ãããã©ãããç¤ºããããããããç¨æãã¦ããï¼ãã
+ *  ãããããä½¿ããã¨ã§ï¼ã¡ã¢ãªã¢ã¯ã»ã¹ã®åæ°ãæ¸ãããã¨ãã§ãããï¼
+ *  ãããæä½å½ä»¤ãå
+
+å®ãã¦ããªããã­ã»ããµã§ï¼åªå
+åº¦ã®æ®µéæ°ãå°ãªã
+ *  å ´åã«ã¯ï¼ããããããæä½ã®ãªã¼ãã¼ãããã®ããã«ï¼éã«å¹çãè½ã¡
+ *  ãå¯è½æ§ãããï¼
+ *
+ *  åªå
+åº¦ã16æ®µéã§ãããã¨ãä»®å®ãã¦ããããï¼uint16_tåã¨ãã¦ããï¼
+ */
+extern uint16_t	ready_primap;
+
+/*
+ *  ã¿ã¹ã¯IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_tskid;
+
+/*
+ *  ã¿ã¹ã¯åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const TINIB	tinib_table[];
+
+/*
+ *  ã¿ã¹ã¯çæé åºãã¼ãã«ï¼kernel_cfg.cï¼
+ */
+extern const ID	torder_table[];
+
+/*
+ *  TCBã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern TCB	tcb_table[];
+
+/*
+ *  ã¿ã¹ã¯ã®æ°
+ */
+#define tnum_tsk	((uint_t)(tmax_tskid - TMIN_TSKID + 1))
+
+/*
+ *  ã¿ã¹ã¯IDããTCBãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_TSK(tskid)	((uint_t)((tskid) - TMIN_TSKID))
+#define get_tcb(tskid)		(&(tcb_table[INDEX_TSK(tskid)]))
+
+/*
+ *  TCBããã¿ã¹ã¯IDãåãåºãããã®ãã¯ã­
+ */
+#define	TSKID(p_tcb)	((ID)(((p_tcb) - tcb_table) + TMIN_TSKID))
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®åæå
+ */
+extern void	initialize_task(void);
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã®ãµã¼ã
+ *
+ *  ã¬ãã£ã­ã¥ã¼ä¸­ã®æé«åªå
+é ä½ã®ã¿ã¹ã¯ããµã¼ããï¼ãã®TCBã¸ã®ãã¤ã³ã¿
+ *  ãè¿ãï¼ã¬ãã£ã­ã¥ã¼ãç©ºã®å ´åã«ã¯ï¼ãã®é¢æ°ãå¼ã³åºãã¦ã¯ãªããªãï¼
+ */
+extern TCB	*search_schedtsk(void);
+
+/*
+ *  å®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ã«æ¿å
+¥ããï¼ã¬ãã£ã­ã¥ã¼ã«æ¿å
+¥
+ *  ããã¿ã¹ã¯ã®åªå
+åº¦ãï¼å®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã¯ï¼å®
+ *  è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ */
+extern void	make_runnable(TCB *p_tcb);
+
+/*
+ *  å®è¡ã§ããç¶æ
+ããä»ã®ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ããåé¤ããï¼p_tcbã§æå®ãã
+ *  ã¿ã¹ã¯ãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ãå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ã
+ *  ãï¼
+ */
+extern void	make_non_runnable(TCB *p_tcb);
+
+/*
+ *  ä¼æ­¢ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¶æ
+ãä¼æ­¢ç¶æ
+ã¨ããï¼ã¾ãï¼ã¿ã¹ã¯ã®èµ·å
+ *  æã«åæåãã¹ãå¤æ°ã®åæåã¨ï¼ã¿ã¹ã¯èµ·åã®ããã®ã³ã³ãã­ã¹ããè¨­
+ *  å®ããï¼
+ */
+extern void	make_dormant(TCB *p_tcb);
+
+/*
+ *  ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¶æ
+ãä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¨ããï¼
+ */
+extern void	make_active(TCB *p_tcb);
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+åº¦ã®å¤æ´
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®åªå
+åº¦ãnewpriï¼å
+é¨è¡¨ç¾ï¼ã«å¤æ´ããï¼ã¾ãï¼
+ *  å¿
+è¦ãªå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®åªå
+é ä½ã¯ï¼åªå
+åº¦ãåãã¿ã¹ã¯ã®ä¸­ã§ï¼
+ *  mtxmodeãfalseã®æã¯æä½ï¼mtxmodeãtrueã®æã¯æé«ã¨ããï¼
+ */
+extern void	change_priority(TCB *p_tcb, uint_t newpri, bool_t mtxmode);
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ã®åè»¢
+ *
+ *  ã¬ãã£ã­ã¥ã¼ä¸­ã®ï¼p_queueã§æå®ãããã¿ã¹ã¯ã­ã¥ã¼ãåè»¢ãããï¼ã¾ãï¼
+ *  å¿
+è¦ãªå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ */
+extern void	rotate_ready_queue(QUEUE *p_queue);
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºå¦ç
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãçµäºãããå¦çãè¡ãï¼ã¿ã¹ã¯ã®èµ·åè¦æ±ã­ã¥ã¼
+ *  ã¤ã³ã°æ°ã0ã§ãªãå ´åã«ã¯ï¼ååº¦èµ·åããããã®å¦çãè¡ãï¼
+ */
+extern void	task_terminate(TCB *p_tcb);
+
+#endif /* TOPPERS_TASK_H */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/task_refer.c
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/task_refer.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/task_refer.c	(revision 302)
@@ -0,0 +1,257 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: task_refer.c 78 2014-04-29 08:00:14Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ã®ç¶æ
+åç
+§æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "semaphore.h"
+#include "eventflag.h"
+#include "dataqueue.h"
+#include "pridataq.h"
+#include "mutex.h"
+#include "messagebuf.h"
+#include "mempfix.h"
+#include "time_event.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_REF_TSK_ENTER
+#define LOG_REF_TSK_ENTER(tskid, pk_rtsk)
+#endif /* LOG_REF_TSK_ENTER */
+
+#ifndef LOG_REF_TSK_LEAVE
+#define LOG_REF_TSK_LEAVE(ercd, pk_rtsk)
+#endif /* LOG_REF_TSK_LEAVE */
+
+/*
+ *  ã¿ã¹ã¯ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_tsk
+
+ER
+ref_tsk(ID tskid, T_RTSK *pk_rtsk)
+{
+	TCB		*p_tcb;
+	uint_t	tstat;
+	ER		ercd;
+
+	LOG_REF_TSK_ENTER(tskid, pk_rtsk);
+	CHECK_TSKCTX_UNL();
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	tstat = p_tcb->tstat;
+	if (TSTAT_DORMANT(tstat)) {
+		/*
+ 		 *  å¯¾è±¡ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ã®å ´å
+		 */
+		pk_rtsk->tskstat = TTS_DMT;
+	}
+	else {
+		/*
+ 		 *  ã¿ã¹ã¯ç¶æ
+ã®ååºã
+		 */
+		if (TSTAT_SUSPENDED(tstat)) {
+			if (TSTAT_WAITING(tstat)) {
+				pk_rtsk->tskstat = TTS_WAS;
+			}
+			else {
+				pk_rtsk->tskstat = TTS_SUS;
+			}
+		}
+		else if (TSTAT_WAITING(tstat)) {
+			pk_rtsk->tskstat = TTS_WAI;
+		}
+		else if (p_tcb == p_runtsk) {
+			pk_rtsk->tskstat = TTS_RUN;
+		}
+		else {
+			pk_rtsk->tskstat = TTS_RDY;
+		}
+
+		/*
+ 		 *  ç¾å¨åªå
+åº¦ã¨ãã¼ã¹åªå
+åº¦ã®ååºã
+		 */
+		pk_rtsk->tskpri = EXT_TSKPRI(p_tcb->priority);
+		pk_rtsk->tskbpri = EXT_TSKPRI(p_tcb->bpriority);
+
+		if (TSTAT_WAITING(tstat)) {
+			/*
+	 		 *  å¾
+ã¡è¦å ã¨å¾
+ã¡å¯¾è±¡ã®ãªãã¸ã§ã¯ãã®IDã®ååºã
+			 */
+			switch (tstat) {
+			case TS_WAITING_SLP:
+				pk_rtsk->tskwait = TTW_SLP;
+				break;
+			case TS_WAITING_DLY:
+				pk_rtsk->tskwait = TTW_DLY;
+				break;
+			case TS_WAITING_SEM:
+				pk_rtsk->tskwait = TTW_SEM;
+				pk_rtsk->wobjid = SEMID(((WINFO_SEM *)(p_tcb->p_winfo))
+																->p_semcb);
+				break;
+			case TS_WAITING_FLG:
+				pk_rtsk->tskwait = TTW_FLG;
+				pk_rtsk->wobjid = FLGID(((WINFO_FLG *)(p_tcb->p_winfo))
+																->p_flgcb);
+				break;
+			case TS_WAITING_SDTQ:
+				pk_rtsk->tskwait = TTW_SDTQ;
+				pk_rtsk->wobjid = DTQID(((WINFO_SDTQ *)(p_tcb->p_winfo))
+																->p_dtqcb);
+				break;
+			case TS_WAITING_RDTQ:
+				pk_rtsk->tskwait = TTW_RDTQ;
+				pk_rtsk->wobjid = DTQID(((WINFO_RDTQ *)(p_tcb->p_winfo))
+																->p_dtqcb);
+				break;
+			case TS_WAITING_SPDQ:
+				pk_rtsk->tskwait = TTW_SPDQ;
+				pk_rtsk->wobjid = PDQID(((WINFO_SPDQ *)(p_tcb->p_winfo))
+																->p_pdqcb);
+				break;
+			case TS_WAITING_RPDQ:
+				pk_rtsk->tskwait = TTW_RPDQ;
+				pk_rtsk->wobjid = PDQID(((WINFO_RPDQ *)(p_tcb->p_winfo))
+																->p_pdqcb);
+				break;
+			case TS_WAITING_MTX:
+				pk_rtsk->tskwait = TTW_MTX;
+				pk_rtsk->wobjid = MTXID(((WINFO_MTX *)(p_tcb->p_winfo))
+																->p_mtxcb);
+				break;
+			case TS_WAITING_SMBF:
+				pk_rtsk->tskwait = TTW_SMBF;
+				pk_rtsk->wobjid = MBFID(((WINFO_SMBF *)(p_tcb->p_winfo))
+																->p_mbfcb);
+				break;
+			case TS_WAITING_RMBF:
+				pk_rtsk->tskwait = TTW_RMBF;
+				pk_rtsk->wobjid = MBFID(((WINFO_RMBF *)(p_tcb->p_winfo))
+																->p_mbfcb);
+				break;
+			case TS_WAITING_MPF:
+				pk_rtsk->tskwait = TTW_MPF;
+				pk_rtsk->wobjid = MPFID(((WINFO_MPF *)(p_tcb->p_winfo))
+																->p_mpfcb);
+				break;
+			}
+
+			/*
+	 		 *  ã¿ã¤ã ã¢ã¦ãããã¾ã§ã®æéã®ååºã
+			 */
+			if (p_tcb->p_winfo->p_tmevtb != NULL) {
+				pk_rtsk->lefttmo
+						= (TMO) tmevt_lefttim(p_tcb->p_winfo->p_tmevtb);
+			}
+			else {
+				pk_rtsk->lefttmo = TMO_FEVR;
+			}
+		}
+
+		/*
+ 		 *  èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®ååºã
+		 */
+		pk_rtsk->wupcnt = p_tcb->wupque ? 1U : 0U;
+
+		/*
+		 *  ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ã®ååºã
+		 */
+		pk_rtsk->raster = p_tcb->raster;
+
+		/*
+		 *  ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã®ååºã
+		 */
+		pk_rtsk->dister = !(p_tcb->enater);
+	}
+
+	/*
+	 *  èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®ååºã
+	 */
+	pk_rtsk->actcnt = p_tcb->actque ? 1U : 0U;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_TSK_LEAVE(ercd, pk_rtsk);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_tsk */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/taskhook.c
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/taskhook.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/taskhook.c	(revision 302)
@@ -0,0 +1,82 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: taskhook.c 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã«é¢é£ããããã¯ã«ã¼ãã³
+ */
+
+#include "kernel_impl.h"
+#include "task.h"
+#include "taskhook.h"
+
+/*
+ *  ãã¥ã¼ããã¯ã¹æ©è½ã®ããã®ããã¯ã«ã¼ãã³
+ */
+#ifdef TOPPERS_mtxhook
+
+bool_t	(*mtxhook_check_ceilpri)(TCB *p_tcb, uint_t bpriority) = NULL;
+bool_t	(*mtxhook_scan_ceilmtx)(TCB *p_tcb) = NULL;
+void	(*mtxhook_release_all)(TCB *p_tcb) = NULL;
+
+#endif /* TOPPERS_mtxhook */
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡æ©è½ã®ããã®ããã¯ã«ã¼ãã³
+ */
+#ifdef TOPPERS_mbfhook
+
+void	(*mbfhook_dequeue_wobj)(TCB *p_tcb) = NULL;
+
+#endif /* TOPPERS_mbfhook */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/taskhook.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/taskhook.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/taskhook.h	(revision 302)
@@ -0,0 +1,78 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: taskhook.h 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã«é¢é£ããããã¯ã«ã¼ãã³
+ */
+
+#ifndef TOPPERS_TASKHOOK_H
+#define TOPPERS_TASKHOOK_H
+
+#include "kernel_impl.h"
+#include "task.h"
+
+/*
+ *  ãã¥ã¼ããã¯ã¹æ©è½ã®ããã®ããã¯ã«ã¼ãã³
+ */
+extern bool_t	(*mtxhook_check_ceilpri)(TCB *p_tcb, uint_t bpriority);
+extern bool_t	(*mtxhook_scan_ceilmtx)(TCB *p_tcb);
+extern void		(*mtxhook_release_all)(TCB *p_tcb);
+
+/*
+ *  ã¡ãã»ã¼ã¸ãããã¡æ©è½ã®ããã®ããã¯ã«ã¼ãã³
+ */
+extern void		(*mbfhook_dequeue_wobj)(TCB *p_tcb);
+
+#endif /* TOPPERS_TASKHOOK_H */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/wait.c
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/wait.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/wait.c	(revision 302)
@@ -0,0 +1,250 @@
+/*
+ *  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: wait.c 470 2015-12-30 09:50:36Z ertl-hiro $
+ */
+
+/*
+ *		å¾
+ã¡ç¶æ
+ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#include "kernel_impl.h"
+#include "taskhook.h"
+#include "wait.h"
+
+/*
+ *  å¾
+ã¡ç¶æ
+ã¸ã®é·ç§»ï¼ã¿ã¤ã ã¢ã¦ãæå®ï¼
+ */
+#ifdef TOPPERS_waimake
+
+void
+make_wait_tmout(WINFO *p_winfo, TMEVTB *p_tmevtb, TMO tmout)
+{
+	make_non_runnable(p_runtsk);
+	p_runtsk->p_winfo = p_winfo;
+	if (tmout == TMO_FEVR) {
+		p_winfo->p_tmevtb = NULL;
+	}
+	else {
+		assert(tmout <= TMAX_RELTIM);
+		p_winfo->p_tmevtb = p_tmevtb;
+		p_tmevtb->callback = (CBACK) wait_tmout;
+		p_tmevtb->arg = (void *) p_runtsk;
+		tmevtb_enqueue(p_tmevtb, (RELTIM) tmout);
+	}
+}
+
+#endif /* TOPPERS_waimake */
+
+/*
+ *  ãªãã¸ã§ã¯ãå¾
+ã¡ã­ã¥ã¼ããã®åé¤
+ */
+#ifdef TOPPERS_waiwobj
+
+void
+wait_dequeue_wobj(TCB *p_tcb)
+{
+	if (TSTAT_WAIT_WOBJ(p_tcb->tstat)) {
+		queue_delete(&(p_tcb->task_queue));
+		if (TSTAT_WAIT_SMBF(p_tcb->tstat)) {
+			(*mbfhook_dequeue_wobj)(p_tcb);
+		}
+	}
+}
+
+#endif /* TOPPERS_waiwobj */
+
+/*
+ *  å¾
+ã¡è§£é¤
+ */
+#ifdef TOPPERS_waicmp
+
+void
+wait_complete(TCB *p_tcb)
+{
+	wait_dequeue_tmevtb(p_tcb);
+	p_tcb->p_winfo->wercd = E_OK;
+	make_non_wait(p_tcb);
+}
+
+#endif /* TOPPERS_waicmp */
+
+/*
+ *  ã¿ã¤ã ã¢ã¦ãã«ä¼´ãå¾
+ã¡è§£é¤
+ */
+#ifdef TOPPERS_waitmo
+
+void
+wait_tmout(TCB *p_tcb)
+{
+	wait_dequeue_wobj(p_tcb);
+	p_tcb->p_winfo->wercd = E_TMOUT;
+	make_non_wait(p_tcb);
+	if (p_runtsk != p_schedtsk) {
+		request_dispatch();
+	}
+
+	/*
+	 *  ããã§åªå
+åº¦ã®é«ãå²è¾¼ã¿ãåãä»ããï¼
+	 */
+	unlock_cpu();
+	delay_for_interrupt();
+	lock_cpu();
+}
+
+#endif /* TOPPERS_waitmo */
+#ifdef TOPPERS_waitmook
+
+void
+wait_tmout_ok(TCB *p_tcb)
+{
+	p_tcb->p_winfo->wercd = E_OK;
+	make_non_wait(p_tcb);
+	if (p_runtsk != p_schedtsk) {
+		request_dispatch();
+	}
+
+	/*
+	 *  ããã§åªå
+åº¦ã®é«ãå²è¾¼ã¿ãåãä»ããï¼
+	 */
+	unlock_cpu();
+	delay_for_interrupt();
+	lock_cpu();
+}
+
+#endif /* TOPPERS_waitmook */
+
+/*
+ *  å®è¡ä¸­ã®ã¿ã¹ã¯ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã¸ã®æ¿å
+¥
+ *
+ *  å®è¡ä¸­ã®ã¿ã¹ã¯ãï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã¸æ¿å
+¥ããï¼ãª
+ *  ãã¸ã§ã¯ãã®å±æ§ã«å¿ãã¦ï¼FIFOé ã¾ãã¯ã¿ã¹ã¯åªå
+åº¦é ã§æ¿å
+¥ããï¼
+ */
+Inline void
+wobj_queue_insert(WOBJCB *p_wobjcb)
+{
+	if ((p_wobjcb->p_wobjinib->wobjatr & TA_TPRI) != 0U) {
+		queue_insert_tpri(&(p_wobjcb->wait_queue), p_runtsk);
+	}
+	else {
+		queue_insert_prev(&(p_wobjcb->wait_queue), &(p_runtsk->task_queue));
+	}
+}
+
+/*
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_wobjwai
+
+void
+wobj_make_wait(WOBJCB *p_wobjcb, WINFO_WOBJ *p_winfo_wobj)
+{
+	make_wait(&(p_winfo_wobj->winfo));
+	wobj_queue_insert(p_wobjcb);
+	p_winfo_wobj->p_wobjcb = p_wobjcb;
+	LOG_TSKSTAT(p_runtsk);
+}
+
+#endif /* TOPPERS_wobjwai */
+#ifdef TOPPERS_wobjwaitmo
+
+void
+wobj_make_wait_tmout(WOBJCB *p_wobjcb, WINFO_WOBJ *p_winfo_wobj,
+								TMEVTB *p_tmevtb, TMO tmout)
+{
+	make_wait_tmout(&(p_winfo_wobj->winfo), p_tmevtb, tmout);
+	wobj_queue_insert(p_wobjcb);
+	p_winfo_wobj->p_wobjcb = p_wobjcb;
+	LOG_TSKSTAT(p_runtsk);
+}
+
+#endif /* TOPPERS_wobjwaitmo */
+
+/*
+ *  å¾
+ã¡ã­ã¥ã¼ã®åæå
+ */
+#ifdef TOPPERS_iniwque
+
+void
+init_wait_queue(QUEUE *p_wait_queue)
+{
+	TCB		*p_tcb;
+
+	while (!queue_empty(p_wait_queue)) {
+		p_tcb = (TCB *) queue_delete_next(p_wait_queue);
+		wait_dequeue_tmevtb(p_tcb);
+		p_tcb->p_winfo->wercd = E_DLT;
+		make_non_wait(p_tcb);
+	}
+}
+
+#endif /* TOPPERS_iniwque */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/wait.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/wait.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/wait.h	(revision 302)
@@ -0,0 +1,375 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2000 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: wait.h 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *		å¾
+ã¡ç¶æ
+ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_WAIT_H
+#define TOPPERS_WAIT_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "task.h"
+#include "time_event.h"
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+åº¦é ã®å¾
+ã¡ã­ã¥ã¼ã¸ã®æ¿å
+¥
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãï¼ã¿ã¹ã¯åªå
+åº¦é ã®ã­ã¥ã¼p_queueã«æ¿å
+¥ããï¼
+ *  ã­ã¥ã¼ã®ä¸­ã«åãåªå
+åº¦ã®ã¿ã¹ã¯ãããå ´åã«ã¯ï¼ãã®æå¾ã«æ¿å
+¥ããï¼
+ */
+Inline void
+queue_insert_tpri(QUEUE *p_queue, TCB *p_tcb)
+{
+	QUEUE	*p_entry;
+	uint_t	pri = p_tcb->priority;
+
+	for (p_entry = p_queue->p_next; p_entry != p_queue;
+										p_entry = p_entry->p_next) {
+		if (pri < ((TCB *) p_entry)->priority) {
+			break;
+		}
+	}
+	queue_insert_prev(p_entry, &(p_tcb->task_queue));
+}
+
+/*
+ *  å¾
+ã¡ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  å®è¡ä¸­ã®ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã«é·ç§»ãããï¼å
+·ä½çã«ã¯ï¼å®è¡ä¸­ã®ã¿ã¹ã¯ã
+ *  ã¬ãã£ã­ã¥ã¼ããåé¤ãï¼TCBã®p_winfoãã£ã¼ã«ãï¼WINFOã®p_tmevtbãã£ã¼
+ *  ã«ããè¨­å®ããï¼
+ */
+Inline void
+make_wait(WINFO *p_winfo)
+{
+	make_non_runnable(p_runtsk);
+	p_runtsk->p_winfo = p_winfo;
+	p_winfo->p_tmevtb = NULL;
+}
+
+/*
+ *  å¾
+ã¡ç¶æ
+ã¸ã®é·ç§»ï¼ã¿ã¤ã ã¢ã¦ãæå®ï¼
+ *
+ *  å®è¡ä¸­ã®ã¿ã¹ã¯ãï¼ã¿ã¤ã ã¢ã¦ãæå®ä»ãã§å¾
+ã¡ç¶æ
+ã«é·ç§»ãããï¼å
+·ä½
+ *  çã«ã¯ï¼å®è¡ä¸­ã®ã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ããåé¤ãï¼TCBã®p_winfoãã£ã¼
+ *  ã«ãï¼WINFOã®p_tmevtbãã£ã¼ã«ããè¨­å®ããï¼ã¾ãï¼ã¿ã¤ã ã¤ãã³ãã
+ *  ã­ãã¯ãç»é²ããï¼
+ */
+extern void	make_wait_tmout(WINFO *p_winfo, TMEVTB *p_tmevtb, TMO tmout);
+
+/*
+ *  å¾
+ã¡è§£é¤ã®ããã®ã¿ã¹ã¯ç¶æ
+ã®æ´æ°
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãï¼å¾
+ã¡è§£é¤ããããã¿ã¹ã¯ç¶æ
+ãæ´æ°ããï¼
+ *  å¾
+ã¡è§£é¤ããã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã«ãªãå ´åã¯ï¼ã¬ãã£ã­ã¥ã¼ã«ã¤ãª
+ *  ãï¼
+ */
+Inline void
+make_non_wait(TCB *p_tcb)
+{
+	assert(TSTAT_WAITING(p_tcb->tstat));
+
+	if (!TSTAT_SUSPENDED(p_tcb->tstat)) {
+		/*
+		 *  å¾
+ã¡ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+		 */
+		p_tcb->tstat = TS_RUNNABLE;
+		LOG_TSKSTAT(p_tcb);
+		make_runnable(p_tcb);
+	}
+	else {
+		/*
+		 *  äºéå¾
+ã¡ç¶æ
+ããå¼·å¶å¾
+ã¡ç¶æ
+ã¸ã®é·ç§»
+		 */
+		p_tcb->tstat = TS_SUSPENDED;
+		LOG_TSKSTAT(p_tcb);
+	}
+}
+
+/*
+ *  ãªãã¸ã§ã¯ãå¾
+ã¡ã­ã¥ã¼ããã®åé¤
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤
+ *  ãªããã¦ããã°ï¼å¾
+ã¡ã­ã¥ã¼ããåé¤ããï¼
+ */
+extern void	wait_dequeue_wobj(TCB *p_tcb);
+
+/*
+ *  æéå¾
+ã¡ã®ããã®ã¿ã¤ã ã¤ãã³ããã­ãã¯ã®ç»é²è§£é¤
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã«å¯¾ãã¦ï¼æéå¾
+ã¡ã®ããã®ã¿ã¤ã ã¤ãã³ãã
+ *  ã­ãã¯ãç»é²ããã¦ããã°ï¼ãããç»é²è§£é¤ããï¼
+ */
+Inline void
+wait_dequeue_tmevtb(TCB *p_tcb)
+{
+	if (p_tcb->p_winfo->p_tmevtb != NULL) {
+		tmevtb_dequeue(p_tcb->p_winfo->p_tmevtb);
+	}
+}
+
+/*
+ *  å¾
+ã¡è§£é¤
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®å¾
+ã¡ç¶æ
+ãè§£é¤ããï¼å
+·ä½çã«ã¯ï¼ã¿ã¤ã ã¤
+ *  ãã³ããã­ãã¯ãç»é²ããã¦ããã°ï¼ãããç»é²è§£é¤ããï¼ã¾ãï¼ã¿ã¹ã¯
+ *  ç¶æ
+ãæ´æ°ãï¼å¾
+ã¡è§£é¤ããã¿ã¹ã¯ããã®è¿å¤ãE_OKã¨ããï¼å¾
+ã¡ã­ã¥ã¼
+ *  ããã®åé¤ã¯è¡ããªãï¼
+ */
+extern void	wait_complete(TCB *p_tcb);
+
+/*
+ *  ã¿ã¤ã ã¢ã¦ãã«ä¼´ãå¾
+ã¡è§£é¤
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãï¼å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ããã°å¾
+ã¡ã­ã¥ã¼
+ *  ããåé¤ãï¼ã¿ã¹ã¯ç¶æ
+ãæ´æ°ããï¼ã¾ãï¼å¾
+ã¡è§£é¤ããã¿ã¹ã¯ããã®è¿
+ *  å¤ãï¼wait_tmoutã§ã¯E_TMOUTï¼wait_tmout_okã§ã¯E_OKã¨ããï¼
+ *
+ *  wait_tmout_okã¯ï¼dly_tskã§ä½¿ãããã®ãã®ã§ï¼å¾
+ã¡ã­ã¥ã¼ããåé¤ãã
+ *  å¦çãè¡ããªãï¼
+ *
+ *  ãããã®é¢æ°ãï¼ã¿ã¤ã ã¤ãã³ãã®ã³ã¼ã«ããã¯é¢æ°ã¨ãã¦ç¨ããããã®
+ *  ãã®ã§ï¼å²è¾¼ã¿ãã³ãã©ããå¼ã³åºããããã¨ãæ³å®ãã¦ããï¼
+ */
+extern void	wait_tmout(TCB *p_tcb);
+extern void	wait_tmout_ok(TCB *p_tcb);
+
+/*
+ *  å¾
+ã¡ã­ã¥ã¼ã®å
+é ­ã®ã¿ã¹ã¯ID
+ *
+ *  p_wait_queueã§æå®ããå¾
+ã¡ã­ã¥ã¼ã®å
+é ­ã®ã¿ã¹ã¯IDãè¿ãï¼å¾
+ã¡ã­ã¥ã¼
+ *  ãç©ºã®å ´åã«ã¯ï¼TSK_NONEãè¿ãï¼
+ */
+Inline ID
+wait_tskid(QUEUE *p_wait_queue)
+{
+	if (!queue_empty(p_wait_queue)) {
+		return(TSKID((TCB *) p_wait_queue->p_next));
+	}
+	else {
+		return(TSK_NONE);
+	}
+}
+
+/*
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åæä½ã«ã¼ãã³
+ *
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã¨ç®¡çãã­ãã¯ã®å
+é ­é¨åã¯å
+±
+ *  éã«ãªã£ã¦ããï¼ä»¥ä¸ã¯ï¼ãã®å
+±éé¨åãæ±ãããã®åããã³ã«ã¼ãã³ç¾¤
+ *  ã§ããï¼
+ *
+ *  è¤æ°ã®å¾
+ã¡ã­ã¥ã¼ãæã¤åæã»éä¿¡ãªãã¸ã§ã¯ãã®å ´åï¼å
+é ­ä»¥å¤ã®å¾
+ã¡
+ *  ã­ã¥ã¼ãæä½ããå ´åã«ã¯ï¼ãããã®ã«ã¼ãã³ã¯ä½¿ããªãï¼ã¾ãï¼ãªãã¸ã§
+ *  ã¯ãå±æ§ã®TA_TPRIããããåç
+§ããã®ã§ï¼ãã®ããããä»ã®ç®çã«ä½¿ã£ã¦
+ *  ããå ´åãï¼ãããã®ã«ã¼ãã³ã¯ä½¿ããªãï¼
+ */
+
+/*
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ */
+typedef struct wait_object_initialization_block {
+	ATR			wobjatr;		/* ãªãã¸ã§ã¯ãå±æ§ */
+} WOBJINIB;
+
+/*
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨å
+ */
+typedef struct wait_object_control_block {
+	QUEUE		wait_queue;		/* å¾
+ã¡ã­ã¥ã¼ */
+	const WOBJINIB *p_wobjinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+} WOBJCB;
+
+/*
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *
+ *  ãã®æ§é ä½ã¯ï¼å¾
+ã¡æ
+å ±ãã­ãã¯ï¼WINFOï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨
+ *  èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ãããï¼WINFOãå
+±ç¨ä½ã§å®ç¾©ããã¦ããã
+ *  ãã«ï¼1ã¤ã®ãã£ã¼ã«ãã¨ãã¦å«ãã¦ããï¼
+ */
+typedef struct wait_object_waiting_information {
+	WINFO	winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	WOBJCB	*p_wobjcb;		/* å¾
+ã¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ */
+} WINFO_WOBJ;
+
+/*
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã¸ã®é·ç§»
+ *  
+ *  å®è¡ä¸­ã®ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã«é·ç§»ããï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼
+ *  ã«ã¤ãªãï¼ã¾ãï¼å¾
+ã¡æ
+å ±ãã­ãã¯ï¼WINFOï¼ã®p_wobjcbãè¨­å®ããï¼
+ *  wobj_make_wait_tmoutã¯ï¼ã¿ã¤ã ã¤ãã³ããã­ãã¯ã®ç»é²ãè¡ãï¼
+ */
+extern void	wobj_make_wait(WOBJCB *p_wobjcb, WINFO_WOBJ *p_winfo);
+extern void	wobj_make_wait_tmout(WOBJCB *p_wobjcb, WINFO_WOBJ *p_winfo,
+											TMEVTB *p_tmevtb, TMO tmout);
+
+/*
+ *  ã¿ã¹ã¯åªå
+åº¦å¤æ´æã®å¦ç
+ *
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã«ããã¿ã¹ã¯ã®åªå
+åº¦ãå¤æ´ã
+ *  ããå ´åã«ï¼å¾
+ã¡ã­ã¥ã¼ã®ä¸­ã§ã®ã¿ã¹ã¯ã®ä½ç½®ãä¿®æ­£ããï¼
+ */
+Inline void
+wobj_change_priority(WOBJCB *p_wobjcb, TCB *p_tcb)
+{
+	if ((p_wobjcb->p_wobjinib->wobjatr & TA_TPRI) != 0U) {
+		queue_delete(&(p_tcb->task_queue));
+		queue_insert_tpri(&(p_wobjcb->wait_queue), p_tcb);
+	}
+}
+
+/*
+ *  å¾
+ã¡ã­ã¥ã¼ã®åæå
+ *
+ *  å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ããã¿ã¹ã¯ããã¹ã¦å¾
+ã¡è§£é¤ããï¼å¾
+ã¡è§£é¤ãã
+ *  ã¿ã¹ã¯ããã®è¿å¤ã¯ï¼E_DLTã¨ããï¼
+ */
+extern void	init_wait_queue(QUEUE *p_wait_queue);
+
+#endif /* TOPPERS_WAIT_H */
Index: asp3_wo_tecs/trunk/extension/messagebuf/test/bit_kernel.c
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/test/bit_kernel.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/test/bit_kernel.c	(revision 302)
@@ -0,0 +1,509 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: bit_kernel.c 53 2014-04-26 18:58:00Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®æ´åæ§æ¤æ»
+ */
+
+#include "kernel/kernel_impl.h"
+#include "kernel/task.h"
+#include "kernel/wait.h"
+#include "kernel/semaphore.h"
+#include "kernel/eventflag.h"
+#include "kernel/dataqueue.h"
+#include "kernel/pridataq.h"
+#include "kernel/mutex.h"
+#include "kernel/messagebuf.h"
+#include "kernel/mempfix.h"
+#include "kernel/time_event.h"
+
+/*
+ *   ã¨ã©ã¼ã³ã¼ãã®å®ç¾©
+ */
+#define E_SYS_LINENO	ERCD(E_SYS, -(__LINE__))
+
+/*
+ *  ç®¡çãã­ãã¯ã®ã¢ãã¬ã¹ã®æ­£å½æ§ã®ãã§ãã¯
+ */
+#define VALID_TCB(p_tcb) \
+		((((char *) p_tcb) - ((char *) tcb_table)) % sizeof(TCB) == 0 \
+			&& TMIN_TSKID <= TSKID(p_tcb) && TSKID(p_tcb) <= tmax_tskid)
+
+#define VALID_SEMCB(p_semcb) \
+		((((char *) p_semcb) - ((char *) semcb_table)) % sizeof(SEMCB) == 0 \
+			&& TMIN_SEMID <= SEMID(p_semcb) && SEMID(p_semcb) <= tmax_semid)
+				
+#define VALID_FLGCB(p_flgcb) \
+		((((char *) p_flgcb) - ((char *) flgcb_table)) % sizeof(FLGCB) == 0 \
+			&& TMIN_FLGID <= FLGID(p_flgcb) && FLGID(p_flgcb) <= tmax_flgid)
+
+#define VALID_DTQCB(p_dtqcb) \
+		((((char *) p_dtqcb) - ((char *) dtqcb_table)) % sizeof(DTQCB) == 0 \
+			&& TMIN_DTQID <= DTQID(p_dtqcb) && DTQID(p_dtqcb) <= tmax_dtqid)
+
+#define VALID_PDQCB(p_pdqcb) \
+		((((char *) p_pdqcb) - ((char *) pdqcb_table)) % sizeof(PDQCB) == 0 \
+			&& TMIN_PDQID <= PDQID(p_pdqcb) && PDQID(p_pdqcb) <= tmax_pdqid)
+
+#define VALID_MTXCB(p_mtxcb) \
+		((((char *) p_mtxcb) - ((char *) mtxcb_table)) % sizeof(MTXCB) == 0 \
+			&& TMIN_MTXID <= MTXID(p_mtxcb) && MTXID(p_mtxcb) <= tmax_mtxid)
+
+#define VALID_MBFCB(p_mbfcb) \
+		((((char *) p_mbfcb) - ((char *) mbfcb_table)) % sizeof(MBFCB) == 0 \
+			&& TMIN_MBFID <= MBFID(p_mbfcb) && MBFID(p_mbfcb) <= tmax_mbfid)
+
+#define VALID_MPFCB(p_mpfcb) \
+		((((char *) p_mpfcb) - ((char *) mpfcb_table)) % sizeof(MPFCB) == 0 \
+			&& TMIN_MPFID <= MPFID(p_mpfcb) && MPFID(p_mpfcb) <= tmax_mpfid)
+
+/*
+ *  ã­ã¥ã¼ã®ãã§ãã¯ã®ããã®é¢æ°
+ *
+ *  p_queueã«p_entryãå«ã¾ãã¦ããããèª¿ã¹ãï¼å«ã¾ãã¦ããã°trueï¼å«ã¾
+ *  ãã¦ããªãå ´åã«ã¯falseãè¿ãï¼ããã«ãªã³ã¯ã®ä¸æ´åã®å ´åã«ãï¼
+ *  falseãè¿ãï¼
+ */
+static bool_t
+in_queue(QUEUE *p_queue, QUEUE *p_entry)
+{
+	QUEUE	*p_current, *p_next;
+
+	p_current = p_queue->p_next;
+	if (p_current->p_prev != p_queue) {
+		return(false);					/* ããã«ãªã³ã¯ã®ä¸æ´å */
+	}
+	while (p_current != p_queue) {
+		if (p_current == p_entry) {
+			return(true);				/* p_entryãå«ã¾ãã¦ãã */
+		}
+
+		/*
+		 *  ã­ã¥ã¼ã®æ¬¡ã®è¦ç´ ã«é²ã
+		 */
+		p_next = p_current->p_next;
+		if (p_next->p_prev != p_current) {
+			return(false);				 /* ããã«ãªã³ã¯ã®ä¸æ´å */
+		}
+		p_current = p_next;
+	}
+	return(false);
+}
+
+/*
+ *  ã¹ã¿ãã¯ä¸ãæãã¦ãããã®æ¤æ»
+ */
+static bool_t
+on_stack(void *addr, const TINIB *p_tinib)
+{
+	if (p_tinib->stk <= addr
+				&& addr < (void *)((char *)(p_tinib->stk) + p_tinib->stksz)) {
+		return(true);
+	}
+	return(false);
+}
+
+/*
+ *  ã¿ã¹ã¯æ¯ã®æ´åæ§æ¤æ»
+ */
+static ER
+bit_task(ID tskid)
+{
+	TCB			*p_tcb;
+	const TINIB	*p_tinib;
+	uint_t		tstat, pri;
+	TMEVTB		*p_tmevtb;
+	SEMCB		*p_semcb;
+	FLGCB		*p_flgcb;
+	DTQCB		*p_dtqcb;
+	PDQCB		*p_pdqcb;
+	MTXCB		*p_mtxcb;
+	MBFCB		*p_mbfcb;
+	MPFCB		*p_mpfcb;
+
+	if (!(TMIN_TSKID <= (tskid) && (tskid) <= tmax_tskid)) {
+		return(E_ID);
+	}
+	p_tcb = get_tcb(tskid);
+	p_tinib = p_tcb->p_tinib;
+	tstat = p_tcb->tstat;
+	pri = p_tcb->priority;
+
+	/*
+	 *  åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ã®æ¤æ»
+	 */
+	if (p_tinib != &(tinib_table[INDEX_TSK(tskid)])) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  tstatã®æ¤æ»
+	 */
+	if (TSTAT_DORMANT(tstat)) {
+		if (tstat != TS_DORMANT) {
+			return(E_SYS_LINENO);
+		}
+	}
+	else if (TSTAT_WAITING(tstat)) {
+		if ((tstat & ~(TS_WAITING_MASK | TS_SUSPENDED)) != 0U) {
+			return(E_SYS_LINENO);
+		}
+	}
+	else if (TSTAT_SUSPENDED(tstat)) {
+		if (tstat != TS_SUSPENDED) {
+			return(E_SYS_LINENO);
+		}
+	}
+	else {
+		if (tstat != TS_RUNNABLE) {
+			return(E_SYS_LINENO);
+		}
+	}
+
+	/*
+	 *  actqueã®æ¤æ»
+	 */
+	if (TSTAT_DORMANT(tstat) && p_tcb->actque) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  ã¿ã¹ã¯åªå
+åº¦ã®æ¤æ»
+	 */
+	if (pri >= TNUM_TPRI) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  rasterã¨ä»ã®ç¶æ
+ã®æ´åæ§ã®æ¤æ»
+	 */
+	if (p_tcb->raster && (p_tcb->enater || TSTAT_WAITING(tstat))) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  ä¼æ­¢ç¶æ
+ã«ããããã§ãã¯
+	 */
+	if (TSTAT_DORMANT(tstat)) {
+		if (!(pri == p_tinib->ipriority)
+					&& (p_tcb->wupque == false)
+					&& (p_tcb->raster == false)
+					&& (p_tcb->enater == true)) {
+			return(E_SYS_LINENO);
+		}
+	}
+
+	/*
+	 *  å®è¡ã§ããç¶æ
+ã«ããããã§ãã¯
+	 */
+	if (TSTAT_RUNNABLE(tstat)) {
+		if (!in_queue(&ready_queue[pri], &(p_tcb->task_queue))) {
+			return(E_SYS_LINENO);
+		}
+	}
+
+	/*
+	 *  å¾
+ã¡ç¶æ
+ã«ããããã§ãã¯
+	 */
+	if (TSTAT_WAITING(tstat)) {
+		if (!on_stack(p_tcb->p_winfo, p_tinib)) {
+			return(E_SYS_LINENO);
+		}
+		p_tmevtb = p_tcb->p_winfo->p_tmevtb;
+		if (p_tmevtb != NULL) {
+			if (!on_stack(p_tmevtb, p_tinib)) {
+				return(E_SYS_LINENO);
+			}
+			/*
+			 *  (*p_tmevtb)ã®æ¤æ»ï¼æªå®æï¼
+			 */
+		}
+
+		switch (tstat & TS_WAITING_MASK) {
+		case TS_WAITING_SLP:
+			if (p_tcb->wupque == true) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_DLY:
+			if (p_tmevtb == NULL) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_SEM:
+			p_semcb = ((WINFO_SEM *)(p_tcb->p_winfo))->p_semcb;
+			if (!VALID_SEMCB(p_semcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_semcb->wait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_FLG:
+			p_flgcb = ((WINFO_FLG *)(p_tcb->p_winfo))->p_flgcb;
+			if (!VALID_FLGCB(p_flgcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_flgcb->wait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_SDTQ:
+			p_dtqcb = ((WINFO_SDTQ *)(p_tcb->p_winfo))->p_dtqcb;
+			if (!VALID_DTQCB(p_dtqcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_dtqcb->swait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_RDTQ:
+			p_dtqcb = ((WINFO_RDTQ *)(p_tcb->p_winfo))->p_dtqcb;
+			if (!VALID_DTQCB(p_dtqcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_dtqcb->rwait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_SPDQ:
+			p_pdqcb = ((WINFO_SPDQ *)(p_tcb->p_winfo))->p_pdqcb;
+			if (!VALID_PDQCB(p_pdqcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_pdqcb->swait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_RPDQ:
+			p_pdqcb = ((WINFO_RPDQ *)(p_tcb->p_winfo))->p_pdqcb;
+			if (!VALID_PDQCB(p_pdqcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_pdqcb->rwait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_MTX:
+			p_mtxcb = ((WINFO_MTX *)(p_tcb->p_winfo))->p_mtxcb;
+			if (!VALID_MTXCB(p_mtxcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_mtxcb->wait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_SMBF:
+			p_mbfcb = ((WINFO_SMBF *)(p_tcb->p_winfo))->p_mbfcb;
+			if (!VALID_MBFCB(p_mbfcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_mbfcb->swait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_RMBF:
+			p_mbfcb = ((WINFO_RMBF *)(p_tcb->p_winfo))->p_mbfcb;
+			if (!VALID_MBFCB(p_mbfcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_mbfcb->rwait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_MPF:
+			p_mpfcb = ((WINFO_MPF *)(p_tcb->p_winfo))->p_mpfcb;
+			if (!VALID_MPFCB(p_mpfcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_mpfcb->wait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		default:
+			return(E_SYS_LINENO);
+			break;
+		}
+	}
+
+	/*
+	 *  tskctxbã®æ¤æ»
+	 */
+	if (!TSTAT_DORMANT(tstat) && p_tcb != p_runtsk) {
+		/*
+		 *  ã¿ã¼ã²ããä¾å­ã®æ¤æ»
+		 */
+#if 0
+		if (bit_tskctxb(&(p_tcb->tskctxb))) {
+			return(E_SYS_LINENO);
+		}
+#endif
+	}
+	return(E_OK);
+}
+
+/*
+ *  ã»ããã©æ¯ã®æ´åæ§æ¤æ»
+ */
+#define INDEX_SEM(semid)	((uint_t)((semid) - TMIN_SEMID))
+#define get_semcb(semid)	(&(semcb_table[INDEX_SEM(semid)]))
+
+static ER
+bit_semaphore(ID semid)
+{
+	SEMCB			*p_semcb;
+	const SEMINIB	*p_seminib;
+	uint_t			semcnt;
+	QUEUE			*p_queue;
+	TCB				*p_tcb;
+
+	if (!(TMIN_SEMID <= (semid) && (semid) <= tmax_semid)) {
+		return(E_ID);
+	}
+	p_semcb = get_semcb(semid);
+	p_seminib = p_semcb->p_seminib;
+	semcnt = p_semcb->semcnt;
+
+	/*
+	 *  åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ã®æ¤æ»
+	 */
+	if (p_seminib != &(seminib_table[INDEX_SEM(semid)])) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  semcntã®æ¤æ»
+	 */
+	if (semcnt > p_seminib->maxsem) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  wait_queueã®æ¤æ»
+	 */
+	if (semcnt == 0) {
+		p_queue = p_semcb->wait_queue.p_next;
+		while (p_queue != &(p_semcb->wait_queue)) {
+			p_tcb = (TCB *) p_queue;
+			p_queue = p_queue->p_next;
+			if (!VALID_TCB(p_tcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (p_tcb->tstat != TS_WAITING_SEM) {
+				return(E_SYS_LINENO);
+			}
+			if (p_semcb != ((WINFO_SEM *)(p_tcb->p_winfo))->p_semcb) {
+				return(E_SYS_LINENO);
+			}
+		}
+	}
+	else {
+		if (!queue_empty(&(p_semcb->wait_queue))) {
+			return(E_SYS_LINENO);
+		}
+	}
+	return(E_OK);
+}
+
+/*
+ *  æ´åæ§æ¤æ»ã«ã¼ãã³æ¬ä½
+ */
+ER
+bit_kernel(void)
+{
+	ID		tskid;
+	ID		semid;
+	ER		ercd;
+
+	/*
+	 *  ã¿ã¹ã¯æ¯ã®æ¤æ»
+	 */
+	for (tskid = TMIN_TSKID; tskid <= tmax_tskid; tskid++) {
+		ercd = bit_task(tskid);
+		if (ercd != E_OK) {
+			return(ercd);
+		}
+	}
+
+	/*
+	 *  ã»ããã©æ¯ã®æ¤æ»
+	 */
+	for (semid = TMIN_SEMID; semid <= tmax_semid; semid++) {
+		ercd = bit_semaphore(semid);
+		if (ercd != E_OK) {
+			return(ercd);
+		}
+	}
+
+	return(E_OK);
+}
Index: asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf1.c
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf1.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf1.c	(revision 302)
@@ -0,0 +1,442 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: test_messagebuf1.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ã¡ãã»ã¼ã¸ãããã¡ã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  FIFOé ã¡ãã»ã¼ã¸ãããã¡ã«ï¼ã¡ãã»ã¼ã¸ãéä¿¡ããå¦çã¨åä¿¡ããå¦ç
+ *  ãä¸éããã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ã¡ãã»ã¼ã¸ãããã¡ã¸ã®éä¿¡å¦çï¼snd_mbfï¼send_messageï¼
+ *		(A-1) åä¿¡å¾
+ã¡ã­ã¥ã¼ã®å
+é ­ã¿ã¹ã¯ãåä¿¡ï¼ã¿ã¹ã¯åæããªãï¼
+ *		(A-2) åä¿¡å¾
+ã¡ã­ã¥ã¼ã®å
+é ­ã¿ã¹ã¯ãåä¿¡ï¼ã¿ã¹ã¯åæãããï¼
+ *		(A-3) ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åã«æ ¼ç´
+ *		(A-4) éä¿¡å¾
+ã¡ã­ã¥ã¼ã«ã¿ã¹ã¯ãããããã«éä¿¡å¾
+ã¡ç¶æ
+ã«
+ *		(A-5) ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åã«ç©ºãããªãããã«éä¿¡å¾
+ã¡ç¶æ
+ã«
+ *	(B) ã¡ãã»ã¼ã¸ãããã¡ããã®åä¿¡å¦çï¼rcv_mbfï¼receive_messageï¼
+ *		(B-1) ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åããåä¿¡
+ *		(B-2) (B-1)ï¼éä¿¡å¾
+ã¡ã¿ã¹ã¯ï¼1ã¤ã¾ãã¯è¤æ°ï¼ãå¾
+ã¡è§£é¤ï¼ã¿ã¹ã¯
+ *			  åæããªãï¼
+ *		(B-3) (B-1)ï¼éä¿¡å¾
+ã¡ã¿ã¹ã¯ï¼1ã¤ã¾ãã¯è¤æ°ï¼ãå¾
+ã¡è§£é¤ï¼ã¿ã¹ã¯
+ *			  åæãããï¼
+ *		(B-4) éä¿¡å¾
+ã¡ã­ã¥ã¼ã®å
+é ­ã®ã¿ã¹ã¯ã®ã¡ãã»ã¼ã¸ãåä¿¡ï¼ã¿ã¹ã¯å
+ *			  æããªãï¼
+ *		(B-5) éä¿¡å¾
+ã¡ã­ã¥ã¼ã®å
+é ­ã®ã¿ã¹ã¯ã®ã¡ãã»ã¼ã¸ãåä¿¡ï¼ã¿ã¹ã¯å
+ *			  æãããï¼
+ *		(B-6) åä¿¡å¾
+ã¡ç¶æ
+ã«
+ *	(C) ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åã¸ã®ã¡ãã»ã¼ã¸ã®æ ¼ç´ï¼enqueue_messageï¼
+ *		(C-1) ãµã¤ãºã¨ã¡ãã»ã¼ã¸æ¬ä½ãä¸é£ã®é åã«æ ¼ç´
+ *		(C-2) ãµã¤ãºãæ ¼ç´å¾ã«ç®¡çé åã®å
+é ­ã«æ»ã
+ *		(C-3) ã¡ãã»ã¼ã¸æ¬ä½ã®æ ¼ç´éä¸­ã§ç®¡çé åã®å
+é ­ã«æ»ã
+ *		(C-4) ã¡ãã»ã¼ã¸æ¬ä½ã®æ ¼ç´å¾ã«ç®¡çé åã®å
+é ­ã«æ»ã
+ *	(D) ã¡ãã»ã¼ã¸ãããã¡ç®¡çé åããã®ã¡ãã»ã¼ã¸ã®ååºãï¼dequeue_messageï¼
+ *		(D-1) ãµã¤ãºã¨ã¡ãã»ã¼ã¸æ¬ä½ãä¸é£ã®é åããååºã
+ *		(D-2) ãµã¤ãºãååºãå¾ã«ç®¡çé åã®å
+é ­ã«æ»ã
+ *		(D-3) ã¡ãã»ã¼ã¸æ¬ä½ã®ååºãéä¸­ã§ç®¡çé åã®å
+é ­ã«æ»ã
+ *		(D-4) ã¡ãã»ã¼ã¸æ¬ä½ã®ååºãå¾ã«ç®¡çé åã®å
+é ­ã«æ»ã
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: é«åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	MBF1: ã¡ãã»ã¼ã¸ãããã¡ï¼TA_NULLå±æ§ï¼æå¤§ã¡ãã»ã¼ã¸ãµã¤ãºï¼26ï¼ã¡ã
+ *		  ã»ã¼ã¸ãããã¡ç®¡çé åã®ãµã¤ãºï¼26âå®éã«ã¯28ï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼é«ï¼==
+ *		call(set_bit_func(bit_kernel))
+ *	1:	act_tsk(TASK2)
+ *		act_tsk(TASK3)
+ *		ref_mbf(MBF1, &rmbf)
+ *		assert(rmbf.stskid == TSK_NONE)
+ *		assert(rmbf.rtskid == TSK_NONE)
+ *		assert(rmbf.smbfcnt == 0)
+ *		snd_mbf(MBF1, string1, 9)		... (A-3)(C-1)ï¼ä½¿ç¨ï¼0ã15
+ *	2:	snd_mbf(MBF1, string2, 5)		... (A-3)(C-4)ï¼ä½¿ç¨ï¼0ã27
+ *	3:	snd_mbf(MBF1, string3, 4)		... (A-5)
+ *	== TASK2ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	4:	ref_mbf(MBF1, &rmbf)
+ *		assert(rmbf.stskid == TASK1)
+ *		assert(rmbf.rtskid == TSK_NONE)
+ *		assert(rmbf.smbfcnt == 2)
+ *	5:	snd_mbf(MBF1, string1, 4)		... (A-4)
+ *	== TASK3ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	6:	rcv_mbf(MBF1, buf1) -> 9		... (B-3)(D-1)(C-1)ï¼ä½¿ç¨ï¼16ã27,0ã15
+ *	== TASK1ï¼ç¶ãï¼==
+ *	7:	assert(strncmp(buf1, string1, 9) == 0)
+ *		slp_tsk()
+ *	== TASK2ï¼ç¶ãï¼==
+ *	8:	rcv_mbf(MBF1, buf1) -> 5		... (B-1)(D-4)ï¼ä½¿ç¨ï¼0ã15
+ *		assert(strncmp(buf1, string2, 5) == 0)
+ *		rcv_mbf(MBF1, buf1) -> 4		... (B-1)(D-1)ï¼ä½¿ç¨ï¼8ã15
+ *		assert(strncmp(buf1, string3, 4) == 0)
+ *		rcv_mbf(MBF1, buf1) -> 4		... (B-1)(D-1)ï¼ä½¿ç¨ï¼ãªã
+ *		assert(strncmp(buf1, string1, 4) == 0)
+ *	9:	rcv_mbf(MBF1, buf1) -> 10		... (B-6)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	10:	ref_mbf(MBF1, &rmbf)
+ *		assert(rmbf.stskid == TSK_NONE)
+ *		assert(rmbf.rtskid == TASK2)
+ *		assert(rmbf.smbfcnt == 0)
+ *	11:	snd_mbf(MBF1, string2, 10)		... (A-2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	12:	assert(strncmp(buf1, string2, 10) == 0)
+ *		rcv_mbf(MBF1, buf1) -> 11		... (B-6)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	13:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	14:	snd_mbf(MBF1, string3, 11)		... (A-1)
+ *		assert(strncmp(buf1, string3, 11) == 0)
+ *		snd_mbf(MBF1, string1, 16)		... (A-3)(C-3)ï¼ä½¿ç¨ï¼16ã27,0ã7
+ *		tslp_tsk(1000U) -> E_TMOUT
+ *	== TASK2ï¼ç¶ãï¼==
+ *	15:	slp_tsk()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	16:	snd_mbf(MBF1, string2, 12)		... (A-5)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	17:	wup_tsk(TASK2)
+ *		tslp_tsk(1000U) -> E_TMOUT
+ *	== TASK2ï¼ç¶ãï¼==
+ *	18:	snd_mbf(MBF1, string3, 4)		... (A-4)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	19:	rcv_mbf(MBF1, buf1) -> 16		... (B-2)(D-3)(C-1)(C-2)ï¼
+ *										... 				ä½¿ç¨ï¼8ã27,0ã3
+ *		assert(strncmp(buf1, string1, 16) == 0)
+ *		slp_tsk()
+ *	== TASK2ï¼ç¶ãï¼==
+ *	20:	rcv_mbf(MBF1, buf1) -> 12		... (B-1)(D-1)ï¼ä½¿ç¨ï¼24ã27ï¼0ã3
+ *		assert(strncmp(buf1, string2, 12) == 0)
+ *	21:	snd_mbf(MBF1, string1, 25)		... (A-5)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	22:	rcv_mbf(MBF1, buf1) -> 4		... (B-1)(D-2)ï¼ä½¿ç¨ï¼ãªã
+ *		assert(strncmp(buf1, string3, 4) == 0)
+ *		rcv_mbf(MBF1, buf1) -> 25		... (B-5)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	23:	assert(strncmp(buf1, string1, 25) == 0)
+ *		snd_mbf(MBF1, string2, 26)		... (A-5)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	24:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	25:	rcv_mbf(MBF1, buf1) -> 26		... (B-4)
+ *		assert(strncmp(buf1, string2, 26) == 0)
+ *		slp_tsk()
+ *	== TASK2ï¼ç¶ãï¼==
+ *	26:	slp_tsk()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	27:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_messagebuf1.h"
+#include <string.h>
+
+const char string1[26] = "abcdefghijklmnopqrstuvwxyz";
+const char string2[26] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+const char string3[16] = "0123456789abcdef";
+
+char buf1[26];
+
+extern ER	bit_kernel(void);
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RMBF	rmbf;
+
+	test_start(__FILE__);
+
+	set_bit_func(bit_kernel);
+
+	check_point(1);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_mbf(MBF1, &rmbf);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmbf.stskid == TSK_NONE);
+
+	check_assert(rmbf.rtskid == TSK_NONE);
+
+	check_assert(rmbf.smbfcnt == 0);
+
+	ercd = snd_mbf(MBF1, string1, 9);
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	ercd = snd_mbf(MBF1, string2, 5);
+	check_ercd(ercd, E_OK);
+
+	check_point(3);
+	ercd = snd_mbf(MBF1, string3, 4);
+	check_ercd(ercd, E_OK);
+
+	check_point(7);
+	check_assert(strncmp(buf1, string1, 9) == 0);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = snd_mbf(MBF1, string3, 11);
+	check_ercd(ercd, E_OK);
+
+	check_assert(strncmp(buf1, string3, 11) == 0);
+
+	ercd = snd_mbf(MBF1, string1, 16);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(1000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(17);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(1000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(19);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 16);
+
+	check_assert(strncmp(buf1, string1, 16) == 0);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 26);
+
+	check_assert(strncmp(buf1, string2, 26) == 0);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RMBF	rmbf;
+
+	check_point(4);
+	ercd = ref_mbf(MBF1, &rmbf);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmbf.stskid == TASK1);
+
+	check_assert(rmbf.rtskid == TSK_NONE);
+
+	check_assert(rmbf.smbfcnt == 2);
+
+	check_point(5);
+	ercd = snd_mbf(MBF1, string1, 4);
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 5);
+
+	check_assert(strncmp(buf1, string2, 5) == 0);
+
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 4);
+
+	check_assert(strncmp(buf1, string3, 4) == 0);
+
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 4);
+
+	check_assert(strncmp(buf1, string1, 4) == 0);
+
+	check_point(9);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 10);
+
+	check_point(12);
+	check_assert(strncmp(buf1, string2, 10) == 0);
+
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 11);
+
+	check_point(15);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(18);
+	ercd = snd_mbf(MBF1, string3, 4);
+	check_ercd(ercd, E_OK);
+
+	check_point(20);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 12);
+
+	check_assert(strncmp(buf1, string2, 12) == 0);
+
+	check_point(21);
+	ercd = snd_mbf(MBF1, string1, 25);
+	check_ercd(ercd, E_OK);
+
+	check_point(23);
+	check_assert(strncmp(buf1, string1, 25) == 0);
+
+	ercd = snd_mbf(MBF1, string2, 26);
+	check_ercd(ercd, E_OK);
+
+	check_point(26);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RMBF	rmbf;
+
+	check_point(6);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 9);
+
+	check_point(10);
+	ercd = ref_mbf(MBF1, &rmbf);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmbf.stskid == TSK_NONE);
+
+	check_assert(rmbf.rtskid == TASK2);
+
+	check_assert(rmbf.smbfcnt == 0);
+
+	check_point(11);
+	ercd = snd_mbf(MBF1, string2, 10);
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(16);
+	ercd = snd_mbf(MBF1, string2, 12);
+	check_ercd(ercd, E_OK);
+
+	check_point(22);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 4);
+
+	check_assert(strncmp(buf1, string3, 4) == 0);
+
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 25);
+
+	check_point(24);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_finish(27);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf1.cfg
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf1.cfg	(revision 302)
@@ -0,0 +1,16 @@
+/*
+ *		ã¡ãã»ã¼ã¸ãããã¡ã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: test_messagebuf1.cfg 263 2014-10-05 13:30:34Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_messagebuf1.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_MBF(MBF1, { TA_NULL, 26, 26, NULL });
Index: asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf1.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf1.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf1.h	(revision 302)
@@ -0,0 +1,91 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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_messagebuf1.h 2 2014-01-11 03:50:35Z ertl-hiro $
+ */
+
+/* 
+ *		ã¡ãã»ã¼ã¸ãããã¡ã®ãã¹ã(1)
+ */
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#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);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf2.c
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf2.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf2.c	(revision 302)
@@ -0,0 +1,743 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: test_messagebuf2.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ã¡ãã»ã¼ã¸ãããã¡ã®ãã¹ã(2)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  FIFOé ã¡ãã»ã¼ã¸ãããã¡ã®éä¿¡å¾
+ã¡ã¿ã¹ã¯ãï¼å¼·å¶çã«å¾
+ã¡è§£é¤ããã
+ *  å ´åãä¸éããã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) éä¿¡å¾
+ã¡ã¿ã¹ã¯ãå¼·å¶çµäºï¼ter_tskï¼
+ *		(A-1) éä¿¡å¾
+ã¡ã¿ã¹ã¯ã®å¾
+ã¡è§£é¤ãªã
+ *		(A-2) éä¿¡å¾
+ã¡ã¿ã¹ã¯ï¼1ã¤ã¾ãã¯è¤æ°ï¼ãå¾
+ã¡è§£é¤ï¼ã¿ã¹ã¯åæããªãï¼
+ *		(A-3) éä¿¡å¾
+ã¡ã¿ã¹ã¯ï¼1ã¤ã¾ãã¯è¤æ°ï¼ãå¾
+ã¡è§£é¤ï¼ã¿ã¹ã¯åæãããï¼
+ *	(B) éä¿¡å¾
+ã¡ã¿ã¹ã¯ãå¼·å¶å¾
+ã¡è§£é¤ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®rel_waiï¼
+ *		(B-1) éä¿¡å¾
+ã¡ã¿ã¹ã¯ã®å¾
+ã¡è§£é¤ãªã
+ *		(B-2) éä¿¡å¾
+ã¡ã¿ã¹ã¯ï¼1ã¤ã¾ãã¯è¤æ°ï¼ãå¾
+ã¡è§£é¤ï¼ã¿ã¹ã¯åæããªãï¼
+ *		(B-3) éä¿¡å¾
+ã¡ã¿ã¹ã¯ï¼1ã¤ã¾ãã¯è¤æ°ï¼ãå¾
+ã¡è§£é¤ï¼ã¿ã¹ã¯åæãããï¼
+ *	(C) éä¿¡å¾
+ã¡ã¿ã¹ã¯ãå¼·å¶å¾
+ã¡è§£é¤ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®rel_waiï¼
+ *		(C-1) éä¿¡å¾
+ã¡ã¿ã¹ã¯ã®å¾
+ã¡è§£é¤ãªã
+ *		(C-2) éä¿¡å¾
+ã¡ã¿ã¹ã¯ï¼1ã¤ã¾ãã¯è¤æ°ï¼ãå¾
+ã¡è§£é¤ï¼ã¿ã¹ã¯åæããªãï¼
+ *		(C-3) éä¿¡å¾
+ã¡ã¿ã¹ã¯ï¼1ã¤ã¾ãã¯è¤æ°ï¼ãå¾
+ã¡è§£é¤ï¼ã¿ã¹ã¯åæãããï¼
+ *	(D) éä¿¡å¾
+ã¡ã¿ã¹ã¯ãã¿ã¤ã ã¢ã¦ãã§å¾
+ã¡è§£é¤
+ *		(D-1) éä¿¡å¾
+ã¡ã¿ã¹ã¯ã®å¾
+ã¡è§£é¤ãªã
+ *		(D-2) éä¿¡å¾
+ã¡ã¿ã¹ã¯ï¼1ã¤ã¾ãã¯è¤æ°ï¼ãå¾
+ã¡è§£é¤ï¼ã¿ã¹ã¯åæããªãï¼
+ *		(D-3) éä¿¡å¾
+ã¡ã¿ã¹ã¯ï¼1ã¤ã¾ãã¯è¤æ°ï¼ãå¾
+ã¡è§£é¤ï¼ã¿ã¹ã¯åæãããï¼
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: é«åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	MBF1: ã¡ãã»ã¼ã¸ãããã¡ï¼TA_NULLå±æ§ï¼æå¤§ã¡ãã»ã¼ã¸ãµã¤ãºï¼26ï¼ã¡ã
+ *		  ã»ã¼ã¸ãããã¡ç®¡çé åã®ãµã¤ãºï¼26âå®éã«ã¯28ï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼é«ï¼==
+ *		call(set_bit_func(bit_kernel))
+ *	1:	act_tsk(TASK2)
+ *		act_tsk(TASK3)
+ *		tslp_tsk(1000U) -> E_TMOUT
+ *	== TASK2-1ï¼åªå
+åº¦ï¼ä¸­ï¼1åã ==
+ *	2:	snd_mbf(MBF1, string1, 26)
+ *	== TASK3ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	3:	snd_mbf(MBF1, string2, 26)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	4:	ter_tsk(TASK2)									... (A-1)
+ *		tslp_tsk(1000U) -> E_TMOUT
+ *	== TASK1ï¼ç¶ãï¼==
+ *	5:	rcv_mbf(MBF1, buf1) -> 26
+ *		assert(strncmp(buf1, string2, 26) == 0)
+ *		act_tsk(TASK2)
+ *		tslp_tsk(1000U) -> E_TMOUT
+ *	== TASK2-2ï¼åªå
+åº¦ï¼ä¸­ï¼2åã ==
+ *	6:	snd_mbf(MBF1, string1, 26)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	7:	snd_mbf(MBF1, string3, 10)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	8:	ter_tsk(TASK2)									... (A-2)
+ *		slp_tsk()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	9:	rcv_mbf(MBF1, buf1) -> 10
+ *		assert(strncmp(buf1, string3, 10) == 0)
+ *	10:	act_tsk(TASK2)
+ *	== TASK2-3ï¼åªå
+åº¦ï¼ä¸­ï¼3åã ==
+ *	11:	snd_mbf(MBF1, string1, 26)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	12:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	13:	snd_mbf(MBF1, string3, 10)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	14:	ter_tsk(TASK2)									... (A-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	15:	rcv_mbf(MBF1, buf1) -> 10
+ *		assert(strncmp(buf1, string3, 10) == 0)
+ *		act_tsk(TASK2)
+ *		tslp_tsk(1000U) -> E_TMOUT
+ *	== TASK2-4ï¼åªå
+åº¦ï¼ä¸­ï¼4åã ==
+ *	16:	snd_mbf(MBF1, string1, 26) -> E_RLWAI
+ *	== TASK3ï¼ç¶ãï¼==
+ *	17:	snd_mbf(MBF1, string2, 26)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	18:	rel_wai(TASK2)									... (B-1)
+ *		tslp_tsk(1000U) -> E_TMOUT
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	19:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	20:	rcv_mbf(MBF1, buf1) -> 26
+ *		assert(strncmp(buf1, string2, 26) == 0)
+ *		wup_tsk(TASK2)
+ *		tslp_tsk(1000U) -> E_TMOUT
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	21:	snd_mbf(MBF1, string1, 26) -> E_RLWAI
+ *	== TASK3ï¼ç¶ãï¼==
+ *	22:	snd_mbf(MBF1, string3, 10)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	23:	rel_wai(TASK2)									... (B-2)
+ *		slp_tsk()
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	24:	slp_tsk()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	25:	rcv_mbf(MBF1, buf1) -> 10
+ *		assert(strncmp(buf1, string3, 10) == 0)
+ *	26:	wup_tsk(TASK2)
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	27:	snd_mbf(MBF1, string1, 26) -> E_RLWAI
+ *	== TASK3ï¼ç¶ãï¼==
+ *	28:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	29:	snd_mbf(MBF1, string3, 10)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	30:	rel_wai(TASK2)									... (B-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	31:	rcv_mbf(MBF1, buf1) -> 10
+ *		assert(strncmp(buf1, string3, 10) == 0)
+ *		tslp_tsk(1000U) -> E_TMOUT
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	32:	snd_mbf(MBF1, string1, 26) -> E_RLWAI
+ *	== TASK3ï¼ç¶ãï¼==
+ *	33:	snd_mbf(MBF1, string2, 26)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	34:	sta_alm(ALM1, 1000U)
+ *		slp_tsk()
+ *	== ALM1-1 ==
+ *	35:	rel_wai(TASK2)									... (C-1)
+ *		wup_tsk(TASK1)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	36:	tslp_tsk(1000U) -> E_TMOUT
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	37:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	38:	rcv_mbf(MBF1, buf1) -> 26
+ *		assert(strncmp(buf1, string2, 26) == 0)
+ *		wup_tsk(TASK2)
+ *		tslp_tsk(1000U) -> E_TMOUT
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	39:	snd_mbf(MBF1, string1, 26) -> E_RLWAI
+ *	== TASK3ï¼ç¶ãï¼==
+ *	40:	snd_mbf(MBF1, string3, 10)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	41:	sta_alm(ALM1, 1000U)
+ *		slp_tsk()
+ *	== ALM1-2 ==
+ *	42:	rel_wai(TASK2)									... (C-2)
+ *		RETURN
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	43:	slp_tsk()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	44:	rcv_mbf(MBF1, buf1) -> 10
+ *		assert(strncmp(buf1, string3, 10) == 0)
+ *	45:	wup_tsk(TASK2)
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	46:	snd_mbf(MBF1, string1, 26) -> E_RLWAI
+ *	== TASK3ï¼ç¶ãï¼==
+ *	47:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	48:	snd_mbf(MBF1, string3, 10)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	49:	sta_alm(ALM1, 1000U)
+ *		slp_tsk()
+ *	== ALM1-3 ==
+ *	50:	rel_wai(TASK2)									... (C-3)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	51:	rcv_mbf(MBF1, buf1) -> 10
+ *		assert(strncmp(buf1, string3, 10) == 0)
+ *		wup_tsk(TASK3)
+ *		slp_tsk()
+ *	== TASK2-4ï¼ç¶ãï¼==
+  *	52:	tsnd_mbf(MBF1, string1, 26, 1000U) -> E_TMOUT	... (D-1)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	53:	snd_mbf(MBF1, string2, 26)
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	54:	tslp_tsk(1000U) -> E_TMOUT
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	55:	rcv_mbf(MBF1, buf1) -> 26
+ *		assert(strncmp(buf1, string2, 26) == 0)
+ *	56:	tsnd_mbf(MBF1, string1, 26, 1000U) -> E_TMOUT	... (D-2)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	57:	snd_mbf(MBF1, string3, 10)
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	58:	slp_tsk()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	59:	rcv_mbf(MBF1, buf1) -> 10
+ *		assert(strncmp(buf1, string3, 10) == 0)
+ *	60:	wup_tsk(TASK2)
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	61:	tsnd_mbf(MBF1, string1, 26, 1000U) -> E_TMOUT	... (D-3)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	62:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	63:	snd_mbf(MBF1, string3, 10)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	64:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	65:	rcv_mbf(MBF1, buf1) -> 10
+ *		assert(strncmp(buf1, string3, 10) == 0)
+ *		slp_tsk()
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	66:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_messagebuf2.h"
+#include <string.h>
+
+const char string1[26] = "abcdefghijklmnopqrstuvwxyz";
+const char string2[26] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+const char string3[16] = "0123456789abcdef";
+
+char buf1[26];
+
+extern ER	bit_kernel(void);
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+static uint_t	alarm1_count = 0;
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++alarm1_count) {
+	case 1:
+		check_point(35);
+		ercd = rel_wai(TASK2);
+		check_ercd(ercd, E_OK);
+
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(42);
+		ercd = rel_wai(TASK2);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(50);
+		ercd = rel_wai(TASK2);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	set_bit_func(bit_kernel);
+
+	check_point(1);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(1000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(4);
+	ercd = ter_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(1000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(5);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 26);
+
+	check_assert(strncmp(buf1, string2, 26) == 0);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(1000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(8);
+	ercd = ter_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	ercd = snd_mbf(MBF1, string3, 10);
+	check_ercd(ercd, E_OK);
+
+	check_point(15);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 10);
+
+	check_assert(strncmp(buf1, string3, 10) == 0);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(1000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(18);
+	ercd = rel_wai(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(1000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(20);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 26);
+
+	check_assert(strncmp(buf1, string2, 26) == 0);
+
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(1000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(23);
+	ercd = rel_wai(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(29);
+	ercd = snd_mbf(MBF1, string3, 10);
+	check_ercd(ercd, E_OK);
+
+	check_point(31);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 10);
+
+	check_assert(strncmp(buf1, string3, 10) == 0);
+
+	ercd = tslp_tsk(1000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(34);
+	ercd = sta_alm(ALM1, 1000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(36);
+	ercd = tslp_tsk(1000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(38);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 26);
+
+	check_assert(strncmp(buf1, string2, 26) == 0);
+
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(1000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(41);
+	ercd = sta_alm(ALM1, 1000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(48);
+	ercd = snd_mbf(MBF1, string3, 10);
+	check_ercd(ercd, E_OK);
+
+	check_point(51);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 10);
+
+	check_assert(strncmp(buf1, string3, 10) == 0);
+
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(63);
+	ercd = snd_mbf(MBF1, string3, 10);
+	check_ercd(ercd, E_OK);
+
+	check_point(65);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 10);
+
+	check_assert(strncmp(buf1, string3, 10) == 0);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+static uint_t	task2_count = 0;
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++task2_count) {
+	case 1:
+		check_point(2);
+		ercd = snd_mbf(MBF1, string1, 26);
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 2:
+		check_point(6);
+		ercd = snd_mbf(MBF1, string1, 26);
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 3:
+		check_point(11);
+		ercd = snd_mbf(MBF1, string1, 26);
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 4:
+		check_point(16);
+		ercd = snd_mbf(MBF1, string1, 26);
+		check_ercd(ercd, E_RLWAI);
+
+		check_point(19);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(21);
+		ercd = snd_mbf(MBF1, string1, 26);
+		check_ercd(ercd, E_RLWAI);
+
+		check_point(24);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(27);
+		ercd = snd_mbf(MBF1, string1, 26);
+		check_ercd(ercd, E_RLWAI);
+
+		check_point(32);
+		ercd = snd_mbf(MBF1, string1, 26);
+		check_ercd(ercd, E_RLWAI);
+
+		check_point(37);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(39);
+		ercd = snd_mbf(MBF1, string1, 26);
+		check_ercd(ercd, E_RLWAI);
+
+		check_point(43);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(46);
+		ercd = snd_mbf(MBF1, string1, 26);
+		check_ercd(ercd, E_RLWAI);
+
+		check_point(52);
+		ercd = tsnd_mbf(MBF1, string1, 26, 1000U);
+		check_ercd(ercd, E_TMOUT);
+
+		check_point(54);
+		ercd = tslp_tsk(1000U);
+		check_ercd(ercd, E_TMOUT);
+
+		check_point(55);
+		ercd = rcv_mbf(MBF1, buf1);
+		check_ercd(ercd, 26);
+
+		check_assert(strncmp(buf1, string2, 26) == 0);
+
+		check_point(56);
+		ercd = tsnd_mbf(MBF1, string1, 26, 1000U);
+		check_ercd(ercd, E_TMOUT);
+
+		check_point(58);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(61);
+		ercd = tsnd_mbf(MBF1, string1, 26, 1000U);
+		check_ercd(ercd, E_TMOUT);
+
+		check_finish(66);
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(3);
+	ercd = snd_mbf(MBF1, string2, 26);
+	check_ercd(ercd, E_OK);
+
+	check_point(7);
+	ercd = snd_mbf(MBF1, string3, 10);
+	check_ercd(ercd, E_OK);
+
+	check_point(9);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 10);
+
+	check_assert(strncmp(buf1, string3, 10) == 0);
+
+	check_point(10);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(12);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = ter_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(17);
+	ercd = snd_mbf(MBF1, string2, 26);
+	check_ercd(ercd, E_OK);
+
+	check_point(22);
+	ercd = snd_mbf(MBF1, string3, 10);
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 10);
+
+	check_assert(strncmp(buf1, string3, 10) == 0);
+
+	check_point(26);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(28);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(30);
+	ercd = rel_wai(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(33);
+	ercd = snd_mbf(MBF1, string2, 26);
+	check_ercd(ercd, E_OK);
+
+	check_point(40);
+	ercd = snd_mbf(MBF1, string3, 10);
+	check_ercd(ercd, E_OK);
+
+	check_point(44);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 10);
+
+	check_assert(strncmp(buf1, string3, 10) == 0);
+
+	check_point(45);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(47);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(49);
+	ercd = sta_alm(ALM1, 1000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(53);
+	ercd = snd_mbf(MBF1, string2, 26);
+	check_ercd(ercd, E_OK);
+
+	check_point(57);
+	ercd = snd_mbf(MBF1, string3, 10);
+	check_ercd(ercd, E_OK);
+
+	check_point(59);
+	ercd = rcv_mbf(MBF1, buf1);
+	check_ercd(ercd, 10);
+
+	check_assert(strncmp(buf1, string3, 10) == 0);
+
+	check_point(60);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(62);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(64);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf2.cfg
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf2.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf2.cfg	(revision 302)
@@ -0,0 +1,17 @@
+/*
+ *		ã¡ãã»ã¼ã¸ãããã¡ã®ãã¹ã(2)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: test_messagebuf2.cfg 327 2015-06-21 06:42:01Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_messagebuf2.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_MBF(MBF1, { TA_NULL, 26, 26, NULL });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
Index: asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf2.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf2.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/messagebuf/test/test_messagebuf2.h	(revision 302)
@@ -0,0 +1,93 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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_messagebuf2.h 2 2014-01-11 03:50:35Z ertl-hiro $
+ */
+
+/* 
+ *		ã¡ãã»ã¼ã¸ãããã¡ã®ãã¹ã(2)
+ */
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#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/extension/ovrhdr/include/kernel.h
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/include/kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/include/kernel.h	(revision 302)
@@ -0,0 +1,626 @@
+/*
+ *  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) 2004-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.h 463 2015-10-18 14:25:55Z ertl-hiro $
+ */
+
+/*
+ *		TOPPERS/ASPã«ã¼ãã« æ¨æºããããã¡ã¤ã«
+ *
+ *  TOPPERS/ASPã«ã¼ãã«ããµãã¼ããããµã¼ãã¹ã³ã¼ã«ã®å®£è¨ã¨ï¼å¿
+è¦ãªãã¼
+ *  ã¿åï¼å®æ°ï¼ãã¯ã­ã®å®ç¾©ãå«ãããããã¡ã¤ã«ï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ããï¼ããã«ããï¼ãã¯ã­å®ç¾©ä»¥å¤ã
+ *  é¤ãããã«ãªã£ã¦ããï¼
+ */
+
+#ifndef TOPPERS_KERNEL_H
+#define TOPPERS_KERNEL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *	TOPPERSå
+±éã®ãã¼ã¿åã»å®æ°ã»ãã¯ã­
+ */
+#include <t_stddef.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨
+ */
+#include "target_kernel.h"
+
+/*
+ *  ãµãã¼ãããæ©è½
+ */
+#ifdef TOPPERS_TARGET_SUPPORT_DIS_INT
+#define TOPPERS_SUPPORT_DIS_INT			/* dis_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_DIS_INT */
+
+#ifdef TOPPERS_TARGET_SUPPORT_ENA_INT
+#define TOPPERS_SUPPORT_ENA_INT			/* ena_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_ENA_INT */
+
+#ifdef TOPPERS_TARGET_SUPPORT_OVRHDR
+#define TOPPERS_SUPPORT_OVRHDR			/* ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µ */
+#endif /* TOPPERS_TARGET_SUPPORT_OVRHDR */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãã¼ã¿åã®å®ç¾©
+ */
+
+/*
+ *  ããããã¿ã¼ã³ããªãã¸ã§ã¯ãçªå·ã®åå®ç¾©
+ */
+typedef	uint_t		FLGPTN;		/* ã¤ãã³ããã©ã°ã®ããããã¿ã¼ã³ */
+typedef	uint_t		INTNO;		/* å²è¾¼ã¿çªå· */
+typedef	uint_t		INHNO;		/* å²è¾¼ã¿ãã³ãã©çªå· */
+typedef	uint_t		EXCNO;		/* CPUä¾å¤ãã³ãã©çªå· */
+
+/*
+ *  å¦çåä½ã®åå®ç¾©
+ */
+typedef void	(*TASK)(intptr_t exinf);
+typedef void	(*TMEHDR)(intptr_t exinf);
+typedef void	(*OVRHDR)(ID tskid, intptr_t exinf);
+typedef void	(*ISR)(intptr_t exinf);
+typedef void	(*INTHDR)(void);
+typedef void	(*EXCHDR)(void *p_excinf);
+typedef void	(*INIRTN)(intptr_t exinf);
+typedef void	(*TERRTN)(intptr_t exinf);
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®åå®ç¾©
+ */
+#ifndef TOPPERS_STK_T
+#define TOPPERS_STK_T	intptr_t
+#endif /* TOPPERS_STK_T */
+typedef	TOPPERS_STK_T	STK_T;	/* ã¹ã¿ãã¯é åãç¢ºä¿ããããã®å */
+
+#ifndef TOPPERS_MPF_T
+#define TOPPERS_MPF_T	intptr_t
+#endif /* TOPPERS_MPF_T */
+typedef	TOPPERS_MPF_T	MPF_T;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åãç¢ºä¿ããããã®å */
+
+/*
+ *  ãã±ããå½¢å¼ã®å®ç¾©
+ */
+typedef struct t_rtsk {
+	STAT	tskstat;	/* ã¿ã¹ã¯ç¶æ
+ */
+	PRI		tskpri;		/* ã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ */
+	PRI		tskbpri;	/* ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+	STAT	tskwait;	/* å¾
+ã¡è¦å  */
+	ID		wobjid;		/* å¾
+ã¡å¯¾è±¡ã®ãªãã¸ã§ã¯ãã®ID */
+	TMO		lefttmo;	/* ã¿ã¤ã ã¢ã¦ãããã¾ã§ã®æé */
+	uint_t	actcnt;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	uint_t	wupcnt;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	bool_t	raster;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	bool_t	dister;		/* ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ */
+} T_RTSK;
+
+typedef struct t_rsem {
+	ID		wtskid;		/* ã»ããã©ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	semcnt;		/* ã»ããã©ã®ç¾å¨ã®è³æºæ° */
+} T_RSEM;
+
+typedef struct t_rflg {
+	ID		wtskid;		/* ã¤ãã³ããã©ã°ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	FLGPTN	flgptn;		/* ã¤ãã³ããã©ã°ã®ç¾å¨ã®ããããã¿ã¼ã³ */
+} T_RFLG;
+
+typedef struct t_rdtq {
+	ID		stskid;		/* ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	ID		rtskid;		/* ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	sdtqcnt;	/* ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼ã¿ã®æ° */
+} T_RDTQ;
+
+typedef struct t_rpdq {
+	ID		stskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	ID		rtskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	uint_t	spdqcnt;	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼
+						   ã¿ã®æ° */
+} T_RPDQ;
+
+typedef struct t_rmtx {
+	ID		htskid;		/* ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã¿ã¹ã¯ã®IDçªå· */
+	ID		wtskid;		/* ãã¥ã¼ããã¯ã¹ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+} T_RMTX;
+
+typedef struct t_rmpf {
+	ID		wtskid;		/* åºå®é·ã¡ã¢ãªãã¼ã«ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®
+						   IDçªå· */
+	uint_t	fblkcnt;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®ç©ºãã¡ã¢ãªé åã«å²ã
+						   ä»ãããã¨ãã§ããåºå®é·ã¡ã¢ãªãã­ãã¯ã®æ° */
+} T_RMPF;
+
+typedef struct t_rcyc {
+	STAT	cycstat;	/* å¨æéç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* æ¬¡åéç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RCYC;
+
+typedef struct t_ralm {
+	STAT	almstat;	/* ã¢ã©ã¼ã éç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* éç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RALM;
+
+typedef struct t_rovr {
+	STAT	ovrstat;	/* ãªã¼ãã©ã³ãã³ãã©ã®åä½ç¶æ
+ */
+	PRCTIM	leftotm;	/* æ®ããã­ã»ããµæé */
+} T_ROVR;
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å®£è¨
+ */
+
+/*
+ *  ã¿ã¹ã¯ç®¡çæ©è½
+ */
+extern ER		act_tsk(ID tskid) throw();
+extern ER_UINT	can_act(ID tskid) throw();
+extern ER		get_tst(ID tskid, STAT *p_tskstat) throw();
+extern ER		chg_pri(ID tskid, PRI tskpri) throw();
+extern ER		get_pri(ID tskid, PRI *p_tskpri) throw();
+extern ER		get_inf(intptr_t *p_exinf) throw();
+extern ER		ref_tsk(ID tskid, T_RTSK *pk_rtsk) throw();
+
+/*
+ *  ã¿ã¹ã¯ä»å±åææ©è½
+ */
+extern ER		slp_tsk(void) throw();
+extern ER		tslp_tsk(TMO tmout) throw();
+extern ER		wup_tsk(ID tskid) throw();
+extern ER_UINT	can_wup(ID tskid) throw();
+extern ER		rel_wai(ID tskid) throw();
+extern ER		sus_tsk(ID tskid) throw();
+extern ER		rsm_tsk(ID tskid) throw();
+extern ER		dly_tsk(RELTIM dlytim) throw();
+
+/*
+ *  ã¿ã¹ã¯çµäºæ©è½
+ */
+extern ER		ext_tsk(void) throw();
+extern ER		ras_ter(ID tskid) throw();
+extern ER		dis_ter(void) throw();
+extern ER		ena_ter(void) throw();
+extern bool_t	sns_ter(void) throw();
+extern ER		ter_tsk(ID tskid) throw();
+
+/*
+ *  åæã»éä¿¡æ©è½
+ */
+extern ER		sig_sem(ID semid) throw();
+extern ER		wai_sem(ID semid) throw();
+extern ER		pol_sem(ID semid) throw();
+extern ER		twai_sem(ID semid, TMO tmout) throw();
+extern ER		ini_sem(ID semid) throw();
+extern ER		ref_sem(ID semid, T_RSEM *pk_rsem) throw();
+
+extern ER		set_flg(ID flgid, FLGPTN setptn) throw();
+extern ER		clr_flg(ID flgid, FLGPTN clrptn) throw();
+extern ER		wai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		pol_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		twai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn, TMO tmout) throw();
+extern ER		ini_flg(ID flgid) throw();
+extern ER		ref_flg(ID flgid, T_RFLG *pk_rflg) throw();
+
+extern ER		snd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		psnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		tsnd_dtq(ID dtqid, intptr_t data, TMO tmout) throw();
+extern ER		fsnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		rcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		prcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		trcv_dtq(ID dtqid, intptr_t *p_data, TMO tmout) throw();
+extern ER		ini_dtq(ID dtqid) throw();
+extern ER		ref_dtq(ID dtqid, T_RDTQ *pk_rdtq) throw();
+
+extern ER		snd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		psnd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		tsnd_pdq(ID pdqid, intptr_t data,
+										PRI datapri, TMO tmout) throw();
+extern ER		rcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		prcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		trcv_pdq(ID pdqid, intptr_t *p_data,
+										PRI *p_datapri, TMO tmout) throw();
+extern ER		ini_pdq(ID pdqid) throw();
+extern ER		ref_pdq(ID pdqid, T_RPDQ *pk_rpdq) throw();
+
+extern ER		loc_mtx(ID mtxid) throw();
+extern ER		ploc_mtx(ID mtxid) throw();
+extern ER		tloc_mtx(ID mtxid, TMO tmout) throw();
+extern ER		unl_mtx(ID mtxid) throw();
+extern ER		ini_mtx(ID mtxid) throw();
+extern ER		ref_mtx(ID mtxid, T_RMTX *pk_rmtx) throw();
+
+/*
+ *  ã¡ã¢ãªãã¼ã«ç®¡çæ©è½
+ */
+extern ER		get_mpf(ID mpfid, void **p_blk) throw();
+extern ER		pget_mpf(ID mpfid, void **p_blk) throw();
+extern ER		tget_mpf(ID mpfid, void **p_blk, TMO tmout) throw();
+extern ER		rel_mpf(ID mpfid, void *blk) throw();
+extern ER		ini_mpf(ID mpfid) throw();
+extern ER		ref_mpf(ID mpfid, T_RMPF *pk_rmpf) throw();
+
+/*
+ *  æéç®¡çæ©è½
+ */
+extern ER		set_tim(SYSTIM systim) throw();
+extern ER		get_tim(SYSTIM *p_systim) throw();
+extern ER		adj_tim(int32_t adjtim) throw();
+extern HRTCNT	fch_hrt(void) throw();
+
+extern ER		sta_cyc(ID cycid) throw();
+extern ER		stp_cyc(ID cycid) throw();
+extern ER		ref_cyc(ID cycid, T_RCYC *pk_rcyc) throw();
+
+extern ER		sta_alm(ID almid, RELTIM almtim) throw();
+extern ER		stp_alm(ID almid) throw();
+extern ER		ref_alm(ID almid, T_RALM *pk_ralm) throw();
+
+extern ER		sta_ovr(ID tskid, PRCTIM ovrtim) throw();
+extern ER		stp_ovr(ID tskid) throw();
+extern ER		ref_ovr(ID tskid, T_ROVR *pk_rovr) throw();
+
+/*
+ *  ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+ */
+extern ER		rot_rdq(PRI tskpri) throw();
+extern ER		get_tid(ID *p_tskid) throw();
+extern ER		get_lod(PRI tskpri, uint_t *p_load) throw();
+extern ER		get_nth(PRI tskpri, uint_t nth, ID *p_tskid) throw();
+extern ER		loc_cpu(void) throw();
+extern ER		unl_cpu(void) throw();
+extern ER		dis_dsp(void) throw();
+extern ER		ena_dsp(void) throw();
+extern bool_t	sns_ctx(void) throw();
+extern bool_t	sns_loc(void) throw();
+extern bool_t	sns_dsp(void) throw();
+extern bool_t	sns_dpn(void) throw();
+extern bool_t	sns_ker(void) throw();
+extern ER		ext_ker(void) throw();
+
+/*
+ *  å²è¾¼ã¿ç®¡çæ©è½
+ */
+extern ER		dis_int(INTNO intno) throw();
+extern ER		ena_int(INTNO intno) throw();
+extern ER		chg_ipm(PRI intpri) throw();
+extern ER		get_ipm(PRI *p_intpri) throw();
+
+/*
+ *  CPUä¾å¤ç®¡çæ©è½
+ */
+extern bool_t	xsns_dpn(void *p_excinf) throw();
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãããµã¼ãã¹ã³ã¼ã«
+ */
+#define iact_tsk(tskid)						act_tsk(tskid)
+#define iwup_tsk(tskid)						wup_tsk(tskid)
+#define irel_wai(tskid)						rel_wai(tskid)
+#define isns_ter()							sns_ter()
+#define isig_sem(semid)						sig_sem(semid)
+#define iset_flg(flgid, setptn)				set_flg(flgid, setptn)
+#define ipsnd_dtq(dtqid, data)				psnd_dtq(dtqid, data)
+#define ifsnd_dtq(dtqid, data)				fsnd_dtq(dtqid, data)
+#define ipsnd_pdq(pdqid, data, datapri)		psnd_pdq(pdqid, data, datapri)
+#define ifch_hrt()							fch_hrt()
+#define ista_alm(almid, almtim)				sta_alm(almid, almtim)
+#define istp_alm(almid)						stp_alm(almid)
+#define ista_ovr(tskid, ovrtim)				sta_ovr(tskid, ovrtim)
+#define istp_ovr(tskid)						stp_ovr(tskid)
+#define irot_rdq(tskpri)					rot_rdq(tskpri)
+#define iget_tid(p_tskid)					get_tid(p_tskid)
+#define iloc_cpu()							loc_cpu()
+#define iunl_cpu()							unl_cpu()
+#define isns_ctx()							sns_ctx()
+#define isns_loc()							sns_loc()
+#define isns_dsp()							sns_dsp()
+#define isns_dpn()							sns_dpn()
+#define isns_ker()							sns_ker()
+#define iext_ker()							ext_ker()
+#define idis_int(intno)						dis_int(intno)
+#define iena_int(intno)						ena_int(intno)
+#define ixsns_dpn(p_excinf)					xsns_dpn(p_excinf)
+
+/*
+ *  ãªãã¸ã§ã¯ãå±æ§ã®å®ç¾©
+ */
+#define TA_ACT			UINT_C(0x01)	/* ã¿ã¹ã¯ãèµ·åãããç¶æ
+ã§çæ */
+#define TA_NOACTQUE		UINT_C(0x02)	/* èµ·åè¦æ±ãã­ã¥ã¼ã¤ã³ã°ããªã */
+
+#define TA_TPRI			UINT_C(0x01)	/* ã¿ã¹ã¯ã®å¾
+ã¡è¡åãåªå
+åº¦é ã« */
+
+#define TA_WMUL			UINT_C(0x02)	/* è¤æ°ã®å¾
+ã¡ã¿ã¹ã¯ */
+#define TA_CLR			UINT_C(0x04)	/* ã¤ãã³ããã©ã°ã®ã¯ãªã¢æå® */
+
+#define TA_CEILING		UINT_C(0x03)	/* åªå
+åº¦ä¸éãã­ãã³ã« */
+
+#define TA_STA			UINT_C(0x02)	/* å¨æéç¥ãåä½ç¶æ
+ã§çæ */
+
+#define TA_NONKERNEL	UINT_C(0x02)	/* ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ */
+
+#define TA_ENAINT		UINT_C(0x01)	/* å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ãã¯ãªã¢ */
+#define TA_EDGE			UINT_C(0x02)	/* ã¨ãã¸ããªã¬ */
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®åä½ã¢ã¼ãã®å®ç¾©
+ */
+#define TWF_ORW			UINT_C(0x01)	/* ã¤ãã³ããã©ã°ã®ORå¾
+ã¡ */
+#define TWF_ANDW		UINT_C(0x02)	/* ã¤ãã³ããã©ã°ã®ANDå¾
+ã¡ */
+
+/*
+ *  éç¥å¦çã¢ã¼ãã®å®ç¾©
+ */
+#define TNFY_HANDLER	UINT_C(0x00)		/* ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºã */
+#define TNFY_SETVAR		UINT_C(0x01)		/* å¤æ°ã®è¨­å® */
+#define TNFY_INCVAR		UINT_C(0x02)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TNFY_ACTTSK		UINT_C(0x03)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TNFY_WUPTSK		UINT_C(0x04)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TNFY_SIGSEM		UINT_C(0x05)		/* ã»ããã©ã®è³æºã®è¿å´ */
+#define TNFY_SETFLG		UINT_C(0x06)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TNFY_SNDDTQ		UINT_C(0x07)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+#define TENFY_SETVAR	UINT_C(0x10)		/* å¤æ°ã®è¨­å® */
+#define TENFY_INCVAR	UINT_C(0x20)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TENFY_ACTTSK	UINT_C(0x30)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TENFY_WUPTSK	UINT_C(0x40)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TENFY_SIGSEM	UINT_C(0x50)		/* ã»ããã©ã®è¿å´ */
+#define TENFY_SETFLG	UINT_C(0x60)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TENFY_SNDDTQ	UINT_C(0x70)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+/*
+ *  ãªãã¸ã§ã¯ãã®ç¶æ
+ã®å®ç¾©
+ */
+#define TTS_RUN			UINT_C(0x01)	/* å®è¡ç¶æ
+ */
+#define TTS_RDY			UINT_C(0x02)	/* å®è¡å¯è½ç¶æ
+ */
+#define TTS_WAI			UINT_C(0x04)	/* å¾
+ã¡ç¶æ
+ */
+#define TTS_SUS			UINT_C(0x08)	/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+#define TTS_WAS			UINT_C(0x0c)	/* äºéå¾
+ã¡ç¶æ
+ */
+#define TTS_DMT			UINT_C(0x10)	/* ä¼æ­¢ç¶æ
+ */
+
+#define TTW_SLP			UINT_C(0x0001)	/* èµ·åºå¾
+ã¡ */
+#define TTW_DLY			UINT_C(0x0002)	/* æéçµéå¾
+ã¡ */
+#define TTW_SEM			UINT_C(0x0004)	/* ã»ããã©ã®è³æºç²å¾å¾
+ã¡ */
+#define TTW_FLG			UINT_C(0x0008)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TTW_SDTQ		UINT_C(0x0010)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RDTQ		UINT_C(0x0020)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_SPDQ		UINT_C(0x0100)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RPDQ		UINT_C(0x0200)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_MTX			UINT_C(0x0080)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ç¶æ
+ */
+#define TTW_MPF			UINT_C(0x2000)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TCYC_STP		UINT_C(0x01)	/* å¨æéç¥ãåä½ãã¦ããªã */
+#define TCYC_STA		UINT_C(0x02)	/* å¨æéç¥ãåä½ãã¦ãã */
+
+#define TALM_STP		UINT_C(0x01)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ããªã */
+#define TALM_STA		UINT_C(0x02)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ãã */
+
+#define TOVR_STP		UINT_C(0x01)	/* ãªã¼ãã©ã³ãã³ãã©ãåä½ãã¦ããªã*/
+#define TOVR_STA		UINT_C(0x02)	/* ãªã¼ãã©ã³ãã³ãã©ãåä½ãã¦ãã */
+
+/*
+ *  ãã®ä»ã®å®æ°ã®å®ç¾©
+ */
+#define TSK_SELF		0			/* èªã¿ã¹ã¯æå® */
+#define TSK_NONE		0			/* è©²å½ããã¿ã¹ã¯ããªã */
+
+#define TPRI_SELF		0			/* èªã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+#define TPRI_INI		0			/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ */
+
+#define TIPM_ENAALL		0			/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ */
+
+/*
+ *  æ§æå®æ°ã¨ãã¯ã­
+ */
+
+/*
+ *  åªå
+åº¦ã®ç¯å²
+ */
+#define TMIN_TPRI		1			/* ã¿ã¹ã¯åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_TPRI		16			/* ã¿ã¹ã¯åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_DPRI		1			/* ãã¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_DPRI		16			/* ãã¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_ISRPRI		1			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå°å¤ */
+#define TMAX_ISRPRI		16			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå¤§å¤ */
+
+/*
+ *  ãã¼ã¸ã§ã³æ
+å ±
+ */
+#define TKERNEL_MAKER	UINT_C(0x0118)	/* ã«ã¼ãã«ã®ã¡ã¼ã«ã¼ã³ã¼ã */
+#define TKERNEL_PRID	UINT_C(0x0007)	/* ã«ã¼ãã«ã®è­å¥çªå· */
+#define TKERNEL_SPVER	UINT_C(0xf630)	/* ã«ã¼ãã«ä»æ§ã®ãã¼ã¸ã§ã³çªå· */
+#define TKERNEL_PRVER	UINT_C(0x30b0)	/* ã«ã¼ãã«ã®ãã¼ã¸ã§ã³çªå· */
+
+/*
+ *  ã­ã¥ã¼ã¤ã³ã°åæ°ã®æå¤§å¤
+ */
+#define TMAX_ACTCNT		UINT_C(1)		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+#define TMAX_WUPCNT		UINT_C(1)		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+
+/*
+ *  ããããã¿ã¼ã³ã®ãããæ°
+ */
+#ifndef TBIT_FLGPTN					/* ã¤ãã³ããã©ã°ã®ãããæ° */
+#define TBIT_FLGPTN		(sizeof(FLGPTN) * CHAR_BIT)
+#endif /* TBIT_FLGPTN */
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´ã§ããç¯å²ï¼åä½ï¼Î¼ç§ï¼
+ */
+#define TMIN_ADJTIM		-1000000		/* ã·ã¹ãã æå»ã®æå°èª¿æ´æé */
+#define TMAX_ADJTIM		1000000			/* ã·ã¹ãã æå»ã®æå¤§èª¿æ´æé */
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©ã®æ®ããã­ã»ããµæéã®æå¤§å¤ï¼åä½ï¼Î¼ç§ï¼
+ */
+#ifndef TMAX_OVRTIM
+#define TMAX_OVRTIM		UINT32_MAX
+#endif /* TMAX_OVRTIM */
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®ãã¯ã­
+ *
+ *  ä»¥ä¸ã®TOPPERS_COUNT_SZã¨TOPPERS_ROUND_SZã®å®ç¾©ã¯ï¼unitã2ã®å·¾ä¹ã§ã
+ *  ããã¨ãä»®å®ãã¦ããï¼
+ */
+#ifndef TOPPERS_COUNT_SZ
+#define TOPPERS_COUNT_SZ(sz, unit)	(((sz) + (unit) - 1) / (unit))
+#endif /* TOPPERS_COUNT_SZ */
+#ifndef TOPPERS_ROUND_SZ
+#define TOPPERS_ROUND_SZ(sz, unit)	(((sz) + (unit) - 1) & ~((unit) - 1))
+#endif /* TOPPERS_ROUND_SZ */
+
+#define COUNT_STK_T(sz)		TOPPERS_COUNT_SZ(sz, sizeof(STK_T))
+#define ROUND_STK_T(sz)		TOPPERS_ROUND_SZ(sz, sizeof(STK_T))
+
+#define COUNT_MPF_T(blksz)	TOPPERS_COUNT_SZ(blksz, sizeof(MPF_T))
+#define ROUND_MPF_T(blksz)	TOPPERS_ROUND_SZ(blksz, sizeof(MPF_T))
+
+/*
+ *  ãã®ä»ã®æ§æå®æ°
+ */
+#define TMAX_MAXSEM		UINT_MAX	/* ã»ããã©ã®æå¤§è³æºæ°ã®æå¤§å¤ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_KERNEL_H */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/Makefile.kernel
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/Makefile.kernel	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/Makefile.kernel	(revision 302)
@@ -0,0 +1,157 @@
+#
+#  TOPPERS/ASP Kernel
+#      Toyohashi Open Platform for Embedded Real-Time Systems/
+#      Advanced Standard Profile Kernel
+# 
+#  Copyright (C) 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: Makefile.kernel 236 2014-09-28 16:24:33Z ertl-hiro $
+# 
+
+#
+#		ã«ã¼ãã«ã®ãã¡ã¤ã«æ§æã®å®ç¾©
+#
+
+#
+#  1ã¤ã®ã½ã¼ã¹ãã¡ã¤ã«ããè¤æ°ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ãçæããããã«ä½
+#  æãããã½ã¼ã¹ãã¡ã¤ã«ã®ãªã¹ã
+#
+KERNEL_FCSRCS = startup.c task.c taskhook.c wait.c time_event.c \
+				task_manage.c task_refer.c task_sync.c task_term.c \
+				semaphore.c eventflag.c dataqueue.c pridataq.c mutex.c \
+				mempfix.c time_manage.c cyclic.c alarm.c overrun.c \
+				sys_manage.c interrupt.c exception.c
+
+#
+#  åã½ã¼ã¹ãã¡ã¤ã«ããçæããããªãã¸ã§ã¯ããã¡ã¤ã«ã®ãªã¹ã
+#
+startup = sta_ker.o ext_ker.o
+
+task = tskini.o tsksched.o tskrun.o tsknrun.o \
+		tskdmt.o tskact.o tskpri.o tskrot.o tskterm.o
+
+taskhook = mtxhook.o
+
+wait = waimake.o waicmp.o waitmo.o waitmook.o \
+		wobjwai.o wobjwaitmo.o iniwque.o
+
+time_event = tmeini.o tmeup.o tmedown.o tmecur.o tmeset.o \
+		tmereg.o tmeenq.o tmedeq.o tmechk.o tmeltim.o sigtim.o
+
+task_manage = act_tsk.o can_act.o get_tst.o chg_pri.o get_pri.o get_inf.o
+
+task_refer = ref_tsk.o
+
+task_sync = slp_tsk.o tslp_tsk.o wup_tsk.o can_wup.o \
+		rel_wai.o sus_tsk.o rsm_tsk.o dly_tsk.o
+
+task_term = ext_tsk.o ras_ter.o ena_ter.o dis_ter.o sns_ter.o ter_tsk.o
+
+semaphore = semini.o sig_sem.o \
+		wai_sem.o pol_sem.o twai_sem.o ini_sem.o ref_sem.o
+
+eventflag = flgini.o flgcnd.o set_flg.o clr_flg.o \
+		wai_flg.o pol_flg.o twai_flg.o ini_flg.o ref_flg.o
+
+dataqueue = dtqini.o dtqenq.o dtqfenq.o dtqdeq.o dtqsnd.o dtqfsnd.o dtqrcv.o \
+		snd_dtq.o psnd_dtq.o tsnd_dtq.o fsnd_dtq.o \
+		rcv_dtq.o prcv_dtq.o trcv_dtq.o ini_dtq.o ref_dtq.o
+
+pridataq = pdqini.o pdqenq.o pdqdeq.o pdqsnd.o pdqrcv.o \
+		snd_pdq.o psnd_pdq.o tsnd_pdq.o \
+		rcv_pdq.o prcv_pdq.o trcv_pdq.o ini_pdq.o ref_pdq.o
+
+mutex = mtxini.o mtxchk.o mtxscan.o mtxdrop.o mtxacq.o mtxrel.o mtxrela.o \
+		loc_mtx.o ploc_mtx.o tloc_mtx.o unl_mtx.o ini_mtx.o ref_mtx.o
+
+mempfix = mpfini.o mpfget.o get_mpf.o pget_mpf.o tget_mpf.o \
+		rel_mpf.o ini_mpf.o ref_mpf.o
+
+time_manage = set_tim.o get_tim.o adj_tim.o fch_hrt.o
+
+cyclic = cycini.o sta_cyc.o stp_cyc.o ref_cyc.o cyccal.o
+
+alarm = almini.o sta_alm.o stp_alm.o ref_alm.o almcal.o
+
+overrun = ovrini.o ovrsta.o ovrstp.o sta_ovr.o stp_ovr.o ref_ovr.o ovrcal.o
+
+sys_manage = rot_rdq.o get_tid.o get_lod.o get_nth.o \
+		loc_cpu.o unl_cpu.o dis_dsp.o ena_dsp.o \
+		sns_ctx.o sns_loc.o sns_dsp.o sns_dpn.o sns_ker.o
+
+interrupt = intini.o dis_int.o ena_int.o chg_ipm.o get_ipm.o
+
+exception = excini.o xsns_dpn.o
+
+#
+#  çæããããªãã¸ã§ã¯ããã¡ã¤ã«ã®ä¾å­é¢ä¿ã®å®ç¾©
+#
+$(startup) $(startup:.o=.s) $(startup:.o=.d): startup.c
+$(task) $(task:.o=.s) $(task:.o=.d): task.c
+$(taskhook) $(taskhook:.o=.s) $(taskhook:.o=.d): taskhook.c
+$(wait) $(wait:.o=.s) $(wait:.o=.d): wait.c
+$(time_event) $(time_event:.o=.s) $(time_event:.o=.d): time_event.c
+$(task_manage) $(task_manage:.o=.s) $(task_manage:.o=.d): task_manage.c
+$(task_refer) $(task_refer:.o=.s) $(task_refer:.o=.d): task_refer.c
+$(task_sync) $(task_sync:.o=.s) $(task_sync:.o=.d): task_sync.c
+$(task_term) $(task_term:.o=.s) $(task_term:.o=.d): task_term.c
+$(semaphore) $(semaphore:.o=.s) $(semaphore:.o=.d): semaphore.c
+$(eventflag) $(eventflag:.o=.s) $(eventflag:.o=.d): eventflag.c
+$(dataqueue) $(dataqueue:.o=.s) $(dataqueue:.o=.d): dataqueue.c
+$(pridataq) $(pridataq:.o=.s) $(pridataq:.o=.d): pridataq.c
+$(mutex) $(mutex:.o=.s) $(mutex:.o=.d): mutex.c
+$(mempfix) $(mempfix:.o=.s) $(mempfix:.o=.d): mempfix.c
+$(time_manage) $(time_manage:.o=.s) $(time_manage:.o=.d): time_manage.c
+$(cyclic) $(cyclic:.o=.s) $(cyclic:.o=.d): cyclic.c
+$(alarm) $(alarm:.o=.s) $(alarm:.o=.d): alarm.c
+$(overrun) $(overrun:.o=.s) $(overrun:.o=.d): overrun.c
+$(sys_manage) $(sys_manage:.o=.s) $(sys_manage:.o=.d): sys_manage.c
+$(interrupt) $(interrupt:.o=.s) $(interrupt:.o=.d): interrupt.c
+$(exception) $(exception:.o=.s) $(exception:.o=.d): exception.c
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/allfunc.h
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/allfunc.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/allfunc.h	(revision 302)
@@ -0,0 +1,265 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: allfunc.h 236 2014-09-28 16:24:33Z ertl-hiro $
+ */
+
+/*
+ *		ãã¹ã¦ã®é¢æ°ãã³ã³ãã¤ã«ããããã®å®ç¾©
+ */
+
+#ifndef TOPPERS_ALLFUNC_H
+#define TOPPERS_ALLFUNC_H
+
+/* startup.c */
+#define TOPPERS_sta_ker
+#define TOPPERS_ext_ker
+
+/* task.c */
+#define TOPPERS_tskini
+#define TOPPERS_tsksched
+#define TOPPERS_tskrun
+#define TOPPERS_tsknrun
+#define TOPPERS_tskdmt
+#define TOPPERS_tskact
+#define TOPPERS_tskpri
+#define TOPPERS_tskrot
+#define TOPPERS_tskterm
+
+/* taskhook.c */
+#define TOPPERS_mtxhook
+
+/* wait.c */
+#define TOPPERS_waimake
+#define TOPPERS_waicmp
+#define TOPPERS_waitmo
+#define TOPPERS_waitmook
+#define TOPPERS_wobjwai
+#define TOPPERS_wobjwaitmo
+#define TOPPERS_iniwque
+
+/* time_event.c */
+#define TOPPERS_tmeini
+#define TOPPERS_tmeup
+#define TOPPERS_tmedown
+#define TOPPERS_tmecur
+#define TOPPERS_tmeset
+#define TOPPERS_tmereg
+#define TOPPERS_tmeenq
+#define TOPPERS_tmedeq
+#define TOPPERS_tmechk
+#define TOPPERS_tmeltim
+#define TOPPERS_sigtim
+
+/* task_manage.c */
+#define TOPPERS_act_tsk
+#define TOPPERS_can_act
+#define TOPPERS_get_tst
+#define TOPPERS_chg_pri
+#define TOPPERS_get_pri
+#define TOPPERS_get_inf
+
+/* task_refer.c */
+#define TOPPERS_ref_tsk
+
+/* task_sync.c */
+#define TOPPERS_slp_tsk
+#define TOPPERS_tslp_tsk
+#define TOPPERS_wup_tsk
+#define TOPPERS_can_wup
+#define TOPPERS_rel_wai
+#define TOPPERS_sus_tsk
+#define TOPPERS_rsm_tsk
+#define TOPPERS_dly_tsk
+
+/* task_term.c */
+#define TOPPERS_ext_tsk
+#define TOPPERS_ras_ter
+#define TOPPERS_dis_ter
+#define TOPPERS_ena_ter
+#define TOPPERS_sns_ter
+#define TOPPERS_ter_tsk
+
+/* semaphore.c */
+#define TOPPERS_semini
+#define TOPPERS_sig_sem
+#define TOPPERS_wai_sem
+#define TOPPERS_pol_sem
+#define TOPPERS_twai_sem
+#define TOPPERS_ini_sem
+#define TOPPERS_ref_sem
+
+/* eventflag.c */
+#define TOPPERS_flgini
+#define TOPPERS_flgcnd
+#define TOPPERS_set_flg
+#define TOPPERS_clr_flg
+#define TOPPERS_wai_flg
+#define TOPPERS_pol_flg
+#define TOPPERS_twai_flg
+#define TOPPERS_ini_flg
+#define TOPPERS_ref_flg
+
+/* dataqueue.c */
+#define TOPPERS_dtqini
+#define TOPPERS_dtqenq
+#define TOPPERS_dtqfenq
+#define TOPPERS_dtqdeq
+#define TOPPERS_dtqsnd
+#define TOPPERS_dtqfsnd
+#define TOPPERS_dtqrcv
+#define TOPPERS_snd_dtq
+#define TOPPERS_psnd_dtq
+#define TOPPERS_tsnd_dtq
+#define TOPPERS_fsnd_dtq
+#define TOPPERS_rcv_dtq
+#define TOPPERS_prcv_dtq
+#define TOPPERS_trcv_dtq
+#define TOPPERS_ini_dtq
+#define TOPPERS_ref_dtq
+
+/* pridataq.c */
+#define TOPPERS_pdqini
+#define TOPPERS_pdqenq
+#define TOPPERS_pdqdeq
+#define TOPPERS_pdqsnd
+#define TOPPERS_pdqrcv
+#define TOPPERS_snd_pdq
+#define TOPPERS_psnd_pdq
+#define TOPPERS_tsnd_pdq
+#define TOPPERS_rcv_pdq
+#define TOPPERS_prcv_pdq
+#define TOPPERS_trcv_pdq
+#define TOPPERS_ini_pdq
+#define TOPPERS_ref_pdq
+
+/* mutex.c */
+#define TOPPERS_mtxini
+#define TOPPERS_mtxchk
+#define TOPPERS_mtxscan
+#define TOPPERS_mtxdrop
+#define TOPPERS_mtxacq
+#define TOPPERS_mtxrel
+#define TOPPERS_mtxrela
+#define TOPPERS_loc_mtx
+#define TOPPERS_ploc_mtx
+#define TOPPERS_tloc_mtx
+#define TOPPERS_unl_mtx
+#define TOPPERS_ini_mtx
+#define TOPPERS_ref_mtx
+
+/* mempfix.c */
+#define TOPPERS_mpfini
+#define TOPPERS_mpfget
+#define TOPPERS_get_mpf
+#define TOPPERS_pget_mpf
+#define TOPPERS_tget_mpf
+#define TOPPERS_rel_mpf
+#define TOPPERS_ini_mpf
+#define TOPPERS_ref_mpf
+
+/* time_manage.c */
+#define TOPPERS_set_tim
+#define TOPPERS_get_tim
+#define TOPPERS_adj_tim
+#define TOPPERS_fch_hrt
+
+/* cyclic.c */
+#define TOPPERS_cycini
+#define TOPPERS_sta_cyc
+#define TOPPERS_stp_cyc
+#define TOPPERS_ref_cyc
+#define TOPPERS_cyccal
+
+/* alarm.c */
+#define TOPPERS_almini
+#define TOPPERS_sta_alm
+#define TOPPERS_stp_alm
+#define TOPPERS_ref_alm
+#define TOPPERS_almcal
+
+/* overrun.c */
+#define TOPPERS_ovrini
+#define TOPPERS_ovrsta
+#define TOPPERS_ovrstp
+#define TOPPERS_sta_ovr
+#define TOPPERS_stp_ovr
+#define TOPPERS_ref_ovr
+#define TOPPERS_ovrcal
+
+/* sys_manage.c */
+#define TOPPERS_rot_rdq
+#define TOPPERS_get_tid
+#define TOPPERS_get_lod
+#define TOPPERS_get_nth
+#define TOPPERS_loc_cpu
+#define TOPPERS_unl_cpu
+#define TOPPERS_dis_dsp
+#define TOPPERS_ena_dsp
+#define TOPPERS_sns_ctx
+#define TOPPERS_sns_loc
+#define TOPPERS_sns_dsp
+#define TOPPERS_sns_dpn
+#define TOPPERS_sns_ker
+
+/* interrupt.c */
+#define TOPPERS_intini
+#define TOPPERS_dis_int
+#define TOPPERS_ena_int
+#define TOPPERS_chg_ipm
+#define TOPPERS_get_ipm
+
+/* exception.c */
+#define TOPPERS_excini
+#define TOPPERS_xsns_dpn
+
+#endif /* TOPPERS_ALLFUNC_H */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/check.h
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/check.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/check.h	(revision 302)
@@ -0,0 +1,207 @@
+/*
+ *  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: check.h 356 2015-07-25 10:44:32Z ertl-hiro $
+ */
+
+/*
+ *		ã¨ã©ã¼ãã§ãã¯ç¨ãã¯ã­
+ */
+
+#ifndef TOPPERS_CHECK_H
+#define TOPPERS_CHECK_H
+
+#include "kernel_impl.h"
+
+/*
+ *  ãªãã¸ã§ã¯ãIDã®ç¯å²ã®å¤å®
+ */
+#define VALID_TSKID(tskid)	(TMIN_TSKID <= (tskid) && (tskid) <= tmax_tskid)
+#define VALID_SEMID(semid)	(TMIN_SEMID <= (semid) && (semid) <= tmax_semid)
+#define VALID_FLGID(flgid)	(TMIN_FLGID <= (flgid) && (flgid) <= tmax_flgid)
+#define VALID_DTQID(dtqid)	(TMIN_DTQID <= (dtqid) && (dtqid) <= tmax_dtqid)
+#define VALID_PDQID(pdqid)	(TMIN_PDQID <= (pdqid) && (pdqid) <= tmax_pdqid)
+#define VALID_MTXID(mtxid)	(TMIN_MTXID <= (mtxid) && (mtxid) <= tmax_mtxid)
+#define VALID_MPFID(mpfid)	(TMIN_MPFID <= (mpfid) && (mpfid) <= tmax_mpfid)
+#define VALID_CYCID(cycid)	(TMIN_CYCID <= (cycid) && (cycid) <= tmax_cycid)
+#define VALID_ALMID(almid)	(TMIN_ALMID <= (almid) && (almid) <= tmax_almid)
+
+/*
+ *  ãªãã¸ã§ã¯ãçªå·ã®ç¯å²ã®å¤å®
+ */
+#ifndef VALID_INTNO_DISINT
+#define VALID_INTNO_DISINT(intno)    VALID_INTNO(intno)
+#endif /* VALID_INTNO_DISINT */
+
+#ifndef VALID_INTNO_CREISR
+#define VALID_INTNO_CREISR(intno)    VALID_INTNO(intno)
+#endif /* VALID_INTNO_CREISR */
+
+/*
+ *  åªå
+åº¦ã®ç¯å²ã®å¤å®
+ */
+#define VALID_TPRI(tpri)	(TMIN_TPRI <= (tpri) && (tpri) <= TMAX_TPRI)
+
+#ifndef VALID_INTPRI_CHGIPM
+#define VALID_INTPRI_CHGIPM(intpri) \
+				(TMIN_INTPRI <= (intpri) && (intpri) <= TIPM_ENAALL)
+#endif /* VALID_INTPRI_CHGIPM */
+
+/*
+ *  ç¸å¯¾æéã®ç¯å²ã®å¤å®
+ */
+#define VALID_RELTIM(reltim)	((reltim) <= TMAX_RELTIM)
+
+/*
+ *  ã¿ã¤ã ã¢ã¦ãæå®å¤ã®ç¯å²ã®å¤å®
+ */
+#define VALID_TMOUT(tmout)	((tmout) <= TMAX_RELTIM || (tmout) == TMO_FEVR \
+													|| (tmout) == TMO_POL)
+
+/*
+ *  å¼åºãã³ã³ãã­ã¹ãã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_TSKCTX() do {									\
+	if (sense_context()) {									\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_UNL() do {									\
+	if (sense_lock()) {										\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  å¼åºãã³ã³ãã­ã¹ãã¨CPUã­ãã¯ç¶æ
+ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_TSKCTX_UNL() do {								\
+	if (sense_context() || sense_lock()) {					\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã£ã¹ãããä¿çç¶æ
+ã§ãªããã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_DISPATCH() do {								\
+	if (sense_context() || sense_lock() || !dspflg) {		\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã®ä»ã®ã³ã³ãã­ã¹ãã¨ã©ã¼ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_CTX(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãªãã¸ã§ã¯ãIDã®ãã§ãã¯ï¼E_IDï¼
+ */
+#define CHECK_ID(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_ID;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã©ã¡ã¼ã¿ã¨ã©ã¼ã®ãã§ãã¯ï¼E_PARï¼
+ */
+#define CHECK_PAR(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_PAR;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ä¸æ­£ä½¿ç¨ã¨ã©ã¼ã®ãã§ãã¯ï¼E_ILUSEï¼
+ */
+#define CHECK_ILUSE(exp) do {								\
+	if (!(exp)) {											\
+		ercd = E_ILUSE;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  éçãªãªãã¸ã§ã¯ãç¶æ
+ã¨ã©ã¼ã®ãã§ãã¯ï¼E_OBJï¼
+ */
+#define CHECK_OBJ(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_OBJ;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+#endif /* TOPPERS_CHECK_H */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/interrupt.c
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/interrupt.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/interrupt.c	(revision 302)
@@ -0,0 +1,279 @@
+/*
+ *  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: interrupt.c 275 2014-11-03 14:26:05Z ertl-hiro $
+ */
+
+/*
+ *		å²è¾¼ã¿ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "interrupt.h"
+#include "overrun.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_DIS_INT_ENTER
+#define LOG_DIS_INT_ENTER(intno)
+#endif /* LOG_DIS_INT_ENTER */
+
+#ifndef LOG_DIS_INT_LEAVE
+#define LOG_DIS_INT_LEAVE(ercd)
+#endif /* LOG_DIS_INT_LEAVE */
+
+#ifndef LOG_ENA_INT_ENTER
+#define LOG_ENA_INT_ENTER(intno)
+#endif /* LOG_ENA_INT_ENTER */
+
+#ifndef LOG_ENA_INT_LEAVE
+#define LOG_ENA_INT_LEAVE(ercd)
+#endif /* LOG_ENA_INT_LEAVE */
+
+#ifndef LOG_CHG_IPM_ENTER
+#define LOG_CHG_IPM_ENTER(intpri)
+#endif /* LOG_CHG_IPM_ENTER */
+
+#ifndef LOG_CHG_IPM_LEAVE
+#define LOG_CHG_IPM_LEAVE(ercd)
+#endif /* LOG_CHG_IPM_LEAVE */
+
+#ifndef LOG_GET_IPM_ENTER
+#define LOG_GET_IPM_ENTER(p_intpri)
+#endif /* LOG_GET_IPM_ENTER */
+
+#ifndef LOG_GET_IPM_LEAVE
+#define LOG_GET_IPM_LEAVE(ercd, p_intpri)
+#endif /* LOG_GET_IPM_LEAVE */
+
+/* 
+ *  å²è¾¼ã¿ç®¡çæ©è½ã®åæå
+ */
+#ifdef TOPPERS_intini
+#ifndef OMIT_INITIALIZE_INTERRUPT
+
+void
+initialize_interrupt(void)
+{
+	uint_t			i;
+	const INHINIB	*p_inhinib;
+	const INTINIB	*p_intinib;
+
+	for (i = 0; i < tnum_def_inhno; i++) {
+		p_inhinib = &(inhinib_table[i]);
+		define_inh(p_inhinib->inhno, p_inhinib->int_entry);
+	}
+	for (i = 0; i < tnum_cfg_intno; i++) {
+		p_intinib = &(intinib_table[i]);
+		config_int(p_intinib->intno, p_intinib->intatr, p_intinib->intpri);
+	}
+}
+
+#endif /* OMIT_INITIALIZE_INTERRUPT */
+#endif /* TOPPERS_intini */
+
+/*
+ *  å²è¾¼ã¿ã®ç¦æ­¢ï¼»NGKI3555ï¼½
+ */
+#ifdef TOPPERS_dis_int
+#ifdef TOPPERS_SUPPORT_DIS_INT					/*ï¼»NGKI3093ï¼½*/
+
+ER
+dis_int(INTNO intno)
+{
+	bool_t	locked;
+	ER		ercd;
+
+	LOG_DIS_INT_ENTER(intno);
+	CHECK_PAR(VALID_INTNO_DISINT(intno));		/*ï¼»NGKI3083ï¼½ï¼»NGKI3087ï¼½*/
+
+	locked = sense_lock();
+	if (!locked) {
+		lock_cpu();
+	}
+	if (disable_int(intno)) {					/*ï¼»NGKI3086ï¼½*/
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_OBJ;							/*ï¼»NGKI3085ï¼½*/
+	}
+	if (!locked) {
+		unlock_cpu();
+	}
+
+  error_exit:
+	LOG_DIS_INT_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_SUPPORT_DIS_INT */
+#endif /* TOPPERS_dis_int */
+
+/*
+ *  å²è¾¼ã¿ã®è¨±å¯ï¼»NGKI3556ï¼½
+ */
+#ifdef TOPPERS_ena_int
+#ifdef TOPPERS_SUPPORT_ENA_INT					/*ï¼»NGKI3106ï¼½*/
+
+ER
+ena_int(INTNO intno)
+{
+	bool_t	locked;
+	ER		ercd;
+
+	LOG_ENA_INT_ENTER(intno);
+	CHECK_PAR(VALID_INTNO_DISINT(intno));		/*ï¼»NGKI3096ï¼½ï¼»NGKI3100ï¼½*/
+
+	locked = sense_lock();
+	if (!locked) {
+		lock_cpu();
+	}
+	if (enable_int(intno)) {					/*ï¼»NGKI3099ï¼½*/
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_OBJ;							/*ï¼»NGKI3098ï¼½*/
+	}
+	if (!locked) {
+		unlock_cpu();
+	}
+
+  error_exit:
+	LOG_ENA_INT_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_SUPPORT_ENA_INT */
+#endif /* TOPPERS_ena_int */
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®å¤æ´ï¼»NGKI3107ï¼½
+ */
+#ifdef TOPPERS_chg_ipm
+
+ER
+chg_ipm(PRI intpri)
+{
+	ER		ercd;
+
+	LOG_CHG_IPM_ENTER(intpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3108ï¼½ï¼»NGKI3109ï¼½*/
+	CHECK_PAR(VALID_INTPRI_CHGIPM(intpri));		/*ï¼»NGKI3113ï¼½ï¼»NGKI3114ï¼½*/
+
+	lock_cpu();
+	t_set_ipm(intpri);							/*ï¼»NGKI3111ï¼½*/
+	if (intpri == TIPM_ENAALL && enadsp) {
+		dspflg = true;
+		p_schedtsk = search_schedtsk();
+		if (p_runtsk->raster && p_runtsk->enater) {
+#ifdef TOPPERS_SUPPORT_OVRHDR
+			if (p_runtsk->staovr) {
+				(void) target_ovrtimer_stop();
+				ovrtimer_flag = false;
+			}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+			task_terminate(p_runtsk);
+			exit_and_dispatch();
+			ercd = E_SYS;
+		}
+		else {
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}
+			ercd = E_OK;
+		}
+	}
+	else {
+		dspflg = false;
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_CHG_IPM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_chg_ipm */
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®åç
+§ï¼»NGKI3115ï¼½
+ */
+#ifdef TOPPERS_get_ipm
+
+ER
+get_ipm(PRI *p_intpri)
+{
+	ER		ercd;
+
+	LOG_GET_IPM_ENTER(p_intpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3116ï¼½ï¼»NGKI3117ï¼½*/
+
+	lock_cpu();
+	*p_intpri = t_get_ipm();					/*ï¼»NGKI3120ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_IPM_LEAVE(ercd, p_intpri);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_ipm */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel.tf	(revision 302)
@@ -0,0 +1,430 @@
+$
+$   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ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  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/overrun.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/extension/ovrhdr/kernel/kernel_api.csv
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_api.csv	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_api.csv	(revision 302)
@@ -0,0 +1,17 @@
+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? } },,
+ovr,DEF_OVR,{ .ovratr &ovrhdr },-1,
+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/extension/ovrhdr/kernel/kernel_check.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_check.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_check.tf	(revision 302)
@@ -0,0 +1,406 @@
+$ 
+$   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$
+
+$
+$  ãªã¼ãã©ã³ãã³ãã©ã«é¢ãããã§ãã¯
+$
+$ovrinib = SYMBOL("_kernel_ovrinib")$
+$IF LENGTH(OVR.ORDER_LIST)$
+	$ovrhdr = PEEK(ovrinib + offsetof_OVRINIB_ovrhdr, sizeof_FP)$
+
+$	// ãªã¼ãã©ã³ãã³ãã©ã®å
+é ­çªå°ã®ãã§ãã¯ï¼»NGKI2613ï¼½
+	$IF CHECK_FUNC_ALIGN && (ovrhdr & (CHECK_FUNC_ALIGN - 1)) != 0$
+		$ERROR OVR.TEXT_LINE[1]$E_PAR:$SPC$
+			$FORMAT(_("%1% `%2%\' in %4% is not aligned"),
+							"ovrhdr", OVR.OVRHDR[1], "DEF_OVR")$
+		$END$
+	$END$
+	$IF CHECK_FUNC_NONNULL && ovrhdr == 0$
+		$ERROR OVR.TEXT_LINE[1]$E_PAR:$SPC$
+			$FORMAT(_("%1% `%2%\' in %3% is null"),
+							"ovrhdr", OVR.OVRHDR[1], "DEF_OVR")$
+		$END$
+	$END$
+$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/extension/ovrhdr/kernel/kernel_def.csv
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_def.csv	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_def.csv	(revision 302)
@@ -0,0 +1,137 @@
+TOPPERS_SUPPORT_OVRHDR,#defined(TOPPERS_SUPPORT_OVRHDR)
+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_OVRINIB,#defined(TOPPERS_SUPPORT_OVRHDR),,sizeof(OVRINIB)
+offsetof_OVRINIB_ovratr,#defined(TOPPERS_SUPPORT_OVRHDR),,"offsetof(OVRINIB,ovratr)"
+offsetof_OVRINIB_ovrhdr,#defined(TOPPERS_SUPPORT_OVRHDR),,"offsetof(OVRINIB,ovrhdr)"
+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/extension/ovrhdr/kernel/kernel_int.h
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_int.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_int.h	(revision 302)
@@ -0,0 +1,102 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 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: kernel_int.h 213 2014-09-23 10:27:00Z ertl-hiro $
+ */
+
+/*
+ *		kernel_cfg.cï¼ããã³cfg1_out.cï¼ç¨ããããã¡ã¤ã«
+ */
+
+#ifndef TOPPERS_KERNEL_INT_H
+#define TOPPERS_KERNEL_INT_H
+
+/*
+ *  ã«ã¼ãã«æ¨æºããããã¡ã¤ã«
+ */
+#include "kernel_impl.h"
+
+/*
+ *  ã«ã¼ãã«ã®åããããã¡ã¤ã«
+ */
+#include "task.h"
+#include "semaphore.h"
+#include "eventflag.h"
+#include "dataqueue.h"
+#include "pridataq.h"
+#include "mutex.h"
+#include "mempfix.h"
+#include "cyclic.h"
+#include "alarm.h"
+#include "overrun.h"
+#include "interrupt.h"
+#include "exception.h"
+#include "time_event.h"
+
+/*
+ *  ãªãã¼ã ããã·ã³ãã«ãå
+ã«æ»ãããã®ããããã¡ã¤ã«
+ */
+#include "kernel_unrename.h"
+
+/*
+ *  å
+å®¹ãç©ºã®é
+åãçæããããã®ãã¯ã­
+ */
+#ifndef TOPPERS_EMPTY_LABEL
+#define TOPPERS_EMPTY_LABEL(type, var)		type var[0]
+#endif
+
+#endif /* TOPPERS_KERNEL_INT_H */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_rename.def
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_rename.def	(revision 302)
@@ -0,0 +1,156 @@
+# startup.c
+kerflg
+exit_kernel
+
+# task.c
+p_runtsk
+p_schedtsk
+enadsp
+dspflg
+ready_queue
+ready_primap
+initialize_task
+search_schedtsk
+make_runnable
+make_non_runnable
+make_dormant
+make_active
+change_priority
+rotate_ready_queue
+task_terminate
+
+# taskhook.c
+mtxhook_check_ceilpri
+mtxhook_scan_ceilmtx
+mtxhook_release_all
+
+# wait.c
+make_wait_tmout
+wait_complete
+wait_tmout
+wait_tmout_ok
+wobj_make_wait
+wobj_make_wait_tmout
+init_wait_queue
+
+# time_event.c
+boundary_evttim
+current_evttim
+current_hrtcnt
+monotonic_evttim
+systim_offset
+in_signal_time
+initialize_tmevt
+tmevt_up
+tmevt_down
+update_current_evttim
+set_hrt_event
+tmevtb_register
+tmevtb_enqueue
+tmevtb_dequeue
+check_adjtim
+tmevt_lefttim
+signal_time
+
+# semaphore.c
+initialize_semaphore
+
+# eventflag.c
+initialize_eventflag
+check_flg_cond
+
+# dataqueue.c
+initialize_dataqueue
+enqueue_data
+force_enqueue_data
+dequeue_data
+send_data
+force_send_data
+receive_data
+
+# pridataq.c
+initialize_pridataq
+enqueue_pridata
+dequeue_pridata
+send_pridata
+receive_pridata
+
+# mutex.c
+initialize_mutex
+mutex_check_ceilpri
+mutex_scan_ceilmtx
+mutex_drop_priority
+mutex_acquire
+mutex_release
+mutex_release_all
+
+# mempfix.c
+initialize_mempfix
+get_mpf_block
+
+# cyclic.c
+initialize_cyclic
+call_cyclic
+
+# alarm.c
+initialize_alarm
+call_alarm
+
+# overrun.c
+ovrtimer_flag
+initialize_overrun
+ovrtimer_start
+ovrtimer_stop
+call_ovrhdr
+
+# interrupt.c
+initialize_interrupt
+
+# exception.c
+initialize_exception
+
+# kernel_cfg.c
+initialize_object
+call_inirtn
+call_terrtn
+tmax_tskid
+tinib_table
+torder_table
+tcb_table
+tmax_semid
+seminib_table
+semcb_table
+tmax_flgid
+flginib_table
+flgcb_table
+tmax_dtqid
+dtqinib_table
+dtqcb_table
+tmax_pdqid
+pdqinib_table
+pdqcb_table
+tmax_mtxid
+mtxinib_table
+mtxcb_table
+tmax_mpfid
+mpfinib_table
+mpfcb_table
+tmax_cycid
+cycinib_table
+cyccb_table
+tmax_almid
+alminib_table
+almcb_table
+ovrinib
+tnum_def_inhno
+inhinib_table
+tnum_cfg_intno
+intinib_table
+tnum_def_excno
+excinib_table
+tmevt_heap
+istksz
+istk
+istkpt
+
+INCLUDE "target"
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_rename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_rename.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_rename.h	(revision 302)
@@ -0,0 +1,392 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+#ifndef TOPPERS_KERNEL_RENAME_H
+#define TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  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
+
+/*
+ *  overrun.c
+ */
+#define ovrtimer_flag				_kernel_ovrtimer_flag
+#define initialize_overrun			_kernel_initialize_overrun
+#define ovrtimer_start				_kernel_ovrtimer_start
+#define ovrtimer_stop				_kernel_ovrtimer_stop
+#define call_ovrhdr					_kernel_call_ovrhdr
+
+/*
+ *  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 ovrinib						_kernel_ovrinib
+#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
+
+
+#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
+
+/*
+ *  overrun.c
+ */
+#define _ovrtimer_flag				__kernel_ovrtimer_flag
+#define _initialize_overrun			__kernel_initialize_overrun
+#define _ovrtimer_start				__kernel_ovrtimer_start
+#define _ovrtimer_stop				__kernel_ovrtimer_stop
+#define _call_ovrhdr				__kernel_call_ovrhdr
+
+/*
+ *  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 _ovrinib					__kernel_ovrinib
+#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"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_unrename.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/kernel_unrename.h	(revision 302)
@@ -0,0 +1,393 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+/* This file is included only when kernel_rename.h has been included. */
+#ifdef TOPPERS_KERNEL_RENAME_H
+#undef TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  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
+
+/*
+ *  overrun.c
+ */
+#undef ovrtimer_flag
+#undef initialize_overrun
+#undef ovrtimer_start
+#undef ovrtimer_stop
+#undef call_ovrhdr
+
+/*
+ *  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 ovrinib
+#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
+
+
+#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
+
+/*
+ *  overrun.c
+ */
+#undef _ovrtimer_flag
+#undef _initialize_overrun
+#undef _ovrtimer_start
+#undef _ovrtimer_stop
+#undef _call_ovrhdr
+
+/*
+ *  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 _ovrinib
+#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"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/overrun.c
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/overrun.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/overrun.c	(revision 302)
@@ -0,0 +1,328 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: overrun.c 458 2015-08-21 14:59:09Z ertl-hiro $
+ */
+
+/*
+ *		ãªã¼ãã©ã³ãã³ãã©æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "overrun.h"
+
+#ifdef TOPPERS_SUPPORT_OVRHDR
+#include "target_timer.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_OVR_ENTER
+#define LOG_OVR_ENTER(p_runtsk)
+#endif /* LOG_OVR_ENTER */
+
+#ifndef LOG_OVR_LEAVE
+#define LOG_OVR_LEAVE(p_runtsk)
+#endif /* LOG_OVR_LEAVE */
+
+#ifndef LOG_STA_OVR_ENTER
+#define LOG_STA_OVR_ENTER(tskid, ovrtim)
+#endif /* LOG_STA_OVR_ENTER */
+
+#ifndef LOG_STA_OVR_LEAVE
+#define LOG_STA_OVR_LEAVE(ercd)
+#endif /* LOG_STA_OVR_LEAVE */
+
+#ifndef LOG_STP_OVR_ENTER
+#define LOG_STP_OVR_ENTER(tskid)
+#endif /* LOG_STP_OVR_ENTER */
+
+#ifndef LOG_STP_OVR_LEAVE
+#define LOG_STP_OVR_LEAVE(ercd)
+#endif /* LOG_STP_OVR_LEAVE */
+
+#ifndef LOG_REF_OVR_ENTER
+#define LOG_REF_OVR_ENTER(tskid, pk_rovr)
+#endif /* LOG_REF_OVR_ENTER */
+
+#ifndef LOG_REF_OVR_LEAVE
+#define LOG_REF_OVR_LEAVE(ercd, pk_rovr)
+#endif /* LOG_REF_OVR_LEAVE */
+
+#ifdef TOPPERS_ovrini
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ããåä½ä¸­ããç¤ºããã©ã°
+ */
+bool_t	ovrtimer_flag;
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©æ©è½ã®åæå
+ */
+void
+initialize_overrun(void)
+{
+	ovrtimer_flag = false;
+}
+
+#endif /* TOPPERS_ovrini */
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©ç¨ã¿ã¤ãã®åä½éå§
+ */
+#ifdef TOPPERS_ovrsta
+#ifndef OMIT_OVRTIMER_START
+
+void
+ovrtimer_start(void)
+{
+	if (p_runtsk->staovr) {
+		target_ovrtimer_start(p_runtsk->leftotm);
+		ovrtimer_flag = true;
+	}
+}
+
+#endif /* OMIT_OVRTIMER_START */
+#endif /* TOPPERS_ovrsta */
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©ç¨ã¿ã¤ãã®åæ­¢
+ */
+#ifdef TOPPERS_ovrstp
+#ifndef OMIT_OVRTIMER_STOP
+
+void
+ovrtimer_stop(void)
+{
+	if (ovrtimer_flag) {
+		assert(p_runtsk != NULL && p_runtsk->staovr);
+		p_runtsk->leftotm = target_ovrtimer_stop();
+		ovrtimer_flag = false;
+	}
+}
+
+#endif /* OMIT_OVRTIMER_STOP */
+#endif /* TOPPERS_ovrstp */
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©ã®åä½éå§
+ */
+#ifdef TOPPERS_sta_ovr
+
+ER
+sta_ovr(ID tskid, PRCTIM ovrtim)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_STA_OVR_ENTER(tskid, ovrtim);
+	CHECK_UNL();
+	CHECK_OBJ(ovrinib[0].ovrhdr != NULL);
+	if (tskid == TSK_SELF && !sense_context()) {
+		p_tcb = p_runtsk;
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));
+		p_tcb = get_tcb(tskid);
+	}
+	CHECK_PAR(0U < ovrtim && ovrtim <= TMAX_OVRTIM);
+
+	lock_cpu();
+	if (!sense_context() && p_tcb == p_runtsk) {
+		if (p_runtsk->staovr) {
+			(void) target_ovrtimer_stop();
+		}
+		target_ovrtimer_start(ovrtim);
+		ovrtimer_flag = true;
+	}
+	p_tcb->staovr = true;
+	p_tcb->leftotm = ovrtim;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_STA_OVR_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_sta_ovr */
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©ã®åä½åæ­¢
+ */
+#ifdef TOPPERS_stp_ovr
+
+ER
+stp_ovr(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_STP_OVR_ENTER(tskid);
+	CHECK_UNL();
+	CHECK_OBJ(ovrinib[0].ovrhdr != NULL);
+	if (tskid == TSK_SELF && !sense_context()) {
+		p_tcb = p_runtsk;
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (!sense_context() && p_tcb == p_runtsk) {
+		if (p_runtsk->staovr) {
+			(void) target_ovrtimer_stop();
+			ovrtimer_flag = false;
+		}
+	}
+	p_tcb->staovr = false;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_STP_OVR_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_stp_ovr */
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_ovr
+
+ER
+ref_ovr(ID tskid, T_ROVR *pk_rovr)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+    
+	LOG_REF_OVR_ENTER(tskid, pk_rovr);
+	CHECK_TSKCTX_UNL();
+	CHECK_OBJ(ovrinib[0].ovrhdr != NULL);
+	if (tskid == TSK_SELF && !sense_context()) {
+		p_tcb = p_runtsk;
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (p_tcb->staovr) {
+		pk_rovr->ovrstat = TOVR_STA;
+		if (p_tcb == p_runtsk) {
+			pk_rovr->leftotm = target_ovrtimer_get_current();
+		}
+		else {
+			pk_rovr->leftotm = p_tcb->leftotm;
+		}
+	}
+	else {
+		pk_rovr->ovrstat = TOVR_STP;
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_OVR_LEAVE(ercd, pk_rovr);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_ovr */
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©èµ·åã«ã¼ãã³
+ *
+ *  ãªã¼ãã©ã³ãã³ãã©ã®å¼åºãå¾ã«ï¼å¼åºãåã®ç¶æ
+ï¼CPUã­ãã¯ãã©ã°ï¼å²
+ *  è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼ã«æ»ããªãã®ã¯ï¼ãã®ã«ã¼ãã³ããã®ãªã¿ã¼ã³å¾ã«ï¼
+ *  å²è¾¼ã¿åºå£å¦çã§å
+ã®ç¶æ
+ã«æ»ãããã§ããï¼
+ */
+#ifdef TOPPERS_ovrcal
+
+void
+call_ovrhdr(void)
+{
+	assert(sense_context());
+	assert(!sense_lock());
+	assert(ovrinib[0].ovrhdr != NULL);
+
+	lock_cpu();
+	if (p_runtsk != NULL && p_runtsk->staovr && p_runtsk->leftotm == 0U) {
+		p_runtsk->staovr = false;
+		unlock_cpu();
+
+		LOG_OVR_ENTER(p_runtsk);
+		((OVRHDR)(ovrinib[0].ovrhdr))(TSKID(p_runtsk),
+											p_runtsk->p_tinib->exinf);
+		LOG_OVR_LEAVE(p_runtsk);
+	}
+	else {
+		/*
+		 *  ãã®ã«ã¼ãã³ãå¼ã³åºãããåã«ï¼ãªã¼ãã©ã³ãã³ãã©ã®èµ·åã
+		 *  ã­ã£ã³ã»ã«ãããå ´å
+		 */
+		unlock_cpu();
+	}
+}
+
+#endif /* TOPPERS_ovrcal */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/overrun.h
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/overrun.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/overrun.h	(revision 302)
@@ -0,0 +1,105 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: overrun.h 443 2015-08-13 03:10:52Z ertl-hiro $
+ */
+
+/*
+ *		ãªã¼ãã©ã³ãã³ãã©æ©è½
+ */
+
+#ifndef TOPPERS_OVERRUN_H
+#define TOPPERS_OVERRUN_H
+
+#ifdef TOPPERS_SUPPORT_OVRHDR
+#include "target_timer.h"
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©åæåãã­ãã¯
+ */
+typedef struct overrun_handler_initialization_block {
+	ATR			ovratr;			/* ãªã¼ãã©ã³ãã³ãã©å±æ§ */
+	OVRHDR		ovrhdr;			/* ãªã¼ãã©ã³ãã³ãã©ã®èµ·åçªå° */
+} OVRINIB;
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const OVRINIB	ovrinib[];
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ããåä½ä¸­ããç¤ºããã©ã°
+ */
+extern bool_t	ovrtimer_flag;
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©æ©è½ã®åæå
+ */
+extern void	initialize_overrun(void);
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©ç¨ã¿ã¤ãã®åä½éå§
+ */
+extern void	ovrtimer_start(void);
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©ç¨ã¿ã¤ãã®åæ­¢
+ */
+extern void	ovrtimer_stop(void);
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©èµ·åã«ã¼ãã³
+ */
+extern void	call_ovrhdr(void);
+
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+#endif /* TOPPERS_OVERRUN_H */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/overrun.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/overrun.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/overrun.tf	(revision 302)
@@ -0,0 +1,106 @@
+$ 
+$   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: overrun.tf 444 2015-08-13 04:39:19Z ertl-hiro $
+$  
+
+$
+$		ãªã¼ãã©ã³ãã³ãã©æ©è½ã®ãã³ãã¬ã¼ããã¡ã¤ã«
+$
+
+$
+$  ãªã¼ãã©ã³ãã³ãã©ããµãã¼ãããã¦ããªãå ´åã®ã¨ã©ã¼ãã§ãã¯
+$
+$IF !TOPPERS_SUPPORT_OVRHDR$
+	$IF LENGTH(OVR.ORDER_LIST)$
+		$ERROR$E_NOSPT:$SPC$
+			$FORMAT(_("%1% is not supported on this target"), "DEF_OVR")$
+		$END$
+	$END$
+$ELSE$
+
+$
+$  kernel_cfg.cã®çæ
+$
+$FILE "kernel_cfg.c"$
+
+/*$NL$
+$SPC$*  Overrun Handler Functions$NL$
+$SPC$*/$NL$
+$NL$
+
+$IF LENGTH(OVR.ORDER_LIST)$
+$	// éçAPIãDEF_OVRããè¤æ°ããï¼E_OBJï¼
+	$IF LENGTH(OVR.ORDER_LIST) > 1$
+		$ERROR$E_OBJ: $FORMAT(_("too many %1%"), "DEF_OVR")$$END$
+	$END$
+
+$	// ovratrãï¼TA_NULLï¼ã§ãªãå ´åï¼E_RSATRï¼
+	$IF OVR.OVRATR[1] != 0$
+		$ERROR OVR.TEXT_LINE[1]$E_RSATR:$SPC$
+			$FORMAT(_("illegal %1% `%2%\' in %3%"),
+						"ovratr", OVR.OVRATR[1], "DEF_OVR")$
+		$END$
+	$END$
+
+$	// ãªã¼ãã©ã³ãã³ãã©åæåãã­ãã¯
+	const OVRINIB _kernel_ovrinib[1] = {$NL$
+		$TAB${ ($OVR.OVRATR[1]$), (OVRHDR)($OVR.OVRHDR[1]$) }$NL$
+	};$NL$
+
+	$initfuncs = APPEND(initfuncs, "_kernel_initialize_overrun();")$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(const OVRINIB, _kernel_ovrinib);$NL$
+$END$$NL$
+
+$END$
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/sys_manage.c
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/sys_manage.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/sys_manage.c	(revision 302)
@@ -0,0 +1,558 @@
+/*
+ *  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: sys_manage.c 470 2015-12-30 09:50:36Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "overrun.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ROT_RDQ_ENTER
+#define LOG_ROT_RDQ_ENTER(tskpri)
+#endif /* LOG_ROT_RDQ_ENTER */
+
+#ifndef LOG_ROT_RDQ_LEAVE
+#define LOG_ROT_RDQ_LEAVE(ercd)
+#endif /* LOG_ROT_RDQ_LEAVE */
+
+#ifndef LOG_GET_TID_ENTER
+#define LOG_GET_TID_ENTER(p_tskid)
+#endif /* LOG_GET_TID_ENTER */
+
+#ifndef LOG_GET_TID_LEAVE
+#define LOG_GET_TID_LEAVE(ercd, p_tskid)
+#endif /* LOG_GET_TID_LEAVE */
+
+#ifndef LOG_GET_LOD_ENTER
+#define LOG_GET_LOD_ENTER(tskpri, p_load)
+#endif /* LOG_GET_LOD_ENTER */
+
+#ifndef LOG_GET_LOD_LEAVE
+#define LOG_GET_LOD_LEAVE(ercd, p_load)
+#endif /* LOG_GET_LOD_LEAVE */
+
+#ifndef LOG_GET_NTH_ENTER
+#define LOG_GET_NTH_ENTER(tskpri, nth, p_tskid)
+#endif /* LOG_GET_NTH_ENTER */
+
+#ifndef LOG_GET_NTH_LEAVE
+#define LOG_GET_NTH_LEAVE(ercd, p_tskid)
+#endif /* LOG_GET_NTH_LEAVE */
+
+#ifndef LOG_LOC_CPU_ENTER
+#define LOG_LOC_CPU_ENTER()
+#endif /* LOG_LOC_CPU_ENTER */
+
+#ifndef LOG_LOC_CPU_LEAVE
+#define LOG_LOC_CPU_LEAVE(ercd)
+#endif /* LOG_LOC_CPU_LEAVE */
+
+#ifndef LOG_UNL_CPU_ENTER
+#define LOG_UNL_CPU_ENTER()
+#endif /* LOG_UNL_CPU_ENTER */
+
+#ifndef LOG_UNL_CPU_LEAVE
+#define LOG_UNL_CPU_LEAVE(ercd)
+#endif /* LOG_UNL_CPU_LEAVE */
+
+#ifndef LOG_DIS_DSP_ENTER
+#define LOG_DIS_DSP_ENTER()
+#endif /* LOG_DIS_DSP_ENTER */
+
+#ifndef LOG_DIS_DSP_LEAVE
+#define LOG_DIS_DSP_LEAVE(ercd)
+#endif /* LOG_DIS_DSP_LEAVE */
+
+#ifndef LOG_ENA_DSP_ENTER
+#define LOG_ENA_DSP_ENTER()
+#endif /* LOG_ENA_DSP_ENTER */
+
+#ifndef LOG_ENA_DSP_LEAVE
+#define LOG_ENA_DSP_LEAVE(ercd)
+#endif /* LOG_ENA_DSP_LEAVE */
+
+#ifndef LOG_SNS_CTX_ENTER
+#define LOG_SNS_CTX_ENTER()
+#endif /* LOG_SNS_CTX_ENTER */
+
+#ifndef LOG_SNS_CTX_LEAVE
+#define LOG_SNS_CTX_LEAVE(state)
+#endif /* LOG_SNS_CTX_LEAVE */
+
+#ifndef LOG_SNS_LOC_ENTER
+#define LOG_SNS_LOC_ENTER()
+#endif /* LOG_SNS_LOC_ENTER */
+
+#ifndef LOG_SNS_LOC_LEAVE
+#define LOG_SNS_LOC_LEAVE(state)
+#endif /* LOG_SNS_LOC_LEAVE */
+
+#ifndef LOG_SNS_DSP_ENTER
+#define LOG_SNS_DSP_ENTER()
+#endif /* LOG_SNS_DSP_ENTER */
+
+#ifndef LOG_SNS_DSP_LEAVE
+#define LOG_SNS_DSP_LEAVE(state)
+#endif /* LOG_SNS_DSP_LEAVE */
+
+#ifndef LOG_SNS_DPN_ENTER
+#define LOG_SNS_DPN_ENTER()
+#endif /* LOG_SNS_DPN_ENTER */
+
+#ifndef LOG_SNS_DPN_LEAVE
+#define LOG_SNS_DPN_LEAVE(state)
+#endif /* LOG_SNS_DPN_LEAVE */
+
+#ifndef LOG_SNS_KER_ENTER
+#define LOG_SNS_KER_ENTER()
+#endif /* LOG_SNS_KER_ENTER */
+
+#ifndef LOG_SNS_KER_LEAVE
+#define LOG_SNS_KER_LEAVE(state)
+#endif /* LOG_SNS_KER_LEAVE */
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+é ä½ã®åè»¢
+ */
+#ifdef TOPPERS_rot_rdq
+
+ER
+rot_rdq(PRI tskpri)
+{
+	uint_t	pri;
+	ER		ercd;
+
+	LOG_ROT_RDQ_ENTER(tskpri);
+	CHECK_UNL();
+	if (tskpri == TPRI_SELF && !sense_context()) {
+		pri = p_runtsk->bpriority;
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));
+		pri = INT_PRIORITY(tskpri);
+	}
+
+	lock_cpu();
+	rotate_ready_queue(&(ready_queue[pri]));
+	if (p_runtsk != p_schedtsk) {
+		if (!sense_context()) {
+			dispatch();
+		}
+		else {
+			request_dispatch();
+		}
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_ROT_RDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rot_rdq */
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯IDã®åç
+§
+ */
+#ifdef TOPPERS_get_tid
+
+ER
+get_tid(ID *p_tskid)
+{
+	ER		ercd;
+
+	LOG_GET_TID_ENTER(p_tskid);
+	CHECK_UNL();
+
+	lock_cpu();
+	*p_tskid = (p_runtsk == NULL) ? TSK_NONE : TSKID(p_runtsk);
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_TID_LEAVE(ercd, p_tskid);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_tid */
+
+/*
+ *  å®è¡ã§ããã¿ã¹ã¯ã®æ°ã®åç
+§
+ */
+#ifdef TOPPERS_get_lod
+
+ER
+get_lod(PRI tskpri, uint_t *p_load)
+{
+	uint_t	pri, load;
+	QUEUE	*p_queue, *p_entry;
+	ER		ercd;
+
+	LOG_GET_LOD_ENTER(p_tskid, p_load);
+	CHECK_TSKCTX_UNL();
+	if (tskpri == TPRI_SELF) {
+		pri = p_runtsk->bpriority;
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));
+		pri = INT_PRIORITY(tskpri);
+	}
+	p_queue = &(ready_queue[pri]);
+
+	lock_cpu();
+	load = 0U;
+	for (p_entry = p_queue->p_next; p_entry != p_queue;
+										p_entry = p_entry->p_next) {
+		load += 1U;
+	}
+	*p_load = load;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_LOD_LEAVE(ercd, p_load);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_lod */
+
+/*
+ *  æå®ããåªå
+é ä½ã®ã¿ã¹ã¯IDã®åç
+§
+ */
+#ifdef TOPPERS_get_nth
+
+ER
+get_nth(PRI tskpri, uint_t nth, ID *p_tskid)
+{
+	uint_t	pri;
+	QUEUE	*p_queue, *p_entry;
+	ID		tskid;
+	ER		ercd;
+
+	LOG_GET_NTH_ENTER(p_tskid, nth, p_tskid);
+	CHECK_TSKCTX_UNL();
+	if (tskpri == TPRI_SELF) {
+		pri = p_runtsk->bpriority;
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));
+		pri = INT_PRIORITY(tskpri);
+	}
+	p_queue = &(ready_queue[pri]);
+
+	lock_cpu();
+	tskid = TSK_NONE;
+	for (p_entry = p_queue->p_next; p_entry != p_queue;
+										p_entry = p_entry->p_next) {
+		if (nth == 0U) {
+			tskid = TSKID((TCB *) p_entry);
+			break;
+		}
+		nth -= 1U;
+	}
+	*p_tskid = tskid;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_NTH_LEAVE(ercd, p_tskid);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_nth */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_loc_cpu
+
+ER
+loc_cpu(void)
+{
+	ER		ercd;
+
+	LOG_LOC_CPU_ENTER();
+
+	if (!sense_lock()) {
+		lock_cpu();
+	}
+	ercd = E_OK;
+
+	LOG_LOC_CPU_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_loc_cpu */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®è§£é¤
+ *
+ *  CPUã­ãã¯ä¸­ã¯ï¼ãã£ã¹ããããå¿
+è¦ã¨ãªããµã¼ãã¹ã³ã¼ã«ãå¼ã³åºãã
+ *  ã¨ã¯ã§ããªãããï¼CPUã­ãã¯ç¶æ
+ã®è§£é¤æã«ãã£ã¹ãããã£ãèµ·åãã
+ *  å¿
+è¦ã¯ãªãï¼
+ */
+#ifdef TOPPERS_unl_cpu
+
+ER
+unl_cpu(void)
+{
+	ER		ercd;
+
+	LOG_UNL_CPU_ENTER();
+
+	if (sense_lock()) {
+		unlock_cpu();
+	}
+	ercd = E_OK;
+
+	LOG_UNL_CPU_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_unl_cpu */
+
+/*
+ *  ãã£ã¹ãããã®ç¦æ­¢
+ */
+#ifdef TOPPERS_dis_dsp
+
+ER
+dis_dsp(void)
+{
+	ER		ercd;
+
+	LOG_DIS_DSP_ENTER();
+	CHECK_TSKCTX_UNL();
+
+	lock_cpu();
+	enadsp = false;
+	dspflg = false;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_DIS_DSP_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_dis_dsp */
+
+/*
+ *  ãã£ã¹ãããã®è¨±å¯
+ */
+#ifdef TOPPERS_ena_dsp
+
+ER
+ena_dsp(void)
+{
+	ER		ercd;
+
+	LOG_ENA_DSP_ENTER();
+	CHECK_TSKCTX_UNL();
+
+	lock_cpu();
+	enadsp = true;
+	if (t_get_ipm() == TIPM_ENAALL) {
+		dspflg = true;
+		p_schedtsk = search_schedtsk();
+		if (p_runtsk->raster && p_runtsk->enater) {
+#ifdef TOPPERS_SUPPORT_OVRHDR
+			if (p_runtsk->staovr) {
+				(void) target_ovrtimer_stop();
+				ovrtimer_flag = false;
+			}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+			task_terminate(p_runtsk);
+			exit_and_dispatch();
+			ercd = E_SYS;
+		}
+		else {
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}
+			ercd = E_OK;
+		}
+	}
+	else {
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ENA_DSP_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ena_dsp */
+
+/*
+ *  ã³ã³ãã­ã¹ãã®åç
+§
+ */
+#ifdef TOPPERS_sns_ctx
+
+bool_t
+sns_ctx(void)
+{
+	bool_t	state;
+
+	LOG_SNS_CTX_ENTER();
+	state = sense_context() ? true : false;
+	LOG_SNS_CTX_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_ctx */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_loc
+
+bool_t
+sns_loc(void)
+{
+	bool_t	state;
+
+	LOG_SNS_LOC_ENTER();
+	state = sense_lock() ? true : false;
+	LOG_SNS_LOC_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_loc */
+
+/*
+ *  ãã£ã¹ãããç¦æ­¢ç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_dsp
+
+bool_t
+sns_dsp(void)
+{
+	bool_t	state;
+
+	LOG_SNS_DSP_ENTER();
+	state = !enadsp;
+	LOG_SNS_DSP_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_dsp */
+
+/*
+ *  ãã£ã¹ãããä¿çç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_dpn
+
+bool_t
+sns_dpn(void)
+{
+	bool_t	state;
+
+	LOG_SNS_DPN_ENTER();
+	state = (sense_context() || sense_lock() || !dspflg) ? true : false;
+	LOG_SNS_DPN_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_dpn */
+
+/*
+ *  ã«ã¼ãã«éåä½ç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_ker
+
+bool_t
+sns_ker(void)
+{
+	bool_t	state;
+
+	LOG_SNS_KER_ENTER();
+	state = kerflg ? false : true;
+	LOG_SNS_KER_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_ker */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/task.c
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/task.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/task.c	(revision 302)
@@ -0,0 +1,480 @@
+/*
+ *  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: task.c 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#include "kernel_impl.h"
+#include "task.h"
+#include "taskhook.h"
+#include "wait.h"
+
+#ifdef TOPPERS_tskini
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯
+ */
+TCB		*p_runtsk;
+
+/*
+ *  å®è¡ãã¹ãã¿ã¹ã¯
+ */
+TCB		*p_schedtsk;
+
+/*
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+
+ */
+bool_t	enadsp;
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããå¯è½ç¶æ
+
+ */
+bool_t	dspflg;
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼
+ */
+QUEUE	ready_queue[TNUM_TPRI];
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ãµã¼ãã®ããã®ãããããã
+ */
+uint16_t	ready_primap;
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®åæå
+ */
+void
+initialize_task(void)
+{
+	uint_t	i, j;
+	TCB		*p_tcb;
+
+	p_runtsk = NULL;
+	p_schedtsk = NULL;
+	enadsp = true;
+	dspflg = true;
+
+	for (i = 0; i < TNUM_TPRI; i++) {
+		queue_initialize(&(ready_queue[i]));
+	}
+	ready_primap = 0U;
+
+	for (i = 0; i < tnum_tsk; i++) {
+		j = INDEX_TSK(torder_table[i]);
+		p_tcb = &(tcb_table[j]);
+		p_tcb->p_tinib = &(tinib_table[j]);
+		p_tcb->actque = false;
+		make_dormant(p_tcb);
+		p_tcb->p_lastmtx = NULL;
+		if ((p_tcb->p_tinib->tskatr & TA_ACT) != 0U) {
+			make_active(p_tcb);
+		}
+	}
+}
+
+#endif /* TOPPERS_tskini */
+
+/*
+ *  ãããããããµã¼ãé¢æ°
+ *
+ *  bitmapå
+ã®1ã®ãããã®å
+ï¼æãä¸ä½ï¼å³ï¼ã®ãã®ããµã¼ããï¼ãã®ãã
+ *  ãçªå·ãè¿ãï¼ãããçªå·ã¯ï¼æä¸ä½ãããã0ã¨ããï¼bitmapã«0ãæå®
+ *  ãã¦ã¯ãªããªãï¼ãã®é¢æ°ã§ã¯ï¼bitmapã16ãããã§ãããã¨ãä»®å®ãï¼
+ *  uint16_tåã¨ãã¦ããï¼
+ *
+ *  ããããµã¼ãå½ä»¤ãæã¤ãã­ã»ããµã§ã¯ï¼ããããµã¼ãå½ä»¤ãä½¿ãããã«
+ *  æ¸ãç´ããæ¹ãå¹çãè¯ãå ´åãããï¼ãã®ãããªå ´åã«ã¯ï¼ã¿ã¼ã²ãã
+ *  ä¾å­é¨ã§ããããµã¼ãå½ä»¤ãä½¿ã£ãbitmap_searchãå®ç¾©ãï¼
+ *  OMIT_BITMAP_SEARCHããã¯ã­å®ç¾©ããã°ããï¼ã¾ãï¼ããããµã¼ãå½ä»¤ã®
+ *  ãµã¼ãæ¹åãéãªã©ã®çç±ã§åªå
+åº¦ã¨ãããã¨ã®å¯¾å¿ãå¤æ´ãããå ´åã«
+ *  ã¯ï¼PRIMAP_BITããã¯ã­å®ç¾©ããã°ããï¼
+ *
+ *  ã¾ãï¼ã©ã¤ãã©ãªã«ffsããããªãï¼æ¬¡ã®ããã«å®ç¾©ãã¦ã©ã¤ãã©ãªé¢æ°ã
+ *  ä½¿ã£ãæ¹ãå¹çãè¯ãå¯è½æ§ãããï¼
+ *		#define	bitmap_search(bitmap) (ffs(bitmap) - 1)
+ */
+#ifndef PRIMAP_BIT
+#define	PRIMAP_BIT(pri)		(1U << (pri))
+#endif /* PRIMAP_BIT */
+
+#ifndef OMIT_BITMAP_SEARCH
+
+static const unsigned char bitmap_search_table[] = { 0, 1, 0, 2, 0, 1, 0,
+												3, 0, 1, 0, 2, 0, 1, 0 };
+
+Inline uint_t
+bitmap_search(uint16_t bitmap)
+{
+	uint_t	n = 0U;
+
+	assert(bitmap != 0U);
+	if ((bitmap & 0x00ffU) == 0U) {
+		bitmap >>= 8;
+		n += 8;
+	}
+	if ((bitmap & 0x0fU) == 0U) {
+		bitmap >>= 4;
+		n += 4;
+	}
+	return(n + bitmap_search_table[(bitmap & 0x0fU) - 1]);
+}
+
+#endif /* OMIT_BITMAP_SEARCH */
+
+/*
+ *  åªå
+åº¦ãããããããç©ºãã®ãã§ãã¯
+ */
+Inline bool_t
+primap_empty(void)
+{
+	return(ready_primap == 0U);
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ãµã¼ã
+ */
+Inline uint_t
+primap_search(void)
+{
+	return(bitmap_search(ready_primap));
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ã»ãã
+ */
+Inline void
+primap_set(uint_t pri)
+{
+	ready_primap |= PRIMAP_BIT(pri);
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ã¯ãªã¢
+ */
+Inline void
+primap_clear(uint_t pri)
+{
+	ready_primap &= ~PRIMAP_BIT(pri);
+}
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã®ãµã¼ã
+ */
+#ifdef TOPPERS_tsksched
+
+TCB *
+search_schedtsk(void)
+{
+	uint_t	schedpri;
+
+	schedpri = primap_search();
+	return((TCB *)(ready_queue[schedpri].p_next));
+}
+
+#endif /* TOPPERS_tsksched */
+
+/*
+ *  å®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼å®è¡ã§ããã¿ã¹ã¯ããªãã£ãå ´åã¨ï¼
+ *  p_tcbã®åªå
+åº¦ãå®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã§ããï¼
+ */
+#ifdef TOPPERS_tskrun
+
+void
+make_runnable(TCB *p_tcb)
+{
+	uint_t	pri = p_tcb->priority;
+
+	queue_insert_prev(&(ready_queue[pri]), &(p_tcb->task_queue));
+	primap_set(pri);
+
+	if (dspflg) {
+		if (p_schedtsk == (TCB *) NULL || pri < p_schedtsk->priority) {
+			p_schedtsk = p_tcb;
+		}
+	}
+}
+
+#endif /* TOPPERS_tskrun */
+
+/*
+ *  å®è¡ã§ããç¶æ
+ããä»ã®ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ãå ´å
+ *  ã§ããï¼p_tcbã¨åãåªå
+åº¦ã®ã¿ã¹ã¯ãä»ã«ããå ´åã¯ï¼p_tcbã®æ¬¡ã®ã¿ã¹
+ *  ã¯ãå®è¡ãã¹ãã¿ã¹ã¯ã«ãªãï¼ããã§ãªãå ´åã¯ï¼ã¬ãã£ã­ã¥ã¼ããµã¼ã
+ *  ããå¿
+è¦ãããï¼
+ */
+#ifdef TOPPERS_tsknrun
+
+void
+make_non_runnable(TCB *p_tcb)
+{
+	uint_t	pri = p_tcb->priority;
+	QUEUE	*p_queue = &(ready_queue[pri]);
+
+	queue_delete(&(p_tcb->task_queue));
+	if (queue_empty(p_queue)) {
+		primap_clear(pri);
+		if (p_schedtsk == p_tcb) {
+			assert(dspflg);
+			p_schedtsk = primap_empty() ? (TCB *) NULL : search_schedtsk();
+		}
+	}
+	else {
+		if (p_schedtsk == p_tcb) {
+			assert(dspflg);
+			p_schedtsk = (TCB *)(p_queue->p_next);
+		}
+	}
+}
+
+#endif /* TOPPERS_tsknrun */
+
+/*
+ *  ä¼æ­¢ç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_tskdmt
+
+void
+make_dormant(TCB *p_tcb)
+{
+	p_tcb->tstat = TS_DORMANT;
+	p_tcb->bpriority = p_tcb->p_tinib->ipriority;
+	p_tcb->priority = p_tcb->p_tinib->ipriority;
+	p_tcb->wupque = false;
+	p_tcb->raster = false;
+	p_tcb->enater = true;
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	p_tcb->staovr = false;
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	LOG_TSKSTAT(p_tcb);
+}
+
+#endif /* TOPPERS_tskdmt */
+
+/*
+ *  ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_tskact
+
+void
+make_active(TCB *p_tcb)
+{
+	activate_context(p_tcb);
+	p_tcb->tstat = TS_RUNNABLE;
+	LOG_TSKSTAT(p_tcb);
+	make_runnable(p_tcb);
+}
+
+#endif /* TOPPERS_tskact */
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+åº¦ã®å¤æ´
+ *
+ *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã®å ´åã«ã¯ï¼ã¬ãã£ã­ã¥ã¼ã®ä¸­ã§ã®ä½ç½®ãå¤æ´ã
+ *  ãï¼ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã®ä¸­ã§å¾
+ã¡ç¶æ
+ã«ãªã£ã¦ããå ´åã«ã¯ï¼å¾
+
+ *  ã¡ã­ã¥ã¼ã®ä¸­ã§ã®ä½ç½®ãå¤æ´ããï¼
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼(1) p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ã¦ï¼
+ *  ãã®åªå
+åº¦ãä¸ããå ´åï¼(2) p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ã¯ãªãï¼å¤æ´å¾
+ *  ã®åªå
+åº¦ãå®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã§ããï¼(1)ã®å ´åã«
+ *  ã¯ï¼ã¬ãã£ã­ã¥ã¼ããµã¼ãããå¿
+è¦ãããï¼
+ */
+#ifdef TOPPERS_tskpri
+
+void
+change_priority(TCB *p_tcb, uint_t newpri, bool_t mtxmode)
+{
+	uint_t	oldpri;
+
+	oldpri = p_tcb->priority;
+	p_tcb->priority = newpri;
+
+	if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		/*
+		 *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã®å ´å
+		 */
+		queue_delete(&(p_tcb->task_queue));
+		if (queue_empty(&(ready_queue[oldpri]))) {
+			primap_clear(oldpri);
+		}
+		if (mtxmode) {
+			queue_insert_next(&(ready_queue[newpri]), &(p_tcb->task_queue));
+		}
+		else {
+			queue_insert_prev(&(ready_queue[newpri]), &(p_tcb->task_queue));
+		}
+		primap_set(newpri);
+
+		if (dspflg) {
+			if (p_schedtsk == p_tcb) {
+				if (newpri >= oldpri) {
+					p_schedtsk = search_schedtsk();
+				}
+			}
+			else {
+				if (mtxmode ? newpri <= p_schedtsk->priority
+							: newpri < p_schedtsk->priority) {
+					p_schedtsk = p_tcb;
+				}
+			}
+		}
+	}
+	else {
+		if (TSTAT_WAIT_WOBJCB(p_tcb->tstat)) {
+			/*
+			 *  ã¿ã¹ã¯ãï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨
+			 *  åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ããå ´å
+			 */
+			wobj_change_priority(((WINFO_WOBJ *)(p_tcb->p_winfo))->p_wobjcb,
+																	p_tcb);
+		}
+	}
+}
+
+#endif /* TOPPERS_tskpri */
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ã®åè»¢
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãã¿ã¹ã¯ã­ã¥ã¼ã®æ«
+ *  å°¾ã«ç§»åããå ´åã§ããï¼
+ */
+#ifdef TOPPERS_tskrot
+
+void
+rotate_ready_queue(QUEUE *p_queue)
+{
+	QUEUE	*p_entry;
+
+	if (!queue_empty(p_queue) && p_queue->p_next->p_next != p_queue) {
+		p_entry = queue_delete_next(p_queue);
+		queue_insert_prev(p_queue, p_entry);
+		if (dspflg) {
+			if (p_schedtsk == (TCB *) p_entry) {
+				p_schedtsk = (TCB *)(p_queue->p_next);
+			}
+		}
+	}
+}
+
+#endif /* TOPPERS_tskrot */
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºå¦ç
+ */
+#ifdef TOPPERS_tskterm
+
+void
+task_terminate(TCB *p_tcb)
+{
+	if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		make_non_runnable(p_tcb);
+	}
+	else if (TSTAT_WAITING(p_tcb->tstat)) {
+		wait_dequeue_wobj(p_tcb);
+		wait_dequeue_tmevtb(p_tcb);
+	}
+	if (p_tcb->p_lastmtx != NULL) {
+		(*mtxhook_release_all)(p_tcb);
+	}
+	make_dormant(p_tcb);
+	if (p_tcb->actque) {
+		p_tcb->actque = false;
+		make_active(p_tcb);
+	}
+}
+
+#endif /* TOPPERS_tskterm */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/task.h
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/task.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/task.h	(revision 302)
@@ -0,0 +1,654 @@
+/*
+ *  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: task.h 458 2015-08-21 14:59:09Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_TASK_H
+#define TOPPERS_TASK_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "time_event.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_TSKSTAT
+#define LOG_TSKSTAT(p_tcb)
+#endif /* LOG_TSKSTAT */
+
+/*
+ *  ã¿ã¹ã¯åªå
+åº¦ã®å
+é¨è¡¨ç¾ã»å¤é¨è¡¨ç¾å¤æãã¯ã­
+ */
+#define INT_PRIORITY(x)		((uint_t)((x) - TMIN_TPRI))
+#define EXT_TSKPRI(x)		((PRI)(x) + TMIN_TPRI)
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+ã®å
+é¨è¡¨ç¾
+ *
+ *  TCBä¸­ã®ã¿ã¹ã¯ç¶æ
+ã®ãã£ã¼ã«ãã§ã¯ï¼ã¿ã¹ã¯ã®ç¶æ
+ã¨ï¼ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+
+ *  ã®æã®å¾
+ã¡è¦å ãè¡¨ãï¼ãã ãï¼å®è¡ç¶æ
+ï¼RUNNINGï¼ã¨å®è¡å¯è½ç¶æ
+
+ *  ï¼READYï¼ã¯åºå¥ããï¼ä¸¡ç¶æ
+ããããã¦å®è¡ã§ããç¶æ
+ï¼RUNNABLEï¼ã¨ã
+ *  ã¦ç®¡çããï¼äºéå¾
+ã¡ç¶æ
+ã¯ï¼(TS_WAITING_??? | TS_SUSPENDED)ã§è¡¨ãï¼
+ *
+ *  ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ãå«ãï¼ã®æã¯ï¼TS_WAITING_???ã§å¾
+ã¡
+ *  è¦å ãè¡¨ãï¼å¾
+ã¡è¦å ï¼5ãããã§è¡¨ç¾ãããï¼ã®ä¸ä½2ãããã§ï¼åæã»
+ *  éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãã£ã¦ãããã©ãããè¡¨ãï¼åæã»
+ *  éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãããªããã®ã¯ä¸ä½2ãããã00ï¼å
+ *  æã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼
+ *  ã«ã¤ãªãããã®ã¯10ã¾ãã¯11ï¼ããä»¥å¤ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãããã®ã¯01
+ *  ã¨ããï¼
+ */
+#define TS_DORMANT		0x00U			/* ä¼æ­¢ç¶æ
+ */
+#define TS_RUNNABLE		0x01U			/* å®è¡ã§ããç¶æ
+ */
+#define TS_SUSPENDED	0x02U			/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+
+#define TS_WAITING_SLP	(0x01U << 2)	/* èµ·åºå¾
+ã¡ */
+#define TS_WAITING_DLY	(0x02U << 2)	/* æéçµéå¾
+ã¡ */
+#define TS_WAITING_RDTQ	(0x08U << 2)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TS_WAITING_RPDQ	(0x09U << 2)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TS_WAITING_SEM	(0x10U << 2)	/* ã»ããã©è³æºã®ç²å¾å¾
+ã¡ */
+#define TS_WAITING_FLG	(0x11U << 2)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TS_WAITING_SDTQ	(0x12U << 2)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TS_WAITING_SPDQ	(0x13U << 2)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TS_WAITING_MTX	(0x14U << 2)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ */
+#define TS_WAITING_MPF	(0x15U << 2)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TS_WAITING_MASK	(0x1fU << 2)	/* å¾
+ã¡ç¶æ
+ã®å¤å¥ç¨ãã¹ã¯ */
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+å¤å¥ãã¯ã­
+ *
+ *  TSTAT_DORMANTã¯ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ã§ãããã©ãããï¼TSTAT_RUNNABLEã¯
+ *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ãããã©ãããå¤å¥ããï¼TSTAT_WAITINGã¯å¾
+
+ *  ã¡ç¶æ
+ã¨äºéå¾
+ã¡ç¶æ
+ã®ããããã§ãããã©ãããï¼TSTAT_SUSPENDEDã¯
+ *  å¼·å¶å¾
+ã¡ç¶æ
+ã¨äºéå¾
+ã¡ç¶æ
+ã®ããããã§ãããã©ãããå¤å¥ããï¼
+ */
+#define TSTAT_DORMANT(tstat)	((tstat) == TS_DORMANT)
+#define TSTAT_RUNNABLE(tstat)	(((tstat) & TS_RUNNABLE) != 0U)
+#define TSTAT_WAITING(tstat)	(((tstat) & TS_WAITING_MASK) != 0U)
+#define TSTAT_SUSPENDED(tstat)	(((tstat) & TS_SUSPENDED) != 0U)
+
+/*
+ *  ã¿ã¹ã¯å¾
+ã¡è¦å å¤å¥ãã¯ã­
+ *
+ *  TSTAT_WAIT_SLPã¯ã¿ã¹ã¯ãèµ·åºå¾
+ã¡ã§ãããã©ãããï¼TSTAT_WAIT_MTXã¯
+ *  ã¿ã¹ã¯ããã¥ã¼ããã¯ã¹å¾
+ã¡ã§ãããã©ãããå¤å¥ããï¼
+ *
+ *  ã¾ãï¼TSTAT_WAIT_WOBJ ã¯ã¿ã¹ã¯ãåæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡
+ *  ã§ãããï¼è¨ãæããã¨ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªã
+ *  ãã¦ãããï¼ã©ãããï¼TSTAT_WAIT_WOBJCBã¯ã¿ã¹ã¯ãåæã»éä¿¡ãªãã¸ã§
+ *  ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ãã
+ *  ãã©ãããå¤å¥ããï¼
+ */
+#define TSTAT_WAIT_SLP(tstat)	(((tstat) & ~TS_SUSPENDED) == TS_WAITING_SLP)
+#define TSTAT_WAIT_MTX(tstat)	(((tstat) & ~TS_SUSPENDED) == TS_WAITING_MTX)
+
+#define TSTAT_WAIT_WOBJ(tstat)		(((tstat) & (0x18U << 2)) != 0U)
+#define TSTAT_WAIT_WOBJCB(tstat)	(((tstat) & (0x10U << 2)) != 0U)
+
+/*
+ *  å¾
+ã¡æ
+å ±ãã­ãã¯ï¼WINFOï¼ã®å®ç¾©
+ *
+ *  ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã®éã¯ï¼TCBããã³ãã®p_winfoã§æãããWINFOãæ¬¡ã®
+ *  ããã«è¨­å®ããªããã°ãªããªãï¼
+ *
+ *  (a) TCBã®ã¿ã¹ã¯ç¶æ
+ãå¾
+ã¡ç¶æ
+ï¼TS_WAITING_???ï¼ã«ããï¼
+ *
+ *  (b) ã¿ã¤ã ã¢ã¦ããç£è¦ããããã«ï¼ã¿ã¤ã ã¤ãã³ããã­ãã¯ãç»é²ããï¼
+ *  ç»é²ããã¿ã¤ã ã¤ãã³ããã­ãã¯ã¯ï¼å¾
+ã¡ã«å
+¥ããµã¼ãã¹ã³ã¼ã«å¦çé¢æ°
+ *  ã®ã­ã¼ã«ã«å¤æ°ã¨ãã¦ç¢ºä¿ãï¼ããã¸ã®ãã¤ã³ã¿ãWINFOã®p_tmevtbã«è¨
+ *  æ¶ããï¼ã¿ã¤ã ã¢ã¦ãã®ç£è¦ãå¿
+è¦ãªãå ´åï¼æ°¸ä¹
+å¾
+ã¡ã®å ´åï¼ã«ã¯ï¼
+ *  p_tmevtbãNULLã«ããï¼
+ *
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã®å ´åã«ã¯ï¼æ¨æºã®WINFOã«
+ *  p_wobjcbãã£ã¼ã«ããè¿½å ããæ§é ä½ï¼WINFO_WOBJï¼wait.hã§å®ç¾©ï¼ã«ï¼
+ *  å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã«ä¾å­ãã¦è¨æ¶ãããã¨ãå¿
+è¦ãªæ
+å ±
+ *  ã®ããã®ãã£ã¼ã«ããè¿½å ããæ§é ä½ï¼WINFO_???ï¼ãå®ç¾©ãï¼WINFOã®ä»£
+ *  ããã«ç¨ããï¼ã¾ãï¼ä»¥ä¸ã®(c)ã(e)ã®è¨­å®ãè¡ãå¿
+è¦ãããï¼åæã»é
+ *  ä¿¡ãªãã¸ã§ã¯ãã«é¢ä¿ããªãå¾
+ã¡ï¼èµ·åºå¾
+ã¡ï¼æéçµéå¾
+ã¡ï¼ã®å ´åã«ã¯ï¼
+ *  ãããã¯å¿
+è¦ãªãï¼
+ *
+ *  (c) TCBãå¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãï¼å¾
+
+ *  ã¡ã­ã¥ã¼ã«ã¤ãªãããã«ï¼task_queueãä½¿ãï¼
+ *
+ *  (d) å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã¸ã®ãã¤ã³ã¿ãï¼
+ *  WINFO_WOBJã®p_wobjcbã«è¨æ¶ããï¼
+ *
+ *  (e) å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã«ä¾å­ãã¦è¨æ¶ãããã¨ãå¿
+è¦ãª
+ *  æ
+å ±ãããå ´åã«ã¯ï¼WINFO_???å
+ã®ãã£ã¼ã«ãã«è¨æ¶ããï¼
+ *
+ *  å¾
+ã¡ç¶æ
+ãè§£é¤ããéã«ã¯ï¼å¾
+ã¡è§£é¤ããã¿ã¹ã¯ã«å¯¾ããè¿å¤ãWINFOã®
+ *  wercdã«è¨­å®ããï¼wercdãå¿
+è¦ãªã®ã¯å¾
+ã¡è§£é¤ä»¥éã§ããã®ã«å¯¾ãã¦ï¼
+ *  p_tmevtbã¯å¾
+ã¡è§£é¤å¾ã¯å¿
+è¦ãªãããï¼ã¡ã¢ãªç¯ç´ã®ããã«å
+±ç¨ä½ãä½¿ã£
+ *  ã¦ããï¼ãã®ããï¼wercdã¸ã¨ã©ã¼ã³ã¼ããè¨­å®ããã®ã¯ï¼ã¿ã¤ã ã¤ãã³ã
+ *  ãã­ãã¯ãç»é²è§£é¤ããå¾ã«ããªããã°ãªããªãï¼
+ */
+typedef union waiting_information {
+	ER		wercd;			/* å¾
+ã¡è§£é¤æã®ã¨ã©ã¼ã³ã¼ã */
+	TMEVTB	*p_tmevtb;		/* å¾
+ã¡ç¶æ
+ç¨ã®ã¿ã¤ã ã¤ãã³ããã­ãã¯ */
+} WINFO;
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ã®åã®åæ¹åç
+§
+ */
+typedef struct mutex_control_block MTXCB;
+
+/*
+ *  ã¿ã¹ã¯åæåãã­ãã¯
+ *
+ *  ã¿ã¹ã¯ã«é¢ããæ
+å ±ãï¼å¤ãå¤ãããªãããã«ROMã«ç½®ããé¨åï¼ã¿ã¹ã¯
+ *  åæåãã­ãã¯ï¼ã¨ï¼å¤ãå¤åããããã«RAMã«ç½®ããªããã°ãªããªãé¨
+ *  åï¼ã¿ã¹ã¯ç®¡çãã­ãã¯ï¼TCBï¼ã«åé¢ãï¼TCBå
+ã«å¯¾å¿ããã¿ã¹ã¯åæå
+ *  ãã­ãã¯ãæããã¤ã³ã¿ãå
+¥ããï¼ã¿ã¹ã¯åæåãã­ãã¯å
+ã«å¯¾å¿ãã
+ *  TCBãæããã¤ã³ã¿ãå
+¥ããæ¹æ³ã®æ¹ãï¼RAMã®ç¯ç´ã®è¦³ç¹ããã¯æã¾ãã
+ *  ãï¼å®è¡å¹çãæªããªãããã«æ¡ç¨ãã¦ããªãï¼ä»ã®ãªãã¸ã§ã¯ãã«ã¤ã
+ *  ã¦ãåæ§ã«æ±ãï¼
+ */
+typedef struct task_initialization_block {
+	ATR			tskatr;			/* ã¿ã¹ã¯å±æ§ */
+	intptr_t	exinf;			/* ã¿ã¹ã¯ã®æ¡å¼µæ
+å ± */
+	TASK		task;			/* ã¿ã¹ã¯ã®èµ·åçªå° */
+	uint_t		ipriority;		/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼ */
+
+#ifdef USE_TSKINICTXB
+	TSKINICTXB	tskinictxb;		/* ã¿ã¹ã¯åæåã³ã³ãã­ã¹ããã­ãã¯ */
+#else /* USE_TSKINICTXB */
+	size_t		stksz;			/* ã¹ã¿ãã¯é åã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
+	void		*stk;			/* ã¹ã¿ãã¯é åã®å
+é ­çªå° */
+#endif /* USE_TSKINICTXB */
+} TINIB;
+
+/*
+ *  ã¿ã¹ã¯ç®¡çãã­ãã¯ï¼TCBï¼
+ *
+ *  ASPã«ã¼ãã«ã§ã¯ï¼ã¿ã¹ã¯ã®èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ï¼TMAX_ACTCNTï¼
+ *  ã¨èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ï¼TMAX_WUPCNTï¼ã¯1ã«åºå®ããã¦ãã
+ *  ããï¼ã­ã¥ã¼ã¤ã³ã°ããã¦ãããã©ããã®çå½å¤ã§è¡¨ç¾ãããã¨ãã§ããï¼
+ *  ã¾ãï¼å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ã®æå¤§å¤ï¼TMAX_SUSCNTï¼ã1ã«åºå®ããã¦ã
+ *  ãã®ã§ï¼å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ï¼suscntï¼ã¯å¿
+è¦ãªãï¼
+ *
+ *  TCBã®ããã¤ãã®ãã£ã¼ã«ãã¯ï¼ç¹å®ã®ã¿ã¹ã¯ç¶æ
+ã§ã®ã¿æå¹ãªå¤ãä¿æãï¼
+ *  ããä»¥å¤ã®å ´åã¯å¤ãä¿è¨¼ãããªãï¼ãã£ã¦ï¼åç
+§ãã¦ã¯ãªããªãï¼ï¼å
+ *  ãã£ã¼ã«ããæå¹ãªå¤ãä¿æããæ¡ä»¶ã¯æ¬¡ã®éãï¼
+ *
+ *  ã»åæåå¾ã¯å¸¸ã«æå¹ï¼
+ *  		p_tinibï¼tstatï¼actque, staovr, leftotm
+ *  ã»ä¼æ­¢ç¶æ
+ä»¥å¤ã§æå¹ï¼ä¼æ­¢ç¶æ
+ã§ã¯åæå¤ã«ãªã£ã¦ããï¼ï¼
+ *  		bpriorityï¼priorityï¼wupqueï¼rasterï¼enaterï¼p_lastmtx
+ *  ã»å¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ãå«ãï¼ã§æå¹ï¼
+ *  		p_winfo
+ *  ã»å®è¡ã§ããç¶æ
+ã¨åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã§æå¹ï¼
+ *  		task_queue
+ *  ã»å®è¡å¯è½ç¶æ
+ï¼å¾
+ã¡ç¶æ
+ï¼å¼·å¶å¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ã§æå¹ï¼
+ *  		tskctxb
+ */
+typedef struct task_control_block {
+	QUEUE			task_queue;		/* ã¿ã¹ã¯ã­ã¥ã¼ */
+	const TINIB		*p_tinib;		/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+
+#ifdef UINT8_MAX
+	uint8_t			tstat;			/* ã¿ã¹ã¯ç¶æ
+ï¼å
+é¨è¡¨ç¾ï¼*/
+	uint8_t			bpriority;		/* ãã¼ã¹åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+	uint8_t			priority;		/* ç¾å¨ã®åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+#else /* UINT8_MAX */
+	BIT_FIELD_UINT	tstat : 8;		/* ã¿ã¹ã¯ç¶æ
+ï¼å
+é¨è¡¨ç¾ï¼*/
+	BIT_FIELD_UINT	bpriority : 8;	/* ãã¼ã¹åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+	BIT_FIELD_UINT	priority : 8	/* ç¾å¨ã®åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/;
+#endif /* UINT8_MAX */
+	BIT_FIELD_BOOL	actque : 1;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã° */
+	BIT_FIELD_BOOL	wupque : 1;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã° */
+	BIT_FIELD_BOOL	raster : 1;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	BIT_FIELD_BOOL	enater : 1;		/* ã¿ã¹ã¯çµäºè¨±å¯ç¶æ
+ */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	BIT_FIELD_BOOL	staovr : 1;		/* ãªã¼ãã©ã³ãã³ãã©åä½ç¶æ
+ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+	WINFO			*p_winfo;		/* å¾
+ã¡æ
+å ±ãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	MTXCB			*p_lastmtx;		/* æå¾ã«ã­ãã¯ãããã¥ã¼ããã¯ã¹ */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	PRCTIM			leftotm;		/* æ®ããã­ã»ããµæé */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	TSKCTXB			tskctxb;		/* ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ */
+} TCB;
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯
+ *
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯ï¼ï¼ãã­ã»ããµãã³ã³ãã­ã¹ããæã£ã¦ããã¿ã¹ã¯ï¼ã®
+ *  TCBãæããã¤ã³ã¿ï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ããªãå ´åã¯NULLã«ããï¼
+ *
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å¦çä¸­ã§ï¼èªã¿ã¹ã¯ï¼ãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºããã¿ã¹
+ *  ã¯ï¼ã«é¢ããæ
+å ±ãåç
+§ããå ´åã¯p_runtskãä½¿ãï¼p_runtskãæ¸ãæã
+ *  ãã®ã¯ï¼ãã£ã¹ãããã£ï¼ã¨åæåå¦çï¼ã®ã¿ã§ããï¼
+ */
+extern TCB	*p_runtsk;
+
+/*
+ *  å®è¡ãã¹ãã¿ã¹ã¯
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ã®TCBãæããã¤ã³ã¿ï¼å®è¡ã§ããã¿ã¹ã¯ããªãå ´åã¯
+ *  NULLã«ããï¼
+ *
+ *  p_runtskã¯ï¼éå¸¸ã¯p_schedtskã¨ä¸è´ãã¦ãããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ã
+ *  å®è¡ä¸­ã¯ï¼ä¸è´ãã¦ããã¨ã¯éããªãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªã
+ *  ç¶æ
+ã®éã¨ãã£ã¹ãããç¦æ­¢ç¶æ
+ã®éï¼ããªãã¡ï¼dspflgãfalseã§ããéï¼
+ *  ã¯ï¼p_schedtskãæ´æ°ããªãï¼
+ */
+extern TCB	*p_schedtsk;
+
+/*
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+
+ *
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ãããã¨ãç¤ºããã©ã°ï¼
+ */
+extern bool_t	enadsp;
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããå¯è½ç¶æ
+
+ *
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§ããï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ããï¼ãã£
+ *  ã¹ãããç¦æ­¢ç¶æ
+ã§ãªãï¼ãã¨ãç¤ºããã©ã°ï¼ãã£ã¹ãããä¿çç¶æ
+ã§ãª
+ *  ããã¨ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãå®è¡ä¸­ã§ï¼CPUã­ãã¯ç¶æ
+ã§ãªãï¼dspflgã
+ *  trueã§ãããã¨ã§å¤å¥ãããã¨ãã§ããï¼
+ */
+extern bool_t	dspflg;
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã¯ï¼å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ãç®¡çããããã®ã­ã¥ã¼ã§ããï¼
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãç®¡çãã¦ããããï¼ã¬ãã£ï¼å®è¡å¯è½ï¼ã­ã¥ã¼ã¨ãã
+ *  åç§°ã¯æ­£ç¢ºã§ã¯ãªããï¼ã¬ãã£ã­ã¥ã¼ã¨ããåç§°ãå®çãã¦ããããï¼ã
+ *  ã®åç§°ã§å¼ã¶ãã¨ã«ããï¼
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã¯ï¼åªå
+åº¦ãã¨ã®ã¿ã¹ã¯ã­ã¥ã¼ã§æ§æããã¦ããï¼ã¿ã¹ã¯ã®
+ *  TCBã¯ï¼è©²å½ããåªå
+åº¦ã®ã­ã¥ã¼ã«ç»é²ãããï¼
+ */
+extern QUEUE	ready_queue[TNUM_TPRI];
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ãµã¼ãã®ããã®ãããããã
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã®ãµã¼ããå¹çããè¡ãããã«ï¼åªå
+åº¦ãã¨ã®ã¿ã¹ã¯ã­ã¥ã¼
+ *  ã«ã¿ã¹ã¯ãå
+¥ã£ã¦ãããã©ãããç¤ºããããããããç¨æãã¦ããï¼ãã
+ *  ãããããä½¿ããã¨ã§ï¼ã¡ã¢ãªã¢ã¯ã»ã¹ã®åæ°ãæ¸ãããã¨ãã§ãããï¼
+ *  ãããæä½å½ä»¤ãå
+
+å®ãã¦ããªããã­ã»ããµã§ï¼åªå
+åº¦ã®æ®µéæ°ãå°ãªã
+ *  å ´åã«ã¯ï¼ããããããæä½ã®ãªã¼ãã¼ãããã®ããã«ï¼éã«å¹çãè½ã¡
+ *  ãå¯è½æ§ãããï¼
+ *
+ *  åªå
+åº¦ã16æ®µéã§ãããã¨ãä»®å®ãã¦ããããï¼uint16_tåã¨ãã¦ããï¼
+ */
+extern uint16_t	ready_primap;
+
+/*
+ *  ã¿ã¹ã¯IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_tskid;
+
+/*
+ *  ã¿ã¹ã¯åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const TINIB	tinib_table[];
+
+/*
+ *  ã¿ã¹ã¯çæé åºãã¼ãã«ï¼kernel_cfg.cï¼
+ */
+extern const ID	torder_table[];
+
+/*
+ *  TCBã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern TCB	tcb_table[];
+
+/*
+ *  ã¿ã¹ã¯ã®æ°
+ */
+#define tnum_tsk	((uint_t)(tmax_tskid - TMIN_TSKID + 1))
+
+/*
+ *  ã¿ã¹ã¯IDããTCBãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_TSK(tskid)	((uint_t)((tskid) - TMIN_TSKID))
+#define get_tcb(tskid)		(&(tcb_table[INDEX_TSK(tskid)]))
+
+/*
+ *  TCBããã¿ã¹ã¯IDãåãåºãããã®ãã¯ã­
+ */
+#define	TSKID(p_tcb)	((ID)(((p_tcb) - tcb_table) + TMIN_TSKID))
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®åæå
+ */
+extern void	initialize_task(void);
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã®ãµã¼ã
+ *
+ *  ã¬ãã£ã­ã¥ã¼ä¸­ã®æé«åªå
+é ä½ã®ã¿ã¹ã¯ããµã¼ããï¼ãã®TCBã¸ã®ãã¤ã³ã¿
+ *  ãè¿ãï¼ã¬ãã£ã­ã¥ã¼ãç©ºã®å ´åã«ã¯ï¼ãã®é¢æ°ãå¼ã³åºãã¦ã¯ãªããªãï¼
+ */
+extern TCB	*search_schedtsk(void);
+
+/*
+ *  å®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ã«æ¿å
+¥ããï¼ã¬ãã£ã­ã¥ã¼ã«æ¿å
+¥
+ *  ããã¿ã¹ã¯ã®åªå
+åº¦ãï¼å®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã¯ï¼å®
+ *  è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ */
+extern void	make_runnable(TCB *p_tcb);
+
+/*
+ *  å®è¡ã§ããç¶æ
+ããä»ã®ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ããåé¤ããï¼p_tcbã§æå®ãã
+ *  ã¿ã¹ã¯ãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ãå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ã
+ *  ãï¼
+ */
+extern void	make_non_runnable(TCB *p_tcb);
+
+/*
+ *  ä¼æ­¢ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¶æ
+ãä¼æ­¢ç¶æ
+ã¨ããï¼ã¾ãï¼ã¿ã¹ã¯ã®èµ·å
+ *  æã«åæåãã¹ãå¤æ°ã®åæåã¨ï¼ã¿ã¹ã¯èµ·åã®ããã®ã³ã³ãã­ã¹ããè¨­
+ *  å®ããï¼
+ */
+extern void	make_dormant(TCB *p_tcb);
+
+/*
+ *  ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¶æ
+ãä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¨ããï¼
+ */
+extern void	make_active(TCB *p_tcb);
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+åº¦ã®å¤æ´
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®åªå
+åº¦ãnewpriï¼å
+é¨è¡¨ç¾ï¼ã«å¤æ´ããï¼ã¾ãï¼
+ *  å¿
+è¦ãªå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®åªå
+é ä½ã¯ï¼åªå
+åº¦ãåãã¿ã¹ã¯ã®ä¸­ã§ï¼
+ *  mtxmodeãfalseã®æã¯æä½ï¼mtxmodeãtrueã®æã¯æé«ã¨ããï¼
+ */
+extern void	change_priority(TCB *p_tcb, uint_t newpri, bool_t mtxmode);
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ã®åè»¢
+ *
+ *  ã¬ãã£ã­ã¥ã¼ä¸­ã®ï¼p_queueã§æå®ãããã¿ã¹ã¯ã­ã¥ã¼ãåè»¢ãããï¼ã¾ãï¼
+ *  å¿
+è¦ãªå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ */
+extern void	rotate_ready_queue(QUEUE *p_queue);
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºå¦ç
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãçµäºãããå¦çãè¡ãï¼ã¿ã¹ã¯ã®èµ·åè¦æ±ã­ã¥ã¼
+ *  ã¤ã³ã°æ°ã0ã§ãªãå ´åã«ã¯ï¼ååº¦èµ·åããããã®å¦çãè¡ãï¼
+ */
+extern void	task_terminate(TCB *p_tcb);
+
+#endif /* TOPPERS_TASK_H */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/kernel/task_term.c
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/kernel/task_term.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/kernel/task_term.c	(revision 302)
@@ -0,0 +1,366 @@
+/*
+ *  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: task_term.c 275 2014-11-03 14:26:05Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯çµäºæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "overrun.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_EXT_TSK_ENTER
+#define LOG_EXT_TSK_ENTER()
+#endif /* LOG_EXT_TSK_ENTER */
+
+#ifndef LOG_EXT_TSK_LEAVE
+#define LOG_EXT_TSK_LEAVE(ercd)
+#endif /* LOG_EXT_TSK_LEAVE */
+
+#ifndef LOG_RAS_TER_ENTER
+#define LOG_RAS_TER_ENTER(tskid)
+#endif /* LOG_RAS_TER_ENTER */
+
+#ifndef LOG_RAS_TER_LEAVE
+#define LOG_RAS_TER_LEAVE(ercd)
+#endif /* LOG_RAS_TER_LEAVE */
+
+#ifndef LOG_DIS_TER_ENTER
+#define LOG_DIS_TER_ENTER()
+#endif /* LOG_DIS_TER_ENTER */
+
+#ifndef LOG_DIS_TER_LEAVE
+#define LOG_DIS_TER_LEAVE(ercd)
+#endif /* LOG_DIS_TER_LEAVE */
+
+#ifndef LOG_ENA_TER_ENTER
+#define LOG_ENA_TER_ENTER()
+#endif /* LOG_ENA_TER_ENTER */
+
+#ifndef LOG_ENA_TER_LEAVE
+#define LOG_ENA_TER_LEAVE(ercd)
+#endif /* LOG_ENA_TER_LEAVE */
+
+#ifndef LOG_SNS_TER_ENTER
+#define LOG_SNS_TER_ENTER()
+#endif /* LOG_SNS_TER_ENTER */
+
+#ifndef LOG_SNS_TER_LEAVE
+#define LOG_SNS_TER_LEAVE(state)
+#endif /* LOG_SNS_TER_LEAVE */
+
+#ifndef LOG_TER_TSK_ENTER
+#define LOG_TER_TSK_ENTER(tskid)
+#endif /* LOG_TER_TSK_ENTER */
+
+#ifndef LOG_TER_TSK_LEAVE
+#define LOG_TER_TSK_LEAVE(ercd)
+#endif /* LOG_TER_TSK_LEAVE */
+
+/*
+ *  èªã¿ã¹ã¯ã®çµäºï¼»NGKI1162ï¼½
+ */
+#ifdef TOPPERS_ext_tsk
+
+ER
+ext_tsk(void)
+{
+	PRI		intpri;
+	ER		ercd;
+
+	LOG_EXT_TSK_ENTER();
+	CHECK_TSKCTX();							/*ï¼»NGKI1164ï¼½*/
+
+	if (sense_lock()) {
+		/*
+		 *  CPUã­ãã¯ç¶æ
+ã§ext_tskãå¼ã°ããå ´åã¯ï¼CPUã­ãã¯ãè§£é¤ã
+		 *  ã¦ããã¿ã¹ã¯ãçµäºããï¼å®è£
+ä¸ã¯ï¼ãµã¼ãã¹ã³ã¼ã«å
+ã§ã®CPU
+		 *  ã­ãã¯ãçç¥ããã°ããã ãï¼ï¼»NGKI1168ï¼½
+		 */
+	}
+	else {
+		lock_cpu();
+	}
+
+	intpri = t_get_ipm();
+	if (!enadsp || intpri != TIPM_ENAALL) {
+		if (!enadsp) {
+			/*
+			 *  ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§ext_tskãå¼ã°ããå ´åã¯ï¼ãã£ã¹ãã
+			 *  ãè¨±å¯ç¶æ
+ã«ãã¦ããã¿ã¹ã¯ãçµäºããï¼ï¼»NGKI1168ï¼½
+			 */
+			enadsp = true;
+		}
+		if (intpri != TIPM_ENAALL) {
+			/*
+			 *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼IPMï¼ãTIPM_ENAALLä»¥å¤ã®ç¶æ
+ã§
+			 *  ext_tskãå¼ã°ããå ´åã¯ï¼IPMãTIPM_ENAALLã«ãã¦ããã¿ã¹
+			 *  ã¯ãçµäºããï¼ï¼»NGKI1168ï¼½
+			 */
+			t_set_ipm(TIPM_ENAALL);
+		}
+		dspflg = true;
+		p_schedtsk = search_schedtsk();
+	}
+
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	if (p_runtsk->staovr) {
+		(void) target_ovrtimer_stop();
+		ovrtimer_flag = false;
+	}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	task_terminate(p_runtsk);				/* ï¼»NGKI3449ï¼½*/
+	exit_and_dispatch();					/* ï¼»NGKI1169ï¼½*/
+	ercd = E_SYS;							/* ï¼»NGKI1163ï¼½*/
+
+  error_exit:
+	LOG_EXT_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ext_tsk */
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºè¦æ±ï¼»NGKI3469ï¼½
+ */
+#ifdef TOPPERS_ras_ter
+
+ER
+ras_ter(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_RAS_TER_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3470ï¼½ï¼»NGKI3471ï¼½*/
+	CHECK_ID(VALID_TSKID(tskid));				/*ï¼»NGKI3472ï¼½*/
+	p_tcb = get_tcb(tskid);
+	CHECK_ILUSE(p_tcb != p_runtsk);				/*ï¼»NGKI3475ï¼½*/
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI3476ï¼½*/
+	}
+	else if (p_tcb->enater) {
+		task_terminate(p_tcb);					/*ï¼»NGKI3477ï¼½*/
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		p_tcb->raster = true;					/*ï¼»NGKI3478ï¼½*/
+		if (!TSTAT_RUNNABLE(p_tcb->tstat)) {
+			if (TSTAT_WAITING(p_tcb->tstat)) {
+				wait_dequeue_wobj(p_tcb);		/*ï¼»NGKI3479ï¼½*/
+				wait_dequeue_tmevtb(p_tcb);
+				p_tcb->p_winfo->wercd = E_RASTER;	/*ï¼»NGKI3480ï¼½*/
+			}
+			p_tcb->tstat = TS_RUNNABLE;			/*ï¼»NGKI3606ï¼½*/
+			LOG_TSKSTAT(p_tcb);
+			make_runnable(p_tcb);
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_RAS_TER_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ras_ter */
+
+/*
+ *  ã¿ã¹ã¯çµäºã®ç¦æ­¢ï¼»NGKI3482ï¼½
+ */
+#ifdef TOPPERS_dis_ter
+
+ER
+dis_ter(void)
+{
+	ER		ercd;
+
+	LOG_DIS_TER_ENTER();
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3483ï¼½ï¼»NGKI3484ï¼½*/
+
+	lock_cpu();
+	p_runtsk->enater = false;					/*ï¼»NGKI3486ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_DIS_TER_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_dis_ter */
+
+/*
+ *  ã¿ã¹ã¯çµäºã®è¨±å¯ï¼»NGKI3487ï¼½
+ */
+#ifdef TOPPERS_ena_ter
+
+ER
+ena_ter(void)
+{
+	ER		ercd;
+
+	LOG_ENA_TER_ENTER();
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3488ï¼½ï¼»NGKI3489ï¼½*/
+
+	lock_cpu();
+	if (p_runtsk->raster && dspflg) {
+#ifdef TOPPERS_SUPPORT_OVRHDR
+		if (p_runtsk->staovr) {
+			(void) target_ovrtimer_stop();
+			ovrtimer_flag = false;
+		}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+		task_terminate(p_runtsk);
+		exit_and_dispatch();
+		ercd = E_SYS;
+	}
+	else {
+		p_runtsk->enater = true;				/*ï¼»NGKI3491ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ENA_TER_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ena_ter */
+
+/*
+ *  ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã®åç
+§ï¼»NGKI3494ï¼½
+ */
+#ifdef TOPPERS_sns_ter
+
+bool_t
+sns_ter(void)
+{
+	bool_t	state;
+
+	LOG_SNS_TER_ENTER();
+	/*
+	 *  enaterãå¤æ´ã§ããã®ã¯èªã¿ã¹ã¯ã®ã¿ã§ããããï¼æä»å¶å¾¡ããã«èª­
+	 *  ãã§ãåé¡ãªãï¼
+	 */
+	state = (p_runtsk != NULL && p_runtsk->enater) ? false : true;
+												/*ï¼»NGKI3495ï¼½ï¼»NGKI3496ï¼½*/
+	LOG_SNS_TER_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_ter */
+
+/*
+ *  ã¿ã¹ã¯ã®å¼·å¶çµäºï¼»NGKI1170ï¼½
+ */
+#ifdef TOPPERS_ter_tsk
+
+ER
+ter_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_TER_TSK_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1171ï¼½ï¼»NGKI1172ï¼½*/
+	CHECK_ID(VALID_TSKID(tskid));				/*ï¼»NGKI1173ï¼½*/
+	p_tcb = get_tcb(tskid);
+	CHECK_ILUSE(p_tcb != p_runtsk);				/*ï¼»NGKI1176ï¼½*/
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1177ï¼½*/
+	}
+	else {
+		task_terminate(p_tcb);					/*ï¼»NGKI3450ï¼½*/
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_TER_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ter_tsk */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/sample/sample1.c
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/sample/sample1.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/sample/sample1.c	(revision 302)
@@ -0,0 +1,597 @@
+/*
+ *  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) 2004-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: sample1.c 216 2014-09-23 12:13:52Z ertl-hiro $
+ */
+
+/* 
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®æ¬ä½
+ *
+ *  ASPã«ã¼ãã«ã®åºæ¬çãªåä½ãç¢ºèªããããã®ãµã³ãã«ãã­ã°ã©ã ï¼
+ *
+ *  ãã­ã°ã©ã ã®æ¦è¦:
+ *
+ *  ã¦ã¼ã¶ã¤ã³ã¿ãã§ã¼ã¹ãåãæã¤ã¡ã¤ã³ã¿ã¹ã¯ï¼ã¿ã¹ã¯ID: MAIN_TASKï¼åª
+ *  å
+åº¦: MAIN_PRIORITYï¼ã¨ï¼3ã¤ã®ä¸¦è¡å®è¡ãããã¿ã¹ã¯ï¼ã¿ã¹ã¯ID:
+ *  TASK1ãTASK3ï¼åæåªå
+åº¦: MID_PRIORITYï¼ã§æ§æãããï¼ã¾ãï¼èµ·åå¨
+ *  æã2ç§ã®å¨æãã³ãã©ï¼å¨æãã³ãã©ID: CYCHDR1ï¼ãç¨ããï¼
+ *
+ *  ä¸¦è¡å®è¡ãããã¿ã¹ã¯ã¯ï¼task_loopåç©ºã«ã¼ããå®è¡ããåº¦ã«ï¼ã¿ã¹ã¯ã
+ *  å®è¡ä¸­ã§ãããã¨ãããããã¡ãã»ã¼ã¸ãè¡¨ç¤ºããï¼ç©ºã«ã¼ããå®è¡ãã
+ *  ã®ã¯ï¼ç©ºã«ã¼ããªãã§ã¡ãã»ã¼ã¸ãåºåããã¨ï¼å¤éã®ã¡ãã»ã¼ã¸ãåºå
+ *  ããï¼ãã­ã°ã©ã ã®åä½ãç¢ºèªãããããªãããã§ããï¼ã¾ãï¼ä½éãªã·
+ *  ãªã¢ã«ãã¼ããç¨ãã¦ã¡ãã»ã¼ã¸ãåºåããå ´åã«ï¼ãã¹ã¦ã®ã¡ãã»ã¼ã¸
+ *  ãåºåã§ããããã«ï¼ã¡ãã»ã¼ã¸ã®éãå¶éããã¨ããçç±ãããï¼
+ *
+ *  å¨æãã³ãã©ã¯ï¼ä¸ã¤ã®åªå
+åº¦ï¼HIGH_PRIORITYï¼MID_PRIORITYï¼
+ *  LOW_PRIORITYï¼ã®ã¬ãã£ã­ã¥ã¼ãåè»¢ãããï¼ãã­ã°ã©ã ã®èµ·åç´å¾ã¯ï¼
+ *  å¨æãã³ãã©ã¯åæ­¢ç¶æ
+ã«ãªã£ã¦ããï¼
+ *
+ *  ã¡ã¤ã³ã¿ã¹ã¯ã¯ï¼ã·ãªã¢ã«I/Oãã¼ãããã®æå­å
+¥åãè¡ãï¼æå­å
+¥åã
+ *  å¾
+ã£ã¦ããéã¯ï¼ä¸¦è¡å®è¡ãããã¿ã¹ã¯ãå®è¡ããã¦ããï¼ï¼å
+¥åããã
+ *  æå­ã«å¯¾å¿ããå¦çãå®è¡ããï¼å
+¥åãããæå­ã¨å¦çã®é¢ä¿ã¯æ¬¡ã®éãï¼
+ *  Control-Cã¾ãã¯'Q'ãå
+¥åãããã¨ï¼ãã­ã°ã©ã ãçµäºããï¼
+ *
+ *  '1' : å¯¾è±¡ã¿ã¹ã¯ãTASK1ã«åãæããï¼åæè¨­å®ï¼ï¼
+ *  '2' : å¯¾è±¡ã¿ã¹ã¯ãTASK2ã«åãæããï¼
+ *  '3' : å¯¾è±¡ã¿ã¹ã¯ãTASK3ã«åãæããï¼
+ *  'a' : å¯¾è±¡ã¿ã¹ã¯ãact_tskã«ããèµ·åããï¼
+ *  'A' : å¯¾è±¡ã¿ã¹ã¯ã«å¯¾ããèµ·åè¦æ±ãcan_actã«ããã­ã£ã³ã»ã«ããï¼
+ *  'e' : å¯¾è±¡ã¿ã¹ã¯ã«ext_tskãå¼ã³åºããï¼çµäºãããï¼
+ *  't' : å¯¾è±¡ã¿ã¹ã¯ãter_tskã«ããå¼·å¶çµäºããï¼
+ *  '>' : å¯¾è±¡ã¿ã¹ã¯ã®åªå
+åº¦ãHIGH_PRIORITYã«ããï¼
+ *  '=' : å¯¾è±¡ã¿ã¹ã¯ã®åªå
+åº¦ãMID_PRIORITYã«ããï¼
+ *  '<' : å¯¾è±¡ã¿ã¹ã¯ã®åªå
+åº¦ãLOW_PRIORITYã«ããï¼
+ *  'G' : å¯¾è±¡ã¿ã¹ã¯ã®åªå
+åº¦ãget_priã§èª­ã¿åºãï¼
+ *  's' : å¯¾è±¡ã¿ã¹ã¯ã«slp_tskãå¼ã³åºããï¼èµ·åºå¾
+ã¡ã«ãããï¼
+ *  'S' : å¯¾è±¡ã¿ã¹ã¯ã«tslp_tsk(10ç§)ãå¼ã³åºããï¼èµ·åºå¾
+ã¡ã«ãããï¼
+ *  'w' : å¯¾è±¡ã¿ã¹ã¯ãwup_tskã«ããèµ·åºããï¼
+ *  'W' : å¯¾è±¡ã¿ã¹ã¯ã«å¯¾ããèµ·åºè¦æ±ãcan_wupã«ããã­ã£ã³ã»ã«ããï¼
+ *  'l' : å¯¾è±¡ã¿ã¹ã¯ãrel_waiã«ããå¼·å¶çã«å¾
+ã¡è§£é¤ã«ããï¼
+ *  'u' : å¯¾è±¡ã¿ã¹ã¯ãsus_tskã«ããå¼·å¶å¾
+ã¡ç¶æ
+ã«ããï¼
+ *  'm' : å¯¾è±¡ã¿ã¹ã¯ã®å¼·å¶å¾
+ã¡ç¶æ
+ãrsm_tskã«ããè§£é¤ããï¼
+ *  'd' : å¯¾è±¡ã¿ã¹ã¯ã«dly_tsk(10ç§)ãå¼ã³åºããï¼æéçµéå¾
+ã¡ã«ãããï¼
+ *  'x' : å¯¾è±¡ã¿ã¹ã¯ã«ras_terã«ããçµäºè¦æ±ããï¼
+ *  'y' : å¯¾è±¡ã¿ã¹ã¯ã«dis_terãå¼ã³åºããï¼ã¿ã¹ã¯çµäºãç¦æ­¢ããï¼
+ *  'Y' : å¯¾è±¡ã¿ã¹ã¯ã«ena_terãå¼ã³åºããï¼ã¿ã¹ã¯çµäºãè¨±å¯ããï¼
+ *  'r' : 3ã¤ã®åªå
+åº¦ï¼HIGH_PRIORITYï¼MID_PRIORITYï¼LOW_PRIORITYï¼ã®ã¬
+ *        ãã£ã­ã¥ã¼ãåè»¢ãããï¼
+ *  'c' : å¨æãã³ãã©ãåä½éå§ãããï¼
+ *  'C' : å¨æãã³ãã©ãåä½åæ­¢ãããï¼
+ *  'b' : ã¢ã©ã¼ã ãã³ãã©ã5ç§å¾ã«èµ·åããããåä½éå§ãããï¼
+ *  'B' : ã¢ã©ã¼ã ãã³ãã©ãåä½åæ­¢ãããï¼
+ *  'z' : å¯¾è±¡ã¿ã¹ã¯ã«CPUä¾å¤ãçºçãããï¼ã¿ã¹ã¯ãçµäºãããï¼ï¼
+ *  'Z' : å¯¾è±¡ã¿ã¹ã¯ã«CPUã­ãã¯ç¶æ
+ã§CPUä¾å¤ãçºçãããï¼ãã­ã°ã©ã ã
+ *        çµäºããï¼ï¼
+ *  'V' : fch_hrtã§é«åè§£è½ã¿ã¤ãã2åèª­ãï¼
+ *  'o' : å¯¾è±¡ã¿ã¹ã¯ã«å¯¾ãã¦ãªã¼ãã©ã³ãã³ãã©ãåä½éå§ããã
+ *  'O' : å¯¾è±¡ã¿ã¹ã¯ã«å¯¾ãã¦ãªã¼ãã©ã³ãã³ãã©ãåä½åæ­¢ããã
+ *  'v' : çºè¡ããã·ã¹ãã ã³ã¼ã«ãè¡¨ç¤ºããï¼ããã©ã«ãï¼ï¼
+ *  'q' : çºè¡ããã·ã¹ãã ã³ã¼ã«ãè¡¨ç¤ºããªãï¼
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include <t_stdlib.h>
+#include "syssvc/serial.h"
+#include "syssvc/syslog.h"
+#include "kernel_cfg.h"
+#include "sample1.h"
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®ã¨ã©ã¼ã®ã­ã°åºå
+ */
+Inline void
+svc_perror(const char *file, int_t line, const char *expr, ER ercd)
+{
+	if (ercd < 0) {
+		t_perror(LOG_ERROR, file, line, expr, ercd);
+	}
+}
+
+#define	SVC_PERROR(expr)	svc_perror(__FILE__, __LINE__, #expr, (expr))
+
+/*
+ *  ä¸¦è¡å®è¡ãããã¿ã¹ã¯ã¸ã®ã¡ãã»ã¼ã¸é å
+ */
+char	message[3];
+
+/*
+ *  ã«ã¼ãåæ°
+ */
+ulong_t	task_loop;		/* ã¿ã¹ã¯å
+ã§ã®ã«ã¼ãåæ° */
+
+/*
+ *  ä¸¦è¡å®è¡ãããã¿ã¹ã¯
+ */
+void task(intptr_t exinf)
+{
+	volatile ulong_t	i;
+	int_t		n = 0;
+	int_t		tskno = (int_t) exinf;
+	const char	*graph[] = { "|    ", "  +  ", "    *" };
+	char		c;
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	T_ROVR		pk_rovr;
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+	while (true) {
+#ifdef TOPPERS_SUPPORT_OVRHDR
+		SVC_PERROR(ref_ovr(TSK_SELF, &pk_rovr));
+		if ((pk_rovr.ovrstat & TOVR_STA) != 0) {
+			syslog(LOG_NOTICE, "task%d is running (%03d).   %s  [%ld]",
+								tskno, ++n, graph[tskno-1], pk_rovr.leftotm);
+		}
+		else {
+			syslog(LOG_NOTICE, "task%d is running (%03d).   %s",
+										tskno, ++n, graph[tskno-1]);
+		}
+#else /* TOPPERS_SUPPORT_OVRHDR */
+		syslog(LOG_NOTICE, "task%d is running (%03d).   %s",
+										tskno, ++n, graph[tskno-1]);
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+		for (i = 0; i < task_loop; i++);
+		c = message[tskno-1];
+		message[tskno-1] = 0;
+		switch (c) {
+		case 'e':
+			syslog(LOG_INFO, "#%d#ext_tsk()", tskno);
+			SVC_PERROR(ext_tsk());
+			assert(0);
+		case 's':
+			syslog(LOG_INFO, "#%d#slp_tsk()", tskno);
+			SVC_PERROR(slp_tsk());
+			break;
+		case 'S':
+			syslog(LOG_INFO, "#%d#tslp_tsk(10000000)", tskno);
+			SVC_PERROR(tslp_tsk(10000000));
+			break;
+		case 'd':
+			syslog(LOG_INFO, "#%d#dly_tsk(10000000)", tskno);
+			SVC_PERROR(dly_tsk(10000000));
+			break;
+		case 'y':
+			syslog(LOG_INFO, "#%d#dis_ter()", tskno);
+			SVC_PERROR(dis_ter());
+			break;
+		case 'Y':
+			syslog(LOG_INFO, "#%d#ena_ter()", tskno);
+			SVC_PERROR(ena_ter());
+			break;
+#ifdef CPUEXC1
+		case 'z':
+			syslog(LOG_NOTICE, "#%d#raise CPU exception", tskno);
+			RAISE_CPU_EXCEPTION;
+			break;
+		case 'Z':
+			SVC_PERROR(loc_cpu());
+			syslog(LOG_NOTICE, "#%d#raise CPU exception", tskno);
+			RAISE_CPU_EXCEPTION;
+			SVC_PERROR(unl_cpu());
+			break;
+#endif /* CPUEXC1 */
+		default:
+			break;
+		}
+	}
+}
+
+/*
+ *  CPUä¾å¤ãã³ãã©
+ */
+ID	cpuexc_tskid;		/* CPUä¾å¤ãèµ·ãããã¿ã¹ã¯ã®ID */
+
+#ifdef CPUEXC1
+
+void
+cpuexc_handler(void *p_excinf)
+{
+	syslog(LOG_NOTICE, "CPU exception handler (p_excinf = %08p).", p_excinf);
+	if (sns_ctx() != true) {
+		syslog(LOG_WARNING,
+					"sns_ctx() is not true in CPU exception handler.");
+	}
+	if (sns_dpn() != true) {
+		syslog(LOG_WARNING,
+					"sns_dpn() is not true in CPU exception handler.");
+	}
+	syslog(LOG_INFO, "sns_loc = %d sns_dsp = %d xsns_dpn = %d",
+								sns_loc(), sns_dsp(), xsns_dpn(p_excinf));
+
+	if (xsns_dpn(p_excinf)) {
+		syslog(LOG_NOTICE, "Sample program ends with exception.");
+		SVC_PERROR(ext_ker());
+		assert(0);
+	}
+
+	SVC_PERROR(get_tid(&cpuexc_tskid));
+	SVC_PERROR(act_tsk(EXC_TASK));
+}
+
+#endif /* CPUEXC1 */
+
+/*
+ *  å¨æãã³ãã©
+ *
+ *  HIGH_PRIORITYï¼MID_PRIORITYï¼LOW_PRIORITY ã®ååªå
+åº¦ã®ã¬ãã£ã­ã¥ã¼
+ *  ãåè»¢ãããï¼
+ */
+void cyclic_handler(intptr_t exinf)
+{
+	SVC_PERROR(rot_rdq(HIGH_PRIORITY));
+	SVC_PERROR(rot_rdq(MID_PRIORITY));
+	SVC_PERROR(rot_rdq(LOW_PRIORITY));
+}
+
+/*
+ *  ã¢ã©ã¼ã ãã³ãã©
+ *
+ *  HIGH_PRIORITYï¼MID_PRIORITYï¼LOW_PRIORITY ã®ååªå
+åº¦ã®ã¬ãã£ã­ã¥ã¼
+ *  ãåè»¢ãããï¼
+ */
+void alarm_handler(intptr_t exinf)
+{
+	SVC_PERROR(rot_rdq(HIGH_PRIORITY));
+	SVC_PERROR(rot_rdq(MID_PRIORITY));
+	SVC_PERROR(rot_rdq(LOW_PRIORITY));
+}
+
+/*
+ *  ä¾å¤å¦çã¿ã¹ã¯
+ */
+void exc_task(intptr_t exinf)
+{
+	SVC_PERROR(ras_ter(cpuexc_tskid));
+}
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©
+ */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+
+void
+overrun_handler(ID tskid, intptr_t exinf)
+{
+	int_t	tskno = (int_t) exinf;
+
+	syslog(LOG_NOTICE, "Overrun handler for task%d.", tskno);
+}
+
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+/*
+ *  ã¡ã¤ã³ã¿ã¹ã¯
+ */
+void main_task(intptr_t exinf)
+{
+	char	c;
+	ID		tskid = TASK1;
+	int_t	tskno = 1;
+	ER_UINT	ercd;
+	PRI		tskpri;
+#ifndef TASK_LOOP
+	volatile ulong_t	i;
+	SYSTIM	stime1, stime2;
+#endif /* TASK_LOOP */
+	HRTCNT	hrtcnt1, hrtcnt2;
+
+	SVC_PERROR(syslog_msk_log(LOG_UPTO(LOG_INFO), LOG_UPTO(LOG_EMERG)));
+	syslog(LOG_NOTICE, "Sample program starts (exinf = %d).", (int_t) exinf);
+
+	/*
+	 *  ã·ãªã¢ã«ãã¼ãã®åæå
+	 *
+	 *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã¨åãã·ãªã¢ã«ãã¼ããä½¿ãå ´åãªã©ï¼ã·ãªã¢ã«
+	 *  ãã¼ãããªã¼ãã³æ¸ã¿ã®å ´åã«ã¯ããã§E_OBJã¨ã©ã¼ã«ãªããï¼æ¯éã¯
+	 *  ãªãï¼
+	 */
+	ercd = serial_opn_por(TASK_PORTID);
+	if (ercd < 0 && MERCD(ercd) != E_OBJ) {
+		syslog(LOG_ERROR, "%s (%d) reported by `serial_opn_por'.",
+									itron_strerror(ercd), SERCD(ercd));
+	}
+	SVC_PERROR(serial_ctl_por(TASK_PORTID,
+							(IOCTL_CRLF | IOCTL_FCSND | IOCTL_FCRCV)));
+
+	/*
+ 	 *  ã«ã¼ãåæ°ã®è¨­å®
+	 *
+	 *  ä¸¦è¡å®è¡ãããã¿ã¹ã¯å
+ã§ã®ç©ºã«ã¼ãã®åæ°ï¼task_loopï¼ã¯ï¼ç©ºã«ã¼
+	 *  ãã®å®è¡æéãç´0.4ç§ã«ãªãããã«è¨­å®ããï¼ãã®è¨­å®ã®ããã«ï¼
+	 *  LOOP_REFåã®ç©ºã«ã¼ãã®å®è¡æéãï¼ãã®åå¾ã§get_timãå¼ã¶ãã¨ã§
+	 *  æ¸¬å®ãï¼ãã®æ¸¬å®çµæããç©ºã«ã¼ãã®å®è¡æéã0.4ç§ã«ãªãã«ã¼ãå
+	 *  æ°ãæ±ãï¼task_loopã«è¨­å®ããï¼
+	 *
+	 *  LOOP_REFã¯ï¼ããã©ã«ãã§ã¯1,000,000ã«è¨­å®ãã¦ãããï¼æ³å®ããã
+	 *  ãé
+ããã­ã»ããµã§ã¯ï¼ãµã³ãã«ãã­ã°ã©ã ã®å®è¡éå§ã«æéããã
+	 *  ããããã¨ããåé¡ãçããï¼éã«æ³å®ããããéããã­ã»ããµã§ã¯ï¼
+	 *  LOOP_REFåã®ç©ºã«ã¼ãã®å®è¡æéãç­ããªãï¼task_loopã«è¨­å®ããå¤
+	 *  ã®èª¤å·®ãå¤§ãããªãã¨ããåé¡ãããï¼
+	 *
+	 *  ããã§ï¼ãã®ãããªã¿ã¼ã²ããã§ã¯ï¼target_test.hã§ï¼LOOP_REFãé©
+	 *  åãªå¤ã«å®ç¾©ããã®ãæã¾ããï¼
+	 *
+	 *  ã¾ãï¼task_loopã®å¤ãåºå®ãããå ´åã«ã¯ï¼ãã®å¤ãTASK_LOOPã«ã
+	 *  ã¯ã­å®ç¾©ããï¼TASK_LOOPããã¯ã­å®ç¾©ããã¦ããå ´åï¼ä¸è¨ã®æ¸¬å®ã
+	 *  è¡ããã«ï¼TASK_LOOPã«å®ç¾©ãããå¤ãç©ºã«ã¼ãã®åæ°ã¨ããï¼
+	 *
+	 * ã¿ã¼ã²ããã«ãã£ã¦ã¯ï¼ç©ºã«ã¼ãã®å®è¡æéã®1åç®ã®æ¸¬å®ã§ï¼æ¬æ¥ã
+	 * ããé·ãã«ãªããã®ãããï¼ãã®ãããªã¿ã¼ã²ããã§ã¯ï¼MEASURE_TWICE
+	 * ããã¯ã­å®ç¾©ãããã¨ã§ï¼1åç®ã®æ¸¬å®çµæãæ¨ã¦ã¦ï¼2åç®ã®æ¸¬å®çµæ
+	 * ãä½¿ãï¼
+	 */
+#ifdef TASK_LOOP
+	task_loop = TASK_LOOP;
+#else /* TASK_LOOP */
+
+#ifdef MEASURE_TWICE
+	task_loop = LOOP_REF;
+	SVC_PERROR(get_tim(&stime1));
+	for (i = 0; i < task_loop; i++);
+	SVC_PERROR(get_tim(&stime2));
+#endif /* MEASURE_TWICE */
+
+	task_loop = LOOP_REF;
+	SVC_PERROR(get_tim(&stime1));
+	for (i = 0; i < task_loop; i++);
+	SVC_PERROR(get_tim(&stime2));
+	task_loop = LOOP_REF * 400LU / (ulong_t)(stime2 - stime1) * 1000LU;
+
+#endif /* TASK_LOOP */
+
+	/*
+ 	 *  ã¿ã¹ã¯ã®èµ·å
+	 */
+	SVC_PERROR(act_tsk(TASK1));
+	SVC_PERROR(act_tsk(TASK2));
+	SVC_PERROR(act_tsk(TASK3));
+
+	/*
+ 	 *  ã¡ã¤ã³ã«ã¼ã
+	 */
+	do {
+		SVC_PERROR(serial_rea_dat(TASK_PORTID, &c, 1));
+		switch (c) {
+		case 'e':
+		case 's':
+		case 'S':
+		case 'd':
+		case 'y':
+		case 'Y':
+		case 'z':
+		case 'Z':
+			message[tskno-1] = c;
+			break;
+		case '1':
+			tskno = 1;
+			tskid = TASK1;
+			break;
+		case '2':
+			tskno = 2;
+			tskid = TASK2;
+			break;
+		case '3':
+			tskno = 3;
+			tskid = TASK3;
+			break;
+		case 'a':
+			syslog(LOG_INFO, "#act_tsk(%d)", tskno);
+			SVC_PERROR(act_tsk(tskid));
+			break;
+		case 'A':
+			syslog(LOG_INFO, "#can_act(%d)", tskno);
+			SVC_PERROR(ercd = can_act(tskid));
+			if (ercd >= 0) {
+				syslog(LOG_NOTICE, "can_act(%d) returns %d", tskno, ercd);
+			}
+			break;
+		case 't':
+			syslog(LOG_INFO, "#ter_tsk(%d)", tskno);
+			SVC_PERROR(ter_tsk(tskid));
+			break;
+		case '>':
+			syslog(LOG_INFO, "#chg_pri(%d, HIGH_PRIORITY)", tskno);
+			SVC_PERROR(chg_pri(tskid, HIGH_PRIORITY));
+			break;
+		case '=':
+			syslog(LOG_INFO, "#chg_pri(%d, MID_PRIORITY)", tskno);
+			SVC_PERROR(chg_pri(tskid, MID_PRIORITY));
+			break;
+		case '<':
+			syslog(LOG_INFO, "#chg_pri(%d, LOW_PRIORITY)", tskno);
+			SVC_PERROR(chg_pri(tskid, LOW_PRIORITY));
+			break;
+		case 'G':
+			syslog(LOG_INFO, "#get_pri(%d, &tskpri)", tskno);
+			SVC_PERROR(ercd = get_pri(tskid, &tskpri));
+			if (ercd >= 0) {
+				syslog(LOG_NOTICE, "priority of task %d is %d", tskno, tskpri);
+			}
+			break;
+		case 'w':
+			syslog(LOG_INFO, "#wup_tsk(%d)", tskno);
+			SVC_PERROR(wup_tsk(tskid));
+			break;
+		case 'W':
+			syslog(LOG_INFO, "#can_wup(%d)", tskno);
+			SVC_PERROR(ercd = can_wup(tskid));
+			if (ercd >= 0) {
+				syslog(LOG_NOTICE, "can_wup(%d) returns %d", tskno, ercd);
+			}
+			break;
+		case 'l':
+			syslog(LOG_INFO, "#rel_wai(%d)", tskno);
+			SVC_PERROR(rel_wai(tskid));
+			break;
+		case 'u':
+			syslog(LOG_INFO, "#sus_tsk(%d)", tskno);
+			SVC_PERROR(sus_tsk(tskid));
+			break;
+		case 'm':
+			syslog(LOG_INFO, "#rsm_tsk(%d)", tskno);
+			SVC_PERROR(rsm_tsk(tskid));
+			break;
+		case 'x':
+			syslog(LOG_INFO, "#ras_ter(%d)", tskno);
+			SVC_PERROR(ras_ter(tskid));
+			break;
+		case 'r':
+			syslog(LOG_INFO, "#rot_rdq(three priorities)");
+			SVC_PERROR(rot_rdq(HIGH_PRIORITY));
+			SVC_PERROR(rot_rdq(MID_PRIORITY));
+			SVC_PERROR(rot_rdq(LOW_PRIORITY));
+			break;
+		case 'c':
+			syslog(LOG_INFO, "#sta_cyc(1)");
+			SVC_PERROR(sta_cyc(CYCHDR1));
+			break;
+		case 'C':
+			syslog(LOG_INFO, "#stp_cyc(1)");
+			SVC_PERROR(stp_cyc(CYCHDR1));
+			break;
+		case 'b':
+			syslog(LOG_INFO, "#sta_alm(1, 5000000)");
+			SVC_PERROR(sta_alm(ALMHDR1, 5000000));
+			break;
+		case 'B':
+			syslog(LOG_INFO, "#stp_alm(1)");
+			SVC_PERROR(stp_alm(ALMHDR1));
+			break;
+
+		case 'V':
+			hrtcnt1 = fch_hrt();
+			hrtcnt2 = fch_hrt();
+			syslog(LOG_NOTICE, "hrtcnt1 = %tu, hrtcnt2 = %tu",
+										hrtcnt1, hrtcnt2);
+			break;
+
+		case 'o':
+#ifdef TOPPERS_SUPPORT_OVRHDR
+			syslog(LOG_INFO, "#sta_ovr(%d, 2000000)", tskno);
+			SVC_PERROR(sta_ovr(tskid, 2000000));
+#else /* TOPPERS_SUPPORT_OVRHDR */
+			syslog(LOG_NOTICE, "sta_ovr is not supported.");
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+			break;
+		case 'O':
+#ifdef TOPPERS_SUPPORT_OVRHDR
+			syslog(LOG_INFO, "#stp_ovr(%d)", tskno);
+			SVC_PERROR(stp_ovr(tskid));
+#else /* TOPPERS_SUPPORT_OVRHDR */
+			syslog(LOG_NOTICE, "stp_ovr is not supported.");
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+			break;
+
+		case 'v':
+			SVC_PERROR(syslog_msk_log(LOG_UPTO(LOG_INFO),
+										LOG_UPTO(LOG_EMERG)));
+			break;
+		case 'q':
+			SVC_PERROR(syslog_msk_log(LOG_UPTO(LOG_NOTICE),
+										LOG_UPTO(LOG_EMERG)));
+			break;
+
+#ifdef BIT_KERNEL
+		case ' ':
+			SVC_PERROR(loc_cpu());
+			{
+				extern ER	bit_kernel(void);
+
+				SVC_PERROR(ercd = bit_kernel());
+				if (ercd >= 0) {
+					syslog(LOG_NOTICE, "bit_kernel passed.");
+				}
+			}
+			SVC_PERROR(unl_cpu());
+			break;
+#endif /* BIT_KERNEL */
+
+		default:
+			break;
+		}
+	} while (c != '\003' && c != 'Q');
+
+	syslog(LOG_NOTICE, "Sample program ends.");
+	SVC_PERROR(ext_ker());
+	assert(0);
+}
Index: asp3_wo_tecs/trunk/extension/ovrhdr/sample/sample1.cfg
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/sample/sample1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/sample/sample1.cfg	(revision 302)
@@ -0,0 +1,27 @@
+/*
+ *  $Id: sample1.cfg 329 2015-06-21 06:55:08Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+INCLUDE("syssvc/logtask.cfg");
+
+#include "sample1.h"
+CRE_TSK(TASK1, { TA_NULL, 1, task, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(EXC_TASK, { TA_NULL, 0, exc_task, EXC_PRIORITY, STACK_SIZE, NULL });
+CRE_CYC(CYCHDR1, { TA_NULL, { TNFY_HANDLER, 0, cyclic_handler }, 2000000, 0 });
+CRE_ALM(ALMHDR1, { TA_NULL, { TNFY_HANDLER, 0, alarm_handler }});
+#ifdef TOPPERS_SUPPORT_OVRHDR
+DEF_OVR({ TA_NULL, overrun_handler });
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+#ifdef CPUEXC1
+DEF_EXC(CPUEXC1, { TA_NULL, cpuexc_handler });
+#endif /* CPUEXC1 */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/sample/sample1.h
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/sample/sample1.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/sample/sample1.h	(revision 302)
@@ -0,0 +1,119 @@
+/*
+ *  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) 2004-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: sample1.h 410 2015-08-03 21:54:44Z ertl-hiro $
+ */
+
+/*
+ *		ãµã³ãã«ãã­ã°ã©ã (1)ã®ããããã¡ã¤ã«
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+
+#define EXC_PRIORITY	1		/* ä¾å¤å¦çã¿ã¹ã¯ã®åªå
+åº¦ */
+#define MAIN_PRIORITY	5		/* ã¡ã¤ã³ã¿ã¹ã¯ã®åªå
+åº¦ */
+								/* HIGH_PRIORITYããé«ããããã¨ */
+
+#define HIGH_PRIORITY	9		/* ä¸¦è¡å®è¡ãããã¿ã¹ã¯ã®åªå
+åº¦ */
+#define MID_PRIORITY	10
+#define LOW_PRIORITY	11
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+
+#ifndef TASK_PORTID
+#define	TASK_PORTID		1			/* æå­å
+¥åããã·ãªã¢ã«ãã¼ãID */
+#endif /* TASK_PORTID */
+
+#ifndef STACK_SIZE
+#define	STACK_SIZE		4096		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãº */
+#endif /* STACK_SIZE */
+
+#ifndef LOOP_REF
+#define LOOP_REF		ULONG_C(1000000)	/* éåº¦è¨æ¸¬ç¨ã®ã«ã¼ãåæ° */
+#endif /* LOOP_REF */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+extern void	task(intptr_t exinf);
+extern void	main_task(intptr_t exinf);
+extern void exc_task(intptr_t exinf);
+#ifdef CPUEXC1
+extern void	cpuexc_handler(void *p_excinf);
+#endif /* CPUEXC1 */
+extern void	cyclic_handler(intptr_t exinf);
+extern void	alarm_handler(intptr_t exinf);
+#ifdef TOPPERS_SUPPORT_OVRHDR
+extern void	overrun_handler(ID tskid, intptr_t exinf);
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/extension/ovrhdr/test/test_ovrhdr1.c
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/test/test_ovrhdr1.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/test/test_ovrhdr1.c	(revision 302)
@@ -0,0 +1,477 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: test_ovrhdr1.c 444 2015-08-13 04:39:19Z ertl-hiro $
+ */
+
+/* 
+ *		ãªã¼ãã©ã³ãã³ãã©æ©è½ã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: é«åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: é«åªå
+åº¦ã¿ã¹ã¯
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *	OVR:   ãªã¼ãã©ã³ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	1:	ref_ovr(TASK2, &rovr)
+ *		assert(rovr.ovrstat == TOVR_STP)
+ *		// TASK2, TASK3ã«å¯¾ãã¦ï¼æ®ããã­ã»ããµæé20000Î¼ç§ã§ï¼ãªã¼ãã©ã³
+ *		// ãã³ãã©ãåä½éå§ãã
+ *		sta_ovr(TASK2, 20000U)
+ *		ref_ovr(TASK2, &rovr)
+ *		assert(rovr.ovrstat == TOVR_STA)
+ *		assert(rovr.leftotm == 20000U)
+ *		sta_ovr(TASK3, 20000U)
+ *		// 10000Î¼ç§å¾ã«ALM1ãåä½ããã
+ *		sta_alm(ALM1, 10000U)
+ *		DO(hrtcnt1 = fch_hrt())
+ *		act_tsk(TASK2)
+ *	== TASK2ï¼åªå
+åº¦ï¼é«ï¼==
+ *		// start_rã§ãªã¼ãã©ã³ã¿ã¤ããåä½éå§ãã
+ *	2:	act_tsk(TASK3)
+ *		DO(while(!task2_flag1))
+ *	== ALM1-1ï¼1åç®ï¼==
+ *		// TASK2ã®å®è¡éä¸­ã§ALM1ãåä½ãã
+ *		// å²è¾¼ã¿å
+¥å£å¦çã§ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ãã
+ *	3:	rot_rdq(HIGH_PRIORITY)
+ *		RETURN
+ *	== TASK3ï¼åªå
+åº¦ï¼é«ï¼==
+ *		// start_rã§ãªã¼ãã©ã³ã¿ã¤ããåä½éå§ãã
+ *		// TASK2ã®ãªã¼ãã©ã³ãã³ãã©ç¶æ
+ãç¢ºèªãã
+ *	4:	ref_ovr(TASK2, &rovr)
+ *		assert(rovr.ovrstat == TOVR_STA)
+ *		assert(5000U <= rovr.leftotm && rovr.leftotm <= 15000U)
+ *		DO(while(!task3_flag1))
+ *	== OVR-1ï¼1åç®ï¼==
+ *		// TASK3ã®æ®ããã­ã»ããµæéããªããªã
+ *	5:	assert(tskid == TASK3)
+ *		DO(task3_flag1 = true)
+ *		RETURN
+ *	== TASK3ï¼ç¶ãï¼==
+ *	6:	DO(task2_flag1 = true)
+ *		slp_tsk()
+ *	== TASK2ï¼ç¶ãï¼==
+ *		// å²è¾¼ã¿åºå£å¦çã§ãªã¼ãã©ã³ã¿ã¤ããåä½éå§ãã
+ *	7:	DO(while(!task2_flag2))
+ *	== OVR-2ï¼2åç®ï¼==
+ *		// TASK2ã®æ®ããã­ã»ããµæéããªããªã
+ *	8:	assert(tskid == TASK2)
+ *		DO(task2_flag2 = true)
+ *		RETURN
+ *	== TASK2ï¼ç¶ãï¼==
+ *	9:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	10:	DO(hrtcnt2 = fch_hrt())
+ *		assert(40000U <= hrtcnt2 - hrtcnt1 && hrtcnt2 - hrtcnt1 <= 50000U)
+ *		ref_ovr(TASK2, &rovr)
+ *		assert(rovr.ovrstat == TOVR_STP)
+ *		sta_ovr(TASK2, 20000U)
+ *		sta_alm(ALM1, 10000U)
+ *		DO(hrtcnt1 = fch_hrt())
+ *		wup_tsk(TASK2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *		// dispatch_rã§ãªã¼ãã©ã³ã¿ã¤ããåä½éå§ãã
+ *	11:	wup_tsk(TASK3)
+ *		DO(while(!task2_flag3))
+ *	== ALM1-2ï¼2åç®ï¼==
+ *		// TASK2ã®å®è¡éä¸­ã§ALM1ãåä½ãã
+ *		// å²è¾¼ã¿å
+¥å£å¦çã§ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ãã
+ *	12:	DO(task2_flag3 = true)
+ *		RETURN
+ *	== TASK2ï¼ç¶ãï¼==
+ *	13:	rot_rdq(HIGH_PRIORITY)
+ *		// dispatch_rã§ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ãã
+ *	== TASK3ï¼ç¶ãï¼==
+ *	14:	sta_alm(ALM1, 10000U)
+ *		sta_ovr(TSK_SELF, 20000U)
+ *		// sta_ovrã§ãªã¼ãã©ã³ã¿ã¤ããåä½éå§ãã
+ *		// TASK2ã®æ®ããã­ã»ããµæéã20000Î¼ç§ã«è¨­å®ããªãã
+ *		sta_ovr(TASK2, 20000U)
+ *	15:	DO(while(!task3_flag2))
+ *	== ALM1-3ï¼3åç®ï¼==
+ *		// TASK3ã®å®è¡éä¸­ã§ALM1ãåä½ãã
+ *		// å²è¾¼ã¿å
+¥å£å¦çã§ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ãã
+ *	16:	DO(task3_flag2 = true)
+ *		RETURN
+ *	== TASK3ï¼ç¶ãï¼==
+ *		// TASK3ã®æ®ããã­ã»ããµæéã20000Î¼ç§ã«è¨­å®ããªãã
+ *	17:	sta_ovr(TSK_SELF, 20000U)
+ *		// sta_ovrã§ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ï¼åä½éå§ãã
+ *		DO(while(!task3_flag3))
+ *	== OVR-3ï¼3åç®ï¼==
+ *		// TASK3ã®æ®ããã­ã»ããµæéããªããªã
+ *	18:	DO(task3_flag3 = true)
+ *		sta_ovr(TSK_SELF, 20000U) -> E_ID
+ *		// TASK3ã®æ®ããã­ã»ããµæéã20000Î¼ç§ã«è¨­å®ããªãã
+ *		sta_ovr(TASK3, 10000U)
+ *		RETURN
+ *	== TASK3ï¼ç¶ãï¼==
+ *	19:	DO(while(!task3_flag4))
+ *	== OVR-4ï¼4åç®ï¼==
+ *		// TASK3ã®æ®ããã­ã»ããµæéããªããªã
+ *	20:	DO(task3_flag4 = true)
+ *		rot_rdq(HIGH_PRIORITY)
+ *		RETURN
+ *	== TASK2ï¼ç¶ãï¼==
+ *		// dispatch_rã§ãªã¼ãã©ã³ã¿ã¤ããåä½éå§ãã
+ *	21:	DO(while(!task2_flag4))
+ *	== OVR-5ï¼5åç®ï¼==
+ *		// TASK2ã®æ®ããã­ã»ããµæéããªããªã
+ *	22:	DO(task2_flag4 = true)
+ *		RETURN
+ *	== TASK2ï¼ç¶ãï¼==
+ *	23:	slp_tsk()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	24:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	25:	DO(hrtcnt2 = fch_hrt())
+ *		assert(70000U <= hrtcnt2 - hrtcnt1 && hrtcnt2 - hrtcnt1 <= 80000U)
+ *	26:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_ovrhdr1.h"
+
+volatile bool_t	task2_flag1 = false;
+volatile bool_t	task2_flag2 = false;
+volatile bool_t	task2_flag3 = false;
+volatile bool_t	task2_flag4 = false;
+volatile bool_t	task3_flag1 = false;
+volatile bool_t	task3_flag2 = false;
+volatile bool_t	task3_flag3 = false;
+volatile bool_t	task3_flag4 = false;
+
+HRTCNT		hrtcnt1, hrtcnt2;
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+static uint_t	alarm1_count = 0;
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++alarm1_count) {
+	case 1:
+		check_point(3);
+		ercd = rot_rdq(HIGH_PRIORITY);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(12);
+		task2_flag3 = true;
+
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(16);
+		task3_flag2 = true;
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	overrun_count = 0;
+
+void
+overrun_handler(ID tskid, intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++overrun_count) {
+	case 1:
+		check_point(5);
+		check_assert(tskid == TASK3);
+
+		task3_flag1 = true;
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(8);
+		check_assert(tskid == TASK2);
+
+		task2_flag2 = true;
+
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(18);
+		task3_flag3 = true;
+
+		ercd = sta_ovr(TSK_SELF, 20000U);
+		check_ercd(ercd, E_ID);
+
+		ercd = sta_ovr(TASK3, 10000U);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	case 4:
+		check_point(20);
+		task3_flag4 = true;
+
+		ercd = rot_rdq(HIGH_PRIORITY);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	case 5:
+		check_point(22);
+		task2_flag4 = true;
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	T_ROVR	rovr;
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	ercd = ref_ovr(TASK2, &rovr);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rovr.ovrstat == TOVR_STP);
+
+	ercd = sta_ovr(TASK2, 20000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_ovr(TASK2, &rovr);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rovr.ovrstat == TOVR_STA);
+
+	check_assert(rovr.leftotm == 20000U);
+
+	ercd = sta_ovr(TASK3, 20000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	hrtcnt1 = fch_hrt();
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(10);
+	hrtcnt2 = fch_hrt();
+
+	check_assert(40000U <= hrtcnt2 - hrtcnt1 && hrtcnt2 - hrtcnt1 <= 50000U);
+
+	ercd = ref_ovr(TASK2, &rovr);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rovr.ovrstat == TOVR_STP);
+
+	ercd = sta_ovr(TASK2, 20000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	hrtcnt1 = fch_hrt();
+
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	hrtcnt2 = fch_hrt();
+
+	check_assert(70000U <= hrtcnt2 - hrtcnt1 && hrtcnt2 - hrtcnt1 <= 80000U);
+
+	check_finish(26);
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(2);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	while(!task2_flag1);
+
+	check_point(7);
+	while(!task2_flag2);
+
+	check_point(9);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	while(!task2_flag3);
+
+	check_point(13);
+	ercd = rot_rdq(HIGH_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(21);
+	while(!task2_flag4);
+
+	check_point(23);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	T_ROVR	rovr;
+	ER_UINT	ercd;
+
+	check_point(4);
+	ercd = ref_ovr(TASK2, &rovr);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rovr.ovrstat == TOVR_STA);
+
+	check_assert(5000U <= rovr.leftotm && rovr.leftotm <= 15000U);
+
+	while(!task3_flag1);
+
+	check_point(6);
+	task2_flag1 = true;
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = sta_ovr(TSK_SELF, 20000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = sta_ovr(TASK2, 20000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(15);
+	while(!task3_flag2);
+
+	check_point(17);
+	ercd = sta_ovr(TSK_SELF, 20000U);
+	check_ercd(ercd, E_OK);
+
+	while(!task3_flag3);
+
+	check_point(19);
+	while(!task3_flag4);
+
+	check_point(24);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/extension/ovrhdr/test/test_ovrhdr1.cfg
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/test/test_ovrhdr1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/test/test_ovrhdr1.cfg	(revision 302)
@@ -0,0 +1,18 @@
+/*
+ *		ãªã¼ãã©ã³ãã³ãã©æ©è½ã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§
+ *		ã³ãã¡ã¤ã«
+ *
+ *  $Id: test_ovrhdr1.cfg 327 2015-06-21 06:42:01Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_ovrhdr1.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, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
+DEF_OVR({ TA_NULL, overrun_handler });
Index: asp3_wo_tecs/trunk/extension/ovrhdr/test/test_ovrhdr1.h
===================================================================
--- asp3_wo_tecs/trunk/extension/ovrhdr/test/test_ovrhdr1.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/ovrhdr/test/test_ovrhdr1.h	(revision 302)
@@ -0,0 +1,93 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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_ovrhdr1.h 233 2014-09-28 09:38:43Z ertl-hiro $
+ */
+
+/* 
+ *		ãªã¼ãã©ã³ãã³ãã©æ©è½ã®ãã¹ã(1)
+ */
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#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);
+extern void overrun_handler(ID tskid, intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/extension/pri_level/include/kernel.h
===================================================================
--- asp3_wo_tecs/trunk/extension/pri_level/include/kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/pri_level/include/kernel.h	(revision 302)
@@ -0,0 +1,602 @@
+/*
+ *  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) 2004-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.h 463 2015-10-18 14:25:55Z ertl-hiro $
+ */
+
+/*
+ *		TOPPERS/ASPã«ã¼ãã« æ¨æºããããã¡ã¤ã«
+ *
+ *  TOPPERS/ASPã«ã¼ãã«ããµãã¼ããããµã¼ãã¹ã³ã¼ã«ã®å®£è¨ã¨ï¼å¿
+è¦ãªãã¼
+ *  ã¿åï¼å®æ°ï¼ãã¯ã­ã®å®ç¾©ãå«ãããããã¡ã¤ã«ï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ããï¼ããã«ããï¼ãã¯ã­å®ç¾©ä»¥å¤ã
+ *  é¤ãããã«ãªã£ã¦ããï¼
+ */
+
+#ifndef TOPPERS_KERNEL_H
+#define TOPPERS_KERNEL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *	TOPPERSå
+±éã®ãã¼ã¿åã»å®æ°ã»ãã¯ã­
+ */
+#include <t_stddef.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨
+ */
+#include "target_kernel.h"
+
+/*
+ *  ãµãã¼ãããæ©è½
+ */
+#ifdef TOPPERS_TARGET_SUPPORT_DIS_INT
+#define TOPPERS_SUPPORT_DIS_INT			/* dis_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_DIS_INT */
+
+#ifdef TOPPERS_TARGET_SUPPORT_ENA_INT
+#define TOPPERS_SUPPORT_ENA_INT			/* ena_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_ENA_INT */
+
+#define TOPPERS_SUPPORT_PRI_LEVEL		/* ã¿ã¹ã¯åªå
+åº¦ã®ç¯å²ã®æ¡å¼µ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãã¼ã¿åã®å®ç¾©
+ */
+
+/*
+ *  ããããã¿ã¼ã³ããªãã¸ã§ã¯ãçªå·ã®åå®ç¾©
+ */
+typedef	uint_t		FLGPTN;		/* ã¤ãã³ããã©ã°ã®ããããã¿ã¼ã³ */
+typedef	uint_t		INTNO;		/* å²è¾¼ã¿çªå· */
+typedef	uint_t		INHNO;		/* å²è¾¼ã¿ãã³ãã©çªå· */
+typedef	uint_t		EXCNO;		/* CPUä¾å¤ãã³ãã©çªå· */
+
+/*
+ *  å¦çåä½ã®åå®ç¾©
+ */
+typedef void	(*TASK)(intptr_t exinf);
+typedef void	(*TMEHDR)(intptr_t exinf);
+typedef void	(*ISR)(intptr_t exinf);
+typedef void	(*INTHDR)(void);
+typedef void	(*EXCHDR)(void *p_excinf);
+typedef void	(*INIRTN)(intptr_t exinf);
+typedef void	(*TERRTN)(intptr_t exinf);
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®åå®ç¾©
+ */
+#ifndef TOPPERS_STK_T
+#define TOPPERS_STK_T	intptr_t
+#endif /* TOPPERS_STK_T */
+typedef	TOPPERS_STK_T	STK_T;	/* ã¹ã¿ãã¯é åãç¢ºä¿ããããã®å */
+
+#ifndef TOPPERS_MPF_T
+#define TOPPERS_MPF_T	intptr_t
+#endif /* TOPPERS_MPF_T */
+typedef	TOPPERS_MPF_T	MPF_T;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åãç¢ºä¿ããããã®å */
+
+/*
+ *  ãã±ããå½¢å¼ã®å®ç¾©
+ */
+typedef struct t_rtsk {
+	STAT	tskstat;	/* ã¿ã¹ã¯ç¶æ
+ */
+	PRI		tskpri;		/* ã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ */
+	PRI		tskbpri;	/* ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+	STAT	tskwait;	/* å¾
+ã¡è¦å  */
+	ID		wobjid;		/* å¾
+ã¡å¯¾è±¡ã®ãªãã¸ã§ã¯ãã®ID */
+	TMO		lefttmo;	/* ã¿ã¤ã ã¢ã¦ãããã¾ã§ã®æé */
+	uint_t	actcnt;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	uint_t	wupcnt;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	bool_t	raster;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	bool_t	dister;		/* ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ */
+} T_RTSK;
+
+typedef struct t_rsem {
+	ID		wtskid;		/* ã»ããã©ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	semcnt;		/* ã»ããã©ã®ç¾å¨ã®è³æºæ° */
+} T_RSEM;
+
+typedef struct t_rflg {
+	ID		wtskid;		/* ã¤ãã³ããã©ã°ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	FLGPTN	flgptn;		/* ã¤ãã³ããã©ã°ã®ç¾å¨ã®ããããã¿ã¼ã³ */
+} T_RFLG;
+
+typedef struct t_rdtq {
+	ID		stskid;		/* ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	ID		rtskid;		/* ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	sdtqcnt;	/* ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼ã¿ã®æ° */
+} T_RDTQ;
+
+typedef struct t_rpdq {
+	ID		stskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	ID		rtskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	uint_t	spdqcnt;	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼
+						   ã¿ã®æ° */
+} T_RPDQ;
+
+typedef struct t_rmtx {
+	ID		htskid;		/* ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã¿ã¹ã¯ã®IDçªå· */
+	ID		wtskid;		/* ãã¥ã¼ããã¯ã¹ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+} T_RMTX;
+
+typedef struct t_rmpf {
+	ID		wtskid;		/* åºå®é·ã¡ã¢ãªãã¼ã«ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®
+						   IDçªå· */
+	uint_t	fblkcnt;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®ç©ºãã¡ã¢ãªé åã«å²ã
+						   ä»ãããã¨ãã§ããåºå®é·ã¡ã¢ãªãã­ãã¯ã®æ° */
+} T_RMPF;
+
+typedef struct t_rcyc {
+	STAT	cycstat;	/* å¨æéç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* æ¬¡åéç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RCYC;
+
+typedef struct t_ralm {
+	STAT	almstat;	/* ã¢ã©ã¼ã éç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* éç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RALM;
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å®£è¨
+ */
+
+/*
+ *  ã¿ã¹ã¯ç®¡çæ©è½
+ */
+extern ER		act_tsk(ID tskid) throw();
+extern ER_UINT	can_act(ID tskid) throw();
+extern ER		get_tst(ID tskid, STAT *p_tskstat) throw();
+extern ER		chg_pri(ID tskid, PRI tskpri) throw();
+extern ER		get_pri(ID tskid, PRI *p_tskpri) throw();
+extern ER		get_inf(intptr_t *p_exinf) throw();
+extern ER		ref_tsk(ID tskid, T_RTSK *pk_rtsk) throw();
+
+/*
+ *  ã¿ã¹ã¯ä»å±åææ©è½
+ */
+extern ER		slp_tsk(void) throw();
+extern ER		tslp_tsk(TMO tmout) throw();
+extern ER		wup_tsk(ID tskid) throw();
+extern ER_UINT	can_wup(ID tskid) throw();
+extern ER		rel_wai(ID tskid) throw();
+extern ER		sus_tsk(ID tskid) throw();
+extern ER		rsm_tsk(ID tskid) throw();
+extern ER		dly_tsk(RELTIM dlytim) throw();
+
+/*
+ *  ã¿ã¹ã¯çµäºæ©è½
+ */
+extern ER		ext_tsk(void) throw();
+extern ER		ras_ter(ID tskid) throw();
+extern ER		dis_ter(void) throw();
+extern ER		ena_ter(void) throw();
+extern bool_t	sns_ter(void) throw();
+extern ER		ter_tsk(ID tskid) throw();
+
+/*
+ *  åæã»éä¿¡æ©è½
+ */
+extern ER		sig_sem(ID semid) throw();
+extern ER		wai_sem(ID semid) throw();
+extern ER		pol_sem(ID semid) throw();
+extern ER		twai_sem(ID semid, TMO tmout) throw();
+extern ER		ini_sem(ID semid) throw();
+extern ER		ref_sem(ID semid, T_RSEM *pk_rsem) throw();
+
+extern ER		set_flg(ID flgid, FLGPTN setptn) throw();
+extern ER		clr_flg(ID flgid, FLGPTN clrptn) throw();
+extern ER		wai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		pol_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		twai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn, TMO tmout) throw();
+extern ER		ini_flg(ID flgid) throw();
+extern ER		ref_flg(ID flgid, T_RFLG *pk_rflg) throw();
+
+extern ER		snd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		psnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		tsnd_dtq(ID dtqid, intptr_t data, TMO tmout) throw();
+extern ER		fsnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		rcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		prcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		trcv_dtq(ID dtqid, intptr_t *p_data, TMO tmout) throw();
+extern ER		ini_dtq(ID dtqid) throw();
+extern ER		ref_dtq(ID dtqid, T_RDTQ *pk_rdtq) throw();
+
+extern ER		snd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		psnd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		tsnd_pdq(ID pdqid, intptr_t data,
+										PRI datapri, TMO tmout) throw();
+extern ER		rcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		prcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		trcv_pdq(ID pdqid, intptr_t *p_data,
+										PRI *p_datapri, TMO tmout) throw();
+extern ER		ini_pdq(ID pdqid) throw();
+extern ER		ref_pdq(ID pdqid, T_RPDQ *pk_rpdq) throw();
+
+extern ER		loc_mtx(ID mtxid) throw();
+extern ER		ploc_mtx(ID mtxid) throw();
+extern ER		tloc_mtx(ID mtxid, TMO tmout) throw();
+extern ER		unl_mtx(ID mtxid) throw();
+extern ER		ini_mtx(ID mtxid) throw();
+extern ER		ref_mtx(ID mtxid, T_RMTX *pk_rmtx) throw();
+
+/*
+ *  ã¡ã¢ãªãã¼ã«ç®¡çæ©è½
+ */
+extern ER		get_mpf(ID mpfid, void **p_blk) throw();
+extern ER		pget_mpf(ID mpfid, void **p_blk) throw();
+extern ER		tget_mpf(ID mpfid, void **p_blk, TMO tmout) throw();
+extern ER		rel_mpf(ID mpfid, void *blk) throw();
+extern ER		ini_mpf(ID mpfid) throw();
+extern ER		ref_mpf(ID mpfid, T_RMPF *pk_rmpf) throw();
+
+/*
+ *  æéç®¡çæ©è½
+ */
+extern ER		set_tim(SYSTIM systim) throw();
+extern ER		get_tim(SYSTIM *p_systim) throw();
+extern ER		adj_tim(int32_t adjtim) throw();
+extern HRTCNT	fch_hrt(void) throw();
+
+extern ER		sta_cyc(ID cycid) throw();
+extern ER		stp_cyc(ID cycid) throw();
+extern ER		ref_cyc(ID cycid, T_RCYC *pk_rcyc) throw();
+
+extern ER		sta_alm(ID almid, RELTIM almtim) throw();
+extern ER		stp_alm(ID almid) throw();
+extern ER		ref_alm(ID almid, T_RALM *pk_ralm) throw();
+
+/*
+ *  ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+ */
+extern ER		rot_rdq(PRI tskpri) throw();
+extern ER		get_tid(ID *p_tskid) throw();
+extern ER		get_lod(PRI tskpri, uint_t *p_load) throw();
+extern ER		get_nth(PRI tskpri, uint_t nth, ID *p_tskid) throw();
+extern ER		loc_cpu(void) throw();
+extern ER		unl_cpu(void) throw();
+extern ER		dis_dsp(void) throw();
+extern ER		ena_dsp(void) throw();
+extern bool_t	sns_ctx(void) throw();
+extern bool_t	sns_loc(void) throw();
+extern bool_t	sns_dsp(void) throw();
+extern bool_t	sns_dpn(void) throw();
+extern bool_t	sns_ker(void) throw();
+extern ER		ext_ker(void) throw();
+
+/*
+ *  å²è¾¼ã¿ç®¡çæ©è½
+ */
+extern ER		dis_int(INTNO intno) throw();
+extern ER		ena_int(INTNO intno) throw();
+extern ER		chg_ipm(PRI intpri) throw();
+extern ER		get_ipm(PRI *p_intpri) throw();
+
+/*
+ *  CPUä¾å¤ç®¡çæ©è½
+ */
+extern bool_t	xsns_dpn(void *p_excinf) throw();
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãããµã¼ãã¹ã³ã¼ã«
+ */
+#define iact_tsk(tskid)						act_tsk(tskid)
+#define iwup_tsk(tskid)						wup_tsk(tskid)
+#define irel_wai(tskid)						rel_wai(tskid)
+#define isns_ter()							sns_ter()
+#define isig_sem(semid)						sig_sem(semid)
+#define iset_flg(flgid, setptn)				set_flg(flgid, setptn)
+#define ipsnd_dtq(dtqid, data)				psnd_dtq(dtqid, data)
+#define ifsnd_dtq(dtqid, data)				fsnd_dtq(dtqid, data)
+#define ipsnd_pdq(pdqid, data, datapri)		psnd_pdq(pdqid, data, datapri)
+#define ifch_hrt()							fch_hrt()
+#define ista_alm(almid, almtim)				sta_alm(almid, almtim)
+#define istp_alm(almid)						stp_alm(almid)
+#define irot_rdq(tskpri)					rot_rdq(tskpri)
+#define iget_tid(p_tskid)					get_tid(p_tskid)
+#define iloc_cpu()							loc_cpu()
+#define iunl_cpu()							unl_cpu()
+#define isns_ctx()							sns_ctx()
+#define isns_loc()							sns_loc()
+#define isns_dsp()							sns_dsp()
+#define isns_dpn()							sns_dpn()
+#define isns_ker()							sns_ker()
+#define iext_ker()							ext_ker()
+#define idis_int(intno)						dis_int(intno)
+#define iena_int(intno)						ena_int(intno)
+#define ixsns_dpn(p_excinf)					xsns_dpn(p_excinf)
+
+/*
+ *  ãªãã¸ã§ã¯ãå±æ§ã®å®ç¾©
+ */
+#define TA_ACT			UINT_C(0x01)	/* ã¿ã¹ã¯ãèµ·åãããç¶æ
+ã§çæ */
+#define TA_NOACTQUE		UINT_C(0x02)	/* èµ·åè¦æ±ãã­ã¥ã¼ã¤ã³ã°ããªã */
+
+#define TA_TPRI			UINT_C(0x01)	/* ã¿ã¹ã¯ã®å¾
+ã¡è¡åãåªå
+åº¦é ã« */
+
+#define TA_WMUL			UINT_C(0x02)	/* è¤æ°ã®å¾
+ã¡ã¿ã¹ã¯ */
+#define TA_CLR			UINT_C(0x04)	/* ã¤ãã³ããã©ã°ã®ã¯ãªã¢æå® */
+
+#define TA_CEILING		UINT_C(0x03)	/* åªå
+åº¦ä¸éãã­ãã³ã« */
+
+#define TA_STA			UINT_C(0x02)	/* å¨æéç¥ãåä½ç¶æ
+ã§çæ */
+
+#define TA_NONKERNEL	UINT_C(0x02)	/* ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ */
+
+#define TA_ENAINT		UINT_C(0x01)	/* å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ãã¯ãªã¢ */
+#define TA_EDGE			UINT_C(0x02)	/* ã¨ãã¸ããªã¬ */
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®åä½ã¢ã¼ãã®å®ç¾©
+ */
+#define TWF_ORW			UINT_C(0x01)	/* ã¤ãã³ããã©ã°ã®ORå¾
+ã¡ */
+#define TWF_ANDW		UINT_C(0x02)	/* ã¤ãã³ããã©ã°ã®ANDå¾
+ã¡ */
+
+/*
+ *  éç¥å¦çã¢ã¼ãã®å®ç¾©
+ */
+#define TNFY_HANDLER	UINT_C(0x00)		/* ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºã */
+#define TNFY_SETVAR		UINT_C(0x01)		/* å¤æ°ã®è¨­å® */
+#define TNFY_INCVAR		UINT_C(0x02)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TNFY_ACTTSK		UINT_C(0x03)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TNFY_WUPTSK		UINT_C(0x04)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TNFY_SIGSEM		UINT_C(0x05)		/* ã»ããã©ã®è³æºã®è¿å´ */
+#define TNFY_SETFLG		UINT_C(0x06)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TNFY_SNDDTQ		UINT_C(0x07)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+#define TENFY_SETVAR	UINT_C(0x10)		/* å¤æ°ã®è¨­å® */
+#define TENFY_INCVAR	UINT_C(0x20)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TENFY_ACTTSK	UINT_C(0x30)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TENFY_WUPTSK	UINT_C(0x40)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TENFY_SIGSEM	UINT_C(0x50)		/* ã»ããã©ã®è¿å´ */
+#define TENFY_SETFLG	UINT_C(0x60)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TENFY_SNDDTQ	UINT_C(0x70)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+/*
+ *  ãªãã¸ã§ã¯ãã®ç¶æ
+ã®å®ç¾©
+ */
+#define TTS_RUN			UINT_C(0x01)	/* å®è¡ç¶æ
+ */
+#define TTS_RDY			UINT_C(0x02)	/* å®è¡å¯è½ç¶æ
+ */
+#define TTS_WAI			UINT_C(0x04)	/* å¾
+ã¡ç¶æ
+ */
+#define TTS_SUS			UINT_C(0x08)	/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+#define TTS_WAS			UINT_C(0x0c)	/* äºéå¾
+ã¡ç¶æ
+ */
+#define TTS_DMT			UINT_C(0x10)	/* ä¼æ­¢ç¶æ
+ */
+
+#define TTW_SLP			UINT_C(0x0001)	/* èµ·åºå¾
+ã¡ */
+#define TTW_DLY			UINT_C(0x0002)	/* æéçµéå¾
+ã¡ */
+#define TTW_SEM			UINT_C(0x0004)	/* ã»ããã©ã®è³æºç²å¾å¾
+ã¡ */
+#define TTW_FLG			UINT_C(0x0008)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TTW_SDTQ		UINT_C(0x0010)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RDTQ		UINT_C(0x0020)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_SPDQ		UINT_C(0x0100)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RPDQ		UINT_C(0x0200)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_MTX			UINT_C(0x0080)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ç¶æ
+ */
+#define TTW_MPF			UINT_C(0x2000)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TCYC_STP		UINT_C(0x01)	/* å¨æéç¥ãåä½ãã¦ããªã */
+#define TCYC_STA		UINT_C(0x02)	/* å¨æéç¥ãåä½ãã¦ãã */
+
+#define TALM_STP		UINT_C(0x01)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ããªã */
+#define TALM_STA		UINT_C(0x02)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ãã */
+
+/*
+ *  ãã®ä»ã®å®æ°ã®å®ç¾©
+ */
+#define TSK_SELF		0			/* èªã¿ã¹ã¯æå® */
+#define TSK_NONE		0			/* è©²å½ããã¿ã¹ã¯ããªã */
+
+#define TPRI_SELF		0			/* èªã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+#define TPRI_INI		0			/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ */
+
+#define TIPM_ENAALL		0			/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ */
+
+/*
+ *  æ§æå®æ°ã¨ãã¯ã­
+ */
+
+/*
+ *  åªå
+åº¦ã®ç¯å²
+ */
+#define TMIN_TPRI		1			/* ã¿ã¹ã¯åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_TPRI		256			/* ã¿ã¹ã¯åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_DPRI		1			/* ãã¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_DPRI		256			/* ãã¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_ISRPRI		1			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå°å¤ */
+#define TMAX_ISRPRI		256			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå¤§å¤ */
+
+/*
+ *  ãã¼ã¸ã§ã³æ
+å ±
+ */
+#define TKERNEL_MAKER	UINT_C(0x0118)	/* ã«ã¼ãã«ã®ã¡ã¼ã«ã¼ã³ã¼ã */
+#define TKERNEL_PRID	UINT_C(0x0007)	/* ã«ã¼ãã«ã®è­å¥çªå· */
+#define TKERNEL_SPVER	UINT_C(0xf630)	/* ã«ã¼ãã«ä»æ§ã®ãã¼ã¸ã§ã³çªå· */
+#define TKERNEL_PRVER	UINT_C(0x30b0)	/* ã«ã¼ãã«ã®ãã¼ã¸ã§ã³çªå· */
+
+/*
+ *  ã­ã¥ã¼ã¤ã³ã°åæ°ã®æå¤§å¤
+ */
+#define TMAX_ACTCNT		UINT_C(1)		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+#define TMAX_WUPCNT		UINT_C(1)		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+
+/*
+ *  ããããã¿ã¼ã³ã®ãããæ°
+ */
+#ifndef TBIT_FLGPTN					/* ã¤ãã³ããã©ã°ã®ãããæ° */
+#define TBIT_FLGPTN		(sizeof(FLGPTN) * CHAR_BIT)
+#endif /* TBIT_FLGPTN */
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´ã§ããç¯å²ï¼åä½ï¼Î¼ç§ï¼
+ */
+#define TMIN_ADJTIM		-1000000		/* ã·ã¹ãã æå»ã®æå°èª¿æ´æé */
+#define TMAX_ADJTIM		1000000			/* ã·ã¹ãã æå»ã®æå¤§èª¿æ´æé */
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®ãã¯ã­
+ *
+ *  ä»¥ä¸ã®TOPPERS_COUNT_SZã¨TOPPERS_ROUND_SZã®å®ç¾©ã¯ï¼unitã2ã®å·¾ä¹ã§ã
+ *  ããã¨ãä»®å®ãã¦ããï¼
+ */
+#ifndef TOPPERS_COUNT_SZ
+#define TOPPERS_COUNT_SZ(sz, unit)	(((sz) + (unit) - 1) / (unit))
+#endif /* TOPPERS_COUNT_SZ */
+#ifndef TOPPERS_ROUND_SZ
+#define TOPPERS_ROUND_SZ(sz, unit)	(((sz) + (unit) - 1) & ~((unit) - 1))
+#endif /* TOPPERS_ROUND_SZ */
+
+#define COUNT_STK_T(sz)		TOPPERS_COUNT_SZ(sz, sizeof(STK_T))
+#define ROUND_STK_T(sz)		TOPPERS_ROUND_SZ(sz, sizeof(STK_T))
+
+#define COUNT_MPF_T(blksz)	TOPPERS_COUNT_SZ(blksz, sizeof(MPF_T))
+#define ROUND_MPF_T(blksz)	TOPPERS_ROUND_SZ(blksz, sizeof(MPF_T))
+
+/*
+ *  ãã®ä»ã®æ§æå®æ°
+ */
+#define TMAX_MAXSEM		UINT_MAX	/* ã»ããã©ã®æå¤§è³æºæ°ã®æå¤§å¤ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_KERNEL_H */
Index: asp3_wo_tecs/trunk/extension/pri_level/kernel/kernel_rename.def
===================================================================
--- asp3_wo_tecs/trunk/extension/pri_level/kernel/kernel_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/extension/pri_level/kernel/kernel_rename.def	(revision 302)
@@ -0,0 +1,150 @@
+# startup.c
+kerflg
+exit_kernel
+
+# task.c
+p_runtsk
+p_schedtsk
+enadsp
+dspflg
+ready_queue
+ready_primap
+ready_primap1
+ready_primap2
+initialize_task
+search_schedtsk
+make_runnable
+make_non_runnable
+make_dormant
+make_active
+change_priority
+rotate_ready_queue
+task_terminate
+
+# taskhook.c
+mtxhook_check_ceilpri
+mtxhook_scan_ceilmtx
+mtxhook_release_all
+
+# wait.c
+make_wait_tmout
+wait_complete
+wait_tmout
+wait_tmout_ok
+wobj_make_wait
+wobj_make_wait_tmout
+init_wait_queue
+
+# time_event.c
+boundary_evttim
+current_evttim
+current_hrtcnt
+monotonic_evttim
+systim_offset
+in_signal_time
+initialize_tmevt
+tmevt_up
+tmevt_down
+update_current_evttim
+set_hrt_event
+tmevtb_register
+tmevtb_enqueue
+tmevtb_dequeue
+check_adjtim
+tmevt_lefttim
+signal_time
+
+# semaphore.c
+initialize_semaphore
+
+# eventflag.c
+initialize_eventflag
+check_flg_cond
+
+# dataqueue.c
+initialize_dataqueue
+enqueue_data
+force_enqueue_data
+dequeue_data
+send_data
+force_send_data
+receive_data
+
+# pridataq.c
+initialize_pridataq
+enqueue_pridata
+dequeue_pridata
+send_pridata
+receive_pridata
+
+# mutex.c
+initialize_mutex
+mutex_check_ceilpri
+mutex_scan_ceilmtx
+mutex_drop_priority
+mutex_acquire
+mutex_release
+mutex_release_all
+
+# mempfix.c
+initialize_mempfix
+get_mpf_block
+
+# cyclic.c
+initialize_cyclic
+call_cyclic
+
+# alarm.c
+initialize_alarm
+call_alarm
+
+# interrupt.c
+initialize_interrupt
+
+# exception.c
+initialize_exception
+
+# kernel_cfg.c
+initialize_object
+call_inirtn
+call_terrtn
+tmax_tskid
+tinib_table
+torder_table
+tcb_table
+tmax_semid
+seminib_table
+semcb_table
+tmax_flgid
+flginib_table
+flgcb_table
+tmax_dtqid
+dtqinib_table
+dtqcb_table
+tmax_pdqid
+pdqinib_table
+pdqcb_table
+tmax_mtxid
+mtxinib_table
+mtxcb_table
+tmax_mpfid
+mpfinib_table
+mpfcb_table
+tmax_cycid
+cycinib_table
+cyccb_table
+tmax_almid
+alminib_table
+almcb_table
+tnum_def_inhno
+inhinib_table
+tnum_cfg_intno
+intinib_table
+tnum_def_excno
+excinib_table
+tmevt_heap
+istksz
+istk
+istkpt
+
+INCLUDE "target"
Index: asp3_wo_tecs/trunk/extension/pri_level/kernel/kernel_rename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/pri_level/kernel/kernel_rename.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/pri_level/kernel/kernel_rename.h	(revision 302)
@@ -0,0 +1,376 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+#ifndef TOPPERS_KERNEL_RENAME_H
+#define TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  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 ready_primap1				_kernel_ready_primap1
+#define ready_primap2				_kernel_ready_primap2
+#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
+
+
+#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 _ready_primap1				__kernel_ready_primap1
+#define _ready_primap2				__kernel_ready_primap2
+#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"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/extension/pri_level/kernel/kernel_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/pri_level/kernel/kernel_unrename.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/pri_level/kernel/kernel_unrename.h	(revision 302)
@@ -0,0 +1,377 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+/* This file is included only when kernel_rename.h has been included. */
+#ifdef TOPPERS_KERNEL_RENAME_H
+#undef TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  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 ready_primap1
+#undef ready_primap2
+#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
+
+
+#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 _ready_primap1
+#undef _ready_primap2
+#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"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/extension/pri_level/kernel/task.c
===================================================================
--- asp3_wo_tecs/trunk/extension/pri_level/kernel/task.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/pri_level/kernel/task.c	(revision 302)
@@ -0,0 +1,512 @@
+/*
+ *  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: task.c 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#include "kernel_impl.h"
+#include "task.h"
+#include "taskhook.h"
+#include "wait.h"
+
+#ifdef TOPPERS_tskini
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯
+ */
+TCB		*p_runtsk;
+
+/*
+ *  å®è¡ãã¹ãã¿ã¹ã¯
+ */
+TCB		*p_schedtsk;
+
+/*
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+
+ */
+bool_t	enadsp;
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããå¯è½ç¶æ
+
+ */
+bool_t	dspflg;
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼
+ */
+QUEUE	ready_queue[TNUM_TPRI];
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ãµã¼ãã®ããã®ãããããã
+ */
+#ifdef PRIMAP_LEVEL_1
+uint16_t	ready_primap;
+#else /* PRIMAP_LEVEL_1 */
+uint16_t	ready_primap1;
+uint16_t	ready_primap2[TNUM_PRIMAP2];
+#endif /* PRIMAP_LEVEL_1 */
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®åæå
+ */
+void
+initialize_task(void)
+{
+	uint_t	i, j;
+	TCB		*p_tcb;
+
+	p_runtsk = NULL;
+	p_schedtsk = NULL;
+	enadsp = true;
+	dspflg = true;
+
+	for (i = 0; i < TNUM_TPRI; i++) {
+		queue_initialize(&(ready_queue[i]));
+	}
+#ifdef PRIMAP_LEVEL_1
+	ready_primap = 0U;
+#else /* PRIMAP_LEVEL_1 */
+	ready_primap1 = 0U;
+	for (i = 0; i < TNUM_PRIMAP2; i++) {
+		ready_primap2[i] = 0U;
+	}
+#endif /* PRIMAP_LEVEL_1 */
+
+	for (i = 0; i < tnum_tsk; i++) {
+		j = INDEX_TSK(torder_table[i]);
+		p_tcb = &(tcb_table[j]);
+		p_tcb->p_tinib = &(tinib_table[j]);
+		p_tcb->actque = false;
+		make_dormant(p_tcb);
+		p_tcb->p_lastmtx = NULL;
+		if ((p_tcb->p_tinib->tskatr & TA_ACT) != 0U) {
+			make_active(p_tcb);
+		}
+	}
+}
+
+#endif /* TOPPERS_tskini */
+
+/*
+ *  ãããããããµã¼ãé¢æ°
+ *
+ *  bitmapå
+ã®1ã®ãããã®å
+ï¼æãä¸ä½ï¼å³ï¼ã®ãã®ããµã¼ããï¼ãã®ãã
+ *  ãçªå·ãè¿ãï¼ãããçªå·ã¯ï¼æä¸ä½ãããã0ã¨ããï¼bitmapã«0ãæå®
+ *  ãã¦ã¯ãªããªãï¼ãã®é¢æ°ã§ã¯ï¼bitmapã16ãããã§ãããã¨ãä»®å®ãï¼
+ *  uint16_tåã¨ãã¦ããï¼
+ *
+ *  ããããµã¼ãå½ä»¤ãæã¤ãã­ã»ããµã§ã¯ï¼ããããµã¼ãå½ä»¤ãä½¿ãããã«
+ *  æ¸ãç´ããæ¹ãå¹çãè¯ãå ´åãããï¼ãã®ãããªå ´åã«ã¯ï¼ã¿ã¼ã²ãã
+ *  ä¾å­é¨ã§ããããµã¼ãå½ä»¤ãä½¿ã£ãbitmap_searchãå®ç¾©ãï¼
+ *  OMIT_BITMAP_SEARCHããã¯ã­å®ç¾©ããã°ããï¼ã¾ãï¼ããããµã¼ãå½ä»¤ã®
+ *  ãµã¼ãæ¹åãéãªã©ã®çç±ã§åªå
+åº¦ã¨ãããã¨ã®å¯¾å¿ãå¤æ´ãããå ´åã«
+ *  ã¯ï¼PRIMAP_BITããã¯ã­å®ç¾©ããã°ããï¼
+ *
+ *  ã¾ãï¼ã©ã¤ãã©ãªã«ffsããããªãï¼æ¬¡ã®ããã«å®ç¾©ãã¦ã©ã¤ãã©ãªé¢æ°ã
+ *  ä½¿ã£ãæ¹ãå¹çãè¯ãå¯è½æ§ãããï¼
+ *		#define	bitmap_search(bitmap) (ffs(bitmap) - 1)
+ */
+#ifndef PRIMAP_BIT
+#define	PRIMAP_BIT(pri)		(1U << (pri))
+#endif /* PRIMAP_BIT */
+
+#ifndef OMIT_BITMAP_SEARCH
+
+static const unsigned char bitmap_search_table[] = { 0, 1, 0, 2, 0, 1, 0,
+												3, 0, 1, 0, 2, 0, 1, 0 };
+
+Inline uint_t
+bitmap_search(uint16_t bitmap)
+{
+	uint_t	n = 0U;
+
+	assert(bitmap != 0U);
+	if ((bitmap & 0x00ffU) == 0U) {
+		bitmap >>= 8;
+		n += 8;
+	}
+	if ((bitmap & 0x0fU) == 0U) {
+		bitmap >>= 4;
+		n += 4;
+	}
+	return(n + bitmap_search_table[(bitmap & 0x0fU) - 1]);
+}
+
+#endif /* OMIT_BITMAP_SEARCH */
+
+/*
+ *  åªå
+åº¦ãããããããç©ºãã®ãã§ãã¯
+ */
+Inline bool_t
+primap_empty(void)
+{
+#ifdef PRIMAP_LEVEL_1
+	return(ready_primap == 0U);
+#else /* PRIMAP_LEVEL_1 */
+	return(ready_primap1 == 0U);
+#endif /* PRIMAP_LEVEL_1 */
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ãµã¼ã
+ */
+Inline uint_t
+primap_search(void)
+{
+#ifdef PRIMAP_LEVEL_1
+	return(bitmap_search(ready_primap));
+#else /* PRIMAP_LEVEL_1 */
+	uint_t	i;
+
+	i = bitmap_search(ready_primap1);
+	return(i * TBIT_PRIMAP + bitmap_search(ready_primap2[i]));
+#endif /* PRIMAP_LEVEL_1 */
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ã»ãã
+ */
+Inline void
+primap_set(uint_t pri)
+{
+#ifdef PRIMAP_LEVEL_1
+	ready_primap |= PRIMAP_BIT(pri);
+#else /* PRIMAP_LEVEL_1 */
+	ready_primap2[pri / TBIT_PRIMAP] |= PRIMAP_BIT(pri % TBIT_PRIMAP);
+	ready_primap1 |= PRIMAP_BIT(pri / TBIT_PRIMAP);
+#endif /* PRIMAP_LEVEL_1 */
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ã¯ãªã¢
+ */
+Inline void
+primap_clear(uint_t pri)
+{
+#ifdef PRIMAP_LEVEL_1
+	ready_primap &= ~PRIMAP_BIT(pri);
+#else /* PRIMAP_LEVEL_1 */
+	if ((ready_primap2[pri / TBIT_PRIMAP] &= ~PRIMAP_BIT(pri % TBIT_PRIMAP))
+																	== 0U) {
+		ready_primap1 &= ~PRIMAP_BIT(pri / TBIT_PRIMAP);
+	}
+#endif /* PRIMAP_LEVEL_1 */
+}
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã®ãµã¼ã
+ */
+#ifdef TOPPERS_tsksched
+
+TCB *
+search_schedtsk(void)
+{
+	uint_t	schedpri;
+
+	schedpri = primap_search();
+	return((TCB *)(ready_queue[schedpri].p_next));
+}
+
+#endif /* TOPPERS_tsksched */
+
+/*
+ *  å®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼å®è¡ã§ããã¿ã¹ã¯ããªãã£ãå ´åã¨ï¼
+ *  p_tcbã®åªå
+åº¦ãå®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã§ããï¼
+ */
+#ifdef TOPPERS_tskrun
+
+void
+make_runnable(TCB *p_tcb)
+{
+	uint_t	pri = p_tcb->priority;
+
+	queue_insert_prev(&(ready_queue[pri]), &(p_tcb->task_queue));
+	primap_set(pri);
+
+	if (dspflg) {
+		if (p_schedtsk == (TCB *) NULL || pri < p_schedtsk->priority) {
+			p_schedtsk = p_tcb;
+		}
+	}
+}
+
+#endif /* TOPPERS_tskrun */
+
+/*
+ *  å®è¡ã§ããç¶æ
+ããä»ã®ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ãå ´å
+ *  ã§ããï¼p_tcbã¨åãåªå
+åº¦ã®ã¿ã¹ã¯ãä»ã«ããå ´åã¯ï¼p_tcbã®æ¬¡ã®ã¿ã¹
+ *  ã¯ãå®è¡ãã¹ãã¿ã¹ã¯ã«ãªãï¼ããã§ãªãå ´åã¯ï¼ã¬ãã£ã­ã¥ã¼ããµã¼ã
+ *  ããå¿
+è¦ãããï¼
+ */
+#ifdef TOPPERS_tsknrun
+
+void
+make_non_runnable(TCB *p_tcb)
+{
+	uint_t	pri = p_tcb->priority;
+	QUEUE	*p_queue = &(ready_queue[pri]);
+
+	queue_delete(&(p_tcb->task_queue));
+	if (queue_empty(p_queue)) {
+		primap_clear(pri);
+		if (p_schedtsk == p_tcb) {
+			assert(dspflg);
+			p_schedtsk = primap_empty() ? (TCB *) NULL : search_schedtsk();
+		}
+	}
+	else {
+		if (p_schedtsk == p_tcb) {
+			assert(dspflg);
+			p_schedtsk = (TCB *)(p_queue->p_next);
+		}
+	}
+}
+
+#endif /* TOPPERS_tsknrun */
+
+/*
+ *  ä¼æ­¢ç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_tskdmt
+
+void
+make_dormant(TCB *p_tcb)
+{
+	p_tcb->tstat = TS_DORMANT;
+	p_tcb->bpriority = p_tcb->p_tinib->ipriority;
+	p_tcb->priority = p_tcb->p_tinib->ipriority;
+	p_tcb->wupque = false;
+	p_tcb->raster = false;
+	p_tcb->enater = true;
+	LOG_TSKSTAT(p_tcb);
+}
+
+#endif /* TOPPERS_tskdmt */
+
+/*
+ *  ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_tskact
+
+void
+make_active(TCB *p_tcb)
+{
+	activate_context(p_tcb);
+	p_tcb->tstat = TS_RUNNABLE;
+	LOG_TSKSTAT(p_tcb);
+	make_runnable(p_tcb);
+}
+
+#endif /* TOPPERS_tskact */
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+åº¦ã®å¤æ´
+ *
+ *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã®å ´åã«ã¯ï¼ã¬ãã£ã­ã¥ã¼ã®ä¸­ã§ã®ä½ç½®ãå¤æ´ã
+ *  ãï¼ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã®ä¸­ã§å¾
+ã¡ç¶æ
+ã«ãªã£ã¦ããå ´åã«ã¯ï¼å¾
+
+ *  ã¡ã­ã¥ã¼ã®ä¸­ã§ã®ä½ç½®ãå¤æ´ããï¼
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼(1) p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ã¦ï¼
+ *  ãã®åªå
+åº¦ãä¸ããå ´åï¼(2) p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ã¯ãªãï¼å¤æ´å¾
+ *  ã®åªå
+åº¦ãå®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã§ããï¼(1)ã®å ´åã«
+ *  ã¯ï¼ã¬ãã£ã­ã¥ã¼ããµã¼ãããå¿
+è¦ãããï¼
+ */
+#ifdef TOPPERS_tskpri
+
+void
+change_priority(TCB *p_tcb, uint_t newpri, bool_t mtxmode)
+{
+	uint_t	oldpri;
+
+	oldpri = p_tcb->priority;
+	p_tcb->priority = newpri;
+
+	if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		/*
+		 *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã®å ´å
+		 */
+		queue_delete(&(p_tcb->task_queue));
+		if (queue_empty(&(ready_queue[oldpri]))) {
+			primap_clear(oldpri);
+		}
+		if (mtxmode) {
+			queue_insert_next(&(ready_queue[newpri]), &(p_tcb->task_queue));
+		}
+		else {
+			queue_insert_prev(&(ready_queue[newpri]), &(p_tcb->task_queue));
+		}
+		primap_set(newpri);
+
+		if (dspflg) {
+			if (p_schedtsk == p_tcb) {
+				if (newpri >= oldpri) {
+					p_schedtsk = search_schedtsk();
+				}
+			}
+			else {
+				if (mtxmode ? newpri <= p_schedtsk->priority
+							: newpri < p_schedtsk->priority) {
+					p_schedtsk = p_tcb;
+				}
+			}
+		}
+	}
+	else {
+		if (TSTAT_WAIT_WOBJCB(p_tcb->tstat)) {
+			/*
+			 *  ã¿ã¹ã¯ãï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨
+			 *  åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ããå ´å
+			 */
+			wobj_change_priority(((WINFO_WOBJ *)(p_tcb->p_winfo))->p_wobjcb,
+																	p_tcb);
+		}
+	}
+}
+
+#endif /* TOPPERS_tskpri */
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ã®åè»¢
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãã¿ã¹ã¯ã­ã¥ã¼ã®æ«
+ *  å°¾ã«ç§»åããå ´åã§ããï¼
+ */
+#ifdef TOPPERS_tskrot
+
+void
+rotate_ready_queue(QUEUE *p_queue)
+{
+	QUEUE	*p_entry;
+
+	if (!queue_empty(p_queue) && p_queue->p_next->p_next != p_queue) {
+		p_entry = queue_delete_next(p_queue);
+		queue_insert_prev(p_queue, p_entry);
+		if (dspflg) {
+			if (p_schedtsk == (TCB *) p_entry) {
+				p_schedtsk = (TCB *)(p_queue->p_next);
+			}
+		}
+	}
+}
+
+#endif /* TOPPERS_tskrot */
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºå¦ç
+ */
+#ifdef TOPPERS_tskterm
+
+void
+task_terminate(TCB *p_tcb)
+{
+	if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		make_non_runnable(p_tcb);
+	}
+	else if (TSTAT_WAITING(p_tcb->tstat)) {
+		wait_dequeue_wobj(p_tcb);
+		wait_dequeue_tmevtb(p_tcb);
+	}
+	if (p_tcb->p_lastmtx != NULL) {
+		(*mtxhook_release_all)(p_tcb);
+	}
+	make_dormant(p_tcb);
+	if (p_tcb->actque) {
+		p_tcb->actque = false;
+		make_active(p_tcb);
+	}
+}
+
+#endif /* TOPPERS_tskterm */
Index: asp3_wo_tecs/trunk/extension/pri_level/kernel/task.h
===================================================================
--- asp3_wo_tecs/trunk/extension/pri_level/kernel/task.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/pri_level/kernel/task.h	(revision 302)
@@ -0,0 +1,667 @@
+/*
+ *  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: task.h 452 2015-08-15 02:36:39Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_TASK_H
+#define TOPPERS_TASK_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "time_event.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_TSKSTAT
+#define LOG_TSKSTAT(p_tcb)
+#endif /* LOG_TSKSTAT */
+
+/*
+ *  ã¿ã¹ã¯åªå
+åº¦ã®å
+é¨è¡¨ç¾ã»å¤é¨è¡¨ç¾å¤æãã¯ã­
+ */
+#define INT_PRIORITY(x)		((uint_t)((x) - TMIN_TPRI))
+#define EXT_TSKPRI(x)		((PRI)(x) + TMIN_TPRI)
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+ã®å
+é¨è¡¨ç¾
+ *
+ *  TCBä¸­ã®ã¿ã¹ã¯ç¶æ
+ã®ãã£ã¼ã«ãã§ã¯ï¼ã¿ã¹ã¯ã®ç¶æ
+ã¨ï¼ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+
+ *  ã®æã®å¾
+ã¡è¦å ãè¡¨ãï¼ãã ãï¼å®è¡ç¶æ
+ï¼RUNNINGï¼ã¨å®è¡å¯è½ç¶æ
+
+ *  ï¼READYï¼ã¯åºå¥ããï¼ä¸¡ç¶æ
+ããããã¦å®è¡ã§ããç¶æ
+ï¼RUNNABLEï¼ã¨ã
+ *  ã¦ç®¡çããï¼äºéå¾
+ã¡ç¶æ
+ã¯ï¼(TS_WAITING_??? | TS_SUSPENDED)ã§è¡¨ãï¼
+ *
+ *  ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ãå«ãï¼ã®æã¯ï¼TS_WAITING_???ã§å¾
+ã¡
+ *  è¦å ãè¡¨ãï¼å¾
+ã¡è¦å ï¼5ãããã§è¡¨ç¾ãããï¼ã®ä¸ä½2ãããã§ï¼åæã»
+ *  éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãã£ã¦ãããã©ãããè¡¨ãï¼åæã»
+ *  éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãããªããã®ã¯ä¸ä½2ãããã00ï¼å
+ *  æã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼
+ *  ã«ã¤ãªãããã®ã¯10ã¾ãã¯11ï¼ããä»¥å¤ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãããã®ã¯01
+ *  ã¨ããï¼
+ */
+#define TS_DORMANT		0x00U			/* ä¼æ­¢ç¶æ
+ */
+#define TS_RUNNABLE		0x01U			/* å®è¡ã§ããç¶æ
+ */
+#define TS_SUSPENDED	0x02U			/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+
+#define TS_WAITING_SLP	(0x01U << 2)	/* èµ·åºå¾
+ã¡ */
+#define TS_WAITING_DLY	(0x02U << 2)	/* æéçµéå¾
+ã¡ */
+#define TS_WAITING_RDTQ	(0x08U << 2)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TS_WAITING_RPDQ	(0x09U << 2)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TS_WAITING_SEM	(0x10U << 2)	/* ã»ããã©è³æºã®ç²å¾å¾
+ã¡ */
+#define TS_WAITING_FLG	(0x11U << 2)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TS_WAITING_SDTQ	(0x12U << 2)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TS_WAITING_SPDQ	(0x13U << 2)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TS_WAITING_MTX	(0x14U << 2)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ */
+#define TS_WAITING_MPF	(0x15U << 2)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TS_WAITING_MASK	(0x1fU << 2)	/* å¾
+ã¡ç¶æ
+ã®å¤å¥ç¨ãã¹ã¯ */
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+å¤å¥ãã¯ã­
+ *
+ *  TSTAT_DORMANTã¯ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ã§ãããã©ãããï¼TSTAT_RUNNABLEã¯
+ *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ãããã©ãããå¤å¥ããï¼TSTAT_WAITINGã¯å¾
+
+ *  ã¡ç¶æ
+ã¨äºéå¾
+ã¡ç¶æ
+ã®ããããã§ãããã©ãããï¼TSTAT_SUSPENDEDã¯
+ *  å¼·å¶å¾
+ã¡ç¶æ
+ã¨äºéå¾
+ã¡ç¶æ
+ã®ããããã§ãããã©ãããå¤å¥ããï¼
+ */
+#define TSTAT_DORMANT(tstat)	((tstat) == TS_DORMANT)
+#define TSTAT_RUNNABLE(tstat)	(((tstat) & TS_RUNNABLE) != 0U)
+#define TSTAT_WAITING(tstat)	(((tstat) & TS_WAITING_MASK) != 0U)
+#define TSTAT_SUSPENDED(tstat)	(((tstat) & TS_SUSPENDED) != 0U)
+
+/*
+ *  ã¿ã¹ã¯å¾
+ã¡è¦å å¤å¥ãã¯ã­
+ *
+ *  TSTAT_WAIT_SLPã¯ã¿ã¹ã¯ãèµ·åºå¾
+ã¡ã§ãããã©ãããï¼TSTAT_WAIT_MTXã¯
+ *  ã¿ã¹ã¯ããã¥ã¼ããã¯ã¹å¾
+ã¡ã§ãããã©ãããå¤å¥ããï¼
+ *
+ *  ã¾ãï¼TSTAT_WAIT_WOBJ ã¯ã¿ã¹ã¯ãåæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡
+ *  ã§ãããï¼è¨ãæããã¨ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªã
+ *  ãã¦ãããï¼ã©ãããï¼TSTAT_WAIT_WOBJCBã¯ã¿ã¹ã¯ãåæã»éä¿¡ãªãã¸ã§
+ *  ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ãã
+ *  ãã©ãããå¤å¥ããï¼
+ */
+#define TSTAT_WAIT_SLP(tstat)	(((tstat) & ~TS_SUSPENDED) == TS_WAITING_SLP)
+#define TSTAT_WAIT_MTX(tstat)	(((tstat) & ~TS_SUSPENDED) == TS_WAITING_MTX)
+
+#define TSTAT_WAIT_WOBJ(tstat)		(((tstat) & (0x18U << 2)) != 0U)
+#define TSTAT_WAIT_WOBJCB(tstat)	(((tstat) & (0x10U << 2)) != 0U)
+
+/*
+ *  å¾
+ã¡æ
+å ±ãã­ãã¯ï¼WINFOï¼ã®å®ç¾©
+ *
+ *  ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã®éã¯ï¼TCBããã³ãã®p_winfoã§æãããWINFOãæ¬¡ã®
+ *  ããã«è¨­å®ããªããã°ãªããªãï¼
+ *
+ *  (a) TCBã®ã¿ã¹ã¯ç¶æ
+ãå¾
+ã¡ç¶æ
+ï¼TS_WAITING_???ï¼ã«ããï¼
+ *
+ *  (b) ã¿ã¤ã ã¢ã¦ããç£è¦ããããã«ï¼ã¿ã¤ã ã¤ãã³ããã­ãã¯ãç»é²ããï¼
+ *  ç»é²ããã¿ã¤ã ã¤ãã³ããã­ãã¯ã¯ï¼å¾
+ã¡ã«å
+¥ããµã¼ãã¹ã³ã¼ã«å¦çé¢æ°
+ *  ã®ã­ã¼ã«ã«å¤æ°ã¨ãã¦ç¢ºä¿ãï¼ããã¸ã®ãã¤ã³ã¿ãWINFOã®p_tmevtbã«è¨
+ *  æ¶ããï¼ã¿ã¤ã ã¢ã¦ãã®ç£è¦ãå¿
+è¦ãªãå ´åï¼æ°¸ä¹
+å¾
+ã¡ã®å ´åï¼ã«ã¯ï¼
+ *  p_tmevtbãNULLã«ããï¼
+ *
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã®å ´åã«ã¯ï¼æ¨æºã®WINFOã«
+ *  p_wobjcbãã£ã¼ã«ããè¿½å ããæ§é ä½ï¼WINFO_WOBJï¼wait.hã§å®ç¾©ï¼ã«ï¼
+ *  å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã«ä¾å­ãã¦è¨æ¶ãããã¨ãå¿
+è¦ãªæ
+å ±
+ *  ã®ããã®ãã£ã¼ã«ããè¿½å ããæ§é ä½ï¼WINFO_???ï¼ãå®ç¾©ãï¼WINFOã®ä»£
+ *  ããã«ç¨ããï¼ã¾ãï¼ä»¥ä¸ã®(c)ã(e)ã®è¨­å®ãè¡ãå¿
+è¦ãããï¼åæã»é
+ *  ä¿¡ãªãã¸ã§ã¯ãã«é¢ä¿ããªãå¾
+ã¡ï¼èµ·åºå¾
+ã¡ï¼æéçµéå¾
+ã¡ï¼ã®å ´åã«ã¯ï¼
+ *  ãããã¯å¿
+è¦ãªãï¼
+ *
+ *  (c) TCBãå¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãï¼å¾
+
+ *  ã¡ã­ã¥ã¼ã«ã¤ãªãããã«ï¼task_queueãä½¿ãï¼
+ *
+ *  (d) å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã¸ã®ãã¤ã³ã¿ãï¼
+ *  WINFO_WOBJã®p_wobjcbã«è¨æ¶ããï¼
+ *
+ *  (e) å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã«ä¾å­ãã¦è¨æ¶ãããã¨ãå¿
+è¦ãª
+ *  æ
+å ±ãããå ´åã«ã¯ï¼WINFO_???å
+ã®ãã£ã¼ã«ãã«è¨æ¶ããï¼
+ *
+ *  å¾
+ã¡ç¶æ
+ãè§£é¤ããéã«ã¯ï¼å¾
+ã¡è§£é¤ããã¿ã¹ã¯ã«å¯¾ããè¿å¤ãWINFOã®
+ *  wercdã«è¨­å®ããï¼wercdãå¿
+è¦ãªã®ã¯å¾
+ã¡è§£é¤ä»¥éã§ããã®ã«å¯¾ãã¦ï¼
+ *  p_tmevtbã¯å¾
+ã¡è§£é¤å¾ã¯å¿
+è¦ãªãããï¼ã¡ã¢ãªç¯ç´ã®ããã«å
+±ç¨ä½ãä½¿ã£
+ *  ã¦ããï¼ãã®ããï¼wercdã¸ã¨ã©ã¼ã³ã¼ããè¨­å®ããã®ã¯ï¼ã¿ã¤ã ã¤ãã³ã
+ *  ãã­ãã¯ãç»é²è§£é¤ããå¾ã«ããªããã°ãªããªãï¼
+ */
+typedef union waiting_information {
+	ER		wercd;			/* å¾
+ã¡è§£é¤æã®ã¨ã©ã¼ã³ã¼ã */
+	TMEVTB	*p_tmevtb;		/* å¾
+ã¡ç¶æ
+ç¨ã®ã¿ã¤ã ã¤ãã³ããã­ãã¯ */
+} WINFO;
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ã®åã®åæ¹åç
+§
+ */
+typedef struct mutex_control_block MTXCB;
+
+/*
+ *  ã¿ã¹ã¯åæåãã­ãã¯
+ *
+ *  ã¿ã¹ã¯ã«é¢ããæ
+å ±ãï¼å¤ãå¤ãããªãããã«ROMã«ç½®ããé¨åï¼ã¿ã¹ã¯
+ *  åæåãã­ãã¯ï¼ã¨ï¼å¤ãå¤åããããã«RAMã«ç½®ããªããã°ãªããªãé¨
+ *  åï¼ã¿ã¹ã¯ç®¡çãã­ãã¯ï¼TCBï¼ã«åé¢ãï¼TCBå
+ã«å¯¾å¿ããã¿ã¹ã¯åæå
+ *  ãã­ãã¯ãæããã¤ã³ã¿ãå
+¥ããï¼ã¿ã¹ã¯åæåãã­ãã¯å
+ã«å¯¾å¿ãã
+ *  TCBãæããã¤ã³ã¿ãå
+¥ããæ¹æ³ã®æ¹ãï¼RAMã®ç¯ç´ã®è¦³ç¹ããã¯æã¾ãã
+ *  ãï¼å®è¡å¹çãæªããªãããã«æ¡ç¨ãã¦ããªãï¼ä»ã®ãªãã¸ã§ã¯ãã«ã¤ã
+ *  ã¦ãåæ§ã«æ±ãï¼
+ */
+typedef struct task_initialization_block {
+	ATR			tskatr;			/* ã¿ã¹ã¯å±æ§ */
+	intptr_t	exinf;			/* ã¿ã¹ã¯ã®æ¡å¼µæ
+å ± */
+	TASK		task;			/* ã¿ã¹ã¯ã®èµ·åçªå° */
+	uint_t		ipriority;		/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼ */
+
+#ifdef USE_TSKINICTXB
+	TSKINICTXB	tskinictxb;		/* ã¿ã¹ã¯åæåã³ã³ãã­ã¹ããã­ãã¯ */
+#else /* USE_TSKINICTXB */
+	size_t		stksz;			/* ã¹ã¿ãã¯é åã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
+	void		*stk;			/* ã¹ã¿ãã¯é åã®å
+é ­çªå° */
+#endif /* USE_TSKINICTXB */
+} TINIB;
+
+/*
+ *  ã¿ã¹ã¯ç®¡çãã­ãã¯ï¼TCBï¼
+ *
+ *  ASPã«ã¼ãã«ã§ã¯ï¼ã¿ã¹ã¯ã®èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ï¼TMAX_ACTCNTï¼
+ *  ã¨èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ï¼TMAX_WUPCNTï¼ã¯1ã«åºå®ããã¦ãã
+ *  ããï¼ã­ã¥ã¼ã¤ã³ã°ããã¦ãããã©ããã®çå½å¤ã§è¡¨ç¾ãããã¨ãã§ããï¼
+ *  ã¾ãï¼å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ã®æå¤§å¤ï¼TMAX_SUSCNTï¼ã1ã«åºå®ããã¦ã
+ *  ãã®ã§ï¼å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ï¼suscntï¼ã¯å¿
+è¦ãªãï¼
+ *
+ *  TCBã®ããã¤ãã®ãã£ã¼ã«ãã¯ï¼ç¹å®ã®ã¿ã¹ã¯ç¶æ
+ã§ã®ã¿æå¹ãªå¤ãä¿æãï¼
+ *  ããä»¥å¤ã®å ´åã¯å¤ãä¿è¨¼ãããªãï¼ãã£ã¦ï¼åç
+§ãã¦ã¯ãªããªãï¼ï¼å
+ *  ãã£ã¼ã«ããæå¹ãªå¤ãä¿æããæ¡ä»¶ã¯æ¬¡ã®éãï¼
+ *
+ *  ã»åæåå¾ã¯å¸¸ã«æå¹ï¼
+ *  		p_tinibï¼tstatï¼actque
+ *  ã»ä¼æ­¢ç¶æ
+ä»¥å¤ã§æå¹ï¼ä¼æ­¢ç¶æ
+ã§ã¯åæå¤ã«ãªã£ã¦ããï¼ï¼
+ *  		bpriorityï¼priorityï¼wupqueï¼rasterï¼enaterï¼p_lastmtx
+ *  ã»å¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ãå«ãï¼ã§æå¹ï¼
+ *  		p_winfo
+ *  ã»å®è¡ã§ããç¶æ
+ã¨åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã§æå¹ï¼
+ *  		task_queue
+ *  ã»å®è¡å¯è½ç¶æ
+ï¼å¾
+ã¡ç¶æ
+ï¼å¼·å¶å¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ã§æå¹ï¼
+ *  		tskctxb
+ */
+typedef struct task_control_block {
+	QUEUE			task_queue;		/* ã¿ã¹ã¯ã­ã¥ã¼ */
+	const TINIB		*p_tinib;		/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+
+#ifdef UINT8_MAX
+	uint8_t			tstat;			/* ã¿ã¹ã¯ç¶æ
+ï¼å
+é¨è¡¨ç¾ï¼*/
+	uint8_t			bpriority;		/* ãã¼ã¹åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+	uint8_t			priority;		/* ç¾å¨ã®åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+#else /* UINT8_MAX */
+	BIT_FIELD_UINT	tstat : 8;		/* ã¿ã¹ã¯ç¶æ
+ï¼å
+é¨è¡¨ç¾ï¼*/
+	BIT_FIELD_UINT	bpriority : 8;	/* ãã¼ã¹åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+	BIT_FIELD_UINT	priority : 8	/* ç¾å¨ã®åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/;
+#endif /* UINT8_MAX */
+	BIT_FIELD_BOOL	actque : 1;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã° */
+	BIT_FIELD_BOOL	wupque : 1;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã° */
+	BIT_FIELD_BOOL	raster : 1;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	BIT_FIELD_BOOL	enater : 1;		/* ã¿ã¹ã¯çµäºè¨±å¯ç¶æ
+ */
+
+	WINFO			*p_winfo;		/* å¾
+ã¡æ
+å ±ãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	MTXCB			*p_lastmtx;		/* æå¾ã«ã­ãã¯ãããã¥ã¼ããã¯ã¹ */
+	TSKCTXB			tskctxb;		/* ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ */
+} TCB;
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯
+ *
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯ï¼ï¼ãã­ã»ããµãã³ã³ãã­ã¹ããæã£ã¦ããã¿ã¹ã¯ï¼ã®
+ *  TCBãæããã¤ã³ã¿ï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ããªãå ´åã¯NULLã«ããï¼
+ *
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å¦çä¸­ã§ï¼èªã¿ã¹ã¯ï¼ãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºããã¿ã¹
+ *  ã¯ï¼ã«é¢ããæ
+å ±ãåç
+§ããå ´åã¯p_runtskãä½¿ãï¼p_runtskãæ¸ãæã
+ *  ãã®ã¯ï¼ãã£ã¹ãããã£ï¼ã¨åæåå¦çï¼ã®ã¿ã§ããï¼
+ */
+extern TCB	*p_runtsk;
+
+/*
+ *  å®è¡ãã¹ãã¿ã¹ã¯
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ã®TCBãæããã¤ã³ã¿ï¼å®è¡ã§ããã¿ã¹ã¯ããªãå ´åã¯
+ *  NULLã«ããï¼
+ *
+ *  p_runtskã¯ï¼éå¸¸ã¯p_schedtskã¨ä¸è´ãã¦ãããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ã
+ *  å®è¡ä¸­ã¯ï¼ä¸è´ãã¦ããã¨ã¯éããªãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªã
+ *  ç¶æ
+ã®éã¨ãã£ã¹ãããç¦æ­¢ç¶æ
+ã®éï¼ããªãã¡ï¼dspflgãfalseã§ããéï¼
+ *  ã¯ï¼p_schedtskãæ´æ°ããªãï¼
+ */
+extern TCB	*p_schedtsk;
+
+/*
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+
+ *
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ãããã¨ãç¤ºããã©ã°ï¼
+ */
+extern bool_t	enadsp;
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããå¯è½ç¶æ
+
+ *
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§ããï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ããï¼ãã£
+ *  ã¹ãããç¦æ­¢ç¶æ
+ã§ãªãï¼ãã¨ãç¤ºããã©ã°ï¼ãã£ã¹ãããä¿çç¶æ
+ã§ãª
+ *  ããã¨ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãå®è¡ä¸­ã§ï¼CPUã­ãã¯ç¶æ
+ã§ãªãï¼dspflgã
+ *  trueã§ãããã¨ã§å¤å¥ãããã¨ãã§ããï¼
+ */
+extern bool_t	dspflg;
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã¯ï¼å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ãç®¡çããããã®ã­ã¥ã¼ã§ããï¼
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãç®¡çãã¦ããããï¼ã¬ãã£ï¼å®è¡å¯è½ï¼ã­ã¥ã¼ã¨ãã
+ *  åç§°ã¯æ­£ç¢ºã§ã¯ãªããï¼ã¬ãã£ã­ã¥ã¼ã¨ããåç§°ãå®çãã¦ããããï¼ã
+ *  ã®åç§°ã§å¼ã¶ãã¨ã«ããï¼
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã¯ï¼åªå
+åº¦ãã¨ã®ã¿ã¹ã¯ã­ã¥ã¼ã§æ§æããã¦ããï¼ã¿ã¹ã¯ã®
+ *  TCBã¯ï¼è©²å½ããåªå
+åº¦ã®ã­ã¥ã¼ã«ç»é²ãããï¼
+ */
+extern QUEUE	ready_queue[TNUM_TPRI];
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ãµã¼ãã®ããã®ãããããã
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã®ãµã¼ããå¹çããè¡ãããã«ï¼åªå
+åº¦ãã¨ã®ã¿ã¹ã¯ã­ã¥ã¼
+ *  ã«ã¿ã¹ã¯ãå
+¥ã£ã¦ãããã©ãããç¤ºããããããããç¨æãã¦ããï¼ãã
+ *  ãããããä½¿ããã¨ã§ï¼ã¡ã¢ãªã¢ã¯ã»ã¹ã®åæ°ãæ¸ãããã¨ãã§ãããï¼
+ *  ãããæä½å½ä»¤ãå
+
+å®ãã¦ããªããã­ã»ããµã§ï¼åªå
+åº¦ã®æ®µéæ°ãå°ãªã
+ *  å ´åã«ã¯ï¼ããããããæä½ã®ãªã¼ãã¼ãããã®ããã«ï¼éã«å¹çãè½ã¡
+ *  ãå¯è½æ§ãããï¼
+ *
+ *  åªå
+åº¦ã®æ®µéæ°ã«ããï¼ããããããã1æ®µéã«ããã2æ®µéã«ããããæ±º
+ *  å®ããï¼2æ®µéã§è¶³ããªãå ´åã«ã¯å¯¾å¿ãã¦ããªãï¼
+ */
+#define TBIT_PRIMAP		16				/* ãããããã1ã¤ãããã®æ®µéæ° */
+
+#if TNUM_TPRI <= TBIT_PRIMAP
+#define PRIMAP_LEVEL_1					/* ããããããã1æ®µéã« */
+#elif TNUM_TPRI <= TBIT_PRIMAP * TBIT_PRIMAP
+#define PRIMAP_LEVEL_2					/* ããããããã2æ®µéã« */
+#define TNUM_PRIMAP2	((TNUM_TPRI + TBIT_PRIMAP - 1) / TBIT_PRIMAP)
+#else
+#error too many task priority levels.
+#endif
+
+#ifdef PRIMAP_LEVEL_1
+extern uint16_t	ready_primap;					/* åªå
+åº¦ãããããã */
+#else /* PRIMAP_LEVEL_1 */
+extern uint16_t	ready_primap1;					/* 1æ®µç®ã®åªå
+åº¦ãããããã */
+extern uint16_t	ready_primap2[TNUM_PRIMAP2];	/* 2æ®µç®ã®åªå
+åº¦ãããããã */
+#endif /* PRIMAP_LEVEL_1 */
+
+/*
+ *  ã¿ã¹ã¯IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_tskid;
+
+/*
+ *  ã¿ã¹ã¯åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const TINIB	tinib_table[];
+
+/*
+ *  ã¿ã¹ã¯çæé åºãã¼ãã«ï¼kernel_cfg.cï¼
+ */
+extern const ID	torder_table[];
+
+/*
+ *  TCBã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern TCB	tcb_table[];
+
+/*
+ *  ã¿ã¹ã¯ã®æ°
+ */
+#define tnum_tsk	((uint_t)(tmax_tskid - TMIN_TSKID + 1))
+
+/*
+ *  ã¿ã¹ã¯IDããTCBãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_TSK(tskid)	((uint_t)((tskid) - TMIN_TSKID))
+#define get_tcb(tskid)		(&(tcb_table[INDEX_TSK(tskid)]))
+
+/*
+ *  TCBããã¿ã¹ã¯IDãåãåºãããã®ãã¯ã­
+ */
+#define	TSKID(p_tcb)	((ID)(((p_tcb) - tcb_table) + TMIN_TSKID))
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®åæå
+ */
+extern void	initialize_task(void);
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã®ãµã¼ã
+ *
+ *  ã¬ãã£ã­ã¥ã¼ä¸­ã®æé«åªå
+é ä½ã®ã¿ã¹ã¯ããµã¼ããï¼ãã®TCBã¸ã®ãã¤ã³ã¿
+ *  ãè¿ãï¼ã¬ãã£ã­ã¥ã¼ãç©ºã®å ´åã«ã¯ï¼ãã®é¢æ°ãå¼ã³åºãã¦ã¯ãªããªãï¼
+ */
+extern TCB	*search_schedtsk(void);
+
+/*
+ *  å®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ã«æ¿å
+¥ããï¼ã¬ãã£ã­ã¥ã¼ã«æ¿å
+¥
+ *  ããã¿ã¹ã¯ã®åªå
+åº¦ãï¼å®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã¯ï¼å®
+ *  è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ */
+extern void	make_runnable(TCB *p_tcb);
+
+/*
+ *  å®è¡ã§ããç¶æ
+ããä»ã®ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ããåé¤ããï¼p_tcbã§æå®ãã
+ *  ã¿ã¹ã¯ãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ãå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ã
+ *  ãï¼
+ */
+extern void	make_non_runnable(TCB *p_tcb);
+
+/*
+ *  ä¼æ­¢ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¶æ
+ãä¼æ­¢ç¶æ
+ã¨ããï¼ã¾ãï¼ã¿ã¹ã¯ã®èµ·å
+ *  æã«åæåãã¹ãå¤æ°ã®åæåã¨ï¼ã¿ã¹ã¯èµ·åã®ããã®ã³ã³ãã­ã¹ããè¨­
+ *  å®ããï¼
+ */
+extern void	make_dormant(TCB *p_tcb);
+
+/*
+ *  ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¶æ
+ãä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¨ããï¼
+ */
+extern void	make_active(TCB *p_tcb);
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+åº¦ã®å¤æ´
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®åªå
+åº¦ãnewpriï¼å
+é¨è¡¨ç¾ï¼ã«å¤æ´ããï¼ã¾ãï¼
+ *  å¿
+è¦ãªå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®åªå
+é ä½ã¯ï¼åªå
+åº¦ãåãã¿ã¹ã¯ã®ä¸­ã§ï¼
+ *  mtxmodeãfalseã®æã¯æä½ï¼mtxmodeãtrueã®æã¯æé«ã¨ããï¼
+ */
+extern void	change_priority(TCB *p_tcb, uint_t newpri, bool_t mtxmode);
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ã®åè»¢
+ *
+ *  ã¬ãã£ã­ã¥ã¼ä¸­ã®ï¼p_queueã§æå®ãããã¿ã¹ã¯ã­ã¥ã¼ãåè»¢ãããï¼ã¾ãï¼
+ *  å¿
+è¦ãªå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ */
+extern void	rotate_ready_queue(QUEUE *p_queue);
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºå¦ç
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãçµäºãããå¦çãè¡ãï¼ã¿ã¹ã¯ã®èµ·åè¦æ±ã­ã¥ã¼
+ *  ã¤ã³ã°æ°ã0ã§ãªãå ´åã«ã¯ï¼ååº¦èµ·åããããã®å¦çãè¡ãï¼
+ */
+extern void	task_terminate(TCB *p_tcb);
+
+#endif /* TOPPERS_TASK_H */
Index: asp3_wo_tecs/trunk/extension/pri_level/test/test_task1.h
===================================================================
--- asp3_wo_tecs/trunk/extension/pri_level/test/test_task1.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/pri_level/test/test_task1.h	(revision 302)
@@ -0,0 +1,97 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: test_task1.h 338 2015-06-28 09:11:10Z ertl-hiro $
+ */
+
+/* 
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®ãã¹ã(1)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åªå
+åº¦ã®å®ç¾©
+ */
+#define HIGH_PRIORITY	18		/* é«åªå
+åº¦ */
+#define MID_PRIORITY	137		/* ä¸­åªå
+åº¦ */
+#define LOW_PRIORITY	255		/* ä½åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#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	task4(intptr_t exinf);
+extern void	task5(intptr_t exinf);
+extern void	task6(intptr_t exinf);
+extern void	alarm1_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/extension/rstr_task/include/kernel.h
===================================================================
--- asp3_wo_tecs/trunk/extension/rstr_task/include/kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/rstr_task/include/kernel.h	(revision 302)
@@ -0,0 +1,602 @@
+/*
+ *  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) 2004-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.h 463 2015-10-18 14:25:55Z ertl-hiro $
+ */
+
+/*
+ *		TOPPERS/ASPã«ã¼ãã« æ¨æºããããã¡ã¤ã«
+ *
+ *  TOPPERS/ASPã«ã¼ãã«ããµãã¼ããããµã¼ãã¹ã³ã¼ã«ã®å®£è¨ã¨ï¼å¿
+è¦ãªãã¼
+ *  ã¿åï¼å®æ°ï¼ãã¯ã­ã®å®ç¾©ãå«ãããããã¡ã¤ã«ï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ããï¼ããã«ããï¼ãã¯ã­å®ç¾©ä»¥å¤ã
+ *  é¤ãããã«ãªã£ã¦ããï¼
+ */
+
+#ifndef TOPPERS_KERNEL_H
+#define TOPPERS_KERNEL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *	TOPPERSå
+±éã®ãã¼ã¿åã»å®æ°ã»ãã¯ã­
+ */
+#include <t_stddef.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨
+ */
+#include "target_kernel.h"
+
+/*
+ *  ãµãã¼ãããæ©è½
+ */
+#ifdef TOPPERS_TARGET_SUPPORT_DIS_INT
+#define TOPPERS_SUPPORT_DIS_INT			/* dis_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_DIS_INT */
+
+#ifdef TOPPERS_TARGET_SUPPORT_ENA_INT
+#define TOPPERS_SUPPORT_ENA_INT			/* ena_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_ENA_INT */
+
+#define TOPPERS_SUPPORT_RSTR_TASK		/* å¶ç´ã¿ã¹ã¯æ©è½æ¡å¼µ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãã¼ã¿åã®å®ç¾©
+ */
+
+/*
+ *  ããããã¿ã¼ã³ããªãã¸ã§ã¯ãçªå·ã®åå®ç¾©
+ */
+typedef	uint_t		FLGPTN;		/* ã¤ãã³ããã©ã°ã®ããããã¿ã¼ã³ */
+typedef	uint_t		INTNO;		/* å²è¾¼ã¿çªå· */
+typedef	uint_t		INHNO;		/* å²è¾¼ã¿ãã³ãã©çªå· */
+typedef	uint_t		EXCNO;		/* CPUä¾å¤ãã³ãã©çªå· */
+
+/*
+ *  å¦çåä½ã®åå®ç¾©
+ */
+typedef void	(*TASK)(intptr_t exinf);
+typedef void	(*TMEHDR)(intptr_t exinf);
+typedef void	(*ISR)(intptr_t exinf);
+typedef void	(*INTHDR)(void);
+typedef void	(*EXCHDR)(void *p_excinf);
+typedef void	(*INIRTN)(intptr_t exinf);
+typedef void	(*TERRTN)(intptr_t exinf);
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®åå®ç¾©
+ */
+#ifndef TOPPERS_STK_T
+#define TOPPERS_STK_T	intptr_t
+#endif /* TOPPERS_STK_T */
+typedef	TOPPERS_STK_T	STK_T;	/* ã¹ã¿ãã¯é åãç¢ºä¿ããããã®å */
+
+#ifndef TOPPERS_MPF_T
+#define TOPPERS_MPF_T	intptr_t
+#endif /* TOPPERS_MPF_T */
+typedef	TOPPERS_MPF_T	MPF_T;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åãç¢ºä¿ããããã®å */
+
+/*
+ *  ãã±ããå½¢å¼ã®å®ç¾©
+ */
+typedef struct t_rtsk {
+	STAT	tskstat;	/* ã¿ã¹ã¯ç¶æ
+ */
+	PRI		tskpri;		/* ã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ */
+	PRI		tskbpri;	/* ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+	STAT	tskwait;	/* å¾
+ã¡è¦å  */
+	ID		wobjid;		/* å¾
+ã¡å¯¾è±¡ã®ãªãã¸ã§ã¯ãã®ID */
+	TMO		lefttmo;	/* ã¿ã¤ã ã¢ã¦ãããã¾ã§ã®æé */
+	uint_t	actcnt;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	uint_t	wupcnt;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	bool_t	raster;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	bool_t	dister;		/* ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ */
+} T_RTSK;
+
+typedef struct t_rsem {
+	ID		wtskid;		/* ã»ããã©ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	semcnt;		/* ã»ããã©ã®ç¾å¨ã®è³æºæ° */
+} T_RSEM;
+
+typedef struct t_rflg {
+	ID		wtskid;		/* ã¤ãã³ããã©ã°ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	FLGPTN	flgptn;		/* ã¤ãã³ããã©ã°ã®ç¾å¨ã®ããããã¿ã¼ã³ */
+} T_RFLG;
+
+typedef struct t_rdtq {
+	ID		stskid;		/* ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	ID		rtskid;		/* ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	sdtqcnt;	/* ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼ã¿ã®æ° */
+} T_RDTQ;
+
+typedef struct t_rpdq {
+	ID		stskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	ID		rtskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	uint_t	spdqcnt;	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼
+						   ã¿ã®æ° */
+} T_RPDQ;
+
+typedef struct t_rmtx {
+	ID		htskid;		/* ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã¿ã¹ã¯ã®IDçªå· */
+	ID		wtskid;		/* ãã¥ã¼ããã¯ã¹ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+} T_RMTX;
+
+typedef struct t_rmpf {
+	ID		wtskid;		/* åºå®é·ã¡ã¢ãªãã¼ã«ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®
+						   IDçªå· */
+	uint_t	fblkcnt;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®ç©ºãã¡ã¢ãªé åã«å²ã
+						   ä»ãããã¨ãã§ããåºå®é·ã¡ã¢ãªãã­ãã¯ã®æ° */
+} T_RMPF;
+
+typedef struct t_rcyc {
+	STAT	cycstat;	/* å¨æéç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* æ¬¡åéç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RCYC;
+
+typedef struct t_ralm {
+	STAT	almstat;	/* ã¢ã©ã¼ã éç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* éç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RALM;
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å®£è¨
+ */
+
+/*
+ *  ã¿ã¹ã¯ç®¡çæ©è½
+ */
+extern ER		act_tsk(ID tskid) throw();
+extern ER_UINT	can_act(ID tskid) throw();
+extern ER		get_tst(ID tskid, STAT *p_tskstat) throw();
+extern ER		chg_pri(ID tskid, PRI tskpri) throw();
+extern ER		get_pri(ID tskid, PRI *p_tskpri) throw();
+extern ER		get_inf(intptr_t *p_exinf) throw();
+extern ER		ref_tsk(ID tskid, T_RTSK *pk_rtsk) throw();
+
+/*
+ *  ã¿ã¹ã¯ä»å±åææ©è½
+ */
+extern ER		slp_tsk(void) throw();
+extern ER		tslp_tsk(TMO tmout) throw();
+extern ER		wup_tsk(ID tskid) throw();
+extern ER_UINT	can_wup(ID tskid) throw();
+extern ER		rel_wai(ID tskid) throw();
+extern ER		sus_tsk(ID tskid) throw();
+extern ER		rsm_tsk(ID tskid) throw();
+extern ER		dly_tsk(RELTIM dlytim) throw();
+
+/*
+ *  ã¿ã¹ã¯çµäºæ©è½
+ */
+extern ER		ext_tsk(void) throw();
+extern ER		ras_ter(ID tskid) throw();
+extern ER		dis_ter(void) throw();
+extern ER		ena_ter(void) throw();
+extern bool_t	sns_ter(void) throw();
+extern ER		ter_tsk(ID tskid) throw();
+
+/*
+ *  åæã»éä¿¡æ©è½
+ */
+extern ER		sig_sem(ID semid) throw();
+extern ER		wai_sem(ID semid) throw();
+extern ER		pol_sem(ID semid) throw();
+extern ER		twai_sem(ID semid, TMO tmout) throw();
+extern ER		ini_sem(ID semid) throw();
+extern ER		ref_sem(ID semid, T_RSEM *pk_rsem) throw();
+
+extern ER		set_flg(ID flgid, FLGPTN setptn) throw();
+extern ER		clr_flg(ID flgid, FLGPTN clrptn) throw();
+extern ER		wai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		pol_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		twai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn, TMO tmout) throw();
+extern ER		ini_flg(ID flgid) throw();
+extern ER		ref_flg(ID flgid, T_RFLG *pk_rflg) throw();
+
+extern ER		snd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		psnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		tsnd_dtq(ID dtqid, intptr_t data, TMO tmout) throw();
+extern ER		fsnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		rcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		prcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		trcv_dtq(ID dtqid, intptr_t *p_data, TMO tmout) throw();
+extern ER		ini_dtq(ID dtqid) throw();
+extern ER		ref_dtq(ID dtqid, T_RDTQ *pk_rdtq) throw();
+
+extern ER		snd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		psnd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		tsnd_pdq(ID pdqid, intptr_t data,
+										PRI datapri, TMO tmout) throw();
+extern ER		rcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		prcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		trcv_pdq(ID pdqid, intptr_t *p_data,
+										PRI *p_datapri, TMO tmout) throw();
+extern ER		ini_pdq(ID pdqid) throw();
+extern ER		ref_pdq(ID pdqid, T_RPDQ *pk_rpdq) throw();
+
+extern ER		loc_mtx(ID mtxid) throw();
+extern ER		ploc_mtx(ID mtxid) throw();
+extern ER		tloc_mtx(ID mtxid, TMO tmout) throw();
+extern ER		unl_mtx(ID mtxid) throw();
+extern ER		ini_mtx(ID mtxid) throw();
+extern ER		ref_mtx(ID mtxid, T_RMTX *pk_rmtx) throw();
+
+/*
+ *  ã¡ã¢ãªãã¼ã«ç®¡çæ©è½
+ */
+extern ER		get_mpf(ID mpfid, void **p_blk) throw();
+extern ER		pget_mpf(ID mpfid, void **p_blk) throw();
+extern ER		tget_mpf(ID mpfid, void **p_blk, TMO tmout) throw();
+extern ER		rel_mpf(ID mpfid, void *blk) throw();
+extern ER		ini_mpf(ID mpfid) throw();
+extern ER		ref_mpf(ID mpfid, T_RMPF *pk_rmpf) throw();
+
+/*
+ *  æéç®¡çæ©è½
+ */
+extern ER		set_tim(SYSTIM systim) throw();
+extern ER		get_tim(SYSTIM *p_systim) throw();
+extern ER		adj_tim(int32_t adjtim) throw();
+extern HRTCNT	fch_hrt(void) throw();
+
+extern ER		sta_cyc(ID cycid) throw();
+extern ER		stp_cyc(ID cycid) throw();
+extern ER		ref_cyc(ID cycid, T_RCYC *pk_rcyc) throw();
+
+extern ER		sta_alm(ID almid, RELTIM almtim) throw();
+extern ER		stp_alm(ID almid) throw();
+extern ER		ref_alm(ID almid, T_RALM *pk_ralm) throw();
+
+/*
+ *  ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+ */
+extern ER		rot_rdq(PRI tskpri) throw();
+extern ER		get_tid(ID *p_tskid) throw();
+extern ER		get_lod(PRI tskpri, uint_t *p_load) throw();
+extern ER		get_nth(PRI tskpri, uint_t nth, ID *p_tskid) throw();
+extern ER		loc_cpu(void) throw();
+extern ER		unl_cpu(void) throw();
+extern ER		dis_dsp(void) throw();
+extern ER		ena_dsp(void) throw();
+extern bool_t	sns_ctx(void) throw();
+extern bool_t	sns_loc(void) throw();
+extern bool_t	sns_dsp(void) throw();
+extern bool_t	sns_dpn(void) throw();
+extern bool_t	sns_ker(void) throw();
+extern ER		ext_ker(void) throw();
+
+/*
+ *  å²è¾¼ã¿ç®¡çæ©è½
+ */
+extern ER		dis_int(INTNO intno) throw();
+extern ER		ena_int(INTNO intno) throw();
+extern ER		chg_ipm(PRI intpri) throw();
+extern ER		get_ipm(PRI *p_intpri) throw();
+
+/*
+ *  CPUä¾å¤ç®¡çæ©è½
+ */
+extern bool_t	xsns_dpn(void *p_excinf) throw();
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãããµã¼ãã¹ã³ã¼ã«
+ */
+#define iact_tsk(tskid)						act_tsk(tskid)
+#define iwup_tsk(tskid)						wup_tsk(tskid)
+#define irel_wai(tskid)						rel_wai(tskid)
+#define isns_ter()							sns_ter()
+#define isig_sem(semid)						sig_sem(semid)
+#define iset_flg(flgid, setptn)				set_flg(flgid, setptn)
+#define ipsnd_dtq(dtqid, data)				psnd_dtq(dtqid, data)
+#define ifsnd_dtq(dtqid, data)				fsnd_dtq(dtqid, data)
+#define ipsnd_pdq(pdqid, data, datapri)		psnd_pdq(pdqid, data, datapri)
+#define ifch_hrt()							fch_hrt()
+#define ista_alm(almid, almtim)				sta_alm(almid, almtim)
+#define istp_alm(almid)						stp_alm(almid)
+#define irot_rdq(tskpri)					rot_rdq(tskpri)
+#define iget_tid(p_tskid)					get_tid(p_tskid)
+#define iloc_cpu()							loc_cpu()
+#define iunl_cpu()							unl_cpu()
+#define isns_ctx()							sns_ctx()
+#define isns_loc()							sns_loc()
+#define isns_dsp()							sns_dsp()
+#define isns_dpn()							sns_dpn()
+#define isns_ker()							sns_ker()
+#define iext_ker()							ext_ker()
+#define idis_int(intno)						dis_int(intno)
+#define iena_int(intno)						ena_int(intno)
+#define ixsns_dpn(p_excinf)					xsns_dpn(p_excinf)
+
+/*
+ *  ãªãã¸ã§ã¯ãå±æ§ã®å®ç¾©
+ */
+#define TA_ACT			UINT_C(0x01)	/* ã¿ã¹ã¯ãèµ·åãããç¶æ
+ã§çæ */
+#define TA_NOACTQUE		UINT_C(0x02)	/* èµ·åè¦æ±ãã­ã¥ã¼ã¤ã³ã°ããªã */
+#define TA_RSTR			UINT_C(0x04)	/* å¶ç´ã¿ã¹ã¯ */
+
+#define TA_TPRI			UINT_C(0x01)	/* ã¿ã¹ã¯ã®å¾
+ã¡è¡åãåªå
+åº¦é ã« */
+
+#define TA_WMUL			UINT_C(0x02)	/* è¤æ°ã®å¾
+ã¡ã¿ã¹ã¯ */
+#define TA_CLR			UINT_C(0x04)	/* ã¤ãã³ããã©ã°ã®ã¯ãªã¢æå® */
+
+#define TA_CEILING		UINT_C(0x03)	/* åªå
+åº¦ä¸éãã­ãã³ã« */
+
+#define TA_STA			UINT_C(0x02)	/* å¨æéç¥ãåä½ç¶æ
+ã§çæ */
+
+#define TA_NONKERNEL	UINT_C(0x02)	/* ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ */
+
+#define TA_ENAINT		UINT_C(0x01)	/* å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ãã¯ãªã¢ */
+#define TA_EDGE			UINT_C(0x02)	/* ã¨ãã¸ããªã¬ */
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®åä½ã¢ã¼ãã®å®ç¾©
+ */
+#define TWF_ORW			UINT_C(0x01)	/* ã¤ãã³ããã©ã°ã®ORå¾
+ã¡ */
+#define TWF_ANDW		UINT_C(0x02)	/* ã¤ãã³ããã©ã°ã®ANDå¾
+ã¡ */
+
+/*
+ *  éç¥å¦çã¢ã¼ãã®å®ç¾©
+ */
+#define TNFY_HANDLER	UINT_C(0x00)		/* ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºã */
+#define TNFY_SETVAR		UINT_C(0x01)		/* å¤æ°ã®è¨­å® */
+#define TNFY_INCVAR		UINT_C(0x02)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TNFY_ACTTSK		UINT_C(0x03)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TNFY_WUPTSK		UINT_C(0x04)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TNFY_SIGSEM		UINT_C(0x05)		/* ã»ããã©ã®è³æºã®è¿å´ */
+#define TNFY_SETFLG		UINT_C(0x06)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TNFY_SNDDTQ		UINT_C(0x07)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+#define TENFY_SETVAR	UINT_C(0x10)		/* å¤æ°ã®è¨­å® */
+#define TENFY_INCVAR	UINT_C(0x20)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TENFY_ACTTSK	UINT_C(0x30)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TENFY_WUPTSK	UINT_C(0x40)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TENFY_SIGSEM	UINT_C(0x50)		/* ã»ããã©ã®è¿å´ */
+#define TENFY_SETFLG	UINT_C(0x60)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TENFY_SNDDTQ	UINT_C(0x70)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+/*
+ *  ãªãã¸ã§ã¯ãã®ç¶æ
+ã®å®ç¾©
+ */
+#define TTS_RUN			UINT_C(0x01)	/* å®è¡ç¶æ
+ */
+#define TTS_RDY			UINT_C(0x02)	/* å®è¡å¯è½ç¶æ
+ */
+#define TTS_WAI			UINT_C(0x04)	/* å¾
+ã¡ç¶æ
+ */
+#define TTS_SUS			UINT_C(0x08)	/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+#define TTS_WAS			UINT_C(0x0c)	/* äºéå¾
+ã¡ç¶æ
+ */
+#define TTS_DMT			UINT_C(0x10)	/* ä¼æ­¢ç¶æ
+ */
+
+#define TTW_SLP			UINT_C(0x0001)	/* èµ·åºå¾
+ã¡ */
+#define TTW_DLY			UINT_C(0x0002)	/* æéçµéå¾
+ã¡ */
+#define TTW_SEM			UINT_C(0x0004)	/* ã»ããã©ã®è³æºç²å¾å¾
+ã¡ */
+#define TTW_FLG			UINT_C(0x0008)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TTW_SDTQ		UINT_C(0x0010)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RDTQ		UINT_C(0x0020)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_SPDQ		UINT_C(0x0100)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RPDQ		UINT_C(0x0200)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_MTX			UINT_C(0x0080)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ç¶æ
+ */
+#define TTW_MPF			UINT_C(0x2000)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TCYC_STP		UINT_C(0x01)	/* å¨æéç¥ãåä½ãã¦ããªã */
+#define TCYC_STA		UINT_C(0x02)	/* å¨æéç¥ãåä½ãã¦ãã */
+
+#define TALM_STP		UINT_C(0x01)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ããªã */
+#define TALM_STA		UINT_C(0x02)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ãã */
+
+/*
+ *  ãã®ä»ã®å®æ°ã®å®ç¾©
+ */
+#define TSK_SELF		0			/* èªã¿ã¹ã¯æå® */
+#define TSK_NONE		0			/* è©²å½ããã¿ã¹ã¯ããªã */
+
+#define TPRI_SELF		0			/* èªã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+#define TPRI_INI		0			/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ */
+
+#define TIPM_ENAALL		0			/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ */
+
+/*
+ *  æ§æå®æ°ã¨ãã¯ã­
+ */
+
+/*
+ *  åªå
+åº¦ã®ç¯å²
+ */
+#define TMIN_TPRI		1			/* ã¿ã¹ã¯åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_TPRI		16			/* ã¿ã¹ã¯åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_DPRI		1			/* ãã¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_DPRI		16			/* ãã¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_ISRPRI		1			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå°å¤ */
+#define TMAX_ISRPRI		16			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå¤§å¤ */
+
+/*
+ *  ãã¼ã¸ã§ã³æ
+å ±
+ */
+#define TKERNEL_MAKER	UINT_C(0x0118)	/* ã«ã¼ãã«ã®ã¡ã¼ã«ã¼ã³ã¼ã */
+#define TKERNEL_PRID	UINT_C(0x0007)	/* ã«ã¼ãã«ã®è­å¥çªå· */
+#define TKERNEL_SPVER	UINT_C(0xf630)	/* ã«ã¼ãã«ä»æ§ã®ãã¼ã¸ã§ã³çªå· */
+#define TKERNEL_PRVER	UINT_C(0x30b0)	/* ã«ã¼ãã«ã®ãã¼ã¸ã§ã³çªå· */
+
+/*
+ *  ã­ã¥ã¼ã¤ã³ã°åæ°ã®æå¤§å¤
+ */
+#define TMAX_ACTCNT		UINT_C(1)		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+#define TMAX_WUPCNT		UINT_C(1)		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+
+/*
+ *  ããããã¿ã¼ã³ã®ãããæ°
+ */
+#ifndef TBIT_FLGPTN					/* ã¤ãã³ããã©ã°ã®ãããæ° */
+#define TBIT_FLGPTN		(sizeof(FLGPTN) * CHAR_BIT)
+#endif /* TBIT_FLGPTN */
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´ã§ããç¯å²ï¼åä½ï¼Î¼ç§ï¼
+ */
+#define TMIN_ADJTIM		-1000000		/* ã·ã¹ãã æå»ã®æå°èª¿æ´æé */
+#define TMAX_ADJTIM		1000000			/* ã·ã¹ãã æå»ã®æå¤§èª¿æ´æé */
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®ãã¯ã­
+ *
+ *  ä»¥ä¸ã®TOPPERS_COUNT_SZã¨TOPPERS_ROUND_SZã®å®ç¾©ã¯ï¼unitã2ã®å·¾ä¹ã§ã
+ *  ããã¨ãä»®å®ãã¦ããï¼
+ */
+#ifndef TOPPERS_COUNT_SZ
+#define TOPPERS_COUNT_SZ(sz, unit)	(((sz) + (unit) - 1) / (unit))
+#endif /* TOPPERS_COUNT_SZ */
+#ifndef TOPPERS_ROUND_SZ
+#define TOPPERS_ROUND_SZ(sz, unit)	(((sz) + (unit) - 1) & ~((unit) - 1))
+#endif /* TOPPERS_ROUND_SZ */
+
+#define COUNT_STK_T(sz)		TOPPERS_COUNT_SZ(sz, sizeof(STK_T))
+#define ROUND_STK_T(sz)		TOPPERS_ROUND_SZ(sz, sizeof(STK_T))
+
+#define COUNT_MPF_T(blksz)	TOPPERS_COUNT_SZ(blksz, sizeof(MPF_T))
+#define ROUND_MPF_T(blksz)	TOPPERS_ROUND_SZ(blksz, sizeof(MPF_T))
+
+/*
+ *  ãã®ä»ã®æ§æå®æ°
+ */
+#define TMAX_MAXSEM		UINT_MAX	/* ã»ããã©ã®æå¤§è³æºæ°ã®æå¤§å¤ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_KERNEL_H */
Index: asp3_wo_tecs/trunk/extension/rstr_task/kernel/check.h
===================================================================
--- asp3_wo_tecs/trunk/extension/rstr_task/kernel/check.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/rstr_task/kernel/check.h	(revision 302)
@@ -0,0 +1,211 @@
+/*
+ *  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: check.h 356 2015-07-25 10:44:32Z ertl-hiro $
+ */
+
+/*
+ *		ã¨ã©ã¼ãã§ãã¯ç¨ãã¯ã­
+ */
+
+#ifndef TOPPERS_CHECK_H
+#define TOPPERS_CHECK_H
+
+#include "kernel_impl.h"
+
+/*
+ *  ãªãã¸ã§ã¯ãIDã®ç¯å²ã®å¤å®
+ */
+#define VALID_TSKID(tskid)	(TMIN_TSKID <= (tskid) && (tskid) <= tmax_tskid)
+#define VALID_SEMID(semid)	(TMIN_SEMID <= (semid) && (semid) <= tmax_semid)
+#define VALID_FLGID(flgid)	(TMIN_FLGID <= (flgid) && (flgid) <= tmax_flgid)
+#define VALID_DTQID(dtqid)	(TMIN_DTQID <= (dtqid) && (dtqid) <= tmax_dtqid)
+#define VALID_PDQID(pdqid)	(TMIN_PDQID <= (pdqid) && (pdqid) <= tmax_pdqid)
+#define VALID_MTXID(mtxid)	(TMIN_MTXID <= (mtxid) && (mtxid) <= tmax_mtxid)
+#define VALID_MPFID(mpfid)	(TMIN_MPFID <= (mpfid) && (mpfid) <= tmax_mpfid)
+#define VALID_CYCID(cycid)	(TMIN_CYCID <= (cycid) && (cycid) <= tmax_cycid)
+#define VALID_ALMID(almid)	(TMIN_ALMID <= (almid) && (almid) <= tmax_almid)
+
+/*
+ *  ãªãã¸ã§ã¯ãçªå·ã®ç¯å²ã®å¤å®
+ */
+#ifndef VALID_INTNO_DISINT
+#define VALID_INTNO_DISINT(intno)    VALID_INTNO(intno)
+#endif /* VALID_INTNO_DISINT */
+
+#ifndef VALID_INTNO_CREISR
+#define VALID_INTNO_CREISR(intno)    VALID_INTNO(intno)
+#endif /* VALID_INTNO_CREISR */
+
+/*
+ *  åªå
+åº¦ã®ç¯å²ã®å¤å®
+ */
+#define VALID_TPRI(tpri)	(TMIN_TPRI <= (tpri) && (tpri) <= TMAX_TPRI)
+
+#ifndef VALID_INTPRI_CHGIPM
+#define VALID_INTPRI_CHGIPM(intpri) \
+				(TMIN_INTPRI <= (intpri) && (intpri) <= TIPM_ENAALL)
+#endif /* VALID_INTPRI_CHGIPM */
+
+/*
+ *  ç¸å¯¾æéã®ç¯å²ã®å¤å®
+ */
+#define VALID_RELTIM(reltim)	((reltim) <= TMAX_RELTIM)
+
+/*
+ *  ã¿ã¤ã ã¢ã¦ãæå®å¤ã®ç¯å²ã®å¤å®
+ */
+#define VALID_TMOUT(tmout)	((tmout) <= TMAX_RELTIM || (tmout) == TMO_FEVR \
+													|| (tmout) == TMO_POL)
+
+/*
+ *  å¼åºãã³ã³ãã­ã¹ãã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_TSKCTX() do {									\
+	if (sense_context()) {									\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_UNL() do {									\
+	if (sense_lock()) {										\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  å¼åºãã³ã³ãã­ã¹ãã¨CPUã­ãã¯ç¶æ
+ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_TSKCTX_UNL() do {								\
+	if (sense_context() || sense_lock()) {					\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã£ã¹ãããä¿çç¶æ
+ã§ãªããã®ãã§ãã¯ï¼E_CTXï¼
+ *  èªã¿ã¹ã¯ãå¶ç´ã¿ã¹ã¯ã§ãªããã®ãã§ãã¯ï¼E_NOSPTï¼
+ */
+#define CHECK_DISPATCH() do {								\
+	if (sense_context() || sense_lock() || !dspflg) {		\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+	if ((p_runtsk->p_tinib->tskatr & TA_RSTR) != 0U) {		\
+		ercd = E_NOSPT;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã®ä»ã®ã³ã³ãã­ã¹ãã¨ã©ã¼ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_CTX(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãªãã¸ã§ã¯ãIDã®ãã§ãã¯ï¼E_IDï¼
+ */
+#define CHECK_ID(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_ID;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã©ã¡ã¼ã¿ã¨ã©ã¼ã®ãã§ãã¯ï¼E_PARï¼
+ */
+#define CHECK_PAR(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_PAR;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ä¸æ­£ä½¿ç¨ã¨ã©ã¼ã®ãã§ãã¯ï¼E_ILUSEï¼
+ */
+#define CHECK_ILUSE(exp) do {								\
+	if (!(exp)) {											\
+		ercd = E_ILUSE;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  æªãµãã¼ãæ©è½ã¨ã©ã¼ã®ãã§ãã¯ï¼E_NOSPTï¼
+ */
+#define CHECK_NOSPT(exp) do {								\
+	if (!(exp)) {											\
+		ercd = E_NOSPT;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+#endif /* TOPPERS_CHECK_H */
Index: asp3_wo_tecs/trunk/extension/rstr_task/kernel/kernel_def.csv
===================================================================
--- asp3_wo_tecs/trunk/extension/rstr_task/kernel/kernel_def.csv	(revision 302)
+++ asp3_wo_tecs/trunk/extension/rstr_task/kernel/kernel_def.csv	(revision 302)
@@ -0,0 +1,134 @@
+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_RSTR,TA_RSTR
+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/extension/rstr_task/kernel/sys_manage.c
===================================================================
--- asp3_wo_tecs/trunk/extension/rstr_task/kernel/sys_manage.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/rstr_task/kernel/sys_manage.c	(revision 302)
@@ -0,0 +1,561 @@
+/*
+ *  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: sys_manage.c 470 2015-12-30 09:50:36Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ROT_RDQ_ENTER
+#define LOG_ROT_RDQ_ENTER(tskpri)
+#endif /* LOG_ROT_RDQ_ENTER */
+
+#ifndef LOG_ROT_RDQ_LEAVE
+#define LOG_ROT_RDQ_LEAVE(ercd)
+#endif /* LOG_ROT_RDQ_LEAVE */
+
+#ifndef LOG_GET_TID_ENTER
+#define LOG_GET_TID_ENTER(p_tskid)
+#endif /* LOG_GET_TID_ENTER */
+
+#ifndef LOG_GET_TID_LEAVE
+#define LOG_GET_TID_LEAVE(ercd, p_tskid)
+#endif /* LOG_GET_TID_LEAVE */
+
+#ifndef LOG_GET_LOD_ENTER
+#define LOG_GET_LOD_ENTER(tskpri, p_load)
+#endif /* LOG_GET_LOD_ENTER */
+
+#ifndef LOG_GET_LOD_LEAVE
+#define LOG_GET_LOD_LEAVE(ercd, p_load)
+#endif /* LOG_GET_LOD_LEAVE */
+
+#ifndef LOG_GET_NTH_ENTER
+#define LOG_GET_NTH_ENTER(tskpri, nth, p_tskid)
+#endif /* LOG_GET_NTH_ENTER */
+
+#ifndef LOG_GET_NTH_LEAVE
+#define LOG_GET_NTH_LEAVE(ercd, p_tskid)
+#endif /* LOG_GET_NTH_LEAVE */
+
+#ifndef LOG_LOC_CPU_ENTER
+#define LOG_LOC_CPU_ENTER()
+#endif /* LOG_LOC_CPU_ENTER */
+
+#ifndef LOG_LOC_CPU_LEAVE
+#define LOG_LOC_CPU_LEAVE(ercd)
+#endif /* LOG_LOC_CPU_LEAVE */
+
+#ifndef LOG_UNL_CPU_ENTER
+#define LOG_UNL_CPU_ENTER()
+#endif /* LOG_UNL_CPU_ENTER */
+
+#ifndef LOG_UNL_CPU_LEAVE
+#define LOG_UNL_CPU_LEAVE(ercd)
+#endif /* LOG_UNL_CPU_LEAVE */
+
+#ifndef LOG_DIS_DSP_ENTER
+#define LOG_DIS_DSP_ENTER()
+#endif /* LOG_DIS_DSP_ENTER */
+
+#ifndef LOG_DIS_DSP_LEAVE
+#define LOG_DIS_DSP_LEAVE(ercd)
+#endif /* LOG_DIS_DSP_LEAVE */
+
+#ifndef LOG_ENA_DSP_ENTER
+#define LOG_ENA_DSP_ENTER()
+#endif /* LOG_ENA_DSP_ENTER */
+
+#ifndef LOG_ENA_DSP_LEAVE
+#define LOG_ENA_DSP_LEAVE(ercd)
+#endif /* LOG_ENA_DSP_LEAVE */
+
+#ifndef LOG_SNS_CTX_ENTER
+#define LOG_SNS_CTX_ENTER()
+#endif /* LOG_SNS_CTX_ENTER */
+
+#ifndef LOG_SNS_CTX_LEAVE
+#define LOG_SNS_CTX_LEAVE(state)
+#endif /* LOG_SNS_CTX_LEAVE */
+
+#ifndef LOG_SNS_LOC_ENTER
+#define LOG_SNS_LOC_ENTER()
+#endif /* LOG_SNS_LOC_ENTER */
+
+#ifndef LOG_SNS_LOC_LEAVE
+#define LOG_SNS_LOC_LEAVE(state)
+#endif /* LOG_SNS_LOC_LEAVE */
+
+#ifndef LOG_SNS_DSP_ENTER
+#define LOG_SNS_DSP_ENTER()
+#endif /* LOG_SNS_DSP_ENTER */
+
+#ifndef LOG_SNS_DSP_LEAVE
+#define LOG_SNS_DSP_LEAVE(state)
+#endif /* LOG_SNS_DSP_LEAVE */
+
+#ifndef LOG_SNS_DPN_ENTER
+#define LOG_SNS_DPN_ENTER()
+#endif /* LOG_SNS_DPN_ENTER */
+
+#ifndef LOG_SNS_DPN_LEAVE
+#define LOG_SNS_DPN_LEAVE(state)
+#endif /* LOG_SNS_DPN_LEAVE */
+
+#ifndef LOG_SNS_KER_ENTER
+#define LOG_SNS_KER_ENTER()
+#endif /* LOG_SNS_KER_ENTER */
+
+#ifndef LOG_SNS_KER_LEAVE
+#define LOG_SNS_KER_LEAVE(state)
+#endif /* LOG_SNS_KER_LEAVE */
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+é ä½ã®åè»¢
+ */
+#ifdef TOPPERS_rot_rdq
+
+ER
+rot_rdq(PRI tskpri)
+{
+	uint_t	pri;
+	QUEUE	*p_queue;
+	ER		ercd;
+
+	LOG_ROT_RDQ_ENTER(tskpri);
+	CHECK_UNL();
+	if (tskpri == TPRI_SELF && !sense_context()) {
+		pri = p_runtsk->bpriority;
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));
+		pri = INT_PRIORITY(tskpri);
+	}
+
+	lock_cpu();
+	p_queue = &(ready_queue[pri]);
+	if (queue_empty(p_queue)) {
+		ercd = E_OK;
+	}
+	else if ((((TCB *)(p_queue->p_next))->p_tinib->tskatr & TA_RSTR) != 0U) {
+		ercd = E_NOSPT;
+	}
+	else {
+		rotate_ready_queue(&(ready_queue[pri]));
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ROT_RDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rot_rdq */
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯IDã®åç
+§
+ */
+#ifdef TOPPERS_get_tid
+
+ER
+get_tid(ID *p_tskid)
+{
+	ER		ercd;
+
+	LOG_GET_TID_ENTER(p_tskid);
+	CHECK_UNL();
+
+	lock_cpu();
+	*p_tskid = (p_runtsk == NULL) ? TSK_NONE : TSKID(p_runtsk);
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_TID_LEAVE(ercd, p_tskid);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_tid */
+
+/*
+ *  å®è¡ã§ããã¿ã¹ã¯ã®æ°ã®åç
+§
+ */
+#ifdef TOPPERS_get_lod
+
+ER
+get_lod(PRI tskpri, uint_t *p_load)
+{
+	uint_t	pri, load;
+	QUEUE	*p_queue, *p_entry;
+	ER		ercd;
+
+	LOG_GET_LOD_ENTER(p_tskid, p_load);
+	CHECK_TSKCTX_UNL();
+	if (tskpri == TPRI_SELF) {
+		pri = p_runtsk->bpriority;
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));
+		pri = INT_PRIORITY(tskpri);
+	}
+	p_queue = &(ready_queue[pri]);
+
+	lock_cpu();
+	load = 0U;
+	for (p_entry = p_queue->p_next; p_entry != p_queue;
+										p_entry = p_entry->p_next) {
+		load += 1U;
+	}
+	*p_load = load;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_LOD_LEAVE(ercd, p_load);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_lod */
+
+/*
+ *  æå®ããåªå
+é ä½ã®ã¿ã¹ã¯IDã®åç
+§
+ */
+#ifdef TOPPERS_get_nth
+
+ER
+get_nth(PRI tskpri, uint_t nth, ID *p_tskid)
+{
+	uint_t	pri;
+	QUEUE	*p_queue, *p_entry;
+	ID		tskid;
+	ER		ercd;
+
+	LOG_GET_NTH_ENTER(p_tskid, nth, p_tskid);
+	CHECK_TSKCTX_UNL();
+	if (tskpri == TPRI_SELF) {
+		pri = p_runtsk->bpriority;
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));
+		pri = INT_PRIORITY(tskpri);
+	}
+	p_queue = &(ready_queue[pri]);
+
+	lock_cpu();
+	tskid = TSK_NONE;
+	for (p_entry = p_queue->p_next; p_entry != p_queue;
+										p_entry = p_entry->p_next) {
+		if (nth == 0U) {
+			tskid = TSKID((TCB *) p_entry);
+			break;
+		}
+		nth -= 1U;
+	}
+	*p_tskid = tskid;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_NTH_LEAVE(ercd, p_tskid);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_nth */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_loc_cpu
+
+ER
+loc_cpu(void)
+{
+	ER		ercd;
+
+	LOG_LOC_CPU_ENTER();
+
+	if (!sense_lock()) {
+		lock_cpu();
+	}
+	ercd = E_OK;
+
+	LOG_LOC_CPU_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_loc_cpu */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®è§£é¤
+ *
+ *  CPUã­ãã¯ä¸­ã¯ï¼ãã£ã¹ããããå¿
+è¦ã¨ãªããµã¼ãã¹ã³ã¼ã«ãå¼ã³åºãã
+ *  ã¨ã¯ã§ããªãããï¼CPUã­ãã¯ç¶æ
+ã®è§£é¤æã«ãã£ã¹ãããã£ãèµ·åãã
+ *  å¿
+è¦ã¯ãªãï¼
+ */
+#ifdef TOPPERS_unl_cpu
+
+ER
+unl_cpu(void)
+{
+	ER		ercd;
+
+	LOG_UNL_CPU_ENTER();
+
+	if (sense_lock()) {
+		unlock_cpu();
+	}
+	ercd = E_OK;
+
+	LOG_UNL_CPU_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_unl_cpu */
+
+/*
+ *  ãã£ã¹ãããã®ç¦æ­¢
+ */
+#ifdef TOPPERS_dis_dsp
+
+ER
+dis_dsp(void)
+{
+	ER		ercd;
+
+	LOG_DIS_DSP_ENTER();
+	CHECK_TSKCTX_UNL();
+
+	lock_cpu();
+	enadsp = false;
+	dspflg = false;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_DIS_DSP_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_dis_dsp */
+
+/*
+ *  ãã£ã¹ãããã®è¨±å¯
+ */
+#ifdef TOPPERS_ena_dsp
+
+ER
+ena_dsp(void)
+{
+	ER		ercd;
+
+	LOG_ENA_DSP_ENTER();
+	CHECK_TSKCTX_UNL();
+
+	lock_cpu();
+	enadsp = true;
+	if (t_get_ipm() == TIPM_ENAALL) {
+		dspflg = true;
+		p_schedtsk = search_schedtsk();
+		if (p_runtsk->raster && p_runtsk->enater) {
+			task_terminate(p_runtsk);
+			exit_and_dispatch();
+			ercd = E_SYS;
+		}
+		else {
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}
+			ercd = E_OK;
+		}
+	}
+	else {
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ENA_DSP_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ena_dsp */
+
+/*
+ *  ã³ã³ãã­ã¹ãã®åç
+§
+ */
+#ifdef TOPPERS_sns_ctx
+
+bool_t
+sns_ctx(void)
+{
+	bool_t	state;
+
+	LOG_SNS_CTX_ENTER();
+	state = sense_context() ? true : false;
+	LOG_SNS_CTX_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_ctx */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_loc
+
+bool_t
+sns_loc(void)
+{
+	bool_t	state;
+
+	LOG_SNS_LOC_ENTER();
+	state = sense_lock() ? true : false;
+	LOG_SNS_LOC_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_loc */
+
+/*
+ *  ãã£ã¹ãããç¦æ­¢ç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_dsp
+
+bool_t
+sns_dsp(void)
+{
+	bool_t	state;
+
+	LOG_SNS_DSP_ENTER();
+	state = !enadsp;
+	LOG_SNS_DSP_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_dsp */
+
+/*
+ *  ãã£ã¹ãããä¿çç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_dpn
+
+bool_t
+sns_dpn(void)
+{
+	bool_t	state;
+
+	LOG_SNS_DPN_ENTER();
+	state = (sense_context() || sense_lock() || !dspflg) ? true : false;
+	LOG_SNS_DPN_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_dpn */
+
+/*
+ *  ã«ã¼ãã«éåä½ç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_ker
+
+bool_t
+sns_ker(void)
+{
+	bool_t	state;
+
+	LOG_SNS_KER_ENTER();
+	state = kerflg ? false : true;
+	LOG_SNS_KER_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_ker */
Index: asp3_wo_tecs/trunk/extension/rstr_task/kernel/task.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/rstr_task/kernel/task.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/rstr_task/kernel/task.tf	(revision 302)
@@ -0,0 +1,232 @@
+$
+$   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ï¼TA_RSTRï¼TARGET_TSKATRä»¥å¤ã®ããããã»ãã
+$	// ããã¦ããå ´åï¼
+	$IF (TSK.TSKATR[tskid] & ~(TA_ACT|TA_NOACTQUE|TA_RSTR|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$
+$END$
+
+$
+$  ã¹ã¿ãã¯é åã®çæ
+$
+$FOREACH tskid TSK.ID_LIST$
+$	// ã¹ã¿ãã¯é åã®è¨­å®ï¼»NGKI1041ï¼½
+	$IF EQ(TSK.STK[tskid],"NULL")$
+		$IF (TSK.TSKATR[tskid] & TA_RSTR) == 0$
+$			// ã¹ã¿ãã¯é åã®çæï¼»NGKI1049ï¼½
+$			// å¤§ããæ¹ã«ä¸¸ãããµã¤ãºã§ç¢ºä¿ããï¼»NGKI1050ï¼½
+			$TSK.TINIB_STKSZ[tskid] = ALLOC_STACK(CONCAT("_kernel_stack_",
+													tskid), TSK.STKSZ[tskid])$
+			$TSK.TINIB_STK[tskid] = CONCAT("_kernel_stack_", tskid)$
+		$ELSE$
+$			// å¶ç´ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åã®è¨­å®ï¼»NGKI1052ï¼½
+			$TSK.TINIB_STKSZ[tskid] = FORMAT("ROUND_STK_T(%1%)",
+														TSK.STKSZ[tskid])$
+			$TSK.TINIB_STK[tskid] = CONCAT("_kernel_shared_stack_",
+														+TSK.ITSKPRI[tskid])$
+$			// å¶ç´ã¿ã¹ã¯ç¨ã®å
+±æã¹ã¿ãã¯ã®ãµã¤ãºãæ±ããï¼»NGKI1053ï¼½
+			$IF !LENGTH(shared_stack_size[TSK.ITSKPRI[tskid]])
+					|| shared_stack_size[TSK.ITSKPRI[tskid]] < TSK.STKSZ[tskid]$
+				$shared_stack_size[TSK.ITSKPRI[tskid]] = TSK.STKSZ[tskid]$
+			$END$
+		$END$
+
+	$ELSE$
+		$TSK.TINIB_STKSZ[tskid] = FORMAT("(%1%)", TSK.STKSZ[tskid])$
+		$TSK.TINIB_STK[tskid] = FORMAT("(void *)(%1%)", TSK.STK[tskid])$
+	$END$
+$END$
+$ å¶ç´ã¿ã¹ã¯ç¨ã®å
+±æã¹ã¿ãã¯é åã®çæï¼»NGKI1052ï¼½ï¼»NGKI1053ï¼½
+$FOREACH tskpri RANGE(TMIN_TPRI, TMAX_TPRI)$
+	$IF LENGTH(shared_stack_size[tskpri])$
+		$RESULT = ALLOC_STACK(CONCAT("_kernel_shared_stack_", tskpri),
+											shared_stack_size[tskpri])$
+	$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/extension/rstr_task/kernel/task_manage.c
===================================================================
--- asp3_wo_tecs/trunk/extension/rstr_task/kernel/task_manage.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/rstr_task/kernel/task_manage.c	(revision 302)
@@ -0,0 +1,381 @@
+/*
+ *  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: task_manage.c 470 2015-12-30 09:50:36Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "taskhook.h"
+#include "wait.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ACT_TSK_ENTER
+#define LOG_ACT_TSK_ENTER(tskid)
+#endif /* LOG_ACT_TSK_ENTER */
+
+#ifndef LOG_ACT_TSK_LEAVE
+#define LOG_ACT_TSK_LEAVE(ercd)
+#endif /* LOG_ACT_TSK_LEAVE */
+
+#ifndef LOG_CAN_ACT_ENTER
+#define LOG_CAN_ACT_ENTER(tskid)
+#endif /* LOG_CAN_ACT_ENTER */
+
+#ifndef LOG_CAN_ACT_LEAVE
+#define LOG_CAN_ACT_LEAVE(ercd)
+#endif /* LOG_CAN_ACT_LEAVE */
+
+#ifndef LOG_GET_TST_ENTER
+#define LOG_GET_TST_ENTER(tskid, p_tskstat)
+#endif /* LOG_GET_TST_ENTER */
+
+#ifndef LOG_GET_TST_LEAVE
+#define LOG_GET_TST_LEAVE(ercd, p_tskstat)
+#endif /* LOG_GET_TST_LEAVE */
+
+#ifndef LOG_CHG_PRI_ENTER
+#define LOG_CHG_PRI_ENTER(tskid, tskpri)
+#endif /* LOG_CHG_PRI_ENTER */
+
+#ifndef LOG_CHG_PRI_LEAVE
+#define LOG_CHG_PRI_LEAVE(ercd)
+#endif /* LOG_CHG_PRI_LEAVE */
+
+#ifndef LOG_GET_PRI_ENTER
+#define LOG_GET_PRI_ENTER(tskid, p_tskpri)
+#endif /* LOG_GET_PRI_ENTER */
+
+#ifndef LOG_GET_PRI_LEAVE
+#define LOG_GET_PRI_LEAVE(ercd, p_tskpri)
+#endif /* LOG_GET_PRI_LEAVE */
+
+#ifndef LOG_GET_INF_ENTER
+#define LOG_GET_INF_ENTER(p_exinf)
+#endif /* LOG_GET_INF_ENTER */
+
+#ifndef LOG_GET_INF_LEAVE
+#define LOG_GET_INF_LEAVE(ercd, p_exinf)
+#endif /* LOG_GET_INF_LEAVE */
+
+/*
+ *  ã¿ã¹ã¯ã®èµ·åï¼»NGKI3529ï¼½
+ */
+#ifdef TOPPERS_act_tsk
+
+ER
+act_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_ACT_TSK_ENTER(tskid);
+	CHECK_UNL();								/*ï¼»NGKI1114ï¼½*/
+	if (tskid == TSK_SELF && !sense_context()) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1121ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1115ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		make_active(p_tcb);						/*ï¼»NGKI1118ï¼½*/
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	else if ((p_tcb->p_tinib->tskatr & TA_NOACTQUE) != 0U || p_tcb->actque) {
+		ercd = E_QOVR;			   				/*ï¼»NGKI3528ï¼½*/
+	}
+	else {
+		p_tcb->actque = true;					/*ï¼»NGKI3527ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ACT_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_act_tsk */
+
+/*
+ *  ã¿ã¹ã¯èµ·åè¦æ±ã®ã­ã£ã³ã»ã«ï¼»NGKI1138ï¼½
+ */
+#ifdef TOPPERS_can_act
+
+ER_UINT
+can_act(ID tskid)
+{
+	TCB		*p_tcb;
+	ER_UINT	ercd;
+
+	LOG_CAN_ACT_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1139ï¼½ï¼»NGKI1140ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1146ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1141ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	ercd = p_tcb->actque ? 1 : 0;				/*ï¼»NGKI1144ï¼½*/
+	p_tcb->actque = false;						/*ï¼»NGKI1144ï¼½*/
+	unlock_cpu();
+
+  error_exit:
+	LOG_CAN_ACT_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_can_act */
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+ã®åç
+§ï¼»NGKI3613ï¼½
+ */
+#ifdef TOPPERS_get_tst
+
+ER
+get_tst(ID tskid, STAT *p_tskstat)
+{
+	TCB		*p_tcb;
+	uint_t	tstat;
+	ER		ercd;
+
+	LOG_GET_TST_ENTER(tskid, p_tskstat);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3614ï¼½ï¼»NGKI3615ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI3621ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI3616ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	tstat = p_tcb->tstat;
+	if (TSTAT_DORMANT(tstat)) {					/*ï¼»NGKI3620ï¼½*/
+		*p_tskstat = TTS_DMT;
+	}
+	else if (TSTAT_SUSPENDED(tstat)) {
+		if (TSTAT_WAITING(tstat)) {
+			*p_tskstat = TTS_WAS;
+		}
+		else {
+			*p_tskstat = TTS_SUS;
+		}
+	}
+	else if (TSTAT_WAITING(tstat)) {
+		*p_tskstat = TTS_WAI;
+	}
+	else if (p_tcb == p_runtsk) {
+		*p_tskstat = TTS_RUN;
+	}
+	else {
+		*p_tskstat = TTS_RDY;
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_TST_LEAVE(ercd, p_tskstat);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_tst */
+
+/*
+ *  ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ã®å¤æ´ï¼»NGKI1183ï¼½
+ */
+#ifdef TOPPERS_chg_pri
+
+ER
+chg_pri(ID tskid, PRI tskpri)
+{
+	TCB		*p_tcb;
+	uint_t	newbpri;
+	ER		ercd;
+
+	LOG_CHG_PRI_ENTER(tskid, tskpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1184ï¼½ï¼»NGKI1185ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1198ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1187ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+	if (tskpri == TPRI_INI) {
+		newbpri = p_tcb->p_tinib->ipriority;	/*ï¼»NGKI1199ï¼½*/
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));			/*ï¼»NGKI1188ï¼½*/
+		newbpri = INT_PRIORITY(tskpri);
+	}
+	CHECK_NOSPT((p_tcb->p_tinib->tskatr & TA_RSTR) == 0U);	/*ï¼»NGKI1186ï¼½*/
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1191ï¼½*/
+	}
+	else if ((p_tcb->p_lastmtx != NULL || TSTAT_WAIT_MTX(p_tcb->tstat))
+						&& !((*mtxhook_check_ceilpri)(p_tcb, newbpri))) {
+		ercd = E_ILUSE;							/*ï¼»NGKI1201ï¼½*/
+	}
+	else {
+		p_tcb->bpriority = newbpri;				/*ï¼»NGKI1192ï¼½*/
+		if (p_tcb->p_lastmtx == NULL || !((*mtxhook_scan_ceilmtx)(p_tcb))) {
+			change_priority(p_tcb, newbpri, false);		/*ï¼»NGKI1193ï¼½*/
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}									/*ï¼»NGKI1197ï¼½*/
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_CHG_PRI_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_chg_pri */
+
+/*
+ *  ã¿ã¹ã¯åªå
+åº¦ã®åç
+§ï¼»NGKI1202ï¼½
+ */
+#ifdef TOPPERS_get_pri
+
+ER
+get_pri(ID tskid, PRI *p_tskpri)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_GET_PRI_ENTER(tskid, p_tskpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1203ï¼½ï¼»NGKI1204ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1211ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1205ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1209ï¼½*/
+	}
+	else {
+		*p_tskpri = EXT_TSKPRI(p_tcb->priority);	/*ï¼»NGKI1210ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_PRI_LEAVE(ercd, p_tskpri);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_pri */
+
+/*
+ *  èªã¿ã¹ã¯ã®æ¡å¼µæ
+å ±ã®åç
+§ï¼»NGKI1212ï¼½
+ */
+#ifdef TOPPERS_get_inf
+
+ER
+get_inf(intptr_t *p_exinf)
+{
+	ER		ercd;
+
+	LOG_GET_INF_ENTER(p_exinf);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1213ï¼½ï¼»NGKI1214ï¼½*/
+
+	lock_cpu();
+	*p_exinf = p_runtsk->p_tinib->exinf;		/*ï¼»NGKI1216ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_INF_LEAVE(ercd, p_exinf);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_inf */
Index: asp3_wo_tecs/trunk/extension/rstr_task/kernel/task_sync.c
===================================================================
--- asp3_wo_tecs/trunk/extension/rstr_task/kernel/task_sync.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/rstr_task/kernel/task_sync.c	(revision 302)
@@ -0,0 +1,529 @@
+/*
+ *  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: task_sync.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ä»å±åææ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_SLP_TSK_ENTER
+#define LOG_SLP_TSK_ENTER()
+#endif /* LOG_SLP_TSK_ENTER */
+
+#ifndef LOG_SLP_TSK_LEAVE
+#define LOG_SLP_TSK_LEAVE(ercd)
+#endif /* LOG_SLP_TSK_LEAVE */
+
+#ifndef LOG_TSLP_TSK_ENTER
+#define LOG_TSLP_TSK_ENTER(tmout)
+#endif /* LOG_TSLP_TSK_ENTER */
+
+#ifndef LOG_TSLP_TSK_LEAVE
+#define LOG_TSLP_TSK_LEAVE(ercd)
+#endif /* LOG_TSLP_TSK_LEAVE */
+
+#ifndef LOG_WUP_TSK_ENTER
+#define LOG_WUP_TSK_ENTER(tskid)
+#endif /* LOG_WUP_TSK_ENTER */
+
+#ifndef LOG_WUP_TSK_LEAVE
+#define LOG_WUP_TSK_LEAVE(ercd)
+#endif /* LOG_WUP_TSK_LEAVE */
+
+#ifndef LOG_CAN_WUP_ENTER
+#define LOG_CAN_WUP_ENTER(tskid)
+#endif /* LOG_CAN_WUP_ENTER */
+
+#ifndef LOG_CAN_WUP_LEAVE
+#define LOG_CAN_WUP_LEAVE(ercd)
+#endif /* LOG_CAN_WUP_LEAVE */
+
+#ifndef LOG_REL_WAI_ENTER
+#define LOG_REL_WAI_ENTER(tskid)
+#endif /* LOG_REL_WAI_ENTER */
+
+#ifndef LOG_REL_WAI_LEAVE
+#define LOG_REL_WAI_LEAVE(ercd)
+#endif /* LOG_REL_WAI_LEAVE */
+
+#ifndef LOG_SUS_TSK_ENTER
+#define LOG_SUS_TSK_ENTER(tskid)
+#endif /* LOG_SUS_TSK_ENTER */
+
+#ifndef LOG_SUS_TSK_LEAVE
+#define LOG_SUS_TSK_LEAVE(ercd)
+#endif /* LOG_SUS_TSK_LEAVE */
+
+#ifndef LOG_RSM_TSK_ENTER
+#define LOG_RSM_TSK_ENTER(tskid)
+#endif /* LOG_RSM_TSK_ENTER */
+
+#ifndef LOG_RSM_TSK_LEAVE
+#define LOG_RSM_TSK_LEAVE(ercd)
+#endif /* LOG_RSM_TSK_LEAVE */
+
+#ifndef LOG_DLY_TSK_ENTER
+#define LOG_DLY_TSK_ENTER(dlytim)
+#endif /* LOG_DLY_TSK_ENTER */
+
+#ifndef LOG_DLY_TSK_LEAVE
+#define LOG_DLY_TSK_LEAVE(ercd)
+#endif /* LOG_DLY_TSK_LEAVE */
+
+/*
+ *  èµ·åºå¾
+ã¡
+ */
+#ifdef TOPPERS_slp_tsk
+
+ER
+slp_tsk(void)
+{
+	WINFO	winfo;
+	ER		ercd;
+
+	LOG_SLP_TSK_ENTER();
+	CHECK_DISPATCH();
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_runtsk->wupque) {
+		p_runtsk->wupque = false;
+		ercd = E_OK;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_SLP;
+		make_wait(&winfo);
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_SLP_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_slp_tsk */
+
+/*
+ *  èµ·åºå¾
+ã¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_tslp_tsk
+
+ER
+tslp_tsk(TMO tmout)
+{
+	WINFO	winfo;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TSLP_TSK_ENTER(tmout);
+	CHECK_DISPATCH();
+	CHECK_PAR(VALID_TMOUT(tmout));
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_runtsk->wupque) {
+		p_runtsk->wupque = false;
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_SLP;
+		make_wait_tmout(&winfo, &tmevtb, tmout);
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TSLP_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_tslp_tsk */
+
+/*
+ *  ã¿ã¹ã¯ã®èµ·åº
+ */
+#ifdef TOPPERS_wup_tsk
+
+ER
+wup_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_WUP_TSK_ENTER(tskid);
+	CHECK_UNL();
+	if (tskid == TSK_SELF && !sense_context()) {
+		p_tcb = p_runtsk;
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));
+		p_tcb = get_tcb(tskid);
+	}
+	CHECK_NOSPT((p_tcb->p_tinib->tskatr & TA_RSTR) == 0U);	/*ï¼»NGKI1266ï¼½*/
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;
+	}
+	else if (TSTAT_WAIT_SLP(p_tcb->tstat)) {
+		wait_complete(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	else if (!(p_tcb->wupque)) {
+		p_tcb->wupque = true;
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_QOVR;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_WUP_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_wup_tsk */
+
+/*
+ *  ã¿ã¹ã¯èµ·åºè¦æ±ã®ã­ã£ã³ã»ã«
+ */
+#ifdef TOPPERS_can_wup
+
+ER_UINT
+can_wup(ID tskid)
+{
+	TCB		*p_tcb;
+	ER_UINT	ercd;
+
+	LOG_CAN_WUP_ENTER(tskid);
+	CHECK_TSKCTX_UNL();
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));
+		p_tcb = get_tcb(tskid);
+	}
+	CHECK_NOSPT((p_tcb->p_tinib->tskatr & TA_RSTR) == 0U);	/*ï¼»NGKI1279ï¼½*/
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;
+	}
+	else {
+		ercd = p_tcb->wupque ? 1 : 0;
+		p_tcb->wupque = false;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_CAN_WUP_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_can_wup */
+
+/*
+ *  å¾
+ã¡ç¶æ
+ã®å¼·å¶è§£é¤
+ */
+#ifdef TOPPERS_rel_wai
+
+ER
+rel_wai(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_REL_WAI_ENTER(tskid);
+	CHECK_UNL();
+	CHECK_ID(VALID_TSKID(tskid));
+	p_tcb = get_tcb(tskid);
+	CHECK_NOSPT((p_tcb->p_tinib->tskatr & TA_RSTR) == 0U);	/*ï¼»NGKI1291ï¼½*/
+
+	lock_cpu();
+	if (!TSTAT_WAITING(p_tcb->tstat)) {
+		ercd = E_OBJ;
+	}
+	else {
+		wait_dequeue_wobj(p_tcb);
+		wait_dequeue_tmevtb(p_tcb);
+		p_tcb->p_winfo->wercd = E_RLWAI;
+		make_non_wait(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REL_WAI_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rel_wai */
+
+/*
+ *  å¼·å¶å¾
+ã¡ç¶æ
+ã¸ã®ç§»è¡ï¼»NGKI1298ï¼½
+ */
+#ifdef TOPPERS_sus_tsk
+
+ER
+sus_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_SUS_TSK_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1299ï¼½ï¼»NGKI1300ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1310ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1302ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+	CHECK_NOSPT((p_tcb->p_tinib->tskatr & TA_RSTR) == 0U);	/*ï¼»NGKI1301ï¼½*/
+
+	lock_cpu();
+	if (p_tcb == p_runtsk && !dspflg) {			/*ï¼»NGKI1311ï¼½ï¼»NGKI3604ï¼½*/
+		ercd = E_CTX;
+	}
+	else if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1305ï¼½*/
+	}
+	else if (p_tcb->raster) {
+		ercd = E_RASTER;						/*ï¼»NGKI3605ï¼½*/
+	}
+	else if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		/*
+		 *  å®è¡ã§ããç¶æ
+ããå¼·å¶å¾
+ã¡ç¶æ
+ã¸ã®é·ç§»ï¼»NGKI1307ï¼½
+		 */
+		p_tcb->tstat = TS_SUSPENDED;
+		LOG_TSKSTAT(p_tcb);
+		make_non_runnable(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else if (TSTAT_SUSPENDED(p_tcb->tstat)) {
+		ercd = E_QOVR;							/*ï¼»NGKI1306ï¼½*/
+	}
+	else {
+		/*
+		 *  å¾
+ã¡ç¶æ
+ããäºéå¾
+ã¡ç¶æ
+ã¸ã®é·ç§»ï¼»NGKI1308ï¼½
+		 */
+		p_tcb->tstat |= TS_SUSPENDED;
+		LOG_TSKSTAT(p_tcb);
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_SUS_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_sus_tsk */
+
+/*
+ *  å¼·å¶å¾
+ã¡ç¶æ
+ããã®åé
+ */
+#ifdef TOPPERS_rsm_tsk
+
+ER
+rsm_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_RSM_TSK_ENTER(tskid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_TSKID(tskid));
+	p_tcb = get_tcb(tskid);
+	CHECK_NOSPT((p_tcb->p_tinib->tskatr & TA_RSTR) == 0U);	/*ï¼»NGKI1315ï¼½*/
+
+	lock_cpu();
+	if (!TSTAT_SUSPENDED(p_tcb->tstat)) {
+		ercd = E_OBJ;
+	}
+	else if (!TSTAT_WAITING(p_tcb->tstat)) {
+		/*
+		 *  å¼·å¶å¾
+ã¡ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+		 */
+		p_tcb->tstat = TS_RUNNABLE;
+		LOG_TSKSTAT(p_tcb);
+		make_runnable(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		/*
+		 *  äºéå¾
+ã¡ç¶æ
+ããå¾
+ã¡ç¶æ
+ã¸ã®é·ç§»
+		 */
+		p_tcb->tstat &= ~TS_SUSPENDED;
+		LOG_TSKSTAT(p_tcb);
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_RSM_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rsm_tsk */
+
+/*
+ *  èªã¿ã¹ã¯ã®é
+å»¶
+ */
+#ifdef TOPPERS_dly_tsk
+
+ER
+dly_tsk(RELTIM dlytim)
+{
+	WINFO	winfo;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_DLY_TSK_ENTER(dlytim);
+	CHECK_DISPATCH();
+	CHECK_PAR(VALID_RELTIM(dlytim));
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_DLY;
+		make_non_runnable(p_runtsk);
+		p_runtsk->p_winfo = &winfo;
+		winfo.p_tmevtb = &tmevtb;
+		tmevtb.callback = (CBACK) wait_tmout_ok;
+		tmevtb.arg = (void *) p_runtsk;
+		tmevtb_enqueue(&tmevtb, dlytim);
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_DLY_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_dly_tsk */
Index: asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr1.c
===================================================================
--- asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr1.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr1.c	(revision 302)
@@ -0,0 +1,382 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2010-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: test_rstr1.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		å¶ç´ã¿ã¹ã¯ã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  å¶ç´ã¿ã¹ã¯ã®åºæ¬çãªæ¯èãããã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) å¶ç´ã¿ã¹ã¯ãï¼èªã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã«ããå¯è½æ§ã®ãããµã¼ãã¹ã³ã¼
+ *      ã«ãå¼ã³åºããå ´åï¼E_NOSPTã¨ã©ã¼ã¨ãªã
+ *		(A-1) slp_tskï¼»NGKI1255ï¼½
+ *		(A-2) tslp_tskï¼»NGKI1255ï¼½
+ *		(A-3) dly_tskï¼»NGKI1350ï¼½
+ *		(A-4) wai_semï¼»NGKI1516ï¼½
+ *		(A-5) pol_semãæ­£ããåä½ãã
+ *		(A-6) twai_semï¼»NGKI1516ï¼½
+ *      â» ä»ã«ããããï¼ããã ãã«çãã
+ *	(B) å¶ç´ã¿ã¹ã¯ãå¯¾è±¡ã¨ãã¦ï¼chg_priï¼wup_tskï¼can_wupï¼rel_waiï¼
+ *	    sus_tskï¼rsm_tskãå¼ã³åºããå ´åï¼E_NOSPTã¨ã©ã¼ã¨ãªã
+ *		(B-1) chg_priï¼»NGKI1186ï¼½
+ *		(B-2) wup_tskï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãããï¼ï¼»NGKI1266ï¼½
+ *		(B-3) wup_tskï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãããï¼ï¼»NGKI1266ï¼½
+ *		(B-4) can_wupï¼»NGKI1279ï¼½
+ *		(B-5) rel_waiï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãããï¼ï¼»NGKI1291ï¼½
+ *		(B-6) rel_waiï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãããï¼ï¼»NGKI1291ï¼½
+ *		(B-7) sus_tskï¼»NGKI1301ï¼½
+ *		(B-8) rsm_tskï¼»NGKI1315ï¼½
+ *  (C) rot_rdqã¯ï¼å¯¾è±¡åªå
+åº¦ãæã¤å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ã®ä¸­ã§æãåªå
+
+ *      é ä½ãé«ãã¿ã¹ã¯ãå¶ç´ã¿ã¹ã¯ã§ããå ´åï¼E_NOSPTã¨ã©ã¼ã¨ãªã
+ *		(C-1) rot_rdqï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãããï¼ãæ­£ããåä½ãã
+ *		(C-2) rot_rdqï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãããï¼ãE_NOSPTãè¿ãï¼»NGKI2690ï¼½
+ *		(C-3) rot_rdqï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãããï¼ãæ­£ããåä½ãã
+ *		(C-4) rot_rdqï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãããï¼ãE_NOSPTãè¿ãï¼»NGKI2690ï¼½
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: é«åªå
+åº¦ã¿ã¹ã¯ï¼å¶ç´ã¿ã¹ã¯
+ *	TASK3: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼å¶ç´ã¿ã¹ã¯
+ *	TASK4: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼å¶ç´ã¿ã¹ã¯
+ *	SEM1:  ã»ããã©
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	1:	act_tsk(TASK2)
+ *	== TASK2-1ï¼åªå
+åº¦ï¼é«ï¼==
+ *	2:	slp_tsk() -> E_NOSPT						... (A-1)
+ *		tslp_tsk(10000U) -> E_NOSPT					... (A-2)
+ *		dly_tsk(10000U) -> E_NOSPT					... (A-3)
+ *		wai_sem(SEM1) -> E_NOSPT					... (A-4)
+ *		pol_sem(SEM1)								... (A-5)
+ *		pol_sem(SEM1) -> E_TMOUT
+ *		twai_sem(SEM1, 10000U) -> E_NOSPT			... (A-6)
+ *  	ext_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	3:	chg_pri(TASK3, HIGH_PRIORITY) -> E_NOSPT	... (B-1)
+ *		wup_tsk(TASK3) -> E_NOSPT					... (B-2)
+ *		can_wup(TASK3) -> E_NOSPT					... (B-4)
+ *		rel_wai(TASK3) -> E_NOSPT					... (B-5)
+ *		sus_tsk(TASK3) -> E_NOSPT					... (B-7)
+ *		rsm_tsk(TASK3) -> E_NOSPT					... (B-8)
+ *		sta_alm(ALM1, 10000U)
+ *		slp_tsk()
+ *	== ALM1 ==
+ *	4:	wup_tsk(TASK3) -> E_NOSPT					... (B-3)
+ *		rel_wai(TASK3) -> E_NOSPT					... (B-6)
+ *		wup_tsk(TASK1)
+ *		act_tsk(TASK3)
+ *		act_tsk(TASK4)
+ *		rot_rdq(MID_PRIORITY)						... (C-3)
+ *		rot_rdq(MID_PRIORITY) -> E_NOSPT			... (C-4)
+ *		RETURN
+ *	== TASK3-1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	5:	act_tsk(TASK2)
+ *	== TASK2-2ï¼åªå
+åº¦ï¼é«ï¼2åã ==
+ *	6:	rot_rdq(MID_PRIORITY) -> E_NOSPT			... (C-2)
+ *		ext_tsk()
+ *	== TASK3-1ï¼ç¶ãï¼==
+ *	7:	ext_tsk()
+ *	== TASK4-1ï¼åªå
+åº¦ï¼ä¸­ï¼1åã ==
+ *	8:	ext_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	9:	act_tsk(TASK3)
+ *		act_tsk(TASK4)
+ *		act_tsk(TASK2)
+ *	== TASK2-3ï¼åªå
+åº¦ï¼é«ï¼3åã ==
+ *	10:	rot_rdq(MID_PRIORITY)						... (C-1)
+ *		ext_tsk()
+ *	== TASK3-2ï¼åªå
+åº¦ï¼ä¸­ï¼2åã ==
+ *	11:	ext_tsk()
+ *	== TASK4-2ï¼åªå
+åº¦ï¼ä¸­ï¼2åã ==
+ *	12:	ext_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	13: END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_rstr1.h"
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(4);
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_NOSPT);
+
+	ercd = rel_wai(TASK3);
+	check_ercd(ercd, E_NOSPT);
+
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_NOSPT);
+
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(3);
+	ercd = chg_pri(TASK3, HIGH_PRIORITY);
+	check_ercd(ercd, E_NOSPT);
+
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_NOSPT);
+
+	ercd = can_wup(TASK3);
+	check_ercd(ercd, E_NOSPT);
+
+	ercd = rel_wai(TASK3);
+	check_ercd(ercd, E_NOSPT);
+
+	ercd = sus_tsk(TASK3);
+	check_ercd(ercd, E_NOSPT);
+
+	ercd = rsm_tsk(TASK3);
+	check_ercd(ercd, E_NOSPT);
+
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(9);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_finish(13);
+	check_point(0);
+}
+
+static uint_t	task2_count = 0;
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++task2_count) {
+	case 1:
+		check_point(2);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_NOSPT);
+
+		ercd = tslp_tsk(10000U);
+		check_ercd(ercd, E_NOSPT);
+
+		ercd = dly_tsk(10000U);
+		check_ercd(ercd, E_NOSPT);
+
+		ercd = wai_sem(SEM1);
+		check_ercd(ercd, E_NOSPT);
+
+		ercd = pol_sem(SEM1);
+		check_ercd(ercd, E_OK);
+
+		ercd = pol_sem(SEM1);
+		check_ercd(ercd, E_TMOUT);
+
+		ercd = twai_sem(SEM1, 10000U);
+		check_ercd(ercd, E_NOSPT);
+
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 2:
+		check_point(6);
+		ercd = rot_rdq(MID_PRIORITY);
+		check_ercd(ercd, E_NOSPT);
+
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 3:
+		check_point(10);
+		ercd = rot_rdq(MID_PRIORITY);
+		check_ercd(ercd, E_OK);
+
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	task3_count = 0;
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++task3_count) {
+	case 1:
+		check_point(5);
+		ercd = act_tsk(TASK2);
+		check_ercd(ercd, E_OK);
+
+		check_point(7);
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 2:
+		check_point(11);
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	task4_count = 0;
+
+void
+task4(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++task4_count) {
+	case 1:
+		check_point(8);
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 2:
+		check_point(12);
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr1.cfg
===================================================================
--- asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr1.cfg	(revision 302)
@@ -0,0 +1,18 @@
+/*
+ *		å¶ç´ã¿ã¹ã¯ã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: test_rstr1.cfg 327 2015-06-21 06:42:01Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_rstr1.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_RSTR, 2, task2, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_RSTR, 3, task3, MID_PRIORITY, STACK_SIZE + 256, NULL });
+CRE_TSK(TASK4, { TA_RSTR, 4, task4, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_SEM(SEM1, { TA_NULL, 1, 1 });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
Index: asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr1.h
===================================================================
--- asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr1.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr1.h	(revision 302)
@@ -0,0 +1,93 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2010 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_rstr1.h 2 2014-01-11 03:50:35Z ertl-hiro $
+ */
+
+/* 
+ *		å¶ç´ã¿ã¹ã¯ã®ãã¹ã(1)
+ */
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åªå
+åº¦ã®å®ç¾©
+ */
+#define HIGH_PRIORITY	4		/* é«åªå
+åº¦ */
+#define MID_PRIORITY	9		/* ä¸­åªå
+åº¦ */
+#define LOW_PRIORITY	14		/* ä½åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#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	task4(intptr_t exinf);
+extern void	alarm1_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr2.c
===================================================================
--- asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr2.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr2.c	(revision 302)
@@ -0,0 +1,277 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2010-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: test_rstr2.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		å¶ç´ã¿ã¹ã¯ã®ãã¹ã(2)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãç¨ãã¦ï¼å¶ç´ã¿ã¹ã¯ã®åªå
+åº¦ãå¤æ´ã§ããã
+ *  ã¨ããã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) å¶ç´ã¿ã¹ã¯ããã¥ã¼ããã¯ã¹ãã­ãã¯ãï¼ç¾å¨åªå
+åº¦ãä¸ãã
+ *		(A-1) ãã£ã¹ãããè¨±å¯ç¶æ
+ã§å¼ã³åºããå ´å
+ *		(A-2) ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§ï¼æé«åªå
+é ä½ã¿ã¹ã¯ãå®è¡ç¶æ
+ã§ãª
+ *		      ãå ´åã«å¼ã³åºããå ´å
+ *	(B) åªå
+åº¦ãä¸ãã£ãå¶ç´ã¿ã¹ã¯ããã¥ã¼ããã¯ã¹ãã­ãã¯è§£é¤ãï¼ç¾å¨
+ *      åªå
+åº¦ããã¼ã¹åªå
+åº¦ã«æ»ã
+ *		(B-1) ãã¼ã¹åªå
+åº¦ãããé«ãåªå
+åº¦ã®ã¿ã¹ã¯ãå®è¡å¯è½ã®å ´åã«ï¼
+ *		      ã¿ã¹ã¯åæããèµ·ãããã¨ãç¢ºèªãã
+ *		(B-2) ãã¼ã¹åªå
+åº¦ã¨åãåªå
+åº¦ã®ã¿ã¹ã¯ãå®è¡å¯è½ã®å ´åã«ï¼ã¿ã¹
+ *		      ã¯åæããèµ·ãããªããã¨ãç¢ºèªãã
+ *		(B-3) ãã¼ã¹åªå
+åº¦ãããä½ãåªå
+åº¦ã®ã¿ã¹ã¯ãå®è¡å¯è½ã®å ´åã«ï¼
+ *		      ã¿ã¹ã¯åæããèµ·ãããªããã¨ãç¢ºèªãã
+ *	(C) å¶ç´ã¿ã¹ã¯ãï¼èªã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ãããä½ãä¸éåªå
+åº¦ãæã¤
+ *	    ãã¥ã¼ããã¯ã¹ãã­ãã¯ãããã¨ãï¼E_ILUSEã«ãªã
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼å¶ç´ã¿ã¹ã¯
+ *	TASK3: é«åªå
+åº¦ã¿ã¹ã¯
+ *	MTX1:  ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯é«åªå
+åº¦ï¼
+ *	MTX2:  ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯ä¸­åªå
+åº¦ï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	1:	act_tsk(TASK2)
+ *		slp_tsk()
+ *	== TASK2ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	2:	get_pri(TSK_SELF, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *		ploc_mtx(MTX1)								... (A-1)
+ *		get_pri(TSK_SELF, &tskpri)
+ *		assert(tskpri == HIGH_PRIORITY)
+ *	3:	ploc_mtx(MTX2)
+ *		unl_mtx(MTX2)
+ *	4:	act_tsk(TASK3)
+ *		unl_mtx(MTX1)								... (B-1)
+ *	== TASK3ï¼åªå
+åº¦ï¼é«ï¼==
+ *	5:	get_pri(TASK2, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	6:	ploc_mtx(MTX2) -> E_ILUSE					... (C)
+ *	7:	chg_pri(TSK_SELF, LOW_PRIORITY)
+ *		slp_tsk()
+ *	== TASK2ï¼ç¶ãï¼==
+ *	8:	dis_dsp()
+ *		wup_tsk(TASK3)
+ *		ploc_mtx(MTX1)								... (A-2)
+ *		ena_dsp()
+ *		unl_mtx(MTX1)								... (B-3)
+ *		chg_pri(TASK3, TPRI_INI)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	9:	ext_tsk()
+ *	== TASK2ï¼ç¶ãï¼==
+ *	10:	ploc_mtx(MTX1)								... (A-1)
+ *		wup_tsk(TASK1)
+ *		unl_mtx(MTX1)								... (B-2)
+ *		ext_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	11: END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_rstr2.h"
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_finish(11);
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	PRI		tskpri;
+
+	check_point(2);
+	ercd = get_pri(TSK_SELF, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	ercd = ploc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TSK_SELF, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == HIGH_PRIORITY);
+
+	check_point(3);
+	ercd = ploc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(4);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = ploc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = chg_pri(TASK3, TPRI_INI);
+	check_ercd(ercd, E_OK);
+
+	check_point(10);
+	ercd = ploc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = ext_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	PRI		tskpri;
+
+	check_point(5);
+	ercd = get_pri(TASK2, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	check_point(6);
+	ercd = ploc_mtx(MTX2);
+	check_ercd(ercd, E_ILUSE);
+
+	check_point(7);
+	ercd = chg_pri(TSK_SELF, LOW_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(9);
+	ercd = ext_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr2.cfg
===================================================================
--- asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr2.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr2.cfg	(revision 302)
@@ -0,0 +1,17 @@
+/*
+ *		å¶ç´ã¿ã¹ã¯ã®ãã¹ã(2)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: test_rstr2.cfg 242 2014-09-30 17:31:16Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_rstr2.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_RSTR, 2, task2, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_MTX(MTX1, { TA_CEILING, HIGH_PRIORITY });
+CRE_MTX(MTX2, { TA_CEILING, MID_PRIORITY });
Index: asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr2.h
===================================================================
--- asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr2.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/rstr_task/test/test_rstr2.h	(revision 302)
@@ -0,0 +1,91 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2010 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_rstr2.h 2 2014-01-11 03:50:35Z ertl-hiro $
+ */
+
+/* 
+ *		å¶ç´ã¿ã¹ã¯ã®ãã¹ã(2)
+ */
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åªå
+åº¦ã®å®ç¾©
+ */
+#define HIGH_PRIORITY	4		/* é«åªå
+åº¦ */
+#define MID_PRIORITY	9		/* ä¸­åªå
+åº¦ */
+#define LOW_PRIORITY	14		/* ä½åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#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);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/extension/subprio/include/kernel.h
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/include/kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/include/kernel.h	(revision 302)
@@ -0,0 +1,605 @@
+/*
+ *  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) 2004-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.h 463 2015-10-18 14:25:55Z ertl-hiro $
+ */
+
+/*
+ *		TOPPERS/ASPã«ã¼ãã« æ¨æºããããã¡ã¤ã«
+ *
+ *  TOPPERS/ASPã«ã¼ãã«ããµãã¼ããããµã¼ãã¹ã³ã¼ã«ã®å®£è¨ã¨ï¼å¿
+è¦ãªãã¼
+ *  ã¿åï¼å®æ°ï¼ãã¯ã­ã®å®ç¾©ãå«ãããããã¡ã¤ã«ï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ããï¼ããã«ããï¼ãã¯ã­å®ç¾©ä»¥å¤ã
+ *  é¤ãããã«ãªã£ã¦ããï¼
+ */
+
+#ifndef TOPPERS_KERNEL_H
+#define TOPPERS_KERNEL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *	TOPPERSå
+±éã®ãã¼ã¿åã»å®æ°ã»ãã¯ã­
+ */
+#include <t_stddef.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨
+ */
+#include "target_kernel.h"
+
+/*
+ *  ãµãã¼ãããæ©è½
+ */
+#ifdef TOPPERS_TARGET_SUPPORT_DIS_INT
+#define TOPPERS_SUPPORT_DIS_INT			/* dis_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_DIS_INT */
+
+#ifdef TOPPERS_TARGET_SUPPORT_ENA_INT
+#define TOPPERS_SUPPORT_ENA_INT			/* ena_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_ENA_INT */
+
+#define TOPPERS_SUPPORT_SUBPRIO			/* ãµãåªå
+åº¦æ©è½æ¡å¼µ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãã¼ã¿åã®å®ç¾©
+ */
+
+/*
+ *  ããããã¿ã¼ã³ããªãã¸ã§ã¯ãçªå·ã®åå®ç¾©
+ */
+typedef	uint_t		FLGPTN;		/* ã¤ãã³ããã©ã°ã®ããããã¿ã¼ã³ */
+typedef	uint_t		INTNO;		/* å²è¾¼ã¿çªå· */
+typedef	uint_t		INHNO;		/* å²è¾¼ã¿ãã³ãã©çªå· */
+typedef	uint_t		EXCNO;		/* CPUä¾å¤ãã³ãã©çªå· */
+
+/*
+ *  å¦çåä½ã®åå®ç¾©
+ */
+typedef void	(*TASK)(intptr_t exinf);
+typedef void	(*TMEHDR)(intptr_t exinf);
+typedef void	(*ISR)(intptr_t exinf);
+typedef void	(*INTHDR)(void);
+typedef void	(*EXCHDR)(void *p_excinf);
+typedef void	(*INIRTN)(intptr_t exinf);
+typedef void	(*TERRTN)(intptr_t exinf);
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®åå®ç¾©
+ */
+#ifndef TOPPERS_STK_T
+#define TOPPERS_STK_T	intptr_t
+#endif /* TOPPERS_STK_T */
+typedef	TOPPERS_STK_T	STK_T;	/* ã¹ã¿ãã¯é åãç¢ºä¿ããããã®å */
+
+#ifndef TOPPERS_MPF_T
+#define TOPPERS_MPF_T	intptr_t
+#endif /* TOPPERS_MPF_T */
+typedef	TOPPERS_MPF_T	MPF_T;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åãç¢ºä¿ããããã®å */
+
+/*
+ *  ãã±ããå½¢å¼ã®å®ç¾©
+ */
+typedef struct t_rtsk {
+	STAT	tskstat;	/* ã¿ã¹ã¯ç¶æ
+ */
+	PRI		tskpri;		/* ã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ */
+	PRI		tskbpri;	/* ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+	uint_t	subpri;		/* ã¿ã¹ã¯ã®ãµãåªå
+åº¦ */
+	STAT	tskwait;	/* å¾
+ã¡è¦å  */
+	ID		wobjid;		/* å¾
+ã¡å¯¾è±¡ã®ãªãã¸ã§ã¯ãã®ID */
+	TMO		lefttmo;	/* ã¿ã¤ã ã¢ã¦ãããã¾ã§ã®æé */
+	uint_t	actcnt;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	uint_t	wupcnt;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	bool_t	raster;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	bool_t	dister;		/* ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ */
+} T_RTSK;
+
+typedef struct t_rsem {
+	ID		wtskid;		/* ã»ããã©ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	semcnt;		/* ã»ããã©ã®ç¾å¨ã®è³æºæ° */
+} T_RSEM;
+
+typedef struct t_rflg {
+	ID		wtskid;		/* ã¤ãã³ããã©ã°ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	FLGPTN	flgptn;		/* ã¤ãã³ããã©ã°ã®ç¾å¨ã®ããããã¿ã¼ã³ */
+} T_RFLG;
+
+typedef struct t_rdtq {
+	ID		stskid;		/* ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	ID		rtskid;		/* ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	sdtqcnt;	/* ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼ã¿ã®æ° */
+} T_RDTQ;
+
+typedef struct t_rpdq {
+	ID		stskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	ID		rtskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	uint_t	spdqcnt;	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼
+						   ã¿ã®æ° */
+} T_RPDQ;
+
+typedef struct t_rmtx {
+	ID		htskid;		/* ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã¿ã¹ã¯ã®IDçªå· */
+	ID		wtskid;		/* ãã¥ã¼ããã¯ã¹ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+} T_RMTX;
+
+typedef struct t_rmpf {
+	ID		wtskid;		/* åºå®é·ã¡ã¢ãªãã¼ã«ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®
+						   IDçªå· */
+	uint_t	fblkcnt;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®ç©ºãã¡ã¢ãªé åã«å²ã
+						   ä»ãããã¨ãã§ããåºå®é·ã¡ã¢ãªãã­ãã¯ã®æ° */
+} T_RMPF;
+
+typedef struct t_rcyc {
+	STAT	cycstat;	/* å¨æéç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* æ¬¡åéç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RCYC;
+
+typedef struct t_ralm {
+	STAT	almstat;	/* ã¢ã©ã¼ã éç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* éç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RALM;
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å®£è¨
+ */
+
+/*
+ *  ã¿ã¹ã¯ç®¡çæ©è½
+ */
+extern ER		act_tsk(ID tskid) throw();
+extern ER_UINT	can_act(ID tskid) throw();
+extern ER		get_tst(ID tskid, STAT *p_tskstat) throw();
+extern ER		chg_pri(ID tskid, PRI tskpri) throw();
+extern ER		get_pri(ID tskid, PRI *p_tskpri) throw();
+extern ER		get_inf(intptr_t *p_exinf) throw();
+extern ER		chg_spr(ID tskid, uint_t subpri) throw();
+extern ER		ref_tsk(ID tskid, T_RTSK *pk_rtsk) throw();
+
+/*
+ *  ã¿ã¹ã¯ä»å±åææ©è½
+ */
+extern ER		slp_tsk(void) throw();
+extern ER		tslp_tsk(TMO tmout) throw();
+extern ER		wup_tsk(ID tskid) throw();
+extern ER_UINT	can_wup(ID tskid) throw();
+extern ER		rel_wai(ID tskid) throw();
+extern ER		sus_tsk(ID tskid) throw();
+extern ER		rsm_tsk(ID tskid) throw();
+extern ER		dly_tsk(RELTIM dlytim) throw();
+
+/*
+ *  ã¿ã¹ã¯çµäºæ©è½
+ */
+extern ER		ext_tsk(void) throw();
+extern ER		ras_ter(ID tskid) throw();
+extern ER		dis_ter(void) throw();
+extern ER		ena_ter(void) throw();
+extern bool_t	sns_ter(void) throw();
+extern ER		ter_tsk(ID tskid) throw();
+
+/*
+ *  åæã»éä¿¡æ©è½
+ */
+extern ER		sig_sem(ID semid) throw();
+extern ER		wai_sem(ID semid) throw();
+extern ER		pol_sem(ID semid) throw();
+extern ER		twai_sem(ID semid, TMO tmout) throw();
+extern ER		ini_sem(ID semid) throw();
+extern ER		ref_sem(ID semid, T_RSEM *pk_rsem) throw();
+
+extern ER		set_flg(ID flgid, FLGPTN setptn) throw();
+extern ER		clr_flg(ID flgid, FLGPTN clrptn) throw();
+extern ER		wai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		pol_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		twai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn, TMO tmout) throw();
+extern ER		ini_flg(ID flgid) throw();
+extern ER		ref_flg(ID flgid, T_RFLG *pk_rflg) throw();
+
+extern ER		snd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		psnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		tsnd_dtq(ID dtqid, intptr_t data, TMO tmout) throw();
+extern ER		fsnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		rcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		prcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		trcv_dtq(ID dtqid, intptr_t *p_data, TMO tmout) throw();
+extern ER		ini_dtq(ID dtqid) throw();
+extern ER		ref_dtq(ID dtqid, T_RDTQ *pk_rdtq) throw();
+
+extern ER		snd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		psnd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		tsnd_pdq(ID pdqid, intptr_t data,
+										PRI datapri, TMO tmout) throw();
+extern ER		rcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		prcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		trcv_pdq(ID pdqid, intptr_t *p_data,
+										PRI *p_datapri, TMO tmout) throw();
+extern ER		ini_pdq(ID pdqid) throw();
+extern ER		ref_pdq(ID pdqid, T_RPDQ *pk_rpdq) throw();
+
+extern ER		loc_mtx(ID mtxid) throw();
+extern ER		ploc_mtx(ID mtxid) throw();
+extern ER		tloc_mtx(ID mtxid, TMO tmout) throw();
+extern ER		unl_mtx(ID mtxid) throw();
+extern ER		ini_mtx(ID mtxid) throw();
+extern ER		ref_mtx(ID mtxid, T_RMTX *pk_rmtx) throw();
+
+/*
+ *  ã¡ã¢ãªãã¼ã«ç®¡çæ©è½
+ */
+extern ER		get_mpf(ID mpfid, void **p_blk) throw();
+extern ER		pget_mpf(ID mpfid, void **p_blk) throw();
+extern ER		tget_mpf(ID mpfid, void **p_blk, TMO tmout) throw();
+extern ER		rel_mpf(ID mpfid, void *blk) throw();
+extern ER		ini_mpf(ID mpfid) throw();
+extern ER		ref_mpf(ID mpfid, T_RMPF *pk_rmpf) throw();
+
+/*
+ *  æéç®¡çæ©è½
+ */
+extern ER		set_tim(SYSTIM systim) throw();
+extern ER		get_tim(SYSTIM *p_systim) throw();
+extern ER		adj_tim(int32_t adjtim) throw();
+extern HRTCNT	fch_hrt(void) throw();
+
+extern ER		sta_cyc(ID cycid) throw();
+extern ER		stp_cyc(ID cycid) throw();
+extern ER		ref_cyc(ID cycid, T_RCYC *pk_rcyc) throw();
+
+extern ER		sta_alm(ID almid, RELTIM almtim) throw();
+extern ER		stp_alm(ID almid) throw();
+extern ER		ref_alm(ID almid, T_RALM *pk_ralm) throw();
+
+/*
+ *  ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+ */
+extern ER		rot_rdq(PRI tskpri) throw();
+extern ER		get_tid(ID *p_tskid) throw();
+extern ER		get_lod(PRI tskpri, uint_t *p_load) throw();
+extern ER		get_nth(PRI tskpri, uint_t nth, ID *p_tskid) throw();
+extern ER		loc_cpu(void) throw();
+extern ER		unl_cpu(void) throw();
+extern ER		dis_dsp(void) throw();
+extern ER		ena_dsp(void) throw();
+extern bool_t	sns_ctx(void) throw();
+extern bool_t	sns_loc(void) throw();
+extern bool_t	sns_dsp(void) throw();
+extern bool_t	sns_dpn(void) throw();
+extern bool_t	sns_ker(void) throw();
+extern ER		ext_ker(void) throw();
+
+/*
+ *  å²è¾¼ã¿ç®¡çæ©è½
+ */
+extern ER		dis_int(INTNO intno) throw();
+extern ER		ena_int(INTNO intno) throw();
+extern ER		chg_ipm(PRI intpri) throw();
+extern ER		get_ipm(PRI *p_intpri) throw();
+
+/*
+ *  CPUä¾å¤ç®¡çæ©è½
+ */
+extern bool_t	xsns_dpn(void *p_excinf) throw();
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãããµã¼ãã¹ã³ã¼ã«
+ */
+#define iact_tsk(tskid)						act_tsk(tskid)
+#define iwup_tsk(tskid)						wup_tsk(tskid)
+#define irel_wai(tskid)						rel_wai(tskid)
+#define isns_ter()							sns_ter()
+#define isig_sem(semid)						sig_sem(semid)
+#define iset_flg(flgid, setptn)				set_flg(flgid, setptn)
+#define ipsnd_dtq(dtqid, data)				psnd_dtq(dtqid, data)
+#define ifsnd_dtq(dtqid, data)				fsnd_dtq(dtqid, data)
+#define ipsnd_pdq(pdqid, data, datapri)		psnd_pdq(pdqid, data, datapri)
+#define ifch_hrt()							fch_hrt()
+#define ista_alm(almid, almtim)				sta_alm(almid, almtim)
+#define istp_alm(almid)						stp_alm(almid)
+#define irot_rdq(tskpri)					rot_rdq(tskpri)
+#define iget_tid(p_tskid)					get_tid(p_tskid)
+#define iloc_cpu()							loc_cpu()
+#define iunl_cpu()							unl_cpu()
+#define isns_ctx()							sns_ctx()
+#define isns_loc()							sns_loc()
+#define isns_dsp()							sns_dsp()
+#define isns_dpn()							sns_dpn()
+#define isns_ker()							sns_ker()
+#define iext_ker()							ext_ker()
+#define idis_int(intno)						dis_int(intno)
+#define iena_int(intno)						ena_int(intno)
+#define ixsns_dpn(p_excinf)					xsns_dpn(p_excinf)
+
+/*
+ *  ãªãã¸ã§ã¯ãå±æ§ã®å®ç¾©
+ */
+#define TA_ACT			UINT_C(0x01)	/* ã¿ã¹ã¯ãèµ·åãããç¶æ
+ã§çæ */
+#define TA_NOACTQUE		UINT_C(0x02)	/* èµ·åè¦æ±ãã­ã¥ã¼ã¤ã³ã°ããªã */
+
+#define TA_TPRI			UINT_C(0x01)	/* ã¿ã¹ã¯ã®å¾
+ã¡è¡åãåªå
+åº¦é ã« */
+
+#define TA_WMUL			UINT_C(0x02)	/* è¤æ°ã®å¾
+ã¡ã¿ã¹ã¯ */
+#define TA_CLR			UINT_C(0x04)	/* ã¤ãã³ããã©ã°ã®ã¯ãªã¢æå® */
+
+#define TA_CEILING		UINT_C(0x03)	/* åªå
+åº¦ä¸éãã­ãã³ã« */
+
+#define TA_STA			UINT_C(0x02)	/* å¨æéç¥ãåä½ç¶æ
+ã§çæ */
+
+#define TA_NONKERNEL	UINT_C(0x02)	/* ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ */
+
+#define TA_ENAINT		UINT_C(0x01)	/* å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ãã¯ãªã¢ */
+#define TA_EDGE			UINT_C(0x02)	/* ã¨ãã¸ããªã¬ */
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®åä½ã¢ã¼ãã®å®ç¾©
+ */
+#define TWF_ORW			UINT_C(0x01)	/* ã¤ãã³ããã©ã°ã®ORå¾
+ã¡ */
+#define TWF_ANDW		UINT_C(0x02)	/* ã¤ãã³ããã©ã°ã®ANDå¾
+ã¡ */
+
+/*
+ *  éç¥å¦çã¢ã¼ãã®å®ç¾©
+ */
+#define TNFY_HANDLER	UINT_C(0x00)		/* ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºã */
+#define TNFY_SETVAR		UINT_C(0x01)		/* å¤æ°ã®è¨­å® */
+#define TNFY_INCVAR		UINT_C(0x02)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TNFY_ACTTSK		UINT_C(0x03)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TNFY_WUPTSK		UINT_C(0x04)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TNFY_SIGSEM		UINT_C(0x05)		/* ã»ããã©ã®è³æºã®è¿å´ */
+#define TNFY_SETFLG		UINT_C(0x06)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TNFY_SNDDTQ		UINT_C(0x07)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+#define TENFY_SETVAR	UINT_C(0x10)		/* å¤æ°ã®è¨­å® */
+#define TENFY_INCVAR	UINT_C(0x20)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TENFY_ACTTSK	UINT_C(0x30)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TENFY_WUPTSK	UINT_C(0x40)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TENFY_SIGSEM	UINT_C(0x50)		/* ã»ããã©ã®è¿å´ */
+#define TENFY_SETFLG	UINT_C(0x60)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TENFY_SNDDTQ	UINT_C(0x70)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+/*
+ *  ãªãã¸ã§ã¯ãã®ç¶æ
+ã®å®ç¾©
+ */
+#define TTS_RUN			UINT_C(0x01)	/* å®è¡ç¶æ
+ */
+#define TTS_RDY			UINT_C(0x02)	/* å®è¡å¯è½ç¶æ
+ */
+#define TTS_WAI			UINT_C(0x04)	/* å¾
+ã¡ç¶æ
+ */
+#define TTS_SUS			UINT_C(0x08)	/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+#define TTS_WAS			UINT_C(0x0c)	/* äºéå¾
+ã¡ç¶æ
+ */
+#define TTS_DMT			UINT_C(0x10)	/* ä¼æ­¢ç¶æ
+ */
+
+#define TTW_SLP			UINT_C(0x0001)	/* èµ·åºå¾
+ã¡ */
+#define TTW_DLY			UINT_C(0x0002)	/* æéçµéå¾
+ã¡ */
+#define TTW_SEM			UINT_C(0x0004)	/* ã»ããã©ã®è³æºç²å¾å¾
+ã¡ */
+#define TTW_FLG			UINT_C(0x0008)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TTW_SDTQ		UINT_C(0x0010)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RDTQ		UINT_C(0x0020)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_SPDQ		UINT_C(0x0100)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RPDQ		UINT_C(0x0200)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_MTX			UINT_C(0x0080)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ç¶æ
+ */
+#define TTW_MPF			UINT_C(0x2000)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TCYC_STP		UINT_C(0x01)	/* å¨æéç¥ãåä½ãã¦ããªã */
+#define TCYC_STA		UINT_C(0x02)	/* å¨æéç¥ãåä½ãã¦ãã */
+
+#define TALM_STP		UINT_C(0x01)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ããªã */
+#define TALM_STA		UINT_C(0x02)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ãã */
+
+/*
+ *  ãã®ä»ã®å®æ°ã®å®ç¾©
+ */
+#define TSK_SELF		0			/* èªã¿ã¹ã¯æå® */
+#define TSK_NONE		0			/* è©²å½ããã¿ã¹ã¯ããªã */
+
+#define TPRI_SELF		0			/* èªã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+#define TPRI_INI		0			/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ */
+
+#define TIPM_ENAALL		0			/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ */
+
+/*
+ *  æ§æå®æ°ã¨ãã¯ã­
+ */
+
+/*
+ *  åªå
+åº¦ã®ç¯å²
+ */
+#define TMIN_TPRI		1			/* ã¿ã¹ã¯åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_TPRI		16			/* ã¿ã¹ã¯åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_DPRI		1			/* ãã¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_DPRI		16			/* ãã¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_ISRPRI		1			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå°å¤ */
+#define TMAX_ISRPRI		16			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå¤§å¤ */
+
+/*
+ *  ãã¼ã¸ã§ã³æ
+å ±
+ */
+#define TKERNEL_MAKER	UINT_C(0x0118)	/* ã«ã¼ãã«ã®ã¡ã¼ã«ã¼ã³ã¼ã */
+#define TKERNEL_PRID	UINT_C(0x0007)	/* ã«ã¼ãã«ã®è­å¥çªå· */
+#define TKERNEL_SPVER	UINT_C(0xf630)	/* ã«ã¼ãã«ä»æ§ã®ãã¼ã¸ã§ã³çªå· */
+#define TKERNEL_PRVER	UINT_C(0x30b0)	/* ã«ã¼ãã«ã®ãã¼ã¸ã§ã³çªå· */
+
+/*
+ *  ã­ã¥ã¼ã¤ã³ã°åæ°ã®æå¤§å¤
+ */
+#define TMAX_ACTCNT		UINT_C(1)		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+#define TMAX_WUPCNT		UINT_C(1)		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+
+/*
+ *  ããããã¿ã¼ã³ã®ãããæ°
+ */
+#ifndef TBIT_FLGPTN					/* ã¤ãã³ããã©ã°ã®ãããæ° */
+#define TBIT_FLGPTN		(sizeof(FLGPTN) * CHAR_BIT)
+#endif /* TBIT_FLGPTN */
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´ã§ããç¯å²ï¼åä½ï¼Î¼ç§ï¼
+ */
+#define TMIN_ADJTIM		-1000000		/* ã·ã¹ãã æå»ã®æå°èª¿æ´æé */
+#define TMAX_ADJTIM		1000000			/* ã·ã¹ãã æå»ã®æå¤§èª¿æ´æé */
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®ãã¯ã­
+ *
+ *  ä»¥ä¸ã®TOPPERS_COUNT_SZã¨TOPPERS_ROUND_SZã®å®ç¾©ã¯ï¼unitã2ã®å·¾ä¹ã§ã
+ *  ããã¨ãä»®å®ãã¦ããï¼
+ */
+#ifndef TOPPERS_COUNT_SZ
+#define TOPPERS_COUNT_SZ(sz, unit)	(((sz) + (unit) - 1) / (unit))
+#endif /* TOPPERS_COUNT_SZ */
+#ifndef TOPPERS_ROUND_SZ
+#define TOPPERS_ROUND_SZ(sz, unit)	(((sz) + (unit) - 1) & ~((unit) - 1))
+#endif /* TOPPERS_ROUND_SZ */
+
+#define COUNT_STK_T(sz)		TOPPERS_COUNT_SZ(sz, sizeof(STK_T))
+#define ROUND_STK_T(sz)		TOPPERS_ROUND_SZ(sz, sizeof(STK_T))
+
+#define COUNT_MPF_T(blksz)	TOPPERS_COUNT_SZ(blksz, sizeof(MPF_T))
+#define ROUND_MPF_T(blksz)	TOPPERS_ROUND_SZ(blksz, sizeof(MPF_T))
+
+/*
+ *  ãã®ä»ã®æ§æå®æ°
+ */
+#define TMAX_MAXSEM		UINT_MAX	/* ã»ããã©ã®æå¤§è³æºæ°ã®æå¤§å¤ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_KERNEL_H */
Index: asp3_wo_tecs/trunk/extension/subprio/kernel/Makefile.kernel
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/kernel/Makefile.kernel	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/kernel/Makefile.kernel	(revision 302)
@@ -0,0 +1,155 @@
+#
+#  TOPPERS/ASP Kernel
+#      Toyohashi Open Platform for Embedded Real-Time Systems/
+#      Advanced Standard Profile Kernel
+# 
+#  Copyright (C) 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: Makefile.kernel 271 2014-10-16 09:42:02Z ertl-hiro $
+# 
+
+#
+#		ã«ã¼ãã«ã®ãã¡ã¤ã«æ§æã®å®ç¾©
+#
+
+#
+#  1ã¤ã®ã½ã¼ã¹ãã¡ã¤ã«ããè¤æ°ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ãçæããããã«ä½
+#  æãããã½ã¼ã¹ãã¡ã¤ã«ã®ãªã¹ã
+#
+KERNEL_FCSRCS = startup.c task.c taskhook.c wait.c time_event.c \
+				task_manage.c task_refer.c task_sync.c task_term.c \
+				semaphore.c eventflag.c dataqueue.c pridataq.c mutex.c \
+				mempfix.c time_manage.c cyclic.c alarm.c \
+				sys_manage.c interrupt.c exception.c
+
+#
+#  åã½ã¼ã¹ãã¡ã¤ã«ããçæããããªãã¸ã§ã¯ããã¡ã¤ã«ã®ãªã¹ã
+#
+startup = sta_ker.o ext_ker.o
+
+task = tskini.o tsksched.o tskrun.o tsknrun.o \
+		tskdmt.o tskact.o tskpri.o tskspr.o tskrot.o tskterm.o
+
+taskhook = mtxhook.o
+
+wait = waimake.o waicmp.o waitmo.o waitmook.o \
+		wobjwai.o wobjwaitmo.o iniwque.o
+
+time_event = tmeini.o tmeup.o tmedown.o tmecur.o tmeset.o \
+		tmereg.o tmeenq.o tmedeq.o tmechk.o tmeltim.o sigtim.o
+
+task_manage = act_tsk.o can_act.o get_tst.o chg_pri.o \
+		chg_spr.o get_pri.o get_inf.o
+
+task_refer = ref_tsk.o
+
+task_sync = slp_tsk.o tslp_tsk.o wup_tsk.o can_wup.o \
+		rel_wai.o sus_tsk.o rsm_tsk.o dly_tsk.o
+
+task_term = ext_tsk.o ras_ter.o ena_ter.o dis_ter.o sns_ter.o ter_tsk.o
+
+semaphore = semini.o sig_sem.o \
+		wai_sem.o pol_sem.o twai_sem.o ini_sem.o ref_sem.o
+
+eventflag = flgini.o flgcnd.o set_flg.o clr_flg.o \
+		wai_flg.o pol_flg.o twai_flg.o ini_flg.o ref_flg.o
+
+dataqueue = dtqini.o dtqenq.o dtqfenq.o dtqdeq.o dtqsnd.o dtqfsnd.o dtqrcv.o \
+		snd_dtq.o psnd_dtq.o tsnd_dtq.o fsnd_dtq.o \
+		rcv_dtq.o prcv_dtq.o trcv_dtq.o ini_dtq.o ref_dtq.o
+
+pridataq = pdqini.o pdqenq.o pdqdeq.o pdqsnd.o pdqrcv.o \
+		snd_pdq.o psnd_pdq.o tsnd_pdq.o \
+		rcv_pdq.o prcv_pdq.o trcv_pdq.o ini_pdq.o ref_pdq.o
+
+mutex = mtxini.o mtxchk.o mtxscan.o mtxdrop.o mtxacq.o mtxrel.o mtxrela.o \
+		loc_mtx.o ploc_mtx.o tloc_mtx.o unl_mtx.o ini_mtx.o ref_mtx.o
+
+mempfix = mpfini.o mpfget.o get_mpf.o pget_mpf.o tget_mpf.o \
+		rel_mpf.o ini_mpf.o ref_mpf.o
+
+time_manage = set_tim.o get_tim.o adj_tim.o fch_hrt.o
+
+cyclic = cycini.o sta_cyc.o stp_cyc.o ref_cyc.o cyccal.o
+
+alarm = almini.o sta_alm.o stp_alm.o ref_alm.o almcal.o
+
+sys_manage = rot_rdq.o get_tid.o get_lod.o get_nth.o \
+		loc_cpu.o unl_cpu.o dis_dsp.o ena_dsp.o \
+		sns_ctx.o sns_loc.o sns_dsp.o sns_dpn.o sns_ker.o
+
+interrupt = intini.o dis_int.o ena_int.o chg_ipm.o get_ipm.o
+
+exception = excini.o xsns_dpn.o
+
+#
+#  çæããããªãã¸ã§ã¯ããã¡ã¤ã«ã®ä¾å­é¢ä¿ã®å®ç¾©
+#
+$(startup) $(startup:.o=.s) $(startup:.o=.d): startup.c
+$(task) $(task:.o=.s) $(task:.o=.d): task.c
+$(taskhook) $(taskhook:.o=.s) $(taskhook:.o=.d): taskhook.c
+$(wait) $(wait:.o=.s) $(wait:.o=.d): wait.c
+$(time_event) $(time_event:.o=.s) $(time_event:.o=.d): time_event.c
+$(task_manage) $(task_manage:.o=.s) $(task_manage:.o=.d): task_manage.c
+$(task_refer) $(task_refer:.o=.s) $(task_refer:.o=.d): task_refer.c
+$(task_sync) $(task_sync:.o=.s) $(task_sync:.o=.d): task_sync.c
+$(task_term) $(task_term:.o=.s) $(task_term:.o=.d): task_term.c
+$(semaphore) $(semaphore:.o=.s) $(semaphore:.o=.d): semaphore.c
+$(eventflag) $(eventflag:.o=.s) $(eventflag:.o=.d): eventflag.c
+$(dataqueue) $(dataqueue:.o=.s) $(dataqueue:.o=.d): dataqueue.c
+$(pridataq) $(pridataq:.o=.s) $(pridataq:.o=.d): pridataq.c
+$(mutex) $(mutex:.o=.s) $(mutex:.o=.d): mutex.c
+$(mempfix) $(mempfix:.o=.s) $(mempfix:.o=.d): mempfix.c
+$(time_manage) $(time_manage:.o=.s) $(time_manage:.o=.d): time_manage.c
+$(cyclic) $(cyclic:.o=.s) $(cyclic:.o=.d): cyclic.c
+$(alarm) $(alarm:.o=.s) $(alarm:.o=.d): alarm.c
+$(sys_manage) $(sys_manage:.o=.s) $(sys_manage:.o=.d): sys_manage.c
+$(interrupt) $(interrupt:.o=.s) $(interrupt:.o=.d): interrupt.c
+$(exception) $(exception:.o=.s) $(exception:.o=.d): exception.c
Index: asp3_wo_tecs/trunk/extension/subprio/kernel/allfunc.h
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/kernel/allfunc.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/kernel/allfunc.h	(revision 302)
@@ -0,0 +1,258 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: allfunc.h 271 2014-10-16 09:42:02Z ertl-hiro $
+ */
+
+/*
+ *		ãã¹ã¦ã®é¢æ°ãã³ã³ãã¤ã«ããããã®å®ç¾©
+ */
+
+#ifndef TOPPERS_ALLFUNC_H
+#define TOPPERS_ALLFUNC_H
+
+/* startup.c */
+#define TOPPERS_sta_ker
+#define TOPPERS_ext_ker
+
+/* task.c */
+#define TOPPERS_tskini
+#define TOPPERS_tsksched
+#define TOPPERS_tskrun
+#define TOPPERS_tsknrun
+#define TOPPERS_tskdmt
+#define TOPPERS_tskact
+#define TOPPERS_tskpri
+#define TOPPERS_tskspr
+#define TOPPERS_tskrot
+#define TOPPERS_tskterm
+
+/* taskhook.c */
+#define TOPPERS_mtxhook
+
+/* wait.c */
+#define TOPPERS_waimake
+#define TOPPERS_waicmp
+#define TOPPERS_waitmo
+#define TOPPERS_waitmook
+#define TOPPERS_wobjwai
+#define TOPPERS_wobjwaitmo
+#define TOPPERS_iniwque
+
+/* time_event.c */
+#define TOPPERS_tmeini
+#define TOPPERS_tmeup
+#define TOPPERS_tmedown
+#define TOPPERS_tmecur
+#define TOPPERS_tmeset
+#define TOPPERS_tmereg
+#define TOPPERS_tmeenq
+#define TOPPERS_tmedeq
+#define TOPPERS_tmechk
+#define TOPPERS_tmeltim
+#define TOPPERS_sigtim
+
+/* task_manage.c */
+#define TOPPERS_act_tsk
+#define TOPPERS_can_act
+#define TOPPERS_get_tst
+#define TOPPERS_chg_pri
+#define TOPPERS_chg_spr
+#define TOPPERS_get_pri
+#define TOPPERS_get_inf
+
+/* task_refer.c */
+#define TOPPERS_ref_tsk
+
+/* task_sync.c */
+#define TOPPERS_slp_tsk
+#define TOPPERS_tslp_tsk
+#define TOPPERS_wup_tsk
+#define TOPPERS_can_wup
+#define TOPPERS_rel_wai
+#define TOPPERS_sus_tsk
+#define TOPPERS_rsm_tsk
+#define TOPPERS_dly_tsk
+
+/* task_term.c */
+#define TOPPERS_ext_tsk
+#define TOPPERS_ras_ter
+#define TOPPERS_dis_ter
+#define TOPPERS_ena_ter
+#define TOPPERS_sns_ter
+#define TOPPERS_ter_tsk
+
+/* semaphore.c */
+#define TOPPERS_semini
+#define TOPPERS_sig_sem
+#define TOPPERS_wai_sem
+#define TOPPERS_pol_sem
+#define TOPPERS_twai_sem
+#define TOPPERS_ini_sem
+#define TOPPERS_ref_sem
+
+/* eventflag.c */
+#define TOPPERS_flgini
+#define TOPPERS_flgcnd
+#define TOPPERS_set_flg
+#define TOPPERS_clr_flg
+#define TOPPERS_wai_flg
+#define TOPPERS_pol_flg
+#define TOPPERS_twai_flg
+#define TOPPERS_ini_flg
+#define TOPPERS_ref_flg
+
+/* dataqueue.c */
+#define TOPPERS_dtqini
+#define TOPPERS_dtqenq
+#define TOPPERS_dtqfenq
+#define TOPPERS_dtqdeq
+#define TOPPERS_dtqsnd
+#define TOPPERS_dtqfsnd
+#define TOPPERS_dtqrcv
+#define TOPPERS_snd_dtq
+#define TOPPERS_psnd_dtq
+#define TOPPERS_tsnd_dtq
+#define TOPPERS_fsnd_dtq
+#define TOPPERS_rcv_dtq
+#define TOPPERS_prcv_dtq
+#define TOPPERS_trcv_dtq
+#define TOPPERS_ini_dtq
+#define TOPPERS_ref_dtq
+
+/* pridataq.c */
+#define TOPPERS_pdqini
+#define TOPPERS_pdqenq
+#define TOPPERS_pdqdeq
+#define TOPPERS_pdqsnd
+#define TOPPERS_pdqrcv
+#define TOPPERS_snd_pdq
+#define TOPPERS_psnd_pdq
+#define TOPPERS_tsnd_pdq
+#define TOPPERS_rcv_pdq
+#define TOPPERS_prcv_pdq
+#define TOPPERS_trcv_pdq
+#define TOPPERS_ini_pdq
+#define TOPPERS_ref_pdq
+
+/* mutex.c */
+#define TOPPERS_mtxini
+#define TOPPERS_mtxchk
+#define TOPPERS_mtxscan
+#define TOPPERS_mtxdrop
+#define TOPPERS_mtxacq
+#define TOPPERS_mtxrel
+#define TOPPERS_mtxrela
+#define TOPPERS_loc_mtx
+#define TOPPERS_ploc_mtx
+#define TOPPERS_tloc_mtx
+#define TOPPERS_unl_mtx
+#define TOPPERS_ini_mtx
+#define TOPPERS_ref_mtx
+
+/* mempfix.c */
+#define TOPPERS_mpfini
+#define TOPPERS_mpfget
+#define TOPPERS_get_mpf
+#define TOPPERS_pget_mpf
+#define TOPPERS_tget_mpf
+#define TOPPERS_rel_mpf
+#define TOPPERS_ini_mpf
+#define TOPPERS_ref_mpf
+
+/* time_manage.c */
+#define TOPPERS_set_tim
+#define TOPPERS_get_tim
+#define TOPPERS_adj_tim
+#define TOPPERS_fch_hrt
+
+/* cyclic.c */
+#define TOPPERS_cycini
+#define TOPPERS_sta_cyc
+#define TOPPERS_stp_cyc
+#define TOPPERS_ref_cyc
+#define TOPPERS_cyccal
+
+/* alarm.c */
+#define TOPPERS_almini
+#define TOPPERS_sta_alm
+#define TOPPERS_stp_alm
+#define TOPPERS_ref_alm
+#define TOPPERS_almcal
+
+/* sys_manage.c */
+#define TOPPERS_rot_rdq
+#define TOPPERS_get_tid
+#define TOPPERS_get_lod
+#define TOPPERS_get_nth
+#define TOPPERS_loc_cpu
+#define TOPPERS_unl_cpu
+#define TOPPERS_dis_dsp
+#define TOPPERS_ena_dsp
+#define TOPPERS_sns_ctx
+#define TOPPERS_sns_loc
+#define TOPPERS_sns_dsp
+#define TOPPERS_sns_dpn
+#define TOPPERS_sns_ker
+
+/* interrupt.c */
+#define TOPPERS_intini
+#define TOPPERS_dis_int
+#define TOPPERS_ena_int
+#define TOPPERS_chg_ipm
+#define TOPPERS_get_ipm
+
+/* exception.c */
+#define TOPPERS_excini
+#define TOPPERS_xsns_dpn
+
+#endif /* TOPPERS_ALLFUNC_H */
Index: asp3_wo_tecs/trunk/extension/subprio/kernel/kernel_api.csv
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/kernel/kernel_api.csv	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/kernel/kernel_api.csv	(revision 302)
@@ -0,0 +1,17 @@
+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? } },,
+spr,ENA_SPR,.tskpri,-1,
+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/extension/subprio/kernel/kernel_rename.def
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/kernel/kernel_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/kernel/kernel_rename.def	(revision 302)
@@ -0,0 +1,150 @@
+# startup.c
+kerflg
+exit_kernel
+
+# task.c
+p_runtsk
+p_schedtsk
+enadsp
+dspflg
+ready_queue
+ready_primap
+initialize_task
+search_schedtsk
+make_runnable
+make_non_runnable
+make_dormant
+make_active
+change_priority
+change_subprio
+rotate_ready_queue
+task_terminate
+
+# taskhook.c
+mtxhook_check_ceilpri
+mtxhook_scan_ceilmtx
+mtxhook_release_all
+
+# wait.c
+make_wait_tmout
+wait_complete
+wait_tmout
+wait_tmout_ok
+wobj_make_wait
+wobj_make_wait_tmout
+init_wait_queue
+
+# time_event.c
+boundary_evttim
+current_evttim
+current_hrtcnt
+monotonic_evttim
+systim_offset
+in_signal_time
+initialize_tmevt
+tmevt_up
+tmevt_down
+update_current_evttim
+set_hrt_event
+tmevtb_register
+tmevtb_enqueue
+tmevtb_dequeue
+check_adjtim
+tmevt_lefttim
+signal_time
+
+# semaphore.c
+initialize_semaphore
+
+# eventflag.c
+initialize_eventflag
+check_flg_cond
+
+# dataqueue.c
+initialize_dataqueue
+enqueue_data
+force_enqueue_data
+dequeue_data
+send_data
+force_send_data
+receive_data
+
+# pridataq.c
+initialize_pridataq
+enqueue_pridata
+dequeue_pridata
+send_pridata
+receive_pridata
+
+# mutex.c
+initialize_mutex
+mutex_check_ceilpri
+mutex_scan_ceilmtx
+mutex_drop_priority
+mutex_acquire
+mutex_release
+mutex_release_all
+
+# mempfix.c
+initialize_mempfix
+get_mpf_block
+
+# cyclic.c
+initialize_cyclic
+call_cyclic
+
+# alarm.c
+initialize_alarm
+call_alarm
+
+# interrupt.c
+initialize_interrupt
+
+# exception.c
+initialize_exception
+
+# kernel_cfg.c
+initialize_object
+call_inirtn
+call_terrtn
+subprio_primap
+tmax_tskid
+tinib_table
+torder_table
+tcb_table
+tmax_semid
+seminib_table
+semcb_table
+tmax_flgid
+flginib_table
+flgcb_table
+tmax_dtqid
+dtqinib_table
+dtqcb_table
+tmax_pdqid
+pdqinib_table
+pdqcb_table
+tmax_mtxid
+mtxinib_table
+mtxcb_table
+tmax_mpfid
+mpfinib_table
+mpfcb_table
+tmax_cycid
+cycinib_table
+cyccb_table
+tmax_almid
+alminib_table
+almcb_table
+tnum_def_inhno
+inhinib_table
+tnum_cfg_intno
+intinib_table
+tnum_def_excno
+excinib_table
+tmevt_heap
+istksz
+istk
+istkpt
+
+INCLUDE "target"
Index: asp3_wo_tecs/trunk/extension/subprio/kernel/kernel_rename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/kernel/kernel_rename.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/kernel/kernel_rename.h	(revision 302)
@@ -0,0 +1,376 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+#ifndef TOPPERS_KERNEL_RENAME_H
+#define TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  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 change_subprio				_kernel_change_subprio
+#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 subprio_primap				_kernel_subprio_primap
+#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
+
+
+#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 _change_subprio				__kernel_change_subprio
+#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 _subprio_primap				__kernel_subprio_primap
+#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"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/extension/subprio/kernel/kernel_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/kernel/kernel_unrename.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/kernel/kernel_unrename.h	(revision 302)
@@ -0,0 +1,377 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+/* This file is included only when kernel_rename.h has been included. */
+#ifdef TOPPERS_KERNEL_RENAME_H
+#undef TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  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 change_subprio
+#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 subprio_primap
+#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
+
+
+#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 _change_subprio
+#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 _subprio_primap
+#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"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/extension/subprio/kernel/mutex.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/kernel/mutex.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/kernel/mutex.tf	(revision 302)
@@ -0,0 +1,160 @@
+$
+$   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$
+
+$		// åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã§ï¼ceilpriããµãåªå
+åº¦ãä½¿ç¨ããã¨è¨­
+$		// å®ããã¦ããå ´åï¼E_ILUSEï¼ï¼»NGKI3682ï¼½
+		$IF MTX.MTXATR[mtxid] == TA_CEILING
+							&& LENGTH(FIND(spr_tskpri, MTX.CEILPRI[mtxid]))$
+			$ERROR MTX.TEXT_LINE[mtxid]$E_ILUSE:$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/extension/subprio/kernel/sys_manage.c
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/kernel/sys_manage.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/kernel/sys_manage.c	(revision 302)
@@ -0,0 +1,552 @@
+/*
+ *  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: sys_manage.c 470 2015-12-30 09:50:36Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ROT_RDQ_ENTER
+#define LOG_ROT_RDQ_ENTER(tskpri)
+#endif /* LOG_ROT_RDQ_ENTER */
+
+#ifndef LOG_ROT_RDQ_LEAVE
+#define LOG_ROT_RDQ_LEAVE(ercd)
+#endif /* LOG_ROT_RDQ_LEAVE */
+
+#ifndef LOG_GET_TID_ENTER
+#define LOG_GET_TID_ENTER(p_tskid)
+#endif /* LOG_GET_TID_ENTER */
+
+#ifndef LOG_GET_TID_LEAVE
+#define LOG_GET_TID_LEAVE(ercd, p_tskid)
+#endif /* LOG_GET_TID_LEAVE */
+
+#ifndef LOG_GET_LOD_ENTER
+#define LOG_GET_LOD_ENTER(tskpri, p_load)
+#endif /* LOG_GET_LOD_ENTER */
+
+#ifndef LOG_GET_LOD_LEAVE
+#define LOG_GET_LOD_LEAVE(ercd, p_load)
+#endif /* LOG_GET_LOD_LEAVE */
+
+#ifndef LOG_GET_NTH_ENTER
+#define LOG_GET_NTH_ENTER(tskpri, nth, p_tskid)
+#endif /* LOG_GET_NTH_ENTER */
+
+#ifndef LOG_GET_NTH_LEAVE
+#define LOG_GET_NTH_LEAVE(ercd, p_tskid)
+#endif /* LOG_GET_NTH_LEAVE */
+
+#ifndef LOG_LOC_CPU_ENTER
+#define LOG_LOC_CPU_ENTER()
+#endif /* LOG_LOC_CPU_ENTER */
+
+#ifndef LOG_LOC_CPU_LEAVE
+#define LOG_LOC_CPU_LEAVE(ercd)
+#endif /* LOG_LOC_CPU_LEAVE */
+
+#ifndef LOG_UNL_CPU_ENTER
+#define LOG_UNL_CPU_ENTER()
+#endif /* LOG_UNL_CPU_ENTER */
+
+#ifndef LOG_UNL_CPU_LEAVE
+#define LOG_UNL_CPU_LEAVE(ercd)
+#endif /* LOG_UNL_CPU_LEAVE */
+
+#ifndef LOG_DIS_DSP_ENTER
+#define LOG_DIS_DSP_ENTER()
+#endif /* LOG_DIS_DSP_ENTER */
+
+#ifndef LOG_DIS_DSP_LEAVE
+#define LOG_DIS_DSP_LEAVE(ercd)
+#endif /* LOG_DIS_DSP_LEAVE */
+
+#ifndef LOG_ENA_DSP_ENTER
+#define LOG_ENA_DSP_ENTER()
+#endif /* LOG_ENA_DSP_ENTER */
+
+#ifndef LOG_ENA_DSP_LEAVE
+#define LOG_ENA_DSP_LEAVE(ercd)
+#endif /* LOG_ENA_DSP_LEAVE */
+
+#ifndef LOG_SNS_CTX_ENTER
+#define LOG_SNS_CTX_ENTER()
+#endif /* LOG_SNS_CTX_ENTER */
+
+#ifndef LOG_SNS_CTX_LEAVE
+#define LOG_SNS_CTX_LEAVE(state)
+#endif /* LOG_SNS_CTX_LEAVE */
+
+#ifndef LOG_SNS_LOC_ENTER
+#define LOG_SNS_LOC_ENTER()
+#endif /* LOG_SNS_LOC_ENTER */
+
+#ifndef LOG_SNS_LOC_LEAVE
+#define LOG_SNS_LOC_LEAVE(state)
+#endif /* LOG_SNS_LOC_LEAVE */
+
+#ifndef LOG_SNS_DSP_ENTER
+#define LOG_SNS_DSP_ENTER()
+#endif /* LOG_SNS_DSP_ENTER */
+
+#ifndef LOG_SNS_DSP_LEAVE
+#define LOG_SNS_DSP_LEAVE(state)
+#endif /* LOG_SNS_DSP_LEAVE */
+
+#ifndef LOG_SNS_DPN_ENTER
+#define LOG_SNS_DPN_ENTER()
+#endif /* LOG_SNS_DPN_ENTER */
+
+#ifndef LOG_SNS_DPN_LEAVE
+#define LOG_SNS_DPN_LEAVE(state)
+#endif /* LOG_SNS_DPN_LEAVE */
+
+#ifndef LOG_SNS_KER_ENTER
+#define LOG_SNS_KER_ENTER()
+#endif /* LOG_SNS_KER_ENTER */
+
+#ifndef LOG_SNS_KER_LEAVE
+#define LOG_SNS_KER_LEAVE(state)
+#endif /* LOG_SNS_KER_LEAVE */
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+é ä½ã®åè»¢
+ */
+#ifdef TOPPERS_rot_rdq
+
+ER
+rot_rdq(PRI tskpri)
+{
+	uint_t	pri;
+	ER		ercd;
+
+	LOG_ROT_RDQ_ENTER(tskpri);
+	CHECK_UNL();
+	if (tskpri == TPRI_SELF && !sense_context()) {
+		pri = p_runtsk->bpriority;
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));
+		pri = INT_PRIORITY(tskpri);
+	}
+	CHECK_ILUSE((subprio_primap & PRIMAP_BIT(pri)) == 0U);
+
+	lock_cpu();
+	rotate_ready_queue(&(ready_queue[pri]));
+	if (p_runtsk != p_schedtsk) {
+		if (!sense_context()) {
+			dispatch();
+		}
+		else {
+			request_dispatch();
+		}
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_ROT_RDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rot_rdq */
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯IDã®åç
+§
+ */
+#ifdef TOPPERS_get_tid
+
+ER
+get_tid(ID *p_tskid)
+{
+	ER		ercd;
+
+	LOG_GET_TID_ENTER(p_tskid);
+	CHECK_UNL();
+
+	lock_cpu();
+	*p_tskid = (p_runtsk == NULL) ? TSK_NONE : TSKID(p_runtsk);
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_TID_LEAVE(ercd, p_tskid);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_tid */
+
+/*
+ *  å®è¡ã§ããã¿ã¹ã¯ã®æ°ã®åç
+§
+ */
+#ifdef TOPPERS_get_lod
+
+ER
+get_lod(PRI tskpri, uint_t *p_load)
+{
+	uint_t	pri, load;
+	QUEUE	*p_queue, *p_entry;
+	ER		ercd;
+
+	LOG_GET_LOD_ENTER(p_tskid, p_load);
+	CHECK_TSKCTX_UNL();
+	if (tskpri == TPRI_SELF) {
+		pri = p_runtsk->bpriority;
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));
+		pri = INT_PRIORITY(tskpri);
+	}
+	p_queue = &(ready_queue[pri]);
+
+	lock_cpu();
+	load = 0U;
+	for (p_entry = p_queue->p_next; p_entry != p_queue;
+										p_entry = p_entry->p_next) {
+		load += 1U;
+	}
+	*p_load = load;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_LOD_LEAVE(ercd, p_load);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_lod */
+
+/*
+ *  æå®ããåªå
+é ä½ã®ã¿ã¹ã¯IDã®åç
+§
+ */
+#ifdef TOPPERS_get_nth
+
+ER
+get_nth(PRI tskpri, uint_t nth, ID *p_tskid)
+{
+	uint_t	pri;
+	QUEUE	*p_queue, *p_entry;
+	ID		tskid;
+	ER		ercd;
+
+	LOG_GET_NTH_ENTER(p_tskid, nth, p_tskid);
+	CHECK_TSKCTX_UNL();
+	if (tskpri == TPRI_SELF) {
+		pri = p_runtsk->bpriority;
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));
+		pri = INT_PRIORITY(tskpri);
+	}
+	p_queue = &(ready_queue[pri]);
+
+	lock_cpu();
+	tskid = TSK_NONE;
+	for (p_entry = p_queue->p_next; p_entry != p_queue;
+										p_entry = p_entry->p_next) {
+		if (nth == 0U) {
+			tskid = TSKID((TCB *) p_entry);
+			break;
+		}
+		nth -= 1U;
+	}
+	*p_tskid = tskid;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_NTH_LEAVE(ercd, p_tskid);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_nth */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_loc_cpu
+
+ER
+loc_cpu(void)
+{
+	ER		ercd;
+
+	LOG_LOC_CPU_ENTER();
+
+	if (!sense_lock()) {
+		lock_cpu();
+	}
+	ercd = E_OK;
+
+	LOG_LOC_CPU_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_loc_cpu */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®è§£é¤
+ *
+ *  CPUã­ãã¯ä¸­ã¯ï¼ãã£ã¹ããããå¿
+è¦ã¨ãªããµã¼ãã¹ã³ã¼ã«ãå¼ã³åºãã
+ *  ã¨ã¯ã§ããªãããï¼CPUã­ãã¯ç¶æ
+ã®è§£é¤æã«ãã£ã¹ãããã£ãèµ·åãã
+ *  å¿
+è¦ã¯ãªãï¼
+ */
+#ifdef TOPPERS_unl_cpu
+
+ER
+unl_cpu(void)
+{
+	ER		ercd;
+
+	LOG_UNL_CPU_ENTER();
+
+	if (sense_lock()) {
+		unlock_cpu();
+	}
+	ercd = E_OK;
+
+	LOG_UNL_CPU_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_unl_cpu */
+
+/*
+ *  ãã£ã¹ãããã®ç¦æ­¢
+ */
+#ifdef TOPPERS_dis_dsp
+
+ER
+dis_dsp(void)
+{
+	ER		ercd;
+
+	LOG_DIS_DSP_ENTER();
+	CHECK_TSKCTX_UNL();
+
+	lock_cpu();
+	enadsp = false;
+	dspflg = false;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_DIS_DSP_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_dis_dsp */
+
+/*
+ *  ãã£ã¹ãããã®è¨±å¯
+ */
+#ifdef TOPPERS_ena_dsp
+
+ER
+ena_dsp(void)
+{
+	ER		ercd;
+
+	LOG_ENA_DSP_ENTER();
+	CHECK_TSKCTX_UNL();
+
+	lock_cpu();
+	enadsp = true;
+	if (t_get_ipm() == TIPM_ENAALL) {
+		dspflg = true;
+		p_schedtsk = search_schedtsk();
+		if (p_runtsk->raster && p_runtsk->enater) {
+			task_terminate(p_runtsk);
+			exit_and_dispatch();
+			ercd = E_SYS;
+		}
+		else {
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}
+			ercd = E_OK;
+		}
+	}
+	else {
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ENA_DSP_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ena_dsp */
+
+/*
+ *  ã³ã³ãã­ã¹ãã®åç
+§
+ */
+#ifdef TOPPERS_sns_ctx
+
+bool_t
+sns_ctx(void)
+{
+	bool_t	state;
+
+	LOG_SNS_CTX_ENTER();
+	state = sense_context() ? true : false;
+	LOG_SNS_CTX_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_ctx */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_loc
+
+bool_t
+sns_loc(void)
+{
+	bool_t	state;
+
+	LOG_SNS_LOC_ENTER();
+	state = sense_lock() ? true : false;
+	LOG_SNS_LOC_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_loc */
+
+/*
+ *  ãã£ã¹ãããç¦æ­¢ç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_dsp
+
+bool_t
+sns_dsp(void)
+{
+	bool_t	state;
+
+	LOG_SNS_DSP_ENTER();
+	state = !enadsp;
+	LOG_SNS_DSP_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_dsp */
+
+/*
+ *  ãã£ã¹ãããä¿çç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_dpn
+
+bool_t
+sns_dpn(void)
+{
+	bool_t	state;
+
+	LOG_SNS_DPN_ENTER();
+	state = (sense_context() || sense_lock() || !dspflg) ? true : false;
+	LOG_SNS_DPN_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_dpn */
+
+/*
+ *  ã«ã¼ãã«éåä½ç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_ker
+
+bool_t
+sns_ker(void)
+{
+	bool_t	state;
+
+	LOG_SNS_KER_ENTER();
+	state = kerflg ? false : true;
+	LOG_SNS_KER_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_ker */
Index: asp3_wo_tecs/trunk/extension/subprio/kernel/task.c
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/kernel/task.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/kernel/task.c	(revision 302)
@@ -0,0 +1,550 @@
+/*
+ *  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: task.c 258 2014-10-04 19:37:38Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#include "kernel_impl.h"
+#include "task.h"
+#include "taskhook.h"
+#include "wait.h"
+
+#ifdef TOPPERS_tskini
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯
+ */
+TCB		*p_runtsk;
+
+/*
+ *  å®è¡ãã¹ãã¿ã¹ã¯
+ */
+TCB		*p_schedtsk;
+
+/*
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+
+ */
+bool_t	enadsp;
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããå¯è½ç¶æ
+
+ */
+bool_t	dspflg;
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼
+ */
+QUEUE	ready_queue[TNUM_TPRI];
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ãµã¼ãã®ããã®ãããããã
+ */
+uint16_t	ready_primap;
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®åæå
+ */
+void
+initialize_task(void)
+{
+	uint_t	i, j;
+	TCB		*p_tcb;
+
+	p_runtsk = NULL;
+	p_schedtsk = NULL;
+	enadsp = true;
+	dspflg = true;
+
+	for (i = 0; i < TNUM_TPRI; i++) {
+		queue_initialize(&(ready_queue[i]));
+	}
+	ready_primap = 0U;
+
+	for (i = 0; i < tnum_tsk; i++) {
+		j = INDEX_TSK(torder_table[i]);
+		p_tcb = &(tcb_table[j]);
+		p_tcb->p_tinib = &(tinib_table[j]);
+		p_tcb->actque = false;
+		p_tcb->subpri = UINT_MAX;
+		make_dormant(p_tcb);
+		p_tcb->p_lastmtx = NULL;
+		if ((p_tcb->p_tinib->tskatr & TA_ACT) != 0U) {
+			make_active(p_tcb);
+		}
+	}
+}
+
+#endif /* TOPPERS_tskini */
+
+/*
+ *  ãããããããµã¼ãé¢æ°
+ *
+ *  bitmapå
+ã®1ã®ãããã®å
+ï¼æãä¸ä½ï¼å³ï¼ã®ãã®ããµã¼ããï¼ãã®ãã
+ *  ãçªå·ãè¿ãï¼ãããçªå·ã¯ï¼æä¸ä½ãããã0ã¨ããï¼bitmapã«0ãæå®
+ *  ãã¦ã¯ãªããªãï¼ãã®é¢æ°ã§ã¯ï¼bitmapã16ãããã§ãããã¨ãä»®å®ãï¼
+ *  uint16_tåã¨ãã¦ããï¼
+ *
+ *  ããããµã¼ãå½ä»¤ãæã¤ãã­ã»ããµã§ã¯ï¼ããããµã¼ãå½ä»¤ãä½¿ãããã«
+ *  æ¸ãç´ããæ¹ãå¹çãè¯ãå ´åãããï¼ãã®ãããªå ´åã«ã¯ï¼ã¿ã¼ã²ãã
+ *  ä¾å­é¨ã§ããããµã¼ãå½ä»¤ãä½¿ã£ãbitmap_searchãå®ç¾©ãï¼
+ *  OMIT_BITMAP_SEARCHããã¯ã­å®ç¾©ããã°ããï¼ã¾ãï¼ããããµã¼ãå½ä»¤ã®
+ *  ãµã¼ãæ¹åãéãªã©ã®çç±ã§åªå
+åº¦ã¨ãããã¨ã®å¯¾å¿ãå¤æ´ãããå ´åã«
+ *  ã¯ï¼PRIMAP_BITããã¯ã­å®ç¾©ããã°ããï¼
+ *
+ *  ã¾ãï¼ã©ã¤ãã©ãªã«ffsããããªãï¼æ¬¡ã®ããã«å®ç¾©ãã¦ã©ã¤ãã©ãªé¢æ°ã
+ *  ä½¿ã£ãæ¹ãå¹çãè¯ãå¯è½æ§ãããï¼
+ *		#define	bitmap_search(bitmap) (ffs(bitmap) - 1)
+ */
+#ifndef OMIT_BITMAP_SEARCH
+
+static const unsigned char bitmap_search_table[] = { 0, 1, 0, 2, 0, 1, 0,
+												3, 0, 1, 0, 2, 0, 1, 0 };
+
+Inline uint_t
+bitmap_search(uint16_t bitmap)
+{
+	uint_t	n = 0U;
+
+	assert(bitmap != 0U);
+	if ((bitmap & 0x00ffU) == 0U) {
+		bitmap >>= 8;
+		n += 8;
+	}
+	if ((bitmap & 0x0fU) == 0U) {
+		bitmap >>= 4;
+		n += 4;
+	}
+	return(n + bitmap_search_table[(bitmap & 0x0fU) - 1]);
+}
+
+#endif /* OMIT_BITMAP_SEARCH */
+
+/*
+ *  åªå
+åº¦ãããããããç©ºãã®ãã§ãã¯
+ */
+Inline bool_t
+primap_empty(void)
+{
+	return(ready_primap == 0U);
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ãµã¼ã
+ */
+Inline uint_t
+primap_search(void)
+{
+	return(bitmap_search(ready_primap));
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ã»ãã
+ */
+Inline void
+primap_set(uint_t pri)
+{
+	ready_primap |= PRIMAP_BIT(pri);
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ã¯ãªã¢
+ */
+Inline void
+primap_clear(uint_t pri)
+{
+	ready_primap &= ~PRIMAP_BIT(pri);
+}
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã®ãµã¼ã
+ */
+#ifdef TOPPERS_tsksched
+
+TCB *
+search_schedtsk(void)
+{
+	uint_t	schedpri;
+
+	schedpri = primap_search();
+	return((TCB *)(ready_queue[schedpri].p_next));
+}
+
+#endif /* TOPPERS_tsksched */
+
+/*
+ *  ã¿ã¹ã¯ã®ãµãåªå
+åº¦é ã®ã­ã¥ã¼ã¸ã®æ¿å
+¥
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãï¼ãµãåªå
+åº¦é ã§ï¼ã­ã¥ã¼p_queueã«æ¿å
+¥ããï¼
+ *  ã­ã¥ã¼ã®ä¸­ã«åããµãåªå
+åº¦ã®ã¿ã¹ã¯ãããå ´åã«ã¯ï¼mtxmodeãtrueã®æ
+ *  ã¯ãããã®å
+é ­ã«ï¼falseã®æã¯ãããã®æå¾ã«æ¿å
+¥ããï¼
+ */
+Inline void
+queue_insert_subprio(QUEUE *p_queue, TCB *p_tcb, bool_t mtxmode)
+{
+	QUEUE	*p_entry;
+	uint_t	subpri = p_tcb->subpri;
+
+	for (p_entry = p_queue->p_next; p_entry != p_queue;
+										p_entry = p_entry->p_next) {
+		if (mtxmode ? subpri <= ((TCB *) p_entry)->subpri
+					: subpri < ((TCB *) p_entry)->subpri) {
+			break;
+		}
+	}
+	queue_insert_prev(p_entry, &(p_tcb->task_queue));
+}
+
+/*
+ *  å®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼å®è¡ã§ããã¿ã¹ã¯ããªãã£ãå ´åã¨ï¼
+ *  p_tcbã®åªå
+åº¦ãå®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã§ããï¼
+ */
+#ifdef TOPPERS_tskrun
+
+void
+make_runnable(TCB *p_tcb)
+{
+	uint_t	pri = p_tcb->priority;
+
+	if ((subprio_primap & PRIMAP_BIT(pri)) != 0U) {
+		queue_insert_subprio(&(ready_queue[pri]), p_tcb, false);
+	}
+	else {
+		queue_insert_prev(&(ready_queue[pri]), &(p_tcb->task_queue));
+	}
+	primap_set(pri);
+
+	if (dspflg) {
+		if (p_schedtsk == (TCB *) NULL || pri < p_schedtsk->priority) {
+			p_schedtsk = p_tcb;
+		}
+	}
+}
+
+#endif /* TOPPERS_tskrun */
+
+/*
+ *  å®è¡ã§ããç¶æ
+ããä»ã®ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ãå ´å
+ *  ã§ããï¼p_tcbã¨åãåªå
+åº¦ã®ã¿ã¹ã¯ãä»ã«ããå ´åã¯ï¼p_tcbã®æ¬¡ã®ã¿ã¹
+ *  ã¯ãå®è¡ãã¹ãã¿ã¹ã¯ã«ãªãï¼ããã§ãªãå ´åã¯ï¼ã¬ãã£ã­ã¥ã¼ããµã¼ã
+ *  ããå¿
+è¦ãããï¼
+ */
+#ifdef TOPPERS_tsknrun
+
+void
+make_non_runnable(TCB *p_tcb)
+{
+	uint_t	pri = p_tcb->priority;
+	QUEUE	*p_queue = &(ready_queue[pri]);
+
+	queue_delete(&(p_tcb->task_queue));
+	if (queue_empty(p_queue)) {
+		primap_clear(pri);
+		if (p_schedtsk == p_tcb) {
+			assert(dspflg);
+			p_schedtsk = primap_empty() ? (TCB *) NULL : search_schedtsk();
+		}
+	}
+	else {
+		if (p_schedtsk == p_tcb) {
+			assert(dspflg);
+			p_schedtsk = (TCB *)(p_queue->p_next);
+		}
+	}
+}
+
+#endif /* TOPPERS_tsknrun */
+
+/*
+ *  ä¼æ­¢ç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_tskdmt
+
+void
+make_dormant(TCB *p_tcb)
+{
+	p_tcb->tstat = TS_DORMANT;
+	p_tcb->bpriority = p_tcb->p_tinib->ipriority;
+	p_tcb->priority = p_tcb->p_tinib->ipriority;
+	p_tcb->wupque = false;
+	p_tcb->raster = false;
+	p_tcb->enater = true;
+	LOG_TSKSTAT(p_tcb);
+}
+
+#endif /* TOPPERS_tskdmt */
+
+/*
+ *  ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_tskact
+
+void
+make_active(TCB *p_tcb)
+{
+	activate_context(p_tcb);
+	p_tcb->tstat = TS_RUNNABLE;
+	LOG_TSKSTAT(p_tcb);
+	make_runnable(p_tcb);
+}
+
+#endif /* TOPPERS_tskact */
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+åº¦ã®å¤æ´
+ *
+ *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã®å ´åã«ã¯ï¼ã¬ãã£ã­ã¥ã¼ã®ä¸­ã§ã®ä½ç½®ãå¤æ´ã
+ *  ãï¼ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã®ä¸­ã§å¾
+ã¡ç¶æ
+ã«ãªã£ã¦ããå ´åã«ã¯ï¼å¾
+
+ *  ã¡ã­ã¥ã¼ã®ä¸­ã§ã®ä½ç½®ãå¤æ´ããï¼
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼(1) p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ã¦ï¼
+ *  ãã®åªå
+åº¦ãä¸ããå ´åï¼(2) p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ã¯ãªãï¼å¤æ´å¾
+ *  ã®åªå
+åº¦ãå®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã§ããï¼(1)ã®å ´åã«
+ *  ã¯ï¼ã¬ãã£ã­ã¥ã¼ããµã¼ãããå¿
+è¦ãããï¼
+ */
+#ifdef TOPPERS_tskpri
+
+void
+change_priority(TCB *p_tcb, uint_t newpri, bool_t mtxmode)
+{
+	uint_t	oldpri;
+
+	oldpri = p_tcb->priority;
+	p_tcb->priority = newpri;
+
+	if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		/*
+		 *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã®å ´å
+		 */
+		queue_delete(&(p_tcb->task_queue));
+		if (queue_empty(&(ready_queue[oldpri]))) {
+			primap_clear(oldpri);
+		}
+		if ((subprio_primap & PRIMAP_BIT(newpri)) != 0U) {
+			queue_insert_subprio(&(ready_queue[newpri]), p_tcb, mtxmode);
+		}
+		else if (mtxmode) {
+			queue_insert_next(&(ready_queue[newpri]), &(p_tcb->task_queue));
+		}
+		else {
+			queue_insert_prev(&(ready_queue[newpri]), &(p_tcb->task_queue));
+		}
+		primap_set(newpri);
+
+		if (dspflg) {
+			if (p_schedtsk == p_tcb) {
+				if (newpri >= oldpri) {
+					p_schedtsk = search_schedtsk();
+				}
+			}
+			else {
+				if (mtxmode ? newpri <= p_schedtsk->priority
+							: newpri < p_schedtsk->priority) {
+					p_schedtsk = p_tcb;
+				}
+			}
+		}
+	}
+	else {
+		if (TSTAT_WAIT_WOBJCB(p_tcb->tstat)) {
+			/*
+			 *  ã¿ã¹ã¯ãï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨
+			 *  åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ããå ´å
+			 */
+			wobj_change_priority(((WINFO_WOBJ *)(p_tcb->p_winfo))->p_wobjcb,
+																	p_tcb);
+		}
+	}
+}
+
+#endif /* TOPPERS_tskpri */
+
+/*
+ *  ã¿ã¹ã¯ã®ãµãåªå
+åº¦ã®å¤æ´
+ *
+ *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ï¼ã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ããµãåªå
+åº¦ãä½¿ç¨ãã
+ *  ã¨è¨­å®ããã¦ããå ´åã«ã¯ï¼ã¬ãã£ã­ã¥ã¼ã®ä¸­ã§ã®ä½ç½®ãå¤æ´ããï¼
+ *
+ *  ãµãåªå
+åº¦ãå¤æ´ããã¿ã¹ã¯ã¨ï¼å®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãåãå ´åã«ï¼
+ *  ãã®åªå
+åº¦ã®ä¸­ã§åªå
+é ä½ãæãé«ãã¿ã¹ã¯ãï¼å®è¡ãã¹ãã¿ã¹ã¯ã¨ããï¼
+ */
+#ifdef TOPPERS_tskspr
+
+void
+change_subprio(TCB *p_tcb, uint_t subpri)
+{
+	p_tcb->subpri = subpri;							/*ï¼»NGKI3672ï¼½*/
+	if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		if ((subprio_primap & PRIMAP_BIT(p_tcb->priority)) != 0U) {
+			queue_delete(&(p_tcb->task_queue));		/*ï¼»NGKI3673ï¼½*/
+			queue_insert_subprio(&(ready_queue[p_tcb->priority]), p_tcb, false);
+		}
+		if (dspflg) {
+			if (p_schedtsk->priority == p_tcb->priority) {
+				p_schedtsk = (TCB *)(ready_queue[p_tcb->priority].p_next);
+			}
+		}
+	}
+}
+
+#endif /* TOPPERS_tskspr */
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ã®åè»¢
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãã¿ã¹ã¯ã­ã¥ã¼ã®æ«
+ *  å°¾ã«ç§»åããå ´åã§ããï¼
+ */
+#ifdef TOPPERS_tskrot
+
+void
+rotate_ready_queue(QUEUE *p_queue)
+{
+	QUEUE	*p_entry;
+
+	if (!queue_empty(p_queue) && p_queue->p_next->p_next != p_queue) {
+		p_entry = queue_delete_next(p_queue);
+		queue_insert_prev(p_queue, p_entry);
+		if (dspflg) {
+			if (p_schedtsk == (TCB *) p_entry) {
+				p_schedtsk = (TCB *)(p_queue->p_next);
+			}
+		}
+	}
+}
+
+#endif /* TOPPERS_tskrot */
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºå¦ç
+ */
+#ifdef TOPPERS_tskterm
+
+void
+task_terminate(TCB *p_tcb)
+{
+	if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		make_non_runnable(p_tcb);
+	}
+	else if (TSTAT_WAITING(p_tcb->tstat)) {
+		wait_dequeue_wobj(p_tcb);
+		wait_dequeue_tmevtb(p_tcb);
+	}
+	if (p_tcb->p_lastmtx != NULL) {
+		(*mtxhook_release_all)(p_tcb);
+	}
+	make_dormant(p_tcb);
+	if (p_tcb->actque) {
+		p_tcb->actque = false;
+		make_active(p_tcb);
+	}
+}
+
+#endif /* TOPPERS_tskterm */
Index: asp3_wo_tecs/trunk/extension/subprio/kernel/task.h
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/kernel/task.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/kernel/task.h	(revision 302)
@@ -0,0 +1,691 @@
+/*
+ *  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: task.h 452 2015-08-15 02:36:39Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_TASK_H
+#define TOPPERS_TASK_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "time_event.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_TSKSTAT
+#define LOG_TSKSTAT(p_tcb)
+#endif /* LOG_TSKSTAT */
+
+/*
+ *  ã¿ã¹ã¯åªå
+åº¦ã®å
+é¨è¡¨ç¾ã»å¤é¨è¡¨ç¾å¤æãã¯ã­
+ */
+#define INT_PRIORITY(x)		((uint_t)((x) - TMIN_TPRI))
+#define EXT_TSKPRI(x)		((PRI)(x) + TMIN_TPRI)
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+ã®å
+é¨è¡¨ç¾
+ *
+ *  TCBä¸­ã®ã¿ã¹ã¯ç¶æ
+ã®ãã£ã¼ã«ãã§ã¯ï¼ã¿ã¹ã¯ã®ç¶æ
+ã¨ï¼ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+
+ *  ã®æã®å¾
+ã¡è¦å ãè¡¨ãï¼ãã ãï¼å®è¡ç¶æ
+ï¼RUNNINGï¼ã¨å®è¡å¯è½ç¶æ
+
+ *  ï¼READYï¼ã¯åºå¥ããï¼ä¸¡ç¶æ
+ããããã¦å®è¡ã§ããç¶æ
+ï¼RUNNABLEï¼ã¨ã
+ *  ã¦ç®¡çããï¼äºéå¾
+ã¡ç¶æ
+ã¯ï¼(TS_WAITING_??? | TS_SUSPENDED)ã§è¡¨ãï¼
+ *
+ *  ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ãå«ãï¼ã®æã¯ï¼TS_WAITING_???ã§å¾
+ã¡
+ *  è¦å ãè¡¨ãï¼å¾
+ã¡è¦å ï¼5ãããã§è¡¨ç¾ãããï¼ã®ä¸ä½2ãããã§ï¼åæã»
+ *  éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãã£ã¦ãããã©ãããè¡¨ãï¼åæã»
+ *  éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãããªããã®ã¯ä¸ä½2ãããã00ï¼å
+ *  æã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼
+ *  ã«ã¤ãªãããã®ã¯10ã¾ãã¯11ï¼ããä»¥å¤ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãããã®ã¯01
+ *  ã¨ããï¼
+ */
+#define TS_DORMANT		0x00U			/* ä¼æ­¢ç¶æ
+ */
+#define TS_RUNNABLE		0x01U			/* å®è¡ã§ããç¶æ
+ */
+#define TS_SUSPENDED	0x02U			/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+
+#define TS_WAITING_SLP	(0x01U << 2)	/* èµ·åºå¾
+ã¡ */
+#define TS_WAITING_DLY	(0x02U << 2)	/* æéçµéå¾
+ã¡ */
+#define TS_WAITING_RDTQ	(0x08U << 2)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TS_WAITING_RPDQ	(0x09U << 2)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TS_WAITING_SEM	(0x10U << 2)	/* ã»ããã©è³æºã®ç²å¾å¾
+ã¡ */
+#define TS_WAITING_FLG	(0x11U << 2)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TS_WAITING_SDTQ	(0x12U << 2)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TS_WAITING_SPDQ	(0x13U << 2)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TS_WAITING_MTX	(0x14U << 2)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ */
+#define TS_WAITING_MPF	(0x15U << 2)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TS_WAITING_MASK	(0x1fU << 2)	/* å¾
+ã¡ç¶æ
+ã®å¤å¥ç¨ãã¹ã¯ */
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+å¤å¥ãã¯ã­
+ *
+ *  TSTAT_DORMANTã¯ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ã§ãããã©ãããï¼TSTAT_RUNNABLEã¯
+ *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ãããã©ãããå¤å¥ããï¼TSTAT_WAITINGã¯å¾
+
+ *  ã¡ç¶æ
+ã¨äºéå¾
+ã¡ç¶æ
+ã®ããããã§ãããã©ãããï¼TSTAT_SUSPENDEDã¯
+ *  å¼·å¶å¾
+ã¡ç¶æ
+ã¨äºéå¾
+ã¡ç¶æ
+ã®ããããã§ãããã©ãããå¤å¥ããï¼
+ */
+#define TSTAT_DORMANT(tstat)	((tstat) == TS_DORMANT)
+#define TSTAT_RUNNABLE(tstat)	(((tstat) & TS_RUNNABLE) != 0U)
+#define TSTAT_WAITING(tstat)	(((tstat) & TS_WAITING_MASK) != 0U)
+#define TSTAT_SUSPENDED(tstat)	(((tstat) & TS_SUSPENDED) != 0U)
+
+/*
+ *  ã¿ã¹ã¯å¾
+ã¡è¦å å¤å¥ãã¯ã­
+ *
+ *  TSTAT_WAIT_SLPã¯ã¿ã¹ã¯ãèµ·åºå¾
+ã¡ã§ãããã©ãããï¼TSTAT_WAIT_MTXã¯
+ *  ã¿ã¹ã¯ããã¥ã¼ããã¯ã¹å¾
+ã¡ã§ãããã©ãããå¤å¥ããï¼
+ *
+ *  ã¾ãï¼TSTAT_WAIT_WOBJ ã¯ã¿ã¹ã¯ãåæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡
+ *  ã§ãããï¼è¨ãæããã¨ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªã
+ *  ãã¦ãããï¼ã©ãããï¼TSTAT_WAIT_WOBJCBã¯ã¿ã¹ã¯ãåæã»éä¿¡ãªãã¸ã§
+ *  ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ãã
+ *  ãã©ãããå¤å¥ããï¼
+ */
+#define TSTAT_WAIT_SLP(tstat)	(((tstat) & ~TS_SUSPENDED) == TS_WAITING_SLP)
+#define TSTAT_WAIT_MTX(tstat)	(((tstat) & ~TS_SUSPENDED) == TS_WAITING_MTX)
+
+#define TSTAT_WAIT_WOBJ(tstat)		(((tstat) & (0x18U << 2)) != 0U)
+#define TSTAT_WAIT_WOBJCB(tstat)	(((tstat) & (0x10U << 2)) != 0U)
+
+/*
+ *  å¾
+ã¡æ
+å ±ãã­ãã¯ï¼WINFOï¼ã®å®ç¾©
+ *
+ *  ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã®éã¯ï¼TCBããã³ãã®p_winfoã§æãããWINFOãæ¬¡ã®
+ *  ããã«è¨­å®ããªããã°ãªããªãï¼
+ *
+ *  (a) TCBã®ã¿ã¹ã¯ç¶æ
+ãå¾
+ã¡ç¶æ
+ï¼TS_WAITING_???ï¼ã«ããï¼
+ *
+ *  (b) ã¿ã¤ã ã¢ã¦ããç£è¦ããããã«ï¼ã¿ã¤ã ã¤ãã³ããã­ãã¯ãç»é²ããï¼
+ *  ç»é²ããã¿ã¤ã ã¤ãã³ããã­ãã¯ã¯ï¼å¾
+ã¡ã«å
+¥ããµã¼ãã¹ã³ã¼ã«å¦çé¢æ°
+ *  ã®ã­ã¼ã«ã«å¤æ°ã¨ãã¦ç¢ºä¿ãï¼ããã¸ã®ãã¤ã³ã¿ãWINFOã®p_tmevtbã«è¨
+ *  æ¶ããï¼ã¿ã¤ã ã¢ã¦ãã®ç£è¦ãå¿
+è¦ãªãå ´åï¼æ°¸ä¹
+å¾
+ã¡ã®å ´åï¼ã«ã¯ï¼
+ *  p_tmevtbãNULLã«ããï¼
+ *
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã®å ´åã«ã¯ï¼æ¨æºã®WINFOã«
+ *  p_wobjcbãã£ã¼ã«ããè¿½å ããæ§é ä½ï¼WINFO_WOBJï¼wait.hã§å®ç¾©ï¼ã«ï¼
+ *  å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã«ä¾å­ãã¦è¨æ¶ãããã¨ãå¿
+è¦ãªæ
+å ±
+ *  ã®ããã®ãã£ã¼ã«ããè¿½å ããæ§é ä½ï¼WINFO_???ï¼ãå®ç¾©ãï¼WINFOã®ä»£
+ *  ããã«ç¨ããï¼ã¾ãï¼ä»¥ä¸ã®(c)ã(e)ã®è¨­å®ãè¡ãå¿
+è¦ãããï¼åæã»é
+ *  ä¿¡ãªãã¸ã§ã¯ãã«é¢ä¿ããªãå¾
+ã¡ï¼èµ·åºå¾
+ã¡ï¼æéçµéå¾
+ã¡ï¼ã®å ´åã«ã¯ï¼
+ *  ãããã¯å¿
+è¦ãªãï¼
+ *
+ *  (c) TCBãå¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãï¼å¾
+
+ *  ã¡ã­ã¥ã¼ã«ã¤ãªãããã«ï¼task_queueãä½¿ãï¼
+ *
+ *  (d) å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã¸ã®ãã¤ã³ã¿ãï¼
+ *  WINFO_WOBJã®p_wobjcbã«è¨æ¶ããï¼
+ *
+ *  (e) å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã«ä¾å­ãã¦è¨æ¶ãããã¨ãå¿
+è¦ãª
+ *  æ
+å ±ãããå ´åã«ã¯ï¼WINFO_???å
+ã®ãã£ã¼ã«ãã«è¨æ¶ããï¼
+ *
+ *  å¾
+ã¡ç¶æ
+ãè§£é¤ããéã«ã¯ï¼å¾
+ã¡è§£é¤ããã¿ã¹ã¯ã«å¯¾ããè¿å¤ãWINFOã®
+ *  wercdã«è¨­å®ããï¼wercdãå¿
+è¦ãªã®ã¯å¾
+ã¡è§£é¤ä»¥éã§ããã®ã«å¯¾ãã¦ï¼
+ *  p_tmevtbã¯å¾
+ã¡è§£é¤å¾ã¯å¿
+è¦ãªãããï¼ã¡ã¢ãªç¯ç´ã®ããã«å
+±ç¨ä½ãä½¿ã£
+ *  ã¦ããï¼ãã®ããï¼wercdã¸ã¨ã©ã¼ã³ã¼ããè¨­å®ããã®ã¯ï¼ã¿ã¤ã ã¤ãã³ã
+ *  ãã­ãã¯ãç»é²è§£é¤ããå¾ã«ããªããã°ãªããªãï¼
+ */
+typedef union waiting_information {
+	ER		wercd;			/* å¾
+ã¡è§£é¤æã®ã¨ã©ã¼ã³ã¼ã */
+	TMEVTB	*p_tmevtb;		/* å¾
+ã¡ç¶æ
+ç¨ã®ã¿ã¤ã ã¤ãã³ããã­ãã¯ */
+} WINFO;
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ã®åã®åæ¹åç
+§
+ */
+typedef struct mutex_control_block MTXCB;
+
+/*
+ *  ã¿ã¹ã¯åæåãã­ãã¯
+ *
+ *  ã¿ã¹ã¯ã«é¢ããæ
+å ±ãï¼å¤ãå¤ãããªãããã«ROMã«ç½®ããé¨åï¼ã¿ã¹ã¯
+ *  åæåãã­ãã¯ï¼ã¨ï¼å¤ãå¤åããããã«RAMã«ç½®ããªããã°ãªããªãé¨
+ *  åï¼ã¿ã¹ã¯ç®¡çãã­ãã¯ï¼TCBï¼ã«åé¢ãï¼TCBå
+ã«å¯¾å¿ããã¿ã¹ã¯åæå
+ *  ãã­ãã¯ãæããã¤ã³ã¿ãå
+¥ããï¼ã¿ã¹ã¯åæåãã­ãã¯å
+ã«å¯¾å¿ãã
+ *  TCBãæããã¤ã³ã¿ãå
+¥ããæ¹æ³ã®æ¹ãï¼RAMã®ç¯ç´ã®è¦³ç¹ããã¯æã¾ãã
+ *  ãï¼å®è¡å¹çãæªããªãããã«æ¡ç¨ãã¦ããªãï¼ä»ã®ãªãã¸ã§ã¯ãã«ã¤ã
+ *  ã¦ãåæ§ã«æ±ãï¼
+ */
+typedef struct task_initialization_block {
+	ATR			tskatr;			/* ã¿ã¹ã¯å±æ§ */
+	intptr_t	exinf;			/* ã¿ã¹ã¯ã®æ¡å¼µæ
+å ± */
+	TASK		task;			/* ã¿ã¹ã¯ã®èµ·åçªå° */
+	uint_t		ipriority;		/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼ */
+
+#ifdef USE_TSKINICTXB
+	TSKINICTXB	tskinictxb;		/* ã¿ã¹ã¯åæåã³ã³ãã­ã¹ããã­ãã¯ */
+#else /* USE_TSKINICTXB */
+	size_t		stksz;			/* ã¹ã¿ãã¯é åã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
+	void		*stk;			/* ã¹ã¿ãã¯é åã®å
+é ­çªå° */
+#endif /* USE_TSKINICTXB */
+} TINIB;
+
+/*
+ *  ã¿ã¹ã¯ç®¡çãã­ãã¯ï¼TCBï¼
+ *
+ *  ASPã«ã¼ãã«ã§ã¯ï¼ã¿ã¹ã¯ã®èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ï¼TMAX_ACTCNTï¼
+ *  ã¨èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ï¼TMAX_WUPCNTï¼ã¯1ã«åºå®ããã¦ãã
+ *  ããï¼ã­ã¥ã¼ã¤ã³ã°ããã¦ãããã©ããã®çå½å¤ã§è¡¨ç¾ãããã¨ãã§ããï¼
+ *  ã¾ãï¼å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ã®æå¤§å¤ï¼TMAX_SUSCNTï¼ã1ã«åºå®ããã¦ã
+ *  ãã®ã§ï¼å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ï¼suscntï¼ã¯å¿
+è¦ãªãï¼
+ *
+ *  TCBã®ããã¤ãã®ãã£ã¼ã«ãã¯ï¼ç¹å®ã®ã¿ã¹ã¯ç¶æ
+ã§ã®ã¿æå¹ãªå¤ãä¿æãï¼
+ *  ããä»¥å¤ã®å ´åã¯å¤ãä¿è¨¼ãããªãï¼ãã£ã¦ï¼åç
+§ãã¦ã¯ãªããªãï¼ï¼å
+ *  ãã£ã¼ã«ããæå¹ãªå¤ãä¿æããæ¡ä»¶ã¯æ¬¡ã®éãï¼
+ *
+ *  ã»åæåå¾ã¯å¸¸ã«æå¹ï¼
+ *  		p_tinibï¼tstatï¼actque
+ *  ã»ä¼æ­¢ç¶æ
+ä»¥å¤ã§æå¹ï¼ä¼æ­¢ç¶æ
+ã§ã¯åæå¤ã«ãªã£ã¦ããï¼ï¼
+ *  		bpriorityï¼priorityï¼wupqueï¼rasterï¼enaterï¼p_lastmtx
+ *  ã»å¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ãå«ãï¼ã§æå¹ï¼
+ *  		p_winfo
+ *  ã»å®è¡ã§ããç¶æ
+ã¨åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã§æå¹ï¼
+ *  		task_queue
+ *  ã»å®è¡å¯è½ç¶æ
+ï¼å¾
+ã¡ç¶æ
+ï¼å¼·å¶å¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ã§æå¹ï¼
+ *  		tskctxb
+ */
+typedef struct task_control_block {
+	QUEUE			task_queue;		/* ã¿ã¹ã¯ã­ã¥ã¼ */
+	const TINIB		*p_tinib;		/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+
+#ifdef UINT8_MAX
+	uint8_t			tstat;			/* ã¿ã¹ã¯ç¶æ
+ï¼å
+é¨è¡¨ç¾ï¼*/
+	uint8_t			bpriority;		/* ãã¼ã¹åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+	uint8_t			priority;		/* ç¾å¨ã®åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+#else /* UINT8_MAX */
+	BIT_FIELD_UINT	tstat : 8;		/* ã¿ã¹ã¯ç¶æ
+ï¼å
+é¨è¡¨ç¾ï¼*/
+	BIT_FIELD_UINT	bpriority : 8;	/* ãã¼ã¹åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+	BIT_FIELD_UINT	priority : 8	/* ç¾å¨ã®åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/;
+#endif /* UINT8_MAX */
+	BIT_FIELD_BOOL	actque : 1;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã° */
+	BIT_FIELD_BOOL	wupque : 1;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã° */
+	BIT_FIELD_BOOL	raster : 1;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	BIT_FIELD_BOOL	enater : 1;		/* ã¿ã¹ã¯çµäºè¨±å¯ç¶æ
+ */
+	uint_t			subpri;			/* ãµãåªå
+åº¦ */
+
+	WINFO			*p_winfo;		/* å¾
+ã¡æ
+å ±ãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	MTXCB			*p_lastmtx;		/* æå¾ã«ã­ãã¯ãããã¥ã¼ããã¯ã¹ */
+	TSKCTXB			tskctxb;		/* ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ */
+} TCB;
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯
+ *
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯ï¼ï¼ãã­ã»ããµãã³ã³ãã­ã¹ããæã£ã¦ããã¿ã¹ã¯ï¼ã®
+ *  TCBãæããã¤ã³ã¿ï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ããªãå ´åã¯NULLã«ããï¼
+ *
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å¦çä¸­ã§ï¼èªã¿ã¹ã¯ï¼ãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºããã¿ã¹
+ *  ã¯ï¼ã«é¢ããæ
+å ±ãåç
+§ããå ´åã¯p_runtskãä½¿ãï¼p_runtskãæ¸ãæã
+ *  ãã®ã¯ï¼ãã£ã¹ãããã£ï¼ã¨åæåå¦çï¼ã®ã¿ã§ããï¼
+ */
+extern TCB	*p_runtsk;
+
+/*
+ *  å®è¡ãã¹ãã¿ã¹ã¯
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ã®TCBãæããã¤ã³ã¿ï¼å®è¡ã§ããã¿ã¹ã¯ããªãå ´åã¯
+ *  NULLã«ããï¼
+ *
+ *  p_runtskã¯ï¼éå¸¸ã¯p_schedtskã¨ä¸è´ãã¦ãããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ã
+ *  å®è¡ä¸­ã¯ï¼ä¸è´ãã¦ããã¨ã¯éããªãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªã
+ *  ç¶æ
+ã®éã¨ãã£ã¹ãããç¦æ­¢ç¶æ
+ã®éï¼ããªãã¡ï¼dspflgãfalseã§ããéï¼
+ *  ã¯ï¼p_schedtskãæ´æ°ããªãï¼
+ */
+extern TCB	*p_schedtsk;
+
+/*
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+
+ *
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ãããã¨ãç¤ºããã©ã°ï¼
+ */
+extern bool_t	enadsp;
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããå¯è½ç¶æ
+
+ *
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§ããï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ããï¼ãã£
+ *  ã¹ãããç¦æ­¢ç¶æ
+ã§ãªãï¼ãã¨ãç¤ºããã©ã°ï¼ãã£ã¹ãããä¿çç¶æ
+ã§ãª
+ *  ããã¨ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãå®è¡ä¸­ã§ï¼CPUã­ãã¯ç¶æ
+ã§ãªãï¼dspflgã
+ *  trueã§ãããã¨ã§å¤å¥ãããã¨ãã§ããï¼
+ */
+extern bool_t	dspflg;
+
+/*
+ *  æå®ããåªå
+åº¦ã«å¯¾å¿ããããããããä¸­ã§ã®ãããä½ç½®
+ */
+#ifndef PRIMAP_BIT
+#define	PRIMAP_BIT(pri)		(1U << (pri))
+#endif /* PRIMAP_BIT */
+
+/*
+ *  ãµãåªå
+åº¦ãç¨ãã¦ã¹ã±ã¸ã¥ã¼ã«ããåªå
+åº¦ï¼kernel_cfg.cï¼
+ *
+ *  åªå
+åº¦ã16æ®µéã§ãããã¨ãä»®å®ãã¦ããããï¼uint16_tåã¨ãã¦ããï¼
+ */
+extern const uint16_t	subprio_primap;
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã¯ï¼å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ãç®¡çããããã®ã­ã¥ã¼ã§ããï¼
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãç®¡çãã¦ããããï¼ã¬ãã£ï¼å®è¡å¯è½ï¼ã­ã¥ã¼ã¨ãã
+ *  åç§°ã¯æ­£ç¢ºã§ã¯ãªããï¼ã¬ãã£ã­ã¥ã¼ã¨ããåç§°ãå®çãã¦ããããï¼ã
+ *  ã®åç§°ã§å¼ã¶ãã¨ã«ããï¼
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã¯ï¼åªå
+åº¦ãã¨ã®ã¿ã¹ã¯ã­ã¥ã¼ã§æ§æããã¦ããï¼ã¿ã¹ã¯ã®
+ *  TCBã¯ï¼è©²å½ããåªå
+åº¦ã®ã­ã¥ã¼ã«ç»é²ãããï¼
+ */
+extern QUEUE	ready_queue[TNUM_TPRI];
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ãµã¼ãã®ããã®ãããããã
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã®ãµã¼ããå¹çããè¡ãããã«ï¼åªå
+åº¦ãã¨ã®ã¿ã¹ã¯ã­ã¥ã¼
+ *  ã«ã¿ã¹ã¯ãå
+¥ã£ã¦ãããã©ãããç¤ºããããããããç¨æãã¦ããï¼ãã
+ *  ãããããä½¿ããã¨ã§ï¼ã¡ã¢ãªã¢ã¯ã»ã¹ã®åæ°ãæ¸ãããã¨ãã§ãããï¼
+ *  ãããæä½å½ä»¤ãå
+
+å®ãã¦ããªããã­ã»ããµã§ï¼åªå
+åº¦ã®æ®µéæ°ãå°ãªã
+ *  å ´åã«ã¯ï¼ããããããæä½ã®ãªã¼ãã¼ãããã®ããã«ï¼éã«å¹çãè½ã¡
+ *  ãå¯è½æ§ãããï¼
+ *
+ *  åªå
+åº¦ã16æ®µéã§ãããã¨ãä»®å®ãã¦ããããï¼uint16_tåã¨ãã¦ããï¼
+ */
+extern uint16_t	ready_primap;
+
+/*
+ *  ã¿ã¹ã¯IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_tskid;
+
+/*
+ *  ã¿ã¹ã¯åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const TINIB	tinib_table[];
+
+/*
+ *  ã¿ã¹ã¯çæé åºãã¼ãã«ï¼kernel_cfg.cï¼
+ */
+extern const ID	torder_table[];
+
+/*
+ *  TCBã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern TCB	tcb_table[];
+
+/*
+ *  ã¿ã¹ã¯ã®æ°
+ */
+#define tnum_tsk	((uint_t)(tmax_tskid - TMIN_TSKID + 1))
+
+/*
+ *  ã¿ã¹ã¯IDããTCBãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_TSK(tskid)	((uint_t)((tskid) - TMIN_TSKID))
+#define get_tcb(tskid)		(&(tcb_table[INDEX_TSK(tskid)]))
+
+/*
+ *  TCBããã¿ã¹ã¯IDãåãåºãããã®ãã¯ã­
+ */
+#define	TSKID(p_tcb)	((ID)(((p_tcb) - tcb_table) + TMIN_TSKID))
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®åæå
+ */
+extern void	initialize_task(void);
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã®ãµã¼ã
+ *
+ *  ã¬ãã£ã­ã¥ã¼ä¸­ã®æé«åªå
+é ä½ã®ã¿ã¹ã¯ããµã¼ããï¼ãã®TCBã¸ã®ãã¤ã³ã¿
+ *  ãè¿ãï¼ã¬ãã£ã­ã¥ã¼ãç©ºã®å ´åã«ã¯ï¼ãã®é¢æ°ãå¼ã³åºãã¦ã¯ãªããªãï¼
+ */
+extern TCB	*search_schedtsk(void);
+
+/*
+ *  å®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ã«æ¿å
+¥ããï¼ã¬ãã£ã­ã¥ã¼ã«æ¿å
+¥
+ *  ããã¿ã¹ã¯ã®åªå
+åº¦ãï¼å®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã¯ï¼å®
+ *  è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ */
+extern void	make_runnable(TCB *p_tcb);
+
+/*
+ *  å®è¡ã§ããç¶æ
+ããä»ã®ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ããåé¤ããï¼p_tcbã§æå®ãã
+ *  ã¿ã¹ã¯ãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ãå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ã
+ *  ãï¼
+ */
+extern void	make_non_runnable(TCB *p_tcb);
+
+/*
+ *  ä¼æ­¢ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¶æ
+ãä¼æ­¢ç¶æ
+ã¨ããï¼ã¾ãï¼ã¿ã¹ã¯ã®èµ·å
+ *  æã«åæåãã¹ãå¤æ°ã®åæåã¨ï¼ã¿ã¹ã¯èµ·åã®ããã®ã³ã³ãã­ã¹ããè¨­
+ *  å®ããï¼
+ */
+extern void	make_dormant(TCB *p_tcb);
+
+/*
+ *  ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¶æ
+ãä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¨ããï¼
+ */
+extern void	make_active(TCB *p_tcb);
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+åº¦ã®å¤æ´
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®åªå
+åº¦ãnewpriï¼å
+é¨è¡¨ç¾ï¼ã«å¤æ´ããï¼ã¾ãï¼
+ *  å¿
+è¦ãªå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®åªå
+é ä½ã¯ï¼åªå
+åº¦ãåãã¿ã¹ã¯ï¼ãµãåªå
+åº¦
+ *  ãä½¿ãããç¶æ³ã§ã¯ï¼ãµãåªå
+åº¦ãåãã¿ã¹ã¯ï¼ã®ä¸­ã§ï¼mtxmodeãfalse
+ *  ã®æã¯æä½ï¼mtxmodeãtrueã®æã¯æé«ã¨ããï¼
+ */
+extern void	change_priority(TCB *p_tcb, uint_t newpri, bool_t mtxmode);
+
+/*
+ *  ã¿ã¹ã¯ã®ãµãåªå
+åº¦ã®å¤æ´
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ãµãåªå
+åº¦ãsubpriã«å¤æ´ããï¼ã¾ãï¼å¿
+è¦ãª
+ *  å ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®åªå
+é ä½ã¯ï¼ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ï¼ã¿ã¹
+ *  ã¯ã®ç¾å¨åªå
+åº¦ããµãåªå
+åº¦ãä½¿ç¨ããã¨è¨­å®ããã¦ããå ´åã«ã¯ï¼åã
+ *  åªå
+åº¦ã§åããµãåªå
+åº¦ã®ã¿ã¹ã¯ã®ä¸­ã§æä½ã¨ããï¼
+ */
+extern void change_subprio(TCB *p_tcb, uint_t subpri);
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ã®åè»¢
+ *
+ *  ã¬ãã£ã­ã¥ã¼ä¸­ã®ï¼p_queueã§æå®ãããã¿ã¹ã¯ã­ã¥ã¼ãåè»¢ãããï¼ã¾ãï¼
+ *  å¿
+è¦ãªå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ */
+extern void	rotate_ready_queue(QUEUE *p_queue);
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºå¦ç
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãçµäºãããå¦çãè¡ãï¼ã¿ã¹ã¯ã®èµ·åè¦æ±ã­ã¥ã¼
+ *  ã¤ã³ã°æ°ã0ã§ãªãå ´åã«ã¯ï¼ååº¦èµ·åããããã®å¦çãè¡ãï¼
+ */
+extern void	task_terminate(TCB *p_tcb);
+
+#endif /* TOPPERS_TASK_H */
Index: asp3_wo_tecs/trunk/extension/subprio/kernel/task.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/kernel/task.tf	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/kernel/task.tf	(revision 302)
@@ -0,0 +1,244 @@
+$
+$   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$
+
+$
+$  ENA_SPRã®ã¨ã©ã¼ãã§ãã¯
+$
+$spr_tskpri = {}$
+$FOREACH i SPR.ORDER_LIST$
+$	// (TMIN_TPRI <= tskpri && tskpri <= TMAX_TPRI)ã§ãªãå ´åï¼»NGKI3678ï¼½
+	$IF !(TMIN_TPRI <= SPR.TSKPRI[i] && SPR.TSKPRI[i] <= TMAX_TPRI)$
+		$ERROR SPR.TEXT_LINE[i]$E_PAR:$SPC$
+			$FORMAT(_("illegal %1% `%2%\' in %3%"),
+						"tskpri", SPR.TSKPRI[i], "ENA_SPR")$
+		$END$
+	$END$
+
+	$IF !LENGTH(FIND(spr_tskpri, SPR.TSKPRI[i]))$
+		$spr_tskpri = APPEND(spr_tskpri, SPR.TSKPRI[i])$
+	$ELSE$
+$		// SPR.TSKPRI[i]ããµãåªå
+åº¦ãä½¿ç¨ããåªå
+åº¦ã«è¨­å®æ¸ã¿ã®å ´å
+		$WARNING SPR.TEXT_LINE[i]$
+			$FORMAT(_("%1% `%2%\' in %3% is same with %4%"),
+						"tskpri", SPR.TSKPRI[i], "ENA_SPR",
+						AT(spr_tskpri, FIND(spr_tskpri, SPR.TSKPRI[i])))$
+		$END$
+	$END$
+$END$
+
+$
+$  ãµãåªå
+åº¦ãç¨ãã¦ã¹ã±ã¸ã¥ã¼ã«ããåªå
+åº¦
+$
+const uint16_t _kernel_subprio_primap =$SPC$
+$IF LENGTH(spr_tskpri)$
+	($JOINEACH tskpri spr_tskpri " | "$
+		PRIMAP_BIT(INT_PRIORITY($tskpri$))
+	$END$)
+$ELSE$
+	0U
+$END$;$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/extension/subprio/kernel/task_manage.c
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/kernel/task_manage.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/kernel/task_manage.c	(revision 302)
@@ -0,0 +1,425 @@
+/*
+ *  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: task_manage.c 470 2015-12-30 09:50:36Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "taskhook.h"
+#include "wait.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ACT_TSK_ENTER
+#define LOG_ACT_TSK_ENTER(tskid)
+#endif /* LOG_ACT_TSK_ENTER */
+
+#ifndef LOG_ACT_TSK_LEAVE
+#define LOG_ACT_TSK_LEAVE(ercd)
+#endif /* LOG_ACT_TSK_LEAVE */
+
+#ifndef LOG_CAN_ACT_ENTER
+#define LOG_CAN_ACT_ENTER(tskid)
+#endif /* LOG_CAN_ACT_ENTER */
+
+#ifndef LOG_CAN_ACT_LEAVE
+#define LOG_CAN_ACT_LEAVE(ercd)
+#endif /* LOG_CAN_ACT_LEAVE */
+
+#ifndef LOG_GET_TST_ENTER
+#define LOG_GET_TST_ENTER(tskid, p_tskstat)
+#endif /* LOG_GET_TST_ENTER */
+
+#ifndef LOG_GET_TST_LEAVE
+#define LOG_GET_TST_LEAVE(ercd, p_tskstat)
+#endif /* LOG_GET_TST_LEAVE */
+
+#ifndef LOG_CHG_PRI_ENTER
+#define LOG_CHG_PRI_ENTER(tskid, tskpri)
+#endif /* LOG_CHG_PRI_ENTER */
+
+#ifndef LOG_CHG_PRI_LEAVE
+#define LOG_CHG_PRI_LEAVE(ercd)
+#endif /* LOG_CHG_PRI_LEAVE */
+
+#ifndef LOG_GET_PRI_ENTER
+#define LOG_GET_PRI_ENTER(tskid, p_tskpri)
+#endif /* LOG_GET_PRI_ENTER */
+
+#ifndef LOG_GET_PRI_LEAVE
+#define LOG_GET_PRI_LEAVE(ercd, p_tskpri)
+#endif /* LOG_GET_PRI_LEAVE */
+
+#ifndef LOG_CHG_SPR_ENTER
+#define LOG_CHG_SPR_ENTER(tskid, subpri)
+#endif /* LOG_CHG_SPR_ENTER */
+
+#ifndef LOG_CHG_SPR_LEAVE
+#define LOG_CHG_SPR_LEAVE(ercd)
+#endif /* LOG_CHG_SPR_LEAVE */
+
+#ifndef LOG_GET_INF_ENTER
+#define LOG_GET_INF_ENTER(p_exinf)
+#endif /* LOG_GET_INF_ENTER */
+
+#ifndef LOG_GET_INF_LEAVE
+#define LOG_GET_INF_LEAVE(ercd, p_exinf)
+#endif /* LOG_GET_INF_LEAVE */
+
+/*
+ *  ã¿ã¹ã¯ã®èµ·åï¼»NGKI3529ï¼½
+ */
+#ifdef TOPPERS_act_tsk
+
+ER
+act_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_ACT_TSK_ENTER(tskid);
+	CHECK_UNL();								/*ï¼»NGKI1114ï¼½*/
+	if (tskid == TSK_SELF && !sense_context()) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1121ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1115ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		make_active(p_tcb);						/*ï¼»NGKI1118ï¼½*/
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	else if ((p_tcb->p_tinib->tskatr & TA_NOACTQUE) != 0U || p_tcb->actque) {
+		ercd = E_QOVR;			   				/*ï¼»NGKI3528ï¼½*/
+	}
+	else {
+		p_tcb->actque = true;					/*ï¼»NGKI3527ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ACT_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_act_tsk */
+
+/*
+ *  ã¿ã¹ã¯èµ·åè¦æ±ã®ã­ã£ã³ã»ã«ï¼»NGKI1138ï¼½
+ */
+#ifdef TOPPERS_can_act
+
+ER_UINT
+can_act(ID tskid)
+{
+	TCB		*p_tcb;
+	ER_UINT	ercd;
+
+	LOG_CAN_ACT_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1139ï¼½ï¼»NGKI1140ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1146ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1141ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	ercd = p_tcb->actque ? 1 : 0;				/*ï¼»NGKI1144ï¼½*/
+	p_tcb->actque = false;						/*ï¼»NGKI1144ï¼½*/
+	unlock_cpu();
+
+  error_exit:
+	LOG_CAN_ACT_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_can_act */
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+ã®åç
+§ï¼»NGKI3613ï¼½
+ */
+#ifdef TOPPERS_get_tst
+
+ER
+get_tst(ID tskid, STAT *p_tskstat)
+{
+	TCB		*p_tcb;
+	uint_t	tstat;
+	ER		ercd;
+
+	LOG_GET_TST_ENTER(tskid, p_tskstat);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3614ï¼½ï¼»NGKI3615ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI3621ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI3616ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	tstat = p_tcb->tstat;
+	if (TSTAT_DORMANT(tstat)) {					/*ï¼»NGKI3620ï¼½*/
+		*p_tskstat = TTS_DMT;
+	}
+	else if (TSTAT_SUSPENDED(tstat)) {
+		if (TSTAT_WAITING(tstat)) {
+			*p_tskstat = TTS_WAS;
+		}
+		else {
+			*p_tskstat = TTS_SUS;
+		}
+	}
+	else if (TSTAT_WAITING(tstat)) {
+		*p_tskstat = TTS_WAI;
+	}
+	else if (p_tcb == p_runtsk) {
+		*p_tskstat = TTS_RUN;
+	}
+	else {
+		*p_tskstat = TTS_RDY;
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_TST_LEAVE(ercd, p_tskstat);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_tst */
+
+/*
+ *  ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ã®å¤æ´ï¼»NGKI1183ï¼½
+ */
+#ifdef TOPPERS_chg_pri
+
+ER
+chg_pri(ID tskid, PRI tskpri)
+{
+	TCB		*p_tcb;
+	uint_t	newbpri;
+	ER		ercd;
+
+	LOG_CHG_PRI_ENTER(tskid, tskpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1184ï¼½ï¼»NGKI1185ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1198ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1187ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+	if (tskpri == TPRI_INI) {
+		newbpri = p_tcb->p_tinib->ipriority;	/*ï¼»NGKI1199ï¼½*/
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));			/*ï¼»NGKI1188ï¼½*/
+		newbpri = INT_PRIORITY(tskpri);
+	}
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1191ï¼½*/
+	}
+	else if ((p_tcb->p_lastmtx != NULL || TSTAT_WAIT_MTX(p_tcb->tstat))
+						&& !((*mtxhook_check_ceilpri)(p_tcb, newbpri))) {
+		ercd = E_ILUSE;							/*ï¼»NGKI1201ï¼½*/
+	}
+	else {
+		p_tcb->bpriority = newbpri;				/*ï¼»NGKI1192ï¼½*/
+		if (p_tcb->p_lastmtx == NULL || !((*mtxhook_scan_ceilmtx)(p_tcb))) {
+			change_priority(p_tcb, newbpri, false);		/*ï¼»NGKI1193ï¼½*/
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}									/*ï¼»NGKI1197ï¼½*/
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_CHG_PRI_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_chg_pri */
+
+/*
+ *  ã¿ã¹ã¯åªå
+åº¦ã®åç
+§ï¼»NGKI1202ï¼½
+ */
+#ifdef TOPPERS_get_pri
+
+ER
+get_pri(ID tskid, PRI *p_tskpri)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_GET_PRI_ENTER(tskid, p_tskpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1203ï¼½ï¼»NGKI1204ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1211ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1205ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1209ï¼½*/
+	}
+	else {
+		*p_tskpri = EXT_TSKPRI(p_tcb->priority);	/*ï¼»NGKI1210ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_PRI_LEAVE(ercd, p_tskpri);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_pri */
+
+/*
+ *  ã¿ã¹ã¯ã®ãµãåªå
+åº¦ã®å¤æ´ï¼»NGK3665ï¼½
+ */
+#ifdef TOPPERS_chg_spr
+
+ER
+chg_spr(ID tskid, uint_t subpri)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_CHG_SPR_ENTER(tskid, subpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3666ï¼½ï¼»NGKI3667ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI3674ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI3669ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	change_subprio(p_tcb, subpri);
+	if (p_runtsk != p_schedtsk) {
+		dispatch();
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_CHG_SPR_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_chg_spr */
+
+/*
+ *  èªã¿ã¹ã¯ã®æ¡å¼µæ
+å ±ã®åç
+§ï¼»NGKI1212ï¼½
+ */
+#ifdef TOPPERS_get_inf
+
+ER
+get_inf(intptr_t *p_exinf)
+{
+	ER		ercd;
+
+	LOG_GET_INF_ENTER(p_exinf);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1213ï¼½ï¼»NGKI1214ï¼½*/
+
+	lock_cpu();
+	*p_exinf = p_runtsk->p_tinib->exinf;		/*ï¼»NGKI1216ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_INF_LEAVE(ercd, p_exinf);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_inf */
Index: asp3_wo_tecs/trunk/extension/subprio/kernel/task_refer.c
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/kernel/task_refer.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/kernel/task_refer.c	(revision 302)
@@ -0,0 +1,252 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: task_refer.c 258 2014-10-04 19:37:38Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ã®ç¶æ
+åç
+§æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "semaphore.h"
+#include "eventflag.h"
+#include "dataqueue.h"
+#include "pridataq.h"
+#include "mutex.h"
+#include "mempfix.h"
+#include "time_event.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_REF_TSK_ENTER
+#define LOG_REF_TSK_ENTER(tskid, pk_rtsk)
+#endif /* LOG_REF_TSK_ENTER */
+
+#ifndef LOG_REF_TSK_LEAVE
+#define LOG_REF_TSK_LEAVE(ercd, pk_rtsk)
+#endif /* LOG_REF_TSK_LEAVE */
+
+/*
+ *  ã¿ã¹ã¯ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_tsk
+
+ER
+ref_tsk(ID tskid, T_RTSK *pk_rtsk)
+{
+	TCB		*p_tcb;
+	uint_t	tstat;
+	ER		ercd;
+
+	LOG_REF_TSK_ENTER(tskid, pk_rtsk);
+	CHECK_TSKCTX_UNL();
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	tstat = p_tcb->tstat;
+	if (TSTAT_DORMANT(tstat)) {
+		/*
+ 		 *  å¯¾è±¡ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ã®å ´å
+		 */
+		pk_rtsk->tskstat = TTS_DMT;
+	}
+	else {
+		/*
+ 		 *  ã¿ã¹ã¯ç¶æ
+ã®ååºã
+		 */
+		if (TSTAT_SUSPENDED(tstat)) {
+			if (TSTAT_WAITING(tstat)) {
+				pk_rtsk->tskstat = TTS_WAS;
+			}
+			else {
+				pk_rtsk->tskstat = TTS_SUS;
+			}
+		}
+		else if (TSTAT_WAITING(tstat)) {
+			pk_rtsk->tskstat = TTS_WAI;
+		}
+		else if (p_tcb == p_runtsk) {
+			pk_rtsk->tskstat = TTS_RUN;
+		}
+		else {
+			pk_rtsk->tskstat = TTS_RDY;
+		}
+
+		/*
+ 		 *  ç¾å¨åªå
+åº¦ã¨ãã¼ã¹åªå
+åº¦ã®ååºã
+		 */
+		pk_rtsk->tskpri = EXT_TSKPRI(p_tcb->priority);
+		pk_rtsk->tskbpri = EXT_TSKPRI(p_tcb->bpriority);
+
+		if (TSTAT_WAITING(tstat)) {
+			/*
+	 		 *  å¾
+ã¡è¦å ã¨å¾
+ã¡å¯¾è±¡ã®ãªãã¸ã§ã¯ãã®IDã®ååºã
+			 */
+			switch (tstat) {
+			case TS_WAITING_SLP:
+				pk_rtsk->tskwait = TTW_SLP;
+				break;
+			case TS_WAITING_DLY:
+				pk_rtsk->tskwait = TTW_DLY;
+				break;
+			case TS_WAITING_SEM:
+				pk_rtsk->tskwait = TTW_SEM;
+				pk_rtsk->wobjid = SEMID(((WINFO_SEM *)(p_tcb->p_winfo))
+																->p_semcb);
+				break;
+			case TS_WAITING_FLG:
+				pk_rtsk->tskwait = TTW_FLG;
+				pk_rtsk->wobjid = FLGID(((WINFO_FLG *)(p_tcb->p_winfo))
+																->p_flgcb);
+				break;
+			case TS_WAITING_SDTQ:
+				pk_rtsk->tskwait = TTW_SDTQ;
+				pk_rtsk->wobjid = DTQID(((WINFO_SDTQ *)(p_tcb->p_winfo))
+																->p_dtqcb);
+				break;
+			case TS_WAITING_RDTQ:
+				pk_rtsk->tskwait = TTW_RDTQ;
+				pk_rtsk->wobjid = DTQID(((WINFO_RDTQ *)(p_tcb->p_winfo))
+																->p_dtqcb);
+				break;
+			case TS_WAITING_SPDQ:
+				pk_rtsk->tskwait = TTW_SPDQ;
+				pk_rtsk->wobjid = PDQID(((WINFO_SPDQ *)(p_tcb->p_winfo))
+																->p_pdqcb);
+				break;
+			case TS_WAITING_RPDQ:
+				pk_rtsk->tskwait = TTW_RPDQ;
+				pk_rtsk->wobjid = PDQID(((WINFO_RPDQ *)(p_tcb->p_winfo))
+																->p_pdqcb);
+				break;
+			case TS_WAITING_MTX:
+				pk_rtsk->tskwait = TTW_MTX;
+				pk_rtsk->wobjid = MTXID(((WINFO_MTX *)(p_tcb->p_winfo))
+																->p_mtxcb);
+				break;
+			case TS_WAITING_MPF:
+				pk_rtsk->tskwait = TTW_MPF;
+				pk_rtsk->wobjid = MPFID(((WINFO_MPF *)(p_tcb->p_winfo))
+																->p_mpfcb);
+				break;
+			}
+
+			/*
+	 		 *  ã¿ã¤ã ã¢ã¦ãããã¾ã§ã®æéã®ååºã
+			 */
+			if (p_tcb->p_winfo->p_tmevtb != NULL) {
+				pk_rtsk->lefttmo
+						= (TMO) tmevt_lefttim(p_tcb->p_winfo->p_tmevtb);
+			}
+			else {
+				pk_rtsk->lefttmo = TMO_FEVR;
+			}
+		}
+
+		/*
+ 		 *  èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®ååºã
+		 */
+		pk_rtsk->wupcnt = p_tcb->wupque ? 1U : 0U;
+
+		/*
+		 *  ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ã®ååºã
+		 */
+		pk_rtsk->raster = p_tcb->raster;
+
+		/*
+		 *  ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã®ååºã
+		 */
+		pk_rtsk->dister = !(p_tcb->enater);
+	}
+
+	/*
+	 *  ãµãåªå
+åº¦ã®ååºã
+	 */
+	pk_rtsk->subpri = p_tcb->subpri;
+
+	/*
+	 *  èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®ååºã
+	 */
+	pk_rtsk->actcnt = p_tcb->actque ? 1U : 0U;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_TSK_LEAVE(ercd, pk_rtsk);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_tsk */
Index: asp3_wo_tecs/trunk/extension/subprio/test/test_subprio1.c
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/test/test_subprio1.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/test/test_subprio1.c	(revision 302)
@@ -0,0 +1,450 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: test_subprio1.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ãµãåªå
+åº¦æ©è½ã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  ãµãåªå
+åº¦ãç¨ããã¹ã±ã¸ã¥ã¼ãªã³ã°ã«é¢ãã¦ç¶²ç¾
+çã«ãã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ãµãåªå
+åº¦ã®åæå
+ *		(A-1) ã¿ã¹ã¯ã®çææã«UINT_MAXã«åæåããããã¨ï¼»NGKI3681ï¼½
+ *		(A-2) ã¿ã¹ã¯ã®èµ·åæã«ã¯å¤æ´ãããªããã¨
+ *	(B) ãµãåªå
+åº¦ãç¨ããåªå
+é ä½ã®æ±ºå®
+ *		(B-1) ãµãåªå
+åº¦ãé«ãã¿ã¹ã¯ãé«ãåªå
+é ä½ãæã¤ãã¨ï¼»NGKI0560ï¼½
+ *		(B-2) ãµãåªå
+åº¦ãåä¸ã®ã¿ã¹ã¯ã®éã§ã¯FCFSã«ãªããã¨ï¼»NGKI0561ï¼½
+ *	(C) chg_sprã«ãããµãåªå
+åº¦ã®å¤æ´ï¼»NGKI3672ï¼½
+ *		(C-1) å®è¡ç¶æ
+ã®ã¿ã¹ã¯ã«å¯¾ããchg_sprï¼ã¿ã¹ã¯åæããªãï¼
+ *		(C-2) å®è¡ç¶æ
+ã®ã¿ã¹ã¯ã«å¯¾ããchg_sprï¼ã¿ã¹ã¯åæãããï¼
+ *		(C-3) å®è¡å¯è½ç¶æ
+ã®ã¿ã¹ã¯ã«å¯¾ããchg_sprï¼ã¿ã¹ã¯åæããªãï¼
+ *		(C-4) å®è¡å¯è½ç¶æ
+ã®ã¿ã¹ã¯ã«å¯¾ããchg_sprï¼ã¿ã¹ã¯åæãããï¼
+ *		(C-5) ä¼æ­¢ç¶æ
+ã®ã¿ã¹ã¯ã«å¯¾ããchg_spr
+ *		(C-6) åããµãåªå
+åº¦ã®ã¿ã¹ã¯ã®ä¸­ã§æä½åªå
+é ä½ã«ãªããã¨ï¼»NGKI3673ï¼½
+ *	(D) ãµãåªå
+åº¦ã®åç
+§
+ *		(D-1) ref_tskã«ããï¼ãµãåªå
+åº¦ãåç
+§ã§ãããã¨ï¼»NGKINGKI3662ï¼½
+ *	(E) chg_priã«ããåªå
+é ä½ã®å¤æ´
+ *		(E-1) åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããªãæ
+ *		(E-2) åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããæ â¦ å®æ½ããªã
+ *			â»ï¼»NGKI3682ï¼½ã«ããï¼ãµãåªå
+åº¦æ©è½ã¨çµ¡ããã¨ããªã
+ *	(F) ãã¥ã¼ããã¯ã¹ã«ããç¾å¨åªå
+åº¦ã®å¤æ´
+ *		(F-1) ãµã¼ãã¹ã³ã¼ã«ã®åå¾ã¨ãå®è¡ã§ããç¶æ
+ã®æ
+ *		(F-2) ãµã¼ãã¹ã³ã¼ã«ã«ããå®è¡ã§ããç¶æ
+ã«ãªã£ãæ â¦ å®æ½ããªã
+ *			â»ï¼»NGKI3682ï¼½ã«ããï¼ãµãåªå
+åº¦æ©è½ã¨çµ¡ããã¨ããªã
+ *	(G) ãµãåªå
+åº¦ãç¨ããï¼ç¨ããªãåªå
+åº¦ãå¯¾è±¡ã¨ããrot_rdq
+ *		(G-1) rot_rdqãE_ILUSEã¨ã©ã¼ã«ãªããã¨ï¼»NGKI3663ï¼½
+ *		(G-2) ãµãåªå
+åº¦ãç¨ããªãåªå
+åº¦ãå¯¾è±¡ã«ããæ
+ *	(H) ãµãåªå
+åº¦ãç¨ããåªå
+åº¦ãENA_SPRã«ããè¨­å®ã§ãããã¨ï¼»NGKI3675ï¼½
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: é«åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK4: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK5: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	ä¸­åªå
+åº¦ãï¼ãµãåªå
+åº¦ãä½¿ã£ã¦åªå
+é ä½ãæ±ºããããã«è¨­å®
+ *	MTX1:  ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯ä¸­åªå
+åº¦ï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼é«ï¼==
+ *	1:	act_tsk(TASK2)
+ *		ref_tsk(TASK2, &rtsk)						... (A-1)(D-1)
+ *		assert(rtsk.subpri == UINT_MAX)
+ *		act_tsk(TASK3)
+ *		act_tsk(TASK4)
+ *		act_tsk(TASK5)
+ *		slp_tsk()
+ *	== TASK2-1ï¼åªå
+åº¦ï¼ä¸­ï¼1åãï¼==
+ *	2:	rot_rdq(MID_PRIORITY) -> E_ILUSE			... (G-1)
+ *		rot_rdq(LOW_PRIORITY)						... (G-2)
+ *		chg_pri(TSK_SELF, TPRI_INI)
+ *	== TASK3-1ï¼åªå
+åº¦ï¼ä¸­ï¼1åãï¼==				... (B-2)
+ *	3:	chg_pri(TSK_SELF, TPRI_INI)					... (E-1)
+ *	== TASK4-1ï¼åªå
+åº¦ï¼ä¸­ï¼1åãï¼==
+ *	4:	chg_pri(TSK_SELF, TPRI_INI)
+ *	== TASK5ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	5:	chg_pri(TSK_SELF, TPRI_INI)
+ *	== TASK2-1ï¼ç¶ãï¼==
+ *	6:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	7:	chg_spr(TASK2, 10)
+ *		ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.subpri == 10)
+ *		chg_spr(TASK3, 5)
+ *		chg_spr(TASK4, 5)							... (C-6)
+ *		slp_tsk()
+ *	== TASK3-1ï¼ç¶ãï¼==							... (B-1)
+ *	8:	ext_tsk()
+ *	== TASK4-1ï¼ç¶ãï¼==
+ *	9:	chg_spr(TSK_SELF, 5)						... (C-1)
+ *	10:	chg_spr(TSK_SELF, 10)						... (C-2)
+ *	== TASK2-1ï¼ç¶ãï¼==
+ *	11:	chg_spr(TASK4, 10)							... (C-3)
+ *	12:	chg_spr(TASK4, 5)							... (C-4)
+ *	== TASK4-1ï¼ç¶ãï¼==
+ *	13:	ext_tsk()
+ *	== TASK2-1ï¼ç¶ãï¼==
+ *	14:	ext_tsk()
+ *	== TASK5ï¼ç¶ãï¼==
+ *	15:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	16:	act_tsk(TASK4)
+ *		chg_spr(TASK3, 10)							... (C-5)
+ *		act_tsk(TASK3)
+ *		ref_tsk(TASK3, &rtsk)
+ *		assert(rtsk.subpri == 10)
+ *		act_tsk(TASK2)
+ *		ref_tsk(TASK2, &rtsk)						... (A-2)
+ *		assert(rtsk.subpri == 10)
+ *		slp_tsk()
+ *	== TASK4-2ï¼2åãï¼==
+ *	17:	ext_tsk()
+ *	== TASK3-2ï¼2åãï¼==
+ *	18:	loc_mtx(MTX1)
+ *		unl_mtx(MTX1)								... (F-1)
+ *		ext_tsk()
+ *	== TASK2-2ï¼2åãï¼==
+ *	19:	ext_tsk()
+ *	== TASK5ï¼ç¶ãï¼==
+ *	20:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	21:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_subprio1.h"
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RTSK	rtsk;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.subpri == UINT_MAX);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(7);
+	ercd = chg_spr(TASK2, 10);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.subpri == 10);
+
+	ercd = chg_spr(TASK3, 5);
+	check_ercd(ercd, E_OK);
+
+	ercd = chg_spr(TASK4, 5);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(16);
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	ercd = chg_spr(TASK3, 10);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_tsk(TASK3, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.subpri == 10);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.subpri == 10);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_finish(21);
+	check_point(0);
+}
+
+static uint_t	task2_count = 0;
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++task2_count) {
+	case 1:
+		check_point(2);
+		ercd = rot_rdq(MID_PRIORITY);
+		check_ercd(ercd, E_ILUSE);
+
+		ercd = rot_rdq(LOW_PRIORITY);
+		check_ercd(ercd, E_OK);
+
+		ercd = chg_pri(TSK_SELF, TPRI_INI);
+		check_ercd(ercd, E_OK);
+
+		check_point(6);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(11);
+		ercd = chg_spr(TASK4, 10);
+		check_ercd(ercd, E_OK);
+
+		check_point(12);
+		ercd = chg_spr(TASK4, 5);
+		check_ercd(ercd, E_OK);
+
+		check_point(14);
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 2:
+		check_point(19);
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	task3_count = 0;
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++task3_count) {
+	case 1:
+		check_point(3);
+		ercd = chg_pri(TSK_SELF, TPRI_INI);
+		check_ercd(ercd, E_OK);
+
+		check_point(8);
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 2:
+		check_point(18);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		ercd = unl_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	task4_count = 0;
+
+void
+task4(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++task4_count) {
+	case 1:
+		check_point(4);
+		ercd = chg_pri(TSK_SELF, TPRI_INI);
+		check_ercd(ercd, E_OK);
+
+		check_point(9);
+		ercd = chg_spr(TSK_SELF, 5);
+		check_ercd(ercd, E_OK);
+
+		check_point(10);
+		ercd = chg_spr(TSK_SELF, 10);
+		check_ercd(ercd, E_OK);
+
+		check_point(13);
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 2:
+		check_point(17);
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task5(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(5);
+	ercd = chg_pri(TSK_SELF, TPRI_INI);
+	check_ercd(ercd, E_OK);
+
+	check_point(15);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(20);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/extension/subprio/test/test_subprio1.cfg
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/test/test_subprio1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/test/test_subprio1.cfg	(revision 302)
@@ -0,0 +1,20 @@
+/*
+ *		ãµãåªå
+åº¦æ©è½ã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: test_subprio1.cfg 260 2014-10-05 02:33:43Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_subprio1.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK4, { TA_NULL, 4, task4, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK5, { TA_NULL, 5, task5, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_MTX(MTX1, { TA_CEILING, HIGH_PRIORITY });
+ENA_SPR(MID_PRIORITY);
Index: asp3_wo_tecs/trunk/extension/subprio/test/test_subprio1.h
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/test/test_subprio1.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/test/test_subprio1.h	(revision 302)
@@ -0,0 +1,94 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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_subprio1.h 260 2014-10-05 02:33:43Z ertl-hiro $
+ */
+
+/* 
+ *		ãµãåªå
+åº¦æ©è½ã®ãã¹ã(1)
+ */
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åªå
+åº¦ã®å®ç¾©
+ */
+#define HIGH_PRIORITY	4		/* é«åªå
+åº¦ */
+#define MID_PRIORITY	9		/* ä¸­åªå
+åº¦ */
+#define LOW_PRIORITY	14		/* ä½åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#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	task4(intptr_t exinf);
+extern void	task5(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/extension/subprio/test/test_subprio2.c
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/test/test_subprio2.c	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/test/test_subprio2.c	(revision 302)
@@ -0,0 +1,276 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: test_subprio2.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ãµãåªå
+åº¦æ©è½ã®ãã¹ã(2)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  ãµãåªå
+åº¦ãç¨ããåªå
+åº¦ã2ã¤ããå ´åããã¹ãããï¼ã¾ãï¼chg_sprã
+ *  ã¨ã©ã¼ã«æãã±ã¼ã¹ããã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ãµãåªå
+åº¦ãç¨ããåªå
+åº¦ãENA_SPRã«ããè¤æ°è¨­å®ã§ãããã¨
+ *	(B) chg_sprãã¨ã©ã¼ã«ãªãå ´å
+ *		(B-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãï¼»NGKI3666ï¼½
+ *		(B-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºãï¼»NGKI3667ï¼½
+ *		(B-3) ä¸æ­£IDçªå·ï¼»NGKI3669ï¼½
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: é«åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK4: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	TASK5: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	ä¸­åªå
+åº¦ã¨ä½åªå
+åº¦ãï¼ãµãåªå
+åº¦ãä½¿ã£ã¦åªå
+é ä½ãæ±ºããããã«è¨­å®
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼é«ï¼==
+ *	1:	chg_spr(TASK2, 10)
+ *		chg_spr(TASK3, 5)
+ *		chg_spr(TASK4, 10)
+ *		chg_spr(TASK5, 5)
+ *		act_tsk(TASK2)
+ *		act_tsk(TASK3)
+ *		act_tsk(TASK4)
+ *		act_tsk(TASK5)
+ *		slp_tsk()
+ *	== TASK3ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	2:	ext_tsk()
+ *	== TASK2ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	3:	ext_tsk()
+ *	== TASK5ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	4:	ext_tsk()
+ *	== TASK4ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	5:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	6:	chg_spr(-1, 10) -> E_ID						... (B-3)
+ *		chg_spr(TNUM_TSKID + 1, 10) -> E_ID			... (B-3)
+ *		loc_cpu()
+ *		chg_spr(TASK2, 10) -> E_CTX					... (B-2)
+ *		unl_cpu()
+ *		sta_alm(ALM1, 10000U)
+ *		slp_tsk()
+ *	== TASK4ï¼ç¶ãï¼==
+ *	7:	ext_tsk()
+ *	== ALM1 ==
+ *	8:	chg_spr(TASK2, 10) -> E_CTX					... (B-1)
+ *		wup_tsk(TASK1)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	9:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_subprio2.h"
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(8);
+	ercd = chg_spr(TASK2, 10);
+	check_ercd(ercd, E_CTX);
+
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	ercd = chg_spr(TASK2, 10);
+	check_ercd(ercd, E_OK);
+
+	ercd = chg_spr(TASK3, 5);
+	check_ercd(ercd, E_OK);
+
+	ercd = chg_spr(TASK4, 10);
+	check_ercd(ercd, E_OK);
+
+	ercd = chg_spr(TASK5, 5);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(6);
+	ercd = chg_spr(-1, 10);
+	check_ercd(ercd, E_ID);
+
+	ercd = chg_spr(TNUM_TSKID + 1, 10);
+	check_ercd(ercd, E_ID);
+
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	ercd = chg_spr(TASK2, 10);
+	check_ercd(ercd, E_CTX);
+
+	ercd = unl_cpu();
+	check_ercd(ercd, E_OK);
+
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_finish(9);
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(3);
+	ercd = ext_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(2);
+	ercd = ext_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task4(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(5);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(7);
+	ercd = ext_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task5(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(4);
+	ercd = ext_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/extension/subprio/test/test_subprio2.cfg
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/test/test_subprio2.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/test/test_subprio2.cfg	(revision 302)
@@ -0,0 +1,21 @@
+/*
+ *		ãµãåªå
+åº¦æ©è½ã®ãã¹ã(2)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: test_subprio2.cfg 327 2015-06-21 06:42:01Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_subprio2.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK4, { TA_NULL, 4, task4, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK5, { TA_NULL, 5, task5, LOW_PRIORITY, STACK_SIZE, NULL });
+ENA_SPR(MID_PRIORITY);
+ENA_SPR(LOW_PRIORITY);
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
Index: asp3_wo_tecs/trunk/extension/subprio/test/test_subprio2.h
===================================================================
--- asp3_wo_tecs/trunk/extension/subprio/test/test_subprio2.h	(revision 302)
+++ asp3_wo_tecs/trunk/extension/subprio/test/test_subprio2.h	(revision 302)
@@ -0,0 +1,95 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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_subprio2.h 258 2014-10-04 19:37:38Z ertl-hiro $
+ */
+
+/* 
+ *		ãµãåªå
+åº¦æ©è½ã®ãã¹ã(2)
+ */
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åªå
+åº¦ã®å®ç¾©
+ */
+#define HIGH_PRIORITY	4		/* é«åªå
+åº¦ */
+#define MID_PRIORITY	9		/* ä¸­åªå
+åº¦ */
+#define LOW_PRIORITY	14		/* ä½åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#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	task4(intptr_t exinf);
+extern void	task5(intptr_t exinf);
+extern void	alarm1_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/include/itron.h
===================================================================
--- asp3_wo_tecs/trunk/include/itron.h	(revision 302)
+++ asp3_wo_tecs/trunk/include/itron.h	(revision 302)
@@ -0,0 +1,164 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  Copyright (C) 2004-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: itron.h 376 2015-07-30 22:56:26Z ertl-hiro $
+ */
+
+/*
+ *		ITRONä»æ§å
+±éè¦å®ã®ãã¼ã¿åã»å®æ°ã»ãã¯ã­
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼ITRONä»æ§å
+±éè¦å®ã®ãã¼ã¿åã»å®æ°ã»ãã¯ã­ã®ä¸­
+ *  ã§ï¼TOPPERSå
+±éããããã¡ã¤ã«ã«å«ã¾ããªããã®ã®å®ç¾©ãå«ãï¼ITRONä»
+ *  æ§ã¨ã®äºææ§ãå¿
+è¦ã¨ããã¢ããªã±ã¼ã·ã§ã³ãã¤ã³ã¯ã«ã¼ããããã¨ãæ³
+ *  å®ãã¦ããï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ããï¼ããã«ããï¼ãã¯ã­å®ç¾©ä»¥å¤ã
+ *  é¤ãããã«ãªã£ã¦ããï¼
+ */
+
+#ifndef TOPPERS_ITRON_H
+#define TOPPERS_ITRON_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *  TOPPERSå
+±éããããã¡ã¤ã«
+ */
+#include <t_stddef.h>
+
+/*
+ *  ITRONä»æ§å
+±éãã¼ã¿å
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+#ifdef INT8_MAX
+typedef	int8_t			B;			/* ç¬¦å·ä»ã8ãããæ´æ° */
+#endif /* INT8_MAX */
+
+#ifdef UINT8_MAX
+typedef	uint8_t			UB;			/* ç¬¦å·ç¡ã8ãããæ´æ° */
+typedef	uint8_t			VB;			/* åãå®ã¾ããªã8ãããã®å¤ */
+#endif /* UINT8_MAX */
+
+typedef	int16_t			H;			/* ç¬¦å·ä»ã16ãããæ´æ° */
+typedef	uint16_t		UH;			/* ç¬¦å·ç¡ã16ãããæ´æ° */
+typedef	uint16_t		VH;			/* åãå®ã¾ããªã16ãããã®å¤ */
+
+typedef	int32_t			W;			/* ç¬¦å·ä»ã32ãããæ´æ° */
+typedef	uint32_t		UW;			/* ç¬¦å·ç¡ã32ãããæ´æ° */
+typedef	uint32_t		VW;			/* åãå®ã¾ããªã32ãããã®å¤ */
+
+#ifdef INT64_MAX
+typedef	int64_t			D;			/* ç¬¦å·ä»ã64ãããæ´æ° */
+#endif /* INT64_MAX */
+
+#ifdef UINT64_MAX
+typedef	uint64_t		UD;			/* ç¬¦å·ç¡ã64ãããæ´æ° */
+typedef	uint64_t		VD;			/* åãå®ã¾ããªã64ãããã®å¤ */
+#endif /* UINT64_MAX */
+
+typedef	void			*VP;		/* åãå®ã¾ããªããã®ã¸ã®ãã¤ã³ã¿ */
+
+typedef int_t			INT;		/* èªç¶ãªãµã¤ãºã®ç¬¦å·ä»ãæ´æ° */
+typedef uint_t			UINT;		/* èªç¶ãªãµã¤ãºã®ç¬¦å·ç¡ãæ´æ° */
+
+typedef bool_t			BOOL;		/* çå½å¤ */
+
+typedef size_t			SIZE;		/* ã¡ã¢ãªé åã®ãµã¤ãºãè¡¨ãç¬¦å·ç¡ãæ´æ°*/
+typedef	intptr_t		VP_INT;		/* ãã¤ã³ã¿ã¾ãã¯ç¬¦å·ä»ãæ´æ° */
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ITRONä»æ§å
+±éå®æ°
+ */
+#define	TRUE		true			/* ç */
+#define	FALSE		false			/* å½ */
+
+/*
+ *  å¼·å¶å¾
+ã¡ç¶æ
+ããã®å¼·å¶åé
+ */
+#define frsm_tsk(tskid)		rsm_tsk(tskid)
+
+/*
+ *  ãªãã¸ã§ã¯ãå±æ§ã®å®ç¾©
+ */
+#define TA_HLNG			UINT_C(0x00)	/* é«ç´è¨èªç¨ã¤ã³ã¿ãã§ã¼ã¹ */
+#define TA_TFIFO		UINT_C(0x00)	/* ã¿ã¹ã¯ã®å¾
+ã¡è¡åãFIFOé ã« */
+#define TA_WSGL			UINT_C(0x00)	/* å¾
+ã¡ã¿ã¹ã¯ã¯1ã¤ã®ã¿ */
+
+/*
+ *  ãã¹ãåæ°ã®æå¤§å¤
+ */
+#define TMAX_SUSCNT		UINT_C(1)		/* å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ã®æå¤§å¤ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_ITRON_H */
Index: asp3_wo_tecs/trunk/include/kernel.h
===================================================================
--- asp3_wo_tecs/trunk/include/kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/include/kernel.h	(revision 302)
@@ -0,0 +1,599 @@
+/*
+ *  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) 2004-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.h 463 2015-10-18 14:25:55Z ertl-hiro $
+ */
+
+/*
+ *		TOPPERS/ASPã«ã¼ãã« æ¨æºããããã¡ã¤ã«
+ *
+ *  TOPPERS/ASPã«ã¼ãã«ããµãã¼ããããµã¼ãã¹ã³ã¼ã«ã®å®£è¨ã¨ï¼å¿
+è¦ãªãã¼
+ *  ã¿åï¼å®æ°ï¼ãã¯ã­ã®å®ç¾©ãå«ãããããã¡ã¤ã«ï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ããï¼ããã«ããï¼ãã¯ã­å®ç¾©ä»¥å¤ã
+ *  é¤ãããã«ãªã£ã¦ããï¼
+ */
+
+#ifndef TOPPERS_KERNEL_H
+#define TOPPERS_KERNEL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *	TOPPERSå
+±éã®ãã¼ã¿åã»å®æ°ã»ãã¯ã­
+ */
+#include <t_stddef.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨
+ */
+#include "target_kernel.h"
+
+/*
+ *  ãµãã¼ãããæ©è½
+ */
+#ifdef TOPPERS_TARGET_SUPPORT_DIS_INT
+#define TOPPERS_SUPPORT_DIS_INT			/* dis_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_DIS_INT */
+
+#ifdef TOPPERS_TARGET_SUPPORT_ENA_INT
+#define TOPPERS_SUPPORT_ENA_INT			/* ena_intããµãã¼ãããã¦ãã */
+#endif /* TOPPERS_TARGET_SUPPORT_ENA_INT */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãã¼ã¿åã®å®ç¾©
+ */
+
+/*
+ *  ããããã¿ã¼ã³ããªãã¸ã§ã¯ãçªå·ã®åå®ç¾©
+ */
+typedef	uint_t		FLGPTN;		/* ã¤ãã³ããã©ã°ã®ããããã¿ã¼ã³ */
+typedef	uint_t		INTNO;		/* å²è¾¼ã¿çªå· */
+typedef	uint_t		INHNO;		/* å²è¾¼ã¿ãã³ãã©çªå· */
+typedef	uint_t		EXCNO;		/* CPUä¾å¤ãã³ãã©çªå· */
+
+/*
+ *  å¦çåä½ã®åå®ç¾©
+ */
+typedef void	(*TASK)(intptr_t exinf);
+typedef void	(*TMEHDR)(intptr_t exinf);
+typedef void	(*ISR)(intptr_t exinf);
+typedef void	(*INTHDR)(void);
+typedef void	(*EXCHDR)(void *p_excinf);
+typedef void	(*INIRTN)(intptr_t exinf);
+typedef void	(*TERRTN)(intptr_t exinf);
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®åå®ç¾©
+ */
+#ifndef TOPPERS_STK_T
+#define TOPPERS_STK_T	intptr_t
+#endif /* TOPPERS_STK_T */
+typedef	TOPPERS_STK_T	STK_T;	/* ã¹ã¿ãã¯é åãç¢ºä¿ããããã®å */
+
+#ifndef TOPPERS_MPF_T
+#define TOPPERS_MPF_T	intptr_t
+#endif /* TOPPERS_MPF_T */
+typedef	TOPPERS_MPF_T	MPF_T;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åãç¢ºä¿ããããã®å */
+
+/*
+ *  ãã±ããå½¢å¼ã®å®ç¾©
+ */
+typedef struct t_rtsk {
+	STAT	tskstat;	/* ã¿ã¹ã¯ç¶æ
+ */
+	PRI		tskpri;		/* ã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ */
+	PRI		tskbpri;	/* ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+	STAT	tskwait;	/* å¾
+ã¡è¦å  */
+	ID		wobjid;		/* å¾
+ã¡å¯¾è±¡ã®ãªãã¸ã§ã¯ãã®ID */
+	TMO		lefttmo;	/* ã¿ã¤ã ã¢ã¦ãããã¾ã§ã®æé */
+	uint_t	actcnt;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	uint_t	wupcnt;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ° */
+	bool_t	raster;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	bool_t	dister;		/* ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ */
+} T_RTSK;
+
+typedef struct t_rsem {
+	ID		wtskid;		/* ã»ããã©ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	semcnt;		/* ã»ããã©ã®ç¾å¨ã®è³æºæ° */
+} T_RSEM;
+
+typedef struct t_rflg {
+	ID		wtskid;		/* ã¤ãã³ããã©ã°ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	FLGPTN	flgptn;		/* ã¤ãã³ããã©ã°ã®ç¾å¨ã®ããããã¿ã¼ã³ */
+} T_RFLG;
+
+typedef struct t_rdtq {
+	ID		stskid;		/* ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	ID		rtskid;		/* ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+	uint_t	sdtqcnt;	/* ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼ã¿ã®æ° */
+} T_RDTQ;
+
+typedef struct t_rpdq {
+	ID		stskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®éä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	ID		rtskid;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®åä¿¡å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯
+						   ã®IDçªå· */
+	uint_t	spdqcnt;	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã«æ ¼ç´ããã¦ãããã¼
+						   ã¿ã®æ° */
+} T_RPDQ;
+
+typedef struct t_rmtx {
+	ID		htskid;		/* ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã¿ã¹ã¯ã®IDçªå· */
+	ID		wtskid;		/* ãã¥ã¼ããã¯ã¹ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®IDçªå· */
+} T_RMTX;
+
+typedef struct t_rmpf {
+	ID		wtskid;		/* åºå®é·ã¡ã¢ãªãã¼ã«ã®å¾
+ã¡è¡åã®å
+é ­ã®ã¿ã¹ã¯ã®
+						   IDçªå· */
+	uint_t	fblkcnt;	/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®ç©ºãã¡ã¢ãªé åã«å²ã
+						   ä»ãããã¨ãã§ããåºå®é·ã¡ã¢ãªãã­ãã¯ã®æ° */
+} T_RMPF;
+
+typedef struct t_rcyc {
+	STAT	cycstat;	/* å¨æéç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* æ¬¡åéç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RCYC;
+
+typedef struct t_ralm {
+	STAT	almstat;	/* ã¢ã©ã¼ã éç¥ã®åä½ç¶æ
+ */
+	RELTIM	lefttim;	/* éç¥æå»ã¾ã§ã®ç¸å¯¾æé */
+} T_RALM;
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å®£è¨
+ */
+
+/*
+ *  ã¿ã¹ã¯ç®¡çæ©è½
+ */
+extern ER		act_tsk(ID tskid) throw();
+extern ER_UINT	can_act(ID tskid) throw();
+extern ER		get_tst(ID tskid, STAT *p_tskstat) throw();
+extern ER		chg_pri(ID tskid, PRI tskpri) throw();
+extern ER		get_pri(ID tskid, PRI *p_tskpri) throw();
+extern ER		get_inf(intptr_t *p_exinf) throw();
+extern ER		ref_tsk(ID tskid, T_RTSK *pk_rtsk) throw();
+
+/*
+ *  ã¿ã¹ã¯ä»å±åææ©è½
+ */
+extern ER		slp_tsk(void) throw();
+extern ER		tslp_tsk(TMO tmout) throw();
+extern ER		wup_tsk(ID tskid) throw();
+extern ER_UINT	can_wup(ID tskid) throw();
+extern ER		rel_wai(ID tskid) throw();
+extern ER		sus_tsk(ID tskid) throw();
+extern ER		rsm_tsk(ID tskid) throw();
+extern ER		dly_tsk(RELTIM dlytim) throw();
+
+/*
+ *  ã¿ã¹ã¯çµäºæ©è½
+ */
+extern ER		ext_tsk(void) throw();
+extern ER		ras_ter(ID tskid) throw();
+extern ER		dis_ter(void) throw();
+extern ER		ena_ter(void) throw();
+extern bool_t	sns_ter(void) throw();
+extern ER		ter_tsk(ID tskid) throw();
+
+/*
+ *  åæã»éä¿¡æ©è½
+ */
+extern ER		sig_sem(ID semid) throw();
+extern ER		wai_sem(ID semid) throw();
+extern ER		pol_sem(ID semid) throw();
+extern ER		twai_sem(ID semid, TMO tmout) throw();
+extern ER		ini_sem(ID semid) throw();
+extern ER		ref_sem(ID semid, T_RSEM *pk_rsem) throw();
+
+extern ER		set_flg(ID flgid, FLGPTN setptn) throw();
+extern ER		clr_flg(ID flgid, FLGPTN clrptn) throw();
+extern ER		wai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		pol_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn) throw();
+extern ER		twai_flg(ID flgid, FLGPTN waiptn,
+						MODE wfmode, FLGPTN *p_flgptn, TMO tmout) throw();
+extern ER		ini_flg(ID flgid) throw();
+extern ER		ref_flg(ID flgid, T_RFLG *pk_rflg) throw();
+
+extern ER		snd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		psnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		tsnd_dtq(ID dtqid, intptr_t data, TMO tmout) throw();
+extern ER		fsnd_dtq(ID dtqid, intptr_t data) throw();
+extern ER		rcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		prcv_dtq(ID dtqid, intptr_t *p_data) throw();
+extern ER		trcv_dtq(ID dtqid, intptr_t *p_data, TMO tmout) throw();
+extern ER		ini_dtq(ID dtqid) throw();
+extern ER		ref_dtq(ID dtqid, T_RDTQ *pk_rdtq) throw();
+
+extern ER		snd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		psnd_pdq(ID pdqid, intptr_t data, PRI datapri) throw();
+extern ER		tsnd_pdq(ID pdqid, intptr_t data,
+										PRI datapri, TMO tmout) throw();
+extern ER		rcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		prcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri) throw();
+extern ER		trcv_pdq(ID pdqid, intptr_t *p_data,
+										PRI *p_datapri, TMO tmout) throw();
+extern ER		ini_pdq(ID pdqid) throw();
+extern ER		ref_pdq(ID pdqid, T_RPDQ *pk_rpdq) throw();
+
+extern ER		loc_mtx(ID mtxid) throw();
+extern ER		ploc_mtx(ID mtxid) throw();
+extern ER		tloc_mtx(ID mtxid, TMO tmout) throw();
+extern ER		unl_mtx(ID mtxid) throw();
+extern ER		ini_mtx(ID mtxid) throw();
+extern ER		ref_mtx(ID mtxid, T_RMTX *pk_rmtx) throw();
+
+/*
+ *  ã¡ã¢ãªãã¼ã«ç®¡çæ©è½
+ */
+extern ER		get_mpf(ID mpfid, void **p_blk) throw();
+extern ER		pget_mpf(ID mpfid, void **p_blk) throw();
+extern ER		tget_mpf(ID mpfid, void **p_blk, TMO tmout) throw();
+extern ER		rel_mpf(ID mpfid, void *blk) throw();
+extern ER		ini_mpf(ID mpfid) throw();
+extern ER		ref_mpf(ID mpfid, T_RMPF *pk_rmpf) throw();
+
+/*
+ *  æéç®¡çæ©è½
+ */
+extern ER		set_tim(SYSTIM systim) throw();
+extern ER		get_tim(SYSTIM *p_systim) throw();
+extern ER		adj_tim(int32_t adjtim) throw();
+extern HRTCNT	fch_hrt(void) throw();
+
+extern ER		sta_cyc(ID cycid) throw();
+extern ER		stp_cyc(ID cycid) throw();
+extern ER		ref_cyc(ID cycid, T_RCYC *pk_rcyc) throw();
+
+extern ER		sta_alm(ID almid, RELTIM almtim) throw();
+extern ER		stp_alm(ID almid) throw();
+extern ER		ref_alm(ID almid, T_RALM *pk_ralm) throw();
+
+/*
+ *  ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+ */
+extern ER		rot_rdq(PRI tskpri) throw();
+extern ER		get_tid(ID *p_tskid) throw();
+extern ER		get_lod(PRI tskpri, uint_t *p_load) throw();
+extern ER		get_nth(PRI tskpri, uint_t nth, ID *p_tskid) throw();
+extern ER		loc_cpu(void) throw();
+extern ER		unl_cpu(void) throw();
+extern ER		dis_dsp(void) throw();
+extern ER		ena_dsp(void) throw();
+extern bool_t	sns_ctx(void) throw();
+extern bool_t	sns_loc(void) throw();
+extern bool_t	sns_dsp(void) throw();
+extern bool_t	sns_dpn(void) throw();
+extern bool_t	sns_ker(void) throw();
+extern ER		ext_ker(void) throw();
+
+/*
+ *  å²è¾¼ã¿ç®¡çæ©è½
+ */
+extern ER		dis_int(INTNO intno) throw();
+extern ER		ena_int(INTNO intno) throw();
+extern ER		chg_ipm(PRI intpri) throw();
+extern ER		get_ipm(PRI *p_intpri) throw();
+
+/*
+ *  CPUä¾å¤ç®¡çæ©è½
+ */
+extern bool_t	xsns_dpn(void *p_excinf) throw();
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãããµã¼ãã¹ã³ã¼ã«
+ */
+#define iact_tsk(tskid)						act_tsk(tskid)
+#define iwup_tsk(tskid)						wup_tsk(tskid)
+#define irel_wai(tskid)						rel_wai(tskid)
+#define isns_ter()							sns_ter()
+#define isig_sem(semid)						sig_sem(semid)
+#define iset_flg(flgid, setptn)				set_flg(flgid, setptn)
+#define ipsnd_dtq(dtqid, data)				psnd_dtq(dtqid, data)
+#define ifsnd_dtq(dtqid, data)				fsnd_dtq(dtqid, data)
+#define ipsnd_pdq(pdqid, data, datapri)		psnd_pdq(pdqid, data, datapri)
+#define ifch_hrt()							fch_hrt()
+#define ista_alm(almid, almtim)				sta_alm(almid, almtim)
+#define istp_alm(almid)						stp_alm(almid)
+#define irot_rdq(tskpri)					rot_rdq(tskpri)
+#define iget_tid(p_tskid)					get_tid(p_tskid)
+#define iloc_cpu()							loc_cpu()
+#define iunl_cpu()							unl_cpu()
+#define isns_ctx()							sns_ctx()
+#define isns_loc()							sns_loc()
+#define isns_dsp()							sns_dsp()
+#define isns_dpn()							sns_dpn()
+#define isns_ker()							sns_ker()
+#define iext_ker()							ext_ker()
+#define idis_int(intno)						dis_int(intno)
+#define iena_int(intno)						ena_int(intno)
+#define ixsns_dpn(p_excinf)					xsns_dpn(p_excinf)
+
+/*
+ *  ãªãã¸ã§ã¯ãå±æ§ã®å®ç¾©
+ */
+#define TA_ACT			UINT_C(0x01)	/* ã¿ã¹ã¯ãèµ·åãããç¶æ
+ã§çæ */
+#define TA_NOACTQUE		UINT_C(0x02)	/* èµ·åè¦æ±ãã­ã¥ã¼ã¤ã³ã°ããªã */
+
+#define TA_TPRI			UINT_C(0x01)	/* ã¿ã¹ã¯ã®å¾
+ã¡è¡åãåªå
+åº¦é ã« */
+
+#define TA_WMUL			UINT_C(0x02)	/* è¤æ°ã®å¾
+ã¡ã¿ã¹ã¯ */
+#define TA_CLR			UINT_C(0x04)	/* ã¤ãã³ããã©ã°ã®ã¯ãªã¢æå® */
+
+#define TA_CEILING		UINT_C(0x03)	/* åªå
+åº¦ä¸éãã­ãã³ã« */
+
+#define TA_STA			UINT_C(0x02)	/* å¨æéç¥ãåä½ç¶æ
+ã§çæ */
+
+#define TA_NONKERNEL	UINT_C(0x02)	/* ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ */
+
+#define TA_ENAINT		UINT_C(0x01)	/* å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ãã¯ãªã¢ */
+#define TA_EDGE			UINT_C(0x02)	/* ã¨ãã¸ããªã¬ */
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®åä½ã¢ã¼ãã®å®ç¾©
+ */
+#define TWF_ORW			UINT_C(0x01)	/* ã¤ãã³ããã©ã°ã®ORå¾
+ã¡ */
+#define TWF_ANDW		UINT_C(0x02)	/* ã¤ãã³ããã©ã°ã®ANDå¾
+ã¡ */
+
+/*
+ *  éç¥å¦çã¢ã¼ãã®å®ç¾©
+ */
+#define TNFY_HANDLER	UINT_C(0x00)		/* ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºã */
+#define TNFY_SETVAR		UINT_C(0x01)		/* å¤æ°ã®è¨­å® */
+#define TNFY_INCVAR		UINT_C(0x02)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TNFY_ACTTSK		UINT_C(0x03)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TNFY_WUPTSK		UINT_C(0x04)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TNFY_SIGSEM		UINT_C(0x05)		/* ã»ããã©ã®è³æºã®è¿å´ */
+#define TNFY_SETFLG		UINT_C(0x06)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TNFY_SNDDTQ		UINT_C(0x07)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+#define TENFY_SETVAR	UINT_C(0x10)		/* å¤æ°ã®è¨­å® */
+#define TENFY_INCVAR	UINT_C(0x20)		/* å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã */
+#define TENFY_ACTTSK	UINT_C(0x30)		/* ã¿ã¹ã¯ã®èµ·å */
+#define TENFY_WUPTSK	UINT_C(0x40)		/* ã¿ã¹ã¯ã®èµ·åº */
+#define TENFY_SIGSEM	UINT_C(0x50)		/* ã»ããã©ã®è¿å´ */
+#define TENFY_SETFLG	UINT_C(0x60)		/* ã¤ãã³ããã©ã°ã®ã»ãã */
+#define TENFY_SNDDTQ	UINT_C(0x70)		/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ */
+
+/*
+ *  ãªãã¸ã§ã¯ãã®ç¶æ
+ã®å®ç¾©
+ */
+#define TTS_RUN			UINT_C(0x01)	/* å®è¡ç¶æ
+ */
+#define TTS_RDY			UINT_C(0x02)	/* å®è¡å¯è½ç¶æ
+ */
+#define TTS_WAI			UINT_C(0x04)	/* å¾
+ã¡ç¶æ
+ */
+#define TTS_SUS			UINT_C(0x08)	/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+#define TTS_WAS			UINT_C(0x0c)	/* äºéå¾
+ã¡ç¶æ
+ */
+#define TTS_DMT			UINT_C(0x10)	/* ä¼æ­¢ç¶æ
+ */
+
+#define TTW_SLP			UINT_C(0x0001)	/* èµ·åºå¾
+ã¡ */
+#define TTW_DLY			UINT_C(0x0002)	/* æéçµéå¾
+ã¡ */
+#define TTW_SEM			UINT_C(0x0004)	/* ã»ããã©ã®è³æºç²å¾å¾
+ã¡ */
+#define TTW_FLG			UINT_C(0x0008)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TTW_SDTQ		UINT_C(0x0010)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RDTQ		UINT_C(0x0020)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_SPDQ		UINT_C(0x0100)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TTW_RPDQ		UINT_C(0x0200)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TTW_MTX			UINT_C(0x0080)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ç¶æ
+ */
+#define TTW_MPF			UINT_C(0x2000)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TCYC_STP		UINT_C(0x01)	/* å¨æéç¥ãåä½ãã¦ããªã */
+#define TCYC_STA		UINT_C(0x02)	/* å¨æéç¥ãåä½ãã¦ãã */
+
+#define TALM_STP		UINT_C(0x01)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ããªã */
+#define TALM_STA		UINT_C(0x02)	/* ã¢ã©ã¼ã éç¥ãåä½ãã¦ãã */
+
+/*
+ *  ãã®ä»ã®å®æ°ã®å®ç¾©
+ */
+#define TSK_SELF		0			/* èªã¿ã¹ã¯æå® */
+#define TSK_NONE		0			/* è©²å½ããã¿ã¹ã¯ããªã */
+
+#define TPRI_SELF		0			/* èªã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ */
+#define TPRI_INI		0			/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ */
+
+#define TIPM_ENAALL		0			/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ */
+
+/*
+ *  æ§æå®æ°ã¨ãã¯ã­
+ */
+
+/*
+ *  åªå
+åº¦ã®ç¯å²
+ */
+#define TMIN_TPRI		1			/* ã¿ã¹ã¯åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_TPRI		16			/* ã¿ã¹ã¯åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_DPRI		1			/* ãã¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_DPRI		16			/* ãã¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+#define TMIN_ISRPRI		1			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå°å¤ */
+#define TMAX_ISRPRI		16			/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³åªå
+åº¦ã®æå¤§å¤ */
+
+/*
+ *  ãã¼ã¸ã§ã³æ
+å ±
+ */
+#define TKERNEL_MAKER	UINT_C(0x0118)	/* ã«ã¼ãã«ã®ã¡ã¼ã«ã¼ã³ã¼ã */
+#define TKERNEL_PRID	UINT_C(0x0007)	/* ã«ã¼ãã«ã®è­å¥çªå· */
+#define TKERNEL_SPVER	UINT_C(0xf630)	/* ã«ã¼ãã«ä»æ§ã®ãã¼ã¸ã§ã³çªå· */
+#define TKERNEL_PRVER	UINT_C(0x30b0)	/* ã«ã¼ãã«ã®ãã¼ã¸ã§ã³çªå· */
+
+/*
+ *  ã­ã¥ã¼ã¤ã³ã°åæ°ã®æå¤§å¤
+ */
+#define TMAX_ACTCNT		UINT_C(1)		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+#define TMAX_WUPCNT		UINT_C(1)		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ */
+
+/*
+ *  ããããã¿ã¼ã³ã®ãããæ°
+ */
+#ifndef TBIT_FLGPTN					/* ã¤ãã³ããã©ã°ã®ãããæ° */
+#define TBIT_FLGPTN		(sizeof(FLGPTN) * CHAR_BIT)
+#endif /* TBIT_FLGPTN */
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´ã§ããç¯å²ï¼åä½ï¼Î¼ç§ï¼
+ */
+#define TMIN_ADJTIM		-1000000		/* ã·ã¹ãã æå»ã®æå°èª¿æ´æé */
+#define TMAX_ADJTIM		1000000			/* ã·ã¹ãã æå»ã®æå¤§èª¿æ´æé */
+
+/*
+ *  ã¡ã¢ãªé åç¢ºä¿ã®ããã®ãã¯ã­
+ *
+ *  ä»¥ä¸ã®TOPPERS_COUNT_SZã¨TOPPERS_ROUND_SZã®å®ç¾©ã¯ï¼unitã2ã®å·¾ä¹ã§ã
+ *  ããã¨ãä»®å®ãã¦ããï¼
+ */
+#ifndef TOPPERS_COUNT_SZ
+#define TOPPERS_COUNT_SZ(sz, unit)	(((sz) + (unit) - 1) / (unit))
+#endif /* TOPPERS_COUNT_SZ */
+#ifndef TOPPERS_ROUND_SZ
+#define TOPPERS_ROUND_SZ(sz, unit)	(((sz) + (unit) - 1) & ~((unit) - 1))
+#endif /* TOPPERS_ROUND_SZ */
+
+#define COUNT_STK_T(sz)		TOPPERS_COUNT_SZ(sz, sizeof(STK_T))
+#define ROUND_STK_T(sz)		TOPPERS_ROUND_SZ(sz, sizeof(STK_T))
+
+#define COUNT_MPF_T(blksz)	TOPPERS_COUNT_SZ(blksz, sizeof(MPF_T))
+#define ROUND_MPF_T(blksz)	TOPPERS_ROUND_SZ(blksz, sizeof(MPF_T))
+
+/*
+ *  ãã®ä»ã®æ§æå®æ°
+ */
+#define TMAX_MAXSEM		UINT_MAX	/* ã»ããã©ã®æå¤§è³æºæ°ã®æå¤§å¤ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_KERNEL_H */
Index: asp3_wo_tecs/trunk/include/log_output.h
===================================================================
--- asp3_wo_tecs/trunk/include/log_output.h	(revision 302)
+++ asp3_wo_tecs/trunk/include/log_output.h	(revision 302)
@@ -0,0 +1,104 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-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: log_output.h 117 2014-05-13 19:41:44Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ã­ã°ã®ãã©ã¼ãããåºå
+ */
+
+#ifndef TOPPERS_LOG_OUTPUT_H
+#define TOPPERS_LOG_OUTPUT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <t_stddef.h>
+#include <t_syslog.h>
+
+/*
+ *  æå­åæ´å½¢åºå
+ *
+ *  formatã§æå®ããããã©ã¼ãããè¨è¿°ã¨p_argsã§æå®ãããå¼æ°åããä½
+ *  æããã¡ãã»ã¼ã¸ãï¼1æå­åºåé¢æ°putcãç¨ãã¦åºåããï¼
+ */
+extern void	syslog_printf(const char *format, const intptr_t *p_args,
+										void (*putc)(char)) throw();
+
+/*
+ *  ã­ã°æ
+å ±ã®åºå
+ *
+ *  p_syslogã§æå®ãããã­ã°æ
+å ±ãæå­åã«æ´å½¢ãï¼1æå­åºåé¢æ°putcãç¨
+ *  ãã¦åºåããï¼
+ */
+extern void	syslog_print(const SYSLOG *p_syslog, void (*putc)(char)) throw();
+
+/*
+ *  ã­ã°æ
+å ±åªå¤±ã¡ãã»ã¼ã¸æå­å
+ *
+ *  lostlogåã®ã­ã°æ
+å ±ãå¤±ãããæ¨ã®ã¡ãã»ã¼ã¸ãï¼1æå­åºåé¢æ°putcã
+ *  ç¨ãã¦åºåããï¼
+ */
+extern void	syslog_lostmsg(uint_t lostlog, void (*putc)(char)) throw();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_LOG_OUTPUT_H */
Index: asp3_wo_tecs/trunk/include/queue.h
===================================================================
--- asp3_wo_tecs/trunk/include/queue.h	(revision 302)
+++ asp3_wo_tecs/trunk/include/queue.h	(revision 302)
@@ -0,0 +1,190 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  Copyright (C) 2006-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: queue.h 117 2014-05-13 19:41:44Z ertl-hiro $
+ */
+
+/*
+ *		ã­ã¥ã¼æä½ã©ã¤ãã©ãª
+ *
+ *  ãã®ã­ã¥ã¼æä½ã©ã¤ãã©ãªã§ã¯ï¼ã­ã¥ã¼ããããå«ããªã³ã°æ§é ã®ããã«
+ *  ãªã³ã¯ã­ã¥ã¼ãæ±ãï¼å
+·ä½çã«ã¯ï¼ã­ã¥ã¼ãããã®æ¬¡ã¨ã³ããªã¯ã­ã¥ã¼ã®
+ *  å
+é ­ã®ã¨ã³ããªï¼åã¨ã³ããªã¯ã­ã¥ã¼ã®æ«å°¾ã®ã¨ã³ããªã¨ããï¼ã¾ãï¼ã­
+ *  ã¥ã¼ã®å
+é ­ã®ã¨ã³ããªã®åã¨ã³ããªã¨ï¼ã­ã¥ã¼ã®æ«å°¾ã®ã¨ã³ããªã®æ¬¡ã¨ã³
+ *  ããªã¯ï¼ã­ã¥ã¼ãããã¨ããï¼ç©ºã®ã­ã¥ã¼ã¯ï¼æ¬¡ã¨ã³ããªï¼åã¨ã³ããªã¨
+ *  ãèªåèªèº«ãæãã­ã¥ã¼ãããã§ããããï¼
+ */
+
+#ifndef	TOPPERS_QUEUE_H
+#define	TOPPERS_QUEUE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <t_stddef.h>
+#include <t_syslog.h>
+
+/*
+ *  ã­ã¥ã¼ã®ãã¼ã¿æ§é ã®å®ç¾©
+ */
+typedef struct queue {
+	struct queue *p_next;		/* æ¬¡ã¨ã³ããªã¸ã®ãã¤ã³ã¿ */
+	struct queue *p_prev;		/* åã¨ã³ããªã¸ã®ãã¤ã³ã¿ */
+} QUEUE;
+
+/*
+ *  ã­ã¥ã¼ã®åæå
+ *
+ *  p_queueã«ã¯ã­ã¥ã¼ããããæå®ããï¼
+ */
+Inline void
+queue_initialize(QUEUE *p_queue)
+{
+	p_queue->p_prev = p_queue;
+	p_queue->p_next = p_queue;
+}
+
+/*
+ *  ã­ã¥ã¼ã®åã¨ã³ããªã¸ã®æ¿å
+¥
+ *
+ *  p_queueã®åã«p_entryãæ¿å
+¥ããï¼p_queueã«ã­ã¥ã¼ããããæå®ããå ´
+ *  åã«ã¯ï¼ã­ã¥ã¼ã®æ«å°¾ã«p_entryãæ¿å
+¥ãããã¨ã«ãªãï¼
+ */
+Inline void
+queue_insert_prev(QUEUE *p_queue, QUEUE *p_entry)
+{
+	p_entry->p_prev = p_queue->p_prev;
+	p_entry->p_next = p_queue;
+	p_queue->p_prev->p_next = p_entry;
+	p_queue->p_prev = p_entry;
+}
+
+/*
+ *  ã­ã¥ã¼ã®æ¬¡ã¨ã³ããªã¸ã®æ¿å
+¥
+ *
+ *  p_queueã®æ¬¡ã«p_entryãæ¿å
+¥ããï¼p_queueã«ã­ã¥ã¼ããããæå®ããå ´
+ *  åã«ã¯ï¼ã­ã¥ã¼ã®å
+é ­ã«p_entryãæ¿å
+¥ãããã¨ã«ãªãï¼
+ */
+Inline void
+queue_insert_next(QUEUE *p_queue, QUEUE *p_entry)
+{
+	p_entry->p_prev = p_queue;
+	p_entry->p_next = p_queue->p_next;
+	p_queue->p_next->p_prev = p_entry;
+	p_queue->p_next = p_entry;
+}
+
+/*
+ *  ã¨ã³ããªã®åé¤
+ *
+ *  p_entryãã­ã¥ã¼ããåé¤ããï¼
+ */
+Inline void
+queue_delete(QUEUE *p_entry)
+{
+	p_entry->p_prev->p_next = p_entry->p_next;
+	p_entry->p_next->p_prev = p_entry->p_prev;
+}
+
+/*
+ *  ã­ã¥ã¼ã®æ¬¡ã¨ã³ããªã®ååºã
+ *
+ *  p_queueã®æ¬¡ã¨ã³ããªãã­ã¥ã¼ããåé¤ãï¼åé¤ããã¨ã³ããªãè¿ãï¼
+ *  p_queueã«ã­ã¥ã¼ããããæå®ããå ´åã«ã¯ï¼ã­ã¥ã¼ã®å
+é ­ã®ã¨ã³ããªã
+ *  åãåºããã¨ã«ãªãï¼p_queueã«ç©ºã®ã­ã¥ã¼ãæå®ãã¦å¼ã³åºãã¦ã¯ãªã
+ *  ãªãï¼
+ */
+Inline QUEUE *
+queue_delete_next(QUEUE *p_queue)
+{
+	QUEUE	*p_entry;
+
+	assert(p_queue->p_next != p_queue);
+	p_entry = p_queue->p_next;
+	p_queue->p_next = p_entry->p_next;
+	p_entry->p_next->p_prev = p_queue;
+	return(p_entry);
+}
+
+/*
+ *  ã­ã¥ã¼ãç©ºãã©ããã®ãã§ãã¯
+ *
+ *  p_queueã«ã¯ã­ã¥ã¼ããããæå®ããï¼
+ */
+Inline bool_t
+queue_empty(QUEUE *p_queue)
+{
+	if (p_queue->p_next == p_queue) {
+		assert(p_queue->p_prev == p_queue);
+		return(true);
+	}
+	return(false);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_QUEUE_H */
Index: asp3_wo_tecs/trunk/include/sil.h
===================================================================
--- asp3_wo_tecs/trunk/include/sil.h	(revision 302)
+++ asp3_wo_tecs/trunk/include/sil.h	(revision 302)
@@ -0,0 +1,303 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-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: sil.h 121 2014-05-13 20:14:30Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ã¤ã³ã¿ãã§ã¼ã¹ã¬ã¤ã¤
+ *
+ *  ã·ã¹ãã ã¤ã³ã¿ãã§ã¼ã¹ã¬ã¤ã¤ã®ãµã¼ãã¹ã³ã¼ã«ã®å®ç¾©ã»å®£è¨ã¨ãã¯ã­ãª
+ *  ã©ã®å®ç¾©ãå«ãããããã¡ã¤ã«ï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ãããã¨ã§ï¼ãã¯ã­å®ç¾©ä»¥å¤ã®è¨è¿°ã
+ *  é¤ããã¨ãã§ããï¼
+ */
+
+#ifndef TOPPERS_SIL_H
+#define TOPPERS_SIL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *	TOPPERSå
+±éã®ãã¼ã¿åã»å®æ°ã»ãã¯ã­
+ */
+#include <t_stddef.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨
+ */
+#include "target_sil.h"
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®å¶å¾¡
+ *
+ *  SIL_PRE_LOCï¼SIL_LOC_INT()ï¼SIL_UNL_INT()ã¯ï¼ã¿ã¼ã²ããä¾å­é¨ã§ç¨
+ *  æããï¼ããã©ã«ãã®å®ç¾©ã¯ç¨æãã¦ããªãï¼
+ */
+
+/*
+ *  å¾®å°æéå¾
+ã¡
+ */
+extern void	sil_dly_nse(ulong_t dlytim) throw();
+
+/*
+ *  ã¨ã³ãã£ã¢ã³ã®åè»¢
+ */
+#ifndef TOPPERS_SIL_REV_ENDIAN_UINT16
+#define	TOPPERS_SIL_REV_ENDIAN_UINT16(data) \
+				((((data) & 0xffU) << 8) | (((data) >> 8) & 0xffU))
+#endif /* TOPPERS_SIL_REV_ENDIAN_UINT16 */
+
+#ifndef TOPPERS_SIL_REV_ENDIAN_UINT32
+#define	TOPPERS_SIL_REV_ENDIAN_UINT32(data) \
+				((((data) & 0xffU) << 24) | (((data) & 0xff00U) << 8) \
+					| (((data) >> 8) & 0xff00U) | (((data) >> 24) & 0xffU))
+#endif /* TOPPERS_SIL_REV_ENDIAN_UINT32 */
+
+/*
+ *  ã¡ã¢ãªç©ºéã¢ã¯ã»ã¹é¢æ°
+ */
+#ifndef TOPPERS_OMIT_SIL_ACCESS
+
+/*
+ *  8ãããåä½ã®èª­åºãï¼æ¸è¾¼ã¿
+ */
+#ifdef UINT8_MAX
+
+Inline uint8_t
+sil_reb_mem(const uint8_t *mem)
+{
+	uint8_t	data;
+
+	data = *((const volatile uint8_t *) mem);
+	return(data);
+}
+
+Inline void
+sil_wrb_mem(uint8_t *mem, uint8_t data)
+{
+	*((volatile uint8_t *) mem) = data;
+}
+
+#endif /* UINT8_MAX */
+
+/*
+ *  16ãããåä½ã®èª­åºãï¼æ¸è¾¼ã¿
+ */
+
+Inline uint16_t
+sil_reh_mem(const uint16_t *mem)
+{
+	uint16_t	data;
+
+	data = *((const volatile uint16_t *) mem);
+	return(data);
+}
+
+Inline void
+sil_wrh_mem(uint16_t *mem, uint16_t data)
+{
+	*((volatile uint16_t *) mem) = data;
+}
+
+#ifdef SIL_ENDIAN_BIG			/* ããã°ã¨ã³ãã£ã¢ã³ãã­ã»ããµ */
+
+#define	sil_reh_bem(mem)		sil_reh_mem(mem)
+#define	sil_wrh_bem(mem, data)	sil_wrh_mem(mem, data)
+
+#ifndef TOPPERS_OMIT_SIL_REH_LEM
+
+Inline uint16_t
+sil_reh_lem(const uint16_t *mem)
+{
+	uint16_t	data;
+
+	data = *((const volatile uint16_t *) mem);
+	return(TOPPERS_SIL_REV_ENDIAN_UINT16(data));
+}
+
+#endif /* TOPPERS_OMIT_SIL_REH_LEM */
+#ifndef TOPPERS_OMIT_SIL_WRH_LEM
+
+Inline void
+sil_wrh_lem(uint16_t *mem, uint16_t data)
+{
+	*((volatile uint16_t *) mem) = TOPPERS_SIL_REV_ENDIAN_UINT16(data);
+}
+
+#endif /* TOPPERS_OMIT_SIL_WRH_LEM */
+#else /* SIL_ENDIAN_BIG */
+#ifdef SIL_ENDIAN_LITTLE		/* ãªãã«ã¨ã³ãã£ã¢ã³ãã­ã»ããµ */
+
+#define	sil_reh_lem(mem)		sil_reh_mem(mem)
+#define	sil_wrh_lem(mem, data)	sil_wrh_mem(mem, data)
+
+#ifndef TOPPERS_OMIT_SIL_REH_BEM
+
+Inline uint16_t
+sil_reh_bem(const uint16_t *mem)
+{
+	uint16_t	data;
+
+	data = *((const volatile uint16_t *) mem);
+	return(TOPPERS_SIL_REV_ENDIAN_UINT16(data));
+}
+
+#endif /* TOPPERS_OMIT_SIL_REH_BEM */
+#ifndef TOPPERS_OMIT_SIL_WRH_BEM
+
+Inline void
+sil_wrh_bem(uint16_t *mem, uint16_t data)
+{
+	*((volatile uint16_t *) mem) = TOPPERS_SIL_REV_ENDIAN_UINT16(data);
+}
+
+#endif /* TOPPERS_OMIT_SIL_WRH_BEM */
+#else /* SIL_ENDIAN_LITTLE */
+
+#error Neither SIL_ENDIAN_BIG nor SIL_ENDIAN_LITTLE is defined.
+
+#endif /* SIL_ENDIAN_LITTLE */
+#endif /* SIL_ENDIAN_BIG */
+
+/*
+ *  32ãããåä½ã®èª­åºãï¼æ¸è¾¼ã¿
+ */
+
+Inline uint32_t
+sil_rew_mem(const uint32_t *mem)
+{
+	uint32_t	data;
+
+	data = *((const volatile uint32_t *) mem);
+	return(data);
+}
+
+Inline void
+sil_wrw_mem(uint32_t *mem, uint32_t data)
+{
+	*((volatile uint32_t *) mem) = data;
+}
+
+#ifdef SIL_ENDIAN_BIG			/* ããã°ã¨ã³ãã£ã¢ã³ãã­ã»ããµ */
+
+#define	sil_rew_bem(mem)		sil_rew_mem(mem)
+#define	sil_wrw_bem(mem, data)	sil_wrw_mem(mem, data)
+
+#ifndef TOPPERS_OMIT_SIL_REW_LEM
+
+Inline uint32_t
+sil_rew_lem(const uint32_t *mem)
+{
+	uint32_t	data;
+
+	data = *((const volatile uint32_t *) mem);
+	return(TOPPERS_SIL_REV_ENDIAN_UINT32(data));
+}
+
+#endif /* TOPPERS_OMIT_SIL_REW_LEM */
+#ifndef TOPPERS_OMIT_SIL_WRW_LEM
+
+Inline void
+sil_wrw_lem(uint32_t *mem, uint32_t data)
+{
+	*((volatile uint32_t *) mem) = TOPPERS_SIL_REV_ENDIAN_UINT32(data);
+}
+
+#endif /* TOPPERS_OMIT_SIL_WRW_LEM */
+#else /* SIL_ENDIAN_BIG */		/* ãªãã«ã¨ã³ãã£ã¢ã³ãã­ã»ããµ */
+
+#define	sil_rew_lem(mem)		sil_rew_mem(mem)
+#define	sil_wrw_lem(mem, data)	sil_wrw_mem(mem, data)
+
+#ifndef TOPPERS_OMIT_SIL_REW_BEM
+
+Inline uint32_t
+sil_rew_bem(const uint32_t *mem)
+{
+	uint32_t	data;
+
+	data = *((const volatile uint32_t *) mem);
+	return(TOPPERS_SIL_REV_ENDIAN_UINT32(data));
+}
+
+#endif /* TOPPERS_OMIT_SIL_REW_BEM */
+#ifndef TOPPERS_OMIT_SIL_WRW_BEM
+
+Inline void
+sil_wrw_bem(uint32_t *mem, uint32_t data)
+{
+	*((volatile uint32_t *) mem) = TOPPERS_SIL_REV_ENDIAN_UINT32(data);
+}
+
+#endif /* TOPPERS_OMIT_SIL_WRW_BEM */
+#endif /* SIL_ENDIAN_BIG */
+#endif /* TOPPERS_OMIT_SIL_ACCESS */
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_SIL_H */
Index: asp3_wo_tecs/trunk/include/t_stddef.h
===================================================================
--- asp3_wo_tecs/trunk/include/t_stddef.h	(revision 302)
+++ asp3_wo_tecs/trunk/include/t_stddef.h	(revision 302)
@@ -0,0 +1,311 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  Copyright (C) 2004-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: t_stddef.h 458 2015-08-21 14:59:09Z ertl-hiro $
+ */
+
+/*
+ *		TOPPERSå
+±éããããã¡ã¤ã«
+ *
+ *  TOPPERSé¢é£ã®ãã¹ã¦ã®ã½ã¼ã¹ãã¡ã¤ã«ã§ã¤ã³ã¯ã«ã¼ããã¹ãããããã¡ã¤
+ *  ã«ï¼åç¨®ã®ã«ã¼ãã«ãã½ããã¦ã§ã¢é¨åã§å
+±éã«ç¨ãããã¨ãæ³å®ãã¦ã
+ *  ãï¼TOPPERSã®åç¨®ã®ã«ã¼ãã«ãã½ããã¦ã§ã¢é¨åã§å
+±éã«ç¨ãããã¼ã¿åï¼
+ *  å®æ°ï¼ãã¯ã­ã®å®ç¾©ãªã©ãå«ãï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ããï¼ããã«ããï¼ãã¯ã­å®ç¾©ä»¥å¤ã
+ *  é¤ãããã«ãªã£ã¦ããï¼
+ */
+
+#ifndef TOPPERS_T_STDDEF_H
+#define TOPPERS_T_STDDEF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨
+ */
+#include "target_stddef.h"
+
+/*
+ *  Cè¨èª/EC++ã§throw()ã«å¯¾å¦ããããã®å®ç¾©
+ */
+#if !defined(__cplusplus) || defined(__embedded_cplusplus)
+#define throw()
+#endif
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®ãã¼ã¿åã®ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef TOPPERS_bool
+#define TOPPERS_bool	int				/* ãã¼ã«å */
+#endif /* TOPPERS_bool */
+
+#ifndef TOPPERS_fp
+struct TOPPERS_dummy_t { int TOPPERS_dummy_field; };
+typedef	void			(*TOPPERS_fp_t)(struct TOPPERS_dummy_t);
+#define TOPPERS_fp		TOPPERS_fp_t	/* ãã­ã°ã©ã ã®èµ·åçªå° */
+#endif /* TOPPERS_fp */
+
+/*
+ *  å
+±éãã¼ã¿å
+ */
+typedef TOPPERS_bool	bool_t;		/* çå½å¤ */
+
+typedef signed int		int_t;		/* èªç¶ãªãµã¤ãºã®ç¬¦å·ä»ãæ´æ° */
+typedef unsigned int	uint_t;		/* èªç¶ãªãµã¤ãºã®ç¬¦å·ç¡ãæ´æ° */
+
+typedef signed long		long_t;		/* é·ãã®ãµã¤ãºã®ç¬¦å·ä»ãæ´æ° */
+typedef unsigned long	ulong_t;	/* é·ãã®ãµã¤ãºã®ç¬¦å·ç¡ãæ´æ° */
+
+typedef int_t			FN;			/* æ©è½ã³ã¼ã */
+typedef	int_t			ER;			/* ã¨ã©ã¼ã³ã¼ã */
+typedef	int_t			ID;			/* ãªãã¸ã§ã¯ãã®IDçªå· */
+typedef	uint_t			ATR;		/* ãªãã¸ã§ã¯ãã®å±æ§ */
+typedef	uint_t			STAT;		/* ãªãã¸ã§ã¯ãã®ç¶æ
+ */
+typedef	uint_t			MODE;		/* ãµã¼ãã¹ã³ã¼ã«ã®åä½ã¢ã¼ã */
+typedef	int_t			PRI;		/* åªå
+åº¦ */
+typedef	uint32_t		TMO;		/* ã¿ã¤ã ã¢ã¦ãæå® */
+typedef	uint32_t		RELTIM;		/* ç¸å¯¾æéï¼»NGKI0550ï¼½*/
+#ifdef UINT64_MAX
+typedef	uint64_t		SYSTIM;		/* ã·ã¹ãã æå»ï¼»NGKI0548ï¼½*/
+#else /* UINT64_MAX */
+typedef	uint32_t		SYSTIM;		/* ã·ã¹ãã æå»ï¼»NGKI0548ï¼½*/
+#endif /* UINT64_MAX */
+typedef	uint32_t		PRCTIM;		/* ãã­ã»ããµæéï¼»NGKI0573ï¼½*/
+typedef	uint32_t		HRTCNT;		/* é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ */
+
+typedef	TOPPERS_fp		FP;			/* ãã­ã°ã©ã ã®èµ·åçªå° */
+
+typedef	int_t			ER_BOOL;	/* ã¨ã©ã¼ã³ã¼ãã¾ãã¯çå½å¤ */
+typedef	int_t			ER_ID;		/* ã¨ã©ã¼ã³ã¼ãã¾ãã¯IDçªå· */
+typedef	int_t			ER_UINT;	/* ã¨ã©ã¼ã³ã¼ãã¾ãã¯ç¬¦å·ç¡ãæ´æ° */
+
+typedef uintptr_t		MB_T;		/* ç®¡çé åãç¢ºä¿ããããã®ãã¼ã¿å */
+
+typedef	uint32_t		ACPTN;		/* ã¢ã¯ã»ã¹è¨±å¯ãã¿ã¼ã³ */
+typedef	struct acvct {				/* ã¢ã¯ã»ã¹è¨±å¯ãã¯ã¿ */
+	ACPTN		acptn1;				/* éå¸¸æä½1ã®ã¢ã¯ã»ã¹è¨±å¯ãã¿ã¼ã³ */
+	ACPTN		acptn2;				/* éå¸¸æä½2ã®ã¢ã¯ã»ã¹è¨±å¯ãã¿ã¼ã³ */
+	ACPTN		acptn3;				/* ç®¡çæä½ã®ã¢ã¯ã»ã¹è¨±å¯ãã¿ã¼ã³ */
+	ACPTN		acptn4;				/* åç
+§æä½ã®ã¢ã¯ã»ã¹è¨±å¯ãã¿ã¼ã³ */
+} ACVCT;
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  æ´æ°å®æ°ãä½ããã¯ã­
+ */
+#ifndef UINT_C
+#define UINT_C(val)		(val ## U)		/* uint_tåã®å®æ°ãä½ããã¯ã­ */
+#endif /* UINT_C */
+
+#ifndef ULONG_C
+#define ULONG_C(val)	(val ## UL)		/* ulong_tåã®å®æ°ãä½ããã¯ã­ */
+#endif /* ULONG_C */
+
+/*
+ *  ä¸è¬å®æ°
+ */
+#ifndef NULL
+#define NULL		0			/* ç¡å¹ãã¤ã³ã¿ */
+#endif /* NULL */
+
+#ifndef true
+#define true		1			/* ç */
+#endif /* true */
+
+#ifndef false
+#define false		0			/* å½ */
+#endif /* false */
+
+#define E_OK		0			/* æ­£å¸¸çµäº */
+
+/*
+ *  ã¡ã¤ã³ã¨ã©ã¼ã³ã¼ã
+ */
+#define E_SYS		(-5)		/* ã·ã¹ãã ã¨ã©ã¼ */
+#define E_NOSPT		(-9)		/* æªãµãã¼ãæ©è½ */
+#define E_RSFN		(-10)		/* äºç´æ©è½ã³ã¼ã */
+#define E_RSATR		(-11)		/* äºç´å±æ§ */
+#define E_PAR		(-17)		/* ãã©ã¡ã¼ã¿ã¨ã©ã¼ */
+#define E_ID		(-18)		/* ä¸æ­£IDçªå· */
+#define E_CTX		(-25)		/* ã³ã³ãã­ã¹ãã¨ã©ã¼ */
+#define E_MACV		(-26)		/* ã¡ã¢ãªã¢ã¯ã»ã¹éå */
+#define E_OACV		(-27)		/* ãªãã¸ã§ã¯ãã¢ã¯ã»ã¹éå */
+#define E_ILUSE		(-28)		/* ãµã¼ãã¹ã³ã¼ã«ä¸æ­£ä½¿ç¨ */
+#define E_NOMEM		(-33)		/* ã¡ã¢ãªä¸è¶³ */
+#define E_NOID		(-34)		/* IDçªå·ä¸è¶³ */
+#define E_NORES		(-35)		/* è³æºä¸è¶³ */
+#define E_OBJ		(-41)		/* ãªãã¸ã§ã¯ãç¶æ
+ã¨ã©ã¼ */
+#define E_NOEXS		(-42)		/* ãªãã¸ã§ã¯ãæªçæ */
+#define E_QOVR		(-43)		/* ã­ã¥ã¼ã¤ã³ã°ãªã¼ãã¼ãã­ã¼ */
+#define E_RLWAI		(-49)		/* å¾
+ã¡ç¶æ
+ã®å¼·å¶è§£é¤ */
+#define E_TMOUT		(-50)		/* ãã¼ãªã³ã°å¤±æã¾ãã¯ã¿ã¤ã ã¢ã¦ã */
+#define E_DLT		(-51)		/* å¾
+ã¡ãªãã¸ã§ã¯ãã®åé¤ */
+#define E_CLS		(-52)		/* å¾
+ã¡ãªãã¸ã§ã¯ãã®ç¶æ
+å¤å */
+#define E_RASTER	(-53)		/* ã¿ã¹ã¯ã®çµäºè¦æ± */
+#define E_WBLK		(-57)		/* ãã³ãã­ãã­ã³ã°åä»ã */
+#define E_BOVR		(-58)		/* ãããã¡ãªã¼ãã¼ãã­ã¼ */
+#define E_COMM		(-65)		/* éä¿¡ã¨ã©ã¼ */
+
+/*
+ *  ãªãã¸ã§ã¯ãå±æ§
+ */
+#define TA_NULL		UINT_C(0)	/* ãªãã¸ã§ã¯ãå±æ§ãæå®ããªã */
+
+/*
+ *  ã¿ã¤ã ã¢ã¦ãæå®
+ */
+#define TMO_POL		UINT_C(0)			/* ãã¼ãªã³ã° */
+#define TMO_FEVR	(UINT32_MAX)		/* æ°¸ä¹
+å¾
+ã¡ */
+#define TMO_NBLK	(UINT32_MAX - 1)	/* ãã³ãã­ãã­ã³ã° */
+
+/*
+ *  ã¢ã¯ã»ã¹è¨±å¯ãã¿ã¼ã³
+ */
+#define TACP_KERNEL	UINT_C(0)		/* ã«ã¼ãã«ãã¡ã¤ã³ã ãã«ã¢ã¯ã»ã¹ãè¨±å¯ */
+#define TACP_SHARED	(~UINT_C(0))	/* ãã¹ã¦ã®ãã¡ã¤ã³ããã¢ã¯ã»ã¹ãè¨±å¯ */
+
+/*
+ *  åã«é¢ããæ
+å ±ãåãåºãããã®ãã¯ã­
+ *
+ *  ä»¥ä¸ã®ALIGN_TYPEã®å®ç¾©ã¯ï¼ã¢ã©ã¤ã³ã¡ã³ãã®åä½ã2ã®å·¾ä¹ã§ãããã¨ã
+ *  ä»®å®ãã¦ããï¼
+ */
+#ifndef offsetof
+#define	offsetof(structure, field)	((uintptr_t) &(((structure *) 0)->field))
+#endif /* offsetof */
+
+#ifndef alignof
+#define alignof(type)	offsetof(struct { char field1; type field2; }, field2)
+#endif /* alignof */
+
+#ifndef ALIGN_TYPE				/* ã¢ã©ã¤ã³ã¡ã³ãã®ãã§ãã¯ */
+#define ALIGN_TYPE(addr, type) \
+						((((uintptr_t)(addr)) & (alignof(type) - 1)) == 0U)
+#endif /* ALIGN_TYPE */
+
+/*
+ *  assertãã¯ã­
+ */
+#undef assert
+#ifndef NDEBUG
+#define assert(exp)		((void)((exp) ? 0 : (TOPPERS_assert_fail(#exp, \
+							__FILE__, __LINE__), TOPPERS_assert_abort(), 0)))
+#else /* NDEBUG */
+#define assert(exp)		((void) 0)
+#endif /* NDEBUG */
+
+#ifdef __cplusplus
+}
+#endif
+
+/*
+ *  ã¨ã©ã¼ã³ã¼ãçæã»åè§£ãã¯ã­
+ *
+ *  ä»¥ä¸ã®ãã¯ã­å®ç¾©ã¯ï¼ç¬¦å·ä»ãæ´æ°ã2ã®è£æ°ã§è¡¨ç¾ããã¦ããï¼å³ã·ãã
+ *  æ¼ç®å­ï¼>>ï¼ãç®è¡ã·ããããããã¨ãä»®å®ãã¦ããï¼ããã§ãªãéçºç°
+ *  å¢ã§ã¯ï¼target_stddef.hã§ãããã®å®ç¾©ãä¸æ¸ãããªããã°ãªããªãï¼
+ *
+ *  MERCDãã¯ã­ã®å®ç¾©ã¯ï¼ã¡ã¤ã³ã¨ã©ã¼ã³ã¼ããè² ã§ãããã¨ãä»®å®ãã¦ããï¼
+ *  ããã§ãªãå ´åï¼2ã¤ã®å®ç¾©ãä¸è´ããªããªãï¼
+ */
+#ifndef ERCD
+#define ERCD(mercd, sercd) \
+				((ER)((((uint_t)(sercd)) << 8) | (((uint_t)(mercd)) & 0xffU)))
+#endif /* ERCD */
+
+#ifndef MERCD
+#ifdef INT8_MAX
+#define MERCD(ercd)		((ER)((int8_t)(ercd)))
+#else /* INT8_MAX */
+#define MERCD(ercd)		((ER)(((uint_t) ercd) | ~0xffU))
+#endif /* INT8_MAX */
+#endif /* MERCD */
+
+#ifndef SERCD
+#define SERCD(ercd)		((ER)((ercd) >> 8))
+#endif /* SERCD */
+
+/*
+ *  ã¢ã¯ã»ã¹è¨±å¯ãã¿ã¼ã³çæãã¯ã­
+ */
+#define TACP(domid)		(1U << ((domid) - 1))	/* domidã ãã«ã¢ã¯ã»ã¹ãè¨±å¯ */
+
+/*
+ *  ç¸å¯¾æéï¼RELTIMï¼ã«æå®ã§ããæå¤§å¤ï¼»NGKI0551ï¼½
+ */
+#define TMAX_RELTIM		4000000000U				/* 66å40ç§ã¾ã§æå®å¯ */
+
+#endif /* TOPPERS_T_STDDEF_H */
Index: asp3_wo_tecs/trunk/include/t_stdlib.h
===================================================================
--- asp3_wo_tecs/trunk/include/t_stdlib.h	(revision 302)
+++ asp3_wo_tecs/trunk/include/t_stdlib.h	(revision 302)
@@ -0,0 +1,91 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  Copyright (C) 2004-2006 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: t_stdlib.h 117 2014-05-13 19:41:44Z ertl-hiro $
+ */
+
+/*
+ *		åºæ¬çãªã©ã¤ãã©ãªé¢æ°
+ */
+
+#ifndef TOPPERS_T_STDLIB_H
+#define TOPPERS_T_STDLIB_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <t_stddef.h>
+
+/*
+ *  ã¨ã©ã¼ã¡ãã»ã¼ã¸æå­åãè¿ãé¢æ°
+ *
+ *  ercdã§æå®ãããã¨ã©ã¼ã³ã¼ãã®ã¡ã¤ã³ã¨ã©ã¼ã³ã¼ãã®åç§°ï¼E_PARï¼
+ *  E_OBJãªã©ï¼ã®æå­åãè¿ãé¢æ°ï¼
+ */
+extern const char	*itron_strerror(ER ercd) throw();
+
+/*
+ *  ã¨ã©ã¼ã¡ãã»ã¼ã¸ã®ã­ã°åºå
+ *
+ *  ãµã¼ãã¹ã³ã¼ã«ãã¨ã©ã¼ãè¿ããå ´åã«ï¼ãã®ãã¡ã¤ã«åï¼è¡çªå·ï¼ã¡ã¤
+ *  ã³ã¨ã©ã¼ã³ã¼ãç­ãè¡¨ç¤ºããããã®é¢æ°ï¼
+ */
+extern void		t_perror(uint_t prio, const char *file, int_t line,
+									const char *expr, ER ercd) throw();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_T_STDLIB_H */
Index: asp3_wo_tecs/trunk/include/t_syslog.h
===================================================================
--- asp3_wo_tecs/trunk/include/t_syslog.h	(revision 302)
+++ asp3_wo_tecs/trunk/include/t_syslog.h	(revision 302)
@@ -0,0 +1,375 @@
+/*
+ *  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) 2004-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: t_syslog.h 127 2014-05-17 12:20:22Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ã­ã°åºåãè¡ãããã®å®ç¾©
+ *
+ *  ã·ã¹ãã ã­ã°ãµã¼ãã¹ã¯ï¼ã·ã¹ãã ã®ã­ã°æ
+å ±ãåºåããããã®ãµã¼ãã¹
+ *  ã§ããï¼ã«ã¼ãã«ããã®ã­ã°æ
+å ±ã®åºåã«ãç¨ããããï¼å
+é¨ã§å¾
+ã¡ç¶æ
+
+ *  ã«ã¯ãããã¨ã¯ãªãï¼
+ *
+ *  ã­ã°æ
+å ±ã¯ï¼ã«ã¼ãã«å
+ã®ã­ã°ãããã¡ã«æ¸ãè¾¼ããï¼ä½ã¬ãã«ã®æå­åº
+ *  åé¢æ°ãç¨ãã¦åºåããï¼ã©ã¡ããä½¿ããã¯ï¼æ¡å¼µãµã¼ãã¹ã³ã¼ã«ã§åã
+ *  æãããã¨ãã§ããï¼
+ *
+ *  ã­ã°ãããã¡é åããªã¼ããã­ã¼ããå ´åã«ã¯ï¼å¤ãã­ã°æ
+å ±ãæ¶ãã¦ä¸
+ *  æ¸ãããï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ãããã¨ã§ï¼ãã¯ã­å®ç¾©ä»¥å¤ã®è¨è¿°ã
+ *  é¤ããã¨ãã§ããï¼
+ */
+
+#ifndef TOPPERS_T_SYSLOG_H
+#define TOPPERS_T_SYSLOG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <t_stddef.h>
+
+/*
+ *  ã­ã°æ
+å ±ã®ç¨®å¥ã®å®ç¾©
+ */
+#define LOG_TYPE_COMMENT	UINT_C(0x01)	/* ã³ã¡ã³ã */
+#define LOG_TYPE_ASSERT		UINT_C(0x02)	/* ã¢ãµã¼ã·ã§ã³ã®å¤±æ */
+
+#define LOG_TYPE_INH		UINT_C(0x11)	/* å²è¾¼ã¿ãã³ãã© */
+#define LOG_TYPE_ISR		UINT_C(0x12)	/* å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ */
+#define LOG_TYPE_CYC		UINT_C(0x13)	/* å¨æãã³ãã© */
+#define LOG_TYPE_ALM		UINT_C(0x14)	/* ã¢ã©ã¼ã ãã³ãã© */
+#define LOG_TYPE_OVR		UINT_C(0x15)	/* ãªã¼ãã©ã³ãã³ãã© */
+#define LOG_TYPE_EXC		UINT_C(0x16)	/* CPUä¾å¤ãã³ãã© */
+#define LOG_TYPE_TSKSTAT	UINT_C(0x21)	/* ã¿ã¹ã¯ç¶æ
+å¤å */
+#define LOG_TYPE_DSP		UINT_C(0x31)	/* ãã£ã¹ãããã£ */
+#define LOG_TYPE_SVC		UINT_C(0x41)	/* ãµã¼ãã¹ã³ã¼ã« */
+
+#define LOG_ENTER			UINT_C(0x00)	/* å
+¥å£ï¼éå§ */
+#define LOG_LEAVE			UINT_C(0x80)	/* åºå£ï¼çµäº */
+
+/*
+ *  ã­ã°æ
+å ±ã®éè¦åº¦ã®å®ç¾©
+ */
+#define LOG_EMERG			UINT_C(0)		/* ã·ã£ãããã¦ã³ã«å¤ããã¨ã©ã¼ */
+#define LOG_ALERT			UINT_C(1)
+#define LOG_CRIT			UINT_C(2)
+#define LOG_ERROR			UINT_C(3)		/* ã·ã¹ãã ã¨ã©ã¼ */
+#define LOG_WARNING			UINT_C(4)		/* è­¦åã¡ãã»ã¼ã¸ */
+#define LOG_NOTICE			UINT_C(5)
+#define LOG_INFO			UINT_C(6)
+#define LOG_DEBUG			UINT_C(7)		/* ãããã°ç¨ã¡ãã»ã¼ã¸ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã­ã°æ
+å ±ã®ãã¼ã¿æ§é 
+ */
+
+#ifndef LOGTIM
+#define LOGTIM		HRTCNT			/* ã­ã°æå»ã®ãã¼ã¿å */
+#endif /* LOGTIM */
+
+#define TNUM_LOGPAR		6			/* ã­ã°ãã©ã¡ã¼ã¿ã®æ° */
+
+#ifndef LOGPAR
+#define LOGPAR		intptr_t		/* ã­ã°ãã©ã¡ã¼ã¿ã®ãã¼ã¿å */
+#define ULOGPAR		uintptr_t
+#endif /* LOGPAR */
+
+typedef struct {
+	uint_t	logtype;				/* ã­ã°æ
+å ±ã®ç¨®å¥ */
+	LOGTIM	logtim;					/* ã­ã°æå» */
+	LOGPAR	logpar[TNUM_LOGPAR];	/* ã­ã°ãã©ã¡ã¼ã¿ */
+} SYSLOG;
+
+/*
+ *  ã­ã°æ
+å ±ã®éè¦åº¦ã®ãããããããä½ãããã®ãã¯ã­
+ */
+#define LOG_MASK(prio)		(1U << (prio))
+#define LOG_UPTO(prio)		((1U << ((prio) + 1)) - 1)
+
+/*
+ *  ãã±ããå½¢å¼ã®å®ç¾©
+ */
+typedef struct t_syslog_rlog {
+	uint_t	count;		/* ã­ã°ãããã¡ä¸­ã®ã­ã°ã®æ° */
+	uint_t	lost;		/* å¤±ãããã­ã°ã®æ° */
+	uint_t	logmask;	/* ã­ã°ãããã¡ã«è¨é²ãã¹ãéè¦åº¦ */
+	uint_t	lowmask;	/* ä½ã¬ãã«åºåãã¹ãéè¦åº¦ */
+} T_SYSLOG_RLOG;
+
+/*
+ *  ã­ã°æ
+å ±ãåºåããããã®ã©ã¤ãã©ãªé¢æ°
+ */
+
+#ifndef TOPPERS_OMIT_SYSLOG
+
+extern ER	syslog_wri_log(uint_t prio, const SYSLOG *p_syslog) throw();
+
+Inline void
+_syslog_0(uint_t prio, uint_t type)
+{
+	SYSLOG	logbuf;
+
+	logbuf.logtype = type;
+	(void) syslog_wri_log(prio, &logbuf);
+}
+
+Inline void
+_syslog_1(uint_t prio, uint_t type, LOGPAR arg1)
+{
+	SYSLOG	logbuf;
+
+	logbuf.logtype = type;
+	logbuf.logpar[0] = arg1;
+	(void) syslog_wri_log(prio, &logbuf);
+}
+
+Inline void
+_syslog_2(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2)
+{
+	SYSLOG	logbuf;
+
+	logbuf.logtype = type;
+	logbuf.logpar[0] = arg1;
+	logbuf.logpar[1] = arg2;
+	(void) syslog_wri_log(prio, &logbuf);
+}
+
+Inline void
+_syslog_3(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2, LOGPAR arg3)
+{
+	SYSLOG	logbuf;
+
+	logbuf.logtype = type;
+	logbuf.logpar[0] = arg1;
+	logbuf.logpar[1] = arg2;
+	logbuf.logpar[2] = arg3;
+	(void) syslog_wri_log(prio, &logbuf);
+}
+
+Inline void
+_syslog_4(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2,
+											LOGPAR arg3, LOGPAR arg4)
+{
+	SYSLOG	logbuf;
+
+	logbuf.logtype = type;
+	logbuf.logpar[0] = arg1;
+	logbuf.logpar[1] = arg2;
+	logbuf.logpar[2] = arg3;
+	logbuf.logpar[3] = arg4;
+	(void) syslog_wri_log(prio, &logbuf);
+}
+
+Inline void
+_syslog_5(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2,
+								LOGPAR arg3, LOGPAR arg4, LOGPAR arg5)
+{
+	SYSLOG	logbuf;
+
+	logbuf.logtype = type;
+	logbuf.logpar[0] = arg1;
+	logbuf.logpar[1] = arg2;
+	logbuf.logpar[2] = arg3;
+	logbuf.logpar[3] = arg4;
+	logbuf.logpar[4] = arg5;
+	(void) syslog_wri_log(prio, &logbuf);
+}
+
+Inline void
+_syslog_6(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2,
+					LOGPAR arg3, LOGPAR arg4, LOGPAR arg5, LOGPAR arg6)
+{
+	SYSLOG	logbuf;
+
+	logbuf.logtype = type;
+	logbuf.logpar[0] = arg1;
+	logbuf.logpar[1] = arg2;
+	logbuf.logpar[2] = arg3;
+	logbuf.logpar[3] = arg4;
+	logbuf.logpar[4] = arg5;
+	logbuf.logpar[5] = arg6;
+	(void) syslog_wri_log(prio, &logbuf);
+}
+
+/*
+ *  ã­ã°æ
+å ±ï¼ã³ã¡ã³ãï¼ãåºåããããã®ã©ã¤ãã©ãªé¢æ°ï¼vasyslog.cï¼
+ */
+extern void	syslog(uint_t prio, const char *format, ...) throw();
+
+#else /* TOPPERS_OMIT_SYSLOG */
+
+/*
+ *  ã·ã¹ãã ã­ã°åºåãææ­¢ããå ´å
+ */
+
+Inline void
+_syslog_0(uint_t prio, uint_t type)
+{
+}
+
+Inline void
+_syslog_1(uint_t prio, uint_t type, LOGPAR arg1)
+{
+}
+
+Inline void
+_syslog_2(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2)
+{
+}
+
+Inline void
+_syslog_3(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2, LOGPAR arg3)
+{
+}
+
+Inline void
+_syslog_4(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2,
+											LOGPAR arg3, LOGPAR arg4)
+{
+}
+
+Inline void
+_syslog_5(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2,
+								LOGPAR arg3, LOGPAR arg4, LOGPAR arg5)
+{
+}
+
+Inline void
+_syslog_6(uint_t prio, uint_t type, LOGPAR arg1, LOGPAR arg2,
+					LOGPAR arg3, LOGPAR arg4, LOGPAR arg5, LOGPAR arg6)
+{
+}
+
+Inline void
+syslog(uint_t prio, const char *format, ...)
+{
+}
+
+#endif /* TOPPERS_OMIT_SYSLOG */
+
+/*
+ *  ã­ã°æ
+å ±ï¼ã³ã¡ã³ãï¼ãåºåããããã®ãã¯ã­
+ *
+ *  formatããã³å¾ç¶ã®å¼æ°ããä½æããã¡ãã»ã¼ã¸ãï¼éå¤§åº¦prioã§ã­ã°æ
+
+ *  å ±ã¨ãã¦åºåããããã®ãã¯ã­ï¼arg1ãargnã¯LOGPARåã«ã­ã£ã¹ãããã
+ *  ãï¼LOGPARåã«åå¤æã§ããä»»æã®åã§ããï¼
+ */
+
+#define syslog_0(prio, format) \
+				_syslog_1(prio, LOG_TYPE_COMMENT, (LOGPAR)(format))
+
+#define syslog_1(prio, format, arg1) \
+				_syslog_2(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \
+														(LOGPAR)(arg1))
+
+#define syslog_2(prio, format, arg1, arg2) \
+				_syslog_3(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \
+										(LOGPAR)(arg1), (LOGPAR)(arg2))
+
+#define syslog_3(prio, format, arg1, arg2, arg3) \
+				_syslog_4(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \
+						(LOGPAR)(arg1), (LOGPAR)(arg2), (LOGPAR)(arg3))
+
+#define syslog_4(prio, format, arg1, arg2, arg3, arg4) \
+				_syslog_5(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \
+						(LOGPAR)(arg1), (LOGPAR)(arg2), (LOGPAR)(arg3), \
+														(LOGPAR)(arg4))
+
+#define syslog_5(prio, format, arg1, arg2, arg3, arg4, arg5) \
+				_syslog_6(prio, LOG_TYPE_COMMENT, (LOGPAR)(format), \
+						(LOGPAR)(arg1), (LOGPAR)(arg2), (LOGPAR)(arg3), \
+										(LOGPAR)(arg4), (LOGPAR)(arg5))
+
+/*
+ *  ã­ã°æ
+å ±ï¼ã¢ãµã¼ã·ã§ã³ã®å¤±æï¼ãåºåããããã®ãã¯ã­
+ */
+#ifndef TOPPERS_assert_fail
+#define TOPPERS_assert_fail(exp, file, line) \
+				_syslog_3(LOG_EMERG, LOG_TYPE_ASSERT, (LOGPAR)(file), \
+										(LOGPAR)(line), (LOGPAR)(exp))
+#endif /* TOPPERS_assert_fail */
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_T_SYSLOG_H */
Index: asp3_wo_tecs/trunk/kernel/Makefile.kernel
===================================================================
--- asp3_wo_tecs/trunk/kernel/Makefile.kernel	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/Makefile.kernel	(revision 302)
@@ -0,0 +1,154 @@
+#
+#  TOPPERS/ASP Kernel
+#      Toyohashi Open Platform for Embedded Real-Time Systems/
+#      Advanced Standard Profile Kernel
+# 
+#  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: Makefile.kernel 488 2016-01-09 23:15:47Z ertl-hiro $
+# 
+
+#
+#		ã«ã¼ãã«ã®ãã¡ã¤ã«æ§æã®å®ç¾©
+#
+
+#
+#  1ã¤ã®ã½ã¼ã¹ãã¡ã¤ã«ããè¤æ°ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ãçæããããã«ä½
+#  æãããã½ã¼ã¹ãã¡ã¤ã«ã®ãªã¹ã
+#
+KERNEL_FCSRCS = startup.c task.c taskhook.c wait.c time_event.c \
+				task_manage.c task_refer.c task_sync.c task_term.c \
+				semaphore.c eventflag.c dataqueue.c pridataq.c mutex.c \
+				mempfix.c time_manage.c cyclic.c alarm.c \
+				sys_manage.c interrupt.c exception.c
+
+#
+#  åã½ã¼ã¹ãã¡ã¤ã«ããçæããããªãã¸ã§ã¯ããã¡ã¤ã«ã®ãªã¹ã
+#
+startup = sta_ker.o ext_ker.o
+
+task = tskini.o tsksched.o tskrun.o tsknrun.o \
+		tskdmt.o tskact.o tskpri.o tskrot.o tskterm.o
+
+taskhook = mtxhook.o
+
+wait = waimake.o waicmp.o waitmo.o waitmook.o \
+		wobjwai.o wobjwaitmo.o iniwque.o
+
+time_event = tmeini.o tmeup.o tmedown.o tmecur.o tmeset.o \
+		tmereg.o tmeenq.o tmedeq.o tmechk.o tmeltim.o sigtim.o
+
+task_manage = act_tsk.o can_act.o get_tst.o chg_pri.o get_pri.o get_inf.o
+
+task_refer = ref_tsk.o
+
+task_sync = slp_tsk.o tslp_tsk.o wup_tsk.o can_wup.o \
+		rel_wai.o sus_tsk.o rsm_tsk.o dly_tsk.o
+
+task_term = ext_tsk.o ras_ter.o ena_ter.o dis_ter.o sns_ter.o ter_tsk.o
+
+semaphore = semini.o sig_sem.o \
+		wai_sem.o pol_sem.o twai_sem.o ini_sem.o ref_sem.o
+
+eventflag = flgini.o flgcnd.o set_flg.o clr_flg.o \
+		wai_flg.o pol_flg.o twai_flg.o ini_flg.o ref_flg.o
+
+dataqueue = dtqini.o dtqenq.o dtqfenq.o dtqdeq.o dtqsnd.o dtqfsnd.o dtqrcv.o \
+		snd_dtq.o psnd_dtq.o tsnd_dtq.o fsnd_dtq.o \
+		rcv_dtq.o prcv_dtq.o trcv_dtq.o ini_dtq.o ref_dtq.o
+
+pridataq = pdqini.o pdqenq.o pdqdeq.o pdqsnd.o pdqrcv.o \
+		snd_pdq.o psnd_pdq.o tsnd_pdq.o \
+		rcv_pdq.o prcv_pdq.o trcv_pdq.o ini_pdq.o ref_pdq.o
+
+mutex = mtxini.o mtxchk.o mtxscan.o mtxdrop.o mtxacq.o mtxrel.o mtxrela.o \
+		loc_mtx.o ploc_mtx.o tloc_mtx.o unl_mtx.o ini_mtx.o ref_mtx.o
+
+mempfix = mpfini.o mpfget.o get_mpf.o pget_mpf.o tget_mpf.o \
+		rel_mpf.o ini_mpf.o ref_mpf.o
+
+time_manage = set_tim.o get_tim.o adj_tim.o fch_hrt.o
+
+cyclic = cycini.o sta_cyc.o stp_cyc.o ref_cyc.o cyccal.o
+
+alarm = almini.o sta_alm.o stp_alm.o ref_alm.o almcal.o
+
+sys_manage = rot_rdq.o get_tid.o get_lod.o get_nth.o \
+		loc_cpu.o unl_cpu.o dis_dsp.o ena_dsp.o \
+		sns_ctx.o sns_loc.o sns_dsp.o sns_dpn.o sns_ker.o
+
+interrupt = intini.o dis_int.o ena_int.o chg_ipm.o get_ipm.o
+
+exception = excini.o xsns_dpn.o
+
+#
+#  çæããããªãã¸ã§ã¯ããã¡ã¤ã«ã®ä¾å­é¢ä¿ã®å®ç¾©
+#
+$(startup) $(startup:.o=.s): startup.c
+$(task) $(task:.o=.s): task.c
+$(taskhook) $(taskhook:.o=.s): taskhook.c
+$(wait) $(wait:.o=.s): wait.c
+$(time_event) $(time_event:.o=.s): time_event.c
+$(task_manage) $(task_manage:.o=.s): task_manage.c
+$(task_refer) $(task_refer:.o=.s): task_refer.c
+$(task_sync) $(task_sync:.o=.s): task_sync.c
+$(task_term) $(task_term:.o=.s): task_term.c
+$(semaphore) $(semaphore:.o=.s): semaphore.c
+$(eventflag) $(eventflag:.o=.s): eventflag.c
+$(dataqueue) $(dataqueue:.o=.s): dataqueue.c
+$(pridataq) $(pridataq:.o=.s): pridataq.c
+$(mutex) $(mutex:.o=.s): mutex.c
+$(mempfix) $(mempfix:.o=.s): mempfix.c
+$(time_manage) $(time_manage:.o=.s): time_manage.c
+$(cyclic) $(cyclic:.o=.s): cyclic.c
+$(alarm) $(alarm:.o=.s): alarm.c
+$(sys_manage) $(sys_manage:.o=.s): sys_manage.c
+$(interrupt) $(interrupt:.o=.s): interrupt.c
+$(exception) $(exception:.o=.s): exception.c
Index: asp3_wo_tecs/trunk/kernel/alarm.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/alarm.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/alarm.c	(revision 302)
@@ -0,0 +1,265 @@
+/*
+ *  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: alarm.c 451 2015-08-14 15:29:07Z ertl-hiro $
+ */
+
+/*
+ *		ã¢ã©ã¼ã éç¥æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "alarm.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ALM_ENTER
+#define LOG_ALM_ENTER(p_almcb)
+#endif /* LOG_ALM_ENTER */
+
+#ifndef LOG_ALM_LEAVE
+#define LOG_ALM_LEAVE(p_almcb)
+#endif /* LOG_ALM_LEAVE */
+
+#ifndef LOG_STA_ALM_ENTER
+#define LOG_STA_ALM_ENTER(almid, almtim)
+#endif /* LOG_STA_ALM_ENTER */
+
+#ifndef LOG_STA_ALM_LEAVE
+#define LOG_STA_ALM_LEAVE(ercd)
+#endif /* LOG_STA_ALM_LEAVE */
+
+#ifndef LOG_STP_ALM_ENTER
+#define LOG_STP_ALM_ENTER(almid)
+#endif /* LOG_STP_ALM_ENTER */
+
+#ifndef LOG_STP_ALM_LEAVE
+#define LOG_STP_ALM_LEAVE(ercd)
+#endif /* LOG_STP_ALM_LEAVE */
+
+#ifndef LOG_REF_ALM_ENTER
+#define LOG_REF_ALM_ENTER(almid, pk_ralm)
+#endif /* LOG_REF_ALM_ENTER */
+
+#ifndef LOG_REF_ALM_LEAVE
+#define LOG_REF_ALM_LEAVE(ercd, pk_ralm)
+#endif /* LOG_REF_ALM_LEAVE */
+
+/*
+ *  ã¢ã©ã¼ã éç¥ã®æ°
+ */
+#define tnum_alm	((uint_t)(tmax_almid - TMIN_ALMID + 1))
+
+/*
+ *  ã¢ã©ã¼ã éç¥IDããã¢ã©ã¼ã éç¥ç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_ALM(almid)	((uint_t)((almid) - TMIN_ALMID))
+#define get_almcb(almid)	(&(almcb_table[INDEX_ALM(almid)]))
+
+/*
+ *  ã¢ã©ã¼ã éç¥æ©è½ã®åæå
+ */
+#ifdef TOPPERS_almini
+
+void
+initialize_alarm(void)
+{
+	uint_t	i;
+	ALMCB	*p_almcb;
+
+	for (i = 0; i < tnum_alm; i++) {
+		p_almcb = &(almcb_table[i]);
+		p_almcb->p_alminib = &(alminib_table[i]);
+		p_almcb->almsta = false;
+		p_almcb->tmevtb.callback = (CBACK) call_alarm;
+		p_almcb->tmevtb.arg = (void *) p_almcb;
+	}
+}
+
+#endif /* TOPPERS_almini */
+
+/*
+ *  ã¢ã©ã¼ã éç¥ã®åä½éå§
+ */
+#ifdef TOPPERS_sta_alm
+
+ER
+sta_alm(ID almid, RELTIM almtim)
+{
+	ALMCB	*p_almcb;
+	ER		ercd;
+
+	LOG_STA_ALM_ENTER(almid, almtim);
+	CHECK_UNL();
+	CHECK_ID(VALID_ALMID(almid));
+	CHECK_PAR(VALID_RELTIM(almtim));
+	p_almcb = get_almcb(almid);
+
+	lock_cpu();
+	if (p_almcb->almsta) {
+		tmevtb_dequeue(&(p_almcb->tmevtb));
+	}
+	else {
+		p_almcb->almsta = true;
+	}
+	tmevtb_enqueue(&(p_almcb->tmevtb), almtim);
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_STA_ALM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_sta_alm */
+
+/*
+ *  ã¢ã©ã¼ã éç¥ã®åä½åæ­¢
+ */
+#ifdef TOPPERS_stp_alm
+
+ER
+stp_alm(ID almid)
+{
+	ALMCB	*p_almcb;
+	ER		ercd;
+
+	LOG_STP_ALM_ENTER(almid);
+	CHECK_UNL();
+	CHECK_ID(VALID_ALMID(almid));
+	p_almcb = get_almcb(almid);
+
+	lock_cpu();
+	if (p_almcb->almsta) {
+		p_almcb->almsta = false;
+		tmevtb_dequeue(&(p_almcb->tmevtb));
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_STP_ALM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_stp_alm */
+
+/*
+ *  ã¢ã©ã¼ã éç¥ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_alm
+
+ER
+ref_alm(ID almid, T_RALM *pk_ralm)
+{
+	ALMCB	*p_almcb;
+	ER		ercd;
+    
+	LOG_REF_ALM_ENTER(almid, pk_ralm);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_ALMID(almid));
+	p_almcb = get_almcb(almid);
+
+	lock_cpu();
+	if (p_almcb->almsta) {
+		pk_ralm->almstat = TALM_STA;
+		pk_ralm->lefttim = tmevt_lefttim(&(p_almcb->tmevtb));
+	}
+	else {
+		pk_ralm->almstat = TALM_STP;
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_ALM_LEAVE(ercd, pk_ralm);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_alm */
+
+/*
+ *  ã¢ã©ã¼ã éç¥èµ·åã«ã¼ãã³
+ */
+#ifdef TOPPERS_almcal
+
+void
+call_alarm(ALMCB *p_almcb)
+{
+	/*
+	 *  ã¢ã©ã¼ã éç¥ãåæ­¢ç¶æ
+ã«ããï¼
+	 */
+	p_almcb->almsta = false;
+
+	/*
+	 *  éç¥ãã³ãã©ãï¼CPUã­ãã¯è§£é¤ç¶æ
+ã§å¼ã³åºãï¼
+	 */
+	unlock_cpu();
+
+	LOG_ALM_ENTER(p_almcb);
+	(*(p_almcb->p_alminib->nfyhdr))(p_almcb->p_alminib->exinf);
+	LOG_ALM_LEAVE(p_almcb);
+
+	if (!sense_lock()) {
+		lock_cpu();
+	}
+}
+
+#endif /* TOPPERS_almcal */
Index: asp3_wo_tecs/trunk/kernel/alarm.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/alarm.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/alarm.h	(revision 302)
@@ -0,0 +1,113 @@
+/*
+ *  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: alarm.h 325 2015-06-21 05:48:02Z ertl-hiro $
+ */
+
+/*
+ *		ã¢ã©ã¼ã éç¥æ©è½
+ */
+
+#ifndef TOPPERS_ALARM_H
+#define TOPPERS_ALARM_H
+
+#include "kernel_impl.h"
+#include "time_event.h"
+
+/*
+ *  ã¢ã©ã¼ã éç¥åæåãã­ãã¯
+ */
+typedef struct alarm_handler_initialization_block {
+	ATR			almatr;			/* ã¢ã©ã¼ã éç¥å±æ§ */
+	intptr_t	exinf;			/* éç¥ãã³ãã©ã®æ¡å¼µæ
+å ± */
+	NFYHDR		nfyhdr;			/* éç¥ãã³ãã©ã®èµ·åçªå° */
+} ALMINIB;
+
+/*
+ *  ã¢ã©ã¼ã éç¥ç®¡çãã­ãã¯
+ */
+typedef struct alarm_handler_control_block {
+	const ALMINIB *p_alminib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	bool_t		almsta;			/* ã¢ã©ã¼ã éç¥ã®åä½ç¶æ
+ */
+	TMEVTB		tmevtb;			/* ã¿ã¤ã ã¤ãã³ããã­ãã¯ */
+} ALMCB;
+
+/*
+ *  ã¢ã©ã¼ã éç¥IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_almid;
+
+/*
+ *  ã¢ã©ã¼ã éç¥åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const ALMINIB	alminib_table[];
+
+/*
+ *  ã¢ã©ã¼ã éç¥ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern ALMCB	almcb_table[];
+
+/*
+ *  ã¢ã©ã¼ã éç¥æ©è½ã®åæå
+ */
+extern void	initialize_alarm(void);
+
+/*
+ *  ã¢ã©ã¼ã éç¥èµ·åã«ã¼ãã³
+ */
+extern void	call_alarm(ALMCB *p_almcb);
+
+#endif /* TOPPERS_ALARM_H */
Index: asp3_wo_tecs/trunk/kernel/alarm.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/alarm.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/alarm.tf	(revision 302)
@@ -0,0 +1,139 @@
+$
+$   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/allfunc.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/allfunc.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/allfunc.h	(revision 302)
@@ -0,0 +1,256 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: allfunc.h 236 2014-09-28 16:24:33Z ertl-hiro $
+ */
+
+/*
+ *		ãã¹ã¦ã®é¢æ°ãã³ã³ãã¤ã«ããããã®å®ç¾©
+ */
+
+#ifndef TOPPERS_ALLFUNC_H
+#define TOPPERS_ALLFUNC_H
+
+/* startup.c */
+#define TOPPERS_sta_ker
+#define TOPPERS_ext_ker
+
+/* task.c */
+#define TOPPERS_tskini
+#define TOPPERS_tsksched
+#define TOPPERS_tskrun
+#define TOPPERS_tsknrun
+#define TOPPERS_tskdmt
+#define TOPPERS_tskact
+#define TOPPERS_tskpri
+#define TOPPERS_tskrot
+#define TOPPERS_tskterm
+
+/* taskhook.c */
+#define TOPPERS_mtxhook
+
+/* wait.c */
+#define TOPPERS_waimake
+#define TOPPERS_waicmp
+#define TOPPERS_waitmo
+#define TOPPERS_waitmook
+#define TOPPERS_wobjwai
+#define TOPPERS_wobjwaitmo
+#define TOPPERS_iniwque
+
+/* time_event.c */
+#define TOPPERS_tmeini
+#define TOPPERS_tmeup
+#define TOPPERS_tmedown
+#define TOPPERS_tmecur
+#define TOPPERS_tmeset
+#define TOPPERS_tmereg
+#define TOPPERS_tmeenq
+#define TOPPERS_tmedeq
+#define TOPPERS_tmechk
+#define TOPPERS_tmeltim
+#define TOPPERS_sigtim
+
+/* task_manage.c */
+#define TOPPERS_act_tsk
+#define TOPPERS_can_act
+#define TOPPERS_get_tst
+#define TOPPERS_chg_pri
+#define TOPPERS_get_pri
+#define TOPPERS_get_inf
+
+/* task_refer.c */
+#define TOPPERS_ref_tsk
+
+/* task_sync.c */
+#define TOPPERS_slp_tsk
+#define TOPPERS_tslp_tsk
+#define TOPPERS_wup_tsk
+#define TOPPERS_can_wup
+#define TOPPERS_rel_wai
+#define TOPPERS_sus_tsk
+#define TOPPERS_rsm_tsk
+#define TOPPERS_dly_tsk
+
+/* task_term.c */
+#define TOPPERS_ext_tsk
+#define TOPPERS_ras_ter
+#define TOPPERS_dis_ter
+#define TOPPERS_ena_ter
+#define TOPPERS_sns_ter
+#define TOPPERS_ter_tsk
+
+/* semaphore.c */
+#define TOPPERS_semini
+#define TOPPERS_sig_sem
+#define TOPPERS_wai_sem
+#define TOPPERS_pol_sem
+#define TOPPERS_twai_sem
+#define TOPPERS_ini_sem
+#define TOPPERS_ref_sem
+
+/* eventflag.c */
+#define TOPPERS_flgini
+#define TOPPERS_flgcnd
+#define TOPPERS_set_flg
+#define TOPPERS_clr_flg
+#define TOPPERS_wai_flg
+#define TOPPERS_pol_flg
+#define TOPPERS_twai_flg
+#define TOPPERS_ini_flg
+#define TOPPERS_ref_flg
+
+/* dataqueue.c */
+#define TOPPERS_dtqini
+#define TOPPERS_dtqenq
+#define TOPPERS_dtqfenq
+#define TOPPERS_dtqdeq
+#define TOPPERS_dtqsnd
+#define TOPPERS_dtqfsnd
+#define TOPPERS_dtqrcv
+#define TOPPERS_snd_dtq
+#define TOPPERS_psnd_dtq
+#define TOPPERS_tsnd_dtq
+#define TOPPERS_fsnd_dtq
+#define TOPPERS_rcv_dtq
+#define TOPPERS_prcv_dtq
+#define TOPPERS_trcv_dtq
+#define TOPPERS_ini_dtq
+#define TOPPERS_ref_dtq
+
+/* pridataq.c */
+#define TOPPERS_pdqini
+#define TOPPERS_pdqenq
+#define TOPPERS_pdqdeq
+#define TOPPERS_pdqsnd
+#define TOPPERS_pdqrcv
+#define TOPPERS_snd_pdq
+#define TOPPERS_psnd_pdq
+#define TOPPERS_tsnd_pdq
+#define TOPPERS_rcv_pdq
+#define TOPPERS_prcv_pdq
+#define TOPPERS_trcv_pdq
+#define TOPPERS_ini_pdq
+#define TOPPERS_ref_pdq
+
+/* mutex.c */
+#define TOPPERS_mtxini
+#define TOPPERS_mtxchk
+#define TOPPERS_mtxscan
+#define TOPPERS_mtxdrop
+#define TOPPERS_mtxacq
+#define TOPPERS_mtxrel
+#define TOPPERS_mtxrela
+#define TOPPERS_loc_mtx
+#define TOPPERS_ploc_mtx
+#define TOPPERS_tloc_mtx
+#define TOPPERS_unl_mtx
+#define TOPPERS_ini_mtx
+#define TOPPERS_ref_mtx
+
+/* mempfix.c */
+#define TOPPERS_mpfini
+#define TOPPERS_mpfget
+#define TOPPERS_get_mpf
+#define TOPPERS_pget_mpf
+#define TOPPERS_tget_mpf
+#define TOPPERS_rel_mpf
+#define TOPPERS_ini_mpf
+#define TOPPERS_ref_mpf
+
+/* time_manage.c */
+#define TOPPERS_set_tim
+#define TOPPERS_get_tim
+#define TOPPERS_adj_tim
+#define TOPPERS_fch_hrt
+
+/* cyclic.c */
+#define TOPPERS_cycini
+#define TOPPERS_sta_cyc
+#define TOPPERS_stp_cyc
+#define TOPPERS_ref_cyc
+#define TOPPERS_cyccal
+
+/* alarm.c */
+#define TOPPERS_almini
+#define TOPPERS_sta_alm
+#define TOPPERS_stp_alm
+#define TOPPERS_ref_alm
+#define TOPPERS_almcal
+
+/* sys_manage.c */
+#define TOPPERS_rot_rdq
+#define TOPPERS_get_tid
+#define TOPPERS_get_lod
+#define TOPPERS_get_nth
+#define TOPPERS_loc_cpu
+#define TOPPERS_unl_cpu
+#define TOPPERS_dis_dsp
+#define TOPPERS_ena_dsp
+#define TOPPERS_sns_ctx
+#define TOPPERS_sns_loc
+#define TOPPERS_sns_dsp
+#define TOPPERS_sns_dpn
+#define TOPPERS_sns_ker
+
+/* interrupt.c */
+#define TOPPERS_intini
+#define TOPPERS_dis_int
+#define TOPPERS_ena_int
+#define TOPPERS_chg_ipm
+#define TOPPERS_get_ipm
+
+/* exception.c */
+#define TOPPERS_excini
+#define TOPPERS_xsns_dpn
+
+#endif /* TOPPERS_ALLFUNC_H */
Index: asp3_wo_tecs/trunk/kernel/check.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/check.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/check.h	(revision 302)
@@ -0,0 +1,196 @@
+/*
+ *  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: check.h 356 2015-07-25 10:44:32Z ertl-hiro $
+ */
+
+/*
+ *		ã¨ã©ã¼ãã§ãã¯ç¨ãã¯ã­
+ */
+
+#ifndef TOPPERS_CHECK_H
+#define TOPPERS_CHECK_H
+
+#include "kernel_impl.h"
+
+/*
+ *  ãªãã¸ã§ã¯ãIDã®ç¯å²ã®å¤å®
+ */
+#define VALID_TSKID(tskid)	(TMIN_TSKID <= (tskid) && (tskid) <= tmax_tskid)
+#define VALID_SEMID(semid)	(TMIN_SEMID <= (semid) && (semid) <= tmax_semid)
+#define VALID_FLGID(flgid)	(TMIN_FLGID <= (flgid) && (flgid) <= tmax_flgid)
+#define VALID_DTQID(dtqid)	(TMIN_DTQID <= (dtqid) && (dtqid) <= tmax_dtqid)
+#define VALID_PDQID(pdqid)	(TMIN_PDQID <= (pdqid) && (pdqid) <= tmax_pdqid)
+#define VALID_MTXID(mtxid)	(TMIN_MTXID <= (mtxid) && (mtxid) <= tmax_mtxid)
+#define VALID_MPFID(mpfid)	(TMIN_MPFID <= (mpfid) && (mpfid) <= tmax_mpfid)
+#define VALID_CYCID(cycid)	(TMIN_CYCID <= (cycid) && (cycid) <= tmax_cycid)
+#define VALID_ALMID(almid)	(TMIN_ALMID <= (almid) && (almid) <= tmax_almid)
+
+/*
+ *  ãªãã¸ã§ã¯ãçªå·ã®ç¯å²ã®å¤å®
+ */
+#ifndef VALID_INTNO_DISINT
+#define VALID_INTNO_DISINT(intno)    VALID_INTNO(intno)
+#endif /* VALID_INTNO_DISINT */
+
+#ifndef VALID_INTNO_CREISR
+#define VALID_INTNO_CREISR(intno)    VALID_INTNO(intno)
+#endif /* VALID_INTNO_CREISR */
+
+/*
+ *  åªå
+åº¦ã®ç¯å²ã®å¤å®
+ */
+#define VALID_TPRI(tpri)	(TMIN_TPRI <= (tpri) && (tpri) <= TMAX_TPRI)
+
+#ifndef VALID_INTPRI_CHGIPM
+#define VALID_INTPRI_CHGIPM(intpri) \
+				(TMIN_INTPRI <= (intpri) && (intpri) <= TIPM_ENAALL)
+#endif /* VALID_INTPRI_CHGIPM */
+
+/*
+ *  ç¸å¯¾æéã®ç¯å²ã®å¤å®
+ */
+#define VALID_RELTIM(reltim)	((reltim) <= TMAX_RELTIM)
+
+/*
+ *  ã¿ã¤ã ã¢ã¦ãæå®å¤ã®ç¯å²ã®å¤å®
+ */
+#define VALID_TMOUT(tmout)	((tmout) <= TMAX_RELTIM || (tmout) == TMO_FEVR \
+													|| (tmout) == TMO_POL)
+
+/*
+ *  å¼åºãã³ã³ãã­ã¹ãã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_TSKCTX() do {									\
+	if (sense_context()) {									\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_UNL() do {									\
+	if (sense_lock()) {										\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  å¼åºãã³ã³ãã­ã¹ãã¨CPUã­ãã¯ç¶æ
+ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_TSKCTX_UNL() do {								\
+	if (sense_context() || sense_lock()) {					\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã£ã¹ãããä¿çç¶æ
+ã§ãªããã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_DISPATCH() do {								\
+	if (sense_context() || sense_lock() || !dspflg) {		\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã®ä»ã®ã³ã³ãã­ã¹ãã¨ã©ã¼ã®ãã§ãã¯ï¼E_CTXï¼
+ */
+#define CHECK_CTX(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_CTX;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãªãã¸ã§ã¯ãIDã®ãã§ãã¯ï¼E_IDï¼
+ */
+#define CHECK_ID(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_ID;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ãã©ã¡ã¼ã¿ã¨ã©ã¼ã®ãã§ãã¯ï¼E_PARï¼
+ */
+#define CHECK_PAR(exp) do {									\
+	if (!(exp)) {											\
+		ercd = E_PAR;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+/*
+ *  ä¸æ­£ä½¿ç¨ã¨ã©ã¼ã®ãã§ãã¯ï¼E_ILUSEï¼
+ */
+#define CHECK_ILUSE(exp) do {								\
+	if (!(exp)) {											\
+		ercd = E_ILUSE;										\
+		goto error_exit;									\
+	}														\
+} while (false)
+
+#endif /* TOPPERS_CHECK_H */
Index: asp3_wo_tecs/trunk/kernel/cyclic.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/cyclic.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/cyclic.c	(revision 302)
@@ -0,0 +1,278 @@
+/*
+ *  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: cyclic.c 451 2015-08-14 15:29:07Z ertl-hiro $
+ */
+
+/*
+ *		å¨æéç¥æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "cyclic.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_CYC_ENTER
+#define LOG_CYC_ENTER(p_cyccb)
+#endif /* LOG_CYC_ENTER */
+
+#ifndef LOG_CYC_LEAVE
+#define LOG_CYC_LEAVE(p_cyccb)
+#endif /* LOG_CYC_LEAVE */
+
+#ifndef LOG_STA_CYC_ENTER
+#define LOG_STA_CYC_ENTER(cycid)
+#endif /* LOG_STA_CYC_ENTER */
+
+#ifndef LOG_STA_CYC_LEAVE
+#define LOG_STA_CYC_LEAVE(ercd)
+#endif /* LOG_STA_CYC_LEAVE */
+
+#ifndef LOG_STP_CYC_ENTER
+#define LOG_STP_CYC_ENTER(cycid)
+#endif /* LOG_STP_CYC_ENTER */
+
+#ifndef LOG_STP_CYC_LEAVE
+#define LOG_STP_CYC_LEAVE(ercd)
+#endif /* LOG_STP_CYC_LEAVE */
+
+#ifndef LOG_REF_CYC_ENTER
+#define LOG_REF_CYC_ENTER(cycid, pk_rcyc)
+#endif /* LOG_REF_CYC_ENTER */
+
+#ifndef LOG_REF_CYC_LEAVE
+#define LOG_REF_CYC_LEAVE(ercd, pk_rcyc)
+#endif /* LOG_REF_CYC_LEAVE */
+
+/*
+ *  å¨æéç¥ã®æ°
+ */
+#define tnum_cyc	((uint_t)(tmax_cycid - TMIN_CYCID + 1))
+
+/*
+ *  å¨æéç¥IDããå¨æéç¥ç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_CYC(cycid)	((uint_t)((cycid) - TMIN_CYCID))
+#define get_cyccb(cycid)	(&(cyccb_table[INDEX_CYC(cycid)]))
+
+/*
+ *  å¨æéç¥æ©è½ã®åæå
+ */
+#ifdef TOPPERS_cycini
+
+void
+initialize_cyclic(void)
+{
+	uint_t	i;
+	CYCCB	*p_cyccb;
+
+	for (i = 0; i < tnum_cyc; i++) {
+		p_cyccb = &(cyccb_table[i]);
+		p_cyccb->p_cycinib = &(cycinib_table[i]);
+		p_cyccb->tmevtb.callback = (CBACK) call_cyclic;
+		p_cyccb->tmevtb.arg = (void *) p_cyccb;
+		if ((p_cyccb->p_cycinib->cycatr & TA_STA) != 0U) {
+			/*
+			 *  ååã®èµ·åã®ããã®ã¿ã¤ã ã¤ãã³ããç»é²ããï¼»ASPD1035ï¼½
+			 *  ï¼»ASPD1062ï¼½ï¼
+			 */
+			p_cyccb->cycsta = true;
+			p_cyccb->tmevtb.evttim = (EVTTIM)(p_cyccb->p_cycinib->cycphs);
+			tmevtb_register(&(p_cyccb->tmevtb));
+		}
+		else {
+			p_cyccb->cycsta = false;
+		}
+	}
+}
+
+#endif /* TOPPERS_cycini */
+
+/*
+ *  å¨æéç¥ã®åä½éå§
+ */
+#ifdef TOPPERS_sta_cyc
+
+ER
+sta_cyc(ID cycid)
+{
+	CYCCB	*p_cyccb;
+	ER		ercd;
+
+	LOG_STA_CYC_ENTER(cycid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_CYCID(cycid));
+	p_cyccb = get_cyccb(cycid);
+
+	lock_cpu();
+	if (p_cyccb->cycsta) {
+		tmevtb_dequeue(&(p_cyccb->tmevtb));
+	}
+	else {
+		p_cyccb->cycsta = true;
+	}
+	/*
+	 *  ååã®èµ·åã®ããã®ã¿ã¤ã ã¤ãã³ããç»é²ããï¼»ASPD1036ï¼½ï¼
+	 */
+	tmevtb_enqueue(&(p_cyccb->tmevtb), p_cyccb->p_cycinib->cycphs);
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_STA_CYC_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_sta_cyc */
+
+/*
+ *  å¨æéç¥ã®åä½åæ­¢
+ */
+#ifdef TOPPERS_stp_cyc
+
+ER
+stp_cyc(ID cycid)
+{
+	CYCCB	*p_cyccb;
+	ER		ercd;
+
+	LOG_STP_CYC_ENTER(cycid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_CYCID(cycid));
+	p_cyccb = get_cyccb(cycid);
+
+	lock_cpu();
+	if (p_cyccb->cycsta) {
+		p_cyccb->cycsta = false;
+		tmevtb_dequeue(&(p_cyccb->tmevtb));
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_STP_CYC_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_stp_cyc */
+
+/*
+ *  å¨æéç¥ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_cyc
+
+ER
+ref_cyc(ID cycid, T_RCYC *pk_rcyc)
+{
+	CYCCB	*p_cyccb;
+	ER		ercd;
+    
+	LOG_REF_CYC_ENTER(cycid, pk_rcyc);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_CYCID(cycid));
+	p_cyccb = get_cyccb(cycid);
+
+	lock_cpu();
+	if (p_cyccb->cycsta) {
+		pk_rcyc->cycstat = TCYC_STA;
+		pk_rcyc->lefttim = tmevt_lefttim(&(p_cyccb->tmevtb));
+	}
+	else {
+		pk_rcyc->cycstat = TCYC_STP;
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_CYC_LEAVE(ercd, pk_rcyc);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_cyc */
+
+/*
+ *  å¨æéç¥èµ·åã«ã¼ãã³
+ */
+#ifdef TOPPERS_cyccal
+
+void
+call_cyclic(CYCCB *p_cyccb)
+{
+	/*
+	 *  æ¬¡åã®èµ·åã®ããã®ã¿ã¤ã ã¤ãã³ããç»é²ããï¼»ASPD1037ï¼½ï¼
+	 */
+	p_cyccb->tmevtb.evttim += p_cyccb->p_cycinib->cyctim;	/*ï¼»ASPD1038ï¼½*/
+	tmevtb_register(&(p_cyccb->tmevtb));
+
+	/*
+	 *  éç¥ãã³ãã©ãï¼CPUã­ãã¯è§£é¤ç¶æ
+ã§å¼ã³åºãï¼
+	 */
+	unlock_cpu();
+
+	LOG_CYC_ENTER(p_cyccb);
+	(*(p_cyccb->p_cycinib->nfyhdr))(p_cyccb->p_cycinib->exinf);
+	LOG_CYC_LEAVE(p_cyccb);
+
+	if (!sense_lock()) {
+		lock_cpu();
+	}
+}
+
+#endif /* TOPPERS_cyccal */
Index: asp3_wo_tecs/trunk/kernel/cyclic.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/cyclic.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/cyclic.h	(revision 302)
@@ -0,0 +1,118 @@
+/*
+ *  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: cyclic.h 451 2015-08-14 15:29:07Z ertl-hiro $
+ */
+
+/*
+ *		å¨æéç¥æ©è½
+ */
+
+#ifndef TOPPERS_CYCLIC_H
+#define TOPPERS_CYCLIC_H
+
+#include "kernel_impl.h"
+#include "time_event.h"
+
+/*
+ *  å¨æéç¥åæåãã­ãã¯
+ */
+typedef struct cyclic_handler_initialization_block {
+	ATR			cycatr;			/* å¨æéç¥å±æ§ */
+	intptr_t	exinf;			/* éç¥ãã³ãã©ã®æ¡å¼µæ
+å ± */
+	NFYHDR		nfyhdr;			/* éç¥ãã³ãã©ã®èµ·åçªå° */
+	RELTIM		cyctim;			/* å¨æéç¥ã®èµ·åå¨æ */
+	RELTIM		cycphs;			/* å¨æéç¥ã®èµ·åä½ç¸ */
+} CYCINIB;
+
+/*
+ *  å¨æéç¥ç®¡çãã­ãã¯
+ *
+ *	æ¬¡ã«å¨æéç¥ãèµ·åããæå»ã¯ï¼ã¿ã¤ã ã¤ãã³ããã­ãã¯ï¼tmevtbï¼ä¸­ã®
+ *	ã¿ã¤ã ã¤ãã³ãã®çºçæå»ï¼evttimï¼ã§ä¿æããï¼
+ */
+typedef struct cyclic_handler_control_block {
+	const CYCINIB *p_cycinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	bool_t		cycsta;			/* å¨æéç¥ã®åä½ç¶æ
+ */
+	TMEVTB		tmevtb;			/* ã¿ã¤ã ã¤ãã³ããã­ãã¯ */
+} CYCCB;
+
+/*
+ *  å¨æéç¥IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_cycid;
+
+/*
+ *  å¨æéç¥åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const CYCINIB	cycinib_table[];
+
+/*
+ *  å¨æéç¥ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern CYCCB	cyccb_table[];
+
+/*
+ *  å¨æéç¥æ©è½ã®åæå
+ */
+extern void	initialize_cyclic(void);
+
+/*
+ *  å¨æéç¥èµ·åã«ã¼ãã³
+ */
+extern void	call_cyclic(CYCCB *p_cyccb);
+
+#endif /* TOPPERS_CYCLIC_H */
Index: asp3_wo_tecs/trunk/kernel/cyclic.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/cyclic.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/cyclic.tf	(revision 302)
@@ -0,0 +1,157 @@
+$
+$   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/dataqueue.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/dataqueue.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/dataqueue.c	(revision 302)
@@ -0,0 +1,690 @@
+/*
+ *  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: dataqueue.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		ãã¼ã¿ã­ã¥ã¼æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "dataqueue.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_SND_DTQ_ENTER
+#define LOG_SND_DTQ_ENTER(dtqid, data)
+#endif /* LOG_SND_DTQ_ENTER */
+
+#ifndef LOG_SND_DTQ_LEAVE
+#define LOG_SND_DTQ_LEAVE(ercd)
+#endif /* LOG_SND_DTQ_LEAVE */
+
+#ifndef LOG_PSND_DTQ_ENTER
+#define LOG_PSND_DTQ_ENTER(dtqid, data)
+#endif /* LOG_PSND_DTQ_ENTER */
+
+#ifndef LOG_PSND_DTQ_LEAVE
+#define LOG_PSND_DTQ_LEAVE(ercd)
+#endif /* LOG_PSND_DTQ_LEAVE */
+
+#ifndef LOG_TSND_DTQ_ENTER
+#define LOG_TSND_DTQ_ENTER(dtqid, data, tmout)
+#endif /* LOG_TSND_DTQ_ENTER */
+
+#ifndef LOG_TSND_DTQ_LEAVE
+#define LOG_TSND_DTQ_LEAVE(ercd)
+#endif /* LOG_TSND_DTQ_LEAVE */
+
+#ifndef LOG_FSND_DTQ_ENTER
+#define LOG_FSND_DTQ_ENTER(dtqid, data)
+#endif /* LOG_FSND_DTQ_ENTER */
+
+#ifndef LOG_FSND_DTQ_LEAVE
+#define LOG_FSND_DTQ_LEAVE(ercd)
+#endif /* LOG_FSND_DTQ_LEAVE */
+
+#ifndef LOG_RCV_DTQ_ENTER
+#define LOG_RCV_DTQ_ENTER(dtqid, p_data)
+#endif /* LOG_RCV_DTQ_ENTER */
+
+#ifndef LOG_RCV_DTQ_LEAVE
+#define LOG_RCV_DTQ_LEAVE(ercd, p_data)
+#endif /* LOG_RCV_DTQ_LEAVE */
+
+#ifndef LOG_PRCV_DTQ_ENTER
+#define LOG_PRCV_DTQ_ENTER(dtqid, p_data)
+#endif /* LOG_PRCV_DTQ_ENTER */
+
+#ifndef LOG_PRCV_DTQ_LEAVE
+#define LOG_PRCV_DTQ_LEAVE(ercd, p_data)
+#endif /* LOG_PRCV_DTQ_LEAVE */
+
+#ifndef LOG_TRCV_DTQ_ENTER
+#define LOG_TRCV_DTQ_ENTER(dtqid, p_data, tmout)
+#endif /* LOG_TRCV_DTQ_ENTER */
+
+#ifndef LOG_TRCV_DTQ_LEAVE
+#define LOG_TRCV_DTQ_LEAVE(ercd, p_data)
+#endif /* LOG_TRCV_DTQ_LEAVE */
+
+#ifndef LOG_INI_DTQ_ENTER
+#define LOG_INI_DTQ_ENTER(dtqid)
+#endif /* LOG_INI_DTQ_ENTER */
+
+#ifndef LOG_INI_DTQ_LEAVE
+#define LOG_INI_DTQ_LEAVE(ercd)
+#endif /* LOG_INI_DTQ_LEAVE */
+
+#ifndef LOG_REF_DTQ_ENTER
+#define LOG_REF_DTQ_ENTER(dtqid, pk_rdtq)
+#endif /* LOG_REF_DTQ_ENTER */
+
+#ifndef LOG_REF_DTQ_LEAVE
+#define LOG_REF_DTQ_LEAVE(ercd, pk_rdtq)
+#endif /* LOG_REF_DTQ_LEAVE */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã®æ°
+ */
+#define tnum_dtq	((uint_t)(tmax_dtqid - TMIN_DTQID + 1))
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼IDãããã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_DTQ(dtqid)	((uint_t)((dtqid) - TMIN_DTQID))
+#define get_dtqcb(dtqid)	(&(dtqcb_table[INDEX_DTQ(dtqid)]))
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼æ©è½ã®åæå
+ */
+#ifdef TOPPERS_dtqini
+
+void
+initialize_dataqueue(void)
+{
+	uint_t	i;
+	DTQCB	*p_dtqcb;
+
+	for (i = 0; i < tnum_dtq; i++) {
+		p_dtqcb = &(dtqcb_table[i]);
+		queue_initialize(&(p_dtqcb->swait_queue));
+		p_dtqcb->p_dtqinib = &(dtqinib_table[i]);
+		queue_initialize(&(p_dtqcb->rwait_queue));
+		p_dtqcb->count = 0U;
+		p_dtqcb->head = 0U;
+		p_dtqcb->tail = 0U;
+	}
+}
+
+#endif /* TOPPERS_dtqini */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çé åã¸ã®ãã¼ã¿ã®æ ¼ç´
+ */
+#ifdef TOPPERS_dtqenq
+
+void
+enqueue_data(DTQCB *p_dtqcb, intptr_t data)
+{
+	(p_dtqcb->p_dtqinib->p_dtqmb + p_dtqcb->tail)->data = data;
+	p_dtqcb->count++;
+	p_dtqcb->tail++;
+	if (p_dtqcb->tail >= p_dtqcb->p_dtqinib->dtqcnt) {
+		p_dtqcb->tail = 0U;
+	}
+}
+
+#endif /* TOPPERS_dtqenq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çé åã¸ã®ãã¼ã¿ã®å¼·å¶æ ¼ç´
+ */
+#ifdef TOPPERS_dtqfenq
+
+void
+force_enqueue_data(DTQCB *p_dtqcb, intptr_t data)
+{
+	(p_dtqcb->p_dtqinib->p_dtqmb + p_dtqcb->tail)->data = data;
+	p_dtqcb->tail++;
+	if (p_dtqcb->tail >= p_dtqcb->p_dtqinib->dtqcnt) {
+		p_dtqcb->tail = 0U;
+	}
+	if (p_dtqcb->count < p_dtqcb->p_dtqinib->dtqcnt) {
+		p_dtqcb->count++;
+	}
+	else {
+		p_dtqcb->head = p_dtqcb->tail;
+	}
+}
+
+#endif /* TOPPERS_dtqfenq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çé åããã®ãã¼ã¿ã®ååºã
+ */
+#ifdef TOPPERS_dtqdeq
+
+void
+dequeue_data(DTQCB *p_dtqcb, intptr_t *p_data)
+{
+	*p_data = (p_dtqcb->p_dtqinib->p_dtqmb + p_dtqcb->head)->data;
+	p_dtqcb->count--;
+	p_dtqcb->head++;
+	if (p_dtqcb->head >= p_dtqcb->p_dtqinib->dtqcnt) {
+		p_dtqcb->head = 0U;
+	}
+}
+
+#endif /* TOPPERS_dtqdeq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®ãã¼ã¿éä¿¡
+ */
+#ifdef TOPPERS_dtqsnd
+
+bool_t
+send_data(DTQCB *p_dtqcb, intptr_t data)
+{
+	TCB		*p_tcb;
+
+	if (!queue_empty(&(p_dtqcb->rwait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_dtqcb->rwait_queue));
+		((WINFO_RDTQ *)(p_tcb->p_winfo))->data = data;
+		wait_complete(p_tcb);
+		return(true);
+	}
+	else if (p_dtqcb->count < p_dtqcb->p_dtqinib->dtqcnt) {
+		enqueue_data(p_dtqcb, data);
+		return(true);
+	}
+	else {
+		return(false);
+	}
+}
+
+#endif /* TOPPERS_dtqsnd */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®ãã¼ã¿å¼·å¶éä¿¡
+ */
+#ifdef TOPPERS_dtqfsnd
+
+void
+force_send_data(DTQCB *p_dtqcb, intptr_t data)
+{
+	TCB		*p_tcb;
+
+	if (!queue_empty(&(p_dtqcb->rwait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_dtqcb->rwait_queue));
+		((WINFO_RDTQ *)(p_tcb->p_winfo))->data = data;
+		wait_complete(p_tcb);
+	}
+	else {
+		force_enqueue_data(p_dtqcb, data);
+	}
+}
+
+#endif /* TOPPERS_dtqfsnd */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ããã®ãã¼ã¿åä¿¡
+ */
+#ifdef TOPPERS_dtqrcv
+
+bool_t
+receive_data(DTQCB *p_dtqcb, intptr_t *p_data)
+{
+	TCB		*p_tcb;
+	intptr_t data;
+
+	if (p_dtqcb->count > 0U) {
+		dequeue_data(p_dtqcb, p_data);
+		if (!queue_empty(&(p_dtqcb->swait_queue))) {
+			p_tcb = (TCB *) queue_delete_next(&(p_dtqcb->swait_queue));
+			data = ((WINFO_SDTQ *)(p_tcb->p_winfo))->data;
+			enqueue_data(p_dtqcb, data);
+			wait_complete(p_tcb);
+		}
+		return(true);
+	}
+	else if (!queue_empty(&(p_dtqcb->swait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_dtqcb->swait_queue));
+		*p_data = ((WINFO_SDTQ *)(p_tcb->p_winfo))->data;
+		wait_complete(p_tcb);
+		return(true);
+	}
+	else {
+		return(false);
+	}
+}
+
+#endif /* TOPPERS_dtqrcv */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡
+ */
+#ifdef TOPPERS_snd_dtq
+
+ER
+snd_dtq(ID dtqid, intptr_t data)
+{
+	DTQCB	*p_dtqcb;
+	WINFO_SDTQ winfo_sdtq;
+	ER		ercd;
+
+	LOG_SND_DTQ_ENTER(dtqid, data);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (send_data(p_dtqcb, data)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		winfo_sdtq.data = data;
+		p_runtsk->tstat = TS_WAITING_SDTQ;
+		wobj_make_wait((WOBJCB *) p_dtqcb, (WINFO_WOBJ *) &winfo_sdtq);
+		dispatch();
+		ercd = winfo_sdtq.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_SND_DTQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_snd_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_psnd_dtq
+
+ER
+psnd_dtq(ID dtqid, intptr_t data)
+{
+	DTQCB	*p_dtqcb;
+	ER		ercd;
+
+	LOG_PSND_DTQ_ENTER(dtqid, data);
+	CHECK_UNL();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu();
+	if (send_data(p_dtqcb, data)) {
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PSND_DTQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_psnd_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_tsnd_dtq
+
+ER
+tsnd_dtq(ID dtqid, intptr_t data, TMO tmout)
+{
+	DTQCB	*p_dtqcb;
+	WINFO_SDTQ winfo_sdtq;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TSND_DTQ_ENTER(dtqid, data, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_DTQID(dtqid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (send_data(p_dtqcb, data)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		winfo_sdtq.data = data;
+		p_runtsk->tstat = TS_WAITING_SDTQ;
+		wobj_make_wait_tmout((WOBJCB *) p_dtqcb, (WINFO_WOBJ *) &winfo_sdtq,
+														&tmevtb, tmout);
+		dispatch();
+		ercd = winfo_sdtq.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TSND_DTQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_tsnd_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®å¼·å¶éä¿¡
+ */
+#ifdef TOPPERS_fsnd_dtq
+
+ER
+fsnd_dtq(ID dtqid, intptr_t data)
+{
+	DTQCB	*p_dtqcb;	
+	ER		ercd;
+
+	LOG_FSND_DTQ_ENTER(dtqid, data);
+	CHECK_UNL();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+	CHECK_ILUSE(p_dtqcb->p_dtqinib->dtqcnt > 0U);
+
+	lock_cpu();
+	force_send_data(p_dtqcb, data);
+	if (p_runtsk != p_schedtsk) {
+		if (!sense_context()) {
+			dispatch();
+		}
+		else {
+			request_dispatch();
+		}
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_FSND_DTQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_fsnd_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡
+ */
+#ifdef TOPPERS_rcv_dtq
+
+ER
+rcv_dtq(ID dtqid, intptr_t *p_data)
+{
+	DTQCB	*p_dtqcb;
+	WINFO_RDTQ winfo_rdtq;
+	ER		ercd;
+
+	LOG_RCV_DTQ_ENTER(dtqid, p_data);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (receive_data(p_dtqcb, p_data)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_RDTQ;
+		make_wait(&(winfo_rdtq.winfo));
+		queue_insert_prev(&(p_dtqcb->rwait_queue), &(p_runtsk->task_queue));
+		winfo_rdtq.p_dtqcb = p_dtqcb;
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo_rdtq.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_data = winfo_rdtq.data;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_RCV_DTQ_LEAVE(ercd, p_data);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rcv_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_prcv_dtq
+
+ER
+prcv_dtq(ID dtqid, intptr_t *p_data)
+{
+	DTQCB	*p_dtqcb;
+	ER		ercd;
+
+	LOG_PRCV_DTQ_ENTER(dtqid, p_data);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu();
+	if (receive_data(p_dtqcb, p_data)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PRCV_DTQ_LEAVE(ercd, p_data);
+	return(ercd);
+}
+
+#endif /* TOPPERS_prcv_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_trcv_dtq
+
+ER
+trcv_dtq(ID dtqid, intptr_t *p_data, TMO tmout)
+{
+	DTQCB	*p_dtqcb;
+	WINFO_RDTQ winfo_rdtq;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TRCV_DTQ_ENTER(dtqid, p_data, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_DTQID(dtqid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (receive_data(p_dtqcb, p_data)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_RDTQ;
+		make_wait_tmout(&(winfo_rdtq.winfo), &tmevtb, tmout);
+		queue_insert_prev(&(p_dtqcb->rwait_queue), &(p_runtsk->task_queue));
+		winfo_rdtq.p_dtqcb = p_dtqcb;
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo_rdtq.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_data = winfo_rdtq.data;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TRCV_DTQ_LEAVE(ercd, p_data);
+	return(ercd);
+}
+
+#endif /* TOPPERS_trcv_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã®ååæå
+ */
+#ifdef TOPPERS_ini_dtq
+
+ER
+ini_dtq(ID dtqid)
+{
+	DTQCB	*p_dtqcb;
+	ER		ercd;
+    
+	LOG_INI_DTQ_ENTER(dtqid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu();
+	init_wait_queue(&(p_dtqcb->swait_queue));
+	init_wait_queue(&(p_dtqcb->rwait_queue));
+	p_dtqcb->count = 0U;
+	p_dtqcb->head = 0U;
+	p_dtqcb->tail = 0U;
+	if (p_runtsk != p_schedtsk) {
+		dispatch();
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_INI_DTQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ini_dtq */
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_dtq
+
+ER
+ref_dtq(ID dtqid, T_RDTQ *pk_rdtq)
+{
+	DTQCB	*p_dtqcb;
+	ER		ercd;
+    
+	LOG_REF_DTQ_ENTER(dtqid, pk_rdtq);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_DTQID(dtqid));
+	p_dtqcb = get_dtqcb(dtqid);
+
+	lock_cpu();
+	pk_rdtq->stskid = wait_tskid(&(p_dtqcb->swait_queue));
+	pk_rdtq->rtskid = wait_tskid(&(p_dtqcb->rwait_queue));
+	pk_rdtq->sdtqcnt = p_dtqcb->count;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_DTQ_LEAVE(ercd, pk_rdtq);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_dtq */
Index: asp3_wo_tecs/trunk/kernel/dataqueue.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/dataqueue.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/dataqueue.h	(revision 302)
@@ -0,0 +1,198 @@
+/*
+ *  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: dataqueue.h 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *		ãã¼ã¿ã­ã¥ã¼æ©è½
+ */
+
+#ifndef TOPPERS_DATAQUEUE_H
+#define TOPPERS_DATAQUEUE_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "wait.h"
+
+/*
+ *  ãã¼ã¿ç®¡çãã­ãã¯
+ */
+typedef struct data_management_block {
+	intptr_t	data;			/* ãã¼ã¿æ¬ä½ */
+} DTQMB;
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WOBJINIBï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct dataqueue_initialization_block {
+	ATR			dtqatr;			/* ãã¼ã¿ã­ã¥ã¼å±æ§ */
+	uint_t		dtqcnt;			/* ãã¼ã¿ã­ã¥ã¼ã®å®¹é */
+	DTQMB		*p_dtqmb;		/* ãã¼ã¿ã­ã¥ã¼ç®¡çé åã®å
+é ­çªå° */
+} DTQINIB;
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼
+ *  ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼æåã®2ã¤ã®
+ *  ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct dataqueue_control_block {
+	QUEUE		swait_queue;	/* ãã¼ã¿ã­ã¥ã¼éä¿¡å¾
+ã¡ã­ã¥ã¼ */
+	const DTQINIB *p_dtqinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	QUEUE		rwait_queue;	/* ãã¼ã¿ã­ã¥ã¼åä¿¡å¾
+ã¡ã­ã¥ã¼ */
+	uint_t		count;			/* ãã¼ã¿ã­ã¥ã¼ä¸­ã®ãã¼ã¿ã®æ° */
+	uint_t		head;			/* æåã®ãã¼ã¿ã®æ ¼ç´å ´æ */
+	uint_t		tail;			/* æå¾ã®ãã¼ã¿ã®æ ¼ç´å ´æã®æ¬¡ */
+} DTQCB;
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼å¾
+ã¡æ
+å ±ãã­ãã¯ã®å®ç¾©
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WINFO_WOBJï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®2ã¤ã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct dataqueue_send_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	DTQCB		*p_dtqcb;		/* å¾
+ã£ã¦ãããã¼ã¿ã­ã¥ã¼ã®ç®¡çãã­ãã¯ */
+	intptr_t	data;			/* éä¿¡ãã¼ã¿ */
+} WINFO_SDTQ;
+
+typedef struct dataqueue_receive_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	DTQCB		*p_dtqcb;		/* å¾
+ã£ã¦ãããã¼ã¿ã­ã¥ã¼ã®ç®¡çãã­ãã¯ */
+	intptr_t	data;			/* åä¿¡ãã¼ã¿ */
+} WINFO_RDTQ;
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_dtqid;
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const DTQINIB	dtqinib_table[];
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern DTQCB	dtqcb_table[];
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ãããã¼ã¿ã­ã¥ã¼IDãåãåºãããã®ãã¯ã­
+ */
+#define	DTQID(p_dtqcb)	((ID)(((p_dtqcb) - dtqcb_table) + TMIN_DTQID))
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼æ©è½ã®åæå
+ */
+extern void	initialize_dataqueue(void);
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çé åã¸ã®ãã¼ã¿ã®æ ¼ç´
+ */
+extern void	enqueue_data(DTQCB *p_dtqcb, intptr_t data);
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çé åã¸ã®ãã¼ã¿ã®å¼·å¶æ ¼ç´
+ */
+extern void	force_enqueue_data(DTQCB *p_dtqcb, intptr_t data);
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ç®¡çé åããã®ãã¼ã¿ã®ååºã
+ */
+extern void	dequeue_data(DTQCB *p_dtqcb, intptr_t *p_data);
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®ãã¼ã¿éä¿¡
+ */
+extern bool_t	send_data(DTQCB *p_dtqcb, intptr_t data);
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ã¸ã®ãã¼ã¿å¼·å¶éä¿¡
+ */
+extern void	force_send_data(DTQCB *p_dtqcb, intptr_t data);
+
+/*
+ *  ãã¼ã¿ã­ã¥ã¼ããã®ãã¼ã¿åä¿¡
+ */
+extern bool_t	receive_data(DTQCB *p_dtqcb, intptr_t *p_data);
+
+#endif /* TOPPERS_DATAQUEUE_H */
Index: asp3_wo_tecs/trunk/kernel/dataqueue.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/dataqueue.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/dataqueue.tf	(revision 302)
@@ -0,0 +1,159 @@
+$
+$   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/eventflag.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/eventflag.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/eventflag.c	(revision 302)
@@ -0,0 +1,470 @@
+/*
+ *  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: eventflag.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		ã¤ãã³ããã©ã°æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "eventflag.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_SET_FLG_ENTER
+#define LOG_SET_FLG_ENTER(flgid, setptn)
+#endif /* LOG_SET_FLG_ENTER */
+
+#ifndef LOG_SET_FLG_LEAVE
+#define LOG_SET_FLG_LEAVE(ercd)
+#endif /* LOG_SET_FLG_LEAVE */
+
+#ifndef LOG_CLR_FLG_ENTER
+#define LOG_CLR_FLG_ENTER(flgid, clrptn)
+#endif /* LOG_CLR_FLG_ENTER */
+
+#ifndef LOG_CLR_FLG_LEAVE
+#define LOG_CLR_FLG_LEAVE(ercd)
+#endif /* LOG_CLR_FLG_LEAVE */
+
+#ifndef LOG_WAI_FLG_ENTER
+#define LOG_WAI_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn)
+#endif /* LOG_WAI_FLG_ENTER */
+
+#ifndef LOG_WAI_FLG_LEAVE
+#define LOG_WAI_FLG_LEAVE(ercd, p_flgptn)
+#endif /* LOG_WAI_FLG_LEAVE */
+
+#ifndef LOG_POL_FLG_ENTER
+#define LOG_POL_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn)
+#endif /* LOG_POL_FLG_ENTER */
+
+#ifndef LOG_POL_FLG_LEAVE
+#define LOG_POL_FLG_LEAVE(ercd, p_flgptn)
+#endif /* LOG_POL_FLG_LEAVE */
+
+#ifndef LOG_TWAI_FLG_ENTER
+#define LOG_TWAI_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn, tmout)
+#endif /* LOG_TWAI_FLG_ENTER */
+
+#ifndef LOG_TWAI_FLG_LEAVE
+#define LOG_TWAI_FLG_LEAVE(ercd, p_flgptn)
+#endif /* LOG_TWAI_FLG_LEAVE */
+
+#ifndef LOG_INI_FLG_ENTER
+#define LOG_INI_FLG_ENTER(flgid)
+#endif /* LOG_INI_FLG_ENTER */
+
+#ifndef LOG_INI_FLG_LEAVE
+#define LOG_INI_FLG_LEAVE(ercd)
+#endif /* LOG_INI_FLG_LEAVE */
+
+#ifndef LOG_REF_FLG_ENTER
+#define LOG_REF_FLG_ENTER(flgid, pk_rflg)
+#endif /* LOG_REF_FLG_ENTER */
+
+#ifndef LOG_REF_FLG_LEAVE
+#define LOG_REF_FLG_LEAVE(ercd, pk_rflg)
+#endif /* LOG_REF_FLG_LEAVE */
+
+/*
+ *  ã¤ãã³ããã©ã°ã®æ°
+ */
+#define tnum_flg	((uint_t)(tmax_flgid - TMIN_FLGID + 1))
+
+/*
+ *  ã¤ãã³ããã©ã°IDããã¤ãã³ããã©ã°ç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_FLG(flgid)	((uint_t)((flgid) - TMIN_FLGID))
+#define get_flgcb(flgid)	(&(flgcb_table[INDEX_FLG(flgid)]))
+
+/*
+ *  ã¤ãã³ããã©ã°æ©è½ã®åæå
+ */
+#ifdef TOPPERS_flgini
+
+void
+initialize_eventflag(void)
+{
+	uint_t	i;
+	FLGCB	*p_flgcb;
+
+	for (i = 0; i < tnum_flg; i++) {
+		p_flgcb = &(flgcb_table[i]);
+		queue_initialize(&(p_flgcb->wait_queue));
+		p_flgcb->p_flginib = &(flginib_table[i]);
+		p_flgcb->flgptn = p_flgcb->p_flginib->iflgptn;
+	}
+}
+
+#endif /* TOPPERS_flgini */
+
+/*
+ *  ã¤ãã³ããã©ã°å¾
+ã¡è§£é¤æ¡ä»¶ã®ãã§ãã¯
+ */
+#ifdef TOPPERS_flgcnd
+
+bool_t
+check_flg_cond(FLGCB *p_flgcb, FLGPTN waiptn, MODE wfmode, FLGPTN *p_flgptn)
+{
+	if ((wfmode & TWF_ORW) != 0U ? (p_flgcb->flgptn & waiptn) != 0U
+									: (p_flgcb->flgptn & waiptn) == waiptn) {
+		*p_flgptn = p_flgcb->flgptn;
+		if ((p_flgcb->p_flginib->flgatr & TA_CLR) != 0U) {
+			p_flgcb->flgptn = 0U;
+		}
+		return(true);
+	}
+	return(false);
+}
+
+#endif /* TOPPERS_flgcnd */
+
+/*
+ *  ã¤ãã³ããã©ã°ã®ã»ãã
+ */
+#ifdef TOPPERS_set_flg
+
+ER
+set_flg(ID flgid, FLGPTN setptn)
+{
+	FLGCB	*p_flgcb;
+	QUEUE	*p_queue;
+	TCB		*p_tcb;
+	WINFO_FLG *p_winfo_flg;
+	ER		ercd;
+
+	LOG_SET_FLG_ENTER(flgid, setptn);
+	CHECK_UNL();
+	CHECK_ID(VALID_FLGID(flgid));
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu();
+	p_flgcb->flgptn |= setptn;
+	p_queue = p_flgcb->wait_queue.p_next;
+	while (p_queue != &(p_flgcb->wait_queue)) {
+		p_tcb = (TCB *) p_queue;
+		p_queue = p_queue->p_next;
+		p_winfo_flg = (WINFO_FLG *)(p_tcb->p_winfo);
+		if (check_flg_cond(p_flgcb, p_winfo_flg->waiptn,
+							p_winfo_flg->wfmode, &(p_winfo_flg->waiptn))) {
+			queue_delete(&(p_tcb->task_queue));
+			wait_complete(p_tcb);
+			if ((p_flgcb->p_flginib->flgatr & TA_CLR) != 0U) {
+				break;
+			}
+		}
+	}
+	if (p_runtsk != p_schedtsk) {
+		if (!sense_context()) {
+			dispatch();
+		}
+		else {
+			request_dispatch();
+		}
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_SET_FLG_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_set_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°ã®ã¯ãªã¢
+ */
+#ifdef TOPPERS_clr_flg
+
+ER
+clr_flg(ID flgid, FLGPTN clrptn)
+{
+	FLGCB	*p_flgcb;
+	ER		ercd;
+
+	LOG_CLR_FLG_ENTER(flgid, clrptn);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_FLGID(flgid));
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu();
+	p_flgcb->flgptn &= clrptn; 
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_CLR_FLG_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_clr_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°å¾
+ã¡
+ */
+#ifdef TOPPERS_wai_flg
+
+ER
+wai_flg(ID flgid, FLGPTN waiptn, MODE wfmode, FLGPTN *p_flgptn)
+{
+	FLGCB	*p_flgcb;
+	WINFO_FLG winfo_flg;
+	ER		ercd;
+
+	LOG_WAI_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_FLGID(flgid));
+	CHECK_PAR(waiptn != 0U);
+	CHECK_PAR(wfmode == TWF_ORW || wfmode == TWF_ANDW);
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if ((p_flgcb->p_flginib->flgatr & TA_WMUL) == 0U
+					&& !queue_empty(&(p_flgcb->wait_queue))) {
+		ercd = E_ILUSE;
+	}
+	else if (check_flg_cond(p_flgcb, waiptn, wfmode, p_flgptn)) {
+		ercd = E_OK;
+	}
+	else {
+		winfo_flg.waiptn = waiptn;
+		winfo_flg.wfmode = wfmode;
+		p_runtsk->tstat = TS_WAITING_FLG;
+		wobj_make_wait((WOBJCB *) p_flgcb, (WINFO_WOBJ *) &winfo_flg);
+		dispatch();
+		ercd = winfo_flg.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_flgptn = winfo_flg.waiptn;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_WAI_FLG_LEAVE(ercd, p_flgptn);
+	return(ercd);
+}
+
+#endif /* TOPPERS_wai_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°å¾
+ã¡ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_pol_flg
+
+ER
+pol_flg(ID flgid, FLGPTN waiptn, MODE wfmode, FLGPTN *p_flgptn)
+{
+	FLGCB	*p_flgcb;
+	ER		ercd;
+
+	LOG_POL_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_FLGID(flgid));
+	CHECK_PAR(waiptn != 0U);
+	CHECK_PAR(wfmode == TWF_ORW || wfmode == TWF_ANDW);
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu();
+	if ((p_flgcb->p_flginib->flgatr & TA_WMUL) == 0U
+					&& !queue_empty(&(p_flgcb->wait_queue))) {
+		ercd = E_ILUSE;
+	}
+	else if (check_flg_cond(p_flgcb, waiptn, wfmode, p_flgptn)) {
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_POL_FLG_LEAVE(ercd, p_flgptn);
+	return(ercd);
+}
+
+#endif /* TOPPERS_pol_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°å¾
+ã¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_twai_flg
+
+ER
+twai_flg(ID flgid, FLGPTN waiptn, MODE wfmode, FLGPTN *p_flgptn, TMO tmout)
+{
+	FLGCB	*p_flgcb;
+	WINFO_FLG winfo_flg;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TWAI_FLG_ENTER(flgid, waiptn, wfmode, p_flgptn, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_FLGID(flgid));
+	CHECK_PAR(waiptn != 0U);
+	CHECK_PAR(wfmode == TWF_ORW || wfmode == TWF_ANDW);
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if ((p_flgcb->p_flginib->flgatr & TA_WMUL) == 0U
+					&& !queue_empty(&(p_flgcb->wait_queue))) {
+		ercd = E_ILUSE;
+	}
+	else if (check_flg_cond(p_flgcb, waiptn, wfmode, p_flgptn)) {
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		winfo_flg.waiptn = waiptn;
+		winfo_flg.wfmode = wfmode;
+		p_runtsk->tstat = TS_WAITING_FLG;
+		wobj_make_wait_tmout((WOBJCB *) p_flgcb, (WINFO_WOBJ *) &winfo_flg,
+														&tmevtb, tmout);
+		dispatch();
+		ercd = winfo_flg.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_flgptn = winfo_flg.waiptn;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TWAI_FLG_LEAVE(ercd, p_flgptn);
+	return(ercd);
+}
+
+#endif /* TOPPERS_twai_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°ã®ååæå
+ */
+#ifdef TOPPERS_ini_flg
+
+ER
+ini_flg(ID flgid)
+{
+	FLGCB	*p_flgcb;
+	ER		ercd;
+    
+	LOG_INI_FLG_ENTER(flgid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_FLGID(flgid));
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu();
+	init_wait_queue(&(p_flgcb->wait_queue));
+	p_flgcb->flgptn = p_flgcb->p_flginib->iflgptn;
+	if (p_runtsk != p_schedtsk) {
+		dispatch();
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_INI_FLG_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ini_flg */
+
+/*
+ *  ã¤ãã³ããã©ã°ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_flg
+
+ER
+ref_flg(ID flgid, T_RFLG *pk_rflg)
+{
+	FLGCB	*p_flgcb;
+	ER		ercd;
+    
+	LOG_REF_FLG_ENTER(flgid, pk_rflg);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_FLGID(flgid));
+	p_flgcb = get_flgcb(flgid);
+
+	lock_cpu();
+	pk_rflg->wtskid = wait_tskid(&(p_flgcb->wait_queue));
+	pk_rflg->flgptn = p_flgcb->flgptn;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_FLG_LEAVE(ercd, pk_rflg);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_flg */
Index: asp3_wo_tecs/trunk/kernel/eventflag.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/eventflag.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/eventflag.h	(revision 302)
@@ -0,0 +1,167 @@
+/*
+ *  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: eventflag.h 200 2014-09-05 19:18:00Z ertl-hiro $
+ */
+
+/*
+ *		ã¤ãã³ããã©ã°æ©è½
+ */
+
+#ifndef TOPPERS_EVENTFLAG_H
+#define TOPPERS_EVENTFLAG_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "wait.h"
+
+/*
+ *  ã¤ãã³ããã©ã°åæåãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WOBJINIBï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct eventflag_initialization_block {
+	ATR			flgatr;			/* ã¤ãã³ããã©ã°å±æ§ */
+	FLGPTN		iflgptn;		/* ã¤ãã³ããã©ã°ã®ããããã¿ã¼ã³ã®åæå¤ */
+} FLGINIB;
+
+/*
+ *  ã¤ãã³ããã©ã°ç®¡çãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼
+ *  ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼æåã®2ã¤ã®
+ *  ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct eventflag_control_block {
+	QUEUE		wait_queue;		/* ã¤ãã³ããã©ã°å¾
+ã¡ã­ã¥ã¼ */
+	const FLGINIB *p_flginib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	FLGPTN		flgptn;			/* ã¤ãã³ããã©ã°ç¾å¨ãã¿ã¼ã³ */
+} FLGCB;
+
+/*
+ *  ã¤ãã³ããã©ã°å¾
+ã¡æ
+å ±ãã­ãã¯ã®å®ç¾©
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WINFO_WOBJï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®2ã¤ã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ *
+ *  waiptnã«ã¯ï¼å¾
+ã¡ç¶æ
+ã®éã¯å¾
+ã¡ãã¿ã¼ã³ãï¼å¾
+ã¡è§£é¤ãããå¾ã¯å¾
+ã¡è§£
+ *  é¤æã®ãã¿ã¼ã³ãå
+¥ããï¼1ã¤ã®ãã£ã¼ã«ãã2ã¤ã®ç®çã«å
+¼ç¨ãã¦ããï¼ï¼
+ */
+typedef struct eventflag_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	FLGCB		*p_flgcb;		/* å¾
+ã£ã¦ããã¤ãã³ããã©ã°ã®ç®¡çãã­ãã¯ */
+	FLGPTN		waiptn;			/* å¾
+ã¡ãã¿ã¼ã³ï¼å¾
+ã¡è§£é¤æã®ãã¿ã¼ã³ */
+	MODE		wfmode;			/* å¾
+ã¡ã¢ã¼ã */
+} WINFO_FLG;
+
+/*
+ *  ã¤ãã³ããã©ã°IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_flgid;
+
+/*
+ *  ã¤ãã³ããã©ã°åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const FLGINIB	flginib_table[];
+
+/*
+ *  ã¤ãã³ããã©ã°ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern FLGCB	flgcb_table[];
+
+/*
+ *  ã¤ãã³ããã©ã°ç®¡çãã­ãã¯ããã¤ãã³ããã©ã°IDãåãåºãããã®ãã¯ã­
+ */
+#define	FLGID(p_flgcb)	((ID)(((p_flgcb) - flgcb_table) + TMIN_FLGID))
+
+/*
+ *  ã¤ãã³ããã©ã°æ©è½ã®åæå
+ */
+extern void	initialize_eventflag(void);
+
+/*
+ *  ã¤ãã³ããã©ã°å¾
+ã¡è§£é¤æ¡ä»¶ã®ãã§ãã¯
+ */
+extern bool_t	check_flg_cond(FLGCB *p_flgcb, FLGPTN waiptn,
+								MODE wfmode, FLGPTN *p_flgptn);
+
+#endif /* TOPPERS_EVENTFLAG_H */
Index: asp3_wo_tecs/trunk/kernel/eventflag.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/eventflag.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/eventflag.tf	(revision 302)
@@ -0,0 +1,139 @@
+$
+$   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/exception.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/exception.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/exception.c	(revision 302)
@@ -0,0 +1,126 @@
+/*
+ *  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: exception.c 267 2014-10-11 06:45:18Z ertl-hiro $
+ */
+
+/*
+ *		CPUä¾å¤ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "task.h"
+#include "exception.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_XSNS_DPN_ENTER
+#define LOG_XSNS_DPN_ENTER(p_excinf)
+#endif /* LOG_XSNS_DPN_ENTER */
+
+#ifndef LOG_XSNS_DPN_LEAVE
+#define LOG_XSNS_DPN_LEAVE(state)
+#endif /* LOG_XSNS_DPN_LEAVE */
+
+/* 
+ *  CPUä¾å¤ãã³ãã©ç®¡çæ©è½ã®åæå
+ */
+#ifdef TOPPERS_excini
+#ifndef OMIT_INITIALIZE_EXCEPTION
+
+void
+initialize_exception(void)
+{
+	uint_t			i;
+	const EXCINIB	*p_excinib;
+
+	for (i = 0; i < tnum_def_excno; i++) {
+		p_excinib = &(excinib_table[i]);
+		define_exc(p_excinib->excno, p_excinib->exc_entry);
+	}
+}
+
+#endif /* OMIT_INITIALIZE_EXCEPTION */
+#endif /* TOPPERS_excini */
+
+/*
+ *  CPUä¾å¤ã®çºçããã³ã³ãã­ã¹ãã®åç
+§
+ */
+
+/*
+ *  CPUä¾å¤çºçæã®ãã£ã¹ãããä¿çç¶æ
+ã®åç
+§
+ *
+ *  CPUä¾å¤ãã³ãã©ä¸­ã§enadspãå¤åãããã¨ã¯ãªãããï¼CPUä¾å¤ãçºçã
+ *  ãæã®enadspãä¿å­ãã¦ããå¿
+è¦ã¯ãªãï¼
+ */
+#ifdef TOPPERS_xsns_dpn
+
+bool_t
+xsns_dpn(void *p_excinf)
+{
+	bool_t	state;
+
+	LOG_XSNS_DPN_ENTER(p_excinf);
+	state = (kerflg && exc_sense_intmask(p_excinf) && enadsp
+								&& p_runtsk != NULL) ? false : true;
+	LOG_XSNS_DPN_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_xsns_dpn */
Index: asp3_wo_tecs/trunk/kernel/exception.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/exception.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/exception.h	(revision 302)
@@ -0,0 +1,96 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2000 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  Copyright (C) 2005-2007 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.h 267 2014-10-11 06:45:18Z ertl-hiro $
+ */
+
+/*
+ *		CPUä¾å¤ç®¡çæ©è½
+ */
+
+#ifndef TOPPERS_EXCEPTION_H
+#define TOPPERS_EXCEPTION_H
+
+#include "kernel_impl.h"
+
+#ifndef OMIT_INITIALIZE_EXCEPTION
+
+/*
+ *  CPUä¾å¤ãã³ãã©åæåãã­ãã¯
+ */
+typedef struct cpu_exception_handler_initialization_block {
+	EXCNO		excno;			/* CPUä¾å¤ãã³ãã©çªå· */
+	ATR			excatr;			/* CPUä¾å¤ãã³ãã©å±æ§ */
+	FP			exc_entry;		/* CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦çã®çªå° */
+} EXCINIB;
+
+/*
+ *  å®ç¾©ããCPUä¾å¤ãã³ãã©çªå·ã®æ°ï¼kernel_cfg.cï¼
+ */
+extern const uint_t	tnum_def_excno;
+
+/*
+ *  CPUä¾å¤ãã³ãã©åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const EXCINIB	excinib_table[];
+
+#endif /* OMIT_INITIALIZE_EXCEPTION */
+
+/*
+ *  CPUä¾å¤ãã³ãã©ç®¡çæ©è½ã®åæå
+ */
+extern void	initialize_exception(void);
+
+#endif /* TOPPERS_EXCEPTION_H */
Index: asp3_wo_tecs/trunk/kernel/exception.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/exception.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/exception.tf	(revision 302)
@@ -0,0 +1,147 @@
+$
+$   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/genoffset.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/genoffset.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/genoffset.tf	(revision 302)
@@ -0,0 +1,169 @@
+$ 
+$   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/interrupt.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/interrupt.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/interrupt.c	(revision 302)
@@ -0,0 +1,272 @@
+/*
+ *  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: interrupt.c 275 2014-11-03 14:26:05Z ertl-hiro $
+ */
+
+/*
+ *		å²è¾¼ã¿ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "interrupt.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_DIS_INT_ENTER
+#define LOG_DIS_INT_ENTER(intno)
+#endif /* LOG_DIS_INT_ENTER */
+
+#ifndef LOG_DIS_INT_LEAVE
+#define LOG_DIS_INT_LEAVE(ercd)
+#endif /* LOG_DIS_INT_LEAVE */
+
+#ifndef LOG_ENA_INT_ENTER
+#define LOG_ENA_INT_ENTER(intno)
+#endif /* LOG_ENA_INT_ENTER */
+
+#ifndef LOG_ENA_INT_LEAVE
+#define LOG_ENA_INT_LEAVE(ercd)
+#endif /* LOG_ENA_INT_LEAVE */
+
+#ifndef LOG_CHG_IPM_ENTER
+#define LOG_CHG_IPM_ENTER(intpri)
+#endif /* LOG_CHG_IPM_ENTER */
+
+#ifndef LOG_CHG_IPM_LEAVE
+#define LOG_CHG_IPM_LEAVE(ercd)
+#endif /* LOG_CHG_IPM_LEAVE */
+
+#ifndef LOG_GET_IPM_ENTER
+#define LOG_GET_IPM_ENTER(p_intpri)
+#endif /* LOG_GET_IPM_ENTER */
+
+#ifndef LOG_GET_IPM_LEAVE
+#define LOG_GET_IPM_LEAVE(ercd, p_intpri)
+#endif /* LOG_GET_IPM_LEAVE */
+
+/* 
+ *  å²è¾¼ã¿ç®¡çæ©è½ã®åæå
+ */
+#ifdef TOPPERS_intini
+#ifndef OMIT_INITIALIZE_INTERRUPT
+
+void
+initialize_interrupt(void)
+{
+	uint_t			i;
+	const INHINIB	*p_inhinib;
+	const INTINIB	*p_intinib;
+
+	for (i = 0; i < tnum_def_inhno; i++) {
+		p_inhinib = &(inhinib_table[i]);
+		define_inh(p_inhinib->inhno, p_inhinib->int_entry);
+	}
+	for (i = 0; i < tnum_cfg_intno; i++) {
+		p_intinib = &(intinib_table[i]);
+		config_int(p_intinib->intno, p_intinib->intatr, p_intinib->intpri);
+	}
+}
+
+#endif /* OMIT_INITIALIZE_INTERRUPT */
+#endif /* TOPPERS_intini */
+
+/*
+ *  å²è¾¼ã¿ã®ç¦æ­¢ï¼»NGKI3555ï¼½
+ */
+#ifdef TOPPERS_dis_int
+#ifdef TOPPERS_SUPPORT_DIS_INT					/*ï¼»NGKI3093ï¼½*/
+
+ER
+dis_int(INTNO intno)
+{
+	bool_t	locked;
+	ER		ercd;
+
+	LOG_DIS_INT_ENTER(intno);
+	CHECK_PAR(VALID_INTNO_DISINT(intno));		/*ï¼»NGKI3083ï¼½ï¼»NGKI3087ï¼½*/
+
+	locked = sense_lock();
+	if (!locked) {
+		lock_cpu();
+	}
+	if (disable_int(intno)) {					/*ï¼»NGKI3086ï¼½*/
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_OBJ;							/*ï¼»NGKI3085ï¼½*/
+	}
+	if (!locked) {
+		unlock_cpu();
+	}
+
+  error_exit:
+	LOG_DIS_INT_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_SUPPORT_DIS_INT */
+#endif /* TOPPERS_dis_int */
+
+/*
+ *  å²è¾¼ã¿ã®è¨±å¯ï¼»NGKI3556ï¼½
+ */
+#ifdef TOPPERS_ena_int
+#ifdef TOPPERS_SUPPORT_ENA_INT					/*ï¼»NGKI3106ï¼½*/
+
+ER
+ena_int(INTNO intno)
+{
+	bool_t	locked;
+	ER		ercd;
+
+	LOG_ENA_INT_ENTER(intno);
+	CHECK_PAR(VALID_INTNO_DISINT(intno));		/*ï¼»NGKI3096ï¼½ï¼»NGKI3100ï¼½*/
+
+	locked = sense_lock();
+	if (!locked) {
+		lock_cpu();
+	}
+	if (enable_int(intno)) {					/*ï¼»NGKI3099ï¼½*/
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_OBJ;							/*ï¼»NGKI3098ï¼½*/
+	}
+	if (!locked) {
+		unlock_cpu();
+	}
+
+  error_exit:
+	LOG_ENA_INT_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_SUPPORT_ENA_INT */
+#endif /* TOPPERS_ena_int */
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®å¤æ´ï¼»NGKI3107ï¼½
+ */
+#ifdef TOPPERS_chg_ipm
+
+ER
+chg_ipm(PRI intpri)
+{
+	ER		ercd;
+
+	LOG_CHG_IPM_ENTER(intpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3108ï¼½ï¼»NGKI3109ï¼½*/
+	CHECK_PAR(VALID_INTPRI_CHGIPM(intpri));		/*ï¼»NGKI3113ï¼½ï¼»NGKI3114ï¼½*/
+
+	lock_cpu();
+	t_set_ipm(intpri);							/*ï¼»NGKI3111ï¼½*/
+	if (intpri == TIPM_ENAALL && enadsp) {
+		dspflg = true;
+		p_schedtsk = search_schedtsk();
+		if (p_runtsk->raster && p_runtsk->enater) {
+			task_terminate(p_runtsk);
+			exit_and_dispatch();
+			ercd = E_SYS;
+		}
+		else {
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}
+			ercd = E_OK;
+		}
+	}
+	else {
+		dspflg = false;
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_CHG_IPM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_chg_ipm */
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®åç
+§ï¼»NGKI3115ï¼½
+ */
+#ifdef TOPPERS_get_ipm
+
+ER
+get_ipm(PRI *p_intpri)
+{
+	ER		ercd;
+
+	LOG_GET_IPM_ENTER(p_intpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3116ï¼½ï¼»NGKI3117ï¼½*/
+
+	lock_cpu();
+	*p_intpri = t_get_ipm();					/*ï¼»NGKI3120ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_IPM_LEAVE(ercd, p_intpri);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_ipm */
Index: asp3_wo_tecs/trunk/kernel/interrupt.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/interrupt.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/interrupt.h	(revision 302)
@@ -0,0 +1,120 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2000 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: interrupt.h 356 2015-07-25 10:44:32Z ertl-hiro $
+ */
+
+/*
+ *		å²è¾¼ã¿ç®¡çæ©è½
+ */
+
+#ifndef TOPPERS_INTERRUPT_H
+#define TOPPERS_INTERRUPT_H
+
+#include "kernel_impl.h"
+
+#if !defined(OMIT_INITIALIZE_INTERRUPT) || defined(USE_INHINIB_TABLE)
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©åæåãã­ãã¯
+ */
+typedef struct interrupt_handler_initialization_block {
+	INHNO		inhno;			/* å²è¾¼ã¿ãã³ãã©çªå· */
+	ATR			inhatr;			/* å²è¾¼ã¿ãã³ãã©å±æ§ */
+	FP			int_entry;		/* å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦çã®çªå° */
+} INHINIB;
+
+/*
+ *  å®ç¾©ããå²è¾¼ã¿ãã³ãã©çªå·ã®æ°ï¼kernel_cfg.cï¼
+ */
+extern const uint_t	tnum_def_inhno;
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const INHINIB	inhinib_table[];
+
+#endif /* !defined(OMIT_INITIALIZE_INTERRUPT) || defined(USE_INHINIB_TABLE) */
+
+#if !defined(OMIT_INITIALIZE_INTERRUPT) || defined(USE_INTINIB_TABLE)
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã©ã¤ã³åæåãã­ãã¯
+ */
+typedef struct interrupt_request_initialization_block {
+	INTNO		intno;			/* å²è¾¼ã¿çªå· */
+	ATR			intatr;			/* å²è¾¼ã¿å±æ§ */
+	PRI			intpri;			/* å²è¾¼ã¿åªå
+åº¦ */
+} INTINIB;
+
+/*
+ *  è¨­å®ããå²è¾¼ã¿è¦æ±ã©ã¤ã³ã®æ°ï¼kernel_cfg.cï¼
+ */
+extern const uint_t	tnum_cfg_intno;
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã©ã¤ã³åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const INTINIB	intinib_table[];
+
+#endif /* !defined(OMIT_INITIALIZE_INTERRUPT) || defined(USE_INTINIB_TABLE) */
+
+/*
+ *  å²è¾¼ã¿ç®¡çæ©è½ã®åæå
+ */
+extern void	initialize_interrupt(void);
+
+#endif /* TOPPERS_INTERRUPT_H */
Index: asp3_wo_tecs/trunk/kernel/interrupt.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/interrupt.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/interrupt.tf	(revision 302)
@@ -0,0 +1,460 @@
+$
+$   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/kernel.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/kernel.tf	(revision 302)
@@ -0,0 +1,434 @@
+$
+$   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_api.csv
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_api.csv	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/kernel_api.csv	(revision 302)
@@ -0,0 +1,16 @@
+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_check.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_check.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/kernel_check.tf	(revision 302)
@@ -0,0 +1,383 @@
+$ 
+$   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_def.csv
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_def.csv	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/kernel_def.csv	(revision 302)
@@ -0,0 +1,133 @@
+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_impl.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_impl.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/kernel_impl.h	(revision 302)
@@ -0,0 +1,211 @@
+/*
+ *  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) 2004-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_impl.h 332 2015-06-21 13:20:37Z ertl-hiro $
+ */
+
+/*
+ *		TOPPERS/ASPã«ã¼ãã«å
+é¨åãæ¨æºããããã¡ã¤ã«
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼ã«ã¼ãã«ãæ§æãããã­ã°ã©ã ã®ã½ã¼ã¹ãã¡ã¤ã«
+ *  ã§å¿
+ãã¤ã³ã¯ã«ã¼ãããã¹ãæ¨æºããããã¡ã¤ã«ã§ããï¼
+ *
+ *  ã¢ã»ã³ããªè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ãããã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããæ
+ *  ã¯ï¼TOPPERS_MACRO_ONLYãå®ç¾©ãã¦ããï¼ããã«ããï¼ãã¯ã­å®ç¾©ä»¥å¤ã
+ *  é¤ãããã«ãªã£ã¦ããï¼
+ */
+
+#ifndef TOPPERS_KERNEL_IMPL_H
+#define TOPPERS_KERNEL_IMPL_H
+
+/*
+ *  ã«ã¼ãã«ã®å
+é¨è­å¥åã®ãªãã¼ã 
+ */
+#include "kernel_rename.h"
+
+/*
+ *  ã¢ããªã±ã¼ã·ã§ã³ã¨å
+±éã®ããããã¡ã¤ã«
+ */
+#include <kernel.h>
+
+/*
+ *  ã·ã¹ãã ã­ã°æ©è½ã®ããã®å®ç¾©
+ */
+#include <t_syslog.h>
+
+/*
+ *  åã­ã£ã¹ããè¡ããã¯ã­ã®å®ç¾©
+ */
+#ifndef CAST
+#define CAST(type, val)		((type)(val))
+#endif /* CAST */
+
+/*
+ *  ã¿ã¼ã²ããä¾å­æ
+å ±ã®å®ç¾©
+ */
+#include "target_kernel_impl.h"
+
+/*
+ *  ãã¹ã¦ã®é¢æ°ãã³ã³ãã¤ã«ããããã®å®ç¾©
+ */
+#ifdef ALLFUNC
+#include "allfunc.h"
+#endif /* ALLFUNC */
+
+/*
+ *  ããããã£ã¼ã«ãã§ã®ç¬¦å·ç¡ãæ´æ°å
+ *
+ *  8ãããä»¥ä¸ã®å¹
+ã®ããããã£ã¼ã«ãã§ï¼ç¬¦å·ç¡ãæ´æ°å¤ãä¿æãããå ´å
+ *  ã«ç¨ããã¹ããã¼ã¿åï¼ANSI Cã§ã¯ï¼ããããã£ã¼ã«ãã®ãã¼ã¿åã«ã¯
+ *  intã¨unsigned intããè¨±ãããªãããï¼ããã©ã«ãã®å®ç¾©ã¯unsigned
+ *  intã¨ãã¦ãããï¼ã¿ã¼ã²ããããã³ãã¼ã«ä¾å­ã§ï¼unsigned charã¾ãã¯
+ *  unsigned shortã«å®ç¾©ããæ¹ãå¹çãè¯ãå ´åãããï¼
+ */
+#ifndef BIT_FIELD_UINT
+#define BIT_FIELD_UINT		unsigned int
+#endif /* BIT_FIELD_UINT */
+
+/*
+ *  ããããã£ã¼ã«ãã§ã®ãã¼ã«å
+ *
+ *  1ãããå¹
+ã®ããããã£ã¼ã«ãã§ï¼ãã¼ã«å¤ãä¿æãããå ´åã«ç¨ããã¹ã
+ *  ãã¼ã¿åï¼ããã©ã«ãã§ã¯BIT_FIELD_UINTã¨åä¸ã«å®ç¾©ãã¦ãããï¼ãã¼
+ *  ã«å¤ãä¿æãããã¨ãæç¤ºããããã«å¥ã®åç§°ã¨ãã¦ããï¼
+ */
+#ifndef BIT_FIELD_BOOL
+#define BIT_FIELD_BOOL		BIT_FIELD_UINT
+#endif /* BIT_FIELD_BOOL */
+
+/*
+ *  ãªãã¸ã§ã¯ãIDã®æå°å¤ã®å®ç¾©
+ */
+#define TMIN_TSKID		1		/* ã¿ã¹ã¯IDã®æå°å¤ */
+#define TMIN_SEMID		1		/* ã»ããã©IDã®æå°å¤ */
+#define TMIN_FLGID		1		/* ãã©ã°IDã®æå°å¤ */
+#define TMIN_DTQID		1		/* ãã¼ã¿ã­ã¥ã¼IDã®æå°å¤ */
+#define TMIN_PDQID		1		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼IDã®æå°å¤ */
+#define TMIN_MTXID		1		/* ãã¥ã¼ããã¯ã¹IDã®æå°å¤ */
+#define TMIN_MPFID		1		/* åºå®é·ã¡ã¢ãªãã¼ã«IDã®æå°å¤ */
+#define TMIN_CYCID		1		/* å¨æéç¥IDã®æå°å¤ */
+#define TMIN_ALMID		1		/* ã¢ã©ã¼ã éç¥IDã®æå°å¤ */
+
+/*
+ *  åªå
+åº¦ã®æ®µéæ°ã®å®ç¾©
+ */
+#define TNUM_TPRI		(TMAX_TPRI - TMIN_TPRI + 1)
+#define TNUM_DPRI		(TMAX_DPRI - TMIN_DPRI + 1)
+#define TNUM_INTPRI		(TMAX_INTPRI - TMIN_INTPRI + 1)
+
+/*
+ *  ããããã¡ã¤ã«ãæããªãã¢ã¸ã¥ã¼ã«ã®é¢æ°ã»å¤æ°ã®å®£è¨
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  åã¢ã¸ã¥ã¼ã«ã®åæåï¼kernel_cfg.cï¼
+ */
+extern void	initialize_object(void);
+
+/*
+ *  åæåã«ã¼ãã³ã®å®è¡ï¼kernel_cfg.cï¼
+ */
+extern void	call_inirtn(void);
+
+/*
+ *  çµäºå¦çã«ã¼ãã³ã®å®è¡ï¼kernel_cfg.cï¼
+ */
+extern void	call_terrtn(void);
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åï¼kernel_cfg.cï¼
+ */
+extern const size_t	istksz;		/* ã¹ã¿ãã¯é åã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
+extern STK_T *const	istk;		/* ã¹ã¿ãã¯é åã®å
+é ­çªå° */
+#ifdef TOPPERS_ISTKPT
+extern STK_T *const	istkpt;		/* ã¹ã¿ãã¯ãã¤ã³ã¿ã®åæå¤ */
+#endif /* TOPPERS_ISTKPT */
+
+/*
+ *  ã«ã¼ãã«åä½ç¶æ
+ãã©ã°ï¼startup.cï¼
+ */
+extern bool_t	kerflg;
+
+/*
+ *  ã«ã¼ãã«ã®èµ·åï¼startup.cï¼
+ */
+extern void	sta_ker(void);
+
+/*
+ *  ã«ã¼ãã«ã®çµäºå¦çï¼startup.cï¼
+ */
+extern void	exit_kernel(void);
+
+/*
+ *  éç¥ãã³ãã©ã®åå®ç¾©
+ */
+typedef void	(*NFYHDR)(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_KERNEL_IMPL_H */
Index: asp3_wo_tecs/trunk/kernel/kernel_int.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_int.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/kernel_int.h	(revision 302)
@@ -0,0 +1,101 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 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: kernel_int.h 12 2014-01-11 11:33:30Z ertl-hiro $
+ */
+
+/*
+ *		kernel_cfg.cï¼ããã³cfg1_out.cï¼ç¨ããããã¡ã¤ã«
+ */
+
+#ifndef TOPPERS_KERNEL_INT_H
+#define TOPPERS_KERNEL_INT_H
+
+/*
+ *  ã«ã¼ãã«æ¨æºããããã¡ã¤ã«
+ */
+#include "kernel_impl.h"
+
+/*
+ *  ã«ã¼ãã«ã®åããããã¡ã¤ã«
+ */
+#include "task.h"
+#include "semaphore.h"
+#include "eventflag.h"
+#include "dataqueue.h"
+#include "pridataq.h"
+#include "mutex.h"
+#include "mempfix.h"
+#include "cyclic.h"
+#include "alarm.h"
+#include "interrupt.h"
+#include "exception.h"
+#include "time_event.h"
+
+/*
+ *  ãªãã¼ã ããã·ã³ãã«ãå
+ã«æ»ãããã®ããããã¡ã¤ã«
+ */
+#include "kernel_unrename.h"
+
+/*
+ *  å
+å®¹ãç©ºã®é
+åãçæããããã®ãã¯ã­
+ */
+#ifndef TOPPERS_EMPTY_LABEL
+#define TOPPERS_EMPTY_LABEL(type, var)		type var[0]
+#endif
+
+#endif /* TOPPERS_KERNEL_INT_H */
Index: asp3_wo_tecs/trunk/kernel/kernel_rename.def
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/kernel_rename.def	(revision 302)
@@ -0,0 +1,148 @@
+# startup.c
+kerflg
+exit_kernel
+
+# task.c
+p_runtsk
+p_schedtsk
+enadsp
+dspflg
+ready_queue
+ready_primap
+initialize_task
+search_schedtsk
+make_runnable
+make_non_runnable
+make_dormant
+make_active
+change_priority
+rotate_ready_queue
+task_terminate
+
+# taskhook.c
+mtxhook_check_ceilpri
+mtxhook_scan_ceilmtx
+mtxhook_release_all
+
+# wait.c
+make_wait_tmout
+wait_complete
+wait_tmout
+wait_tmout_ok
+wobj_make_wait
+wobj_make_wait_tmout
+init_wait_queue
+
+# time_event.c
+boundary_evttim
+current_evttim
+current_hrtcnt
+monotonic_evttim
+systim_offset
+in_signal_time
+initialize_tmevt
+tmevt_up
+tmevt_down
+update_current_evttim
+set_hrt_event
+tmevtb_register
+tmevtb_enqueue
+tmevtb_dequeue
+check_adjtim
+tmevt_lefttim
+signal_time
+
+# semaphore.c
+initialize_semaphore
+
+# eventflag.c
+initialize_eventflag
+check_flg_cond
+
+# dataqueue.c
+initialize_dataqueue
+enqueue_data
+force_enqueue_data
+dequeue_data
+send_data
+force_send_data
+receive_data
+
+# pridataq.c
+initialize_pridataq
+enqueue_pridata
+dequeue_pridata
+send_pridata
+receive_pridata
+
+# mutex.c
+initialize_mutex
+mutex_check_ceilpri
+mutex_scan_ceilmtx
+mutex_drop_priority
+mutex_acquire
+mutex_release
+mutex_release_all
+
+# mempfix.c
+initialize_mempfix
+get_mpf_block
+
+# cyclic.c
+initialize_cyclic
+call_cyclic
+
+# alarm.c
+initialize_alarm
+call_alarm
+
+# interrupt.c
+initialize_interrupt
+
+# exception.c
+initialize_exception
+
+# kernel_cfg.c
+initialize_object
+call_inirtn
+call_terrtn
+tmax_tskid
+tinib_table
+torder_table
+tcb_table
+tmax_semid
+seminib_table
+semcb_table
+tmax_flgid
+flginib_table
+flgcb_table
+tmax_dtqid
+dtqinib_table
+dtqcb_table
+tmax_pdqid
+pdqinib_table
+pdqcb_table
+tmax_mtxid
+mtxinib_table
+mtxcb_table
+tmax_mpfid
+mpfinib_table
+mpfcb_table
+tmax_cycid
+cycinib_table
+cyccb_table
+tmax_almid
+alminib_table
+almcb_table
+tnum_def_inhno
+inhinib_table
+tnum_cfg_intno
+intinib_table
+tnum_def_excno
+excinib_table
+tmevt_heap
+istksz
+istk
+istkpt
+
+INCLUDE "target"
Index: asp3_wo_tecs/trunk/kernel/kernel_rename.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_rename.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/kernel_rename.h	(revision 302)
@@ -0,0 +1,372 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+#ifndef TOPPERS_KERNEL_RENAME_H
+#define TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  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
+
+
+#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"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/kernel/kernel_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/kernel_unrename.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/kernel_unrename.h	(revision 302)
@@ -0,0 +1,373 @@
+/* This file is generated from kernel_rename.def by genrename. */
+
+/* This file is included only when kernel_rename.h has been included. */
+#ifdef TOPPERS_KERNEL_RENAME_H
+#undef TOPPERS_KERNEL_RENAME_H
+
+/*
+ *  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
+
+
+#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"
+
+#endif /* TOPPERS_KERNEL_RENAME_H */
Index: asp3_wo_tecs/trunk/kernel/mempfix.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/mempfix.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/mempfix.c	(revision 302)
@@ -0,0 +1,424 @@
+/*
+ *  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: mempfix.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		åºå®é·ã¡ã¢ãªãã¼ã«æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "mempfix.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_GET_MPF_ENTER
+#define LOG_GET_MPF_ENTER(mpfid, p_blk)
+#endif /* LOG_GET_MPF_ENTER */
+
+#ifndef LOG_GET_MPF_LEAVE
+#define LOG_GET_MPF_LEAVE(ercd, p_blk)
+#endif /* LOG_GET_MPF_LEAVE */
+
+#ifndef LOG_PGET_MPF_ENTER
+#define LOG_PGET_MPF_ENTER(mpfid, p_blk)
+#endif /* LOG_PGET_MPF_ENTER */
+
+#ifndef LOG_PGET_MPF_LEAVE
+#define LOG_PGET_MPF_LEAVE(ercd, p_blk)
+#endif /* LOG_PGET_MPF_LEAVE */
+
+#ifndef LOG_TGET_MPF_ENTER
+#define LOG_TGET_MPF_ENTER(mpfid, p_blk, tmout)
+#endif /* LOG_TGET_MPF_ENTER */
+
+#ifndef LOG_TGET_MPF_LEAVE
+#define LOG_TGET_MPF_LEAVE(ercd, p_blk)
+#endif /* LOG_TGET_MPF_LEAVE */
+
+#ifndef LOG_REL_MPF_ENTER
+#define LOG_REL_MPF_ENTER(mpfid, blk)
+#endif /* LOG_REL_MPF_ENTER */
+
+#ifndef LOG_REL_MPF_LEAVE
+#define LOG_REL_MPF_LEAVE(ercd)
+#endif /* LOG_REL_MPF_LEAVE */
+
+#ifndef LOG_INI_MPF_ENTER
+#define LOG_INI_MPF_ENTER(mpfid)
+#endif /* LOG_INI_MPF_ENTER */
+
+#ifndef LOG_INI_MPF_LEAVE
+#define LOG_INI_MPF_LEAVE(ercd)
+#endif /* LOG_INI_MPF_LEAVE */
+
+#ifndef LOG_REF_MPF_ENTER
+#define LOG_REF_MPF_ENTER(mpfid, pk_rmpf)
+#endif /* LOG_REF_MPF_ENTER */
+
+#ifndef LOG_REF_MPF_LEAVE
+#define LOG_REF_MPF_LEAVE(ercd, pk_rmpf)
+#endif /* LOG_REF_MPF_LEAVE */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ã®æ°
+ */
+#define tnum_mpf	((uint_t)(tmax_mpfid - TMIN_MPFID + 1))
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«IDããåºå®é·ã¡ã¢ãªãã¼ã«ç®¡çãã­ãã¯ãåãåºãã
+ *  ãã®ãã¯ã­
+ */
+#define INDEX_MPF(mpfid)	((uint_t)((mpfid) - TMIN_MPFID))
+#define get_mpfcb(mpfid)	(&(mpfcb_table[INDEX_MPF(mpfid)]))
+
+/*
+ *  ç¹æ®ãªã¤ã³ããã¯ã¹å¤ã®å®ç¾©
+ */
+#define INDEX_NULL		(~0U)		/* ç©ºããã­ãã¯ãªã¹ãã®æå¾ */
+#define INDEX_ALLOC		(~1U)		/* å²å½ã¦æ¸ã¿ã®ãã­ãã¯ */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«æ©è½ã®åæå
+ */
+#ifdef TOPPERS_mpfini
+
+void
+initialize_mempfix(void)
+{
+	uint_t	i;
+	MPFCB	*p_mpfcb;
+
+	for (i = 0; i < tnum_mpf; i++) {
+		p_mpfcb = &(mpfcb_table[i]);
+		queue_initialize(&(p_mpfcb->wait_queue));
+		p_mpfcb->p_mpfinib = &(mpfinib_table[i]);
+		p_mpfcb->fblkcnt = p_mpfcb->p_mpfinib->blkcnt;
+		p_mpfcb->unused = 0U;
+		p_mpfcb->freelist = INDEX_NULL;
+	}
+}
+
+#endif /* TOPPERS_mpfini */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ãããã­ãã¯ãç²å¾
+ */
+#ifdef TOPPERS_mpfget
+
+void
+get_mpf_block(MPFCB *p_mpfcb, void **p_blk)
+{
+	uint_t	blkidx;
+
+	if (p_mpfcb->freelist != INDEX_NULL) {
+		blkidx = p_mpfcb->freelist;
+		p_mpfcb->freelist = (p_mpfcb->p_mpfinib->p_mpfmb + blkidx)->next;
+	}
+	else {
+		blkidx = p_mpfcb->unused;
+		p_mpfcb->unused++;
+	}
+	*p_blk = (void *)((char *)(p_mpfcb->p_mpfinib->mpf)
+								+ p_mpfcb->p_mpfinib->blksz * blkidx);
+	p_mpfcb->fblkcnt--;
+	(p_mpfcb->p_mpfinib->p_mpfmb + blkidx)->next = INDEX_ALLOC;
+}
+
+#endif /* TOPPERS_mpfget */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾
+ */
+#ifdef TOPPERS_get_mpf
+
+ER
+get_mpf(ID mpfid, void **p_blk)
+{
+	MPFCB	*p_mpfcb;
+	WINFO_MPF winfo_mpf;
+	ER		ercd;
+
+	LOG_GET_MPF_ENTER(mpfid, p_blk);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_MPFID(mpfid));
+	p_mpfcb = get_mpfcb(mpfid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_mpfcb->fblkcnt > 0) {
+		get_mpf_block(p_mpfcb, p_blk);
+		ercd = E_OK;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_MPF;
+		wobj_make_wait((WOBJCB *) p_mpfcb, (WINFO_WOBJ *) &winfo_mpf);
+		dispatch();
+		ercd = winfo_mpf.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_blk = winfo_mpf.blk;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_GET_MPF_LEAVE(ercd, p_blk);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_mpf */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_pget_mpf
+
+ER
+pget_mpf(ID mpfid, void **p_blk)
+{
+	MPFCB	*p_mpfcb;
+	ER		ercd;
+
+	LOG_PGET_MPF_ENTER(mpfid, p_blk);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MPFID(mpfid));
+	p_mpfcb = get_mpfcb(mpfid);
+
+	lock_cpu();
+	if (p_mpfcb->fblkcnt > 0) {
+		get_mpf_block(p_mpfcb, p_blk);
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PGET_MPF_LEAVE(ercd, p_blk);
+	return(ercd);
+}
+
+#endif /* TOPPERS_pget_mpf */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_tget_mpf
+
+ER
+tget_mpf(ID mpfid, void **p_blk, TMO tmout)
+{
+	MPFCB	*p_mpfcb;
+	WINFO_MPF winfo_mpf;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TGET_MPF_ENTER(mpfid, p_blk, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_MPFID(mpfid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_mpfcb = get_mpfcb(mpfid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_mpfcb->fblkcnt > 0) {
+		get_mpf_block(p_mpfcb, p_blk);
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_MPF;
+		wobj_make_wait_tmout((WOBJCB *) p_mpfcb, (WINFO_WOBJ *) &winfo_mpf,
+														&tmevtb, tmout);
+		dispatch();
+		ercd = winfo_mpf.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_blk = winfo_mpf.blk;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TGET_MPF_LEAVE(ercd, p_blk);
+	return(ercd);
+}
+
+#endif /* TOPPERS_tget_mpf */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã­ãã¯ã®è¿å´
+ */
+#ifdef TOPPERS_rel_mpf
+
+ER
+rel_mpf(ID mpfid, void *blk)
+{
+	MPFCB	*p_mpfcb;
+	size_t	blkoffset;
+	uint_t	blkidx;
+	TCB		*p_tcb;
+	ER		ercd;
+    
+	LOG_REL_MPF_ENTER(mpfid, blk);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MPFID(mpfid));
+	p_mpfcb = get_mpfcb(mpfid);
+	CHECK_PAR(p_mpfcb->p_mpfinib->mpf <= blk);
+	blkoffset = ((char *) blk) - (char *)(p_mpfcb->p_mpfinib->mpf);
+	CHECK_PAR(blkoffset % p_mpfcb->p_mpfinib->blksz == 0U);
+	CHECK_PAR(blkoffset / p_mpfcb->p_mpfinib->blksz < p_mpfcb->unused);
+	blkidx = (uint_t)(blkoffset / p_mpfcb->p_mpfinib->blksz);
+	CHECK_PAR((p_mpfcb->p_mpfinib->p_mpfmb + blkidx)->next == INDEX_ALLOC);
+
+	lock_cpu();
+	if (!queue_empty(&(p_mpfcb->wait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_mpfcb->wait_queue));
+		((WINFO_MPF *)(p_tcb->p_winfo))->blk = blk;
+		wait_complete(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		p_mpfcb->fblkcnt++;
+		(p_mpfcb->p_mpfinib->p_mpfmb + blkidx)->next = p_mpfcb->freelist;
+		p_mpfcb->freelist = blkidx;
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REL_MPF_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rel_mpf */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ã®ååæå
+ */
+#ifdef TOPPERS_ini_mpf
+
+ER
+ini_mpf(ID mpfid)
+{
+	MPFCB	*p_mpfcb;
+	ER		ercd;
+    
+	LOG_INI_MPF_ENTER(mpfid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MPFID(mpfid));
+	p_mpfcb = get_mpfcb(mpfid);
+
+	lock_cpu();
+	init_wait_queue(&(p_mpfcb->wait_queue));
+	p_mpfcb->fblkcnt = p_mpfcb->p_mpfinib->blkcnt;
+	p_mpfcb->unused = 0U;
+	p_mpfcb->freelist = INDEX_NULL;
+	if (p_runtsk != p_schedtsk) {
+		dispatch();
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_INI_MPF_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ini_mpf */
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_mpf
+
+ER
+ref_mpf(ID mpfid, T_RMPF *pk_rmpf)
+{
+	MPFCB	*p_mpfcb;
+	ER		ercd;
+    
+	LOG_REF_MPF_ENTER(mpfid, pk_rmpf);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MPFID(mpfid));
+	p_mpfcb = get_mpfcb(mpfid);
+
+	lock_cpu();
+	pk_rmpf->wtskid = wait_tskid(&(p_mpfcb->wait_queue));
+	pk_rmpf->fblkcnt = p_mpfcb->fblkcnt;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_MPF_LEAVE(ercd, pk_rmpf);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_mpf */
Index: asp3_wo_tecs/trunk/kernel/mempfix.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/mempfix.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/mempfix.h	(revision 302)
@@ -0,0 +1,171 @@
+/*
+ *  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: mempfix.h 200 2014-09-05 19:18:00Z ertl-hiro $
+ */
+
+/*
+ *		åºå®é·ã¡ã¢ãªãã¼ã«æ©è½
+ */
+
+#ifndef TOPPERS_MEMPFIX_H
+#define TOPPERS_MEMPFIX_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "wait.h"
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã­ãã¯ç®¡çãã­ãã¯
+ *
+ *  nextãã£ã¼ã«ãã«ã¯ï¼ã¡ã¢ãªãã­ãã¯ãå²å½ã¦æ¸ã¿ã®å ´åã¯INDEX_ALLOCãï¼
+ *  æªå²å½ã¦ã®å ´åã¯æ¬¡ã®æªå²å½ã¦ãã­ãã¯ã®ã¤ã³ããã¯ã¹çªå·ãæ ¼ç´ããï¼
+ *  æå¾ã®æªå²å½ã¦ãã­ãã¯ã®å ´åã«ã¯ï¼INDEX_NULLãæ ¼ç´ããï¼
+ */
+typedef struct fixed_memoryblock_management_block {
+	uint_t		next;			/* æ¬¡ã®æªå²å½ã¦ãã­ãã¯ */
+} MPFMB;
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«åæåãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WOBJINIBï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct fixed_memorypool_initialization_block {
+	ATR			mpfatr;			/* åºå®é·ã¡ã¢ãªãã¼ã«å±æ§ */
+	uint_t		blkcnt;			/* ã¡ã¢ãªãã­ãã¯æ° */
+	uint_t		blksz;			/* ã¡ã¢ãªãã­ãã¯ã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
+	void		*mpf;			/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®å
+é ­çªå° */
+	MPFMB		*p_mpfmb;		/* åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çé åã®å
+é ­çªå° */
+} MPFINIB;
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼
+ *  ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼æåã®2ã¤ã®
+ *  ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct fixed_memorypool_control_block {
+	QUEUE		wait_queue;		/* åºå®é·ã¡ã¢ãªãã¼ã«å¾
+ã¡ã­ã¥ã¼ */
+	const MPFINIB *p_mpfinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	uint_t		fblkcnt;		/* æªå²å½ã¦ãã­ãã¯æ° */
+	uint_t		unused;			/* æªä½¿ç¨ãã­ãã¯ã®å
+é ­ */
+	uint_t		freelist;		/* æªå²å½ã¦ãã­ãã¯ã®ãªã¹ã */
+} MPFCB;
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«å¾
+ã¡æ
+å ±ãã­ãã¯ã®å®ç¾©
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WINFO_WOBJï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®2ã¤ã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct fixed_memorypool_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	MPFCB		*p_mpfcb;		/* å¾
+ã£ã¦ããåºå®é·ã¡ã¢ãªãã¼ã«ã®ç®¡çãã­ãã¯*/
+	void		*blk;			/* ç²å¾ããã¡ã¢ãªãã­ãã¯ */
+} WINFO_MPF;
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_mpfid;
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const MPFINIB	mpfinib_table[];
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern MPFCB	mpfcb_table[];
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ç®¡çãã­ãã¯ããåºå®é·ã¡ã¢ãªãã¼ã«IDãåãåºãã
+ *  ãã®ãã¯ã­
+ */
+#define	MPFID(p_mpfcb)	((ID)(((p_mpfcb) - mpfcb_table) + TMIN_MPFID))
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«æ©è½ã®åæå
+ */
+extern void	initialize_mempfix(void);
+
+/*
+ *  åºå®é·ã¡ã¢ãªãã¼ã«ãããã­ãã¯ãç²å¾
+ */
+extern void	get_mpf_block(MPFCB *p_mpfcb, void **p_blk);
+
+#endif /* TOPPERS_MEMPFIX_H */
Index: asp3_wo_tecs/trunk/kernel/mempfix.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/mempfix.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/mempfix.tf	(revision 302)
@@ -0,0 +1,171 @@
+$
+$   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/mutex.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/mutex.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/mutex.c	(revision 302)
@@ -0,0 +1,629 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: mutex.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		ãã¥ã¼ããã¯ã¹æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "taskhook.h"
+#include "wait.h"
+#include "mutex.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_LOC_MTX_ENTER
+#define LOG_LOC_MTX_ENTER(mtxid)
+#endif /* LOG_LOC_MTX_ENTER */
+
+#ifndef LOG_LOC_MTX_LEAVE
+#define LOG_LOC_MTX_LEAVE(ercd)
+#endif /* LOG_LOC_MTX_LEAVE */
+
+#ifndef LOG_PLOC_MTX_ENTER
+#define LOG_PLOC_MTX_ENTER(mtxid)
+#endif /* LOG_PLOC_MTX_ENTER */
+
+#ifndef LOG_PLOC_MTX_LEAVE
+#define LOG_PLOC_MTX_LEAVE(ercd)
+#endif /* LOG_PLOC_MTX_LEAVE */
+
+#ifndef LOG_TLOC_MTX_ENTER
+#define LOG_TLOC_MTX_ENTER(mtxid, tmout)
+#endif /* LOG_TLOC_MTX_ENTER */
+
+#ifndef LOG_TLOC_MTX_LEAVE
+#define LOG_TLOC_MTX_LEAVE(ercd)
+#endif /* LOG_TLOC_MTX_LEAVE */
+
+#ifndef LOG_UNL_MTX_ENTER
+#define LOG_UNL_MTX_ENTER(mtxid)
+#endif /* LOG_UNL_MTX_ENTER */
+
+#ifndef LOG_UNL_MTX_LEAVE
+#define LOG_UNL_MTX_LEAVE(ercd)
+#endif /* LOG_UNL_MTX_LEAVE */
+
+#ifndef LOG_INI_MTX_ENTER
+#define LOG_INI_MTX_ENTER(mtxid)
+#endif /* LOG_INI_MTX_ENTER */
+
+#ifndef LOG_INI_MTX_LEAVE
+#define LOG_INI_MTX_LEAVE(ercd)
+#endif /* LOG_INI_MTX_LEAVE */
+
+#ifndef LOG_REF_MTX_ENTER
+#define LOG_REF_MTX_ENTER(mtxid, pk_rmtx)
+#endif /* LOG_REF_MTX_ENTER */
+
+#ifndef LOG_REF_MTX_LEAVE
+#define LOG_REF_MTX_LEAVE(ercd, pk_rmtx)
+#endif /* LOG_REF_MTX_LEAVE */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®æ°
+ */
+#define tnum_mtx	((uint_t)(tmax_mtxid - TMIN_MTXID + 1))
+
+/*
+ *  ãã¥ã¼ããã¯ã¹IDãããã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_MTX(mtxid)	((uint_t)((mtxid) - TMIN_MTXID))
+#define get_mtxcb(mtxid)	(&(mtxcb_table[INDEX_MTX(mtxid)]))
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ãã­ãã³ã«ãå¤æ­ãããã¯ã­
+ */
+#define MTXPROTO_MASK			0x03U
+#define MTXPROTO(p_mtxcb)		((p_mtxcb)->p_mtxinib->mtxatr & MTXPROTO_MASK)
+#define MTX_CEILING(p_mtxcb)	(MTXPROTO(p_mtxcb) == TA_CEILING)
+
+/* 
+ *  ãã¥ã¼ããã¯ã¹æ©è½ã®åæå
+ */
+#ifdef TOPPERS_mtxini
+
+void
+initialize_mutex(void)
+{
+	uint_t	i;
+	MTXCB	*p_mtxcb;
+
+	mtxhook_check_ceilpri = mutex_check_ceilpri;
+	mtxhook_scan_ceilmtx = mutex_scan_ceilmtx;
+	mtxhook_release_all = mutex_release_all;
+
+	for (i = 0; i < tnum_mtx; i++) {
+		p_mtxcb = &(mtxcb_table[i]);
+		queue_initialize(&(p_mtxcb->wait_queue));
+		p_mtxcb->p_mtxinib = &(mtxinib_table[i]);
+		p_mtxcb->p_loctsk = NULL;
+	}
+}
+
+#endif /* TOPPERS_mtxini */
+
+/* 
+ *  ä¸éåªå
+åº¦éåã®ãã§ãã¯
+ */
+#ifdef TOPPERS_mtxchk
+
+bool_t
+mutex_check_ceilpri(TCB *p_tcb, uint_t bpriority)
+{
+	MTXCB	*p_mtxcb;
+
+	/*
+	 *  ã¿ã¹ã¯ãã­ãã¯ãã¦ããåªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã®ä¸­ã§ï¼ä¸éåªå
+
+	 *  åº¦ãbpriorityãããä½ããã®ãããã°ï¼falseãè¿ãï¼
+	 */
+	p_mtxcb = p_tcb->p_lastmtx;
+	while (p_mtxcb != NULL) {
+		if (MTX_CEILING(p_mtxcb) && bpriority < p_mtxcb->p_mtxinib->ceilpri) {
+			return(false);
+		}
+		p_mtxcb = p_mtxcb->p_prevmtx;
+	}
+
+	/*
+	 *  ã¿ã¹ã¯ãåªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã®ã­ãã¯ãå¾
+ã£ã¦ããå ´åã«ï¼ã
+	 *  ã®ä¸éåªå
+åº¦ãbpriorityãããä½ãããã°ï¼falseãè¿ãï¼
+	 */
+	if (TSTAT_WAIT_MTX(p_tcb->tstat)) {
+		p_mtxcb = ((WINFO_MTX *)(p_tcb->p_winfo))->p_mtxcb;
+		if (MTX_CEILING(p_mtxcb) && bpriority < p_mtxcb->p_mtxinib->ceilpri) {
+			return(false);
+		}
+	}
+
+	/*
+	 *  ãããã®æ¡ä»¶ã«ãå½ã¦ã¯ã¾ããªããã°trueãè¿ãï¼
+	 */
+	return(true);
+}
+
+#endif /* TOPPERS_mtxchk */
+
+/* 
+ *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ãããã®ãã§ãã¯
+ */
+#ifdef TOPPERS_mtxscan
+
+bool_t
+mutex_scan_ceilmtx(TCB *p_tcb)
+{
+	MTXCB	*p_mtxcb;
+
+	p_mtxcb = p_tcb->p_lastmtx;
+	while (p_mtxcb != NULL) {
+		if (MTX_CEILING(p_mtxcb)) {
+			return(true);
+		}
+		p_mtxcb = p_mtxcb->p_prevmtx;
+	}
+	return(false);
+}
+
+#endif /* TOPPERS_mtxscan */
+
+/* 
+ *  ã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ã®è¨ç®
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ï¼ã«è¨­å®ãã¹ãå¤ï¼ãè¨ç®ããï¼
+ */
+Inline uint_t
+mutex_calc_priority(TCB *p_tcb)
+{
+	uint_t	priority;
+	MTXCB	*p_mtxcb;
+
+	priority = p_tcb->bpriority;
+	p_mtxcb = p_tcb->p_lastmtx;
+	while (p_mtxcb != NULL) {
+		if (MTX_CEILING(p_mtxcb) && p_mtxcb->p_mtxinib->ceilpri < priority) {
+			priority = p_mtxcb->p_mtxinib->ceilpri;
+		}
+		p_mtxcb = p_mtxcb->p_prevmtx;
+	}
+	return(priority);
+}
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ãè§£æ¾ããå ´åã®ç¾å¨åªå
+åº¦å¤æ´å¦ç
+ */
+#ifdef TOPPERS_mtxdrop
+
+void
+mutex_drop_priority(TCB *p_tcb, MTXCB *p_mtxcb)
+{
+	uint_t	newpri;
+
+	if (MTX_CEILING(p_mtxcb)
+					&& p_mtxcb->p_mtxinib->ceilpri == p_tcb->priority) {
+		newpri = mutex_calc_priority(p_tcb);
+		if (newpri != p_tcb->priority) {
+			change_priority(p_tcb, newpri, true);
+		}
+	}
+}
+
+#endif /* TOPPERS_mtxdrop */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯
+ */
+#ifdef TOPPERS_mtxacq
+
+void
+mutex_acquire(TCB *p_tcb, MTXCB *p_mtxcb)
+{
+	p_mtxcb->p_loctsk = p_tcb;
+	p_mtxcb->p_prevmtx = p_tcb->p_lastmtx;
+	p_tcb->p_lastmtx = p_mtxcb;
+	if (MTX_CEILING(p_mtxcb)
+					&& p_mtxcb->p_mtxinib->ceilpri < p_tcb->priority) {
+		change_priority(p_tcb, p_mtxcb->p_mtxinib->ceilpri, true);
+	}
+}
+
+#endif /* TOPPERS_mtxacq */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤
+ */
+#ifdef TOPPERS_mtxrel
+
+void
+mutex_release(MTXCB *p_mtxcb)
+{
+	TCB		*p_tcb;
+
+	if (queue_empty(&(p_mtxcb->wait_queue))) {
+		p_mtxcb->p_loctsk = NULL;
+	}
+	else {
+		/*
+		 *  ãã¥ã¼ããã¯ã¹å¾
+ã¡ã­ã¥ã¼ã®å
+é ­ã¿ã¹ã¯ï¼p_tcbï¼ã«ï¼ãã¥ã¼ãã
+		 *  ã¯ã¹ãã­ãã¯ãããï¼
+		 */
+		p_tcb = (TCB *) queue_delete_next(&(p_mtxcb->wait_queue));
+		wait_dequeue_tmevtb(p_tcb);
+		p_tcb->p_winfo->wercd = E_OK;
+
+		p_mtxcb->p_loctsk = p_tcb;
+		p_mtxcb->p_prevmtx = p_tcb->p_lastmtx;
+		p_tcb->p_lastmtx = p_mtxcb;
+		if (MTX_CEILING(p_mtxcb)) {
+			if (p_mtxcb->p_mtxinib->ceilpri < p_tcb->priority) {
+				p_tcb->priority = p_mtxcb->p_mtxinib->ceilpri;
+			}
+		}
+		make_non_wait(p_tcb);
+	}
+}
+
+#endif /* TOPPERS_mtxrel */
+
+/*
+ *  ã¿ã¹ã¯ãã­ãã¯ãã¦ãããã¹ã¦ã®ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤
+ */
+#ifdef TOPPERS_mtxrela
+
+void
+mutex_release_all(TCB *p_tcb)
+{
+	MTXCB	*p_mtxcb;
+
+	while ((p_mtxcb = p_tcb->p_lastmtx) != NULL) {
+		p_tcb->p_lastmtx = p_mtxcb->p_prevmtx;
+		mutex_release(p_mtxcb);
+	}
+}
+
+#endif /* TOPPERS_mtxrela */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯
+ */
+#ifdef TOPPERS_loc_mtx
+
+ER
+loc_mtx(ID mtxid)
+{
+	MTXCB	*p_mtxcb;
+	WINFO_MTX winfo_mtx;
+	ER		ercd;
+
+	LOG_LOC_MTX_ENTER(mtxid);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_MTXID(mtxid));
+	p_mtxcb = get_mtxcb(mtxid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (MTX_CEILING(p_mtxcb)
+				&& p_runtsk->bpriority < p_mtxcb->p_mtxinib->ceilpri) {
+		ercd = E_ILUSE;
+	}
+	else if (p_mtxcb->p_loctsk == NULL) {
+		mutex_acquire(p_runtsk, p_mtxcb);
+		/*
+		 *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ããå ´åï¼p_runtskã®åªå
+åº¦
+		 *  ãä¸ããå¯è½æ§ããããï¼ãã£ã¹ããããå¿
+è¦ã«ãªããã¨ã¯ãªãï¼
+		 */
+		assert(p_runtsk == p_schedtsk);
+		ercd = E_OK;
+	}
+	else if (p_mtxcb->p_loctsk == p_runtsk) {
+		ercd = E_OBJ;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_MTX;
+		wobj_make_wait((WOBJCB *) p_mtxcb, (WINFO_WOBJ *) &winfo_mtx);
+		dispatch();
+		ercd = winfo_mtx.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_LOC_MTX_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_loc_mtx */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_ploc_mtx
+
+ER
+ploc_mtx(ID mtxid)
+{
+	MTXCB	*p_mtxcb;
+	ER		ercd;
+
+	LOG_PLOC_MTX_ENTER(mtxid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MTXID(mtxid));
+	p_mtxcb = get_mtxcb(mtxid);
+
+	lock_cpu();
+	if (MTX_CEILING(p_mtxcb)
+				&& p_runtsk->bpriority < p_mtxcb->p_mtxinib->ceilpri) {
+		ercd = E_ILUSE;
+	}
+	else if (p_mtxcb->p_loctsk == NULL) {
+		mutex_acquire(p_runtsk, p_mtxcb);
+		/*
+		 *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ããå ´åï¼p_runtskã®åªå
+åº¦
+		 *  ãä¸ããå¯è½æ§ããããï¼ãã£ã¹ããããå¿
+è¦ã«ãªããã¨ã¯ãªãï¼
+		 */
+		assert(p_runtsk == p_schedtsk);
+		ercd = E_OK;
+	}
+	else if (p_mtxcb->p_loctsk == p_runtsk) {
+		ercd = E_OBJ;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PLOC_MTX_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ploc_mtx */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_tloc_mtx
+
+ER
+tloc_mtx(ID mtxid, TMO tmout)
+{
+	MTXCB	*p_mtxcb;
+	WINFO_MTX winfo_mtx;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TLOC_MTX_ENTER(mtxid, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_MTXID(mtxid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_mtxcb = get_mtxcb(mtxid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (MTX_CEILING(p_mtxcb)
+				&& p_runtsk->bpriority < p_mtxcb->p_mtxinib->ceilpri) {
+		ercd = E_ILUSE;
+	}
+	else if (p_mtxcb->p_loctsk == NULL) {
+		mutex_acquire(p_runtsk, p_mtxcb);
+		/*
+		 *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ããå ´åï¼p_runtskã®åªå
+åº¦
+		 *  ãä¸ããå¯è½æ§ããããï¼ãã£ã¹ããããå¿
+è¦ã«ãªããã¨ã¯ãªãï¼
+		 */
+		assert(p_runtsk == p_schedtsk);
+		ercd = E_OK;
+	}
+	else if (p_mtxcb->p_loctsk == p_runtsk) {
+		ercd = E_OBJ;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_MTX;
+		wobj_make_wait_tmout((WOBJCB *) p_mtxcb, (WINFO_WOBJ *) &winfo_mtx,
+														&tmevtb, tmout);
+		dispatch();
+		ercd = winfo_mtx.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TLOC_MTX_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_tloc_mtx */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤
+ */
+#ifdef TOPPERS_unl_mtx
+
+ER
+unl_mtx(ID mtxid)
+{
+	MTXCB	*p_mtxcb;
+	ER		ercd;
+    
+	LOG_UNL_MTX_ENTER(mtxid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MTXID(mtxid));
+	p_mtxcb = get_mtxcb(mtxid);
+
+	lock_cpu();
+	if (p_mtxcb != p_runtsk->p_lastmtx) {
+		ercd = E_OBJ;
+	}
+	else {
+		p_runtsk->p_lastmtx = p_mtxcb->p_prevmtx;
+		mutex_drop_priority(p_runtsk, p_mtxcb);
+		mutex_release(p_mtxcb);
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_UNL_MTX_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_unl_mtx */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ååæå
+ */
+#ifdef TOPPERS_ini_mtx
+
+ER
+ini_mtx(ID mtxid)
+{
+	MTXCB	*p_mtxcb, **pp_prevmtx;
+	TCB		*p_loctsk;
+	ER		ercd;
+    
+	LOG_INI_MTX_ENTER(mtxid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MTXID(mtxid));
+	p_mtxcb = get_mtxcb(mtxid);
+
+	lock_cpu();
+	init_wait_queue(&(p_mtxcb->wait_queue));
+	p_loctsk = p_mtxcb->p_loctsk;
+	if (p_loctsk != NULL) {
+		p_mtxcb->p_loctsk = NULL;
+		pp_prevmtx = &(p_loctsk->p_lastmtx);
+		while (*pp_prevmtx != NULL) {
+			if (*pp_prevmtx == p_mtxcb) {
+				*pp_prevmtx = p_mtxcb->p_prevmtx;
+				break;
+			}
+			pp_prevmtx = &((*pp_prevmtx)->p_prevmtx);
+		}
+		mutex_drop_priority(p_loctsk, p_mtxcb);
+	}
+	if (p_runtsk != p_schedtsk) {
+		dispatch();
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_INI_MTX_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ini_mtx */
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_mtx
+
+ER
+ref_mtx(ID mtxid, T_RMTX *pk_rmtx)
+{
+	MTXCB	*p_mtxcb;
+	ER		ercd;
+    
+	LOG_REF_MTX_ENTER(mtxid, pk_rmtx);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_MTXID(mtxid));
+	p_mtxcb = get_mtxcb(mtxid);
+
+	lock_cpu();
+	pk_rmtx->htskid = (p_mtxcb->p_loctsk != NULL) ? TSKID(p_mtxcb->p_loctsk)
+													: TSK_NONE;
+	pk_rmtx->wtskid = wait_tskid(&(p_mtxcb->wait_queue));
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_MTX_LEAVE(ercd, pk_rmtx);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_mtx */
Index: asp3_wo_tecs/trunk/kernel/mutex.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/mutex.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/mutex.h	(revision 302)
@@ -0,0 +1,222 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: mutex.h 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *		ãã¥ã¼ããã¯ã¹æ©è½
+ */
+
+#ifndef TOPPERS_MUTEX_H
+#define TOPPERS_MUTEX_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "wait.h"
+
+/*
+ *  ãã¥ã¼ããã¯ã¹åæåãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WOBJINIBï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct mutex_initialization_block {
+	ATR			mtxatr;			/* ãã¥ã¼ããã¯ã¹å±æ§ */
+	uint_t		ceilpri;		/* ãã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+} MTXINIB;
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼
+ *  ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼æåã®2ã¤ã®
+ *  ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+struct mutex_control_block {
+	QUEUE		wait_queue;		/* ãã¥ã¼ããã¯ã¹å¾
+ã¡ã­ã¥ã¼ */
+	const MTXINIB *p_mtxinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	TCB			*p_loctsk;		/* ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã¿ã¹ã¯ */
+	MTXCB		*p_prevmtx;		/* ãã®åã«ã­ãã¯ãããã¥ã¼ããã¯ã¹ */
+};
+
+/*
+ *  ãã¥ã¼ããã¯ã¹å¾
+ã¡æ
+å ±ãã­ãã¯ã®å®ç¾©
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WINFO_WOBJï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  ãã¹ã¦ã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct mutex_waiting_information {
+	WINFO	winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	MTXCB	*p_mtxcb;		/* å¾
+ã£ã¦ãããã¥ã¼ããã¯ã¹ã®ç®¡çãã­ãã¯ */
+} WINFO_MTX;
+
+/*
+ *  ãã¥ã¼ããã¯ã¹IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_mtxid;
+
+/*
+ *  ãã¥ã¼ããã¯ã¹åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const MTXINIB	mtxinib_table[];
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern MTXCB	mtxcb_table[];
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ãããã¥ã¼ããã¯ã¹IDãåãåºãããã®ãã¯ã­
+ */
+#define	MTXID(p_mtxcb)	((ID)(((p_mtxcb) - mtxcb_table) + TMIN_MTXID))
+
+/*
+ *  ãã¥ã¼ããã¯ã¹æ©è½ã®åæå
+ */
+extern void	initialize_mutex(void);
+
+/*
+ *  ä¸éåªå
+åº¦éåã®ãã§ãã¯
+ *
+ *  chg_priã®ä¸­ã§ä¸éåªå
+åº¦éåã®ãã§ãã¯ãè¡ãããã«ç¨ããé¢æ°ã§ããï¼
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã­ãã¯ãã¦ããåªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã¨ï¼
+ *  ã­ãã¯ãå¾
+ã£ã¦ããåªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã®ä¸­ã§ï¼ä¸éåªå
+åº¦ã
+ *  bpriorityãããä½ããã®ãããã°falseãï¼ããã§ãªããã°trueãè¿ãï¼
+ */
+extern bool_t	mutex_check_ceilpri(TCB *p_tcb, uint_t bpriority);
+
+/* 
+ *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ãããã®ãã§ãã¯
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãåªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã°
+ *  trueï¼ããã§ãªããã°falseãè¿ãï¼
+ */
+extern bool_t	mutex_scan_ceilmtx(TCB *p_tcb);
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ãã­ãã¯è§£é¤ããå ´åã®ç¾å¨åªå
+åº¦å¤æ´å¦ç
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãï¼p_mtxcbã§æå®ããããã¥ã¼ããã¯ã¹ãã­ã
+ *  ã¯è§£é¤ããéã®ç¾å¨åªå
+åº¦å¤æ´å¦çãè¡ãï¼
+ */
+extern void	mutex_drop_priority(TCB *p_tcb, MTXCB *p_mtxcb);
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã«ï¼p_mtxcbã§æå®ããããã¥ã¼ããã¯ã¹ãã­ã
+ *  ã¯ãããï¼
+ */
+extern void	mutex_acquire(TCB *p_tcb, MTXCB *p_mtxcb);
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤
+ *
+ *  p_mtxcbã§æå®ããããã¥ã¼ããã¯ã¹ãã­ãã¯è§£é¤ããï¼ã­ãã¯è§£é¤ãã
+ *  ãã¥ã¼ããã¯ã¹ã«ï¼ã­ãã¯å¾
+ã¡ç¶æ
+ã®ã¿ã¹ã¯ãããå ´åã«ã¯ï¼ãã®ã¿ã¹ã¯
+ *  ã«ãã¥ã¼ããã¯ã¹ãã­ãã¯ãããï¼
+ */
+extern void	mutex_release(MTXCB *p_mtxcb);
+
+/*
+ *  ã¿ã¹ã¯ãã­ãã¯ãã¦ãããã¹ã¦ã®ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã«ï¼ãããã­ãã¯ãã¦ãããã¹ã¦ã®ãã¥ã¼ããã¯
+ *  ã¹ãã­ãã¯è§£é¤ãããï¼ã­ãã¯è§£é¤ãããã¥ã¼ããã¯ã¹ã«ï¼ã­ãã¯å¾
+ã¡ç¶
+ *  æ
+ã®ã¿ã¹ã¯ãããå ´åã«ã¯ï¼ãã®ã¿ã¹ã¯ã«ãã¥ã¼ããã¯ã¹ãã­ãã¯ãããï¼
+ *
+ *  ãã®é¢æ°ã¯ï¼ã¿ã¹ã¯ã®çµäºæã«ä½¿ããããã®ã§ããããï¼p_tcbã§æå®ãã
+ *  ãã¿ã¹ã¯ã®åªå
+åº¦ãå¤æ´ããå¦çã¯è¡ããªãï¼ãã ãï¼ãã®é¢æ°ã®ä¸­ã§ä»
+ *  ã®ã¿ã¹ã¯ã®åªå
+åº¦ãå¤åãï¼å®è¡ãã¹ãã¿ã¹ã¯ãå¤ãããã¨ãããï¼ãã®
+ *  ããï¼ãã®é¢æ°ããæ»ã£ãå¾ã«ï¼ãã£ã¹ããããå¿
+è¦ãå¤å¥ãã¦ï¼å¿
+è¦ãª
+ *  å ´åã«ã¯ãã£ã¹ããããè¡ããªããã°ãªããªãï¼
+ */
+extern void	mutex_release_all(TCB *p_tcb);
+
+#endif /* TOPPERS_MUTEX_H */
Index: asp3_wo_tecs/trunk/kernel/mutex.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/mutex.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/mutex.tf	(revision 302)
@@ -0,0 +1,148 @@
+$
+$   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/pridataq.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/pridataq.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/pridataq.c	(revision 302)
@@ -0,0 +1,655 @@
+/*
+ *  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: pridataq.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "pridataq.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_SND_PDQ_ENTER
+#define LOG_SND_PDQ_ENTER(pdqid, data, datapri)
+#endif /* LOG_SND_PDQ_ENTER */
+
+#ifndef LOG_SND_PDQ_LEAVE
+#define LOG_SND_PDQ_LEAVE(ercd)
+#endif /* LOG_SND_PDQ_LEAVE */
+
+#ifndef LOG_PSND_PDQ_ENTER
+#define LOG_PSND_PDQ_ENTER(pdqid, data, datapri)
+#endif /* LOG_PSND_PDQ_ENTER */
+
+#ifndef LOG_PSND_PDQ_LEAVE
+#define LOG_PSND_PDQ_LEAVE(ercd)
+#endif /* LOG_PSND_PDQ_LEAVE */
+
+#ifndef LOG_TSND_PDQ_ENTER
+#define LOG_TSND_PDQ_ENTER(pdqid, data, datapri, tmout)
+#endif /* LOG_TSND_PDQ_ENTER */
+
+#ifndef LOG_TSND_PDQ_LEAVE
+#define LOG_TSND_PDQ_LEAVE(ercd)
+#endif /* LOG_TSND_PDQ_LEAVE */
+
+#ifndef LOG_RCV_PDQ_ENTER
+#define LOG_RCV_PDQ_ENTER(pdqid, p_data, p_datapri)
+#endif /* LOG_RCV_PDQ_ENTER */
+
+#ifndef LOG_RCV_PDQ_LEAVE
+#define LOG_RCV_PDQ_LEAVE(ercd, p_data, p_datapri)
+#endif /* LOG_RCV_PDQ_LEAVE */
+
+#ifndef LOG_PRCV_PDQ_ENTER
+#define LOG_PRCV_PDQ_ENTER(pdqid, p_data, p_datapri)
+#endif /* LOG_PRCV_PDQ_ENTER */
+
+#ifndef LOG_PRCV_PDQ_LEAVE
+#define LOG_PRCV_PDQ_LEAVE(ercd, p_data, p_datapri)
+#endif /* LOG_PRCV_PDQ_LEAVE */
+
+#ifndef LOG_TRCV_PDQ_ENTER
+#define LOG_TRCV_PDQ_ENTER(pdqid, p_data, p_datapri, tmout)
+#endif /* LOG_TRCV_PDQ_ENTER */
+
+#ifndef LOG_TRCV_PDQ_LEAVE
+#define LOG_TRCV_PDQ_LEAVE(ercd, p_data, p_datapri)
+#endif /* LOG_TRCV_PDQ_LEAVE */
+
+#ifndef LOG_INI_PDQ_ENTER
+#define LOG_INI_PDQ_ENTER(pdqid)
+#endif /* LOG_INI_PDQ_ENTER */
+
+#ifndef LOG_INI_PDQ_LEAVE
+#define LOG_INI_PDQ_LEAVE(ercd)
+#endif /* LOG_INI_PDQ_LEAVE */
+
+#ifndef LOG_REF_PDQ_ENTER
+#define LOG_REF_PDQ_ENTER(pdqid, pk_rpdq)
+#endif /* LOG_REF_PDQ_ENTER */
+
+#ifndef LOG_REF_PDQ_LEAVE
+#define LOG_REF_PDQ_LEAVE(ercd, pk_rpdq)
+#endif /* LOG_REF_PDQ_LEAVE */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®æ°
+ */
+#define tnum_pdq	((uint_t)(tmax_pdqid - TMIN_PDQID + 1))
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼IDããåªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ãåãåºãã
+ *  ãã®ãã¯ã­
+ */
+#define INDEX_PDQ(pdqid)	((uint_t)((pdqid) - TMIN_PDQID))
+#define get_pdqcb(pdqid)	(&(pdqcb_table[INDEX_PDQ(pdqid)]))
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½ã®åæå
+ */
+#ifdef TOPPERS_pdqini
+
+void
+initialize_pridataq(void)
+{
+	uint_t	i;
+	PDQCB	*p_pdqcb;
+
+	for (i = 0; i < tnum_pdq; i++) {
+		p_pdqcb = &(pdqcb_table[i]);
+		queue_initialize(&(p_pdqcb->swait_queue));
+		p_pdqcb->p_pdqinib = &(pdqinib_table[i]);
+		queue_initialize(&(p_pdqcb->rwait_queue));
+		p_pdqcb->count = 0U;
+		p_pdqcb->p_head = NULL;
+		p_pdqcb->unused = 0U;
+		p_pdqcb->p_freelist = NULL;
+	}
+}
+
+#endif /* TOPPERS_pdqini */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã¸ã®ãã¼ã¿ã®æ ¼ç´
+ */
+#ifdef TOPPERS_pdqenq
+
+void
+enqueue_pridata(PDQCB *p_pdqcb, intptr_t data, PRI datapri)
+{
+	PDQMB	*p_pdqmb;
+	PDQMB	**pp_prev_next, *p_next;
+
+	if (p_pdqcb->p_freelist != NULL) {
+		p_pdqmb = p_pdqcb->p_freelist;
+		p_pdqcb->p_freelist = p_pdqmb->p_next;
+	}
+	else {
+		p_pdqmb = p_pdqcb->p_pdqinib->p_pdqmb + p_pdqcb->unused;
+		p_pdqcb->unused++;
+	}
+
+	p_pdqmb->data = data;
+	p_pdqmb->datapri = datapri;
+
+	pp_prev_next = &(p_pdqcb->p_head);
+	while ((p_next = *pp_prev_next) != NULL) {
+		if (p_next->datapri > datapri) {
+			break;
+		}
+		pp_prev_next = &(p_next->p_next);
+	}
+	p_pdqmb->p_next = p_next;
+	*pp_prev_next = p_pdqmb;
+	p_pdqcb->count++;
+}
+
+#endif /* TOPPERS_pdqenq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åããã®ãã¼ã¿ã®ååºã
+ */
+#ifdef TOPPERS_pdqdeq
+
+void
+dequeue_pridata(PDQCB *p_pdqcb, intptr_t *p_data, PRI *p_datapri)
+{
+	PDQMB	*p_pdqmb;
+
+	p_pdqmb = p_pdqcb->p_head;
+	p_pdqcb->p_head = p_pdqmb->p_next;
+	p_pdqcb->count--;
+
+	*p_data = p_pdqmb->data;
+	*p_datapri = p_pdqmb->datapri;
+
+	p_pdqmb->p_next = p_pdqcb->p_freelist;
+	p_pdqcb->p_freelist = p_pdqmb;
+}
+
+#endif /* TOPPERS_pdqdeq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®ãã¼ã¿éä¿¡
+ */
+#ifdef TOPPERS_pdqsnd
+
+bool_t
+send_pridata(PDQCB *p_pdqcb, intptr_t data, PRI datapri)
+{
+	TCB		*p_tcb;
+
+	if (!queue_empty(&(p_pdqcb->rwait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_pdqcb->rwait_queue));
+		((WINFO_RPDQ *)(p_tcb->p_winfo))->data = data;
+		((WINFO_RPDQ *)(p_tcb->p_winfo))->datapri = datapri;
+		wait_complete(p_tcb);
+		return(true);
+	}
+	else if (p_pdqcb->count < p_pdqcb->p_pdqinib->pdqcnt) {
+		enqueue_pridata(p_pdqcb, data, datapri);
+		return(true);
+	}
+	else {
+		return(false);
+	}
+}
+
+#endif /* TOPPERS_pdqsnd */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®ãã¼ã¿åä¿¡
+ */
+#ifdef TOPPERS_pdqrcv
+
+bool_t
+receive_pridata(PDQCB *p_pdqcb, intptr_t *p_data, PRI *p_datapri)
+{
+	TCB		*p_tcb;
+	intptr_t data;
+	PRI		datapri;
+
+	if (p_pdqcb->count > 0U) {
+		dequeue_pridata(p_pdqcb, p_data, p_datapri);
+		if (!queue_empty(&(p_pdqcb->swait_queue))) {
+			p_tcb = (TCB *) queue_delete_next(&(p_pdqcb->swait_queue));
+			data = ((WINFO_SPDQ *)(p_tcb->p_winfo))->data;
+			datapri = ((WINFO_SPDQ *)(p_tcb->p_winfo))->datapri;
+			enqueue_pridata(p_pdqcb, data, datapri);
+			wait_complete(p_tcb);
+		}
+		return(true);
+	}
+	else if (!queue_empty(&(p_pdqcb->swait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_pdqcb->swait_queue));
+		*p_data = ((WINFO_SPDQ *)(p_tcb->p_winfo))->data;
+		*p_datapri = ((WINFO_SPDQ *)(p_tcb->p_winfo))->datapri;
+		wait_complete(p_tcb);
+		return(true);
+	}
+	else {
+		return(false);
+	}
+}
+
+#endif /* TOPPERS_pdqrcv */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡
+ */
+#ifdef TOPPERS_snd_pdq
+
+ER
+snd_pdq(ID pdqid, intptr_t data, PRI datapri)
+{
+	PDQCB	*p_pdqcb;
+	WINFO_SPDQ winfo_spdq;
+	ER		ercd;
+
+	LOG_SND_PDQ_ENTER(pdqid, data, datapri);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_PDQID(pdqid));
+	p_pdqcb = get_pdqcb(pdqid);
+	CHECK_PAR(TMIN_DPRI <= datapri && datapri <= p_pdqcb->p_pdqinib->maxdpri);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (send_pridata(p_pdqcb, data, datapri)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		winfo_spdq.data = data;
+		winfo_spdq.datapri = datapri;
+		p_runtsk->tstat = TS_WAITING_SPDQ;
+		wobj_make_wait((WOBJCB *) p_pdqcb, (WINFO_WOBJ *) &winfo_spdq);
+		dispatch();
+		ercd = winfo_spdq.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_SND_PDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_snd_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_psnd_pdq
+
+ER
+psnd_pdq(ID pdqid, intptr_t data, PRI datapri)
+{
+	PDQCB	*p_pdqcb;
+	ER		ercd;
+
+	LOG_PSND_PDQ_ENTER(pdqid, data, datapri);
+	CHECK_UNL();
+	CHECK_ID(VALID_PDQID(pdqid));
+	p_pdqcb = get_pdqcb(pdqid);
+	CHECK_PAR(TMIN_DPRI <= datapri && datapri <= p_pdqcb->p_pdqinib->maxdpri);
+
+	lock_cpu();
+	if (send_pridata(p_pdqcb, data, datapri)) {
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PSND_PDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_psnd_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_tsnd_pdq
+
+ER
+tsnd_pdq(ID pdqid, intptr_t data, PRI datapri, TMO tmout)
+{
+	PDQCB	*p_pdqcb;
+	WINFO_SPDQ winfo_spdq;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TSND_PDQ_ENTER(pdqid, data, datapri, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_PDQID(pdqid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_pdqcb = get_pdqcb(pdqid);
+	CHECK_PAR(TMIN_DPRI <= datapri && datapri <= p_pdqcb->p_pdqinib->maxdpri);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (send_pridata(p_pdqcb, data, datapri)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		winfo_spdq.data = data;
+		winfo_spdq.datapri = datapri;
+		p_runtsk->tstat = TS_WAITING_SPDQ;
+		wobj_make_wait_tmout((WOBJCB *) p_pdqcb, (WINFO_WOBJ *) &winfo_spdq,
+														&tmevtb, tmout);
+		dispatch();
+		ercd = winfo_spdq.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TSND_PDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_tsnd_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡
+ */
+#ifdef TOPPERS_rcv_pdq
+
+ER
+rcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri)
+{
+	PDQCB	*p_pdqcb;
+	WINFO_RPDQ winfo_rpdq;
+	ER		ercd;
+
+	LOG_RCV_PDQ_ENTER(pdqid, p_data, p_datapri);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_PDQID(pdqid));
+	p_pdqcb = get_pdqcb(pdqid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (receive_pridata(p_pdqcb, p_data, p_datapri)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_RPDQ;
+		make_wait(&(winfo_rpdq.winfo));
+		queue_insert_prev(&(p_pdqcb->rwait_queue), &(p_runtsk->task_queue));
+		winfo_rpdq.p_pdqcb = p_pdqcb;
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo_rpdq.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_data = winfo_rpdq.data;
+			*p_datapri = winfo_rpdq.datapri;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_RCV_PDQ_LEAVE(ercd, p_data, p_datapri);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rcv_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_prcv_pdq
+
+ER
+prcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri)
+{
+	PDQCB	*p_pdqcb;
+	ER		ercd;
+
+	LOG_PRCV_PDQ_ENTER(pdqid, p_data, p_datapri);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_PDQID(pdqid));
+	p_pdqcb = get_pdqcb(pdqid);
+
+	lock_cpu();
+	if (receive_pridata(p_pdqcb, p_data, p_datapri)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_PRCV_PDQ_LEAVE(ercd, p_data, p_datapri);
+	return(ercd);
+}
+
+#endif /* TOPPERS_prcv_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_trcv_pdq
+
+ER
+trcv_pdq(ID pdqid, intptr_t *p_data, PRI *p_datapri, TMO tmout)
+{
+	PDQCB	*p_pdqcb;
+	WINFO_RPDQ winfo_rpdq;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TRCV_PDQ_ENTER(pdqid, p_data, p_datapri, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_PDQID(pdqid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_pdqcb = get_pdqcb(pdqid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (receive_pridata(p_pdqcb, p_data, p_datapri)) {
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_RPDQ;
+		make_wait_tmout(&(winfo_rpdq.winfo), &tmevtb, tmout);
+		queue_insert_prev(&(p_pdqcb->rwait_queue), &(p_runtsk->task_queue));
+		winfo_rpdq.p_pdqcb = p_pdqcb;
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo_rpdq.winfo.wercd;
+		if (ercd == E_OK) {
+			*p_data = winfo_rpdq.data;
+			*p_datapri = winfo_rpdq.datapri;
+		}
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TRCV_PDQ_LEAVE(ercd, p_data, p_datapri);
+	return(ercd);
+}
+
+#endif /* TOPPERS_trcv_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®ååæå
+ */
+#ifdef TOPPERS_ini_pdq
+
+ER
+ini_pdq(ID pdqid)
+{
+	PDQCB	*p_pdqcb;
+	ER		ercd;
+    
+	LOG_INI_PDQ_ENTER(pdqid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_PDQID(pdqid));
+	p_pdqcb = get_pdqcb(pdqid);
+
+	lock_cpu();
+	init_wait_queue(&(p_pdqcb->swait_queue));
+	init_wait_queue(&(p_pdqcb->rwait_queue));
+	p_pdqcb->count = 0U;
+	p_pdqcb->p_head = NULL;
+	p_pdqcb->unused = 0U;
+	p_pdqcb->p_freelist = NULL;
+	if (p_runtsk != p_schedtsk) {
+		dispatch();
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_INI_PDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ini_pdq */
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_pdq
+
+ER
+ref_pdq(ID pdqid, T_RPDQ *pk_rpdq)
+{
+	PDQCB	*p_pdqcb;
+	ER		ercd;
+    
+	LOG_REF_PDQ_ENTER(pdqid, pk_rpdq);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_PDQID(pdqid));
+	p_pdqcb = get_pdqcb(pdqid);
+
+	lock_cpu();
+	pk_rpdq->stskid = wait_tskid(&(p_pdqcb->swait_queue));
+	pk_rpdq->rtskid = wait_tskid(&(p_pdqcb->rwait_queue));
+	pk_rpdq->spdqcnt = p_pdqcb->count;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_PDQ_LEAVE(ercd, pk_rpdq);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_pdq */
Index: asp3_wo_tecs/trunk/kernel/pridataq.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/pridataq.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/pridataq.h	(revision 302)
@@ -0,0 +1,226 @@
+/*
+ *  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: pridataq.h 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *		åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½
+ */
+
+#ifndef TOPPERS_PRIDATAQ_H
+#define TOPPERS_PRIDATAQ_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "wait.h"
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ç®¡çãã­ãã¯
+ */
+typedef struct pridata_management_block PDQMB;
+
+struct pridata_management_block {
+	PDQMB		*p_next;		/* æ¬¡ã®ãã¼ã¿ */
+	intptr_t	data;			/* ãã¼ã¿æ¬ä½ */
+	PRI			datapri;		/* ãã¼ã¿åªå
+åº¦ */
+};
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WOBJINIBï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct pridataq_initialization_block {
+	ATR			pdqatr;			/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼å±æ§ */
+	uint_t		pdqcnt;			/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®å®¹é */
+	PRI			maxdpri;		/* ãã¼ã¿åªå
+åº¦ã®æå¤§å¤ */
+	PDQMB		*p_pdqmb;		/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã®å
+é ­çªå° */
+} PDQINIB;
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼
+ *  ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼æåã®2ã¤ã®
+ *  ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct pridataq_control_block {
+	QUEUE		swait_queue;	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼éä¿¡å¾
+ã¡ã­ã¥ã¼ */
+	const PDQINIB *p_pdqinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	QUEUE		rwait_queue;	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼åä¿¡å¾
+ã¡ã­ã¥ã¼ */
+	uint_t		count;			/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ä¸­ã®ãã¼ã¿ã®æ° */
+	PDQMB		*p_head;		/* æåã®ãã¼ã¿ */
+	uint_t		unused;			/* æªä½¿ç¨ãã¼ã¿ç®¡çãã­ãã¯ã®å
+é ­ */
+	PDQMB		*p_freelist;	/* æªå²å½ã¦ãã¼ã¿ç®¡çãã­ãã¯ã®ãªã¹ã */
+} PDQCB;
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼å¾
+ã¡æ
+å ±ãã­ãã¯ã®å®ç¾©
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WINFO_WOBJï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®2ã¤ã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct pridataq_send_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	PDQCB		*p_pdqcb;		/* å¾
+ã£ã¦ããåªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®ç®¡çãã­ãã¯*/
+	intptr_t	data;			/* éä¿¡ãã¼ã¿ */
+	PRI			datapri;		/* ãã¼ã¿åªå
+åº¦ */
+} WINFO_SPDQ;
+
+typedef struct pridataq_receive_waiting_information {
+	WINFO		winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	PDQCB		*p_pdqcb;		/* å¾
+ã£ã¦ããåªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã®ç®¡çãã­ãã¯*/
+	intptr_t	data;			/* åä¿¡ãã¼ã¿ */
+	PRI			datapri;		/* ãã¼ã¿åªå
+åº¦ */
+} WINFO_RPDQ;
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_pdqid;
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const PDQINIB	pdqinib_table[];
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern PDQCB	pdqcb_table[];
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çãã­ãã¯ããåªå
+åº¦ãã¼ã¿ã­ã¥ã¼IDãåãåºãã
+ *  ãã®ãã¯ã­
+ */
+#define	PDQID(p_pdqcb)	((ID)(((p_pdqcb) - pdqcb_table) + TMIN_PDQID))
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼æ©è½ã®åæå
+ */
+extern void	initialize_pridataq(void);
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åã¸ã®ãã¼ã¿ã®æ ¼ç´
+ */
+extern void	enqueue_pridata(PDQCB *p_pdqcb, intptr_t data, PRI datapri);
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ç®¡çé åããã®ãã¼ã¿ã®ååºã
+ */
+extern void	dequeue_pridata(PDQCB *p_pdqcb, intptr_t *p_data, PRI *p_datapri);
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®ãã¼ã¿éä¿¡
+ */
+extern bool_t	send_pridata(PDQCB *p_pdqcb, intptr_t data, PRI datapri);
+
+/*
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®ãã¼ã¿åä¿¡
+ */
+extern bool_t	receive_pridata(PDQCB *p_pdqcb, intptr_t *p_data,
+														PRI *p_datapri);
+
+#endif /* TOPPERS_PRIDATAQ_H */
Index: asp3_wo_tecs/trunk/kernel/pridataq.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/pridataq.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/pridataq.tf	(revision 302)
@@ -0,0 +1,176 @@
+$
+$   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/semaphore.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/semaphore.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/semaphore.c	(revision 302)
@@ -0,0 +1,378 @@
+/*
+ *  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: semaphore.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		ã»ããã©æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "semaphore.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_SIG_SEM_ENTER
+#define LOG_SIG_SEM_ENTER(semid)
+#endif /* LOG_SIG_SEM_ENTER */
+
+#ifndef LOG_SIG_SEM_LEAVE
+#define LOG_SIG_SEM_LEAVE(ercd)
+#endif /* LOG_SIG_SEM_LEAVE */
+
+#ifndef LOG_WAI_SEM_ENTER
+#define LOG_WAI_SEM_ENTER(semid)
+#endif /* LOG_WAI_SEM_ENTER */
+
+#ifndef LOG_WAI_SEM_LEAVE
+#define LOG_WAI_SEM_LEAVE(ercd)
+#endif /* LOG_WAI_SEM_LEAVE */
+
+#ifndef LOG_POL_SEM_ENTER
+#define LOG_POL_SEM_ENTER(semid)
+#endif /* LOG_POL_SEM_ENTER */
+
+#ifndef LOG_POL_SEM_LEAVE
+#define LOG_POL_SEM_LEAVE(ercd)
+#endif /* LOG_POL_SEM_LEAVE */
+
+#ifndef LOG_TWAI_SEM_ENTER
+#define LOG_TWAI_SEM_ENTER(semid, tmout)
+#endif /* LOG_TWAI_SEM_ENTER */
+
+#ifndef LOG_TWAI_SEM_LEAVE
+#define LOG_TWAI_SEM_LEAVE(ercd)
+#endif /* LOG_TWAI_SEM_LEAVE */
+
+#ifndef LOG_INI_SEM_ENTER
+#define LOG_INI_SEM_ENTER(semid)
+#endif /* LOG_INI_SEM_ENTER */
+
+#ifndef LOG_INI_SEM_LEAVE
+#define LOG_INI_SEM_LEAVE(ercd)
+#endif /* LOG_INI_SEM_LEAVE */
+
+#ifndef LOG_REF_SEM_ENTER
+#define LOG_REF_SEM_ENTER(semid, pk_rsem)
+#endif /* LOG_REF_SEM_ENTER */
+
+#ifndef LOG_REF_SEM_LEAVE
+#define LOG_REF_SEM_LEAVE(ercd, pk_rsem)
+#endif /* LOG_REF_SEM_LEAVE */
+
+/*
+ *  ã»ããã©ã®æ°
+ */
+#define tnum_sem	((uint_t)(tmax_semid - TMIN_SEMID + 1))
+
+/*
+ *  ã»ããã©IDããã»ããã©ç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_SEM(semid)	((uint_t)((semid) - TMIN_SEMID))
+#define get_semcb(semid)	(&(semcb_table[INDEX_SEM(semid)]))
+
+/* 
+ *  ã»ããã©æ©è½ã®åæå
+ */
+#ifdef TOPPERS_semini
+
+void
+initialize_semaphore(void)
+{
+	uint_t	i;
+	SEMCB	*p_semcb;
+
+	for (i = 0; i < tnum_sem; i++) {
+		p_semcb = &(semcb_table[i]);
+		queue_initialize(&(p_semcb->wait_queue));
+		p_semcb->p_seminib = &(seminib_table[i]);
+		p_semcb->semcnt = p_semcb->p_seminib->isemcnt;
+	}
+}
+
+#endif /* TOPPERS_semini */
+
+/*
+ *  ã»ããã©è³æºã®è¿å´
+ */
+#ifdef TOPPERS_sig_sem
+
+ER
+sig_sem(ID semid)
+{
+	SEMCB	*p_semcb;
+	TCB		*p_tcb;
+	ER		ercd;
+    
+	LOG_SIG_SEM_ENTER(semid);
+	CHECK_UNL();
+	CHECK_ID(VALID_SEMID(semid));
+	p_semcb = get_semcb(semid);
+
+	lock_cpu();
+	if (!queue_empty(&(p_semcb->wait_queue))) {
+		p_tcb = (TCB *) queue_delete_next(&(p_semcb->wait_queue));
+		wait_complete(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	else if (p_semcb->semcnt < p_semcb->p_seminib->maxsem) {
+		p_semcb->semcnt += 1;
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_QOVR;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_SIG_SEM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_sig_sem */
+
+/*
+ *  ã»ããã©è³æºã®ç²å¾
+ */
+#ifdef TOPPERS_wai_sem
+
+ER
+wai_sem(ID semid)
+{
+	SEMCB	*p_semcb;
+	WINFO_SEM winfo_sem;
+	ER		ercd;
+
+	LOG_WAI_SEM_ENTER(semid);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_SEMID(semid));
+	p_semcb = get_semcb(semid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_semcb->semcnt >= 1) {
+		p_semcb->semcnt -= 1;
+		ercd = E_OK;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_SEM;
+		wobj_make_wait((WOBJCB *) p_semcb, (WINFO_WOBJ *) &winfo_sem);
+		dispatch();
+		ercd = winfo_sem.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_WAI_SEM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_wai_sem */
+
+/*
+ *  ã»ããã©è³æºã®ç²å¾ï¼ãã¼ãªã³ã°ï¼
+ */
+#ifdef TOPPERS_pol_sem
+
+ER
+pol_sem(ID semid)
+{
+	SEMCB	*p_semcb;
+	ER		ercd;
+
+	LOG_POL_SEM_ENTER(semid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_SEMID(semid));
+	p_semcb = get_semcb(semid);
+
+	lock_cpu();
+	if (p_semcb->semcnt >= 1) {
+		p_semcb->semcnt -= 1;
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_TMOUT;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_POL_SEM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_pol_sem */
+
+/*
+ *  ã»ããã©è³æºã®ç²å¾ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_twai_sem
+
+ER
+twai_sem(ID semid, TMO tmout)
+{
+	SEMCB	*p_semcb;
+	WINFO_SEM winfo_sem;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TWAI_SEM_ENTER(semid, tmout);
+	CHECK_DISPATCH();
+	CHECK_ID(VALID_SEMID(semid));
+	CHECK_PAR(VALID_TMOUT(tmout));
+	p_semcb = get_semcb(semid);
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_semcb->semcnt >= 1) {
+		p_semcb->semcnt -= 1;
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_SEM;
+		wobj_make_wait_tmout((WOBJCB *) p_semcb, (WINFO_WOBJ *) &winfo_sem,
+														&tmevtb, tmout);
+		dispatch();
+		ercd = winfo_sem.winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TWAI_SEM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_twai_sem */
+
+/*
+ *  ã»ããã©ã®ååæå
+ */
+#ifdef TOPPERS_ini_sem
+
+ER
+ini_sem(ID semid)
+{
+	SEMCB	*p_semcb;
+	ER		ercd;
+    
+	LOG_INI_SEM_ENTER(semid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_SEMID(semid));
+	p_semcb = get_semcb(semid);
+
+	lock_cpu();
+	init_wait_queue(&(p_semcb->wait_queue));
+	p_semcb->semcnt = p_semcb->p_seminib->isemcnt;
+	if (p_runtsk != p_schedtsk) {
+		dispatch();
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_INI_SEM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ini_sem */
+
+/*
+ *  ã»ããã©ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_sem
+
+ER
+ref_sem(ID semid, T_RSEM *pk_rsem)
+{
+	SEMCB	*p_semcb;
+	ER		ercd;
+    
+	LOG_REF_SEM_ENTER(semid, pk_rsem);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_SEMID(semid));
+	p_semcb = get_semcb(semid);
+
+	lock_cpu();
+	pk_rsem->wtskid = wait_tskid(&(p_semcb->wait_queue));
+	pk_rsem->semcnt = p_semcb->semcnt;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_SEM_LEAVE(ercd, pk_rsem);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_sem */
Index: asp3_wo_tecs/trunk/kernel/semaphore.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/semaphore.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/semaphore.h	(revision 302)
@@ -0,0 +1,146 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2000 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: semaphore.h 145 2014-05-24 00:33:59Z ertl-hiro $
+ */
+
+/*
+ *		ã»ããã©æ©è½
+ */
+
+#ifndef TOPPERS_SEMAPHORE_H
+#define TOPPERS_SEMAPHORE_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "wait.h"
+
+/*
+ *  ã»ããã©åæåãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WOBJINIBï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  æåã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct semaphore_initialization_block {
+	ATR			sematr;			/* ã»ããã©å±æ§ */
+	uint_t		isemcnt;		/* ã»ããã©ã®è³æºæ°ã®åæå¤ */
+	uint_t		maxsem;			/* ã»ããã©ã®æå¤§è³æºæ° */
+} SEMINIB;
+
+/*
+ *  ã»ããã©ç®¡çãã­ãã¯
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼
+ *  ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼æåã®2ã¤ã®
+ *  ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct semaphore_control_block {
+	QUEUE		wait_queue;		/* ã»ããã©å¾
+ã¡ã­ã¥ã¼ */
+	const SEMINIB *p_seminib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	uint_t		semcnt;			/* ã»ããã©ç¾å¨ã«ã¦ã³ãå¤ */
+} SEMCB;
+
+/*
+ *  ã»ããã©å¾
+ã¡æ
+å ±ãã­ãã¯ã®å®ç¾©
+ *
+ *  ãã®æ§é ä½ã¯ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *  ï¼WINFO_WOBJï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ï¼
+ *  ãã¹ã¦ã®ãã£ã¼ã«ããå
+±éã«ãªã£ã¦ããï¼
+ */
+typedef struct semaphore_waiting_information {
+	WINFO	winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	SEMCB	*p_semcb;		/* å¾
+ã£ã¦ããã»ããã©ã®ç®¡çãã­ãã¯ */
+} WINFO_SEM;
+
+/*
+ *  ã»ããã©IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_semid;
+
+/*
+ *  ã»ããã©åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const SEMINIB	seminib_table[];
+
+/*
+ *  ã»ããã©ç®¡çãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern SEMCB	semcb_table[];
+
+/*
+ *  ã»ããã©ç®¡çãã­ãã¯ããã»ããã©IDãåãåºãããã®ãã¯ã­
+ */
+#define	SEMID(p_semcb)	((ID)(((p_semcb) - semcb_table) + TMIN_SEMID))
+
+/*
+ *  ã»ããã©æ©è½ã®åæå
+ */
+extern void	initialize_semaphore(void);
+
+#endif /* TOPPERS_SEMAPHORE_H */
Index: asp3_wo_tecs/trunk/kernel/semaphore.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/semaphore.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/semaphore.tf	(revision 302)
@@ -0,0 +1,148 @@
+$
+$   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/startup.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/startup.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/startup.c	(revision 302)
@@ -0,0 +1,198 @@
+/*
+ *  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: startup.c 181 2014-06-14 16:45:07Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®åæåã¨çµäºå¦ç
+ */
+
+#include "kernel_impl.h"
+#include "time_event.h"
+#include <sil.h>
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_KER_ENTER
+#define LOG_KER_ENTER()
+#endif /* LOG_KER_ENTER */
+
+#ifndef LOG_KER_LEAVE
+#define LOG_KER_LEAVE()
+#endif /* LOG_KER_LEAVE */
+
+#ifndef LOG_EXT_KER_ENTER
+#define LOG_EXT_KER_ENTER()
+#endif /* LOG_EXT_KER_ENTER */
+
+#ifndef LOG_EXT_KER_LEAVE
+#define LOG_EXT_KER_LEAVE(ercd)
+#endif /* LOG_EXT_KER_LEAVE */
+
+#ifdef TOPPERS_sta_ker
+
+/*
+ *  ã«ã¼ãã«åä½ç¶æ
+ãã©ã°
+ *
+ *  ã¹ã¿ã¼ãã¢ããã«ã¼ãã³ã§ï¼falseï¼ï¼0ï¼ã«åæåããããã¨ãæå¾
+ãã¦
+ *  ããï¼
+ */
+bool_t	kerflg = false;
+
+/*
+ *  ã«ã¼ãã«ã®èµ·å
+ */
+void
+sta_ker(void)
+{
+	/*
+	 *  ã¿ã¼ã²ããä¾å­ã®åæå
+	 */
+	target_initialize();
+
+	/*
+	 *  åã¢ã¸ã¥ã¼ã«ã®åæå
+	 *
+	 *  ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«ã¯ä»ã®ã¢ã¸ã¥ã¼ã«ããå
+ã«åæå
+	 *  ããå¿
+è¦ãããï¼
+	 */
+	initialize_tmevt();								/*ï¼»ASPD1061ï¼½*/
+	initialize_object();
+
+	/*
+	 *  åæåã«ã¼ãã³ã®å®è¡
+	 */ 
+	call_inirtn();
+
+	/*
+	 *  é«åè§£è½ã¿ã¤ãã®è¨­å®
+	 */
+	current_hrtcnt = target_hrt_get_current();		/*ï¼»ASPD1063ï¼½*/
+	set_hrt_event();								/*ï¼»ASPD1064ï¼½*/
+
+	/*
+	 *  ã«ã¼ãã«åä½ã®éå§
+	 */
+	kerflg = true;
+	LOG_KER_ENTER();
+	start_dispatch();
+	assert(0);
+}
+
+#endif /* TOPPERS_sta_ker */
+
+/*
+ *  ã«ã¼ãã«ã®çµäº
+ */
+#ifdef TOPPERS_ext_ker
+
+ER
+ext_ker(void)
+{
+	SIL_PRE_LOC;
+
+	LOG_EXT_KER_ENTER();
+
+	/*
+	 *  å²è¾¼ã¿ã­ãã¯ç¶æ
+ã«ç§»è¡
+	 */
+	SIL_LOC_INT();
+
+	/*
+	 *  ã«ã¼ãã«åä½ã®çµäº
+	 */
+	LOG_KER_LEAVE();
+	kerflg = false;
+
+	/*
+	 *  ã«ã¼ãã«ã®çµäºå¦çã®å¼åºã
+	 *
+	 *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã¦ï¼exit_kernelãå¼ã³åºãï¼
+	 */
+	call_exit_kernel();
+
+	/*
+	 *  ã³ã³ãã¤ã©ã®è­¦åå¯¾ç­ï¼ããã¸æ¥ããã¨ã¯ãªãã¯ãï¼
+	 */
+	SIL_UNL_INT();
+	LOG_EXT_KER_LEAVE(E_SYS);
+	return(E_SYS);
+}
+
+/*
+ *  ã«ã¼ãã«ã®çµäºå¦ç
+ */
+void
+exit_kernel(void)
+{
+	/*
+	 *  çµäºå¦çã«ã¼ãã³ã®å®è¡
+	 */
+	call_terrtn();
+
+	/*
+	 *  ã¿ã¼ã²ããä¾å­ã®çµäºå¦ç
+	 */
+	target_exit();
+	assert(0);
+}
+
+#endif /* TOPPERS_ext_ker */
Index: asp3_wo_tecs/trunk/kernel/sys_manage.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/sys_manage.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/sys_manage.c	(revision 302)
@@ -0,0 +1,551 @@
+/*
+ *  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: sys_manage.c 469 2015-12-30 02:38:47Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ç¶æ
+ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ROT_RDQ_ENTER
+#define LOG_ROT_RDQ_ENTER(tskpri)
+#endif /* LOG_ROT_RDQ_ENTER */
+
+#ifndef LOG_ROT_RDQ_LEAVE
+#define LOG_ROT_RDQ_LEAVE(ercd)
+#endif /* LOG_ROT_RDQ_LEAVE */
+
+#ifndef LOG_GET_TID_ENTER
+#define LOG_GET_TID_ENTER(p_tskid)
+#endif /* LOG_GET_TID_ENTER */
+
+#ifndef LOG_GET_TID_LEAVE
+#define LOG_GET_TID_LEAVE(ercd, p_tskid)
+#endif /* LOG_GET_TID_LEAVE */
+
+#ifndef LOG_GET_LOD_ENTER
+#define LOG_GET_LOD_ENTER(tskpri, p_load)
+#endif /* LOG_GET_LOD_ENTER */
+
+#ifndef LOG_GET_LOD_LEAVE
+#define LOG_GET_LOD_LEAVE(ercd, p_load)
+#endif /* LOG_GET_LOD_LEAVE */
+
+#ifndef LOG_GET_NTH_ENTER
+#define LOG_GET_NTH_ENTER(tskpri, nth, p_tskid)
+#endif /* LOG_GET_NTH_ENTER */
+
+#ifndef LOG_GET_NTH_LEAVE
+#define LOG_GET_NTH_LEAVE(ercd, p_tskid)
+#endif /* LOG_GET_NTH_LEAVE */
+
+#ifndef LOG_LOC_CPU_ENTER
+#define LOG_LOC_CPU_ENTER()
+#endif /* LOG_LOC_CPU_ENTER */
+
+#ifndef LOG_LOC_CPU_LEAVE
+#define LOG_LOC_CPU_LEAVE(ercd)
+#endif /* LOG_LOC_CPU_LEAVE */
+
+#ifndef LOG_UNL_CPU_ENTER
+#define LOG_UNL_CPU_ENTER()
+#endif /* LOG_UNL_CPU_ENTER */
+
+#ifndef LOG_UNL_CPU_LEAVE
+#define LOG_UNL_CPU_LEAVE(ercd)
+#endif /* LOG_UNL_CPU_LEAVE */
+
+#ifndef LOG_DIS_DSP_ENTER
+#define LOG_DIS_DSP_ENTER()
+#endif /* LOG_DIS_DSP_ENTER */
+
+#ifndef LOG_DIS_DSP_LEAVE
+#define LOG_DIS_DSP_LEAVE(ercd)
+#endif /* LOG_DIS_DSP_LEAVE */
+
+#ifndef LOG_ENA_DSP_ENTER
+#define LOG_ENA_DSP_ENTER()
+#endif /* LOG_ENA_DSP_ENTER */
+
+#ifndef LOG_ENA_DSP_LEAVE
+#define LOG_ENA_DSP_LEAVE(ercd)
+#endif /* LOG_ENA_DSP_LEAVE */
+
+#ifndef LOG_SNS_CTX_ENTER
+#define LOG_SNS_CTX_ENTER()
+#endif /* LOG_SNS_CTX_ENTER */
+
+#ifndef LOG_SNS_CTX_LEAVE
+#define LOG_SNS_CTX_LEAVE(state)
+#endif /* LOG_SNS_CTX_LEAVE */
+
+#ifndef LOG_SNS_LOC_ENTER
+#define LOG_SNS_LOC_ENTER()
+#endif /* LOG_SNS_LOC_ENTER */
+
+#ifndef LOG_SNS_LOC_LEAVE
+#define LOG_SNS_LOC_LEAVE(state)
+#endif /* LOG_SNS_LOC_LEAVE */
+
+#ifndef LOG_SNS_DSP_ENTER
+#define LOG_SNS_DSP_ENTER()
+#endif /* LOG_SNS_DSP_ENTER */
+
+#ifndef LOG_SNS_DSP_LEAVE
+#define LOG_SNS_DSP_LEAVE(state)
+#endif /* LOG_SNS_DSP_LEAVE */
+
+#ifndef LOG_SNS_DPN_ENTER
+#define LOG_SNS_DPN_ENTER()
+#endif /* LOG_SNS_DPN_ENTER */
+
+#ifndef LOG_SNS_DPN_LEAVE
+#define LOG_SNS_DPN_LEAVE(state)
+#endif /* LOG_SNS_DPN_LEAVE */
+
+#ifndef LOG_SNS_KER_ENTER
+#define LOG_SNS_KER_ENTER()
+#endif /* LOG_SNS_KER_ENTER */
+
+#ifndef LOG_SNS_KER_LEAVE
+#define LOG_SNS_KER_LEAVE(state)
+#endif /* LOG_SNS_KER_LEAVE */
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+é ä½ã®åè»¢
+ */
+#ifdef TOPPERS_rot_rdq
+
+ER
+rot_rdq(PRI tskpri)
+{
+	uint_t	pri;
+	ER		ercd;
+
+	LOG_ROT_RDQ_ENTER(tskpri);
+	CHECK_UNL();
+	if (tskpri == TPRI_SELF && !sense_context()) {
+		pri = p_runtsk->bpriority;
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));
+		pri = INT_PRIORITY(tskpri);
+	}
+
+	lock_cpu();
+	rotate_ready_queue(&(ready_queue[pri]));
+	if (p_runtsk != p_schedtsk) {
+		if (!sense_context()) {
+			dispatch();
+		}
+		else {
+			request_dispatch();
+		}
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_ROT_RDQ_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rot_rdq */
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯IDã®åç
+§
+ */
+#ifdef TOPPERS_get_tid
+
+ER
+get_tid(ID *p_tskid)
+{
+	ER		ercd;
+
+	LOG_GET_TID_ENTER(p_tskid);
+	CHECK_UNL();
+
+	lock_cpu();
+	*p_tskid = (p_runtsk == NULL) ? TSK_NONE : TSKID(p_runtsk);
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_TID_LEAVE(ercd, p_tskid);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_tid */
+
+/*
+ *  å®è¡ã§ããã¿ã¹ã¯ã®æ°ã®åç
+§
+ */
+#ifdef TOPPERS_get_lod
+
+ER
+get_lod(PRI tskpri, uint_t *p_load)
+{
+	uint_t	pri, load;
+	QUEUE	*p_queue, *p_entry;
+	ER		ercd;
+
+	LOG_GET_LOD_ENTER(p_tskid, p_load);
+	CHECK_TSKCTX_UNL();
+	if (tskpri == TPRI_SELF) {
+		pri = p_runtsk->bpriority;
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));
+		pri = INT_PRIORITY(tskpri);
+	}
+	p_queue = &(ready_queue[pri]);
+
+	lock_cpu();
+	load = 0U;
+	for (p_entry = p_queue->p_next; p_entry != p_queue;
+										p_entry = p_entry->p_next) {
+		load += 1U;
+	}
+	*p_load = load;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_LOD_LEAVE(ercd, p_load);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_lod */
+
+/*
+ *  æå®ããåªå
+é ä½ã®ã¿ã¹ã¯IDã®åç
+§
+ */
+#ifdef TOPPERS_get_nth
+
+ER
+get_nth(PRI tskpri, uint_t nth, ID *p_tskid)
+{
+	uint_t	pri;
+	QUEUE	*p_queue, *p_entry;
+	ID		tskid;
+	ER		ercd;
+
+	LOG_GET_NTH_ENTER(p_tskid, nth, p_tskid);
+	CHECK_TSKCTX_UNL();
+	if (tskpri == TPRI_SELF) {
+		pri = p_runtsk->bpriority;
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));
+		pri = INT_PRIORITY(tskpri);
+	}
+	p_queue = &(ready_queue[pri]);
+
+	lock_cpu();
+	tskid = TSK_NONE;
+	for (p_entry = p_queue->p_next; p_entry != p_queue;
+										p_entry = p_entry->p_next) {
+		if (nth == 0U) {
+			tskid = TSKID((TCB *) p_entry);
+			break;
+		}
+		nth -= 1U;
+	}
+	*p_tskid = tskid;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_NTH_LEAVE(ercd, p_tskid);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_nth */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_loc_cpu
+
+ER
+loc_cpu(void)
+{
+	ER		ercd;
+
+	LOG_LOC_CPU_ENTER();
+
+	if (!sense_lock()) {
+		lock_cpu();
+	}
+	ercd = E_OK;
+
+	LOG_LOC_CPU_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_loc_cpu */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®è§£é¤
+ *
+ *  CPUã­ãã¯ä¸­ã¯ï¼ãã£ã¹ããããå¿
+è¦ã¨ãªããµã¼ãã¹ã³ã¼ã«ãå¼ã³åºãã
+ *  ã¨ã¯ã§ããªãããï¼CPUã­ãã¯ç¶æ
+ã®è§£é¤æã«ãã£ã¹ãããã£ãèµ·åãã
+ *  å¿
+è¦ã¯ãªãï¼
+ */
+#ifdef TOPPERS_unl_cpu
+
+ER
+unl_cpu(void)
+{
+	ER		ercd;
+
+	LOG_UNL_CPU_ENTER();
+
+	if (sense_lock()) {
+		unlock_cpu();
+	}
+	ercd = E_OK;
+
+	LOG_UNL_CPU_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_unl_cpu */
+
+/*
+ *  ãã£ã¹ãããã®ç¦æ­¢
+ */
+#ifdef TOPPERS_dis_dsp
+
+ER
+dis_dsp(void)
+{
+	ER		ercd;
+
+	LOG_DIS_DSP_ENTER();
+	CHECK_TSKCTX_UNL();
+
+	lock_cpu();
+	enadsp = false;
+	dspflg = false;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_DIS_DSP_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_dis_dsp */
+
+/*
+ *  ãã£ã¹ãããã®è¨±å¯
+ */
+#ifdef TOPPERS_ena_dsp
+
+ER
+ena_dsp(void)
+{
+	ER		ercd;
+
+	LOG_ENA_DSP_ENTER();
+	CHECK_TSKCTX_UNL();
+
+	lock_cpu();
+	enadsp = true;
+	if (t_get_ipm() == TIPM_ENAALL) {
+		dspflg = true;
+		p_schedtsk = search_schedtsk();
+		if (p_runtsk->raster && p_runtsk->enater) {
+			task_terminate(p_runtsk);
+			exit_and_dispatch();
+			ercd = E_SYS;
+		}
+		else {
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}
+			ercd = E_OK;
+		}
+	}
+	else {
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ENA_DSP_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ena_dsp */
+
+/*
+ *  ã³ã³ãã­ã¹ãã®åç
+§
+ */
+#ifdef TOPPERS_sns_ctx
+
+bool_t
+sns_ctx(void)
+{
+	bool_t	state;
+
+	LOG_SNS_CTX_ENTER();
+	state = sense_context() ? true : false;
+	LOG_SNS_CTX_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_ctx */
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_loc
+
+bool_t
+sns_loc(void)
+{
+	bool_t	state;
+
+	LOG_SNS_LOC_ENTER();
+	state = sense_lock() ? true : false;
+	LOG_SNS_LOC_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_loc */
+
+/*
+ *  ãã£ã¹ãããç¦æ­¢ç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_dsp
+
+bool_t
+sns_dsp(void)
+{
+	bool_t	state;
+
+	LOG_SNS_DSP_ENTER();
+	state = !enadsp;
+	LOG_SNS_DSP_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_dsp */
+
+/*
+ *  ãã£ã¹ãããä¿çç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_dpn
+
+bool_t
+sns_dpn(void)
+{
+	bool_t	state;
+
+	LOG_SNS_DPN_ENTER();
+	state = (sense_context() || sense_lock() || !dspflg) ? true : false;
+	LOG_SNS_DPN_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_dpn */
+
+/*
+ *  ã«ã¼ãã«éåä½ç¶æ
+ã®åç
+§
+ */
+#ifdef TOPPERS_sns_ker
+
+bool_t
+sns_ker(void)
+{
+	bool_t	state;
+
+	LOG_SNS_KER_ENTER();
+	state = kerflg ? false : true;
+	LOG_SNS_KER_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_ker */
Index: asp3_wo_tecs/trunk/kernel/task.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/task.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/task.c	(revision 302)
@@ -0,0 +1,477 @@
+/*
+ *  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: task.c 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#include "kernel_impl.h"
+#include "task.h"
+#include "taskhook.h"
+#include "wait.h"
+
+#ifdef TOPPERS_tskini
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯
+ */
+TCB		*p_runtsk;
+
+/*
+ *  å®è¡ãã¹ãã¿ã¹ã¯
+ */
+TCB		*p_schedtsk;
+
+/*
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+
+ */
+bool_t	enadsp;
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããå¯è½ç¶æ
+
+ */
+bool_t	dspflg;
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼
+ */
+QUEUE	ready_queue[TNUM_TPRI];
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ãµã¼ãã®ããã®ãããããã
+ */
+uint16_t	ready_primap;
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®åæå
+ */
+void
+initialize_task(void)
+{
+	uint_t	i, j;
+	TCB		*p_tcb;
+
+	p_runtsk = NULL;
+	p_schedtsk = NULL;
+	enadsp = true;
+	dspflg = true;
+
+	for (i = 0; i < TNUM_TPRI; i++) {
+		queue_initialize(&(ready_queue[i]));
+	}
+	ready_primap = 0U;
+
+	for (i = 0; i < tnum_tsk; i++) {
+		j = INDEX_TSK(torder_table[i]);
+		p_tcb = &(tcb_table[j]);
+		p_tcb->p_tinib = &(tinib_table[j]);
+		p_tcb->actque = false;
+		make_dormant(p_tcb);
+		p_tcb->p_lastmtx = NULL;
+		if ((p_tcb->p_tinib->tskatr & TA_ACT) != 0U) {
+			make_active(p_tcb);
+		}
+	}
+}
+
+#endif /* TOPPERS_tskini */
+
+/*
+ *  ãããããããµã¼ãé¢æ°
+ *
+ *  bitmapå
+ã®1ã®ãããã®å
+ï¼æãä¸ä½ï¼å³ï¼ã®ãã®ããµã¼ããï¼ãã®ãã
+ *  ãçªå·ãè¿ãï¼ãããçªå·ã¯ï¼æä¸ä½ãããã0ã¨ããï¼bitmapã«0ãæå®
+ *  ãã¦ã¯ãªããªãï¼ãã®é¢æ°ã§ã¯ï¼bitmapã16ãããã§ãããã¨ãä»®å®ãï¼
+ *  uint16_tåã¨ãã¦ããï¼
+ *
+ *  ããããµã¼ãå½ä»¤ãæã¤ãã­ã»ããµã§ã¯ï¼ããããµã¼ãå½ä»¤ãä½¿ãããã«
+ *  æ¸ãç´ããæ¹ãå¹çãè¯ãå ´åãããï¼ãã®ãããªå ´åã«ã¯ï¼ã¿ã¼ã²ãã
+ *  ä¾å­é¨ã§ããããµã¼ãå½ä»¤ãä½¿ã£ãbitmap_searchãå®ç¾©ãï¼
+ *  OMIT_BITMAP_SEARCHããã¯ã­å®ç¾©ããã°ããï¼ã¾ãï¼ããããµã¼ãå½ä»¤ã®
+ *  ãµã¼ãæ¹åãéãªã©ã®çç±ã§åªå
+åº¦ã¨ãããã¨ã®å¯¾å¿ãå¤æ´ãããå ´åã«
+ *  ã¯ï¼PRIMAP_BITããã¯ã­å®ç¾©ããã°ããï¼
+ *
+ *  ã¾ãï¼ã©ã¤ãã©ãªã«ffsããããªãï¼æ¬¡ã®ããã«å®ç¾©ãã¦ã©ã¤ãã©ãªé¢æ°ã
+ *  ä½¿ã£ãæ¹ãå¹çãè¯ãå¯è½æ§ãããï¼
+ *		#define	bitmap_search(bitmap) (ffs(bitmap) - 1)
+ */
+#ifndef PRIMAP_BIT
+#define	PRIMAP_BIT(pri)		(1U << (pri))
+#endif /* PRIMAP_BIT */
+
+#ifndef OMIT_BITMAP_SEARCH
+
+static const unsigned char bitmap_search_table[] = { 0, 1, 0, 2, 0, 1, 0,
+												3, 0, 1, 0, 2, 0, 1, 0 };
+
+Inline uint_t
+bitmap_search(uint16_t bitmap)
+{
+	uint_t	n = 0U;
+
+	assert(bitmap != 0U);
+	if ((bitmap & 0x00ffU) == 0U) {
+		bitmap >>= 8;
+		n += 8;
+	}
+	if ((bitmap & 0x0fU) == 0U) {
+		bitmap >>= 4;
+		n += 4;
+	}
+	return(n + bitmap_search_table[(bitmap & 0x0fU) - 1]);
+}
+
+#endif /* OMIT_BITMAP_SEARCH */
+
+/*
+ *  åªå
+åº¦ãããããããç©ºãã®ãã§ãã¯
+ */
+Inline bool_t
+primap_empty(void)
+{
+	return(ready_primap == 0U);
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ãµã¼ã
+ */
+Inline uint_t
+primap_search(void)
+{
+	return(bitmap_search(ready_primap));
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ã»ãã
+ */
+Inline void
+primap_set(uint_t pri)
+{
+	ready_primap |= PRIMAP_BIT(pri);
+}
+
+/*
+ *  åªå
+åº¦ããããããã®ã¯ãªã¢
+ */
+Inline void
+primap_clear(uint_t pri)
+{
+	ready_primap &= ~PRIMAP_BIT(pri);
+}
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã®ãµã¼ã
+ */
+#ifdef TOPPERS_tsksched
+
+TCB *
+search_schedtsk(void)
+{
+	uint_t	schedpri;
+
+	schedpri = primap_search();
+	return((TCB *)(ready_queue[schedpri].p_next));
+}
+
+#endif /* TOPPERS_tsksched */
+
+/*
+ *  å®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼å®è¡ã§ããã¿ã¹ã¯ããªãã£ãå ´åã¨ï¼
+ *  p_tcbã®åªå
+åº¦ãå®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã§ããï¼
+ */
+#ifdef TOPPERS_tskrun
+
+void
+make_runnable(TCB *p_tcb)
+{
+	uint_t	pri = p_tcb->priority;
+
+	queue_insert_prev(&(ready_queue[pri]), &(p_tcb->task_queue));
+	primap_set(pri);
+
+	if (dspflg) {
+		if (p_schedtsk == (TCB *) NULL || pri < p_schedtsk->priority) {
+			p_schedtsk = p_tcb;
+		}
+	}
+}
+
+#endif /* TOPPERS_tskrun */
+
+/*
+ *  å®è¡ã§ããç¶æ
+ããä»ã®ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ãå ´å
+ *  ã§ããï¼p_tcbã¨åãåªå
+åº¦ã®ã¿ã¹ã¯ãä»ã«ããå ´åã¯ï¼p_tcbã®æ¬¡ã®ã¿ã¹
+ *  ã¯ãå®è¡ãã¹ãã¿ã¹ã¯ã«ãªãï¼ããã§ãªãå ´åã¯ï¼ã¬ãã£ã­ã¥ã¼ããµã¼ã
+ *  ããå¿
+è¦ãããï¼
+ */
+#ifdef TOPPERS_tsknrun
+
+void
+make_non_runnable(TCB *p_tcb)
+{
+	uint_t	pri = p_tcb->priority;
+	QUEUE	*p_queue = &(ready_queue[pri]);
+
+	queue_delete(&(p_tcb->task_queue));
+	if (queue_empty(p_queue)) {
+		primap_clear(pri);
+		if (p_schedtsk == p_tcb) {
+			assert(dspflg);
+			p_schedtsk = primap_empty() ? (TCB *) NULL : search_schedtsk();
+		}
+	}
+	else {
+		if (p_schedtsk == p_tcb) {
+			assert(dspflg);
+			p_schedtsk = (TCB *)(p_queue->p_next);
+		}
+	}
+}
+
+#endif /* TOPPERS_tsknrun */
+
+/*
+ *  ä¼æ­¢ç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_tskdmt
+
+void
+make_dormant(TCB *p_tcb)
+{
+	p_tcb->tstat = TS_DORMANT;
+	p_tcb->bpriority = p_tcb->p_tinib->ipriority;
+	p_tcb->priority = p_tcb->p_tinib->ipriority;
+	p_tcb->wupque = false;
+	p_tcb->raster = false;
+	p_tcb->enater = true;
+	LOG_TSKSTAT(p_tcb);
+}
+
+#endif /* TOPPERS_tskdmt */
+
+/*
+ *  ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_tskact
+
+void
+make_active(TCB *p_tcb)
+{
+	activate_context(p_tcb);
+	p_tcb->tstat = TS_RUNNABLE;
+	LOG_TSKSTAT(p_tcb);
+	make_runnable(p_tcb);
+}
+
+#endif /* TOPPERS_tskact */
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+åº¦ã®å¤æ´
+ *
+ *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã®å ´åã«ã¯ï¼ã¬ãã£ã­ã¥ã¼ã®ä¸­ã§ã®ä½ç½®ãå¤æ´ã
+ *  ãï¼ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã®ä¸­ã§å¾
+ã¡ç¶æ
+ã«ãªã£ã¦ããå ´åã«ã¯ï¼å¾
+
+ *  ã¡ã­ã¥ã¼ã®ä¸­ã§ã®ä½ç½®ãå¤æ´ããï¼
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼(1) p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ã¦ï¼
+ *  ãã®åªå
+åº¦ãä¸ããå ´åï¼(2) p_tcbãå®è¡ãã¹ãã¿ã¹ã¯ã§ã¯ãªãï¼å¤æ´å¾
+ *  ã®åªå
+åº¦ãå®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã§ããï¼(1)ã®å ´åã«
+ *  ã¯ï¼ã¬ãã£ã­ã¥ã¼ããµã¼ãããå¿
+è¦ãããï¼
+ */
+#ifdef TOPPERS_tskpri
+
+void
+change_priority(TCB *p_tcb, uint_t newpri, bool_t mtxmode)
+{
+	uint_t	oldpri;
+
+	oldpri = p_tcb->priority;
+	p_tcb->priority = newpri;
+
+	if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		/*
+		 *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã®å ´å
+		 */
+		queue_delete(&(p_tcb->task_queue));
+		if (queue_empty(&(ready_queue[oldpri]))) {
+			primap_clear(oldpri);
+		}
+		if (mtxmode) {
+			queue_insert_next(&(ready_queue[newpri]), &(p_tcb->task_queue));
+		}
+		else {
+			queue_insert_prev(&(ready_queue[newpri]), &(p_tcb->task_queue));
+		}
+		primap_set(newpri);
+
+		if (dspflg) {
+			if (p_schedtsk == p_tcb) {
+				if (newpri >= oldpri) {
+					p_schedtsk = search_schedtsk();
+				}
+			}
+			else {
+				if (mtxmode ? newpri <= p_schedtsk->priority
+							: newpri < p_schedtsk->priority) {
+					p_schedtsk = p_tcb;
+				}
+			}
+		}
+	}
+	else {
+		if (TSTAT_WAIT_WOBJCB(p_tcb->tstat)) {
+			/*
+			 *  ã¿ã¹ã¯ãï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨
+			 *  åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ããå ´å
+			 */
+			wobj_change_priority(((WINFO_WOBJ *)(p_tcb->p_winfo))->p_wobjcb,
+																	p_tcb);
+		}
+	}
+}
+
+#endif /* TOPPERS_tskpri */
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ã®åè»¢
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããã®ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãã¿ã¹ã¯ã­ã¥ã¼ã®æ«
+ *  å°¾ã«ç§»åããå ´åã§ããï¼
+ */
+#ifdef TOPPERS_tskrot
+
+void
+rotate_ready_queue(QUEUE *p_queue)
+{
+	QUEUE	*p_entry;
+
+	if (!queue_empty(p_queue) && p_queue->p_next->p_next != p_queue) {
+		p_entry = queue_delete_next(p_queue);
+		queue_insert_prev(p_queue, p_entry);
+		if (dspflg) {
+			if (p_schedtsk == (TCB *) p_entry) {
+				p_schedtsk = (TCB *)(p_queue->p_next);
+			}
+		}
+	}
+}
+
+#endif /* TOPPERS_tskrot */
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºå¦ç
+ */
+#ifdef TOPPERS_tskterm
+
+void
+task_terminate(TCB *p_tcb)
+{
+	if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		make_non_runnable(p_tcb);
+	}
+	else if (TSTAT_WAITING(p_tcb->tstat)) {
+		wait_dequeue_wobj(p_tcb);
+		wait_dequeue_tmevtb(p_tcb);
+	}
+	if (p_tcb->p_lastmtx != NULL) {
+		(*mtxhook_release_all)(p_tcb);
+	}
+	make_dormant(p_tcb);
+	if (p_tcb->actque) {
+		p_tcb->actque = false;
+		make_active(p_tcb);
+	}
+}
+
+#endif /* TOPPERS_tskterm */
Index: asp3_wo_tecs/trunk/kernel/task.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/task.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/task.h	(revision 302)
@@ -0,0 +1,647 @@
+/*
+ *  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: task.h 452 2015-08-15 02:36:39Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_TASK_H
+#define TOPPERS_TASK_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "time_event.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_TSKSTAT
+#define LOG_TSKSTAT(p_tcb)
+#endif /* LOG_TSKSTAT */
+
+/*
+ *  ã¿ã¹ã¯åªå
+åº¦ã®å
+é¨è¡¨ç¾ã»å¤é¨è¡¨ç¾å¤æãã¯ã­
+ */
+#define INT_PRIORITY(x)		((uint_t)((x) - TMIN_TPRI))
+#define EXT_TSKPRI(x)		((PRI)(x) + TMIN_TPRI)
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+ã®å
+é¨è¡¨ç¾
+ *
+ *  TCBä¸­ã®ã¿ã¹ã¯ç¶æ
+ã®ãã£ã¼ã«ãã§ã¯ï¼ã¿ã¹ã¯ã®ç¶æ
+ã¨ï¼ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+
+ *  ã®æã®å¾
+ã¡è¦å ãè¡¨ãï¼ãã ãï¼å®è¡ç¶æ
+ï¼RUNNINGï¼ã¨å®è¡å¯è½ç¶æ
+
+ *  ï¼READYï¼ã¯åºå¥ããï¼ä¸¡ç¶æ
+ããããã¦å®è¡ã§ããç¶æ
+ï¼RUNNABLEï¼ã¨ã
+ *  ã¦ç®¡çããï¼äºéå¾
+ã¡ç¶æ
+ã¯ï¼(TS_WAITING_??? | TS_SUSPENDED)ã§è¡¨ãï¼
+ *
+ *  ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ãå«ãï¼ã®æã¯ï¼TS_WAITING_???ã§å¾
+ã¡
+ *  è¦å ãè¡¨ãï¼å¾
+ã¡è¦å ï¼5ãããã§è¡¨ç¾ãããï¼ã®ä¸ä½2ãããã§ï¼åæã»
+ *  éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãã£ã¦ãããã©ãããè¡¨ãï¼åæã»
+ *  éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãããªããã®ã¯ä¸ä½2ãããã00ï¼å
+ *  æã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼
+ *  ã«ã¤ãªãããã®ã¯10ã¾ãã¯11ï¼ããä»¥å¤ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãããã®ã¯01
+ *  ã¨ããï¼
+ */
+#define TS_DORMANT		0x00U			/* ä¼æ­¢ç¶æ
+ */
+#define TS_RUNNABLE		0x01U			/* å®è¡ã§ããç¶æ
+ */
+#define TS_SUSPENDED	0x02U			/* å¼·å¶å¾
+ã¡ç¶æ
+ */
+
+#define TS_WAITING_SLP	(0x01U << 2)	/* èµ·åºå¾
+ã¡ */
+#define TS_WAITING_DLY	(0x02U << 2)	/* æéçµéå¾
+ã¡ */
+#define TS_WAITING_RDTQ	(0x08U << 2)	/* ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TS_WAITING_RPDQ	(0x09U << 2)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ããã®åä¿¡å¾
+ã¡ */
+#define TS_WAITING_SEM	(0x10U << 2)	/* ã»ããã©è³æºã®ç²å¾å¾
+ã¡ */
+#define TS_WAITING_FLG	(0x11U << 2)	/* ã¤ãã³ããã©ã°å¾
+ã¡ */
+#define TS_WAITING_SDTQ	(0x12U << 2)	/* ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TS_WAITING_SPDQ	(0x13U << 2)	/* åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡å¾
+ã¡ */
+#define TS_WAITING_MTX	(0x14U << 2)	/* ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¾
+ã¡ */
+#define TS_WAITING_MPF	(0x15U << 2)	/* åºå®é·ã¡ã¢ãªãã­ãã¯ã®ç²å¾å¾
+ã¡ */
+
+#define TS_WAITING_MASK	(0x1fU << 2)	/* å¾
+ã¡ç¶æ
+ã®å¤å¥ç¨ãã¹ã¯ */
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+å¤å¥ãã¯ã­
+ *
+ *  TSTAT_DORMANTã¯ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ã§ãããã©ãããï¼TSTAT_RUNNABLEã¯
+ *  ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ãããã©ãããå¤å¥ããï¼TSTAT_WAITINGã¯å¾
+
+ *  ã¡ç¶æ
+ã¨äºéå¾
+ã¡ç¶æ
+ã®ããããã§ãããã©ãããï¼TSTAT_SUSPENDEDã¯
+ *  å¼·å¶å¾
+ã¡ç¶æ
+ã¨äºéå¾
+ã¡ç¶æ
+ã®ããããã§ãããã©ãããå¤å¥ããï¼
+ */
+#define TSTAT_DORMANT(tstat)	((tstat) == TS_DORMANT)
+#define TSTAT_RUNNABLE(tstat)	(((tstat) & TS_RUNNABLE) != 0U)
+#define TSTAT_WAITING(tstat)	(((tstat) & TS_WAITING_MASK) != 0U)
+#define TSTAT_SUSPENDED(tstat)	(((tstat) & TS_SUSPENDED) != 0U)
+
+/*
+ *  ã¿ã¹ã¯å¾
+ã¡è¦å å¤å¥ãã¯ã­
+ *
+ *  TSTAT_WAIT_SLPã¯ã¿ã¹ã¯ãèµ·åºå¾
+ã¡ã§ãããã©ãããï¼TSTAT_WAIT_MTXã¯
+ *  ã¿ã¹ã¯ããã¥ã¼ããã¯ã¹å¾
+ã¡ã§ãããã©ãããå¤å¥ããï¼
+ *
+ *  ã¾ãï¼TSTAT_WAIT_WOBJ ã¯ã¿ã¹ã¯ãåæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡
+ *  ã§ãããï¼è¨ãæããã¨ï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªã
+ *  ãã¦ãããï¼ã©ãããï¼TSTAT_WAIT_WOBJCBã¯ã¿ã¹ã¯ãåæã»éä¿¡ãªãã¸ã§
+ *  ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åï¼WOBJCBï¼ã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ãã
+ *  ãã©ãããå¤å¥ããï¼
+ */
+#define TSTAT_WAIT_SLP(tstat)	(((tstat) & ~TS_SUSPENDED) == TS_WAITING_SLP)
+#define TSTAT_WAIT_MTX(tstat)	(((tstat) & ~TS_SUSPENDED) == TS_WAITING_MTX)
+
+#define TSTAT_WAIT_WOBJ(tstat)		(((tstat) & (0x18U << 2)) != 0U)
+#define TSTAT_WAIT_WOBJCB(tstat)	(((tstat) & (0x10U << 2)) != 0U)
+
+/*
+ *  å¾
+ã¡æ
+å ±ãã­ãã¯ï¼WINFOï¼ã®å®ç¾©
+ *
+ *  ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã®éã¯ï¼TCBããã³ãã®p_winfoã§æãããWINFOãæ¬¡ã®
+ *  ããã«è¨­å®ããªããã°ãªããªãï¼
+ *
+ *  (a) TCBã®ã¿ã¹ã¯ç¶æ
+ãå¾
+ã¡ç¶æ
+ï¼TS_WAITING_???ï¼ã«ããï¼
+ *
+ *  (b) ã¿ã¤ã ã¢ã¦ããç£è¦ããããã«ï¼ã¿ã¤ã ã¤ãã³ããã­ãã¯ãç»é²ããï¼
+ *  ç»é²ããã¿ã¤ã ã¤ãã³ããã­ãã¯ã¯ï¼å¾
+ã¡ã«å
+¥ããµã¼ãã¹ã³ã¼ã«å¦çé¢æ°
+ *  ã®ã­ã¼ã«ã«å¤æ°ã¨ãã¦ç¢ºä¿ãï¼ããã¸ã®ãã¤ã³ã¿ãWINFOã®p_tmevtbã«è¨
+ *  æ¶ããï¼ã¿ã¤ã ã¢ã¦ãã®ç£è¦ãå¿
+è¦ãªãå ´åï¼æ°¸ä¹
+å¾
+ã¡ã®å ´åï¼ã«ã¯ï¼
+ *  p_tmevtbãNULLã«ããï¼
+ *
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã®å ´åã«ã¯ï¼æ¨æºã®WINFOã«
+ *  p_wobjcbãã£ã¼ã«ããè¿½å ããæ§é ä½ï¼WINFO_WOBJï¼wait.hã§å®ç¾©ï¼ã«ï¼
+ *  å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã«ä¾å­ãã¦è¨æ¶ãããã¨ãå¿
+è¦ãªæ
+å ±
+ *  ã®ããã®ãã£ã¼ã«ããè¿½å ããæ§é ä½ï¼WINFO_???ï¼ãå®ç¾©ãï¼WINFOã®ä»£
+ *  ããã«ç¨ããï¼ã¾ãï¼ä»¥ä¸ã®(c)ã(e)ã®è¨­å®ãè¡ãå¿
+è¦ãããï¼åæã»é
+ *  ä¿¡ãªãã¸ã§ã¯ãã«é¢ä¿ããªãå¾
+ã¡ï¼èµ·åºå¾
+ã¡ï¼æéçµéå¾
+ã¡ï¼ã®å ´åã«ã¯ï¼
+ *  ãããã¯å¿
+è¦ãªãï¼
+ *
+ *  (c) TCBãå¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªãï¼å¾
+
+ *  ã¡ã­ã¥ã¼ã«ã¤ãªãããã«ï¼task_queueãä½¿ãï¼
+ *
+ *  (d) å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã¸ã®ãã¤ã³ã¿ãï¼
+ *  WINFO_WOBJã®p_wobjcbã«è¨æ¶ããï¼
+ *
+ *  (e) å¾
+ã¡å¯¾è±¡ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã«ä¾å­ãã¦è¨æ¶ãããã¨ãå¿
+è¦ãª
+ *  æ
+å ±ãããå ´åã«ã¯ï¼WINFO_???å
+ã®ãã£ã¼ã«ãã«è¨æ¶ããï¼
+ *
+ *  å¾
+ã¡ç¶æ
+ãè§£é¤ããéã«ã¯ï¼å¾
+ã¡è§£é¤ããã¿ã¹ã¯ã«å¯¾ããè¿å¤ãWINFOã®
+ *  wercdã«è¨­å®ããï¼wercdãå¿
+è¦ãªã®ã¯å¾
+ã¡è§£é¤ä»¥éã§ããã®ã«å¯¾ãã¦ï¼
+ *  p_tmevtbã¯å¾
+ã¡è§£é¤å¾ã¯å¿
+è¦ãªãããï¼ã¡ã¢ãªç¯ç´ã®ããã«å
+±ç¨ä½ãä½¿ã£
+ *  ã¦ããï¼ãã®ããï¼wercdã¸ã¨ã©ã¼ã³ã¼ããè¨­å®ããã®ã¯ï¼ã¿ã¤ã ã¤ãã³ã
+ *  ãã­ãã¯ãç»é²è§£é¤ããå¾ã«ããªããã°ãªããªãï¼
+ */
+typedef union waiting_information {
+	ER		wercd;			/* å¾
+ã¡è§£é¤æã®ã¨ã©ã¼ã³ã¼ã */
+	TMEVTB	*p_tmevtb;		/* å¾
+ã¡ç¶æ
+ç¨ã®ã¿ã¤ã ã¤ãã³ããã­ãã¯ */
+} WINFO;
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ã®åã®åæ¹åç
+§
+ */
+typedef struct mutex_control_block MTXCB;
+
+/*
+ *  ã¿ã¹ã¯åæåãã­ãã¯
+ *
+ *  ã¿ã¹ã¯ã«é¢ããæ
+å ±ãï¼å¤ãå¤ãããªãããã«ROMã«ç½®ããé¨åï¼ã¿ã¹ã¯
+ *  åæåãã­ãã¯ï¼ã¨ï¼å¤ãå¤åããããã«RAMã«ç½®ããªããã°ãªããªãé¨
+ *  åï¼ã¿ã¹ã¯ç®¡çãã­ãã¯ï¼TCBï¼ã«åé¢ãï¼TCBå
+ã«å¯¾å¿ããã¿ã¹ã¯åæå
+ *  ãã­ãã¯ãæããã¤ã³ã¿ãå
+¥ããï¼ã¿ã¹ã¯åæåãã­ãã¯å
+ã«å¯¾å¿ãã
+ *  TCBãæããã¤ã³ã¿ãå
+¥ããæ¹æ³ã®æ¹ãï¼RAMã®ç¯ç´ã®è¦³ç¹ããã¯æã¾ãã
+ *  ãï¼å®è¡å¹çãæªããªãããã«æ¡ç¨ãã¦ããªãï¼ä»ã®ãªãã¸ã§ã¯ãã«ã¤ã
+ *  ã¦ãåæ§ã«æ±ãï¼
+ */
+typedef struct task_initialization_block {
+	ATR			tskatr;			/* ã¿ã¹ã¯å±æ§ */
+	intptr_t	exinf;			/* ã¿ã¹ã¯ã®æ¡å¼µæ
+å ± */
+	TASK		task;			/* ã¿ã¹ã¯ã®èµ·åçªå° */
+	uint_t		ipriority;		/* ã¿ã¹ã¯ã®èµ·åæåªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼ */
+
+#ifdef USE_TSKINICTXB
+	TSKINICTXB	tskinictxb;		/* ã¿ã¹ã¯åæåã³ã³ãã­ã¹ããã­ãã¯ */
+#else /* USE_TSKINICTXB */
+	size_t		stksz;			/* ã¹ã¿ãã¯é åã®ãµã¤ãºï¼ä¸¸ããå¤ï¼ */
+	void		*stk;			/* ã¹ã¿ãã¯é åã®å
+é ­çªå° */
+#endif /* USE_TSKINICTXB */
+} TINIB;
+
+/*
+ *  ã¿ã¹ã¯ç®¡çãã­ãã¯ï¼TCBï¼
+ *
+ *  ASPã«ã¼ãã«ã§ã¯ï¼ã¿ã¹ã¯ã®èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ï¼TMAX_ACTCNTï¼
+ *  ã¨èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®æå¤§å¤ï¼TMAX_WUPCNTï¼ã¯1ã«åºå®ããã¦ãã
+ *  ããï¼ã­ã¥ã¼ã¤ã³ã°ããã¦ãããã©ããã®çå½å¤ã§è¡¨ç¾ãããã¨ãã§ããï¼
+ *  ã¾ãï¼å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ã®æå¤§å¤ï¼TMAX_SUSCNTï¼ã1ã«åºå®ããã¦ã
+ *  ãã®ã§ï¼å¼·å¶å¾
+ã¡è¦æ±ãã¹ãæ°ï¼suscntï¼ã¯å¿
+è¦ãªãï¼
+ *
+ *  TCBã®ããã¤ãã®ãã£ã¼ã«ãã¯ï¼ç¹å®ã®ã¿ã¹ã¯ç¶æ
+ã§ã®ã¿æå¹ãªå¤ãä¿æãï¼
+ *  ããä»¥å¤ã®å ´åã¯å¤ãä¿è¨¼ãããªãï¼ãã£ã¦ï¼åç
+§ãã¦ã¯ãªããªãï¼ï¼å
+ *  ãã£ã¼ã«ããæå¹ãªå¤ãä¿æããæ¡ä»¶ã¯æ¬¡ã®éãï¼
+ *
+ *  ã»åæåå¾ã¯å¸¸ã«æå¹ï¼
+ *  		p_tinibï¼tstatï¼actque
+ *  ã»ä¼æ­¢ç¶æ
+ä»¥å¤ã§æå¹ï¼ä¼æ­¢ç¶æ
+ã§ã¯åæå¤ã«ãªã£ã¦ããï¼ï¼
+ *  		bpriorityï¼priorityï¼wupqueï¼rasterï¼enaterï¼p_lastmtx
+ *  ã»å¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ãå«ãï¼ã§æå¹ï¼
+ *  		p_winfo
+ *  ã»å®è¡ã§ããç¶æ
+ã¨åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã§æå¹ï¼
+ *  		task_queue
+ *  ã»å®è¡å¯è½ç¶æ
+ï¼å¾
+ã¡ç¶æ
+ï¼å¼·å¶å¾
+ã¡ç¶æ
+ï¼äºéå¾
+ã¡ç¶æ
+ã§æå¹ï¼
+ *  		tskctxb
+ */
+typedef struct task_control_block {
+	QUEUE			task_queue;		/* ã¿ã¹ã¯ã­ã¥ã¼ */
+	const TINIB		*p_tinib;		/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+
+#ifdef UINT8_MAX
+	uint8_t			tstat;			/* ã¿ã¹ã¯ç¶æ
+ï¼å
+é¨è¡¨ç¾ï¼*/
+	uint8_t			bpriority;		/* ãã¼ã¹åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+	uint8_t			priority;		/* ç¾å¨ã®åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+#else /* UINT8_MAX */
+	BIT_FIELD_UINT	tstat : 8;		/* ã¿ã¹ã¯ç¶æ
+ï¼å
+é¨è¡¨ç¾ï¼*/
+	BIT_FIELD_UINT	bpriority : 8;	/* ãã¼ã¹åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/
+	BIT_FIELD_UINT	priority : 8	/* ç¾å¨ã®åªå
+åº¦ï¼å
+é¨è¡¨ç¾ï¼*/;
+#endif /* UINT8_MAX */
+	BIT_FIELD_BOOL	actque : 1;		/* èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã° */
+	BIT_FIELD_BOOL	wupque : 1;		/* èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã° */
+	BIT_FIELD_BOOL	raster : 1;		/* ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ */
+	BIT_FIELD_BOOL	enater : 1;		/* ã¿ã¹ã¯çµäºè¨±å¯ç¶æ
+ */
+
+	WINFO			*p_winfo;		/* å¾
+ã¡æ
+å ±ãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+	MTXCB			*p_lastmtx;		/* æå¾ã«ã­ãã¯ãããã¥ã¼ããã¯ã¹ */
+	TSKCTXB			tskctxb;		/* ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ */
+} TCB;
+
+/*
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯
+ *
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯ï¼ï¼ãã­ã»ããµãã³ã³ãã­ã¹ããæã£ã¦ããã¿ã¹ã¯ï¼ã®
+ *  TCBãæããã¤ã³ã¿ï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ããªãå ´åã¯NULLã«ããï¼
+ *
+ *  ãµã¼ãã¹ã³ã¼ã«ã®å¦çä¸­ã§ï¼èªã¿ã¹ã¯ï¼ãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºããã¿ã¹
+ *  ã¯ï¼ã«é¢ããæ
+å ±ãåç
+§ããå ´åã¯p_runtskãä½¿ãï¼p_runtskãæ¸ãæã
+ *  ãã®ã¯ï¼ãã£ã¹ãããã£ï¼ã¨åæåå¦çï¼ã®ã¿ã§ããï¼
+ */
+extern TCB	*p_runtsk;
+
+/*
+ *  å®è¡ãã¹ãã¿ã¹ã¯
+ *
+ *  å®è¡ãã¹ãã¿ã¹ã¯ã®TCBãæããã¤ã³ã¿ï¼å®è¡ã§ããã¿ã¹ã¯ããªãå ´åã¯
+ *  NULLã«ããï¼
+ *
+ *  p_runtskã¯ï¼éå¸¸ã¯p_schedtskã¨ä¸è´ãã¦ãããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ã
+ *  å®è¡ä¸­ã¯ï¼ä¸è´ãã¦ããã¨ã¯éããªãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªã
+ *  ç¶æ
+ã®éã¨ãã£ã¹ãããç¦æ­¢ç¶æ
+ã®éï¼ããªãã¡ï¼dspflgãfalseã§ããéï¼
+ *  ã¯ï¼p_schedtskãæ´æ°ããªãï¼
+ */
+extern TCB	*p_schedtsk;
+
+/*
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+
+ *
+ *  ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ãããã¨ãç¤ºããã©ã°ï¼
+ */
+extern bool_t	enadsp;
+
+/*
+ *  ã¿ã¹ã¯ãã£ã¹ãããå¯è½ç¶æ
+
+ *
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§ããï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§ããï¼ãã£
+ *  ã¹ãããç¦æ­¢ç¶æ
+ã§ãªãï¼ãã¨ãç¤ºããã©ã°ï¼ãã£ã¹ãããä¿çç¶æ
+ã§ãª
+ *  ããã¨ã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãå®è¡ä¸­ã§ï¼CPUã­ãã¯ç¶æ
+ã§ãªãï¼dspflgã
+ *  trueã§ãããã¨ã§å¤å¥ãããã¨ãã§ããï¼
+ */
+extern bool_t	dspflg;
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã¯ï¼å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ãç®¡çããããã®ã­ã¥ã¼ã§ããï¼
+ *  å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãç®¡çãã¦ããããï¼ã¬ãã£ï¼å®è¡å¯è½ï¼ã­ã¥ã¼ã¨ãã
+ *  åç§°ã¯æ­£ç¢ºã§ã¯ãªããï¼ã¬ãã£ã­ã¥ã¼ã¨ããåç§°ãå®çãã¦ããããï¼ã
+ *  ã®åç§°ã§å¼ã¶ãã¨ã«ããï¼
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã¯ï¼åªå
+åº¦ãã¨ã®ã¿ã¹ã¯ã­ã¥ã¼ã§æ§æããã¦ããï¼ã¿ã¹ã¯ã®
+ *  TCBã¯ï¼è©²å½ããåªå
+åº¦ã®ã­ã¥ã¼ã«ç»é²ãããï¼
+ */
+extern QUEUE	ready_queue[TNUM_TPRI];
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ãµã¼ãã®ããã®ãããããã
+ *
+ *  ã¬ãã£ã­ã¥ã¼ã®ãµã¼ããå¹çããè¡ãããã«ï¼åªå
+åº¦ãã¨ã®ã¿ã¹ã¯ã­ã¥ã¼
+ *  ã«ã¿ã¹ã¯ãå
+¥ã£ã¦ãããã©ãããç¤ºããããããããç¨æãã¦ããï¼ãã
+ *  ãããããä½¿ããã¨ã§ï¼ã¡ã¢ãªã¢ã¯ã»ã¹ã®åæ°ãæ¸ãããã¨ãã§ãããï¼
+ *  ãããæä½å½ä»¤ãå
+
+å®ãã¦ããªããã­ã»ããµã§ï¼åªå
+åº¦ã®æ®µéæ°ãå°ãªã
+ *  å ´åã«ã¯ï¼ããããããæä½ã®ãªã¼ãã¼ãããã®ããã«ï¼éã«å¹çãè½ã¡
+ *  ãå¯è½æ§ãããï¼
+ *
+ *  åªå
+åº¦ã16æ®µéã§ãããã¨ãä»®å®ãã¦ããããï¼uint16_tåã¨ãã¦ããï¼
+ */
+extern uint16_t	ready_primap;
+
+/*
+ *  ã¿ã¹ã¯IDã®æå¤§å¤ï¼kernel_cfg.cï¼
+ */
+extern const ID	tmax_tskid;
+
+/*
+ *  ã¿ã¹ã¯åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const TINIB	tinib_table[];
+
+/*
+ *  ã¿ã¹ã¯çæé åºãã¼ãã«ï¼kernel_cfg.cï¼
+ */
+extern const ID	torder_table[];
+
+/*
+ *  TCBã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern TCB	tcb_table[];
+
+/*
+ *  ã¿ã¹ã¯ã®æ°
+ */
+#define tnum_tsk	((uint_t)(tmax_tskid - TMIN_TSKID + 1))
+
+/*
+ *  ã¿ã¹ã¯IDããTCBãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_TSK(tskid)	((uint_t)((tskid) - TMIN_TSKID))
+#define get_tcb(tskid)		(&(tcb_table[INDEX_TSK(tskid)]))
+
+/*
+ *  TCBããã¿ã¹ã¯IDãåãåºãããã®ãã¯ã­
+ */
+#define	TSKID(p_tcb)	((ID)(((p_tcb) - tcb_table) + TMIN_TSKID))
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®åæå
+ */
+extern void	initialize_task(void);
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã®ãµã¼ã
+ *
+ *  ã¬ãã£ã­ã¥ã¼ä¸­ã®æé«åªå
+é ä½ã®ã¿ã¹ã¯ããµã¼ããï¼ãã®TCBã¸ã®ãã¤ã³ã¿
+ *  ãè¿ãï¼ã¬ãã£ã­ã¥ã¼ãç©ºã®å ´åã«ã¯ï¼ãã®é¢æ°ãå¼ã³åºãã¦ã¯ãªããªãï¼
+ */
+extern TCB	*search_schedtsk(void);
+
+/*
+ *  å®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ã«æ¿å
+¥ããï¼ã¬ãã£ã­ã¥ã¼ã«æ¿å
+¥
+ *  ããã¿ã¹ã¯ã®åªå
+åº¦ãï¼å®è¡ãã¹ãã¿ã¹ã¯ã®åªå
+åº¦ãããé«ãå ´åã¯ï¼å®
+ *  è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ */
+extern void	make_runnable(TCB *p_tcb);
+
+/*
+ *  å®è¡ã§ããç¶æ
+ããä»ã®ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ããåé¤ããï¼p_tcbã§æå®ãã
+ *  ã¿ã¹ã¯ãå®è¡ãã¹ãã¿ã¹ã¯ã§ãã£ãå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ã
+ *  ãï¼
+ */
+extern void	make_non_runnable(TCB *p_tcb);
+
+/*
+ *  ä¼æ­¢ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¶æ
+ãä¼æ­¢ç¶æ
+ã¨ããï¼ã¾ãï¼ã¿ã¹ã¯ã®èµ·å
+ *  æã«åæåãã¹ãå¤æ°ã®åæåã¨ï¼ã¿ã¹ã¯èµ·åã®ããã®ã³ã³ãã­ã¹ããè¨­
+ *  å®ããï¼
+ */
+extern void	make_dormant(TCB *p_tcb);
+
+/*
+ *  ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®ç¶æ
+ãä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¨ããï¼
+ */
+extern void	make_active(TCB *p_tcb);
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+åº¦ã®å¤æ´
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®åªå
+åº¦ãnewpriï¼å
+é¨è¡¨ç¾ï¼ã«å¤æ´ããï¼ã¾ãï¼
+ *  å¿
+è¦ãªå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®åªå
+é ä½ã¯ï¼åªå
+åº¦ãåãã¿ã¹ã¯ã®ä¸­ã§ï¼
+ *  mtxmodeãfalseã®æã¯æä½ï¼mtxmodeãtrueã®æã¯æé«ã¨ããï¼
+ */
+extern void	change_priority(TCB *p_tcb, uint_t newpri, bool_t mtxmode);
+
+/*
+ *  ã¬ãã£ã­ã¥ã¼ã®åè»¢
+ *
+ *  ã¬ãã£ã­ã¥ã¼ä¸­ã®ï¼p_queueã§æå®ãããã¿ã¹ã¯ã­ã¥ã¼ãåè»¢ãããï¼ã¾ãï¼
+ *  å¿
+è¦ãªå ´åã«ã¯ï¼å®è¡ãã¹ãã¿ã¹ã¯ãæ´æ°ããï¼
+ */
+extern void	rotate_ready_queue(QUEUE *p_queue);
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºå¦ç
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãçµäºãããå¦çãè¡ãï¼ã¿ã¹ã¯ã®èµ·åè¦æ±ã­ã¥ã¼
+ *  ã¤ã³ã°æ°ã0ã§ãªãå ´åã«ã¯ï¼ååº¦èµ·åããããã®å¦çãè¡ãï¼
+ */
+extern void	task_terminate(TCB *p_tcb);
+
+#endif /* TOPPERS_TASK_H */
Index: asp3_wo_tecs/trunk/kernel/task.tf
===================================================================
--- asp3_wo_tecs/trunk/kernel/task.tf	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/task.tf	(revision 302)
@@ -0,0 +1,202 @@
+$
+$   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_manage.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/task_manage.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/task_manage.c	(revision 302)
@@ -0,0 +1,380 @@
+/*
+ *  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: task_manage.c 469 2015-12-30 02:38:47Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "taskhook.h"
+#include "wait.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_ACT_TSK_ENTER
+#define LOG_ACT_TSK_ENTER(tskid)
+#endif /* LOG_ACT_TSK_ENTER */
+
+#ifndef LOG_ACT_TSK_LEAVE
+#define LOG_ACT_TSK_LEAVE(ercd)
+#endif /* LOG_ACT_TSK_LEAVE */
+
+#ifndef LOG_CAN_ACT_ENTER
+#define LOG_CAN_ACT_ENTER(tskid)
+#endif /* LOG_CAN_ACT_ENTER */
+
+#ifndef LOG_CAN_ACT_LEAVE
+#define LOG_CAN_ACT_LEAVE(ercd)
+#endif /* LOG_CAN_ACT_LEAVE */
+
+#ifndef LOG_GET_TST_ENTER
+#define LOG_GET_TST_ENTER(tskid, p_tskstat)
+#endif /* LOG_GET_TST_ENTER */
+
+#ifndef LOG_GET_TST_LEAVE
+#define LOG_GET_TST_LEAVE(ercd, p_tskstat)
+#endif /* LOG_GET_TST_LEAVE */
+
+#ifndef LOG_CHG_PRI_ENTER
+#define LOG_CHG_PRI_ENTER(tskid, tskpri)
+#endif /* LOG_CHG_PRI_ENTER */
+
+#ifndef LOG_CHG_PRI_LEAVE
+#define LOG_CHG_PRI_LEAVE(ercd)
+#endif /* LOG_CHG_PRI_LEAVE */
+
+#ifndef LOG_GET_PRI_ENTER
+#define LOG_GET_PRI_ENTER(tskid, p_tskpri)
+#endif /* LOG_GET_PRI_ENTER */
+
+#ifndef LOG_GET_PRI_LEAVE
+#define LOG_GET_PRI_LEAVE(ercd, p_tskpri)
+#endif /* LOG_GET_PRI_LEAVE */
+
+#ifndef LOG_GET_INF_ENTER
+#define LOG_GET_INF_ENTER(p_exinf)
+#endif /* LOG_GET_INF_ENTER */
+
+#ifndef LOG_GET_INF_LEAVE
+#define LOG_GET_INF_LEAVE(ercd, p_exinf)
+#endif /* LOG_GET_INF_LEAVE */
+
+/*
+ *  ã¿ã¹ã¯ã®èµ·åï¼»NGKI3529ï¼½
+ */
+#ifdef TOPPERS_act_tsk
+
+ER
+act_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_ACT_TSK_ENTER(tskid);
+	CHECK_UNL();								/*ï¼»NGKI1114ï¼½*/
+	if (tskid == TSK_SELF && !sense_context()) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1121ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1115ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		make_active(p_tcb);						/*ï¼»NGKI1118ï¼½*/
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	else if ((p_tcb->p_tinib->tskatr & TA_NOACTQUE) != 0U || p_tcb->actque) {
+		ercd = E_QOVR;			   				/*ï¼»NGKI3528ï¼½*/
+	}
+	else {
+		p_tcb->actque = true;					/*ï¼»NGKI3527ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ACT_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_act_tsk */
+
+/*
+ *  ã¿ã¹ã¯èµ·åè¦æ±ã®ã­ã£ã³ã»ã«ï¼»NGKI1138ï¼½
+ */
+#ifdef TOPPERS_can_act
+
+ER_UINT
+can_act(ID tskid)
+{
+	TCB		*p_tcb;
+	ER_UINT	ercd;
+
+	LOG_CAN_ACT_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1139ï¼½ï¼»NGKI1140ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1146ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1141ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	ercd = p_tcb->actque ? 1 : 0;				/*ï¼»NGKI1144ï¼½*/
+	p_tcb->actque = false;						/*ï¼»NGKI1144ï¼½*/
+	unlock_cpu();
+
+  error_exit:
+	LOG_CAN_ACT_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_can_act */
+
+/*
+ *  ã¿ã¹ã¯ç¶æ
+ã®åç
+§ï¼»NGKI3613ï¼½
+ */
+#ifdef TOPPERS_get_tst
+
+ER
+get_tst(ID tskid, STAT *p_tskstat)
+{
+	TCB		*p_tcb;
+	uint_t	tstat;
+	ER		ercd;
+
+	LOG_GET_TST_ENTER(tskid, p_tskstat);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3614ï¼½ï¼»NGKI3615ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI3621ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI3616ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	tstat = p_tcb->tstat;
+	if (TSTAT_DORMANT(tstat)) {					/*ï¼»NGKI3620ï¼½*/
+		*p_tskstat = TTS_DMT;
+	}
+	else if (TSTAT_SUSPENDED(tstat)) {
+		if (TSTAT_WAITING(tstat)) {
+			*p_tskstat = TTS_WAS;
+		}
+		else {
+			*p_tskstat = TTS_SUS;
+		}
+	}
+	else if (TSTAT_WAITING(tstat)) {
+		*p_tskstat = TTS_WAI;
+	}
+	else if (p_tcb == p_runtsk) {
+		*p_tskstat = TTS_RUN;
+	}
+	else {
+		*p_tskstat = TTS_RDY;
+	}
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_TST_LEAVE(ercd, p_tskstat);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_tst */
+
+/*
+ *  ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ã®å¤æ´ï¼»NGKI1183ï¼½
+ */
+#ifdef TOPPERS_chg_pri
+
+ER
+chg_pri(ID tskid, PRI tskpri)
+{
+	TCB		*p_tcb;
+	uint_t	newbpri;
+	ER		ercd;
+
+	LOG_CHG_PRI_ENTER(tskid, tskpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1184ï¼½ï¼»NGKI1185ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1198ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1187ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+	if (tskpri == TPRI_INI) {
+		newbpri = p_tcb->p_tinib->ipriority;	/*ï¼»NGKI1199ï¼½*/
+	}
+	else {
+		CHECK_PAR(VALID_TPRI(tskpri));			/*ï¼»NGKI1188ï¼½*/
+		newbpri = INT_PRIORITY(tskpri);
+	}
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1191ï¼½*/
+	}
+	else if ((p_tcb->p_lastmtx != NULL || TSTAT_WAIT_MTX(p_tcb->tstat))
+						&& !((*mtxhook_check_ceilpri)(p_tcb, newbpri))) {
+		ercd = E_ILUSE;							/*ï¼»NGKI1201ï¼½*/
+	}
+	else {
+		p_tcb->bpriority = newbpri;				/*ï¼»NGKI1192ï¼½*/
+		if (p_tcb->p_lastmtx == NULL || !((*mtxhook_scan_ceilmtx)(p_tcb))) {
+			change_priority(p_tcb, newbpri, false);		/*ï¼»NGKI1193ï¼½*/
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}									/*ï¼»NGKI1197ï¼½*/
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_CHG_PRI_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_chg_pri */
+
+/*
+ *  ã¿ã¹ã¯åªå
+åº¦ã®åç
+§ï¼»NGKI1202ï¼½
+ */
+#ifdef TOPPERS_get_pri
+
+ER
+get_pri(ID tskid, PRI *p_tskpri)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_GET_PRI_ENTER(tskid, p_tskpri);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1203ï¼½ï¼»NGKI1204ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1211ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1205ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1209ï¼½*/
+	}
+	else {
+		*p_tskpri = EXT_TSKPRI(p_tcb->priority);	/*ï¼»NGKI1210ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_PRI_LEAVE(ercd, p_tskpri);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_pri */
+
+/*
+ *  èªã¿ã¹ã¯ã®æ¡å¼µæ
+å ±ã®åç
+§ï¼»NGKI1212ï¼½
+ */
+#ifdef TOPPERS_get_inf
+
+ER
+get_inf(intptr_t *p_exinf)
+{
+	ER		ercd;
+
+	LOG_GET_INF_ENTER(p_exinf);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1213ï¼½ï¼»NGKI1214ï¼½*/
+
+	lock_cpu();
+	*p_exinf = p_runtsk->p_tinib->exinf;		/*ï¼»NGKI1216ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_INF_LEAVE(ercd, p_exinf);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_inf */
Index: asp3_wo_tecs/trunk/kernel/task_refer.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/task_refer.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/task_refer.c	(revision 302)
@@ -0,0 +1,246 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: task_refer.c 69 2014-04-28 19:26:49Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ã®ç¶æ
+åç
+§æ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+#include "semaphore.h"
+#include "eventflag.h"
+#include "dataqueue.h"
+#include "pridataq.h"
+#include "mutex.h"
+#include "mempfix.h"
+#include "time_event.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_REF_TSK_ENTER
+#define LOG_REF_TSK_ENTER(tskid, pk_rtsk)
+#endif /* LOG_REF_TSK_ENTER */
+
+#ifndef LOG_REF_TSK_LEAVE
+#define LOG_REF_TSK_LEAVE(ercd, pk_rtsk)
+#endif /* LOG_REF_TSK_LEAVE */
+
+/*
+ *  ã¿ã¹ã¯ã®ç¶æ
+åç
+§
+ */
+#ifdef TOPPERS_ref_tsk
+
+ER
+ref_tsk(ID tskid, T_RTSK *pk_rtsk)
+{
+	TCB		*p_tcb;
+	uint_t	tstat;
+	ER		ercd;
+
+	LOG_REF_TSK_ENTER(tskid, pk_rtsk);
+	CHECK_TSKCTX_UNL();
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	tstat = p_tcb->tstat;
+	if (TSTAT_DORMANT(tstat)) {
+		/*
+ 		 *  å¯¾è±¡ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ã®å ´å
+		 */
+		pk_rtsk->tskstat = TTS_DMT;
+	}
+	else {
+		/*
+ 		 *  ã¿ã¹ã¯ç¶æ
+ã®ååºã
+		 */
+		if (TSTAT_SUSPENDED(tstat)) {
+			if (TSTAT_WAITING(tstat)) {
+				pk_rtsk->tskstat = TTS_WAS;
+			}
+			else {
+				pk_rtsk->tskstat = TTS_SUS;
+			}
+		}
+		else if (TSTAT_WAITING(tstat)) {
+			pk_rtsk->tskstat = TTS_WAI;
+		}
+		else if (p_tcb == p_runtsk) {
+			pk_rtsk->tskstat = TTS_RUN;
+		}
+		else {
+			pk_rtsk->tskstat = TTS_RDY;
+		}
+
+		/*
+ 		 *  ç¾å¨åªå
+åº¦ã¨ãã¼ã¹åªå
+åº¦ã®ååºã
+		 */
+		pk_rtsk->tskpri = EXT_TSKPRI(p_tcb->priority);
+		pk_rtsk->tskbpri = EXT_TSKPRI(p_tcb->bpriority);
+
+		if (TSTAT_WAITING(tstat)) {
+			/*
+	 		 *  å¾
+ã¡è¦å ã¨å¾
+ã¡å¯¾è±¡ã®ãªãã¸ã§ã¯ãã®IDã®ååºã
+			 */
+			switch (tstat) {
+			case TS_WAITING_SLP:
+				pk_rtsk->tskwait = TTW_SLP;
+				break;
+			case TS_WAITING_DLY:
+				pk_rtsk->tskwait = TTW_DLY;
+				break;
+			case TS_WAITING_SEM:
+				pk_rtsk->tskwait = TTW_SEM;
+				pk_rtsk->wobjid = SEMID(((WINFO_SEM *)(p_tcb->p_winfo))
+																->p_semcb);
+				break;
+			case TS_WAITING_FLG:
+				pk_rtsk->tskwait = TTW_FLG;
+				pk_rtsk->wobjid = FLGID(((WINFO_FLG *)(p_tcb->p_winfo))
+																->p_flgcb);
+				break;
+			case TS_WAITING_SDTQ:
+				pk_rtsk->tskwait = TTW_SDTQ;
+				pk_rtsk->wobjid = DTQID(((WINFO_SDTQ *)(p_tcb->p_winfo))
+																->p_dtqcb);
+				break;
+			case TS_WAITING_RDTQ:
+				pk_rtsk->tskwait = TTW_RDTQ;
+				pk_rtsk->wobjid = DTQID(((WINFO_RDTQ *)(p_tcb->p_winfo))
+																->p_dtqcb);
+				break;
+			case TS_WAITING_SPDQ:
+				pk_rtsk->tskwait = TTW_SPDQ;
+				pk_rtsk->wobjid = PDQID(((WINFO_SPDQ *)(p_tcb->p_winfo))
+																->p_pdqcb);
+				break;
+			case TS_WAITING_RPDQ:
+				pk_rtsk->tskwait = TTW_RPDQ;
+				pk_rtsk->wobjid = PDQID(((WINFO_RPDQ *)(p_tcb->p_winfo))
+																->p_pdqcb);
+				break;
+			case TS_WAITING_MTX:
+				pk_rtsk->tskwait = TTW_MTX;
+				pk_rtsk->wobjid = MTXID(((WINFO_MTX *)(p_tcb->p_winfo))
+																->p_mtxcb);
+				break;
+			case TS_WAITING_MPF:
+				pk_rtsk->tskwait = TTW_MPF;
+				pk_rtsk->wobjid = MPFID(((WINFO_MPF *)(p_tcb->p_winfo))
+																->p_mpfcb);
+				break;
+			}
+
+			/*
+	 		 *  ã¿ã¤ã ã¢ã¦ãããã¾ã§ã®æéã®ååºã
+			 */
+			if (p_tcb->p_winfo->p_tmevtb != NULL) {
+				pk_rtsk->lefttmo
+						= (TMO) tmevt_lefttim(p_tcb->p_winfo->p_tmevtb);
+			}
+			else {
+				pk_rtsk->lefttmo = TMO_FEVR;
+			}
+		}
+
+		/*
+ 		 *  èµ·åºè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®ååºã
+		 */
+		pk_rtsk->wupcnt = p_tcb->wupque ? 1U : 0U;
+
+		/*
+		 *  ã¿ã¹ã¯çµäºè¦æ±ç¶æ
+ã®ååºã
+		 */
+		pk_rtsk->raster = p_tcb->raster;
+
+		/*
+		 *  ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã®ååºã
+		 */
+		pk_rtsk->dister = !(p_tcb->enater);
+	}
+
+	/*
+	 *  èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã®ååºã
+	 */
+	pk_rtsk->actcnt = p_tcb->actque ? 1U : 0U;
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_REF_TSK_LEAVE(ercd, pk_rtsk);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ref_tsk */
Index: asp3_wo_tecs/trunk/kernel/task_sync.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/task_sync.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/task_sync.c	(revision 302)
@@ -0,0 +1,524 @@
+/*
+ *  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: task_sync.c 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯ä»å±åææ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_SLP_TSK_ENTER
+#define LOG_SLP_TSK_ENTER()
+#endif /* LOG_SLP_TSK_ENTER */
+
+#ifndef LOG_SLP_TSK_LEAVE
+#define LOG_SLP_TSK_LEAVE(ercd)
+#endif /* LOG_SLP_TSK_LEAVE */
+
+#ifndef LOG_TSLP_TSK_ENTER
+#define LOG_TSLP_TSK_ENTER(tmout)
+#endif /* LOG_TSLP_TSK_ENTER */
+
+#ifndef LOG_TSLP_TSK_LEAVE
+#define LOG_TSLP_TSK_LEAVE(ercd)
+#endif /* LOG_TSLP_TSK_LEAVE */
+
+#ifndef LOG_WUP_TSK_ENTER
+#define LOG_WUP_TSK_ENTER(tskid)
+#endif /* LOG_WUP_TSK_ENTER */
+
+#ifndef LOG_WUP_TSK_LEAVE
+#define LOG_WUP_TSK_LEAVE(ercd)
+#endif /* LOG_WUP_TSK_LEAVE */
+
+#ifndef LOG_CAN_WUP_ENTER
+#define LOG_CAN_WUP_ENTER(tskid)
+#endif /* LOG_CAN_WUP_ENTER */
+
+#ifndef LOG_CAN_WUP_LEAVE
+#define LOG_CAN_WUP_LEAVE(ercd)
+#endif /* LOG_CAN_WUP_LEAVE */
+
+#ifndef LOG_REL_WAI_ENTER
+#define LOG_REL_WAI_ENTER(tskid)
+#endif /* LOG_REL_WAI_ENTER */
+
+#ifndef LOG_REL_WAI_LEAVE
+#define LOG_REL_WAI_LEAVE(ercd)
+#endif /* LOG_REL_WAI_LEAVE */
+
+#ifndef LOG_SUS_TSK_ENTER
+#define LOG_SUS_TSK_ENTER(tskid)
+#endif /* LOG_SUS_TSK_ENTER */
+
+#ifndef LOG_SUS_TSK_LEAVE
+#define LOG_SUS_TSK_LEAVE(ercd)
+#endif /* LOG_SUS_TSK_LEAVE */
+
+#ifndef LOG_RSM_TSK_ENTER
+#define LOG_RSM_TSK_ENTER(tskid)
+#endif /* LOG_RSM_TSK_ENTER */
+
+#ifndef LOG_RSM_TSK_LEAVE
+#define LOG_RSM_TSK_LEAVE(ercd)
+#endif /* LOG_RSM_TSK_LEAVE */
+
+#ifndef LOG_DLY_TSK_ENTER
+#define LOG_DLY_TSK_ENTER(dlytim)
+#endif /* LOG_DLY_TSK_ENTER */
+
+#ifndef LOG_DLY_TSK_LEAVE
+#define LOG_DLY_TSK_LEAVE(ercd)
+#endif /* LOG_DLY_TSK_LEAVE */
+
+/*
+ *  èµ·åºå¾
+ã¡
+ */
+#ifdef TOPPERS_slp_tsk
+
+ER
+slp_tsk(void)
+{
+	WINFO	winfo;
+	ER		ercd;
+
+	LOG_SLP_TSK_ENTER();
+	CHECK_DISPATCH();
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_runtsk->wupque) {
+		p_runtsk->wupque = false;
+		ercd = E_OK;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_SLP;
+		make_wait(&winfo);
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_SLP_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_slp_tsk */
+
+/*
+ *  èµ·åºå¾
+ã¡ï¼ã¿ã¤ã ã¢ã¦ãããï¼
+ */
+#ifdef TOPPERS_tslp_tsk
+
+ER
+tslp_tsk(TMO tmout)
+{
+	WINFO	winfo;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_TSLP_TSK_ENTER(tmout);
+	CHECK_DISPATCH();
+	CHECK_PAR(VALID_TMOUT(tmout));
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else if (p_runtsk->wupque) {
+		p_runtsk->wupque = false;
+		ercd = E_OK;
+	}
+	else if (tmout == TMO_POL) {
+		ercd = E_TMOUT;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_SLP;
+		make_wait_tmout(&winfo, &tmevtb, tmout);
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_TSLP_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_tslp_tsk */
+
+/*
+ *  ã¿ã¹ã¯ã®èµ·åº
+ */
+#ifdef TOPPERS_wup_tsk
+
+ER
+wup_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_WUP_TSK_ENTER(tskid);
+	CHECK_UNL();
+	if (tskid == TSK_SELF && !sense_context()) {
+		p_tcb = p_runtsk;
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;
+	}
+	else if (TSTAT_WAIT_SLP(p_tcb->tstat)) {
+		wait_complete(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	else if (!(p_tcb->wupque)) {
+		p_tcb->wupque = true;
+		ercd = E_OK;
+	}
+	else {
+		ercd = E_QOVR;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_WUP_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_wup_tsk */
+
+/*
+ *  ã¿ã¹ã¯èµ·åºè¦æ±ã®ã­ã£ã³ã»ã«
+ */
+#ifdef TOPPERS_can_wup
+
+ER_UINT
+can_wup(ID tskid)
+{
+	TCB		*p_tcb;
+	ER_UINT	ercd;
+
+	LOG_CAN_WUP_ENTER(tskid);
+	CHECK_TSKCTX_UNL();
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;
+	}
+	else {
+		ercd = p_tcb->wupque ? 1 : 0;
+		p_tcb->wupque = false;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_CAN_WUP_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_can_wup */
+
+/*
+ *  å¾
+ã¡ç¶æ
+ã®å¼·å¶è§£é¤
+ */
+#ifdef TOPPERS_rel_wai
+
+ER
+rel_wai(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_REL_WAI_ENTER(tskid);
+	CHECK_UNL();
+	CHECK_ID(VALID_TSKID(tskid));
+	p_tcb = get_tcb(tskid);
+
+	lock_cpu();
+	if (!TSTAT_WAITING(p_tcb->tstat)) {
+		ercd = E_OBJ;
+	}
+	else {
+		wait_dequeue_wobj(p_tcb);
+		wait_dequeue_tmevtb(p_tcb);
+		p_tcb->p_winfo->wercd = E_RLWAI;
+		make_non_wait(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			if (!sense_context()) {
+				dispatch();
+			}
+			else {
+				request_dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_REL_WAI_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rel_wai */
+
+/*
+ *  å¼·å¶å¾
+ã¡ç¶æ
+ã¸ã®ç§»è¡ï¼»NGKI1298ï¼½
+ */
+#ifdef TOPPERS_sus_tsk
+
+ER
+sus_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_SUS_TSK_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1299ï¼½ï¼»NGKI1300ï¼½*/
+	if (tskid == TSK_SELF) {
+		p_tcb = p_runtsk;						/*ï¼»NGKI1310ï¼½*/
+	}
+	else {
+		CHECK_ID(VALID_TSKID(tskid));			/*ï¼»NGKI1302ï¼½*/
+		p_tcb = get_tcb(tskid);
+	}
+
+	lock_cpu();
+	if (p_tcb == p_runtsk && !dspflg) {			/*ï¼»NGKI1311ï¼½ï¼»NGKI3604ï¼½*/
+		ercd = E_CTX;
+	}
+	else if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1305ï¼½*/
+	}
+	else if (p_tcb->raster) {
+		ercd = E_RASTER;						/*ï¼»NGKI3605ï¼½*/
+	}
+	else if (TSTAT_RUNNABLE(p_tcb->tstat)) {
+		/*
+		 *  å®è¡ã§ããç¶æ
+ããå¼·å¶å¾
+ã¡ç¶æ
+ã¸ã®é·ç§»ï¼»NGKI1307ï¼½
+		 */
+		p_tcb->tstat = TS_SUSPENDED;
+		LOG_TSKSTAT(p_tcb);
+		make_non_runnable(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else if (TSTAT_SUSPENDED(p_tcb->tstat)) {
+		ercd = E_QOVR;							/*ï¼»NGKI1306ï¼½*/
+	}
+	else {
+		/*
+		 *  å¾
+ã¡ç¶æ
+ããäºéå¾
+ã¡ç¶æ
+ã¸ã®é·ç§»ï¼»NGKI1308ï¼½
+		 */
+		p_tcb->tstat |= TS_SUSPENDED;
+		LOG_TSKSTAT(p_tcb);
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_SUS_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_sus_tsk */
+
+/*
+ *  å¼·å¶å¾
+ã¡ç¶æ
+ããã®åé
+ */
+#ifdef TOPPERS_rsm_tsk
+
+ER
+rsm_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_RSM_TSK_ENTER(tskid);
+	CHECK_TSKCTX_UNL();
+	CHECK_ID(VALID_TSKID(tskid));
+	p_tcb = get_tcb(tskid);
+
+	lock_cpu();
+	if (!TSTAT_SUSPENDED(p_tcb->tstat)) {
+		ercd = E_OBJ;
+	}
+	else if (!TSTAT_WAITING(p_tcb->tstat)) {
+		/*
+		 *  å¼·å¶å¾
+ã¡ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+		 */
+		p_tcb->tstat = TS_RUNNABLE;
+		LOG_TSKSTAT(p_tcb);
+		make_runnable(p_tcb);
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		/*
+		 *  äºéå¾
+ã¡ç¶æ
+ããå¾
+ã¡ç¶æ
+ã¸ã®é·ç§»
+		 */
+		p_tcb->tstat &= ~TS_SUSPENDED;
+		LOG_TSKSTAT(p_tcb);
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_RSM_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_rsm_tsk */
+
+/*
+ *  èªã¿ã¹ã¯ã®é
+å»¶
+ */
+#ifdef TOPPERS_dly_tsk
+
+ER
+dly_tsk(RELTIM dlytim)
+{
+	WINFO	winfo;
+	TMEVTB	tmevtb;
+	ER		ercd;
+
+	LOG_DLY_TSK_ENTER(dlytim);
+	CHECK_DISPATCH();
+	CHECK_PAR(VALID_RELTIM(dlytim));
+
+	lock_cpu_dsp();
+	if (p_runtsk->raster) {
+		ercd = E_RASTER;
+	}
+	else {
+		p_runtsk->tstat = TS_WAITING_DLY;
+		make_non_runnable(p_runtsk);
+		p_runtsk->p_winfo = &winfo;
+		winfo.p_tmevtb = &tmevtb;
+		tmevtb.callback = (CBACK) wait_tmout_ok;
+		tmevtb.arg = (void *) p_runtsk;
+		tmevtb_enqueue(&tmevtb, dlytim);
+		LOG_TSKSTAT(p_runtsk);
+		dispatch();
+		ercd = winfo.wercd;
+	}
+	unlock_cpu_dsp();
+
+  error_exit:
+	LOG_DLY_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_dly_tsk */
Index: asp3_wo_tecs/trunk/kernel/task_term.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/task_term.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/task_term.c	(revision 302)
@@ -0,0 +1,353 @@
+/*
+ *  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: task_term.c 275 2014-11-03 14:26:05Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¹ã¯çµäºæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "task.h"
+#include "wait.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_EXT_TSK_ENTER
+#define LOG_EXT_TSK_ENTER()
+#endif /* LOG_EXT_TSK_ENTER */
+
+#ifndef LOG_EXT_TSK_LEAVE
+#define LOG_EXT_TSK_LEAVE(ercd)
+#endif /* LOG_EXT_TSK_LEAVE */
+
+#ifndef LOG_RAS_TER_ENTER
+#define LOG_RAS_TER_ENTER(tskid)
+#endif /* LOG_RAS_TER_ENTER */
+
+#ifndef LOG_RAS_TER_LEAVE
+#define LOG_RAS_TER_LEAVE(ercd)
+#endif /* LOG_RAS_TER_LEAVE */
+
+#ifndef LOG_DIS_TER_ENTER
+#define LOG_DIS_TER_ENTER()
+#endif /* LOG_DIS_TER_ENTER */
+
+#ifndef LOG_DIS_TER_LEAVE
+#define LOG_DIS_TER_LEAVE(ercd)
+#endif /* LOG_DIS_TER_LEAVE */
+
+#ifndef LOG_ENA_TER_ENTER
+#define LOG_ENA_TER_ENTER()
+#endif /* LOG_ENA_TER_ENTER */
+
+#ifndef LOG_ENA_TER_LEAVE
+#define LOG_ENA_TER_LEAVE(ercd)
+#endif /* LOG_ENA_TER_LEAVE */
+
+#ifndef LOG_SNS_TER_ENTER
+#define LOG_SNS_TER_ENTER()
+#endif /* LOG_SNS_TER_ENTER */
+
+#ifndef LOG_SNS_TER_LEAVE
+#define LOG_SNS_TER_LEAVE(state)
+#endif /* LOG_SNS_TER_LEAVE */
+
+#ifndef LOG_TER_TSK_ENTER
+#define LOG_TER_TSK_ENTER(tskid)
+#endif /* LOG_TER_TSK_ENTER */
+
+#ifndef LOG_TER_TSK_LEAVE
+#define LOG_TER_TSK_LEAVE(ercd)
+#endif /* LOG_TER_TSK_LEAVE */
+
+/*
+ *  èªã¿ã¹ã¯ã®çµäºï¼»NGKI1162ï¼½
+ */
+#ifdef TOPPERS_ext_tsk
+
+ER
+ext_tsk(void)
+{
+	PRI		intpri;
+	ER		ercd;
+
+	LOG_EXT_TSK_ENTER();
+	CHECK_TSKCTX();							/*ï¼»NGKI1164ï¼½*/
+
+	if (sense_lock()) {
+		/*
+		 *  CPUã­ãã¯ç¶æ
+ã§ext_tskãå¼ã°ããå ´åã¯ï¼CPUã­ãã¯ãè§£é¤ã
+		 *  ã¦ããã¿ã¹ã¯ãçµäºããï¼å®è£
+ä¸ã¯ï¼ãµã¼ãã¹ã³ã¼ã«å
+ã§ã®CPU
+		 *  ã­ãã¯ãçç¥ããã°ããã ãï¼ï¼»NGKI1168ï¼½
+		 */
+	}
+	else {
+		lock_cpu();
+	}
+
+	intpri = t_get_ipm();
+	if (!enadsp || intpri != TIPM_ENAALL) {
+		if (!enadsp) {
+			/*
+			 *  ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§ext_tskãå¼ã°ããå ´åã¯ï¼ãã£ã¹ãã
+			 *  ãè¨±å¯ç¶æ
+ã«ãã¦ããã¿ã¹ã¯ãçµäºããï¼ï¼»NGKI1168ï¼½
+			 */
+			enadsp = true;
+		}
+		if (intpri != TIPM_ENAALL) {
+			/*
+			 *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼IPMï¼ãTIPM_ENAALLä»¥å¤ã®ç¶æ
+ã§
+			 *  ext_tskãå¼ã°ããå ´åã¯ï¼IPMãTIPM_ENAALLã«ãã¦ããã¿ã¹
+			 *  ã¯ãçµäºããï¼ï¼»NGKI1168ï¼½
+			 */
+			t_set_ipm(TIPM_ENAALL);
+		}
+		dspflg = true;
+		p_schedtsk = search_schedtsk();
+	}
+
+	task_terminate(p_runtsk);				/* ï¼»NGKI3449ï¼½*/
+	exit_and_dispatch();					/* ï¼»NGKI1169ï¼½*/
+	ercd = E_SYS;							/* ï¼»NGKI1163ï¼½*/
+
+  error_exit:
+	LOG_EXT_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ext_tsk */
+
+/*
+ *  ã¿ã¹ã¯ã®çµäºè¦æ±ï¼»NGKI3469ï¼½
+ */
+#ifdef TOPPERS_ras_ter
+
+ER
+ras_ter(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_RAS_TER_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3470ï¼½ï¼»NGKI3471ï¼½*/
+	CHECK_ID(VALID_TSKID(tskid));				/*ï¼»NGKI3472ï¼½*/
+	p_tcb = get_tcb(tskid);
+	CHECK_ILUSE(p_tcb != p_runtsk);				/*ï¼»NGKI3475ï¼½*/
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI3476ï¼½*/
+	}
+	else if (p_tcb->enater) {
+		task_terminate(p_tcb);					/*ï¼»NGKI3477ï¼½*/
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	else {
+		p_tcb->raster = true;					/*ï¼»NGKI3478ï¼½*/
+		if (!TSTAT_RUNNABLE(p_tcb->tstat)) {
+			if (TSTAT_WAITING(p_tcb->tstat)) {
+				wait_dequeue_wobj(p_tcb);		/*ï¼»NGKI3479ï¼½*/
+				wait_dequeue_tmevtb(p_tcb);
+				p_tcb->p_winfo->wercd = E_RASTER;	/*ï¼»NGKI3480ï¼½*/
+			}
+			p_tcb->tstat = TS_RUNNABLE;			/*ï¼»NGKI3606ï¼½*/
+			LOG_TSKSTAT(p_tcb);
+			make_runnable(p_tcb);
+			if (p_runtsk != p_schedtsk) {
+				dispatch();
+			}
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_RAS_TER_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ras_ter */
+
+/*
+ *  ã¿ã¹ã¯çµäºã®ç¦æ­¢ï¼»NGKI3482ï¼½
+ */
+#ifdef TOPPERS_dis_ter
+
+ER
+dis_ter(void)
+{
+	ER		ercd;
+
+	LOG_DIS_TER_ENTER();
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3483ï¼½ï¼»NGKI3484ï¼½*/
+
+	lock_cpu();
+	p_runtsk->enater = false;					/*ï¼»NGKI3486ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_DIS_TER_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_dis_ter */
+
+/*
+ *  ã¿ã¹ã¯çµäºã®è¨±å¯ï¼»NGKI3487ï¼½
+ */
+#ifdef TOPPERS_ena_ter
+
+ER
+ena_ter(void)
+{
+	ER		ercd;
+
+	LOG_ENA_TER_ENTER();
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3488ï¼½ï¼»NGKI3489ï¼½*/
+
+	lock_cpu();
+	if (p_runtsk->raster && dspflg) {
+		task_terminate(p_runtsk);
+		exit_and_dispatch();
+		ercd = E_SYS;
+	}
+	else {
+		p_runtsk->enater = true;				/*ï¼»NGKI3491ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ENA_TER_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ena_ter */
+
+/*
+ *  ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã®åç
+§ï¼»NGKI3494ï¼½
+ */
+#ifdef TOPPERS_sns_ter
+
+bool_t
+sns_ter(void)
+{
+	bool_t	state;
+
+	LOG_SNS_TER_ENTER();
+	/*
+	 *  enaterãå¤æ´ã§ããã®ã¯èªã¿ã¹ã¯ã®ã¿ã§ããããï¼æä»å¶å¾¡ããã«èª­
+	 *  ãã§ãåé¡ãªãï¼
+	 */
+	state = (p_runtsk != NULL && p_runtsk->enater) ? false : true;
+												/*ï¼»NGKI3495ï¼½ï¼»NGKI3496ï¼½*/
+	LOG_SNS_TER_LEAVE(state);
+	return(state);
+}
+
+#endif /* TOPPERS_sns_ter */
+
+/*
+ *  ã¿ã¹ã¯ã®å¼·å¶çµäºï¼»NGKI1170ï¼½
+ */
+#ifdef TOPPERS_ter_tsk
+
+ER
+ter_tsk(ID tskid)
+{
+	TCB		*p_tcb;
+	ER		ercd;
+
+	LOG_TER_TSK_ENTER(tskid);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI1171ï¼½ï¼»NGKI1172ï¼½*/
+	CHECK_ID(VALID_TSKID(tskid));				/*ï¼»NGKI1173ï¼½*/
+	p_tcb = get_tcb(tskid);
+	CHECK_ILUSE(p_tcb != p_runtsk);				/*ï¼»NGKI1176ï¼½*/
+
+	lock_cpu();
+	if (TSTAT_DORMANT(p_tcb->tstat)) {
+		ercd = E_OBJ;							/*ï¼»NGKI1177ï¼½*/
+	}
+	else {
+		task_terminate(p_tcb);					/*ï¼»NGKI3450ï¼½*/
+		if (p_runtsk != p_schedtsk) {
+			dispatch();
+		}
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_TER_TSK_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_ter_tsk */
Index: asp3_wo_tecs/trunk/kernel/taskhook.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/taskhook.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/taskhook.c	(revision 302)
@@ -0,0 +1,73 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: taskhook.c 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã«é¢é£ããããã¯ã«ã¼ãã³
+ */
+
+#include "kernel_impl.h"
+#include "task.h"
+#include "taskhook.h"
+
+/*
+ *  ãã¥ã¼ããã¯ã¹æ©è½ã®ããã®ããã¯ã«ã¼ãã³
+ */
+#ifdef TOPPERS_mtxhook
+
+bool_t	(*mtxhook_check_ceilpri)(TCB *p_tcb, uint_t bpriority) = NULL;
+bool_t	(*mtxhook_scan_ceilmtx)(TCB *p_tcb) = NULL;
+void	(*mtxhook_release_all)(TCB *p_tcb) = NULL;
+
+#endif /* TOPPERS_mtxhook */
Index: asp3_wo_tecs/trunk/kernel/taskhook.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/taskhook.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/taskhook.h	(revision 302)
@@ -0,0 +1,73 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: taskhook.h 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *  ã¿ã¹ã¯ç®¡çã«é¢é£ããããã¯ã«ã¼ãã³
+ */
+
+#ifndef TOPPERS_TASKHOOK_H
+#define TOPPERS_TASKHOOK_H
+
+#include "kernel_impl.h"
+#include "task.h"
+
+/*
+ *  ãã¥ã¼ããã¯ã¹æ©è½ã®ããã®ããã¯ã«ã¼ãã³
+ */
+extern bool_t	(*mtxhook_check_ceilpri)(TCB *p_tcb, uint_t bpriority);
+extern bool_t	(*mtxhook_scan_ceilmtx)(TCB *p_tcb);
+extern void		(*mtxhook_release_all)(TCB *p_tcb);
+
+#endif /* TOPPERS_TASKHOOK_H */
Index: asp3_wo_tecs/trunk/kernel/time_event.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/time_event.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/time_event.c	(revision 302)
@@ -0,0 +1,659 @@
+/*
+ *  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: time_event.c 451 2015-08-14 15:29:07Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#include "kernel_impl.h"
+#include "time_event.h"
+
+/*
+ *  TSTEP_HRTCNTã®ç¯å²ãã§ãã¯
+ */
+#if TSTEP_HRTCNT > 4000U
+#error TSTEP_HRTCNT is too large.
+#endif /* TSTEP_HRTCNT > 4000U */
+
+/*
+ *  HRTCNT_BOUNDã®ç¯å²ãã§ãã¯
+ */
+#if HRTCNT_BOUND >= 4294000000U
+#error HRTCNT_BOUND is too large.
+#endif /* HRTCNT_BOUND >= 4294000000U */
+
+#ifdef TCYC_HRTCNT
+#if HRTCNT_BOUND >= TCYC_HRTCNT
+#error HRTCNT_BOUND is too large.
+#endif /* HRTCNT_BOUND >= TCYC_HRTCNT */
+#endif /* TCYC_HRTCNT */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãæä½ãã¯ã­
+ *
+ *  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 p_top_tmevtn	(&(tmevt_heap[1]))
+#define top_evttim		(tmevt_heap[1].p_tmevtb->evttim)
+										/* å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã®çºçæå» */
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãä¸­ã®æå¾ã®ãã¼ã
+ */
+#define p_last_tmevtn	(tmevt_heap[0].p_last)
+
+/*
+ *  ã¤ãã³ãæå»ã®åå¾é¢ä¿ã®å¤å®ï¼»ASPD1009ï¼½
+ *
+ *  ã¤ãã³ãæå»ã¯ï¼boundary_evttimããã®ç¸å¯¾å¤ã§æ¯è¼ããï¼ããªãã¡ï¼
+ *  boundary_evttimãæãæ©ãæå»ï¼boundary_evttimâ1ãæãé
+ãæå»ã¨ã¿
+ *  ãªãã¦æ¯è¼ããï¼
+ */
+#define EVTTIM_ADVANCE(t)	((t) - boundary_evttim)
+#define EVTTIM_LT(t1, t2)	(EVTTIM_ADVANCE(t1) < EVTTIM_ADVANCE(t2))
+#define EVTTIM_LE(t1, t2)	(EVTTIM_ADVANCE(t1) <= EVTTIM_ADVANCE(t2))
+
+#ifdef TOPPERS_tmeini
+
+/*
+ *  å¢çã¤ãã³ãæå»ï¼»ASPD1008ï¼½
+ */
+EVTTIM	boundary_evttim;
+
+/*
+ *  æå¾ã«ç¾å¨æå»ãç®åºããæç¹ã§ã®ã¤ãã³ãæå»ï¼»ASPD1012ï¼½
+ */
+EVTTIM	current_evttim;
+
+/*
+ *  æå¾ã«ç¾å¨æå»ãç®åºããæç¹ã§ã®é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ï¼»ASPD1012ï¼½
+ */
+HRTCNT	current_hrtcnt;
+
+/*
+ *  æãé²ãã§ããæã®ã¤ãã³ãæå»ï¼»ASPD1041ï¼½
+ */
+EVTTIM	monotonic_evttim;
+
+/*
+ *  ã·ã¹ãã æå»ã®ãªãã»ããï¼»ASPD1043ï¼½
+ */
+SYSTIM	systim_offset;
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦çä¸­ã§ãããã¨ãç¤ºããã©ã°ï¼»ASPD1032ï¼½
+ */
+bool_t	in_signal_time;
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«ã®åæåï¼»ASPD1061ï¼½
+ */
+void
+initialize_tmevt(void)
+{
+	current_evttim = 0U;							/*ï¼»ASPD1047ï¼½*/
+	boundary_evttim = current_evttim - BOUNDARY_MARGIN;
+													/*ï¼»ASPD1048ï¼½*/
+	monotonic_evttim = 0U;							/*ï¼»ASPD1046ï¼½*/
+	systim_offset = 0U;								/*ï¼»ASPD1044ï¼½*/
+	in_signal_time = false;							/*ï¼»ASPD1033ï¼½*/
+	p_last_tmevtn = tmevt_heap;
+}
+
+#endif /* TOPPERS_tmeini */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãã®æ¿å
+¥ä½ç½®ãä¸åãã«æ¢ç´¢
+ *
+ *  æå»evttimã«çºçããã¿ã¤ã ã¤ãã³ããæ¿å
+¥ãããã¼ããç©ºããããã«ï¼
+ *  ãã¼ãã®ä¸ã«åãã£ã¦ç©ºãã¼ããç§»åãããï¼ç§»ååã®ç©ºãã¼ãã®ä½ç½®ã
+ *  p_tmevtnã«æ¸¡ãã¨ï¼ç§»åå¾ã®ç©ºãã¼ãã®ä½ç½®ï¼ããªãã¡æ¿å
+¥ä½ç½®ï¼ãè¿ãï¼
+ */
+#ifdef TOPPERS_tmeup
+
+TMEVTN *
+tmevt_up(TMEVTN *p_tmevtn, EVTTIM evttim)
+{
+	TMEVTN	*p_parent;
+
+	while (p_tmevtn > p_top_tmevtn) {
+		/*
+		 *  è¦ªãã¼ãã®ã¤ãã³ãçºçæå»ã®æ¹ãæ©ãï¼ã¾ãã¯åãï¼ãªãã°ï¼
+		 *  p_tmevtnãæ¿å
+¥ä½ç½®ãªã®ã§ã«ã¼ããæããï¼
+		 */
+		p_parent = PARENT(p_tmevtn);
+		if (EVTTIM_LE(p_parent->p_tmevtb->evttim, evttim)) {
+			break;
+		}
+
+		/*
+		 *  è¦ªãã¼ããp_tmevtnã®ä½ç½®ã«ç§»åãããï¼
+		 */
+		*p_tmevtn = *p_parent;
+		p_tmevtn->p_tmevtb->p_tmevtn = p_tmevtn;
+
+		/*
+		 *  p_tmevtnãè¦ªãã¼ãã®ä½ç½®ã«æ´æ°ï¼
+		 */
+		p_tmevtn = p_parent;
+	}
+	return(p_tmevtn);
+}
+
+#endif /* TOPPERS_tmeup */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãã®æ¿å
+¥ä½ç½®ãä¸åãã«æ¢ç´¢
+ *
+ *  æå»evttimã«çºçããã¿ã¤ã ã¤ãã³ããæ¿å
+¥ãããã¼ããç©ºããããã«ï¼
+ *  ãã¼ãã®ä¸ã«åãã£ã¦ç©ºãã¼ããç§»åãããï¼ç§»ååã®ç©ºãã¼ãã®ä½ç½®ã
+ *  p_tmevtnã«æ¸¡ãã¨ï¼ç§»åå¾ã®ç©ºãã¼ãã®ä½ç½®ï¼ããªãã¡æ¿å
+¥ä½ç½®ï¼ãè¿ãï¼
+ */
+#ifdef TOPPERS_tmedown
+
+TMEVTN *
+tmevt_down(TMEVTN *p_tmevtn, EVTTIM evttim)
+{
+	TMEVTN	*p_child;
+
+	while ((p_child = LCHILD(p_tmevtn)) <= p_last_tmevtn) {
+		/*
+		 *  å·¦å³ã®å­ãã¼ãã®ã¤ãã³ãçºçæå»ãæ¯è¼ãï¼æ©ãæ¹ã®å­ãã¼ã
+		 *  ã®ä½ç½®ãp_childã«è¨­å®ããï¼ä»¥ä¸ã®å­ãã¼ãã¯ï¼ããã§é¸ã°ãã
+		 *  æ¹ã®å­ãã¼ãã®ãã¨ï¼
+		 */
+		if (p_child + 1 <= p_last_tmevtn
+					&& EVTTIM_LT((p_child + 1)->p_tmevtb->evttim,
+											p_child->p_tmevtb->evttim)) {
+			p_child = p_child + 1;
+		}
+
+		/*
+		 *  å­ãã¼ãã®ã¤ãã³ãçºçæå»ã®æ¹ãé
+ãï¼ã¾ãã¯åãï¼ãªãã°ï¼
+		 *  p_tmevtnãæ¿å
+¥ä½ç½®ãªã®ã§ã«ã¼ããæããï¼
+		 */
+		if (EVTTIM_LE(evttim, p_child->p_tmevtb->evttim)) {
+			break;
+		}
+
+		/*
+		 *  å­ãã¼ããp_tmevtnã®ä½ç½®ã«ç§»åãããï¼
+		 */
+		*p_tmevtn = *p_child;
+		p_tmevtn->p_tmevtb->p_tmevtn = p_tmevtn;
+
+		/*
+		 *  p_tmevtnãå­ãã¼ãã®ä½ç½®ã«æ´æ°ï¼
+		 */
+		p_tmevtn = p_child;
+	}
+	return(p_tmevtn);
+}
+
+#endif /* TOPPERS_tmedown */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãã¸ã®è¿½å 
+ *
+ *  p_tmevtbã§æå®ããã¿ã¤ã ã¤ãã³ããã­ãã¯ãï¼ã¿ã¤ã ã¤ãã³ããã¼ãã«
+ *  è¿½å ããï¼
+ */
+Inline void
+tmevtb_insert(TMEVTB *p_tmevtb)
+{
+	TMEVTN	*p_tmevtn;
+
+	/*
+	 *  p_last_tmevtnãã¤ã³ã¯ãªã¡ã³ããï¼ããããä¸ã«æ¿å
+¥ä½ç½®ãæ¢ãï¼
+	 */
+	p_tmevtn = tmevt_up(++p_last_tmevtn, p_tmevtb->evttim);
+
+	/*
+	 *  ã¿ã¤ã ã¤ãã³ããp_tmevtnã®ä½ç½®ã«æ¿å
+¥ããï¼
+	 */ 
+	p_tmevtn->p_tmevtb = p_tmevtb;
+	p_tmevtb->p_tmevtn = p_tmevtn;
+}
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãããã®åé¤
+ */
+Inline void
+tmevtb_delete(TMEVTB *p_tmevtb)
+{
+	TMEVTN	*p_tmevtn = p_tmevtb->p_tmevtn;
+	TMEVTN	*p_parent;
+	EVTTIM	event_evttim;
+
+	/*
+	 *  åé¤ã«ããã¿ã¤ã ã¤ãã³ããã¼ããç©ºã«ãªãå ´åã¯ä½ãããªãï¼
+	 */
+	if (--p_last_tmevtn < p_top_tmevtn) {
+		return;
+	}
+
+	/*
+	 *  åé¤ãããã¼ãã®ä½ç½®ã«æå¾ã®ãã¼ãï¼p_last_tmevtn + 1 ã®ä½ç½®ã®
+	 *  ãã¼ãï¼ãæ¿å
+¥ãï¼ãããé©åãªä½ç½®ã¸ç§»åãããï¼å®éã«ã¯ï¼æå¾
+	 *  ã®ãã¼ããå®éã«æ¿å
+¥ããã®ã§ã¯ãªãï¼åé¤ãããã¼ãã®ä½ç½®ãç©ºãã¼
+	 *  ãã«ãªãã®ã§ï¼æå¾ã®ãã¼ããæ¿å
+¥ãã¹ãä½ç½®ã¸åãã¦ç©ºãã¼ããç§»
+	 *  åãããï¼
+	 *
+	 *  æå¾ã®ãã¼ãã®ã¤ãã³ãçºçæå»ãï¼åé¤ãããã¼ãã®è¦ªãã¼ãã®ã¤
+	 *  ãã³ãçºçæå»ããåã®å ´åã«ã¯ï¼ä¸ã«åãã£ã¦æ¿å
+¥ä½ç½®ãæ¢ãï¼ã
+	 *  ãã§ãªãå ´åã«ã¯ï¼ä¸ã«åãã£ã¦æ¢ãï¼
+	 */
+	event_evttim = (p_last_tmevtn + 1)->p_tmevtb->evttim;
+	if (p_tmevtn > p_top_tmevtn
+			&& EVTTIM_LT(event_evttim,
+						(p_parent = PARENT(p_tmevtn))->p_tmevtb->evttim)) {
+		/*
+		 *  è¦ªãã¼ããp_tmevtnã®ä½ç½®ã«ç§»åãããï¼
+		 */
+		*p_tmevtn = *p_parent;
+		p_tmevtn->p_tmevtb->p_tmevtn = p_tmevtn;
+
+		/*
+		 *  åé¤ãããã¼ãã®è¦ªãã¼ãããä¸ã«åãã£ã¦æ¿å
+¥ä½ç½®ãæ¢ãï¼
+		 */
+		p_tmevtn = tmevt_up(p_parent, event_evttim);
+	}
+	else {
+		/*
+		 *  åé¤ãããã¼ãããä¸ã«åãã£ã¦æ¿å
+¥ä½ç½®ãæ¢ãï¼
+		 */
+		p_tmevtn = tmevt_down(p_tmevtn, event_evttim);
+	}
+
+	/*
+	 *  æå¾ã®ãã¼ããp_tmevtnã®ä½ç½®ã«æ¿å
+¥ããï¼
+	 */ 
+	*p_tmevtn = *(p_last_tmevtn + 1);
+	p_tmevtn->p_tmevtb->p_tmevtn = p_tmevtn;
+}
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãã®å
+é ­ã®ãã¼ãã®åé¤
+ */
+Inline TMEVTB *
+tmevtb_delete_top(void)
+{
+	TMEVTN	*p_tmevtn;
+	TMEVTB	*p_top_tmevtb = p_top_tmevtn->p_tmevtb;
+	EVTTIM	event_evttim;
+
+	/*
+	 *  åé¤ã«ããã¿ã¤ã ã¤ãã³ããã¼ããç©ºã«ãªãå ´åã¯ä½ãããªãï¼
+	 */
+	if (--p_last_tmevtn >= p_top_tmevtn) {
+		/*
+		 *  ã«ã¼ããã¼ãã«æå¾ã®ãã¼ãï¼p_last_tmevtn + 1 ã®ä½ç½®ã®ãã¼
+		 *  ãï¼ãæ¿å
+¥ãï¼ãããé©åãªä½ç½®ã¸ç§»åãããï¼å®éã«ã¯ï¼æå¾
+		 *  ã®ãã¼ããå®éã«æ¿å
+¥ããã®ã§ã¯ãªãï¼ã«ã¼ããã¼ããç©ºãã¼ã
+		 *  ã«ãªãã®ã§ï¼æå¾ã®ãã¼ããæ¿å
+¥ãã¹ãä½ç½®ã¸åãã¦ç©ºãã¼ãã
+		 *  ç§»åãããï¼
+		 */
+		event_evttim = (p_last_tmevtn + 1)->p_tmevtb->evttim;
+		p_tmevtn = tmevt_down(p_top_tmevtn, event_evttim);
+
+		/*
+		 *  æå¾ã®ãã¼ããp_tmevtnã®ä½ç½®ã«æ¿å
+¥ããï¼
+		 */ 
+		*p_tmevtn = *(p_last_tmevtn + 1);
+		p_tmevtn->p_tmevtb->p_tmevtn = p_tmevtn;
+	}
+	return(p_top_tmevtb);
+}
+
+/*
+ *  ç¾å¨ã®ã¤ãã³ãæå»ã®æ´æ°
+ */
+#ifdef TOPPERS_tmecur
+
+void
+update_current_evttim(void)
+{
+	HRTCNT	new_hrtcnt, hrtcnt_advance;
+	EVTTIM	previous_evttim;
+
+	new_hrtcnt = target_hrt_get_current();			/*ï¼»ASPD1013ï¼½*/
+	hrtcnt_advance = new_hrtcnt - current_hrtcnt;	/*ï¼»ASPD1014ï¼½*/
+#ifdef TCYC_HRTCNT
+	if (new_hrtcnt < current_hrtcnt) {
+		hrtcnt_advance += TCYC_HRTCNT;
+	}
+#endif /* TCYC_HRTCNT */
+
+	previous_evttim = current_evttim;
+	current_evttim += (EVTTIM) hrtcnt_advance;		/*ï¼»ASPD1015ï¼½*/
+	current_hrtcnt = new_hrtcnt;					/*ï¼»ASPD1016ï¼½*/
+	boundary_evttim = current_evttim - BOUNDARY_MARGIN;	/*ï¼»ASPD1011ï¼½*/
+
+	if (monotonic_evttim - previous_evttim < (EVTTIM) hrtcnt_advance) {
+#ifdef UINT64_MAX
+		if (current_evttim < monotonic_evttim) {
+			systim_offset += 1LLU << 32;			/*ï¼»ASPD1045ï¼½*/
+		}
+#endif /* UINT64_MAX */
+		monotonic_evttim = current_evttim;			/*ï¼»ASPD1042ï¼½*/
+	}
+}
+
+#endif /* TOPPERS_tmecur */
+
+/*
+ *  ç¾å¨ã®ã¤ãã³ãæå»ãé
+ãæ¹ã«ä¸¸ããã¤ãã³ãæå»ã®ç®åºï¼»ASPD1027ï¼½
+ *
+ *  ç¾å¨ã®ã¤ãã³ãæå»ãæ´æ°ããå¾ã«å¼ã¶ãã¨ãæ³å®ãã¦ããï¼
+ */
+Inline EVTTIM
+calc_current_evttim_ub(void)
+{
+	return(current_evttim + ((EVTTIM) TSTEP_HRTCNT));
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ã®è¨­å®
+ */
+#ifdef TOPPERS_tmeset
+
+void
+set_hrt_event(void)
+{
+	HRTCNT	hrtcnt;
+
+	if (p_last_tmevtn < p_top_tmevtn) {
+		target_hrt_set_event(HRTCNT_BOUND);			/*ï¼»ASPD1007ï¼½*/
+	}
+	else if (EVTTIM_LE(top_evttim, current_evttim)) {
+		target_hrt_raise_event();					/*ï¼»ASPD1017ï¼½*/
+	}
+	else {
+		hrtcnt = (HRTCNT)(top_evttim - current_evttim);
+		if (hrtcnt > HRTCNT_BOUND) {
+			target_hrt_set_event(HRTCNT_BOUND);		/*ï¼»ASPD1006ï¼½*/
+		}
+		else {
+			target_hrt_set_event(hrtcnt);			/*ï¼»ASPD1002ï¼½*/
+		}
+	}
+}
+
+#endif /* TOPPERS_tmeset */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã­ãã¯ã®ãã¼ãã¸ã®æ¿å
+¥
+ */
+#ifdef TOPPERS_tmereg
+
+void
+tmevtb_register(TMEVTB *p_tmevtb)
+{
+	tmevtb_insert(p_tmevtb);
+}
+
+#endif /* TOPPERS_tmereg */
+
+/*
+ *  ç¸å¯¾æéæå®ã«ããã¿ã¤ã ã¤ãã³ãã®ç»é²
+ *  
+ */
+#ifdef TOPPERS_tmeenq
+
+void
+tmevtb_enqueue(TMEVTB *p_tmevtb, RELTIM time)
+{
+	/*
+	 *  ç¾å¨ã®ã¤ãã³ãæå»ã¨ã¿ã¤ã ã¤ãã³ãã®çºçæå»ãæ±ããï¼»ASPD1026ï¼½ï¼
+	 */
+	update_current_evttim();
+	p_tmevtb->evttim = calc_current_evttim_ub() + time;
+
+	/*
+	 *  ã¿ã¤ã ã¤ãã³ããã­ãã¯ããã¼ãã«æ¿å
+¥ããï¼»ASPD1030ï¼½ï¼
+	 */
+	tmevtb_insert(p_tmevtb);
+
+	/*
+	 *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ãè¨­å®ããï¼»ASPD1031ï¼½
+	 *  ï¼»ASPD1034ï¼½ï¼
+	 */
+	if (!in_signal_time && p_tmevtb->p_tmevtn == p_top_tmevtn) {
+		set_hrt_event();
+	}
+}
+
+#endif /* TOPPERS_tmeenq */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãã®ç»é²è§£é¤
+ */
+#ifdef TOPPERS_tmedeq
+
+void
+tmevtb_dequeue(TMEVTB *p_tmevtb)
+{
+	TMEVTN	*p_tmevtn;
+
+	/*
+	 *  ã¿ã¤ã ã¤ãã³ããã­ãã¯ããã¼ãããåé¤ããï¼»ASPD1039ï¼½ï¼
+	 */
+	p_tmevtn = p_tmevtb->p_tmevtn;
+	tmevtb_delete(p_tmevtb);
+
+	/*
+	 *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ãè¨­å®ããï¼»ASPD1040ï¼½ï¼
+	 */
+	if (!in_signal_time && p_tmevtn == p_top_tmevtn) {
+		update_current_evttim();
+		set_hrt_event();
+	}
+}
+
+#endif /* TOPPERS_tmedeq */
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´æã®ã¨ã©ã¼ãã§ãã¯
+ */
+#ifdef TOPPERS_tmechk
+
+bool_t
+check_adjtim(int_t adjtim)
+{
+	if (adjtim > 0) {
+		return(p_last_tmevtn >= p_top_tmevtn	/*ï¼»NGKI3588ï¼½*/
+					&& EVTTIM_LE(top_evttim, current_evttim - TMAX_ADJTIM));
+	}
+	else if (adjtim < 0) {						/*ï¼»NGKI3589ï¼½*/
+		return(monotonic_evttim - current_evttim >= -TMIN_ADJTIM);
+	}
+	return(false);
+}
+
+#endif /* TOPPERS_tmechk */
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããçºçããã¾ã§ã®æéã®è¨ç®
+ */
+#ifdef TOPPERS_tmeltim
+
+RELTIM
+tmevt_lefttim(TMEVTB *p_tmevtb)
+{
+	EVTTIM	evttim, current_evttim_ub;
+
+	/*
+	 *  ç¾å¨ã®ã¤ãã³ãæå»ãé
+ãæ¹ã«ä¸¸ããæå»ãæ±ããï¼»ASPD1050ï¼½ï¼
+	 */
+	update_current_evttim();
+	current_evttim_ub = calc_current_evttim_ub();
+
+	/*
+	 *  ã¿ã¤ã ã¤ãã³ãçºçã¾ã§ã®ç¸å¯¾æéãæ±ããï¼»ASPD1049ï¼½ï¼
+	 */
+	evttim = p_tmevtb->evttim;
+	if (EVTTIM_LE(evttim, current_evttim_ub)) {
+		/*
+		 *  ã¿ã¤ã ã¤ãã³ãã®çºçæå»ãéãã¦ããå ´åã«ã¯0ãè¿ãï¼»NGKI0552ï¼½ï¼
+		 */
+		return(0U);
+	}
+	else {
+		return((RELTIM)(evttim - current_evttim_ub));
+	}
+}
+
+#endif /* TOPPERS_tmeltim */
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦ç
+ */
+#ifdef TOPPERS_sigtim
+
+void
+signal_time(void)
+{
+	TMEVTB	*p_tmevtb;
+	bool_t	callflag;
+
+	assert(sense_context());
+	assert(!sense_lock());
+
+	lock_cpu();
+	in_signal_time = true;							/*ï¼»ASPD1033ï¼½*/
+
+	do {
+		/*
+		 *  ã³ã¼ã«ããã¯é¢æ°ãå¼ã³åºããªããã°ã«ã¼ããæããï¼»ASPD1020ï¼½ï¼
+		 */
+		callflag = false;
+
+		/*
+		 *  ç¾å¨ã®ã¤ãã³ãæå»ãæ±ããï¼»ASPD1022ï¼½ï¼
+		 */
+		update_current_evttim();
+
+		/*
+		 *  çºçæå»ãcurrent_evttimä»¥åã®ã¿ã¤ã ã¤ãã³ããããã°ï¼ã¿ã¤
+		 *  ã ã¤ãã³ããã¼ãããåé¤ãï¼ã³ã¼ã«ããã¯é¢æ°ãå¼ã³åºã
+		 *  ï¼»ASPD1018ï¼½ï¼»ASPD1019ï¼½ï¼
+		 */
+		while (p_last_tmevtn >= p_top_tmevtn
+							&& EVTTIM_LE(top_evttim, current_evttim)) {
+			p_tmevtb = tmevtb_delete_top();
+			(*(p_tmevtb->callback))(p_tmevtb->arg);
+			callflag = true;
+		}
+	} while (callflag);								/*ï¼»ASPD1020ï¼½*/
+
+	/*
+	 *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ãè¨­å®ããï¼»ASPD1025ï¼½ï¼
+	 */
+	set_hrt_event();
+
+	in_signal_time = false;							/*ï¼»ASPD1033ï¼½*/
+	unlock_cpu();
+}
+
+#endif /* TOPPERS_sigtim */
Index: asp3_wo_tecs/trunk/kernel/time_event.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/time_event.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/time_event.h	(revision 302)
@@ -0,0 +1,220 @@
+/*
+ *  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: time_event.h 451 2015-08-14 15:29:07Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_TIME_EVENT_H
+#define TOPPERS_TIME_EVENT_H
+
+#include "kernel_impl.h"
+#include "target_timer.h"
+
+/*
+ *  ã¤ãã³ãæå»ã®ãã¼ã¿åã®å®ç¾©ï¼»ASPD1001ï¼½
+ *
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãã«ç»é²ããã¿ã¤ã ã¤ãã³ãã®çºçæå»ãè¡¨ç¾ããã
+ *  ãã®ãã¼ã¿åï¼ãªã¼ããããä½æ¸ã®ããã«ï¼32ãããã§æ±ãï¼
+ */
+typedef uint32_t	EVTTIM;
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãä¸­ã®ãã¼ãã®ãã¼ã¿åã®åæ¹åç
+§
+ */
+typedef union time_event_node TMEVTN;
+
+/* 
+ *  ã¿ã¤ã ã¤ãã³ããã­ãã¯ã®ãã¼ã¿åã®å®ç¾©
+ */
+typedef void	(*CBACK)(void *);	/* ã³ã¼ã«ããã¯é¢æ°ã®å */
+
+typedef struct time_event_block {
+	EVTTIM	evttim;			/* ã¿ã¤ã ã¤ãã³ãã®çºçæå» */
+	TMEVTN	*p_tmevtn;		/* ã¿ã¤ã ã¤ãã³ããã¼ãä¸­ã§ã®ä½ç½® */
+	CBACK	callback;		/* ã³ã¼ã«ããã¯é¢æ° */
+	void	*arg;			/* ã³ã¼ã«ããã¯é¢æ°ã¸æ¸¡ãå¼æ° */
+} TMEVTB;
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãä¸­ã®ãã¼ãã®ãã¼ã¿åã®å®ç¾©
+ *
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãã®å
+é ­ã®ãã¼ãï¼tmevt_heap[0]ï¼ã«ï¼æå¾ã®ä½¿ç¨é 
+ *  åãæããã¤ã³ã¿ï¼p_lastï¼ãæ ¼ç´ãï¼ããä»¥éãã¿ã¤ã ã¤ãã³ããã¼ã
+ *  ã¨ãã¦ä½¿ç¨ããï¼(tmevt_heap[0].p_last - tmevt_heap) ãï¼ã¿ã¤ã ã¤ã
+ *  ã³ããã¼ãã«ç»é²ããã¦ããã¿ã¤ã ã¤ãã³ãã®æ°ã¨ãªãï¼
+ */
+union time_event_node {
+	TMEVTB	*p_tmevtb;		/* å¯¾å¿ããã¿ã¤ã ã¤ãã³ããã­ãã¯ */
+	TMEVTN	*p_last;		/* ã¿ã¤ã ã¤ãã³ããã¼ãã®æå¾ã®ä½¿ç¨é å */
+};
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããã¼ãï¼kernel_cfg.cï¼
+ */
+extern TMEVTN	tmevt_heap[];
+
+/*
+ *  å¢çã¤ãã³ãæå»ï¼»ASPD1008ï¼½
+ */
+extern EVTTIM	boundary_evttim;
+
+/*
+ *  ç¾å¨ã®ã¤ãã³ãæå»ã¨å¢çã¤ãã³ãæå»ã®å·®ï¼»ASPD1010ï¼½
+ */
+#define BOUNDARY_MARGIN		(200000000U)
+
+/*
+ *  æå¾ã«ç¾å¨æå»ãç®åºããæç¹ã§ã®ã¤ãã³ãæå»ï¼»ASPD1012ï¼½
+ */
+extern EVTTIM	current_evttim;
+
+/*
+ *  æå¾ã«ç¾å¨æå»ãç®åºããæç¹ã§ã®é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ï¼»ASPD1012ï¼½
+ */
+extern HRTCNT	current_hrtcnt;
+
+/*
+ *  æãé²ãã§ããæã®ã¤ãã³ãæå»ï¼»ASPD1041ï¼½
+ */
+extern EVTTIM	monotonic_evttim;
+
+/*
+ *  ã·ã¹ãã æå»ã®ãªãã»ããï¼»ASPD1043ï¼½
+ *
+ *  get_timã§åç
+§ããã·ã¹ãã æå»ã¨monotonic_evttimã®å·®ãä¿æããï¼
+ */
+extern SYSTIM	systim_offset;
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦çä¸­ã§ãããã¨ãç¤ºããã©ã°ï¼»ASPD1032ï¼½
+ */
+extern bool_t	in_signal_time;
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«ã®åæå
+ */
+extern void	initialize_tmevt(void);
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãã®æ¿å
+¥ä½ç½®ã®æ¢ç´¢
+ */
+extern TMEVTN	*tmevt_up(TMEVTN *p_tmevtn, EVTTIM evttim);
+extern TMEVTN	*tmevt_down(TMEVTN *p_tmevtn, EVTTIM evttim);
+
+/*
+ *  ç¾å¨ã®ã¤ãã³ãæå»ã®æ´æ°
+ *
+ *  current_evttimã¨current_hrtcntãï¼ç¾å¨ã®å¤ã«æ´æ°ããï¼
+ */
+extern void		update_current_evttim(void);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ã®è¨­å®
+ *
+ *  ç¾å¨ã®ã¤ãã³ãæå»ãåå¾ããå¾ã«å¼ã³åºããã¨ãæ³å®ãã¦ããï¼
+ */
+extern void		set_hrt_event(void);
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãã®ç»é²
+ *
+ *  p_tmevtbã§æå®ããã¿ã¤ã ã¤ãã³ããã­ãã¯ãç»é²ããï¼ã¿ã¤ã ã¤ãã³ã
+ *  ã®çºçæå»ï¼ã³ã¼ã«ããã¯é¢æ°ï¼ã³ã¼ã«ããã¯é¢æ°ã¸æ¸¡ãå¼æ°ã¯ï¼
+ *  p_tmevtbãæãã¿ã¤ã ã¤ãã³ããã­ãã¯ä¸­ã«è¨­å®ãã¦ããï¼
+ */
+extern void		tmevtb_register(TMEVTB *p_tmevtb);
+
+/*
+ *  ç¸å¯¾æéæå®ã«ããã¿ã¤ã ã¤ãã³ãã®ç»é²
+ *
+ *  timeã§æå®ããç¸å¯¾æéãçµéããå¾ã«ã³ã¼ã«ããã¯é¢æ°ãå¼ã³åºããã
+ *  ããã«ï¼p_tmevtbã§æå®ããã¿ã¤ã ã¤ãã³ããã­ãã¯ãç»é²ããï¼ã³ã¼ã«
+ *  ããã¯é¢æ°ï¼ã³ã¼ã«ããã¯é¢æ°ã¸æ¸¡ãå¼æ°ã¯ï¼p_tmevtbãæãã¿ã¤ã ã¤ã
+ *  ã³ããã­ãã¯ä¸­ã«è¨­å®ãã¦ããï¼
+ */
+extern void		tmevtb_enqueue(TMEVTB *p_tmevtb, RELTIM time);
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ãã®ç»é²è§£é¤
+ */
+extern void		tmevtb_dequeue(TMEVTB *p_tmevtb);
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´æã®ã¨ã©ã¼ãã§ãã¯
+ *
+ *  adjtimã§æå®ãããæéã®åï¼ã·ã¹ãã æå»ãèª¿æ´ãã¦ãããå¤å®ããï¼
+ *  èª¿æ´ãã¦ã¯ãªããªãå ´åã«trueï¼ããã§ãªãå ´åã«falseãè¿ãï¼ç¾å¨ã®ã¤
+ *  ãã³ãæå»ãåå¾ããå¾ã«å¼ã³åºããã¨ãæ³å®ãã¦ããï¼
+ */
+extern bool_t	check_adjtim(int_t adjtim);
+
+/*
+ *  ã¿ã¤ã ã¤ãã³ããçºçããã¾ã§ã®æéã®è¨ç®
+ */
+extern RELTIM	tmevt_lefttim(TMEVTB *p_tmevtb);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦ç
+ */
+extern void	signal_time(void);
+
+#endif /* TOPPERS_TIME_EVENT_H */
Index: asp3_wo_tecs/trunk/kernel/time_manage.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/time_manage.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/time_manage.c	(revision 302)
@@ -0,0 +1,230 @@
+/*
+ *  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: time_manage.c 181 2014-06-14 16:45:07Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã æå»ç®¡çæ©è½
+ */
+
+#include "kernel_impl.h"
+#include "check.h"
+#include "time_event.h"
+#include "target_timer.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_SET_TIM_ENTER
+#define LOG_SET_TIM_ENTER(systim)
+#endif /* LOG_SET_TIM_ENTER */
+
+#ifndef LOG_SET_TIM_LEAVE
+#define LOG_SET_TIM_LEAVE(ercd)
+#endif /* LOG_SET_TIM_LEAVE */
+
+#ifndef LOG_GET_TIM_ENTER
+#define LOG_GET_TIM_ENTER(p_systim)
+#endif /* LOG_GET_TIM_ENTER */
+
+#ifndef LOG_GET_TIM_LEAVE
+#define LOG_GET_TIM_LEAVE(ercd, p_systim)
+#endif /* LOG_GET_TIM_LEAVE */
+
+#ifndef LOG_ADJ_TIM_ENTER
+#define LOG_ADJ_TIM_ENTER(adjtim)
+#endif /* LOG_ADJ_TIM_ENTER */
+
+#ifndef LOG_ADJ_TIM_LEAVE
+#define LOG_ADJ_TIM_LEAVE(ercd)
+#endif /* LOG_ADJ_TIM_LEAVE */
+
+#ifndef LOG_FCH_HRT_ENTER
+#define LOG_FCH_HRT_ENTER()
+#endif /* LOG_FCH_HRT_ENTER */
+
+#ifndef LOG_FCH_HRT_LEAVE
+#define LOG_FCH_HRT_LEAVE(hrtcnt)
+#endif /* LOG_FCH_HRT_LEAVE */
+
+/*
+ *  ã·ã¹ãã æå»ã®è¨­å®ï¼»NGKI3563ï¼½
+ */
+#ifdef TOPPERS_set_tim
+
+ER
+set_tim(SYSTIM systim)
+{
+	ER		ercd;
+
+	LOG_SET_TIM_ENTER(systim);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI3564ï¼½ï¼»NGKI3565ï¼½*/
+
+	lock_cpu();
+	update_current_evttim();					/*ï¼»ASPD1059ï¼½*/
+	systim_offset = systim - monotonic_evttim;	/*ï¼»ASPD1060ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_SET_TIM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_set_tim */
+
+/*
+ *  ã·ã¹ãã æå»ã®åç
+§ï¼»NGKI2349ï¼½
+ */
+#ifdef TOPPERS_get_tim
+
+ER
+get_tim(SYSTIM *p_systim)
+{
+	ER		ercd;
+
+	LOG_GET_TIM_ENTER(p_systim);
+	CHECK_TSKCTX_UNL();							/*ï¼»NGKI2350ï¼½ï¼»NGKI2351ï¼½*/
+
+	lock_cpu();
+	update_current_evttim();					/*ï¼»ASPD1057ï¼½*/
+	*p_systim = systim_offset + monotonic_evttim;	/*ï¼»ASPD1058ï¼½*/
+	ercd = E_OK;
+	unlock_cpu();
+
+  error_exit:
+	LOG_GET_TIM_LEAVE(ercd, p_systim);
+	return(ercd);
+}
+
+#endif /* TOPPERS_get_tim */
+
+/*
+ *  ã·ã¹ãã æå»ã®èª¿æ´ï¼»NGKI3581ï¼½
+ */
+#ifdef TOPPERS_adj_tim
+
+ER
+adj_tim(int32_t adjtim)
+{
+	EVTTIM	previous_evttim;
+	ER		ercd;
+
+	LOG_ADJ_TIM_ENTER(adjtim);
+	CHECK_UNL();								/*ï¼»NGKI3583ï¼½*/
+	CHECK_PAR(TMIN_ADJTIM <= adjtim && adjtim <= TMAX_ADJTIM);
+												/*ï¼»NGKI3584ï¼½*/
+	lock_cpu();
+	update_current_evttim();					/*ï¼»ASPD1051ï¼½*/
+	if (check_adjtim(adjtim)) {					/*ï¼»ASPD1052ï¼½*/
+		ercd = E_OBJ;
+	}
+	else {
+		previous_evttim = current_evttim;
+		current_evttim += adjtim;				/*ï¼»ASPD1053ï¼½*/
+		boundary_evttim = current_evttim - BOUNDARY_MARGIN;	/*ï¼»ASPD1055ï¼½*/
+
+		if (adjtim > 0
+				&& monotonic_evttim - previous_evttim < (EVTTIM) adjtim) {
+#ifdef UINT64_MAX
+			if (current_evttim < monotonic_evttim) {
+				systim_offset += 1LLU << 32;
+			}
+#endif /* UINT64_MAX */
+			monotonic_evttim = current_evttim;	/*ï¼»ASPD1054ï¼½*/
+		}
+
+		set_hrt_event();						/*ï¼»ASPD1056ï¼½*/
+		ercd = E_OK;
+	}
+	unlock_cpu();
+
+  error_exit:
+	LOG_ADJ_TIM_LEAVE(ercd);
+	return(ercd);
+}
+
+#endif /* TOPPERS_adj_tim */
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®åç
+§ï¼»NGKI3569ï¼½
+ *
+ *  ä»»æã®ç¶æ
+ããå¼ã³åºããããã«ããããã«ï¼SILã®å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®
+ *  å¶å¾¡æ©è½ãç¨ãã¦ï¼æä»å¶å¾¡ãå®ç¾ãã¦ããï¼»NGKI3572ï¼½ï¼
+ */
+#ifdef TOPPERS_fch_hrt
+
+HRTCNT
+fch_hrt(void)
+{
+	HRTCNT	hrtcnt;
+	SIL_PRE_LOC;
+
+	LOG_FCH_HRT_ENTER();
+
+	SIL_LOC_INT();
+	hrtcnt = target_hrt_get_current();			/*ï¼»NGKI3571ï¼½*/
+	SIL_UNL_INT();
+
+	LOG_FCH_HRT_LEAVE(hrtcnt);
+	return(hrtcnt);
+}
+
+#endif /* TOPPERS_fch_hrt */
Index: asp3_wo_tecs/trunk/kernel/wait.c
===================================================================
--- asp3_wo_tecs/trunk/kernel/wait.c	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/wait.c	(revision 302)
@@ -0,0 +1,230 @@
+/*
+ *  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: wait.c 469 2015-12-30 02:38:47Z ertl-hiro $
+ */
+
+/*
+ *		å¾
+ã¡ç¶æ
+ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#include "kernel_impl.h"
+#include "wait.h"
+
+/*
+ *  å¾
+ã¡ç¶æ
+ã¸ã®é·ç§»ï¼ã¿ã¤ã ã¢ã¦ãæå®ï¼
+ */
+#ifdef TOPPERS_waimake
+
+void
+make_wait_tmout(WINFO *p_winfo, TMEVTB *p_tmevtb, TMO tmout)
+{
+	make_non_runnable(p_runtsk);
+	p_runtsk->p_winfo = p_winfo;
+	if (tmout == TMO_FEVR) {
+		p_winfo->p_tmevtb = NULL;
+	}
+	else {
+		assert(tmout <= TMAX_RELTIM);
+		p_winfo->p_tmevtb = p_tmevtb;
+		p_tmevtb->callback = (CBACK) wait_tmout;
+		p_tmevtb->arg = (void *) p_runtsk;
+		tmevtb_enqueue(p_tmevtb, (RELTIM) tmout);
+	}
+}
+
+#endif /* TOPPERS_waimake */
+
+/*
+ *  å¾
+ã¡è§£é¤
+ */
+#ifdef TOPPERS_waicmp
+
+void
+wait_complete(TCB *p_tcb)
+{
+	wait_dequeue_tmevtb(p_tcb);
+	p_tcb->p_winfo->wercd = E_OK;
+	make_non_wait(p_tcb);
+}
+
+#endif /* TOPPERS_waicmp */
+
+/*
+ *  ã¿ã¤ã ã¢ã¦ãã«ä¼´ãå¾
+ã¡è§£é¤
+ */
+#ifdef TOPPERS_waitmo
+
+void
+wait_tmout(TCB *p_tcb)
+{
+	wait_dequeue_wobj(p_tcb);
+	p_tcb->p_winfo->wercd = E_TMOUT;
+	make_non_wait(p_tcb);
+	if (p_runtsk != p_schedtsk) {
+		request_dispatch();
+	}
+
+	/*
+	 *  ããã§åªå
+åº¦ã®é«ãå²è¾¼ã¿ãåãä»ããï¼
+	 */
+	unlock_cpu();
+	delay_for_interrupt();
+	lock_cpu();
+}
+
+#endif /* TOPPERS_waitmo */
+#ifdef TOPPERS_waitmook
+
+void
+wait_tmout_ok(TCB *p_tcb)
+{
+	p_tcb->p_winfo->wercd = E_OK;
+	make_non_wait(p_tcb);
+	if (p_runtsk != p_schedtsk) {
+		request_dispatch();
+	}
+
+	/*
+	 *  ããã§åªå
+åº¦ã®é«ãå²è¾¼ã¿ãåãä»ããï¼
+	 */
+	unlock_cpu();
+	delay_for_interrupt();
+	lock_cpu();
+}
+
+#endif /* TOPPERS_waitmook */
+
+/*
+ *  å®è¡ä¸­ã®ã¿ã¹ã¯ã®åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã¸ã®æ¿å
+¥
+ *
+ *  å®è¡ä¸­ã®ã¿ã¹ã¯ãï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã¸æ¿å
+¥ããï¼ãª
+ *  ãã¸ã§ã¯ãã®å±æ§ã«å¿ãã¦ï¼FIFOé ã¾ãã¯ã¿ã¹ã¯åªå
+åº¦é ã§æ¿å
+¥ããï¼
+ */
+Inline void
+wobj_queue_insert(WOBJCB *p_wobjcb)
+{
+	if ((p_wobjcb->p_wobjinib->wobjatr & TA_TPRI) != 0U) {
+		queue_insert_tpri(&(p_wobjcb->wait_queue), p_runtsk);
+	}
+	else {
+		queue_insert_prev(&(p_wobjcb->wait_queue), &(p_runtsk->task_queue));
+	}
+}
+
+/*
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã¸ã®é·ç§»
+ */
+#ifdef TOPPERS_wobjwai
+
+void
+wobj_make_wait(WOBJCB *p_wobjcb, WINFO_WOBJ *p_winfo_wobj)
+{
+	make_wait(&(p_winfo_wobj->winfo));
+	wobj_queue_insert(p_wobjcb);
+	p_winfo_wobj->p_wobjcb = p_wobjcb;
+	LOG_TSKSTAT(p_runtsk);
+}
+
+#endif /* TOPPERS_wobjwai */
+#ifdef TOPPERS_wobjwaitmo
+
+void
+wobj_make_wait_tmout(WOBJCB *p_wobjcb, WINFO_WOBJ *p_winfo_wobj,
+								TMEVTB *p_tmevtb, TMO tmout)
+{
+	make_wait_tmout(&(p_winfo_wobj->winfo), p_tmevtb, tmout);
+	wobj_queue_insert(p_wobjcb);
+	p_winfo_wobj->p_wobjcb = p_wobjcb;
+	LOG_TSKSTAT(p_runtsk);
+}
+
+#endif /* TOPPERS_wobjwaitmo */
+
+/*
+ *  å¾
+ã¡ã­ã¥ã¼ã®åæå
+ */
+#ifdef TOPPERS_iniwque
+
+void
+init_wait_queue(QUEUE *p_wait_queue)
+{
+	TCB		*p_tcb;
+
+	while (!queue_empty(p_wait_queue)) {
+		p_tcb = (TCB *) queue_delete_next(p_wait_queue);
+		wait_dequeue_tmevtb(p_tcb);
+		p_tcb->p_winfo->wercd = E_DLT;
+		make_non_wait(p_tcb);
+	}
+}
+
+#endif /* TOPPERS_iniwque */
Index: asp3_wo_tecs/trunk/kernel/wait.h
===================================================================
--- asp3_wo_tecs/trunk/kernel/wait.h	(revision 302)
+++ asp3_wo_tecs/trunk/kernel/wait.h	(revision 302)
@@ -0,0 +1,381 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2000 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: wait.h 244 2014-09-30 18:08:03Z ertl-hiro $
+ */
+
+/*
+ *		å¾
+ã¡ç¶æ
+ç®¡çã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_WAIT_H
+#define TOPPERS_WAIT_H
+
+#include "kernel_impl.h"
+#include <queue.h>
+#include "task.h"
+#include "time_event.h"
+
+/*
+ *  ã¿ã¹ã¯ã®åªå
+åº¦é ã®å¾
+ã¡ã­ã¥ã¼ã¸ã®æ¿å
+¥
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãï¼ã¿ã¹ã¯åªå
+åº¦é ã®ã­ã¥ã¼p_queueã«æ¿å
+¥ããï¼
+ *  ã­ã¥ã¼ã®ä¸­ã«åãåªå
+åº¦ã®ã¿ã¹ã¯ãããå ´åã«ã¯ï¼ãã®æå¾ã«æ¿å
+¥ããï¼
+ */
+Inline void
+queue_insert_tpri(QUEUE *p_queue, TCB *p_tcb)
+{
+	QUEUE	*p_entry;
+	uint_t	pri = p_tcb->priority;
+
+	for (p_entry = p_queue->p_next; p_entry != p_queue;
+										p_entry = p_entry->p_next) {
+		if (pri < ((TCB *) p_entry)->priority) {
+			break;
+		}
+	}
+	queue_insert_prev(p_entry, &(p_tcb->task_queue));
+}
+
+/*
+ *  å¾
+ã¡ç¶æ
+ã¸ã®é·ç§»
+ *
+ *  å®è¡ä¸­ã®ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã«é·ç§»ãããï¼å
+·ä½çã«ã¯ï¼å®è¡ä¸­ã®ã¿ã¹ã¯ã
+ *  ã¬ãã£ã­ã¥ã¼ããåé¤ãï¼TCBã®p_winfoãã£ã¼ã«ãï¼WINFOã®p_tmevtbãã£ã¼
+ *  ã«ããè¨­å®ããï¼
+ */
+Inline void
+make_wait(WINFO *p_winfo)
+{
+	make_non_runnable(p_runtsk);
+	p_runtsk->p_winfo = p_winfo;
+	p_winfo->p_tmevtb = NULL;
+}
+
+/*
+ *  å¾
+ã¡ç¶æ
+ã¸ã®é·ç§»ï¼ã¿ã¤ã ã¢ã¦ãæå®ï¼
+ *
+ *  å®è¡ä¸­ã®ã¿ã¹ã¯ãï¼ã¿ã¤ã ã¢ã¦ãæå®ä»ãã§å¾
+ã¡ç¶æ
+ã«é·ç§»ãããï¼å
+·ä½
+ *  çã«ã¯ï¼å®è¡ä¸­ã®ã¿ã¹ã¯ãã¬ãã£ã­ã¥ã¼ããåé¤ãï¼TCBã®p_winfoãã£ã¼
+ *  ã«ãï¼WINFOã®p_tmevtbãã£ã¼ã«ããè¨­å®ããï¼ã¾ãï¼ã¿ã¤ã ã¤ãã³ãã
+ *  ã­ãã¯ãç»é²ããï¼
+ */
+extern void	make_wait_tmout(WINFO *p_winfo, TMEVTB *p_tmevtb, TMO tmout);
+
+/*
+ *  å¾
+ã¡è§£é¤ã®ããã®ã¿ã¹ã¯ç¶æ
+ã®æ´æ°
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãï¼å¾
+ã¡è§£é¤ããããã¿ã¹ã¯ç¶æ
+ãæ´æ°ããï¼
+ *  å¾
+ã¡è§£é¤ããã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã«ãªãå ´åã¯ï¼ã¬ãã£ã­ã¥ã¼ã«ã¤ãª
+ *  ãï¼
+ */
+Inline void
+make_non_wait(TCB *p_tcb)
+{
+	assert(TSTAT_WAITING(p_tcb->tstat));
+
+	if (!TSTAT_SUSPENDED(p_tcb->tstat)) {
+		/*
+		 *  å¾
+ã¡ç¶æ
+ããå®è¡ã§ããç¶æ
+ã¸ã®é·ç§»
+		 */
+		p_tcb->tstat = TS_RUNNABLE;
+		LOG_TSKSTAT(p_tcb);
+		make_runnable(p_tcb);
+	}
+	else {
+		/*
+		 *  äºéå¾
+ã¡ç¶æ
+ããå¼·å¶å¾
+ã¡ç¶æ
+ã¸ã®é·ç§»
+		 */
+		p_tcb->tstat = TS_SUSPENDED;
+		LOG_TSKSTAT(p_tcb);
+	}
+}
+
+/*
+ *  ãªãã¸ã§ã¯ãå¾
+ã¡ã­ã¥ã¼ããã®åé¤
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼ã«ã¤
+ *  ãªããã¦ããã°ï¼å¾
+ã¡ã­ã¥ã¼ããåé¤ããï¼
+ */
+Inline void
+wait_dequeue_wobj(TCB *p_tcb)
+{
+	if (TSTAT_WAIT_WOBJ(p_tcb->tstat)) {
+		queue_delete(&(p_tcb->task_queue));
+	}
+}
+
+/*
+ *  æéå¾
+ã¡ã®ããã®ã¿ã¤ã ã¤ãã³ããã­ãã¯ã®ç»é²è§£é¤
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã«å¯¾ãã¦ï¼æéå¾
+ã¡ã®ããã®ã¿ã¤ã ã¤ãã³ãã
+ *  ã­ãã¯ãç»é²ããã¦ããã°ï¼ãããç»é²è§£é¤ããï¼
+ */
+Inline void
+wait_dequeue_tmevtb(TCB *p_tcb)
+{
+	if (p_tcb->p_winfo->p_tmevtb != NULL) {
+		tmevtb_dequeue(p_tcb->p_winfo->p_tmevtb);
+	}
+}
+
+/*
+ *  å¾
+ã¡è§£é¤
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ã®å¾
+ã¡ç¶æ
+ãè§£é¤ããï¼å
+·ä½çã«ã¯ï¼ã¿ã¤ã ã¤
+ *  ãã³ããã­ãã¯ãç»é²ããã¦ããã°ï¼ãããç»é²è§£é¤ããï¼ã¾ãï¼ã¿ã¹ã¯
+ *  ç¶æ
+ãæ´æ°ãï¼å¾
+ã¡è§£é¤ããã¿ã¹ã¯ããã®è¿å¤ãE_OKã¨ããï¼å¾
+ã¡ã­ã¥ã¼
+ *  ããã®åé¤ã¯è¡ããªãï¼
+ */
+extern void	wait_complete(TCB *p_tcb);
+
+/*
+ *  ã¿ã¤ã ã¢ã¦ãã«ä¼´ãå¾
+ã¡è§£é¤
+ *
+ *  p_tcbã§æå®ãããã¿ã¹ã¯ãï¼å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ããã°å¾
+ã¡ã­ã¥ã¼
+ *  ããåé¤ãï¼ã¿ã¹ã¯ç¶æ
+ãæ´æ°ããï¼ã¾ãï¼å¾
+ã¡è§£é¤ããã¿ã¹ã¯ããã®è¿
+ *  å¤ãï¼wait_tmoutã§ã¯E_TMOUTï¼wait_tmout_okã§ã¯E_OKã¨ããï¼
+ *
+ *  wait_tmout_okã¯ï¼dly_tskã§ä½¿ãããã®ãã®ã§ï¼å¾
+ã¡ã­ã¥ã¼ããåé¤ãã
+ *  å¦çãè¡ããªãï¼
+ *
+ *  ãããã®é¢æ°ãï¼ã¿ã¤ã ã¤ãã³ãã®ã³ã¼ã«ããã¯é¢æ°ã¨ãã¦ç¨ããããã®
+ *  ãã®ã§ï¼å²è¾¼ã¿ãã³ãã©ããå¼ã³åºããããã¨ãæ³å®ãã¦ããï¼
+ */
+extern void	wait_tmout(TCB *p_tcb);
+extern void	wait_tmout_ok(TCB *p_tcb);
+
+/*
+ *  å¾
+ã¡ã­ã¥ã¼ã®å
+é ­ã®ã¿ã¹ã¯ID
+ *
+ *  p_wait_queueã§æå®ããå¾
+ã¡ã­ã¥ã¼ã®å
+é ­ã®ã¿ã¹ã¯IDãè¿ãï¼å¾
+ã¡ã­ã¥ã¼
+ *  ãç©ºã®å ´åã«ã¯ï¼TSK_NONEãè¿ãï¼
+ */
+Inline ID
+wait_tskid(QUEUE *p_wait_queue)
+{
+	if (!queue_empty(p_wait_queue)) {
+		return(TSKID((TCB *) p_wait_queue->p_next));
+	}
+	else {
+		return(TSK_NONE);
+	}
+}
+
+/*
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨åæä½ã«ã¼ãã³
+ *
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã¨ç®¡çãã­ãã¯ã®å
+é ­é¨åã¯å
+±
+ *  éã«ãªã£ã¦ããï¼ä»¥ä¸ã¯ï¼ãã®å
+±éé¨åãæ±ãããã®åããã³ã«ã¼ãã³ç¾¤
+ *  ã§ããï¼
+ *
+ *  è¤æ°ã®å¾
+ã¡ã­ã¥ã¼ãæã¤åæã»éä¿¡ãªãã¸ã§ã¯ãã®å ´åï¼å
+é ­ä»¥å¤ã®å¾
+ã¡
+ *  ã­ã¥ã¼ãæä½ããå ´åã«ã¯ï¼ãããã®ã«ã¼ãã³ã¯ä½¿ããªãï¼ã¾ãï¼ãªãã¸ã§
+ *  ã¯ãå±æ§ã®TA_TPRIããããåç
+§ããã®ã§ï¼ãã®ããããä»ã®ç®çã«ä½¿ã£ã¦
+ *  ããå ´åãï¼ãããã®ã«ã¼ãã³ã¯ä½¿ããªãï¼
+ */
+
+/*
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã®åæåãã­ãã¯ã®å
+±éé¨å
+ */
+typedef struct wait_object_initialization_block {
+	ATR			wobjatr;		/* ãªãã¸ã§ã¯ãå±æ§ */
+} WOBJINIB;
+
+/*
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ã®å
+±éé¨å
+ */
+typedef struct wait_object_control_block {
+	QUEUE		wait_queue;		/* å¾
+ã¡ã­ã¥ã¼ */
+	const WOBJINIB *p_wobjinib;	/* åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ */
+} WOBJCB;
+
+/*
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡æ
+å ±ãã­ãã¯ã®å
+±éé¨å
+ *
+ *  ãã®æ§é ä½ã¯ï¼å¾
+ã¡æ
+å ±ãã­ãã¯ï¼WINFOï¼ãæ¡å¼µï¼ãªãã¸ã§ã¯ãæåè¨
+ *  èªã®ç¶æ¿ã«ç¸å½ï¼ãããã®ã§ãããï¼WINFOãå
+±ç¨ä½ã§å®ç¾©ããã¦ããã
+ *  ãã«ï¼1ã¤ã®ãã£ã¼ã«ãã¨ãã¦å«ãã¦ããï¼
+ */
+typedef struct wait_object_waiting_information {
+	WINFO	winfo;			/* æ¨æºã®å¾
+ã¡æ
+å ±ãã­ãã¯ */
+	WOBJCB	*p_wobjcb;		/* å¾
+ã¡ãªãã¸ã§ã¯ãã®ç®¡çãã­ãã¯ */
+} WINFO_WOBJ;
+
+/*
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã¸ã®é·ç§»
+ *  
+ *  å®è¡ä¸­ã®ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã«é·ç§»ããï¼åæã»éä¿¡ãªãã¸ã§ã¯ãã®å¾
+ã¡ã­ã¥ã¼
+ *  ã«ã¤ãªãï¼ã¾ãï¼å¾
+ã¡æ
+å ±ãã­ãã¯ï¼WINFOï¼ã®p_wobjcbãè¨­å®ããï¼
+ *  wobj_make_wait_tmoutã¯ï¼ã¿ã¤ã ã¤ãã³ããã­ãã¯ã®ç»é²ãè¡ãï¼
+ */
+extern void	wobj_make_wait(WOBJCB *p_wobjcb, WINFO_WOBJ *p_winfo);
+extern void	wobj_make_wait_tmout(WOBJCB *p_wobjcb, WINFO_WOBJ *p_winfo,
+											TMEVTB *p_tmevtb, TMO tmout);
+
+/*
+ *  ã¿ã¹ã¯åªå
+åº¦å¤æ´æã®å¦ç
+ *
+ *  åæã»éä¿¡ãªãã¸ã§ã¯ãã«å¯¾ããå¾
+ã¡ç¶æ
+ã«ããã¿ã¹ã¯ã®åªå
+åº¦ãå¤æ´ã
+ *  ããå ´åã«ï¼å¾
+ã¡ã­ã¥ã¼ã®ä¸­ã§ã®ã¿ã¹ã¯ã®ä½ç½®ãä¿®æ­£ããï¼
+ */
+Inline void
+wobj_change_priority(WOBJCB *p_wobjcb, TCB *p_tcb)
+{
+	if ((p_wobjcb->p_wobjinib->wobjatr & TA_TPRI) != 0U) {
+		queue_delete(&(p_tcb->task_queue));
+		queue_insert_tpri(&(p_wobjcb->wait_queue), p_tcb);
+	}
+}
+
+/*
+ *  å¾
+ã¡ã­ã¥ã¼ã®åæå
+ *
+ *  å¾
+ã¡ã­ã¥ã¼ã«ã¤ãªããã¦ããã¿ã¹ã¯ããã¹ã¦å¾
+ã¡è§£é¤ããï¼å¾
+ã¡è§£é¤ãã
+ *  ã¿ã¹ã¯ããã®è¿å¤ã¯ï¼E_DLTã¨ããï¼
+ */
+extern void	init_wait_queue(QUEUE *p_wait_queue);
+
+#endif /* TOPPERS_WAIT_H */
Index: asp3_wo_tecs/trunk/library/log_output.c
===================================================================
--- asp3_wo_tecs/trunk/library/log_output.c	(revision 302)
+++ asp3_wo_tecs/trunk/library/log_output.c	(revision 302)
@@ -0,0 +1,218 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  Copyright (C) 2004-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: log_output.c 127 2014-05-17 12:20:22Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ã­ã°ã®ãã©ã¼ãããåºå
+ */
+
+#include <t_stddef.h>
+#include <t_syslog.h>
+#include <log_output.h>
+
+/*
+ *  æ°å¤ãæå­åã«å¤æ
+ */
+#define CONVERT_BUFLEN	((sizeof(ULOGPAR) * CHAR_BIT + 2) / 3)
+										/* ULOGPARåã®æ°å¤ã®æå¤§æå­æ° */
+static void
+convert(ULOGPAR val, uint_t radix, const char *radchar,
+			uint_t width, bool_t minus, bool_t padzero, void (*putc)(char))
+{
+	char	buf[CONVERT_BUFLEN];
+	uint_t	i, j;
+
+	i = 0U;
+	do {
+		buf[i++] = radchar[val % radix];
+		val /= radix;
+	} while (i < CONVERT_BUFLEN && val != 0);
+
+	if (minus && width > 0) {
+		width -= 1;
+	}
+	if (minus && padzero) {
+		(*putc)('-');
+	}
+	for (j = i; j < width; j++) {
+		(*putc)(padzero ? '0' : ' ');
+	}
+	if (minus && !padzero) {
+		(*putc)('-');
+	}
+	while (i > 0U) {
+		(*putc)(buf[--i]);
+	}
+}
+
+/*
+ *  æå­åæ´å½¢åºå
+ */
+static const char raddec[] = "0123456789";
+static const char radhex[] = "0123456789abcdef";
+static const char radHEX[] = "0123456789ABCDEF";
+
+void
+syslog_printf(const char *format, const LOGPAR *p_args, void (*putc)(char))
+{
+	char		c;
+	uint_t		width;
+	bool_t		padzero;
+	LOGPAR	val;
+	const char	*str;
+
+	while ((c = *format++) != '\0') {
+		if (c != '%') {
+			(*putc)(c);
+			continue;
+		}
+
+		width = 0U;
+		padzero = false;
+		if ((c = *format++) == '0') {
+			padzero = true;
+			c = *format++;
+		}
+		while ('0' <= c && c <= '9') {
+			width = width * 10U + c - '0';
+			c = *format++;
+		}
+		if (c == 'l' || c == 't' || c == 'T') {
+			c = *format++;
+		}
+		switch (c) {
+		case 'd':
+			val = (LOGPAR)(*p_args++);
+			if (val >= 0) {
+				convert((ULOGPAR) val, 10U, raddec,
+											width, false, padzero, putc);
+			}
+			else {
+				convert((ULOGPAR)(-val), 10U, raddec,
+											width, true, padzero, putc);
+			}
+			break;
+		case 'u':
+			val = (LOGPAR)(*p_args++);
+			convert((ULOGPAR) val, 10U, raddec, width, false, padzero, putc);
+			break;
+		case 'x':
+		case 'p':
+			val = (LOGPAR)(*p_args++);
+			convert((ULOGPAR) val, 16U, radhex, width, false, padzero, putc);
+			break;
+		case 'X':
+			val = (LOGPAR)(*p_args++);
+			convert((ULOGPAR) val, 16U, radHEX, width, false, padzero, putc);
+			break;
+		case 'c':
+			(*putc)((char)(LOGPAR)(*p_args++));
+			break;
+		case 's':
+			str = (const char *)(*p_args++);
+			while ((c = *str++) != '\0') {
+				(*putc)(c);
+			}
+			break;
+		case '%':
+			(*putc)('%');
+			break;
+		case '\0':
+			format--;
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+/*
+ *  ã­ã°æ
+å ±ã®åºå
+ */
+void
+syslog_print(const SYSLOG *p_syslog, void (*putc)(char))
+{
+	switch (p_syslog->logtype) {
+	case LOG_TYPE_COMMENT:
+		syslog_printf((const char *)(p_syslog->logpar[0]),
+								&(p_syslog->logpar[1]), putc);
+		break;
+	case LOG_TYPE_ASSERT:
+		syslog_printf("%s:%u: Assertion `%s' failed.",
+								&(p_syslog->logpar[0]), putc);
+		break;
+	default:
+		/*
+		 *  ä»ã®ç¨®å¥ã®ã­ã°æ
+å ±ã«ã¯å¯¾å¿ãã¦ããªãï¼
+		 */
+		break;
+	}
+}
+
+/*
+ *  ã­ã°æ
+å ±åªå¤±ã¡ãã»ã¼ã¸ã®åºå
+ */
+void
+syslog_lostmsg(uint_t lostlog, void (*putc)(char))
+{
+	LOGPAR	lostinfo[1];
+
+	lostinfo[0] = (LOGPAR) lostlog;
+	syslog_printf("%d messages are lost.", lostinfo, putc);
+	(*putc)('\n');
+}
Index: asp3_wo_tecs/trunk/library/strerror.c
===================================================================
--- asp3_wo_tecs/trunk/library/strerror.c	(revision 302)
+++ asp3_wo_tecs/trunk/library/strerror.c	(revision 302)
@@ -0,0 +1,130 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  Copyright (C) 2004-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: strerror.c 108 2014-05-11 01:30:18Z ertl-hiro $
+ */
+
+/*
+ *		ã¨ã©ã¼ã¡ãã»ã¼ã¸æå­åãè¿ãé¢æ°
+ */
+
+#include <t_stddef.h>
+#include <t_stdlib.h>
+
+const char *
+itron_strerror(ER ercd)
+{
+	switch (MERCD(ercd)) {
+	case E_OK:
+		return("E_OK");
+
+	case E_SYS:
+		return("E_SYS");
+	case E_NOSPT:
+		return("E_NOSPT");
+	case E_RSFN:
+		return("E_RSFN");
+	case E_RSATR:
+		return("E_RSATR");
+
+	case E_PAR:
+		return("E_PAR");
+	case E_ID:
+		return("E_ID");
+
+	case E_CTX:
+		return("E_CTX");
+	case E_MACV:
+		return("E_MACV");
+	case E_OACV:
+		return("E_OACV");
+	case E_ILUSE:
+		return("E_ILUSE");
+
+	case E_NOMEM:
+		return("E_NOMEM");
+	case E_NOID:
+		return("E_NOID");
+	case E_NORES:
+		return("E_NORES");
+
+	case E_OBJ:
+		return("E_OBJ");
+	case E_NOEXS:
+		return("E_NOEXS");
+	case E_QOVR:
+		return("E_QOVR");
+
+	case E_RLWAI:
+		return("E_RLWAI");
+	case E_TMOUT:
+		return("E_TMOUT");
+	case E_DLT:
+		return("E_DLT");
+	case E_CLS:
+		return("E_CLS");
+	case E_RASTER:
+		return("E_RASTER");
+
+	case E_WBLK:
+		return("E_WBLK");
+	case E_BOVR:
+		return("E_BOVR");
+
+	case E_COMM:
+		return("E_COMM");
+
+	default:
+		return("unknown error");
+	}
+}
Index: asp3_wo_tecs/trunk/library/t_perror.c
===================================================================
--- asp3_wo_tecs/trunk/library/t_perror.c	(revision 302)
+++ asp3_wo_tecs/trunk/library/t_perror.c	(revision 302)
@@ -0,0 +1,71 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  Copyright (C) 2004-2006 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: t_perror.c 108 2014-05-11 01:30:18Z ertl-hiro $
+ */
+
+/*
+ *		ã¨ã©ã¼ã¡ãã»ã¼ã¸ã®åºå
+ */
+
+#include <t_stddef.h>
+#include <t_syslog.h>
+#include <t_stdlib.h>
+
+void
+t_perror(uint_t prio, const char *file, int_t line, const char *expr, ER ercd)
+{
+	syslog_5(prio, "%s (%d) reported by `%s' in line %d of `%s'.",
+						itron_strerror(ercd), SERCD(ercd), expr, line, file);
+
+}
Index: asp3_wo_tecs/trunk/library/vasyslog.c
===================================================================
--- asp3_wo_tecs/trunk/library/vasyslog.c	(revision 302)
+++ asp3_wo_tecs/trunk/library/vasyslog.c	(revision 302)
@@ -0,0 +1,130 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  Copyright (C) 2004-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: vasyslog.c 127 2014-05-17 12:20:22Z ertl-hiro $
+ */
+
+/*
+ *		å¯å¤æ°å¼æ°ã®ã·ã¹ãã ã­ã°ã©ã¤ãã©ãª
+ */
+
+#include <t_stddef.h>
+#include <t_syslog.h>
+#include <stdarg.h>
+
+#ifndef TOPPERS_OMIT_SYSLOG
+
+void
+syslog(uint_t prio, const char *format, ...)
+{
+	SYSLOG	logbuf;
+	va_list	ap;
+	uint_t	i;
+	char	sz;
+	char	c;
+
+	logbuf.logtype = LOG_TYPE_COMMENT;
+	logbuf.logpar[0] = (LOGPAR) format;
+	i = 1U;
+	va_start(ap, format);
+
+	while ((c = *format++) != '\0' && i < TNUM_LOGPAR) {
+		if (c != '%') {
+			continue;
+		}
+
+		sz = '\0';
+		c = *format++;
+		while ('0' <= c && c <= '9') {
+			c = *format++;
+		}
+		if (c == 'l' || c == 't' || c == 'T') {
+			sz = c;
+			c = *format++;
+		}
+		switch (c) {
+		case 'd':
+			logbuf.logpar[i++] = (sz == 'l') ? (LOGPAR) va_arg(ap, long_t)
+							   : (sz == 't') ? (LOGPAR) va_arg(ap, int32_t)
+							   : (sz == 'T') ? (LOGPAR) va_arg(ap, SYSTIM)
+							   : (LOGPAR) va_arg(ap, int_t);
+			break;
+		case 'u':
+		case 'x':
+		case 'X':
+			logbuf.logpar[i++] = (sz == 'l') ? (LOGPAR) va_arg(ap, ulong_t)
+							   : (sz == 't') ? (LOGPAR) va_arg(ap, uint32_t)
+							   : (sz == 'T') ? (LOGPAR) va_arg(ap, SYSTIM)
+							   : (LOGPAR) va_arg(ap, uint_t);
+			break;
+		case 'p':
+			logbuf.logpar[i++] = (LOGPAR) va_arg(ap, void *);
+			break;
+		case 'c':
+			logbuf.logpar[i++] = (LOGPAR) va_arg(ap, int);
+			break;
+		case 's':
+			logbuf.logpar[i++] = (LOGPAR) va_arg(ap, const char *);
+			break;
+		case '\0':
+			format--;
+			break;
+		default:
+			break;
+		}
+	}
+	va_end(ap);
+	(void) syslog_wri_log(prio, &logbuf);
+}
+
+#endif /* TOPPERS_OMIT_SYSLOG */
Index: asp3_wo_tecs/trunk/sample/Makefile
===================================================================
--- asp3_wo_tecs/trunk/sample/Makefile	(revision 302)
+++ asp3_wo_tecs/trunk/sample/Makefile	(revision 302)
@@ -0,0 +1,510 @@
+#
+#  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) 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: Makefile 492 2016-01-10 03:58:54Z ertl-hiro $
+# 
+
+#
+#  ã¿ã¼ã²ããã®æå®ï¼Makefile.targetã§ä¸æ¸ããããã®ãé²ãããï¼
+#
+all:
+
+#
+#  ã¿ã¼ã²ããç¥ç§°ã®å®ç¾©
+#
+TARGET = @(TARGET)
+
+#
+#  ãã­ã°ã©ãã³ã°è¨èªã®å®ç¾©
+#
+SRCLANG = @(SRCLANG)
+ifeq ($(SRCLANG),c)
+	LIBS = -lc
+endif
+ifeq ($(SRCLANG),c++)
+	USE_CXX = true
+	CXXLIBS = -lstdc++ -lm -lc
+	CXXRTS = cxxrt.o newlibrt.o
+endif
+
+#
+#  ã½ã¼ã¹ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+SRCDIR = @(SRCDIR)
+
+#
+#  ãªãã¸ã§ã¯ããã¡ã¤ã«åã®æ¡å¼µå­ã®è¨­å®
+#
+OBJEXT = @(OBJEXT)
+
+#
+#  ã«ã¼ãã«ã©ã¤ãã©ãªï¼libkernel.aï¼ã®ãã£ã¬ã¯ããªå
+#  ï¼ã«ã¼ãã«ã©ã¤ãã©ãªãmakeå¯¾è±¡ã«ããæã¯ï¼ç©ºã«å®ç¾©ããï¼
+#
+KERNEL_LIB = @(KERNEL_LIB)
+
+#
+#  ã«ã¼ãã«ãé¢æ°åä½ã§ã³ã³ãã¤ã«ãããã©ããã®å®ç¾©
+#
+KERNEL_FUNCOBJS = @(KERNEL_FUNCOBJS)
+
+#
+#  ãã¬ã¼ã¹ã­ã°ãåå¾ãããã©ããã®å®ç¾©
+#
+ENABLE_TRACE = @(ENABLE_TRACE)
+
+#
+#  éçºãã¼ã«ï¼ã³ã³ãã¤ã©ç­ï¼ã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+DEVTOOLDIR = @(DEVTOOLDIR)
+
+#
+#  ã¦ã¼ãã£ãªãã£ãã­ã°ã©ã ã®åç§°
+#
+CFG = @(CFG)
+
+#
+#  ãªãã¸ã§ã¯ããã¡ã¤ã«åã®å®ç¾©
+#
+OBJNAME = asp
+ifdef OBJEXT
+	OBJFILE = $(OBJNAME).$(OBJEXT)
+	CFG1_OUT = cfg1_out.$(OBJEXT)
+else
+	OBJFILE = $(OBJNAME)
+	CFG1_OUT = cfg1_out
+endif
+
+#
+#  ä¾å­é¢ä¿ãã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªã®å®ç¾©
+#
+DEPDIR = @(DEPDIR)
+
+#
+#  ã¿ã¼ã²ããä¾å­é¨ã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+TARGETDIR = $(SRCDIR)/target/$(TARGET)
+
+#
+#  ã¿ã¼ã²ããä¾å­ã®å®ç¾©ã®ã¤ã³ã¯ã«ã¼ã
+#
+include $(TARGETDIR)/Makefile.target
+
+#
+#  å
+±éã³ã³ãã¤ã«ãªãã·ã§ã³ã®å®ç¾©
+#
+COPTS := -g @(COPTS) $(COPTS)
+ifndef OMIT_WARNING_ALL
+	COPTS := -Wall $(COPTS)
+endif
+ifndef OMIT_OPTIMIZATION
+	COPTS := -O2 $(COPTS)
+endif
+CDEFS := $(CDEFS) @(CDEFS)
+INCLUDES := -I. -I$(SRCDIR)/include $(INCLUDES) -I$(SRCDIR)
+LDFLAGS := $(LDFLAGS) @(LDFLAGS)
+LIBS := $(LIBS) $(CXXLIBS)
+CFLAGS = $(COPTS) $(CDEFS) $(INCLUDES)
+
+#
+#  ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã«é¢ããå®ç¾©
+#
+APPLNAME = @(APPLNAME)
+APPLDIRS = @(APPLDIRS)
+APPL_CFG = @(CFGFILE)
+
+APPL_DIRS := $(APPLDIRS) $(SRCDIR)/library
+APPL_ASMOBJS :=
+ifdef USE_CXX
+	APPL_CXXOBJS := @(APPLOBJS)
+	APPL_COBJS :=
+else
+	APPL_COBJS := @(APPLOBJS)
+endif
+APPL_COBJS := $(APPL_COBJS) log_output.o vasyslog.o t_perror.o strerror.o
+APPL_CFLAGS := $(APPL_CFLAGS)
+ifdef APPLDIRS
+	INCLUDES := $(INCLUDES) $(foreach dir,$(APPLDIRS),-I$(dir))
+endif
+
+#
+#  ã·ã¹ãã ãµã¼ãã¹ã«é¢ããå®ç¾©
+#
+SYSSVC_DIRS := $(SYSSVC_DIRS) $(SRCDIR)/syssvc
+SYSSVC_ASMOBJS := $(SYSSVC_ASMOBJS)
+SYSSVC_COBJS := $(SYSSVC_COBJS) banner.o syslog.o serial.o logtask.o \
+				@(SYSSVCOBJS) $(CXXRTS)
+SYSSVC_CFLAGS := $(SYSSVC_CFLAGS)
+
+#
+#  ã¿ã¼ã²ãããã¡ã¤ã«ï¼è¤æ°ãåæã«é¸æãã¦ã¯ãªããªãï¼
+#
+all: $(OBJFILE)
+#all: $(OBJNAME).bin
+#all: $(OBJNAME).srec
+
+##### ä»¥ä¸ã¯ç·¨éããªããã¨ #####
+
+#
+#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«é¢ããå®ç¾©
+#
+CFG_TABS := --api-table $(SRCDIR)/kernel/kernel_api.csv \
+			--cfg1-def-table $(SRCDIR)/kernel/kernel_def.csv $(CFG_TABS)
+CFG_ASMOBJS := $(CFG_ASMOBJS)
+CFG_COBJS := kernel_cfg.o $(CFG_COBJS)
+CFG_OBJS := $(CFG_ASMOBJS) $(CFG_COBJS)
+CFG2_OUT_SRCS := kernel_cfg.h kernel_cfg.c $(CFG2_OUT_SRCS)
+CFG_CFLAGS := $(CFG_CFLAGS)
+
+#
+#  ã«ã¼ãã«ã«é¢ããå®ç¾©
+#
+#  KERNEL_ASMOBJS: ã«ã¼ãã«ã©ã¤ãã©ãªã«å«ããï¼ã½ã¼ã¹ãã¢ã»ã³ããªè¨èªã®
+#				   ãªãã¸ã§ã¯ããã¡ã¤ã«ï¼
+#  KERNEL_COBJS: ã«ã¼ãã«ã®ã©ã¤ãã©ãªã«å«ããï¼ã½ã¼ã¹ãCè¨èªã§ï¼ã½ã¼ã¹
+#				 ãã¡ã¤ã«ã¨1å¯¾1ã«å¯¾å¿ãããªãã¸ã§ã¯ããã¡ã¤ã«ï¼
+#  KERNEL_LCSRCS: ã«ã¼ãã«ã®ã©ã¤ãã©ãªã«å«ããCè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ã§ï¼
+#				  1ã¤ã®ã½ã¼ã¹ãã¡ã¤ã«ããè¤æ°ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ãç
+#				  æãããã®ï¼
+#  KERNEL_LCOBJS: ä¸ã®ã½ã¼ã¹ãã¡ã¤ã«ããçæããããªãã¸ã§ã¯ããã¡ã¤ã«ï¼
+#
+KERNEL_DIRS := $(KERNEL_DIRS) $(SRCDIR)/kernel
+KERNEL_ASMOBJS := $(KERNEL_ASMOBJS)
+KERNEL_COBJS := $(KERNEL_COBJS)
+KERNEL_CFLAGS := $(KERNEL_CFLAGS) -I$(SRCDIR)/kernel
+
+#
+#  ã«ã¼ãã«ã®ãã¡ã¤ã«æ§æã®å®ç¾©
+#
+include $(SRCDIR)/kernel/Makefile.kernel
+ifdef KERNEL_FUNCOBJS
+	KERNEL_LCSRCS := $(KERNEL_FCSRCS)
+	KERNEL_LCOBJS := $(foreach file,$(KERNEL_FCSRCS),$($(file:.c=)))
+else
+	KERNEL_CFLAGS := -DALLFUNC $(KERNEL_CFLAGS)
+	KERNEL_COBJS := $(KERNEL_COBJS) \
+					$(foreach file,$(KERNEL_FCSRCS),$(file:.c=.o))
+endif
+ifdef OMIT_OFFSET_H
+	OFFSET_H =
+else
+	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
+endif
+
+#
+#  ã½ã¼ã¹ãã¡ã¤ã«ã®ãããã£ã¬ã¯ããªã«é¢ããå®ç¾©
+#
+vpath %.c $(KERNEL_DIRS) $(SYSSVC_DIRS) $(APPL_DIRS)
+vpath %.S $(KERNEL_DIRS) $(SYSSVC_DIRS) $(APPL_DIRS)
+vpath %.cfg $(APPL_DIRS)
+
+#
+#  ã³ã³ãã¤ã«ã®ããã®å¤æ°ã®å®ç¾©
+#
+KERNEL_LIB_OBJS = $(KERNEL_ASMOBJS) $(KERNEL_COBJS) $(KERNEL_LCOBJS)
+SYSSVC_OBJS = $(SYSSVC_ASMOBJS) $(SYSSVC_COBJS)
+APPL_OBJS = $(APPL_ASMOBJS) $(APPL_COBJS) $(APPL_CXXOBJS)
+ALL_OBJS = $(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
+											$(END_OBJS) $(HIDDEN_OBJS)
+ifdef KERNEL_LIB
+	ALL_LIBS = -lkernel $(LIBS)
+	LIBS_DEP = $(KERNEL_LIB)/libkernel.a $(filter %.a,$(LIBS))
+	OBJ_LDFLAGS := $(OBJ_LDFLAGS) -L$(KERNEL_LIB)
+	REALCLEAN_FILES := libkernel.a $(REALCLEAN_FILES)
+else
+	ALL_LIBS = libkernel.a $(LIBS)
+	LIBS_DEP = libkernel.a $(filter %.a,$(LIBS))
+endif
+
+ifdef TEXT_START_ADDRESS
+	LDFLAGS := $(LDFLAGS) -Wl,-Ttext,$(TEXT_START_ADDRESS)
+endif
+ifdef DATA_START_ADDRESS
+	LDFLAGS := $(LDFLAGS) -Wl,-Tdata,$(DATA_START_ADDRESS)
+endif
+ifdef LDSCRIPT
+	LDFLAGS := $(LDFLAGS) -T $(LDSCRIPT)
+endif
+
+#
+#  ã«ã¼ãã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã®çæ
+#
+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)
+	$(LINK) $(CFLAGS) $(LDFLAGS) $(CFG1_OUT_LDFLAGS) -o $(CFG1_OUT) \
+						$(START_OBJS) cfg1_out.o $(END_OBJS)
+	$(NM) -n $(CFG1_OUT) > cfg1_out.syms
+	$(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
+
+#
+#  ãªãã»ãããã¡ã¤ã«ï¼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
+
+#
+#  ã«ã¼ãã«ã©ã¤ãã©ãªãã¡ã¤ã«ã®çæ
+#
+libkernel.a: $(OFFSET_H) $(KERNEL_LIB_OBJS)
+	rm -f libkernel.a
+	$(AR) -rcs libkernel.a $(KERNEL_LIB_OBJS)
+	$(RANLIB) libkernel.a
+
+#
+#  ç¹å¥ãªä¾å­é¢ä¿ã®å®ç¾©
+#
+banner.o: $(filter-out banner.o,$(ALL_OBJS)) $(LIBS_DEP)
+
+#
+#  å
+¨ä½ã®ãªã³ã¯
+#
+$(OBJFILE): $(APPL_CFG) kernel_cfg.h $(ALL_OBJS) $(LIBS_DEP)
+	$(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) \
+			$(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
+			$(ALL_LIBS) $(END_OBJS)
+	$(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) $<
+
+#
+#  ãã¤ããªãã¡ã¤ã«ã®çæ
+#
+$(OBJNAME).bin: $(OBJFILE)
+	$(OBJCOPY) -O binary -S $(OBJFILE) $(OBJNAME).bin
+
+#
+#  Sã¬ã³ã¼ããã¡ã¤ã«ã®çæ
+#
+$(OBJNAME).srec: $(OBJFILE)
+	$(OBJCOPY) -O srec -S $(OBJFILE) $(OBJNAME).srec
+
+#
+#  ã³ã³ãã¤ã«çµæã®æ¶å»
+#
+.PHONY: clean
+clean:
+	rm -f \#* *~ *.o $(CLEAN_FILES) offset.timestamp $(OFFSET_H)
+	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
+ifndef KERNEL_LIB
+	rm -f libkernel.a
+endif
+
+.PHONY: cleankernel
+cleankernel:
+	rm -f $(OFFSET_H) $(KERNEL_LIB_OBJS)
+	rm -f $(KERNEL_LIB_OBJS:%.o=$(DEPDIR)/%.d)
+
+.PHONY: realclean
+realclean: clean
+	rm -f $(REALCLEAN_FILES)
+
+#
+#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãçæãããã¡ã¤ã«ã®ã³ã³ãã¤ã«ã«ã¼ã«ã®å®ç¾©
+#
+#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãçæãããã¡ã¤ã«ã¯ï¼å
+±éã®ã³ã³ãã¤ã«ãªãã·ã§ã³
+#  ã®ã¿ãä»ãã¦ã³ã³ãã¤ã«ããï¼
+#
+ALL_CFG_COBJS = $(CFG_COBJS) cfg1_out.o
+ALL_CFG_ASMOBJS = $(CFG_ASMOBJS)
+
+$(ALL_CFG_COBJS): %.o: %.c
+	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $<
+
+$(ALL_CFG_COBJS:.o=.s): %.s: %.c
+	$(CC) -S $(CFLAGS) $(CFG_CFLAGS) $<
+
+$(ALL_CFG_ASMOBJS): %.o: %.S
+	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $<
+
+#
+#  ä¾å­é¢ä¿ãã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
+#
+-include $(DEPDIR)/*.d
+
+#
+#  éçºãã¼ã«ã®ã³ãã³ãåã®å®ç¾©
+#
+ifeq ($(TOOL),gcc)
+	#
+	#  GNUéçºç°å¢ç¨
+	#
+	ifdef GCC_TARGET
+		GCC_TARGET_PREFIX = $(GCC_TARGET)-
+	else
+		GCC_TARGET_PREFIX =
+	endif
+	CC := $(GCC_TARGET_PREFIX)gcc
+	CXX := $(GCC_TARGET_PREFIX)g++
+	AS := $(GCC_TARGET_PREFIX)as
+	LD := $(GCC_TARGET_PREFIX)ld
+	AR := $(GCC_TARGET_PREFIX)ar
+	NM := $(GCC_TARGET_PREFIX)nm
+	RANLIB := $(GCC_TARGET_PREFIX)ranlib
+	OBJCOPY := $(GCC_TARGET_PREFIX)objcopy
+	OBJDUMP := $(GCC_TARGET_PREFIX)objdump
+endif
+
+ifdef DEVTOOLDIR
+	CC := $(DEVTOOLDIR)/$(CC)
+	CXX := $(DEVTOOLDIR)/$(CXX)
+	AS := $(DEVTOOLDIR)/$(AS)
+	LD := $(DEVTOOLDIR)/$(LD)
+	AR := $(DEVTOOLDIR)/$(AR)
+	NM := $(DEVTOOLDIR)/$(NM)
+	RANLIB := $(DEVTOOLDIR)/$(RANLIB)
+	OBJCOPY := $(DEVTOOLDIR)/$(OBJCOPY)
+	OBJDUMP := $(DEVTOOLDIR)/$(OBJDUMP)
+endif
+
+ifdef USE_CXX
+	LINK = $(CXX)
+else
+	LINK = $(CC)
+endif
+
+#
+#  ã³ã³ãã¤ã«ã«ã¼ã«ã®å®ç¾©
+#
+$(KERNEL_COBJS): %.o: %.c
+	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+$(KERNEL_COBJS:.o=.s): %.s: %.c
+	$(CC) -S $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+$(KERNEL_LCOBJS): %.o:
+	$(CC) -DTOPPERS_$(*F) -o $@ -c -MD -MP -MF $(DEPDIR)/$*.d \
+									$(CFLAGS) $(KERNEL_CFLAGS) $<
+
+$(KERNEL_LCOBJS:.o=.s): %.s:
+	$(CC) -DTOPPERS_$(*F) -o $@ -S $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+$(KERNEL_ASMOBJS): %.o: %.S
+	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+$(SYSSVC_COBJS): %.o: %.c
+	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $<
+
+$(SYSSVC_COBJS:.o=.s): %.s: %.c
+	$(CC) -S $(CFLAGS) $(SYSSVC_CFLAGS) $<
+
+$(SYSSVC_ASMOBJS): %.o: %.S
+	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $<
+
+$(APPL_COBJS): %.o: %.c
+	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $<
+
+$(APPL_COBJS:.o=.s): %.s: %.c
+	$(CC) -S $(CFLAGS) $(APPL_CFLAGS) $<
+
+$(APPL_CXXOBJS): %.o: %.cpp
+	$(CXX) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $<
+
+$(APPL_CXXOBJS:.o=.s): %.s: %.cpp
+	$(CXX) -S $(CFLAGS) $(APPL_CFLAGS) $<
+
+$(APPL_ASMOBJS): %.o: %.S
+	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $<
+
+#
+#  ããã©ã«ãã³ã³ãã¤ã«ã«ã¼ã«ãä¸æ¸ã
+#
+%.o: %.c
+	@echo "*** Default compile rules should not be used."
+	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<
+
+%.s: %.c
+	@echo "*** Default compile rules should not be used."
+	$(CC) -S $(CFLAGS) $<
+
+%.o: %.cpp
+	@echo "*** Default compile rules should not be used."
+	$(CXX) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<
+
+%.s: %.cpp
+	@echo "*** Default compile rules should not be used."
+	$(CXX) -S $(CFLAGS) $<
+
+%.o: %.S
+	@echo "*** Default compile rules should not be used."
+	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<
Index: asp3_wo_tecs/trunk/sample/sample1.c
===================================================================
--- asp3_wo_tecs/trunk/sample/sample1.c	(revision 302)
+++ asp3_wo_tecs/trunk/sample/sample1.c	(revision 302)
@@ -0,0 +1,555 @@
+/*
+ *  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) 2004-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: sample1.c 346 2015-07-18 02:12:08Z ertl-hiro $
+ */
+
+/* 
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®æ¬ä½
+ *
+ *  ASPã«ã¼ãã«ã®åºæ¬çãªåä½ãç¢ºèªããããã®ãµã³ãã«ãã­ã°ã©ã ï¼
+ *
+ *  ãã­ã°ã©ã ã®æ¦è¦:
+ *
+ *  ã¦ã¼ã¶ã¤ã³ã¿ãã§ã¼ã¹ãåãæã¤ã¡ã¤ã³ã¿ã¹ã¯ï¼ã¿ã¹ã¯ID: MAIN_TASKï¼åª
+ *  å
+åº¦: MAIN_PRIORITYï¼ã¨ï¼3ã¤ã®ä¸¦è¡å®è¡ãããã¿ã¹ã¯ï¼ã¿ã¹ã¯ID:
+ *  TASK1ãTASK3ï¼åæåªå
+åº¦: MID_PRIORITYï¼ã§æ§æãããï¼ã¾ãï¼èµ·åå¨
+ *  æã2ç§ã®å¨æãã³ãã©ï¼å¨æãã³ãã©ID: CYCHDR1ï¼ãç¨ããï¼
+ *
+ *  ä¸¦è¡å®è¡ãããã¿ã¹ã¯ã¯ï¼task_loopåç©ºã«ã¼ããå®è¡ããåº¦ã«ï¼ã¿ã¹ã¯ã
+ *  å®è¡ä¸­ã§ãããã¨ãããããã¡ãã»ã¼ã¸ãè¡¨ç¤ºããï¼ç©ºã«ã¼ããå®è¡ãã
+ *  ã®ã¯ï¼ç©ºã«ã¼ããªãã§ã¡ãã»ã¼ã¸ãåºåããã¨ï¼å¤éã®ã¡ãã»ã¼ã¸ãåºå
+ *  ããï¼ãã­ã°ã©ã ã®åä½ãç¢ºèªãããããªãããã§ããï¼ã¾ãï¼ä½éãªã·
+ *  ãªã¢ã«ãã¼ããç¨ãã¦ã¡ãã»ã¼ã¸ãåºåããå ´åã«ï¼ãã¹ã¦ã®ã¡ãã»ã¼ã¸
+ *  ãåºåã§ããããã«ï¼ã¡ãã»ã¼ã¸ã®éãå¶éããã¨ããçç±ãããï¼
+ *
+ *  å¨æãã³ãã©ã¯ï¼ä¸ã¤ã®åªå
+åº¦ï¼HIGH_PRIORITYï¼MID_PRIORITYï¼
+ *  LOW_PRIORITYï¼ã®ã¬ãã£ã­ã¥ã¼ãåè»¢ãããï¼ãã­ã°ã©ã ã®èµ·åç´å¾ã¯ï¼
+ *  å¨æãã³ãã©ã¯åæ­¢ç¶æ
+ã«ãªã£ã¦ããï¼
+ *
+ *  ã¡ã¤ã³ã¿ã¹ã¯ã¯ï¼ã·ãªã¢ã«I/Oãã¼ãããã®æå­å
+¥åãè¡ãï¼æå­å
+¥åã
+ *  å¾
+ã£ã¦ããéã¯ï¼ä¸¦è¡å®è¡ãããã¿ã¹ã¯ãå®è¡ããã¦ããï¼ï¼å
+¥åããã
+ *  æå­ã«å¯¾å¿ããå¦çãå®è¡ããï¼å
+¥åãããæå­ã¨å¦çã®é¢ä¿ã¯æ¬¡ã®éãï¼
+ *  Control-Cã¾ãã¯'Q'ãå
+¥åãããã¨ï¼ãã­ã°ã©ã ãçµäºããï¼
+ *
+ *  '1' : å¯¾è±¡ã¿ã¹ã¯ãTASK1ã«åãæããï¼åæè¨­å®ï¼ï¼
+ *  '2' : å¯¾è±¡ã¿ã¹ã¯ãTASK2ã«åãæããï¼
+ *  '3' : å¯¾è±¡ã¿ã¹ã¯ãTASK3ã«åãæããï¼
+ *  'a' : å¯¾è±¡ã¿ã¹ã¯ãact_tskã«ããèµ·åããï¼
+ *  'A' : å¯¾è±¡ã¿ã¹ã¯ã«å¯¾ããèµ·åè¦æ±ãcan_actã«ããã­ã£ã³ã»ã«ããï¼
+ *  'e' : å¯¾è±¡ã¿ã¹ã¯ã«ext_tskãå¼ã³åºããï¼çµäºãããï¼
+ *  't' : å¯¾è±¡ã¿ã¹ã¯ãter_tskã«ããå¼·å¶çµäºããï¼
+ *  '>' : å¯¾è±¡ã¿ã¹ã¯ã®åªå
+åº¦ãHIGH_PRIORITYã«ããï¼
+ *  '=' : å¯¾è±¡ã¿ã¹ã¯ã®åªå
+åº¦ãMID_PRIORITYã«ããï¼
+ *  '<' : å¯¾è±¡ã¿ã¹ã¯ã®åªå
+åº¦ãLOW_PRIORITYã«ããï¼
+ *  'G' : å¯¾è±¡ã¿ã¹ã¯ã®åªå
+åº¦ãget_priã§èª­ã¿åºãï¼
+ *  's' : å¯¾è±¡ã¿ã¹ã¯ã«slp_tskãå¼ã³åºããï¼èµ·åºå¾
+ã¡ã«ãããï¼
+ *  'S' : å¯¾è±¡ã¿ã¹ã¯ã«tslp_tsk(10ç§)ãå¼ã³åºããï¼èµ·åºå¾
+ã¡ã«ãããï¼
+ *  'w' : å¯¾è±¡ã¿ã¹ã¯ãwup_tskã«ããèµ·åºããï¼
+ *  'W' : å¯¾è±¡ã¿ã¹ã¯ã«å¯¾ããèµ·åºè¦æ±ãcan_wupã«ããã­ã£ã³ã»ã«ããï¼
+ *  'l' : å¯¾è±¡ã¿ã¹ã¯ãrel_waiã«ããå¼·å¶çã«å¾
+ã¡è§£é¤ã«ããï¼
+ *  'u' : å¯¾è±¡ã¿ã¹ã¯ãsus_tskã«ããå¼·å¶å¾
+ã¡ç¶æ
+ã«ããï¼
+ *  'm' : å¯¾è±¡ã¿ã¹ã¯ã®å¼·å¶å¾
+ã¡ç¶æ
+ãrsm_tskã«ããè§£é¤ããï¼
+ *  'd' : å¯¾è±¡ã¿ã¹ã¯ã«dly_tsk(10ç§)ãå¼ã³åºããï¼æéçµéå¾
+ã¡ã«ãããï¼
+ *  'x' : å¯¾è±¡ã¿ã¹ã¯ã«ras_terã«ããçµäºè¦æ±ããï¼
+ *  'y' : å¯¾è±¡ã¿ã¹ã¯ã«dis_terãå¼ã³åºããï¼ã¿ã¹ã¯çµäºãç¦æ­¢ããï¼
+ *  'Y' : å¯¾è±¡ã¿ã¹ã¯ã«ena_terãå¼ã³åºããï¼ã¿ã¹ã¯çµäºãè¨±å¯ããï¼
+ *  'r' : 3ã¤ã®åªå
+åº¦ï¼HIGH_PRIORITYï¼MID_PRIORITYï¼LOW_PRIORITYï¼ã®ã¬
+ *        ãã£ã­ã¥ã¼ãåè»¢ãããï¼
+ *  'c' : å¨æãã³ãã©ãåä½éå§ãããï¼
+ *  'C' : å¨æãã³ãã©ãåä½åæ­¢ãããï¼
+ *  'b' : ã¢ã©ã¼ã ãã³ãã©ã5ç§å¾ã«èµ·åããããåä½éå§ãããï¼
+ *  'B' : ã¢ã©ã¼ã ãã³ãã©ãåä½åæ­¢ãããï¼
+ *  'z' : å¯¾è±¡ã¿ã¹ã¯ã«CPUä¾å¤ãçºçãããï¼ã¿ã¹ã¯ãçµäºãããï¼ï¼
+ *  'Z' : å¯¾è±¡ã¿ã¹ã¯ã«CPUã­ãã¯ç¶æ
+ã§CPUä¾å¤ãçºçãããï¼ãã­ã°ã©ã ã
+ *        çµäºããï¼ï¼
+ *  'V' : fch_hrtã§é«åè§£è½ã¿ã¤ãã2åèª­ãï¼
+ *  'v' : çºè¡ããã·ã¹ãã ã³ã¼ã«ãè¡¨ç¤ºããï¼ããã©ã«ãï¼ï¼
+ *  'q' : çºè¡ããã·ã¹ãã ã³ã¼ã«ãè¡¨ç¤ºããªãï¼
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include <t_stdlib.h>
+#include "syssvc/serial.h"
+#include "syssvc/syslog.h"
+#include "kernel_cfg.h"
+#include "sample1.h"
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«ã®ã¨ã©ã¼ã®ã­ã°åºå
+ */
+Inline void
+svc_perror(const char *file, int_t line, const char *expr, ER ercd)
+{
+	if (ercd < 0) {
+		t_perror(LOG_ERROR, file, line, expr, ercd);
+	}
+}
+
+#define	SVC_PERROR(expr)	svc_perror(__FILE__, __LINE__, #expr, (expr))
+
+/*
+ *  ä¸¦è¡å®è¡ãããã¿ã¹ã¯ã¸ã®ã¡ãã»ã¼ã¸é å
+ */
+char	message[3];
+
+/*
+ *  ã«ã¼ãåæ°
+ */
+ulong_t	task_loop;		/* ã¿ã¹ã¯å
+ã§ã®ã«ã¼ãåæ° */
+
+/*
+ *  ä¸¦è¡å®è¡ãããã¿ã¹ã¯
+ */
+void task(intptr_t exinf)
+{
+	volatile ulong_t	i;
+	int_t		n = 0;
+	int_t		tskno = (int_t) exinf;
+	const char	*graph[] = { "|", "  +", "    *" };
+	char		c;
+
+	while (true) {
+		syslog(LOG_NOTICE, "task%d is running (%03d).   %s",
+										tskno, ++n, graph[tskno-1]);
+		for (i = 0; i < task_loop; i++);
+		c = message[tskno-1];
+		message[tskno-1] = 0;
+		switch (c) {
+		case 'e':
+			syslog(LOG_INFO, "#%d#ext_tsk()", tskno);
+			SVC_PERROR(ext_tsk());
+			assert(0);
+		case 's':
+			syslog(LOG_INFO, "#%d#slp_tsk()", tskno);
+			SVC_PERROR(slp_tsk());
+			break;
+		case 'S':
+			syslog(LOG_INFO, "#%d#tslp_tsk(10000000)", tskno);
+			SVC_PERROR(tslp_tsk(10000000));
+			break;
+		case 'd':
+			syslog(LOG_INFO, "#%d#dly_tsk(10000000)", tskno);
+			SVC_PERROR(dly_tsk(10000000));
+			break;
+		case 'y':
+			syslog(LOG_INFO, "#%d#dis_ter()", tskno);
+			SVC_PERROR(dis_ter());
+			break;
+		case 'Y':
+			syslog(LOG_INFO, "#%d#ena_ter()", tskno);
+			SVC_PERROR(ena_ter());
+			break;
+#ifdef CPUEXC1
+		case 'z':
+			syslog(LOG_NOTICE, "#%d#raise CPU exception", tskno);
+			RAISE_CPU_EXCEPTION;
+			break;
+		case 'Z':
+			SVC_PERROR(loc_cpu());
+			syslog(LOG_NOTICE, "#%d#raise CPU exception", tskno);
+			RAISE_CPU_EXCEPTION;
+			SVC_PERROR(unl_cpu());
+			break;
+#endif /* CPUEXC1 */
+		default:
+			break;
+		}
+	}
+}
+
+/*
+ *  CPUä¾å¤ãã³ãã©
+ */
+ID	cpuexc_tskid;		/* CPUä¾å¤ãèµ·ãããã¿ã¹ã¯ã®ID */
+
+#ifdef CPUEXC1
+
+void
+cpuexc_handler(void *p_excinf)
+{
+	syslog(LOG_NOTICE, "CPU exception handler (p_excinf = %08p).", p_excinf);
+	if (sns_ctx() != true) {
+		syslog(LOG_WARNING,
+					"sns_ctx() is not true in CPU exception handler.");
+	}
+	if (sns_dpn() != true) {
+		syslog(LOG_WARNING,
+					"sns_dpn() is not true in CPU exception handler.");
+	}
+	syslog(LOG_INFO, "sns_loc = %d sns_dsp = %d xsns_dpn = %d",
+								sns_loc(), sns_dsp(), xsns_dpn(p_excinf));
+
+	if (xsns_dpn(p_excinf)) {
+		syslog(LOG_NOTICE, "Sample program ends with exception.");
+		SVC_PERROR(ext_ker());
+		assert(0);
+	}
+
+#ifdef PREPARE_RETURN_CPUEXC
+	PREPARE_RETURN_CPUEXC;
+	SVC_PERROR(get_tid(&cpuexc_tskid));
+	SVC_PERROR(act_tsk(EXC_TASK));
+#else /* PREPARE_RETURN_CPUEXC */
+	syslog(LOG_NOTICE, "Sample program ends with exception.");
+	SVC_PERROR(ext_ker());
+	assert(0);
+#endif /* PREPARE_RETURN_CPUEXC */
+}
+
+#endif /* CPUEXC1 */
+
+/*
+ *  å¨æãã³ãã©
+ *
+ *  HIGH_PRIORITYï¼MID_PRIORITYï¼LOW_PRIORITY ã®ååªå
+åº¦ã®ã¬ãã£ã­ã¥ã¼
+ *  ãåè»¢ãããï¼
+ */
+void cyclic_handler(intptr_t exinf)
+{
+	SVC_PERROR(rot_rdq(HIGH_PRIORITY));
+	SVC_PERROR(rot_rdq(MID_PRIORITY));
+	SVC_PERROR(rot_rdq(LOW_PRIORITY));
+}
+
+/*
+ *  ã¢ã©ã¼ã ãã³ãã©
+ *
+ *  HIGH_PRIORITYï¼MID_PRIORITYï¼LOW_PRIORITY ã®ååªå
+åº¦ã®ã¬ãã£ã­ã¥ã¼
+ *  ãåè»¢ãããï¼
+ */
+void alarm_handler(intptr_t exinf)
+{
+	SVC_PERROR(rot_rdq(HIGH_PRIORITY));
+	SVC_PERROR(rot_rdq(MID_PRIORITY));
+	SVC_PERROR(rot_rdq(LOW_PRIORITY));
+}
+
+/*
+ *  ä¾å¤å¦çã¿ã¹ã¯
+ */
+void exc_task(intptr_t exinf)
+{
+	SVC_PERROR(ras_ter(cpuexc_tskid));
+}
+
+/*
+ *  ã¡ã¤ã³ã¿ã¹ã¯
+ */
+void main_task(intptr_t exinf)
+{
+	char	c;
+	ID		tskid = TASK1;
+	int_t	tskno = 1;
+	ER_UINT	ercd;
+	PRI		tskpri;
+#ifndef TASK_LOOP
+	volatile ulong_t	i;
+	SYSTIM	stime1, stime2;
+#endif /* TASK_LOOP */
+	HRTCNT	hrtcnt1, hrtcnt2;
+
+	SVC_PERROR(syslog_msk_log(LOG_UPTO(LOG_INFO), LOG_UPTO(LOG_EMERG)));
+	syslog(LOG_NOTICE, "Sample program starts (exinf = %d).", (int_t) exinf);
+
+	/*
+	 *  ã·ãªã¢ã«ãã¼ãã®åæå
+	 *
+	 *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã¨åãã·ãªã¢ã«ãã¼ããä½¿ãå ´åãªã©ï¼ã·ãªã¢ã«
+	 *  ãã¼ãããªã¼ãã³æ¸ã¿ã®å ´åã«ã¯ããã§E_OBJã¨ã©ã¼ã«ãªããï¼æ¯éã¯
+	 *  ãªãï¼
+	 */
+	ercd = serial_opn_por(TASK_PORTID);
+	if (ercd < 0 && MERCD(ercd) != E_OBJ) {
+		syslog(LOG_ERROR, "%s (%d) reported by `serial_opn_por'.",
+									itron_strerror(ercd), SERCD(ercd));
+	}
+	SVC_PERROR(serial_ctl_por(TASK_PORTID,
+							(IOCTL_CRLF | IOCTL_FCSND | IOCTL_FCRCV)));
+
+	/*
+ 	 *  ã«ã¼ãåæ°ã®è¨­å®
+	 *
+	 *  ä¸¦è¡å®è¡ãããã¿ã¹ã¯å
+ã§ã®ç©ºã«ã¼ãã®åæ°ï¼task_loopï¼ã¯ï¼ç©ºã«ã¼
+	 *  ãã®å®è¡æéãç´0.4ç§ã«ãªãããã«è¨­å®ããï¼ãã®è¨­å®ã®ããã«ï¼
+	 *  LOOP_REFåã®ç©ºã«ã¼ãã®å®è¡æéãï¼ãã®åå¾ã§get_timãå¼ã¶ãã¨ã§
+	 *  æ¸¬å®ãï¼ãã®æ¸¬å®çµæããç©ºã«ã¼ãã®å®è¡æéã0.4ç§ã«ãªãã«ã¼ãå
+	 *  æ°ãæ±ãï¼task_loopã«è¨­å®ããï¼
+	 *
+	 *  LOOP_REFã¯ï¼ããã©ã«ãã§ã¯1,000,000ã«è¨­å®ãã¦ãããï¼æ³å®ããã
+	 *  ãé
+ããã­ã»ããµã§ã¯ï¼ãµã³ãã«ãã­ã°ã©ã ã®å®è¡éå§ã«æéããã
+	 *  ããããã¨ããåé¡ãçããï¼éã«æ³å®ããããéããã­ã»ããµã§ã¯ï¼
+	 *  LOOP_REFåã®ç©ºã«ã¼ãã®å®è¡æéãç­ããªãï¼task_loopã«è¨­å®ããå¤
+	 *  ã®èª¤å·®ãå¤§ãããªãã¨ããåé¡ãããï¼
+	 *
+	 *  ããã§ï¼ãã®ãããªã¿ã¼ã²ããã§ã¯ï¼target_test.hã§ï¼LOOP_REFãé©
+	 *  åãªå¤ã«å®ç¾©ããã®ãæã¾ããï¼
+	 *
+	 *  ã¾ãï¼task_loopã®å¤ãåºå®ãããå ´åã«ã¯ï¼ãã®å¤ãTASK_LOOPã«ã
+	 *  ã¯ã­å®ç¾©ããï¼TASK_LOOPããã¯ã­å®ç¾©ããã¦ããå ´åï¼ä¸è¨ã®æ¸¬å®ã
+	 *  è¡ããã«ï¼TASK_LOOPã«å®ç¾©ãããå¤ãç©ºã«ã¼ãã®åæ°ã¨ããï¼
+	 *
+	 * ã¿ã¼ã²ããã«ãã£ã¦ã¯ï¼ç©ºã«ã¼ãã®å®è¡æéã®1åç®ã®æ¸¬å®ã§ï¼æ¬æ¥ã
+	 * ããé·ãã«ãªããã®ãããï¼ãã®ãããªã¿ã¼ã²ããã§ã¯ï¼MEASURE_TWICE
+	 * ããã¯ã­å®ç¾©ãããã¨ã§ï¼1åç®ã®æ¸¬å®çµæãæ¨ã¦ã¦ï¼2åç®ã®æ¸¬å®çµæ
+	 * ãä½¿ãï¼
+	 */
+#ifdef TASK_LOOP
+	task_loop = TASK_LOOP;
+#else /* TASK_LOOP */
+
+#ifdef MEASURE_TWICE
+	task_loop = LOOP_REF;
+	SVC_PERROR(get_tim(&stime1));
+	for (i = 0; i < task_loop; i++);
+	SVC_PERROR(get_tim(&stime2));
+#endif /* MEASURE_TWICE */
+
+	task_loop = LOOP_REF;
+	SVC_PERROR(get_tim(&stime1));
+	for (i = 0; i < task_loop; i++);
+	SVC_PERROR(get_tim(&stime2));
+	task_loop = LOOP_REF * 400LU / (ulong_t)(stime2 - stime1) * 1000LU;
+
+#endif /* TASK_LOOP */
+
+	/*
+ 	 *  ã¿ã¹ã¯ã®èµ·å
+	 */
+	SVC_PERROR(act_tsk(TASK1));
+	SVC_PERROR(act_tsk(TASK2));
+	SVC_PERROR(act_tsk(TASK3));
+
+	/*
+ 	 *  ã¡ã¤ã³ã«ã¼ã
+	 */
+	do {
+		SVC_PERROR(serial_rea_dat(TASK_PORTID, &c, 1));
+		switch (c) {
+		case 'e':
+		case 's':
+		case 'S':
+		case 'd':
+		case 'y':
+		case 'Y':
+		case 'z':
+		case 'Z':
+			message[tskno-1] = c;
+			break;
+		case '1':
+			tskno = 1;
+			tskid = TASK1;
+			break;
+		case '2':
+			tskno = 2;
+			tskid = TASK2;
+			break;
+		case '3':
+			tskno = 3;
+			tskid = TASK3;
+			break;
+		case 'a':
+			syslog(LOG_INFO, "#act_tsk(%d)", tskno);
+			SVC_PERROR(act_tsk(tskid));
+			break;
+		case 'A':
+			syslog(LOG_INFO, "#can_act(%d)", tskno);
+			SVC_PERROR(ercd = can_act(tskid));
+			if (ercd >= 0) {
+				syslog(LOG_NOTICE, "can_act(%d) returns %d", tskno, ercd);
+			}
+			break;
+		case 't':
+			syslog(LOG_INFO, "#ter_tsk(%d)", tskno);
+			SVC_PERROR(ter_tsk(tskid));
+			break;
+		case '>':
+			syslog(LOG_INFO, "#chg_pri(%d, HIGH_PRIORITY)", tskno);
+			SVC_PERROR(chg_pri(tskid, HIGH_PRIORITY));
+			break;
+		case '=':
+			syslog(LOG_INFO, "#chg_pri(%d, MID_PRIORITY)", tskno);
+			SVC_PERROR(chg_pri(tskid, MID_PRIORITY));
+			break;
+		case '<':
+			syslog(LOG_INFO, "#chg_pri(%d, LOW_PRIORITY)", tskno);
+			SVC_PERROR(chg_pri(tskid, LOW_PRIORITY));
+			break;
+		case 'G':
+			syslog(LOG_INFO, "#get_pri(%d, &tskpri)", tskno);
+			SVC_PERROR(ercd = get_pri(tskid, &tskpri));
+			if (ercd >= 0) {
+				syslog(LOG_NOTICE, "priority of task %d is %d", tskno, tskpri);
+			}
+			break;
+		case 'w':
+			syslog(LOG_INFO, "#wup_tsk(%d)", tskno);
+			SVC_PERROR(wup_tsk(tskid));
+			break;
+		case 'W':
+			syslog(LOG_INFO, "#can_wup(%d)", tskno);
+			SVC_PERROR(ercd = can_wup(tskid));
+			if (ercd >= 0) {
+				syslog(LOG_NOTICE, "can_wup(%d) returns %d", tskno, ercd);
+			}
+			break;
+		case 'l':
+			syslog(LOG_INFO, "#rel_wai(%d)", tskno);
+			SVC_PERROR(rel_wai(tskid));
+			break;
+		case 'u':
+			syslog(LOG_INFO, "#sus_tsk(%d)", tskno);
+			SVC_PERROR(sus_tsk(tskid));
+			break;
+		case 'm':
+			syslog(LOG_INFO, "#rsm_tsk(%d)", tskno);
+			SVC_PERROR(rsm_tsk(tskid));
+			break;
+		case 'x':
+			syslog(LOG_INFO, "#ras_ter(%d)", tskno);
+			SVC_PERROR(ras_ter(tskid));
+			break;
+		case 'r':
+			syslog(LOG_INFO, "#rot_rdq(three priorities)");
+			SVC_PERROR(rot_rdq(HIGH_PRIORITY));
+			SVC_PERROR(rot_rdq(MID_PRIORITY));
+			SVC_PERROR(rot_rdq(LOW_PRIORITY));
+			break;
+		case 'c':
+			syslog(LOG_INFO, "#sta_cyc(1)");
+			SVC_PERROR(sta_cyc(CYCHDR1));
+			break;
+		case 'C':
+			syslog(LOG_INFO, "#stp_cyc(1)");
+			SVC_PERROR(stp_cyc(CYCHDR1));
+			break;
+		case 'b':
+			syslog(LOG_INFO, "#sta_alm(1, 5000000)");
+			SVC_PERROR(sta_alm(ALMHDR1, 5000000));
+			break;
+		case 'B':
+			syslog(LOG_INFO, "#stp_alm(1)");
+			SVC_PERROR(stp_alm(ALMHDR1));
+			break;
+
+		case 'V':
+			hrtcnt1 = fch_hrt();
+			hrtcnt2 = fch_hrt();
+			syslog(LOG_NOTICE, "hrtcnt1 = %tu, hrtcnt2 = %tu",
+										hrtcnt1, hrtcnt2);
+			break;
+
+		case 'v':
+			SVC_PERROR(syslog_msk_log(LOG_UPTO(LOG_INFO),
+										LOG_UPTO(LOG_EMERG)));
+			break;
+		case 'q':
+			SVC_PERROR(syslog_msk_log(LOG_UPTO(LOG_NOTICE),
+										LOG_UPTO(LOG_EMERG)));
+			break;
+
+#ifdef BIT_KERNEL
+		case ' ':
+			SVC_PERROR(loc_cpu());
+			{
+				extern ER	bit_kernel(void);
+
+				SVC_PERROR(ercd = bit_kernel());
+				if (ercd >= 0) {
+					syslog(LOG_NOTICE, "bit_kernel passed.");
+				}
+			}
+			SVC_PERROR(unl_cpu());
+			break;
+#endif /* BIT_KERNEL */
+
+		default:
+			break;
+		}
+	} while (c != '\003' && c != 'Q');
+
+	syslog(LOG_NOTICE, "Sample program ends.");
+	SVC_PERROR(ext_ker());
+	assert(0);
+}
Index: asp3_wo_tecs/trunk/sample/sample1.cfg
===================================================================
--- asp3_wo_tecs/trunk/sample/sample1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/sample/sample1.cfg	(revision 302)
@@ -0,0 +1,22 @@
+/*
+ *		ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: sample1.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+INCLUDE("syssvc/logtask.cfg");
+
+#include "sample1.h"
+CRE_TSK(TASK1, { TA_NULL, 1, task, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(EXC_TASK, { TA_NULL, 0, exc_task, EXC_PRIORITY, STACK_SIZE, NULL });
+CRE_CYC(CYCHDR1, { TA_NULL, { TNFY_HANDLER, 0, cyclic_handler }, 2000000, 0 });
+CRE_ALM(ALMHDR1, { TA_NULL, { TNFY_HANDLER, 0, alarm_handler }});
+#ifdef CPUEXC1
+DEF_EXC(CPUEXC1, { TA_NULL, cpuexc_handler });
+#endif /* CPUEXC1 */
Index: asp3_wo_tecs/trunk/sample/sample1.h
===================================================================
--- asp3_wo_tecs/trunk/sample/sample1.h	(revision 302)
+++ asp3_wo_tecs/trunk/sample/sample1.h	(revision 302)
@@ -0,0 +1,116 @@
+/*
+ *  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) 2004-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: sample1.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/*
+ *		ãµã³ãã«ãã­ã°ã©ã (1)ã®ããããã¡ã¤ã«
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+
+#define EXC_PRIORITY	1		/* ä¾å¤å¦çã¿ã¹ã¯ã®åªå
+åº¦ */
+#define MAIN_PRIORITY	5		/* ã¡ã¤ã³ã¿ã¹ã¯ã®åªå
+åº¦ */
+								/* HIGH_PRIORITYããé«ããããã¨ */
+
+#define HIGH_PRIORITY	9		/* ä¸¦è¡å®è¡ãããã¿ã¹ã¯ã®åªå
+åº¦ */
+#define MID_PRIORITY	10
+#define LOW_PRIORITY	11
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+
+#ifndef TASK_PORTID
+#define	TASK_PORTID		1			/* æå­å
+¥åããã·ãªã¢ã«ãã¼ãID */
+#endif /* TASK_PORTID */
+
+#ifndef STACK_SIZE
+#define	STACK_SIZE		4096		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãº */
+#endif /* STACK_SIZE */
+
+#ifndef LOOP_REF
+#define LOOP_REF		ULONG_C(1000000)	/* éåº¦è¨æ¸¬ç¨ã®ã«ã¼ãåæ° */
+#endif /* LOOP_REF */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+extern void	task(intptr_t exinf);
+extern void	main_task(intptr_t exinf);
+extern void exc_task(intptr_t exinf);
+#ifdef CPUEXC1
+extern void	cpuexc_handler(void *p_excinf);
+#endif /* CPUEXC1 */
+extern void	cyclic_handler(intptr_t exinf);
+extern void	alarm_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/syssvc/banner.c
===================================================================
--- asp3_wo_tecs/trunk/syssvc/banner.c	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/banner.c	(revision 302)
@@ -0,0 +1,87 @@
+/*
+ *  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) 2004-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: banner.c 312 2015-02-08 14:52:45Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºå
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "target_syssvc.h"
+#include "banner.h"
+
+#ifndef TARGET_COPYRIGHT
+#define TARGET_COPYRIGHT
+#endif /* TARGET_COPYRIGHT */
+
+static const char banner[] = "\n"
+"TOPPERS/ASP3 Kernel Release %d.%X.%d for " TARGET_NAME
+" (" __DATE__ ", " __TIME__ ")\n"
+"Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory\n"
+"                            Toyohashi Univ. of Technology, JAPAN\n"
+"Copyright (C) 2004-2015 by Embedded and Real-Time Systems Laboratory\n"
+"            Graduate School of Information Science, Nagoya Univ., JAPAN\n"
+TARGET_COPYRIGHT;
+
+void
+print_banner(intptr_t exinf)
+{
+	syslog_3(LOG_NOTICE, banner,
+				(TKERNEL_PRVER >> 12) & 0x0fU,
+				(TKERNEL_PRVER >> 4) & 0xffU,
+				TKERNEL_PRVER & 0x0fU);
+}
Index: asp3_wo_tecs/trunk/syssvc/banner.cfg
===================================================================
--- asp3_wo_tecs/trunk/syssvc/banner.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/banner.cfg	(revision 302)
@@ -0,0 +1,8 @@
+/*
+ *		ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºåã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: banner.cfg 285 2014-11-29 07:37:58Z ertl-hiro $
+ */
+
+#include "syssvc/banner.h"
+ATT_INI({ TA_NULL, 0, print_banner });
Index: asp3_wo_tecs/trunk/syssvc/banner.h
===================================================================
--- asp3_wo_tecs/trunk/syssvc/banner.h	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/banner.h	(revision 302)
@@ -0,0 +1,70 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2008 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: banner.h 120 2014-05-13 20:05:57Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºå
+ */
+
+#ifndef TOPPERS_BANNER_H
+#define TOPPERS_BANNER_H
+
+#include <kernel.h>
+
+/*
+ *  ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã®åºå
+ */
+extern void	print_banner(intptr_t exinf) throw();
+
+#endif /* TOPPERS_BANNER_H */
Index: asp3_wo_tecs/trunk/syssvc/histogram.c
===================================================================
--- asp3_wo_tecs/trunk/syssvc/histogram.c	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/histogram.c	(revision 302)
@@ -0,0 +1,209 @@
+/*
+ *  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: histogram.c 506 2016-01-12 01:46:49Z ertl-hiro $
+ */
+
+/*
+ *		å®è¡æéåå¸éè¨ãµã¼ãã¹
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "histogram.h"
+#include "target_test.h"
+
+/*
+ *  å®è¡æéåå¸è¨æ¸¬ã®æ°
+ */
+#ifndef TNUM_HIST
+#define TNUM_HIST		10
+#endif /* TNUM_HIST */
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨ã§è¨­å®å¤æ´ããããã®ãã¯ã­
+ */
+#ifndef HISTTIM						/* å®è¡æéè¨æ¸¬ç¨ã®æå»ã®ãã¼ã¿å */
+#define HISTTIM					HRTCNT
+
+#ifdef TCYC_HRTCNT					/* å®è¡æéè¨æ¸¬ç¨ã®æå»ã®å¨æ */
+#define HISTTIM_CYCLE			TCYC_HRTCNT
+#endif /* TCYC_HRTCNT */
+#endif /* HISTTIM */
+
+#ifndef HIST_GET_TIM				/* å®è¡æéè¨æ¸¬ç¨ã®ç¾å¨æå»ã®åå¾ */
+#define HIST_GET_TIM(p_time)	(*(p_time) = fch_hrt())
+#endif /* HIST_GET_TIM */
+
+#ifndef HIST_CONV_TIM				/* æå»ã®å·®ããå®è¡æéã¸ã®å¤æ */
+#define HIST_CONV_TIM(time)		((uint_t)(time))
+#endif /* HIST_CONV_TIM */
+
+#ifndef HIST_BM_HOOK				/* å®è¡æéè¨æ¸¬ç´åã«è¡ãã¹ãå¦ç */
+#define HIST_BM_HOOK()			((void) 0)
+#endif
+
+/*
+ *  å®è¡æéåå¸è¨æ¸¬ç®¡çãã­ãã¯
+ */
+typedef struct histogram_control_block {
+	HISTTIM		begin_time;			/* è¨æ¸¬éå§æå» */
+	uint_t		maxval;				/* åå¸ãè¨é²ããæå¤§æé */
+	uint_t		*histarea;			/* åå¸ãè¨é²ããã¡ã¢ãªé å */
+	uint_t		over;				/* æå¤§æéãè¶
+ããåº¦æ° */
+	uint_t		under;				/* æéã®éè»¢ãçãããåº¦æ° */
+} HISTCB;
+
+/*
+ *  å®è¡æéåå¸è¨æ¸¬ç®¡çãã­ãã¯ã®ã¨ãªã¢
+ */
+static HISTCB	histcb_table[TNUM_HIST];
+
+/*
+ *  å®è¡æéåå¸è¨æ¸¬IDã®æå°å¤ã¨æå¤§å¤
+ */
+#define TMIN_HISTID		1
+#define TMAX_HISTID		(TMIN_HISTID + TNUM_HIST - 1)
+
+/*
+ *  å®è¡æéåå¸è¨æ¸¬ã®åæå
+ */
+void
+init_hist(ID histid, uint_t maxval, uint_t histarea[])
+{
+	HISTCB	*p_histcb;
+	uint_t	i;
+
+	assert(TMIN_HISTID <= histid && histid <= TMAX_HISTID);
+	p_histcb = &(histcb_table[histid - TMIN_HISTID]);
+
+	for (i = 0; i <= maxval; i++) {
+		histarea[i] = 0U;
+	}
+	p_histcb->maxval = maxval;
+	p_histcb->histarea = histarea;
+	p_histcb->over = 0U;
+	p_histcb->under = 0U;
+}
+
+/*
+ *  å®è¡æéè¨æ¸¬ã®éå§
+ */
+void
+begin_measure(ID histid)
+{
+	HISTCB	*p_histcb;
+
+	assert(TMIN_HISTID <= histid && histid <= TMAX_HISTID);
+	p_histcb = &(histcb_table[histid - TMIN_HISTID]);
+
+	HIST_BM_HOOK();
+	HIST_GET_TIM(&(p_histcb->begin_time));
+}
+
+/*
+ *  å®è¡æéè¨æ¸¬ã®çµäº
+ */
+void
+end_measure(ID histid)
+{
+	HISTCB	*p_histcb;
+	HISTTIM	end_time, timediff;
+	uint_t	val;
+
+	HIST_GET_TIM(&end_time);
+
+	assert(TMIN_HISTID <= histid && histid <= TMAX_HISTID);
+	p_histcb = &(histcb_table[histid - TMIN_HISTID]);
+
+	timediff = end_time - p_histcb->begin_time;
+#ifdef HISTTIM_CYCLE
+	if (end_time < p_histcb->begin_time) {
+		timediff += HISTTIM_CYCLE;
+	}
+#endif /* HISTTIM_CYCLE */
+	val = HIST_CONV_TIM(timediff);
+	if (val <= p_histcb->maxval) {
+		p_histcb->histarea[val]++;
+	}
+	else if (val <= ((uint_t) INT_MAX)) {
+		p_histcb->over++;
+	}
+	else {
+		p_histcb->under++;
+	}
+}
+
+/*
+ *  å®è¡æéåå¸è¨æ¸¬ã®è¡¨ç¤º
+ */
+void
+print_hist(ID histid)
+{
+	HISTCB	*p_histcb;
+	uint_t	i;
+
+	assert(TMIN_HISTID <= histid && histid <= TMAX_HISTID);
+	p_histcb = &(histcb_table[histid - TMIN_HISTID]);
+
+	for (i = 0; i <= p_histcb->maxval; i++) {
+		if (p_histcb->histarea[i] > 0) {
+			syslog_2(LOG_NOTICE, "%d : %d", i, p_histcb->histarea[i]);
+		}
+	}
+	if (p_histcb->over > 0) {
+		syslog_2(LOG_NOTICE, "> %d : %d", p_histcb->maxval, p_histcb->over);
+	}
+	if (p_histcb->under > 0) {
+		syslog_1(LOG_NOTICE, "> INT_MAX : %d", p_histcb->under);
+	}
+}
Index: asp3_wo_tecs/trunk/syssvc/histogram.h
===================================================================
--- asp3_wo_tecs/trunk/syssvc/histogram.h	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/histogram.h	(revision 302)
@@ -0,0 +1,92 @@
+/*
+ *  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: histogram.h 506 2016-01-12 01:46:49Z ertl-hiro $
+ */
+
+/*
+ *		å®è¡æéåå¸éè¨ãµã¼ãã¹
+ */
+
+#ifndef TOPPERS_HISTOGRAM_H
+#define TOPPERS_HISTOGRAM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <t_stddef.h>
+
+/*
+ *  å®è¡æéåå¸è¨æ¸¬ã®åæå
+ */
+extern void	init_hist(ID histid, uint_t maxval, uint_t histarea[]);
+
+/*
+ *  å®è¡æéè¨æ¸¬ã®éå§
+ */
+extern void	begin_measure(ID histid);
+
+/*
+ *  å®è¡æéè¨æ¸¬ã®çµäº
+ */
+extern void	end_measure(ID histid);
+
+/*
+ *  å®è¡æéåå¸è¨æ¸¬ã®è¡¨ç¤º
+ */
+extern void	print_hist(ID histid);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_HISTOGRAM_H */
Index: asp3_wo_tecs/trunk/syssvc/logtask.c
===================================================================
--- asp3_wo_tecs/trunk/syssvc/logtask.c	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/logtask.c	(revision 302)
@@ -0,0 +1,218 @@
+/*
+ *  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-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: logtask.c 108 2014-05-11 01:30:18Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ã­ã°ã¿ã¹ã¯
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include <log_output.h>
+#include "syssvc/serial.h"
+#include "syssvc/syslog.h"
+#include "logtask.h"
+
+/*
+ *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®åºåå
+ã®ãã¼ãID
+ */
+static ID	logtask_portid;
+
+/*
+ *  ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ã¸ã®1æå­åºå
+ */
+static void
+logtask_putc(char c)
+{
+	(void) serial_wri_dat(logtask_portid, &c, 1);
+}
+
+/*
+ *  ã·ã¹ãã ã­ã°åºåã®å¾
+ã¡åãã
+ */
+ER
+logtask_flush(uint_t count)
+{
+	T_SYSLOG_RLOG	rlog;
+	T_SERIAL_RPOR	rpor;
+	ER				ercd, rercd;
+
+	if (sns_dpn()) {
+		ercd = E_CTX;
+	}
+	else {
+		for (;;) {
+			if (syslog_ref_log(&rlog) < 0) {
+				ercd = E_SYS;
+				goto error_exit;
+			}
+			if (rlog.count <= count) {
+				if (count == 0U) {
+					/*
+					 *  countã0ã®å ´åã«ã¯ï¼ã·ãªã¢ã«ãããã¡ãç©ºããç¢º
+					 *  èªããï¼
+					 */
+					if (serial_ref_por(logtask_portid, &rpor) < 0) {
+						ercd = E_SYS;
+						goto error_exit;
+					}
+					if (rpor.wricnt == 0U) {
+						ercd = E_OK;
+						goto error_exit;
+					}
+				}
+				else {
+					ercd = E_OK;
+					goto error_exit;
+				}
+			}
+
+			/*
+			 *  LOGTASK_FLUSH_WAITÎ¼ç§å¾
+ã¤ï¼
+			 */
+			rercd = dly_tsk(LOGTASK_FLUSH_WAIT);
+			if (rercd < 0) {
+				ercd = (rercd == E_RLWAI) ? rercd : E_SYS;
+				goto error_exit;
+			}
+		}
+	}
+
+  error_exit:
+	return(ercd);
+}
+
+/*
+ *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®æ¬ä½
+ */
+void
+logtask_main(intptr_t exinf)
+{
+	SYSLOG	logbuf;
+	uint_t	lostlog;
+	ER_UINT	rercd;
+
+	logtask_portid = (ID) exinf;
+	(void) serial_opn_por(logtask_portid);
+	(void) syslog_msk_log(LOG_UPTO(LOG_NOTICE), LOG_UPTO(LOG_EMERG));
+	syslog_1(LOG_NOTICE, "System logging task is started on port %d.",
+													logtask_portid);
+	for (;;) {
+		lostlog = 0U;
+		while ((rercd = syslog_rea_log(&logbuf)) >= 0) {
+			lostlog += (uint_t) rercd;
+			if (logbuf.logtype >= LOG_TYPE_COMMENT) {
+				if (lostlog > 0U) {
+					syslog_lostmsg(lostlog, logtask_putc);
+					lostlog = 0U;
+				}
+				syslog_print(&logbuf, logtask_putc);
+				logtask_putc('\n');
+			}
+		}
+		if (lostlog > 0U) {
+			syslog_lostmsg(lostlog, logtask_putc);
+		}
+		(void) dly_tsk(LOGTASK_INTERVAL);
+	}
+}
+
+/*
+ *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®çµäºå¦ç
+ */
+void
+logtask_terminate(intptr_t exinf)
+{
+	char	c;
+	SYSLOG	logbuf;
+	bool_t	msgflg = false;
+	ER_UINT	rercd;
+
+	/*
+	 *  ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®éä¿¡ãããã¡ã«èç©ããããã¼ã¿
+	 *  ãï¼ä½ã¬ãã«åºåæ©è½ãç¨ãã¦åºåããï¼
+	 */
+	while (serial_get_chr(logtask_portid, &c)) {
+		target_fput_log(c);
+	}
+
+	/*
+	 *  ã­ã°ãããã¡ã«è¨é²ãããã­ã°æ
+å ±ãï¼ä½ã¬ãã«åºåæ©è½ãç¨ãã¦åº
+	 *  åããï¼
+	 */
+	while ((rercd = syslog_rea_log(&logbuf)) >= 0) {
+		if (!msgflg) {
+			/*
+			 *  ã­ã°ãããã¡ã«æ®ã£ãã­ã°æ
+å ±ã§ãããã¨ãç¤ºãæå­åãåº
+			 *  åããï¼
+			 */
+			syslog_printf("-- buffered messages --\n", NULL, target_fput_log);
+			msgflg = true;
+		}
+		if (rercd > 0) {
+			syslog_lostmsg((uint_t) rercd, target_fput_log);
+		}
+		if (logbuf.logtype >= LOG_TYPE_COMMENT) {
+			syslog_print(&logbuf, target_fput_log);
+			target_fput_log('\n');
+		}
+	}
+}
Index: asp3_wo_tecs/trunk/syssvc/logtask.cfg
===================================================================
--- asp3_wo_tecs/trunk/syssvc/logtask.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/logtask.cfg	(revision 302)
@@ -0,0 +1,10 @@
+/*
+ *		ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: logtask.cfg 285 2014-11-29 07:37:58Z ertl-hiro $
+ */
+
+#include "syssvc/logtask.h"
+CRE_TSK(LOGTASK, { TA_ACT, LOGTASK_PORTID, logtask_main,
+						LOGTASK_PRIORITY, LOGTASK_STACK_SIZE, NULL });
+ATT_TER({ TA_NULL, 0, logtask_terminate });
Index: asp3_wo_tecs/trunk/syssvc/logtask.h
===================================================================
--- asp3_wo_tecs/trunk/syssvc/logtask.h	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/logtask.h	(revision 302)
@@ -0,0 +1,122 @@
+/*
+ *  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) 2004-2008 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: logtask.h 120 2014-05-13 20:05:57Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ã­ã°ã¿ã¹ã¯
+ */
+
+#ifndef TOPPERS_LOGTASK_H
+#define TOPPERS_LOGTASK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <kernel.h>
+#include "target_syssvc.h"
+
+/*
+ *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯é¢é£ã®å®æ°ã®ããã©ã«ãå¤ã®å®ç¾©
+ */ 
+#ifndef LOGTASK_PRIORITY
+#define LOGTASK_PRIORITY	3		/* åæåªå
+åº¦ */
+#endif /* LOGTASK_PRIORITY */
+
+#ifndef LOGTASK_STACK_SIZE
+#define LOGTASK_STACK_SIZE	1024	/* ã¹ã¿ãã¯é åã®ãµã¤ãº */
+#endif /* LOGTASK_STACK_SIZE */
+
+#ifndef LOGTASK_PORTID
+#define LOGTASK_PORTID		1		/* ã·ã¹ãã ã­ã°ç¨ã®ã·ãªã¢ã«ãã¼ãçªå· */
+#endif /* LOGTASK_PORTID */
+
+#ifndef LOGTASK_INTERVAL
+#define LOGTASK_INTERVAL	10000U	/* ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®åä½ééï¼Î¼ç§ï¼*/
+#endif /* LOGTASK_INTERVAL */
+
+#ifndef LOGTASK_FLUSH_WAIT
+#define LOGTASK_FLUSH_WAIT	1000U	/* ãã©ãã·ã¥å¾
+ã¡ã®åä½æéï¼Î¼ç§ï¼*/
+#endif /* LOGTASK_FLUSH_WAIT */
+
+/*
+ *  ã·ã¹ãã ã­ã°åºåã®å¾
+ã¡åãã
+ *
+ *  ã­ã°ãããã¡ä¸­ã®ã­ã°ã®æ°ãcountä»¥ä¸ã«ãªãã¾ã§å¾
+ã¤ï¼countã0ã®å ´åã«
+ *  ã¯ï¼ã·ãªã¢ã«ãããã¡ãç©ºã«ãªãã®ãå¾
+ã¤ï¼
+ */
+extern ER	logtask_flush(uint_t count) throw();
+
+/*
+ *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®æ¬ä½
+ */
+extern void	logtask_main(intptr_t exinf) throw();
+
+/*
+ *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®çµäºå¦ç
+ */
+extern void	logtask_terminate(intptr_t exinf) throw();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_LOGTASK_H */
Index: asp3_wo_tecs/trunk/syssvc/serial.c
===================================================================
--- asp3_wo_tecs/trunk/syssvc/serial.c	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/serial.c	(revision 302)
@@ -0,0 +1,818 @@
+/*
+ *  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) 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: serial.c 468 2015-12-30 00:56:27Z ertl-hiro $
+ */
+
+/*
+ *		ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ã
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "target_syssvc.h"
+#include "target_serial.h"
+#include "serial.h"
+#include "kernel_cfg.h"
+
+/*
+ *  ãããã¡ãµã¤ãºã®ããã©ã«ãå¤ã¨ãããã¡ã®å®ç¾©
+ */
+#ifndef SERIAL_RCV_BUFSZ1
+#define	SERIAL_RCV_BUFSZ1	256			/* ãã¼ã1ã®åä¿¡ãããã¡ãµã¤ãº */
+#endif /* SERIAL_RCV_BUFSZ1 */
+
+#ifndef SERIAL_SND_BUFSZ1
+#define	SERIAL_SND_BUFSZ1	256			/* ãã¼ã1ã®éä¿¡ãããã¡ãµã¤ãº */
+#endif /* SERIAL_SND_BUFSZ1 */
+
+static char	rcv_buffer1[SERIAL_RCV_BUFSZ1];
+static char	snd_buffer1[SERIAL_SND_BUFSZ1];
+
+#if TNUM_PORT >= 2						/* ãã¼ã2ã«é¢ããå®ç¾© */
+
+#ifndef SERIAL_RCV_BUFSZ2
+#define	SERIAL_RCV_BUFSZ2	256			/* ãã¼ã2ã®åä¿¡ãããã¡ãµã¤ãº */
+#endif /* SERIAL_RCV_BUFSZ2 */
+
+#ifndef SERIAL_SND_BUFSZ2
+#define	SERIAL_SND_BUFSZ2	256			/* ãã¼ã2ã®éä¿¡ãããã¡ãµã¤ãº */
+#endif /* SERIAL_SND_BUFSZ2 */
+
+static char	rcv_buffer2[SERIAL_RCV_BUFSZ2];
+static char	snd_buffer2[SERIAL_SND_BUFSZ2];
+
+#endif /* TNUM_PORT >= 2 */
+
+#if TNUM_PORT >= 3						/* ãã¼ã3ã«é¢ããå®ç¾© */
+
+#ifndef SERIAL_RCV_BUFSZ3
+#define	SERIAL_RCV_BUFSZ3	256			/* ãã¼ã3ã®åä¿¡ãããã¡ãµã¤ãº */
+#endif /* SERIAL_RCV_BUFSZ3 */
+
+#ifndef SERIAL_SND_BUFSZ3
+#define	SERIAL_SND_BUFSZ3	256			/* ãã¼ã3ã®éä¿¡ãããã¡ãµã¤ãº */
+#endif /* SERIAL_SND_BUFSZ3 */
+
+static char	rcv_buffer3[SERIAL_RCV_BUFSZ3];
+static char	snd_buffer3[SERIAL_SND_BUFSZ3];
+
+#endif /* TNUM_PORT >= 3 */
+
+#if TNUM_PORT >= 4						/* ãã¼ã4ã«é¢ããå®ç¾© */
+
+#ifndef SERIAL_RCV_BUFSZ4
+#define	SERIAL_RCV_BUFSZ4	256			/* ãã¼ã4ã®åä¿¡ãããã¡ãµã¤ãº */
+#endif /* SERIAL_RCV_BUFSZ4 */
+
+#ifndef SERIAL_SND_BUFSZ4
+#define	SERIAL_SND_BUFSZ4	256			/* ãã¼ã4ã®éä¿¡ãããã¡ãµã¤ãº */
+#endif /* SERIAL_SND_BUFSZ4 */
+
+static char	rcv_buffer4[SERIAL_RCV_BUFSZ4];
+static char	snd_buffer4[SERIAL_SND_BUFSZ4];
+
+#endif /* TNUM_PORT >= 4 */
+
+#if TNUM_PORT >= 5
+#error Serial interface driver supports up to 4 ports.
+#endif /* TNUM_PORT >= 5 */
+
+/*
+ *  ãã­ã¼å¶å¾¡ã«é¢é£ããå®æ°ã¨ãã¯ã­
+ */
+#define	FC_STOP			'\023'		/* ã³ã³ãã­ã¼ã«-S */
+#define	FC_START		'\021'		/* ã³ã³ãã­ã¼ã«-Q */
+
+#define BUFCNT_STOP(bufsz)		((bufsz) * 3 / 4)	/* STOPãéãåºæºæå­æ° */
+#define BUFCNT_START(bufsz)		((bufsz) / 2)		/* STARTãéãåºæºæå­æ° */
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãåæåãã­ãã¯
+ */
+typedef struct serial_port_initialization_block {
+	ID		rcv_semid;		/* åä¿¡ãããã¡ç®¡çç¨ã»ããã©ã®ID */
+	ID		snd_semid;		/* éä¿¡ãããã¡ç®¡çç¨ã»ããã©ã®ID */
+	uint_t	rcv_bufsz;		/* åä¿¡ãããã¡ãµã¤ãº */
+	char	*rcv_buffer;	/* åä¿¡ãããã¡ */
+	uint_t	snd_bufsz;		/* éä¿¡ãããã¡ãµã¤ãº */
+	char	*snd_buffer;	/* éä¿¡ãããã¡ */
+} SPINIB;
+
+static const SPINIB spinib_table[TNUM_PORT] = {
+	{ SERIAL_RCV_SEM1, SERIAL_SND_SEM1,
+	  SERIAL_RCV_BUFSZ1, rcv_buffer1,
+	  SERIAL_SND_BUFSZ1, snd_buffer1 },
+#if TNUM_PORT >= 2
+	{ SERIAL_RCV_SEM2, SERIAL_SND_SEM2,
+	  SERIAL_RCV_BUFSZ2, rcv_buffer2,
+	  SERIAL_SND_BUFSZ2, snd_buffer2 },
+#endif /* TNUM_PORT >= 2 */
+#if TNUM_PORT >= 3
+	{ SERIAL_RCV_SEM3, SERIAL_SND_SEM3,
+	  SERIAL_RCV_BUFSZ3, rcv_buffer3,
+	  SERIAL_SND_BUFSZ3, snd_buffer3 },
+#endif /* TNUM_PORT >= 3 */
+#if TNUM_PORT >= 4
+	{ SERIAL_RCV_SEM4, SERIAL_SND_SEM4,
+	  SERIAL_RCV_BUFSZ4, rcv_buffer4,
+	  SERIAL_SND_BUFSZ4, snd_buffer4 },
+#endif /* TNUM_PORT >= 4 */
+};
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãç®¡çãã­ãã¯
+ */
+typedef struct serial_port_control_block {
+	const SPINIB *p_spinib;		/* ã·ãªã¢ã«ãã¼ãåæåãã­ãã¯ */
+	SIOPCB	*p_siopcb;			/* ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ */
+	bool_t	openflag;			/* ãªã¼ãã³æ¸ã¿ãã©ã° */
+	bool_t	errorflag;			/* ã¨ã©ã¼ãã©ã° */
+	uint_t	ioctl;				/* åä½å¶å¾¡ã®è¨­å®å¤ */
+
+	uint_t	rcv_read_ptr;		/* åä¿¡ãããã¡èª­åºããã¤ã³ã¿ */
+	uint_t	rcv_write_ptr;		/* åä¿¡ãããã¡æ¸è¾¼ã¿ãã¤ã³ã¿ */
+	uint_t	rcv_count;			/* åä¿¡ãããã¡ä¸­ã®æå­æ° */
+	char	rcv_fc_chr;			/* éãã¹ãSTART/STOP */
+	bool_t	rcv_stopped;		/* STOPãéã£ãç¶æ
+ãï¼ */
+
+	uint_t	snd_read_ptr;		/* éä¿¡ãããã¡èª­åºããã¤ã³ã¿ */
+	uint_t	snd_write_ptr;		/* éä¿¡ãããã¡æ¸è¾¼ã¿ãã¤ã³ã¿ */
+	uint_t	snd_count;			/* éä¿¡ãããã¡ä¸­ã®æå­æ° */
+	bool_t	snd_stopped;		/* STOPãåãåã£ãç¶æ
+ãï¼ */
+} SPCB;
+
+static SPCB	spcb_table[TNUM_PORT];
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãIDããã·ãªã¢ã«ãã¼ãç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_PORT(portid)	((uint_t)((portid) - 1))
+#define get_spcb(portid)	(&(spcb_table[INDEX_PORT(portid)]))
+
+/*
+ *  ãã¤ã³ã¿ã®ã¤ã³ã¯ãªã¡ã³ã
+ */
+#define INC_PTR(ptr, bufsz) do {	\
+	if (++(ptr) == (bufsz)) {		\
+		(ptr) = 0;					\
+	 }								\
+} while (false)
+
+/*
+ *  ãµã¼ãã¹ã³ã¼ã«å¼åºããã¯ã­
+ *
+ *  ãµã¼ãã¹ã³ã¼ã«å¼åºããå«ãå¼expãè©ä¾¡ãï¼è¿å¤ãã¨ã©ã¼ï¼è² ã®å¤ï¼ã®å ´
+ *  åã«ã¯ï¼ercã«ercd_expãè©ä¾¡ããå¤ãä»£å
+¥ãï¼error_exitã«gotoããï¼
+ */
+#define SVC(exp, ercd_exp) do {		\
+	if ((exp) < 0) {				\
+		ercd = (ercd_exp);			\
+		goto error_exit;			\
+	}								\
+} while (false)
+
+/*
+ *  E_SYSã¨ã©ã¼ã®çæ
+ */
+static ER
+gen_ercd_sys(SPCB *p_spcb)
+{
+	p_spcb->errorflag = true;
+	return(E_SYS);
+}
+
+/*
+ *  å¾
+ã¡ã«å
+¥ããµã¼ãã¹ã³ã¼ã«ããã®ã¨ã©ã¼ã®å¤æ
+ */
+static ER
+gen_ercd_wait(ER rercd, SPCB *p_spcb)
+{
+	switch (MERCD(rercd)) {
+	case E_RLWAI:
+	case E_DLT:
+	case E_RASTER:
+		return(rercd);
+	default:
+		p_spcb->errorflag = true;
+		return(E_SYS);
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®åæåã«ã¼ãã³
+ */
+void
+serial_initialize(intptr_t exinf)
+{
+	uint_t	i;
+	SPCB	*p_spcb;
+
+	for (i = 0; i < TNUM_PORT; i++) {
+		p_spcb = &(spcb_table[i]);
+		p_spcb->p_spinib = &(spinib_table[i]);
+		p_spcb->openflag = false;
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãã®ãªã¼ãã³ï¼ãµã¼ãã¹ã³ã¼ã«ï¼
+ */
+ER
+serial_opn_por(ID portid)
+{
+	SPCB	*p_spcb;
+	ER		ercd;
+
+	if (sns_dpn()) {				/* ã³ã³ãã­ã¹ãã®ãã§ãã¯ */
+		return(E_CTX);
+	}
+	if (!(1 <= portid && portid <= TNUM_PORT)) {
+		return(E_ID);				/* ãã¼ãçªå·ã®ãã§ãã¯ */
+	}
+	p_spcb = get_spcb(portid);
+
+	SVC(dis_dsp(), gen_ercd_sys(p_spcb));
+	if (p_spcb->openflag) {			/* ãªã¼ãã³æ¸ã¿ãã®ãã§ãã¯ */
+		ercd = E_OBJ;
+	}
+	else {
+		/*
+		 *  å¤æ°ã®åæå
+		 */
+		p_spcb->ioctl = (IOCTL_ECHO | IOCTL_CRLF | IOCTL_FCSND | IOCTL_FCRCV);
+
+		p_spcb->rcv_read_ptr = 0U;
+		p_spcb->rcv_write_ptr = 0U;
+		p_spcb->rcv_count = 0U;
+		p_spcb->rcv_fc_chr = '\0';
+		p_spcb->rcv_stopped = false;
+
+		p_spcb->snd_read_ptr = 0U;
+		p_spcb->snd_write_ptr = 0U;
+		p_spcb->snd_count = 0U;
+		p_spcb->snd_stopped = false;
+
+		/*
+		 *  ããä»¥éï¼å²è¾¼ã¿ãç¦æ­¢ããï¼
+		 */
+		if (loc_cpu() < 0) {
+			ercd = E_SYS;
+			goto error_exit_enadsp;
+		}
+
+		/*
+		 *  ãã¼ãã¦ã§ã¢ä¾å­ã®ãªã¼ãã³å¦ç
+		 */
+		p_spcb->p_siopcb = sio_opn_por(portid, (intptr_t) p_spcb);
+
+		/*
+		 *  åä¿¡éç¥ã³ã¼ã«ããã¯ãè¨±å¯ããï¼
+		 */
+		sio_ena_cbr(p_spcb->p_siopcb, SIO_RDY_RCV);
+		p_spcb->openflag = true;
+		p_spcb->errorflag = false;
+
+		if (unl_cpu() < 0) {
+			p_spcb->errorflag = true;
+			ercd = E_SYS;
+			goto error_exit_enadsp;
+		}
+		ercd = E_OK;
+	}
+
+  error_exit_enadsp:
+	SVC(ena_dsp(), gen_ercd_sys(p_spcb));
+
+  error_exit:
+	return(ercd);
+}
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãã®ã¯ã­ã¼ãºï¼ãµã¼ãã¹ã³ã¼ã«ï¼
+ */
+ER
+serial_cls_por(ID portid)
+{
+	SPCB	*p_spcb;
+	ER		ercd;
+	bool_t	eflag = false;
+
+	if (sns_dpn()) {				/* ã³ã³ãã­ã¹ãã®ãã§ãã¯ */
+		return(E_CTX);
+	}
+	if (!(1 <= portid && portid <= TNUM_PORT)) {
+		return(E_ID);				/* ãã¼ãçªå·ã®ãã§ãã¯ */
+	}
+	p_spcb = get_spcb(portid);
+
+	SVC(dis_dsp(), gen_ercd_sys(p_spcb));
+	if (!(p_spcb->openflag)) {		/* ãªã¼ãã³æ¸ã¿ãã®ãã§ãã¯ */
+		ercd = E_OBJ;
+	}
+	else {
+		/*
+		 *  ãã¼ãã¦ã§ã¢ä¾å­ã®ã¯ã­ã¼ãºå¦ç
+		 */
+		if (loc_cpu() < 0) {
+			eflag = true;
+		}
+		sio_cls_por(p_spcb->p_siopcb);
+		p_spcb->openflag = false;
+		if (unl_cpu() < 0) {
+			eflag = true;
+		}
+
+		/*
+		 *  ã»ããã©ã®åæå
+		 */
+		if (ini_sem(p_spcb->p_spinib->snd_semid) < 0) {
+			eflag = true;
+		}
+		if (ini_sem(p_spcb->p_spinib->rcv_semid) < 0) {
+			eflag = true;
+		}
+
+		/*
+		 *  ã¨ã©ã¼ã³ã¼ãã®è¨­å®
+		 */
+		if (eflag) {
+			ercd = gen_ercd_sys(p_spcb);
+		}
+		else {
+			ercd = E_OK;
+		}
+	}
+	SVC(ena_dsp(), gen_ercd_sys(p_spcb));
+
+  error_exit:
+	return(ercd);
+}
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãã¸ã®æå­éä¿¡
+ *
+ *  p_spcbã§æå®ãããã·ãªã¢ã«I/Oãã¼ãã«å¯¾ãã¦ï¼æå­cãéä¿¡ããï¼æå­
+ *  ãéä¿¡ã¬ã¸ã¹ã¿ã«ãããå ´åã«ã¯trueãè¿ãï¼ããã§ãªãå ´åã«ã¯ï¼éä¿¡
+ *  ã¬ã¸ã¹ã¿ãç©ºãããã¨ãéç¥ããã³ã¼ã«ããã¯é¢æ°ãè¨±å¯ãï¼falseãè¿ãï¼
+ *  ãã®é¢æ°ã¯ï¼CPUã­ãã¯ç¶æ
+ã§å¼ã³åºãããï¼
+ */
+Inline bool_t
+serial_snd_chr(SPCB *p_spcb, char c)
+{
+	if (sio_snd_chr(p_spcb->p_siopcb, c)) {
+		return(true);
+	}
+	else {
+		sio_ena_cbr(p_spcb->p_siopcb, SIO_RDY_SND);
+		return(false);
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãã¸ã®1æå­éä¿¡
+ */
+static ER_BOOL
+serial_wri_chr(SPCB *p_spcb, char c)
+{
+	bool_t	buffer_full;
+	ER		ercd, rercd;
+
+	/*
+	 *  LFã®åã«CRãéä¿¡ããï¼
+	 */
+	if (c == '\n' && (p_spcb->ioctl & IOCTL_CRLF) != 0U) {
+		/*
+		 *  ä»¥ä¸ã®ã³ã¼ãã¯åå¸°å¼åºãã«ãªã£ã¦ãããï¼å¼æ°cã'\n'ã®å ´åã«
+		 *  å¼æ°cã'\r'ã¨ãã¦å¼ã³åºããã¨ããï¼ãã®åå¸°å¼åºãã¯2åç®ã®
+		 *  å¼ã³åºãã§å¿
+ãæ­¢ã¾ãï¼
+		 */
+		SVC(rercd = serial_wri_chr(p_spcb, '\r'), rercd);
+		if ((bool_t) rercd) {
+			SVC(rercd = wai_sem(p_spcb->p_spinib->snd_semid),
+										gen_ercd_wait(rercd, p_spcb));
+		}
+	}
+
+	SVC(loc_cpu(), gen_ercd_sys(p_spcb));
+	if (p_spcb->snd_count == 0U && !(p_spcb->snd_stopped)
+								&& serial_snd_chr(p_spcb, c)) {
+		/*
+		 *  ã·ãªã¢ã«I/Oããã¤ã¹ã®éä¿¡ã¬ã¸ã¹ã¿ã«æå­ãå
+¥ãããã¨ã«æåã
+		 *  ãå ´åï¼
+		 */
+		buffer_full = false;
+	}
+	else {
+		/*
+		 *  éä¿¡ãããã¡ã«æå­ãå
+¥ããï¼
+		 */
+		p_spcb->p_spinib->snd_buffer[p_spcb->snd_write_ptr] = c;
+		INC_PTR(p_spcb->snd_write_ptr, p_spcb->p_spinib->snd_bufsz);
+		p_spcb->snd_count++;
+		buffer_full = (p_spcb->snd_count == p_spcb->p_spinib->snd_bufsz);
+	}
+
+	SVC(unl_cpu(), gen_ercd_sys(p_spcb));
+	ercd = (ER_BOOL) buffer_full;
+
+  error_exit:
+	return(ercd);
+}
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãã¸ã®æå­åéä¿¡ï¼ãµã¼ãã¹ã³ã¼ã«ï¼
+ */
+ER_UINT
+serial_wri_dat(ID portid, const char *buf, uint_t len)
+{
+	SPCB	*p_spcb;
+	bool_t	buffer_full;
+	uint_t	wricnt = 0U;
+	ER		ercd, rercd;
+
+	if (sns_dpn()) {				/* ã³ã³ãã­ã¹ãã®ãã§ãã¯ */
+		return(E_CTX);
+	}
+	if (!(1 <= portid && portid <= TNUM_PORT)) {
+		return(E_ID);				/* ãã¼ãçªå·ã®ãã§ãã¯ */
+	}
+
+	p_spcb = get_spcb(portid);
+	if (!(p_spcb->openflag)) {		/* ãªã¼ãã³æ¸ã¿ãã®ãã§ãã¯ */
+		return(E_OBJ);
+	}
+	if (p_spcb->errorflag) {		/* ã¨ã©ã¼ç¶æ
+ãã®ãã§ãã¯ */
+		return(E_SYS);
+	}
+
+	buffer_full = true;				/* ã«ã¼ãã®1åãã¯wai_semãã */
+	while (wricnt < len) {
+		if (buffer_full) {
+			SVC(rercd = wai_sem(p_spcb->p_spinib->snd_semid),
+										gen_ercd_wait(rercd, p_spcb));
+		}
+		SVC(rercd = serial_wri_chr(p_spcb, *buf++), rercd);
+		wricnt++;
+		buffer_full = (bool_t) rercd;
+	}
+	if (!buffer_full) {
+		SVC(sig_sem(p_spcb->p_spinib->snd_semid), gen_ercd_sys(p_spcb));
+	}
+	ercd = E_OK;
+
+  error_exit:
+	return(wricnt > 0U ? (ER_UINT) wricnt : ercd);
+}
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãããã®1æå­åä¿¡
+ */
+static bool_t
+serial_rea_chr(SPCB *p_spcb, char *p_c)
+{
+	bool_t	buffer_empty;
+	ER		ercd;
+
+	SVC(loc_cpu(), gen_ercd_sys(p_spcb));
+
+	/*
+	 *  åä¿¡ãããã¡ããæå­ãåãåºãï¼
+	 */
+	*p_c = p_spcb->p_spinib->rcv_buffer[p_spcb->rcv_read_ptr];
+	INC_PTR(p_spcb->rcv_read_ptr, p_spcb->p_spinib->rcv_bufsz);
+	p_spcb->rcv_count--;
+	buffer_empty = (p_spcb->rcv_count == 0U);
+
+	/*
+	 *  STARTãéä¿¡ããï¼
+	 */
+	if (p_spcb->rcv_stopped && p_spcb->rcv_count
+								<= BUFCNT_START(p_spcb->p_spinib->rcv_bufsz)) {
+		if (!serial_snd_chr(p_spcb, FC_START)) {
+			p_spcb->rcv_fc_chr = FC_START;
+		}
+		p_spcb->rcv_stopped = false;
+	}
+
+	SVC(unl_cpu(), gen_ercd_sys(p_spcb));
+	ercd = (ER_BOOL) buffer_empty;
+
+  error_exit:
+	return(ercd);
+}
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãããã®æå­ååä¿¡ï¼ãµã¼ãã¹ã³ã¼ã«ï¼
+ */
+ER_UINT
+serial_rea_dat(ID portid, char *buf, uint_t len)
+{
+	SPCB	*p_spcb;
+	bool_t	buffer_empty;
+	uint_t	reacnt = 0U;
+	char	c = '\0';		/* ã³ã³ãã¤ã©ã®è­¦åãææ­¢ããããã«åæåãã */
+	ER		ercd, rercd;
+
+	if (sns_dpn()) {				/* ã³ã³ãã­ã¹ãã®ãã§ãã¯ */
+		return(E_CTX);
+	}
+	if (!(1 <= portid && portid <= TNUM_PORT)) {
+		return(E_ID);				/* ãã¼ãçªå·ã®ãã§ãã¯ */
+	}
+
+	p_spcb = get_spcb(portid);
+	if (!(p_spcb->openflag)) {		/* ãªã¼ãã³æ¸ã¿ãã®ãã§ãã¯ */
+		return(E_OBJ);
+	}
+	if (p_spcb->errorflag) {		/* ã¨ã©ã¼ç¶æ
+ãã®ãã§ãã¯ */
+		return(E_SYS);
+	}
+
+	buffer_empty = true;			/* ã«ã¼ãã®1åãã¯wai_semãã */
+	while (reacnt < len) {
+		if (buffer_empty) {
+			SVC(rercd = wai_sem(p_spcb->p_spinib->rcv_semid),
+										gen_ercd_wait(rercd, p_spcb));
+		}
+		SVC(rercd = serial_rea_chr(p_spcb, &c), rercd);
+		*buf++ = c;
+		reacnt++;
+		buffer_empty = (bool_t) rercd;
+
+		/*
+		 *  ã¨ã³ã¼ããã¯å¦çï¼
+		 */
+		if ((p_spcb->ioctl & IOCTL_ECHO) != 0U) {
+			SVC(rercd = wai_sem(p_spcb->p_spinib->snd_semid),
+										gen_ercd_wait(rercd, p_spcb));
+			SVC(rercd = serial_wri_chr(p_spcb, c), rercd);
+			if (!((bool_t) rercd)) {
+				SVC(sig_sem(p_spcb->p_spinib->snd_semid),
+										gen_ercd_sys(p_spcb));
+			}
+		}
+	}
+	if (!buffer_empty) {
+		SVC(sig_sem(p_spcb->p_spinib->rcv_semid), gen_ercd_sys(p_spcb));
+	}
+	ercd = E_OK;
+
+  error_exit:
+	return(reacnt > 0U ? (ER_UINT) reacnt : ercd);
+}
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãã®å¶å¾¡ï¼ãµã¼ãã¹ã³ã¼ã«ï¼
+ */
+ER
+serial_ctl_por(ID portid, uint_t ioctl)
+{
+	SPCB	*p_spcb;
+
+	if (sns_dpn()) {				/* ã³ã³ãã­ã¹ãã®ãã§ãã¯ */
+		return(E_CTX);
+	}
+	if (!(1 <= portid && portid <= TNUM_PORT)) {
+		return(E_ID);				/* ãã¼ãçªå·ã®ãã§ãã¯ */
+	}
+
+	p_spcb = get_spcb(portid);
+	if (!(p_spcb->openflag)) {		/* ãªã¼ãã³æ¸ã¿ãã®ãã§ãã¯ */
+		return(E_OBJ);
+	}
+	if (p_spcb->errorflag) {		/* ã¨ã©ã¼ç¶æ
+ãã®ãã§ãã¯ */
+		return(E_SYS);
+	}
+
+	p_spcb->ioctl = ioctl;
+	return(E_OK);
+}
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãç¶æ
+ã®åç
+§ï¼ãµã¼ãã¹ã³ã¼ã«ï¼
+ */
+ER
+serial_ref_por(ID portid, T_SERIAL_RPOR *pk_rpor)
+{
+	SPCB	*p_spcb;
+
+	if (sns_dpn()) {				/* ã³ã³ãã­ã¹ãã®ãã§ãã¯ */
+		return(E_CTX);
+	}
+	if (!(1 <= portid && portid <= TNUM_PORT)) {
+		return(E_ID);				/* ãã¼ãçªå·ã®ãã§ãã¯ */
+	}
+
+	p_spcb = get_spcb(portid);
+	if (!(p_spcb->openflag)) {		/* ãªã¼ãã³æ¸ã¿ãã®ãã§ãã¯ */
+		return(E_OBJ);
+	}
+	if (p_spcb->errorflag) {		/* ã¨ã©ã¼ç¶æ
+ãã®ãã§ãã¯ */
+		return(E_SYS);
+	}
+
+	pk_rpor->reacnt = p_spcb->rcv_count;
+	pk_rpor->wricnt = p_spcb->snd_count;
+	return(E_OK);
+}
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãããã®éä¿¡å¯è½ã³ã¼ã«ããã¯
+ */
+void
+sio_irdy_snd(intptr_t exinf)
+{
+	SPCB	*p_spcb;
+
+	p_spcb = (SPCB *) exinf;
+	if (p_spcb->rcv_fc_chr != '\0') {
+		/*
+		 *  START/STOP ãéä¿¡ããï¼
+		 */
+		(void) sio_snd_chr(p_spcb->p_siopcb, p_spcb->rcv_fc_chr);
+		p_spcb->rcv_fc_chr = '\0';
+	}
+	else if (!(p_spcb->snd_stopped) && p_spcb->snd_count > 0U) {
+		/*
+		 *  éä¿¡ãããã¡ä¸­ããæå­ãåãåºãã¦éä¿¡ããï¼
+		 */
+		(void) sio_snd_chr(p_spcb->p_siopcb,
+					p_spcb->p_spinib->snd_buffer[p_spcb->snd_read_ptr]);
+		INC_PTR(p_spcb->snd_read_ptr, p_spcb->p_spinib->snd_bufsz);
+		if (p_spcb->snd_count == p_spcb->p_spinib->snd_bufsz) {
+			if (sig_sem(p_spcb->p_spinib->snd_semid) < 0) {
+				p_spcb->errorflag = true;
+			}
+		}
+		p_spcb->snd_count--;
+	}
+	else {
+		/*
+		 *  éä¿¡ãã¹ãæå­ããªãå ´åã¯ï¼éä¿¡å¯è½ã³ã¼ã«ããã¯ãç¦æ­¢ããï¼
+		 */
+		sio_dis_cbr(p_spcb->p_siopcb, SIO_RDY_SND);
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãããã®åä¿¡éç¥ã³ã¼ã«ããã¯
+ */
+void
+sio_irdy_rcv(intptr_t exinf)
+{
+	SPCB	*p_spcb;
+	char	c;
+
+	p_spcb = (SPCB *) exinf;
+	c = (char) sio_rcv_chr(p_spcb->p_siopcb);
+	if ((p_spcb->ioctl & IOCTL_FCSND) != 0U && c == FC_STOP) {
+		/*
+		 *  éä¿¡ãä¸æåæ­¢ããï¼éä¿¡ä¸­ã®æå­ã¯ãã®ã¾ã¾éä¿¡ããï¼
+		 */
+		p_spcb->snd_stopped = true;
+	}
+	else if (p_spcb->snd_stopped && (c == FC_START
+				|| (p_spcb->ioctl & IOCTL_FCANY) != 0U)) {
+		/*
+		 *  éä¿¡ãåéããï¼
+		 */
+		p_spcb->snd_stopped = false;
+		if (p_spcb->snd_count > 0U) {
+			c = p_spcb->p_spinib->snd_buffer[p_spcb->snd_read_ptr];
+			if (serial_snd_chr(p_spcb, c)) {
+				INC_PTR(p_spcb->snd_read_ptr, p_spcb->p_spinib->snd_bufsz);
+				if (p_spcb->snd_count == p_spcb->p_spinib->snd_bufsz) {
+					if (sig_sem(p_spcb->p_spinib->snd_semid) < 0) {
+						p_spcb->errorflag = true;
+					}
+				}
+				p_spcb->snd_count--;
+			}
+		}
+	}
+	else if ((p_spcb->ioctl & IOCTL_FCSND) != 0U && c == FC_START) {
+		/*
+		 *  éä¿¡ã«å¯¾ãã¦ãã­ã¼å¶å¾¡ãã¦ããå ´åï¼START ã¯æ¨ã¦ãï¼
+		 */
+	}
+	else if (p_spcb->rcv_count == p_spcb->p_spinib->rcv_bufsz) {
+		/*
+		 *  ãããã¡ãã«ã®å ´åï¼åä¿¡ããæå­ãæ¨ã¦ãï¼
+		 */
+	}
+	else {
+		/*
+		 *  åä¿¡ããæå­ãåä¿¡ãããã¡ã«å
+¥ããï¼
+		 */
+		p_spcb->p_spinib->rcv_buffer[p_spcb->rcv_write_ptr] = c;
+		INC_PTR(p_spcb->rcv_write_ptr, p_spcb->p_spinib->rcv_bufsz);
+		if (p_spcb->rcv_count == 0U) {
+			if (sig_sem(p_spcb->p_spinib->rcv_semid) < 0) {
+				p_spcb->errorflag = true;
+			}
+		}
+		p_spcb->rcv_count++;
+
+		/*
+		 *  STOPãéä¿¡ããï¼
+		 */
+		if ((p_spcb->ioctl & IOCTL_FCRCV) != 0U && !(p_spcb->rcv_stopped)
+						&& p_spcb->rcv_count
+							>= BUFCNT_STOP(p_spcb->p_spinib->rcv_bufsz)) {
+			if (!serial_snd_chr(p_spcb, FC_STOP)) {
+				p_spcb->rcv_fc_chr = FC_STOP;
+			}
+			p_spcb->rcv_stopped = true;
+		}
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãããã®æªéä¿¡æå­ã®ååºã
+ */
+bool_t
+serial_get_chr(ID portid, char *p_c)
+{
+	SPCB	*p_spcb;
+
+	if (1 <= portid && portid <= TNUM_PORT) {	/* ãã¼ãçªå·ã®ãã§ãã¯ */
+		p_spcb = get_spcb(portid);
+		if (p_spcb->openflag) {					/* ãªã¼ãã³æ¸ã¿ãã®ãã§ãã¯ */
+			if (p_spcb->snd_count > 0U) {
+				*p_c = p_spcb->p_spinib->snd_buffer[p_spcb->snd_read_ptr];
+				INC_PTR(p_spcb->snd_read_ptr, p_spcb->p_spinib->snd_bufsz);
+				p_spcb->snd_count--;
+				return(true);
+			}
+		}
+	}
+	return(false);
+}
Index: asp3_wo_tecs/trunk/syssvc/serial.cfg
===================================================================
--- asp3_wo_tecs/trunk/syssvc/serial.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/serial.cfg	(revision 302)
@@ -0,0 +1,26 @@
+/*
+ *		ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: serial.cfg 285 2014-11-29 07:37:58Z ertl-hiro $
+ */
+
+#include "target_syssvc.h"
+INCLUDE("target_serial.cfg");
+
+#include "syssvc/serial.h"
+ATT_INI({ TA_NULL, 0, serial_initialize });
+
+CRE_SEM(SERIAL_RCV_SEM1, { TA_TPRI, 0, 1 });
+CRE_SEM(SERIAL_SND_SEM1, { TA_TPRI, 1, 1 });
+#if TNUM_PORT >= 2
+CRE_SEM(SERIAL_RCV_SEM2, { TA_TPRI, 0, 1 });
+CRE_SEM(SERIAL_SND_SEM2, { TA_TPRI, 1, 1 });
+#endif /* TNUM_PORT >= 2 */
+#if TNUM_PORT >= 3
+CRE_SEM(SERIAL_RCV_SEM3, { TA_TPRI, 0, 1 });
+CRE_SEM(SERIAL_SND_SEM3, { TA_TPRI, 1, 1 });
+#endif /* TNUM_PORT >= 3 */
+#if TNUM_PORT >= 4
+CRE_SEM(SERIAL_RCV_SEM4, { TA_TPRI, 0, 1 });
+CRE_SEM(SERIAL_SND_SEM4, { TA_TPRI, 1, 1 });
+#endif /* TNUM_PORT >= 4 */
Index: asp3_wo_tecs/trunk/syssvc/serial.h
===================================================================
--- asp3_wo_tecs/trunk/syssvc/serial.h	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/serial.h	(revision 302)
@@ -0,0 +1,115 @@
+/*
+ *  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) 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: serial.h 120 2014-05-13 20:05:57Z ertl-hiro $
+ */
+
+/*
+ *		ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ã
+ */
+
+#ifndef TOPPERS_SERIAL_H
+#define TOPPERS_SERIAL_H
+
+#include <kernel.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *  ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ç¨ãããã±ãã
+ */
+typedef struct {
+	uint_t		reacnt;			/* åä¿¡ãããã¡ä¸­ã®æå­æ° */
+	uint_t		wricnt;			/* éä¿¡ãããã¡ä¸­ã®æå­æ° */
+} T_SERIAL_RPOR;
+
+/*
+ *  ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®åæåã«ã¼ãã³
+ */
+extern void		serial_initialize(intptr_t exinf) throw();
+
+/*
+ *  ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãããã®æªéä¿¡æå­ã®ååºã
+ */
+extern bool_t	serial_get_chr(ID portid, char *p_c) throw();
+
+/*
+ *  ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ãµã¼ãã¹ã³ã¼ã«
+ */
+extern ER		serial_opn_por(ID portid) throw();
+extern ER		serial_cls_por(ID portid) throw();
+extern ER_UINT	serial_rea_dat(ID portid, char *buf, uint_t len) throw();
+extern ER_UINT	serial_wri_dat(ID portid, const char *buf, uint_t len) throw();
+extern ER		serial_ctl_por(ID portid, uint_t ioctl) throw();
+extern ER		serial_ref_por(ID portid, T_SERIAL_RPOR *pk_rpor) throw();
+
+/*
+ *  ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®åä½å¶å¾¡ç¨ã®ããã®å®æ°
+ *
+ *  ä»¥ä¸ã®å®æ°ã¯ï¼ãããæ¯ã«è«çåãã¨ã£ã¦ç¨ããï¼
+ */
+#define	IOCTL_NULL	0U			/* æå®ãªã */
+#define	IOCTL_ECHO	0x0001U		/* åä¿¡ããæå­ãã¨ã³ã¼ããã¯ */
+#define	IOCTL_CRLF	0x0010U		/* LFãéä¿¡ããåã«CRãä»å  */
+#define	IOCTL_FCSND	0x0100U		/* éä¿¡ã«å¯¾ãã¦ãã­ã¼å¶å¾¡ãè¡ã */
+#define	IOCTL_FCANY	0x0200U		/* ã©ã®ãããªæå­ã§ãéä¿¡åé */
+#define	IOCTL_FCRCV	0x0400U		/* åä¿¡ã«å¯¾ãã¦ãã­ã¼å¶å¾¡ãè¡ã */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_SERIAL_H */
Index: asp3_wo_tecs/trunk/syssvc/syslog.c
===================================================================
--- asp3_wo_tecs/trunk/syssvc/syslog.c	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/syslog.c	(revision 302)
@@ -0,0 +1,317 @@
+/*
+ *  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: syslog.c 406 2015-08-02 21:57:18Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ã­ã°æ©è½
+ */
+
+#include <sil.h>
+#undef TOPPERS_OMIT_SYSLOG
+#include <t_syslog.h>
+#include <log_output.h>
+#include "target_syssvc.h"
+#include "syslog.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_SYSLOG_WRI_LOG_ENTER
+#define LOG_SYSLOG_WRI_LOG_ENTER(prio, p_syslog)
+#endif /* LOG_SYSLOG_WRI_LOG_ENTER */
+
+#ifndef LOG_SYSLOG_WRI_LOG_LEAVE
+#define LOG_SYSLOG_WRI_LOG_LEAVE(ercd)
+#endif /* LOG_SYSLOG_WRI_LOG_LEAVE */
+
+#ifndef LOG_SYSLOG_REA_LOG_ENTER
+#define LOG_SYSLOG_REA_LOG_ENTER(p_syslog)
+#endif /* LOG_SYSLOG_REA_LOG_ENTER */
+
+#ifndef LOG_SYSLOG_REA_LOG_LEAVE
+#define LOG_SYSLOG_REA_LOG_LEAVE(ercd, p_syslog)
+#endif /* LOG_SYSLOG_REA_LOG_LEAVE */
+
+#ifndef LOG_SYSLOG_MSK_LOG_ENTER
+#define LOG_SYSLOG_MSK_LOG_ENTER(logmask, lowmask)
+#endif /* LOG_SYSLOG_MSK_LOG_ENTER */
+
+#ifndef LOG_SYSLOG_MSK_LOG_LEAVE
+#define LOG_SYSLOG_MSK_LOG_LEAVE(ercd)
+#endif /* LOG_SYSLOG_MSK_LOG_LEAVE */
+
+#ifndef LOG_SYSLOG_REF_LOG_ENTER
+#define LOG_SYSLOG_REF_LOG_ENTER(pk_rlog)
+#endif /* LOG_SYSLOG_REF_LOG_ENTER */
+
+#ifndef LOG_SYSLOG_REF_LOG_LEAVE
+#define LOG_SYSLOG_REF_LOG_LEAVE(ercd, pk_rlog)
+#endif /* LOG_SYSLOG_REF_LOG_LEAVE */
+
+#ifndef LOG_SYSLOG_FLS_LOG_ENTER
+#define LOG_SYSLOG_FLS_LOG_ENTER()
+#endif /* LOG_SYSLOG_FLS_LOG_ENTER */
+
+#ifndef LOG_SYSLOG_FLS_LOG_LEAVE
+#define LOG_SYSLOG_FLS_LOG_LEAVE(ercd)
+#endif /* LOG_SYSLOG_FLS_LOG_LEAVE */
+
+/*
+ *  ã­ã°æå»ã®åãåºã
+ *
+ *  ããã©ã«ãã§ã¯ï¼ã­ã°æå»ã¨ãã¦ï¼é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ãç¨ãã¦
+ *  ããï¼ã¿ã¼ã²ããä¾å­ã§å¤æ´ããå ´åã«ã¯ï¼SYSLOG_GET_LOGTIMã«ï¼ã­ã°æ
+ *  å»ãåãåºããã¯ã­ãå®ç¾©ããï¼
+ */
+#ifndef SYSLOG_GET_LOGTIM
+#define target_hrt_get_current		_kernel_target_hrt_get_current
+#include "target_timer.h"
+#define SYSLOG_GET_LOGTIM(p_logtim) \
+				(*(p_logtim) = _kernel_target_hrt_get_current())
+#endif /* SYSLOG_GET_LOGTIM */
+
+/*
+ *  ã­ã°ãããã¡ã¨ããã«ã¢ã¯ã»ã¹ããããã®ãã¤ã³ã¿
+ */
+static SYSLOG	syslog_buffer[TCNT_SYSLOG_BUFFER];	/* ã­ã°ãããã¡ */
+static uint_t	syslog_count;			/* ã­ã°ãããã¡ä¸­ã®ã­ã°ã®æ° */
+static uint_t	syslog_head;			/* å
+é ­ã®ã­ã°ã®æ ¼ç´ä½ç½® */
+static uint_t	syslog_tail;			/* æ¬¡ã®ã­ã°ã®æ ¼ç´ä½ç½® */
+static uint_t	syslog_lost;			/* å¤±ãããã­ã°ã®æ° */
+
+/*
+ *  åºåãã¹ãã­ã°æ
+å ±ã®éè¦åº¦ï¼ããããããï¼
+ */
+static uint_t	syslog_logmask;			/* ã­ã°ãããã¡ã«è¨é²ãã¹ãéè¦åº¦ */
+static uint_t	syslog_lowmask_not;		/* ä½ã¬ãã«åºåãã¹ãéè¦åº¦ï¼åè»¢ï¼*/
+
+/*
+ *  ã·ã¹ãã ã­ã°æ©è½ã®åæå
+ */
+void
+syslog_initialize(intptr_t exinf)
+{
+	syslog_count = 0U;
+	syslog_head = 0U;
+	syslog_tail = 0U;
+	syslog_lost = 0U;
+	syslog_logmask = 0U;
+	syslog_lowmask_not = 0U;
+}     
+
+/* 
+ *  ã­ã°æ
+å ±ã®åºå
+ *
+ *  CPUã­ãã¯ç¶æ
+ãå®è¡ã³ã³ãã­ã¹ãã«ãããåä½ã§ããããã«å®è£
+ãã¦ããï¼
+ */
+ER
+syslog_wri_log(uint_t prio, const SYSLOG *p_syslog)
+{
+	SIL_PRE_LOC;
+
+	LOG_SYSLOG_WRI_LOG_ENTER(prio, p_syslog);
+	SIL_LOC_INT();
+
+	/*
+	 *  ã­ã°æå»ã®è¨­å®
+	 */
+	SYSLOG_GET_LOGTIM(&(((SYSLOG *) p_syslog)->logtim));
+
+	/*
+	 *  ã­ã°ãããã¡ã«è¨é²
+	 */
+	if ((syslog_logmask & LOG_MASK(prio)) != 0U) {
+		syslog_buffer[syslog_tail] = *p_syslog;
+		syslog_tail++;
+		if (syslog_tail >= TCNT_SYSLOG_BUFFER) {
+			syslog_tail = 0U;
+		}
+		if (syslog_count < TCNT_SYSLOG_BUFFER) {
+			syslog_count++;
+		}
+		else {
+			syslog_head = syslog_tail;
+			syslog_lost++;
+		}
+	}
+
+	/*
+	 *  ä½ã¬ãã«åºå
+	 */
+	if (((~syslog_lowmask_not) & LOG_MASK(prio)) != 0U) {
+		syslog_print(p_syslog, target_fput_log);
+		target_fput_log('\n');
+	}
+
+	SIL_UNL_INT();
+	LOG_SYSLOG_WRI_LOG_LEAVE(E_OK);
+	return(E_OK);
+}
+
+/*
+ *  ã­ã°ãããã¡ããã®èª­åºã
+ *
+ *  CPUã­ãã¯ç¶æ
+ãå®è¡ã³ã³ãã­ã¹ãã«ãããåä½ã§ããããã«å®è£
+ãã¦ããï¼
+ */
+ER_UINT
+syslog_rea_log(SYSLOG *p_syslog)
+{
+	ER_UINT	ercd;
+	SIL_PRE_LOC;
+
+	LOG_SYSLOG_REA_LOG_ENTER(p_syslog);
+	SIL_LOC_INT();
+
+	/*
+	 *  ã­ã°ãããã¡ããã®ååºã
+	 */
+	if (syslog_count > 0U) {
+		*p_syslog = syslog_buffer[syslog_head];
+		syslog_count--;
+		syslog_head++;
+		if (syslog_head >= TCNT_SYSLOG_BUFFER) {
+			syslog_head = 0U;
+		}
+		ercd = (ER_UINT) syslog_lost;
+		syslog_lost = 0U;
+	}
+	else {
+		ercd = E_OBJ;
+	}
+
+	SIL_UNL_INT();
+	LOG_SYSLOG_REA_LOG_LEAVE(ercd, p_syslog);
+	return(ercd);
+}
+
+/* 
+ *  åºåãã¹ãã­ã°æ
+å ±ã®éè¦åº¦ã®è¨­å®
+ */
+ER
+syslog_msk_log(uint_t logmask, uint_t lowmask)
+{
+	SIL_PRE_LOC;
+
+	LOG_SYSLOG_MSK_LOG_ENTER(logmask, lowmask);
+	SIL_LOC_INT();
+
+	syslog_logmask = logmask;
+	syslog_lowmask_not = ~lowmask;
+
+	SIL_UNL_INT();
+	LOG_SYSLOG_MSK_LOG_LEAVE(E_OK);
+	return(E_OK);
+}
+
+/*
+ *  ã­ã°ãããã¡ã®ç¶æ
+åç
+§
+ */
+ER
+syslog_ref_log(T_SYSLOG_RLOG *pk_rlog)
+{
+	SIL_PRE_LOC;
+
+	LOG_SYSLOG_REF_LOG_ENTER(pk_rlog);
+	SIL_LOC_INT();
+
+	pk_rlog->count = syslog_count;
+	pk_rlog->lost = syslog_lost;
+	pk_rlog->logmask = syslog_logmask;
+	pk_rlog->lowmask = ~syslog_lowmask_not;
+
+	SIL_UNL_INT();
+	LOG_SYSLOG_REF_LOG_LEAVE(E_OK, pk_rlog);
+	return(E_OK);
+}
+
+/* 
+ *  ä½ã¬ãã«åºåã«ãããã¹ã¦ã®ã­ã°æ
+å ±ã®åºå
+ */
+ER
+syslog_fls_log(void)
+{
+	SYSLOG	logbuf;
+	ER_UINT	rercd;
+	SIL_PRE_LOC;
+
+	LOG_SYSLOG_FLS_LOG_ENTER();
+	SIL_LOC_INT();
+
+	while ((rercd = syslog_rea_log(&logbuf)) >= 0) {
+		if (rercd > 0) {
+			syslog_lostmsg((uint_t) rercd, target_fput_log);
+		}
+		if (logbuf.logtype >= LOG_TYPE_COMMENT) {
+			syslog_print(&logbuf, target_fput_log);
+			target_fput_log('\n');
+		}
+	}
+
+	SIL_UNL_INT();
+	LOG_SYSLOG_FLS_LOG_LEAVE(E_OK);
+	return(E_OK);
+}
Index: asp3_wo_tecs/trunk/syssvc/syslog.cfg
===================================================================
--- asp3_wo_tecs/trunk/syssvc/syslog.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/syslog.cfg	(revision 302)
@@ -0,0 +1,8 @@
+/*
+ *		ã·ã¹ãã ã­ã°æ©è½ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: syslog.cfg 285 2014-11-29 07:37:58Z ertl-hiro $
+ */
+
+#include "syssvc/syslog.h"
+ATT_INI({ TA_NULL, 0, syslog_initialize });
Index: asp3_wo_tecs/trunk/syssvc/syslog.h
===================================================================
--- asp3_wo_tecs/trunk/syssvc/syslog.h	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/syslog.h	(revision 302)
@@ -0,0 +1,119 @@
+/*
+ *  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: syslog.h 391 2015-08-01 04:22:59Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ã­ã°æ©è½
+ */
+
+#ifndef TOPPERS_SYSLOG_H
+#define TOPPERS_SYSLOG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <t_stddef.h>
+#include <t_syslog.h>
+
+/*
+ *  ã­ã°ãããã¡ã®ãµã¤ãº
+ */
+#ifndef TCNT_SYSLOG_BUFFER
+#define TCNT_SYSLOG_BUFFER	32		/* ã­ã°ãããã¡ã®ãµã¤ãº */
+#endif /* TCNT_SYSLOG_BUFFER */
+
+/*
+ *  ã·ã¹ãã ã­ã°æ©è½ã®åæå
+ */
+extern void	syslog_initialize(intptr_t exinf) throw();
+
+/*
+ *  ã­ã°æ
+å ±ã®åºå
+ */
+extern ER	syslog_wri_log(uint_t prio, const SYSLOG *p_syslog) throw();
+
+/*
+ *  ã­ã°ãããã¡ããã®ã­ã°æ
+å ±ã®èª­åºã
+ */
+extern ER_UINT	syslog_rea_log(SYSLOG *p_syslog) throw();
+
+/*
+ *  åºåãã¹ãã­ã°æ
+å ±ã®éè¦åº¦ã®è¨­å®
+ */
+extern ER	syslog_msk_log(uint_t logmask, uint_t lowmask) throw();
+
+/*
+ *  ã­ã°ãããã¡ã®ç¶æ
+åç
+§
+ */
+extern ER	syslog_ref_log(T_SYSLOG_RLOG *pk_rlog) throw();
+
+/*
+ *  ä½ã¬ãã«åºåã«ãããã¹ã¦ã®ã­ã°æ
+å ±ã®åºå
+ */
+extern ER	syslog_fls_log(void) throw();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_SYSLOG_H */
Index: asp3_wo_tecs/trunk/syssvc/test_svc.c
===================================================================
--- asp3_wo_tecs/trunk/syssvc/test_svc.c	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/test_svc.c	(revision 302)
@@ -0,0 +1,203 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: test_svc.c 391 2015-08-01 04:22:59Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¹ããã­ã°ã©ã ç¨ãµã¼ãã¹
+ */
+
+#include <kernel.h>
+#include <sil.h>
+#include <t_syslog.h>
+#include <t_stdlib.h>
+#include <log_output.h>
+#include "syssvc/syslog.h"
+#include "target_syssvc.h"
+#include "test_svc.h"
+
+/*
+ *	ãã§ãã¯ãã¤ã³ã
+ */
+static uint_t	check_count;
+
+/*
+ *	èªå·±è¨ºæ­é¢æ°
+ */
+static BIT_FUNC	check_bit_func;
+
+/*
+ *  ãã¹ããã­ã°ã©ã ã®éå§
+ */
+void
+test_start(char *progname)
+{
+	syslog_1(LOG_NOTICE, "Test program: %s", progname);
+	check_count = 0U;
+	check_bit_func = NULL;
+}
+
+/*
+ *	èªå·±è¨ºæ­é¢æ°ã®è¨­å®
+ */
+void
+set_bit_func(BIT_FUNC bit_func)
+{
+	check_bit_func = bit_func;
+}
+
+/*
+ *	ãã¹ããã­ã°ã©ã ã®çµäº
+ */
+static void
+test_finish(void)
+{
+	SIL_PRE_LOC;
+
+	SIL_LOC_INT();
+	(void) syslog_fls_log();
+	(void) ext_ker();
+
+	/* ããã¸æ¥ããã¨ã¯ãªãã¯ã */
+	SIL_UNL_INT();
+}
+
+/*
+ *	ãã§ãã¯ãã¤ã³ã
+ */
+void
+check_point(uint_t count)
+{
+	bool_t	errorflag = false;
+	ER		rercd;
+	SIL_PRE_LOC;
+
+	/*
+	 *  å²è¾¼ã¿ã­ãã¯ç¶æ
+ã«
+	 */
+	SIL_LOC_INT();
+
+	/*
+	 *  ã·ã¼ã±ã³ã¹ãã§ãã¯
+	 */
+	if (++check_count == count) {
+		syslog_1(LOG_NOTICE, "Check point %d passed.", count);
+	}
+	else {
+		syslog_1(LOG_ERROR, "## Unexpected check point %d.", count);
+		errorflag = true;
+	}
+
+	/*
+	 *  ã«ã¼ãã«ã®å
+é¨ç¶æ
+ã®æ¤æ»
+	 */
+	if (check_bit_func != NULL) {
+		rercd = (*check_bit_func)();
+		if (rercd < 0) {
+			syslog_2(LOG_ERROR, "## Internal inconsistency detected (%s, %d).",
+								itron_strerror(rercd), SERCD(rercd));
+			errorflag = true;
+		}
+	}
+
+	/*
+	 *  ã¨ã©ã¼ãæ¤åºãããå ´åã¯ï¼ãã¹ããã­ã°ã©ã ãçµäºããï¼
+	 */
+	if (errorflag) {
+		test_finish();
+	}
+
+	/*
+	 *  å²è¾¼ã¿ã­ãã¯ç¶æ
+ãè§£é¤
+	 */
+	SIL_UNL_INT();
+}
+
+/*
+ *	å®äºãã§ãã¯ãã¤ã³ã
+ */
+void
+check_finish(uint_t count)
+{
+	if (count > 0U) {
+		check_point(count);
+		syslog_0(LOG_NOTICE, "All check points passed.");
+	}
+	test_finish();
+}
+
+/*
+ *	æ¡ä»¶ãã§ãã¯ã®ã¨ã©ã¼å¦ç
+ */
+void
+check_assert_error(const char *expr, const char *file, int_t line)
+{
+	syslog_3(LOG_ERROR, "## Assertion `%s' failed at %s:%u.",
+								expr, file, line);
+	test_finish();
+}
+
+/*
+ *	ã¨ã©ã¼ã³ã¼ããã§ãã¯ã®ã¨ã©ã¼å¦ç
+ */
+void
+check_ercd_error(ER ercd, const char *file, int_t line)
+{
+	syslog_3(LOG_ERROR, "## Unexpected error %s detected at %s:%u.",
+								itron_strerror(ercd), file, line);
+	test_finish();
+}
Index: asp3_wo_tecs/trunk/syssvc/test_svc.h
===================================================================
--- asp3_wo_tecs/trunk/syssvc/test_svc.h	(revision 302)
+++ asp3_wo_tecs/trunk/syssvc/test_svc.h	(revision 302)
@@ -0,0 +1,143 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: test_svc.h 494 2016-01-10 08:12:56Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¹ããã­ã°ã©ã ç¨ãµã¼ãã¹
+ */
+
+#ifndef TOPPERS_TEST_SVC_H
+#define TOPPERS_TEST_SVC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *	èªå·±è¨ºæ­é¢æ°ã®å
+ */
+typedef ER (*BIT_FUNC)(void);
+
+/*
+ *  ãã¹ããã­ã°ã©ã ã®éå§
+ */
+extern void	test_start(char *progname);
+
+/*
+ *	èªå·±è¨ºæ­é¢æ°ã®è¨­å®
+ */
+extern void	set_bit_func(BIT_FUNC bit_func);
+
+/*
+ *	ãã§ãã¯ãã¤ã³ã
+ */
+extern void	check_point(uint_t count);
+
+/*
+ *	å®äºãã§ãã¯ãã¤ã³ã
+ */
+extern void	check_finish(uint_t count);
+
+/*
+ *	æ¡ä»¶ãã§ãã¯
+ */
+extern void	check_assert_error(const char *expr, const char *file, int_t line);
+#define check_assert(exp) \
+	((void)(!(exp) ? (check_assert_error(#exp, __FILE__, __LINE__), 0) : 0))
+
+/*
+ *	ã¨ã©ã¼ã³ã¼ããã§ãã¯
+ */
+extern void	check_ercd_error(ER ercd, const char *file, int_t line);
+#define check_ercd(ercd, expected_ercd) \
+	((void)((ercd) != (expected_ercd) ? \
+					(check_ercd_error(ercd, __FILE__, __LINE__), 0) : 0))
+
+/*
+ *	ã·ã¹ãã ç¶æ
+ã®ãã§ãã¯
+ */
+#define check_state(ctx, loc, dsp, dpn, ter) do {	\
+	check_assert(sns_ctx() == ctx);					\
+	check_assert(sns_loc() == loc);					\
+	check_assert(sns_dsp() == dsp);					\
+	check_assert(sns_dpn() == dpn);					\
+	check_assert(sns_ter() == ter);					\
+} while (false);
+
+/*
+ *	å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®ãã§ãã¯
+ */
+#define check_ipm(ipm) do {				\
+	PRI		intpri;						\
+	ER		ercd;						\
+										\
+	ercd = get_ipm(&intpri);			\
+	check_ercd(ercd, E_OK);				\
+	check_assert(intpri == ipm);		\
+} while (false);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TOPPERS_TEST_SVC_H */
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/E_PACKAGE
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/E_PACKAGE	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/E_PACKAGE	(revision 302)
@@ -0,0 +1,7 @@
+E_PACKAGE asp3_blueninja_gcc
+VERSION %date
+
+INCLUDE MANIFEST
+INCLUDE ../../MANIFEST
+INCLUDE ../../arch/arm_m_gcc/MANIFEST
+
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/MANIFEST
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/MANIFEST	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/MANIFEST	(revision 302)
@@ -0,0 +1,36 @@
+PACKAGE asp3_arch_arm_m_gcc
+VERSION 3.A.0
+
+E_PACKAGE
+tz1000.h
+blueninja_ram.ld
+blueninja_ram_cfg1_out.ld
+Makefile.target
+MANIFEST
+start.S
+target.tf
+target_asm.inc
+target_cfg1_out.h
+target_check.tf
+target_kernel_impl.c
+target_kernel_impl.h
+target_def.csv
+target_kernel.h
+target_offset.tf
+target_rename.def
+target_rename.h
+target_serial.c
+target_serial.cfg
+target_serial.h
+target_sil.h
+target_stddef.h
+target_syssvc.h
+target_test.cfg
+target_test.h
+target_timer.c
+target_timer.cfg
+target_timer.h
+target_unrename.h
+target_user.txt
+RTE.patch
+
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/Makefile.target
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/Makefile.target	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/Makefile.target	(revision 302)
@@ -0,0 +1,147 @@
+# 
+#   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: Makefile.target 301 2015-01-07 04:57:01Z ertl-ishikawa $
+# 
+# 
+
+#
+#		Makefile ã®ã¿ã¼ã²ããä¾å­é¨ï¼BlueNinjaç¨ï¼
+#
+
+#
+#  ãã¼ãåï¼ãã­ã»ããµåï¼éçºç°å¢åã®å®ç¾©
+#
+BOARD = blueninja
+PRC   = arm_m
+TOOL  = gcc
+
+DEVICEDIR = $(TARGETDIR)/device
+
+#
+#  ã³ã³ãã¤ã«ãªãã·ã§ã³
+#
+INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(SRCDIR)/arch -I$(DEVICEDIR)/RTE -I$(DEVICEDIR)/RTE/Device/TZ1001MBG -I$(DEVICEDIR)/TOSHIBA.TZ10xx_DFP/Device/Include -I$(DEVICEDIR)/TOSHIBA.TZ10xx_DFP/RTE_Driver -I$(DEVICEDIR)/ARM.CMSIS/CMSIS/Include -I$(DEVICEDIR)/ARM.CMSIS/CMSIS/Driver/Include
+COPTS := $(COPTS) -MMD -MP -mlittle-endian -mcpu=cortex-m4 -mthumb-interwork -march=armv7e-m -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -std=c99 -D__TARGET_FPU_VFPUV4_D16
+LDFLAGS := $(LDFLAGS) -MMD -MP -mlittle-endian -mcpu=cortex-m4 -mthumb-interwork -march=armv7e-m -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -std=c99
+
+vpath %.c $(TARGETDIR) $(DEVICEDIR)/TOSHIBA.TZ10xx_DFP/RTE_Driver
+vpath %.S $(TARGETDIR)
+
+#
+#  ã«ã¼ãã«ã«é¢ããå®ç¾©
+#
+KERNEL_DIR := $(KERNEL_DIR) $(TARGETDIR)
+KERNEL_ASMOBJS := $(KERNEL_ASMOBJS)
+KERNEL_COBJS := $(KERNEL_COBJS) target_kernel_impl.o target_timer.o GPIO_TZ10xx.o PMU_TZ10xx.o TMR_TZ10xx.o UART_TZ10xx.o
+
+#
+#  ã·ã¹ãã ãµã¼ãã¹ã«é¢ããå®ç¾©
+#
+SYSSVC_DIR := $(SYSSVC_DIR) 
+SYSSVC_COBJS := $(SYSSVC_COBJS) target_serial.o
+
+#
+#  ãã¬ã¼ã¹ã­ã°ã«é¢ããè¨­å®
+#
+ifeq ($(ENABLE_TRACE),true)
+      COPTS := $(COPTS) -DTOPPERS_ENABLE_TRACE
+      KERNEL_DIR := $(KERNEL_DIR) $(SRCDIR)/arch/logtrace
+      KERNEL_COBJS := $(KERNEL_COBJS) trace_config.o trace_dump.o
+endif
+
+#
+#  GNUéçºç°å¢ã®ã¿ã¼ã²ããã¢ã¼ã­ãã¯ãã£ã®å®ç¾©
+#
+GCC_TARGET = arm-none-eabi
+
+#
+#  ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã«é¢ããå®ç¾©
+#
+#  ldã«ãSTARTUP(start.o)ããè¨è¿°ããããï¼
+#  ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«ã®ååãHIDDEN_OBJSã«å®ç¾©ããï¼
+#  ã¾ãï¼LDFLAGSã«-nostdlibãè¿½å ãã¦ããï¼
+#
+HIDDEN_OBJS = start.o
+
+$(HIDDEN_OBJS): %.o: %.S
+	$(CC) -c $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+LDFLAGS := -nostdlib $(LDFLAGS)
+
+#
+#  ä¾å­é¢ä¿ã®å®ç¾©
+#
+kernel_cfg.timestamp: $(TARGETDIR)/target.tf
+
+#
+#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
+#
+CFG_TABS := $(CFG_TABS) --cfg1-def-table $(TARGETDIR)/target_def.csv
+CFG1_OUT_LDFLAGS := $(LDFLAGS) -T $(TARGETDIR)/blueninja_ram_cfg1_out.ld
+
+#
+#  ãªã³ã«ã¹ã¯ãªããã®å®ç¾©
+#
+OBJ_LDFLAGS := $(LDFLAGS) -T $(TARGETDIR)/blueninja_ram.ld
+
+# 
+#  ãªãã»ãããã¡ã¤ã«çæã®ããã®å®ç¾© 
+# 
+OFFSET_TF := $(TARGETDIR)/target_offset.tf
+
+#
+#  ã³ã¢ä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ã
+#
+include $(SRCDIR)/arch/$(PRC)_$(TOOL)/common/Makefile.core
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/RTE.patch
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/RTE.patch	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/RTE.patch	(revision 302)
@@ -0,0 +1,100 @@
+--- TOSHIBA.TZ10xx_DFP/RTE_Driver/Config/RTE_Device.h	2015-06-17 16:12:02.000000000 +0900
++++ RTE/Device/TZ1001MBG/RTE_Device.h	2015-11-09 10:42:14.000000000 +0900
+@@ -87,22 +87,22 @@
+ #define RTE_GPIO_9_ID 1
+ #define RTE_GPIO_10_ID 1
+ #define RTE_GPIO_11_ID 1
+-#define RTE_GPIO_12_ID 1
+-#define RTE_GPIO_13_ID 1
+-#define RTE_GPIO_14_ID 1
+-#define RTE_GPIO_15_ID 1
+-#define RTE_GPIO_16_ID 0
+-#define RTE_GPIO_17_ID 0
+-#define RTE_GPIO_18_ID 0
+-#define RTE_GPIO_19_ID 0
+-#define RTE_GPIO_20_ID 0
+-#define RTE_GPIO_21_ID 0
+-#define RTE_GPIO_22_ID 0
+-#define RTE_GPIO_23_ID 0
+-#define RTE_GPIO_24_ID 1
+-#define RTE_GPIO_25_ID 1
+-#define RTE_GPIO_26_ID 1
+-#define RTE_GPIO_27_ID 1
++#define RTE_GPIO_12_ID 0
++#define RTE_GPIO_13_ID 0
++#define RTE_GPIO_14_ID 0
++#define RTE_GPIO_15_ID 0
++#define RTE_GPIO_16_ID 1
++#define RTE_GPIO_17_ID 1
++#define RTE_GPIO_18_ID 2
++#define RTE_GPIO_19_ID 2
++#define RTE_GPIO_20_ID 1
++#define RTE_GPIO_21_ID 1
++#define RTE_GPIO_22_ID 2
++#define RTE_GPIO_23_ID 2
++#define RTE_GPIO_24_ID 0
++#define RTE_GPIO_25_ID 0
++#define RTE_GPIO_26_ID 0
++#define RTE_GPIO_27_ID 0
+ #define RTE_GPIO_28_ID 1
+ #define RTE_GPIO_29_ID 1
+ #define RTE_GPIO_30_ID 1
+@@ -283,12 +283,12 @@
+ //   <o8> DMA Channel <0-7>
+ //   <o9> Handshake Channel <0-7>
+ //  </e>
+-#define RTE_SPI3 0
++#define RTE_SPI3 1
+ #if RTE_SPI3
+-#define RTE_SPIM3_CS_N_ID 1
+-#define RTE_SPIM3_CLK_ID 1
+-#define RTE_SPIM3_MOSI_ID 1
+-#define RTE_SPIM3_MISO_ID 1
++#define RTE_SPIM3_CS_N_ID 2
++#define RTE_SPIM3_CLK_ID 2
++#define RTE_SPIM3_MOSI_ID 2
++#define RTE_SPIM3_MISO_ID 2
+ #define RTE_SPIM3_DRIVE_CAPABILITY 0
+ #define RTE_SPIM3_RESISTOR         0
+ #define RTE_SPIM3_DMA_RX 0
+@@ -347,7 +347,7 @@
+ //   <o6> DMA Channel <0-7>
+ //   <o7> Handshake Channel <0-7>
+ //  </e>
+-#define RTE_I2C1 0
++#define RTE_I2C1 1
+ #if RTE_I2C1
+ #define RTE_I2C1_DATA_ID 1
+ #define RTE_I2C1_CLK_ID 1
+@@ -377,10 +377,10 @@
+ //   <o6> DMA Channel <0-7>
+ //   <o7> Handshake Channel <0-7>
+ //  </e>
+-#define RTE_I2C2 0
++#define RTE_I2C2 1
+ #if RTE_I2C2
+-#define RTE_I2C2_DATA_ID 1
+-#define RTE_I2C2_CLK_ID 1
++#define RTE_I2C2_DATA_ID 2
++#define RTE_I2C2_CLK_ID 2
+ #define RTE_I2C2_DRIVE_CAPABILITY 0
+ #define RTE_I2C2_RESISTOR 1
+ #define RTE_I2C2_DMA_RX 0
+@@ -437,7 +437,7 @@
+ // <i> Configuration settings for Driver_UART1 in component ::Drivers:UART
+ //  <o1> UA1_RXD pin <1=>MCU_UA1_RXD
+ //  <o2> UA1_TXD pin <1=>MCU_UA1_TXD
+-#define RTE_UART1 0
++#define RTE_UART1 1
+ #if RTE_UART1
+ #define RTE_UA1_RXD_ID 1
+ #define RTE_UA1_TXD_ID 1
+@@ -533,7 +533,7 @@
+ // </e>
+ 
+ // <e> TMR (Timer)
+-#define RTE_TMR 0
++#define RTE_TMR 1
+ // </e>
+ 
+ // <e> ADVTMR (Advanced Timer)
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/blueninja_ram.ld
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/blueninja_ram.ld	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/blueninja_ram.ld	(revision 302)
@@ -0,0 +1,96 @@
+MEMORY
+{
+    ROM (rx) : ORIGIN = 0x00000000, LENGTH = 1024K
+    RAM (rwx) : ORIGIN = 0x10000000, LENGTH = 256K
+    RAM2 (rwx) : ORIGIN = 0x20000000, LENGTH = 32K
+}
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm","elf32-littlearm") 
+OUTPUT_ARCH(arm)
+
+PROVIDE(hardware_init_hook = 0);
+PROVIDE(software_init_hook = 0);
+PROVIDE(software_term_hook = 0);
+STARTUP(start.o)
+
+SECTIONS
+{
+    .boot :
+    {
+        *(.vector)
+        start.o(.text*)
+    } > ROM
+    _eboot = .	;
+
+    .text :
+    {
+        __text = . ; 
+        *(.text*)
+        *(.glue_7t)
+        *(.glue_7)
+    } > RAM AT > ROM
+    _etext = .	;
+    PROVIDE (etext = .)	;
+
+    .rodata : { 
+        *(.rodata*) 
+    } > ROM
+
+    . = ALIGN(4);
+    .data   :
+    {
+        __data_start = . ;
+        *(vtable)
+        *(.data*)
+    } > RAM AT > ROM
+    __idata_start = LOADADDR(.data) ;
+    __idata_end = __idata_start + SIZEOF(.data);
+    _edata  =  . ;
+    PROVIDE (edata = .);
+    . = ALIGN(4);
+
+    .bss       :
+    {
+       __bss_start = .	;
+      *(.bss*)
+      *(COMMON)
+      . = ALIGN(32 / 8);
+    } > RAM2
+   . = ALIGN(32 / 8);
+     _end = .		;
+    __bss_end = .;
+    PROVIDE (end = .)	;
+
+    .comment 0 : { *(.comment) }
+
+  /* DWARF debug sections.
+     Symbols in the DWARF debugging sections are relative to 
+     the beginning of the section so we begin them at 0.  */
+
+  /* DWARF 1 */
+  .debug          0 : { *(.debug) }
+  .line           0 : { *(.line) }
+
+  /* GNU DWARF 1 extensions */
+  .debug_srcinfo  0 : { *(.debug_srcinfo) }
+  .debug_sfnames  0 : { *(.debug_sfnames) }
+
+  /* DWARF 1.1 and DWARF 2 */
+  .debug_aranges  0 : { *(.debug_aranges) }
+  .debug_pubnames 0 : { *(.debug_pubnames) }
+
+  /* DWARF 2 */
+  .debug_info     0 : { *(.debug_info) }
+  .debug_abbrev   0 : { *(.debug_abbrev) }
+  .debug_line     0 : { *(.debug_line) }
+  .debug_frame    0 : { *(.debug_frame) }
+  .debug_str      0 : { *(.debug_str) }
+  .debug_loc      0 : { *(.debug_loc) }
+  .debug_macinfo  0 : { *(.debug_macinfo) }
+
+  /* SGI/MIPS DWARF 2 extensions */
+  .debug_weaknames 0 : { *(.debug_weaknames) }
+  .debug_funcnames 0 : { *(.debug_funcnames) }
+  .debug_typenames 0 : { *(.debug_typenames) }
+  .debug_varnames  0 : { *(.debug_varnames) }
+}
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/blueninja_ram_cfg1_out.ld
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/blueninja_ram_cfg1_out.ld	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/blueninja_ram_cfg1_out.ld	(revision 302)
@@ -0,0 +1,96 @@
+MEMORY
+{
+    ROM (rx) : ORIGIN = 0x00000000, LENGTH = 1024K
+    RAM (rwx) : ORIGIN = 0x10000000, LENGTH = 256K
+    RAM2 (rwx) : ORIGIN = 0x20000000, LENGTH = 32K
+}
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm","elf32-littlearm") 
+OUTPUT_ARCH(arm)
+
+PROVIDE(hardware_init_hook = 0);
+PROVIDE(software_init_hook = 0);
+PROVIDE(software_term_hook = 0);
+PROVIDE(_kernel_datasecinib_table = 0);
+PROVIDE(_kernel_tnum_datasec = 0);
+PROVIDE(_kernel_bsssecinib_table = 0);
+PROVIDE(_kernel_tnum_bsssec = 0);
+STARTUP(start.o)
+ENTRY(_start)
+
+SECTIONS
+{
+    .text :
+    {  
+        __text = . ; 
+        KEEP(*(.vector))
+        *(.text*)
+        *(.glue_7t)
+        *(.glue_7)
+    } > RAM
+    _eboot = .	;
+    _etext = .	;
+    PROVIDE (etext = .)	;
+
+    .rodata : { 
+        *(.rodata*) 
+    } > RAM
+
+    . = ALIGN(4);
+    __idata_start = . ;
+    .data   :  AT(__idata_start) 
+    {
+        __data_start = . ;
+        *(vtable)
+        *(.data*)
+    } > RAM
+    __idata_end = __idata_start + SIZEOF(.data);
+    _edata  =  . ;
+    PROVIDE (edata = .);
+    . = ALIGN(4);
+
+    .bss       :
+    {
+       __bss_start = .	;
+      *(.bss*)
+      *(COMMON)
+      . = ALIGN(32 / 8);
+    } > RAM
+   . = ALIGN(32 / 8);
+     _end = .		;
+    __bss_end = .;
+    PROVIDE (end = .)	;
+
+    .comment 0 : { *(.comment) }
+
+  /* DWARF debug sections.
+     Symbols in the DWARF debugging sections are relative to 
+     the beginning of the section so we begin them at 0.  */
+
+  /* DWARF 1 */
+  .debug          0 : { *(.debug) }
+  .line           0 : { *(.line) }
+
+  /* GNU DWARF 1 extensions */
+  .debug_srcinfo  0 : { *(.debug_srcinfo) }
+  .debug_sfnames  0 : { *(.debug_sfnames) }
+
+  /* DWARF 1.1 and DWARF 2 */
+  .debug_aranges  0 : { *(.debug_aranges) }
+  .debug_pubnames 0 : { *(.debug_pubnames) }
+
+  /* DWARF 2 */
+  .debug_info     0 : { *(.debug_info) }
+  .debug_abbrev   0 : { *(.debug_abbrev) }
+  .debug_line     0 : { *(.debug_line) }
+  .debug_frame    0 : { *(.debug_frame) }
+  .debug_str      0 : { *(.debug_str) }
+  .debug_loc      0 : { *(.debug_loc) }
+  .debug_macinfo  0 : { *(.debug_macinfo) }
+
+  /* SGI/MIPS DWARF 2 extensions */
+  .debug_weaknames 0 : { *(.debug_weaknames) }
+  .debug_funcnames 0 : { *(.debug_funcnames) }
+  .debug_typenames 0 : { *(.debug_typenames) }
+  .debug_varnames  0 : { *(.debug_varnames) }
+}
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/start.S
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/start.S	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/start.S	(revision 302)
@@ -0,0 +1,194 @@
+/*
+ *  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: start.S 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+                
+/*
+ *   ã«ã¼ãã«ç¨ã®ã¹ã¿ã¼ãã¢ããã¢ã¸ã¥ã¼ã«(ARM-Mç¨)
+ */
+#define TOPPERS_MACRO_ONLY
+#define UINT_C(val)		(val)		/* uint_tåã®å®æ°ãä½ããã¯ã­ */
+#define ULONG_C(val)	(val)		/* ulong_tåã®å®æ°ãä½ããã¯ã­ */
+#define CAST(type, val)	(val)		/* åã­ã£ã¹ããè¡ããã¯ã­ */
+
+#include "kernel_impl.h"
+#include "arm_m.h"
+#include "target_asm.inc"
+
+/*
+ *  ã¹ã¿ã¼ãã¢ããã«ã¼ãã³
+ *
+ *  Threadã¢ã¼ãã§å¼ã³åºããããã¨ãåæã¨ãã¦ãï¼
+ */
+	ATEXT
+	AALIGN(2)
+	ATHUMB(_start)
+	AGLOBAL(_start) 
+ALABEL(_start)
+	cpsid f                 /* å²è¾¼ã¿ã­ãã¯ç¶æ
+ã¸ */
+
+#ifdef INIT_MSP
+	/*
+	 * MSPã®è¨­å®
+	 */
+	mov   r0, #CONTROL_MSP  /* MSPãæå¹ã«  */
+	msr   control, r0
+	isb                     /* control ã®æä½å¾ã«å¿
+è¦ */
+	ldr  r0,=_kernel_istkpt
+	ldr  r1,[r0]
+	msr  msp, r1
+#endif /* INIT_MSP */
+
+#ifdef __TARGET_FPU_VFPUV4_D16
+    /*
+     *  ASPEN: CONTROL.FPCAãæå¹å
+     *  LSPEN: lazy context save FP ãç¡å¹å
+     */
+    mov r0, #(0xC0000000)   /* ASPEN = 1, LSPEN = 0 */
+    ldr r1, =0xE000EF34     /* FPCCR */
+    str r0, [r1]
+#endif /* __TARGET_FPU_VFPUV4_D16 */
+
+ALABEL(start_01)
+	/*
+	 *  textã»ã¯ã·ã§ã³åæå
+	 *  _eboot ããã¯ãã¾ãã¡ã¢ãªå
+å®¹ãï¼__text ãã _etext ã«
+	 *  ã³ãã¼ãã
+	 */
+	ldr  r1, =__text
+	ldr  r2, =_etext
+	cmp  r1, r2
+	bhs  start_03
+	ldr  r3, =_eboot
+ALABEL(start_02)
+	ldr  r0, [r3]
+	str  r0, [r1]
+	add  r1, #4
+	add  r3, #4
+	cmp  r1, r2
+	blo  start_02
+ALABEL(start_03)
+
+	/*
+	 * hardware_init_hookã®å¼ã³åºã ï¼0ã§ãªãå ´åï¼
+	 *
+	 * ã¿ã¼ã²ãããã¼ãã¦ã§ã¢ã«ä¾å­ãã¦å¿
+è¦ãªåæåå¦çãããå ´å
+	 * ã¯ï¼hardware_init_hook ã¨ããé¢æ°ãç¨æãã
+	 */
+	ldr  r0, =hardware_init_hook
+	cbz  r0, start_1
+	blx  r0
+
+ALABEL(start_1)
+#ifndef OMIT_BSS_INIT
+	/*
+	 *  BSSã»ã¯ã·ã§ã³åæå
+	 */
+	mov  r0, #0
+	ldr  r1, =BSS_START
+	ldr  r2, =BSS_END
+	cmp  r1, r2
+	bhs  start_3
+ALABEL(start_2)
+	str  r0, [r1]
+	add  r1,r1, #4    
+	cmp  r1, r2
+	blo  start_2
+#endif /* OMIT_BSS_INIT */
+
+
+ALABEL(start_3)
+#ifndef OMIT_DATA_INIT
+	/*
+	 *  DATAã»ã¯ã·ã§ã³åæå
+	 *  __idata_start ãã __idata_end ã¾ã§ãï¼__data_start ä»¥éã«
+	 *  ã³ãã¼ãã
+	 */
+	ldr  r1, =IDATA_START
+	ldr  r2, =IDATA_END
+	cmp  r1, r2
+	bhs  start_5
+	ldr  r3, =DATA_START
+ALABEL(start_4)
+	ldr  r0, [r1]
+	str  r0, [r3]
+	add  r1, #4
+	add  r3, #4
+	cmp  r1, r2
+	blo  start_4
+#endif /* OMIT_DATA_INIT */
+
+	/*
+	 *  software_init_hook ãå¼åºãï¼0 ã§ãªãå ´åï¼
+	 *
+	 *  ã½ããã¦ã§ã¢ç°å¢ï¼ç¹ã«ã©ã¤ãã©ãªï¼ã«ä¾å­ãã¦å¿
+è¦ãªåæåå¦
+	 *  çãããå ´åã¯ï¼software_init_hook ã¨ããé¢æ°ãç¨æããã°
+	 *  ããï¼
+	 */
+ALABEL(start_5)
+	ldr  r0, =software_init_hook
+	cbz  r0, start_6
+	blx  r0
+
+ALABEL(start_6)
+	bl   sta_ker
+
+ALABEL(l_end)
+	b   l_end
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/tPutLogTarget.c
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/tPutLogTarget.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/tPutLogTarget.c	(revision 302)
@@ -0,0 +1,112 @@
+/*
+ *  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-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: target_serial.c 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/* #[<PREAMBLE>]#
+ * #[<...>]# ãã #[</...>]# ã§å²ã¾ããã³ã¡ã³ãã¯ç·¨éããªãã§ãã ãã
+ * tecsmerge ã«ãããã¼ã¸ã«ä½¿ç¨ããã¾ã
+ *
+ * å¼ã³å£é¢æ° #_TCPF_#
+ * call port: cSIOPort signature: sSIOPort context:task
+ *   void           cSIOPort_open( );
+ *   void           cSIOPort_close( );
+ *   bool_t         cSIOPort_putChar( char c );
+ *   int_t          cSIOPort_getChar( );
+ *   void           cSIOPort_enableCBR( uint_t cbrtn );
+ *   void           cSIOPort_disableCBR( uint_t cbrtn );
+ *
+ * #[</PREAMBLE>]# */
+
+/* ãã­ãã¿ã¤ãå®£è¨ãå¤æ°ã®å®ç¾©ãããã«æ¸ãã¾ã #_PAC_# */
+#include "tPutLogTarget_tecsgen.h"
+#include <sil.h>
+#include "tz1000.h"
+
+#ifndef E_OK
+#define	E_OK	0		/* success */
+#define	E_ID	(-18)	/* illegal ID */
+#endif
+
+/* åãå£é¢æ° #_TEPF_# */
+/* #[<ENTRY_PORT>]# ePutLog
+ * entry port: ePutLog
+ * signature:  sPutLog
+ * context:    task
+ * #[</ENTRY_PORT>]# */
+
+/* #[<ENTRY_FUNC>]# ePutLog_putChar
+ * name:         ePutLog_putChar
+ * global_name:  tPutLogTarget_ePutLog_putChar
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+/*
+ *  ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®ããã®æå­åºå
+ */
+/* void target_fput_log(char c) */
+void
+ePutLog_putChar(char c)
+{
+	if (c == '\n') {
+        while ((sil_rew_mem(UARTFR(UART1_BASE)) & UARTFR_TXFF) == UARTFR_TXFF);
+        sil_wrw_mem(UARTDR(UART1_BASE), (uint32_t)('\r'));
+	}
+    while ((sil_rew_mem(UARTFR(UART1_BASE)) & UARTFR_TXFF) == UARTFR_TXFF);
+    sil_wrw_mem(UARTDR(UART1_BASE), (uint32_t)((uint8_t)(c)));
+}
+
+/* #[<POSTAMBLE>]#
+ *   ããããä¸ã«éåãå£é¢æ°ãæ¸ãã¾ã
+ * #[</POSTAMBLE>]#*/
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/tPutLogTarget.cdl
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/tPutLogTarget.cdl	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/tPutLogTarget.cdl	(revision 302)
@@ -0,0 +1,69 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2015 by Ushio Laboratory
+ *              Graduate School of Engineering Science, Osaka Univ., 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: tPutLogCT11MPCore.cdl 509 2016-01-12 06:06:14Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®ã³ã³ãã¼ãã³ãè¨è¿°
+ */
+
+/*
+ *  ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®ã»ã«ã¿ã¤ã
+ */
+[singleton]
+celltype tPutLogTarget {
+	entry	sPutLog		ePutLog;
+	call	sSIOPort	cSIOPort;
+};
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/tSIOPortTarget.cdl
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/tSIOPortTarget.cdl	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/tSIOPortTarget.cdl	(revision 302)
@@ -0,0 +1,141 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2015 by Ushio Laboratory
+ *              Graduate School of Engineering Science, Osaka Univ., 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: tSIOPortCT11MPCore.cdl 509 2016-01-12 06:06:14Z ertl-hiro $
+ */
+
+/*
+ *		ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ã¿ã¼ã²ããä¾å­é¨ï¼BlueNinjaç¨ï¼
+ *		ã®ã³ã³ãã¼ãã³ãè¨è¿°
+ */
+celltype tSIOPortTargetMain {
+	entry sSIOPort	eSIOPort;
+	call  siSIOCBR	ciSIOCBR;
+    call  sInterruptRequest cInterruptRequest;
+
+	entry sRoutineBody eInitialize; /* åæåå¦ç */
+	entry sRoutineBody eTerminate;   /* çµäºå¦ç */
+	entry siHandlerBody	eiISRBody;
+
+    var {
+        bool_t opnflg;
+    };
+
+	FACTORY {
+		write("tInterruptRequest_factory.h", "#include \"target_serial.h\"");
+		write("tISR_factory.h", "#include \"target_serial.h\"");
+	};
+};
+
+/*
+ *  åæåã«ã¼ãã³ï¼ISRãå
+å«ããããï¼active
+ */
+[active]
+composite tSIOPortTarget {
+    /*
+     *  éä¾å­é¨ããã®åãå£
+     */
+	entry sSIOPort	eSIOPort;
+    /*
+     *  éä¾å­é¨ã¸ã®ã³ã¼ã«ããã¯ç¨å¼ã³å£
+     */
+	call siSIOCBR	ciSIOCBR;
+
+    attr {
+        /*
+         *  UARTå²è¾¼ã¿çªå·
+         */
+        [omit] INTNO interruptNumber = C_EXP("INTNO_UART1");
+    };
+
+	/*
+     *  ç°¡æSIOãã©ã¤ãã®åæåå¦çã«ã¼ãã³(ATT_INI)
+	 */
+	cell tInitializeRoutine InitializeSIO {
+		cInitializeRoutineBody = SIOPortTargetMain.eInitialize;
+	};
+	/*
+     *  ç°¡æSIOãã©ã¤ãã®çµäºå¦çã«ã¼ãã³(ATT_TER)
+	 */
+	cell tTerminateRoutine TerminateSIO {
+		cTerminateRoutineBody = SIOPortTargetMain.eTerminate;
+	};
+    /*
+     *  å²è¾¼ã¿è¦æ±ã©ã¤ã³(CFG_INT)
+     */
+	cell tInterruptRequest SIOIRQ {
+		interruptNumber   =  composite.interruptNumber;
+		interruptPriority =  -2;
+		attribute         =  C_EXP("TA_ENAINT");
+	};
+    /*
+     *  å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³(CRE_ISR)
+     */
+	cell tISR SIOISR {
+        ciISRBody = SIOPortTargetMain.eiISRBody;
+		interruptNumber   =  composite.interruptNumber;
+		isrPriority          =  1;
+	};
+    /*
+     *  ã·ãªã¢ã«ãã©ã¤ãæ¬ä½ã»ã«
+     */
+	cell tSIOPortTargetMain SIOPortTargetMain {
+		ciSIOCBR => composite.ciSIOCBR;
+        cInterruptRequest = SIOIRQ.eInterruptRequest;
+	};
+
+	composite.eSIOPort => SIOPortTargetMain.eSIOPort;
+};
+
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/tSIOPortTargetMain.c
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/tSIOPortTargetMain.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/tSIOPortTargetMain.c	(revision 302)
@@ -0,0 +1,418 @@
+/*
+ *  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-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: target_serial.c 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/* #[<PREAMBLE>]#
+ * #[<...>]# ãã #[</...>]# ã§å²ã¾ããã³ã¡ã³ãã¯ç·¨éããªãã§ãã ãã
+ * tecsmerge ã«ãããã¼ã¸ã«ä½¿ç¨ããã¾ã
+ *
+ * å±æ§ã¢ã¯ã»ã¹ãã¯ã­ #_CAAM_#
+ * opnflg           bool_t           VAR_opnflg      
+ *
+ * å¼ã³å£é¢æ° #_TCPF_#
+ * call port: ciSIOCBR signature: siSIOCBR context:task
+ *   void           ciSIOCBR_readySend( );
+ *   void           ciSIOCBR_readyReceive( );
+ * call port: cInterruptRequest signature: sInterruptRequest context:task
+ *   ER             cInterruptRequest_disable( );
+ *   ER             cInterruptRequest_enable( );
+ *
+ * #[</PREAMBLE>]# */
+
+/* ãã­ãã¿ã¤ãå®£è¨ãå¤æ°ã®å®ç¾©ãããã«æ¸ãã¾ã #_PAC_# */
+#include "tSIOPortTargetMain_tecsgen.h"
+#include <t_syslog.h>
+#include "tz1000.h"
+
+#ifndef E_OK
+#define	E_OK	0		/* success */
+#define	E_ID	(-18)	/* illegal ID */
+#endif
+
+/* åãå£é¢æ° #_TEPF_# */
+/* #[<ENTRY_PORT>]# eSIOPort
+ * entry port: eSIOPort
+ * signature:  sSIOPort
+ * context:    task
+ * #[</ENTRY_PORT>]# */
+
+/* #[<ENTRY_FUNC>]# eSIOPort_open
+ * name:         eSIOPort_open
+ * global_name:  tSIOPortTargetMain_eSIOPort_open
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
+ */
+/* SIOPCB *sio_opn_por(ID siopid, intptr_t exinf) */
+void
+eSIOPort_open(CELLIDX idx)
+{
+	CELLCB	*p_cellcb;
+	bool_t  opnflg;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+	/*
+	 *  ãªã¼ãã³ãããã¼ããããããopnflgã«èª­ãã§ããï¼
+	 */
+	opnflg = VAR_opnflg;
+
+    if (!opnflg) {
+        /*
+         *  UART1ãã¼ãã¦ã§ã¢ã®åæåã¯target_initialize
+         *  ã§ä¸é¨å®æ½æ¸ã¿
+         *  å²è¾¼ã¿è¦å ãã¹ã¯(UARTIMSC)ã¯å
+¨ç¦æ­¢ç¶æ
+
+         */
+        /*
+         * UART1_UARTIFLSã®è¨­å®
+         *   åä¿¡å²è¾¼ã¿é »åº¦ï¼åä¿¡FIFOã®x%ä»¥ä¸ãFULLç¶æ
+ã§å²è¾¼ã¿ãèµ·ãã
+         *     ç¾ç¶1/8ã«è¨­å®
+         *   éä¿¡å²è¾¼ã¿é »åº¦ï¼éä¿¡FIFOã®x%ä»¥ä¸ãEMPTYç¶æ
+ã§å²è¾¼ã¿ãèµ·ãã
+         *     ç¾ç¶7/8ã«è¨­å®
+         */
+        sil_wrw_mem(UARTIFLS(UART1_BASE), (UARTIFLS_RX_1 | UARTIFLS_TX_14));
+        /* 
+         * å²è¾¼ã¿è¦æ±ã®ã¯ãªã¢
+         * UART1_UARTICR ã®å
+¨è¦å ãã¯ãªã¢
+         */
+        sil_wrw_mem(UARTICR(UART1_BASE), (UARTICR_TXIC | UARTICR_RXIC));
+        while ((sil_rew_mem(UARTFR(UART1_BASE)) & UARTFR_TXFF) == UARTFR_TXFF);
+        sil_wrw_mem(UARTDR(UART1_BASE), (uint32_t)('\0'));
+
+        VAR_opnflg = true;
+    }
+}
+
+/* #[<ENTRY_FUNC>]# eSIOPort_close
+ * name:         eSIOPort_close
+ * global_name:  tSIOPortTargetMain_eSIOPort_close
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ã¯ã­ã¼ãº
+ */
+/* void sio_cls_por(SIOPCB *p_siopcb) */
+void
+eSIOPort_close(CELLIDX idx)
+{
+	CELLCB	*p_cellcb;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+	if (!VAR_opnflg) {
+		cInterruptRequest_disable();
+	}
+
+}
+
+/* #[<ENTRY_FUNC>]# eSIOPort_putChar
+ * name:         eSIOPort_putChar
+ * global_name:  tSIOPortTargetMain_eSIOPort_putChar
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã¸ã®æå­éä¿¡
+ */
+/* bool_t sio_snd_chr(SIOPCB *p_siopcb, char c) */
+bool_t
+eSIOPort_putChar(CELLIDX idx, char c)
+{
+	CELLCB	*p_cellcb;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+	if ((sil_rew_mem(UARTFR(UART1_BASE)) & UARTFR_TXFF) != UARTFR_TXFF) {
+		/*
+         *  éä¿¡FIFOãFullã§ãªããªãã°
+		 *  DRã«æ¸ãè¾¼ã
+		 */
+        sil_wrw_mem(UARTDR(UART1_BASE), (uint32_t)((uint8_t)(c)));
+		return(true);
+	}
+    else {
+        return(false);
+    }
+}
+
+/* #[<ENTRY_FUNC>]# eSIOPort_getChar
+ * name:         eSIOPort_getChar
+ * global_name:  tSIOPortTargetMain_eSIOPort_getChar
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®æå­åä¿¡
+ */
+/* int_t sio_rcv_chr(SIOPCB *p_siopcb) */
+int_t
+eSIOPort_getChar(CELLIDX idx)
+{
+	CELLCB	*p_cellcb;
+    int_t c = -1;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+	if ((sil_rew_mem(UARTFR(UART1_BASE)) & UARTFR_RXFE) != UARTFR_RXFE) {
+		/*
+         *  åä¿¡FIFOãç©ºã§ãªããªãã°
+		 *  DRãèª­ã
+		 */
+        c = (int_t)(sil_rew_mem(UARTDR(UART1_BASE)) & 0xFF);
+	}
+	return(c);
+
+}
+
+/* #[<ENTRY_FUNC>]# eSIOPort_enableCBR
+ * name:         eSIOPort_enableCBR
+ * global_name:  tSIOPortTargetMain_eSIOPort_enableCBR
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®è¨±å¯
+ */
+/* void sio_ena_cbr(SIOPCB *p_siopcb, uint_t cbrtn) */
+void
+eSIOPort_enableCBR(CELLIDX idx, uint_t cbrtn)
+{
+	CELLCB	*p_cellcb;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+    switch (cbrtn) {
+        case SIOReceiveReady:
+            /* åä¿¡å²è¾¼ã¿ã®è¨±å¯ */
+            sil_orw(UARTIMSC(UART1_BASE), UARTIMSC_RXIM);
+            break;
+        case SIOSendReady:
+            /* éä¿¡å²è¾¼ã¿ã®è¨±å¯ */
+            sil_orw(UARTIMSC(UART1_BASE), UARTIMSC_TXIM);
+            break;
+    }
+}
+
+/* #[<ENTRY_FUNC>]# eSIOPort_disableCBR
+ * name:         eSIOPort_disableCBR
+ * global_name:  tSIOPortTargetMain_eSIOPort_disableCBR
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®ç¦æ­¢
+ */
+/* void sio_dis_cbr(SIOPCB *p_siopcb, uint_t cbrtn) */
+void
+eSIOPort_disableCBR(CELLIDX idx, uint_t cbrtn)
+{
+	CELLCB	*p_cellcb;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+    switch (cbrtn) {
+        case SIOReceiveReady:
+            /* åä¿¡å²è¾¼ã¿ã®ç¦æ­¢ */
+            sil_andw(UARTIMSC(UART1_BASE), ~UARTIMSC_RXIM);
+            break;
+        case SIOSendReady:
+            /* éä¿¡å²è¾¼ã¿ã®ç¦æ­¢ */
+            sil_andw(UARTIMSC(UART1_BASE), ~UARTIMSC_TXIM);
+            break;
+    }
+}
+
+/* #[<ENTRY_PORT>]# eInitialize
+ * entry port: eInitialize
+ * signature:  sRoutineBody
+ * context:    task
+ * #[</ENTRY_PORT>]# */
+
+/* #[<ENTRY_FUNC>]# eInitialize_main
+ * name:         eInitialize_main
+ * global_name:  tSIOPortTargetMain_eInitialize_main
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+/*
+ *  SIOãã©ã¤ãã®åæå
+ */
+/* void sio_initialize(intptr_t exinf) */
+void
+eInitialize_main(CELLIDX idx)
+{
+	CELLCB	*p_cellcb;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+    VAR_opnflg = false;
+
+}
+
+/* #[<ENTRY_PORT>]# eTerminate
+ * entry port: eTerminate
+ * signature:  sRoutineBody
+ * context:    task
+ * #[</ENTRY_PORT>]# */
+
+/* #[<ENTRY_FUNC>]# eTerminate_main
+ * name:         eTerminate_main
+ * global_name:  tSIOPortTargetMain_eTerminate_main
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+void
+eTerminate_main(CELLIDX idx)
+{
+	CELLCB	*p_cellcb;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+}
+
+/* #[<ENTRY_PORT>]# eiISRBody
+ * entry port: eiISRBody
+ * signature:  siHandlerBody
+ * context:    non-task
+ * #[</ENTRY_PORT>]# */
+
+/* #[<ENTRY_FUNC>]# eiISRBody_main
+ * name:         eiISRBody_main
+ * global_name:  tSIOPortTargetMain_eiISRBody_main
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+/*
+ *  SIOã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+ */
+/* void sio_isr(intptr_t exinf) */
+void
+eiISRBody_main(CELLIDX idx)
+{
+	CELLCB	*p_cellcb;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+    /* 
+     * å²è¾¼ã¿è¦æ±ã®ã¯ãªã¢
+     * UART1_UARTICR ã®å
+¨è¦å ãã¯ãªã¢
+     */
+    sil_wrw_mem(UARTICR(UART1_BASE), (UARTICR_TXIC | UARTICR_RXIC));
+
+	if ((sil_rew_mem(UARTFR(UART1_BASE)) & UARTFR_RXFE) != UARTFR_RXFE) {
+		/*
+         *  åä¿¡FIFOãç©ºã§ãªããªãã°
+		 *  åä¿¡éç¥ã³ã¼ã«ããã¯ã«ã¼ãã³ãå¼ã³åºãï¼
+		 */
+		ciSIOCBR_readyReceive();
+	}
+	if ((sil_rew_mem(UARTFR(UART1_BASE)) & UARTFR_TXFF) != UARTFR_TXFF) {
+		/*
+         *  éä¿¡FIFOãFullã§ãªããªãã°
+		 *  éä¿¡å¯è½ã³ã¼ã«ããã¯ã«ã¼ãã³ãå¼ã³åºãï¼
+		 */
+		ciSIOCBR_readySend();
+	}
+}
+
+/* #[<POSTAMBLE>]#
+ *   ããããä¸ã«éåãå£é¢æ°ãæ¸ãã¾ã
+ * #[</POSTAMBLE>]#*/
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target.cdl
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target.cdl	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target.cdl	(revision 302)
@@ -0,0 +1,92 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2015 by Ushio Laboratory
+ *              Graduate School of Engineering Science, Osaka Univ., 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: target.cdl 509 2016-01-12 06:06:14Z ertl-hiro $
+ */
+
+/*
+ *  ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãºã®ããã©ã«ã
+ */
+const size_t DefaultTaskStackSize = 4096;		/* ã¹ã¿ãã¯ãµã¤ãºï¼4KBï¼*/
+
+/*
+ *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãºã®å®ç¾©
+ */
+const size_t LogTaskStackSize = DefaultTaskStackSize;
+
+/*
+ *  ã«ã¼ãã«èµ·åã¡ãã»ã¼ã¸ã«é¢ããå®ç¾©
+ */
+const char *const BannerTargetName = "BlueNinja(TZ1000:ARM Cortex-M4)";	/* ã¿ã¼ã²ããå */
+const char *const BannerCopyrightNotice = "";			/* èä½æ¨©è¡¨ç¤º */
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®ã»ã«ã¿ã¤ãã®å®ç¾©
+ */
+import("tPutLogTarget.cdl");
+import("tSIOPortTarget.cdl");
+
+/*
+ *  ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ã¿ã¼ã²ããä¾å­é¨ã®çµã¿ä¸ãè¨è¿°
+ */
+cell tSIOPortTarget SIOPortTarget1 {
+};
+
+/*
+ *  ä½ã¬ãã«åºåã®çµã¿ä¸ãè¨è¿°
+ */
+cell tPutLogTarget PutLogTarget {
+	/* SIOãã©ã¤ãã¨ã®çµå */
+	cSIOPort = SIOPortTarget1.eSIOPort;
+};
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target.tf
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target.tf	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target.tf	(revision 302)
@@ -0,0 +1,67 @@
+$ ======================================================================
+$ 
+$   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: target.tf 301 2015-01-07 04:57:01Z ertl-ishikawa $
+$
+$ =====================================================================
+
+$ 
+$     ãã¹2ã®ã¿ã¼ã²ããä¾å­ãã³ãã¬ã¼ãï¼LM3SXXXXç¨ï¼
+$ 
+
+$ 
+$  ã³ã¢ä¾å­ãã³ãã¬ã¼ãã®ã¤ã³ã¯ã«ã¼ã
+$ 
+$INCLUDE"arm_m_gcc/common/core.tf"$
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_asm.inc
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_asm.inc	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_asm.inc	(revision 302)
@@ -0,0 +1,1 @@
+#include "arm_m_gcc/common/core_asm.inc"
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_cfg1_out.h
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_cfg1_out.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_cfg1_out.h	(revision 302)
@@ -0,0 +1,68 @@
+/*
+ *  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: target_cfg1_out.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *		cfg1_out.cããªã³ã¯ããããã«å¿
+è¦ãªã¹ã¿ãã®å®ç¾©
+ */
+
+STK_T *const	_kernel_istkpt = 0x00;
+
+/*
+ *  ã³ã¢ä¾å­ã®ã¹ã¿ãã®å®ç¾© 
+ */
+#include <core_cfg1_out.h>
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_check.tf
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_check.tf	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_check.tf	(revision 302)
@@ -0,0 +1,13 @@
+$ 
+$     ãã¹3ã®ã¿ã¼ã²ããä¾å­ãã³ãã¬ã¼ãï¼LM3SXXXXç¨ï¼
+$ 
+
+$eboot = SYMBOL("_eboot")$
+$text = SYMBOL("__text")$
+$etext = SYMBOL("_etext")$
+$BCOPY(eboot, text, etext - text)$
+
+$ 
+$  ãã¹3ã®ã³ã¢ä¾å­ã®ãã³ãã¬ã¼ãã®ã¤ã³ã¯ã«ã¼ã
+$ 
+$INCLUDE"arm_m_gcc/common/core_check.tf"$
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_def.csv
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_def.csv	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_def.csv	(revision 302)
@@ -0,0 +1,1 @@
+TOPPERS_RAM_DEBUG,#defined(TOPPERS_RAM_DEBUG)
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_kernel.h
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_kernel.h	(revision 302)
@@ -0,0 +1,120 @@
+/*
+ *  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: target_kernel.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *  kernel.hã®ãããä¾å­é¨ï¼LM3Sxxxxç¨ï¼
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼kernel.hã§ã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡
+ *  ã¤ã«ããç´æ¥ã¤ã³ã¯ã«ã¼ããããã¨ã¯ãªãï¼ãã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ã
+ *  ããåã«ï¼t_stddef.hãã¤ã³ã¯ã«ã¼ããããã®ã§ï¼ãããã«ä¾å­ãã¦ãã
+ *  ãï¼
+ */
+
+#ifndef TOPPERS_TARGET_KERNEL_H
+#define TOPPERS_TARGET_KERNEL_H
+
+/*
+ *  ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿åªå
+åº¦ã®ç¯å²
+ *
+ *  TMIN_INTPRIã®å®ç¾©ãå¤æ´ãããã¨ã§ï¼ãã®ã¬ãã«ãããé«ãå²è¾¼ã¿åªå
+åº¦
+ *  ãæã¤ãã®ãã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã¨ããããå¤æ´ã§ããï¼
+ */
+#define TMIN_INTPRI		(-6)		/* å²è¾¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+
+/*
+ *  ãµãã¼ãããæ©è½ã®å®ç¾©
+ */
+/*
+ * =begin not implemented...
+ * TODO: ãªã¼ãã©ã³ã¿ã¤ãã¯ç¾ç¶æªãµãã¼ã
+ */
+#if 0
+#define TOPPERS_TARGET_SUPPORT_OVRHDR		/* ãªã¼ãã©ã³ãã³ãã© */
+#endif
+/*
+ * =end not implemented...
+ */
+
+/*
+ *  ã¿ã¤ã ãã£ãã¯ã®å®ç¾©
+ */
+#define TIC_NUME   1U            /* ã¿ã¤ã ãã£ãã¯ã®å¨æã®åå­ */
+#define TIC_DENO   1U            /* ã¿ã¤ã ãã£ãã¯ã®å¨æã®åæ¯ */
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æ
+ *
+ *  ã¿ã¤ãå¨æã2^32ã®å ´åã«ã¯ï¼ãã®ãã¯ã­ãå®ç¾©ããªãï¼
+ */
+#define TCYC_HRTCNT 178956970U 
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã®é²ã¿å¹
+
+ */
+#define TSTEP_HRTCNT	1U
+
+/*
+ *  ã³ã¢ä¾å­ã§å
+±éãªå®ç¾©
+ */
+#include "arm_m_gcc/common/core_kernel.h"
+
+#endif /* TOPPERS_TARGET_KERNEL_H */
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_kernel_impl.c
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_kernel_impl.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_kernel_impl.c	(revision 302)
@@ -0,0 +1,218 @@
+/*
+ *  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: target_kernel_impl.c 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ * ã¿ã¼ã²ããä¾å­ã¢ã¸ã¥ã¼ã«ï¼BlueNinjaç¨ï¼
+ */
+#include "kernel_impl.h"
+#include <sil.h>
+#include "tz1000.h"
+
+/*
+ *  æ±èè£½ãã©ã¤ããä½¿ç¨ããããã®I/F
+ */
+uint32_t SystemCoreClock = 12000000;
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®åæå
+ */
+void
+target_initialize(void){
+
+    volatile uint32_t i;
+
+	/*
+	 * ã³ã¢ä¾å­ã®åæå
+	 */
+	core_initialize();
+
+    sil_orw((void *)CPACR_BASE, ((3UL << 10*2) | (3UL << 11*2)));
+
+    /*
+     *  wait 2sec
+     */
+    for (i = 0; i < 2000U; i++) {
+        sil_dly_nse(1000000);
+    }
+
+    /* PMU Initialize */
+    Driver_PMU.Initialize(NULL);
+    Driver_PMU.SelectClockSource(PMU_CSM_MAIN, PMU_CLOCK_SOURCE_PLL);
+    Driver_PMU.SetPrescaler(PMU_CD_MPIER, 1);
+    Driver_PMU.SetPrescaler(PMU_CD_PPIER0, 2);
+    Driver_PMU.SetPrescaler(PMU_CD_PPIER1, 4);
+    Driver_PMU.SetPrescaler(PMU_CD_PPIER2, 4);
+    /*
+     * GPIO
+     *  GPIO1 ---> PW switch
+     *  GPIO2 ---> reset
+     *  GPIO3 ---> Hold
+     *  GPIO4 ---> battery
+     *  GPIO10 ---> LED RED
+     *  GPIO11 ---> LED GREEN
+     *
+     */
+    /* PW switch */
+    Driver_PMU.StandbyInputBuffer(PMU_IO_FUNC_GPIO_1, 0);
+    Driver_PMU.StandbyInputBuffer(PMU_IO_FUNC_GPIO_4, 0);
+
+    /* GPIO Initialize */
+    Driver_GPIO.Initialize();
+    Driver_GPIO.PowerControl(ARM_POWER_FULL);
+    /* config Input/Output */
+    Driver_GPIO.Configure(1,  GPIO_DIRECTION_INPUT_HI_Z, GPIO_EVENT_DISABLE, NULL);
+    Driver_GPIO.Configure(3, GPIO_DIRECTION_OUTPUT_2MA, GPIO_EVENT_DISABLE, NULL);
+    Driver_GPIO.Configure(4, GPIO_DIRECTION_INPUT_HI_Z, GPIO_EVENT_DISABLE, NULL);
+    Driver_GPIO.Configure(11, GPIO_DIRECTION_OUTPUT_2MA, GPIO_EVENT_DISABLE, NULL);
+
+    /* GPIO3 High Hold / LED(G) turn on */
+    Driver_GPIO.WritePin(3, 1);
+    Driver_GPIO.WritePin(11, 1);
+
+    /* 
+     * UART Initialize
+     * banner.c(target_fput_log)ã®ããã«ããã§åæåãã
+     */
+    Driver_PMU.SelectClockSource(PMU_CSM_UART1, PMU_CLOCK_SOURCE_OSC12M);
+    Driver_PMU.SetPrescaler(PMU_CD_UART1, 1);
+    Driver_UART1.Initialize(0, 0);
+    Driver_UART1.Configure(115200, 8, ARM_UART_PARITY_NONE, 
+            ARM_UART_STOP_BITS_1, ARM_UART_FLOW_CONTROL_NONE);
+    Driver_UART1.PowerControl(ARM_POWER_FULL);
+} 
+
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®çµäºå¦ç
+ */
+void
+target_exit(void)
+{
+    /* GPIO3 Low Hold / LED(G) turn off */
+    Driver_GPIO.WritePin(11, 0);
+    Driver_GPIO.WritePin(3, 0);
+
+	/*
+	 *  ã³ã¢ä¾å­ã®çµäºå¦ç
+	 */
+	core_terminate();
+
+	/*
+	 *  éçºç°å¢ä¾å­ã®çµäºå¦ç
+	 */
+	while(1);
+}
+
+
+/*
+ *  ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®ããã®æå­åºå
+ */
+void
+target_fput_log(char c)
+{
+	if (c == '\n') {
+        while ((sil_rew_mem(UARTFR(UART1_BASE)) & UARTFR_TXFF) == UARTFR_TXFF);
+        sil_wrw_mem(UARTDR(UART1_BASE), (uint32_t)('\r'));
+	}
+    while ((sil_rew_mem(UARTFR(UART1_BASE)) & UARTFR_TXFF) == UARTFR_TXFF);
+    sil_wrw_mem(UARTDR(UART1_BASE), (uint32_t)((uint8_t)(c)));
+}
+
+void
+check_power_handler(intptr_t exinf)
+{
+    static uint8_t check_count = 0U;
+    static bool_t led_out = true;
+    uint32_t check_power_switch;
+    uint32_t check_battery;
+
+    /*
+     * PW switch ã®æ¼ä¸ç¶æ³ãã§ãã¯
+     * ããããªç¶æ³ãã§ãã¯
+     */
+    Driver_GPIO.ReadPin(1, &check_power_switch);
+    Driver_GPIO.ReadPin(4, &check_battery);
+
+    if (!(check_power_switch & 0x1U)) {
+        check_count++;
+    }
+    else if (!(check_battery & 0x1U)) {
+        check_count++;
+    }
+    else {
+        check_count = 0U;
+    }
+
+    if (check_count >= 5U) {
+        /*
+         * é»æºOFFå¤å®5ç§ä»¥ä¸
+         */
+        ext_ker();
+    }
+    /*
+     *  LED(G)åè»¢å¦ç 
+     */
+    else if (led_out) {
+        Driver_GPIO.WritePin(11, 0);
+        led_out = false;
+    }
+    else {
+        Driver_GPIO.WritePin(11, 1);
+        led_out = true;
+    }
+}
+
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_kernel_impl.h
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_kernel_impl.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_kernel_impl.h	(revision 302)
@@ -0,0 +1,120 @@
+/*
+ *  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: target_kernel_impl.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *  ãããä¾å­ã¢ã¸ã¥ã¼ã«ï¼BlueNinjaç¨ï¼
+ *
+ *  ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ï¼kernel_impl.hã®ã¿ã¼
+ *  ã²ããä¾å­é¨ã®ä½ç½®ä»ãã¨ãªãï¼
+ */
+
+#ifndef TOPPERS_TARGET_KERNEL_IMPL_H
+#define TOPPERS_TARGET_KERNEL_IMPL_H
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨ã®ãã¼ãã¦ã§ã¢è³æºã®å®ç¾©
+ */
+#include "tz1000.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã«é¢ããè¨­å®
+ */
+#ifdef TOPPERS_ENABLE_TRACE
+#include "logtrace/trace_config.h"
+#endif /* TOPPERS_ENABLE_TRACE */
+
+/*
+ *  RAMå®è¡ããå ´åãQEMUå®è¡æROMãããã°æã¯MSPãåæåãã
+ *  å¿
+è¦ããããã,ã¹ã¿ã¼ãã¢ããã«ã¼ãã³ã§MSPãåæåããï¼ 
+ */
+#define INIT_MSP
+
+/*
+ *  ããã©ã«ãã®éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã®å®ç¾©
+ */
+#define DEFAULT_ISTKSZ      (0x1000U)   /* 4KByte */
+
+/*
+ *  å¾®å°æéå¾
+ã¡ã®ããã®å®ç¾©ï¼æ¬æ¥ã¯SILã®ã¿ã¼ã²ããä¾å­é¨ï¼
+ */
+#define SIL_DLY_TIM1    340
+#define SIL_DLY_TIM2    340
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã¿ã¼ã²ããã·ã¹ãã ä¾å­ã®åæå
+ */
+extern void	target_initialize(void);
+
+/*
+ *  ã¿ã¼ã²ããã·ã¹ãã ã®çµäº
+ *
+ *  ã·ã¹ãã ãçµäºããæã«ä½¿ãï¼
+ */
+extern void	target_exit(void) NoReturn;
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ã³ã¢ä¾å­ã¢ã¸ã¥ã¼ã«ï¼ARM-Mç¨ï¼
+ */
+#include "core_kernel_impl.h"
+
+#endif /* TOPPERS_TARGET_KERNEL_IMPL_H */
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_offset.tf
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_offset.tf	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_offset.tf	(revision 302)
@@ -0,0 +1,73 @@
+$ ======================================================================
+$ 
+$   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: target_offset.tf 301 2015-01-07 04:57:01Z ertl-ishikawa $
+$  
+$ =====================================================================
+
+$
+$       ãªãã»ãããã¡ã¤ã«çæç¨ãã³ãã¬ã¼ããã¡ã¤ã«ï¼LM3SXXXXç¨ï¼
+$
+
+$
+$  æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
+$
+$INCLUDE "kernel/genoffset.tf"$
+
+$ 
+$  ã³ã¢ä¾å­ãã³ãã¬ã¼ãã®ã¤ã³ã¯ã«ã¼ãï¼ARM-Mç¨ï¼
+$ 
+$INCLUDE"../../arch/arm_m_gcc/common/core_offset.tf"$
+
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_rename.def
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_rename.def	(revision 302)
@@ -0,0 +1,13 @@
+INCLUDE "arm_m_gcc/common/core"
+
+#target_kernel_impl.c
+target_initialize
+target_exit
+
+#target_timer.c
+target_hrt_initialize
+target_hrt_terminate
+target_hrt_handler
+target_hrt_get_current
+target_hrt_set_event
+target_hrt_raise_event
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_rename.h
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_rename.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_rename.h	(revision 302)
@@ -0,0 +1,46 @@
+/* This file is generated from target_rename.def by genrename. */
+
+#ifndef TOPPERS_TARGET_RENAME_H
+#define TOPPERS_TARGET_RENAME_H
+
+
+/*
+ * target_kernel_impl.c
+ */
+#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_handler			_kernel_target_hrt_handler
+#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
+
+#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_hrt_initialize		__kernel_target_hrt_initialize
+#define _target_hrt_terminate		__kernel_target_hrt_terminate
+#define _target_hrt_handler			__kernel_target_hrt_handler
+#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
+
+#endif /* TOPPERS_LABEL_ASM */
+
+#include "arm_m_gcc/common/core_rename.h"
+
+#endif /* TOPPERS_TARGET_RENAME_H */
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_serial.c
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_serial.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_serial.c	(revision 302)
@@ -0,0 +1,294 @@
+/*
+ *  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: target_serial.c 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *  ã·ãªã¢ã«I/Oããã¤ã¹ï¼SIOï¼ãã©ã¤ãï¼BlueNinjaç¨ï¼
+ */
+
+#include "kernel/kernel_impl.h"
+#include <t_syslog.h>
+#include "target_serial.h"
+#include "tz1000.h"
+
+/*
+ * TODO:
+ *  ç¾ç¶ã§ã¯UART1ã®ã¿ããµãã¼ããã¦ããï¼
+ *  ä»å¾ï¼Bluetoothã®å©ç¨ãªã©ã«ãã
+ *  ãµãã¼ãããã·ãªã¢ã«ãã¼ããå¢ãã
+ *  å ´åã®æ¡å¼µã®ããã«SIOPINIBãæ®ãã¦ãã
+ */
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãåæåãã­ãã¯ã®å®ç¾©
+ */
+typedef struct sio_port_initialization_block {
+	INTNO    intno;
+} SIOPINIB;
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®å®ç¾©
+ */
+struct sio_port_control_block {
+	const SIOPINIB  *p_siopinib;  /* ã·ãªã¢ã«I/Oãã¼ãåæåãã­ãã¯ */
+	intptr_t        exinf;        /* æ¡å¼µæ
+å ± */
+	bool_t          opnflg;       /* ãªã¼ãã³æ¸ã¿ãã©ã° */
+};
+
+/*
+ * ã·ãªã¢ã«I/Oãã¼ãåæåãã­ãã¯
+ */
+const SIOPINIB siopinib_table[TNUM_SIOP] = {
+	{(INTNO)INTNO_SIO}
+};
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®ã¨ãªã¢
+ */
+SIOPCB	siopcb_table[TNUM_SIOP];
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãIDããç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_SIOP(siopid)	((uint_t)((siopid) - 1))
+#define get_siopcb(siopid)	(&(siopcb_table[INDEX_SIOP(siopid)]))
+
+/*
+ *  SIOãã©ã¤ãã®åæå
+ */
+void
+sio_initialize(intptr_t exinf)
+{
+	SIOPCB	*p_siopcb;
+	uint_t	i;
+
+	/*
+	 *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®åæå
+	 */
+	for (p_siopcb = siopcb_table, i = 0; i < TNUM_SIOP; p_siopcb++, i++) {
+		p_siopcb->p_siopinib = &(siopinib_table[i]);
+		p_siopcb->opnflg = false;
+	}
+}
+
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
+ */
+SIOPCB *
+sio_opn_por(ID siopid, intptr_t exinf)
+{
+	SIOPCB          *p_siopcb;
+	bool_t  opnflg;
+
+	p_siopcb = get_siopcb(siopid);
+
+	/*
+	 *  ãªã¼ãã³ãããã¼ããããããopnflgã«èª­ãã§ããï¼
+	 */
+	opnflg = p_siopcb->opnflg;
+
+    if (!opnflg) {
+        p_siopcb->exinf = exinf;
+
+        /*
+         *  UART1ãã¼ãã¦ã§ã¢ã®åæåã¯target_initialize
+         *  ã§ä¸é¨å®æ½æ¸ã¿
+         *  å²è¾¼ã¿è¦å ãã¹ã¯(UARTIMSC)ã¯å
+¨ç¦æ­¢ç¶æ
+
+         */
+        /*
+         * UART1_UARTIFLSã®è¨­å®
+         *   åä¿¡å²è¾¼ã¿é »åº¦ï¼åä¿¡FIFOã®x%ä»¥ä¸ãFULLç¶æ
+ã§å²è¾¼ã¿ãèµ·ãã
+         *     ç¾ç¶1/8ã«è¨­å®
+         *   éä¿¡å²è¾¼ã¿é »åº¦ï¼éä¿¡FIFOã®x%ä»¥ä¸ãEMPTYç¶æ
+ã§å²è¾¼ã¿ãèµ·ãã
+         *     ç¾ç¶7/8ã«è¨­å®
+         */
+        sil_wrw_mem(UARTIFLS(UART1_BASE), (UARTIFLS_RX_1 | UARTIFLS_TX_14));
+        /* 
+         * å²è¾¼ã¿è¦æ±ã®ã¯ãªã¢
+         * UART1_UARTICR ã®å
+¨è¦å ãã¯ãªã¢
+         */
+        sil_wrw_mem(UARTICR(UART1_BASE), (UARTICR_TXIC | UARTICR_RXIC));
+
+        p_siopcb->opnflg = true;
+    }
+
+	return(p_siopcb);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ã¯ã­ã¼ãº
+ */
+void
+sio_cls_por(SIOPCB *p_siopcb)
+{
+	/*
+	 *  ã·ãªã¢ã«I/Oå²è¾¼ã¿ããã¹ã¯ããï¼
+	 */
+	if (!(p_siopcb->opnflg)) {
+		dis_int(p_siopcb->p_siopinib->intno);
+	}
+}
+
+/*
+ *  SIOã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+ */
+void
+sio_isr(intptr_t exinf)
+{
+	SIOPCB          *p_siopcb;
+
+	p_siopcb = get_siopcb(exinf);
+
+    /* 
+     * å²è¾¼ã¿è¦æ±ã®ã¯ãªã¢
+     * UART1_UARTICR ã®å
+¨è¦å ãã¯ãªã¢
+     */
+    sil_wrw_mem(UARTICR(UART1_BASE), (UARTICR_TXIC | UARTICR_RXIC));
+
+	if ((sil_rew_mem(UARTFR(UART1_BASE)) & UARTFR_RXFE) != UARTFR_RXFE) {
+		/*
+         *  åä¿¡FIFOãç©ºã§ãªããªãã°
+		 *  åä¿¡éç¥ã³ã¼ã«ããã¯ã«ã¼ãã³ãå¼ã³åºãï¼
+		 */
+		sio_irdy_rcv(p_siopcb->exinf);
+	}
+	if ((sil_rew_mem(UARTFR(UART1_BASE)) & UARTFR_TXFF) != UARTFR_TXFF) {
+		/*
+         *  éä¿¡FIFOãFullã§ãªããªãã°
+		 *  éä¿¡å¯è½ã³ã¼ã«ããã¯ã«ã¼ãã³ãå¼ã³åºãï¼
+		 */
+		sio_irdy_snd(p_siopcb->exinf);
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã¸ã®æå­éä¿¡
+ */
+bool_t
+sio_snd_chr(SIOPCB *p_siopcb, char c)
+{
+	if ((sil_rew_mem(UARTFR(UART1_BASE)) & UARTFR_TXFF) != UARTFR_TXFF) {
+		/*
+         *  éä¿¡FIFOãFullã§ãªããªãã°
+		 *  DRã«æ¸ãè¾¼ã
+		 */
+        sil_wrw_mem(UARTDR(UART1_BASE), (uint32_t)((uint8_t)(c)));
+		return(true);
+	}
+    else {
+        return(false);
+    }
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®æå­åä¿¡
+ */
+int_t
+sio_rcv_chr(SIOPCB *p_siopcb)
+{
+    int_t c = -1;
+	if ((sil_rew_mem(UARTFR(UART1_BASE)) & UARTFR_RXFE) != UARTFR_RXFE) {
+		/*
+         *  åä¿¡FIFOãç©ºã§ãªããªãã°
+		 *  DRãèª­ã
+		 */
+        c = (int_t)(sil_rew_mem(UARTDR(UART1_BASE)) & 0xFF);
+	}
+	return(c);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®è¨±å¯
+ */
+void
+sio_ena_cbr(SIOPCB *p_siopcb, uint_t cbrtn)
+{
+    switch (cbrtn) {
+        case SIO_RDY_RCV:
+            /* åä¿¡å²è¾¼ã¿ã®è¨±å¯ */
+            sil_orw(UARTIMSC(UART1_BASE), UARTIMSC_RXIM);
+            break;
+        case SIO_RDY_SND:
+            /* éä¿¡å²è¾¼ã¿ã®è¨±å¯ */
+            sil_orw(UARTIMSC(UART1_BASE), UARTIMSC_TXIM);
+            break;
+    }
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®ç¦æ­¢
+ */
+void
+sio_dis_cbr(SIOPCB *p_siopcb, uint_t cbrtn)
+{
+    switch (cbrtn) {
+        case SIO_RDY_RCV:
+            /* åä¿¡å²è¾¼ã¿ã®ç¦æ­¢ */
+            sil_andw(UARTIMSC(UART1_BASE), ~UARTIMSC_RXIM);
+            break;
+        case SIO_RDY_SND:
+            /* éä¿¡å²è¾¼ã¿ã®ç¦æ­¢ */
+            sil_andw(UARTIMSC(UART1_BASE), ~UARTIMSC_TXIM);
+            break;
+    }
+}
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_serial.cfg
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_serial.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_serial.cfg	(revision 302)
@@ -0,0 +1,66 @@
+/*
+ *  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: target_serial.cfg 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *  SIOãã©ã¤ãï¼PL011ç¨ï¼ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+
+#include "target_serial.h"
+ATT_INI({ TA_NULL, 0, sio_initialize });
+CRE_ISR(SIO_ISR, {TA_NULL, 1, INTNO_SIO, sio_isr, 1});
+CFG_INT(INTNO_SIO, { INTATR_SIO, INTPRI_SIO });
+
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_serial.h
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_serial.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_serial.h	(revision 302)
@@ -0,0 +1,145 @@
+/*
+ *  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: target_serial.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *    ã·ãªã¢ã«I/Oããã¤ã¹ï¼SIOï¼ãã©ã¤ã
+ */
+
+#ifndef TOPPERS_TARGET_SERIAL_H
+#define TOPPERS_TARGET_SERIAL_H
+
+#include "tz1000.h"
+
+/*
+ *  SIOã®å²è¾¼ã¿ãã³ãã©ã®ãã¯ã¿çªå·
+ */
+#define INHNO_SIO        INTNO_UART1  /* å²è¾¼ã¿ãã³ãã©çªå· */
+#define INTNO_SIO        INTNO_UART1  /* å²è¾¼ã¿çªå· */
+#define INTPRI_SIO       -3        /* å²è¾¼ã¿åªå
+åº¦ */
+#define INTATR_SIO       TA_ENAINT /* å²è¾¼ã¿å±æ§ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®å®ç¾©
+ */
+typedef struct sio_port_control_block    SIOPCB;
+
+/*
+ *  ã³ã¼ã«ããã¯ã«ã¼ãã³ã®è­å¥çªå·
+ */
+#define SIO_RDY_SND    1U        /* éä¿¡å¯è½ã³ã¼ã«ããã¯ */
+#define SIO_RDY_RCV    2U        /* åä¿¡éç¥ã³ã¼ã«ããã¯ */
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãæ°ã®å®ç¾©
+ */
+#define TNUM_SIOP       1       /* ãµãã¼ãããã·ãªã¢ã«I/Oãã¼ãã®æ° */
+
+/*
+ *  SIOãã©ã¤ãã®åæå
+ */
+extern void sio_initialize(intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
+ */
+extern SIOPCB *sio_opn_por(ID siopid, intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ã¯ã­ã¼ãº
+ */
+extern void sio_cls_por(SIOPCB *p_siopcb);
+
+/*
+ *  SIOã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+ */
+extern void sio_isr(intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã¸ã®æå­éä¿¡
+ */
+extern bool_t sio_snd_chr(SIOPCB *p_siopcb, char c);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®æå­åä¿¡
+ */
+extern int_t sio_rcv_chr(SIOPCB *p_siopcb);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®è¨±å¯
+ */
+extern void sio_ena_cbr(SIOPCB *p_siopcb, uint_t cbrtn);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®ç¦æ­¢
+ */
+extern void sio_dis_cbr(SIOPCB *p_siopcb, uint_t cbrtn);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®éä¿¡å¯è½ã³ã¼ã«ããã¯
+ */
+extern void sio_irdy_snd(intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®åä¿¡éç¥ã³ã¼ã«ããã¯
+ */
+extern void sio_irdy_rcv(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_TARGET_SERIAL_H */
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_sil.h
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_sil.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_sil.h	(revision 302)
@@ -0,0 +1,96 @@
+/*
+ *  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: target_sil.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *   sil.hã®ãããä¾å­é¨ï¼BlueNinjaç¨ï¼
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼sil.hã®å
+é ­ã§ã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡
+ *  ã¤ã«ããã¯ç´æ¥ã¤ã³ã¯ã«ã¼ããããã¨ã¯ãªãï¼ãã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼
+ *  ãããåã«ï¼t_stddef.hãã¤ã³ã¯ã«ã¼ããããã®ã§ï¼ãããã«ä¾å­ãã¦ã
+ *  ããï¼
+ */
+
+#ifndef TOPPERS_TARGET_SIL_H
+#define TOPPERS_TARGET_SIL_H
+
+/*
+ *  ãã­ã»ããµã®ã¨ã³ãã£ã¢ã³
+ */
+#define SIL_ENDIAN_LITTLE
+
+#include "tz1000.h"
+
+/*
+ *  ã³ã¢ä¾å­ã§å
+±éãªå®ç¾©
+ */
+#include "core_sil.h"
+
+/*
+ *  ä¸è¬å
+±éã¬ã¸ã¹ã¿æä½é¢æ°
+ */
+#define sil_orb( mem, val )		sil_wrb_mem( mem, sil_reb_mem( mem ) | val )
+#define sil_andb( mem, val )	sil_wrb_mem( mem, sil_reb_mem( mem ) & val )
+#define sil_orh( mem, val )		sil_wrh_mem( mem, sil_reh_mem( mem ) | val )
+#define sil_andh( mem, val )	sil_wrh_mem( mem, sil_reh_mem( mem ) & val )
+#define sil_orw( mem, val )		sil_wrw_mem( mem, sil_rew_mem( mem ) | val )
+#define sil_andw( mem, val )	sil_wrw_mem( mem, sil_rew_mem( mem ) & val )
+
+
+#endif /* TOPPERS_TARGET_SIL_H */
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_stddef.h
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_stddef.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_stddef.h	(revision 302)
@@ -0,0 +1,107 @@
+/*
+ *  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: target_stddef.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *  t_stddef.hã®ã¿ã¼ã²ããä¾å­é¨ï¼LM3SXXXXç¨ï¼
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼t_stddef.hã®å
+é ­ã§ã¤ã³ã¯ã«ã¼ããããï¼
+ *  ä»ã®ãã¡ã¤ã«ããã¯ç´æ¥ã¤ã³ã¯ã«ã¼ããããã¨ã¯ãªãï¼ä»ã®ã¤ã³ã¯ã«ã¼ã
+ *  ãã¡ã¤ã«ã«å
+ç«ã£ã¦å¦çãããããï¼ä»ã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã«ä¾å­ã
+ *  ã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_TARGET_STDDEF_H
+#define TOPPERS_TARGET_STDDEF_H
+
+/*
+ *  ã¿ã¼ã²ãããè­å¥ããããã®ãã¯ã­ã®å®ç¾©
+ */
+#define TOPPERS_LM3SXXXX				/* ã·ã¹ãã ç¥ç§° */
+
+/*
+ *  éçºç°å¢ã§å
+±éãªå®ç¾©
+ *
+ *  éçºç°å¢ã§stdint.hãç¨æããã¦ããå ´åã«ã¯ï¼TOPPERS_STDINT_TYPE1ã®
+ *  ãã¯ã­å®ç¾©ãåé¤ãï¼stdint.hãã¤ã³ã¯ã«ã¼ãããã°ããï¼
+ */
+#define TOPPERS_STDINT_TYPE1
+#define TOPPERS_STDFLOAT_TYPE1
+#include "gcc/tool_stddef.h"
+
+/*
+ *  ã³ã¢ä¾å­ã§å
+±éãªå®ç¾©
+ */
+#include "arm_m_gcc/common/core_stddef.h"
+
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã¢ãµã¼ã·ã§ã³ã®å¤±ææã®å®è¡ä¸­æ­å¦çï¼T.B.Dï¼
+ */
+Inline void
+TOPPERS_assert_abort(void)
+{
+    
+}
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_TARGET_STDDEF_H */
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_syssvc.h
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_syssvc.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_syssvc.h	(revision 302)
@@ -0,0 +1,105 @@
+/*
+ *  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: target_syssvc.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *  ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­é¨ï¼BlueNinjaç¨ï¼
+ *
+ *  ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ï¼ãã®ãã¡
+ *  ã¤ã«ã®å
+å®¹ã¯ï¼ã³ã³ãã¼ãã³ãè¨è¿°ãã¡ã¤ã«ã«è¨è¿°ããï¼ãã®ãã¡ã¤ã«ã¯
+ *  ç¡ããªãè¦è¾¼ã¿ï¼
+ */
+
+#ifndef TOPPERS_TARGET_SYSSVC_H
+#define TOPPERS_TARGET_SYSSVC_H
+
+/*
+ *  ã¿ã¼ã²ããã·ã¹ãã ã®ãã¼ãã¦ã§ã¢è³æºã®å®ç¾©
+ */
+#include "tz1000.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã«é¢ããè¨­å®
+ */
+#ifdef TOPPERS_ENABLE_TRACE
+#include "logtrace/trace_config.h"
+#endif /* TOPPERS_ENABLE_TRACE */
+
+/*
+ *  èµ·åã¡ãã»ã¼ã¸ã®ã¿ã¼ã²ããã·ã¹ãã å
+ */
+#define TARGET_NAME    "BlueNinja(TZ1000:ARM Cortex-M4)"
+
+/*
+ *  ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®ããã®æå­åºå
+ *
+ *  ã¿ã¼ã²ããä¾å­ã®æ¹æ³ã§ï¼æå­cãè¡¨ç¤º/åºå/ä¿å­ããï¼
+ */
+extern void	target_fput_log(char c);
+
+/*
+ *  ãµãã¼ãããã·ãªã¢ã«ãã¼ãã®æ°
+ */
+#define TNUM_PORT        1
+
+/*
+ *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯é¢é£ã®å®æ°ã®å®ç¾©
+ *
+ *  ããã©ã«ãå¤ã®éãï¼
+ */
+
+#endif /* TOPPERS_TARGET_SYSSVC_H */
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_test.cfg
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_test.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_test.cfg	(revision 302)
@@ -0,0 +1,58 @@
+/*
+ *  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: target_kernel_impl.c 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+CRE_CYC(CYCHDR2, { TA_STA, { TNFY_HANDLER, 0, check_power_handler }, 1000000, 1000000 });
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_test.h
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_test.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_test.h	(revision 302)
@@ -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: target_test.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *		ãã¹ããã­ã°ã©ã ã®ã¿ã¼ã²ããä¾å­å®ç¾©ï¼LM3SXXXXç¨ï¼
+ */
+
+#ifndef TOPPERS_TARGET_TEST_H
+#define TOPPERS_TARGET_TEST_H
+
+#ifdef TOPPERS_QEMU_CM3
+#define TASK_LOOP 10000000
+#endif /* TOPPERS_QEMU_CM3 */
+
+extern void check_power_handler(intptr_t exinf);
+
+/*
+ *  ã³ã¢ä¾å­ã¢ã¸ã¥ã¼ã«ï¼ARM-Mç¨ï¼
+ */
+#include "arm_m_gcc/common/core_test.h"
+
+#endif /* TOPPERS_TARGET_TEST_H */
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_timer.c
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_timer.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_timer.c	(revision 302)
@@ -0,0 +1,277 @@
+/*
+ *  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: target_timer.c 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *  ã¿ã¤ããã©ã¤ãï¼BlueNinjaç¨ï¼
+ */
+
+#include "kernel_impl.h"
+#include "time_event.h"
+#include <sil.h>
+#include "target_timer.h"
+#include "tz1000.h"
+
+/*
+ * =begin not implemented...
+ * TODO: ãªã¼ãã©ã³ã¿ã¤ãã¯ç¾ç¶æªãµãã¼ã
+ */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+
+#include "overrun.h"
+
+/*
+ *	ãªã¼ãã©ã³ã¿ã¤ãã®åæåå¦ç
+ *
+ *	ã¿ã¤ããåæåããï¼
+ */
+void
+target_ovrtimer_initialize(intptr_t exinf)
+{
+}
+
+/*
+ *	ãªã¼ãã©ã³ã¿ã¤ãã®çµäºå¦ç
+ *
+ *	ã¿ã¤ãã®åä½ãçµäºããï¼
+ */
+void
+target_ovrtimer_terminate(intptr_t exinf)
+{
+}
+
+/*
+ *	ãªã¼ãã©ã³ã¿ã¤ãã®èµ·åå¦ç
+ *
+ *	ã¿ã¤ããèµ·åããï¼
+ */
+void
+target_ovrtimer_start(OVRTIM ovrtim)
+{
+}
+
+/*
+ *	ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢å¦ç
+ *
+ *	ã¿ã¤ãã®åä½ãåæ­¢ãããï¼
+ */
+OVRTIM
+target_ovrtimer_stop(void)
+{
+}
+
+/*
+ *	ãªã¼ãã©ã³ã¿ã¤ãã®æ®ãæéã®èª­åºã
+ */
+OVRTIM
+target_ovrtimer_get_current(void)
+{
+}
+
+/*
+ *	ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+void
+target_ovrtimer_handler(void)
+{
+	i_begin_int(INTNO_OVRTIMER);
+    /*
+     *  å²è¾¼ã¿ãã³ãã©ã®å
+¥ãå£ã§å
+¨å²è¾¼ã¿ãç¦æ­¢ã§ããï¼
+     *  å²è¾¼ã¿ãã³ãã©ã®å
+¥ãå£ã§ãªã¼ãã©ã³ã¿ã¤ããåæ­¢ãã
+     *  åã«ï¼ãªã¼ãã©ã³ã¿ã¤ãã®å²è¾¼ã¿ãå
+¥ãå¯è½æ§ãããããï¼
+     *  ããã§ãovrtimer_stopãå¼åºãï¼éä¾å­é¨ããªã¼ãã©ã³
+     *  ã¿ã¤ãåæ­¢ç¶æ
+ã¨ãã
+     */
+    ovrtimer_stop();
+
+    /*
+     * å²è¾¼ã¿è¦æ±ã¯ãªã¢
+     */
+
+	call_ovrhdr();
+	i_end_int(INTNO_OVRTIMER);
+}
+
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+/*
+ * =end not implemented...
+ */
+
+/*
+ *  ã¿ã¤ãã®èµ·åå¦ç
+ */
+void
+target_hrt_initialize(intptr_t exinf)
+{
+    /*
+     * ã¯ã­ãã¯ã½ã¼ã¹
+     *   CSMSEL_MAIN : PLL (48MHz)
+     *   PSSEL_CD_PPIER0 : /2
+     *   ... 24MHz
+     */
+    /* åæè¨­å® */
+    /*
+     *  TMR0 ç¾å¨å¤ã¿ã¤ã
+     *    32bitå¨æã¿ã¤ã
+     *    å²è¾¼ã¿ç¦æ­¢
+     */
+    Driver_TMR0.Initialize(0, 0);
+    sil_wrw_mem(TMRCONTROL(TMR0_BASE), (TMRCONTROL_PERIOD | TMRCONTROL_32BIT));
+    /* ã«ã¦ã³ã¿ãã»ãã */
+    sil_wrw_mem(TMRLOAD(TMR0_BASE), MAX_HRTCNT_CLOCK);
+
+    /*
+     *  TMR1 ã¿ã¤ã ã¤ãã³ãå²è¾¼ã¿ã¿ã¤ã
+     *    32bitã¯ã³ã·ã§ããã¿ã¤ã
+     *    å²è¾¼ã¿è¨±å¯
+     */
+    Driver_TMR1.Initialize(0, 0);
+    sil_wrw_mem(TMRCONTROL(TMR1_BASE), (TMRCONTROL_PERIOD |
+                                        TMRCONTROL_INTENA |
+                                        TMRCONTROL_32BIT  | 
+                                        TMRCONTROL_ONESHOT));
+    /* å²è¾¼ã¿è¦æ±ãã¯ãªã¢ */
+    sil_wrw_mem(TMRINTCLR(TMR1_BASE), 0x00000001);
+
+    /* ç¾å¨å¤ã¿ã¤ãã¹ã¿ã¼ã */
+    sil_orw(TMRCONTROL(TMR0_BASE), TMRCONTROL_ENABLE);
+}
+
+/*
+ *  ã¿ã¤ãã®åæ­¢å¦ç
+ */
+void
+target_hrt_terminate(intptr_t exinf)
+{
+    /* ã¿ã¤ããåæ­¢ */
+    sil_andw(TMRCONTROL(TMR0_BASE), ~TMRCONTROL_ENABLE);
+    sil_andw(TMRCONTROL(TMR1_BASE), ~TMRCONTROL_ENABLE);
+    /* å²ãè¾¼ã¿è¦æ±ãã¯ãªã¢ */
+    sil_wrw_mem(TMRINTCLR(TMR1_BASE), 0x00000001);
+}
+
+/*
+ *  ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+void
+target_hrt_handler(void)
+{
+	i_begin_int(INTNO_TIMER);
+    /* å²ãè¾¼ã¿è¦æ±ãã¯ãªã¢ */
+    sil_wrw_mem(TMRINTCLR(TMR1_BASE), 0x00000001);
+	signal_time();                    /* ã¿ã¤ã ãã£ãã¯ã®ä¾çµ¦ */
+	i_end_int(INTNO_TIMER);
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ç¾å¨ã®ã«ã¦ã³ãå¤ã®èª­åºã
+ */
+HRTCNT
+target_hrt_get_current(void)
+{
+    HRTCNT current;
+
+	current = MAX_HRTCNT_CLOCK - (HRTCNT)sil_rew_mem(TMRVALUE(TMR0_BASE));
+
+    return (HRTCNT_USEC(current));
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã¸ã®å²è¾¼ã¿ã¿ã¤ãã³ã°ã®è¨­å®
+ *
+ *  é«åè§£è½ã¿ã¤ããï¼hrtcntã§æå®ããå¤ã«ã¦ã³ãã¢ãããããå²è¾¼ã¿ãçº
+ *  çãããããã«è¨­å®ããï¼
+ */
+void
+target_hrt_set_event(HRTCNT hrtcnt)
+{
+    /* ã¿ã¤ããåæ­¢ */
+    sil_andw(TMRCONTROL(TMR1_BASE), ~TMRCONTROL_ENABLE);
+
+    /* ã«ã¦ã³ã¿ãã»ãã */
+    sil_wrw_mem(TMRLOAD(TMR1_BASE), HRTCNT_CLOCK(hrtcnt));
+
+    /* å²è¾¼ã¿è¦æ±ãã¯ãªã¢ */
+    sil_wrw_mem(TMRINTCLR(TMR1_BASE), 0x00000001);
+
+    /* ã¿ã¤ã ã¤ãã³ãå²è¾¼ã¿ã¿ã¤ãã¹ã¿ã¼ã */
+    sil_orw(TMRCONTROL(TMR1_BASE), TMRCONTROL_ENABLE);
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®è¦æ±
+ */
+void
+target_hrt_raise_event(void)
+{
+    /* ã¿ã¤ããåæ­¢ */
+    sil_andw(TMRCONTROL(TMR1_BASE), ~TMRCONTROL_ENABLE);
+
+    /* ã«ã¦ã³ã¿ãã»ãã */
+    sil_wrw_mem(TMRLOAD(TMR1_BASE), 1U);
+
+    /* å²è¾¼ã¿è¦æ±ãã¯ãªã¢ */
+    sil_wrw_mem(TMRINTCLR(TMR1_BASE), 0x00000001);
+
+    /* ã¿ã¤ã ã¤ãã³ãå²è¾¼ã¿ã¿ã¤ãã¹ã¿ã¼ã */
+    sil_orw(TMRCONTROL(TMR1_BASE), TMRCONTROL_ENABLE);
+}
+
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_timer.cfg
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_timer.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_timer.cfg	(revision 302)
@@ -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-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: target_timer.cfg 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *    ã¿ã¤ããã©ã¤ãã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+#include "target_timer.h"
+ATT_INI({ TA_NULL, 0, _kernel_target_hrt_initialize });
+ATT_TER({ TA_NULL, 0, _kernel_target_hrt_terminate });
+DEF_INH(INHNO_TIMER, { TA_NULL, _kernel_target_hrt_handler });
+CFG_INT(INTNO_TIMER, { TA_ENAINT|INTATR_TIMER, INTPRI_TIMER });
+
+#ifdef TOPPERS_SUPPORT_OVRHDR
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ãã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+ATT_INI({ TA_NULL, 0, target_ovrtimer_initialize });
+ATT_TER({ TA_NULL, 0, target_ovrtimer_terminate });
+DEF_INH(INHNO_OVRTIMER, { TA_NULL, target_ovrtimer_handler });
+CFG_INT(INTNO_OVRTIMER, { TA_ENAINT|INTATR_OVRTIMER, INTPRI_OVRTIMER });
+#endif
+
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_timer.h
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_timer.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_timer.h	(revision 302)
@@ -0,0 +1,241 @@
+/*
+ *  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: target_timer.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *  ã¿ã¤ããã©ã¤ãï¼BlueNinjaç¨ï¼
+ */
+
+#ifndef TOPPERS_TARGET_TIMER_H
+#define TOPPERS_TARGET_TIMER_H
+
+#include "tz1000.h"
+
+/*
+ *  ã¿ã¤ãå²è¾¼ã¿ãã³ãã©ç»é²ã®ããã®å®æ°
+ */
+#define INTPRI_TIMER    (-5)          /* å²è¾¼ã¿åªå
+åº¦ */
+#define INTATR_TIMER    0U            /* å²è¾¼ã¿å±æ§ */
+#define INHNO_TIMER     INTNO_TMR1 /* å²è¾¼ã¿ãã³ãã©çªå· */
+#define INTNO_TIMER     INTNO_TMR1 /* å²è¾¼ã¿çªå· */
+
+/*
+ *  ã¿ã¤ãå¤ã®å
+é¨è¡¨ç¾ã®å
+ */
+typedef uint32_t    CLOCK;
+
+/*
+ * =begin not implemented...
+ * TODO: ãªã¼ãã©ã³ã¿ã¤ãã¯ç¾ç¶æªãµãã¼ã
+ */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+/*
+ *  GPTM0_Aãä½¿ç¨ãã
+ */
+
+/*
+ *	ã¿ã¤ãå²è¾¼ã¿ãã³ãã©ç»é²ã®ããã®å®æ°
+ */
+#define INHNO_OVRTIMER 	XX   /* å²è¾¼ã¿ãã³ãã©çªå· */
+#define INTNO_OVRTIMER 	XX   /* å²è¾¼ã¿çªå· */
+#define INTPRI_OVRTIMER	(-6)		  /* å²è¾¼ã¿åªå
+åº¦ */
+#define INTATR_OVRTIMER	0U			  /* å²è¾¼ã¿å±æ§ */
+
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+#ifndef TOPPERS_MACRO_ONLY
+#ifdef TOPPERS_SUPPORT_OVRHDR
+/*
+ *  ã¿ã¤ãå¤ã®å
+é¨è¡¨ç¾ã¨ãã¤ã¯ã­ç§åä½ã¨ã®å¤æ
+ */
+#define OVRTIMER_CLOCK_UNIT 50
+/*
+ *  è¨­å®ã§ããæå¤§ã®ã¿ã¤ãå¨æï¼åä½ã¯å
+é¨è¡¨ç¾ï¼
+ */
+#define MAX_OVRTIMER_CLOCK    ((CLOCK) 0xffffffffU)
+/*
+ *	ã¿ã¤ãå¤ã®å
+é¨è¡¨ç¾ã¨ãã¤ã¯ã­ç§åä½ã¨ã®å¤æ
+ *	1Î¼secãããã®ã¯ã­ãã¯ã«ã¦ã³ãæ°
+ */
+#define OVRTIMER_CLOCK(usec) ((usec) * OVRTIMER_CLOCK_UNIT)
+#define OVRTIMER_USEC(clock) ((clock) / OVRTIMER_CLOCK_UNIT)
+
+/*
+ *	ãªã¼ãã©ã³ã¿ã¤ãã®åæåå¦ç
+ *
+ *	ã¿ã¤ããåæåããï¼
+ */
+extern void target_ovrtimer_initialize(intptr_t exinf);
+
+/*
+ *	ãªã¼ãã©ã³ã¿ã¤ãã®çµäºå¦ç
+ *
+ *	ã¿ã¤ãã®åä½ãçµäºããï¼
+ */
+extern void target_ovrtimer_terminate(intptr_t exinf);
+
+/*
+ *	ãªã¼ãã©ã³ã¿ã¤ãã®èµ·åå¦ç
+ *
+ *	ã¿ã¤ããèµ·åããï¼
+ */
+extern void target_ovrtimer_start(OVRTIM ovrtim);
+
+/*
+ *	ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢å¦ç
+ *
+ *	ã¿ã¤ãã®åä½ãåæ­¢ãããï¼
+ */
+extern OVRTIM target_ovrtimer_stop(void);
+
+/*
+ *	ãªã¼ãã©ã³ã¿ã¤ãã®ç¾å¨å¤ã®èª­åºã
+ */
+extern OVRTIM target_ovrtimer_get_current(void);
+
+/*
+ *	ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+extern void target_ovrtimer_handler(void);
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©èµ·åã«ã¼ãã³
+ */
+extern void	call_ovrhdr(void);
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+/*
+ * =end not implemented...
+ */
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ç¾å¨ã®ã«ã¦ã³ãå¤ã®èª­åºã
+ */
+extern HRTCNT target_hrt_get_current(void);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã¸ã®å²è¾¼ã¿ã¿ã¤ãã³ã°ã®è¨­å®
+ *
+ *  é«åè§£è½ã¿ã¤ããï¼hrtcntã§æå®ããå¤ã«ã¦ã³ãã¢ãããããå²è¾¼ã¿ãçº
+ *  çãããããã«è¨­å®ããï¼
+ */
+extern void target_hrt_set_event(HRTCNT hrtcnt);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®è¦æ±
+ */
+extern void target_hrt_raise_event(void);
+
+/*
+ *  ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+extern void target_hrt_handler(void);
+
+/*
+ *  ã¿ã¤ãã®èµ·åå¦ç
+ *
+ *  ã¿ã¤ããåæåãï¼å¨æçãªã¿ã¤ãå²è¾¼ã¿è¦æ±ãçºçãããï¼
+ */
+extern void target_hrt_initialize(intptr_t exinf);
+
+/*
+ *  ã¿ã¤ãã®åæ­¢å¦ç
+ *
+ *  ã¿ã¤ãã®åä½ãåæ­¢ãããï¼
+ */
+extern void target_hrt_terminate(intptr_t exinf);
+
+/*
+ *  ã¿ã¤ãå¤ã®å
+é¨è¡¨ç¾ã¨ãã¤ã¯ã­ç§åä½ã¨ã®å¤æ
+ *  48MHz / 2
+ */
+#define HRTCNT_CLOCK_UNIT 24
+/*
+ *  è¨­å®ã§ããæå¤§ã®ã¿ã¤ãå¨æï¼åä½ã¯å
+é¨è¡¨ç¾ï¼
+ *  TCYC_HRTCNT(178956970us)*HRT_CLOCK_UNITãã¿ã¤ãå¨æ
+ */
+#define MAX_HRTCNT_CLOCK    ((HRTCNT)0xFFFFFFF0U)
+/*
+ *	ã¿ã¤ãå¤ã®å
+é¨è¡¨ç¾ã¨ãã¤ã¯ã­ç§åä½ã¨ã®å¤æ
+ *	1Î¼secãããã®ã¯ã­ãã¯ã«ã¦ã³ãæ°
+ */
+#define HRTCNT_CLOCK(usec) ((usec) *  HRTCNT_CLOCK_UNIT)
+#define HRTCNT_USEC(clock) ((clock) / HRTCNT_CLOCK_UNIT)
+
+/*
+ *  å²è¾¼ã¿ã¿ã¤ãã³ã°ã«æå®ããæå¤§å¤ [ASPD1005]
+ *  ã¿ã¤ãã§è¨æ¸¬ã§ããæå¤§ã®æéï¼Î¼ç§ï¼- ã¿ã¤ãå²è¾¼ã¿ã®æå¤§é
+å»¶æé
+ *  = (0xffffffff / 24) - MAX_HRTINT_DLY
+ *  ~ 178956970 us - MAX_HRTINT_DLY
+ */
+#ifndef MAX_HRTINT_DLY
+#define MAX_HRTINT_DLY 5U   /* ããã©ã«ãã®ã¿ã¤ãå²è¾¼ã¿ã®é
+å»¶æé */
+#endif /* MAX_HRTINT_DLY */
+#define HRTCNT_BOUND    (178956970U - MAX_HRTINT_DLY)
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+#endif /* TOPPERS_TARGET_TIMER_H */
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_unrename.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_unrename.h	(revision 302)
@@ -0,0 +1,47 @@
+/* This file is generated from target_rename.def by genrename. */
+
+/* This file is included only when target_rename.h has been included. */
+#ifdef TOPPERS_TARGET_RENAME_H
+#undef TOPPERS_TARGET_RENAME_H
+
+
+/*
+ * target_kernel_impl.c
+ */
+#undef target_initialize
+#undef target_exit
+
+/*
+ * target_timer.c
+ */
+#undef target_hrt_initialize
+#undef target_hrt_terminate
+#undef target_hrt_handler
+#undef target_hrt_get_current
+#undef target_hrt_set_event
+#undef target_hrt_raise_event
+
+#ifdef TOPPERS_LABEL_ASM
+
+
+/*
+ * target_kernel_impl.c
+ */
+#undef _target_initialize
+#undef _target_exit
+
+/*
+ * target_timer.c
+ */
+#undef _target_hrt_initialize
+#undef _target_hrt_terminate
+#undef _target_hrt_handler
+#undef _target_hrt_get_current
+#undef _target_hrt_set_event
+#undef _target_hrt_raise_event
+
+#endif /* TOPPERS_LABEL_ASM */
+
+#include "arm_m_gcc/common/core_unrename.h"
+
+#endif /* TOPPERS_TARGET_RENAME_H */
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/target_user.txt
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/target_user.txt	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/target_user.txt	(revision 302)
@@ -0,0 +1,234 @@
+=====================================================================
+                          BlueNinjaä¾å­é¨
+                                          Last Modified: 2015 Nov 12
+=====================================================================
+
+(1) å¯¾å¿ãã¦ããã¿ã¼ã²ããã·ã¹ãã ã®ç¨®é¡ã»æ§æ
+
+BlueNinjaä¾å­é¨ã¯ï¼CEREVOç¤¾ã®BlueNinjaããµãã¼ããã¦ããï¼
+
+  ã»CDP-TZ01B (TOSHIBA TZ1001MBG)
+  
+ä½¿ç¨ãã¦ãããªã½ã¼ã¹ã¯ï¼
+ã»UART1ï¼syslogåºåï¼ä½ã¬ãã«åºåï¼
+ã»TMR0ï¼TMR1ï¼ã·ã¹ãã æå»ï¼ã¤ãã³ãæå»ï¼
+ã§ããï¼TOSHIBA TZ1001MBGãä½¿ç¨ãã¦ããã¿ã¼ã²ããã§ããã°ï¼
+å®¹æã«ãã¼ãã£ã³ã°å¯è½ã§ããï¼
+
+ã¿ã¼ã²ããåæåããã³OpenOCDåä½ã®ããã«ã¯ï¼æ±èç¤¾ããæä¾ããã¦ãã
+"TZ1000 BSP"ï¼ããã³ï¼CEREVOç¤¾ããæä¾ããã¦ãã"BlueNinja BSP"ãç¨ããï¼
+
+(2) ä½¿ç¨ããéçºç°å¢ã¨åä½æ¤è¨¼ããæ¡ä»¶ï¼ãã¼ã¸ã§ã³ï¼ãªãã·ã§ã³ç­ï¼
+
+ã³ã³ãã¤ã©ã¯GCCãç¨ããï¼åä½ç¢ºèªã«ç¨ããã³ã³ãã¤ã©ã¯ä»¥ä¸ã®éãã§ããï¼
+
+  arm-none-eabi-gcc 4.8.4 (GCC ARM Embedded in Launchpad 4.8-2014-q3)
+  arm-none-eabi-gcc 4.9.3 (GCC ARM Embedded in Launchpad 4.9-2015-q1)
+
+ãããã°ç°å¢ã¯ï¼BlueNinjaã«ä»å±ãããã¬ã¤ã¯ã¢ã¦ããã¼ãã®mbedç¸å½ã®
+æ¸è¾¼ã¿æ©è½ãå©ç¨ããFlashã¸ã®æ¸è¾¼ã¿ï¼ã¾ãï¼ãã¬ã¤ã¯ã¢ã¦ããã¼ãã®
+CMSIS-DAPã¤ã³ã¿ã¼ãã§ã¼ã¹ãå©ç¨ããï¼GDBã¨OpenOCDã«ãããããã°ã
+ç¢ºèªããï¼
+ãã¹ãPCã®OSãWindowsã®å ´åã«ã¯ï¼ãã¬ã¤ã¯ã¢ã¦ããã¼ãã®mbedç¸å½ã®æ©è½ã
+å©ç¨ããããã«ï¼ããã¤ã¹ãã©ã¤ãã®ã¤ã³ã¹ãã¼ã«ãå¿
+è¦ã§ããï¼
+ä¸è¨ã®URLã®ï¼"Download latest driver"ãªã³ã¯ããï¼ããã¤ã¹ãã©ã¤ãã
+ãã¦ã³ã­ã¼ããï¼ãã¹ãPCã«ã¤ã³ã¹ãã¼ã«ããï¼
+https://developer.mbed.org/handbook/Windows-serial-configuration
+MacOSXç°å¢ã§ã¯ï¼ä¸è¨ããã¤ã¹ãã©ã¤ãã®ã¤ã³ã¹ãã¼ã«ã¯å¿
+è¦ãªãï¼
+ããããï¼Linuxç°å¢ã§ãå¿
+è¦ãªãã¨æããããï¼è¦ç¢ºèªã§ããï¼
+åä½ç¢ºèªã«ç¨ããGDBã¯ï¼ä¸è¨GCCã®ããã±ã¼ã¸ã«åæ¢±ããã¦ããGDBã§ããï¼
+ã¾ãï¼åä½ç¢ºèªã«ç¨ããOpenOCDã®ãã¼ã¸ã§ã³ã¯ï¼OpenOCD 0.8.0ã§ããï¼
+
+TZ1000 BSPãç¨ããããã«ï¼ä»¥ä¸ã®ç°å¢æ§ç¯ãå¿
+è¦ã§ããï¼
+  1. CMSISã®å
+¥æ
+     http://www.keil.com/dd2/pack/ ã®URLã®ï¼ARM > CMSIS CMSIS 
+     (Cortex Microcontroller Software Interface Standard) > 
+     Version: 3.20.4 ARM.CMSIS.3.20.4.pack ã«ãã"Download"ãã¿ã³
+     ããï¼ARM.CMSIS.3.20.4.pack ããã¦ã³ã­ã¼ããï¼unzipã«ãã
+     è§£åããï¼
+
+  2. TZ1000 BSPã®å
+¥æ
+  ã http://blueninja.cerevo.com/ja/guide/altc.html ã®URLã«
+  ã å¾ãï¼æ±èç¤¾ã®ã¦ã§ããµã¤ããã"TZ1000 BSP non OS Version 
+     for MDK-ARM"ã®Ver.1.35.0ããã¦ã³ã­ã¼ãããï¼
+     ãã¦ã³ã­ã¼ããã TZ1000_OSless_MDK_20150827.zip ãunzip
+     ã«ããè§£åãï¼TZ1000_OSless_MDK_20150827/TZ1000_Software_150827/
+     TOSHIBA.TZ10xx_DFP.1.35.0.pack ãè§£åããï¼
+
+  3. ããã¤ã¹ãã©ã¤ãç¨ãã£ã¬ã¯ããªã®ä½æ
+     target/blueninja_gcc/ ä»¥ä¸ã«ï¼device/ ãã£ã¬ã¯ããªãä½æããï¼
+     ããã¦ï¼device/ ä»¥ä¸ã«ï¼1.ã2.ã§è§£åãããã£ã¬ã¯ããªãï¼ä»¥ä¸ã®
+     ããã«é
+ç½®ããï¼
+     target/blueninja_gcc/device/
+        - ARM.CMSIS/ ... 1. ã§è§£åãããã£ã¬ã¯ããªãé
+ç½®
+            - ARM.CMSIS.pdsc
+            - CMSIS/
+            - CMSIS_RTX/
+            - Device/
+        - TOSHIBA.TZ10xx_DFP/ ... 2. ã§è§£åãããã£ã¬ã¯ããªãé
+ç½®
+            - Boards/
+            - Device/
+            - Flash/
+            - Middleware/
+            - RTE_Driver/
+            - SVD/
+            - TOSHIBA.TZ10xx_DFP.pdsc
+            - Utils/
+        - RTE/ ... TOSHIBA.TZ10xx_DFP/ ããä¸é¨ã®ãã¡ã¤ã«ãé
+ç½®
+            - Device/TZ1001MBG/ ... æ°è¦ä½æ
+       â» ãªãï¼deviceã¨ãããã£ã¬ã¯ããªåã¯ãã¹ã¯ï¼Makefile.targetã®
+          DEVICEDIRãã¯ã­ãä¿®æ­£ãããã¨ã«ããå¤æ´å¯è½ã§ããï¼
+
+    4. target/blueninja_gcc/device/RTE/ ä»¥ä¸ã®ãã¡ã¤ã«ã®æºå
+       TOSHIBA.TZ10xx_DFP/ ããä¸é¨ã®ãã¡ã¤ã«ã RTE/ ä»¥ä¸ã«é
+ç½®ããï¼
+       - cp TOSHIBA.TZ10xx_DFP/RTE_Driver/Config/* RTE/Device/TZ1001MBG/
+       - cp TOSHIBA.TZ10xx_DFP/Boards/TOSHIBA/RBTZ1000/Template/RTE/ \
+         RTE_Components.h RTE/
+       ä¸è¨ãã¡ã¤ã«ã«ãããããã¦ãï¼
+       - cd target/blueninja_gcc/device
+       - patch -p0 < ../RTE.patch
+
+BlueNinja BSPãå
+¥æããããã«ã¯ï¼gitãä½¿ç¨ãï¼ä¸è¨ã®ã³ãã³ãã«ããï¼
+BlueNinja BSPãªãã¸ããªãã¯ã­ã¼ã³ããï¼
+  git clone https://bitbucket.org/cerevo/blueninja_bsp.git
+
+OpenOCDã«ãããããã°æã«ã¯ï¼ä¸è¨ã®ãã¡ã¤ã«ãOpenOCDã®scripts/
+ãã£ã¬ã¯ããªã«é
+ç½®ããå¿
+è¦ãããï¼
+  - cp blueninja_bsp/install_files/tz10xx.cfg %OpenOCD%/share/openocd/ \
+    scripts/target/
+  - cp blueninja_bsp/install_files/tz10xx_reset.tcl %OpenOCD%/share/ \
+    openocd/scripts/target/
+
+ãªãï¼BlueNinja BSPã®ä¸è¨ã«å«ã¾ããã©ã¤ãã©ãªããã©ã¤ããå©ç¨å¯è½ã§ããï¼
+  - blueninja_bsp/_TZ1/skel/src/
+ãã®éã«ã¯ï¼Makefileãä¸è¨ã®æ¹éã§ä¿®æ­£ããå¿
+è¦ãããï¼
+  - .cãã¡ã¤ã«ã®ãã¹ãvpathã«å«ãã
+  - .hãã¡ã¤ã«ã®ãã¹ãINCLUDEã«å«ãã
+ã©ã¤ãã©ãªããã©ã¤ãã®ãªãã¡ã¬ã³ã¹ã¯ä¸è¨CEREVOç¤¾ã®ã¦ã§ããµã¤ããåç
+§ã®ãã¨ï¼
+  http://blueninja.cerevo.com/ja/docs/reference/index.html
+
+åèæ
+å ± (1)
+  æ±èç¤¾ãCEREVOç¤¾ã®ã©ã¤ãã©ãªããã©ã¤ãã§ã¯ï¼stdint.hãä½¿ç¨ãã¦ããï¼
+  TOPPERSã«ã¼ãã«ã®t_stddef.hã®å®ç¾©ã¨éè¤ããããï¼ã³ã³ãã¤ã«ã¨ã©ã¼ã¨
+  ãªãï¼
+  æ±èç¤¾ãCEREVOç¤¾ã®ã©ã¤ãã©ãªããã©ã¤ãã®ããããã¡ã¤ã«ãincludeãã
+  éã«ã¯ï¼ãã®includeæã®åã«ï¼ä¸è¨ã®ã¤ã³ã¯ã«ã¼ãã¬ã¼ãç¨ãã¯ã­ãå®ç¾©
+  ãããã¨ã§ï¼åå®ç¾©ã®è¡çªãåé¿ãããã¨ãã§ããï¼
+#define _STDINT_H
+
+åèæ
+å ± (2)
+  CEREVOç¤¾ã®BlueNinja BSPã®ã©ã¤ãã©ãªããã©ã¤ãããä½¿ç¨ãã¦ããï¼
+  æ±èç¤¾ã®TZ1000 BSPã®ã©ã¤ãã©ãªããã©ã¤ãã«é¢ããæ
+å ±ã¯ï¼
+  blueninja_bsp/_TZ1/scripts/app_create.bat ãåèã«ãªãï¼
+
+(2-1) sample1ã®åä½ç¢ºèªæé 
+
+1. (2) ã®ç°å¢æºåããã
+
+2. asp3/obj/ ãã£ã¬ã¯ããªãä½æãã
+  $ mkdir obj
+
+3. asp3/obj/ ã«ç§»åãï¼configureãå®æ½
+  $ cd obj
+  $ ../configure -T blueninja_gcc
+
+4. Makefileãä¿®æ­£ãï¼asp.binããã«ãããããã«ãã
+@@ -205,8 +205,8 @@
+ #
+ #  ã¿ã¼ã²ãããã¡ã¤ã«ï¼è¤æ°ãåæã«é¸æãã¦ã¯ãªããªãï¼
+ #
+-#all: $(OBJFILE)
+-all: $(OBJNAME).bin
++all: $(OBJFILE)
++#all: $(OBJNAME).bin
+ #all: $(OBJNAME).srec
+ 
+ ##### ä»¥ä¸ã¯ç·¨éããªããã¨ #####
+
+5. make depend; make ãå®è¡ãï¼asp.binããã«ã
+  $ make depend; make
+
+6. BlueNinjaããã¬ã¤ã¯ã¢ã¦ããã¼ãã«æ¥ç¶ãï¼USBã±ã¼ãã«ã§ãã¹ãPCã«
+   æ¥ç¶ããï¼
+
+7. BlueNinjaãUSBã¡ã¢ãªãã¤ã·ãªã¢ã«ãã¼ãã¨ãã¦èªè­ãããï¼
+   USBã¡ã¢ãªã¨ãã¦èªè­ãããBlueNinjaã®ããããã£ã¬ã¯ããªã«
+   asp.binãç½®ã
+  $ cp asp.bin %DevicePath%/CDP-TZ01B/
+
+8. BlueNinjaãèªåçã«åæ¥ç¶èªè­ããã
+
+9. TeraTermãªã©ãä½¿ç¨ãï¼ãã¹ãPCã®ã·ãªã¢ã«ãã¼ããopenãã
+
+10. ãã¬ã¤ã¯ã¢ã¦ããã¼ãã®ãã¯ã¼ã¹ã¤ããï¼miniUSBç«¯å­ã®é£ï¼
+    ã2ç§ä»¥ä¸æ¼ãç¶ãã
+  ãã¯ã¼ã¹ã¤ããã®ä½ç½®ã¯ä¸è¨URLã®å³ãåèã«ãªã
+  http://blueninja.cerevo.com/ja/docs/BlueNinja_ERASE.png
+
+11. BlueNinjaã§ASPãèµ·åãï¼ã·ãªã¢ã«ã­ã°åºåãéå§ããï¼LEDãç¹ç¯ãã
+
+
+(3) ã¿ã¼ã²ããå®ç¾©äºé 
+ã®è¦å®
+
+(3-1) å²è¾¼ã¿åªå
+åº¦
+
+CFG_INTã§ä½¿ç¨å¯è½ãªå²è¾¼ã¿åªå
+åº¦ã®ç¯å²ã¯ï¼-8 ã -1 ã§ããï¼ARM-Mãã­ã»
+ããµä¾å­é¨ã®ããã¥ã¢ã«ããããã«ï¼TMIN_INTPRIã«è¨­å®å¯è½ãªå¤ã®æå¤§å¤ã¯
+-7ã§ããï¼ã«ã¼ãã«ç®¡çå
+ã®å²è¾¼ã¿ã¯-7 ã -1 ã®åªå
+åº¦ãè¨­å®å¯è½ã§ããï¼
+ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã®åªå
+åº¦ã¨ãã¦ã¯-8ãä½¿ç¨å¯è½ã§ããï¼
+
+(4) ã¡ã¢ãªããã
+
+ä¾å¤ãã¯ã¿ï¼ã¹ã¿ã¼ãã¢ãããã­ã°ã©ã ãã­ã¹ãï¼å®æ°ãã¼ã¿ã¯FLASHã¸ï¼
+ãã®ä»ã®ãã­ã°ã©ã ãã­ã¹ã(*)ï¼ãã®ä»ã®ãã¼ã¿ã¯RAMã¸é
+ç½®ããï¼
+(*)ã¯ï¼ã¹ã¿ã¼ãã¢ãããã­ã°ã©ã ã«ããï¼FLASHããRAMã¸ã³ãã¼ãããï¼
+
+(5) ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®æ
+å ±
+
+ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã§ã¯ï¼UART1ãç¨ããï¼éä¿¡ãã©ã¼ãããã¯ï¼
+115200bps, 8bit, non-parity, 1topbitã§ããï¼
+
+(6) ã·ã¹ãã ã­ã°æ©è½ã®æ
+å ±
+
+ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã¯ï¼UART1ãç¨ããï¼éä¿¡ãã©ã¼ãããã¯ï¼
+115200bps, 8bit, non-parity, 1topbitã§ããï¼
+
+(7) ã©ã¤ãã©ãªã®æå®
+
+"Stellaris Peripheral Driver Libary" ã«å«ã¾ããï¼libdriver.a ã¨ 
+libgr.a ããªã³ã¯å¯¾è±¡ã¨ããå¿
+è¦ãããï¼æå®æ¹æ³ã¯ï¼Makefile.target ã® 
+LIBS ã«æå®ããã°ããï¼
+
+(8) ãã¼ã¸ã§ã³å±¥æ­´
+
+2015/11/15
+ã»æåã®ãªãªã¼ã¹
Index: asp3_wo_tecs/trunk/target/blueninja_gcc/tz1000.h
===================================================================
--- asp3_wo_tecs/trunk/target/blueninja_gcc/tz1000.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/blueninja_gcc/tz1000.h	(revision 302)
@@ -0,0 +1,180 @@
+/*
+ *  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: lm3sxxxx.h 301 2015-01-07 04:57:01Z ertl-ishikawa $
+ */
+
+/*
+ *  TZ1000ã«é¢ããå®ç¾©
+ */
+
+#ifndef TOPPERS_TZ1000_H
+#define TOPPERS_TZ1000_H
+
+/*
+ *  å²è¾¼ã¿çªå·ã®æå¤§å¤
+ */
+#define TMAX_INTNO   (15 + 80)
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ã®ãããå¹
+
+ */
+#define TBITW_IPRI     3
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãããå¹
+ä¸­ã®ãµãåªå
+åº¦ã®ãããå¹
+
+ */
+#define TBITW_SUBIPRI  0
+
+#include <sil.h>
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ * INTNO
+ */
+#define INTNO_UART1     (16 + 41)
+#define INTNO_TMR1      (16 + 61)
+
+/*
+ * TMR
+ */
+#define TMR0_BASE           0x40042000
+#define TMR1_BASE           0x40042020
+#define TMRLOAD(tmr)        ((void *)(tmr + 0x0000U))
+#define TMRVALUE(tmr)       ((void *)(tmr + 0x0004U))
+#define TMRCONTROL(tmr)     ((void *)(tmr + 0x0008U))
+#define TMRINTCLR(tmr)      ((void *)(tmr + 0x000CU))
+#define TMRRIS(tmr)         ((void *)(tmr + 0x0010U))
+#define TMRMIS(tmr)         ((void *)(tmr + 0x0014U))
+#define TMRBGLOAD(tmr)      ((void *)(tmr + 0x0018U))
+
+#define TMRCONTROL_ENABLE   ((uint32_t)(1U << 7))
+#define TMRCONTROL_PERIOD   ((uint32_t)(1U << 6))
+#define TMRCONTROL_INTENA   ((uint32_t)(1U << 5))
+#define TMRCONTROL_DIV_16   ((uint32_t)(1U << 2))
+#define TMRCONTROL_DIV_256  ((uint32_t)(2U << 2))
+#define TMRCONTROL_32BIT    ((uint32_t)(1U << 1))
+#define TMRCONTROL_ONESHOT  ((uint32_t)(1U << 0))
+
+/*
+ *  UART
+ */
+#define UART1_BASE          0x40065000U
+#define UARTDR(uart)        ((void *)(uart + 0x0000U))
+#define UARTRSR_ECR(uart)   ((void *)(uart + 0x0004U))
+#define UARTFR(uart)        ((void *)(uart + 0x0018U))
+#define UARTIBRD(uart)      ((void *)(uart + 0x0024U))
+#define UARTFBRD(uart)      ((void *)(uart + 0x0028U))
+#define UARTLCR_H(uart)     ((void *)(uart + 0x002CU))
+#define UARTCR(uart)        ((void *)(uart + 0x0030U))
+#define UARTIFLS(uart)      ((void *)(uart + 0x0034U))
+#define UARTIMSC(uart)      ((void *)(uart + 0x0038U))
+#define UARTRIS(uart)       ((void *)(uart + 0x003CU))
+#define UARTMIS(uart)       ((void *)(uart + 0x0040U))
+#define UARTICR(uart)       ((void *)(uart + 0x0044U))
+#define UARTDMACR(uart)     ((void *)(uart + 0x0048U))
+
+#define UARTFR_TXFE ((uint32_t)(1U << 7))
+#define UARTFR_RXFF ((uint32_t)(1U << 6))
+#define UARTFR_TXFF ((uint32_t)(1U << 5))
+#define UARTFR_RXFE ((uint32_t)(1U << 4))
+
+/*
+ *  åä¿¡å²è¾¼ã¿ãçºçãããé¾å¤ã®åä¿¡FIFO Full byteæ°
+ */
+#define UARTIFLS_RX_1       ((uint32_t)(0U << 3))
+#define UARTIFLS_RX_2       ((uint32_t)(1U << 3))
+#define UARTIFLS_RX_4       ((uint32_t)(2U << 3))
+#define UARTIFLS_RX_6       ((uint32_t)(3U << 3))
+#define UARTIFLS_RX_7       ((uint32_t)(4U << 3))
+
+/*
+ *  éä¿¡å¯è½å²è¾¼ã¿ãçºçãããé¾å¤ã®éä¿¡FIFO Empty byteæ°
+ */
+#define UARTIFLS_TX_14      ((uint32_t)(0U))
+#define UARTIFLS_TX_12      ((uint32_t)(1U))
+#define UARTIFLS_TX_8       ((uint32_t)(2U))
+#define UARTIFLS_TX_4       ((uint32_t)(3U))
+#define UARTIFLS_TX_2       ((uint32_t)(4U))
+
+#define UARTIMSC_TXIM       ((uint32_t)(1U << 5))
+#define UARTIMSC_RXIM       ((uint32_t)(1U << 4))
+
+#define UARTICR_TXIC        ((uint32_t)(1U << 5))
+#define UARTICR_RXIC        ((uint32_t)(1U << 4))
+
+/*
+ *  æ±èè£½ãã©ã¤ããä½¿ç¨ããããã®I/F
+ */
+#define _STDINT_H
+#include "PMU_TZ10xx.h"
+#include "GPIO_TZ10xx.h"
+#include "TMR_TZ10xx.h"
+#include "Driver_UART.h"
+extern TZ10XX_DRIVER_PMU Driver_PMU;
+extern TZ10XX_DRIVER_GPIO Driver_GPIO;
+extern ARM_DRIVER_UART Driver_UART1;
+extern TZ10XX_DRIVER_TMR Driver_TMR0;
+extern TZ10XX_DRIVER_TMR Driver_TMR1;
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+#endif /* TOPPERS_TZ1000_H */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/E_PACKAGE
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/E_PACKAGE	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/E_PACKAGE	(revision 302)
@@ -0,0 +1,6 @@
+E_PACKAGE asp3_ct11mpcore_gcc
+VERSION %date
+
+INCLUDE ../../MANIFEST
+INCLUDE ../../arch/arm_gcc/MANIFEST
+INCLUDE ../../cfg/MANIFEST
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/MANIFEST
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/MANIFEST	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/MANIFEST	(revision 302)
@@ -0,0 +1,27 @@
+PACKAGE asp3_arch_arm_gcc
+
+E_PACKAGE
+MANIFEST
+Makefile.target
+ct11mpcore.h
+ct11mpcore.ld
+target.tf
+target_cfg1_out.h
+target_check.tf
+target_kernel.h
+target_kernel_impl.c
+target_kernel_impl.h
+target_rename.def
+target_rename.h
+target_serial.c
+target_serial.cfg
+target_serial.h
+target_sil.h
+target_stddef.h
+target_syssvc.h
+target_test.h
+target_timer.c
+target_timer.cfg
+target_timer.h
+target_unrename.h
+target_user.txt
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/Makefile.target
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/Makefile.target	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/Makefile.target	(revision 302)
@@ -0,0 +1,98 @@
+#
+#		Makefileã®ã¿ã¼ã²ããä¾å­é¨ï¼CT11MPcoreç¨ï¼
+#
+#  $Id: Makefile.target 504 2016-01-12 01:19:55Z ertl-hiro $
+# 
+
+#
+#  ã·ã¹ãã åï¼ãããåï¼ã³ã¢åï¼éçºç°å¢åã®å®ç¾©
+#
+SYS = ct11mpcore
+CHIP = mpcore
+CORE = arm
+TOOL = gcc
+
+#
+#  QEMUã«é¢ããå®ç¾©
+#
+#  QEMUä¸ã§å®è¡ããå ´åã«ã¯ï¼TOPPERS_USE_QEMUããã¯ã­å®ç¾©ããï¼QEMUã®
+#  Semihostingãä½¿ããªãå ´åã«ã¯ï¼TOPPERS_OMIT_QEMU_SEMIHOSTINGããã¯ã­
+#  å®ç¾©ããï¼Semihostingãä½¿ãå ´åã«ã¯ï¼QEMUã®èµ·åæã«ï¼-semihostingãª
+#  ãã·ã§ã³ãã¤ãããã¨ãå¿
+è¦ã§ããï¼
+#
+#COPTS := $(COPTS) -DTOPPERS_USE_QEMU
+#COPTS := $(COPTS) -DTOPPERS_OMIT_QEMU_SEMIHOSTING
+
+#
+#  MPCoreã®ç¨®é¡ã®å®ç¾©
+#
+MPCORE_TYPE = ARM11
+
+#
+#  ã³ã¢ã®æå®
+#  
+CORENO = CORE0
+
+#
+#  åã»ã°ã¡ã³ãã®éå§ã¢ãã¬ã¹ã®å®ç¾©
+#
+ifeq ($(CORENO),CORE0)
+	TEXT_START_ADDRESS=0x01000000
+	DATA_START_ADDRESS=0x01800000
+endif
+ifeq ($(CORENO),CORE1)
+	TEXT_START_ADDRESS=0x02000000
+	DATA_START_ADDRESS=0x02800000
+endif
+ifeq ($(CORENO),CORE2)
+	TEXT_START_ADDRESS=0x03000000
+	DATA_START_ADDRESS=0x03800000
+endif
+ifeq ($(CORENO),CORE3)
+	TEXT_START_ADDRESS=0x04000000
+	DATA_START_ADDRESS=0x04800000
+endif
+
+#
+#  ã³ã³ãã¤ã«ãªãã·ã§ã³
+#
+INCLUDES := $(INCLUDES) -I$(TARGETDIR)
+COPTS := $(COPTS) -mlittle-endian -D$(CORENO)
+LDFLAGS := $(LDFLAGS) -mlittle-endian
+
+#
+#  ã«ã¼ãã«ã«é¢ããå®ç¾©
+#
+KERNEL_DIRS := $(KERNEL_DIRS) $(TARGETDIR)
+KERNEL_COBJS := $(KERNEL_COBJS) target_kernel_impl.o target_timer.o
+
+#
+#  ã·ã¹ãã ãµã¼ãã¹ã«é¢ããå®ç¾©
+#
+SYSSVC_DIRS := $(SYSSVC_DIRS) $(SRCDIR)/arch/arm_gcc/common
+SYSSVC_COBJS := $(SYSSVC_COBJS) target_serial.o uart_pl011.o
+
+#
+#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
+#
+#CFG_TABS := $(CFG_TABS) --cfg1-def-table $(TARGETDIR)/target_def.csv
+
+#
+#  ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ãã«é¢ããå®ç¾©
+#
+ifdef ENABLE_TRACE
+	COPTS := $(COPTS) -DTOPPERS_ENABLE_TRACE
+	KERNEL_DIRS := $(KERNEL_DIRS) $(SRCDIR)/arch/logtrace
+	KERNEL_COBJS := $(KERNEL_COBJS) trace_config.o trace_dump.o
+endif
+
+#
+#  ãªã³ã«ã¹ã¯ãªããã®å®ç¾©
+#
+LDSCRIPT = $(TARGETDIR)/ct11mpcore.ld
+
+#
+#  ãããä¾å­é¨
+#
+include $(SRCDIR)/arch/arm_gcc/mpcore/Makefile.chip
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/ct11mpcore.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/ct11mpcore.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/ct11mpcore.h	(revision 302)
@@ -0,0 +1,160 @@
+/*
+ *  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: ct11mpcore.h 478 2016-01-02 02:08:26Z ertl-hiro $
+ */
+
+/*
+ *		CT11MPcore with RealView Emulation Baseboard ãµãã¼ãã¢ã¸ã¥ã¼ã«
+ */
+
+#ifndef TOPPERS_CT11MPCORE_H
+#define TOPPERS_CT11MPCORE_H
+
+/*
+ *  å²è¾¼ã¿ã®æ°
+ */
+#define DIC_TNUM_INTNO		UINT_C(64)
+
+/*
+ *  å²è¾¼ã¿çªå·
+ */
+#define EB_IRQNO_TIMER01	33U
+#define EB_IRQNO_TIMER23	34U
+#define EB_IRQNO_UART0   	36U
+#define EB_IRQNO_UART1   	37U
+#define EB_IRQNO_UART2   	44U		/* è¦æ¤è¨ */
+#define EB_IRQNO_UART3   	45U		/* è¦æ¤è¨ */
+
+/*
+ *  MPCore Private Memory Regionã®å
+é ­çªå°
+ *
+ *  ARM11 MPCoreã®å¶å¾¡ã¬ã¸ã¹ã¿ã«ã¯ï¼MPCore Private Memory Regionã¨å¼ã°
+ *  ããã¡ã¢ãªé åã«ããã¢ã¯ã»ã¹ããï¼ãã®é åã®å
+é ­çªå°ã¯ï¼ã³ã¢å¤é¨ã
+ *  ãè¨­å®å¯è½ã¨ãªã£ã¦ããï¼CT11MPCoreã§ã¯ï¼ãã¼ãã§è¨­å®ã§ããããã«ãªã£
+ *  ã¦ããï¼ããã©ã«ãã§ã¯ï¼0x1f000000ã«ãªã£ã¦ããï¼
+ *
+ *  QEMUã§ã¯ï¼ãã®é åã®å
+é ­çªå°ã¯ï¼0x10100000ã«è¨­å®ããã¦ãã
+ *  ï¼qemu-2.1.0/hw/arm/realview.cï¼ï¼
+ */
+#ifdef TOPPERS_USE_QEMU
+#define MPCORE_PMR_BASE		0x10100000
+#endif /* TOPPERS_USE_QEMU */
+
+#ifndef MPCORE_PMR_BASE
+#define MPCORE_PMR_BASE		0x1f000000
+#endif /* MPCORE_PMR_BASE */
+
+/*
+ *  MPCoreå
+èµã®ã¿ã¤ãã¨ã¦ã©ããããã°ã1MHzã§åä½ãããããã®ããªã¹ã±ã¼
+ *  ã©ã®è¨­å®å¤ï¼ã³ã¢ã®ã¯ã­ãã¯ã200MHzã®å ´åï¼
+ */
+#define MPCORE_TMR_PS_1MHZ		99
+#define MPCORE_WDG_PS_1MHZ		99
+
+/*
+ *  Emulation Boardä¸ã®ãªã½ã¼ã¹
+ */
+#define EB_SYS_BASE			0x10000000
+#define EB_SYS_LOCK			((uint32_t *)(EB_SYS_BASE + 0x0020U))
+#define EB_SYS_PLD_CTRL1	((uint32_t *)(EB_SYS_BASE + 0x0074U))
+#define EB_SYS_PLD_CTRL2	((uint32_t *)(EB_SYS_BASE + 0x0078U))
+
+/*
+ *  ã­ãã¯ã¬ã¸ã¹ã¿ï¼EB_SYS_LOCKï¼ã®è¨­å®å¤
+ */
+#define EB_SYS_LOCK_LOCK	UINT_C(0x0000)
+#define EB_SYS_LOCK_UNLOCK	UINT_C(0xa05f)
+
+/*
+ *  ã·ã¹ãã å¶å¾¡ã¬ã¸ã¹ã¿1ï¼EB_SYS_PLD_CTRL1ï¼ã®è¨­å®å¤
+ */
+#define EB_SYS_PLD_CTRL1_INTMODE_LEGACY		UINT_C(0x00000000)
+#define EB_SYS_PLD_CTRL1_INTMODE_NEW_DCC	UINT_C(0x00400000)
+#define EB_SYS_PLD_CTRL1_INTMODE_NEW_NODCC	UINT_C(0x00800000)
+#define EB_SYS_PLD_CTRL1_INTMODE_EN_FIQ		UINT_C(0x01000000)
+#define EB_SYS_PLD_CTRL1_INTMODE_MASK		UINT_C(0x01c00000)
+
+/*
+ *  UARTé¢é£ã®å®ç¾©
+ */
+
+/* 
+ *  UARTã¬ã¸ã¹ã¿ã®ãã¼ã¹ã¢ãã¬ã¹
+ */
+#define EB_UART0_BASE		(EB_SYS_BASE + 0x9000U)
+#define EB_UART1_BASE		(EB_SYS_BASE + 0xa000U)
+#define EB_UART2_BASE		(EB_SYS_BASE + 0xb000U)
+#define EB_UART3_BASE		(EB_SYS_BASE + 0xc000U)
+
+/*
+ *  ãã¼ã¬ã¼ãè¨­å®ï¼38400bpsï¼
+ */ 
+#define EB_UART_IBRD_38400	0x27U
+#define EB_UART_FBRD_38400	0x04U
+
+/*
+ *  ã¿ã¤ãé¢é£ã®å®ç¾©
+ */
+
+/* 
+ *  ã¿ã¤ãã¬ã¸ã¹ã¿ã®ãã¼ã¹ã¢ãã¬ã¹
+ */
+#define EB_TIMER0_BASE		(EB_SYS_BASE + 0x11000U)
+#define EB_TIMER1_BASE		(EB_SYS_BASE + 0x11020U)
+#define EB_TIMER2_BASE		(EB_SYS_BASE + 0x12000U)
+#define EB_TIMER3_BASE		(EB_SYS_BASE + 0x12020U)
+
+#endif /* TOPPERS_CT11MPCORE_H */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/ct11mpcore.ld
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/ct11mpcore.ld	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/ct11mpcore.ld	(revision 302)
@@ -0,0 +1,85 @@
+/*
+ *  $Id: ct11mpcore.ld 362 2015-07-26 11:29:15Z ertl-hiro $
+ */
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm","elf32-littlearm") 
+OUTPUT_ARCH(arm)
+
+PROVIDE(hardware_init_hook = 0);
+PROVIDE(software_init_hook = 0);
+PROVIDE(software_term_hook = 0);
+
+SECTIONS {
+	.text ALIGN(4) : {
+		__start_text = .;
+		*(vector)
+		*(.text)
+		*(.glue_7t)
+		*(.glue_7)
+		__end_kernel = .;
+	}
+	_etext = .;
+	PROVIDE(etext = .);
+
+	.rodata ALIGN(4) : {
+		__start_rodata = .;
+		*(.rodata)
+		__end_rodata = .;
+	}
+
+	. = ALIGN(4);
+	__start_idata = .;
+	.data : AT(__start_idata) {
+		__start_data = .;
+		*(.data)
+		__end_data = .;
+	}
+	__end_idata = __start_idata + SIZEOF(.data);
+	_edata = .;
+	PROVIDE(edata = .);
+
+	.bss ALIGN(4) : {
+		__start_bss = .;
+		*(.bss)
+		*(COMMON)
+		__end_bss = .;
+	}
+
+	. = ALIGN(4);
+	_end = .;
+	PROVIDE(end = .);
+	.comment 0 : { *(.comment) }	
+
+	/*
+	 *  DWARF debug sections.
+	 *  Symbols in the DWARF debugging sections are relative to
+	 *  the beginning of the section so we begin them at 0.
+	 */
+
+	/* DWARF 1 */
+	.debug			0 : { *(.debug) }
+	.line			0 : { *(.line) }
+
+	/* GNU DWARF 1 extensions */
+	.debug_srcinfo	0 : { *(.debug_srcinfo) }
+	.debug_sfnames	0 : { *(.debug_sfnames) }
+
+	/* DWARF 1.1 and DWARF 2 */
+	.debug_aranges	0 : { *(.debug_aranges) }
+	.debug_pubnames	0 : { *(.debug_pubnames) }
+
+	/* DWARF 2 */
+	.debug_info		0 : { *(.debug_info) }
+	.debug_abbrev	0 : { *(.debug_abbrev) }
+	.debug_line		0 : { *(.debug_line) }
+	.debug_frame	0 : { *(.debug_frame) }
+	.debug_str		0 : { *(.debug_str) }
+	.debug_loc		0 : { *(.debug_loc) }
+	.debug_macinfo	0 : { *(.debug_macinfo) }
+
+	/* SGI/MIPS DWARF 2 extensions */
+	.debug_weaknames 0 : { *(.debug_weaknames) }
+	.debug_funcnames 0 : { *(.debug_funcnames) }
+	.debug_typenames 0 : { *(.debug_typenames) }
+	.debug_varnames  0 : { *(.debug_varnames) }
+}	
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target.tf
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target.tf	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target.tf	(revision 302)
@@ -0,0 +1,16 @@
+$ 
+$		ãã¹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_cfg1_out.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_cfg1_out.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_cfg1_out.h	(revision 302)
@@ -0,0 +1,11 @@
+/*
+ *		cfg1_out.cããªã³ã¯ããããã«å¿
+è¦ãªã¹ã¿ãã®å®ç¾©
+ *
+ *  $Id: target_cfg1_out.h 362 2015-07-26 11:29:15Z ertl-hiro $
+ */
+
+/*
+ *  ã³ã¢ä¾å­ã®ã¹ã¿ãã®å®ç¾©ï¼ãããä¾å­é¨ã¯é£ã°ãï¼
+ */
+#include "core_cfg1_out.h"
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_check.tf
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_check.tf	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_check.tf	(revision 302)
@@ -0,0 +1,8 @@
+$ 
+$		ãã¹3ã®ã¿ã¼ã²ããä¾å­ãã³ãã¬ã¼ãï¼CT11MPCoreç¨ï¼
+$ 
+
+$ 
+$  ã³ã¢ä¾å­ãã³ãã¬ã¼ãï¼ãããä¾å­é¨ã¯é£ã°ãï¼
+$ 
+$INCLUDE "core_check.tf"$
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel.h	(revision 302)
@@ -0,0 +1,89 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2006-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: target_kernel.h 437 2015-08-09 00:36:08Z ertl-hiro $
+ */
+
+/*
+ *		kernel.hã®ã¿ã¼ã²ããä¾å­é¨ï¼CT11MPCoreç¨ï¼
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼kernel.hããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«
+ *  ããç´æ¥ã¤ã³ã¯ã«ã¼ããããã¨ã¯ãªãï¼ãã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ããã
+ *  åã«ï¼t_stddef.hãã¤ã³ã¯ã«ã¼ããããã®ã§ï¼ããã«ä¾å­ãã¦ãããï¼
+ */
+
+#ifndef TOPPERS_TARGET_KERNEL_H
+#define TOPPERS_TARGET_KERNEL_H
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ã®ç¯å²
+ */
+#define TMIN_INTPRI		(-15)		/* å²è¾¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_INTPRI		(-1)		/* å²è¾¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼*/
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©ã®ãµãã¼ãã®å¯å¦
+ */
+#if defined(CORE0) || defined(CORE1)
+#define TOPPERS_TARGET_SUPPORT_OVRHDR
+#endif /* defined(CORE0) || defined(CORE1) */
+
+/*
+ *  ãããã§å
+±éãªå®ç¾©
+ */
+#include "chip_kernel.h"
+
+#endif /* TOPPERS_TARGET_KERNEL_H */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel_impl.c
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel_impl.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel_impl.c	(revision 302)
@@ -0,0 +1,269 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: target_kernel_impl.c 365 2015-07-26 13:18:44Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ï¼CT11MPCoreç¨ï¼
+ */
+
+#include "kernel_impl.h"
+#include <sil.h>
+#include "arm.h"
+#include "uart_pl011.h"
+
+/*
+ *  ã«ã¼ãã«åä½æã®ã¡ã¢ãªãããã¨é¢é£ããå®ç¾©
+ *
+ *  0x00000000 - 0x00100000ï¼ãã¯ã¿ã¼é åï¼1MBï¼
+ *  0x00100000 - 0x0FFFFFFFï¼DRAMï¼255MBï¼
+ *  0x10000000 - 0x100FFFFFï¼Emulation Baseboardä¸ã®ãªã½ã¼ã¹ï¼1MBï¼
+ *  0x10100000 - 0x101FFFFFï¼Private Memory Regionï¼1MBï¼(*)
+ *  0x48000000 - 0x4BFFFFFFï¼SRAMï¼4MBï¼
+ *
+ *  (*) Private Memory Regionã®å
+é ­çªå°ã¯ï¼ãã¼ãã®è¨­å®ã§å¤æ´ã§ããï¼
+ */
+
+/*
+ *  MMUã¸ã®è¨­å®å±æ§ï¼ç¬¬1ã¬ãã«ãã£ã¹ã¯ãªãã¿ï¼
+ */
+#define MMU_ATTR_RAM	(ARM_MMU_DSCR1_SHARED|ARMV6_MMU_DSCR1_APX0 \
+							|ARM_MMU_DSCR1_TEX001|ARM_MMU_DSCR1_AP11 \
+							|ARM_MMU_DSCR1_CB11)
+#define MMU_ATTR_IODEV	(ARM_MMU_DSCR1_SHARED|ARMV6_MMU_DSCR1_APX0 \
+							|ARM_MMU_DSCR1_TEX000|ARM_MMU_DSCR1_AP11 \
+							|ARM_MMU_DSCR1_CB01|ARMV6_MMU_DSCR1_NOEXEC)
+#define MMU_ATTR_VECTOR	(ARMV6_MMU_DSCR1_APX0 \
+							|ARM_MMU_DSCR1_TEX001|ARM_MMU_DSCR1_AP11 \
+							|ARM_MMU_DSCR1_CB11)
+
+/*
+ *  ã¡ã¢ãªé åã®å
+é ­çªå°ã¨ãµã¤ãº
+ */
+#define SDRAM_ADDR		0x00100000
+#define SDRAM_SIZE		0x0ff00000		/* 255MB */
+#define SDRAM_ATTR		MMU_ATTR_RAM
+
+#define SRAM_ADDR		0x48000000
+#define SRAM_SIZE		0x04000000		/* 16MB */
+#define SRAM_ATTR		MMU_ATTR_RAM
+
+/*
+ *  ããã¤ã¹ã¬ã¸ã¹ã¿é åã®å
+é ­çªå°ã¨ãµã¤ãº
+ */
+#define EB_SYS_ADDR		EB_SYS_BASE
+#define EB_SYS_SIZE		0x00100000		/* 1MB */
+#define EB_SYS_ATTR		MMU_ATTR_IODEV
+
+#define PMR_ADDR		MPCORE_PMR_BASE
+#define PMR_SIZE		0x00100000		/* 1MB */
+#define PMR_ATTR		MMU_ATTR_IODEV
+
+/*
+ *  ãã¯ã¿ãã¼ãã«ãç½®ãã¡ã¢ãªé å
+ */
+#if defined(CORE0)
+#define VECTOR_ADDR		0x01000000
+#elif defined(CORE1)
+#define VECTOR_ADDR		0x02000000
+#elif defined(CORE2)
+#define VECTOR_ADDR		0x03000000
+#elif defined(CORE3)
+#define VECTOR_ADDR		0x04000000
+#endif
+#define VECTOR_SIZE		0x00100000		/* 1MB */
+#define VECTOR_ATTR		MMU_ATTR_VECTOR
+
+/*
+ *  MMUã®è¨­å®æ
+å ±ï¼ã¡ã¢ãªã¨ãªã¢ã®æ
+å ±ï¼
+ */
+ARM_MMU_CONFIG arm_memory_area[] = {
+	{ 0x00000000, VECTOR_ADDR, VECTOR_SIZE, VECTOR_ATTR },
+	{ SRAM_ADDR, SRAM_ADDR, SRAM_SIZE, SRAM_ATTR },
+	{ EB_SYS_ADDR, EB_SYS_ADDR, EB_SYS_SIZE, EB_SYS_ATTR },
+	{ PMR_ADDR, PMR_ADDR, PMR_SIZE, PMR_ATTR },
+	{ SDRAM_ADDR, SDRAM_ADDR, SDRAM_SIZE, SDRAM_ATTR }
+};
+
+/*
+ *  MMUã®è¨­å®æ
+å ±ã®æ°ï¼ã¡ã¢ãªã¨ãªã¢ã®æ°ï¼
+ */
+const uint_t arm_tnum_memory_area
+					= sizeof(arm_memory_area) / sizeof(ARM_MMU_CONFIG);
+
+/*
+ *  UARTããã®ãã¼ãªã³ã°åºå
+ */
+static void
+ct11mpcore_uart_fput(char c)
+{
+	/*
+	 *  éä¿¡ãããã¡ãç©ºãã¾ã§ãã¼ãªã³ã°
+	 */
+	while (!(uart_pl011_putready(FPUT_UART_BASE))) ;
+
+	/*
+	 *  éä¿¡ããæå­ã®æ¸è¾¼ã¿
+	 */
+	uart_pl011_putchar(FPUT_UART_BASE, c);
+}
+
+/*
+ *  ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®ããã®æå­åºå
+ */
+void
+target_fput_log(char c)
+{
+	if (c == '\n') {
+		ct11mpcore_uart_fput('\r');
+	}
+	ct11mpcore_uart_fput(c);
+}
+
+/*
+ *  UARPããã®ãã¼ãªã³ã°åºåã®ããã®åæå
+ */
+static void
+ct11mpcore_uart_initialize(void)
+{
+	/*
+	 *  UARTããã£ã¹ã¨ã¼ãã«
+	 */
+	sil_wrw_mem(UART_CR(FPUT_UART_BASE), 0U);
+
+	/*
+	 *  ã¨ã©ã¼ãã©ã°ãã¯ãªã¢
+	 */
+    sil_wrw_mem(UART_ECR(FPUT_UART_BASE), 0U);
+
+	/*
+	 *  FIFOãç©ºã«ãã
+	 */
+	while (uart_pl011_getready(FPUT_UART_BASE)) {
+		(void) uart_pl011_getchar(FPUT_UART_BASE);
+	}
+
+	/*
+	 *  ãã¼ã¬ã¼ãã¨éä¿¡è¦æ ¼ãè¨­å®
+	 */
+	sil_wrw_mem(UART_IBRD(FPUT_UART_BASE), EB_UART_IBRD_38400);
+	sil_wrw_mem(UART_FBRD(FPUT_UART_BASE), EB_UART_FBRD_38400);
+	sil_wrw_mem(UART_LCR_H(FPUT_UART_BASE), UART_LCR_H_WLEN8);
+		
+	/*
+	 *  UARTãã¤ãã¼ãã«
+	 */
+	sil_wrw_mem(UART_CR(FPUT_UART_BASE),
+						UART_CR_UARTEN|UART_CR_TXE|UART_CR_RXE);
+}
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®åæå
+ */
+void
+target_initialize(void)
+{
+	uint32_t	reg;
+
+	/*
+	 *  ãããä¾å­ã®åæå
+	 */
+	chip_initialize();
+	
+	/*
+	 *  Emulation Baseboardã®å²è¾¼ã¿ã¢ã¼ãã®è¨­å®
+	 */
+	sil_wrw_mem(EB_SYS_LOCK, EB_SYS_LOCK_UNLOCK);	/* ã­ãã¯è§£é¤ */
+
+	reg = sil_rew_mem(EB_SYS_PLD_CTRL1);
+	reg &= ~EB_SYS_PLD_CTRL1_INTMODE_MASK;
+	reg |= EB_SYS_PLD_CTRL1_INTMODE_NEW_NODCC;
+	sil_wrw_mem(EB_SYS_PLD_CTRL1, reg);
+
+	sil_wrw_mem(EB_SYS_LOCK, EB_SYS_LOCK_LOCK);		/* ã­ãã¯ */
+	
+	/*
+	 *  UARTãåæå
+	 */
+	ct11mpcore_uart_initialize();
+}
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®çµäºå¦ç
+ */
+void
+target_exit(void)
+{
+	/*
+	 *  ãããä¾å­ã®çµäºå¦ç
+	 */
+	chip_terminate();
+
+	/*
+	 *  ã¿ã¼ã²ããä¾å­ã®çµäºå¦ç
+	 */
+#if defined(TOPPERS_USE_QEMU) && !defined(TOPPERS_OMIT_QEMU_SEMIHOSTING)
+	/*
+	 *  QEMUãçµäºãããï¼
+	 */
+	Asm("mov r0, #24\n\t"
+		"svc 0x00123456");
+#endif
+	while (true) ;
+}
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel_impl.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel_impl.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_kernel_impl.h	(revision 302)
@@ -0,0 +1,136 @@
+/*
+ *  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) 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: target_kernel_impl.h 397 2015-08-02 01:44:43Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã«é¢ããå®ç¾©ï¼CT11MPCoreç¨ï¼
+ *
+ *  ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã®ããããã¡ã¤ã«ï¼kernel_impl.hã®ã¿ã¼ã²ã
+ *  ãä¾å­é¨ã®ä½ç½®ä»ãã¨ãªãï¼
+ */
+
+#ifndef TOPPERS_TARGET_KERNEL_IMPL_H
+#define TOPPERS_TARGET_KERNEL_IMPL_H
+
+#include "ct11mpcore.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã«é¢ããè¨­å®
+ */
+#ifdef TOPPERS_ENABLE_TRACE
+#include "arch/logtrace/trace_config.h"
+#endif /* TOPPERS_ENABLE_TRACE */
+
+/*
+ *  GICä¾å­é¨ãä½¿ç¨ããããã®å®ç¾©
+ */
+#define GIC_TNUM_INTNO	DIC_TNUM_INTNO
+#define GIC_PRI_LEVEL	16
+
+/*
+ *  ããã©ã«ãã®éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é åã®å®ç¾©
+ */
+#define DEFAULT_ISTKSZ	0x2000U
+
+/*
+ *  target_fput_logã§ä½¿ç¨ããUARTã®æå®
+ */
+#if defined(CORE0)
+#define FPUT_UART_BASE	EB_UART0_BASE
+#elif defined(CORE1)
+#define FPUT_UART_BASE	EB_UART1_BASE
+#elif defined(CORE2)
+#define FPUT_UART_BASE	EB_UART2_BASE
+#elif defined(CORE3)
+#define FPUT_UART_BASE	EB_UART3_BASE
+#endif
+
+/*
+ *  å¾®å°æéå¾
+ã¡ã®ããã®å®ç¾©ï¼æ¬æ¥ã¯SILã®ã¿ã¼ã²ããä¾å­é¨ï¼
+ */
+#define SIL_DLY_TIM1	20
+#define SIL_DLY_TIM2	3
+
+/*
+ *  semihostingã®æã¯ï¼bssã»ã¯ã·ã§ã³ã¨dataã»ã¯ã·ã§ã³ã®åæåãè¡ããªãï¼
+ */
+#ifdef TOPPERS_ENABLE_SEMIHOSTING
+#define TOPPERS_OMIT_BSS_INIT
+#define TOPPERS_OMIT_DATA_INIT
+#endif /* TOPPERS_ENABLE_SEMIHOSTING */
+
+/*
+ *  ãããä¾å­é¨ï¼MPCoreç¨ï¼
+ */
+#include "chip_kernel_impl.h"
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã¿ã¼ã²ããã·ã¹ãã ä¾å­ã®åæå
+ */
+extern void	target_initialize(void);
+
+/*
+ *  ã¿ã¼ã²ããã·ã¹ãã ã®çµäº
+ *
+ *  ã·ã¹ãã ãçµäºããæã«ä½¿ãï¼
+ */
+extern void	target_exit(void) NoReturn;
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_TARGET_KERNEL_IMPL_H */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_rename.def
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_rename.def	(revision 302)
@@ -0,0 +1,21 @@
+# target_kernel_impl.c
+target_initialize
+target_exit
+
+# target_timer.c
+target_ovrtimer_initialize
+target_ovrtimer_terminate
+target_ovrtimer_start
+target_ovrtimer_stop
+target_ovrtimer_get_current
+target_ovrtimer_handler
+
+# trace_config.c
+log_dsp_enter
+log_dsp_leave
+log_inh_enter
+log_inh_leave
+log_exc_enter
+log_exc_leave
+
+INCLUDE "chip"
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_rename.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_rename.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_rename.h	(revision 302)
@@ -0,0 +1,66 @@
+/* This file is generated from target_rename.def by genrename. */
+
+#ifndef TOPPERS_TARGET_RENAME_H
+#define TOPPERS_TARGET_RENAME_H
+
+/*
+ *  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
+
+
+#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"
+
+#endif /* TOPPERS_TARGET_RENAME_H */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_serial.c
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_serial.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_serial.c	(revision 302)
@@ -0,0 +1,182 @@
+/*
+ *  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: target_serial.c 362 2015-07-26 11:29:15Z ertl-hiro $
+ */
+
+/*
+ *		ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ã¿ã¼ã²ããä¾å­é¨ï¼CT11MPCoreç¨ï¼
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "target_serial.h"
+
+/*
+ *  SIOãã©ã¤ãã®åæå
+ */
+void
+sio_initialize(intptr_t exinf)
+{
+	uart_pl011_initialize();
+}
+
+/*
+ *  SIOãã©ã¤ãã®çµäºå¦ç
+ */
+void
+sio_terminate(intptr_t exinf)
+{
+	/* ä½ãããªã */
+}
+
+/*
+ *  SIOã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+ */
+void
+sio_isr(intptr_t exinf)
+{
+	uart_pl011_isr();
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
+ */
+SIOPCB *
+sio_opn_por(ID siopid, intptr_t exinf)
+{
+	SIOPCB	*p_siopcb;
+
+	/*
+	 *  ããã¤ã¹ä¾å­ã®ãªã¼ãã³å¦ç
+	 */
+	p_siopcb = uart_pl011_opn_por(siopid, exinf);
+
+	/*
+	 *  ã·ãªã¢ã«I/Oã®å²è¾¼ã¿ãã¹ã¯ãè§£é¤ããï¼
+	 */
+	(void) ena_int(INTNO_SIO);
+	return(p_siopcb);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ã¯ã­ã¼ãº
+ */
+void
+sio_cls_por(SIOPCB *p_siopcb)
+{
+	/*
+	 *  ããã¤ã¹ä¾å­ã®ã¯ã­ã¼ãºå¦ç
+	 */
+	uart_pl011_cls_por(p_siopcb);
+
+	/*
+	 *  ã·ãªã¢ã«I/Oã®å²è¾¼ã¿ããã¹ã¯ããï¼
+	 */
+	(void) dis_int(INTNO_SIO);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã¸ã®æå­éä¿¡
+ */
+bool_t
+sio_snd_chr(SIOPCB *siopcb, char c)
+{
+	return(uart_pl011_snd_chr(siopcb, c));
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®æå­åä¿¡
+ */
+int_t
+sio_rcv_chr(SIOPCB *siopcb)
+{
+	return(uart_pl011_rcv_chr(siopcb));
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®è¨±å¯
+ */
+void
+sio_ena_cbr(SIOPCB *siopcb, uint_t cbrtn)
+{
+	uart_pl011_ena_cbr(siopcb, cbrtn);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®ç¦æ­¢
+ */
+void
+sio_dis_cbr(SIOPCB *siopcb, uint_t cbrtn)
+{
+	uart_pl011_dis_cbr(siopcb, cbrtn);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®éä¿¡å¯è½ã³ã¼ã«ããã¯
+ */
+void
+uart_pl011_irdy_snd(intptr_t exinf)
+{
+	sio_irdy_snd(exinf);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®åä¿¡éç¥ã³ã¼ã«ããã¯
+ */
+void
+uart_pl011_irdy_rcv(intptr_t exinf)
+{
+	sio_irdy_rcv(exinf);
+}
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_serial.cfg
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_serial.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_serial.cfg	(revision 302)
@@ -0,0 +1,12 @@
+/*
+ *		ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *		ã®ã¿ã¼ã²ããä¾å­é¨ï¼CT11MPCoreç¨ï¼
+ *
+ *  $Id: target_serial.cfg 362 2015-07-26 11:29:15Z ertl-hiro $
+ */
+
+#include "target_serial.h"
+ATT_INI({ TA_NULL, 0, sio_initialize });
+ATT_INI({ TA_NULL, 0, sio_terminate });
+CFG_INT(INTNO_SIO, { INTATR_SIO, INTPRI_SIO });
+CRE_ISR(ISR_SIO, { TA_NULL, 0, INTNO_SIO, sio_isr, 1 });
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_serial.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_serial.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_serial.h	(revision 302)
@@ -0,0 +1,132 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: target_serial.h 362 2015-07-26 11:29:15Z ertl-hiro $
+ */
+
+/*
+ *		ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã®ã¿ã¼ã²ããä¾å­é¨ï¼CT11MPCoreç¨ï¼
+ */
+
+#ifndef TOPPERS_TARGET_SERIAL_H
+#define TOPPERS_TARGET_SERIAL_H
+
+#include "target_syssvc.h"
+#include "uart_pl011.h"
+
+/*
+ *  SIOå²è¾¼ã¿ãç»é²ããããã®å®ç¾©
+ */
+#define INTNO_SIO		SIO_UART_IRQNO		/* UARTå²è¾¼ã¿çªå· */
+#define INTPRI_SIO		(-2)				/* UARTå²è¾¼ã¿åªå
+åº¦ */
+#define INTATR_SIO		TA_NULL				/* UARTå²è¾¼ã¿å±æ§ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  SIOãã©ã¤ãã®åæå
+ */
+extern void sio_initialize(intptr_t exinf);
+
+/*
+ *  SIOãã©ã¤ãã®çµäºå¦ç
+ */
+extern void sio_terminate(intptr_t exinf);
+
+/*
+ *  SIOã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+ */
+extern void sio_isr(intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
+ */
+extern SIOPCB *sio_opn_por(ID siopid, intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ã¯ã­ã¼ãº
+ */
+extern void sio_cls_por(SIOPCB *p_siopcb);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã¸ã®æå­éä¿¡
+ */
+extern bool_t sio_snd_chr(SIOPCB *siopcb, char c);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®æå­åä¿¡
+ */
+extern int_t sio_rcv_chr(SIOPCB *siopcb);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®è¨±å¯
+ */
+extern void sio_ena_cbr(SIOPCB *siopcb, uint_t cbrtn);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®ç¦æ­¢
+ */
+extern void sio_dis_cbr(SIOPCB *siopcb, uint_t cbrtn);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®éä¿¡å¯è½ã³ã¼ã«ããã¯
+ */
+extern void sio_irdy_snd(intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®åä¿¡éç¥ã³ã¼ã«ããã¯
+ */
+extern void sio_irdy_rcv(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_TARGET_SERIAL_H */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_sil.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_sil.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_sil.h	(revision 302)
@@ -0,0 +1,77 @@
+/*
+ *  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: target_sil.h 362 2015-07-26 11:29:15Z ertl-hiro $
+ */
+
+/*
+ *		sil.hã®ã¿ã¼ã²ããä¾å­é¨ï¼CT11MPCoreç¨ï¼
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼sil.hããã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡ã¤ã«ãã
+ *  ç´æ¥ã¤ã³ã¯ã«ã¼ããããã¨ã¯ãªãï¼ãã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ãããåã«ï¼
+ *  t_stddef.hãã¤ã³ã¯ã«ã¼ããããã®ã§ï¼ããã«ä¾å­ãã¦ãããï¼
+ */
+
+#ifndef TOPPERS_TARGET_SIL_H
+#define TOPPERS_TARGET_SIL_H
+
+/*
+ *  ãã­ã»ããµã®ã¨ã³ãã£ã¢ã³
+ */
+#define SIL_ENDIAN_LITTLE
+
+/*
+ *  ã³ã¢ã§å
+±éãªå®ç¾©ï¼ãããä¾å­é¨ã¯é£ã°ãï¼
+ */
+#include "core_sil.h"
+
+#endif /* TOPPERS_TARGET_SIL_H */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_stddef.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_stddef.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_stddef.h	(revision 302)
@@ -0,0 +1,109 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: target_stddef.h 362 2015-07-26 11:29:15Z ertl-hiro $
+ */
+
+/*
+ *		t_stddef.hã®ã¿ã¼ã²ããä¾å­é¨ï¼CT11MPCoreç¨ï¼
+ *
+ *  ãã®ããããã¡ã¤ã«ã¯ï¼t_stddef.hã®å
+é ­ã§ã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡
+ *  ã¤ã«ããã¯ç´æ¥ã¤ã³ã¯ã«ã¼ããããã¨ã¯ãªãï¼ä»ã®ããããã¡ã¤ã«ã«å
+ç«ã£
+ *  ã¦å¦çãããããï¼ä»ã®ããããã¡ã¤ã«ã«ä¾å­ãã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_TARGET_STDDEF_H
+#define TOPPERS_TARGET_STDDEF_H
+
+/*
+ *  ã¿ã¼ã²ãããè­å¥ããããã®ãã¯ã­ã®å®ç¾©
+ */
+#define TOPPERS_CT11MPCORE				/* ã·ã¹ãã ç¥ç§° */
+
+/*
+ *  éçºç°å¢ã§å
+±éãªå®ç¾©
+ *
+ *  éçºç°å¢ã§stdint.hãç¨æããã¦ããå ´åã«ã¯ï¼TOPPERS_STDINT_TYPE1ã®
+ *  ãã¯ã­å®ç¾©ãåé¤ãï¼stdint.hãã¤ã³ã¯ã«ã¼ãããã°ããï¼
+ */
+#define TOPPERS_STDINT_TYPE1
+#define TOPPERS_STDFLOAT_TYPE1
+#include "tool_stddef.h"
+
+/*
+ *  ãããã§å
+±éãªå®ç¾©
+ */
+#include "chip_stddef.h"
+
+/*
+ *  ã¢ãµã¼ã·ã§ã³ã®å¤±ææã®å®è¡ä¸­æ­å¦ç
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+Inline void
+TOPPERS_assert_abort(void)
+{
+#if defined(TOPPERS_USE_QEMU) && !defined(TOPPERS_OMIT_QEMU_SEMIHOSTING)
+	/*
+	 *  QEMUãçµäºãããï¼
+	 */
+	Asm("mov r0, #24\n\t"
+		"svc 0x00123456");
+#endif
+	while (1) ;
+}
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_TARGET_STDDEF_H */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_syssvc.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_syssvc.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_syssvc.h	(revision 302)
@@ -0,0 +1,117 @@
+/*
+ *  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: target_syssvc.h 362 2015-07-26 11:29:15Z ertl-hiro $
+ */
+
+/*
+ *  ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­é¨ï¼CT11MPCOREç¨ï¼
+ *
+ *  ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­é¨ã®ããããã¡ã¤ã«ï¼ãã®ãã¡ã¤ã«ã®
+ *  å
+å®¹ã¯ï¼ã³ã³ãã¼ãã³ãè¨è¿°ãã¡ã¤ã«ã«è¨è¿°ããï¼ãã®ãã¡ã¤ã«ã¯ç¡ããª
+ *  ãè¦è¾¼ã¿ï¼
+ */
+
+#ifndef TOPPERS_TARGET_SYSSVC_H
+#define TOPPERS_TARGET_SYSSVC_H
+
+#include "ct11mpcore.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã«é¢ããè¨­å®
+ */
+#ifdef TOPPERS_ENABLE_TRACE
+#include "arch/logtrace/trace_config.h"
+#endif /* TOPPERS_ENABLE_TRACE */
+
+/*
+ *  èµ·åã¡ãã»ã¼ã¸ã®ã¿ã¼ã²ããã·ã¹ãã å
+ */
+#define TARGET_NAME    "ARM CT11MPCore"
+
+/*
+ *  ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®ããã®æå­åºå
+ *
+ *  ã¿ã¼ã²ããä¾å­ã®æ¹æ³ã§ï¼æå­cãè¡¨ç¤º/åºå/ä¿å­ããï¼
+ */
+extern void	target_fput_log(char c);
+
+/*
+ *  ãµãã¼ãããã·ãªã¢ã«ãã¼ãã®æ°
+ */
+#define TNUM_PORT        1        
+
+/*
+ *  SIOãã©ã¤ãã§ä½¿ç¨ããUARTã«é¢ããæå®
+ */
+#if defined(CORE0)
+#define SIO_UART_BASE	EB_UART0_BASE
+#define SIO_UART_IRQNO	EB_IRQNO_UART0
+#elif defined(CORE1)
+#define SIO_UART_BASE	EB_UART1_BASE
+#define SIO_UART_IRQNO	EB_IRQNO_UART1
+#elif defined(CORE2)
+#define SIO_UART_BASE	EB_UART2_BASE
+#define SIO_UART_IRQNO	EB_IRQNO_UART2
+#elif defined(CORE3)
+#define SIO_UART_BASE	EB_UART3_BASE
+#define SIO_UART_IRQNO	EB_IRQNO_UART3
+#endif
+
+#define UART_IBRD_DEF	EB_UART_IBRD_38400
+#define UART_FBRD_DEF	EB_UART_FBRD_38400
+#define UART_LCR_H_DEF	UART_LCR_H_WLEN8
+
+#endif /* TOPPERS_TARGET_SYSSVC_H */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_test.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_test.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_test.h	(revision 302)
@@ -0,0 +1,76 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: target_test.h 362 2015-07-26 11:29:15Z ertl-hiro $
+ */
+
+/*
+ *		ãã¹ããã­ã°ã©ã ã®ã¿ã¼ã²ããä¾å­é¨ï¼CT11MPCoreç¨ï¼
+ */
+
+#ifndef TOPPERS_TARGET_TEST_H
+#define TOPPERS_TARGET_TEST_H
+
+/*
+ *  ã³ã¢ã§å
+±éãªå®ç¾©ï¼ãããä¾å­é¨ã¯é£ã°ãï¼
+ */
+#include "core_test.h"
+
+/*
+ *  ãã¹ããã­ã°ã©ã ã®åä½ãã©ã¡ã¼ã¿ã®å®ç¾©
+ */
+#ifdef TOPPERS_USE_QEMU
+#define ALM1_RELTIM		2000U		/* ã¢ã©ã¼ã ãã³ãã©1ã«ä»æããç¸å¯¾æé */
+#endif /* TOPPERS_USE_QEMU */
+
+#endif /* TOPPERS_TARGET_TEST_H */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_timer.c
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_timer.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_timer.c	(revision 302)
@@ -0,0 +1,101 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: target_timer.c 437 2015-08-09 00:36:08Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ããã©ã¤ãï¼CT11MPCoreç¨ï¼
+ */
+
+#include "kernel_impl.h"
+#ifdef TOPPERS_SUPPORT_OVRHDR
+#include "overrun.h"
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+#include "target_timer.h"
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ã
+ */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åæåå¦ç
+ */
+void
+target_ovrtimer_initialize(intptr_t exinf)
+{
+	sil_wrw_mem(SP804_CR(OVRTIMER_TIMER_BASE), SP804_DISABLE|SP804_CONFIG);
+	sil_wrw_mem(SP804_ICR(OVRTIMER_TIMER_BASE), 0U);
+}
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢å¦ç
+ */
+void
+target_ovrtimer_terminate(intptr_t exinf)
+{
+	sil_wrw_mem(SP804_CR(OVRTIMER_TIMER_BASE), SP804_DISABLE);
+	sil_wrw_mem(SP804_ICR(OVRTIMER_TIMER_BASE), 0U);
+}
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+void
+target_ovrtimer_handler(void)
+{
+	sil_wrw_mem(SP804_ICR(OVRTIMER_TIMER_BASE), 0U);
+	call_ovrhdr();					/* ãªã¼ãã©ã³ãã³ãã©ã®èµ·åå¦ç */
+}
+
+#endif /* TOPPERS_SUPPORT_OVRHDR */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_timer.cfg
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_timer.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_timer.cfg	(revision 302)
@@ -0,0 +1,22 @@
+/*
+ *		ã¿ã¤ããã©ã¤ãã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: target_timer.cfg 437 2015-08-09 00:36:08Z ertl-hiro $
+ */
+
+#include "target_timer.h"
+
+/*
+ *  ãããä¾å­é¨ï¼MPCoreç¨ï¼
+ */
+INCLUDE("chip_timer.cfg");
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ã
+ */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+ATT_INI({ TA_NULL, 0, _kernel_target_ovrtimer_initialize });
+ATT_TER({ TA_NULL, 0, _kernel_target_ovrtimer_terminate });
+CFG_INT(INTNO_OVRTIMER, { TA_ENAINT|INTATR_OVRTIMER, INTPRI_OVRTIMER });
+DEF_INH(INHNO_OVRTIMER, { TA_NULL, _kernel_target_ovrtimer_handler });
+#endif /* TOPPERS_SUPPORT_OVRHDR */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_timer.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_timer.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_timer.h	(revision 302)
@@ -0,0 +1,150 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: target_timer.h 458 2015-08-21 14:59:09Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ããã©ã¤ãï¼CT11MPCoreç¨ï¼
+ */
+
+#ifndef TOPPERS_TARGET_TIMER_H
+#define TOPPERS_TARGET_TIMER_H
+
+/*
+ *  ãããã§å
+±éãªå®ç¾©ï¼MPCoreç¨ï¼
+ */
+#include "chip_timer.h"
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ã
+ */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+
+#include "ct11mpcore.h"
+#include "sp804.h"
+#include <sil.h>
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ãã§ä½¿ç¨ããã¿ã¤ãã«é¢ããæå®
+ */
+#if defined(CORE0)
+#define OVRTIMER_TIMER_BASE		EB_TIMER0_BASE
+#define OVRTIMER_TIMER_IRQNO	EB_IRQNO_TIMER01
+#elif defined(CORE1)
+#define OVRTIMER_TIMER_BASE		EB_TIMER2_BASE
+#define OVRTIMER_TIMER_IRQNO	EB_IRQNO_TIMER23
+#endif
+
+#define SP804_CONFIG		(SP804_INT_ENABLE|SP804_MODE_ONESHOT \
+									|SP804_SIZE_32|SP804_PRESCALE_1)
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ãã³ãã©ç»é²ã®ããã®å®æ°
+ */
+#define INHNO_OVRTIMER		OVRTIMER_TIMER_IRQNO	/* å²è¾¼ã¿ãã³ãã©çªå· */
+#define INTNO_OVRTIMER		OVRTIMER_TIMER_IRQNO	/* å²è¾¼ã¿çªå· */
+#define INTPRI_OVRTIMER		(TMAX_INTPRI - 1)		/* å²è¾¼ã¿åªå
+åº¦ */
+#define INTATR_OVRTIMER		TA_NULL					/* å²è¾¼ã¿å±æ§ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åæåå¦ç
+ */
+extern void target_ovrtimer_initialize(intptr_t exinf);
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢å¦ç
+ */
+extern void target_ovrtimer_terminate(intptr_t exinf);
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§
+ */
+Inline void
+target_ovrtimer_start(PRCTIM ovrtim)
+{
+	sil_wrw_mem(SP804_LR(OVRTIMER_TIMER_BASE), (uint32_t) ovrtim);
+	sil_wrw_mem(SP804_CR(OVRTIMER_TIMER_BASE), SP804_ENABLE|SP804_CONFIG);
+}
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢
+ */
+Inline PRCTIM
+target_ovrtimer_stop(void)
+{
+	sil_wrw_mem(SP804_CR(OVRTIMER_TIMER_BASE), SP804_DISABLE|SP804_CONFIG);
+	sil_wrw_mem(SP804_ICR(OVRTIMER_TIMER_BASE), 0U);
+	return((PRCTIM) sil_rew_mem(SP804_CVR(OVRTIMER_TIMER_BASE)));
+}
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®ç¾å¨å¤ã®èª­åºã
+ */
+Inline PRCTIM
+target_ovrtimer_get_current(void)
+{
+	return((PRCTIM) sil_rew_mem(SP804_CVR(OVRTIMER_TIMER_BASE)));
+}
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+extern void	target_ovrtimer_handler(void);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+#endif /* TOPPERS_TARGET_TIMER_H */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_unrename.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_unrename.h	(revision 302)
@@ -0,0 +1,67 @@
+/* This file is generated from target_rename.def by genrename. */
+
+/* This file is included only when target_rename.h has been included. */
+#ifdef TOPPERS_TARGET_RENAME_H
+#undef TOPPERS_TARGET_RENAME_H
+
+/*
+ *  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
+
+
+#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"
+
+#endif /* TOPPERS_TARGET_RENAME_H */
Index: asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_user.txt
===================================================================
--- asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_user.txt	(revision 302)
+++ asp3_wo_tecs/trunk/target/ct11mpcore_gcc/target_user.txt	(revision 302)
@@ -0,0 +1,351 @@
+
+		TOPPERS/ASPã«ã¼ãã«
+		CT11MPcoreä¾å­é¨ ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«
+
+		å¯¾å¿ãã¼ã¸ã§ã³: Release 3.0.0
+		æçµæ´æ°: 2015å¹´8æ9æ¥
+
+ãã®ãã­ã¥ã¡ã³ãã¯ï¼TOPPERS/ASPã«ã¼ãã«ã®CT11MPcoreã¿ã¼ã²ããä¾å­é¨ãä½¿
+ç¨ããããã«å¿
+è¦ãªäºé 
+ãèª¬æãããã®ã§ããï¼
+
+----------------------------------------------------------------------
+ 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: target_user.txt 437 2015-08-09 00:36:08Z ertl-hiro $
+----------------------------------------------------------------------
+
+âç®æ¬¡
+
+ï¼ï¼CT11MPcoreã¿ã¼ã²ããä¾å­é¨ã®æ¦è¦
+	1.1 å¯¾å¿ããã¿ã¼ã²ããã·ã¹ãã ã¨ã¿ã¼ã²ããç¥ç§°
+	1.2 ã¿ã¼ã²ããä¾å­é¨ã®æ§æ
+	1.3 ä¾å­ãã¦ããåå¥ããã±ã¼ã¸ã®ãã¼ã¸ã§ã³çªå·
+	1.4 éçºç°å¢ã¨åä½ç¢ºèªæ¡ä»¶
+	1.5 ã¡ã¢ãªããã
+ï¼ï¼ã¿ã¼ã²ããå®ç¾©äºé 
+ã®è¦å®
+	2.1 å²è¾¼ã¿åªå
+åº¦ã¨å²è¾¼ã¿çªå·
+	2.2 ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µã®ãµãã¼ãã«é¢ããè¦å®
+ï¼ï¼ãã©ã¤ãé¢é£ã®æ
+å ±
+	3.1 ã¿ã¤ããã©ã¤ã
+	3.2 ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ã
+	3.3 ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºå
+ï¼ï¼ã·ã¹ãã æ§ç¯æé ã¨å®è¡æé 
+	4.1 ã·ã¹ãã æ§ç¯
+	4.2 ãããã¬ã®ä½¿ç¨æ¹æ³
+ï¼ï¼ãªãã¡ã¬ã³ã¹
+	5.1 ãã£ã¬ã¯ããªæ§æã»ãã¡ã¤ã«æ§æ
+	5.2 ãã¼ã¸ã§ã³å±¥æ­´
+
+
+ï¼ï¼CT11MPcoreã¿ã¼ã²ããä¾å­é¨ã®æ¦è¦
+
+CT11MPcoreã¿ã¼ã²ããä¾å­é¨ã¯ï¼TOPPERS/ASPã«ã¼ãã«ãï¼ARM11 MPCoreã®ãã¹
+ãããããæ­è¼ããCoreTileï¼CT11MPCoreï¼ãï¼RealView Emulation
+Baseboardä¸ã«å®è£
+ããã¿ã¼ã²ããã·ã¹ãã ã§åä½ãããç°å¢ãæ§ç¯ããããã®
+ãã®ã§ããï¼
+
+ã¾ãï¼å®ã¿ã¼ã²ããã·ã¹ãã ã«ä»£ãã¦ï¼Qemuãç¨ãã¦å®è¡ãããã¨ãã§ããï¼
+Qemuã§å®è¡ããå ´åã«ã¯ï¼ã³ã³ãã¤ã«ãªãã·ã§ã³ã«ã-DTOPPERS_USE_QEMUãã
+è¿½å ããå¿
+è¦ãããï¼
+
+1.1 å¯¾å¿ããã¿ã¼ã²ããã·ã¹ãã ã¨ã¿ã¼ã²ããç¥ç§°
+
+CT11MPcoreã¿ã¼ã²ããä¾å­é¨ã®åä½ç¢ºèªã¯ï¼Qemuãç¨ãã¦è¡ã£ã¦ããï¼åä½ç¢º
+èªãè¡ã£ãQemuã®ãã¼ã¸ã§ã³ã¯æ¬¡ã®éãï¼
+
+	qemu-system-arm		version 2.1.0
+
+Qemuä¸ã§ASPã«ã¼ãã«ãå®è¡ããããã®ã³ãã³ãã¯æ¬¡ã®éãï¼
+
+	qemu-system-arm -M realview-eb-mpcore -semihosting -m 128M -smp 1 \
+											-serial stdio -kernel asp
+
+ã¾ãï¼ã¿ã¼ã²ããç¥ç§°ç­ã¯æ¬¡ã®éãï¼
+
+	ã¿ã¼ã²ããç¥ç§°ï¼ct11mpcore_gcc
+	ã·ã¹ãã ç¥ç§°ï¼ct11mpcore
+	éçºç°å¢ç¥ç§°ï¼gcc
+
+1.2 ã¿ã¼ã²ããä¾å­é¨ã®æ§æ
+
+CT11MPcoreã¿ã¼ã²ããä¾å­é¨ã®ä½¿ç¨ããã¿ã¼ã²ããä¾å­é¨ï¼targetãã£ã¬ã¯ã
+ãªï¼ããã³ã¿ã¼ã²ããä¾å­é¨ã®å
+±éé¨ï¼archãã£ã¬ã¯ããªï¼ã®ãã£ã¬ã¯ããªã¯
+æ¬¡ã®éãï¼
+
+	target/
+		ct11mpcore_gcc/		CT11MPcoreã¿ã¼ã²ããä¾å­é¨
+
+	arch/
+		arm_gcc/common/		ARMã³ã¢ä¾å­é¨
+		arm_gcc/mpcore/		MPCoreãããä¾å­é¨
+		gcc/				GCCéçºç°å¢ä¾å­é¨
+		logtrace/			ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ã
+
+1.3 ä¾å­ãã¦ããåå¥ããã±ã¼ã¸ã®ãã¼ã¸ã§ã³çªå·
+
+Mac OS Xã¿ã¼ã²ããä¾å­é¨ï¼ãã¼ã¸ã§ã³ 3.B.0ï¼ã®åå¥ããã±ã¼ã¸ãä¾å­ãã¦
+ããåå¥ããã±ã¼ã¸ã¨ï¼åä½ç¢ºèªãè¡ã£ããã¼ã¸ã§ã³ã¯æ¬¡ã®éãï¼
+
+	åå¥ããã±ã¼ã¸ã®åç§°	ãã¼ã¸ã§ã³	åå¥ããã±ã¼ã¸ãã¡ã¤ã«å
+	------------------------------------------------------------------
+	ã¿ã¼ã²ããéä¾å­é¨		3.0.0		asp3-3.0.0.tar.gz
+
+1.4 éçºç°å¢ã¨åä½ç¢ºèªæ¡ä»¶
+
+éçºç°å¢ã¨ãã¦ï¼ä»¥ä¸ã®URLããããªãã«ãçããã¦ã³ã­ã¼ããããã¨ãã§ãã
+GCC ARM Embeddedãç¨ããï¼
+
+	https://launchpad.net/gcc-arm-embedded/
+
+åä½ç¢ºèªãè¡ã£ããã¼ã¸ã§ã³ã¯æ¬¡ã®éãï¼
+
+	gcc: version 4.8.3 20140228
+	gdb: 7.6.0.20140228-cvs
+	binutilsï¼objcopyï¼objdumpï¼ï¼2.23.2.20140228
+
+1.5 ã¡ã¢ãªããã
+
+ä»¥ä¸ã®ã¡ã¢ãªããããæ³å®ãã¦ããï¼Qemuã®å ´åï¼ï¼
+
+	0x00000000 - 0x00100000ï¼ãã¯ã¿ã¼é åï¼1MBï¼
+	0x00100000 - 0x0FFFFFFFï¼DRAMï¼255MBï¼
+	0x10000000 - 0x100FFFFFï¼Emulation Baseboardä¸ã®ãªã½ã¼ã¹ï¼1MBï¼
+	0x10100000 - 0x101FFFFFï¼Private Memory Regionï¼1MBï¼
+	0x48000000 - 0x4BFFFFFFï¼SRAMï¼4MBï¼
+
+MPCoreã®Private Memory Regionã®å
+é ­çªå°ã¯ï¼ã³ã¢å¤é¨ããè¨­å®å¯è½ã¨ãªã£ã¦
+ããï¼QEMUã§ã¯ï¼ãã®é åã®å
+é ­çªå°ã¯ï¼0x10100000ã«è¨­å®ããã¦ããï¼å®é
+ã®ã¿ã¼ã²ããã·ã¹ãã ã§ã¯ï¼ãã¼ãä¸ã§è¨­å®ã§ããããã«ãªã£ã¦ããï¼ããã©
+ã«ãã§ã¯0x1f000000ã«è¨­å®ããã¦ããï¼
+
+ã¡ã¢ãªããããå¤æ´ããå ´åã«ã¯ï¼Makefile.targetã¨target_kernel_impl.cã
+ä¿®æ­£ããå¿
+è¦ãããï¼
+
+
+ï¼ï¼ã¿ã¼ã²ããå®ç¾©äºé 
+ã®è¦å®
+
+CT11MPcoreã¿ã¼ã²ããä¾å­é¨ã¯ï¼ARMã³ã¢ä¾å­é¨ã¨MPCoreãããä¾å­é¨ãç¨ãã¦
+å®è£
+ããã¦ããï¼ããã§ã¯ï¼ARMã³ã¢ä¾å­é¨ããã³MPCoreãããä¾å­é¨ã¨ç°ãªãï¼
+ãªããã¯ï¼ãããã§è¦å®ããã¦ããªãäºé 
+ã«ã¤ãã¦èª¬æããï¼
+
+2.1 å²è¾¼ã¿åªå
+åº¦ã¨å²è¾¼ã¿çªå·
+
+CT11MPCoreã®å²è¾¼ã¿ã³ã³ãã­ã¼ã©ï¼Distributed Interrupt COntrollerï¼ã¯ï¼
+16ã¬ãã«ã®å²è¾¼ã¿åªå
+åº¦ããµãã¼ããã¦ããï¼ãã®ããï¼å²è¾¼ã¿åªå
+åº¦ã®æå°
+å¤ï¼æé«å¤ï¼ã¯-15ï¼å²è¾¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼ã¯-1ã§ããï¼
+
+CT11MPCoreã®å²è¾¼ã¿ã³ã³ãã­ã¼ã©ããµãã¼ãããå²è¾¼ã¿ã¨ï¼ãã®å²è¾¼ã¿çªå·ã¯
+æ¬¡ã®éãï¼
+
+	ãã­ã»ããµéå²è¾¼ã¿			0ã15
+	ãã©ã¤ãã¼ãå²è¾¼ã¿			16ã31
+		ãã©ã¤ãã¼ãã¿ã¤ã			29
+		ãã©ã¤ãã¼ãã¦ã©ããããã°	30
+		ã¬ã¬ã·ã¼nIRQ				31
+	ãã¼ãã¦ã§ã¢å²è¾¼ã¿			32ã63
+	  ãããå¤ããã®å²è¾¼ã¿		  32ã47
+		ACCI						32
+		EB_TIMER0/1					33
+		EB_TIMER2/3					34
+		USB							35
+		EB_UART0					36
+		EB_UART1					37
+		â¦ä¸­ç¥â¦
+		EB_GIC1_nIRQ				42
+		EB_GIC2_nIRQ				43
+		EB_GIC1_nFIQ				44
+		EB_GIC2_nFIQ				45
+		â¦ä¸­ç¥â¦
+	  ãããå
+ã®å²è¾¼ã¿		  48ã63
+
+2.2 ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µã®ãµãã¼ãã«é¢ããè¦å®
+
+ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸ããµãã¼ããã¦ããï¼ãã ãï¼ã³ã¢2ã¨
+ã³ã¢3ã«å¯¾ãã¦ãµãã¼ããã¦ããªãï¼ï¼
+
+
+ï¼ï¼ãã©ã¤ãé¢é£ã®æ
+å ±
+
+3.1 ã¿ã¤ããã©ã¤ã
+
+é«åè§£è½ã¿ã¤ãã¯ï¼MPCoreãã³ã¢æ¯ã«æã¤ã¿ã¤ãã¨ã¦ã©ããããã°ãä½¿ç¨ãã¦
+å®ç¾ãã¦ããï¼å
+·ä½çã«ã¯ï¼ã¦ã©ããããã°ãç¾å¨æå»ã®ç®¡çã®ããã«ç¨ãï¼
+ã¿ã¤ããç¸å¯¾æéå²è¾¼ã¿ã®çºçã®ããã«ç¨ãã¦ããï¼ãã®ããï¼ãããã®ã¿ã¤
+ããå¥ã®ç®çã§ä½¿ç¨ãããã¨ã¯ã§ããªãï¼
+
+ã¾ãï¼ãªã¼ãã©ã³ãã³ãã©æ©è½ããµãã¼ãããå ´åã«ã¯ï¼RealView Emulation
+Baseboardä¸ã®FPGAã«å®è£
+ããã¦ããã¿ã¤ãã®å
+ã®1ã¤ï¼ã©ã®1ã¤ãç¨ãããã¯ï¼
+ã³ã¢æ¯ã«ç°ãªãï¼ãç¨ãã¦ããï¼
+
+3.2 ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ã
+
+ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã§ã¯ï¼RealView Emulation Baseboardä¸ã®
+FPGAã«å®è£
+ããã¦ãã4ãã£ã³ãã«ã®UARTã®å
+ã®1ã¤ï¼ã©ã®1ã¤ãç¨ãããã¯ï¼ã³
+ã¢æ¯ã«ç°ãªãï¼ãç¨ãã¦ï¼ã·ãªã¢ã«I/Oãã¼ãã1ã¤ã®ã¿ãµãã¼ããã¦ããï¼
+
+ç¨ããUARTãå¤æ´ããå ´åã«ã¯ï¼target_syssvc.hãä¿®æ­£ããå¿
+è¦ãããï¼
+
+3.3 ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºå
+
+ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã¯ï¼ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ããç¨ãã¦ã
+ãã®ã¨åãUARTãç¨ãï¼ãã¼ãªã³ã°ã«ããæå­ãåºåããæ¹æ³ã§å®ç¾ãã¦ããï¼
+
+ç¨ããUARTãå¤æ´ããå ´åã«ã¯ï¼target_kernel_impl.hãä¿®æ­£ããå¿
+è¦ãããï¼
+
+
+ï¼ï¼ã·ã¹ãã æ§ç¯æé ã¨å®è¡æé 
+
+4.1 ã·ã¹ãã æ§ç¯
+
+CT11MPcoreåãã®æ§ç¯ããæé ã¯ï¼ãTOPPERS/ASPã«ã¼ãã« ã¦ã¼ã¶ã¼ãºããã¥
+ã¢ã«ãã®ãï¼ï¼ã¯ã¤ãã¯ã¹ã¿ã¼ãã¬ã¤ããã®ç« ã«è¨è¿°ããã¦ããéãã§ããï¼
+Qemuã§å®è¡ããå ´åã«ã¯ï¼ã³ã³ãã¤ã«ãªãã·ã§ã³ã«ã-DTOPPERS_USE_QEMUãã
+è¿½å ãããã¨ï¼
+
+4.2 Qemuã§å®è¡ããå ´åã®ãããã¬ã®ä½¿ç¨æ¹æ³
+
+Qemuã§å®è¡ããå ´åï¼GDBãããã¬ãç¨ãã¦å®è¡ãããã¨ãã§ããï¼ã¾ãï¼
+Qemuãå®è¡ããéã«ï¼ãªãã·ã§ã³ã-S -gdb tcp::1234ããä»ããï¼å
+·ä½çã«ã¯ï¼
+æ¬¡ã®ã³ãã³ãã«ããå®è¡ããï¼
+
+	qemu-system-arm -M realview-eb-mpcore -semihosting -m 128M -smp 1 \
+							-serial stdio -S -gdb tcp::1234 -kernel asp
+
+Qemuãå®è¡ããã®ã¨ã¯å¥ã®ã¦ã£ã³ãã¦ã§ï¼GDBãèµ·åããï¼
+
+	% arm-none-eabi-gdb asp
+	<GDBã®èµ·åã¡ãã»ã¼ã¸>
+	(gdb) target remote localhost:1234
+	(gdb) 
+
+ããã§ï¼ãtarget remote localhost:1234ãã¯ï¼TCPãç¨ãã¦Qemuã¨GDBãæ¥ç¶
+ããããã®ã³ãã³ãã§ããï¼ãã®ã³ãã³ããï¼.gdbinitã«è¨­å®ãã¦ããã¨ä¾¿å©
+ã§ããï¼
+
+ã¾ãï¼æ¡ä»¶ä»ããã¬ã¼ã¯ãã¤ã³ããä½¿ãã¨ï¼ç¹å®ã®ã¿ã¹ã¯ãç¹å®ã®ã¢ãã¬ã¹ã
+å®è¡ããå ´åã«ã®ã¿å®è¡ãåæ­¢ããããã¨ãã§ããï¼ãã ãï¼ãã¬ã¼ã¯æ¡ä»¶ã
+è¨è¿°ããã«ã¯ï¼ã«ã¼ãã«ã®å
+é¨æ§é ãç¥ã£ã¦ãããã¨ãå¿
+è¦ã§ããï¼
+
+
+ï¼ï¼ãªãã¡ã¬ã³ã¹
+
+5.1 ãã£ã¬ã¯ããªæ§æã»ãã¡ã¤ã«æ§æ
+
+	target/macosx_xcode/
+		E_PACKAGE				ç°¡æããã±ã¼ã¸ã®ãã¡ã¤ã«ãªã¹ã
+		MANIFEST				åå¥ããã±ã¼ã¸ã®ãã¡ã¤ã«ãªã¹ã
+		Makefile.target			Makefileã®ã¿ã¼ã²ããä¾å­é¨
+		ct11mpcore.h			ã¿ã¼ã²ããã®ãã¼ãã¦ã§ã¢è³æºã®å®ç¾©
+		ct11mpcore.ld			æ¨æºã®ãªã³ã«ã¹ã¯ãªãã
+		target.tf				kernel.tfã®ã¿ã¼ã²ããä¾å­é¨
+		target_cfg1_out.h		cfg1_out.cã®ãªã³ã¯ã«å¿
+è¦ãªã¹ã¿ãã®å®ç¾©
+		target_check.tf			kernel_check.tfã®ã¿ã¼ã²ããä¾å­é¨
+		target_kernel.h			kernel.hã®ã¿ã¼ã²ããä¾å­é¨
+		target_kernel_impl.c	ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨é¢é£ã®å®ç¾©
+		target_kernel_impl.h	ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨
+		target_rename.def		ã¿ã¼ã²ããä¾å­é¨ã®å
+é¨è­å¥åã®ãªãã¼ã å®ç¾©
+		target_rename.h			ã¿ã¼ã²ããä¾å­é¨ã®å
+é¨è­å¥åã®ãªãã¼ã 
+		target_serial.c			serial.cã®ã¿ã¼ã²ããä¾å­é¨
+		target_serial.cfg		serial.cfgã®ã¿ã¼ã²ããä¾å­é¨
+		target_serial.h			serial.hã®ã¿ã¼ã²ããä¾å­é¨
+		target_sil.h			sil.hã®ã¿ã¼ã²ããä¾å­é¨
+		target_stddef.h			t_stddef.hã®ã¿ã¼ã²ããä¾å­é¨
+		target_syssvc.h			ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­å®ç¾©
+		target_test.h			ãã¹ããã­ã°ã©ã ã®ã¿ã¼ã²ããä¾å­å®ç¾©
+		target_timer.cfg		ã¿ã¤ããã©ã¤ãã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+		target_timer.h			ã¿ã¤ããã©ã¤ããä½¿ç¨ããããã®å®ç¾©
+		target_unrename.h		ã¿ã¼ã²ããä¾å­é¨ã®å
+é¨è­å¥åã®ãªãã¼ã è§£é¤
+		target_user.txt			ã¿ã¼ã²ããä¾å­é¨ã®ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«
+
+6.2 ãã¼ã¸ã§ã³å±¥æ­´
+
+	2015å¹´8æ5æ¥	Release	3.B.0		æåã®ãªãªã¼ã¹
+	2015å¹´ æ æ¥	Release	3.0.0		æåã®ä¸è¬å
+¬é
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/target/dummy_gcc/MANIFEST
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/MANIFEST	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/MANIFEST	(revision 302)
@@ -0,0 +1,26 @@
+PACKAGE asp3
+
+MANIFEST
+Makefile.target
+dummy.h
+target.tf
+target_cfg1_out.h
+target_check.tf
+target_def.csv
+target_kernel.h
+target_kernel_impl.c
+target_kernel_impl.h
+target_offset.tf
+target_rename.def
+target_rename.h
+target_serial.c
+target_serial.cfg
+target_serial.h
+target_sil.h
+target_stddef.h
+target_syssvc.h
+target_test.h
+target_timer.c
+target_timer.cfg
+target_timer.h
+target_unrename.h
Index: asp3_wo_tecs/trunk/target/dummy_gcc/Makefile.target
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/Makefile.target	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/Makefile.target	(revision 302)
@@ -0,0 +1,53 @@
+#
+#		Makefile ã®ã¿ã¼ã²ããä¾å­é¨ï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+#
+#  $Id: Makefile.target 504 2016-01-12 01:19:55Z ertl-hiro $
+# 
+
+#
+#  ã·ã¹ãã åï¼éçºç°å¢åã®å®ç¾©
+#
+SYS = dummy
+TOOL = gcc
+
+#
+#  ãã¼ã«ä¾å­é¨ãã£ã¬ã¯ããªåã®å®ç¾© 
+#
+TOOLDIR = $(SRCDIR)/arch/$(TOOL)
+
+#
+#  GNUéçºç°å¢ã®ã¿ã¼ã²ããã¢ã¼ã­ãã¯ãã£ã®å®ç¾©
+#
+#  ããã¼ã¿ã¼ã²ããç¨ã§ããããï¼å®ç¾©ããªãï¼
+#
+#GCC_TARGET =
+
+#
+#  ã³ã³ãã¤ã«ãªãã·ã§ã³
+#
+INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(TOOLDIR)
+
+#
+#  ã«ã¼ãã«ã«é¢ããå®ç¾©
+#
+KERNEL_DIRS := $(KERNEL_DIRS) $(TARGETDIR)
+KERNEL_COBJS := $(KERNEL_COBJS) target_kernel_impl.o target_timer.o
+
+#
+#  ã·ã¹ãã ãµã¼ãã¹ã«é¢ããå®ç¾©
+#
+SYSSVC_COBJS := $(SYSSVC_COBJS) target_serial.o
+
+#
+#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
+#
+CFG_TABS := $(CFG_TABS) --cfg1-def-table $(TARGETDIR)/target_def.csv
+
+#
+#  ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ãã«é¢ããå®ç¾©
+#
+ifdef ENABLE_TRACE
+	COPTS := $(COPTS) -DTOPPERS_ENABLE_TRACE
+	KERNEL_DIRS := $(KERNEL_DIRS) $(SRCDIR)/arch/logtrace
+	KERNEL_COBJS := $(KERNEL_COBJS) trace_config.o trace_dump.o
+endif
Index: asp3_wo_tecs/trunk/target/dummy_gcc/dummy.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/dummy.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/dummy.h	(revision 302)
@@ -0,0 +1,70 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2013-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: dummy.h 238 2014-09-28 19:19:25Z ertl-hiro $
+ */
+
+/*
+ *		ããã¼ã¿ã¼ã²ããã®ãã¼ãã¦ã§ã¢è³æºã®å®ç¾©
+ */
+
+#ifndef TOPPERS_DUMMY_H
+#define TOPPERS_DUMMY_H
+
+/*
+ *  å²è¾¼ã¿çªå·ï¼intnoï¼ã®å®ç¾©
+ */
+#define TINTNO_HRT		0		/* é«åè§£è½ã¿ã¤ã */
+#define TINTNO_OVRTIMER	1		/* ãªã¼ãã©ã³ã¿ã¤ã */
+#define TINTNO_SIO		2		/* ã·ãªã¢ã«I/Oãã¼ã */
+
+#endif /* TOPPERS_DUMMY_H */
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target.tf
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target.tf	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target.tf	(revision 302)
@@ -0,0 +1,21 @@
+$ 
+$ 		ãã¹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_cfg1_out.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_cfg1_out.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_cfg1_out.h	(revision 302)
@@ -0,0 +1,20 @@
+/*
+ *		cfg1_out.cã®ãªã³ã¯ã«å¿
+è¦ãªã¹ã¿ãã®å®ç¾©
+ *
+ *  $Id: target_cfg1_out.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+#include <t_stddef.h>
+
+int main()
+{
+	return(0);
+}
+
+/*
+ *  offset.hãçæããããã®å®ç¾©
+ */
+const uint8_t	MAGIC_1 = 0x12;
+const uint16_t	MAGIC_2 = 0x1234;
+const uint32_t	MAGIC_4 = 0x12345678;
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_check.tf
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_check.tf	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_check.tf	(revision 302)
@@ -0,0 +1,10 @@
+$ 
+$ 		ãã¹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_def.csv
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_def.csv	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_def.csv	(revision 302)
@@ -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_kernel.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel.h	(revision 302)
@@ -0,0 +1,96 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2013-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: target_kernel.h 231 2014-09-28 07:54:17Z ertl-hiro $
+ */
+
+/*
+ *		kernel.hã®ã¿ã¼ã²ããä¾å­é¨ï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼kernel.hã§ã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡
+ *  ã¤ã«ããç´æ¥ã¤ã³ã¯ã«ã¼ããããã¨ã¯ãªãï¼ãã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ã
+ *  ããåã«ï¼t_stddef.hãã¤ã³ã¯ã«ã¼ããããã®ã§ï¼ãããã«ä¾å­ãã¦ãã
+ *  ãï¼
+ */
+
+#ifndef TOPPERS_TARGET_KERNEL_H
+#define TOPPERS_TARGET_KERNEL_H
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨ã§ãµãã¼ãã§ããæ©è½
+ */
+#define TOPPERS_TARGET_SUPPORT_DIS_INT		/* dis_int */
+#define TOPPERS_TARGET_SUPPORT_ENA_INT		/* ena_int */
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æ
+ *
+ *  ã¿ã¤ãå¨æã2^32ã®å ´åã«ã¯ï¼ãã®ãã¯ã­ãå®ç¾©ããªãï¼
+ */
+#undef TCYC_HRTCNT
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã®é²ã¿å¹
+
+ */
+#define TSTEP_HRTCNT	1U
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ã®ç¯å²
+ */
+#define TMIN_INTPRI		(-7)		/* å²è¾¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#define TMAX_INTPRI		(-1)		/* å²è¾¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼ */
+
+#endif /* TOPPERS_TARGET_KERNEL_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 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel_impl.c	(revision 302)
@@ -0,0 +1,228 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2013-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: target_kernel_impl.c 374 2015-07-30 22:01:54Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¼ã²ããä¾å­ã¢ã¸ã¥ã¼ã«ï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+ */
+
+#include "kernel_impl.h"
+#include "task.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_DSP_ENTER
+#define LOG_DSP_ENTER(p_tcb)
+#endif /* LOG_DSP_ENTER */
+
+#ifndef LOG_DSP_LEAVE
+#define LOG_DSP_LEAVE(p_tcb)
+#endif /* LOG_DSP_LEAVE */
+
+/*
+ *  ãã£ã¹ãããã£æ¬ä½
+ */
+static void
+dispatcher(void)
+{
+	LOG_DSP_ENTER(p_runtsk);
+
+/* dispatcher_0: */
+	p_runtsk = p_schedtsk;
+	if (p_runtsk != NULL) {
+		/* èªã¿ã¹ã¯ï¼p_runtskï¼ã®TCBããã¹ã¿ãã¯ãã¤ã³ã¿ãå¾©å¸°ãã */
+		LOG_DSP_LEAVE(p_runtsk);
+		/* èªã¿ã¹ã¯ã®TCBããå®è¡åéçªå°ãå¾©å¸°ãï¼ããã¸åå²ãã */
+	}
+
+	/*
+	 *  ã¢ã¤ãã«å¦ç
+	 */
+	/* å²è¾¼ã¿ãè¨±å¯ãããCPUã­ãã¯è§£é¤ç¶æ
+ã«ãªãããæºåãã */
+	/* å²è¾¼ã¿ããã¹ã¦è¨±å¯ãã */
+	while (true) {
+		/* å²è¾¼ã¿çºçãå¾
+ã¤ */
+	}
+}
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã¸ã®ãã£ã¹ããã
+ */
+void
+dispatch(void)
+{
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	ovrtimer_stop();					/* ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	/* ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ã«ä¿å­ãã */
+	/* ã¹ã¿ãã¯ãã¤ã³ã¿ãèªã¿ã¹ã¯ï¼p_runtskï¼ã®TCBã«ä¿å­ãã */
+	/* dispatch_rãï¼å®è¡åéçªå°ã¨ãã¦èªã¿ã¹ã¯ã®TCBã«ä¿å­ãã */
+	dispatcher();	/* ã³ã³ãã¤ã©ã®è­¦åææ­¢ã®ããï¼ããããã¯å¼ã¶ */
+
+/* dispatch_r: */
+	/* ã¹ã¯ã©ããã¬ã¸ã¹ã¿ãé¤ããã¹ã¦ã®ã¬ã¸ã¹ã¿ãã¹ã¿ãã¯ããå¾©å¸°ãã */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	ovrtimer_start();					/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+}
+
+/*
+ *  ãã£ã¹ãããã£ã®åä½éå§
+ */
+void
+start_dispatch(void)
+{
+	/* ã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã */
+	/* ã¹ã¿ãã¯ãIDã1ã®ã¿ã¹ã¯ã®ã¹ã¿ãã¯é åã«åãæãã */
+	/* CPUã­ãã¯ç¶æ
+ã»å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã«ãã */
+	/* dispatcher_0ã«åå²ãã */
+}
+
+/*
+ *  ç¾å¨ã®ã³ã³ãã­ã¹ããæ¨ã¦ã¦ãã£ã¹ããã
+ */
+void
+exit_and_dispatch(void)
+{
+	/* dispatcherã«åå²ãã */
+}
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©åºå
+¥å£å¦ç
+ */
+void
+int_handler_entry(void)
+{
+}
+
+/*
+ *  CPUä¾å¤ãã³ãã©åºå
+¥å£å¦ç
+ */
+void
+exc_handler_entry(void)
+{
+}
+
+/*
+ *  ã«ã¼ãã«ã®çµäºå¦çã®å¼åºã
+ */
+void
+call_exit_kernel(void)
+{
+	/* éã¿ã¹ã¯ã³ã³ãã­ã¹ãã«åãæãã */
+	/* exit_kernelã«åå²ãã */
+	while (true);
+}
+
+/*
+ *  ã¿ã¹ã¯éå§æå¦ç
+ */
+void
+start_r(void)
+{
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	ovrtimer_start();					/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	/* CPUã­ãã¯è§£é¤ç¶æ
+ã«ãã */
+	/* èªã¿ã¹ã¯ï¼p_runtskï¼ã®èµ·åçªå°ãï¼æ¡å¼µæ
+å ±ããã©ã¡ã¼ã¿ã¨ãã¦å¼ã³åºã */
+	/* ext_tskã«åå²ãã */
+}
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®åæå
+ */
+void
+target_initialize(void)
+{
+}
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®çµäºå¦ç
+ */
+void
+target_exit(void)
+{
+	exit(0);
+}
+
+/*
+ *  ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®ããã®æå­åºå
+ */
+void
+target_fput_log(char c)
+{
+	/* æå­cãè¡¨ç¤º/åºå/ä¿å­ãã */
+}
+
+/*
+ *  ã¡ã¤ã³é¢æ°
+ */
+int
+main()
+{
+	sta_ker();
+	return(0);
+}
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel_impl.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel_impl.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_kernel_impl.h	(revision 302)
@@ -0,0 +1,406 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2013-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: target_kernel_impl.h 471 2015-12-30 10:03:16Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+ *
+ *  ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã®ããããã¡ã¤ã«ï¼kernel_impl.hã®ã¿ã¼ã²ã
+ *  ãä¾å­é¨ã®ä½ç½®ä»ãã¨ãªãï¼
+ */
+
+#ifndef TOPPERS_TARGET_KERNEL_IMPL_H
+#define TOPPERS_TARGET_KERNEL_IMPL_H
+
+#include <kernel.h>
+#ifndef TOPPERS_MACRO_ONLY
+#ifdef TOPPERS_SUPPORT_OVRHDR
+#include "overrun.h"
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ã¿ã¼ã²ããã·ã¹ãã ã®ãã¼ãã¦ã§ã¢è³æºã®å®ç¾©
+ */
+#include "dummy.h"
+
+/*
+ *  ã¨ã©ã¼ãã§ãã¯æ¹æ³ã®æå®
+ */
+#define CHECK_STKSZ_ALIGN	4	/* ã¹ã¿ãã¯ãµã¤ãºã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_INTPTR_ALIGN	4	/* intptr_tåã®å¤æ°ã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_INTPTR_NONNULL	/* intptr_tåã®å¤æ°ã®éNULLãã§ãã¯ */
+#define CHECK_FUNC_ALIGN	4	/* é¢æ°ã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_FUNC_NONNULL		/* é¢æ°ã®éNULLãã§ãã¯ */
+#define CHECK_STACK_ALIGN	4	/* ã¹ã¿ãã¯é åã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_STACK_NONNULL		/* ã¹ã¿ãã¯é åã®éNULLãã§ãã¯ */
+#define CHECK_MPF_ALIGN		4	/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_MPF_NONNULL		/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®éNULLãã§ãã¯ */
+#define CHECK_MB_ALIGN		4	/* ç®¡çé åã®ã¢ã©ã¤ã³åä½ */
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã«é¢ããè¨­å®
+ */
+#ifdef TOPPERS_ENABLE_TRACE
+#include "arch/logtrace/trace_config.h"
+#endif /* TOPPERS_ENABLE_TRACE */
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_INH_ENTER
+#define LOG_INH_ENTER(inhno)
+#endif /* LOG_INH_ENTER */
+
+#ifndef LOG_INH_LEAVE
+#define LOG_INH_LEAVE(inhno)
+#endif /* LOG_INH_LEAVE */
+
+#ifndef LOG_EXC_ENTER
+#define LOG_EXC_ENTER(excno)
+#endif /* LOG_EXC_ENTER */
+
+#ifndef LOG_EXC_LEAVE
+#define LOG_EXC_LEAVE(excno)
+#endif /* LOG_EXC_LEAVE */
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã¹ã¿ãã¯ã®ããã©ã«ãã®ãµã¤ãº
+ */
+#define DEFAULT_ISTKSZ			4096
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ã®å®ç¾©
+ */
+typedef struct task_context_block {
+	void		*sp;			/* ã¹ã¿ãã¯ãã¤ã³ã¿ */
+	void		*pc;			/* å®è¡åéçªå° */
+} TSKCTXB;
+
+/*
+ *  ã³ã³ãã­ã¹ãã®åç
+§
+ */
+Inline bool_t
+sense_context(void)
+{
+	return(false);
+}
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã¸ã®é·ç§»
+ */
+Inline void
+lock_cpu(void)
+{
+}
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã¸ã®ç§»è¡ï¼ãã£ã¹ãããã§ããç¶æ
+ï¼
+ */
+#define lock_cpu_dsp()		lock_cpu()
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®è§£é¤
+ */
+Inline void
+unlock_cpu(void)
+{
+}
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®è§£é¤ï¼ãã£ã¹ãããã§ããç¶æ
+ï¼
+ */
+#define unlock_cpu_dsp()	unlock_cpu()
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®åç
+§
+ */
+Inline bool_t
+sense_lock(void)
+{
+	return(false);
+}
+
+/*
+ *  å²è¾¼ã¿ãåãä»ããããã®é
+å»¶å¦ç
+ */
+Inline void
+delay_for_interrupt(void)
+{
+}
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®è¨­å®
+ */
+Inline void
+t_set_ipm(PRI intpri)
+{
+}
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®åç
+§
+ */
+Inline PRI
+t_get_ipm(void)
+{
+	return(TIPM_ENAALL);
+}
+
+/*
+ *  å²è¾¼ã¿çªå·ï¼å²è¾¼ã¿ãã³ãã©çªå·ï¼CPUä¾å¤ãã³ãã©çªå·ã®ç¯å²ã®å¤å®
+ */
+#define	VALID_INTNO(intno)	(0U <= (intno) && (intno) <= 31U)
+#define VALID_INHNO(inhno)	VALID_INTNO((INTNO)(inhno))
+#define VALID_EXCNO(excno)	(0U <= (excno) && (excno) <= 7U)
+
+/*
+ *  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ã»ãã
+ *
+ *  å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªãå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦å²è¾¼ã¿è¦æ±ç¦æ­¢
+ *  ãã©ã°ãã»ãããããã¨ããå ´åã«ã¯ï¼falseãè¿ãï¼
+ */
+Inline bool_t
+disable_int(INTNO intno)
+{
+	return(true);
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ã¯ãªã¢
+ *
+ *  å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªãå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦å²è¾¼ã¿è¦æ±ç¦æ­¢
+ *  ãã©ã°ãã¯ãªã¢ãããã¨ããå ´åã«ã¯ï¼falseãè¿ãï¼
+ */
+Inline bool_t
+enable_int(INTNO intno)
+{
+	return(true);
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã®ã¯ãªã¢
+ */
+Inline void
+clear_int(INTNO intno)
+{
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã®ãã§ãã¯
+ */
+Inline bool_t
+probe_int(INTNO intno)
+{
+	return(true);
+}
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã¸ã®ãã£ã¹ããã
+ */
+extern void	dispatch(void);
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®ãã£ã¹ãããè¦æ±
+ */
+#define request_dispatch()
+
+/*
+ *  ãã£ã¹ãããã£ã®åä½éå§
+ */
+extern void start_dispatch(void);
+
+/*
+ *  ç¾å¨ã®ã³ã³ãã­ã¹ããæ¨ã¦ã¦ãã£ã¹ããã
+ */
+extern void	exit_and_dispatch(void);
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©åºå
+¥å£å¦ç
+ */
+extern void	int_handler_entry(void);
+
+/*
+ *  CPUä¾å¤ãã³ãã©åºå
+¥å£å¦ç
+ */
+extern void	exc_handler_entry(void);
+
+/*
+ *  ã«ã¼ãã«ã®çµäºå¦çã®å¼åºã
+ */
+extern void call_exit_kernel(void) NoReturn;
+
+/*
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãã®åæå
+ */
+extern void	start_r(void);
+
+#define activate_context(p_tcb) \
+	/* æå®ãããã¿ã¹ã¯ï¼p_tcbï¼ã®TCBä¸­ã®ã¹ã¿ãã¯ãã¤ã³ã¿ãåæåãã */
+	/* start_rãï¼å®è¡åéçªå°ã¨ãã¦èªã¿ã¹ã¯ã®TCBã«ä¿å­ãã */
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©ã®è¨­å®
+ *
+ *  ãã¯ãã«çªå·inhnoã®å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦çã®çªå°ãint_entryã«
+ *  è¨­å®ããï¼
+ */
+Inline void
+define_inh(INHNO inhno, FP int_entry)
+{
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã©ã¤ã³å±æ§ã®è¨­å®
+ */
+Inline void
+config_int(INTNO intno, ATR intatr, PRI intpri)
+{
+}
+
+/*
+ *  CPUä¾å¤ãã³ãã©ã®è¨­å®
+ *
+ *  ãã¯ãã«çªå·excnoã®CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦çã®çªå°ãexc_entryã«è¨­
+ *  å®ããï¼
+ */
+Inline void
+define_exc(EXCNO excno, FP exc_entry)
+{
+}
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©åæ­¢ã®ããã®ãã¯ã­
+ */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+#define OVRTIMER_STOP()	{				\
+			lock_cpu();					\
+			_kernel_ovrtimer_stop();	\
+			unlock_cpu();				\
+		}
+#else /* TOPPERS_SUPPORT_OVRHDR */
+#define OVRTIMER_STOP()
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©ã®å
+¥å£å¦çã®çæãã¯ã­
+ */
+#define INT_ENTRY(inhno, inthdr)	inthdr
+#define INTHDR_ENTRY(inhno, inthdr, intpri)
+
+/*
+ *  CPUä¾å¤ãã³ãã©ã®å
+¥å£å¦çã®çæãã¯ã­
+ */
+#define EXC_ENTRY(excno, exchdr)	exchdr
+#define EXCHDR_ENTRY(excno, excno_num, exchdr)
+
+/*
+ *  CPUä¾å¤ã®çºçããæã®ã³ã³ãã­ã¹ãã¨å²è¾¼ã¿ã®ãã¹ã¯ç¶æ
+ã®åç
+§
+ *
+ *  CPUä¾å¤ã®çºçããæã®ã·ã¹ãã ç¶æ
+ãï¼ã«ã¼ãã«å
+ã®ã¯ãªãã£ã«ã«ã»ã¯ã·ã§
+ *  ã³ã®å®è¡ä¸­ã§ãªãï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§ãªãï¼CPUã­ãã¯ç¶æ
+ã§ãªãï¼ã«ã¼
+ *  ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©å®è¡ä¸­ã§ãªãï¼ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ãã³
+ *  ãã©å®è¡ä¸­ã§ãªãï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§ããï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨
+ *  è§£é¤ã§ããæã«trueï¼ããã§ãªãæã«falseãè¿ãï¼
+ */
+Inline bool_t
+exc_sense_intmask(void *p_excinf)
+{
+	return(true);
+}
+
+/*
+ *  ã¿ã¼ã²ããã·ã¹ãã ä¾å­ã®åæå
+ */
+extern void	target_initialize(void);
+
+/*
+ *  ã¿ã¼ã²ããã·ã¹ãã ã®çµäº
+ *
+ *  ã·ã¹ãã ãçµäºããæã«ä½¿ãï¼
+ */
+extern void	target_exit(void) NoReturn;
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_TARGET_KERNEL_IMPL_H */
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_offset.tf
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_offset.tf	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_offset.tf	(revision 302)
@@ -0,0 +1,19 @@
+$ 
+$ 		ãªãã»ãããã¡ã¤ã«çæç¨ãã³ãã¬ã¼ããã¡ã¤ã«ï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+$
+$   $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_rename.def
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_rename.def	(revision 302)
@@ -0,0 +1,32 @@
+# target_kernel_impl.c
+dispatch
+start_dispatch
+exit_and_dispatch
+ret_int
+ret_exc
+call_exit_kernel
+start_r
+target_initialize
+target_exit
+
+# target_timer.c
+target_hrt_initialize
+target_hrt_terminate
+target_hrt_get_current
+target_hrt_set_event
+target_hrt_raise_event
+target_hrt_handler
+target_ovrtimer_initialize
+target_ovrtimer_terminate
+target_ovrtimer_start
+target_ovrtimer_stop
+target_ovrtimer_get_current
+target_ovrtimer_handler
+
+# trace_config.c
+log_dsp_enter
+log_dsp_leave
+log_inh_enter
+log_inh_leave
+log_exc_enter
+log_exc_leave
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_rename.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_rename.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_rename.h	(revision 302)
@@ -0,0 +1,89 @@
+/* This file is generated from target_rename.def by genrename. */
+
+#ifndef TOPPERS_TARGET_RENAME_H
+#define TOPPERS_TARGET_RENAME_H
+
+/*
+ *  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
+
+#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_serial.c
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_serial.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_serial.c	(revision 302)
@@ -0,0 +1,253 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2013-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: target_serial.c 374 2015-07-30 22:01:54Z ertl-hiro $
+ */
+
+/*
+ *		ã·ãªã¢ã«I/Oããã¤ã¹ï¼SIOï¼ãã©ã¤ãï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+ */
+
+#include "target_serial.h"
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãåæåãã­ãã¯ã®å®ç¾©
+ */
+typedef struct sio_port_initialization_block {
+	int_t		dummy;			/* ããã¼ãã£ã¼ã«ã */
+	/* SIOã®ã¬ã¸ã¹ã¿ã®çªå°ãªã© */
+} SIOPINIB;
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®å®ç¾©
+ */
+struct sio_port_control_block {
+	const SIOPINIB *p_siopinib;	/* ã·ãªã¢ã«I/Oãã¼ãåæåãã­ãã¯ */
+	intptr_t	exinf;			/* æ¡å¼µæ
+å ± */
+	bool_t		openflag;		/* ãªã¼ãã³æ¸ã¿ãã©ã° */
+	int_t		dummy;			/* ããã¼ãã£ã¼ã«ã */
+	/* SIOã®ç¶æ
+ãªã© */
+};
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãåæåãã­ãã¯
+ */
+const SIOPINIB siopinib_table[TNUM_SIOP] = {
+	{ 0 }
+};
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®ã¨ãªã¢
+ */
+SIOPCB	siopcb_table[TNUM_SIOP];
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãIDããç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_SIOP(siopid)	((uint_t)((siopid) - 1))
+#define get_siopcb(siopid)	(&(siopcb_table[INDEX_SIOP(siopid)]))
+
+/*
+ *  SIOãã©ã¤ãã®åæå
+ */
+void
+sio_initialize(intptr_t exinf)
+{
+	SIOPCB	*p_siopcb;
+	uint_t	i;
+
+	/*
+	 *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®åæå
+	 */
+	for (i = 0; i < TNUM_SIOP; i++) {
+		p_siopcb = &(siopcb_table[i]);
+		p_siopcb->p_siopinib = &(siopinib_table[i]);
+		p_siopcb->openflag = false;
+		/* ãã®ä»ã®ãã£ã¼ã«ãã®åæå */
+	}
+}
+
+/*
+ *  SIOãã©ã¤ãã®çµäºå¦ç
+ */
+void
+sio_terminate(intptr_t exinf)
+{
+	SIOPCB	*p_siopcb;
+	uint_t	i;
+
+	/*
+	 *  ãªã¼ãã³ããã¦ããã·ãªã¢ã«I/Oãã¼ãã®ã¯ã­ã¼ãº
+	 */
+	for (i = 0; i < TNUM_SIOP; i++) {
+		p_siopcb = &(siopcb_table[i]);
+		if (p_siopcb->openflag) {
+			/* SIOã®ã¯ã­ã¼ãºå¦ç */
+		}
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
+ */
+SIOPCB *
+sio_opn_por(ID siopid, intptr_t exinf)
+{
+	SIOPCB			*p_siopcb;
+	const SIOPINIB	*p_siopinib;
+
+	p_siopcb = get_siopcb(siopid);
+	p_siopinib = p_siopcb->p_siopinib;
+
+	/* SIOã®ãªã¼ãã³å¦ç */
+
+	p_siopcb->exinf = exinf;
+	p_siopcb->openflag = true;
+	p_siopcb->dummy = p_siopinib->dummy;
+	return(p_siopcb);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ã¯ã­ã¼ãº
+ */
+void
+sio_cls_por(SIOPCB *p_siopcb)
+{
+	/* SIOã®ã¯ã­ã¼ãºå¦ç */
+
+	p_siopcb->openflag = false;
+}
+
+/*
+ *  SIOã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+ */
+void
+sio_isr(intptr_t exinf)
+{
+	SIOPCB	*p_siopcb = &(siopcb_table[(int_t) exinf]);
+	
+	if (1/* éä¿¡å®äºå²è¾¼ã¿ã®å ´å */) {
+		sio_irdy_snd(p_siopcb->exinf);
+	}
+	if (1/* åä¿¡å®äºå²è¾¼ã¿ã®å ´å */) {
+		sio_irdy_rcv(p_siopcb->exinf);
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã¸ã®æå­éä¿¡
+ */
+bool_t
+sio_snd_chr(SIOPCB *p_siopcb, char c)
+{
+	if (1/* éä¿¡ã¬ã¸ã¹ã¿ã«ç©ºããããå ´å */) {
+		/* éä¿¡ã¬ã¸ã¹ã¿ã«æå­cãå
+¥ãã */
+		return(true);
+	}
+	else {
+		return(false);
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®æå­åä¿¡
+ */
+int_t
+sio_rcv_chr(SIOPCB *p_siopcb)
+{
+	char	c;
+
+	if (1/* åä¿¡ã¬ã¸ã¹ã¿ã«æå­ãããå ´å */) {
+		/* åä¿¡ã¬ã¸ã¹ã¿ã®æå­ãcã«å
+¥ãã */
+		c = '\0';
+		return((int_t) c);
+	}
+	else {
+		return(-1);
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®è¨±å¯
+ */
+void
+sio_ena_cbr(SIOPCB *p_siopcb, uint_t cbrtn)
+{
+	switch (cbrtn) {
+	case SIO_RDY_SND:
+		/* éä¿¡å®äºå²è¾¼ã¿ãè¨±å¯ */
+		break;
+	case SIO_RDY_RCV:
+		/* åä¿¡å®äºå²è¾¼ã¿ãè¨±å¯ */
+		break;
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®ç¦æ­¢
+ */
+void
+sio_dis_cbr(SIOPCB *p_siopcb, uint_t cbrtn)
+{
+	switch (cbrtn) {
+	case SIO_RDY_SND:
+		/* éä¿¡å®äºå²è¾¼ã¿ãç¦æ­¢ */
+		break;
+	case SIO_RDY_RCV:
+		/* åä¿¡å®äºå²è¾¼ã¿ãç¦æ­¢ */
+		break;
+	}
+}
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_serial.cfg
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_serial.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_serial.cfg	(revision 302)
@@ -0,0 +1,11 @@
+/*
+ *		SIOãã©ã¤ãï¼ããã¼ã¿ã¼ã²ããç¨ï¼ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: target_serial.cfg 238 2014-09-28 19:19:25Z ertl-hiro $
+ */
+
+#include "target_serial.h"
+ATT_INI({ TA_NULL, 0, sio_initialize });
+ATT_TER({ TA_NULL, 0, sio_terminate });
+CFG_INT(INTNO_SIO, { INTATR_SIO, INTPRI_SIO });
+CRE_ISR(ISR_SIO, { TA_NULL, 0, INTNO_SIO, sio_isr, 1 });
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_serial.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_serial.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_serial.h	(revision 302)
@@ -0,0 +1,149 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2013-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: target_serial.h 2 2014-01-11 03:50:35Z ertl-hiro $
+ */
+
+/*
+ *		ã·ãªã¢ã«I/Oããã¤ã¹ï¼SIOï¼ãã©ã¤ãï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+ */
+
+#ifndef TOPPERS_TARGET_SERIAL_H
+#define TOPPERS_TARGET_SERIAL_H
+
+#include "dummy.h"
+#include <t_stddef.h>
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãæ°ã®å®ç¾©
+ */
+#define TNUM_SIOP		1		/* ãµãã¼ãããã·ãªã¢ã«I/Oãã¼ãã®æ° */
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®å²è¾¼ã¿é¢é£æ
+å ±
+ */
+#define INTNO_SIO		TINTNO_SIO		/* å²è¾¼ã¿çªå· */
+#define INTPRI_SIO		-1				/* å²è¾¼ã¿åªå
+åº¦ */
+#define INTATR_SIO		TA_NULL			/* å²è¾¼ã¿å±æ§ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®å®ç¾©
+ */
+typedef struct sio_port_control_block	SIOPCB;
+
+/*
+ *  ã³ã¼ã«ããã¯ã«ã¼ãã³ã®è­å¥çªå·
+ */
+#define SIO_RDY_SND		1U		/* éä¿¡å¯è½ã³ã¼ã«ããã¯ */
+#define SIO_RDY_RCV		2U		/* åä¿¡éç¥ã³ã¼ã«ããã¯ */
+
+/*
+ *  SIOãã©ã¤ãã®åæå
+ */
+extern void		sio_initialize(intptr_t exinf);
+
+/*
+ *  SIOãã©ã¤ãã®çµäºå¦ç
+ */
+extern void		sio_terminate(intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
+ */
+extern SIOPCB	*sio_opn_por(ID siopid, intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ã¯ã­ã¼ãº
+ */
+extern void		sio_cls_por(SIOPCB *p_siopcb);
+
+/*
+ *  SIOã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+ */
+extern void		sio_isr(intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã¸ã®æå­éä¿¡
+ */
+extern bool_t	sio_snd_chr(SIOPCB *siopcb, char c);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®æå­åä¿¡
+ */
+extern int_t	sio_rcv_chr(SIOPCB *siopcb);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®è¨±å¯
+ */
+extern void		sio_ena_cbr(SIOPCB *siopcb, uint_t cbrtn);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®ç¦æ­¢
+ */
+extern void		sio_dis_cbr(SIOPCB *siopcb, uint_t cbrtn);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®éä¿¡å¯è½ã³ã¼ã«ããã¯
+ */
+extern void		sio_irdy_snd(intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®åä¿¡éç¥ã³ã¼ã«ããã¯
+ */
+extern void		sio_irdy_rcv(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_TARGET_SERIAL_H */
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_sil.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_sil.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_sil.h	(revision 302)
@@ -0,0 +1,97 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2013-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: target_sil.h 374 2015-07-30 22:01:54Z ertl-hiro $
+ */
+
+/*
+ *		sil.hã®ã¿ã¼ã²ããä¾å­é¨ï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼sil.hã®å
+é ­ã§ã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡
+ *  ã¤ã«ããã¯ç´æ¥ã¤ã³ã¯ã«ã¼ããããã¨ã¯ãªãï¼ãã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼
+ *  ãããåã«ï¼t_stddef.hãã¤ã³ã¯ã«ã¼ããããã®ã§ï¼ãããã«ä¾å­ãã¦ã
+ *  ããï¼
+ */
+
+#ifndef TOPPERS_TARGET_SIL_H
+#define TOPPERS_TARGET_SIL_H
+
+#ifndef TOPPERS_MACRO_ONLY
+
+#include <t_stddef.h>
+
+/*
+ *  å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®å¶å¾¡
+ */
+#define SIL_PRE_LOC		int_t intmask
+#define SIL_LOC_INT()	(intmask = 1)
+#define SIL_UNL_INT()	(intmask = intmask - 1)
+
+/*
+ *  å¾®å°æéå¾
+ã¡
+ */
+Inline void
+sil_dly_nse(ulong_t dlytim)
+{
+}
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ãã­ã»ããµã®ã¨ã³ãã£ã¢ã³
+ */
+#define SIL_ENDIAN_LITTLE			/* ãªãã«ã¨ã³ãã£ã¢ã³ */
+
+#endif /* TOPPERS_TARGET_SIL_H */
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_stddef.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_stddef.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_stddef.h	(revision 302)
@@ -0,0 +1,104 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2013-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: target_stddef.h 293 2014-11-30 09:27:54Z ertl-hiro $
+ */
+
+/*
+ *		t_stddef.hã®ã¿ã¼ã²ããä¾å­é¨ï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼t_stddef.hã®å
+é ­ã§ã¤ã³ã¯ã«ã¼ããããï¼
+ *  ä»ã®ãã¡ã¤ã«ããã¯ç´æ¥ã¤ã³ã¯ã«ã¼ããããã¨ã¯ãªãï¼ä»ã®ã¤ã³ã¯ã«ã¼ã
+ *  ãã¡ã¤ã«ã«å
+ç«ã£ã¦å¦çãããããï¼ä»ã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã«ä¾å­ã
+ *  ã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_TARGET_STDDEF_H
+#define TOPPERS_TARGET_STDDEF_H
+
+/*
+ *  ã¿ã¼ã²ãããè­å¥ããããã®ãã¯ã­ã®å®ç¾©
+ */
+#define TOPPERS_DUMMY				/* ã·ã¹ãã ç¥ç§° */
+
+/*
+ *  éçºç°å¢ã§å
+±éãªå®ç¾©
+ */
+#define TOPPERS_STDFLOAT_TYPE1
+#include "tool_stddef.h"
+
+/*
+ *  éçºç°å¢ã®æ¨æºã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã®å©ç¨
+ *
+ *  C99äºæã®æ´æ°åã®å®ç¾©ãstdint.hããåãè¾¼ãï¼stdlib.hã¯ï¼abortã®å®£
+ *  è¨ãåãè¾¼ãããã«ã¤ã³ã¯ã«ã¼ããã¦ããï¼
+ */
+#ifndef TOPPERS_MACRO_ONLY
+#include <stdint.h>
+#include <stdlib.h>
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ã¢ãµã¼ã·ã§ã³ã®å¤±ææã®å®è¡ä¸­æ­å¦ç
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+Inline void
+TOPPERS_assert_abort(void)
+{
+	abort();
+}
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_TARGET_STDDEF_H */
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_syssvc.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_syssvc.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_syssvc.h	(revision 302)
@@ -0,0 +1,97 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2013-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: target_syssvc.h 293 2014-11-30 09:27:54Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­é¨ï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+ *
+ *  ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ï¼ãã®ãã¡
+ *  ã¤ã«ã®å
+å®¹ã¯ï¼ã³ã³ãã¼ãã³ãè¨è¿°ãã¡ã¤ã«ã«è¨è¿°ããï¼ãã®ãã¡ã¤ã«ã¯
+ *  ç¡ããªãè¦è¾¼ã¿ï¼
+ */
+
+#ifndef TOPPERS_TARGET_SYSSVC_H
+#define TOPPERS_TARGET_SYSSVC_H
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã«é¢ããè¨­å®
+ */
+#ifdef TOPPERS_ENABLE_TRACE
+#include "arch/logtrace/trace_config.h"
+#endif /* TOPPERS_ENABLE_TRACE */
+
+/*
+ *  èµ·åã¡ãã»ã¼ã¸ã®ã¿ã¼ã²ããã·ã¹ãã å
+ */
+#define TARGET_NAME	"Dummy Target"
+
+/*
+ *  ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®ããã®æå­åºå
+ *
+ *  ã¿ã¼ã²ããä¾å­ã®æ¹æ³ã§ï¼æå­cãè¡¨ç¤º/åºå/ä¿å­ããï¼
+ */
+extern void	target_fput_log(char c);
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãæ°ã®å®ç¾©
+ */
+#define TNUM_PORT		1		/* ãµãã¼ãããã·ãªã¢ã«ãã¼ãã®æ° */
+
+/*
+ *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯é¢é£ã®å®æ°ã®å®ç¾©
+ */
+#define LOGTASK_STACK_SIZE	4096		/* ã¹ã¿ãã¯é åã®ãµã¤ãº */
+
+#endif /* TOPPERS_TARGET_SYSSVC_H */
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_test.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_test.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_test.h	(revision 302)
@@ -0,0 +1,67 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2013-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: target_test.h 364 2015-07-26 11:57:44Z ertl-hiro $
+ */
+
+/*
+ *		ãã¹ããã­ã°ã©ã ã®ã¿ã¼ã²ããä¾å­å®ç¾©ï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+ */
+
+#ifndef TOPPERS_TARGET_TEST_H
+#define TOPPERS_TARGET_TEST_H
+
+#define CPUEXC1					1
+#define RAISE_CPU_EXCEPTION		{ int *p = NULL; *p = 0; }
+#define PREPARE_RETURN_CPUEXC
+
+#endif /* TOPPERS_TARGET_TEST_H */
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_timer.c
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_timer.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_timer.c	(revision 302)
@@ -0,0 +1,167 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2013-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: target_timer.c 458 2015-08-21 14:59:09Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ããã©ã¤ãï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+ */
+
+#include "kernel_impl.h"
+#include "time_event.h"
+#include "target_timer.h"
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®åæåå¦ç
+ */
+void
+target_hrt_initialize(intptr_t exinf)
+{
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®çµäºå¦ç
+ */
+void
+target_hrt_terminate(intptr_t exinf)
+{
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ç¾å¨ã®ã«ã¦ã³ãå¤ã®èª­åºã
+ */
+HRTCNT
+target_hrt_get_current(void)
+{
+	return(0U);
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã¸ã®å²è¾¼ã¿ã¿ã¤ãã³ã°ã®è¨­å®
+ */
+void
+target_hrt_set_event(HRTCNT hrtcnt)
+{
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®è¦æ±
+ */
+void
+target_hrt_raise_event(void)
+{
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+void
+target_hrt_handler(void)
+{
+	signal_time();					/* é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦ç */
+}
+
+#ifdef TOPPERS_SUPPORT_OVRHDR
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åæåå¦ç
+ */
+void
+target_ovrtimer_initialize(intptr_t exinf)
+{
+}
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®çµäºå¦ç
+ */
+void
+target_ovrtimer_terminate(intptr_t exinf)
+{
+}
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§
+ */
+void
+target_ovrtimer_start(PRCTIM ovrtim)
+{
+}
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢
+ */
+PRCTIM
+target_ovrtimer_stop(void)
+{
+	return(0U);
+}
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®ç¾å¨å¤ã®èª­åºã
+ */
+PRCTIM
+target_ovrtimer_get_current(void)
+{
+	return(0U);
+}
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+void
+target_ovrtimer_handler(void)
+{
+	call_ovrhdr();					/* ãªã¼ãã©ã³ãã³ãã©ã®èµ·åå¦ç */
+}
+
+#endif /* TOPPERS_SUPPORT_OVRHDR */
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_timer.cfg
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_timer.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_timer.cfg	(revision 302)
@@ -0,0 +1,18 @@
+/*
+ *		ã¿ã¤ããã©ã¤ãï¼ããã¼ã¿ã¼ã²ããç¨ï¼ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: target_timer.cfg 238 2014-09-28 19:19:25Z ertl-hiro $
+ */
+
+#include "target_timer.h"
+ATT_INI({ TA_NULL, 0, _kernel_target_hrt_initialize });
+ATT_TER({ TA_NULL, 0, _kernel_target_hrt_terminate });
+CFG_INT(INTNO_HRT, { TA_ENAINT | INTATR_HRT, INTPRI_HRT });
+DEF_INH(INHNO_HRT, { TA_NULL, _kernel_target_hrt_handler });
+
+#ifdef TOPPERS_SUPPORT_OVRHDR
+ATT_INI({ TA_NULL, 0, _kernel_target_ovrtimer_initialize });
+ATT_TER({ TA_NULL, 0, _kernel_target_ovrtimer_terminate });
+CFG_INT(INTNO_OVRTIMER, { TA_ENAINT | INTATR_OVRTIMER, INTPRI_OVRTIMER });
+DEF_INH(INHNO_OVRTIMER, { TA_NULL, _kernel_target_ovrtimer_handler });
+#endif /* TOPPERS_SUPPORT_OVRHDR */
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_timer.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_timer.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_timer.h	(revision 302)
@@ -0,0 +1,164 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2013-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: target_timer.h 458 2015-08-21 14:59:09Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ããã©ã¤ãï¼ããã¼ã¿ã¼ã²ããç¨ï¼
+ */
+
+#ifndef TOPPERS_TARGET_TIMER_H
+#define TOPPERS_TARGET_TIMER_H
+
+#include <sil.h>
+#include "dummy.h"
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ãã³ãã©ç»é²ã®ããã®å®æ°
+ */
+#define INHNO_HRT		TINTNO_HRT			/* å²è¾¼ã¿ãã³ãã©çªå· */
+#define INTNO_HRT		TINTNO_HRT			/* å²è¾¼ã¿çªå· */
+#define INTPRI_HRT		(TMAX_INTPRI - 1)	/* å²è¾¼ã¿åªå
+åº¦ */
+#define INTATR_HRT		TA_EDGE				/* å²è¾¼ã¿å±æ§ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã¿ã¤ãå¤ã®å
+é¨è¡¨ç¾ã®å
+ */
+typedef uint32_t	CLOCK;
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®åæåå¦ç
+ */
+extern void	target_hrt_initialize(intptr_t exinf);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®çµäºå¦ç
+ */
+extern void	target_hrt_terminate(intptr_t exinf);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ç¾å¨ã®ã«ã¦ã³ãå¤ã®èª­åºã
+ */
+extern HRTCNT target_hrt_get_current(void);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã¸ã®å²è¾¼ã¿ã¿ã¤ãã³ã°ã®è¨­å®
+ */
+extern void target_hrt_set_event(HRTCNT hrtcnt);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®è¦æ±
+ */
+extern void target_hrt_raise_event(void);
+
+/*
+ *  å²è¾¼ã¿ã¿ã¤ãã³ã°ã«æå®ããæå¤§å¤
+ */
+#define HRTCNT_BOUND	4000000002U
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+extern void target_hrt_handler(void);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ãã³ãã©ç»é²ã®ããã®å®æ°
+ */
+#define INHNO_OVRTIMER	TINTNO_OVRTIMER		/* å²è¾¼ã¿ãã³ãã©çªå· */
+#define INTNO_OVRTIMER	TINTNO_OVRTIMER		/* å²è¾¼ã¿çªå· */
+#define INTPRI_OVRTIMER	(TMAX_INTPRI)		/* å²è¾¼ã¿åªå
+åº¦ */
+#define INTATR_OVRTIMER	TA_EDGE				/* å²è¾¼ã¿å±æ§ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åæåå¦ç
+ */
+extern void target_ovrtimer_initialize(intptr_t exinf);
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®çµäºå¦ç
+ */
+extern void target_ovrtimer_terminate(intptr_t exinf);
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§
+ */
+extern void target_ovrtimer_start(PRCTIM ovrtim);
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢
+ */
+extern PRCTIM target_ovrtimer_stop(void);
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®ç¾å¨å¤ã®èª­åºã
+ */
+extern PRCTIM target_ovrtimer_get_current(void);
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+extern void target_ovrtimer_handler(void);
+
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_TARGET_TIMER_H */
Index: asp3_wo_tecs/trunk/target/dummy_gcc/target_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/target/dummy_gcc/target_unrename.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/dummy_gcc/target_unrename.h	(revision 302)
@@ -0,0 +1,90 @@
+/* This file is generated from target_rename.def by genrename. */
+
+/* This file is included only when target_rename.h has been included. */
+#ifdef TOPPERS_TARGET_RENAME_H
+#undef TOPPERS_TARGET_RENAME_H
+
+/*
+ *  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
+
+#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/macosx_xcode/E_PACKAGE
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/E_PACKAGE	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/E_PACKAGE	(revision 302)
@@ -0,0 +1,7 @@
+E_PACKAGE asp3_macosx_xcode
+VERSION %date
+
+INCLUDE ../../MANIFEST
+INCLUDE MANIFEST
+INCLUDE ../../cfg/MANIFEST
+../../cfg/cfg/cfg
Index: asp3_wo_tecs/trunk/target/macosx_xcode/MANIFEST
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/MANIFEST	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/MANIFEST	(revision 302)
@@ -0,0 +1,32 @@
+PACKAGE asp3_target_macosx_xcode
+VERSION 3.0.0
+
+E_PACKAGE
+MANIFEST
+Makefile.target
+macosx.h
+target.tf
+target_cfg1_out.h
+target_check.tf
+target_def.csv
+target_kernel.h
+target_kernel_impl.c
+target_kernel_impl.h
+target_rename.def
+target_rename.h
+target_serial.c
+target_serial.cfg
+target_serial.h
+target_sil.h
+target_stddef.h
+target_syssvc.h
+target_test.h
+target_timer.c
+target_timer.cfg
+target_timer.h
+target_unrename.h
+target_user.txt
+unix_sigio.cfg
+unix_sigio.h
+
+INCLUDE ../test_hrt_macosx_xcode/MANIFEST
Index: asp3_wo_tecs/trunk/target/macosx_xcode/Makefile.target
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/Makefile.target	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/Makefile.target	(revision 302)
@@ -0,0 +1,74 @@
+#
+#		Makefile ã®ã¿ã¼ã²ããä¾å­é¨ï¼Mac OS Xç¨ï¼
+#
+#  $Id: Makefile.target 504 2016-01-12 01:19:55Z ertl-hiro $
+#
+
+#
+#  ã·ã¹ãã åï¼éçºç°å¢åã®å®ç¾©
+#
+SYS = macosx
+TOOL = xcode
+
+#
+#  ãã¼ã«ä¾å­é¨ãã£ã¬ã¯ããªåã®å®ç¾© 
+#
+#  GCCåãã®ãã¼ã«ä¾å­é¨ãæµç¨ããï¼
+#
+TOOLDIR = $(SRCDIR)/arch/gcc
+
+#
+#  éçºãã¼ã«ã®ã³ãã³ãåã®å®ç¾©
+#
+#  objcopyã¨objdumpã¯ï¼ããããï¼gobjcopyã¨gobjdumpãç¨ããï¼
+#
+CC = cc
+CXX = c++
+AS = as
+LD = ld
+AR = ar
+NM = nm
+RANLIB = ranlib
+OBJCOPY = gobjcopy
+OBJDUMP = gobjdump
+
+#
+#  offset.hã¯ä½¿ç¨ããªã
+#
+OMIT_OFFSET_H = true
+
+#
+#  ã³ã³ãã¤ã«ãªãã·ã§ã³
+#
+#  ã«ã¼ãã«ãé¢æ°åä½ã§ã³ã³ãã¤ã«ããæã«ã¯ï¼æªä½¿ç¨é¢æ°ã®è­¦åãææ­¢ããï¼
+#
+INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(TOOLDIR)
+COPTS := -m32 -Werror $(COPTS)
+ifdef KERNEL_FUNCOBJS
+  COPTS := -Wno-unused-function $(COPTS)
+endif
+
+#
+#  ã«ã¼ãã«ã«é¢ããå®ç¾©
+#
+KERNEL_DIRS := $(KERNEL_DIRS) $(TARGETDIR)
+KERNEL_COBJS := $(KERNEL_COBJS) target_kernel_impl.o target_timer.o
+
+#
+#  ã·ã¹ãã ãµã¼ãã¹ã«é¢ããå®ç¾©
+#
+SYSSVC_COBJS := $(SYSSVC_COBJS) target_serial.o
+
+#
+#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
+#
+CFG_TABS := $(CFG_TABS) --cfg1-def-table $(TARGETDIR)/target_def.csv
+
+#
+#  ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ãã«é¢ããå®ç¾©
+#
+ifdef ENABLE_TRACE
+	COPTS := $(COPTS) -DTOPPERS_ENABLE_TRACE
+	KERNEL_DIRS := $(KERNEL_DIRS) $(SRCDIR)/arch/logtrace
+	KERNEL_COBJS := $(KERNEL_COBJS) trace_config.o trace_dump.o
+endif
Index: asp3_wo_tecs/trunk/target/macosx_xcode/macosx.h
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/macosx.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/macosx.h	(revision 302)
@@ -0,0 +1,69 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2006,2007 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: macosx.h 102 2014-05-04 15:25:30Z ertl-hiro $
+ */
+
+/*
+ *		Mac OS Xã®OSè³æºã®å®ç¾©
+ */
+
+#ifndef TOPPERS_MACOSX_H
+#define TOPPERS_MACOSX_H
+
+/*
+ *  ã·ã°ãã«çªå·ã®å®ç¾©
+ */
+#ifndef TOPPERS_MACRO_ONLY
+#include <signal.h>
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_MACOSX_H */
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target.tf
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target.tf	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target.tf	(revision 302)
@@ -0,0 +1,193 @@
+$
+$		ãã¹2ã®ã¿ã¼ã²ããä¾å­ãã³ãã¬ã¼ãï¼Mac OS Xç¨ï¼
+$
+$  $Id: target.tf 405 2015-08-02 21:56:53Z ertl-hiro $
+$
+
+$
+$  ä½¿ç¨ã§ããå²è¾¼ã¿çªå·ã¨ããã«å¯¾å¿ããå²è¾¼ã¿ãã³ãã©çªå·
+$
+$  å²è¾¼ã¿çªå·ã¨å²è¾¼ã¿ãã³ãã©çªå·ã¯ï¼ã·ã°ãã«çªå·ã«ä¸è´ãããï¼1ã31ã®
+$  ã·ã°ãã«çªå·ã®å
+ï¼SIGKILLï¼ï¼9ï¼ï¼SIGSTOPï¼ï¼17ï¼ï¼SIGUSR2ï¼ï¼31ï¼ä»¥
+$  å¤ãä½¿ç¨ã§ããï¼
+$
+$INTNO_VALID = { 1, 2, ..., 8; 10, 11, ..., 16; 18, 19, ..., 30 }$
+$INHNO_VALID = INTNO_VALID$
+$EXCNO_VALID = INTNO_VALID$
+
+$
+$  CFG_INTã§ä½¿ç¨ã§ããå²è¾¼ã¿çªå·ã¨å²è¾¼ã¿åªå
+åº¦
+$
+$  å²è¾¼ã¿åªå
+åº¦ã¯ï¼-1ã-7ãä½¿ç¨ã§ããï¼-7ã¯NMIã¨æ±ãï¼
+$
+$INTPRI_CFGINT_VALID = { -1, -2, ..., -7 }$
+
+$
+$  ã¹ã¿ãã¯é åã®ç¢ºä¿é¢æ°
+$
+$  Intelãã­ã»ããµã§ã¯ï¼ã¹ã¿ãã¯ãã¤ã³ã¿ã16ãã¤ãå¢çã«ã¢ã©ã¤ã³ããã
+$  å¿
+è¦ãããï¼
+$
+$FUNCTION ALLOC_STACK$
+	static STK_T $ARGV[1]$[COUNT_STK_T($ARGV[2]$)]
+						$SPC$__attribute__((aligned(16)));$NL$
+	$RESULT = FORMAT("ROUND_STK_T(%1%)", ARGV[2])$
+$END$
+
+$
+$  æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
+$
+$INCLUDE "kernel/kernel.tf"$
+
+$
+$  ã¿ã¼ã²ããä¾å­ã®å®ç¾©ã®çæ
+$
+$FILE "kernel_cfg.c"$
+
+/*$NL$
+$SPC$*  Target-dependent Definitions (Mac OS X)$NL$
+$SPC$*/$NL$
+$NL$
+
+$
+$  ãã¹ã¯ã§ããªãã·ã°ãã«ã¨ã«ã¼ãã«ãä½¿ãã·ã°ãã«ã«é¢ããè¨­å®
+$
+$  SIGKILLï¼ãã¹ã¯ä¸å¯ï¼
+$  SIGSTOPï¼ãã¹ã¯ä¸å¯ï¼
+$  SIGUSR2ï¼ã«ã¼ãã«ãå©ç¨ï¼
+$
+$INT.INTPRI[SIGKILL] = -7$
+$INT.INTPRI[SIGSTOP] = -7$
+$INT.INTPRI[SIGUSR2] = -7$
+
+$
+$  CFG_INTã®ã¿ã¼ã²ããä¾å­ã®ã¨ã©ã¼ãã§ãã¯
+$
+$FOREACH intno INT.ORDER_LIST$
+	$IF (INT.INTATR[intno] & TA_EDGE) == 0$
+		$ERROR INT.TEXT_LINE[intno]$E_RSATR:$SPC$
+			$FORMAT("Level trigger is not supported for %1% `%2%\' in %3%",
+									"intno", INT.INTNO[intno], "CFG_INT")$
+		$END$
+	$END$
+$END$
+
+$
+$  CPUä¾å¤ãã³ãã©ã«é¢ããå¦ç
+$
+$FOREACH excno EXC.ORDER_LIST$
+$	// å²è¾¼ã¿ãã³ãã©ã¨ã®éè¤ãã§ãã¯
+	$IF LENGTH(INH.INHNO[excno])$
+		$ERROR EXC.TEXT_LINE[excno]$E_OBJ:$SPC$
+			$FORMAT(_("%1% `%2%\' in %3% is duplicated with %4% `%5%\'"),
+									"excno", EXC.EXCNO[excno], "DEF_EXC",
+									"inhno", INH.INHNO[excno])$
+		$END$
+	$END$
+
+$	// CPUä¾å¤ãã³ãã©ãç»é²ããã·ã°ãã«ã«é¢ããè¨­å®
+	$IF LENGTH(INTNO[excno])$
+		$INT.INTPRI[INTNO[excno]] = -7$
+	$END$
+$END$
+
+$
+$  ãããã°ç¨ã«ãã¹ã¯ããªãã·ã°ãã«ã«é¢ããè¨­å®
+$
+$  SIGINTï¼ãããã°ç¨ï¼
+$  SIGBUSï¼ãããã°ç¨ï¼
+$  SIGSEGVï¼ãããã°ç¨ï¼
+$
+$IF !LENGTH(INT.INTPRI[SIGINT])$
+	$INT.INTPRI[SIGINT] = -7$
+$END$
+$IF !LENGTH(INT.INTPRI[SIGBUS])$
+	$INT.INTPRI[SIGBUS] = -7$
+$END$
+$IF !LENGTH(INT.INTPRI[SIGSEGV])$
+	$INT.INTPRI[SIGSEGV] = -7$
+$END$
+
+$
+$  å²è¾¼ã¿ãã³ãã©ã®åæåã«å¿
+è¦ãªæ
+å ±
+$
+
+$
+$  å®ç¾©ããå²è¾¼ã¿ãã³ãã©ã®æ°
+$
+#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.INTHDR[inhno]$,$SPC$
+							$INT.INTPRI[INTNO[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]$), ($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$
+
+$			// å²è¾¼ã¿åªå
+åº¦
+			($INT.INTPRI[INTNO[INH.INHNO[inhno]]]$)$SPC$
+		}$END$$NL$
+	};$NL$
+$ELSE$
+	TOPPERS_EMPTY_LABEL(const INHINIB, _kernel_inhinib_table);$NL$
+$END$
+$NL$
+
+$
+$  å²è¾¼ã¿åªå
+åº¦æ¯ã®ããä»¥ä¸ã®å²è¾¼ã¿è¦æ±ããã¹ã¯ããããã®æ
+å ±ã®ãã¼ãã«
+$
+const sigset_t _kernel_sigmask_table[8] = {$NL$
+$FOREACH intpri { 0, -1, ..., -6 }$
+	$intmask = 0$
+	$FOREACH intno { 1, 2, ..., 31 }$
+		$IF ALT(INT.INTPRI[intno], 0) >= intpri$
+			$intmask = intmask | (1 << (intno - 1))$
+		$END$
+	$END$
+	$TAB$UINT32_C($FORMAT("0x%08x", intmask)$),$NL$
+$END$
+$TAB$UINT32_C($FORMAT("0x%08x", intmask)$)$NL$
+};$NL$
+
+$
+$  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°å®ç¾ã®ããã®å¤æ°ã®åæå¤
+$
+$sigmask_disint_init = 0$
+$FOREACH intno INT.ORDER_LIST$
+	$IF (INT.INTATR[intno] & TA_ENAINT) == 0$
+		$sigmask_disint_init = sigmask_disint_init
+									| (1 << (INT.INTNO[intno] - 1))$
+	$END$
+$END$
+$NL$
+const sigset_t	_kernel_sigmask_disint_init = 
+		UINT32_C($FORMAT("0x%08x", sigmask_disint_init)$);$NL$
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_cfg1_out.h
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_cfg1_out.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_cfg1_out.h	(revision 302)
@@ -0,0 +1,11 @@
+/*
+ *		cfg1_out.cã®ãªã³ã¯ã«å¿
+è¦ãªã¹ã¿ãã®å®ç¾©
+ *
+ *  $Id: target_cfg1_out.h 237 2014-09-28 19:17:01Z ertl-hiro $
+ */
+
+int main()
+{
+	return(0);
+}
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_check.tf
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_check.tf	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_check.tf	(revision 302)
@@ -0,0 +1,10 @@
+$
+$ 		ãã¹3ã®ã¿ã¼ã²ããä¾å­ãã³ãã¬ã¼ãï¼Mac OS Xç¨ï¼
+$
+$   $Id: target_check.tf 265 2014-10-06 03:04:09Z ertl-hiro $
+$
+
+$
+$  æ¨æºãã³ãã¬ã¼ããã¡ã¤ã«ã®ã¤ã³ã¯ã«ã¼ã
+$
+$INCLUDE "kernel/kernel_check.tf"$
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_def.csv
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_def.csv	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_def.csv	(revision 302)
@@ -0,0 +1,6 @@
+SIGINT,SIGINT
+SIGKILL,SIGKILL
+SIGBUS,SIGBUS
+SIGSEGV,SIGSEGV
+SIGSTOP,SIGSTOP
+SIGUSR2,SIGUSR2
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_kernel.h
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_kernel.h	(revision 302)
@@ -0,0 +1,110 @@
+/*
+ *  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) 2004-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: target_kernel.h 229 2014-09-28 07:50:26Z ertl-hiro $
+ */
+
+/*
+ *		kernel.hã®ã¿ã¼ã²ããä¾å­é¨ï¼Mac OS Xç¨ï¼
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼kernel.hã§ã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡
+ *  ã¤ã«ããç´æ¥ã¤ã³ã¯ã«ã¼ããããã¨ã¯ãªãï¼ãã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ã
+ *  ããåã«ï¼t_stddef.hãã¤ã³ã¯ã«ã¼ããããã®ã§ï¼ãããã«ä¾å­ãã¦ãã
+ *  ãï¼
+ */
+
+#ifndef TOPPERS_TARGET_KERNEL_H
+#define TOPPERS_TARGET_KERNEL_H
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨ã§ãµãã¼ãã§ããæ©è½
+ */
+#define TOPPERS_TARGET_SUPPORT_DIS_INT		/* dis_int */
+#define TOPPERS_TARGET_SUPPORT_ENA_INT		/* ena_int */
+#define TOPPERS_TARGET_SUPPORT_OVRHDR		/* ãªã¼ãã©ã³ãã³ãã© */
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æ
+ *
+ *  ã¿ã¤ãå¨æã2^32ã®å ´åã«ã¯ï¼ãã®ãã¯ã­ãå®ç¾©ããªãï¼
+ */
+#undef TCYC_HRTCNT
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã®é²ã¿å¹
+
+ */
+#define TSTEP_HRTCNT	1U
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ã®ç¯å²
+ *
+ *  TMIN_INTPRIã®å®ç¾©ãå¤æ´ãããã¨ã§ï¼ã©ã®ã¬ãã«ãããé«ãå²è¾¼ã¿åªå
+åº¦
+ *  ãæã¤ãã®ãã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã¨ããããå¤æ´ã§ããï¼
+ *
+ *  TMIN_INTPRIã«è¨­å®ã§ããå¤ã¯ï¼-6ã-1ã®ç¯å²ã§ããï¼ä¾ãã°TMIN_INTPRI
+ *  ã-5ã«è¨­å®ããã¨ï¼ã¬ãã«7ï¼NMIï¼ã¨ã¬ãã«6ã®å²è¾¼ã¿ãã«ã¼ãã«ç®¡çå¤ã¨
+ *  ãªãï¼TMIN_INTPRIã-6ã«è¨­å®ããã¨ï¼ã¬ãã«7ã®å²è¾¼ã¿ï¼NMIï¼ä»¥å¤ã«ã«ã¼
+ *  ãã«ç®¡çå¤ã®å²è¾¼ã¿ãè¨­ããªããã¨ã«ãªãï¼
+ */
+#ifndef TMIN_INTPRI
+#define TMIN_INTPRI		(-6)		/* å²è¾¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#endif /* TMIN_INTPRI */
+#define TMAX_INTPRI		(-1)		/* å²è¾¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼ */
+
+#endif /* TOPPERS_TARGET_KERNEL_H */
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_kernel_impl.c
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_kernel_impl.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_kernel_impl.c	(revision 302)
@@ -0,0 +1,451 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2006-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: target_kernel_impl.c 479 2016-01-03 07:28:41Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ï¼Mac OS Xç¨ï¼
+ */
+
+#include "kernel_impl.h"
+#include "task.h"
+#include <unistd.h>
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_DSP_ENTER
+#define LOG_DSP_ENTER(p_tcb)
+#endif /* LOG_DSP_ENTER */
+
+#ifndef LOG_DSP_LEAVE
+#define LOG_DSP_LEAVE(p_tcb)
+#endif /* LOG_DSP_LEAVE */
+
+/*
+ *  TMIN_INTPRIã®ç¯å²ã®ãã§ãã¯
+ */
+#if (TMIN_INTPRI > -1) || (-6 > TMIN_INTPRI)
+#error TMIN_INTPRI out of range.
+#endif /* (TMIN_INTPRI > -1) || (-6 > TMIN_INTPRI) */
+
+/*
+ *  å²è¾¼ã¿ã­ãã¯ï¼CPUã­ãã¯ã¸ã®é·ç§»ã§ãã¹ã¯ããã·ã°ãã«ãä¿æããå¤æ°
+ */
+sigset_t	sigmask_intlock;	/* å²è¾¼ã¿ã­ãã¯ã§ãã¹ã¯ããã·ã°ãã« */
+sigset_t	sigmask_cpulock;	/* CPUã­ãã¯ã§ãã¹ã¯ããã·ã°ãã« */
+
+/*
+ *  CPUã­ãã¯ãã©ã°å®ç¾ã®ããã®å¤æ°
+ */
+volatile bool_t		lock_flag;		/* CPUã­ãã¯ãã©ã°ãè¡¨ãå¤æ° */
+volatile sigset_t	saved_sigmask;	/* ã·ã°ãã«ãã¹ã¯ãä¿å­ããå¤æ° */
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å®ç¾ã®ããã®å¤æ°
+ */
+volatile PRI		intpri_value;	/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãè¡¨ãå¤æ° */
+
+/*
+ *  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°å®ç¾ã®ããã®å¤æ°
+ */
+volatile sigset_t	sigmask_disint;	/* åå¥ã«ãã¹ã¯ãã¦ããã·ã°ãã« */
+
+/*
+ *  ãã£ã¹ãããã£æ¬ä½
+ *
+ *  LOG_DSP_LEAVEãï¼dispatcherã«å
+¥ããï¼ãããå¼ã³åºãé¢æ°ã®å´ã«å
+¥ãã¦
+ *  ããçç±ã¯æ¬¡ã®éãï¼LOG_DSP_LEAVEã¯ï¼åæãå¾ã®ã¿ã¹ã¯ã®ã¹ã¿ãã¯ã§å¼
+ *  ã³åºããªããã°ãªããªãããï¼_longjmpãå®è¡ããå¾ã«å¼ã³åºãå¿
+è¦ãã
+ *  ãï¼dispatcherãå¼ã³åºãé¢æ°ã®å´ã«å
+¥ããªããã°ãªããªãï¼
+ */
+static void
+dispatcher(void)
+{
+	sigset_t	sigmask;
+
+	p_runtsk = p_schedtsk;
+	if (p_runtsk != NULL) {
+		_longjmp(p_runtsk->tskctxb.env, 1);
+		assert(0);
+	}
+
+	/*
+	 *  ã¢ã¤ãã«å¦ç
+	 *
+	 *  ã¾ãï¼CPUã­ãã¯ç¶æ
+ãè§£é¤ããæºåãããï¼sigmaskã«ã¯ï¼CPUã­ãã¯
+	 *  ç¶æ
+ã«é·ç§»ããåã®ã·ã°ãã«ãã¹ã¯ãåãåºãï¼ã«ã¼ãã«å
+¥ãåã®
+	 *  sigprocmaskã¯ä¸è¦ã«æãããï¼ç¡ãã¨æ­£ããåä½ããªãï¼
+	 */
+	lock_flag = false;
+	sigassignset(&sigmask, &saved_sigmask);
+	sigprocmask(SIG_SETMASK, &sigmask, NULL);
+	while (true) {
+		sigsuspend(&sigmask);			/* å²è¾¼ã¿å¾
+ã¡ */
+	}
+}
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã¸ã®ãã£ã¹ããã
+ */
+void
+dispatch(void)
+{
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	ovrtimer_stop();					/* ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	if (_setjmp(p_runtsk->tskctxb.env) == 0) {
+		LOG_DSP_ENTER(p_runtsk);
+		dispatcher();
+		assert(0);
+	}
+	LOG_DSP_LEAVE(p_runtsk);
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	ovrtimer_start();					/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+}
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã¸ã®ãã£ã¹ãããï¼ã·ã°ãã«ãã³ãã©ç¨ï¼
+ */
+static void
+dispatch_handler(int sig, struct __siginfo *p_info, void *p_ctx)
+{
+	/*
+	 *  ã·ã°ãã«ãã³ãã©ã®å®è¡éå§åã®ã·ã°ãã«ãã¹ã¯ãsaved_sigmaskã«ä»£
+	 *  å
+¥ãï¼CPUã­ãã¯ç¶æ
+ã«é·ç§»ããï¼
+	 */
+	sigassignset(&saved_sigmask, &(((ucontext_t *) p_ctx)->uc_sigmask));
+	lock_flag = true;
+
+	if (p_runtsk != p_schedtsk) {
+		if (p_runtsk != NULL) {
+			if (_setjmp(p_runtsk->tskctxb.env) == 0) {
+				LOG_DSP_ENTER(p_runtsk);
+				dispatcher();
+				assert(0);
+			}
+		}
+		else {
+			dispatcher();
+			assert(0);
+		}
+		LOG_DSP_LEAVE(p_runtsk);
+	}
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	ovrtimer_start();					/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+	/*
+	 *  ã·ã°ãã«ãã³ãã©ããã®ãªã¿ã¼ã³å¾ã®ã·ã°ãã«ãã¹ã¯ãsaved_sigmask
+	 *  ã«ãªãããã«è¨­å®ãï¼CPUã­ãã¯ç¶æ
+ãè§£é¤ããï¼
+	 */
+	lock_flag = false;
+	sigassignset(&(((ucontext_t *) p_ctx)->uc_sigmask), &saved_sigmask);
+}
+
+/*
+ *  ç¾å¨ã®ã³ã³ãã­ã¹ããæ¨ã¦ã¦ãã£ã¹ããã
+ */
+void
+exit_and_dispatch(void)
+{
+	LOG_DSP_ENTER(p_runtsk);
+	dispatcher();
+	assert(0);
+}
+
+/*
+ *  ã«ã¼ãã«ã®çµäºå¦çã®å¼åºã
+ */
+void
+call_exit_kernel(void)
+{
+	sigset_t			sigmask;
+	struct sigaction	sigact;
+
+	/*
+	 *  SIGUSR2ã®ã·ã°ãã«ãã³ãã©ã«exit_kernelãç»é²
+	 */
+	sigact.sa_handler = (void (*)(int)) exit_kernel;
+	sigact.sa_flags = SA_ONSTACK;
+	sigemptyset(&(sigact.sa_mask));
+	sigaction(SIGUSR2, &sigact, NULL);
+
+	/*
+	 *  SIGUSR2ã®ãã¹ã¯ãè§£é¤
+	 */
+	sigemptyset(&sigmask);
+	sigaddset(&sigmask, SIGUSR2);
+	sigprocmask(SIG_UNBLOCK, &sigmask, NULL);
+
+	/*
+	 *  exit_kernelã®å¼åºã
+	 */
+	raise(SIGUSR2);
+	assert(0);
+	while (true);
+}
+
+/*
+ *  ã¿ã¹ã¯éå§æå¦ç
+ */
+void
+start_r(void)
+{
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	ovrtimer_start();					/* ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	unlock_cpu();
+	(*(p_runtsk->p_tinib->task))(p_runtsk->p_tinib->exinf);
+	(void) ext_tsk();
+	assert(0);
+}
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®åæå
+ */
+void
+target_initialize(void)
+{
+	struct sigaction	sigact;
+
+	/*
+	 *  å²è¾¼ã¿ã­ãã¯ã¸ã®é·ç§»ã§ãã¹ã¯ããã·ã°ãã«ãä¿æããå¤æ°ã®åæå
+	 */
+	sigassignset(&sigmask_intlock, &(sigmask_table[6]));
+	sigaddset(&sigmask_intlock, SIGUSR2);
+
+	/*
+	 *  CPUã­ãã¯ã¸ã®é·ç§»ã§ãã¹ã¯ããã·ã°ãã«ãä¿æããå¤æ°ã®åæå
+	 */
+	sigassignset(&sigmask_cpulock, &(sigmask_table[-TMIN_INTPRI]));
+	sigaddset(&sigmask_cpulock, SIGUSR2);
+
+	/*
+	 *  CPUã­ãã¯ãã©ã°å®ç¾ã®ããã®å¤æ°ã®åæå
+	 *
+	 *  saved_sigmaskã¯ï¼ã«ã¼ãã«èµ·åæã«å¼ã³åºãset_sigmaskã§åæåã
+	 *  ããï¼
+	 */
+	lock_flag = true;
+
+	/*
+	 *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å®ç¾ã®ããã®å¤æ°ã®åæå
+	 */
+	intpri_value = TIPM_ENAALL;
+
+	/*
+	 *  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°å®ç¾ã®ããã®å¤æ°ã®åæå
+	 */
+	sigassignset(&sigmask_disint, &sigmask_disint_init);
+
+	/*
+	 *  SIGUSR2ã®ã·ã°ãã«ãã³ãã©ã«ãã£ã¹ãããã£ãç»é²
+	 */
+	sigact.sa_sigaction = dispatch_handler;
+	sigact.sa_flags = SA_SIGINFO;
+	sigassignset(&(sigact.sa_mask), &sigmask_cpulock);
+	sigaction(SIGUSR2, &sigact, NULL);
+}
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®çµäºå¦ç
+ */
+void
+target_exit(void)
+{
+	/*
+	 *  ãã­ã»ã¹ã®çµäºå¦ç
+	 */
+	exit(0);
+}
+
+/*
+ *  ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®ããã®æå­åºå
+ */
+void
+target_fput_log(char c)
+{
+	write(STDERR_FILENO, &c, 1);
+}
+
+/*
+ *  å²è¾¼ã¿ç®¡çæ©è½ã®åæå
+ */
+void
+initialize_interrupt(void)
+{
+	uint_t			i;
+	const INHINIB	*p_inhinib;
+
+	for (i = 0; i < tnum_def_inhno; i++) {
+		p_inhinib = &(inhinib_table[i]);
+		define_inh(p_inhinib->inhno, p_inhinib->int_entry, p_inhinib->intpri);
+	}
+}
+
+/*
+ *  ã¡ã¤ã³é¢æ°
+ */
+int
+main()
+{
+	sigset_t			sigmask;
+	stack_t				ss;
+	struct sigaction	sigact;
+
+	/*
+	 *  SIGUSR2ä»¥å¤ã®ãã¹ã¦ã®ã·ã°ãã«ããã¹ã¯
+	 */
+	sigfillset(&sigmask);
+	sigdelset(&sigmask, SIGUSR2);
+	sigprocmask(SIG_BLOCK, &sigmask, NULL);
+
+	/*
+	 *  ã·ã°ãã«ã¹ã¿ãã¯ï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯ï¼ã®è¨­å®
+	 */
+	ss.ss_sp = (char *)(istk);
+	ss.ss_size = (int)(istksz);
+	ss.ss_flags = 0;
+	sigaltstack(&ss, NULL);
+
+	/*
+	 *  SIGUSR2ã®ã·ã°ãã«ãã³ãã©ã«sta_kerãç»é²
+	 */
+	sigact.sa_handler = (void (*)(int)) sta_ker;
+	sigact.sa_flags = SA_ONSTACK;
+	sigemptyset(&(sigact.sa_mask));
+	sigaction(SIGUSR2, &sigact, NULL);
+
+	/*
+	 *  sta_kerã®å¼åºã
+	 */
+	raise(SIGUSR2);
+
+	/*
+	 *  ãã£ã¹ãããã£ã®åä½éå§
+	 *
+	 *  target_initializeã§ï¼lock_flagãtrueã«ï¼intpri_valueã
+	 *  TIPM_ENAALLã«åæåãã¦ããããï¼set_sigmaskãå¼ã³åºãã¦ã·ã°ã
+	 *  ã«ãã¹ã¯ã¨saved_sigmaskãè¨­å®ãããã¨ã§ï¼CPUã­ãã¯ç¶æ
+ã»ï¼ã¢ã
+	 *  ã«ä¸ã®ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãTIPM_ENAALLã®ç¶æ
+ã«ãªãï¼
+	 *
+	 *  ã¾ãï¼initialize_taskã§enadspãtrueã«åæåãã¦ããããï¼ãã£
+	 *  ã¹ãããè¨±å¯ç¶æ
+ã«ãªã£ã¦ããï¼
+	 */
+	set_sigmask();
+	dispatcher();
+	assert(0);
+	return(0);
+}
+
+/*
+ *  ã«ã¼ãã«ã®å²ãä»ããã¡ã¢ãªé åã®ç®¡ç
+ *
+ *  TLSFï¼ãªã¼ãã³ã½ã¼ã¹ã®ã¡ã¢ãªç®¡çã©ã¤ãã©ãªï¼ãç¨ãã¦å®ç¾ï¼
+ */
+#ifdef TOPPERS_SUPPORT_DYNAMIC_CRE
+
+#include "tlsf.h"
+
+static bool_t	tlsf_initialized = false;
+
+void
+initialize_kmm(void)
+{
+	if (init_memory_pool(kmmsz, kmm) != -1) {
+		tlsf_initialized = true;
+	}
+}
+
+void *
+kernel_malloc(size_t size)
+{
+	if (tlsf_initialized) {
+		return(malloc_ex(size, kmm));
+	}
+	else {
+		return(NULL);
+	}
+}
+
+void
+kernel_free(void *ptr)
+{
+	if (tlsf_initialized) {
+		free_ex(ptr, kmm);
+	}
+}
+
+#endif /* TOPPERS_SUPPORT_DYNAMIC_CRE */
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_kernel_impl.h
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_kernel_impl.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_kernel_impl.h	(revision 302)
@@ -0,0 +1,762 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: target_kernel_impl.h 479 2016-01-03 07:28:41Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ï¼Mac OS Xç¨ï¼
+ *
+ *  ã«ã¼ãã«ã®ã¿ã¼ã²ããä¾å­é¨ã®ããããã¡ã¤ã«ï¼kernel_impl.hã®ã¿ã¼ã²ã
+ *  ãä¾å­é¨ã®ä½ç½®ä»ãã¨ãªãï¼
+ */
+
+#ifndef TOPPERS_TARGET_KERNEL_IMPL_H
+#define TOPPERS_TARGET_KERNEL_IMPL_H
+
+/*
+ *  æ¨æºã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«
+ */
+#ifndef TOPPERS_MACRO_ONLY
+#include <sys/types.h>
+#include <stdlib.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdio.h>
+
+#include <kernel.h>
+#include <t_syslog.h>
+#ifdef TOPPERS_SUPPORT_OVRHDR
+#include "overrun.h"
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ã¿ã¼ã²ããã·ã¹ãã ã®OSä¾å­ã®å®ç¾©
+ */
+#include "macosx.h"
+
+/*
+ *  ã¿ã¼ã²ããå®ç¾©ã®ãªãã¸ã§ã¯ãå±æ§
+ */
+#define TARGET_INHATR	TA_NONKERNEL	/* ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ */
+
+/*
+ *  ã¨ã©ã¼ãã§ãã¯æ¹æ³ã®æå®
+ */
+#define CHECK_STKSZ_ALIGN	16	/* ã¹ã¿ãã¯ãµã¤ãºã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_INTPTR_ALIGN	4	/* intptr_tåã®å¤æ°ã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_INTPTR_NONNULL	/* intptr_tåã®å¤æ°ã®éNULLãã§ãã¯ */
+#define CHECK_FUNC_ALIGN	4	/* é¢æ°ã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_FUNC_NONNULL		/* é¢æ°ã®éNULLãã§ãã¯ */
+#define CHECK_STACK_ALIGN	16	/* ã¹ã¿ãã¯é åã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_STACK_NONNULL		/* ã¹ã¿ãã¯é åã®éNULLãã§ãã¯ */
+#define CHECK_MPF_ALIGN		4	/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®ã¢ã©ã¤ã³åä½ */
+#define CHECK_MPF_NONNULL		/* åºå®é·ã¡ã¢ãªãã¼ã«é åã®éNULLãã§ãã¯ */
+#define CHECK_MB_ALIGN		4	/* ç®¡çé åã®ã¢ã©ã¤ã³åä½ */
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã«é¢ããè¨­å®
+ */
+#ifdef TOPPERS_ENABLE_TRACE
+#include "arch/logtrace/trace_config.h"
+#endif /* TOPPERS_ENABLE_TRACE */
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ãã¯ã­ã®ããã©ã«ãå®ç¾©
+ */
+#ifndef LOG_INH_ENTER
+#define LOG_INH_ENTER(inhno)
+#endif /* LOG_INH_ENTER */
+
+#ifndef LOG_INH_LEAVE
+#define LOG_INH_LEAVE(inhno)
+#endif /* LOG_INH_LEAVE */
+
+#ifndef LOG_EXC_ENTER
+#define LOG_EXC_ENTER(excno)
+#endif /* LOG_EXC_ENTER */
+
+#ifndef LOG_EXC_LEAVE
+#define LOG_EXC_LEAVE(excno)
+#endif /* LOG_EXC_LEAVE */
+
+/*
+ *  ã¢ã¼ã­ãã¯ãã£ï¼ãã­ã»ããµï¼ä¾å­ã®å®ç¾©
+ */
+#if defined(__ppc__)
+
+#define JMPBUF_PC				21			/* jmp_bufä¸­ã§ã®PCã®ä½ç½® */
+#define JMPBUF_SP				0			/* jmp_bufä¸­ã§ã®SPã®ä½ç½® */
+#define TASK_STACK_MERGIN		4U
+#define DEFAULT_ISTKSZ			SIGSTKSZ	/* ã·ã°ãã«ã¹ã¿ãã¯ã®ãµã¤ãº */
+
+#elif defined(__i386__)
+
+#define JMPBUF_PC				12			/* jmp_bufä¸­ã§ã®PCã®ä½ç½® */
+#define JMPBUF_SP				9			/* jmp_bufä¸­ã§ã®SPã®ä½ç½® */
+#define TASK_STACK_MERGIN		4U 
+#define DEFAULT_ISTKSZ			SIGSTKSZ	/* ã·ã°ãã«ã¹ã¿ãã¯ã®ãµã¤ãº */
+
+#elif defined(__x86_64__)
+
+#error architecture not supported
+#define JMPBUF_PC				7			/* jmp_bufä¸­ã§ã®PCã®ä½ç½® */
+#define JMPBUF_SP				2			/* jmp_bufä¸­ã§ã®SPã®ä½ç½® */
+#define TASK_STACK_MERGIN		8U 
+#define DEFAULT_ISTKSZ			SIGSTKSZ	/* ã·ã°ãã«ã¹ã¿ãã¯ã®ãµã¤ãº */
+
+#else
+#error architecture not supported
+#endif
+
+/* 
+ *  æ¨æºã®å²è¾¼ã¿ç®¡çæ©è½ã®åæåãè¡ããªãããã®å®ç¾©
+ */
+#define OMIT_INITIALIZE_INTERRUPT
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ããã­ãã¯ã®å®ç¾©
+ */
+typedef struct task_context_block {
+	jmp_buf		env;			/* ã³ã³ãã­ã¹ãæ
+å ± */
+} TSKCTXB;
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©åæåãã­ãã¯
+ *
+ *  æ¨æºã®å²è¾¼ã¿ãã³ãã©åæåãã­ãã¯ã«ï¼å²è¾¼ã¿åªå
+åº¦ãè¿½å ãããã®ï¼
+ */
+typedef struct interrupt_handler_initialization_block {
+	INHNO		inhno;			/* å²è¾¼ã¿ãã³ãã©çªå· */
+	ATR			inhatr;			/* å²è¾¼ã¿ãã³ãã©å±æ§ */
+	FP			int_entry;		/* å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦çã®çªå° */
+	PRI			intpri;			/* å²è¾¼ã¿åªå
+åº¦ */
+} INHINIB;
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©çªå·ã®æ°ï¼kernel_cfg.cï¼
+ */
+extern const uint_t	tnum_def_inhno;
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©åæåãã­ãã¯ã®ã¨ãªã¢ï¼kernel_cfg.cï¼
+ */
+extern const INHINIB	inhinib_table[];
+
+/*
+ *  ã·ã°ãã«ã»ããæä½ãã¯ã­
+ */
+#define sigequalset(set1, set2)		(*(set1) == *(set2))
+#define sigassignset(set1, set2)	(*(set1) = *(set2))
+#define sigjoinset(set1, set2)		(*(set1) |= *(set2))
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã«ããã·ã°ãã«ãã¹ã¯ï¼kernel_cfg.cï¼
+ *
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã«ãã£ã¦ãã¹ã¯ããã¦ããå²è¾¼ã¿ã¨ï¼å²è¾¼ã¿å±æ§ãè¨­
+ *  å®ããã¦ããªãå²è¾¼ã¿ã«å¯¾å¿ããã·ã°ãã«ããã¹ã¯ããããã®ã·ã°ãã«ã
+ *  ã¹ã¯ãä¿æããé
+åï¼é
+åã®ã¤ã³ããã¯ã¹ã¯ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®ç¬¦å·
+ *  ãåè»¢ãããã®ï¼
+ *
+ *  sigmask_table[0]ï¼å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªãå²è¾¼ã¿ã«å¯¾å¿ããã·ã°
+ *                    ãã«ã®ã¿ããã¹ã¯ããã·ã°ãã«ãã¹ã¯
+ *  sigmask_table[-TMIN_INTPRI]ï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ãã¹ã¦ã¨ï¼å²è¾¼ã¿å±
+ *                    æ§ãè¨­å®ããã¦ããªãå²è¾¼ã¿ã«å¯¾å¿ããã·ã°ãã«ãã
+ *                    ã¹ã¯ããã·ã°ãã«ãã¹ã¯
+ *  sigmask_table[6]ï¼NMIã¨SIGUSR2ãé¤ããã¹ã¦ã®å²è¾¼ã¿ã¨ï¼å²è¾¼ã¿å±æ§ãè¨­
+ *                    å®ããã¦ããªãå²è¾¼ã¿ã«å¯¾å¿ããã·ã°ãã«ããã¹ã¯ãã
+ *                    ã·ã°ãã«ãã¹ã¯
+ *  sigmask_table[7]ï¼sigmask_table[6]ã¨åãå¤
+ */
+extern const sigset_t sigmask_table[8];
+
+/*
+ *  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°å®ç¾ã®ããã®å¤æ°ã®åæå¤ï¼kernel_cfg.cï¼
+ */
+extern const sigset_t sigmask_disint_init;
+
+/*
+ *  å²è¾¼ã¿ã­ãã¯ï¼CPUã­ãã¯ã¸ã®ç§»è¡ã§ãã¹ã¯ããã·ã°ãã«ãä¿æããå¤æ°
+ */
+extern sigset_t	sigmask_intlock;	/* å²è¾¼ã¿ã­ãã¯ã§ãã¹ã¯ããã·ã°ãã« */
+extern sigset_t	sigmask_cpulock;	/* CPUã­ãã¯ã§ãã¹ã¯ããã·ã°ãã« */
+
+/*
+ *  ã³ã³ãã­ã¹ãã®åç
+§
+ */
+Inline bool_t
+sense_context(void)
+{
+	stack_t	ss;
+
+	sigaltstack(NULL, &ss);
+	return((ss.ss_flags & SA_ONSTACK) != 0);
+}
+
+/*
+ *  CPUã­ãã¯ãã©ã°å®ç¾ã®ããã®å¤æ°
+ */
+extern volatile bool_t		lock_flag;		/* CPUã­ãã¯ãã©ã°ãè¡¨ãå¤æ° */
+extern volatile sigset_t	saved_sigmask;	/* ã·ã°ãã«ãã¹ã¯ãä¿å­ããå¤æ° */
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å®ç¾ã®ããã®å¤æ°
+ */
+extern volatile PRI			intpri_value;	/* å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãè¡¨ãå¤æ° */
+
+/*
+ *  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°å®ç¾ã®ããã®å¤æ°
+ */
+extern volatile sigset_t	sigmask_disint;	/* åå¥ã«ãã¹ã¯ãã¦ããã·ã°ãã« */
+
+/*
+ *  ã·ã°ãã«ãã¹ã¯ã®è¨­å®
+ *
+ *  ç¾å¨ã®ç¶æ
+ï¼ã³ã³ãã­ã¹ãï¼CPUã­ãã¯ãã©ã°ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼å²è¾¼
+ *  ã¿ç¦æ­¢ãã©ã°ï¼ãåç
+§ãã¦ï¼ç¾å¨ã®ã·ã°ãã«ãã¹ã¯ã¨saved_sigmaskãé©å
+ *  ãªå¤ã«è¨­å®ããï¼
+ */
+Inline void
+set_sigmask(void)
+{
+	sigset_t	sigmask;
+
+	sigassignset(&sigmask, &(sigmask_table[-intpri_value]));
+	sigjoinset(&sigmask, &sigmask_disint);
+	if (sense_context()) {
+		sigaddset(&sigmask, SIGUSR2);
+	}
+	if (lock_flag) {
+		sigassignset(&saved_sigmask, &sigmask);
+		sigjoinset(&sigmask, &sigmask_cpulock);
+	}
+	sigprocmask(SIG_SETMASK, &sigmask, NULL);
+}
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã¸ã®ç§»è¡
+ */
+Inline void
+lock_cpu(void)
+{
+	assert(!lock_flag);
+	sigprocmask(SIG_BLOCK, &sigmask_cpulock, (sigset_t *) &saved_sigmask);
+	lock_flag = true;
+}
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã¸ã®ç§»è¡ï¼ãã£ã¹ãããã§ããç¶æ
+ï¼
+ */
+#define lock_cpu_dsp()		lock_cpu()
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®è§£é¤
+ */
+Inline void
+unlock_cpu(void)
+{
+	assert(lock_flag);
+	lock_flag = false;
+	sigprocmask(SIG_SETMASK, (sigset_t *) &saved_sigmask, NULL);
+}
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®è§£é¤ï¼ãã£ã¹ãããã§ããç¶æ
+ï¼
+ */
+#define unlock_cpu_dsp()	unlock_cpu()
+
+/*
+ *  CPUã­ãã¯ç¶æ
+ã®åç
+§
+ */
+Inline bool_t
+sense_lock(void)
+{
+	return(lock_flag);
+}
+
+/*
+ *  å²è¾¼ã¿ãåãä»ããããã®é
+å»¶å¦ç
+ */
+Inline void
+delay_for_interrupt(void)
+{
+}
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®è¨­å®
+ */
+Inline void
+t_set_ipm(PRI intpri)
+{
+	intpri_value = intpri;
+	set_sigmask();
+}
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ã®åç
+§
+ */
+Inline PRI
+t_get_ipm(void)
+{
+	return(intpri_value);
+}
+
+/*
+ *  å²è¾¼ã¿çªå·ã®ç¯å²ã®å¤å®
+ */
+#define	VALID_INTNO(intno)	(1 <= (intno) && (intno) <= 30 \
+								&& (intno) != SIGKILL && (intno) != SIGSTOP)
+
+/*
+ *  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ã»ãã
+ *
+ *  å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªãå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦å²è¾¼ã¿è¦æ±ç¦æ­¢
+ *  ãã©ã°ãã»ãããããã¨ããå ´åã«ã¯ï¼falseãè¿ãï¼
+ */
+Inline bool_t
+disable_int(INTNO intno)
+{
+	if (sigismember(&(sigmask_table[0]), intno)
+				|| !sigismember(&(sigmask_table[7]), intno)) {
+		return(false);
+	}
+	sigaddset(&sigmask_disint, intno);
+	set_sigmask();
+	return(true);
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ç¦æ­¢ãã©ã°ã®ã¯ãªã¢
+ *
+ *  å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªãå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦å²è¾¼ã¿è¦æ±ç¦æ­¢
+ *  ãã©ã°ãã¯ãªã¢ãããã¨ããå ´åã«ã¯ï¼falseãè¿ãï¼
+ */
+Inline bool_t
+enable_int(INTNO intno)
+{
+	if (sigismember(&(sigmask_table[0]), intno)
+				|| !sigismember(&(sigmask_table[7]), intno)) {
+		return(false);
+	}
+	sigdelset(&sigmask_disint, intno);
+	set_sigmask();
+	return(true);
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã®ã¯ãªã¢
+ */
+Inline void
+clear_int(INTNO intno)
+{
+}
+
+/*
+ *  å²è¾¼ã¿è¦æ±ã®ãã§ãã¯
+ */
+Inline bool_t
+probe_int(INTNO intno)
+{
+	sigset_t	sigmask;
+
+	sigpending(&sigmask);
+	return(sigismember(&sigmask, intno));
+}
+
+/*
+ *  æé«åªå
+é ä½ã¿ã¹ã¯ã¸ã®ãã£ã¹ããã
+ *
+ *  dispatchã¯ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºããããµã¼ãã¹ã³ã¼ã«å¦çã
+ *  ãå¼ã³åºãã¹ããã®ã§ï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã»CPUã­ãã¯ç¶æ
+ã»ãã£ã¹ãã
+ *  ãè¨±å¯ç¶æ
+ã»ï¼ã¢ãã«ä¸ã®ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§å¼ã³åºããª
+ *  ããã°ãªããªãï¼
+ */
+extern void	dispatch(void);
+
+/*
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®ãã£ã¹ãããè¦æ±
+ */
+#define request_dispatch()
+
+/*
+ *  ãã£ã¹ãããã£ã®åä½éå§
+ *
+ *  start_dispatchãreturnã«ãã¯ã­å®ç¾©ãããã¨ã§ï¼ã«ã¼ãã«ã®åæåå®äº
+ *  å¾ã«sta_kerããmainã«ãªã¿ã¼ã³ããï¼ã·ã°ãã«ã¹ã¿ãã¯ããå
+ã®ã¹ã¿ãã¯
+ *  ã«æ»ãï¼
+ */
+#define start_dispatch()	return
+
+/*
+ *  ç¾å¨ã®ã³ã³ãã­ã¹ããæ¨ã¦ã¦ãã£ã¹ããã
+ *
+ *  exit_and_dispatchã¯ï¼ext_tskããå¼ã³åºãã¹ããã®ã§ï¼ã¿ã¹ã¯ã³ã³ãã­
+ *  ã¹ãã»CPUã­ãã¯ç¶æ
+ã»ãã£ã¹ãããè¨±å¯ç¶æ
+ã»ï¼ã¢ãã«ä¸ã®ï¼å²è¾¼ã¿åªå
+
+ *  åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã§å¼ã³åºããªããã°ãªããªãï¼
+ */
+extern void	exit_and_dispatch(void);
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©åºå£å¦ç
+ */
+extern void	ret_int(void);
+
+/*
+ *  CPUä¾å¤ãã³ãã©åºå£å¦ç
+ */
+extern void	ret_exc(void);
+
+/*
+ *  ã«ã¼ãã«ã®çµäºå¦çã®å¼åºã
+ *
+ *  call_exit_kernelã¯ï¼ã«ã¼ãã«ã®çµäºæã«å¼ã³åºãã¹ããã®ã§ï¼éã¿ã¹ã¯
+ *  ã³ã³ãã­ã¹ãã«åãæãã¦ï¼ã«ã¼ãã«ã®çµäºå¦çï¼exit_kernelï¼ãå¼ã³åº
+ *  ãï¼
+ */
+extern void call_exit_kernel(void) NoReturn;
+
+/*
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãã®åæå
+ *
+ *  ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã«ç§»è¡ããæã«å¼ã°ããï¼ãã®æç¹
+ *  ã§ã¹ã¿ãã¯é åãä½¿ã£ã¦ã¯ãªããªãï¼
+ *
+ *  activate_contextãï¼ã¤ã³ã©ã¤ã³é¢æ°ã§ã¯ãªããã¯ã­å®ç¾©ã¨ãã¦ããã®ã¯ï¼
+ *  ãã®æç¹ã§ã¯TCBãå®ç¾©ããã¦ããªãããã§ããï¼
+ */
+extern void	start_r(void);
+
+#define activate_context(p_tcb)											\
+{																		\
+	((intptr_t *) &((p_tcb)->tskctxb.env))[JMPBUF_PC]					\
+											= (intptr_t) start_r;		\
+	((intptr_t *) &((p_tcb)->tskctxb.env))[JMPBUF_SP]					\
+						= (intptr_t)((char *)((p_tcb)->p_tinib->stk)	\
+										+ (p_tcb)->p_tinib->stksz		\
+										- TASK_STACK_MERGIN);			\
+}
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©çªå·ã¨CPUä¾å¤ãã³ãã©çªå·ã®ç¯å²ã®å¤å®
+ */
+#define VALID_INHNO(inhno)		VALID_INTNO((INTNO)(inhno))
+#define VALID_EXCNO(excno)		VALID_INTNO((INTNO)(excno))
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©ã®è¨­å®
+ *
+ *  ãã¯ãã«çªå·inhnoã®å²è¾¼ã¿ãã³ãã©ã®åºå
+¥å£å¦çã®çªå°ãint_entryã«ï¼
+ *  å²è¾¼ã¿åªå
+åº¦ãintpriã«è¨­å®ããï¼
+ */
+Inline void
+define_inh(INHNO inhno, FP int_entry, PRI intpri)
+{
+	struct sigaction	sigact;
+
+	assert(VALID_INHNO(inhno));
+	sigact.sa_sigaction =
+				(void (*)(int, struct __siginfo *, void *))(int_entry);
+	sigact.sa_flags = (SA_ONSTACK | SA_SIGINFO);
+	sigassignset(&(sigact.sa_mask), &(sigmask_table[-intpri]));
+	sigaddset(&(sigact.sa_mask), SIGUSR2);
+	sigaction(inhno, &sigact, NULL);
+}
+
+/*
+ *  CPUä¾å¤ãã³ãã©ã®è¨­å®
+ *
+ *  ãã¯ãã«çªå·excnoã®CPUä¾å¤ãã³ãã©ã®åºå
+¥å£å¦çã®çªå°ãexc_entryã«è¨­
+ *  å®ããï¼
+ *
+ *  SA_NODEFERã«ããï¼ã·ã°ãã«ãã³ãã©ã®èµ·åæã«ï¼ãã®ã·ã°ãã«ããã¹ã¯
+ *  ããã®ãææ­¢ãã¦ããï¼
+ */
+Inline void
+define_exc(EXCNO excno, FP exc_entry)
+{
+	struct sigaction	sigact;
+
+	assert(VALID_EXCNO(excno));
+	sigact.sa_sigaction =
+				(void (*)(int, struct __siginfo *, void *))(exc_entry);
+	sigact.sa_flags = (SA_ONSTACK | SA_SIGINFO | SA_NODEFER);
+	sigemptyset(&(sigact.sa_mask));
+	sigaddset(&(sigact.sa_mask), SIGUSR2);
+	sigaction(excno, &sigact, NULL);
+}
+
+/*
+ *  ãªã¼ãã©ã³ãã³ãã©åä½éå§ï¼åæ­¢ã®ããã®ãã¯ã­
+ */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+
+#define OVRTIMER_START() do {					\
+			if (_kernel_p_runtsk != NULL) {		\
+				_kernel_ovrtimer_start();		\
+			}									\
+		} while (0)
+
+#define OVRTIMER_STOP()		_kernel_ovrtimer_stop()
+
+#else /* TOPPERS_SUPPORT_OVRHDR */
+
+#define OVRTIMER_START()	((void) 0)
+#define OVRTIMER_STOP()		((void) 0)
+
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+/*
+ *  å²è¾¼ã¿ãã³ãã©ã®å
+¥å£å¦çã®çæãã¯ã­
+ */
+#define INT_ENTRY(inhno, inthdr)	_kernel_##inthdr##_##inhno
+
+#define INTHDR_ENTRY(inhno, inthdr, intpri)								\
+void _kernel_##inthdr##_##inhno(int sig,								\
+						struct __siginfo *p_info, void *p_ctx)			\
+{																		\
+	PRI		saved_intpri;												\
+																		\
+	lock_cpu();															\
+	saved_intpri = _kernel_intpri_value;								\
+	_kernel_intpri_value = intpri;										\
+	if (((ucontext_t *) p_ctx)->uc_onstack == 0) {						\
+		OVRTIMER_STOP();												\
+	}																	\
+	unlock_cpu();														\
+																		\
+	LOG_INH_ENTER(inhno);												\
+	inthdr();					/* å²è¾¼ã¿ãã³ãã©ãå¼ã³åºã */			\
+	LOG_INH_LEAVE(inhno);												\
+																		\
+	if (!sense_lock()) {												\
+		lock_cpu();														\
+	}																	\
+	if (((ucontext_t *) p_ctx)->uc_onstack == 0) {						\
+		if (_kernel_p_runtsk != _kernel_p_schedtsk) {					\
+			raise(SIGUSR2);		/* ãã£ã¹ãããã£ã®èµ·åãè¦æ±ãã */	\
+		}																\
+		else {															\
+			OVRTIMER_START();											\
+		}																\
+	}																	\
+	_kernel_intpri_value = saved_intpri;								\
+	unlock_cpu();														\
+}
+
+/*
+ *  CPUä¾å¤ãã³ãã©ã®å
+¥å£å¦çã®çæãã¯ã­
+ */
+#define EXC_ENTRY(excno, exchdr)	_kernel_##exchdr##_##excno
+
+#define EXCHDR_ENTRY(excno, excno_num, exchdr)								\
+void _kernel_##exchdr##_##excno(int sig,									\
+						struct __siginfo *p_info, void *p_ctx)				\
+{																			\
+	if (exc_sense_nonkernel(p_ctx)) {										\
+		bool_t	saved_lock_flag;											\
+																			\
+		/* ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ãã³ãã©ã®å ´å */							\
+		saved_lock_flag = _kernel_lock_flag;								\
+		exchdr(p_ctx);				/* CPUä¾å¤ãã³ãã©ãå¼ã³åºã */			\
+		_kernel_lock_flag = saved_lock_flag;								\
+	}																		\
+	else {																	\
+		/* ã«ã¼ãã«ç®¡çã®CPUä¾å¤ãã³ãã©ã®å ´å */							\
+		lock_cpu();															\
+		if (((ucontext_t *) p_ctx)->uc_onstack == 0) {						\
+			OVRTIMER_STOP();												\
+		}																	\
+		unlock_cpu();														\
+																			\
+		LOG_EXC_ENTER(excno);												\
+		exchdr(p_ctx);				/* CPUä¾å¤ãã³ãã©ãå¼ã³åºã */			\
+		LOG_EXC_LEAVE(excno);												\
+																			\
+		if (!sense_lock()) {												\
+			lock_cpu();														\
+		}																	\
+		if (((ucontext_t *) p_ctx)->uc_onstack == 0) {						\
+			if (_kernel_p_runtsk != _kernel_p_schedtsk) {					\
+				raise(SIGUSR2);		/* ãã£ã¹ãããã£ã®èµ·åãè¦æ±ãã */	\
+			}																\
+			else {															\
+				OVRTIMER_START();											\
+			}																\
+		}																	\
+		unlock_cpu();														\
+	}																		\
+}
+
+/*
+ *  CPUä¾å¤ã®çºçããæã®ã³ã³ãã­ã¹ãã®åç
+§
+ *
+ *  CPUä¾å¤ã®çºçããæã®ã³ã³ãã­ã¹ããï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã®æã«falseï¼
+ *  ããã§ãªãæã«trueãè¿ãï¼
+ */
+Inline bool_t
+exc_sense_context(void *p_excinf)
+{
+	return(((ucontext_t *) p_excinf)->uc_onstack != 0);
+}
+
+/*
+ *  ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã®å¤å¥
+ *
+ *  ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ã®æã«trueï¼ããã§ãªãæã«falseãè¿ãï¼
+ */
+Inline bool_t
+exc_sense_nonkernel(void *p_excinf)
+{
+	sigset_t	sigmask;
+
+	sigassignset(&sigmask, &(((ucontext_t *) p_excinf)->uc_sigmask));
+	return(sigismember(&sigmask, SIGUSR2));
+}
+
+/*
+ *  CPUä¾å¤ã®çºçããæã®ã³ã³ãã­ã¹ãã¨å²è¾¼ã¿ã®ãã¹ã¯ç¶æ
+ã®åç
+§
+ *
+ *  CPUä¾å¤ã®çºçããæã®ã·ã¹ãã ç¶æ
+ãï¼ã«ã¼ãã«å
+ã®ã¯ãªãã£ã«ã«ã»ã¯ã·ã§
+ *  ã³ã®å®è¡ä¸­ã§ãªãï¼å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§ãªãï¼CPUã­ãã¯ç¶æ
+ã§ãªãï¼ã«ã¼
+ *  ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©å®è¡ä¸­ã§ãªãï¼ã«ã¼ãã«ç®¡çå¤ã®CPUä¾å¤ãã³
+ *  ãã©å®è¡ä¸­ã§ãªãï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãã§ããï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+¨
+ *  è§£é¤ã§ããæã«trueï¼ããã§ãªãæã«falseãè¿ãï¼
+ */
+Inline bool_t
+exc_sense_intmask(void *p_excinf)
+{
+	return(!exc_sense_context(p_excinf) && !exc_sense_nonkernel(p_excinf)
+											&& intpri_value == TIPM_ENAALL);
+}
+
+/*
+ *  ã¿ã¼ã²ããã·ã¹ãã ä¾å­ã®åæå
+ */
+extern void	target_initialize(void);
+
+/*
+ *  ã¿ã¼ã²ããã·ã¹ãã ã®çµäº
+ *
+ *  ã·ã¹ãã ãçµäºããæã«ä½¿ãï¼
+ */
+extern void	target_exit(void) NoReturn;
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ã«ã¼ãã«ã®å²ãä»ããã¡ã¢ãªé åã®ç®¡ç
+ *
+ *  target_kernel_impl.cã«ï¼TLSFï¼ãªã¼ãã³ã½ã¼ã¹ã®ã¡ã¢ãªç®¡çã©ã¤ãã©ãªï¼
+ *  ãç¨ããã¡ã¢ãªç®¡çã«ã¼ãã³ãå«ãã¦ããï¼
+ */
+#define OMIT_KMM_ALLOCONLY
+
+#endif /* TOPPERS_TARGET_KERNEL_IMPL_H */
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_rename.def
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_rename.def	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_rename.def	(revision 302)
@@ -0,0 +1,36 @@
+# kernel_cfg.c
+sigmask_table
+sigmask_disint_init
+
+# target_kernel_impl.c
+sigmask_intlock
+sigmask_cpulock
+lock_flag
+saved_sigmask
+intpri_value
+sigmask_disint
+dispatch
+exit_and_dispatch
+call_exit_kernel
+start_r
+target_initialize
+target_exit
+
+# target_timer.c
+target_timer_initialize
+target_timer_terminate
+target_hrt_get_current
+target_hrt_set_event
+target_hrt_raise_event
+target_ovrtimer_start
+target_ovrtimer_stop
+target_ovrtimer_get_current
+target_timer_handler
+
+# trace_config.c
+log_dsp_enter
+log_dsp_leave
+log_inh_enter
+log_inh_leave
+log_exc_enter
+log_exc_leave
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_rename.h
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_rename.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_rename.h	(revision 302)
@@ -0,0 +1,101 @@
+/* This file is generated from target_rename.def by genrename. */
+
+#ifndef TOPPERS_TARGET_RENAME_H
+#define TOPPERS_TARGET_RENAME_H
+
+/*
+ *  kernel_cfg.c
+ */
+#define sigmask_table				_kernel_sigmask_table
+#define sigmask_disint_init			_kernel_sigmask_disint_init
+
+/*
+ *  target_kernel_impl.c
+ */
+#define sigmask_intlock				_kernel_sigmask_intlock
+#define sigmask_cpulock				_kernel_sigmask_cpulock
+#define lock_flag					_kernel_lock_flag
+#define saved_sigmask				_kernel_saved_sigmask
+#define intpri_value				_kernel_intpri_value
+#define sigmask_disint				_kernel_sigmask_disint
+#define dispatch					_kernel_dispatch
+#define exit_and_dispatch			_kernel_exit_and_dispatch
+#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_timer_initialize		_kernel_target_timer_initialize
+#define target_timer_terminate		_kernel_target_timer_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_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_timer_handler		_kernel_target_timer_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
+
+#ifdef TOPPERS_LABEL_ASM
+
+/*
+ *  kernel_cfg.c
+ */
+#define _sigmask_table				__kernel_sigmask_table
+#define _sigmask_disint_init		__kernel_sigmask_disint_init
+
+/*
+ *  target_kernel_impl.c
+ */
+#define _sigmask_intlock			__kernel_sigmask_intlock
+#define _sigmask_cpulock			__kernel_sigmask_cpulock
+#define _lock_flag					__kernel_lock_flag
+#define _saved_sigmask				__kernel_saved_sigmask
+#define _intpri_value				__kernel_intpri_value
+#define _sigmask_disint				__kernel_sigmask_disint
+#define _dispatch					__kernel_dispatch
+#define _exit_and_dispatch			__kernel_exit_and_dispatch
+#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_timer_initialize	__kernel_target_timer_initialize
+#define _target_timer_terminate		__kernel_target_timer_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_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_timer_handler		__kernel_target_timer_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/macosx_xcode/target_serial.c
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_serial.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_serial.c	(revision 302)
@@ -0,0 +1,320 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2006-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: target_serial.c 102 2014-05-04 15:25:30Z ertl-hiro $
+ */
+
+/*
+ *		ã·ãªã¢ã«I/Oããã¤ã¹ï¼SIOï¼ãã©ã¤ãï¼Mac OS Xç¨ï¼
+ */
+
+#include "macosx.h"
+#include <t_stddef.h>
+#include <t_syslog.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <termios.h>
+#include "target_serial.h"
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãåæåãã­ãã¯ã®å®ç¾©
+ */
+typedef struct sio_port_initialization_block {
+	char		*path;			/* ãã¡ã¤ã«ã®ãã¹å */
+} SIOPINIB;
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®å®ç¾©
+ */
+struct sio_port_control_block {
+	const SIOPINIB *p_siopinib;	/* ã·ãªã¢ã«I/Oãã¼ãåæåãã­ãã¯ */
+	intptr_t	exinf;			/* æ¡å¼µæ
+å ± */
+	bool_t		openflag;		/* ãªã¼ãã³æ¸ã¿ãã©ã° */
+	struct termios saved_term;	/* å
+ã®ç«¯æ«å¶å¾¡æ
+å ± */
+
+	int_t		read_fd;		/* èª­åºãç¨ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ */
+	bool_t		rcv_flag;		/* åä¿¡æå­ãããã¡æå¹ãã©ã° */
+	char		rcv_buf;		/* åä¿¡æå­ãããã¡ */
+	bool_t		rcv_rdy;		/* åä¿¡éç¥ã³ã¼ã«ããã¯è¨±å¯ãã©ã° */
+
+	int_t		write_fd;		/* æ¸è¾¼ã¿ç¨ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ */
+	bool_t		snd_flag;		/* éä¿¡æå­ãããã¡æå¹ãã©ã° */
+	char		snd_buf;		/* éä¿¡æå­ãããã¡ */
+	bool_t		snd_rdy;		/* éä¿¡éç¥ã³ã¼ã«ããã¯è¨±å¯ãã©ã° */
+};
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãåæåãã­ãã¯
+ */
+const SIOPINIB siopinib_table[TNUM_SIOP] = {
+	{ NULL }
+};
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®ã¨ãªã¢
+ */
+SIOPCB	siopcb_table[TNUM_SIOP];
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãIDããç®¡çãã­ãã¯ãåãåºãããã®ãã¯ã­
+ */
+#define INDEX_SIOP(siopid)	((uint_t)((siopid) - 1))
+#define get_siopcb(siopid)	(&(siopcb_table[INDEX_SIOP(siopid)]))
+
+/*
+ *  SIOãã©ã¤ãã®åæå
+ */
+void
+sio_initialize(intptr_t exinf)
+{
+	SIOPCB	*p_siopcb;
+	uint_t	i;
+
+	/*
+	 *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®åæå
+	 */
+	for (i = 0; i < TNUM_SIOP; i++) {
+		p_siopcb = &(siopcb_table[i]);
+		p_siopcb->p_siopinib = &(siopinib_table[i]);
+		p_siopcb->openflag = false;
+	}
+}
+
+/*
+ *  SIOãã©ã¤ãã®çµäºå¦ç
+ */
+void
+sio_terminate(intptr_t exinf)
+{
+	SIOPCB	*p_siopcb;
+	uint_t	i;
+
+	/*
+	 *  ãªã¼ãã³ããã¦ããã·ãªã¢ã«I/Oãã¼ãã®ã¯ã­ã¼ãº
+	 */
+	for (i = 0; i < TNUM_SIOP; i++) {
+		p_siopcb = &(siopcb_table[i]);
+		if (p_siopcb->openflag) {
+			sio_cls_por(p_siopcb);
+		}
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
+ */
+SIOPCB *
+sio_opn_por(ID siopid, intptr_t exinf)
+{
+	SIOPCB			*p_siopcb;
+	const SIOPINIB	*p_siopinib;
+	int_t			fd;
+	struct termios	term;
+
+	p_siopcb = get_siopcb(siopid);
+	p_siopinib = p_siopcb->p_siopinib;
+
+	if (p_siopinib->path != NULL) {
+		fd = open(p_siopinib->path, O_RDWR, 0777);
+		assert(fd >= 0);
+		p_siopcb->read_fd = fd;
+		p_siopcb->write_fd = fd;
+	}
+	else {
+		fd = STDIN_FILENO;					/* æ¨æºå
+¥åºåãä½¿ã */
+		p_siopcb->read_fd = STDIN_FILENO;
+		p_siopcb->write_fd = STDOUT_FILENO;
+	}
+	fcntl(fd, F_SETOWN, getpid());
+	fcntl(fd, F_SETFL, (O_NONBLOCK | O_ASYNC));
+
+	tcgetattr(fd, &(p_siopcb->saved_term));
+	term = p_siopcb->saved_term;
+	term.c_lflag &= ~(ECHO | ICANON);
+	tcsetattr(fd, TCSAFLUSH, &term);
+
+	p_siopcb->exinf = exinf;
+	p_siopcb->rcv_flag = false;
+	p_siopcb->rcv_rdy = false;
+	p_siopcb->snd_flag = false;
+	p_siopcb->snd_rdy = false;
+	p_siopcb->openflag = true;
+	return(p_siopcb);
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ã¯ã­ã¼ãº
+ */
+void
+sio_cls_por(SIOPCB *p_siopcb)
+{
+	int_t	fd;
+
+	fd = p_siopcb->read_fd;
+	tcsetattr(fd, TCSAFLUSH, &(p_siopcb->saved_term));
+	fcntl(fd, F_SETFL, 0);
+
+	if (p_siopcb->p_siopinib->path != NULL) {
+		close(p_siopcb->read_fd);
+	}
+	p_siopcb->openflag = false;
+}
+
+/*
+ *  SIOã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+ */
+void
+sio_isr(intptr_t exinf)
+{
+	SIOPCB	*p_siopcb = &(siopcb_table[0]);
+	int_t	n;
+
+	if (p_siopcb->snd_flag) {
+		if ((n = write(p_siopcb->write_fd, &(p_siopcb->snd_buf), 1)) > 0) {
+			p_siopcb->snd_flag = false;
+			if (p_siopcb->snd_rdy) {
+				sio_irdy_snd(p_siopcb->exinf);
+			}
+		}
+	}
+	if (!p_siopcb->rcv_flag) {
+		if ((n = read(p_siopcb->read_fd, &(p_siopcb->rcv_buf), 1)) > 0) {
+			p_siopcb->rcv_flag = true;
+			if (p_siopcb->rcv_rdy) {
+				sio_irdy_rcv(p_siopcb->exinf);
+			}
+		}
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã¸ã®æå­éä¿¡
+ */
+bool_t
+sio_snd_chr(SIOPCB *p_siopcb, char c)
+{
+	int_t	n;
+
+	if (!p_siopcb->snd_flag) {
+		if ((n = write(p_siopcb->write_fd, &c, 1)) > 0) {
+			return(true);
+		}
+		else {
+			assert(n < 0 && errno == EAGAIN);
+			p_siopcb->snd_flag = true;
+			p_siopcb->snd_buf = c;
+			return(true);
+		}
+	}
+	else {
+		return(false);
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®æå­åä¿¡
+ */
+int_t
+sio_rcv_chr(SIOPCB *p_siopcb)
+{
+	char	c;
+	int_t	n;
+
+	if (p_siopcb->rcv_flag) {
+		p_siopcb->rcv_flag = false;
+		return((int_t)(uint8_t)(p_siopcb->rcv_buf));
+	}
+	else if ((n = read(p_siopcb->read_fd, &c, 1)) > 0) {
+		return((int_t)(uint8_t) c);
+	}
+	else {
+		assert(n < 0 && errno == EAGAIN);
+		return(-1);
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®è¨±å¯
+ */
+void
+sio_ena_cbr(SIOPCB *p_siopcb, uint_t cbrtn)
+{
+	switch (cbrtn) {
+	case SIO_RDY_SND:
+		p_siopcb->snd_rdy = true;
+		break;
+	case SIO_RDY_RCV:
+		p_siopcb->rcv_rdy = true;
+		break;
+	}
+}
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®ç¦æ­¢
+ */
+void
+sio_dis_cbr(SIOPCB *p_siopcb, uint_t cbrtn)
+{
+	switch (cbrtn) {
+	case SIO_RDY_SND:
+		p_siopcb->snd_rdy = false;
+		break;
+	case SIO_RDY_RCV:
+		p_siopcb->rcv_rdy = false;
+		break;
+	}
+}
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_serial.cfg
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_serial.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_serial.cfg	(revision 302)
@@ -0,0 +1,11 @@
+/*
+ *		SIOãã©ã¤ãï¼Mac OS Xç¨ï¼ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: target_serial.cfg 237 2014-09-28 19:17:01Z ertl-hiro $
+ */
+
+#include "target_serial.h"
+INCLUDE("unix_sigio.cfg");
+ATT_INI({ TA_NULL, 0, sio_initialize });
+ATT_TER({ TA_NULL, 0, sio_terminate });
+CRE_ISR( ISR_SIO, { TA_NULL, 0, INTNO_SIGIO, sio_isr, 1 });
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_serial.h
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_serial.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_serial.h	(revision 302)
@@ -0,0 +1,140 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2006-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: target_serial.h 102 2014-05-04 15:25:30Z ertl-hiro $
+ */
+
+/*
+ *		ã·ãªã¢ã«I/Oããã¤ã¹ï¼SIOï¼ãã©ã¤ãï¼Mac OS Xç¨ï¼
+ */
+
+#ifndef TOPPERS_TARGET_SERIAL_H
+#define TOPPERS_TARGET_SERIAL_H
+
+#include "macosx.h"
+#include <t_stddef.h>
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãæ°ã®å®ç¾©
+ */
+#define TNUM_SIOP		1		/* ãµãã¼ãããã·ãªã¢ã«I/Oãã¼ãã®æ° */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãç®¡çãã­ãã¯ã®å®ç¾©
+ */
+typedef struct sio_port_control_block	SIOPCB;
+
+/*
+ *  ã³ã¼ã«ããã¯ã«ã¼ãã³ã®è­å¥çªå·
+ */
+#define SIO_RDY_SND		1U		/* éä¿¡å¯è½ã³ã¼ã«ããã¯ */
+#define SIO_RDY_RCV		2U		/* åä¿¡éç¥ã³ã¼ã«ããã¯ */
+
+/*
+ *  SIOãã©ã¤ãã®åæå
+ */
+extern void		sio_initialize(intptr_t exinf);
+
+/*
+ *  SIOãã©ã¤ãã®çµäºå¦ç
+ */
+extern void		sio_terminate(intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
+ */
+extern SIOPCB	*sio_opn_por(ID siopid, intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã®ã¯ã­ã¼ãº
+ */
+extern void		sio_cls_por(SIOPCB *p_siopcb);
+
+/*
+ *  SIOã®å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
+ */
+extern void		sio_isr(intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãã¸ã®æå­éä¿¡
+ */
+extern bool_t	sio_snd_chr(SIOPCB *siopcb, char c);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®æå­åä¿¡
+ */
+extern int_t	sio_rcv_chr(SIOPCB *siopcb);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®è¨±å¯
+ */
+extern void		sio_ena_cbr(SIOPCB *siopcb, uint_t cbrtn);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®ç¦æ­¢
+ */
+extern void		sio_dis_cbr(SIOPCB *siopcb, uint_t cbrtn);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®éä¿¡å¯è½ã³ã¼ã«ããã¯
+ */
+extern void		sio_irdy_snd(intptr_t exinf);
+
+/*
+ *  ã·ãªã¢ã«I/Oãã¼ãããã®åä¿¡éç¥ã³ã¼ã«ããã¯
+ */
+extern void		sio_irdy_rcv(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_TARGET_SERIAL_H */
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_sil.h
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_sil.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_sil.h	(revision 302)
@@ -0,0 +1,133 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  Copyright (C) 2004-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: target_sil.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/*
+ *		sil.hã®ã¿ã¼ã²ããä¾å­é¨ï¼Mac OS Xç¨ï¼
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼sil.hã®å
+é ­ã§ã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡
+ *  ã¤ã«ããã¯ç´æ¥ã¤ã³ã¯ã«ã¼ããããã¨ã¯ãªãï¼ãã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼
+ *  ãããåã«ï¼t_stddef.hãã¤ã³ã¯ã«ã¼ããããã®ã§ï¼ãããã«ä¾å­ãã¦ã
+ *  ããï¼
+ */
+
+#ifndef TOPPERS_TARGET_SIL_H
+#define TOPPERS_TARGET_SIL_H
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  æ¨æºã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«
+ */
+#include <signal.h>
+
+#include <t_stddef.h>
+
+/*
+ *  NMIãé¤ããã¹ã¦ã®å²è¾¼ã¿ã®ç¦æ­¢
+ */
+Inline void
+TOPPERS_dissig(sigset_t *p_sigmask)
+{
+	extern sigset_t	_kernel_sigmask_intlock;
+
+	sigprocmask(SIG_BLOCK, &_kernel_sigmask_intlock, p_sigmask);
+}
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼å
+é¨è¡¨ç¾ï¼ã®ç¾å¨å¤ã®è¨­å®
+ */
+Inline void
+TOPPERS_setsig(sigset_t *p_sigmask)
+{
+	sigprocmask(SIG_SETMASK, p_sigmask, NULL);
+}
+
+/*
+ *  å
+¨å²è¾¼ã¿ã­ãã¯ç¶æ
+ã®å¶å¾¡
+ */
+#define SIL_PRE_LOC		sigset_t TOPPERS_sigmask
+#define SIL_LOC_INT()	(TOPPERS_dissig(&TOPPERS_sigmask))
+#define SIL_UNL_INT()	(TOPPERS_setsig(&TOPPERS_sigmask))
+
+/*
+ *  å¾®å°æéå¾
+ã¡
+ */
+Inline void
+sil_dly_nse(ulong_t dlytim)
+{
+	/*
+	 *  ã·ãã¥ã¬ã¼ã·ã§ã³ç°å¢ã§ã¯æå³ããªãããï¼ä½ãããªãï¼
+	 */
+}
+
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ãã­ã»ããµã®ã¨ã³ãã£ã¢ã³
+ */
+#if defined(__ppc__)
+#define SIL_ENDIAN_BIG				/* ããã°ã¨ã³ãã£ã¢ã³ */
+#elif defined(__i386__) || defined(__x86_64__)
+#define SIL_ENDIAN_LITTLE			/* ãªãã«ã¨ã³ãã£ã¢ã³ */
+#endif
+
+#endif /* TOPPERS_TARGET_SIL_H */
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_stddef.h
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_stddef.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_stddef.h	(revision 302)
@@ -0,0 +1,112 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  Copyright (C) 2004-2009 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: target_stddef.h 293 2014-11-30 09:27:54Z ertl-hiro $
+ */
+
+/*
+ *		t_stddef.hã®ã¿ã¼ã²ããä¾å­é¨ï¼Mac OS Xç¨ï¼
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼t_stddef.hã®å
+é ­ã§ã¤ã³ã¯ã«ã¼ããããï¼
+ *  ä»ã®ãã¡ã¤ã«ããã¯ç´æ¥ã¤ã³ã¯ã«ã¼ããããã¨ã¯ãªãï¼ä»ã®ã¤ã³ã¯ã«ã¼ã
+ *  ãã¡ã¤ã«ã«å
+ç«ã£ã¦å¦çãããããï¼ä»ã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã«ä¾å­ã
+ *  ã¦ã¯ãªããªãï¼
+ */
+
+#ifndef TOPPERS_TARGET_STDDEF_H
+#define TOPPERS_TARGET_STDDEF_H
+
+/*
+ *  ã¿ã¼ã²ãããè­å¥ããããã®ãã¯ã­ã®å®ç¾©
+ */
+#define TOPPERS_MACOSX				/* ã·ã¹ãã ç¥ç§° */
+
+/*
+ *  éçºç°å¢ã§å
+±éãªå®ç¾©
+ */
+#define TOPPERS_STDFLOAT_TYPE1
+#include "tool_stddef.h"
+
+/*
+ *  éçºç°å¢ã®æ¨æºã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã®å©ç¨
+ *
+ *  C99äºæã®æ´æ°åã®å®ç¾©ãstdint.hããåãè¾¼ãï¼stdlib.hã¯ï¼abortã®å®£
+ *  è¨ãåãè¾¼ãããã«ã¤ã³ã¯ã«ã¼ããã¦ããï¼
+ */
+#ifndef TOPPERS_MACRO_ONLY
+#include <stdint.h>
+#include <stdlib.h>
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ã¢ãµã¼ã·ã§ã³ã®å¤±ææã®å®è¡ä¸­æ­å¦ç
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+Inline void
+TOPPERS_assert_abort(void)
+{
+	abort();
+}
+
+/*
+ *  software_init_hookã¨software_term_hookãå¼ã³åºãããã®å®£è¨
+ */
+extern void	software_init_hook(void) __attribute__((constructor));
+extern void	software_term_hook(void) __attribute__((destructor));
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_TARGET_STDDEF_H */
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_syssvc.h
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_syssvc.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_syssvc.h	(revision 302)
@@ -0,0 +1,102 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2006-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: target_syssvc.h 293 2014-11-30 09:27:54Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­é¨ï¼Mac OS Xç¨ï¼
+ *
+ *  ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ï¼ãã®ãã¡
+ *  ã¤ã«ã®å
+å®¹ã¯ï¼ã³ã³ãã¼ãã³ãè¨è¿°ãã¡ã¤ã«ã«è¨è¿°ããï¼ãã®ãã¡ã¤ã«ã¯
+ *  ç¡ããªãè¦è¾¼ã¿ï¼
+ */
+
+#ifndef TOPPERS_TARGET_SYSSVC_H
+#define TOPPERS_TARGET_SYSSVC_H
+
+/*
+ *  ã¿ã¼ã²ããã·ã¹ãã ã®OSä¾å­ã®å®ç¾©
+ */
+#include "macosx.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã«é¢ããè¨­å®
+ */
+#ifdef TOPPERS_ENABLE_TRACE
+#include "arch/logtrace/trace_config.h"
+#endif /* TOPPERS_ENABLE_TRACE */
+
+/*
+ *  èµ·åã¡ãã»ã¼ã¸ã®ã¿ã¼ã²ããã·ã¹ãã å
+ */
+#define TARGET_NAME	"Mac OS X"
+
+/*
+ *  ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®ããã®æå­åºå
+ *
+ *  ã¿ã¼ã²ããä¾å­ã®æ¹æ³ã§ï¼æå­cãè¡¨ç¤º/åºå/ä¿å­ããï¼
+ */
+extern void	target_fput_log(char c);
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãæ°ã®å®ç¾©
+ */
+#define TNUM_PORT		1		/* ãµãã¼ãããã·ãªã¢ã«ãã¼ãã®æ° */
+
+/*
+ *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯é¢é£ã®å®æ°ã®å®ç¾©
+ */
+#define LOGTASK_STACK_SIZE	SIGSTKSZ	/* ã¹ã¿ãã¯é åã®ãµã¤ãº */
+
+#endif /* TOPPERS_TARGET_SYSSVC_H */
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_test.h
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_test.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_test.h	(revision 302)
@@ -0,0 +1,71 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: target_test.h 364 2015-07-26 11:57:44Z ertl-hiro $
+ */
+
+/*
+ *		ãã¹ããã­ã°ã©ã ã®ã¿ã¼ã²ããä¾å­é¨ï¼Mac OS Xç¨ï¼
+ */
+
+#ifndef TOPPERS_TARGET_TEST_H
+#define TOPPERS_TARGET_TEST_H
+
+#include <macosx.h>
+#define CPUEXC1					SIGINFO
+#define RAISE_CPU_EXCEPTION		(raise(SIGINFO))
+#define PREPARE_RETURN_CPUEXC
+#define	STACK_SIZE				SIGSTKSZ
+#define LOOP_REF				ULONG_C(10000000)
+#define MEASURE_TWICE
+
+#endif /* TOPPERS_TARGET_TEST_H */
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_timer.c
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_timer.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_timer.c	(revision 302)
@@ -0,0 +1,350 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: target_timer.c 458 2015-08-21 14:59:09Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ããã©ã¤ãï¼Mac OS Xç¨ï¼
+ *
+ *  Mac OS Xä¸ã§ä½¿ç¨ã§ãããã¤ã¯ã­ç§ç²¾åº¦ã®ã¿ã¤ãã1ã¤ãããªãããï¼1ã¤
+ *  ã®ã¤ã³ã¿ã¼ãã«ã¿ã¤ãã§ã·ã¹ãã æå»ãé²ããããã®é«åè§£è½ã¿ã¤ããå®
+ *  ç¾ãã¦ããï¼ãã®æ¹æ³ã¯ï¼æéã®ãããçããããã«æ¨å¥¨ã§ããªããï¼ã·
+ *  ãã¥ã¬ã¼ã·ã§ã³ç°å¢ã§æéã®ããã¯å¤§ããåé¡ã§ã¯ãªãããï¼ãã®æ¹æ³ã
+ *  æ¡ç¨ãã¦ããï¼
+ *
+ *  ããã«ï¼ãªã¼ãã©ã³ãã³ãã©æ©è½ã®ããã®ã¿ã¤ãï¼ãªã¼ãã©ã³ã¿ã¤ãï¼ãï¼
+ *  åãã¤ã³ã¿ã¼ãã«ã¿ã¤ããå¤éåãã¦å®ç¾ãã¦ããï¼
+ */
+
+#include "kernel_impl.h"
+#include "time_event.h"
+#ifdef TOPPERS_SUPPORT_OVRHDR
+#include "overrun.h"
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+#include "target_timer.h"
+#include <sys/time.h>
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ç¶æ
+
+ */
+static HRTCNT	hrtcnt_current;		/* é«åè§£è½ã¿ã¤ãã®ç¾æç¹ã®å¤ */
+static HRTCNT	hrtcnt_left;		/* é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®æ®ãã«ã¦ã³ã */
+static bool_t	hrtcnt_pending;		/* é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ãè¦æ±ä¸­ */
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®ç¶æ
+
+ */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+static PRCTIM	ovrtimer_left;		/* ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ã®æ®ãæé */
+static bool_t	ovrtimer_pending;	/* ãªã¼ãã©ã³ã¿ã¤ãå²è¾¼ã¿ãè¦æ±ä¸­ */
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+/*
+ *  ã¤ã³ã¿ã¼ãã«ã¿ã¤ãã®è¨­å®ç¶æ
+
+ */
+static ulong_t	itimer_value;		/* æå¾ã«ã¤ã³ã¿ã¼ãã«ã¿ã¤ãã«è¨­å®ããå¤ */
+
+/*
+ *  ã¤ã³ã¿ã¼ãã«ã¿ã¤ããåæ­¢ãããããã®å¤æ°
+ */
+static const struct itimerval	itimerval_stop = {{ 0, 0 }, { 0, 0 }};
+
+/*
+ *  ã¤ã³ã¿ã¼ãã«ã¿ã¤ãã®çµéæéã®ç®åº
+ */
+Inline ulong_t
+itimer_progress(struct itimerval *p_val)
+{
+	return(itimer_value - ((ulong_t)(p_val->it_value.tv_sec) * 1000000U
+									+ (ulong_t)(p_val->it_value.tv_usec)));
+}
+
+/*
+ *  ã¤ã³ã¿ã¼ãã«ã¿ã¤ãã®ä¸æåæ­¢å¦ç
+ */
+static void
+pause_itimer(void)
+{
+	ulong_t				progtim;
+	struct itimerval	val;
+
+	/*
+	 *  ã¤ã³ã¿ã¼ãã«ã¿ã¤ããåæ­¢ãï¼çµéããæéãæ±ããï¼
+	 */
+	setitimer(ITIMER_REAL, &itimerval_stop, &val);
+	progtim = itimer_progress(&val);
+
+	/*
+	 *  é«åè§£è½ã¿ã¤ãã®ç¶æ
+ãæ´æ°ããï¼
+	 */
+	hrtcnt_current += progtim;
+	if (hrtcnt_left > 0U) {
+		if (hrtcnt_left > progtim) {
+			hrtcnt_left -= progtim;
+		}
+		else {
+			hrtcnt_left = 0U;
+			hrtcnt_pending = true;
+			/*
+			 *  ããã§SIGALRMãè¦æ±ããªãã¨ï¼ã¿ã¤ãå²è¾¼ã¿è¦æ±ãæãã¦ã
+			 *  ã¾ãå ´åãããï¼ãµã³ãã«ãã­ã°ã©ã ã§ï¼'o'ãé£æããã¨å
+			 *  ç¾ããï¼ï¼ã¹ããªã¢ã¹å²è¾¼ã¿ããããããï¼é¿ãããã¨ãã
+			 *  ã ãï¼æããåå ãä¸æã§ããããï¼ä¿®æ­£ã§ãã¦ããªãï¼
+			 */
+			raise(SIGALRM);
+		}
+	}
+
+	/*
+	 *  ãªã¼ãã©ã³ã¿ã¤ãã®ç¶æ
+ãæ´æ°ããï¼
+	 */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	if (ovrtimer_left > 0U) {
+		if (ovrtimer_left > progtim) {
+			ovrtimer_left -= progtim;
+		}
+		else {
+			ovrtimer_left = 0U;
+			ovrtimer_pending = true;
+		}
+	}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+}
+
+/*
+ *  ã¤ã³ã¿ã¼ãã«ã¿ã¤ãã®åä½éå§å¦ç
+ */
+static void
+start_itimer(void)
+{
+	struct itimerval	val;
+
+	/*
+	 *  ã¤ã³ã¿ã¼ãã«ã¿ã¤ãã«è¨­å®ããæéãæ±ããï¼
+	 */
+	itimer_value = (hrtcnt_left > 0U) ? hrtcnt_left : ULONG_MAX;
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	if (ovrtimer_left > 0U && ovrtimer_left < itimer_value) {
+		itimer_value = ovrtimer_left;
+	}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+	/*
+	 *  ã¤ã³ã¿ã¼ãã«ã¿ã¤ãã®åä½ãéå§ããï¼
+	 */
+	val.it_interval.tv_sec = 0;
+	val.it_interval.tv_usec = 0;
+	val.it_value.tv_sec = itimer_value / 1000000U;
+	val.it_value.tv_usec = itimer_value % 1000000U;
+	setitimer(ITIMER_REAL, &val, NULL);
+}
+
+/*
+ *  ã¿ã¤ãã®åæåå¦ç
+ */
+void
+target_timer_initialize(intptr_t exinf)
+{
+	hrtcnt_current = 0U;
+	hrtcnt_left = 0U;
+	hrtcnt_pending = false;
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	ovrtimer_left = 0U;
+	ovrtimer_pending = false;
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+	start_itimer();
+}
+
+/*
+ *  ã¿ã¤ãã®çµäºå¦ç
+ */
+void
+target_timer_terminate(intptr_t exinf)
+{
+	/*
+	 *  ã¤ã³ã¿ã¼ãã«ã¿ã¤ãã®åä½ãåæ­¢ããï¼
+	 */
+	setitimer(ITIMER_REAL, &itimerval_stop, NULL);
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ç¾å¨ã®ã«ã¦ã³ãå¤ã®èª­åºã
+ */
+HRTCNT
+target_hrt_get_current(void)
+{
+	struct itimerval	val;
+
+	getitimer(ITIMER_REAL, &val);
+	return(hrtcnt_current + itimer_progress(&val));
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã¸ã®å²è¾¼ã¿ã¿ã¤ãã³ã°ã®è¨­å®
+ */
+void
+target_hrt_set_event(HRTCNT hrtcnt)
+{
+	pause_itimer();
+	hrtcnt_left = hrtcnt;
+	start_itimer();
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®è¦æ±
+ */
+void
+target_hrt_raise_event(void)
+{
+	hrtcnt_pending = true;
+	raise(SIGALRM);
+}
+
+#ifdef TOPPERS_SUPPORT_OVRHDR
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§
+ */
+void
+target_ovrtimer_start(PRCTIM ovrtim)
+{
+	assert(ovrtimer_left == 0U);
+	if (ovrtim > 0U) {
+		pause_itimer();
+		ovrtimer_left = ovrtim;
+		start_itimer();
+	}
+	else {
+		ovrtimer_pending = true;
+		raise(SIGALRM);
+	}
+}
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢
+ */
+PRCTIM
+target_ovrtimer_stop(void)
+{
+	PRCTIM	lefttim;
+
+	assert(ovrtimer_left > 0U);
+	pause_itimer();
+	lefttim = ovrtimer_left;
+	ovrtimer_left = 0U;
+	start_itimer();
+	return(lefttim);
+}
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®ç¾å¨å¤ã®èª­åºã
+ */
+PRCTIM
+target_ovrtimer_get_current(void)
+{
+	struct itimerval	val;
+
+	assert(ovrtimer_left > 0U);
+	getitimer(ITIMER_REAL, &val);
+	return(ovrtimer_left - itimer_progress(&val));
+}
+
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+/*
+ *  ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+void
+target_timer_handler(void)
+{
+	lock_cpu();
+	pause_itimer();
+
+#ifdef TOPPERS_SUPPORT_OVRHDR
+	/*
+	 *  ãªã¼ãã©ã³ã¿ã¤ãã«ããå²è¾¼ã¿ãçºçããå ´å
+	 */
+	if (ovrtimer_pending) {
+		ovrtimer_pending = false;
+		start_itimer();
+		unlock_cpu();
+
+		call_ovrhdr();				/* ãªã¼ãã©ã³ãã³ãã©ã®èµ·åå¦ç */
+
+		if (!sense_lock()) {
+			lock_cpu();
+		}
+		pause_itimer();
+	}
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+	/*
+	 *  é«åè§£è½ã¿ã¤ãã«ããå²è¾¼ã¿ãçºçããå ´å
+	 */
+	if (hrtcnt_pending) {
+		hrtcnt_pending = false;
+		start_itimer();
+		unlock_cpu();
+
+		signal_time();			/* é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦ç */
+	}
+	else {
+		start_itimer();
+		unlock_cpu();
+	}
+}
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_timer.cfg
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_timer.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_timer.cfg	(revision 302)
@@ -0,0 +1,15 @@
+/*
+ *		ã¿ã¤ããã©ã¤ãã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  é«åè§£è½ã¿ã¤ãã¨ãªã¼ãã©ã³ã¿ã¤ããï¼1ã¤ã®ã¿ã¤ãã§å®è£
+ãã¦ããããï¼
+ *  é¢æ°åãªã©ãæ¨æºã¨ã¯éã£ããã®ã¨ãã¦ããï¼
+ *
+ *  $Id: target_timer.cfg 237 2014-09-28 19:17:01Z ertl-hiro $
+ */
+
+#include "target_timer.h"
+ATT_INI({ TA_NULL, 0, _kernel_target_timer_initialize });
+ATT_TER({ TA_NULL, 0, _kernel_target_timer_terminate });
+CFG_INT(INTNO_TIMER, { TA_ENAINT | INTATR_TIMER, INTPRI_TIMER });
+DEF_INH(INHNO_TIMER, { TA_NULL, _kernel_target_timer_handler });
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_timer.h
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_timer.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_timer.h	(revision 302)
@@ -0,0 +1,143 @@
+/*
+ *  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: target_timer.h 458 2015-08-21 14:59:09Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ããã©ã¤ãï¼Mac OS Xç¨ï¼
+ */
+
+#ifndef TOPPERS_TARGET_TIMER_H
+#define TOPPERS_TARGET_TIMER_H
+
+#include <sil.h>
+#include "macosx.h"
+#ifndef TOPPERS_MACRO_ONLY
+#include <sys/time.h>
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ã¿ã¤ãå²è¾¼ã¿ãã³ãã©ç»é²ã®ããã®å®æ°
+ */
+#define INHNO_TIMER		SIGALRM				/* å²è¾¼ã¿ãã³ãã©çªå· */
+#define INTNO_TIMER		SIGALRM				/* å²è¾¼ã¿çªå· */
+#define INTPRI_TIMER	(TMAX_INTPRI - 1)	/* å²è¾¼ã¿åªå
+åº¦ */
+#define INTATR_TIMER	TA_EDGE				/* å²è¾¼ã¿å±æ§ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã¿ã¤ãã®åæåå¦ç
+ */
+extern void	target_timer_initialize(intptr_t exinf);
+
+/*
+ *  ã¿ã¤ãã®çµäºå¦ç
+ */
+extern void	target_timer_terminate(intptr_t exinf);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ç¾å¨ã®ã«ã¦ã³ãå¤ã®èª­åºã
+ */
+extern HRTCNT target_hrt_get_current(void);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã¸ã®å²è¾¼ã¿ã¿ã¤ãã³ã°ã®è¨­å®
+ *
+ *  é«åè§£è½ã¿ã¤ããï¼hrtcntã§æå®ããå¤ã«ã¦ã³ãã¢ãããããå²è¾¼ã¿ãçº
+ *  çãããããã«è¨­å®ããï¼
+ */
+extern void target_hrt_set_event(HRTCNT hrtcnt);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®è¦æ±
+ */
+extern void target_hrt_raise_event(void);
+
+/*
+ *  å²è¾¼ã¿ã¿ã¤ãã³ã°ã«æå®ããæå¤§å¤
+ */
+#define HRTCNT_BOUND	4000000002U
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ããã©ã¤ã
+ */
+#ifdef TOPPERS_SUPPORT_OVRHDR
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åä½éå§
+ */
+extern void target_ovrtimer_start(PRCTIM ovrtim);
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®åæ­¢
+ */
+extern PRCTIM target_ovrtimer_stop(void);
+
+/*
+ *  ãªã¼ãã©ã³ã¿ã¤ãã®ç¾å¨å¤ã®èª­åºã
+ */
+extern PRCTIM target_ovrtimer_get_current(void);
+
+#endif /* TOPPERS_SUPPORT_OVRHDR */
+
+/*
+ *  ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+extern void	target_timer_handler(void);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_TARGET_TIMER_H */
Index: asp3_wo_tecs/trunk/target/macosx_xcode/target_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_unrename.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_unrename.h	(revision 302)
@@ -0,0 +1,102 @@
+/* This file is generated from target_rename.def by genrename. */
+
+/* This file is included only when target_rename.h has been included. */
+#ifdef TOPPERS_TARGET_RENAME_H
+#undef TOPPERS_TARGET_RENAME_H
+
+/*
+ *  kernel_cfg.c
+ */
+#undef sigmask_table
+#undef sigmask_disint_init
+
+/*
+ *  target_kernel_impl.c
+ */
+#undef sigmask_intlock
+#undef sigmask_cpulock
+#undef lock_flag
+#undef saved_sigmask
+#undef intpri_value
+#undef sigmask_disint
+#undef dispatch
+#undef exit_and_dispatch
+#undef call_exit_kernel
+#undef start_r
+#undef target_initialize
+#undef target_exit
+
+/*
+ *  target_timer.c
+ */
+#undef target_timer_initialize
+#undef target_timer_terminate
+#undef target_hrt_get_current
+#undef target_hrt_set_event
+#undef target_hrt_raise_event
+#undef target_ovrtimer_start
+#undef target_ovrtimer_stop
+#undef target_ovrtimer_get_current
+#undef target_timer_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
+
+#ifdef TOPPERS_LABEL_ASM
+
+/*
+ *  kernel_cfg.c
+ */
+#undef _sigmask_table
+#undef _sigmask_disint_init
+
+/*
+ *  target_kernel_impl.c
+ */
+#undef _sigmask_intlock
+#undef _sigmask_cpulock
+#undef _lock_flag
+#undef _saved_sigmask
+#undef _intpri_value
+#undef _sigmask_disint
+#undef _dispatch
+#undef _exit_and_dispatch
+#undef _call_exit_kernel
+#undef _start_r
+#undef _target_initialize
+#undef _target_exit
+
+/*
+ *  target_timer.c
+ */
+#undef _target_timer_initialize
+#undef _target_timer_terminate
+#undef _target_hrt_get_current
+#undef _target_hrt_set_event
+#undef _target_hrt_raise_event
+#undef _target_ovrtimer_start
+#undef _target_ovrtimer_stop
+#undef _target_ovrtimer_get_current
+#undef _target_timer_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/macosx_xcode/target_user.txt
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/target_user.txt	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/target_user.txt	(revision 302)
@@ -0,0 +1,494 @@
+
+		TOPPERS/ASPã«ã¼ãã«
+		Mac OS Xã¿ã¼ã²ããä¾å­é¨ ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«
+
+		å¯¾å¿ãã¼ã¸ã§ã³: Release 3.B.0
+		æçµæ´æ°: 2015å¹´8æ21æ¥
+
+ãã®ãã­ã¥ã¡ã³ãã¯ï¼TOPPERS/ASPã«ã¼ãã«ã®Mac OS Xã¿ã¼ã²ããä¾å­é¨ãä½¿ç¨
+ããããã«å¿
+è¦ãªäºé 
+ãèª¬æãããã®ã§ããï¼
+
+----------------------------------------------------------------------
+ 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: target_user.txt 458 2015-08-21 14:59:09Z ertl-hiro $
+----------------------------------------------------------------------
+
+âç®æ¬¡
+
+ï¼ï¼Mac OS Xã¿ã¼ã²ããä¾å­é¨ã®æ¦è¦
+	1.1 å¯¾å¿ããã¿ã¼ã²ããã·ã¹ãã ã¨ã¿ã¼ã²ããç¥ç§°
+	1.2 ã¿ã¼ã²ããä¾å­é¨ã®æ§æ
+	1.3 ä¾å­ãã¦ããåå¥ããã±ã¼ã¸ã®ãã¼ã¸ã§ã³çªå·
+	1.4 éçºç°å¢ã¨åä½ç¢ºèªæ¡ä»¶
+	1.5 ã¡ã¢ãªããã
+ï¼ï¼ã¿ã¼ã²ããå®ç¾©äºé 
+ã®è¦å®
+	2.1 ãã¼ã¿åã«é¢ããè¦å®
+	2.2 å²è¾¼ã¿å¦çã¨CPUä¾å¤å¦çã«é¢ããè¦å®
+	2.3 æ§è½è©ä¾¡ç¨ã·ã¹ãã æå»ã®åç
+§ã«é¢ããè¦å®
+	2.4 ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µã®ãµãã¼ãã«é¢ããè¦å®
+	2.5 åççææ©è½æ¡å¼µã®ãµãã¼ãã«é¢ããè¦å®
+	2.6 ãã®ä»ã®å¶éäºé 
+
+ï¼ï¼ãã©ã¤ãé¢é£ã®æ
+å ±
+	3.1 ã¿ã¤ããã©ã¤ã
+	3.2 ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ã
+	3.3 ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºå
+	3.4 ãã³ãã­ãã­ã³ã°I/Oãµãã¼ãã¢ã¸ã¥ã¼ã«
+ï¼ï¼ã·ã¹ãã æ§ç¯æé ã¨å®è¡æé 
+	4.1 ã·ã¹ãã æ§ç¯ã¨å®è¡
+	4.2 ãããã¬ã®ä½¿ç¨æ¹æ³
+ï¼ï¼åèæ
+å ±
+	5.1 ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ãç¨ã¿ã¼ã²ããä¾å­é¨
+	5.2 é¡ä¼¼ã®ã¿ã¼ã²ããã¸ã®ãã¼ãã£ã³ã°
+ï¼ï¼ãªãã¡ã¬ã³ã¹
+	6.1 ãã£ã¬ã¯ããªæ§æã»ãã¡ã¤ã«æ§æ
+	6.2 ãã¼ã¸ã§ã³å±¥æ­´
+
+
+ï¼ï¼Mac OS Xã¿ã¼ã²ããä¾å­é¨ã®æ¦è¦
+
+Mac OS Xã¿ã¼ã²ããä¾å­é¨ã¯ï¼TOPPERS/ASPã«ã¼ãã«ãï¼Mac OS Xä¸ã®1ã¤ã®ã
+ã­ã»ã¹ã§ã·ãã¥ã¬ã¼ã·ã§ã³åä½ãããç°å¢ï¼ãããï¼ASPã«ã¼ãã«ã®Mac OS Xã·
+ãã¥ã¬ã¼ã·ã§ã³ç°å¢ã¨å¼ã¶ï¼ãæ§æããããã®ãã®ã§ããï¼ãã®ã·ãã¥ã¬ã¼ã·ã§
+ã³ç°å¢ã§ã¯ï¼ASPã«ã¼ãã«ã®åã¿ã¹ã¯ãï¼ãã­ã»ã¹å
+ã®ã¦ã¼ã¶ã¬ãã«ã¹ã¬ããã¨
+ãã¦åä½ããï¼
+
+1.1 å¯¾å¿ããã¿ã¼ã²ããã·ã¹ãã ã¨ã¿ã¼ã²ããç¥ç§°
+
+åä½ç¢ºèªãè¡ã£ãã¿ã¼ã²ããã·ã¹ãã ããã³OSã®ãã¼ã¸ã§ã³ã¯æ¬¡ã®éãï¼
+
+	Intelãã­ã»ããµ
+		ãã·ã³åï¼MacBook Air
+		ãã­ã»ããµï¼1.7GHz Intel Core i7
+		OSï¼Mac OS X ãã¼ã¸ã§ã³ 10.9.5
+
+ãªãï¼ç¾æç¹ã§ã¯ï¼Intelãã­ã»ããµã®32ãããç°å¢ï¼IA-32ï¼ã®ã¿ããµãã¼ã
+ãã¦ããï¼64ãããç°å¢ï¼x86-64ï¼ã¯ãµãã¼ããã¦ããªãï¼64ãããç°å¢ããµ
+ãã¼ãããããã®æå¤§ã®èª²é¡ã¯ï¼ã¢ãã­ã¼ã©Sã¬ã³ã¼ããã©ã¼ãããã64ããã
+ã¢ãã¬ã¹ã«å¯¾å¿ãã¦ããªããã¨ã§ããï¼
+
+ã¾ãï¼ã¿ã¼ã²ããç¥ç§°ç­ã¯æ¬¡ã®éãï¼
+
+	ã¿ã¼ã²ããç¥ç§°ï¼macosx_xcode
+	ã·ã¹ãã ç¥ç§°ï¼macosx
+	éçºç°å¢ç¥ç§°ï¼xcode
+
+1.2 ã¿ã¼ã²ããä¾å­é¨ã®æ§æ
+
+Mac OS Xã¿ã¼ã²ããä¾å­é¨ã®ä½¿ç¨ããã¿ã¼ã²ããä¾å­é¨ï¼targetãã£ã¬ã¯ããªï¼
+ããã³ã¿ã¼ã²ããä¾å­é¨ã®å
+±éé¨ï¼archãã£ã¬ã¯ããªï¼ã®ãã£ã¬ã¯ããªã¯æ¬¡ã®
+éãï¼
+
+	target/
+		macosx_xcode/			Mac OS Xã¿ã¼ã²ããä¾å­é¨
+		test_hrt_macosx_xcode/	Mac OS Xä¸ã§ã®ã·ã¹ãã æå»ç®¡çæ©è½ãã¹
+								ãç¨ã¿ã¼ã²ããä¾å­é¨
+	arch/
+		gcc/			GCCéçºç°å¢ä¾å­é¨
+		logtrace/		ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ã
+
+Xcodeã«ä»å±ã®Cã³ã³ãã¤ã©ã¯Clangã§ããï¼GCCã§ã¯ãªããï¼ãã®ç¯å²ã§ã¯äºæ
+ã§ä½¿ããããï¼GCCéçºç°å¢ä¾å­é¨ãæµç¨ãã¦ããï¼
+
+1.3 ä¾å­ãã¦ããåå¥ããã±ã¼ã¸ã®ãã¼ã¸ã§ã³çªå·
+
+Mac OS Xã¿ã¼ã²ããä¾å­é¨ï¼ãã¼ã¸ã§ã³ 3.B.0ï¼ã®åå¥ããã±ã¼ã¸ãä¾å­ãã¦
+ããåå¥ããã±ã¼ã¸ã¨ï¼åä½ç¢ºèªãè¡ã£ããã¼ã¸ã§ã³ã¯æ¬¡ã®éãï¼
+
+	åå¥ããã±ã¼ã¸ã®åç§°	ãã¼ã¸ã§ã³	åå¥ããã±ã¼ã¸ãã¡ã¤ã«å
+	------------------------------------------------------------------
+	ã¿ã¼ã²ããéä¾å­é¨		3.B.0		asp3-3.B.0.tar.gz
+
+1.4 éçºç°å¢ã¨åä½ç¢ºèªæ¡ä»¶
+
+éçºç°å¢ã¨ãã¦ï¼Xcodeã«ä»å±ã®Cã³ã³ãã¤ã©ï¼CCï¼ã¨ï¼GNUãã¤ããªã¦ã¼ãã£ãª
+ãã£ï¼binutilsï¼ãç¨ããï¼åä½ç¢ºèªãè¡ã£ããã¼ã¸ã§ã³ã¯æ¬¡ã®éãï¼
+
+	Clang: Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
+	GDBï¼7.7
+	binutilsï¼objcopyï¼objdumpï¼ï¼2.25
+
+ä¸è¨ã®CCã¯ï¼Xcode 6.2ã«å«ã¾ãããã®ã§ããï¼Xcodeã¯ï¼Command Line Tools
+ãã¤ã³ã¹ãã¼ã«ãããã¨ï¼
+
+GDBã¨binutilsã¯ï¼HomeBrewã«ããã¤ã³ã¹ãã¼ã«ãããã®ãç¨ãã¦åä½ç¢ºèªããï¼
+HomeBrewã¯ï¼binutilsã®åãã­ã°ã©ã ã"g"ã§å§ã¾ãåç§°ã§ã¤ã³ã¹ãã¼ã«ããã
+ãï¼Makefile.targetã§ï¼objcopyã¨objdumpã«ä»£ãã¦ï¼gobjcopyã¨gobjdumpãç¨
+ããããã«ãã¦ããï¼
+
+1.5 ã¡ã¢ãªããã
+
+Mac OS Xã·ãã¥ã¬ã¼ã·ã§ã³ç°å¢ã§ã¯ï¼TOPPERS/ASPã«ã¼ãã«ããã³ã¢ããªã±ã¼ã·ã§
+ã³ã½ããã¦ã§ã¢ãï¼Mac OS Xä¸ã®1ã¤ã®ãã­ã»ã¹ã§åä½ããããï¼ã¡ã¢ãªããã
+ã«ã¤ãã¦ã¯ï¼Mac OS Xã®ãã­ã»ã¹ã®æ¨æºã®æ±ãã«å¾ãï¼
+
+
+ï¼ï¼ã¿ã¼ã²ããå®ç¾©äºé 
+ã®è¦å®
+
+2.1 ãã¼ã¿åã«é¢ããè¦å®
+
+ã¿ã¼ã²ããä¾å­ã®ãã¼ã¿åã®ãµã¤ãºã¯æ¬¡ã®éãï¼
+
+	int_t			32ããã
+	long_t			32ããã
+
+	char			8ããã
+	int_least8_t	8ããã
+	void *			32ããã
+	intptr_t		32ããã
+	size_t			32ããã
+
+ã¿ã¼ã²ããä¾å­ã®ãã¼ã¿åã®æç¡ã¯æ¬¡ã®éãï¼
+
+	int8_tï¼uint8_t			ãã
+	int64_tï¼uint64_t		ãã
+	int128_tï¼uint128_t		ãªã
+	float32_t				ãã
+	double64_t				ãã
+
+2.2 å²è¾¼ã¿å¦çã¨CPUä¾å¤å¦çã«é¢ããè¦å®
+
+Mac OS Xã·ãã¥ã¬ã¼ã·ã§ã³ç°å¢ã§ã¯ï¼ãã­ã»ã¹ã«å¯¾ããã·ã°ãã«ãï¼å²è¾¼ã¿ã¾
+ãã¯CPUä¾å¤ã¨ãã¦æ±ãï¼ãã ãï¼SIGKILLã¨SIGSTOPã®2ã¤ã®ã·ã°ãã«ã¯ï¼ãã
+ãã«å¯¾ããã·ã°ãã«ãã³ãã©ãç»é²ã§ããªãããï¼å²è¾¼ã¿ã¾ãã¯CPUä¾å¤ã¨ãã¦
+æ±ããã¨ãã§ããªãï¼ã¾ãï¼SIGUSR2ãï¼Mac OS Xã·ãã¥ã¬ã¼ã·ã§ã³ç°å¢ã®å®ç¾
+ã®ããã«ä½¿ç¨ããããï¼å²è¾¼ã¿ã¾ãã¯CPUä¾å¤ã¨ãã¦æ±ããã¨ãã§ããªãï¼
+
+ãããã®3ã¤ã®ã·ã°ãã«ãé¤ãã¨ï¼ãããã®ã·ã°ãã«ãï¼å²è¾¼ã¿ã¨ãã¦æ±ããã¨
+ãï¼CPUä¾å¤ã¨ãã¦æ±ããã¨ãã§ããï¼å
+·ä½çã«ã¯ï¼DEF_INHã«ãã£ã¦å²è¾¼ã¿ã
+ã³ãã©ãç»é²ãããï¼CRE_ISRã«ãã£ã¦å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ãç»é²ããå ´å
+ã«ã¯ï¼å²è¾¼ã¿ã¨ãã¦æ±ããï¼DEF_EXCã«ãã£ã¦CPUä¾å¤ãã³ãã©ãç»é²ããå ´å
+ã«ã¯ï¼CPUä¾å¤ã¨ãã¦æ±ãããï¼
+
+å²è¾¼ã¿ãã³ãã©çªå·ï¼inhnoï¼ï¼å²è¾¼ã¿çªå·ï¼intnoï¼ï¼CPUä¾å¤ãã³ãã©çªå·
+ï¼excnoï¼ã®å¤ã¯ï¼ããããï¼ã·ã°ãã«çªå·ã¨ä¸è´ããã¦ããï¼ã·ã°ãã«åã¨ã·
+ã°ãã«çªå·ã¯ï¼/usr/include/sys/signal.hã«å®ç¾©ããã¦ããï¼ãªãï¼macosx.h
+ãããã®ããããã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ããã¦ããããï¼ã·ã°ãã«åãç¨ããå ´
+åã«ã¯ï¼macosx.hãã¤ã³ã¯ã«ã¼ãããã¨è¯ãï¼
+
+å²è¾¼ã¿åªå
+åº¦ã¨ãã¦ã¯ï¼-7ã-1ã®7æ®µéããµãã¼ããã¦ãããï¼-7ã¯NMIæ±ãã¨
+ãã¦ããï¼ã«ã¼ãã«ç®¡çã®å²è¾¼ã¿ã¨ã§ããã®ã¯ï¼-6ã-1ã®ç¯å²ã§ããï¼ããã©
+ã«ãã§ã¯ï¼target_kernel.hã«ããã¦TMIN_INTPRIã-6ã«è¨­å®ãã¦ããï¼ããã¯ï¼
+NMIä»¥å¤ã«ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãè¨­ããªããã¨ãæå³ãã¦ããï¼ãã®å¤ãä¾
+ãã°-5ã«å¤æ´ããã¨ï¼NMIã«å ãã¦ï¼å²è¾¼ã¿åªå
+åº¦ã-6ã®å²è¾¼ã¿ãã«ã¼ãã«ç®¡ç
+å¤ã¨ãªãï¼ãªãï¼TMIN_INTPRIã«å®ç¾©ã§ããå¤ã¯ï¼-6ã-1ã®ç¯å²ã§ããï¼
+
+ããå²è¾¼ã¿ãã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã¨ãã¦ä½¿ç¨ããå ´åã«ã¯ï¼CFG_INTã«ãã
+ã¦å²è¾¼ã¿åªå
+åº¦ãTMIN_INTPRIããé«ãã¬ãã«ï¼å¤ã¨ãã¦ã¯ï¼ããå°ããå¤ï¼ã«
+è¨­å®ãï¼å²è¾¼ã¿ãã³ãã©å±æ§ã«TA_NONKERNELãæå®ãã¦DEF_INHã«ããå²è¾¼ã¿ã
+ã³ãã©ãå®ç¾©ããã°ããï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã«å¯¾ãã¦å²è¾¼ã¿ãµã¼ãã¹ã«ã¼
+ãã³ãç»é²ãããã¨ã¯ã§ããªãã®ã§æ³¨æï¼ï¼
+
+ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©ã¯ï¼ã«ã¼ãã«å
+ã®å²è¾¼ã¿åºå
+¥å£å¦çãçµç±ã
+ãã«å¼ã³åºãããï¼ããªãã¡ï¼ã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ãã³ãã©ã®è¨è¿°æ¹æ³ã¯ï¼
+Mac OS Xã®ã·ã°ãã«ãã³ãã©ã¨åãã§ããï¼
+
+dis_intã¨ena_intã¯ï¼NMIä»¥å¤ã®å²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã¦ãµãã¼ããã¦ããï¼
+éã«è¨ãã¨ï¼å²è¾¼ã¿åªå
+åº¦ã-7ï¼NMIï¼ã®å²è¾¼ã¿è¦æ±ã©ã¤ã³ï¼CPUä¾å¤ã¨ãã¦æ±ã£
+ã¦ããã·ã°ãã«ï¼å²è¾¼ã¿å±æ§ãè¨­å®ããã¦ããªãå²è¾¼ã¿è¦æ±ã©ã¤ã³ã«å¯¾ãã
+dis_intã¨ena_intã¯ï¼E_OBJã¨ã©ã¼ã¨ãªãï¼
+
+CFG_INTã«å¯¾ããå¶éäºé 
+ã¨ãã¦ï¼ã¬ãã«ããªã¬ããµãã¼ãããã¦ãããï¼å²è¾¼
+ã¿å±æ§ã«TA_EDGEãæå®ããªãã¨ï¼E_RSATRã¨ã©ã¼ã¨ãªãï¼ããã¯ï¼ãã­ã»ã¹ã«
+å¯¾ããã·ã°ãã«ã¯ï¼ã¨ãã¸ããªã¬ã¨åæ§ã«æ¯ãèãï¼ã¬ãã«ããªã¬ã®ããã«æ¯
+ãèããããã¨ãã§ããªãããã§ããï¼
+
+ä»¥ä¸ã®3ã¤ã®ã·ã°ãã«ã¯ï¼å²è¾¼ã¿ã¨ãã¦ãCPUä¾å¤ã¨ãã¦ãæ±ããªãå ´åã«ï¼ã·
+ã°ãã«ããã¹ã¯ããã«ï¼æ¨æºçãªæ¯èãããããï¼ããã¯ï¼ãããã°ãå®¹æã«
+ããããã§ããï¼ä¾ãã°ï¼SIGINTããã¹ã¯ããã¨ï¼CTRL+Cã§ãã­ã°ã©ã ã®å®è¡
+ãåæ­¢ããªããªãï¼ï¼
+
+	SIGINT		å²è¾¼ã¿ï¼CTRL+Cï¼
+	SIGBUS		ãã¹ã¨ã©ã¼
+	SIGSEGV		ã»ã°ã¡ã³ãã¼ã·ã§ã³éå
+
+2.3 æ§è½è©ä¾¡ç¨ã·ã¹ãã æå»ã®åç
+§ã«é¢ããè¦å®
+
+fch_hrtããµãã¼ããã¦ãããï¼ã·ãã¥ã¬ã¼ã·ã§ã³ç°å¢ã®å¶éä¸ï¼æ­£ç¢ºãªæ§è½è©
+ä¾¡ã«ä½¿ç¨ãããã¨ã¯ã§ããªãï¼
+
+2.4 ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µã®ãµãã¼ãã«é¢ããè¦å®
+
+ãªã¼ãã©ã³ãã³ãã©æ©è½æ¡å¼µããã±ã¼ã¸ããµãã¼ããã¦ãããï¼ã·ãã¥ã¬ã¼ã·ã§
+ã³ç°å¢ã®å¶éä¸ï¼ãã­ã»ããµæéã®æ¸¬å®ã«ã¯ããªãã®èª¤å·®ãå«ã¾ããï¼ãã­ã»ã
+ãµæéã«æå®ã§ããå¤ã«å¶éã¯ãªãï¼ã¤ã¾ãï¼TMAX_OVRTIMã¯UINT32_MAXã§ã
+ãï¼ï¼
+
+2.5 åççææ©è½æ¡å¼µã®ãµãã¼ãã«é¢ããè¦å®
+
+åççææ©è½æ¡å¼µããã±ã¼ã¸ããµãã¼ããã¦ããï¼
+
+åçã¡ã¢ãªç®¡çã¯ï¼ãªã¼ãã³ã½ã¼ã¹ã®ã¡ã¢ãªå²ä»ãã©ã¤ãã©ãªã§ããTLSFãç¨
+ããæ¹æ³ãæ¨æºã«ãã¦ããï¼ãã®ããï¼åççææ©è½æ¡å¼µãä½¿ç¨ããå ´åã«ã¯ï¼
+TLSFã®ããã±ã¼ã¸ã«å«ã¾ããtlsf.hã¨tlsf.cãï¼ã«ã¼ãã«ããã«ããããã£ã¬
+ã¯ããªãï¼vpathã§æå®ããããã£ã¬ã¯ããªã«ç½®ãã¦ããå¿
+è¦ãããï¼ã¾ãï¼
+Makefileã®KERNEL_COBJSã®å®ç¾©ã«ï¼ä»¥ä¸ã®ããã«tlsf.oãè¿½å ããå¿
+è¦ãããï¼
+
+----------------------------------------
+KERNEL_COBJS := $(KERNEL_COBJS) tlsf.o
+----------------------------------------
+
+ãªãï¼TLSFï¼åä½ç¢ºèªã¯ï¼Version 2.4.6ï¼ã¯ï¼ä»¥ä¸ã®ã¦ã§ããµã¤ããããã¦ã³
+ã­ã¼ããããã¨ãã§ããï¼
+
+	http://rtportal.upv.es/rtmalloc/
+
+2.6 ãã®ä»ã®å¶éäºé 
+
+
+sil_dly_nseã¯ï¼ã·ãã¥ã¬ã¼ã·ã§ã³ç°å¢ã§ã¯æå³ããªããã¨ããï¼ä½ãããªãã¤
+ã³ã©ã¤ã³é¢æ°ã¨ãã¦ããï¼
+
+
+ï¼ï¼ãã©ã¤ãé¢é£ã®æ
+å ±
+
+3.1 ã¿ã¤ããã©ã¤ã
+
+ã¿ã¤ããã©ã¤ãã¯ï¼Mac OS Xã®ã¤ã³ã¿ã¼ãã«ã¿ã¤ãæ©è½ãä½¿ç¨ãã¦ããï¼ãã®
+ããï¼ã¤ã³ã¿ã¼ãã«ã¿ã¤ããå¥ã®ç®çã§ä½¿ç¨ãããã¨ã¯ã§ããªãï¼
+
+3.2 ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ã
+
+ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã§ã¯ï¼ã·ãªã¢ã«I/Oãã¼ãã1ã¤ã®ã¿ãµãã¼ã
+ãã¦ããï¼ãã­ã»ã¹ã®æ¨æºå
+¥åºåã«å¯¾ããæå­ã®å
+¥åºåã§å®ç¾ãã¦ããï¼ããª
+ãã¡ï¼ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã«éä¿¡ããæå­ã¯ï¼ãã­ã»ã¹ã®æ¨æºåº
+åã«åºåããï¼ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãããæå­ãåä¿¡ãããã¨ãã
+ã¨ï¼ãã­ã»ã¹ã®æ¨æºå
+¥åã«å
+¥åãããï¼
+
+è¤æ°ã®ã·ãªã¢ã«I/Oãã¼ãããµãã¼ããï¼æ¨æºå
+¥åºåä»¥å¤ã«å¯¾ããæå­ã®å
+¥åºå
+ãå¯è½ã«ãããã¨ãèæ
+®ãã¦ã³ã¼ããä½æãã¦ãããï¼ç¾æç¹ã§ã¯æªæ¤è¨¼ã§ã
+ãï¼
+
+3.3 ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºå
+
+ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã¯ï¼ãã­ã»ã¹ã®æ¨æºã¨ã©ã¼ã«å¯¾ãã¦æå­ãåºåã
+ãæ¹æ³ã§å®ç¾ãã¦ããï¼
+
+3.4 ãã³ãã­ãã­ã³ã°I/Oãµãã¼ãã¢ã¸ã¥ã¼ã«
+
+Mac OS Xã·ãã¥ã¬ã¼ã·ã§ã³ç°å¢ã§ãã³ãã­ãã­ã³ã°I/Oæ©è½ã®ä½¿ç¨ããµãã¼ãã
+ãã¢ã¸ã¥ã¼ã«ã¨ãã¦ï¼unix_sigio.cfgããã³unix_sigio.hãç¨æãã¦ããï¼
+
+ãã³ãã­ãã­ã³ã°I/Oæ©è½ãç¨ããã¨ï¼I/Oã®ç¶æ
+ã«å¤åããã£ãå ´åã«ï¼ãã­
+ã»ã¹ã«å¯¾ãã¦SIGIOã·ã°ãã«ãé
+éãããï¼ãã³ãã­ãã­ã³ã°I/Oæ©è½ãç¨ãã
+ã¢ã¸ã¥ã¼ã«ã¯ï¼SIGIOã·ã°ãã«ãé
+éãããå ´åã®å¦çãç¨æããå¿
+è¦ãããï¼
+
+ãã®ãµãã¼ãã¢ã¸ã¥ã¼ã«ãç¨ããå ´åï¼ã¢ããªã±ã¼ã·ã§ã³ã¯ï¼SIGIOã·ã°ãã«ã
+é
+éãããå ´åã®å¦çãå²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³ã¨ãã¦ç¨æãï¼CRE_ISRã«ãã
+å²è¾¼ã¿çªå·INTNO_SIGIOã«å¯¾ãã¦ç»é²ãããã¨ã§ï¼SIGIOã·ã°ãã«é
+éæã«å¼ã³
+åºãããããã«ã§ããï¼
+
+ãªãï¼ã·ãªã¢ã«ã¤ã³ã¿ãã§ã¼ã¹ãã©ã¤ãã¯ï¼ãã®æ©è½ãç¨ãã¦å®ç¾ãã¦ããï¼
+
+
+ï¼ï¼ã·ã¹ãã æ§ç¯æé ã¨å®è¡æé 
+
+4.1 ã·ã¹ãã æ§ç¯ã¨å®è¡
+
+Mac OS Xã·ãã¥ã¬ã¼ã·ã§ã³ç°å¢ãæ§ç¯ããæé ã¯ï¼ãTOPPERS/ASPã«ã¼ãã« ã¦ã¼
+ã¶ã¼ãºããã¥ã¢ã«ãã®ãï¼ï¼ã¯ã¤ãã¯ã¹ã¿ã¼ãã¬ã¤ããã®ç« ã«è¨è¿°ããã¦ãã
+éãã§ããï¼
+
+æ§ç¯ããã·ãã¥ã¬ã¼ã·ã§ã³ç°å¢ã®å®è¡ã¯ï¼å®è¡å½¢å¼ãã¡ã¤ã«ã¨ãã¦çæããã
+aspãå®è¡ããã ãã§ããï¼
+
+4.2 ãããã¬ã®ä½¿ç¨æ¹æ³
+
+æ¬¡ã®ãããªæé ã«ããï¼GDBãããã¬ã®ç®¡çä¸ã§Mac OS Xã·ãã¥ã¬ã¼ã·ã§ã³ç°å¢
+ãå®è¡ãããã¨ãã§ããï¼ãªãï¼Xcode 6.0.1ã§ã¯ï¼GDBã«ä»£ãã¦LLDBãæ¨æºã®
+ãããã¬ã¨ãªã£ã¦ããï¼GDBãã¤ã³ã¹ãã¼ã«ããã®ã¯é¢åã§ããï¼
+
+	% gdb asp
+	<GDBã®èµ·åã¡ãã»ã¼ã¸>
+	(gdb) handle SIGUSR2 nostop noprint
+	(gdb) run
+
+ããã§ï¼ãhandle SIGUSR2 nostop noprintãã¯ï¼SIGUSR2ã«ãã£ã¦ãããã¬ã
+åæ­¢ããã®ãé²ãããã®ã³ãã³ãã§ããï¼ãããçãã¨ï¼ãã£ã¹ãããã®åº¦ã«
+ãããã¬ãåæ­¢ãã¦ãã¾ãï¼ã¾ãï¼ãµã³ãã«ãã­ã°ã©ã ï¼sample1ï¼ãå®è¡ãã
+éã«ã¯ï¼CPUä¾å¤ã¨ãã¦ç¨ãã¦ããSIGINFOã«ãã£ã¦ãããã¬ãåæ­¢ãããã¨ã
+é²ãã§ãããã¨ãå¿
+è¦ã§ããï¼
+
+	(gdb) handle SIGINFO nostop noprint
+
+ãããã®ã³ãã³ããï¼.gdbinitã«è¨­å®ãã¦ããã¨ä¾¿å©ã§ããï¼
+
+ã¾ãï¼æ¡ä»¶ä»ããã¬ã¼ã¯ãã¤ã³ããä½¿ãã¨ï¼ç¹å®ã®ã¿ã¹ã¯ãç¹å®ã®ã¢ãã¬ã¹ã
+å®è¡ããå ´åã«ã®ã¿å®è¡ãåæ­¢ããããã¨ãã§ããï¼ãã ãï¼ãã¬ã¼ã¯æ¡ä»¶ã
+è¨è¿°ããã«ã¯ï¼ã«ã¼ãã«ã®å
+é¨æ§é ãç¥ã£ã¦ãããã¨ãå¿
+è¦ã§ããï¼
+
+
+ï¼ï¼åèæ
+å ±
+
+5.1 ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ãç¨ã¿ã¼ã²ããä¾å­é¨
+
+ASP3ã«ã¼ãã«ã®ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ããã­ã°ã©ã ãå®è¡ããããã«ã¯ï¼
+ãã¹ãç¨ã®é«åè§£è½ã¿ã¤ãã¢ã¸ã¥ã¼ã«ãçµã¿è¾¼ãã ã¿ã¼ã²ããä¾å­é¨ãå¿
+è¦ã¨
+ãªãï¼ãã¦ã¼ã¶ã¼ãºããã¥ã¢ã«ãã®ã10.4 ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ããã­ã°
+ã©ã ãã®ç¯ãåç
+§ï¼ï¼
+
+Mac OS Xã¿ã¼ã²ããä¾å­é¨ã«ã¯ï¼Mac OS Xä¸ã§ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ãã
+è¡ãããã®ï¼ãã¹ãç¨ã¿ã¼ã²ããä¾å­é¨ãå«ãã§ããï¼ãã¹ãç¨ã¿ã¼ã²ããä¾
+å­é¨ã®ã¿ã¼ã²ããç¥ç§°ç­ã¯æ¬¡ã®éãï¼
+
+	ã¿ã¼ã²ããç¥ç§°ï¼hrt_test_macosx_xcode
+	ã·ã¹ãã ç¥ç§°ï¼hrt_testmacosx
+	éçºç°å¢ç¥ç§°ï¼xcode
+
+5.2 é¡ä¼¼ã®ã¿ã¼ã²ããã¸ã®ãã¼ãã£ã³ã°
+
+Max OS Xã®ã«ã¼ãã«ã¯ï¼BSD UNIXãã¼ã¹ã§ããï¼Mac OS Xã¿ã¼ã²ããä¾å­é¨ã«
+ããã¦ãï¼Mac OS Xã«ç¹æã®æ©è½ã¯ã»ã¨ãã©ä½¿ç¨ãã¦ããªãï¼ãã®ããï¼ä»ã®
+BSD UNIXãã¼ã¹ã®OSãï¼Linuxã¸ã®ãã¼ãã£ã³ã°ãå¯è½ã¨æãããï¼
+
+ãã ãï¼æããã«OSããã­ã»ããµã«ä¾å­ããé¨åã¨ãã¦ï¼ã¿ã¹ã¯ã®èµ·åæã«ã¿
+ã¹ã¯ã®ã¡ã¤ã³ã«ã¼ãã³ã«åå²ããããã«ï¼jmp_bufæ§é ä½ã«PCãSPãç´æ¥è¨­å®ã
+ã¦longjmpãã¦ããã³ã¼ããããï¼jmp_bufæ§é ä½ã®ä¸­ã§PCãSPã®ä½ç½®ã¯ãã­ã»ã
+ãµãOSï¼å³å¯ã«ã¯ã©ã¤ãã©ãªï¼ã«ãã£ã¦ç°ãªããï¼ãã­ã»ããµã«ãã£ã¦ã¯ä»ã®
+ã¬ã¸ã¹ã¿ãè¨­å®ããªããã°ãªããªãå ´åãããï¼
+
+
+ï¼ï¼ãªãã¡ã¬ã³ã¹
+
+6.1 ãã£ã¬ã¯ããªæ§æã»ãã¡ã¤ã«æ§æ
+
+	target/macosx_xcode/
+		E_PACKAGE				ç°¡æããã±ã¼ã¸ã®ãã¡ã¤ã«ãªã¹ã
+		MANIFEST				åå¥ããã±ã¼ã¸ã®ãã¡ã¤ã«ãªã¹ã
+		Makefile.target			Makefileã®ã¿ã¼ã²ããä¾å­é¨
+		macosx.h				ã¿ã¼ã²ããã®ãã¼ãã¦ã§ã¢è³æºã®å®ç¾©
+		target.tf				kernel.tfã®ã¿ã¼ã²ããä¾å­é¨
+		target_cfg1_out.h		cfg1_out.cã®ãªã³ã¯ã«å¿
+è¦ãªã¹ã¿ãã®å®ç¾©
+		target_check.tf			kernel_check.tfã®ã¿ã¼ã²ããä¾å­é¨
+		target_def.csv			kernel_def.csvã®ã¿ã¼ã²ããä¾å­é¨
+		target_kernel.h			kernel.hã®ã¿ã¼ã²ããä¾å­é¨
+		target_kernel_impl.c	ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨é¢é£ã®å®ç¾©
+		target_kernel_impl.h	ã«ã¼ãã«å®è£
+ã®ã¿ã¼ã²ããä¾å­é¨
+		target_rename.def		ã¿ã¼ã²ããä¾å­é¨ã®å
+é¨è­å¥åã®ãªãã¼ã å®ç¾©
+		target_rename.h			ã¿ã¼ã²ããä¾å­é¨ã®å
+é¨è­å¥åã®ãªãã¼ã 
+		target_serial.c			serial.cã®ã¿ã¼ã²ããä¾å­é¨
+		target_serial.cfg		serial.cfgã®ã¿ã¼ã²ããä¾å­é¨
+		target_serial.h			serial.hã®ã¿ã¼ã²ããä¾å­é¨
+		target_sil.h			sil.hã®ã¿ã¼ã²ããä¾å­é¨
+		target_stddef.h			t_stddef.hã®ã¿ã¼ã²ããä¾å­é¨
+		target_syssvc.h			ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­å®ç¾©
+		target_test.h			ãã¹ããã­ã°ã©ã ã®ã¿ã¼ã²ããä¾å­å®ç¾©
+		target_timer.c			ã¿ã¤ããã©ã¤ã
+		target_timer.cfg		ã¿ã¤ããã©ã¤ãã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+		target_timer.h			ã¿ã¤ããã©ã¤ããä½¿ç¨ããããã®å®ç¾©
+		target_unrename.h		ã¿ã¼ã²ããä¾å­é¨ã®å
+é¨è­å¥åã®ãªãã¼ã è§£é¤
+		target_user.txt			ã¿ã¼ã²ããä¾å­é¨ã®ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«
+		unix_sigio.cfg			ãã³ãã­ãã­ã³ã°I/Oãµãã¼ãã¢ã¸ã¥ã¼ã«ã®ã³ã³
+								ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+		unix_sigio.h			ãã³ãã­ãã­ã³ã°I/Oãµãã¼ãã¢ã¸ã¥ã¼ã«ã®å®ç¾©
+
+	target/test_hrt_macosx_xcode/
+		MANIFEST				åå¥ããã±ã¼ã¸ã®ãã¡ã¤ã«ãªã¹ã
+		Makefile.target			Makefileã®ã¿ã¼ã²ããä¾å­é¨
+		target_kernel.h			kernel.hã®ã¿ã¼ã²ããä¾å­é¨
+		target_syssvc.h			ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­å®ç¾©
+		target_timer.c			ã¿ã¤ããã©ã¤ã
+		target_timer.h			ã¿ã¤ããã©ã¤ããä½¿ç¨ããããã®å®ç¾©
+
+6.2 ãã¼ã¸ã§ã³å±¥æ­´
+
+	2014å¹´11æ24æ¥	Release	3.A.0		æåã®ãªãªã¼ã¹
+	2015å¹´8æ5æ¥	Release	3.B.0
+
+ä»¥ä¸
Index: asp3_wo_tecs/trunk/target/macosx_xcode/unix_sigio.cfg
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/unix_sigio.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/unix_sigio.cfg	(revision 302)
@@ -0,0 +1,11 @@
+/*
+ *		UNIXç¨ãã³ãã­ãã­ã³ã°I/Oãµãã¼ãã¢ã¸ã¥ã¼ã«ã®
+ *		ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: unix_sigio.cfg 237 2014-09-28 19:17:01Z ertl-hiro $
+ */
+
+#pragma once
+
+#include "unix_sigio.h"
+CFG_INT(INTNO_SIGIO, { TA_ENAINT | INTATR_SIGIO, INTPRI_SIGIO });
Index: asp3_wo_tecs/trunk/target/macosx_xcode/unix_sigio.h
===================================================================
--- asp3_wo_tecs/trunk/target/macosx_xcode/unix_sigio.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/macosx_xcode/unix_sigio.h	(revision 302)
@@ -0,0 +1,74 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2006-2008 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: unix_sigio.h 102 2014-05-04 15:25:30Z ertl-hiro $
+ */
+
+/*
+ *		UNIXç¨ãã³ãã­ãã­ã³ã°I/Oãµãã¼ãã¢ã¸ã¥ã¼ã«
+ *
+ */
+
+#ifndef	TOPPERS_UNIX_SIGIO_H
+#define	TOPPERS_UNIX_SIGIO_H
+
+/*
+ *  SIGIOãã³ãã©ç»é²ã®ããã®å®æ°
+ */
+#define	INHNO_SIGIO		SIGIO			/* å²è¾¼ã¿ãã³ãã©çªå· */
+#define INTNO_SIGIO		SIGIO			/* å²è¾¼ã¿çªå· */
+#define INTPRI_SIGIO	TMAX_INTPRI		/* å²è¾¼ã¿åªå
+åº¦ï¼æä½åªå
+åº¦ï¼*/
+#define INTATR_SIGIO	TA_EDGE			/* å²è¾¼ã¿å±æ§ */
+
+#endif /* TOPPERS_UNIX_SIGIO_H */
Index: asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/MANIFEST
===================================================================
--- asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/MANIFEST	(revision 302)
+++ asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/MANIFEST	(revision 302)
@@ -0,0 +1,8 @@
+PACKAGE asp3_target_macosx_xcode
+
+MANIFEST
+Makefile.target
+target_kernel.h
+target_syssvc.h
+target_timer.c
+target_timer.h
Index: asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/Makefile.target
===================================================================
--- asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/Makefile.target	(revision 302)
+++ asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/Makefile.target	(revision 302)
@@ -0,0 +1,81 @@
+#
+#		Makefile ã®ã¿ã¼ã²ããä¾å­é¨ï¼Mac OS Xç¨ï¼
+#
+#  $Id: Makefile.target 504 2016-01-12 01:19:55Z ertl-hiro $
+#
+
+#
+#  ã·ã¹ãã åï¼éçºç°å¢åã®å®ç¾©
+#
+SYS = macosx
+TOOL = xcode
+
+#
+#  ãã®ã¿ã¼ã²ããä¾å­é¨ã§ã¯macosx_xcodeã¨ç°ãªããã¡ã¤ã«ã®ã¿ãç¨æãã
+#
+TARGETDIR2 = $(SRCDIR)/target/macosx_xcode
+TARGET_TF = $(TARGETDIR2)/target.tf
+TARGET_CHECK_TF = $(TARGETDIR2)/target_check.tf
+
+#
+#  ãã¼ã«ä¾å­é¨ãã£ã¬ã¯ããªåã®å®ç¾© 
+#
+#  GCCåãã®ãã¼ã«ä¾å­é¨ãæµç¨ããï¼
+#
+TOOLDIR = $(SRCDIR)/arch/gcc
+
+#
+#  éçºãã¼ã«ã®ã³ãã³ãåã®å®ç¾©
+#
+#  objcopyã¨objdumpã¯ï¼ããããï¼gobjcopyã¨gobjdumpãç¨ããï¼
+#
+CC = cc
+CXX = c++
+AS = as
+LD = ld
+AR = ar
+NM = nm
+RANLIB = ranlib
+OBJCOPY = gobjcopy
+OBJDUMP = gobjdump
+
+#
+#  offset.hã¯ä½¿ç¨ããªã
+#
+OMIT_OFFSET_H = true
+
+#
+#  ã³ã³ãã¤ã«ãªãã·ã§ã³
+#
+#  ã«ã¼ãã«ãé¢æ°åä½ã§ã³ã³ãã¤ã«ããæã«ã¯ï¼æªä½¿ç¨é¢æ°ã®è­¦åãææ­¢ããï¼
+#
+INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(TARGETDIR2) -I$(TOOLDIR)
+COPTS := -m32 -Werror $(COPTS)
+ifdef KERNEL_FUNCOBJS
+	COPTS := -Wno-unused-function $(COPTS)
+endif
+
+#
+#  ã«ã¼ãã«ã«é¢ããå®ç¾©
+#
+KERNEL_DIRS := $(KERNEL_DIRS) $(TARGETDIR) $(TARGETDIR2)
+KERNEL_COBJS := $(KERNEL_COBJS) target_kernel_impl.o target_timer.o
+
+#
+#  ã·ã¹ãã ãµã¼ãã¹ã«é¢ããå®ç¾©
+#
+SYSSVC_COBJS := $(SYSSVC_COBJS) target_serial.o
+
+#
+#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
+#
+CFG_TABS := $(CFG_TABS) --cfg1-def-table $(TARGETDIR2)/target_def.csv
+
+#
+#  ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ãã«é¢ããå®ç¾©
+#
+ifdef ENABLE_TRACE
+	COPTS := $(COPTS) -DTOPPERS_ENABLE_TRACE
+	KERNEL_DIRS := $(KERNEL_DIRS) $(SRCDIR)/arch/logtrace
+	KERNEL_COBJS := $(KERNEL_COBJS) trace_config.o trace_dump.o
+endif
Index: asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/target_kernel.h
===================================================================
--- asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/target_kernel.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/target_kernel.h	(revision 302)
@@ -0,0 +1,122 @@
+/*
+ *  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) 2004-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: target_kernel.h 157 2014-05-29 07:32:48Z ertl-hiro $
+ */
+
+/*
+ *		kernel.hã®ã¿ã¼ã²ããä¾å­é¨
+ *		ï¼Mac OS Xä¸ã§ã®ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ãç¨ï¼
+ *
+ *  ãã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã¯ï¼kernel.hã§ã¤ã³ã¯ã«ã¼ããããï¼ä»ã®ãã¡
+ *  ã¤ã«ããç´æ¥ã¤ã³ã¯ã«ã¼ããããã¨ã¯ãªãï¼ãã®ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ã
+ *  ããåã«ï¼t_stddef.hãã¤ã³ã¯ã«ã¼ããããã®ã§ï¼ãããã«ä¾å­ãã¦ãã
+ *  ãï¼
+ */
+
+#ifndef TOPPERS_TARGET_KERNEL_H
+#define TOPPERS_TARGET_KERNEL_H
+
+/*
+ *  ã¿ã¼ã²ããä¾å­é¨ã§ãµãã¼ãã§ããæ©è½
+ */
+#define TOPPERS_TARGET_SUPPORT_DIS_INT		/* dis_int */
+#define TOPPERS_TARGET_SUPPORT_ENA_INT		/* ena_int */
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ã¿ã¤ãå¨æ
+ *
+ *  ã¿ã¤ãå¨æã2^32ã®å ´åã«ã¯ï¼ãã®ãã¯ã­ãå®ç¾©ããªãï¼
+ */
+#ifdef HRT_CONFIG1		/* 1Î¼ç§æ¯ã«ã«ã¦ã³ãã¢ãããã32ãããã¿ã¤ã */
+#undef TCYC_HRTCNT
+#endif /* HRT_CONFIG1 */
+
+#ifdef HRT_CONFIG2		/* 10Î¼æ¯ã«ã«ã¦ã³ãã¢ãããã16ãããã¿ã¤ã */
+#define TCYC_HRTCNT		(0x10000U * 10U)
+#endif /* HRT_CONFIG2 */
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã®é²ã¿å¹
+
+ */
+#ifdef HRT_CONFIG1		/* 1Î¼ç§æ¯ã«ã«ã¦ã³ãã¢ãããã32ãããã¿ã¤ã */
+#define TSTEP_HRTCNT	1U
+#endif /* HRT_CONFIG1 */
+
+#ifdef HRT_CONFIG2		/* 10Î¼æ¯ã«ã«ã¦ã³ãã¢ãããã16ãããã¿ã¤ã */
+#define TSTEP_HRTCNT	10U
+#endif /* HRT_CONFIG2 */
+
+/*
+ *  å²è¾¼ã¿åªå
+åº¦ã®ç¯å²
+ *
+ *  TMIN_INTPRIã®å®ç¾©ãå¤æ´ãããã¨ã§ï¼ã©ã®ã¬ãã«ãããé«ãå²è¾¼ã¿åªå
+åº¦
+ *  ãæã¤ãã®ãã«ã¼ãã«ç®¡çå¤ã®å²è¾¼ã¿ã¨ããããå¤æ´ã§ããï¼
+ *
+ *  TMIN_INTPRIã«è¨­å®ã§ããå¤ã¯ï¼-6ã-1ã®ç¯å²ã§ããï¼ä¾ãã°TMIN_INTPRI
+ *  ã-5ã«è¨­å®ããã¨ï¼ã¬ãã«7ï¼NMIï¼ã¨ã¬ãã«6ã®å²è¾¼ã¿ãã«ã¼ãã«ç®¡çå¤ã¨
+ *  ãªãï¼TMIN_INTPRIã-6ã«è¨­å®ããã¨ï¼ã¬ãã«7ã®å²è¾¼ã¿ï¼NMIï¼ä»¥å¤ã«ã«ã¼
+ *  ãã«ç®¡çå¤ã®å²è¾¼ã¿ãè¨­ããªããã¨ã«ãªãï¼
+ */
+#ifndef TMIN_INTPRI
+#define TMIN_INTPRI		(-6)		/* å²è¾¼ã¿åªå
+åº¦ã®æå°å¤ï¼æé«å¤ï¼*/
+#endif /* TMIN_INTPRI */
+#define TMAX_INTPRI		(-1)		/* å²è¾¼ã¿åªå
+åº¦ã®æå¤§å¤ï¼æä½å¤ï¼ */
+
+#endif /* TOPPERS_TARGET_KERNEL_H */
Index: asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/target_syssvc.h
===================================================================
--- asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/target_syssvc.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/target_syssvc.h	(revision 302)
@@ -0,0 +1,110 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  Copyright (C) 2006-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: target_syssvc.h 293 2014-11-30 09:27:54Z ertl-hiro $
+ */
+
+/*
+ *		ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­é¨
+ *		ï¼Mac OS Xä¸ã§ã®ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ãç¨ï¼
+ *
+ *  ã·ã¹ãã ãµã¼ãã¹ã®ã¿ã¼ã²ããä¾å­é¨ã®ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ï¼ãã®ãã¡
+ *  ã¤ã«ã®å
+å®¹ã¯ï¼ã³ã³ãã¼ãã³ãè¨è¿°ãã¡ã¤ã«ã«è¨è¿°ããï¼ãã®ãã¡ã¤ã«ã¯
+ *  ç¡ããªãè¦è¾¼ã¿ï¼
+ */
+
+#ifndef TOPPERS_TARGET_SYSSVC_H
+#define TOPPERS_TARGET_SYSSVC_H
+
+/*
+ *  ã¿ã¼ã²ããã·ã¹ãã ã®OSä¾å­ã®å®ç¾©
+ */
+#include "macosx.h"
+
+/*
+ *  ãã¬ã¼ã¹ã­ã°ã«é¢ããè¨­å®
+ */
+#ifdef TOPPERS_ENABLE_TRACE
+#include "arch/logtrace/trace_config.h"
+#endif /* TOPPERS_ENABLE_TRACE */
+
+/*
+ *  èµ·åã¡ãã»ã¼ã¸ã®ã¿ã¼ã²ããã·ã¹ãã å
+ */
+#define TARGET_NAME	"Mac OS X (for System Time Test)"
+
+/*
+ *  ã­ã°æå»ã®åãåºã
+ *
+ *  ç¡éã®åå¸°å¼åºããé²ãããï¼ã­ã°æå»ãè¨é²ããªãããã«ããï¼
+ */
+#define SYSLOG_GET_LOGTIM(p_logtim)	((void) 0)
+
+/*
+ *  ã·ã¹ãã ã­ã°ã®ä½ã¬ãã«åºåã®ããã®æå­åºå
+ *
+ *  ã¿ã¼ã²ããä¾å­ã®æ¹æ³ã§ï¼æå­cãè¡¨ç¤º/åºå/ä¿å­ããï¼
+ */
+extern void	target_fput_log(char c);
+
+/*
+ *  ã·ãªã¢ã«ãã¼ãæ°ã®å®ç¾©
+ */
+#define TNUM_PORT		1		/* ãµãã¼ãããã·ãªã¢ã«ãã¼ãã®æ° */
+
+/*
+ *  ã·ã¹ãã ã­ã°ã¿ã¹ã¯é¢é£ã®å®æ°ã®å®ç¾©
+ */
+#define LOGTASK_STACK_SIZE	SIGSTKSZ	/* ã¹ã¿ãã¯é åã®ãµã¤ãº */
+
+#endif /* TOPPERS_TARGET_SYSSVC_H */
Index: asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/target_timer.c
===================================================================
--- asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/target_timer.c	(revision 302)
+++ asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/target_timer.c	(revision 302)
@@ -0,0 +1,119 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: target_timer.c 381 2015-07-31 02:19:30Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ããã©ã¤ãï¼Mac OS Xä¸ã§ã®ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ãç¨ï¼
+ */
+
+#include "kernel_impl.h"
+#include "time_event.h"
+#include "target_timer.h"
+#include <sys/time.h>
+
+/*
+ *  ã¿ã¤ãå²è¾¼ã¿ãçºçãããã¾ã§ã®æé
+ */
+#define HRT_INTERVAL	1000U
+
+/*
+ *  ã¿ã¤ãã®åæåå¦ç
+ */
+void
+target_timer_initialize(intptr_t exinf)
+{
+}
+
+/*
+ *  ã¿ã¤ãã®çµäºå¦ç
+ */
+void
+target_timer_terminate(intptr_t exinf)
+{
+}
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®è¦æ±
+ */
+void
+target_raise_hrt_int(uint_t timing)
+{
+	struct itimerval	val, oval;
+
+	if (timing == 0) {
+		/*
+		 *  å³åº§ã«ã¿ã¤ãå²è¾¼ã¿ãçºçãããï¼
+		 */
+		raise(SIGALRM);
+	}
+	else {
+		/*
+		 *  ä¸å®æéå¾ã«ï¼ã¿ã¤ãå²è¾¼ã¿ãçºçãããï¼
+		 */
+		val.it_interval.tv_sec = 0;
+		val.it_interval.tv_usec = 0;
+		val.it_value.tv_sec = HRT_INTERVAL * timing / 1000000U;
+		val.it_value.tv_usec = HRT_INTERVAL * timing % 1000000U;
+		setitimer(ITIMER_REAL, &val, &oval);
+	}
+}
+
+/*
+ *  ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+void
+target_timer_handler(void)
+{
+	signal_time();					/* é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦ç */
+}
Index: asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/target_timer.h
===================================================================
--- asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/target_timer.h	(revision 302)
+++ asp3_wo_tecs/trunk/target/test_hrt_macosx_xcode/target_timer.h	(revision 302)
@@ -0,0 +1,132 @@
+/*
+ *  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: target_timer.h 381 2015-07-31 02:19:30Z ertl-hiro $
+ */
+
+/*
+ *		ã¿ã¤ããã©ã¤ãï¼Mac OS Xä¸ã§ã®ã·ã¹ãã æå»ç®¡çæ©è½ãã¹ãç¨ï¼
+ */
+
+#ifndef TOPPERS_TARGET_TIMER_H
+#define TOPPERS_TARGET_TIMER_H
+
+#include <sil.h>
+#include "macosx.h"
+#ifndef TOPPERS_MACRO_ONLY
+#include <sys/time.h>
+#endif /* TOPPERS_MACRO_ONLY */
+
+/*
+ *  ã¿ã¤ãå²è¾¼ã¿ãã³ãã©ç»é²ã®ããã®å®æ°
+ */
+#define INHNO_TIMER		SIGALRM				/* å²è¾¼ã¿ãã³ãã©çªå· */
+#define INTNO_TIMER		SIGALRM				/* å²è¾¼ã¿çªå· */
+#define INTPRI_TIMER	(TMAX_INTPRI - 1)	/* å²è¾¼ã¿åªå
+åº¦ */
+#define INTATR_TIMER	TA_EDGE				/* å²è¾¼ã¿å±æ§ */
+
+#ifndef TOPPERS_MACRO_ONLY
+
+/*
+ *  ã¿ã¤ãã®åæåå¦ç
+ */
+extern void	target_timer_initialize(intptr_t exinf);
+
+/*
+ *  ã¿ã¤ãã®çµäºå¦ç
+ */
+extern void	target_timer_terminate(intptr_t exinf);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã®ç¾å¨ã®ã«ã¦ã³ãå¤ã®èª­åºã
+ */
+extern HRTCNT target_hrt_get_current(void);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãã¸ã®å²è¾¼ã¿ã¿ã¤ãã³ã°ã®è¨­å®
+ *
+ *  é«åè§£è½ã¿ã¤ããï¼hrtcntã§æå®ããå¤ã«ã¦ã³ãã¢ãããããå²è¾¼ã¿ãçº
+ *  çãããããã«è¨­å®ããï¼
+ */
+extern void target_hrt_set_event(HRTCNT hrtcnt);
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®è¦æ±
+ */
+extern void target_hrt_raise_event(void);
+
+/*
+ *  å²è¾¼ã¿ã¿ã¤ãã³ã°ã«æå®ããæå¤§å¤
+ */
+#ifdef HRT_CONFIG1		/* 1Î¼ç§æ¯ã«ã«ã¦ã³ãã¢ãããã32ãããã¿ã¤ã */
+#define HRTCNT_BOUND	4000000002U
+#endif /* HRT_CONFIG1 */
+
+#ifdef HRT_CONFIG2		/* 10Î¼æ¯ã«ã«ã¦ã³ãã¢ãããã16ãããã¿ã¤ã */
+#define HRTCNT_BOUND	(0x10000U * 9U)
+#endif /* HRT_CONFIG2 */
+
+/*
+ *  é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®è¦æ±ï¼ãã¹ããã­ã°ã©ã ç¨ï¼
+ */
+extern void target_raise_hrt_int(uint_t timing);
+
+/*
+ *  ã¿ã¤ãå²è¾¼ã¿ãã³ãã©
+ */
+extern void	target_timer_handler(void);
+
+#endif /* TOPPERS_MACRO_ONLY */
+#endif /* TOPPERS_TARGET_TIMER_H */
Index: asp3_wo_tecs/trunk/test/MANIFEST
===================================================================
--- asp3_wo_tecs/trunk/test/MANIFEST	(revision 302)
+++ asp3_wo_tecs/trunk/test/MANIFEST	(revision 302)
@@ -0,0 +1,103 @@
+PACKAGE asp3
+
+MANIFEST
+bit_kernel.c
+bit_mutex.c
+hrt_systim1.c
+hrt_systim1.cfg
+hrt_systim1.h
+hrt_systim2.c
+hrt_systim2.cfg
+hrt_systim2.h
+hrt_systim3.c
+hrt_systim3.cfg
+hrt_systim3.h
+hrt_systim4.c
+hrt_systim4.cfg
+hrt_systim4.h
+perf0.c
+perf0.cfg
+perf0.h
+perf1.c
+perf1.cfg
+perf1.h
+perf2.c
+perf2.cfg
+perf2.h
+perf3.c
+perf3.cfg
+perf3.h
+perf4.c
+perf4.cfg
+perf4.h
+perf5.c
+perf5.cfg
+perf5.h
+test_cpuexc.cfg
+test_cpuexc.h
+test_cpuexc.txt
+test_cpuexc1.c
+test_cpuexc2.c
+test_cpuexc3.c
+test_cpuexc4.c
+test_cpuexc5.c
+test_cpuexc6.c
+test_cpuexc7.c
+test_cpuexc8.c
+test_cpuexc9.c
+test_cpuexc10.c
+test_dlynse.c
+test_dlynse.cfg
+test_dlynse.h
+test_hrt1.c
+test_hrt1.cfg
+test_hrt1.h
+test_mutex.h
+test_mutex1.c
+test_mutex1.cfg
+test_mutex2.c
+test_mutex2.cfg
+test_mutex3.c
+test_mutex3.cfg
+test_mutex4.c
+test_mutex4.cfg
+test_mutex4.h
+test_mutex5.c
+test_mutex5.cfg
+test_mutex5.h
+test_mutex6.c
+test_mutex6.cfg
+test_mutex6.h
+test_mutex7.c
+test_mutex7.cfg
+test_mutex7.h
+test_mutex8.c
+test_mutex8.cfg
+test_mutex8.h
+test_notify1.c
+test_notify1.cfg
+test_notify1.h
+test_raster1.c
+test_raster1.cfg
+test_raster1.h
+test_raster2.c
+test_raster2.cfg
+test_raster2.h
+test_sem1.c
+test_sem1.cfg
+test_sem1.h
+test_sem2.c
+test_sem2.cfg
+test_sem2.h
+test_sysman1.c
+test_sysman1.cfg
+test_sysman1.h
+test_sysstat1.c
+test_sysstat1.cfg
+test_sysstat1.h
+test_task1.c
+test_task1.cfg
+test_task1.h
+test_tmevt1.c
+test_tmevt1.cfg
+test_tmevt1.h
Index: asp3_wo_tecs/trunk/test/bit_kernel.c
===================================================================
--- asp3_wo_tecs/trunk/test/bit_kernel.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/bit_kernel.c	(revision 302)
@@ -0,0 +1,593 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      Advanced Standard Profile Kernel
+ * 
+ *  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: bit_kernel.c 456 2015-08-16 06:11:51Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«ã®æ´åæ§æ¤æ»
+ */
+
+#include "kernel/kernel_impl.h"
+#include "kernel/task.h"
+#include "kernel/wait.h"
+#include "kernel/semaphore.h"
+#include "kernel/eventflag.h"
+#include "kernel/dataqueue.h"
+#include "kernel/pridataq.h"
+#include "kernel/mutex.h"
+#include "kernel/mempfix.h"
+#include "kernel/time_event.h"
+#include "kernel/check.h"
+
+/*
+ *   ã¨ã©ã¼ã³ã¼ãã®å®ç¾©
+ */
+#define E_SYS_LINENO	ERCD(E_SYS, -(__LINE__))
+
+/*
+ *  ç®¡çãã­ãã¯ã®ã¢ãã¬ã¹ã®æ­£å½æ§ã®ãã§ãã¯
+ */
+#define VALID_TCB(p_tcb) \
+		((((char *) p_tcb) - ((char *) tcb_table)) % sizeof(TCB) == 0 \
+			&& TMIN_TSKID <= TSKID(p_tcb) && TSKID(p_tcb) <= tmax_tskid)
+
+#define VALID_SEMCB(p_semcb) \
+		((((char *) p_semcb) - ((char *) semcb_table)) % sizeof(SEMCB) == 0 \
+			&& TMIN_SEMID <= SEMID(p_semcb) && SEMID(p_semcb) <= tmax_semid)
+				
+#define VALID_FLGCB(p_flgcb) \
+		((((char *) p_flgcb) - ((char *) flgcb_table)) % sizeof(FLGCB) == 0 \
+			&& TMIN_FLGID <= FLGID(p_flgcb) && FLGID(p_flgcb) <= tmax_flgid)
+
+#define VALID_DTQCB(p_dtqcb) \
+		((((char *) p_dtqcb) - ((char *) dtqcb_table)) % sizeof(DTQCB) == 0 \
+			&& TMIN_DTQID <= DTQID(p_dtqcb) && DTQID(p_dtqcb) <= tmax_dtqid)
+
+#define VALID_PDQCB(p_pdqcb) \
+		((((char *) p_pdqcb) - ((char *) pdqcb_table)) % sizeof(PDQCB) == 0 \
+			&& TMIN_PDQID <= PDQID(p_pdqcb) && PDQID(p_pdqcb) <= tmax_pdqid)
+
+#define VALID_MTXCB(p_mtxcb) \
+		((((char *) p_mtxcb) - ((char *) mtxcb_table)) % sizeof(MTXCB) == 0 \
+			&& TMIN_MTXID <= MTXID(p_mtxcb) && MTXID(p_mtxcb) <= tmax_mtxid)
+
+#define VALID_MPFCB(p_mpfcb) \
+		((((char *) p_mpfcb) - ((char *) mpfcb_table)) % sizeof(MPFCB) == 0 \
+			&& TMIN_MPFID <= MPFID(p_mpfcb) && MPFID(p_mpfcb) <= tmax_mpfid)
+
+/*
+ *  ã­ã¥ã¼ã®ãã§ãã¯ã®ããã®é¢æ°
+ *
+ *  p_queueã«p_entryãå«ã¾ãã¦ããããèª¿ã¹ãï¼å«ã¾ãã¦ããã°trueï¼å«ã¾
+ *  ãã¦ããªãå ´åã«ã¯falseãè¿ãï¼ããã«ãªã³ã¯ã®ä¸æ´åã®å ´åã«ãï¼
+ *  falseãè¿ãï¼
+ */
+static bool_t
+in_queue(QUEUE *p_queue, QUEUE *p_entry)
+{
+	QUEUE	*p_current, *p_next;
+
+	p_current = p_queue->p_next;
+	if (p_current->p_prev != p_queue) {
+		return(false);					/* ããã«ãªã³ã¯ã®ä¸æ´å */
+	}
+	while (p_current != p_queue) {
+		if (p_current == p_entry) {
+			return(true);				/* p_entryãå«ã¾ãã¦ãã */
+		}
+
+		/*
+		 *  ã­ã¥ã¼ã®æ¬¡ã®è¦ç´ ã«é²ã
+		 */
+		p_next = p_current->p_next;
+		if (p_next->p_prev != p_current) {
+			return(false);				 /* ããã«ãªã³ã¯ã®ä¸æ´å */
+		}
+		p_current = p_next;
+	}
+	return(false);
+}
+
+/*
+ *  ã¹ã¿ãã¯ä¸ãæãã¦ãããã®æ¤æ»
+ */
+static bool_t
+on_stack(void *addr, const TINIB *p_tinib)
+{
+#ifdef USE_TSKINICTXB
+	/*
+	 *  ãã®é¢æ°ã®å®è£
+ã¯ã¿ã¼ã²ããä¾å­ã«ãªãï¼
+	 */
+	return(true);
+#else /* USE_TSKINICTXB */
+	if (p_tinib->stk <= addr
+			&& addr < (void *)((char *)(p_tinib->stk) + p_tinib->stksz)) {
+		return(true);
+	}
+	return(false);
+#endif /* USE_TSKINICTXB */
+}
+
+/*
+ *  ã¹ã±ã¸ã¥ã¼ãªã³ã°ã®ããã®ãã¼ã¿æ§é ã®æ¤æ»
+ */
+#ifndef PRIMAP_BIT
+#define	PRIMAP_BIT(pri)		(1U << (pri))
+#endif /* PRIMAP_BIT */
+
+static ER
+bit_schedcb(void)
+{
+	uint_t	pri;
+	QUEUE	*p_queue;
+	TCB		*p_tcb;
+
+	/*
+	 *  enadspã¨p_schedtskã®æ´åæ§ã®æ¤æ»
+	 */
+	if (enadsp) {
+		if (ready_primap == 0U) {
+			if (p_schedtsk != NULL) {
+				return(E_SYS_LINENO);
+			}
+		}
+		else {
+			if (p_schedtsk != search_schedtsk()) {
+				return(E_SYS_LINENO);
+			}
+		}
+	}
+
+	/*
+	 *  ready_queueã¨ready_primapã®æ´åæ§ã®æ¤æ»
+	 */
+	for (pri = 0; pri < TNUM_TPRI; pri++) {
+		p_queue = ready_queue[pri].p_next;
+		if (p_queue == &ready_queue[pri]) {
+			if ((ready_primap & PRIMAP_BIT(pri)) != 0U) {
+				return(E_SYS_LINENO);
+			}
+		}
+		else {
+			if ((ready_primap & PRIMAP_BIT(pri)) == 0U) {
+				return(E_SYS_LINENO);
+			}
+		}
+		while (p_queue != &ready_queue[pri]) {
+			p_tcb = (TCB *) p_queue;
+			if (!VALID_TCB(p_tcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!TSTAT_RUNNABLE(p_tcb->tstat)) {
+				return(E_SYS_LINENO);
+			}
+			if (p_tcb->priority != pri) {
+				return(E_SYS_LINENO);
+			}
+			p_queue = p_queue->p_next;
+		}
+	}
+	return(E_OK);
+}
+
+/*
+ *  ã¿ã¹ã¯æ¯ã®æ´åæ§æ¤æ»
+ */
+static ER
+bit_task(ID tskid)
+{
+	TCB				*p_tcb;
+	const TINIB		*p_tinib;
+	uint_t			tstat, bpri, pri;
+	TMEVTB			*p_tmevtb;
+	SEMCB			*p_semcb;
+	FLGCB			*p_flgcb;
+	DTQCB			*p_dtqcb;
+	PDQCB			*p_pdqcb;
+	MTXCB			*p_mtxcb;
+	MPFCB			*p_mpfcb;
+
+	if (!VALID_TSKID(tskid)) {
+		return(E_ID);
+	}
+	p_tcb = get_tcb(tskid);
+	p_tinib = p_tcb->p_tinib;
+	tstat = p_tcb->tstat;
+	bpri = p_tcb->bpriority;
+	pri = p_tcb->priority;
+
+	/*
+	 *  ã¿ã¹ã¯åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ã®æ¤æ»
+	 */
+	if (p_tinib != &(tinib_table[INDEX_TSK(tskid)])) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  tstatã®æ¤æ»
+	 */
+	if (TSTAT_DORMANT(tstat)) {
+		if (tstat != TS_DORMANT) {
+			return(E_SYS_LINENO);
+		}
+	}
+	else if (TSTAT_WAITING(tstat)) {
+		if ((tstat & ~(TS_WAITING_MASK | TS_SUSPENDED)) != 0U) {
+			return(E_SYS_LINENO);
+		}
+	}
+	else if (TSTAT_SUSPENDED(tstat)) {
+		if (tstat != TS_SUSPENDED) {
+			return(E_SYS_LINENO);
+		}
+	}
+	else {
+		if (tstat != TS_RUNNABLE) {
+			return(E_SYS_LINENO);
+		}
+	}
+
+	/*
+	 *  ãã¼ã¹åªå
+åº¦ã®æ¤æ»
+	 */
+	if (bpri >= TNUM_TPRI) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  ç¾å¨ã®åªå
+åº¦ã®æ¤æ»
+	 */
+	if (pri > bpri) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  rasterã¨ä»ã®ç¶æ
+ã®æ´åæ§ã®æ¤æ»
+	 */
+	if (p_tcb->raster && (p_tcb->enater || TSTAT_WAITING(tstat))) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  ä¼æ­¢ç¶æ
+ã«ããããã§ãã¯
+	 */
+	if (TSTAT_DORMANT(tstat)) {
+		if (!(bpri == p_tinib->ipriority
+			  		&& pri == p_tinib->ipriority
+					&& p_tcb->actque == false
+					&& p_tcb->wupque == false
+					&& p_tcb->raster == false
+					&& p_tcb->enater == true
+					&& p_tcb->p_lastmtx == NULL)) {
+			return(E_SYS_LINENO);
+		}
+	}
+
+	/*
+	 *  å®è¡ã§ããç¶æ
+ã«ããããã§ãã¯
+	 */
+	if (TSTAT_RUNNABLE(tstat)) {
+		if (!in_queue(&ready_queue[pri], &(p_tcb->task_queue))) {
+			return(E_SYS_LINENO);
+		}
+	}
+
+	/*
+	 *  å¾
+ã¡ç¶æ
+ã«ããããã§ãã¯
+	 */
+	if (TSTAT_WAITING(tstat)) {
+		if (!on_stack(p_tcb->p_winfo, p_tinib)) {
+			return(E_SYS_LINENO);
+		}
+		p_tmevtb = p_tcb->p_winfo->p_tmevtb;
+		if (p_tmevtb != NULL) {
+			if (!on_stack(p_tmevtb, p_tinib)) {
+				return(E_SYS_LINENO);
+			}
+			/*
+			 *  (*p_tmevtb)ã®æ¤æ»ï¼æªå®æï¼
+			 */
+		}
+
+		switch (tstat & TS_WAITING_MASK) {
+		case TS_WAITING_SLP:
+			if (p_tcb->wupque == true) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_DLY:
+			if (p_tmevtb == NULL) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_SEM:
+			p_semcb = ((WINFO_SEM *)(p_tcb->p_winfo))->p_semcb;
+			if (!VALID_SEMCB(p_semcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_semcb->wait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_FLG:
+			p_flgcb = ((WINFO_FLG *)(p_tcb->p_winfo))->p_flgcb;
+			if (!VALID_FLGCB(p_flgcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_flgcb->wait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_SDTQ:
+			p_dtqcb = ((WINFO_SDTQ *)(p_tcb->p_winfo))->p_dtqcb;
+			if (!VALID_DTQCB(p_dtqcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_dtqcb->swait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_RDTQ:
+			p_dtqcb = ((WINFO_RDTQ *)(p_tcb->p_winfo))->p_dtqcb;
+			if (!VALID_DTQCB(p_dtqcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_dtqcb->rwait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_SPDQ:
+			p_pdqcb = ((WINFO_SPDQ *)(p_tcb->p_winfo))->p_pdqcb;
+			if (!VALID_PDQCB(p_pdqcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_pdqcb->swait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_RPDQ:
+			p_pdqcb = ((WINFO_RPDQ *)(p_tcb->p_winfo))->p_pdqcb;
+			if (!VALID_PDQCB(p_pdqcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_pdqcb->rwait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_MTX:
+			p_mtxcb = ((WINFO_MTX *)(p_tcb->p_winfo))->p_mtxcb;
+			if (!VALID_MTXCB(p_mtxcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_mtxcb->wait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		case TS_WAITING_MPF:
+			p_mpfcb = ((WINFO_MPF *)(p_tcb->p_winfo))->p_mpfcb;
+			if (!VALID_MPFCB(p_mpfcb)) {
+				return(E_SYS_LINENO);
+			}
+			if (!in_queue(&(p_mpfcb->wait_queue), &(p_tcb->task_queue))) {
+				return(E_SYS_LINENO);
+			}
+			break;
+
+		default:
+			return(E_SYS_LINENO);
+			break;
+		}
+	}
+
+	/*
+	 *  p_lastmtxã®æ¤æ»
+	 */
+	if (p_tcb->p_lastmtx != NULL) {
+		if (!VALID_MTXCB(p_tcb->p_lastmtx)) {
+			return(E_SYS_LINENO);
+		}
+	}
+
+	/*
+	 *  tskctxbã®æ¤æ»
+	 */
+	if (!TSTAT_DORMANT(tstat) && p_tcb != p_runtsk) {
+		/*
+		 *  ã¿ã¼ã²ããä¾å­ã®æ¤æ»
+		 */
+#if 0
+		if (bit_tskctxb(&(p_tcb->tskctxb))) {
+			return(E_SYS_LINENO);
+		}
+#endif
+	}
+	return(E_OK);
+}
+
+/*
+ *  ã»ããã©æ¯ã®æ´åæ§æ¤æ»
+ */
+#define INDEX_SEM(semid)	((uint_t)((semid) - TMIN_SEMID))
+#define get_semcb(semid)	(&(semcb_table[INDEX_SEM(semid)]))
+
+static ER
+bit_semaphore(ID semid)
+{
+	SEMCB			*p_semcb;
+	const SEMINIB	*p_seminib;
+	uint_t			semcnt, pri;
+	QUEUE			*p_queue;
+	TCB				*p_tcb;
+
+	if (!VALID_SEMID(semid)) {
+		return(E_ID);
+	}
+	p_semcb = get_semcb(semid);
+	p_seminib = p_semcb->p_seminib;
+	semcnt = p_semcb->semcnt;
+
+	/*
+	 *  ã»ããã©åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ã®æ¤æ»
+	 */
+	if (p_seminib != &(seminib_table[INDEX_SEM(semid)])) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  semcntã®æ¤æ»
+	 */
+	if (semcnt > p_seminib->maxsem) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  wait_queueã®æ¤æ»
+	 */
+	if (semcnt == 0) {
+		p_queue = p_semcb->wait_queue.p_next;
+		pri = TMIN_TPRI;
+		while (p_queue != &(p_semcb->wait_queue)) {
+			p_tcb = (TCB *) p_queue;
+			if (!VALID_TCB(p_tcb)) {
+				return(E_SYS_LINENO);
+			}
+
+			/*
+			 *  ã­ã¥ã¼ãã¿ã¹ã¯åªå
+åº¦é ã«ãªã£ã¦ãããã®æ¤æ»
+			 */
+			if ((p_seminib->sematr & TA_TPRI) != 0U) {
+				if (p_tcb->priority < pri) {
+					return(E_SYS_LINENO);
+				}
+			}
+			pri = p_tcb->priority;
+
+			/*
+			 *  ã¿ã¹ã¯ç¶æ
+ã®æ¤æ»
+			 */
+			if (p_tcb->tstat != TS_WAITING_SEM) {
+				return(E_SYS_LINENO);
+			}
+			if (p_semcb != ((WINFO_SEM *)(p_tcb->p_winfo))->p_semcb) {
+				return(E_SYS_LINENO);
+			}
+			p_queue = p_queue->p_next;
+		}
+	}
+	else {
+		if (!queue_empty(&(p_semcb->wait_queue))) {
+			return(E_SYS_LINENO);
+		}
+	}
+	return(E_OK);
+}
+
+/*
+ *  æ´åæ§æ¤æ»ã«ã¼ãã³æ¬ä½
+ */
+ER
+bit_kernel(void)
+{
+	ID		tskid;
+	ID		semid;
+	ER		ercd;
+
+	/*
+	 *  ã¹ã±ã¸ã¥ã¼ãªã³ã°ã®ããã®ãã¼ã¿æ§é ã®æ¤æ»
+	 */
+	ercd = bit_schedcb();
+	if (ercd != E_OK) {
+		return(ercd);
+	}
+
+	/*
+	 *  ã¿ã¹ã¯æ¯ã®æ¤æ»
+	 */
+	for (tskid = TMIN_TSKID; tskid <= tmax_tskid; tskid++) {
+		ercd = bit_task(tskid);
+		if (ercd != E_OK) {
+			return(ercd);
+		}
+	}
+
+	/*
+	 *  ã»ããã©æ¯ã®æ¤æ»
+	 */
+	for (semid = TMIN_SEMID; semid <= tmax_semid; semid++) {
+		ercd = bit_semaphore(semid);
+		if (ercd != E_OK) {
+			return(ercd);
+		}
+	}
+
+	return(E_OK);
+}
Index: asp3_wo_tecs/trunk/test/bit_mutex.c
===================================================================
--- asp3_wo_tecs/trunk/test/bit_mutex.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/bit_mutex.c	(revision 302)
@@ -0,0 +1,361 @@
+/*
+ *  TOPPERS/ASP Kernel
+ *      Toyohashi Open Platform for Embedded Real-Time Systems/
+ *      High Reliable system Profile Kernel
+ * 
+ *  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: bit_mutex.c 456 2015-08-16 06:11:51Z ertl-hiro $
+ */
+
+/*
+ *		ãã¥ã¼ããã¯ã¹æ©è½ã®æ´åæ§æ¤æ»
+ */
+
+#include "kernel/kernel_impl.h"
+#include "kernel/task.h"
+#include "kernel/mutex.h"
+#include "kernel/check.h"
+
+/*
+ *  ãã¥ã¼ããã¯ã¹IDãããã¥ã¼ããã¯ã¹ç®¡çãã­ãã¯ãåãåºãããã®ãã¯
+ *  ã­ï¼mutex.cããï¼
+ */
+#define INDEX_MTX(mtxid)	((uint_t)((mtxid) - TMIN_MTXID))
+#define get_mtxcb(mtxid)	(&(mtxcb_table[INDEX_MTX(mtxid)]))
+
+/*
+ *  ãã¥ã¼ããã¯ã¹ã®ãã­ãã³ã«ãå¤æ­ãããã¯ã­
+ */
+#define MTXPROTO_MASK			0x03U
+#define MTXPROTO(p_mtxinib)		((p_mtxinib)->mtxatr & MTXPROTO_MASK)
+#define MTX_CEILING(p_mtxinib)	(MTXPROTO(p_mtxinib) == TA_CEILING)
+
+/*
+ *   ã¨ã©ã¼ã³ã¼ãã®å®ç¾©
+ */
+#define E_SYS_LINENO	ERCD(E_SYS, -(__LINE__))
+
+/*
+ *  ç®¡çãã­ãã¯ã®ã¢ãã¬ã¹ã®æ­£å½æ§ã®ãã§ãã¯
+ */
+#define VALID_TCB(p_tcb) \
+		((((char *) p_tcb) - ((char *) tcb_table)) % sizeof(TCB) == 0 \
+			&& TMIN_TSKID <= TSKID(p_tcb) && TSKID(p_tcb) <= tmax_tskid)
+
+#define VALID_MTXCB(p_mtxcb) \
+		((((char *) p_mtxcb) - ((char *) mtxcb_table)) % sizeof(MTXCB) == 0 \
+			&& TMIN_MTXID <= MTXID(p_mtxcb) && MTXID(p_mtxcb) <= tmax_mtxid)
+				
+/*
+ *  ã­ã¥ã¼ã®ãã§ãã¯ã®ããã®é¢æ°
+ *
+ *  p_queueã«p_entryãå«ã¾ãã¦ããããèª¿ã¹ãï¼å«ã¾ãã¦ããã°trueï¼å«ã¾
+ *  ãã¦ããªãå ´åã«ã¯falseãè¿ãï¼ããã«ãªã³ã¯ã®ä¸æ´åã®å ´åã«ãï¼
+ *  falseãè¿ãï¼
+ */
+static bool_t
+in_queue(QUEUE *p_queue, QUEUE *p_entry)
+{
+	QUEUE	*p_current, *p_next;
+
+	p_current = p_queue->p_next;
+	if (p_current->p_prev != p_queue) {
+		return(false);					/* ããã«ãªã³ã¯ã®ä¸æ´å */
+	}
+	while (p_current != p_queue) {
+		if (p_current == p_entry) {
+			return(true);				/* p_entryãå«ã¾ãã¦ãã */
+		}
+
+		/*
+		 *  ã­ã¥ã¼ã®æ¬¡ã®è¦ç´ ã«é²ã
+		 */
+		p_next = p_current->p_next;
+		if (p_next->p_prev != p_current) {
+			return(false);				 /* ããã«ãªã³ã¯ã®ä¸æ´å */
+		}
+		p_current = p_next;
+	}
+	return(false);
+}
+
+/*
+ *  ã¿ã¹ã¯æ¯ã®æ¤æ»
+ */
+static ER
+bit_mutex_task(ID tskid)
+{
+	TCB				*p_tcb;
+	uint_t			pri;
+	MTXCB			*p_mtxcb;
+	const MTXINIB	*p_mtxinib;
+
+	if (!VALID_TSKID(tskid)) {
+		return(E_ID);
+	}
+	p_tcb = get_tcb(tskid);
+	pri = p_tcb->bpriority;
+
+	/*
+	 *  ã¿ã¹ã¯ãã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ã®ã­ã¥ã¼ã®æ¤æ»
+	 */
+	p_mtxcb = p_tcb->p_lastmtx;
+	while (p_mtxcb != NULL) {
+		if (!VALID_MTXCB(p_mtxcb)) {
+			return(E_SYS_LINENO);
+		}
+		p_mtxinib = p_mtxcb->p_mtxinib;
+
+		/*
+		 *  ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã¿ã¹ã¯ã®ãã§ãã¯
+		 */
+		if (p_mtxcb->p_loctsk != p_tcb) {
+			return(E_SYS_LINENO);
+		}
+
+		/*
+		 *  ç¾å¨åªå
+åº¦ã®è¨ç®
+		 */
+		if (MTXPROTO(p_mtxinib)) {
+			if (p_mtxinib->ceilpri < pri) {
+				pri = p_mtxinib->ceilpri;
+			}
+		}
+
+		/*
+		 *  ã­ã¥ã¼ã®æ¬¡ã®è¦ç´ ã«é²ã
+		 */
+		p_mtxcb = p_mtxcb->p_prevmtx;
+	}
+
+	/*
+	 *  ç¾å¨åªå
+åº¦ã®æ¤æ»
+	 */
+	if (p_tcb->priority != pri) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  ã¿ã¹ã¯ãå¾
+ã£ã¦ãããã¥ã¼ããã¯ã¹ã«é¢ããæ¤æ»
+	 */
+	if (TSTAT_WAIT_MTX(p_tcb->tstat)) {
+		p_mtxcb = ((WINFO_MTX *)(p_tcb->p_winfo))->p_mtxcb;
+		if (!VALID_MTXCB(p_mtxcb)) {
+			return(E_SYS_LINENO);
+		}
+		if (!in_queue(&(p_mtxcb->wait_queue), &(p_tcb->task_queue))) {
+			return(E_SYS_LINENO);
+		}
+	}
+	return(E_OK);
+}
+
+/*
+ *  ãã¥ã¼ããã¯ã¹æ¯ã®æ¤æ»
+ */
+static ER
+bit_mutex_mutex(ID mtxid)
+{
+	MTXCB			*p_mtxcb, *p_acquired_mtx;
+	const MTXINIB	*p_mtxinib;
+	TCB				*p_tcb;
+	QUEUE			*p_queue, *p_next;
+	uint_t			pri;
+
+	if (!VALID_MTXID(mtxid)) {
+		return(E_ID);
+	}
+	p_mtxcb = get_mtxcb(mtxid);
+	p_mtxinib = p_mtxcb->p_mtxinib;
+
+	/*
+	 *  åæåãã­ãã¯ã¸ã®ãã¤ã³ã¿ã®æ¤æ»
+	 */
+	if (p_mtxinib != &(mtxinib_table[INDEX_MTX(mtxid)])) {
+		return(E_SYS_LINENO);
+	}
+
+	/*
+	 *  ãã¥ã¼ããã¯ã¹å¾
+ã¡ã­ã¥ã¼ã®æ¤æ»
+	 */
+	p_queue = p_mtxcb->wait_queue.p_next;
+	if (p_queue->p_prev != &(p_mtxcb->wait_queue)) {
+		return(E_SYS_LINENO);
+	}
+	pri = TMIN_TPRI;
+	while (p_queue != &(p_mtxcb->wait_queue)) {
+		p_tcb = (TCB *) p_queue;
+		if (!VALID_TCB(p_tcb)) {
+			return(E_SYS_LINENO);
+		}
+
+		/*
+		 *  ã­ã¥ã¼ãã¿ã¹ã¯åªå
+åº¦é ã«ãªã£ã¦ãããã®æ¤æ»
+		 */
+		if (MTXPROTO(p_mtxinib) != TA_NULL) {
+			if (p_tcb->priority < pri) {
+				return(E_SYS_LINENO);
+			}
+		}
+		pri = p_tcb->priority;
+
+		/*
+		 *  ã¿ã¹ã¯ç¶æ
+ã®æ¤æ»
+		 *
+		 *  ãã¥ã¼ããã¯ã¹å¾
+ã¡ç¶æ
+ã®ã¿ã¹ã¯ã®æ¤æ»ã¯ï¼ã¿ã¹ã¯æ¯ã®æ¤æ»ã§è¡ã£
+		 *  ã¦ããããï¼ããã§ã¯è¡ããªãï¼
+		 */
+		if (!TSTAT_WAIT_MTX(p_tcb->tstat)) {
+			return(E_SYS_LINENO);
+		}
+
+		/*
+		 *  åªå
+åº¦ä¸éã®æ¤æ»
+		 */
+		if (MTX_CEILING(p_mtxinib)) {
+			if (p_tcb->bpriority < p_mtxinib->ceilpri) {
+				return(E_SYS_LINENO);
+			}
+		}
+
+		/*
+		 *  ã­ã¥ã¼ã®æ¬¡ã®è¦ç´ ã«é²ã
+		 */
+		p_next = p_queue->p_next;
+		if (p_next->p_prev != p_queue) {
+			return(E_SYS_LINENO);
+		}
+		p_queue = p_next;
+	}
+
+	/*
+	 *  ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã¿ã¹ã¯ã®æ¤æ»
+	 */
+	p_tcb = p_mtxcb->p_loctsk;
+	if (p_tcb == NULL) {
+		/*
+		 *  ãã¥ã¼ããã¯ã¹ãã­ãã¯ããã¦ããªãæ
+		 */
+		if (!queue_empty(&(p_mtxcb->wait_queue))) {
+			return(E_SYS_LINENO);
+		}
+	}
+	else {
+		/*
+		 *  ãã¥ã¼ããã¯ã¹ãã­ãã¯ããã¦ããæ
+		 *
+		 *  ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããã¿ã¹ã¯ã®æ¤æ»ã¯ï¼ã¿ã¹ã¯æ¯ã®æ¤
+		 *  æ»ã§è¡ã£ã¦ããããï¼ããã§ã¯è¡ããªãï¼
+		 */
+		if (!VALID_TCB(p_tcb)) {
+			return(E_SYS_LINENO);
+		}
+		p_acquired_mtx = p_tcb->p_lastmtx;
+		while (p_mtxcb != NULL) {
+			if (p_mtxcb == p_acquired_mtx) {
+				break;
+			}
+			p_acquired_mtx = p_acquired_mtx->p_prevmtx;
+		}
+		if (p_mtxcb == NULL) {
+			return(E_SYS_LINENO);
+		}
+
+		/*
+		 *  åªå
+åº¦ä¸éã®æ¤æ»
+		 */
+		if (MTX_CEILING(p_mtxinib)) {
+			if (p_tcb->bpriority < p_mtxinib->ceilpri) {
+				return(E_SYS_LINENO);
+			}
+		}
+	}
+	return(E_OK);
+}
+
+/*
+ *  æ´åæ§æ¤æ»ã«ã¼ãã³æ¬ä½
+ */
+ER
+bit_mutex(void)
+{
+	ID		tskid, mtxid;
+	ER		ercd;
+
+	/*
+	 *  ã¿ã¹ã¯æ¯ã®æ¤æ»
+	 */
+	for (tskid = TMIN_TSKID; tskid <= tmax_tskid; tskid++) {
+		ercd = bit_mutex_task(tskid);
+		if (ercd != E_OK) {
+			return(ercd);
+		}
+	}
+
+	/*
+	 *  ãã¥ã¼ããã¯ã¹æ¯ã®æ¤æ»
+	 */
+	for (mtxid = TMIN_MTXID; mtxid <= tmax_mtxid; mtxid++) {
+		ercd = bit_mutex_mutex(mtxid);
+		if (ercd != E_OK) {
+			return(ercd);
+		}
+	}
+	return(E_OK);
+}
Index: asp3_wo_tecs/trunk/test/hrt_systim1.c
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim1.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/hrt_systim1.c	(revision 302)
@@ -0,0 +1,1143 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: hrt_systim1.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  è¨­è¨æ¸ã®ãé«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ã®è¨­å®ããé«åè§£è½ã¿
+ *  ã¤ãå²è¾¼ã¿ã®å¦çããç¸å¯¾æéæå®ã«ããã¿ã¤ã ã¤ãã³ãã®ç»é²ãã®ç¯ã«
+ *  è¨è¿°å
+å®¹ããã¹ãããï¼
+ *
+ *  ä»¥ä¸ã®é¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
+ *		set_hrt_eventï¼é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ã®è¨­å®ï¼
+ *		tmevtb_enqueueï¼ç¸å¯¾æéæå®ã«ããã¿ã¤ã ã¤ãã³ãã®ç»é²ï¼
+ *		signal_timeï¼é«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®å¦çï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ãé«åè§£è½ã¿ã¤ãå²è¾¼ã¿ã®çºçã¿ã¤ãã³ã°ã®è¨­å®ãã®ç¯ã®è¨è¿°å
+å®¹ã®
+ *		ãã¹ãã¨set_hrt_eventã®å®è¡/åå²ãã¹ã®ç¶²ç¾
+
+ *	  (A-1) ã¿ã¤ã ã¤ãã³ããç»é²ããã¦ããªãæï¼»ASPD1007ï¼½
+ *	  (A-2) ã¿ã¤ã ã¤ãã³ããç»é²ããã¦ããï¼çºçæå»ãéãã¦ããæï¼»ASPD1017ï¼½
+ *	  (A-3) ã¿ã¤ã ã¤ãã³ããç»é²ããã¦ããï¼å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã®çºç
+ *			æå»ã¾ã§ã®é«åè§£ã¿ã¤ãã®ã«ã¦ã³ãã¢ããå¤ãHRTCNT_BOUNDä»¥ä¸
+ *			ã®æï¼»ASPD1002ï¼½
+ *	  (A-4) ã¿ã¤ã ã¤ãã³ããç»é²ããã¦ããï¼å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã®çºç
+ *			æå»ã¾ã§ã®é«åè§£ã¿ã¤ãã®ã«ã¦ã³ãã¢ããå¤ãHRTCNT_BOUNDãè¶
+
+ *			ããæï¼»ASPD1006ï¼½
+ *  (B) ãç¸å¯¾æéæå®ã«ããã¿ã¤ã ã¤ãã³ãã®ç»é²ãã®ç¯ã®è¨è¿°å
+å®¹ã®ãã¹
+ *		ãã¨tmevtb_enqueueã®å®è¡/åå²ãã¹ã®ç¶²ç¾
+
+ *	  (B-1) çºçæå»ãæ­£ããè¨­å®ããããã¨ï¼»ASPD1026ï¼½ï¼»ASPD1027ï¼½
+ *	  (B-2) ã¿ã¤ã ã¤ãã³ããã¼ãã«æ¿å
+¥ããããã¨ï¼»ASPD1030ï¼½
+ *	  (B-3) signal_timeã®ä¸­ã§å¼ã°ããæï¼»ASPD1034ï¼½
+ *	  (B-4) ç»é²ããã¿ã¤ã ã¤ãã³ããå
+é ­ã§ãªãæï¼»ASPD1031ï¼½
+ *	  (B-5) ç»é²ããã¿ã¤ã ã¤ãã³ããå
+é ­ã«ãªã£ãæï¼é«åè§£è½ã¿ã¤ããè¨­
+ *			å®ããï¼ï¼»ASPD1031ï¼½
+ *  (C) signal_timeã®å®è¡/åå²ãã¹ã®ç¶²ç¾
+
+ *	  (C-1) ã¿ã¤ã ã¤ãã³ããã¼ããç©ºã®ç¶æ
+ã§ï¼signal_timeãå¼ã³åºããã
+ *			å ´å
+ *	  (C-2) ã¿ã¤ã ã¤ãã³ããã¼ãã®å
+é ­ã®ã¤ãã³ãã®çºçæå»åã«ï¼
+ *			signal_timeãå¼ã³åºãããå ´å
+ *	  (C-3) signal_timeã§ï¼ã¿ã¤ã ã¤ãã³ããã¼ãã®å
+é ­ã®ã¤ãã³ãã®ã¿ãå¦
+ *			çããå ´å
+ *	  (C-4) signal_timeã§ï¼ã¿ã¤ã ã¤ãã³ããã¼ãã®å
+é ­ãã2ã¤ã®ã¤ãã³ã
+ *			ãï¼å
+å´ã®ã«ã¼ãã§å¦çããå ´å
+ *	  (C-5) signal_timeã§ï¼ã¿ã¤ã ã¤ãã³ããã¼ãã®å
+é ­ãã2ã¤ã®ã¤ãã³ã
+ *			ãï¼å¤å´ã®ã«ã¼ãã§å¦çããå ´å
+ *  (D) signal_timeããå¼ãã å¦çã§ç¾å¨æå»ãæ´æ°ãããå ´å
+ *	  (D-1) æ´æ°ãããç¾å¨æå»ãï¼æ¬¡ã®ã¿ã¤ã ã¤ãã³ããéãã¦ããï¼æ¬¡ã®
+ *			ã¿ã¤ã ã¤ãã³ããå
+å´ã®ã«ã¼ãã§å¦çããå ´å
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	é«åè§£è½ã¿ã¤ãã¢ã¸ã¥ã¼ã«ã®æ§è³ªï¼HRT_CONFIG1
+ *		TCYC_HRTCNT		æªå®ç¾©ï¼2^32ã®æå³ï¼
+ *		TSTEP_HRTCNT	1U
+ *		HRTCNT_BOUND	4000000002U
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *	ALM2:  ã¢ã©ã¼ã ãã³ãã©
+ *	ALM3:  ã¢ã©ã¼ã ãã³ãã©
+ *
+ * ãè£è¶³èª¬æã
+ *
+ *	ã¿ã¤ã ã¤ãã³ããç»é²ããã¦ããªãæã«é«åè§£è½ã¿ã¤ãã«è¨­å®ããç¸å¯¾ã¯ï¼
+ *	ããªããèª¿æ´æ©è½ãæããªãå ´åã¯HRTCNT_BOUNDã§ããã®ã«å¯¾ãã¦ï¼ããª
+ *	ããèª¿æ´æ©è½ãæã¤å ´åã¯TMAX_RELTIMãã¤ãã³ãæå»ã®ä¼¸ç¸®çã§å²ã£ãå¤
+ *	ã¨HRTCNT_BOUNDã®å°ããæ¹ã®å¤ï¼ãã®ãã¹ãã§ã¯ï¼ããªããéãè¨­å®ããï¼
+ *	HRTCNT_BOUNDï¼TMAX_RELTIMã§ããããï¼TMAX_RELTIMã«ä¸è´ï¼ã¨ãªãï¼ã
+ *	ãã§ï¼HRTCNT_EMPTYããã®å¤ã«å®ç¾©ãï¼ããªããèª¿æ´æ©è½ã®æç¡ã«ããã
+ *	åããã¹ãã·ã¼ã±ã³ã¹ãä½¿ããããã«ããï¼
+ *
+ *	ä»¥ä¸ã®ãã¹ãã·ã¼ã±ã³ã¹ã®ã³ã¡ã³ãä¸­ã§ï¼ãçºçï¼xxxãã¨ã¯ï¼é«åè§£è½ã¿
+ *	ã¤ãã®ã«ã¦ã³ãå¤ãxxxã«ãªã£ãæã«ã¿ã¤ã ã¤ãã³ããçºçãããã¨ãæå³
+ *	ããï¼ã¿ã¤ã ã¤ãã³ãã®ã¤ãã³ãçºçæå»ã§ã¯ãªãï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== START ==
+ *	// ã«ã¼ãã«èµ·åï¼é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã¨ã¤ãã³ãæå»ã¯10ããã
+ *	1:		[target_hrt_get_current -> 10U]
+ *	2:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	// ã¿ã¤ã ã¤ãã³ãã1ã¤ã ãç»é²
+ *	3:	sta_alm(ALM1, 100U)
+ *	4:		[target_hrt_get_current -> 20U]			// çºçï¼121
+ *	5:		[target_hrt_set_event <- 101U]			... (A-3)
+ *	6:	DO(target_raise_hrt_int(1U))
+ *		slp_tsk()
+ *	== HRT_HANDLER ==								... (C-3)
+ *	7:		[target_hrt_get_current -> 130U]		// ALM1ãçºç
+ *	== ALM1-1ï¼1åç®ï¼==
+ *	8:	wup_tsk(TASK1)
+ *		RETURN
+ *	// ã¿ã¤ã ã¤ãã³ãããªããªã£ãå ´å
+ *	9:		[target_hrt_get_current -> 140U]
+ *	10:		[target_hrt_set_event <- HRTCNT_EMPTY]	... (A-1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// 3ã¤ã®ã¿ã¤ã ã¤ãã³ããç»é²ï¼ãã®å
+ã®2ã¤ãå
+å´ã®ã«ã¼ãã§å¦ç
+ *	11:	sta_alm(ALM1, 100U)							... (B-5)
+ *	12:		[target_hrt_get_current -> 150U]		// çºçï¼251
+ *	13:		[target_hrt_set_event <- 101U]			... (B-1)(B-2)
+ *	14:	sta_alm(ALM2, 100U)							... (B-4)
+ *	15:		[target_hrt_get_current -> 160U]		// çºçï¼261
+ *	16:	sta_alm(ALM3, 110U)
+ *	17:		[target_hrt_get_current -> 170U]		// çºçï¼281
+ *	18:	DO(target_raise_hrt_int(1U))
+ *		slp_tsk()
+ *	== HRT_HANDLER ==								... (C-4)
+ *	19:		[target_hrt_get_current -> 261U]		// ALM1ã¨ALM2ãçºç
+ *	== ALM1-2ï¼2åç®ï¼==
+ *	20:	RETURN
+ *	== ALM2-1ï¼1åç®ï¼==							// é£ç¶ãã¦å¦ç
+ *	21:	DO(target_raise_hrt_int(1U))
+ *		RETURN
+ *	22:		[target_hrt_get_current -> 280U]
+ *	23:		[target_hrt_set_event <- 1U]			// ALM3ã¾ã§ã®æéã¯1
+ *	== HRT_HANDLER ==
+ *	24:		[target_hrt_get_current -> 290U]		// ALM3ãçºç
+ *	== ALM3-1ï¼1åç®ï¼==
+ *	25:	wup_tsk(TASK1)
+ *		RETURN
+ *	26:		[target_hrt_get_current -> 300U]
+ *	27:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// 2ã¤ã®ã¿ã¤ã ã¤ãã³ããç»é²ï¼ãã®2ã¤ãå¤å´ã®ã«ã¼ãã§å¦ç
+ *	28:	sta_alm(ALM1, 100U)
+ *	29:		[target_hrt_get_current -> 310U]		// çºçï¼411
+ *	30:		[target_hrt_set_event <- 101U]
+ *	31:	sta_alm(ALM2, 100U)
+ *	32:		[target_hrt_get_current -> 320U]		// çºçï¼421
+ *	33:	DO(target_raise_hrt_int(1U))
+ *		slp_tsk()
+ *	== HRT_HANDLER ==								... (C-5)
+ *	34:		[target_hrt_get_current -> 420U]		// ALM1ãçºç
+ *	== ALM1-3ï¼3åç®ï¼==
+ *	35:	RETURN
+ *	36:		[target_hrt_get_current -> 430U]		// ALM2ãçºç
+ *	== ALM2-2ï¼2åç®ï¼==
+ *	37:	wup_tsk(TASK1)
+ *		RETURN
+ *	38:		[target_hrt_get_current -> 440U]
+ *	39:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// 2ã¤ã®ã¿ã¤ã ã¤ãã³ããç»é²
+ *	40:	sta_alm(ALM1, 100U)
+ *	41:		[target_hrt_get_current -> 450U]		// çºçï¼551
+ *	42:		[target_hrt_set_event <- 101U]
+ *	43:	sta_alm(ALM2, 100U)
+ *	44:		[target_hrt_get_current -> 460U]		// çºçï¼561
+ *	45:	DO(target_raise_hrt_int(1U))
+ *		slp_tsk()
+ *	== HRT_HANDLER ==								... (D-1)
+ *	46:		[target_hrt_get_current -> 560U]		// ALM1ãçºç
+ *	== ALM1-4ï¼4åç®ï¼==
+ *	// ã¢ã©ã¼ã ãã³ãã©ä¸­ã§ããã«1ã¤ã®ã¿ã¤ã ã¤ãã³ããç»é²
+ *	47:	sta_alm(ALM3, 10U)							... (B-3)
+ *	48:		[target_hrt_get_current -> 570U]		// çºçï¼581ï¼ALM2ãçºç
+ *	49:	RETURN
+ *	== ALM2-3ï¼3åç®ï¼==
+ *	50:	RETURN
+ *	51:		[target_hrt_get_current -> 590U]		// ALM3ãçºç
+ *	== ALM3-2ï¼2åç®ï¼==
+ *	52:	wup_tsk(TASK1)
+ *		RETURN
+ *	53:		[target_hrt_get_current -> 600U]
+ *	54:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// 2ã¤ã®ã¿ã¤ã ã¤ãã³ããç»é²ï¼2ã¤ãã®æ¹ãçºçæå»ãæ©ãå ´å
+ *	55:	sta_alm(ALM1, 100U)							// çºçï¼711
+ *	56:		[target_hrt_get_current -> 610U]
+ *	57:		[target_hrt_set_event <- 101U]
+ *	58:	sta_alm(ALM2, 50U)							// çºçï¼671
+ *	59:		[target_hrt_get_current -> 620U]
+ *	60:		[target_hrt_set_event <- 51U]
+ *	61:	DO(target_raise_hrt_int(1U))
+ *		slp_tsk()
+ *	== HRT_HANDLER ==
+ *	62:		[target_hrt_get_current -> 680U]		// ALM2ãçºç
+ *	== ALM2-4ï¼4åç®ï¼==
+ *	63:	DO(target_raise_hrt_int(1U))
+ *		RETURN
+ *	64:		[target_hrt_get_current -> 690U]
+ *	65:		[target_hrt_set_event <- 21U]
+ *	== HRT_HANDLER ==
+ *	66:		[target_hrt_get_current -> 720U]		// ALM1ãçºç
+ *	== ALM1-5ï¼5åç®ï¼==
+ *	67:	wup_tsk(TASK1)
+ *	68:	RETURN
+ *	69:		[target_hrt_get_current -> 730U]
+ *	70:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// 2ã¤ã®ã¿ã¤ã ã¤ãã³ããç»é²ï¼2ã¤ãã®ã¿ã¤ã ã¤ãã³ãã®ç»é²æç¹ã§ï¼
+ *	// 1ã¤ãã®ã¿ã¤ã ã¤ãã³ãã®çºçæå»ãéãã¦ããå ´å
+ *	71:	sta_alm(ALM1, 10U)
+ *	72:		[target_hrt_get_current -> 740U]		// çºçï¼751
+ *	73:		[target_hrt_set_event <- 11U]
+ *	74:	sta_alm(ALM2, 100U)
+ *	75:		[target_hrt_get_current -> 760U]		// çºçï¼861ï¼ALM1ãçºç
+ *	76:	DO(target_raise_hrt_int(1U))
+ *		slp_tsk()
+ *	== HRT_HANDLER ==
+ *	77:		[target_hrt_get_current -> 770U]		// ALM1ãçºç
+ *	== ALM1-6ï¼6åç®ï¼==
+ *	78:	DO(target_raise_hrt_int(1U))
+ *		RETURN
+ *	79:		[target_hrt_get_current -> 780U]
+ *	80:		[target_hrt_set_event <- 81U]
+ *	== HRT_HANDLER ==								... (C-2)
+ *	81:		[target_hrt_get_current -> 810U]		// ã¹ããªã¢ã¹å²è¾¼ã¿
+ *	== target_hrt_set_event-N						// target_raise_hrt_intã
+ *	82:	assert(hrtcnt == 51U)						//	å¼ã¶ããã«ãã®å½¢ã§è¨è¿°
+ *		DO(target_raise_hrt_int(1U))
+ *		RETURN
+ *	== HRT_HANDLER ==
+ *	83:		[target_hrt_get_current -> 870U]		// ALM2ãçºç
+ *	== ALM2-5ï¼5åç®ï¼==
+ *	84:	wup_tsk(TASK1)
+ *		RETURN
+ *	85:		[target_hrt_get_current -> 880U]
+ *	86:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	87:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==								... (C-1)
+ *	88:		[target_hrt_get_current -> 890U]		// ã¹ããªã¢ã¹å²è¾¼ã¿
+ *	89:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// ã¿ã¤ã ã¤ãã³ããç»é²å¾ã«æéãé²ãï¼å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã®çºçæ
+ *	// å»ãéããç¶æ³ãä½ã
+ *	90:	sta_alm(ALM1, 100U)
+ *	91:		[target_hrt_get_current -> 900U]		// çºçï¼1001
+ *	92:		[target_hrt_set_event <- 101U]
+ *	93:	adj_tim(200)								// ALM1ã®çºçï¼801
+ *	94:		[target_hrt_get_current -> 910U]		// ALM1ãçºç
+ *	95:		[target_hrt_raise_event]				... (A-2)
+ *	96:	DO(target_raise_hrt_int(1U))
+ *		slp_tsk()
+ *	== HRT_HANDLER ==
+ *	97:		[target_hrt_get_current -> 920U]
+ *	== ALM1-7ï¼7åç®ï¼==
+ *	98:	wup_tsk(TASK1)
+ *		RETURN
+ *	99:		[target_hrt_get_current -> 930U]
+ *	100:	[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// ã¿ã¤ã ã¤ãã³ããç»é²å¾ã«æéãæ»ãï¼å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã®çºçæ
+ *	// å»ã¾ã§ã®é«åè§£ã¿ã¤ãã®ã«ã¦ã³ãã¢ããå¤ãHRTCNT_BOUNDãè¶
+ããç¶æ³
+ *	// ãä½ã
+ *	101:sta_alm(ALM1, TMAX_RELTIM)
+ *	102:	[target_hrt_get_current -> 940U]		// çºçï¼4,000,000,941
+ *	103:	[target_hrt_set_event <- 4000000001U]
+ *	104:adj_tim(-200)								// çºçï¼4,000,001,141
+ *	105:	[target_hrt_get_current -> 950U]
+ *	106:	[target_hrt_set_event <- HRTCNT_BOUND]	... (A-4)
+ *	// å¾å§æ«
+ *	107:stp_alm(ALM1)
+ *	108:	[target_hrt_get_current -> 960U]
+ *	109:	[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	110:END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "hrt_systim1.h"
+#include "target_timer.h"
+
+#if !defined(HRT_CONFIG1) || defined(HRT_CONFIG2)
+#error Compiler option "-DHRT_CONFIG1" is missing.
+#endif
+
+#ifdef TOPPERS_SUPPORT_DRIFT
+#define HRTCNT_EMPTY	TMAX_RELTIM
+#else /* TOPPERS_SUPPORT_DRIFT */
+#define HRTCNT_EMPTY	HRTCNT_BOUND
+#endif /* TOPPERS_SUPPORT_DRIFT */
+
+#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
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+static uint_t	alarm1_count = 0;
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++alarm1_count) {
+	case 1:
+		check_point(8);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(20);
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(35);
+		return;
+
+		check_point(0);
+
+	case 4:
+		check_point(47);
+		ercd = sta_alm(ALM3, 10U);
+		check_ercd(ercd, E_OK);
+
+		check_point(49);
+		return;
+
+		check_point(0);
+
+	case 5:
+		check_point(67);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(68);
+		return;
+
+		check_point(0);
+
+	case 6:
+		check_point(78);
+		target_raise_hrt_int(1U);
+
+		return;
+
+		check_point(0);
+
+	case 7:
+		check_point(98);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	alarm2_count = 0;
+
+void
+alarm2_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++alarm2_count) {
+	case 1:
+		check_point(21);
+		target_raise_hrt_int(1U);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(37);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(50);
+		return;
+
+		check_point(0);
+
+	case 4:
+		check_point(63);
+		target_raise_hrt_int(1U);
+
+		return;
+
+		check_point(0);
+
+	case 5:
+		check_point(84);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	alarm3_count = 0;
+
+void
+alarm3_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++alarm3_count) {
+	case 1:
+		check_point(25);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(52);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(3);
+	ercd = sta_alm(ALM1, 100U);
+	check_ercd(ercd, E_OK);
+
+	check_point(6);
+	target_raise_hrt_int(1U);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	ercd = sta_alm(ALM1, 100U);
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = sta_alm(ALM2, 100U);
+	check_ercd(ercd, E_OK);
+
+	check_point(16);
+	ercd = sta_alm(ALM3, 110U);
+	check_ercd(ercd, E_OK);
+
+	check_point(18);
+	target_raise_hrt_int(1U);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(28);
+	ercd = sta_alm(ALM1, 100U);
+	check_ercd(ercd, E_OK);
+
+	check_point(31);
+	ercd = sta_alm(ALM2, 100U);
+	check_ercd(ercd, E_OK);
+
+	check_point(33);
+	target_raise_hrt_int(1U);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(40);
+	ercd = sta_alm(ALM1, 100U);
+	check_ercd(ercd, E_OK);
+
+	check_point(43);
+	ercd = sta_alm(ALM2, 100U);
+	check_ercd(ercd, E_OK);
+
+	check_point(45);
+	target_raise_hrt_int(1U);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(55);
+	ercd = sta_alm(ALM1, 100U);
+	check_ercd(ercd, E_OK);
+
+	check_point(58);
+	ercd = sta_alm(ALM2, 50U);
+	check_ercd(ercd, E_OK);
+
+	check_point(61);
+	target_raise_hrt_int(1U);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(71);
+	ercd = sta_alm(ALM1, 10U);
+	check_ercd(ercd, E_OK);
+
+	check_point(74);
+	ercd = sta_alm(ALM2, 100U);
+	check_ercd(ercd, E_OK);
+
+	check_point(76);
+	target_raise_hrt_int(1U);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(87);
+	target_raise_hrt_int(0U);
+
+	check_point(90);
+	ercd = sta_alm(ALM1, 100U);
+	check_ercd(ercd, E_OK);
+
+	check_point(93);
+	ercd = adj_tim(200);
+	check_ercd(ercd, E_OK);
+
+	check_point(96);
+	target_raise_hrt_int(1U);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(101);
+	ercd = sta_alm(ALM1, TMAX_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	check_point(104);
+	ercd = adj_tim(-200);
+	check_ercd(ercd, E_OK);
+
+	check_point(107);
+	ercd = stp_alm(ALM1);
+	check_ercd(ercd, E_OK);
+
+	check_finish(110);
+	check_point(0);
+}
+
+static uint_t	target_hrt_get_current_count = 0;
+
+HRTCNT
+target_hrt_get_current(void)
+{
+
+	switch (++target_hrt_get_current_count) {
+	case 1:
+		test_start(__FILE__);
+
+		check_point(1);
+		return(10U);
+
+		check_point(0);
+
+	case 2:
+		check_point(4);
+		return(20U);
+
+		check_point(0);
+
+	case 3:
+		check_point(7);
+		return(130U);
+
+		check_point(0);
+
+	case 4:
+		check_point(9);
+		return(140U);
+
+		check_point(0);
+
+	case 5:
+		check_point(12);
+		return(150U);
+
+		check_point(0);
+
+	case 6:
+		check_point(15);
+		return(160U);
+
+		check_point(0);
+
+	case 7:
+		check_point(17);
+		return(170U);
+
+		check_point(0);
+
+	case 8:
+		check_point(19);
+		return(261U);
+
+		check_point(0);
+
+	case 9:
+		check_point(22);
+		return(280U);
+
+		check_point(0);
+
+	case 10:
+		check_point(24);
+		return(290U);
+
+		check_point(0);
+
+	case 11:
+		check_point(26);
+		return(300U);
+
+		check_point(0);
+
+	case 12:
+		check_point(29);
+		return(310U);
+
+		check_point(0);
+
+	case 13:
+		check_point(32);
+		return(320U);
+
+		check_point(0);
+
+	case 14:
+		check_point(34);
+		return(420U);
+
+		check_point(0);
+
+	case 15:
+		check_point(36);
+		return(430U);
+
+		check_point(0);
+
+	case 16:
+		check_point(38);
+		return(440U);
+
+		check_point(0);
+
+	case 17:
+		check_point(41);
+		return(450U);
+
+		check_point(0);
+
+	case 18:
+		check_point(44);
+		return(460U);
+
+		check_point(0);
+
+	case 19:
+		check_point(46);
+		return(560U);
+
+		check_point(0);
+
+	case 20:
+		check_point(48);
+		return(570U);
+
+		check_point(0);
+
+	case 21:
+		check_point(51);
+		return(590U);
+
+		check_point(0);
+
+	case 22:
+		check_point(53);
+		return(600U);
+
+		check_point(0);
+
+	case 23:
+		check_point(56);
+		return(610U);
+
+		check_point(0);
+
+	case 24:
+		check_point(59);
+		return(620U);
+
+		check_point(0);
+
+	case 25:
+		check_point(62);
+		return(680U);
+
+		check_point(0);
+
+	case 26:
+		check_point(64);
+		return(690U);
+
+		check_point(0);
+
+	case 27:
+		check_point(66);
+		return(720U);
+
+		check_point(0);
+
+	case 28:
+		check_point(69);
+		return(730U);
+
+		check_point(0);
+
+	case 29:
+		check_point(72);
+		return(740U);
+
+		check_point(0);
+
+	case 30:
+		check_point(75);
+		return(760U);
+
+		check_point(0);
+
+	case 31:
+		check_point(77);
+		return(770U);
+
+		check_point(0);
+
+	case 32:
+		check_point(79);
+		return(780U);
+
+		check_point(0);
+
+	case 33:
+		check_point(81);
+		return(810U);
+
+		check_point(0);
+
+	case 34:
+		check_point(83);
+		return(870U);
+
+		check_point(0);
+
+	case 35:
+		check_point(85);
+		return(880U);
+
+		check_point(0);
+
+	case 36:
+		check_point(88);
+		return(890U);
+
+		check_point(0);
+
+	case 37:
+		check_point(91);
+		return(900U);
+
+		check_point(0);
+
+	case 38:
+		check_point(94);
+		return(910U);
+
+		check_point(0);
+
+	case 39:
+		check_point(97);
+		return(920U);
+
+		check_point(0);
+
+	case 40:
+		check_point(99);
+		return(930U);
+
+		check_point(0);
+
+	case 41:
+		check_point(102);
+		return(940U);
+
+		check_point(0);
+
+	case 42:
+		check_point(105);
+		return(950U);
+
+		check_point(0);
+
+	case 43:
+		check_point(108);
+		return(960U);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+	return(0U);
+}
+
+static uint_t	target_hrt_raise_event_count = 0;
+
+void
+target_hrt_raise_event(void)
+{
+
+	switch (++target_hrt_raise_event_count) {
+	case 1:
+		check_point(95);
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	target_hrt_set_event_count = 0;
+
+void
+target_hrt_set_event(HRTCNT hrtcnt)
+{
+
+	switch (++target_hrt_set_event_count) {
+	case 1:
+		check_point(2);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(5);
+		check_assert(hrtcnt == 101U);
+
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(10);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 4:
+		check_point(13);
+		check_assert(hrtcnt == 101U);
+
+		return;
+
+		check_point(0);
+
+	case 5:
+		check_point(23);
+		check_assert(hrtcnt == 1U);
+
+		return;
+
+		check_point(0);
+
+	case 6:
+		check_point(27);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 7:
+		check_point(30);
+		check_assert(hrtcnt == 101U);
+
+		return;
+
+		check_point(0);
+
+	case 8:
+		check_point(39);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 9:
+		check_point(42);
+		check_assert(hrtcnt == 101U);
+
+		return;
+
+		check_point(0);
+
+	case 10:
+		check_point(54);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 11:
+		check_point(57);
+		check_assert(hrtcnt == 101U);
+
+		return;
+
+		check_point(0);
+
+	case 12:
+		check_point(60);
+		check_assert(hrtcnt == 51U);
+
+		return;
+
+		check_point(0);
+
+	case 13:
+		check_point(65);
+		check_assert(hrtcnt == 21U);
+
+		return;
+
+		check_point(0);
+
+	case 14:
+		check_point(70);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 15:
+		check_point(73);
+		check_assert(hrtcnt == 11U);
+
+		return;
+
+		check_point(0);
+
+	case 16:
+		check_point(80);
+		check_assert(hrtcnt == 81U);
+
+		return;
+
+		check_point(0);
+
+	case 17:
+		check_point(82);
+		check_assert(hrtcnt == 51U);
+
+		target_raise_hrt_int(1U);
+
+		return;
+
+		check_point(0);
+
+	case 18:
+		check_point(86);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 19:
+		check_point(89);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 20:
+		check_point(92);
+		check_assert(hrtcnt == 101U);
+
+		return;
+
+		check_point(0);
+
+	case 21:
+		check_point(100);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 22:
+		check_point(103);
+		check_assert(hrtcnt == 4000000001U);
+
+		return;
+
+		check_point(0);
+
+	case 23:
+		check_point(106);
+		check_assert(hrtcnt == HRTCNT_BOUND);
+
+		return;
+
+		check_point(0);
+
+	case 24:
+		check_point(109);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/hrt_systim1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/hrt_systim1.cfg	(revision 302)
@@ -0,0 +1,17 @@
+/*
+ *		ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³
+ *		ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "hrt_systim1.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
+CRE_ALM(ALM2, { TA_NULL, { TNFY_HANDLER, 1, alarm2_handler }});
+CRE_ALM(ALM3, { TA_NULL, { TNFY_HANDLER, 1, alarm3_handler }});
Index: asp3_wo_tecs/trunk/test/hrt_systim1.h
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim1.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/hrt_systim1.h	(revision 302)
@@ -0,0 +1,94 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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: hrt_systim1.h 286 2014-11-29 07:51: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	alarm1_handler(intptr_t exinf);
+extern void	alarm2_handler(intptr_t exinf);
+extern void	alarm3_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/hrt_systim2.c
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim2.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/hrt_systim2.c	(revision 302)
@@ -0,0 +1,1211 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: hrt_systim2.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(2)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *	ã·ã¹ãã æå»ç®¡çæ©è½ã®æ¨æºã®ãµã¼ãã¹ã³ã¼ã«ï¼set_timï¼get_timï¼
+ *	adj_timï¼ãï¼è¦æ±ãã¼ã¹ã§ãã¹ãããï¼
+ *
+ *	ãã¹ãå¯¾è±¡ã®ãµã¼ãã¹ã³ã¼ã«å¦çé¢æ°ããã³ããããå¼ã³åºãããä»¥ä¸ã®
+ *	é¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
+ *		set_tim â¦ é¢æ°å
+ã«åå²ããªã
+ *		get_tim â¦ é¢æ°å
+ã«åå²ããªã
+ *		adj_tim
+ *		check_adjtim
+ *		update_current_evttimï¼TCYC_HRTCNTãå®ç¾©ããã¦ããªãå ´åï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *  (A) set_timã®è¦æ±ãã¼ã¹ãã¹ã
+ *	  (A-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãï¼»NGKI3564ï¼½
+ *	  (A-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºãï¼»NGKI3565ï¼½
+ *	  (A-3) ã·ã¹ãã æå»ã®ç¾å¨å¤ãæ­£ããè¨­å®ããããã¨ï¼»NGKI3567ï¼½
+ *  (B) get_timã®è¦æ±ãã¼ã¹ãã¹ã
+ *	  (B-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãï¼»NGKI2350ï¼½
+ *	  (B-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºãï¼»NGKI2351ï¼½
+ *	  (B-3) ã·ã¹ãã æå»ã®ç¾å¨å¤ãæ­£ããåç
+§ããããã¨ï¼»NGKI2354ï¼½
+ *	  (B-4) adj_timã«ãã£ã¦ã·ã¹ãã æå»ãæ»ããå ´åï¼ã·ã¹ãã æå»ãæã
+ *			é²ãã§ããæã®ã·ã¹ãã æå»ãè¿ããã¨ï¼»NGKI3591ï¼½
+ *	  (B-5) åç
+§ããã·ã¹ãã æå»ã®é²ã¿ãæ­¢ã¾ã£ã¦ããéã«ï¼set_timã«ã
+ *			ãã·ã¹ãã æå»ãè¨­å®ããå ´åã§ãï¼åç
+§ããã·ã¹ãã æå»ã®é²
+ *			ã¿ãæ­¢ã¾ã£ã¦ããæéã¯å¤åããªããã¨ï¼»NGKI3592ï¼½
+ *  (C) adj_timã®è¦æ±ãã¼ã¹ãã¹ã
+ *	  (C-1) CPUã­ãã¯ç¶æ
+ããã®å¼åºãï¼»NGKI3583ï¼½
+ *	  (C-2) adjtimãå°ããããï¼»NGKI3584ï¼½
+ *	  (C-3) adjtimãå¤§ããããï¼»NGKI3584ï¼½
+ *	  (C-4) ã·ã¹ãã æå»ã«adjtimãå ãããããã¨ï¼»NGKI3586ï¼½
+ *	  (C-5) ã·ã¹ãã æå»ã®çµéããã£ããã«çºçããã¿ã¤ã ã¤ãã³ããçºç
+ *			ããã¾ã§ã®ç¸å¯¾æéãèª¿æ´ããããã¨ï¼»NGKI3587ï¼½
+ *	  (C-6) (adj_tim > 0)ã§ï¼1ç§ä»¥ä¸éå»ã®çºçæå»ãæã¤ã¿ã¤ã ã¤ãã³ã
+ *			ãæ®ã£ã¦ããå ´åã«ï¼E_OBJã¨ã©ã¼ã¨ãªããã¨ï¼»NGKI3588ï¼½
+ *	  (C-7) (adj_tim < 0)ã§ï¼ç¾å¨ã®ã·ã¹ãã æå»ãï¼ã·ã¹ãã æå»ãæãé²
+ *			ãã§ããæã®ã·ã¹ãã æå»ãã1ç§ä»¥ä¸æ»ã£ã¦ããå ´åã«ï¼E_OBJ
+ *			ã¨ã©ã¼ã¨ãªããã¨ï¼»NGKI3589ï¼½
+ *	  (C-8) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãã§ï¼ã·ã¹ãã æå»ã«adjtimã
+ *			å ãããããã¨
+ *  (D) adj_timã®å®è¡/åå²ãã¹ã®ç¶²ç¾
+
+ *	  (D-1) (adjtim <= 0)ã®å ´å
+ *	  (D-2) (adjtim > 0)ã§ï¼æãé²ãã§ããæã®ã¤ãã³ãæå»ã®æ´æ°ãå¿
+è¦
+ *			ãªãå ´å
+ *	  (D-3) (adjtim > 0)ã§ï¼æãé²ãã§ããæã®ã¤ãã³ãæå»ã®æ´æ°ãå¿
+è¦
+ *			ã§ï¼ã·ã¹ãã æå»ã®ãªãã»ãããé²ããå¿
+è¦ããªãå ´å
+ *	  (D-4) (adjtim > 0)ã§ï¼æãé²ãã§ããæã®ã¤ãã³ãæå»ã®æ´æ°ãå¿
+è¦
+ *			ã§ï¼ã·ã¹ãã æå»ã®ãªãã»ãããé²ããå¿
+è¦ãããå ´å
+ *  (E) check_adjtimã®å®è¡/åå²ãã¹/æ»ãå¤ã®ç¶²ç¾
+
+ *	  (E-1) (adjtim > 0)ã§ï¼ã¿ã¤ã ã¤ãã³ããç»é²ããã¦ããªãå ´å
+ *	  (E-2) (adjtim > 0)ã§ï¼å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã®çºçæå»ã1ç§åä»¥éã§
+ *			ããå ´å
+ *	  (E-3) (adjtim > 0)ã§ï¼å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã®çºçæå»ã1ç§åä»¥åã§
+ *			ããå ´åï¼adj_timãE_OBJã¨ã©ã¼ã¨ãªãï¼
+ *	  (E-4) (adjtim < 0)ã§ï¼ç¾å¨ã®ã·ã¹ãã æå»ãï¼ã·ã¹ãã æå»ãæãé²
+ *			ãã§ããæã®ã·ã¹ãã æå»ãã1ç§ä»¥ä¸æ»ã£ã¦ããªãå ´å
+ *	  (E-5) (adjtim < 0)ã§ï¼ç¾å¨ã®ã·ã¹ãã æå»ãï¼ã·ã¹ãã æå»ãæãé²
+ *			ãã§ããæã®ã·ã¹ãã æå»ãã1ç§ä»¥ä¸æ»ã£ã¦ããå ´åï¼adj_tim
+ *			ãE_OBJã¨ã©ã¼ã¨ãªãï¼
+ *	  (E-6) (adjtim == 0)ã®å ´å
+ *  (F) update_current_evttimã®å®è¡/åå²ãã¹ã®ç¶²ç¾
+
+ *	  (F-1) æãé²ãã§ããæã®ã¤ãã³ãæå»ã®æ´æ°ãå¿
+è¦ãªãå ´å
+ *	  (F-2) æãé²ãã§ããæã®ã¤ãã³ãæå»ã®æ´æ°ãå¿
+è¦ã§ï¼ã·ã¹ãã æå»
+ *			ã®ãªãã»ãããé²ããå¿
+è¦ããªãå ´å
+ *	  (F-3) æãé²ãã§ããæã®ã¤ãã³ãæå»ã®æ´æ°ãå¿
+è¦ã§ï¼ã·ã¹ãã æå»
+ *			ã®ãªãã»ãããé²ããå¿
+è¦ãããå ´å
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	é«åè§£è½ã¿ã¤ãã¢ã¸ã¥ã¼ã«ã®æ§è³ªï¼HRT_CONFIG1
+ *		TCYC_HRTCNT		æªå®ç¾©ï¼2^32ã®æå³ï¼
+ *		TSTEP_HRTCNT	1U
+ *		HRTCNT_BOUND	4000000002U
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *	ALM2:  ã¢ã©ã¼ã ãã³ãã©
+ *	ALM3:  ã¢ã©ã¼ã ãã³ãã©
+ *
+ * ãè£è¶³èª¬æã
+ *
+ *	ã¿ã¤ã ã¤ãã³ããç»é²ããã¦ããªãæã«é«åè§£è½ã¿ã¤ãã«è¨­å®ããç¸å¯¾ã¯ï¼
+ *	ããªããèª¿æ´æ©è½ãæããªãå ´åã¯HRTCNT_BOUNDã§ããã®ã«å¯¾ãã¦ï¼ããª
+ *	ããèª¿æ´æ©è½ãæã¤å ´åã¯TMAX_RELTIMãã¤ãã³ãæå»ã®ä¼¸ç¸®çã§å²ã£ãå¤
+ *	ã¨HRTCNT_BOUNDã®å°ããæ¹ã®å¤ï¼ãã®ãã¹ãã§ã¯ï¼ããªããéãè¨­å®ããï¼
+ *	HRTCNT_BOUNDï¼TMAX_RELTIMã§ããããï¼TMAX_RELTIMã«ä¸è´ï¼ã¨ãªãï¼ã
+ *	ãã§ï¼HRTCNT_EMPTYããã®å¤ã«å®ç¾©ãï¼ããªããèª¿æ´æ©è½ã®æç¡ã«ããã
+ *	åããã¹ãã·ã¼ã±ã³ã¹ãä½¿ããããã«ããï¼
+ *
+ *	ä»¥ä¸ã®ãã¹ãã·ã¼ã±ã³ã¹ã®ã³ã¡ã³ãä¸­ã§ï¼ãçºçï¼xxxãã¨ã¯ï¼é«åè§£è½ã¿
+ *	ã¤ãã®ã«ã¦ã³ãå¤ãxxxã«ãªã£ãæã«ã¿ã¤ã ã¤ãã³ããçºçãããã¨ãæå³
+ *	ããï¼ã¿ã¤ã ã¤ãã³ãã®ã¤ãã³ãçºçæå»ã§ã¯ãªãï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== START ==
+ *	// ã«ã¼ãã«èµ·åï¼é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã¨ã¤ãã³ãæå»ã¯10ããã
+ *	1:		[target_hrt_get_current -> 10U]
+ *	2:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	// CPUã­ãã¯ç¶æ
+ã§åãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºã
+ *	3:	loc_cpu()
+ *		set_tim(1000000LLU) -> E_CTX				... (A-2)
+ *		get_tim(&systim) -> E_CTX					... (B-2)
+ *		adj_tim(100) -> E_CTX						... (C-1)
+ *		unl_cpu()
+ *	// ã¾ãã¯get_timã®ä¸è¬çãªåä½ãç¢ºèª
+ *	4:	get_tim(&systim)							... (B-3)
+ *	5:		[target_hrt_get_current -> 40U]
+ *	6:	assert(systim == 40U - 10U)
+ *	// ã·ã¹ãã æå»ã32ããããè¶
+ããå¤ã«è¨­å®
+ *		set_tim(2LLU << 32)							... (A-3)
+ *	7:		[target_hrt_get_current -> 50U]			... (F-2)
+ *	// ã·ã¹ãã æå»ãæå¾
+éãã«è¨­å®ããã¦ãããã¨ãç¢ºèª
+ *	8:	get_tim(&systim)							... (B-3)
+ *	9:		[target_hrt_get_current -> 60U]
+ *	10:	assert(systim == (2LLU << 32) + 10U)
+ *	11:	DO(target_raise_hrt_int(1U))
+ *		tslp_tsk(TMAX_RELTIM) -> E_TMOUT
+ *	12:		[target_hrt_get_current -> 70U]			// TMOUTã®çºçï¼4000000071U
+ *	13:		[target_hrt_set_event <- 4000000001U]
+ *	// ããã§é·æéçµéãããã¨ãæ³å®
+ *	== HRT_HANDLER ==
+ *	14:		[target_hrt_get_current -> 4000000080U]	// TMOUTãçºç
+ *	// ããã§ã¿ã¤ã ã¢ã¦ãå¦çãè¡ããã
+ *	15:		[target_hrt_get_current -> 4000000090U]
+ *	16:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	17:	get_tim(&systim)							... (B-3)
+ *	18:		[target_hrt_get_current -> 4000000100U]
+ *	19:	assert(systim == (2LLU << 32) + 4000000050U)
+ *	// ããã§æéãçµéãã¦ï¼HRTãå·¡åãããã¨ãæ³å®
+ *	20:	get_tim(&systim)							... (B-3)
+ *	21:		[target_hrt_get_current -> 100U]		... (F-3)
+ *	22:	assert(systim == (3LLU << 32) + 50U)
+ *	// adj_timã®ãã©ã¡ã¼ã¿ã¨ã©ã¼ã®ãã¹ã
+ *		adj_tim(-1000001) -> E_PAR					... (C-2)
+ *		adj_tim(+1000001) -> E_PAR					... (C-3)
+ *
+ *	// adj_timã§ã·ã¹ãã æå»ãé²ãããã¹ã
+ *	// ã¿ã¤ã ã¤ãã³ãã1ã¤ç»é²
+ *		sta_alm(ALM1, 2000000U)
+ *	23:		[target_hrt_get_current -> 120U]		// ALM1ã®çºçï¼2,000,121
+ *	24:		[target_hrt_set_event <- 2000001U]
+ *	25:	get_tim(&systim)
+ *	26:		[target_hrt_get_current -> 130U]
+ *	27:	assert(systim == (3LLU << 32) + 80U)
+ *	// adj_timã§ã·ã¹ãã æå»ãé²ãã
+ *		adj_tim(+1000000)							... (C-4)(D-3)(E-2)
+ *	28:		[target_hrt_get_current -> 140U]		// ALM1ã®çºçï¼1,000,121
+ *	29:		[target_hrt_set_event <- 999981U]		... (C-5)
+ *	30:	get_tim(&systim)
+ *	31:		[target_hrt_get_current -> 150U]
+ *	32:	assert(systim == (3LLU << 32) + 1000000U + 100U)
+ *	// ã¿ã¤ã ã¤ãã³ãçºçã¾ã§ã®æéããã§ãã¯
+ *		ref_alm(ALM1, &ralm)
+ *	33:		[target_hrt_get_current -> 160U]
+ *	34:	assert(ralm.lefttim == 999960U)
+ *	// ããã§é·æéçµéãããã¨ãæ³å®
+ *		DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	35:		[target_hrt_get_current -> 1000130U]	// ALM1ãçºç
+ *	== ALM1-1ï¼1åç®ï¼==
+ *	// éã¿ã¹ã¯ã³ã³ãã­ã¹ãããåãµã¼ãã¹ã³ã¼ã«ãå¼ã³åºã
+ *	36:	set_tim(1LLU << 32) -> E_CTX				... (A-1)
+ *		get_tim(&systim) -> E_CTX					... (B-1)
+ *		RETURN
+ *	37:		[target_hrt_get_current -> 1000140U]
+ *	38:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼ç¶ãï¼==
+ *
+ *	// adj_timã§ã·ã¹ãã æå»ãæ»ããã¹ã
+ *	// ã¿ã¤ã ã¤ãã³ãã1ã¤ç»é²
+ *	39:	sta_alm(ALM1, 2000000U)
+ *	40:		[target_hrt_get_current -> 1000150U]	// ALM1ã®çºçï¼3,000,151
+ *	41:		[target_hrt_set_event <- 2000001U]
+ *	// ã·ã¹ãã æå»ãç¢ºèªãã¦ãã
+ *	42:	get_tim(&systim)
+ *	43:		[target_hrt_get_current -> 1000160U]
+ *	44:	assert(systim == (3LLU << 32) + 1000000U + 1000110U)
+ *	// adj_timã§ã·ã¹ãã æå»ãæ»ã
+ *		adj_tim(-1000000)							... (C-4)(D-1)(E-4)
+ *	45:		[target_hrt_get_current -> 1000170U]	// ALM1ã®çºçï¼4,000,151
+ *	46:		[target_hrt_set_event <- 2999981U]		... (C-5)
+ *	// ã·ã¹ãã æå»ãæ»ã£ã¦ããªããã¨ããã§ãã¯
+ *	// adj_timãå¼ã³åºããæç¹ã®ã·ã¹ãã æå»ã«ãªã£ã¦ããã¯ã
+ *	47:	get_tim(&systim)							... (B-4)
+ *	48:		[target_hrt_get_current -> 1000180U]
+ *	49:	assert(systim == (3LLU << 32) + 1000000U + 1000120U)
+ *	// ã¿ã¤ã ã¤ãã³ãçºçã¾ã§ã®æéããã§ãã¯
+ *		ref_alm(ALM1, &ralm)
+ *	50:		[target_hrt_get_current -> 1000190U]
+ *		assert(ralm.lefttim == 2999960U)
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	// ã·ã¹ãã æå»ãé²ãã§ããªããã¨ããã§ãã¯
+ *		get_tim(&systim)							... (B-4)
+ *	51:		[target_hrt_get_current -> 1500200U]	... (F-1)
+ *	52:	assert(systim == (3LLU << 32) + 1000000U + 1000120U)
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	// ã·ã¹ãã æå»ãé²ãã§ãããã¨ããã§ãã¯
+ *		get_tim(&systim)							... (B-4)
+ *	53:		[target_hrt_get_current -> 2000210U]
+ *	54:	assert(systim == (3LLU << 32) + 2000160U)
+ *	// adj_timã§ã·ã¹ãã æå»ãæ»ã
+ *		adj_tim(-1000000)							... (C-4)(D-1)(E-4)
+ *	55:		[target_hrt_get_current -> 2000220U]	// ALM1ã®çºçï¼5,000,151
+ *	56:		[target_hrt_set_event <- 2999931U]		... (C-5)
+ *	// ã·ã¹ãã æå»ãæ»ã£ã¦ããªããã¨ããã§ãã¯
+ *	// adj_timãå¼ã³åºããæç¹ã®ã·ã¹ãã æå»ã«ãªã£ã¦ããã¯ã
+ *		get_tim(&systim)							... (B-4)
+ *	57:		[target_hrt_get_current -> 2000230U]
+ *	58:	assert(systim == (3LLU << 32) + 2000170U)
+ *	// ããã§ã·ã¹ãã æå»ãè¨­å®
+ *	// ãã®æç¹ã§ï¼get_timã§åç
+§ããã·ã¹ãã æå»ã¯20æ­¢ã¾ã£ã¦ãã
+ *	// ããä»¥éï¼ããã«999980ã®éï¼ã·ã¹ãã æå»ã¯æ­¢ã¾ã£ã¦ããã¯ã
+ *		set_tim(4LLU << 32)
+ *	59:		[target_hrt_get_current -> 2000240U]
+ *	// ã·ã¹ãã æå»ãé²ãã§ããªããã¨ããã§ãã¯
+ *		get_tim(&systim)							... (B-5)
+ *	60:		[target_hrt_get_current -> 2000250U]
+ *	61:	assert(systim == (4LLU << 32))
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	// ã·ã¹ãã æå»ãé²ãã§ããªããã¨ããã§ãã¯
+ *		get_tim(&systim)							... (B-5)
+ *	62:		[target_hrt_get_current -> 2500250U]
+ *	63:	assert(systim == (4LLU << 32))
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	// ã·ã¹ãã æå»ãé²ãã§ãããã¨ããã§ãã¯
+ *		get_tim(&systim)							... (B-5)
+ *	64:		[target_hrt_get_current -> 3000260U]
+ *	65:	assert(systim == (4LLU << 32) - 999980U + 1000020U)
+ *
+ *	// adj_timã§ç¹°ãè¿ãã·ã¹ãã æå»ãé²ãããã¹ã
+ *	// ã¿ã¤ã ã¤ãã³ãã2ã¤ç»é²
+ *		sta_alm(ALM1, 1000U)
+ *	66:		[target_hrt_get_current -> 3000270U]	// ALM1ã®åæ­¢
+ *	67:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	68:		[target_hrt_get_current -> 3000270U]	// ALM1ã®çºçï¼3,001,271
+ *	69:		[target_hrt_set_event <- 1001U]
+ *	70:	sta_alm(ALM2, 1000U)
+ *	71:		[target_hrt_get_current -> 3000280U]	// ALM2ã®çºçï¼3,001,281
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	72:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	73:		[target_hrt_get_current -> 3001280U]	// ALM1ãçºç
+ *	== ALM1-2ï¼2åç®ï¼==
+ *	74:	adj_tim(+1000000)							... (C-8)(D-3)(E-2)
+ *	75:		[target_hrt_get_current -> 3001290U]	// ALM2ã®çºçï¼2,001,281
+ *	76:	adj_tim(+1000000) -> E_OBJ					... (C-6)(E-3)
+ *	77:		[target_hrt_get_current -> 3001300U]
+ *	78:	RETURN
+ *	== ALM2-1ï¼1åç®ï¼==
+ *	79:	RETURN
+ *	80:		[target_hrt_get_current -> 3001400U]
+ *	81:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼ç¶ãï¼==
+ *
+ *	// (D-4)ã®ãã¹ã
+ *	// ããã§é·æéçµéãããã¨ãæ³å®
+ *	82:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	83:		[target_hrt_get_current -> -100U]
+ *	84:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// ã·ã¹ãã æå»ãè¨­å®ããï¼ãã®å¾ã®è¨ç®ãæ¥½ã«ããããï¼
+ *	85:	set_tim(5LLU << 32)
+ *	86:		[target_hrt_get_current -> -90U]
+ *	// adj_timã§ã·ã¹ãã æå»ãé²ãã
+ *	87:	adj_tim(200)								... (C-4)(D-4)(E-1)
+ *	88:		[target_hrt_get_current -> -80U]
+ *	89:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	// ã·ã¹ãã æå»ãç¢ºèª
+ *	90:	get_tim(&systim)
+ *	91:		[target_hrt_get_current -> -70U]
+ *	92:	assert(systim == (5LLU << 32) + 200U + 20U)
+ *
+ *	// adj_timã§ç¹°ãè¿ãã·ã¹ãã æå»ãæ»ããã¹ã
+ *	// ããã§å°ãæéãçµéãããã¨ãæ³å®
+ *	// ã·ã¹ãã æå»ãè¨­å®ããï¼ãã®å¾ã®è¨ç®ãæ¥½ã«ããããï¼
+ *	93:	set_tim(6LLU << 32)
+ *	94:		[target_hrt_get_current -> 110U]
+ *	// adj_timã§ã·ã¹ãã æå»ãæ»ã
+ *	95:	adj_tim(-200)								... (C-4)(D-1)(E-4)
+ *	96:		[target_hrt_get_current -> 120U]
+ *	97:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	// ã·ã¹ãã æå»ãç¢ºèª
+ *	98:	get_tim(&systim)
+ *	99:		[target_hrt_get_current -> 130U]
+ *	100:assert(systim == (6LLU << 32) + 10U)
+ *	// adj_timã§ã·ã¹ãã æå»ãããã«æ»ã
+ *		adj_tim(-1000000)							... (C-4)(D-1)(E-4)
+ *	101:	[target_hrt_get_current -> 140U]
+ *	102:	[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	103:adj_tim(-1000000) -> E_OBJ					... (C-7)(E-5)
+ *	104:	[target_hrt_get_current -> 150U]
+ *	105:adj_tim(+1000000)							... (C-4)(D-2)(E-1)
+ *	106:	[target_hrt_get_current -> 160U]
+ *	107:	[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	// ã·ã¹ãã æå»ãç¢ºèª
+ *	// adj_tim(-200)ãå¼ã³åºããæç¹ã§ã®ã·ã¹ãã æå»ã«ãªã£ã¦ããã¯ã
+ *	108:get_tim(&systim)
+ *	109:	[target_hrt_get_current -> 170U]
+ *	110:assert(systim == (6LLU << 32) + 10U)
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	111:get_tim(&systim)
+ *	112:	[target_hrt_get_current -> 370U]
+ *	113:assert(systim == (6LLU << 32) - 200U + 260U)
+ *	// adj_tim(0)ã®åä½ãç¢ºèª
+ *		adj_tim(0)									... (C-4)(D-1)(E-6)
+ *	114:	[target_hrt_get_current -> 380U]
+ *	115:	[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	// ã·ã¹ãã æå»ãç¢ºèª
+ *	116:get_tim(&systim)
+ *	117:	[target_hrt_get_current -> 390U]
+ *	118:assert(systim == (6LLU << 32) - 200U + 280U)
+ *	119:END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "hrt_systim2.h"
+#include "target_timer.h"
+
+#if !defined(HRT_CONFIG1) || defined(HRT_CONFIG2)
+#error Compiler option "-DHRT_CONFIG1" is missing.
+#endif
+
+#ifdef TOPPERS_SUPPORT_DRIFT
+#define HRTCNT_EMPTY	TMAX_RELTIM
+#else /* TOPPERS_SUPPORT_DRIFT */
+#define HRTCNT_EMPTY	HRTCNT_BOUND
+#endif /* TOPPERS_SUPPORT_DRIFT */
+
+#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
+
+void
+target_hrt_raise_event(void)
+{
+}
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+static uint_t	alarm1_count = 0;
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	SYSTIM	systim;
+
+	switch (++alarm1_count) {
+	case 1:
+		check_point(36);
+		ercd = set_tim(1LLU << 32);
+		check_ercd(ercd, E_CTX);
+
+		ercd = get_tim(&systim);
+		check_ercd(ercd, E_CTX);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(74);
+		ercd = adj_tim(+1000000);
+		check_ercd(ercd, E_OK);
+
+		check_point(76);
+		ercd = adj_tim(+1000000);
+		check_ercd(ercd, E_OBJ);
+
+		check_point(78);
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	alarm2_count = 0;
+
+void
+alarm2_handler(intptr_t exinf)
+{
+
+	switch (++alarm2_count) {
+	case 1:
+		check_point(79);
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RALM	ralm;
+	SYSTIM	systim;
+
+	check_point(3);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	ercd = set_tim(1000000LLU);
+	check_ercd(ercd, E_CTX);
+
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_CTX);
+
+	ercd = adj_tim(100);
+	check_ercd(ercd, E_CTX);
+
+	ercd = unl_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_point(4);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(6);
+	check_assert(systim == 40U - 10U);
+
+	ercd = set_tim(2LLU << 32);
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(10);
+	check_assert(systim == (2LLU << 32) + 10U);
+
+	check_point(11);
+	target_raise_hrt_int(1U);
+
+	ercd = tslp_tsk(TMAX_RELTIM);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(17);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(19);
+	check_assert(systim == (2LLU << 32) + 4000000050U);
+
+	check_point(20);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(22);
+	check_assert(systim == (3LLU << 32) + 50U);
+
+	ercd = adj_tim(-1000001);
+	check_ercd(ercd, E_PAR);
+
+	ercd = adj_tim(+1000001);
+	check_ercd(ercd, E_PAR);
+
+	ercd = sta_alm(ALM1, 2000000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(27);
+	check_assert(systim == (3LLU << 32) + 80U);
+
+	ercd = adj_tim(+1000000);
+	check_ercd(ercd, E_OK);
+
+	check_point(30);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(32);
+	check_assert(systim == (3LLU << 32) + 1000000U + 100U);
+
+	ercd = ref_alm(ALM1, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_point(34);
+	check_assert(ralm.lefttim == 999960U);
+
+	target_raise_hrt_int(0U);
+
+	check_point(39);
+	ercd = sta_alm(ALM1, 2000000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(42);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(44);
+	check_assert(systim == (3LLU << 32) + 1000000U + 1000110U);
+
+	ercd = adj_tim(-1000000);
+	check_ercd(ercd, E_OK);
+
+	check_point(47);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(49);
+	check_assert(systim == (3LLU << 32) + 1000000U + 1000120U);
+
+	ercd = ref_alm(ALM1, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert(ralm.lefttim == 2999960U);
+
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(52);
+	check_assert(systim == (3LLU << 32) + 1000000U + 1000120U);
+
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(54);
+	check_assert(systim == (3LLU << 32) + 2000160U);
+
+	ercd = adj_tim(-1000000);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(58);
+	check_assert(systim == (3LLU << 32) + 2000170U);
+
+	ercd = set_tim(4LLU << 32);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(61);
+	check_assert(systim == (4LLU << 32));
+
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(63);
+	check_assert(systim == (4LLU << 32));
+
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(65);
+	check_assert(systim == (4LLU << 32) - 999980U + 1000020U);
+
+	ercd = sta_alm(ALM1, 1000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(70);
+	ercd = sta_alm(ALM2, 1000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(72);
+	target_raise_hrt_int(0U);
+
+	check_point(82);
+	target_raise_hrt_int(0U);
+
+	check_point(85);
+	ercd = set_tim(5LLU << 32);
+	check_ercd(ercd, E_OK);
+
+	check_point(87);
+	ercd = adj_tim(200);
+	check_ercd(ercd, E_OK);
+
+	check_point(90);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(92);
+	check_assert(systim == (5LLU << 32) + 200U + 20U);
+
+	check_point(93);
+	ercd = set_tim(6LLU << 32);
+	check_ercd(ercd, E_OK);
+
+	check_point(95);
+	ercd = adj_tim(-200);
+	check_ercd(ercd, E_OK);
+
+	check_point(98);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(100);
+	check_assert(systim == (6LLU << 32) + 10U);
+
+	ercd = adj_tim(-1000000);
+	check_ercd(ercd, E_OK);
+
+	check_point(103);
+	ercd = adj_tim(-1000000);
+	check_ercd(ercd, E_OBJ);
+
+	check_point(105);
+	ercd = adj_tim(+1000000);
+	check_ercd(ercd, E_OK);
+
+	check_point(108);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(110);
+	check_assert(systim == (6LLU << 32) + 10U);
+
+	check_point(111);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(113);
+	check_assert(systim == (6LLU << 32) - 200U + 260U);
+
+	ercd = adj_tim(0);
+	check_ercd(ercd, E_OK);
+
+	check_point(116);
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+	check_point(118);
+	check_assert(systim == (6LLU << 32) - 200U + 280U);
+
+	check_finish(119);
+	check_point(0);
+}
+
+static uint_t	target_hrt_get_current_count = 0;
+
+HRTCNT
+target_hrt_get_current(void)
+{
+
+	switch (++target_hrt_get_current_count) {
+	case 1:
+		test_start(__FILE__);
+
+		check_point(1);
+		return(10U);
+
+		check_point(0);
+
+	case 2:
+		check_point(5);
+		return(40U);
+
+		check_point(0);
+
+	case 3:
+		check_point(7);
+		return(50U);
+
+		check_point(0);
+
+	case 4:
+		check_point(9);
+		return(60U);
+
+		check_point(0);
+
+	case 5:
+		check_point(12);
+		return(70U);
+
+		check_point(0);
+
+	case 6:
+		check_point(14);
+		return(4000000080U);
+
+		check_point(0);
+
+	case 7:
+		check_point(15);
+		return(4000000090U);
+
+		check_point(0);
+
+	case 8:
+		check_point(18);
+		return(4000000100U);
+
+		check_point(0);
+
+	case 9:
+		check_point(21);
+		return(100U);
+
+		check_point(0);
+
+	case 10:
+		check_point(23);
+		return(120U);
+
+		check_point(0);
+
+	case 11:
+		check_point(26);
+		return(130U);
+
+		check_point(0);
+
+	case 12:
+		check_point(28);
+		return(140U);
+
+		check_point(0);
+
+	case 13:
+		check_point(31);
+		return(150U);
+
+		check_point(0);
+
+	case 14:
+		check_point(33);
+		return(160U);
+
+		check_point(0);
+
+	case 15:
+		check_point(35);
+		return(1000130U);
+
+		check_point(0);
+
+	case 16:
+		check_point(37);
+		return(1000140U);
+
+		check_point(0);
+
+	case 17:
+		check_point(40);
+		return(1000150U);
+
+		check_point(0);
+
+	case 18:
+		check_point(43);
+		return(1000160U);
+
+		check_point(0);
+
+	case 19:
+		check_point(45);
+		return(1000170U);
+
+		check_point(0);
+
+	case 20:
+		check_point(48);
+		return(1000180U);
+
+		check_point(0);
+
+	case 21:
+		check_point(50);
+		return(1000190U);
+
+		check_point(0);
+
+	case 22:
+		check_point(51);
+		return(1500200U);
+
+		check_point(0);
+
+	case 23:
+		check_point(53);
+		return(2000210U);
+
+		check_point(0);
+
+	case 24:
+		check_point(55);
+		return(2000220U);
+
+		check_point(0);
+
+	case 25:
+		check_point(57);
+		return(2000230U);
+
+		check_point(0);
+
+	case 26:
+		check_point(59);
+		return(2000240U);
+
+		check_point(0);
+
+	case 27:
+		check_point(60);
+		return(2000250U);
+
+		check_point(0);
+
+	case 28:
+		check_point(62);
+		return(2500250U);
+
+		check_point(0);
+
+	case 29:
+		check_point(64);
+		return(3000260U);
+
+		check_point(0);
+
+	case 30:
+		check_point(66);
+		return(3000270U);
+
+		check_point(0);
+
+	case 31:
+		check_point(68);
+		return(3000270U);
+
+		check_point(0);
+
+	case 32:
+		check_point(71);
+		return(3000280U);
+
+		check_point(0);
+
+	case 33:
+		check_point(73);
+		return(3001280U);
+
+		check_point(0);
+
+	case 34:
+		check_point(75);
+		return(3001290U);
+
+		check_point(0);
+
+	case 35:
+		check_point(77);
+		return(3001300U);
+
+		check_point(0);
+
+	case 36:
+		check_point(80);
+		return(3001400U);
+
+		check_point(0);
+
+	case 37:
+		check_point(83);
+		return(-100U);
+
+		check_point(0);
+
+	case 38:
+		check_point(86);
+		return(-90U);
+
+		check_point(0);
+
+	case 39:
+		check_point(88);
+		return(-80U);
+
+		check_point(0);
+
+	case 40:
+		check_point(91);
+		return(-70U);
+
+		check_point(0);
+
+	case 41:
+		check_point(94);
+		return(110U);
+
+		check_point(0);
+
+	case 42:
+		check_point(96);
+		return(120U);
+
+		check_point(0);
+
+	case 43:
+		check_point(99);
+		return(130U);
+
+		check_point(0);
+
+	case 44:
+		check_point(101);
+		return(140U);
+
+		check_point(0);
+
+	case 45:
+		check_point(104);
+		return(150U);
+
+		check_point(0);
+
+	case 46:
+		check_point(106);
+		return(160U);
+
+		check_point(0);
+
+	case 47:
+		check_point(109);
+		return(170U);
+
+		check_point(0);
+
+	case 48:
+		check_point(112);
+		return(370U);
+
+		check_point(0);
+
+	case 49:
+		check_point(114);
+		return(380U);
+
+		check_point(0);
+
+	case 50:
+		check_point(117);
+		return(390U);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+	return(0U);
+}
+
+static uint_t	target_hrt_set_event_count = 0;
+
+void
+target_hrt_set_event(HRTCNT hrtcnt)
+{
+
+	switch (++target_hrt_set_event_count) {
+	case 1:
+		check_point(2);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(13);
+		check_assert(hrtcnt == 4000000001U);
+
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(16);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 4:
+		check_point(24);
+		check_assert(hrtcnt == 2000001U);
+
+		return;
+
+		check_point(0);
+
+	case 5:
+		check_point(29);
+		check_assert(hrtcnt == 999981U);
+
+		return;
+
+		check_point(0);
+
+	case 6:
+		check_point(38);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 7:
+		check_point(41);
+		check_assert(hrtcnt == 2000001U);
+
+		return;
+
+		check_point(0);
+
+	case 8:
+		check_point(46);
+		check_assert(hrtcnt == 2999981U);
+
+		return;
+
+		check_point(0);
+
+	case 9:
+		check_point(56);
+		check_assert(hrtcnt == 2999931U);
+
+		return;
+
+		check_point(0);
+
+	case 10:
+		check_point(67);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 11:
+		check_point(69);
+		check_assert(hrtcnt == 1001U);
+
+		return;
+
+		check_point(0);
+
+	case 12:
+		check_point(81);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 13:
+		check_point(84);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 14:
+		check_point(89);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 15:
+		check_point(97);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 16:
+		check_point(102);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 17:
+		check_point(107);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 18:
+		check_point(115);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/hrt_systim2.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim2.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/hrt_systim2.cfg	(revision 302)
@@ -0,0 +1,16 @@
+/*
+ *		ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(2)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³
+ *		ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "hrt_systim2.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
+CRE_ALM(ALM2, { TA_NULL, { TNFY_HANDLER, 1, alarm2_handler }});
Index: asp3_wo_tecs/trunk/test/hrt_systim2.h
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim2.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/hrt_systim2.h	(revision 302)
@@ -0,0 +1,93 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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: hrt_systim2.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(2)
+ */
+
+#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	alarm1_handler(intptr_t exinf);
+extern void	alarm2_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/hrt_systim3.c
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim3.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/hrt_systim3.c	(revision 302)
@@ -0,0 +1,652 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: hrt_systim3.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(3)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *	å¨æãã³ãã©ã®èµ·åã¿ã¤ãã³ã°ããã¹ãããï¼
+ *
+ *	ã¾ãï¼ä»¥ä¸ã®é¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
+ *		tmevtb_dequeue
+ *		tmevtb_lefttim
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *  (A) å¨æãã³ãã©ã®èµ·åã¿ã¤ãã³ã°ã®ç¢ºèª
+ *	  (A-1) TA_STAå±æ§ã§ï¼èµ·åä½ç¸ï¼ååã®èµ·åæå»ï¼ã0ã®å ´å
+ *	  (A-2) TA_STAå±æ§ã§ï¼èµ·åä½ç¸ï¼ååã®èµ·åæå»ï¼ã0ã§ãªãå ´å
+ *	  (A-3) sta_cycã§ï¼èµ·åä½ç¸ï¼ååã®èµ·åæå»ï¼ã0ã®å ´å
+ *	  (A-4) sta_cycã§ï¼èµ·åä½ç¸ï¼ååã®èµ·åæå»ï¼ã0ã§ãªãå ´å
+ *	  (A-5) æ±ºããããå¨æã§åèµ·åããããã¨
+ *  (B) tmevtb_dequeueã®å®è¡/åå²ãã¹ã®ç¶²ç¾
+
+ *	  (B-1) signal_timeä¸­ããã®å¼ã³åºã
+ *	  (B-2) å
+é ­ä»¥å¤ã®ã¿ã¤ã ã¤ãã³ããåé¤ããå ´å
+ *	  (B-3) å
+é ­ã®ã¿ã¤ã ã¤ãã³ããåé¤ããå ´å
+ *  (C) tmevtb_lefttimã®å®è¡/åå²ãã¹ã®ç¶²ç¾
+
+ *	  (C-1) ã¤ãã³ãã®çºçæå»ãéãã¦ããå ´å
+ *	  (C-2) ã¤ãã³ãã®çºçæå»ãéãã¦ããªãå ´å
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	é«åè§£è½ã¿ã¤ãã¢ã¸ã¥ã¼ã«ã®æ§è³ªï¼HRT_CONFIG1
+ *		TCYC_HRTCNT		æªå®ç¾©ï¼2^32ã®æå³ï¼
+ *		TSTEP_HRTCNT	1U
+ *		HRTCNT_BOUND	4000000002U
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *	CYC1:  å¨æãã³ãã©ï¼å¨æï¼1000ï¼åæä½ç¸ï¼0ï¼
+ *	CYC2:  å¨æãã³ãã©ï¼å¨æï¼500ï¼åæä½ç¸ï¼499ï¼
+ *
+ * ãè£è¶³èª¬æã
+ *
+ *	ã¿ã¤ã ã¤ãã³ããç»é²ããã¦ããªãæã«é«åè§£è½ã¿ã¤ãã«è¨­å®ããç¸å¯¾ã¯ï¼
+ *	ããªããèª¿æ´æ©è½ãæããªãå ´åã¯HRTCNT_BOUNDã§ããã®ã«å¯¾ãã¦ï¼ããª
+ *	ããèª¿æ´æ©è½ãæã¤å ´åã¯TMAX_RELTIMãã¤ãã³ãæå»ã®ä¼¸ç¸®çã§å²ã£ãå¤
+ *	ã¨HRTCNT_BOUNDã®å°ããæ¹ã®å¤ï¼ãã®ãã¹ãã§ã¯ï¼ããªããéãè¨­å®ããï¼
+ *	HRTCNT_BOUNDï¼TMAX_RELTIMã§ããããï¼TMAX_RELTIMã«ä¸è´ï¼ã¨ãªãï¼ã
+ *	ãã§ï¼HRTCNT_EMPTYããã®å¤ã«å®ç¾©ãï¼ããªããèª¿æ´æ©è½ã®æç¡ã«ããã
+ *	åããã¹ãã·ã¼ã±ã³ã¹ãä½¿ããããã«ããï¼
+ *
+ *	ä»¥ä¸ã®ãã¹ãã·ã¼ã±ã³ã¹ã®ã³ã¡ã³ãä¸­ã§ï¼ãçºçï¼xxxãã¨ã¯ï¼é«åè§£è½ã¿
+ *	ã¤ãã®ã«ã¦ã³ãå¤ãxxxã«ãªã£ãæã«ã¿ã¤ã ã¤ãã³ããçºçãããã¨ãæå³
+ *	ããï¼ã¿ã¤ã ã¤ãã³ãã®ã¤ãã³ãçºçæå»ã§ã¯ãªãï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== START ==
+ *	// ã«ã¼ãã«èµ·åï¼é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã¨ã¤ãã³ãæå»ã¯10ããã
+ *	1:		[target_hrt_get_current -> 10U]			// CYC1ã®æ¬¡åçºçï¼10
+ *	2:		[target_hrt_raise_event]				// CYC2ã®æ¬¡åçºçï¼509
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	3:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	4:		[target_hrt_get_current -> 10U]			... (A-1)	// CYC1ã®çºç
+ *	== CYC1-1ï¼1åç®ï¼==							// CYC1ã®æ¬¡åçºçï¼1010
+ *	5:	RETURN
+ *	6:		[target_hrt_get_current -> 20U]
+ *	7:		[target_hrt_set_event <- 489U]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	8:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	9:		[target_hrt_get_current -> 509U]		... (A-2)	// CYC2ã®çºç
+ *	== CYC2-1ï¼1åç®ï¼==							// CYC2ã®æ¬¡åçºçï¼1009
+ *	10:	RETURN
+ *	11:		[target_hrt_get_current -> 519U]
+ *	12:		[target_hrt_set_event <- 490U]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	13:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	14:		[target_hrt_get_current -> 1009U]		... (A-5)	// CYC2ã®çºç
+ *	== CYC2-2ï¼2åç®ï¼==							// CYC2ã®æ¬¡åçºçï¼1509
+ *	15:	RETURN
+ *	16:		[target_hrt_get_current -> 1010U]		... (A-5)	// CYC1ã®çºç
+ *	== CYC1-2ï¼2åç®ï¼==							// CYC1ã®æ¬¡åçºçï¼2010
+ *	17:	RETURN
+ *	18:		[target_hrt_get_current -> 1020U]
+ *	19:		[target_hrt_set_event <- 489U]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	20:	ref_cyc(CYC1, &rcyc)						... (C-2)
+ *	21:		[target_hrt_get_current -> 1030U]
+ *	22:	assert(rcyc.lefttim == 979U)
+ *	23:	stp_cyc(CYC1)								... (B-2)
+ *	24:	stp_cyc(CYC2)								... (B-3)
+ *	25:		[target_hrt_get_current -> 1040U]
+ *	26:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	27:	sta_cyc(CYC1)								... (A-3)
+ *	28:		[target_hrt_get_current -> 1050U]		// CYC1ã®çºçï¼1051
+ *	29:		[target_hrt_set_event <- 1U]
+ *	30:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	31:		[target_hrt_get_current -> 1051U]		// CYC1ãçºç
+ *	== CYC1-3ï¼3åç®ï¼==							// CYC1ã®æ¬¡åçºçï¼2051
+ *	32:	RETURN
+ *	33:		[target_hrt_get_current -> 1052U]
+ *	34:		[target_hrt_set_event <- 999U]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	35:	sta_cyc(CYC2)								... (A-4)
+ *	36:		[target_hrt_get_current -> 1060U]		// CYC2ã®çºçï¼1560
+ *	37:		[target_hrt_set_event <- 500U]
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	38:	ref_cyc(CYC2, &rcyc)						... (C-2)
+ *	39:		[target_hrt_get_current -> 1558U]
+ *	40:	assert(rcyc.lefttim == 1U)
+ *	// ä»¥ä¸ã®ã·ã¼ã±ã³ã¹ã¯ï¼ã¿ã¤ãå²è¾¼ã¿ã®åä»ãé
+ããå ´åã«ããçºçããªãï¼
+ *	41:	ref_cyc(CYC2, &rcyc)						... (C-1)
+ *	42:		[target_hrt_get_current -> 1561U]		// CYC2ã®çºçæå»ã
+ *	43:	assert(rcyc.lefttim == 0U)					//  éãã¦ãã
+ *	44:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	45:		[target_hrt_get_current -> 1562U]		// CYC2ãçºç
+ *	== CYC2-3ï¼3åç®ï¼==							// CYC2ã®æ¬¡åçºçï¼2060
+ *	46:	RETURN
+ *	47:		[target_hrt_get_current -> 1563U]
+ *	48:		[target_hrt_set_event <- 488U]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	49:	sta_alm(ALM1, 100U)
+ *	50:		[target_hrt_get_current -> 1620U]		// ALM1ã®çºçï¼1721
+ *	51:		[target_hrt_set_event <- 101U]
+ *	52:	sta_alm(ALM2, 200U)
+ *	53:		[target_hrt_get_current -> 1630U]		// ALM2ã®çºçï¼1831
+ *	// ããã§æéãçµéãããã¨ãæ³å®
+ *	54:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	55:		[target_hrt_get_current -> 1721]		// ALM1ãçºç
+ *	== ALM1-1ï¼1åç®ï¼==
+ *	56:	stp_alm(ALM2)								... (B-1)
+ *		RETURN
+ *	57:		[target_hrt_get_current -> 1730U]
+ *	58:		[target_hrt_set_event <- 321U]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	59:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "hrt_systim3.h"
+#include "target_timer.h"
+
+#if !defined(HRT_CONFIG1) || defined(HRT_CONFIG2)
+#error Compiler option "-DHRT_CONFIG1" is missing.
+#endif
+
+#ifdef TOPPERS_SUPPORT_DRIFT
+#define HRTCNT_EMPTY	TMAX_RELTIM
+#else /* TOPPERS_SUPPORT_DRIFT */
+#define HRTCNT_EMPTY	HRTCNT_BOUND
+#endif /* TOPPERS_SUPPORT_DRIFT */
+
+#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
+
+void
+alarm2_handler(intptr_t exinf)
+{
+}
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+static uint_t	alarm1_count = 0;
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++alarm1_count) {
+	case 1:
+		check_point(56);
+		ercd = stp_alm(ALM2);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	cyclic1_count = 0;
+
+void
+cyclic1_handler(intptr_t exinf)
+{
+
+	switch (++cyclic1_count) {
+	case 1:
+		check_point(5);
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(17);
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(32);
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	cyclic2_count = 0;
+
+void
+cyclic2_handler(intptr_t exinf)
+{
+
+	switch (++cyclic2_count) {
+	case 1:
+		check_point(10);
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(15);
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(46);
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RCYC	rcyc;
+
+	check_point(3);
+	target_raise_hrt_int(0U);
+
+	check_point(8);
+	target_raise_hrt_int(0U);
+
+	check_point(13);
+	target_raise_hrt_int(0U);
+
+	check_point(20);
+	ercd = ref_cyc(CYC1, &rcyc);
+	check_ercd(ercd, E_OK);
+
+	check_point(22);
+	check_assert(rcyc.lefttim == 979U);
+
+	check_point(23);
+	ercd = stp_cyc(CYC1);
+	check_ercd(ercd, E_OK);
+
+	check_point(24);
+	ercd = stp_cyc(CYC2);
+	check_ercd(ercd, E_OK);
+
+	check_point(27);
+	ercd = sta_cyc(CYC1);
+	check_ercd(ercd, E_OK);
+
+	check_point(30);
+	target_raise_hrt_int(0U);
+
+	check_point(35);
+	ercd = sta_cyc(CYC2);
+	check_ercd(ercd, E_OK);
+
+	check_point(38);
+	ercd = ref_cyc(CYC2, &rcyc);
+	check_ercd(ercd, E_OK);
+
+	check_point(40);
+	check_assert(rcyc.lefttim == 1U);
+
+	check_point(41);
+	ercd = ref_cyc(CYC2, &rcyc);
+	check_ercd(ercd, E_OK);
+
+	check_point(43);
+	check_assert(rcyc.lefttim == 0U);
+
+	check_point(44);
+	target_raise_hrt_int(0U);
+
+	check_point(49);
+	ercd = sta_alm(ALM1, 100U);
+	check_ercd(ercd, E_OK);
+
+	check_point(52);
+	ercd = sta_alm(ALM2, 200U);
+	check_ercd(ercd, E_OK);
+
+	check_point(54);
+	target_raise_hrt_int(0U);
+
+	check_finish(59);
+	check_point(0);
+}
+
+static uint_t	target_hrt_get_current_count = 0;
+
+HRTCNT
+target_hrt_get_current(void)
+{
+
+	switch (++target_hrt_get_current_count) {
+	case 1:
+		test_start(__FILE__);
+
+		check_point(1);
+		return(10U);
+
+		check_point(0);
+
+	case 2:
+		check_point(4);
+		return(10U);
+
+		check_point(0);
+
+	case 3:
+		check_point(6);
+		return(20U);
+
+		check_point(0);
+
+	case 4:
+		check_point(9);
+		return(509U);
+
+		check_point(0);
+
+	case 5:
+		check_point(11);
+		return(519U);
+
+		check_point(0);
+
+	case 6:
+		check_point(14);
+		return(1009U);
+
+		check_point(0);
+
+	case 7:
+		check_point(16);
+		return(1010U);
+
+		check_point(0);
+
+	case 8:
+		check_point(18);
+		return(1020U);
+
+		check_point(0);
+
+	case 9:
+		check_point(21);
+		return(1030U);
+
+		check_point(0);
+
+	case 10:
+		check_point(25);
+		return(1040U);
+
+		check_point(0);
+
+	case 11:
+		check_point(28);
+		return(1050U);
+
+		check_point(0);
+
+	case 12:
+		check_point(31);
+		return(1051U);
+
+		check_point(0);
+
+	case 13:
+		check_point(33);
+		return(1052U);
+
+		check_point(0);
+
+	case 14:
+		check_point(36);
+		return(1060U);
+
+		check_point(0);
+
+	case 15:
+		check_point(39);
+		return(1558U);
+
+		check_point(0);
+
+	case 16:
+		check_point(42);
+		return(1561U);
+
+		check_point(0);
+
+	case 17:
+		check_point(45);
+		return(1562U);
+
+		check_point(0);
+
+	case 18:
+		check_point(47);
+		return(1563U);
+
+		check_point(0);
+
+	case 19:
+		check_point(50);
+		return(1620U);
+
+		check_point(0);
+
+	case 20:
+		check_point(53);
+		return(1630U);
+
+		check_point(0);
+
+	case 21:
+		check_point(55);
+		return(1721);
+
+		check_point(0);
+
+	case 22:
+		check_point(57);
+		return(1730U);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+	return(0U);
+}
+
+static uint_t	target_hrt_raise_event_count = 0;
+
+void
+target_hrt_raise_event(void)
+{
+
+	switch (++target_hrt_raise_event_count) {
+	case 1:
+		check_point(2);
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	target_hrt_set_event_count = 0;
+
+void
+target_hrt_set_event(HRTCNT hrtcnt)
+{
+
+	switch (++target_hrt_set_event_count) {
+	case 1:
+		check_point(7);
+		check_assert(hrtcnt == 489U);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(12);
+		check_assert(hrtcnt == 490U);
+
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(19);
+		check_assert(hrtcnt == 489U);
+
+		return;
+
+		check_point(0);
+
+	case 4:
+		check_point(26);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 5:
+		check_point(29);
+		check_assert(hrtcnt == 1U);
+
+		return;
+
+		check_point(0);
+
+	case 6:
+		check_point(34);
+		check_assert(hrtcnt == 999U);
+
+		return;
+
+		check_point(0);
+
+	case 7:
+		check_point(37);
+		check_assert(hrtcnt == 500U);
+
+		return;
+
+		check_point(0);
+
+	case 8:
+		check_point(48);
+		check_assert(hrtcnt == 488U);
+
+		return;
+
+		check_point(0);
+
+	case 9:
+		check_point(51);
+		check_assert(hrtcnt == 101U);
+
+		return;
+
+		check_point(0);
+
+	case 10:
+		check_point(58);
+		check_assert(hrtcnt == 321U);
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/hrt_systim3.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim3.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/hrt_systim3.cfg	(revision 302)
@@ -0,0 +1,18 @@
+/*
+ *		ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(3)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³
+ *		ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "hrt_systim3.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_CYC(CYC1, { TA_STA, { TNFY_HANDLER, 1, cyclic1_handler }, 1000, 0 });
+CRE_CYC(CYC2, { TA_STA, { TNFY_HANDLER, 1, cyclic2_handler }, 500, 499 });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
+CRE_ALM(ALM2, { TA_NULL, { TNFY_HANDLER, 1, alarm2_handler }});
Index: asp3_wo_tecs/trunk/test/hrt_systim3.h
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim3.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/hrt_systim3.h	(revision 302)
@@ -0,0 +1,95 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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: hrt_systim3.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(3)
+ */
+
+#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	cyclic1_handler(intptr_t exinf);
+extern void	cyclic2_handler(intptr_t exinf);
+extern void	alarm1_handler(intptr_t exinf);
+extern void	alarm2_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/hrt_systim4.c
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim4.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/hrt_systim4.c	(revision 302)
@@ -0,0 +1,436 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: hrt_systim4.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(4)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  é«åè§£è½ã¿ã¤ãã¢ã¸ã¥ã¼ã«ã®æ§è³ªãç°ãªãå ´åã®ãã¹ãï¼é«åè§£è½ã¿ã¤ã
+ *  ã¢ã¸ã¥ã¼ã«ã®æ§è³ªãè¡¨ã3ã¤ã®å®æ°ãåç
+§ãã¦ããç®æãç¶²ç¾
+çã«ãã¹ãã
+ *  ãï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) update_current_evttimã§TCYC_HRTCNTãåç
+§ãã¦ããç®æã®ãã¹ã
+ *	  (A-1) ã«ã¦ã³ãå¤ãå¨åãã¦ããªãå ´å
+ *	  (A-2) ã«ã¦ã³ãå¤ãå¨åãã¦ããå ´å
+ *	  (A-3) ã«ã¦ã³ãå¤ãååã¨åãå ´åï¼å¢çã®ã±ã¼ã¹ï¼
+ *	(B) calc_current_evttim_ubï¼TSTEP_HRTCNTãåç
+§ãã¦ããï¼ãå¼ã³åºã
+ *		ã¦ããå¦çã®ãã¹ã
+ *	  (B-1) tmevtb_enqueueã§ã®ã¿ã¤ã ã¤ãã³ãã®çºçæå»ã®è¨ç®
+ *	  (B-2) tmevt_lefttimã§ã®ã¿ã¤ã ã¤ãã³ããçºçããã¾ã§ã®æéã®è¨ç®
+ *	(C) set_hrt_eventã§HRTCNT_BOUNDãåç
+§ãã¦ããç®æã®ãã¹ã
+ *	  (C-1) ç»é²ããã¦ããã¿ã¤ã ã¤ãã³ãããªãæ
+ *	  (C-2) å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã¾ã§ã®æéãHRTCNT_BOUNDãè¶
+ããæ
+ *	  (C-3) å
+é ­ã®ã¿ã¤ã ã¤ãã³ãã¾ã§ã®æéãHRTCNT_BOUNDä»¥ä¸ã®æ
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	é«åè§£è½ã¿ã¤ãã¢ã¸ã¥ã¼ã«ã®æ§è³ªï¼HRT_CONFIG2
+ *		TCYC_HRTCNT		(0x10000U * 10U)
+ *		TSTEP_HRTCNT	10U
+ *		HRTCNT_BOUND	(0x10000U * 9U)
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *	ALM2:  ã¢ã©ã¼ã ãã³ãã©
+ *	ALM3:  ã¢ã©ã¼ã ãã³ãã©
+ *
+ * ãè£è¶³èª¬æã
+ *
+ *	ä»¥ä¸ã®ãã¹ãã·ã¼ã±ã³ã¹ã®ã³ã¡ã³ãä¸­ã§ï¼ãçºçï¼xxxãã¨ã¯ï¼é«åè§£è½ã¿
+ *	ã¤ãã®ã«ã¦ã³ãå¤ãxxxã«ãªã£ãæã«ã¿ã¤ã ã¤ãã³ããçºçãããã¨ãæå³
+ *	ããï¼ã¿ã¤ã ã¤ãã³ãã®ã¤ãã³ãçºçæå»ã§ã¯ãªãï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== START ==
+ *	// ã«ã¼ãã«èµ·åï¼é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ã¨ã¤ãã³ãæå»ã¯10ããã
+ *	1:		[target_hrt_get_current -> 10U]
+ *	2:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	// ã¿ã¤ã ã¤ãã³ãã2ã¤ç»é²
+ *	3:	sta_alm(ALM1, 100U)
+ *	4:		[target_hrt_get_current -> 20U]			... (A-1) // çºçï¼130
+ *	5:		[target_hrt_set_event <- 110U]			... (B-1)(C-3)
+ *	6:	sta_alm(ALM2, 105U)
+ *	7:		[target_hrt_get_current -> 20U]			... (A-3) // çºçï¼135
+ *	8:	DO(target_raise_hrt_int(1U))
+ *		slp_tsk()
+ *	== HRT_HANDLER ==
+ *	9:		[target_hrt_get_current -> 130U]		// ALM1ãçºç
+ *	== ALM1-1ï¼1åç®ï¼==
+ *	10:	wup_tsk(TASK1)
+ *		RETURN
+ *	11:		[target_hrt_get_current -> 130U]		... (A-3)
+ *	12:		[target_hrt_set_event <- 5U]			... (B-1)
+ *	== TASK1ï¼ç¶ãï¼== 								// ALM2ã¾ã§ã®æéã¯5
+ *	13:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	14:		[target_hrt_get_current -> 140U]		// ALM2ãçºç
+ *	== ALM2-1ï¼1åç®ï¼==
+ *	15:	RETURN
+ *	// ã¿ã¤ã ã¤ãã³ãããªããªã£ãå ´å
+ *	16:		[target_hrt_get_current -> 150U]
+ *	17:		[target_hrt_set_event <- HRTCNT_EMPTY]	... (C-1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// çºçæå»ã¾ã§ã®é·ãã¿ã¤ã ã¤ãã³ããç»é²
+ *	18:	sta_alm(ALM1, 1000000U)
+ *	19:		[target_hrt_get_current -> 160U]		// çºçï¼1000170
+ *	20:		[target_hrt_set_event <- HRTCNT_BOUND]	... (C-2)
+ *	21:	ref_alm(ALM1, &ralm)
+ *	22:		[target_hrt_get_current -> 170U]
+ *	23:	assert(ralm.lefttim == 999990U)
+ *	// ããã§é·ãæéãçµéããã¨æ³å®
+ *	24:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	25:		[target_hrt_get_current -> 600000U]
+ *	26:		[target_hrt_set_event <- 400170U]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	// ããã§é·ãæéãçµéããã¨æ³å®
+ *	27:	DO(target_raise_hrt_int(0U))
+ *	== HRT_HANDLER ==
+ *	28:		[target_hrt_get_current -> 344810U]		... (A-2) // ALM1ãçºç
+ *	== ALM1-2ï¼2åç®ï¼==
+ *	29:	RETURN
+ *	30:		[target_hrt_get_current -> 344810U]
+ *	31:		[target_hrt_set_event <- HRTCNT_EMPTY]
+ *	== TASK1ï¼ç¶ãï¼==
+ *	32:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "hrt_systim4.h"
+#include "target_timer.h"
+
+#if defined(HRT_CONFIG1) || !defined(HRT_CONFIG2)
+#error Compiler option "-DHRT_CONFIG2" is missing.
+#endif
+
+#define HRTCNT_EMPTY	HRTCNT_BOUND
+
+#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
+
+void
+target_hrt_raise_event(void)
+{
+}
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+static uint_t	alarm1_count = 0;
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++alarm1_count) {
+	case 1:
+		check_point(10);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(29);
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	alarm2_count = 0;
+
+void
+alarm2_handler(intptr_t exinf)
+{
+
+	switch (++alarm2_count) {
+	case 1:
+		check_point(15);
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RALM	ralm;
+
+	check_point(3);
+	ercd = sta_alm(ALM1, 100U);
+	check_ercd(ercd, E_OK);
+
+	check_point(6);
+	ercd = sta_alm(ALM2, 105U);
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	target_raise_hrt_int(1U);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	target_raise_hrt_int(0U);
+
+	check_point(18);
+	ercd = sta_alm(ALM1, 1000000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(21);
+	ercd = ref_alm(ALM1, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_point(23);
+	check_assert(ralm.lefttim == 999990U);
+
+	check_point(24);
+	target_raise_hrt_int(0U);
+
+	check_point(27);
+	target_raise_hrt_int(0U);
+
+	check_finish(32);
+	check_point(0);
+}
+
+static uint_t	target_hrt_get_current_count = 0;
+
+HRTCNT
+target_hrt_get_current(void)
+{
+
+	switch (++target_hrt_get_current_count) {
+	case 1:
+		test_start(__FILE__);
+
+		check_point(1);
+		return(10U);
+
+		check_point(0);
+
+	case 2:
+		check_point(4);
+		return(20U);
+
+		check_point(0);
+
+	case 3:
+		check_point(7);
+		return(20U);
+
+		check_point(0);
+
+	case 4:
+		check_point(9);
+		return(130U);
+
+		check_point(0);
+
+	case 5:
+		check_point(11);
+		return(130U);
+
+		check_point(0);
+
+	case 6:
+		check_point(14);
+		return(140U);
+
+		check_point(0);
+
+	case 7:
+		check_point(16);
+		return(150U);
+
+		check_point(0);
+
+	case 8:
+		check_point(19);
+		return(160U);
+
+		check_point(0);
+
+	case 9:
+		check_point(22);
+		return(170U);
+
+		check_point(0);
+
+	case 10:
+		check_point(25);
+		return(600000U);
+
+		check_point(0);
+
+	case 11:
+		check_point(28);
+		return(344810U);
+
+		check_point(0);
+
+	case 12:
+		check_point(30);
+		return(344810U);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+	return(0U);
+}
+
+static uint_t	target_hrt_set_event_count = 0;
+
+void
+target_hrt_set_event(HRTCNT hrtcnt)
+{
+
+	switch (++target_hrt_set_event_count) {
+	case 1:
+		check_point(2);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(5);
+		check_assert(hrtcnt == 110U);
+
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(12);
+		check_assert(hrtcnt == 5U);
+
+		return;
+
+		check_point(0);
+
+	case 4:
+		check_point(17);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	case 5:
+		check_point(20);
+		check_assert(hrtcnt == HRTCNT_BOUND);
+
+		return;
+
+		check_point(0);
+
+	case 6:
+		check_point(26);
+		check_assert(hrtcnt == 400170U);
+
+		return;
+
+		check_point(0);
+
+	case 7:
+		check_point(31);
+		check_assert(hrtcnt == HRTCNT_EMPTY);
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/hrt_systim4.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim4.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/hrt_systim4.cfg	(revision 302)
@@ -0,0 +1,16 @@
+/*
+ *		ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "hrt_systim4.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
+CRE_ALM(ALM2, { TA_NULL, { TNFY_HANDLER, 1, alarm2_handler }});
Index: asp3_wo_tecs/trunk/test/hrt_systim4.h
===================================================================
--- asp3_wo_tecs/trunk/test/hrt_systim4.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/hrt_systim4.h	(revision 302)
@@ -0,0 +1,93 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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: hrt_systim4.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ã·ã¹ãã æå»ç®¡çæ©è½ã®ãã¹ã(4)
+ */
+
+#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	alarm1_handler(intptr_t exinf);
+extern void	alarm2_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/perf0.c
===================================================================
--- asp3_wo_tecs/trunk/test/perf0.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf0.c	(revision 302)
@@ -0,0 +1,98 @@
+/*
+ *  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: perf0.c 506 2016-01-12 01:46:49Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (0)
+ *
+ *  æéè¨æ¸¬ã®ãªã¼ãããããè¨æ¸¬ããããã®ãã­ã°ã©ã ï¼
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/syslog.h"
+#include "syssvc/test_svc.h"
+#include "syssvc/histogram.h"
+#include "kernel_cfg.h"
+#include "perf0.h"
+
+/*
+ *  è¨æ¸¬åæ°ã¨å®è¡æéåå¸ãè¨é²ããæå¤§æé
+ */
+#define NO_MEASURE	10000U			/* è¨æ¸¬åæ° */
+#define MAX_TIME	1000U			/* å®è¡æéåå¸ãè¨é²ããæå¤§æé */
+
+/*
+ *  å®è¡æéåå¸ãè¨é²ããã¡ã¢ãªé å
+ */
+static uint_t	histarea1[MAX_TIME + 1];
+
+/*
+ *  ã¡ã¤ã³ã¿ã¹ã¯
+ */
+void main_task(intptr_t exinf)
+{
+	uint_t	i;
+
+	syslog_0(LOG_NOTICE, "Performance evaluation program (0)");
+	init_hist(1, MAX_TIME, histarea1);
+
+	for (i = 0; i < NO_MEASURE; i++) {
+		begin_measure(1);
+		end_measure(1);
+	}
+
+	syslog_0(LOG_NOTICE, "Measurement overhead");
+	print_hist(1);
+	check_finish(0);
+}
Index: asp3_wo_tecs/trunk/test/perf0.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/perf0.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf0.cfg	(revision 302)
@@ -0,0 +1,13 @@
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (0)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: perf0.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "perf0.h"
+
+CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, STACK_SIZE, NULL });
Index: asp3_wo_tecs/trunk/test/perf0.h
===================================================================
--- asp3_wo_tecs/trunk/test/perf0.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf0.h	(revision 302)
@@ -0,0 +1,83 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2006-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: perf0.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (0)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+#define MAIN_PRIORITY	11		/* ã¡ã¤ã³ã¿ã¹ã¯ã®åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#ifndef STACK_SIZE
+#define	STACK_SIZE		4096		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãº */
+#endif /* STACK_SIZE */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+extern void	main_task(intptr_t exinf);
Index: asp3_wo_tecs/trunk/test/perf1.c
===================================================================
--- asp3_wo_tecs/trunk/test/perf1.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf1.c	(revision 302)
@@ -0,0 +1,135 @@
+/*
+ *  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: perf1.c 506 2016-01-12 01:46:49Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (1)
+ *
+ *  slp_tskï¼wup_tskã«ããã¿ã¹ã¯åæãæéãè¨æ¸¬ããããã®ãã­ã°ã©ã ï¼
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/syslog.h"
+#include "syssvc/test_svc.h"
+#include "syssvc/histogram.h"
+#include "kernel_cfg.h"
+#include "perf1.h"
+
+/*
+ *  è¨æ¸¬åæ°ã¨å®è¡æéåå¸ãè¨é²ããæå¤§æé
+ */
+#define NO_MEASURE	10000U			/* è¨æ¸¬åæ° */
+#define MAX_TIME	1000U			/* å®è¡æéåå¸ãè¨é²ããæå¤§æé */
+
+/*
+ *  å®è¡æéåå¸ãè¨é²ããã¡ã¢ãªé å
+ */
+static uint_t	histarea1[MAX_TIME + 1];
+static uint_t	histarea2[MAX_TIME + 1];
+
+/*
+ *  è¨æ¸¬ã¿ã¹ã¯1ï¼é«åªå
+åº¦ï¼
+ */
+void task1(intptr_t exinf)
+{
+	uint_t	i;
+
+	slp_tsk();
+	end_measure(1);
+	for (i = 1; i < NO_MEASURE; i++) {
+		begin_measure(2);
+		slp_tsk();
+		end_measure(1);
+	}
+	begin_measure(2);
+	slp_tsk();
+}
+
+/*
+ *  è¨æ¸¬ã¿ã¹ã¯2ï¼ä¸­åªå
+åº¦ï¼
+ */
+void task2(intptr_t exinf)
+{
+	uint_t	i;
+
+	for (i = 0; i < NO_MEASURE; i++) {
+		begin_measure(1);
+		wup_tsk(TASK1);
+		end_measure(2);
+	}
+	wup_tsk(TASK1);
+}
+
+/*
+ *  ã¡ã¤ã³ã¿ã¹ã¯ï¼ä½åªå
+åº¦ï¼
+ */
+void main_task(intptr_t exinf)
+{
+	syslog_0(LOG_NOTICE, "Performance evaluation program (1)");
+	init_hist(1, MAX_TIME, histarea1);
+	init_hist(2, MAX_TIME, histarea2);
+
+	act_tsk(TASK1);
+	act_tsk(TASK2);
+
+	syslog_0(LOG_NOTICE, "Execution times of wup_tsk -> slp_tsk");
+	print_hist(1);
+
+	syslog_0(LOG_NOTICE, "Execution times of slp_tsk -> wup_tsk");
+	print_hist(2);
+	check_finish(0);
+}
Index: asp3_wo_tecs/trunk/test/perf1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/perf1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf1.cfg	(revision 302)
@@ -0,0 +1,15 @@
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: perf1.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "perf1.h"
+
+CRE_TSK(TASK1, { TA_NULL, 1, task1, TASK1_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, TASK2_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, STACK_SIZE, NULL });
Index: asp3_wo_tecs/trunk/test/perf1.h
===================================================================
--- asp3_wo_tecs/trunk/test/perf1.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf1.h	(revision 302)
@@ -0,0 +1,89 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2006-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: perf1.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (1)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+#define TASK1_PRIORITY	9		/* è¨æ¸¬ã¿ã¹ã¯1ã®åªå
+åº¦ */
+#define TASK2_PRIORITY	10		/* è¨æ¸¬ã¿ã¹ã¯2ã®åªå
+åº¦ */
+#define MAIN_PRIORITY	11		/* ã¡ã¤ã³ã¿ã¹ã¯ã®åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#ifndef STACK_SIZE
+#define	STACK_SIZE		4096		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãº */
+#endif /* STACK_SIZE */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+extern void	task1(intptr_t exinf);
+extern void	task2(intptr_t exinf);
+extern void	main_task(intptr_t exinf);
Index: asp3_wo_tecs/trunk/test/perf2.c
===================================================================
--- asp3_wo_tecs/trunk/test/perf2.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf2.c	(revision 302)
@@ -0,0 +1,131 @@
+/*
+ *  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: perf2.c 506 2016-01-12 01:46:49Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (2)
+ *
+ *  åªå
+åº¦ãã¼ã¿ã­ã¥ã¼ã«èç©ããã¦ãããã¼ã¿ã®æ°ã«ããï¼snd_pdqã®å¦çæ
+ *  éãã©ã®ããã«å¤åããããè¨æ¸¬ããããã®ãã­ã°ã©ã ï¼
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/syslog.h"
+#include "syssvc/test_svc.h"
+#include "syssvc/histogram.h"
+#include "kernel_cfg.h"
+#include "perf2.h"
+
+/*
+ *  è¨æ¸¬åæ°ã¨å®è¡æéåå¸ãè¨é²ããæå¤§æé
+ */
+#define NO_MEASURE	10000U			/* è¨æ¸¬åæ° */
+#define MAX_TIME	1000U			/* å®è¡æéåå¸ãè¨é²ããæå¤§æé */
+
+/*
+ *  å®è¡æéåå¸ãè¨é²ããã¡ã¢ãªé å
+ */
+static uint_t	histarea1[MAX_TIME + 1];
+
+/*
+ *  è¨æ¸¬ã«ã¼ãã³
+ */
+void
+perf_eval(uint_t n)
+{
+	uint_t		i;
+	intptr_t	data;
+	PRI			pri;
+
+	ini_pdq(PDQ1);
+	init_hist(1, MAX_TIME, histarea1);
+
+	for (i = 0; i < n; i++) {
+		data = i;
+		snd_pdq(PDQ1, data, 1);
+	}
+
+	for (i = 0; i < NO_MEASURE; i++) {
+		data = i;
+		begin_measure(1);
+		snd_pdq(PDQ1, data, 2);
+		end_measure(1);
+		rcv_pdq(PDQ1, &data, &pri);
+	}
+
+	syslog_1(LOG_NOTICE, "Execution times of snd_pdq"
+								" when %d data are queued.", n);
+	print_hist(1);
+}
+
+/*
+ *  ã¡ã¤ã³ã¿ã¹ã¯ï¼ä½åªå
+åº¦ï¼
+ */
+void main_task(intptr_t exinf)
+{
+	syslog_0(LOG_NOTICE, "Performance evaluation program (2)");
+
+	perf_eval(0);
+	perf_eval(10);
+	perf_eval(20);
+	perf_eval(30);
+	perf_eval(40);
+	perf_eval(50);
+	perf_eval(100);
+	perf_eval(200);
+	perf_eval(300);
+	check_finish(0);
+}
Index: asp3_wo_tecs/trunk/test/perf2.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/perf2.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf2.cfg	(revision 302)
@@ -0,0 +1,14 @@
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (2)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: perf2.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "perf2.h"
+
+CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, STACK_SIZE, NULL });
+CRE_PDQ(PDQ1, { TA_NULL, 301, 16, NULL });
Index: asp3_wo_tecs/trunk/test/perf2.h
===================================================================
--- asp3_wo_tecs/trunk/test/perf2.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf2.h	(revision 302)
@@ -0,0 +1,83 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: perf2.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (2)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+#define MAIN_PRIORITY	11		/* ã¡ã¤ã³ã¿ã¹ã¯ã®åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#ifndef STACK_SIZE
+#define	STACK_SIZE		4096		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãº */
+#endif /* STACK_SIZE */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+extern void	main_task(intptr_t exinf);
Index: asp3_wo_tecs/trunk/test/perf3.c
===================================================================
--- asp3_wo_tecs/trunk/test/perf3.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf3.c	(revision 302)
@@ -0,0 +1,158 @@
+/*
+ *  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: perf3.c 506 2016-01-12 01:46:49Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (3)
+ *
+ *  å¾
+ã¡è§£é¤ããã¿ã¹ã¯ã®æ°ã«ããï¼set_flgã®å¦çæéãã©ã®ããã«å¤åãã
+ *  ããè¨æ¸¬ããããã®ãã­ã°ã©ã ï¼
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/syslog.h"
+#include "syssvc/test_svc.h"
+#include "syssvc/histogram.h"
+#include "kernel_cfg.h"
+#include "perf3.h"
+
+/*
+ *  è¨æ¸¬åæ°ã¨å®è¡æéåå¸ãè¨é²ããæå¤§æé
+ */
+#define NO_MEASURE	10000U			/* è¨æ¸¬åæ° */
+#define MAX_TIME	1000U			/* å®è¡æéåå¸ãè¨é²ããæå¤§æé */
+
+/*
+ *  å®è¡æéåå¸ãè¨é²ããã¡ã¢ãªé å
+ */
+static uint_t	histarea1[MAX_TIME + 1];
+
+/*
+ *  è¨æ¸¬ã¿ã¹ã¯ã®ãªã¹ã
+ */
+static ID task_list[20] = {
+	TASK1, TASK2, TASK3, TASK4, TASK5,
+	TASK6, TASK7, TASK8, TASK9, TASK10,
+	TASK11, TASK12, TASK13, TASK14, TASK15,
+	TASK16, TASK17, TASK18, TASK19, TASK20
+};
+
+/*
+ *  è¨æ¸¬ã¿ã¹ã¯ï¼ä¸­åªå
+åº¦ï¼
+ */
+void task(intptr_t exinf)
+{
+	FLGPTN	flgptn;
+
+	wai_flg(FLG1, 0x01U, TWF_ORW, &flgptn);
+}
+
+/*
+ *  è¨æ¸¬ã«ã¼ãã³
+ */
+void
+perf_eval(uint_t n)
+{
+	uint_t		i, j;
+
+	init_hist(1, MAX_TIME, histarea1);
+
+	for (i = 0; i < NO_MEASURE; i++) {
+		ini_flg(FLG1);
+		for (j = 0; j < n; j++) {
+			act_tsk(task_list[j]);
+		}
+		chg_pri(TSK_SELF, MAIN_PRIORITY_LOW);
+		/* ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã«å
+¥ãã®ãå¾
+ã¤ */
+		chg_pri(TSK_SELF, TPRI_INI);
+
+		begin_measure(1);
+		set_flg(FLG1, 0x01U);
+		end_measure(1);
+
+		chg_pri(TSK_SELF, MAIN_PRIORITY_LOW);
+		/* ã¿ã¹ã¯ãçµäºããã®ãå¾
+ã¤ */
+		chg_pri(TSK_SELF, TPRI_INI);
+	}
+
+	syslog_1(LOG_NOTICE, "Execution times of set_flg"
+							" when %d tasks are released from waiting.", n);
+	print_hist(1);
+}
+
+/*
+ *  ã¡ã¤ã³ã¿ã¹ã¯ï¼é«åªå
+åº¦ï¼
+ */
+void main_task(intptr_t exinf)
+{
+	syslog_0(LOG_NOTICE, "Performance evaluation program (3)");
+
+	perf_eval(0);
+	perf_eval(1);
+	perf_eval(2);
+	perf_eval(3);
+	perf_eval(4);
+	perf_eval(5);
+	perf_eval(10);
+	perf_eval(20);
+	check_finish(0);
+}
Index: asp3_wo_tecs/trunk/test/perf3.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/perf3.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf3.cfg	(revision 302)
@@ -0,0 +1,34 @@
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (3)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: perf3.cfg 326 2015-06-21 06:06:45Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "perf3.h"
+
+CRE_TSK(TASK1, { TA_NULL, 1, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK4, { TA_NULL, 4, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK5, { TA_NULL, 5, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK6, { TA_NULL, 6, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK7, { TA_NULL, 7, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK8, { TA_NULL, 8, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK9, { TA_NULL, 9, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK10, { TA_NULL, 10, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK11, { TA_NULL, 11, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK12, { TA_NULL, 12, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK13, { TA_NULL, 13, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK14, { TA_NULL, 14, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK15, { TA_NULL, 15, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK16, { TA_NULL, 16, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK17, { TA_NULL, 17, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK18, { TA_NULL, 18, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK19, { TA_NULL, 19, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK20, { TA_NULL, 20, task, TASK_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, STACK_SIZE, NULL });
+CRE_FLG(FLG1, { TA_WMUL, 0x00U });
Index: asp3_wo_tecs/trunk/test/perf3.h
===================================================================
--- asp3_wo_tecs/trunk/test/perf3.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf3.h	(revision 302)
@@ -0,0 +1,88 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: perf3.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (3)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+#define TASK_PRIORITY		10		/* ã¿ã¹ã¯ã®åªå
+åº¦ */
+#define MAIN_PRIORITY		9		/* ã¡ã¤ã³ã¿ã¹ã¯ã®åªå
+åº¦ */
+#define MAIN_PRIORITY_LOW	11		/* ã¡ã¤ã³ã¿ã¹ã¯ã®ä½åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#ifndef STACK_SIZE
+#define	STACK_SIZE		4096		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãº */
+#endif /* STACK_SIZE */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+extern void	task(intptr_t exinf);
+extern void	main_task(intptr_t exinf);
Index: asp3_wo_tecs/trunk/test/perf4.c
===================================================================
--- asp3_wo_tecs/trunk/test/perf4.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf4.c	(revision 302)
@@ -0,0 +1,224 @@
+/*
+ *  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: perf4.c 506 2016-01-12 01:46:49Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (4)
+ *
+ *  act_tskã®å¦çæéã¨ã¿ã¹ã¯åæãæéãè¨æ¸¬ããããã®ãã­ã°ã©ã ï¼ä»¥ä¸
+ *  ã®3ã¤ã®æéãæ¸¬å®ããï¼
+ *
+ *  (1) ã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãï¼ã¿ã¹ã¯åæããèµ·ãããªã
+ *      act_tskã®å¦çæéï¼èªã¿ã¹ã¯ãããåªå
+åº¦ã®ä½ãã¿ã¹ã¯ã«å¯¾ãã¦
+ *      act_tskãçºè¡ãï¼ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã«é·ç§»ãããå¦çã®æ
+ *      éï¼
+ *
+ *  (2) ã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãï¼ã¿ã¹ã¯åæããèµ·ããact_tskã®å¦
+ *      çæéï¼èªã¿ã¹ã¯ãããåªå
+åº¦ã®é«ãã¿ã¹ã¯ã«å¯¾ãã¦act_tskãçºè¡ãï¼
+ *      ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã«é·ç§»ããï¼ã¿ã¹ã¯åæããèµ·ããã¦ï¼
+ *      é«ãåªå
+åº¦ã®ã¿ã¹ã¯ã®å®è¡ãå§ã¾ãã¾ã§ã®æéï¼
+ *
+ *  (3) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãï¼ã¿ã¹ã¯åæããèµ·ããact_tsk
+ *      ã®å¦çæéï¼å¨æãã³ãã©ããï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãããé«ãåªå
+åº¦
+ *      ã®ã¿ã¹ã¯ã«å¯¾ãã¦act_tskãçºè¡ãï¼ä¼æ­¢ç¶æ
+ããå®è¡ã§ããç¶æ
+ã«é·
+ *      ç§»ããããã¨ã«å¨æãã³ãã©ãããªã¿ã¼ã³ãï¼ã¿ã¹ã¯åæããèµ·ãã
+ *      ã¦ï¼é«ãåªå
+åº¦ã®ã¿ã¹ã¯ã®å®è¡ãå§ã¾ãã¾ã§ã®æéï¼
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/syslog.h"
+#include "syssvc/test_svc.h"
+#include "syssvc/histogram.h"
+#include "kernel_cfg.h"
+#include "perf4.h"
+
+/*
+ *  è¨æ¸¬åæ°ã¨å®è¡æéåå¸ãè¨é²ããæå¤§æé
+ */
+#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];
+
+/*
+ *  è¨æ¸¬ã¿ã¹ã¯1ï¼é«åªå
+åº¦ï¼
+ */
+void task1(intptr_t exinf)
+{
+	end_measure(2);
+	ext_tsk();
+}
+
+/*
+ *  è¨æ¸¬ã¿ã¹ã¯2ã¨ã¡ã¤ã³ã¿ã¹ã¯ã®å
+±æå¤æ°
+ */
+volatile uint_t		task2_count;
+
+/*
+ *  è¨æ¸¬ã¿ã¹ã¯2ï¼é«åªå
+åº¦ï¼
+ */
+void task2(intptr_t exinf)
+{
+	end_measure(3);
+	task2_count++;
+	ext_tsk();
+}
+
+/*
+ *  è¨æ¸¬ã¿ã¹ã¯3ï¼ä½åªå
+åº¦ï¼
+ */
+void task3(intptr_t exinf)
+{
+	ext_tsk();
+}
+
+/*
+ *  è¨æ¸¬ã¿ã¹ã¯4ï¼æä½åªå
+åº¦ï¼
+ */
+void task4(intptr_t exinf)
+{
+	while (true) {
+		wup_tsk(MAIN_TASK);
+	}
+}
+
+/*
+ *  å¨æãã³ãã©
+ */
+void cyclic_handler(intptr_t exinf)
+{
+	begin_measure(3);
+	act_tsk(TASK2);
+}
+
+/*
+ *  ã¡ã¤ã³ã¿ã¹ã¯ï¼ä¸­åªå
+åº¦ï¼
+ */
+void main_task(intptr_t exinf)
+{
+	uint_t	i;
+
+	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);
+
+	/*
+	 *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãï¼ã¿ã¹ã¯åæããèµ·ãããªã
+	 *  act_tskã®å¦çæéã®æ¸¬å®
+	 */
+	for (i = 0; i < NO_MEASURE; i++) {
+		begin_measure(1);
+		act_tsk(TASK3);
+		end_measure(1);
+		slp_tsk();
+	}
+
+	/*
+	 *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãï¼ã¿ã¹ã¯åæããèµ·ããact_tskã®å¦
+	 *  çæéã®æ¸¬å®
+	 */
+	for (i = 0; i < NO_MEASURE; i++) {
+		begin_measure(2);
+		act_tsk(TASK1);
+	}
+
+	/*
+	 *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºãï¼ã¿ã¹ã¯åæããèµ·ããact_tskã®
+	 *  å¦çæéã®æ¸¬å®ï¼æ¸¬å®åæ°ã¯10åã®1ï¼
+	 */
+	task2_count = 0;
+	sta_cyc(CYC1);
+	while (task2_count < NO_MEASURE / 10) ;
+	stp_cyc(CYC1);
+
+	/*
+	 *  æ¸¬å®çµæã®åºå
+	 */
+	syslog_0(LOG_NOTICE,
+		"Execution times of act_tsk from task context without task switch");
+	print_hist(1);
+
+	syslog_0(LOG_NOTICE,
+		"Execution times of act_tsk from task context with task switch");
+	print_hist(2);
+
+	syslog_0(LOG_NOTICE,
+		"Execution times of act_tsk from non-task context with task switch");
+	print_hist(3);
+	check_finish(0);
+}
Index: asp3_wo_tecs/trunk/test/perf4.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/perf4.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf4.cfg	(revision 302)
@@ -0,0 +1,19 @@
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "perf4.h"
+
+CRE_TSK(TASK1, { TA_NULL, 1, task1, TASK1_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, TASK2_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, TASK3_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK4, { TA_ACT, 4, task4, TASK4_PRIORITY, STACK_SIZE, NULL });
+CRE_CYC(CYC1, { TA_NULL, { TNFY_HANDLER, 0, cyclic_handler },
+											CYC1_CYCLE, CYC1_CYCLE });
+CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, STACK_SIZE, NULL });
Index: asp3_wo_tecs/trunk/test/perf4.h
===================================================================
--- asp3_wo_tecs/trunk/test/perf4.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf4.h	(revision 302)
@@ -0,0 +1,100 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2006-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: perf4.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (4)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+#define TASK1_PRIORITY	9		/* è¨æ¸¬ã¿ã¹ã¯1ã®åªå
+åº¦ */
+#define TASK2_PRIORITY	9		/* è¨æ¸¬ã¿ã¹ã¯2ã®åªå
+åº¦ */
+#define TASK3_PRIORITY	11		/* è¨æ¸¬ã¿ã¹ã¯3ã®åªå
+åº¦ */
+#define TASK4_PRIORITY	12		/* è¨æ¸¬ã¿ã¹ã¯4ã®åªå
+åº¦ */
+#define MAIN_PRIORITY	10		/* ã¡ã¤ã³ã¿ã¹ã¯ã®åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#ifndef STACK_SIZE
+#define	STACK_SIZE		4096		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãº */
+#endif /* STACK_SIZE */
+
+#ifndef CYC1_CYCLE
+#define CYC1_CYCLE		100U		/* å¨æãã³ãã©ã®å¨æï¼Î¼ç§ï¼*/
+#endif /* CYC1_CYCLE */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+extern void	task1(intptr_t exinf);
+extern void	task2(intptr_t exinf);
+extern void	task3(intptr_t exinf);
+extern void	task4(intptr_t exinf);
+extern void	cyclic_handler(intptr_t exinf);
+extern void	main_task(intptr_t exinf);
Index: asp3_wo_tecs/trunk/test/perf5.c
===================================================================
--- asp3_wo_tecs/trunk/test/perf5.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf5.c	(revision 302)
@@ -0,0 +1,219 @@
+/*
+ *  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: perf5.c 506 2016-01-12 01:46:49Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (5)
+ *
+ *  ã¿ã¤ã ã¤ãã³ãå¦çã«ãããæéãè¨æ¸¬ãããã­ã°ã©ã ï¼
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/syslog.h"
+#include "syssvc/test_svc.h"
+#include "syssvc/histogram.h"
+#include "kernel_cfg.h"
+#include "perf5.h"
+
+/*
+ *  è¨æ¸¬åæ°ã¨å®è¡æéåå¸ãè¨é²ããæå¤§æé
+ */
+#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];
+
+/*
+ *  ã¢ã©ã¼ã ãã³ãã©
+ */
+void alarm_handler(intptr_t exinf)
+{
+	/*
+	 *  ã¢ã©ã¼ã ãã³ãã©ã¯å®è¡ãããªãã¯ã
+	 */
+	syslog_1(LOG_NOTICE, "alarm handler %d executed.", exinf);
+}
+
+/*
+ *  è¨æ¸¬ç¨ã®ã¢ã©ã¼ã ãã³ãã©ã®ãªã¹ã
+ */
+static ID alarm1_list[30] = {
+	ALM1, ALM2, ALM3, ALM4, ALM5, ALM6, ALM7, ALM8, ALM9, ALM10,
+	ALM11, ALM12, ALM13, ALM14, ALM15, ALM16, ALM17, ALM18, ALM19, ALM20,
+	ALM21, ALM22, ALM23, ALM24, ALM25, ALM26, ALM27, ALM28, ALM29, ALM30
+};
+
+static ID alarm2_list[30] = {
+	ALM31, ALM32, ALM33, ALM34, ALM35, ALM36, ALM37, ALM38, ALM39, ALM40,
+	ALM41, ALM42, ALM43, ALM44, ALM45, ALM46, ALM47, ALM48, ALM49, ALM50,
+	ALM51, ALM52, ALM53, ALM54, ALM55, ALM56, ALM57, ALM58, ALM59, ALM60
+};
+
+static ID alarm3_list[30] = {
+	ALM61, ALM62, ALM63, ALM64, ALM65, ALM66, ALM67, ALM68, ALM69, ALM70,
+	ALM71, ALM72, ALM73, ALM74, ALM75, ALM76, ALM77, ALM78, ALM79, ALM80,
+	ALM81, ALM82, ALM83, ALM84, ALM85, ALM86, ALM87, ALM88, ALM89, ALM90
+};
+
+/*
+ *  ã¡ã¤ã³ã¿ã¹ã¯
+ */
+void main_task(intptr_t exinf)
+{
+	uint_t	i, j;
+
+	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);
+
+	/*
+	 *  ç¹°ãè¿ãè¨æ¸¬
+	 */
+	for (j = 0; j < NO_MEASURE / 10; j++) {
+		/*
+		 *  ã¢ã©ã¼ã ãã³ãã©0ç­ãæéã§åä½éå§
+		 *
+		 *  æ§è½è©ä¾¡ä¸­ã«é«åè§£è½ã¿ã¤ããåè¨­å®ãããã®ãé¿ããããï¼
+		 */
+		sta_alm(ALM0, ALM_RELTIM0);
+
+		/*
+		 *  30åã®ã¢ã©ã¼ã ãã³ãã©ãé·ãæéã§åä½éå§
+		 */
+		begin_measure(1);
+		for (i = 0; i < 30; i++) {
+			sta_alm(alarm1_list[i], ALM_RELTIM1);
+		}
+		end_measure(1);
+
+		/*
+		 *  30åã®ã¢ã©ã¼ã ãã³ãã©ãä¸­éã®æéã§åä½éå§
+		 */
+		begin_measure(2);
+		for (i = 0; i < 30; i++) {
+			sta_alm(alarm2_list[i], ALM_RELTIM2);
+		}
+		end_measure(2);
+
+		/*
+		 *  30åã®ã¢ã©ã¼ã ãã³ãã©ãç­ãæéã§åä½éå§
+		 */
+		begin_measure(3);
+		for (i = 0; i < 30; i++) {
+			sta_alm(alarm3_list[i], ALM_RELTIM3);
+		}
+		end_measure(3);
+
+		/*
+		 *  ç­ãæéã§åä½éå§ãã30åã®ã¢ã©ã¼ã ãã³ãã©ãåä½åæ­¢
+		 */
+		begin_measure(6);
+		for (i = 0; i < 30; i++) {
+			stp_alm(alarm3_list[i]);
+		}
+		end_measure(6);
+
+		/*
+		 *  ä¸­éã®æéã§åä½éå§ãã30åã®ã¢ã©ã¼ã ãã³ãã©ãåä½åæ­¢
+		 */
+		begin_measure(5);
+		for (i = 0; i < 30; i++) {
+			stp_alm(alarm2_list[29 - i]);		/* éé ã§åä½åæ­¢ */
+		}
+		end_measure(5);
+
+		/*
+		 *  é·ãæéã§åä½éå§ãã30åã®ã¢ã©ã¼ã ãã³ãã©ãåä½åæ­¢
+		 */
+		begin_measure(4);
+		for (i = 0; i < 30; i++) {
+			stp_alm(alarm1_list[29 - i]);		/* éé ã§åä½åæ­¢ */
+		}
+		end_measure(4);
+	}
+
+	/*
+	 *  æ¸¬å®çµæã®åºå
+	 */
+	syslog_0(LOG_NOTICE, "Execution times of 30 short sta_alm");
+	print_hist(1);
+
+	syslog_0(LOG_NOTICE, "Execution times of 30 medium sta_alm");
+	print_hist(2);
+
+	syslog_0(LOG_NOTICE, "Execution times of 30 long sta_alm");
+	print_hist(3);
+
+	syslog_0(LOG_NOTICE, "Execution times of 30 short stp_alm");
+	print_hist(4);
+
+	syslog_0(LOG_NOTICE, "Execution times of 30 medium stp_alm");
+	print_hist(5);
+
+	syslog_0(LOG_NOTICE, "Execution times of 30 long stp_alm");
+	print_hist(6);
+	check_finish(0);
+}
Index: asp3_wo_tecs/trunk/test/perf5.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/perf5.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf5.cfg	(revision 302)
@@ -0,0 +1,104 @@
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (5)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $Id: perf5.cfg 449 2015-08-14 01:26:43Z ertl-hiro $
+ */
+INCLUDE("target_timer.cfg");
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
+INCLUDE("syssvc/serial.cfg");
+
+#include "perf5.h"
+
+CRE_ALM(ALM0, { TA_NULL, { TNFY_HANDLER, 0, alarm_handler }});
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm_handler }});
+CRE_ALM(ALM2, { TA_NULL, { TNFY_HANDLER, 2, alarm_handler }});
+CRE_ALM(ALM3, { TA_NULL, { TNFY_HANDLER, 3, alarm_handler }});
+CRE_ALM(ALM4, { TA_NULL, { TNFY_HANDLER, 4, alarm_handler }});
+CRE_ALM(ALM5, { TA_NULL, { TNFY_HANDLER, 5, alarm_handler }});
+CRE_ALM(ALM6, { TA_NULL, { TNFY_HANDLER, 6, alarm_handler }});
+CRE_ALM(ALM7, { TA_NULL, { TNFY_HANDLER, 7, alarm_handler }});
+CRE_ALM(ALM8, { TA_NULL, { TNFY_HANDLER, 8, alarm_handler }});
+CRE_ALM(ALM9, { TA_NULL, { TNFY_HANDLER, 9, alarm_handler }});
+CRE_ALM(ALM10, { TA_NULL, { TNFY_HANDLER, 10, alarm_handler }});
+CRE_ALM(ALM11, { TA_NULL, { TNFY_HANDLER, 11, alarm_handler }});
+CRE_ALM(ALM12, { TA_NULL, { TNFY_HANDLER, 12, alarm_handler }});
+CRE_ALM(ALM13, { TA_NULL, { TNFY_HANDLER, 13, alarm_handler }});
+CRE_ALM(ALM14, { TA_NULL, { TNFY_HANDLER, 14, alarm_handler }});
+CRE_ALM(ALM15, { TA_NULL, { TNFY_HANDLER, 15, alarm_handler }});
+CRE_ALM(ALM16, { TA_NULL, { TNFY_HANDLER, 16, alarm_handler }});
+CRE_ALM(ALM17, { TA_NULL, { TNFY_HANDLER, 17, alarm_handler }});
+CRE_ALM(ALM18, { TA_NULL, { TNFY_HANDLER, 18, alarm_handler }});
+CRE_ALM(ALM19, { TA_NULL, { TNFY_HANDLER, 19, alarm_handler }});
+CRE_ALM(ALM20, { TA_NULL, { TNFY_HANDLER, 20, alarm_handler }});
+CRE_ALM(ALM21, { TA_NULL, { TNFY_HANDLER, 21, alarm_handler }});
+CRE_ALM(ALM22, { TA_NULL, { TNFY_HANDLER, 22, alarm_handler }});
+CRE_ALM(ALM23, { TA_NULL, { TNFY_HANDLER, 23, alarm_handler }});
+CRE_ALM(ALM24, { TA_NULL, { TNFY_HANDLER, 24, alarm_handler }});
+CRE_ALM(ALM25, { TA_NULL, { TNFY_HANDLER, 25, alarm_handler }});
+CRE_ALM(ALM26, { TA_NULL, { TNFY_HANDLER, 26, alarm_handler }});
+CRE_ALM(ALM27, { TA_NULL, { TNFY_HANDLER, 27, alarm_handler }});
+CRE_ALM(ALM28, { TA_NULL, { TNFY_HANDLER, 28, alarm_handler }});
+CRE_ALM(ALM29, { TA_NULL, { TNFY_HANDLER, 29, alarm_handler }});
+CRE_ALM(ALM30, { TA_NULL, { TNFY_HANDLER, 30, alarm_handler }});
+CRE_ALM(ALM31, { TA_NULL, { TNFY_HANDLER, 31, alarm_handler }});
+CRE_ALM(ALM32, { TA_NULL, { TNFY_HANDLER, 32, alarm_handler }});
+CRE_ALM(ALM33, { TA_NULL, { TNFY_HANDLER, 33, alarm_handler }});
+CRE_ALM(ALM34, { TA_NULL, { TNFY_HANDLER, 34, alarm_handler }});
+CRE_ALM(ALM35, { TA_NULL, { TNFY_HANDLER, 35, alarm_handler }});
+CRE_ALM(ALM36, { TA_NULL, { TNFY_HANDLER, 36, alarm_handler }});
+CRE_ALM(ALM37, { TA_NULL, { TNFY_HANDLER, 37, alarm_handler }});
+CRE_ALM(ALM38, { TA_NULL, { TNFY_HANDLER, 38, alarm_handler }});
+CRE_ALM(ALM39, { TA_NULL, { TNFY_HANDLER, 39, alarm_handler }});
+CRE_ALM(ALM40, { TA_NULL, { TNFY_HANDLER, 40, alarm_handler }});
+CRE_ALM(ALM41, { TA_NULL, { TNFY_HANDLER, 41, alarm_handler }});
+CRE_ALM(ALM42, { TA_NULL, { TNFY_HANDLER, 42, alarm_handler }});
+CRE_ALM(ALM43, { TA_NULL, { TNFY_HANDLER, 43, alarm_handler }});
+CRE_ALM(ALM44, { TA_NULL, { TNFY_HANDLER, 44, alarm_handler }});
+CRE_ALM(ALM45, { TA_NULL, { TNFY_HANDLER, 45, alarm_handler }});
+CRE_ALM(ALM46, { TA_NULL, { TNFY_HANDLER, 46, alarm_handler }});
+CRE_ALM(ALM47, { TA_NULL, { TNFY_HANDLER, 47, alarm_handler }});
+CRE_ALM(ALM48, { TA_NULL, { TNFY_HANDLER, 48, alarm_handler }});
+CRE_ALM(ALM49, { TA_NULL, { TNFY_HANDLER, 49, alarm_handler }});
+CRE_ALM(ALM50, { TA_NULL, { TNFY_HANDLER, 50, alarm_handler }});
+CRE_ALM(ALM51, { TA_NULL, { TNFY_HANDLER, 51, alarm_handler }});
+CRE_ALM(ALM52, { TA_NULL, { TNFY_HANDLER, 52, alarm_handler }});
+CRE_ALM(ALM53, { TA_NULL, { TNFY_HANDLER, 53, alarm_handler }});
+CRE_ALM(ALM54, { TA_NULL, { TNFY_HANDLER, 54, alarm_handler }});
+CRE_ALM(ALM55, { TA_NULL, { TNFY_HANDLER, 55, alarm_handler }});
+CRE_ALM(ALM56, { TA_NULL, { TNFY_HANDLER, 56, alarm_handler }});
+CRE_ALM(ALM57, { TA_NULL, { TNFY_HANDLER, 57, alarm_handler }});
+CRE_ALM(ALM58, { TA_NULL, { TNFY_HANDLER, 58, alarm_handler }});
+CRE_ALM(ALM59, { TA_NULL, { TNFY_HANDLER, 59, alarm_handler }});
+CRE_ALM(ALM60, { TA_NULL, { TNFY_HANDLER, 60, alarm_handler }});
+CRE_ALM(ALM61, { TA_NULL, { TNFY_HANDLER, 61, alarm_handler }});
+CRE_ALM(ALM62, { TA_NULL, { TNFY_HANDLER, 62, alarm_handler }});
+CRE_ALM(ALM63, { TA_NULL, { TNFY_HANDLER, 63, alarm_handler }});
+CRE_ALM(ALM64, { TA_NULL, { TNFY_HANDLER, 64, alarm_handler }});
+CRE_ALM(ALM65, { TA_NULL, { TNFY_HANDLER, 65, alarm_handler }});
+CRE_ALM(ALM66, { TA_NULL, { TNFY_HANDLER, 66, alarm_handler }});
+CRE_ALM(ALM67, { TA_NULL, { TNFY_HANDLER, 67, alarm_handler }});
+CRE_ALM(ALM68, { TA_NULL, { TNFY_HANDLER, 68, alarm_handler }});
+CRE_ALM(ALM69, { TA_NULL, { TNFY_HANDLER, 69, alarm_handler }});
+CRE_ALM(ALM70, { TA_NULL, { TNFY_HANDLER, 70, alarm_handler }});
+CRE_ALM(ALM71, { TA_NULL, { TNFY_HANDLER, 71, alarm_handler }});
+CRE_ALM(ALM72, { TA_NULL, { TNFY_HANDLER, 72, alarm_handler }});
+CRE_ALM(ALM73, { TA_NULL, { TNFY_HANDLER, 73, alarm_handler }});
+CRE_ALM(ALM74, { TA_NULL, { TNFY_HANDLER, 74, alarm_handler }});
+CRE_ALM(ALM75, { TA_NULL, { TNFY_HANDLER, 75, alarm_handler }});
+CRE_ALM(ALM76, { TA_NULL, { TNFY_HANDLER, 76, alarm_handler }});
+CRE_ALM(ALM77, { TA_NULL, { TNFY_HANDLER, 77, alarm_handler }});
+CRE_ALM(ALM78, { TA_NULL, { TNFY_HANDLER, 78, alarm_handler }});
+CRE_ALM(ALM79, { TA_NULL, { TNFY_HANDLER, 79, alarm_handler }});
+CRE_ALM(ALM80, { TA_NULL, { TNFY_HANDLER, 80, alarm_handler }});
+CRE_ALM(ALM81, { TA_NULL, { TNFY_HANDLER, 81, alarm_handler }});
+CRE_ALM(ALM82, { TA_NULL, { TNFY_HANDLER, 82, alarm_handler }});
+CRE_ALM(ALM83, { TA_NULL, { TNFY_HANDLER, 83, alarm_handler }});
+CRE_ALM(ALM84, { TA_NULL, { TNFY_HANDLER, 84, alarm_handler }});
+CRE_ALM(ALM85, { TA_NULL, { TNFY_HANDLER, 85, alarm_handler }});
+CRE_ALM(ALM86, { TA_NULL, { TNFY_HANDLER, 86, alarm_handler }});
+CRE_ALM(ALM87, { TA_NULL, { TNFY_HANDLER, 87, alarm_handler }});
+CRE_ALM(ALM88, { TA_NULL, { TNFY_HANDLER, 88, alarm_handler }});
+CRE_ALM(ALM89, { TA_NULL, { TNFY_HANDLER, 89, alarm_handler }});
+CRE_ALM(ALM90, { TA_NULL, { TNFY_HANDLER, 90, alarm_handler }});
+CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, STACK_SIZE, NULL });
Index: asp3_wo_tecs/trunk/test/perf5.h
===================================================================
--- asp3_wo_tecs/trunk/test/perf5.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/perf5.h	(revision 302)
@@ -0,0 +1,100 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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: perf5.h 450 2015-08-14 13:26:57Z ertl-hiro $
+ */
+
+/*
+ *		ã«ã¼ãã«æ§è½è©ä¾¡ãã­ã°ã©ã (5)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+#define MAIN_PRIORITY	10		/* ã¡ã¤ã³ã¿ã¹ã¯ã®åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#ifndef STACK_SIZE
+#define	STACK_SIZE		4096		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãº */
+#endif /* STACK_SIZE */
+
+#ifndef ALM_RELTIM1
+#define ALM_RELTIM1		4000000U	/* ã¢ã©ã¼ã ãã³ãã©ã«ä»æããç¸å¯¾æé1 */
+#endif /* ALM_RELTIM1 */
+
+#ifndef ALM_RELTIM2
+#define ALM_RELTIM2		3000000U	/* ã¢ã©ã¼ã ãã³ãã©ã«ä»æããç¸å¯¾æé2 */
+#endif /* ALM_RELTIM2 */
+
+#ifndef ALM_RELTIM3
+#define ALM_RELTIM3		2000000U	/* ã¢ã©ã¼ã ãã³ãã©ã«ä»æããç¸å¯¾æé3 */
+#endif /* ALM_RELTIM3 */
+
+#ifndef ALM_RELTIM0
+#define ALM_RELTIM0		1000000U	/* ã¢ã©ã¼ã ãã³ãã©ã«ä»æããç¸å¯¾æé0 */
+#endif /* ALM_RELTIM0 */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+extern void	alarm_handler(intptr_t exinf);
+extern void	main_task(intptr_t exinf);
Index: asp3_wo_tecs/trunk/test/test_cpuexc.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_cpuexc.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_cpuexc.cfg	(revision 302)
@@ -0,0 +1,16 @@
+/*
+ *		CPUä¾å¤å¦çã®ãã¹ã(1)ã(10)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_cpuexc.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_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
+DEF_EXC(CPUEXC1, { TA_NULL, cpuexc_handler });
Index: asp3_wo_tecs/trunk/test/test_cpuexc.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_cpuexc.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_cpuexc.h	(revision 302)
@@ -0,0 +1,92 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: test_cpuexc.h 404 2015-08-02 21:56:21Z ertl-hiro $
+ */
+
+/* 
+ *		CPUä¾å¤å¦çã®ãã¹ã(1)ã(10)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+#define HIGH_PRIORITY	9		/* é«åªå
+åº¦ */
+#define MID_PRIORITY	10		/* ä¸­åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#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	alarm1_handler(intptr_t exinf);
+extern void	cpuexc_handler(void *p_excinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_cpuexc1.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_cpuexc1.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_cpuexc1.c	(revision 302)
@@ -0,0 +1,237 @@
+/*
+ *  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: test_cpuexc1.c 346 2015-07-18 02:12:08Z ertl-hiro $
+ */
+
+/* 
+ *		CPUä¾å¤å¦çã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯ç¶æ
+ã§çºçããCPUä¾å¤ã«ãããã·ã¹ã
+ *  ã ç¶æ
+ã®ãã¹ãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ï¼ãã£ã¹ãããç¦æ­¢ç¶æ
+
+ *  ã§ãã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *  ããããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯ç¶æ
+ã§çºçããCPUä¾å¤ã«ã
+ *  ãã¦ï¼
+ *
+ *	(A) CPUä¾å¤ãã³ãã©å®è¡éå§æã«CPUã­ãã¯ãã©ã°ãå¤åããªããã¨
+ *		ï¼å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§çºçããCPUä¾å¤ã§ã¯ï¼ã·ã¹ãã ç¶æ
+ãæ­£ããèª­
+ *		ããããã¨ãä¿è¨¼ãããªãããï¼ãã¹ãã§ããªãï¼
+ *	(B) CPUä¾å¤ãã³ãã©å®è¡éå§æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤åããªããã¨
+ *		ï¼å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§çºçããCPUä¾å¤ã§ã¯ï¼ã·ã¹ãã ç¶æ
+ãæ­£ããèª­
+ *		ããããã¨ãä¿è¨¼ãããªãããï¼ãã¹ãã§ããªãï¼
+ *	(C) CPUä¾å¤ãã³ãã©å®è¡éå§æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *		ï¼å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§çºçããCPUä¾å¤ã§ã¯ï¼ã·ã¹ãã ç¶æ
+ãæ­£ããèª­
+ *		ããããã¨ãä¿è¨¼ãããªãããï¼ãã¹ãã§ããªãï¼
+ *	(D) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«CPUã­ãã¯ãã©ã°ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(E) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(F) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(G) xsns_dpnãtrueãè¿ããã¨
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	CPUEXC: CPUä¾å¤ãã³ãã©
+ *	ALM1: ã¢ã©ã¼ã ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1 ==
+ *	1:	state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *		dis_dsp()
+ *	2:	state(false, false, true, true, false)
+ *		ipm(TIPM_ENAALL)
+ *		sta_alm(ALM1, 10000U)
+ *		DO(while(!alm1_flag))
+ *	== ALM1 ==
+ *	3:	state(true, false, true, true, false)
+ *		DO(SIL_LOC_INT())
+ *		DO(RAISE_CPU_EXCEPTION)
+ *	== CPUEXC ==
+ *	4:	assert(xsns_dpn(p_excinf) == true)					... (G)
+ *	5:	HOOK(HOOK_POINT(%d))
+ *				... CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããªãå ´åã¯ããã§çµäº
+ *		RETURN
+ *	== ALM1ï¼ç¶ãï¼==
+ *	6:	DO(SIL_UNL_INT())
+ *	7:	state(true, false, true, true, false)				... (D)(F)
+ *		DO(alm1_flag = true)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	8:	state(false, false, true, true, false)				... (E)
+ *		ipm(TIPM_ENAALL)
+ *	9:	END
+ */
+
+#include <sil.h>
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_cpuexc.h"
+
+volatile bool_t	alm1_flag = false;
+
+void
+task2(intptr_t exinf)
+{
+	check_point(0);
+}
+
+#ifdef PREPARE_RETURN_CPUEXC
+#define HOOK_POINT(count)	do {							\
+								PREPARE_RETURN_CPUEXC;		\
+								check_point(count);			\
+							} while (false)
+#else /* PREPARE_RETURN_CPUEXC */
+#define HOOK_POINT(count)	check_finish(count)
+#endif /* PREPARE_RETURN_CPUEXC */
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	SIL_PRE_LOC;
+
+	check_point(3);
+	check_state(true, false, true, true, false);
+
+	SIL_LOC_INT();
+
+	RAISE_CPU_EXCEPTION;
+
+	check_point(6);
+	SIL_UNL_INT();
+
+	check_point(7);
+	check_state(true, false, true, true, false);
+
+	alm1_flag = true;
+
+	return;
+
+	check_point(0);
+}
+
+void
+cpuexc_handler(void *p_excinf)
+{
+
+	check_point(4);
+	check_assert(xsns_dpn(p_excinf) == true);
+
+	HOOK_POINT(5);
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	check_state(false, false, true, true, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	while(!alm1_flag);
+
+	check_point(8);
+	check_state(false, false, true, true, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_finish(9);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_cpuexc10.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_cpuexc10.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_cpuexc10.c	(revision 302)
@@ -0,0 +1,221 @@
+/*
+ *  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: test_cpuexc10.c 346 2015-07-18 02:12:08Z ertl-hiro $
+ */
+
+/* 
+ *		CPUä¾å¤å¦çã®ãã¹ã(10)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶æ
+ï¼å²è¾¼ã¿åª
+ *  å
+åº¦ãã¹ã¯ï¼TMIN_INTPRI-1ï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§çºçããCPUä¾å¤ã«
+ *  ãããã·ã¹ãã ç¶æ
+ã®ãã¹ãï¼
+ *
+ *  ãã®ãã¹ãã¯ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãTMIN_INTPRI-1ã«è¨­å®ã§ããå ´åã®ã¿
+ *  å®æ½ããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *  ããããï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶æ
+ï¼
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼TMIN_INTPRI-1ï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§çºçãã
+ *  CPUä¾å¤ã«ããã¦ï¼
+ *
+ *	(A) CPUä¾å¤ãã³ãã©å®è¡éå§æã«CPUã­ãã¯ãã©ã°ãå¤åããªããã¨
+ *	(B) CPUä¾å¤ãã³ãã©å®è¡éå§æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ä¸­ã§å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãèª­ããªãããï¼ãã¹ãã§
+ *		ãããªãï¼
+ *	(C) CPUä¾å¤ãã³ãã©å®è¡éå§æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *	(D) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«CPUã­ãã¯ãã©ã°ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(E) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(F) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(G) xsns_dpnãtrueãè¿ããã¨
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	CPUEXC: CPUä¾å¤ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1 ==
+ *	1:	state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *		check_chg_ipm(TMIN_INTPRI-1)
+ *	2:	state(false, false, false, true, false)
+ *		ipm(TMIN_INTPRI-1)
+ *		DO(RAISE_CPU_EXCEPTION)
+ *	== CPUEXC ==
+ *	3:	state(true, false, false, true, false)				... (A)(C)
+ *		assert(xsns_dpn(p_excinf) == true)					... (G)
+ *	4:	HOOK(HOOK_POINT(%d))
+ *				... CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããªãå ´åã¯ããã§çµäº
+ *		loc_cpu()	... ããã¦CPUã­ãã¯ç¶æ
+ã«ãã¦ã¿ã
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	5:	state(false, false, false, true, false)				... (D)(E)(F)
+ *		ipm(TMIN_INTPRI-1)
+ *	6:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_cpuexc.h"
+
+Inline ER
+check_chg_ipm(PRI intpri)
+{
+	ER		ercd;
+
+	ercd = chg_ipm(intpri);
+	if (ercd == E_PAR) {
+		syslog_0(LOG_NOTICE, "This test program is not necessary.");
+		ext_ker();
+	}
+	return(ercd);
+}
+
+void
+task2(intptr_t exinf)
+{
+	check_point(0);
+}
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	check_point(0);
+}
+
+#ifdef PREPARE_RETURN_CPUEXC
+#define HOOK_POINT(count)	do {							\
+								PREPARE_RETURN_CPUEXC;		\
+								check_point(count);			\
+							} while (false)
+#else /* PREPARE_RETURN_CPUEXC */
+#define HOOK_POINT(count)	check_finish(count)
+#endif /* PREPARE_RETURN_CPUEXC */
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+cpuexc_handler(void *p_excinf)
+{
+	ER_UINT	ercd;
+
+	check_point(3);
+	check_state(true, false, false, true, false);
+
+	check_assert(xsns_dpn(p_excinf) == true);
+
+	HOOK_POINT(4);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	ercd = check_chg_ipm(TMIN_INTPRI-1);
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	check_state(false, false, false, true, false);
+
+	check_ipm(TMIN_INTPRI-1);
+
+	RAISE_CPU_EXCEPTION;
+
+	check_point(5);
+	check_state(false, false, false, true, false);
+
+	check_ipm(TMIN_INTPRI-1);
+
+	check_finish(6);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_cpuexc2.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_cpuexc2.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_cpuexc2.c	(revision 302)
@@ -0,0 +1,231 @@
+/*
+ *  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: test_cpuexc2.c 346 2015-07-18 02:12:08Z ertl-hiro $
+ */
+
+/* 
+ *		CPUä¾å¤å¦çã®ãã¹ã(2)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ç¶æ
+ï¼CPUã­ãã¯ç¶æ
+ã§çºçã
+ *  ãCPUä¾å¤ã«ãããã·ã¹ãã ç¶æ
+ã®ãã¹ãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ï¼
+ *  ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§ãã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *  ããããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯ç¶æ
+ã§
+ *  çºçããCPUä¾å¤ã«ããã¦ï¼
+ *
+ *	(A) CPUä¾å¤ãã³ãã©å®è¡éå§æã«CPUã­ãã¯ãã©ã°ãå¤åããªããã¨
+ *	(B) CPUä¾å¤ãã³ãã©å®è¡éå§æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ä¸­ã§å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãèª­ããªãããï¼ãã¹ãã§
+ *		ãããªãï¼
+ *	(C) CPUä¾å¤ãã³ãã©å®è¡éå§æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *	(D) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«CPUã­ãã¯ãã©ã°ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(E) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(F) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(G) xsns_dpnãtrueãè¿ããã¨
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	CPUEXC: CPUä¾å¤ãã³ãã©
+ *	ALM1: ã¢ã©ã¼ã ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1 ==
+ *	1:	state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *		dis_dsp()
+ *	2:	state(false, false, true, true, false)
+ *		ipm(TIPM_ENAALL)
+ *		sta_alm(ALM1, 10000U)
+ *		DO(while(!alm1_flag))
+ *	== ALM1 ==
+ *	3:	state(true, false, true, true, false)
+ *		loc_cpu()
+ *		DO(RAISE_CPU_EXCEPTION)
+ *	== CPUEXC ==
+ *	4:	state(true, true, true, true, false)				... (A)(C)
+ *		assert(xsns_dpn(p_excinf) == true)					... (G)
+ *	5:	HOOK(HOOK_POINT(%d))
+ *				... CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããªãå ´åã¯ããã§çµäº
+ *		RETURN
+ *	== ALM1ï¼ç¶ãï¼==
+ *	6:	state(true, true, true, true, false)				... (D)(F)
+ *		DO(alm1_flag = true)
+ *		RETURN	... CPUã­ãã¯ç¶æ
+ã®ã¾ã¾ãªã¿ã¼ã³
+ *	== TASK1ï¼ç¶ãï¼==
+ *	7:	state(false, false, true, true, false)				... (E)
+ *		ipm(TIPM_ENAALL)
+ *	8:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_cpuexc.h"
+
+volatile bool_t	alm1_flag = false;
+
+void
+task2(intptr_t exinf)
+{
+	check_point(0);
+}
+
+#ifdef PREPARE_RETURN_CPUEXC
+#define HOOK_POINT(count)	do {							\
+								PREPARE_RETURN_CPUEXC;		\
+								check_point(count);			\
+							} while (false)
+#else /* PREPARE_RETURN_CPUEXC */
+#define HOOK_POINT(count)	check_finish(count)
+#endif /* PREPARE_RETURN_CPUEXC */
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(3);
+	check_state(true, false, true, true, false);
+
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	RAISE_CPU_EXCEPTION;
+
+	check_point(6);
+	check_state(true, true, true, true, false);
+
+	alm1_flag = true;
+
+	return;
+
+	check_point(0);
+}
+
+void
+cpuexc_handler(void *p_excinf)
+{
+
+	check_point(4);
+	check_state(true, true, true, true, false);
+
+	check_assert(xsns_dpn(p_excinf) == true);
+
+	HOOK_POINT(5);
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	check_state(false, false, true, true, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	while(!alm1_flag);
+
+	check_point(7);
+	check_state(false, false, true, true, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_finish(8);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_cpuexc3.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_cpuexc3.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_cpuexc3.c	(revision 302)
@@ -0,0 +1,225 @@
+/*
+ *  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: test_cpuexc3.c 346 2015-07-18 02:12:08Z ertl-hiro $
+ */
+
+/* 
+ *		CPUä¾å¤å¦çã®ãã¹ã(3)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  éã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶æ
+ã§çºçã
+ *  ãCPUä¾å¤ã«ãããã·ã¹ãã ç¶æ
+ã®ãã¹ãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ï¼
+ *  ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§ãã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *  ããããï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶
+ *  æ
+ã§çºçããCPUä¾å¤ã«ããã¦ï¼
+ *
+ *	(A) CPUä¾å¤ãã³ãã©å®è¡éå§æã«CPUã­ãã¯ãã©ã°ãå¤åããªããã¨
+ *	(B) CPUä¾å¤ãã³ãã©å®è¡éå§æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ä¸­ã§å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãèª­ããªãããï¼ãã¹ãã§
+ *		ãããªãï¼
+ *	(C) CPUä¾å¤ãã³ãã©å®è¡éå§æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *	(D) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«CPUã­ãã¯ãã©ã°ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(E) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(F) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(G) xsns_dpnãtrueãè¿ããã¨
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	CPUEXC: CPUä¾å¤ãã³ãã©
+ *	ALM1: ã¢ã©ã¼ã ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1 ==
+ *	1:	state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *		dis_dsp()
+ *	2:	state(false, false, true, true, false)
+ *		ipm(TIPM_ENAALL)
+ *		sta_alm(ALM1, 10000U)
+ *		DO(while(!alm1_flag))
+ *	== ALM1 ==
+ *	3:	state(true, false, true, true, false)
+ *		DO(RAISE_CPU_EXCEPTION)
+ *	== CPUEXC ==
+ *	4:	state(true, false, true, true, false)				... (A)(C)
+ *		assert(xsns_dpn(p_excinf) == true)					... (G)
+ *	5:	HOOK(HOOK_POINT(%d))
+ *				... CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããªãå ´åã¯ããã§çµäº
+ *		RETURN
+ *	== ALM1ï¼ç¶ãï¼==
+ *	6:	state(true, false, true, true, false)				... (D)(F)
+ *		DO(alm1_flag = true)
+ *		RETURN	... CPUã­ãã¯ç¶æ
+ã®ã¾ã¾ãªã¿ã¼ã³
+ *	== TASK1ï¼ç¶ãï¼==
+ *	7:	state(false, false, true, true, false)				... (E)
+ *		ipm(TIPM_ENAALL)
+ *	8:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_cpuexc.h"
+
+volatile bool_t	alm1_flag = false;
+
+void
+task2(intptr_t exinf)
+{
+	check_point(0);
+}
+
+#ifdef PREPARE_RETURN_CPUEXC
+#define HOOK_POINT(count)	do {							\
+								PREPARE_RETURN_CPUEXC;		\
+								check_point(count);			\
+							} while (false)
+#else /* PREPARE_RETURN_CPUEXC */
+#define HOOK_POINT(count)	check_finish(count)
+#endif /* PREPARE_RETURN_CPUEXC */
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+alarm1_handler(intptr_t exinf)
+{
+
+	check_point(3);
+	check_state(true, false, true, true, false);
+
+	RAISE_CPU_EXCEPTION;
+
+	check_point(6);
+	check_state(true, false, true, true, false);
+
+	alm1_flag = true;
+
+	return;
+
+	check_point(0);
+}
+
+void
+cpuexc_handler(void *p_excinf)
+{
+
+	check_point(4);
+	check_state(true, false, true, true, false);
+
+	check_assert(xsns_dpn(p_excinf) == true);
+
+	HOOK_POINT(5);
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	check_state(false, false, true, true, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	while(!alm1_flag);
+
+	check_point(7);
+	check_state(false, false, true, true, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_finish(8);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_cpuexc4.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_cpuexc4.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_cpuexc4.c	(revision 302)
@@ -0,0 +1,210 @@
+/*
+ *  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: test_cpuexc4.c 346 2015-07-18 02:12:08Z ertl-hiro $
+ */
+
+/* 
+ *		CPUä¾å¤å¦çã®ãã¹ã(4)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯ç¶æ
+ã§çºçããCPUä¾å¤ã«ãããã·ã¹ãã 
+ *  ç¶æ
+ã®ãã¹ãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ï¼ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§
+ *  ãã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *  ããããï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯ç¶æ
+ã§çºçããCPUä¾å¤ã«ãã
+ *  ã¦ï¼
+ *
+ *	(A) CPUä¾å¤ãã³ãã©å®è¡éå§æã«CPUã­ãã¯ãã©ã°ãå¤åããªããã¨
+ *		ï¼å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§çºçããCPUä¾å¤ã§ã¯ï¼ã·ã¹ãã ç¶æ
+ãæ­£ããèª­
+ *		ããããã¨ãä¿è¨¼ãããªãããï¼ãã¹ãã§ããªãï¼
+ *	(B) CPUä¾å¤ãã³ãã©å®è¡éå§æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤åããªããã¨
+ *		ï¼å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§çºçããCPUä¾å¤ã§ã¯ï¼ã·ã¹ãã ç¶æ
+ãæ­£ããèª­
+ *		ããããã¨ãä¿è¨¼ãããªãããï¼ãã¹ãã§ããªãï¼
+ *	(C) CPUä¾å¤ãã³ãã©å®è¡éå§æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *		ï¼å²è¾¼ã¿ã­ãã¯ç¶æ
+ã§çºçããCPUä¾å¤ã§ã¯ï¼ã·ã¹ãã ç¶æ
+ãæ­£ããèª­
+ *		ããããã¨ãä¿è¨¼ãããªãããï¼ãã¹ãã§ããªãï¼
+ *	(D) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«CPUã­ãã¯ãã©ã°ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(E) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(F) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(G) xsns_dpnãtrueãè¿ããã¨
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	CPUEXC: CPUä¾å¤ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1 ==
+ *	1:	state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *		dis_dsp()
+ *	2:	state(false, false, true, true, false)
+ *		ipm(TIPM_ENAALL)
+ *		DO(SIL_LOC_INT())
+ *		DO(RAISE_CPU_EXCEPTION)
+ *	== CPUEXC ==
+ *	3:	assert(xsns_dpn(p_excinf) == true)					... (G)
+ *	4:	HOOK(HOOK_POINT(%d))
+ *				... CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããªãå ´åã¯ããã§çµäº
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	5:	DO(SIL_UNL_INT())
+ *	6:	state(false, false, true, true, false)				... (D)(E)(F)
+ *		ipm(TIPM_ENAALL)
+ *	7:	END
+ */
+
+#include <sil.h>
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_cpuexc.h"
+
+void
+task2(intptr_t exinf)
+{
+	check_point(0);
+}
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	check_point(0);
+}
+
+#ifdef PREPARE_RETURN_CPUEXC
+#define HOOK_POINT(count)	do {							\
+								PREPARE_RETURN_CPUEXC;		\
+								check_point(count);			\
+							} while (false)
+#else /* PREPARE_RETURN_CPUEXC */
+#define HOOK_POINT(count)	check_finish(count)
+#endif /* PREPARE_RETURN_CPUEXC */
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+cpuexc_handler(void *p_excinf)
+{
+
+	check_point(3);
+	check_assert(xsns_dpn(p_excinf) == true);
+
+	HOOK_POINT(4);
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	SIL_PRE_LOC;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	check_state(false, false, true, true, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	SIL_LOC_INT();
+
+	RAISE_CPU_EXCEPTION;
+
+	check_point(5);
+	SIL_UNL_INT();
+
+	check_point(6);
+	check_state(false, false, true, true, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_finish(7);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_cpuexc5.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_cpuexc5.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_cpuexc5.c	(revision 302)
@@ -0,0 +1,195 @@
+/*
+ *  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: test_cpuexc5.c 346 2015-07-18 02:12:08Z ertl-hiro $
+ */
+
+/* 
+ *		CPUä¾å¤å¦çã®ãã¹ã(5)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯ç¶æ
+ã§çºçããCPU
+ *  ä¾å¤ã«ãããã·ã¹ãã ç¶æ
+ã®ãã¹ãï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ï¼ãã£
+ *  ã¹ãããç¦æ­¢ç¶æ
+ã§ãã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *  ããããï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯ç¶æ
+ã§çº
+ *  çããCPUä¾å¤ã«ããã¦ï¼
+ *
+ *	(A) CPUä¾å¤ãã³ãã©å®è¡éå§æã«CPUã­ãã¯ãã©ã°ãå¤åããªããã¨
+ *	(B) CPUä¾å¤ãã³ãã©å®è¡éå§æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ä¸­ã§å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãèª­ããªãããï¼ãã¹ãã§
+ *		ãããªãï¼
+ *	(C) CPUä¾å¤ãã³ãã©å®è¡éå§æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *	(D) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«CPUã­ãã¯ãã©ã°ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(E) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(F) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(G) xsns_dpnãtrueãè¿ããã¨
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	CPUEXC: CPUä¾å¤ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1 ==
+ *	1:	state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *		dis_dsp()
+ *		loc_cpu()
+ *	2:	state(false, true, true, true, false)
+ *		DO(RAISE_CPU_EXCEPTION)
+ *	== CPUEXC ==
+ *	3:	state(true, true, true, true, false)			... (A)(C)
+ *		assert(xsns_dpn(p_excinf) == true)				... (G)
+ *	4:	HOOK(HOOK_POINT(%d))
+ *				... CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããªãå ´åã¯ããã§çµäº
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	5:	state(false, true, true, true, false)			... (D)(E)(F)
+ *	6:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_cpuexc.h"
+
+void
+task2(intptr_t exinf)
+{
+	check_point(0);
+}
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	check_point(0);
+}
+
+#ifdef PREPARE_RETURN_CPUEXC
+#define HOOK_POINT(count)	do {							\
+								PREPARE_RETURN_CPUEXC;		\
+								check_point(count);			\
+							} while (false)
+#else /* PREPARE_RETURN_CPUEXC */
+#define HOOK_POINT(count)	check_finish(count)
+#endif /* PREPARE_RETURN_CPUEXC */
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+cpuexc_handler(void *p_excinf)
+{
+
+	check_point(3);
+	check_state(true, true, true, true, false);
+
+	check_assert(xsns_dpn(p_excinf) == true);
+
+	HOOK_POINT(4);
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	check_state(false, true, true, true, false);
+
+	RAISE_CPU_EXCEPTION;
+
+	check_point(5);
+	check_state(false, true, true, true, false);
+
+	check_finish(6);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_cpuexc6.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_cpuexc6.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_cpuexc6.c	(revision 302)
@@ -0,0 +1,227 @@
+/*
+ *  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: test_cpuexc6.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		CPUä¾å¤å¦çã®ãã¹ã(6)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶æ
+ï¼å²è¾¼ã¿åª
+ *  å
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§çºçããCPUä¾å¤ã«ããã
+ *  ã·ã¹ãã ç¶æ
+ã®ãã¹ãï¼ã¿ã¹ã¯åæãã«ãããªã«ããªã§ãããã¨ããã¹ã
+ *  ããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *  ããããï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶æ
+ï¼
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§çºçããCPUä¾å¤
+ *  ã«ããã¦ï¼
+ *
+ *	(A) CPUä¾å¤ãã³ãã©å®è¡éå§æã«CPUã­ãã¯ãã©ã°ãå¤åããªããã¨
+ *	(B) CPUä¾å¤ãã³ãã©å®è¡éå§æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ä¸­ã§å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãèª­ããªãããï¼ãã¹ãã§
+ *		ãããªãï¼
+ *	(C) CPUä¾å¤ãã³ãã©å®è¡éå§æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *	(D) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«CPUã­ãã¯ãã©ã°ãå
+ã«æ»ããã¨
+ *	(E) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ããã¨
+ *	(F) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *	(G) xsns_dpnãfalseãè¿ããã¨
+ *	(H) ã¿ã¹ã¯åæãã«ãããªã«ããªãã§ãããã¨
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	TASK2: é«åªå
+åº¦ã¿ã¹ã¯
+ *	CPUEXC: CPUä¾å¤ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1-1ï¼1åç®ï¼==
+ *	1:	state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *		DO(RAISE_CPU_EXCEPTION)
+ *	== CPUEXC ==
+ *	2:	state(true, false, false, true, false)				... (A)(C)
+ *		assert(xsns_dpn(p_excinf) == false)					... (G)
+ *  3:	act_tsk(TASK2)
+ *		loc_cpu()	... ããã¦CPUã­ãã¯ç¶æ
+ã«ãã¦ã¿ã
+ *  	RETURN
+ *	== TASK2 ==
+ *	4:	state(false, false, false, false, false)			... (D)(E)(F)
+ *		ipm(TIPM_ENAALL)
+ *	5:	ter_tsk(TASK1)										... (H)
+ *	6:	act_tsk(TASK1)										... (H)
+ *	7:	ext_tsk()
+ *	== TASK1-2ï¼2åç®ï¼==
+ *	8:	state(false, false, false, false, false)			... (H)
+ *		ipm(TIPM_ENAALL)
+ *	9:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_cpuexc.h"
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	check_point(0);
+}
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+cpuexc_handler(void *p_excinf)
+{
+	ER_UINT	ercd;
+
+	check_point(2);
+	check_state(true, false, false, true, false);
+
+	check_assert(xsns_dpn(p_excinf) == false);
+
+	check_point(3);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	return;
+
+	check_point(0);
+}
+
+static uint_t	task1_count = 0;
+
+void
+task1(intptr_t exinf)
+{
+
+	switch (++task1_count) {
+	case 1:
+		test_start(__FILE__);
+
+		check_point(1);
+		check_state(false, false, false, false, false);
+
+		check_ipm(TIPM_ENAALL);
+
+		RAISE_CPU_EXCEPTION;
+
+		check_point(0);
+
+	case 2:
+		check_point(8);
+		check_state(false, false, false, false, false);
+
+		check_ipm(TIPM_ENAALL);
+
+		check_finish(9);
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(4);
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_point(5);
+	ercd = ter_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(6);
+	ercd = act_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(7);
+	ercd = ext_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_cpuexc7.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_cpuexc7.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_cpuexc7.c	(revision 302)
@@ -0,0 +1,208 @@
+/*
+ *  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: test_cpuexc7.c 346 2015-07-18 02:12:08Z ertl-hiro $
+ */
+
+/* 
+ *		CPUä¾å¤å¦çã®ãã¹ã(7)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶æ
+ï¼å²è¾¼ã¿åª
+ *  å
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ï¼ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§çºçããCPUä¾å¤ã«ããã
+ *  ã·ã¹ãã ç¶æ
+ã®ãã¹ãï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *  ããããï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶æ
+ï¼
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ï¼ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§çºçããCPUä¾å¤
+ *  ã«ããã¦ï¼
+ *
+ *	(A) CPUä¾å¤ãã³ãã©å®è¡éå§æã«CPUã­ãã¯ãã©ã°ãå¤åããªããã¨
+ *	(B) CPUä¾å¤ãã³ãã©å®è¡éå§æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ä¸­ã§å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãèª­ããªãããï¼ãã¹ãã§
+ *		ãããªãï¼
+ *	(C) CPUä¾å¤ãã³ãã©å®è¡éå§æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *	(D) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«CPUã­ãã¯ãã©ã°ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(E) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(F) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(G) xsns_dpnãtrueãè¿ããã¨
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	CPUEXC: CPUä¾å¤ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1 ==
+ *	1:	state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *		dis_dsp()
+ *	2:	state(false, false, true, true, false)
+ *		ipm(TIPM_ENAALL)
+ *		DO(RAISE_CPU_EXCEPTION)
+ *	== CPUEXC ==
+ *	3:	state(true, false, true, true, false)				... (A)(C)
+ *		assert(xsns_dpn(p_excinf) == true)					... (G)
+ *	4:	HOOK(HOOK_POINT(%d))
+ *				... CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããªãå ´åã¯ããã§çµäº
+ *		loc_cpu()	... ããã¦CPUã­ãã¯ç¶æ
+ã«ãã¦ã¿ã
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	5:	state(false, false, true, true, false)				... (D)(E)(F)
+ *		ipm(TIPM_ENAALL)
+ *	6:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_cpuexc.h"
+
+void
+task2(intptr_t exinf)
+{
+	check_point(0);
+}
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	check_point(0);
+}
+
+#ifdef PREPARE_RETURN_CPUEXC
+#define HOOK_POINT(count)	do {							\
+								PREPARE_RETURN_CPUEXC;		\
+								check_point(count);			\
+							} while (false)
+#else /* PREPARE_RETURN_CPUEXC */
+#define HOOK_POINT(count)	check_finish(count)
+#endif /* PREPARE_RETURN_CPUEXC */
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+cpuexc_handler(void *p_excinf)
+{
+	ER_UINT	ercd;
+
+	check_point(3);
+	check_state(true, false, true, true, false);
+
+	check_assert(xsns_dpn(p_excinf) == true);
+
+	HOOK_POINT(4);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	check_state(false, false, true, true, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	RAISE_CPU_EXCEPTION;
+
+	check_point(5);
+	check_state(false, false, true, true, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_finish(6);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_cpuexc8.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_cpuexc8.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_cpuexc8.c	(revision 302)
@@ -0,0 +1,210 @@
+/*
+ *  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: test_cpuexc8.c 346 2015-07-18 02:12:08Z ertl-hiro $
+ */
+
+/* 
+ *		CPUä¾å¤å¦çã®ãã¹ã(8)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶æ
+ï¼å²è¾¼ã¿åª
+ *  å
+åº¦ãã¹ã¯ï¼TMAX_INTPRIï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§çºçããCPUä¾å¤ã«ã
+ *  ããã·ã¹ãã ç¶æ
+ã®ãã¹ãï¼
+ *
+ *  ãã®ãã¹ãã¯ï¼TMAX_INTPRIã¨TMIN_INTPRIãç°ãªãå ´åã®ã¿å®æ½ããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *  ããããï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶æ
+ï¼
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼TMAX_INTPRIï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§çºçããCPU
+ *  ä¾å¤ã«ããã¦ï¼
+ *
+ *	(A) CPUä¾å¤ãã³ãã©å®è¡éå§æã«CPUã­ãã¯ãã©ã°ãå¤åããªããã¨
+ *	(B) CPUä¾å¤ãã³ãã©å®è¡éå§æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ä¸­ã§å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãèª­ããªãããï¼ãã¹ãã§
+ *		ãããªãï¼
+ *	(C) CPUä¾å¤ãã³ãã©å®è¡éå§æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *	(D) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«CPUã­ãã¯ãã©ã°ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(E) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(F) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(G) xsns_dpnãtrueãè¿ããã¨
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	CPUEXC: CPUä¾å¤ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1 ==
+ *	1:	state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *		chg_ipm(TMAX_INTPRI)
+ *	2:	state(false, false, false, true, false)
+ *		ipm(TMAX_INTPRI)
+ *		DO(RAISE_CPU_EXCEPTION)
+ *	== CPUEXC ==
+ *	3:	state(true, false, false, true, false)				... (A)(C)
+ *		assert(xsns_dpn(p_excinf) == true)					... (G)
+ *	4:	HOOK(HOOK_POINT(%d))
+ *				... CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããªãå ´åã¯ããã§çµäº
+ *		loc_cpu()	... ããã¦CPUã­ãã¯ç¶æ
+ã«ãã¦ã¿ã
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	5:	state(false, false, false, true, false)				... (D)(E)(F)
+ *		ipm(TMAX_INTPRI)
+ *	6:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_cpuexc.h"
+
+#if TMAX_INTPRI == TMIN_INTPRI
+#error "This test program is not necessary."
+#endif /* TMAX_INTPRI == TMIN_INTPRI */
+
+void
+task2(intptr_t exinf)
+{
+	check_point(0);
+}
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	check_point(0);
+}
+
+#ifdef PREPARE_RETURN_CPUEXC
+#define HOOK_POINT(count)	do {							\
+								PREPARE_RETURN_CPUEXC;		\
+								check_point(count);			\
+							} while (false)
+#else /* PREPARE_RETURN_CPUEXC */
+#define HOOK_POINT(count)	check_finish(count)
+#endif /* PREPARE_RETURN_CPUEXC */
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+cpuexc_handler(void *p_excinf)
+{
+	ER_UINT	ercd;
+
+	check_point(3);
+	check_state(true, false, false, true, false);
+
+	check_assert(xsns_dpn(p_excinf) == true);
+
+	HOOK_POINT(4);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	ercd = chg_ipm(TMAX_INTPRI);
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	check_state(false, false, false, true, false);
+
+	check_ipm(TMAX_INTPRI);
+
+	RAISE_CPU_EXCEPTION;
+
+	check_point(5);
+	check_state(false, false, false, true, false);
+
+	check_ipm(TMAX_INTPRI);
+
+	check_finish(6);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_cpuexc9.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_cpuexc9.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_cpuexc9.c	(revision 302)
@@ -0,0 +1,204 @@
+/*
+ *  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: test_cpuexc9.c 346 2015-07-18 02:12:08Z ertl-hiro $
+ */
+
+/* 
+ *		CPUä¾å¤å¦çã®ãã¹ã(9)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶æ
+ï¼å²è¾¼ã¿åª
+ *  å
+åº¦ãã¹ã¯ï¼TMIN_INTPRIï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§çºçããCPUä¾å¤ã«ã
+ *  ããã·ã¹ãã ç¶æ
+ã®ãã¹ãï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *  ããããï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãï¼å²è¾¼ã­ãã¯è§£é¤ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶æ
+ï¼
+ *  å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ï¼TMIN_INTPRIï¼ãã£ã¹ãããè¨±å¯ç¶æ
+ã§çºçããCPU
+ *  ä¾å¤ã«ããã¦ï¼
+ *
+ *	(A) CPUä¾å¤ãã³ãã©å®è¡éå§æã«CPUã­ãã¯ãã©ã°ãå¤åããªããã¨
+ *	(B) CPUä¾å¤ãã³ãã©å®è¡éå§æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ä¸­ã§å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãèª­ããªãããï¼ãã¹ãã§
+ *		ãããªãï¼
+ *	(C) CPUä¾å¤ãã³ãã©å®è¡éå§æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *	(D) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«CPUã­ãã¯ãã©ã°ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(E) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«å²è¾¼ã¿åªå
+åº¦ãã¹ã¯ãå
+ã«æ»ããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(F) CPUä¾å¤ãã³ãã©ãªã¿ã¼ã³æã«ãã£ã¹ãããç¦æ­¢ãã©ã°ãå¤åããªããã¨
+ *		ï¼CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããå ´åã®ã¿ãã¹ãããï¼
+ *	(G) xsns_dpnãtrueãè¿ããã¨
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	CPUEXC: CPUä¾å¤ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1 ==
+ *	1:	state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *		chg_ipm(TMIN_INTPRI)
+ *	2:	state(false, false, false, true, false)
+ *		ipm(TMIN_INTPRI)
+ *		DO(RAISE_CPU_EXCEPTION)
+ *	== CPUEXC ==
+ *	3:	state(true, false, false, true, false)				... (A)(C)
+ *		assert(xsns_dpn(p_excinf) == true)					... (G)
+ *	4:	HOOK(HOOK_POINT(%d))
+ *				... CPUä¾å¤ãã³ãã©ãããªã¿ã¼ã³ã§ããªãå ´åã¯ããã§çµäº
+ *		loc_cpu()	... ããã¦CPUã­ãã¯ç¶æ
+ã«ãã¦ã¿ã
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	5:	state(false, false, false, true, false)				... (D)(E)(F)
+ *		ipm(TMIN_INTPRI)
+ *	6:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_cpuexc.h"
+
+void
+task2(intptr_t exinf)
+{
+	check_point(0);
+}
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	check_point(0);
+}
+
+#ifdef PREPARE_RETURN_CPUEXC
+#define HOOK_POINT(count)	do {							\
+								PREPARE_RETURN_CPUEXC;		\
+								check_point(count);			\
+							} while (false)
+#else /* PREPARE_RETURN_CPUEXC */
+#define HOOK_POINT(count)	check_finish(count)
+#endif /* PREPARE_RETURN_CPUEXC */
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+cpuexc_handler(void *p_excinf)
+{
+	ER_UINT	ercd;
+
+	check_point(3);
+	check_state(true, false, false, true, false);
+
+	check_assert(xsns_dpn(p_excinf) == true);
+
+	HOOK_POINT(4);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	ercd = chg_ipm(TMIN_INTPRI);
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	check_state(false, false, false, true, false);
+
+	check_ipm(TMIN_INTPRI);
+
+	RAISE_CPU_EXCEPTION;
+
+	check_point(5);
+	check_state(false, false, false, true, false);
+
+	check_ipm(TMIN_INTPRI);
+
+	check_finish(6);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_dlynse.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_dlynse.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_dlynse.c	(revision 302)
@@ -0,0 +1,139 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  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: test_dlynse.c 482 2016-01-03 13:12:51Z ertl-hiro $
+ */
+
+/*
+ *		sil_dly_nseã«é¢ãããã¹ã
+ */
+
+#include <kernel.h>
+#include <sil.h>
+#include <t_syslog.h>
+#include "syssvc/syslog.h"
+#include "syssvc/test_svc.h"
+#include "syssvc/histogram.h"
+#include "kernel_cfg.h"
+#include "test_dlynse.h"
+
+/*
+ *  SIL_DLY_TIM1ã¨SIL_DLY_TIM2ãåç
+§ããããã«ï¼ã«ã¼ãã«ç¨ã®ããããã¡
+ *  ã¤ã«ãã¤ã³ã¯ã«ã¼ãããï¼
+ */
+#include "target_kernel_impl.h"
+
+#define	NO_LOOP		ULONG_C(1000000)
+
+SYSTIM	empty_time;
+
+static void
+test_empty(void)
+{
+	HRTCNT	stime, etime;
+	volatile ulong_t	i;
+
+	stime = fch_hrt();
+	for (i = 0; i < NO_LOOP; i++) {
+	}
+	etime = fch_hrt();
+	empty_time = etime - stime;
+	syslog(LOG_NOTICE, "empty loop: %u", empty_time);
+	(void) syslog_fls_log();
+}
+
+static void
+test_dly_nse(ulong_t dlytim)
+{
+	HRTCNT	stime, etime;
+	ulong_t	delay_time;
+	volatile ulong_t	i;
+
+	stime = fch_hrt();
+	for (i = 0; i < NO_LOOP; i++) {
+		sil_dly_nse(dlytim);
+	}
+	etime = fch_hrt();
+	delay_time = ((etime - stime) - empty_time) / 1000U;
+	syslog(LOG_NOTICE, "sil_dly_nse(%lu): %lu %s", dlytim, delay_time,
+									delay_time >= dlytim ? "OK" : "NG");
+	(void) syslog_fls_log();
+}
+
+void
+main_task(intptr_t exinf)
+{
+	test_start(__FILE__);
+
+	test_empty();
+
+	syslog(LOG_NOTICE, "-- for fitting parameters --");
+	test_dly_nse(0);
+	test_dly_nse(SIL_DLY_TIM1);
+	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 1);
+	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 2);
+	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 3);
+	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 4);
+	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 5);
+	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 10);
+	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 20);
+	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 50);
+
+	syslog(LOG_NOTICE, "-- for checking boundary conditions --");
+	test_dly_nse(SIL_DLY_TIM1 + 1);
+	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 1 + 1);
+	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 2 + 1);
+
+	check_finish(0);
+}
Index: asp3_wo_tecs/trunk/test/test_dlynse.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_dlynse.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_dlynse.cfg	(revision 302)
@@ -0,0 +1,12 @@
+/*
+ *		sil_dly_nseã«é¢ãããã¹ãã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_dlynse.h"
+CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, STACK_SIZE, NULL });
Index: asp3_wo_tecs/trunk/test/test_dlynse.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_dlynse.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_dlynse.h	(revision 302)
@@ -0,0 +1,86 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2006-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_dlynse.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/*
+ *		sil_dly_nseã«é¢ãããã¹ã
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+#define MAIN_PRIORITY	10
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#ifndef STACK_SIZE
+#define	STACK_SIZE		4096		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãº */
+#endif /* STACK_SIZE */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+extern void	main_task(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_hrt1.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_hrt1.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_hrt1.c	(revision 302)
@@ -0,0 +1,142 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
+ *                              Toyohashi Univ. of Technology, JAPAN
+ *  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: test_hrt1.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/*
+ *		fch_hrtã«é¢ãããã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ãéè¡ãããã¨ããªããã¨ããã¹ãããï¼
+ *
+ * ããã¹ãã®å
+å®¹ã
+ *
+ *  ã¡ã¤ã³ã¿ã¹ã¯ã§ã¯ï¼é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ãç¹°ãè¿ãåå¾ãï¼ã«ã¦
+ *  ã³ãå¤ãå°ãããªããªããããã§ãã¯ããï¼ããã¨ä¸¦è¡ãã¦ï¼å¨æãã³ã
+ *  ã©ã100Î¼ç§å¨æã§å®è¡ãï¼ãã®ä¸­ã§ãé«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ãåå¾
+ *  ãã¦ï¼ã«ã¦ã³ãå¤ãå°ãããªããªããããã§ãã¯ããï¼
+ *
+ *  ãªãï¼é«åè§£è½ã¿ã¤ãã®ã«ã¦ã³ãå¤ãæå¤§å¤ãè¶
+ãã¦0ã«æ»ãç¶æ³ã¯èæ
+®ã
+ *  ã¦ããªãï¼
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_hrt1.h"
+
+#define	NO_LOOP		ULONG_C(100000)
+
+HRTCNT	recent_hrtcnt;
+char	*recent_hrtcnt_pos;
+uint_t	cyclic_count;
+
+void
+cyclic_handler(intptr_t exinf)
+{
+	HRTCNT		hrtcnt, prev_hrtcnt;
+	char		*prev_hrtcnt_pos;
+
+	(void) loc_cpu();
+	hrtcnt = fch_hrt();
+	prev_hrtcnt = recent_hrtcnt;
+	prev_hrtcnt_pos = recent_hrtcnt_pos;
+	recent_hrtcnt = hrtcnt;
+	recent_hrtcnt_pos = "CYC";
+	(void) unl_cpu();
+
+	if (prev_hrtcnt > hrtcnt) {
+		syslog(LOG_NOTICE,
+				"system performance time goes back: %d(%s) %d(CYC)",
+								prev_hrtcnt, prev_hrtcnt_pos, hrtcnt);
+	}
+	cyclic_count += 1U;
+}
+
+void
+main_task(intptr_t exinf)
+{
+	HRTCNT		hrtcnt, prev_hrtcnt;
+	char		*prev_hrtcnt_pos;
+	ulong_t		i;
+
+	cyclic_count = 0U;
+	recent_hrtcnt = fch_hrt();
+	syslog(LOG_NOTICE, "system performance time test starts.");
+
+	for (i = 0; i < NO_LOOP; i++) {
+		(void) loc_cpu();
+		hrtcnt = fch_hrt();
+		prev_hrtcnt = recent_hrtcnt;
+		prev_hrtcnt_pos = recent_hrtcnt_pos;
+		recent_hrtcnt = hrtcnt;
+		recent_hrtcnt_pos = "TSK";
+		(void) unl_cpu();
+
+		if (prev_hrtcnt > hrtcnt) {
+			syslog(LOG_NOTICE,
+				"system performance time goes back: %d(%s) %d(TSK)",
+								prev_hrtcnt, prev_hrtcnt_pos, hrtcnt);
+		}
+	}
+
+	syslog(LOG_NOTICE, "system performance time test finishes.");
+	syslog(LOG_NOTICE, "number of cyclic handler execution: %d", cyclic_count);
+	check_finish(0);
+}
Index: asp3_wo_tecs/trunk/test/test_hrt1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_hrt1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_hrt1.cfg	(revision 302)
@@ -0,0 +1,15 @@
+/*
+ *		fch_hrtã«é¢ãããã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_hrt1.h"
+
+CRE_CYC(CYC1, { TA_STA, { TNFY_HANDLER, 0, cyclic_handler },
+											CYC1_CYCLE, CYC1_CYCLE });
+CRE_TSK(MAIN_TASK, { TA_ACT, 0, main_task, MAIN_PRIORITY, STACK_SIZE, NULL });
Index: asp3_wo_tecs/trunk/test/test_hrt1.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_hrt1.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_hrt1.h	(revision 302)
@@ -0,0 +1,91 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2006-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_hrt1.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/*
+ *		fch_hrtã«é¢ãããã¹ã(1)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+#define MAIN_PRIORITY	10
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#ifndef STACK_SIZE
+#define	STACK_SIZE		4096		/* ã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãº */
+#endif /* STACK_SIZE */
+
+#ifndef CYC1_CYCLE
+#define CYC1_CYCLE		100U		/* å¨æãã³ãã©ã®å¨æï¼Î¼ç§ï¼*/
+#endif /* CYC1_CYCLE */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+extern void	cyclic_handler(intptr_t exinf);
+extern void	main_task(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_mutex.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex.h	(revision 302)
@@ -0,0 +1,93 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: test_mutex.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(1)ã(3)
+ */
+
+#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);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_mutex1.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex1.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex1.c	(revision 302)
@@ -0,0 +1,310 @@
+/*
+ *  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: test_mutex1.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  FIFOé ãã¥ã¼ããã¯ã¹ãï¼ã­ãã¯ããå¦çã¨ã­ãã¯è§£é¤ããå¦çãä¸éã
+ *  ãã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¦çï¼loc_mtxï¼
+ *		(A-1) ã­ãã¯ããã¦ããªãå ´åã«ã¯ï¼ããã«ã­ãã¯ã§ãããã¨
+ *		(A-2) å¤éã«ã­ãã¯ãããã¨ããã¨ï¼E_OBJã¨ã©ã¼ã«ãªããã¨
+ *		(A-3) ã­ãã¯ããã¦ããå ´åã«ã¯ï¼FIFOé ã§å¾
+ã¡ç¶æ
+ã«ãªããã¨
+ *	(B) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤å¦çï¼unl_mtxï¼
+ *		(B-1) ä»ã¿ã¹ã¯ãã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ãè§£æ¾ãããã¨ããã¨
+ *		ãããE_OBJã¨ã©ã¼ã«ãªããã¨
+ *		(B-2) å¾
+ã¡ã¿ã¹ã¯ããªãã¨ï¼åã«ã­ãã¯è§£é¤ãããã¨
+ *		(B-3) å¾
+ã¡ã¿ã¹ã¯ã«ã­ãã¯ãæ¸¡ããã¨
+ *		(B-4) å¾
+ã¡ã¿ã¹ã¯ã«ã­ãã¯ãæ¸¡ãã¦ï¼ãã£ã¹ããããèµ·ãããã¨
+ *	(C) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¦çï¼ploc_mtxï¼
+ *		(C-1) ã­ãã¯ããã¦ããå ´åã«ã¯ï¼ããã«E_TMOUTã¨ã©ã¼ã«ãªããã¨
+ *	(D) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¦çï¼tloc_mtxï¼
+ *		(D-1) ã­ãã¯ããã¦ããå ´åã«ã¯ï¼ã¿ã¤ã ã¢ã¦ãä»ãã®å¾
+ã¡ç¶æ
+ã«ãª
+ *		ãããããã¨
+ *	(E) ãã¾ã
+ *		(E-1) ã¿ã¹ã¯ãçµäºããã¨ï¼ãã¥ã¼ããã¯ã¹ãã­ãã¯è§£é¤ãããã¨
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä½åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: é«åªå
+åº¦ã¿ã¹ã¯
+ *	MTX1: ãã¥ã¼ããã¯ã¹ï¼TA_NULLå±æ§ï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä½ï¼==
+ *		call(set_bit_func(bit_mutex))
+ *	1:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TSK_NONE)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		loc_mtx(MTX1)					... (A-1)
+ *	2:	loc_mtx(MTX1) -> E_OBJ			... (A-2)
+ *	3:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK1)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		act_tsk(TASK2)
+ *	== TASK2ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	4:	ploc_mtx(MTX1) -> E_TMOUT		... (C-1)
+ *		loc_mtx(MTX1)					... (A-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	5:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK1)
+ *		assert(rmtx.wtskid == TASK2)
+ *		act_tsk(TASK3)
+ *	== TASK3ï¼åªå
+åº¦ï¼é«ï¼==
+ *	6:	unl_mtx(MTX1) -> E_OBJ			... (B-1)
+ *	7:	loc_mtx(MTX1)					... (A-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	8:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK1)
+ *		assert(rmtx.wtskid == TASK2)
+ *		dis_dsp()
+ *		unl_mtx(MTX1)					... (B-3)
+ *	9:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK2)
+ *		assert(rmtx.wtskid == TASK3)
+ *		ena_dsp()
+ *	== TASK2ï¼ç¶ãï¼==
+ *	10:	unl_mtx(MTX1)					... (B-4)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	11:	ext_tsk() -> noreturn			... (E-1)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	12:	loc_mtx(MTX1)
+ *	13:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	14:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK2)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		tloc_mtx(MTX1, 10000U) -> E_TMOUT	... (D-1)
+ *	15:	wup_tsk(TASK2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	16:	unl_mtx(MTX1)					... (B-2)
+ *	17:	ext_tsk() -> noreturn
+ *	== TASK1ï¼ç¶ãï¼==
+ *	18:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_mutex.h"
+
+extern ER	bit_mutex(void);
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RMTX	rmtx;
+
+	test_start(__FILE__);
+
+	set_bit_func(bit_mutex);
+
+	check_point(1);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TSK_NONE);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OBJ);
+
+	check_point(3);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK1);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(5);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK1);
+
+	check_assert(rmtx.wtskid == TASK2);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK1);
+
+	check_assert(rmtx.wtskid == TASK2);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(9);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK2);
+
+	check_assert(rmtx.wtskid == TASK3);
+
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK2);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = tloc_mtx(MTX1, 10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(15);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_finish(18);
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(4);
+	ercd = ploc_mtx(MTX1);
+	check_ercd(ercd, E_TMOUT);
+
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(10);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(12);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(16);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(17);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(6);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OBJ);
+
+	check_point(7);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_mutex1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex1.cfg	(revision 302)
@@ -0,0 +1,16 @@
+/*
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_mutex.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_MTX(MTX1, { TA_NULL });
Index: asp3_wo_tecs/trunk/test/test_mutex2.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex2.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex2.c	(revision 302)
@@ -0,0 +1,311 @@
+/*
+ *  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: test_mutex2.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(2)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  åªå
+åº¦é ãã¥ã¼ããã¯ã¹ãï¼ã­ãã¯ããå¦çã¨ã­ãã¯è§£é¤ããå¦çãä¸é
+ *  ããã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¦çï¼loc_mtxï¼
+ *		(A-1) ã­ãã¯ããã¦ããªãå ´åã«ã¯ï¼ããã«ã­ãã¯ã§ãããã¨
+ *		(A-2) å¤éã«ã­ãã¯ãããã¨ããã¨ï¼E_OBJã¨ã©ã¼ã«ãªããã¨
+ *		(A-3) ã­ãã¯ããã¦ããå ´åã«ã¯ï¼åªå
+åº¦é ã§å¾
+ã¡ç¶æ
+ã«ãªããã¨
+ *	(B) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤å¦çï¼unl_mtxï¼
+ *		(B-1) ä»ã¿ã¹ã¯ãã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ãè§£æ¾ãããã¨ããã¨
+ *		ãããE_OBJã¨ã©ã¼ã«ãªããã¨
+ *		(B-2) å¾
+ã¡ã¿ã¹ã¯ããªãã¨ï¼åã«ã­ãã¯è§£é¤ãããã¨
+ *		(B-3) å¾
+ã¡ã¿ã¹ã¯ã«ã­ãã¯ãæ¸¡ããã¨
+ *		(B-4) å¾
+ã¡ã¿ã¹ã¯ã«ã­ãã¯ãæ¸¡ãã¦ï¼ãã£ã¹ããããèµ·ãããã¨
+ *	(C) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¦çï¼ploc_mtxï¼
+ *		(C-1) ã­ãã¯ããã¦ããå ´åã«ã¯ï¼ããã«E_TMOUTã¨ã©ã¼ã«ãªããã¨
+ *	(D) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¦çï¼tloc_mtxï¼
+ *		(D-1) ã­ãã¯ããã¦ããå ´åã«ã¯ï¼ã¿ã¤ã ã¢ã¦ãä»ãã®å¾
+ã¡ç¶æ
+ã«ãª
+ *		ãããããã¨
+ *	(E) ãã¾ã
+ *		(E-1) ã¿ã¹ã¯ãçµäºããã¨ï¼ãã¥ã¼ããã¯ã¹ãã­ãã¯è§£é¤ãããã¨
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä½åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: é«åªå
+åº¦ã¿ã¹ã¯
+ *	MTX1: ãã¥ã¼ããã¯ã¹ï¼TA_TPRIå±æ§ï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä½ï¼==
+ *		call(set_bit_func(bit_mutex))
+ *	1:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TSK_NONE)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		loc_mtx(MTX1)					... (A-1)
+ *	2:	loc_mtx(MTX1) -> E_OBJ			... (A-2)
+ *	3:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK1)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		act_tsk(TASK2)
+ *	== TASK2ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	4:	ploc_mtx(MTX1) -> E_TMOUT		... (C-1)
+ *		loc_mtx(MTX1)					... (A-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	5:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK1)
+ *		assert(rmtx.wtskid == TASK2)
+ *		act_tsk(TASK3)
+ *	== TASK3ï¼åªå
+åº¦ï¼é«ï¼==
+ *	6:	unl_mtx(MTX1) -> E_OBJ			... (B-1)
+ *	7:	loc_mtx(MTX1)					... (A-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	8:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK1)
+ *		assert(rmtx.wtskid == TASK3)
+ *		dis_dsp()
+ *		unl_mtx(MTX1)					... (B-3)
+ *	9:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK3)
+ *		assert(rmtx.wtskid == TASK2)
+ *		ena_dsp()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	10:	ext_tsk() -> noreturn			... (E-1)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	11:	unl_mtx(MTX1)					... (B-4)
+ *	12:	loc_mtx(MTX1)
+ *	13:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	14:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK2)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		tloc_mtx(MTX1, 10000U) -> E_TMOUT	... (D-1)
+ *	15:	wup_tsk(TASK2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	16:	unl_mtx(MTX1)					... (B-2)
+ *	17:	ext_tsk() -> noreturn
+ *	== TASK1ï¼ç¶ãï¼==
+ *	18:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_mutex.h"
+
+extern ER	bit_mutex(void);
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RMTX	rmtx;
+
+	test_start(__FILE__);
+
+	set_bit_func(bit_mutex);
+
+	check_point(1);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TSK_NONE);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OBJ);
+
+	check_point(3);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK1);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(5);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK1);
+
+	check_assert(rmtx.wtskid == TASK2);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK1);
+
+	check_assert(rmtx.wtskid == TASK3);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(9);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK3);
+
+	check_assert(rmtx.wtskid == TASK2);
+
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK2);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = tloc_mtx(MTX1, 10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(15);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_finish(18);
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(4);
+	ercd = ploc_mtx(MTX1);
+	check_ercd(ercd, E_TMOUT);
+
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(12);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(16);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(17);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(6);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OBJ);
+
+	check_point(7);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(10);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_mutex2.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex2.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex2.cfg	(revision 302)
@@ -0,0 +1,16 @@
+/*
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(2)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_mutex.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_MTX(MTX1, { TA_TPRI });
Index: asp3_wo_tecs/trunk/test/test_mutex3.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex3.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex3.c	(revision 302)
@@ -0,0 +1,359 @@
+/*
+ *  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: test_mutex3.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(3)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãï¼ã­ãã¯ããå¦çã¨ã­ãã¯è§£é¤ããå¦çãä¸
+ *  éããã¹ãããï¼ref_tskã«ãããã¼ã¹åªå
+åº¦ã¨ç¾å¨åªå
+åº¦ã®åç
+§å¦çã®ã
+ *  ã¹ããå
+¼ã­ã¦ããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¦çï¼loc_mtxï¼
+ *		(A-1) ã­ãã¯ããã¦ããªãå ´åã«ã¯ï¼ããã«ã­ãã¯ã§ãããã¨
+ *		(A-2) å¤éã«ã­ãã¯ãããã¨ããã¨ï¼E_OBJã¨ã©ã¼ã«ãªããã¨
+ *		(A-3) ã­ãã¯ããã¦ããå ´åã«ã¯ï¼åªå
+åº¦é ã§å¾
+ã¡ç¶æ
+ã«ãªããã¨
+ *	(B) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤å¦çï¼unl_mtxï¼
+ *		(B-1) ä»ã¿ã¹ã¯ãã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ãè§£æ¾ãããã¨ããã¨
+ *		ãããE_OBJã¨ã©ã¼ã«ãªããã¨
+ *		(B-2) å¾
+ã¡ã¿ã¹ã¯ããªãã¨ï¼åã«ã­ãã¯è§£é¤ãããã¨
+ *		(B-3) å¾
+ã¡ã¿ã¹ã¯ã«ã­ãã¯ãæ¸¡ããã¨
+ *		(B-4) å¾
+ã¡ã¿ã¹ã¯ã«ã­ãã¯ãæ¸¡ãã¦ï¼ãã£ã¹ããããèµ·ãããã¨
+ *	(C) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¦çï¼ploc_mtxï¼
+ *		(C-1) ã­ãã¯ããã¦ããå ´åã«ã¯ï¼ããã«E_TMOUTã¨ã©ã¼ã«ãªããã¨
+ *	(D) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¦çï¼tloc_mtxï¼
+ *		(D-1) ã­ãã¯ããã¦ããå ´åã«ã¯ï¼ã¿ã¤ã ã¢ã¦ãä»ãã®å¾
+ã¡ç¶æ
+ã«ãª
+ *		ãããããã¨
+ *	(E) ãã¾ã
+ *		(E-1) ã¿ã¹ã¯ãçµäºããã¨ï¼ãã¥ã¼ããã¯ã¹ãã­ãã¯è§£é¤ãããã¨
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä½åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: é«åªå
+åº¦ã¿ã¹ã¯
+ *	MTX1: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯é«åªå
+åº¦ï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä½ï¼==
+ *		call(set_bit_func(bit_mutex))
+ *	1:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TSK_NONE)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		loc_mtx(MTX1)					... (A-1)
+ *	2:	ref_tsk(TASK1, &rtsk)
+ *		assert(rtsk.tskpri == HIGH_PRIORITY)
+ *		assert(rtsk.tskbpri == LOW_PRIORITY)
+ *		loc_mtx(MTX1) -> E_OBJ			... (A-2)
+ *	3:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK1)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		act_tsk(TASK2)
+ *	4:	tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK2ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	5:	ploc_mtx(MTX1) -> E_TMOUT		... (C-1)
+ *		loc_mtx(MTX1)					... (A-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	6:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK1)
+ *		assert(rmtx.wtskid == TASK2)
+ *		act_tsk(TASK3)
+ *	7:	tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK3ï¼åªå
+åº¦ï¼é«ï¼==
+ *	8:	unl_mtx(MTX1) -> E_OBJ			... (B-1)
+ *	9:	loc_mtx(MTX1)					... (A-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	10:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK1)
+ *		assert(rmtx.wtskid == TASK3)
+ *		dis_dsp()
+ *		unl_mtx(MTX1)					... (B-3)
+ *	11:	ref_tsk(TASK1, &rtsk)
+ *		assert(rtsk.tskpri == LOW_PRIORITY)
+ *		assert(rtsk.tskbpri == LOW_PRIORITY)
+ *		ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK3)
+ *		assert(rmtx.wtskid == TASK2)
+ *		ena_dsp()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	12:	ext_tsk() -> noreturn			... (E-1)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	13:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskpri == HIGH_PRIORITY)
+ *		assert(rtsk.tskbpri == MID_PRIORITY)
+ *		unl_mtx(MTX1)					... (B-4)
+ *	14:	loc_mtx(MTX1)
+ *	15:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	16:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK2)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		tloc_mtx(MTX1, 10000U) -> E_TMOUT	... (D-1)
+ *	17:	wup_tsk(TASK2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	18:	unl_mtx(MTX1)					... (B-2)
+ *	19:	ext_tsk() -> noreturn
+ *	== TASK1ï¼ç¶ãï¼==
+ *	20:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_mutex.h"
+
+extern ER	bit_mutex(void);
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RTSK	rtsk;
+	T_RMTX	rmtx;
+
+	test_start(__FILE__);
+
+	set_bit_func(bit_mutex);
+
+	check_point(1);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TSK_NONE);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	ercd = ref_tsk(TASK1, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskpri == HIGH_PRIORITY);
+
+	check_assert(rtsk.tskbpri == LOW_PRIORITY);
+
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OBJ);
+
+	check_point(3);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK1);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(4);
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(6);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK1);
+
+	check_assert(rmtx.wtskid == TASK2);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(7);
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(10);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK1);
+
+	check_assert(rmtx.wtskid == TASK3);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	ercd = ref_tsk(TASK1, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskpri == LOW_PRIORITY);
+
+	check_assert(rtsk.tskbpri == LOW_PRIORITY);
+
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK3);
+
+	check_assert(rmtx.wtskid == TASK2);
+
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(16);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK2);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = tloc_mtx(MTX1, 10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(17);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_finish(20);
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RTSK	rtsk;
+
+	check_point(5);
+	ercd = ploc_mtx(MTX1);
+	check_ercd(ercd, E_TMOUT);
+
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskpri == HIGH_PRIORITY);
+
+	check_assert(rtsk.tskbpri == MID_PRIORITY);
+
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(15);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(18);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(19);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(8);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OBJ);
+
+	check_point(9);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(12);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_mutex3.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex3.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex3.cfg	(revision 302)
@@ -0,0 +1,16 @@
+/*
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(3)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_mutex.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_MTX(MTX1, { TA_CEILING, HIGH_PRIORITY });
Index: asp3_wo_tecs/trunk/test/test_mutex4.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex4.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex4.c	(revision 302)
@@ -0,0 +1,931 @@
+/*
+ *  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: test_mutex4.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(4)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã«å¯¾ãã¦ï¼loc_mtxã¨unl_mtxã«ä¼´ãåªå
+åº¦ã®å¤
+ *  æ´å¦çãç¶²ç¾
+çã«ãã¹ãããï¼ãã ãï¼change_priorityã¨
+ *  mutex_calc_priorityã®å
+å®¹ã«ã¯è¸ã¿è¾¼ã¾ãªãï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¦çï¼loc_mtxï¼ã«ä¼´ãåªå
+åº¦å¤æ´
+ *		(A-1) ã­ãã¯ãããã¥ã¼ããã¯ã¹ã®åªå
+åº¦ä¸éãèªã¿ã¹ã¯ã®ç¾å¨åªå
+
+ *			  åº¦ãããé«ãå ´åã«ï¼èªã¿ã¹ã¯ã®åªå
+åº¦ããã®åªå
+åº¦ä¸éã¾ã§
+ *			  ä¸ãããã¨ï¼ã¾ãï¼åãåªå
+åº¦å
+ã§ã®åªå
+é ä½ãæé«ã«ãªãã
+ *			  ã¨
+ *		(A-2) ã­ãã¯ãããã¥ã¼ããã¯ã¹ã®åªå
+åº¦ä¸éãèªã¿ã¹ã¯ã®ç¾å¨åªå
+
+ *			  åº¦ã¨åãå ´åã«ï¼èªã¿ã¹ã¯ã®åªå
+åº¦ãå¤ãããªããã¨ï¼ã¾ãï¼
+ *			  åãåªå
+åº¦å
+ã§ã®åªå
+é ä½ãå¤ãããªããã¨
+ *		(A-3) ã­ãã¯ãããã¥ã¼ããã¯ã¹ã®åªå
+åº¦ä¸éãèªã¿ã¹ã¯ã®ç¾å¨åªå
+
+ *			  åº¦ãããä½ãå ´åã«ï¼èªã¿ã¹ã¯ã®åªå
+åº¦ãå¤ãããªããã¨ï¼ã¾
+ *			  ãï¼åãåªå
+åº¦å
+ã§ã®åªå
+é ä½ãå¤ãããªããã¨
+ *	(B) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤å¦çï¼unl_mtxï¼ã«ä¼´ãã­ãã¯è§£é¤ãã
+ * 		ã¿ã¹ã¯ã®åªå
+åº¦å¤æ´
+ *		(B-1) ã­ãã¯è§£é¤ãããã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ãèªã¿ã¹ã¯ã®ç¾å¨
+ *			  åªå
+åº¦ã¨åãã§ï¼ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤ã§åªå
+åº¦ãä¸ã
+ *			  ãã¹ãå ´åã«ï¼èªã¿ã¹ã¯ã®åªå
+åº¦ãé©åã«ä¸ãããããã¨ï¼ã¾
+ *			  ãï¼åãåªå
+åº¦å
+ã§ã®åªå
+é ä½ãæé«ã«ãªããã¨
+ *		(B-2) ã­ãã¯è§£é¤ãããã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ãèªã¿ã¹ã¯ã®ç¾å¨
+ *			  åªå
+åº¦ã¨åãã§ï¼ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤ã§åªå
+åº¦ãå¤ã
+ *			  ãã¹ãã§ãªãå ´åã«ï¼èªã¿ã¹ã¯ã®åªå
+åº¦ãå¤ãããªããã¨ï¼ã¾
+ *			  ãï¼åãåªå
+åº¦å
+ã§ã®åªå
+é ä½ãå¤ãããªããã¨
+ *		(B-3) ã­ãã¯è§£é¤ãããã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ãèªã¿ã¹ã¯ã®ç¾å¨
+ *			  åªå
+åº¦ãããä½ãå ´åã«ï¼èªã¿ã¹ã¯ã®åªå
+åº¦ãå¤ãããªããã¨ï¼
+ *			  ã¾ãï¼åãåªå
+åº¦å
+ã§ã®åªå
+é ä½ãå¤ãããªããã¨
+ *	(C) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤å¦çï¼unl_mtxï¼ã«ä¼´ããã¥ã¼ããã¯ã¹ã
+ *		ã­ãã¯ããã¿ã¹ã¯ã®åªå
+åº¦å¤æ´
+ *		(C-1) ãã¥ã¼ããã¯ã¹ã®åªå
+åº¦ä¸éãæ°ãã«ãã¥ã¼ããã¯ã¹ãã­ãã¯
+ *			  ããã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ãããé«ãå ´åã«ï¼å½è©²ã¿ã¹ã¯ã®åªå
+
+ *			  åº¦ããã®åªå
+åº¦ä¸éã¾ã§ä¸ãããã¨ï¼ã¾ãï¼åãåªå
+åº¦å
+ã§ã®
+ *			  åªå
+é ä½ãæä½ã«ãªããã¨
+ *		(C-2) ãã¥ã¼ããã¯ã¹ã®åªå
+åº¦ä¸éãæ°ãã«ãã¥ã¼ããã¯ã¹ãã­ãã¯
+ *			  ããã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ã¨åãå ´åã«ï¼å½è©²ã¿ã¹ã¯ã®åªå
+åº¦ã
+ *			  å¤ãããªããã¨ï¼ã¾ãï¼åãåªå
+åº¦å
+ã§ã®åªå
+é ä½ãæä½ã«ãª
+ *			  ããã¨
+ *		(C-3) ãã¥ã¼ããã¯ã¹ã®åªå
+åº¦ä¸éãæ°ãã«ãã¥ã¼ããã¯ã¹ãã­ãã¯
+ *			  ããã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ãããä½ãå ´åã«ï¼å½è©²ã¿ã¹ã¯ã®åªå
+
+ *			  åº¦ãå¤ãããªããã¨ï¼ã¾ãï¼åãåªå
+åº¦å
+ã§ã®åªå
+é ä½ãæä½
+ *			  ã«ãªããã¨
+ *	(D) ãã¥ã¼ããã¯ã¹ã®ã­ãã¯å¦çï¼loc_mtxï¼ã®E_ILUSEã¨ã©ã¼
+ *		(D-1) èªã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ãï¼ã­ãã¯ãããã¨ãããã¥ã¼ããã¯
+ *			  ã¹ã®ä¸éåªå
+åº¦ãããé«ãæï¼E_ILUSEã¨ã©ã¼ã«ãªããã¨
+ *		(D-2) èªã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ãï¼ã­ãã¯ãããã¨ãããã¥ã¼ããã¯
+ *			  ã¹ã®ä¸éåªå
+åº¦ã¨åããããããä½ããã°ï¼èªã¿ã¹ã¯ã®ç¾å¨åª
+ *			  å
+åº¦ãããããé«ãã¦ãï¼E_ILUSEã¨ã©ã¼ã«ãªããªããã¨
+ *
+ * ããã¹ãé 
+ç®ã®å®ç¾æ¹æ³ã
+ *
+ *	(A-1)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ã«ï¼é«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX2ï¼ã
+ *		ã­ãã¯ããï¼é«åªå
+åº¦ã«ãªããã¨ãç¢ºèªããï¼ã¾ãï¼å®è¡å¯è½ç¶æ
+ã®
+ *		é«åªå
+åº¦ã¿ã¹ã¯ï¼TASK4ï¼ãããï¼åªå
+é ä½ãé«ããªããã¨ãç¢ºèªããï¼
+ *		ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§å®æ½ããï¼
+ *	(A-2)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ã«ï¼ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ã
+ *		ã­ãã¯ããï¼åªå
+åº¦ãå¤ãããªããã¨ãç¢ºèªããï¼ã¾ãï¼å®è¡å¯è½ç¶
+ *		æ
+ã®ä¸­åªå
+åº¦ã¿ã¹ã¯ã2ã¤ï¼TASK2ï¼TASK3ï¼ãç¨æãã¦ããï¼åªå
+é ä½
+ *		ãå¤ãããªããã¨ãç¢ºèªããï¼ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§å®æ½ããï¼
+ *	(A-3)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãé«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX2ï¼ãã­ã
+ *		ã¯ãã¦é«åªå
+åº¦ã«ãªã£ã¦ããç¶æ
+ã§ï¼ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹
+ *		ï¼MTX1ï¼ãã­ãã¯ããï¼åªå
+åº¦ãå¤ãããªããã¨ãç¢ºèªããï¼ã¾ãï¼
+ *		å®è¡å¯è½ç¶æ
+ã®é«åªå
+åº¦ã¿ã¹ã¯ã2ã¤ï¼TASK4ï¼TASK5ï¼ãç¨æãã¦ããï¼
+ *		åªå
+é ä½ãå¤ãããªããã¨ãç¢ºèªããï¼ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§å®æ½
+ *		ããï¼
+ *	(B-1)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ã«é«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX2ï¼ã®ã¿
+ *		ãã­ãã¯ããã¦ããç¶æ
+ã§ï¼ãããã­ãã¯è§£é¤ããï¼ä¸­åªå
+åº¦ã«ãªã
+ *		ãã¨ãç¢ºèªããï¼ã¾ãï¼å®è¡å¯è½ç¶æ
+ã®ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ãã
+ *		ãï¼åªå
+é ä½ãé«ããªããã¨ãç¢ºèªããï¼
+ *	(B-2)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ã«ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ã®ã¿
+ *		ãã­ãã¯ããã¦ããç¶æ
+ã§ï¼ãããã­ãã¯è§£é¤ããï¼åªå
+åº¦ãå¤ãã
+ *		ãªããã¨ãç¢ºèªããï¼ã¾ãï¼å®è¡å¯è½ç¶æ
+ã®ä¸­åªå
+åº¦ã¿ã¹ã¯ã2ã¤
+ *		ï¼TASK2ï¼TASK3ï¼ãç¨æãã¦ããï¼åªå
+é ä½ãå¤ãããªããã¨ãç¢ºèª
+ *		ããï¼ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§å®æ½ããï¼
+ *	(B-3)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ã«é«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX2ï¼ã¨ä¸­
+ *		åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ãã¯ããã¦ããç¶æ
+ã§ï¼ä¸­åª
+ *		å
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ãã¯è§£é¤ããï¼åªå
+åº¦ãå¤ãã
+ *		ãªããã¨ãç¢ºèªããï¼ã¾ãï¼å®è¡å¯è½ç¶æ
+ã®é«åªå
+åº¦ã¿ã¹ã¯ã2ã¤
+ *		ï¼TASK4ï¼TASK5ï¼ãç¨æãã¦ããï¼åªå
+é ä½ãå¤ãããªããã¨ãç¢ºèª
+ *		ããï¼ãã£ã¹ãããç¦æ­¢ç¶æ
+ã§å®æ½ããï¼
+ *	(C-1)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ã«é«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX2ï¼ãã­ã
+ *		ã¯ããï¼å¥ã®ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ãMTX2ãå¾
+ã£ã¦ããç¶æ
+ã§ï¼
+ *		TASK1ãä¸æçã«é«åªå
+åº¦ã«ãï¼ããã«TASK1ã«MTX2ãã­ãã¯è§£é¤ããï¼
+ *		TASK2ã®åªå
+åº¦ãé«åªå
+åº¦ã«ãªããã¨ãç¢ºèªããï¼ã¾ãï¼TASK2ã®åªå
+
+ *		é ä½ãï¼TASK1ãããä½ããªããã¨ãç¢ºèªããï¼
+ *	(C-2)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ã«ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ã
+ *		ã¯ããï¼å¥ã®ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãMTX1ãå¾
+ã£ã¦ããç¶æ
+ã§ï¼
+ *		TASK2ã«MTX1ãã­ãã¯è§£é¤ããï¼TASK1ã®åªå
+åº¦ãä¸­åªå
+åº¦ã®ã¾ã¾å¤å
+ *		ããªããã¨ãç¢ºèªããï¼ã¾ãï¼å®è¡å¯è½ç¶æ
+ã®ä¸­åªå
+åº¦ã¿ã¹ã¯ããã
+ *		1ã¤ï¼TASK3ï¼ç¨æãã¦ããï¼TASK1ã®åªå
+é ä½ãTASK3ãããä½ããªã
+ *		ãã¨ãç¢ºèªããï¼
+ *	(C-3)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ã«é«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX3ï¼ã¨ä¸­
+ *		åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ãã¯ããï¼å¥ã®ä¸­åªå
+åº¦ã¿ã¹
+ *		ã¯ï¼TASK2ï¼ãå¥ã®é«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX2ï¼ãã­ãã¯ãã¦
+ *		MTX1ãå¾
+ã£ã¦ããç¶æ
+ã§ï¼TASK1ã«MTX1ãã­ãã¯è§£é¤ããï¼TASK2ã®åª
+ *		å
+åº¦ãé«åªå
+åº¦ã®ã¾ã¾å¤åããªããã¨ãç¢ºèªããï¼ã¾ãï¼TASK2ã®åªå
+
+ *		é ä½ãï¼TASK1ãããä½ããªããã¨ãç¢ºèªããï¼
+ *	(D-1)
+ *		é«åªå
+åº¦ã¿ã¹ã¯ï¼TASK4ï¼ã«ï¼ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ã
+ *		ã­ãã¯ããï¼E_ILUSEã¨ã©ã¼ã«ãªããã¨ãç¢ºèªããï¼
+ *	(D-2)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãé«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX2ï¼ãã­ã
+ *		ã¯ãã¦é«åªå
+åº¦ã«ãªã£ã¦ããç¶æ
+ã§ï¼ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹
+ *		ï¼MTX1ï¼ãã­ãã¯ããï¼E_ILUSEã¨ã©ã¼ã«ãªããªããã¨ãç¢ºèªããï¼
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK4: é«åªå
+åº¦ã¿ã¹ã¯
+ *	TASK5: é«åªå
+åº¦ã¿ã¹ã¯
+ *	MTX1: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯ä¸­åªå
+åº¦ï¼
+ *	MTX2: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯é«åªå
+åº¦ï¼
+ *	MTX3: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯é«åªå
+åº¦ï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *		call(set_bit_func(bit_mutex))
+ *	1:	dis_dsp()
+ *	2:	act_tsk(TASK2)
+ *		act_tsk(TASK4)
+ *	//		é«ï¼TASK4ï¼ä¸­ï¼TASK1âTASK2
+ *	3:	ploc_mtx(MTX2)								... (A-1)
+ *	//		é«ï¼TASK1âTASK4ï¼ä¸­ï¼TASK2ï¼MTX2ï¼TASK1
+ *		get_pri(TSK_SELF, &tskpri)
+ *		assert(tskpri == HIGH_PRIORITY)
+ *	4:	ena_dsp()
+ *	5:	unl_mtx(MTX2)								... (B-1)
+ *	//		é«ï¼TASK4ï¼ä¸­ï¼TASK1âTASK2
+ *	== TASK4ï¼åªå
+åº¦ï¼é«ï¼==
+ *	6:	loc_mtx(MTX1) -> E_ILUSE					... (D-1)
+ *	7:	slp_tsk()
+ *	//		ä¸­ï¼TASK1âTASK2
+ *	== TASK1ï¼ç¶ãï¼==
+ *	8:	get_pri(TSK_SELF, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *
+ *	9:	dis_dsp()
+ *	10:	rot_rdq(MID_PRIORITY)
+ *	//		ä¸­ï¼TASK2âTASK1
+ *	11:	act_tsk(TASK3)
+ *	//		ä¸­ï¼TASK2âTASK1âTASK3
+ *	12:	ploc_mtx(MTX1)								... (A-2)
+ *	//		ä¸­ï¼TASK2âTASK1âTASK3ï¼MTX1ï¼TASK1
+ *		get_pri(TSK_SELF, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	13:	ena_dsp()
+ *	== TASK2ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	14:	slp_tsk()
+ *	//		ä¸­ï¼TASK1âTASK3ï¼MTX1ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	15:	slp_tsk()
+ *	//		ä¸­ï¼TASK3ï¼MTX1ï¼TASK1
+ *	== TASK3ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	16:	wup_tsk(TASK1)
+ *	//		ä¸­ï¼TASK3âTASK1ï¼MTX1ï¼TASK1
+ *	17:	slp_tsk()
+ *	//		ä¸­ï¼TASK1ï¼MTX1ï¼TASK1
+ *
+ *	== TASK1ï¼ç¶ãï¼==
+ *	18:	wup_tsk(TASK2)
+ *	//		ä¸­ï¼TASK1âTASK2ï¼MTX1ï¼TASK1
+ *	19:	dis_dsp()
+ *	20:	rot_rdq(MID_PRIORITY)
+ *	//		ä¸­ï¼TASK2âTASK1ï¼MTX1ï¼TASK1
+ *	21:	wup_tsk(TASK3)
+ *	//		ä¸­ï¼TASK2âTASK1âTASK3ï¼MTX1ï¼TASK1
+ *	22:	unl_mtx(MTX1)								... (B-2)
+ *	//		ä¸­ï¼TASK2âTASK1âTASK3
+ *		get_pri(TSK_SELF, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	23:	ena_dsp()
+ *	== TASK2ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	24:	slp_tsk()
+ *	//		ä¸­ï¼TASK1âTASK3
+ *	== TASK1ï¼ç¶ãï¼==
+ *	25:	slp_tsk()
+ *	//		ä¸­ï¼TASK3
+ *	== TASK3ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	26:	wup_tsk(TASK1)
+ *	//		ä¸­ï¼TASK3âTASK1
+ *	27:	slp_tsk()
+ *	//		ä¸­ï¼TASK1
+ *
+ *	== TASK1ï¼ç¶ãï¼==
+ *	28:	dis_dsp()
+ *	29:	wup_tsk(TASK4)
+ *	//		é«ï¼TASK4ï¼ä¸­ï¼TASK1
+ *	30:	ploc_mtx(MTX2)
+ *	//		é«ï¼TASK1âTASK4ï¼MTX2ï¼TASK1
+ *	31:	rot_rdq(HIGH_PRIORITY)
+ *	//		é«ï¼TASK4âTASK1ï¼MTX2ï¼TASK1
+ *	32:	act_tsk(TASK5)
+ *	//		é«ï¼TASK4âTASK1âTASK5ï¼MTX2ï¼TASK1
+ *	33:	ploc_mtx(MTX1)								... (A-3)(D-2)
+ *	//		é«ï¼TASK4âTASK1âTASK5ï¼MTX2ï¼TASK1ï¼MTX1ï¼TASK1
+ *		get_pri(TSK_SELF, &tskpri)
+ *		assert(tskpri == HIGH_PRIORITY)
+ *	34:	ena_dsp()
+ *	== TASK4ï¼ç¶ãï¼==
+ *	35:	slp_tsk()
+ *	//		é«ï¼TASK1âTASK5ï¼MTX2ï¼TASK1ï¼MTX1ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	36:	slp_tsk()
+ *	//		é«ï¼TASK5ï¼MTX2ï¼TASK1ï¼MTX1ï¼TASK1
+ *	== TASK5ï¼åªå
+åº¦ï¼é«ï¼==
+ *	37:	wup_tsk(TASK1)
+ *	//		é«ï¼TASK5âTASK1ï¼MTX2ï¼TASK1ï¼MTX1ï¼TASK1
+ *	38:	slp_tsk()
+ *	//		é«ï¼TASK1ï¼MTX2ï¼TASK1ï¼MTX1ï¼TASK1
+ *
+ *	== TASK1ï¼ç¶ãï¼==
+ *	39:	dis_dsp()
+ *	40:	wup_tsk(TASK4)
+ *	//		é«ï¼TASK1âTASK4ï¼MTX2ï¼TASK1ï¼MTX1ï¼TASK1
+ *	41:	rot_rdq(HIGH_PRIORITY)
+ *	//		é«ï¼TASK4âTASK1ï¼MTX2ï¼TASK1ï¼MTX1ï¼TASK1
+ *	42:	wup_tsk(TASK5)
+ *	//		é«ï¼TASK4âTASK1âTASK5ï¼MTX2ï¼TASK1ï¼MTX1ï¼TASK1
+ *	43:	unl_mtx(MTX1)								... (B-3)
+ *	//		é«ï¼TASK4âTASK1âTASK5ï¼MTX2ï¼TASK1
+ *		get_pri(TSK_SELF, &tskpri)
+ *		assert(tskpri == HIGH_PRIORITY)
+ *	44:	ena_dsp()
+ *	== TASK4ï¼ç¶ãï¼==
+ *	45:	slp_tsk()
+ *	//		é«ï¼TASK1âTASK5ï¼MTX2ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	46:	slp_tsk()
+ *	//		é«ï¼TASK5ï¼MTX2ï¼TASK1
+ *	== TASK5ï¼ç¶ãï¼==
+ *	47:	wup_tsk(TASK1)
+ *	//		é«ï¼TASK5âTASK1ï¼MTX2ï¼TASK1
+ *	48:	slp_tsk()
+ *	//		é«ï¼TASK1ï¼MTX2ï¼TASK1
+ *
+ *	== TASK1ï¼ç¶ãï¼==
+ *	49:	wup_tsk(TASK2)
+ *		wup_tsk(TASK3)
+ *		slp_tsk()
+ *	//		ä¸­ï¼TASK2âTASK3ï¼MTX2ï¼TASK1
+ *	== TASK2ï¼ç¶ãï¼==
+ *	50:	loc_mtx(MTX2)
+ *	//		ä¸­ï¼TASK3ï¼MTX2ï¼TASK1âTASK2
+ *	== TASK3ï¼ç¶ãï¼==
+ *	51:	chg_pri(TASK1, HIGH_PRIORITY)
+ *		wup_tsk(TASK1)
+ *	//		é«ï¼TASK1ï¼ä¸­ï¼TASK3ï¼MTX2ï¼TASK1âTASK2
+ *	== TASK1ï¼ç¶ãï¼==
+ *	52:	unl_mtx(MTX2)								... (C-1)
+ *	//		é«ï¼TASK1âTASK2ï¼ä¸­ï¼TASK3ï¼MTX2ï¼TASK2
+ *		get_pri(TASK2, &tskpri)
+ *		assert(tskpri == HIGH_PRIORITY)
+ *
+ *	53:	loc_mtx(MTX3)
+ *	//		é«ï¼TASK1âTASK2ï¼ä¸­ï¼TASK3ï¼MTX2ï¼TASK2ï¼MTX3ï¼TASK1
+ *		chg_pri(TASK1, TPRI_INI)
+ *	54:	loc_mtx(MTX1)
+ *	//		é«ï¼TASK1âTASK2ï¼ä¸­ï¼TASK3ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK2ï¼MTX3ï¼TASK1
+ *	55:	slp_tsk()
+ *	//		é«ï¼TASK2ï¼ä¸­ï¼TASK3ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK2ï¼MTX3ï¼TASK1
+ *	== TASK2ï¼ç¶ãï¼==
+ *	56:	wup_tsk(TASK1)
+ *	//		é«ï¼TASK2âTASK1ï¼ä¸­ï¼TASK3ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK2ï¼MTX3ï¼TASK1
+ *	57:	loc_mtx(MTX1)
+ *	//		é«ï¼TASK1ï¼ä¸­ï¼TASK3ï¼MTX1ï¼TASK1âTASK2ï¼MTX2ï¼TASK2ï¼MTX3ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	58:	unl_mtx(MTX1)								... (C-3)
+ *	//		é«ï¼TASK1âTASK2ï¼ä¸­ï¼TASK3ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2ï¼MTX3ï¼TASK1
+ *		get_pri(TASK2, &tskpri)
+ *		assert(tskpri == HIGH_PRIORITY)
+ *	59:	unl_mtx(MTX3)
+ *	//		é«ï¼TASK2ï¼ä¸­ï¼TASK1âTASK3ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2
+ *	== TASK2ï¼ç¶ãï¼==
+ *	60:	unl_mtx(MTX1)
+ *	//		é«ï¼TASK2ï¼ä¸­ï¼TASK1âTASK3ï¼MTX2ï¼TASK2
+ *	61:	unl_mtx(MTX2)
+ *	//		ä¸­ï¼TASK2âTASK1âTASK3
+ *
+ *	62:	loc_mtx(MTX1)
+ *	//		ä¸­ï¼TASK2âTASK1âTASK3ï¼MTX1ï¼TASK2
+ *	63:	rot_rdq(MID_PRIORITY)
+ *	//		ä¸­ï¼TASK1âTASK3âTASK2ï¼MTX1ï¼TASK2
+ *	== TASK1ï¼ç¶ãï¼==
+ *	64:	loc_mtx(MTX1)
+ *	//		ä¸­ï¼TASK3âTASK2ï¼MTX1ï¼TASK2âTASK1
+ *	== TASK3ï¼ç¶ãï¼==
+ *	65:	rot_rdq(MID_PRIORITY)
+ *	//		ä¸­ï¼TASK2âTASK3ï¼MTX1ï¼TASK2âTASK1
+ *	== TASK2ï¼ç¶ãï¼==
+ *	66:	unl_mtx(MTX1)								... (C-2)
+ *	//		ä¸­ï¼TASK2âTASK3âTASK1ï¼MTX1ï¼TASK1
+ *		get_pri(TASK1, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	67:	ext_tsk() -> noreturn
+ *	//		ä¸­ï¼TASK3âTASK1ï¼MTX1ï¼TASK1
+ *	== TASK3ï¼ç¶ãï¼==
+ *	68:	ext_tsk() -> noreturn
+ *	//		ä¸­ï¼TASK1ï¼MTX1ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	69:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_mutex4.h"
+
+extern ER	bit_mutex(void);
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	PRI		tskpri;
+
+	test_start(__FILE__);
+
+	set_bit_func(bit_mutex);
+
+	check_point(1);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(3);
+	ercd = ploc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TSK_SELF, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == HIGH_PRIORITY);
+
+	check_point(4);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(5);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	ercd = get_pri(TSK_SELF, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	check_point(9);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(10);
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(12);
+	ercd = ploc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TSK_SELF, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	check_point(13);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(15);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(18);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(19);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(20);
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(21);
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(22);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TSK_SELF, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	check_point(23);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(28);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(29);
+	ercd = wup_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(30);
+	ercd = ploc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(31);
+	ercd = rot_rdq(HIGH_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(32);
+	ercd = act_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(33);
+	ercd = ploc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TSK_SELF, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == HIGH_PRIORITY);
+
+	check_point(34);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(36);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(39);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(40);
+	ercd = wup_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(41);
+	ercd = rot_rdq(HIGH_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(42);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(43);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TSK_SELF, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == HIGH_PRIORITY);
+
+	check_point(44);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(46);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(49);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(52);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TASK2, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == HIGH_PRIORITY);
+
+	check_point(53);
+	ercd = loc_mtx(MTX3);
+	check_ercd(ercd, E_OK);
+
+	ercd = chg_pri(TASK1, TPRI_INI);
+	check_ercd(ercd, E_OK);
+
+	check_point(54);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(55);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(58);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TASK2, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == HIGH_PRIORITY);
+
+	check_point(59);
+	ercd = unl_mtx(MTX3);
+	check_ercd(ercd, E_OK);
+
+	check_point(64);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_finish(69);
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	PRI		tskpri;
+
+	check_point(14);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(24);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(50);
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(56);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(57);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(60);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(61);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(62);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(63);
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(66);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TASK1, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	check_point(67);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(16);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(17);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(26);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(27);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(51);
+	ercd = chg_pri(TASK1, HIGH_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(65);
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(68);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task4(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(6);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_ILUSE);
+
+	check_point(7);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(35);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(45);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task5(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(37);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(38);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(47);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(48);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_mutex4.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex4.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex4.cfg	(revision 302)
@@ -0,0 +1,20 @@
+/*
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_mutex4.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK4, { TA_NULL, 4, task4, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK5, { TA_NULL, 5, task5, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_MTX(MTX1, { TA_CEILING, MID_PRIORITY });
+CRE_MTX(MTX2, { TA_CEILING, HIGH_PRIORITY });
+CRE_MTX(MTX3, { TA_CEILING, HIGH_PRIORITY });
Index: asp3_wo_tecs/trunk/test/test_mutex4.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex4.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex4.h	(revision 302)
@@ -0,0 +1,95 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: test_mutex4.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(4)
+ */
+
+#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	task4(intptr_t exinf);
+extern void	task5(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_mutex5.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex5.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex5.c	(revision 302)
@@ -0,0 +1,1142 @@
+/*
+ *  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: test_mutex5.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(5)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã«å¯¾ãã¦ï¼ãã¥ã¼ããã¯ã¹ã®ååæåå¦çãç¶²
+ *  ç¾
+çã«ãã¹ãããï¼ãã ãï¼change_priorityã¨mutex_calc_priorityã®å
+
+ *  å®¹ã«ã¯è¸ã¿è¾¼ã¾ãªãï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ãã¥ã¼ããã¯ã¹ã®åæåï¼ini_mtxï¼ã«ä¼´ããã¥ã¼ããã¯ã¹ãã­ãã¯ã
+ *		ã¦ããã¿ã¹ã¯ï¼å®è¡ã§ããç¶æ
+ï¼ã®åªå
+åº¦å¤æ´
+ *		(A-1) åæåãããã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ãï¼ãã¥ã¼ããã¯ã¹ã
+ *			  ã­ãã¯ãã¦ããã¿ã¹ã¯ï¼å®è¡ã§ããç¶æ
+ï¼ã®ç¾å¨åªå
+åº¦ã¨åã
+ *			  ã§ï¼ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤ã§åªå
+åº¦ãä¸ããã¹ãå ´åã«ï¼
+ *			  å½è©²ã¿ã¹ã¯ã®åªå
+åº¦ãé©åã«ä¸ãããããã¨ï¼ã¾ãï¼åãåªå
+
+ *			  åº¦å
+ã§ã®åªå
+é ä½ãæé«ã«ãªããã¨
+ *		(A-2) åæåãããã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ãï¼ãã¥ã¼ããã¯ã¹ã
+ *			  ã­ãã¯ãã¦ããã¿ã¹ã¯ï¼å®è¡ã§ããç¶æ
+ï¼ã®ç¾å¨åªå
+åº¦ã¨åã
+ *			  ã§ï¼ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤ã§åªå
+åº¦ãå¤ããã¹ãã§ãªã
+ *			  å ´åã«ï¼å½è©²ã¿ã¹ã¯ã®åªå
+åº¦ãå¤ãããªããã¨ï¼ã¾ãï¼åãåª
+ *			  å
+åº¦å
+ã§ã®åªå
+é ä½ãå¤ãããªããã¨
+ *		(A-3) åæåãããã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ãï¼ãã¥ã¼ããã¯ã¹ã
+ *			  ã­ãã¯ãã¦ããã¿ã¹ã¯ï¼å®è¡ã§ããç¶æ
+ï¼ã®ç¾å¨åªå
+åº¦ããã
+ *			  ä½ãå ´åã«ï¼å½è©²ã¿ã¹ã¯ã®åªå
+åº¦ãå¤ãããªããã¨ï¼ã¾ãï¼å
+ *			  ãåªå
+åº¦å
+ã§ã®åªå
+é ä½ãå¤ãããªããã¨
+ *		(A-4) (A-1)ã®çµæï¼ã¿ã¹ã¯ãã£ã¹ããããèµ·ãããã¨ï¼
+ *	(B) ãã¥ã¼ããã¯ã¹ã®åæåï¼ini_mtxï¼ã«ä¼´ããã¥ã¼ããã¯ã¹ãã­ãã¯ã
+ *		ã¦ããã¿ã¹ã¯ï¼å¾
+ã¡ç¶æ
+ï¼ã®åªå
+åº¦å¤æ´
+ *		(B-1) åæåãããã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ãï¼ãã¥ã¼ããã¯ã¹ã
+ *			  ã­ãã¯ãã¦ããã¿ã¹ã¯ï¼å¾
+ã¡ç¶æ
+ï¼ã®ç¾å¨åªå
+åº¦ã¨åãã§ï¼
+ *			  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤ã§åªå
+åº¦ãä¸ããã¹ãå ´åã«ï¼å½
+ *			  è©²ã¿ã¹ã¯ã®åªå
+åº¦ãé©åã«ä¸ãããããã¨ï¼ã¾ãï¼åãåªå
+åº¦
+ *			  å
+ã§ã®é åºãæå¾ã«ãªããã¨
+ *		(B-2) åæåãããã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ãï¼ãã¥ã¼ããã¯ã¹ã
+ *			  ã­ãã¯ãã¦ããã¿ã¹ã¯ï¼å¾
+ã¡ç¶æ
+ï¼ã®ç¾å¨åªå
+åº¦ã¨åãã§ï¼
+ *			  ãã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤ã§åªå
+åº¦ãå¤ããã¹ãã§ãªãå ´å
+ *			  ã«ï¼å½è©²ã¿ã¹ã¯ã®åªå
+åº¦ãå¤ãããªããã¨ï¼ã¾ãï¼åãåªå
+åº¦
+ *			  å
+ã§ã®é åºãå¤ãããªããã¨
+ *		(B-3) åæåãããã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ãï¼ãã¥ã¼ããã¯ã¹ã
+ *			  ã­ãã¯ãã¦ããã¿ã¹ã¯ï¼å¾
+ã¡ç¶æ
+ï¼ã®ç¾å¨åªå
+åº¦ãããä½ãå ´
+ *			  åã«ï¼å½è©²ã¿ã¹ã¯ã®åªå
+åº¦ãå¤ãããªããã¨ï¼ã¾ãï¼åãåªå
+
+ *			  åº¦å
+ã§ã®é åºãå¤ãããªããã¨
+ *	(C) ãã¥ã¼ããã¯ã¹ã®åæåï¼ini_mtxï¼ã«ä¼´ããã¥ã¼ããã¯ã¹ãå¾
+ã£ã¦ã
+ *		ãã¿ã¹ã¯ã®ç¶æ
+å¤å
+ *		(C-1) ãã¥ã¼ããã¯ã¹ãå¾
+ã£ã¦ããã¿ã¹ã¯ãå¾
+ã¡è§£é¤ããããã¨ï¼
+ *		(C-2) (C-1)ã®çµæï¼ã¿ã¹ã¯ãã£ã¹ããããèµ·ãããã¨ï¼
+ *
+ * ããã¹ãé 
+ç®ã®å®ç¾æ¹æ³ã
+ *
+ *	(A-1)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãï¼ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ã
+ *		ã­ãã¯ããç¶æ
+ã§ï¼é«åªå
+åº¦ã¿ã¹ã¯ï¼TASK5ï¼ããMTX1ãååæåãï¼
+ *		TASK1ã®åªå
+åº¦ãä½åªå
+åº¦ã«ä¸ãããã¨ãç¢ºèªããï¼ã¾ãï¼å®è¡å¯è½ç¶
+ *		æ
+ã®ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ãããï¼åªå
+é ä½ãé«ããªããã¨ãç¢ºèª
+ *		ããï¼ã
+ *	(A-2)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãï¼ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã2ã¤
+ *		ï¼MTX1ï¼MTX2ï¼ãã­ãã¯ããç¶æ
+ã§ï¼é«åªå
+åº¦ã¿ã¹ã¯ï¼TASK5ï¼ãã
+ *		MTX1ãååæåãï¼TASK1ã®åªå
+åº¦ãå¤åããªããã¨ãç¢ºèªããï¼ã¾ãï¼
+ *		å®è¡å¯è½ç¶æ
+ã®ä¸­åªå
+åº¦ã¿ã¹ã¯ã2ã¤ï¼TASK3ï¼TASK4ï¼ãç¨æãã¦ããï¼
+ *		åªå
+é ä½ãå¤ãããªããã¨ãç¢ºèªããï¼
+ *	(A-3)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãï¼ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX2ï¼ã¨
+ *		ä½åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX3ï¼ãã­ãã¯ããç¶æ
+ã§ï¼é«åªå
+åº¦
+ *		ã¿ã¹ã¯ï¼TASK5ï¼ããMTX3ãååæåãï¼TASK1ã®åªå
+åº¦ãå¤åããªã
+ *		ãã¨ãç¢ºèªããï¼ã¾ãï¼å®è¡å¯è½ç¶æ
+ã®ä¸­åªå
+åº¦ã¿ã¹ã¯ã2ã¤ï¼TASK3ï¼
+ *		TASK4ï¼ãç¨æãã¦ããï¼åªå
+é ä½ãå¤ãããªããã¨ãç¢ºèªããï¼
+ *	(A-4)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãï¼ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX2ï¼ã
+ *		ã­ãã¯ããç¶æ
+ã§ï¼TASK1ããMTX2ãååæåãï¼TASK1ã®åªå
+åº¦ãä½
+ *		åªå
+åº¦ã«ä¸ããï¼å®è¡å¯è½ç¶æ
+ã®ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK4ï¼ã«åãæã
+ *		ããã¨ãç¢ºèªããï¼ã¾ãï¼å®è¡å¯è½ç¶æ
+ã®ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ã
+ *		ããï¼åªå
+é ä½ãé«ããªããã¨ãç¢ºèªããï¼ã
+ *	(B-1)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãï¼ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ã
+ *		ã­ãã¯ããç¶æ
+ã§ï¼å¥ã®ãã¥ã¼ããã¯ã¹ï¼MTX4ï¼å¾
+ã¡ç¶æ
+ã¨ãï¼é«åª
+ *		å
+åº¦ã¿ã¹ã¯ï¼TASK5ï¼ããMTX1ãååæåãï¼TASK1ã®åªå
+åº¦ãä½åªå
+
+ *		åº¦ã«ä¸ãããã¨ãç¢ºèªããï¼ã¾ãï¼MTX4å¾
+ã¡ç¶æ
+ã®ä½åªå
+åº¦ã¿ã¹ã¯
+ *		ï¼TASK2ï¼ãããï¼å¾
+ã¡è¡åä¸­ã§ã®é åºãå¾ã«ãªããã¨ãç¢ºèªããï¼
+ *	(B-2)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãï¼ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã2ã¤
+ *		ï¼MTX1ï¼MTX2ï¼ãã­ãã¯ããç¶æ
+ã§ï¼å¥ã®ãã¥ã¼ããã¯ã¹ï¼MTX4ï¼å¾
+
+ *		ã¡ç¶æ
+ã¨ãï¼é«åªå
+åº¦ã¿ã¹ã¯ï¼TASK5ï¼ããMTX1ãååæåãï¼TASK1
+ *		ã®åªå
+åº¦ãå¤åããªããã¨ãç¢ºèªããï¼ã¾ãï¼MTX4å¾
+ã¡ç¶æ
+ã®ä¸­åªå
+
+ *		åº¦ã¿ã¹ã¯ã2ã¤ï¼TASK3ï¼TASK4ï¼ãç¨æãã¦ããï¼å¾
+ã¡è¡åä¸­ã§ã®é åº
+ *		ãå¤ãããªããã¨ãç¢ºèªããï¼
+ *	(B-3)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãï¼ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX2ï¼ã¨
+ *		ä½åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX3ï¼ãã­ãã¯ããç¶æ
+ã§ï¼å¥ã®ãã¥ã¼
+ *		ããã¯ã¹ï¼MTX4ï¼å¾
+ã¡ç¶æ
+ã¨ãï¼é«åªå
+åº¦ã¿ã¹ã¯ï¼TASK5ï¼ããMTX3ã
+ *		ååæåãï¼TASK1ã®åªå
+åº¦ãå¤åããªããã¨ãç¢ºèªããï¼ã¾ãï¼
+ *		MTX4å¾
+ã¡ç¶æ
+ã®ä¸­åªå
+åº¦ã¿ã¹ã¯ã2ã¤ï¼TASK3ï¼TASK4ï¼ãç¨æãã¦ããï¼
+ *		å¾
+ã¡è¡åä¸­ã§ã®é åºãå¤ãããªããã¨ãç¢ºèªããï¼
+ *	(C-1)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ã
+ *		ã¯ãï¼ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK3ï¼ãMTX1ãå¾
+ã£ã¦ããç¶æ
+ã§ï¼é«åªå
+åº¦
+ *		ã¿ã¹ã¯ï¼TASK5ï¼ããMTX1ãååæåãï¼TASK3ãå¾
+ã¡è§£é¤ããããã¨
+ *		ãç¢ºèªããï¼ã¾ãï¼å®è¡å¯è½ç¶æ
+ã®ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK4ï¼ãããï¼
+ *		TASK3ã®æ¹ãåªå
+é ä½ãä½ããªããã¨ãç¢ºèªããï¼ã
+ *	(C-2)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ã
+ *		ã¯ãï¼ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK3ï¼ãMTX1ãå¾
+ã¡ï¼TASK1ãèµ·åºå¾
+ã¡ç¶æ
+
+ *		ã¨ããç¶æ
+ã§ï¼å¥ã®ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ããMTX1ãååæåãï¼
+ *		TASK3ãå¾
+ã¡è§£é¤ããï¼TASK3ã«åãæãããã¨ãç¢ºèªããï¼
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä½åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK4: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK5: é«åªå
+åº¦ã¿ã¹ã¯
+ *	MTX1: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯ä¸­åªå
+åº¦ï¼
+ *	MTX2: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯ä¸­åªå
+åº¦ï¼
+ *	MTX3: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯ä½åªå
+åº¦ï¼
+ *	MTX4: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯é«åªå
+åº¦ï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä½ï¼==
+ *		call(set_bit_func(bit_mutex))
+ *	1:	loc_mtx(MTX1)
+ *	2:	act_tsk(TASK2)
+ *	3:	act_tsk(TASK5)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK1ï¼ä½ï¼TASK2ï¼MTX1ï¼TASK1
+ *	== TASK5ï¼åªå
+åº¦ï¼é«ï¼==
+ *	4:	ini_mtx(MTX1)			... (A-1)
+ *	//		é«ï¼TASK5ï¼ä½ï¼TASK1âTASK2
+ *		get_pri(TASK1, &tskpri)
+ *		assert(tskpri == LOW_PRIORITY)
+ *	5:	slp_tsk()
+ *	//		ä½ï¼TASK1âTASK2
+ *
+ *	== TASK1ï¼ç¶ãï¼==
+ *	6:	sus_tsk(TASK2)
+ *	7:	loc_mtx(MTX1)
+ *		loc_mtx(MTX2)
+ *	8:	act_tsk(TASK3)
+ *	//		ä¸­ï¼TASK1âTASK3ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK1
+ *	9:	dis_dsp()
+ *	10:	rot_rdq(MID_PRIORITY)
+ *	//		ä¸­ï¼TASK3âTASK1ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK1
+ *	11:	act_tsk(TASK4)
+ *	//		ä¸­ï¼TASK3âTASK1âTASK4ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK1
+ *	12:	wup_tsk(TASK5)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK3âTASK1âTASK4ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK1
+ *	13:	ena_dsp()
+ *	== TASK5ï¼ç¶ãï¼==
+ *	14:	ini_mtx(MTX1)			... (A-2)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK3âTASK1âTASK4ï¼MTX2ï¼TASK1
+ *		get_pri(TASK1, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	15:	slp_tsk()
+ *	//		ä¸­ï¼TASK3âTASK1âTASK4ï¼MTX2ï¼TASK1
+ *	== TASK3ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	16:	slp_tsk()
+ *	//		ä¸­ï¼TASK1âTASK4ï¼MTX2ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	17:	slp_tsk()
+ *	//		ä¸­ï¼TASK4ï¼MTX2ï¼TASK1
+ *	== TASK4ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	18:	wup_tsk(TASK1)
+ *	//		ä¸­ï¼TASK4âTASK1ï¼MTX2ï¼TASK1
+ *	19:	slp_tsk()
+ *	//		ä¸­ï¼TASK1ï¼MTX2ï¼TASK1
+ *
+ *	== TASK1ï¼ç¶ãï¼==
+ *	20:	loc_mtx(MTX3)
+ *	//		ä¸­ï¼TASK1ï¼MTX2ï¼TASK1ï¼MTX3ï¼TASK1
+ *	21:	wup_tsk(TASK3)
+ *	//		ä¸­ï¼TASK1âTASK3ï¼MTX2ï¼TASK1ï¼MTX3ï¼TASK1
+ *	22:	dis_dsp()
+ *	23:	rot_rdq(MID_PRIORITY)
+ *	//		ä¸­ï¼TASK3âTASK1ï¼MTX2ï¼TASK1ï¼MTX3ï¼TASK1
+ *	24:	wup_tsk(TASK4)
+ *	//		ä¸­ï¼TASK3âTASK1âTASK4ï¼MTX2ï¼TASK1ï¼MTX3ï¼TASK1
+ *	25:	wup_tsk(TASK5)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK3âTASK1âTASK4ï¼MTX2ï¼TASK1ï¼MTX3ï¼TASK1
+ *	26:	ena_dsp()
+ *	== TASK5ï¼ç¶ãï¼==
+ *	27:	ini_mtx(MTX3)			... (A-3)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK3âTASK1âTASK4ï¼MTX2ï¼TASK1
+ *		get_pri(TASK1, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	28:	slp_tsk()
+ *	//		ä¸­ï¼TASK3âTASK1âTASK4ï¼MTX2ï¼TASK1
+ *	== TASK3ï¼ç¶ãï¼==
+ *	29:	slp_tsk()
+ *	//		ä¸­ï¼TASK1âTASK4ï¼MTX2ï¼TASK1
+ *
+ *	== TASK1ï¼ç¶ãï¼==
+ *	30:	slp_tsk()
+ *	//		ä¸­ï¼TASK4ï¼MTX2ï¼TASK1
+ *	== TASK4ï¼ç¶ãï¼==
+ *	31:	wup_tsk(TASK1)
+ *	//		ä¸­ï¼TASK4âTASK1ï¼MTX2ï¼TASK1
+ *	32:	rot_rdq(MID_PRIORITY)
+ *	//		ä¸­ï¼TASK1âTASK4ï¼MTX2ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	33:	rsm_tsk(TASK2)
+ *	//		ä¸­ï¼TASK1âTASK4ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1
+ *	34:	ini_mtx(MTX2)			... (A-4)
+ *	//		ä¸­ï¼TASK4ï¼ä½ï¼TASK1âTASK2
+ *	== TASK4ï¼ç¶ãï¼==
+ *	35:	get_pri(TASK1, &tskpri)
+ *		assert(tskpri == LOW_PRIORITY)
+ *	36:	slp_tsk()
+ *	//		ä½ï¼TASK1âTASK2
+ *
+ *	== TASK1ï¼ç¶ãï¼==
+ *	37:	wup_tsk(TASK5)
+ *	== TASK5ï¼ç¶ãï¼==
+ *	38:	loc_mtx(MTX4)
+ *	39:	tslp_tsk(10000U) -> E_TMOUT
+ *	//		ä½ï¼TASK1âTASK2ï¼MTX4ï¼TASK5
+ *	== TASK1ï¼ç¶ãï¼==
+ *	40:	loc_mtx(MTX1)
+ *	//		ä¸­ï¼TASK1ï¼ä½ï¼TASK2ï¼MTX1ï¼TASK1ï¼MTX4ï¼TASK5
+ *	41:	loc_mtx(MTX4)
+ *	//		ä½ï¼TASK2ï¼MTX1ï¼TASK1ï¼MTX4ï¼TASK5âTASK1
+ *	== TASK2ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	42:	loc_mtx(MTX4)
+ *	//		MTX1ï¼TASK1ï¼MTX4ï¼TASK5âTASK1âTASK2
+ *	//		ã¿ã¤ã ã¢ã¦ãå¾
+ã¡
+ *	//		é«ï¼TASK5ï¼MTX1ï¼TASK1ï¼MTX4ï¼TASK5âTASK1âTASK2
+ *	== TASK5ï¼ç¶ãï¼==
+ *	43:	ini_mtx(MTX1)			... (B-1)
+ *	//		é«ï¼TASK5ï¼MTX4ï¼TASK5âTASK2âTASK1
+ *		get_pri(TASK1, &tskpri)
+ *		assert(tskpri == LOW_PRIORITY)
+ *	44:	unl_mtx(MTX4)
+ *	//		é«ï¼TASK5âTASK2ï¼MTX4ï¼TASK2âTASK1
+ *	45:	slp_tsk()
+ *	//		é«ï¼TASK2ï¼MTX4ï¼TASK2âTASK1
+ *	== TASK2ï¼ç¶ãï¼==
+ *	46:	unl_mtx(MTX4)
+ *	//		é«ï¼TASK1ï¼ä½ï¼TASK2ï¼MTX4ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	47:	unl_mtx(MTX4)
+ *	//		ä½ï¼TASK1âTASK2
+ *
+ *	48:	wup_tsk(TASK5)
+ *	== TASK5ï¼ç¶ãï¼==
+ *	49:	loc_mtx(MTX4)
+ *	50:	slp_tsk()
+ *	//		ä½ï¼TASK1âTASK2ï¼MTX4ï¼TASK5
+ *	== TASK1ï¼ç¶ãï¼==
+ *	51:	wup_tsk(TASK3)
+ *	//		ä¸­ï¼TASK3ï¼ä½ï¼TASK1âTASK2ï¼MTX4ï¼TASK5
+ *	== TASK3ï¼ç¶ãï¼==
+ *	52:	loc_mtx(MTX4)
+ *	//		ä½ï¼TASK1âTASK2ï¼MTX4ï¼TASK5âTASK3
+ *	== TASK1ï¼ç¶ãï¼==
+ *	53:	loc_mtx(MTX1)
+ *		loc_mtx(MTX2)
+ *	//		ä¸­ï¼TASK1ï¼ä½ï¼TASK2ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK1ï¼MTX4ï¼TASK5âTASK3
+ *	54:	loc_mtx(MTX4)
+ *	//		ä½ï¼TASK2ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK1ï¼MTX4ï¼TASK5âTASK3âTASK1
+ *	== TASK2ï¼ç¶ãï¼==
+ *	55:	wup_tsk(TASK4)
+ *	== TASK4ï¼ç¶ãï¼==
+ *	56:	loc_mtx(MTX4)
+ *	//		ä½ï¼TASK2ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK1ï¼
+ *	//								MTX4ï¼TASK5âTASK3âTASK1âTASK4
+ *	== TASK2ï¼ç¶ãï¼==
+ *	57:	wup_tsk(TASK5)
+ *	//		é«ï¼TASK5ï¼ä½ï¼TASK2ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK1ï¼
+ *	//								MTX4ï¼TASK5âTASK3âTASK1âTASK4
+ *	== TASK5ï¼ç¶ãï¼==
+ *	58:	ini_mtx(MTX1)			... (B-2)
+ *	//		é«ï¼TASK5ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX4ï¼TASK5âTASK3âTASK1âTASK4
+ *		get_pri(TASK1, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	59:	unl_mtx(MTX4)
+ *	//		é«ï¼TASK5âTASK3ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX4ï¼TASK3âTASK1âTASK4
+ *	60:	slp_tsk()
+ *	//		é«ï¼TASK3ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX4ï¼TASK3âTASK1âTASK4
+ *	== TASK3ï¼ç¶ãï¼==
+ *	61:	unl_mtx(MTX4)
+ *	//		é«ï¼TASK1ï¼ä¸­ï¼TASK3ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX4ï¼TASK1âTASK4
+ *	== TASK1ï¼ç¶ãï¼==
+ *	62:	unl_mtx(MTX4)
+ *	//		é«ï¼TASK4ï¼ä¸­ï¼TASK1âTASK3ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX4ï¼TASK4
+ *	== TASK4ï¼ç¶ãï¼==
+ *	63:	unl_mtx(MTX4)
+ *	//		ä¸­ï¼TASK4âTASK1âTASK3ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1
+ *	64:	slp_tsk()
+ *	//		ä¸­ï¼TASK1âTASK3ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	65:	slp_tsk()
+ *	//		ä¸­ï¼TASK3ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1
+ *	== TASK3ï¼ç¶ãï¼==
+ *	66:	slp_tsk()
+ *	//		ä½ï¼TASK2ï¼MTX2ï¼TASK1
+ *
+ *	== TASK2ï¼ç¶ãï¼==
+ *	67: wup_tsk(TASK5)
+ *	== TASK5ï¼ç¶ãï¼==
+ *	68:	loc_mtx(MTX4)
+ *	69:	slp_tsk()
+ *	//		ä½ï¼TASK2ï¼MTX4ï¼TASK5
+ *	== TASK2ï¼ç¶ãï¼==
+ *	70:	wup_tsk(TASK3)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	71:	loc_mtx(MTX4)
+ *	//		ä½ï¼TASK2ï¼MTX4ï¼TASK5âTASK3
+ *	== TASK2ï¼ç¶ãï¼==
+ *	72:	wup_tsk(TASK1)
+ *	//		ä¸­ï¼TASK1ï¼ä½ï¼TASK2ï¼MTX4ï¼TASK5
+ *	== TASK1ï¼ç¶ãï¼==
+ *	73:	loc_mtx(MTX3)
+ *	//		ä¸­ï¼TASK1ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX3ï¼TASK1ï¼MTX4ï¼TASK5âTASK3
+ *	74:	loc_mtx(MTX4)
+ *	//		ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX3ï¼TASK1ï¼MTX4ï¼TASK5âTASK3âTASK1
+ *	== TASK2ï¼ç¶ãï¼==
+ *	75:	wup_tsk(TASK4)
+ *	== TASK4ï¼ç¶ãï¼==
+ *	76:	loc_mtx(MTX4)
+ *	//		ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX3ï¼TASK1ï¼
+ *	//								MTX4ï¼TASK5âTASK3âTASK1âTASK4
+ *	== TASK2ï¼ç¶ãï¼==
+ *	77:	wup_tsk(TASK5)
+ *	//		é«ï¼TASK5ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX3ï¼TASK1ï¼
+ *	//								MTX4ï¼TASK5âTASK3âTASK1âTASK4
+ *	== TASK5ï¼ç¶ãï¼==
+ *	78:	ini_mtx(MTX3)			... (B-3)
+ *	//		é«ï¼TASK5ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX4ï¼TASK5âTASK3âTASK1âTASK4
+ *		get_pri(TASK1, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	79:	unl_mtx(MTX4)
+ *	//		é«ï¼TASK5âTASK3ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX4ï¼TASK3âTASK1âTASK4
+ *	80:	slp_tsk()
+ *	//		é«ï¼TASK3ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX4ï¼TASK3âTASK1âTASK4
+ *	== TASK3ï¼ç¶ãï¼==
+ *	81:	unl_mtx(MTX4)
+ *	//		é«ï¼TASK1ï¼ä¸­ï¼TASK3ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX4ï¼TASK1âTASK4
+ *	== TASK1ï¼ç¶ãï¼==
+ *	82:	unl_mtx(MTX4)
+ *	//		é«ï¼TASK4ï¼ä¸­ï¼TASK1âTASK3ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1ï¼MTX4ï¼TASK4
+ *	== TASK4ï¼ç¶ãï¼==
+ *	83:	unl_mtx(MTX4)
+ *	//		ä¸­ï¼TASK4âTASK1âTASK3ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1
+ *	84:	slp_tsk()
+ *	//		ä¸­ï¼TASK1âTASK3ï¼ä½ï¼TASK2ï¼MTX2ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	85:	unl_mtx(MTX2)
+ *	//		ä¸­ï¼TASK3ï¼ä½ï¼TASK1âTASK2
+ *	== TASK3ï¼ç¶ãï¼==
+ *	86:	slp_tsk()
+ *	//		ä½ï¼TASK1âTASK2
+ *
+ *	== TASK1ï¼ç¶ãï¼==
+ *	87:	sus_tsk(TASK2)
+ *	//		ä½ï¼TASK1
+ *	88:	loc_mtx(MTX1)
+ *	//		ä¸­ï¼TASK1ï¼MTX1ï¼TASK1
+ *	89:	wup_tsk(TASK3)
+ *	//		ä¸­ï¼TASK1âTASK3ï¼MTX1ï¼TASK1
+ *	90:	rot_rdq(MID_PRIORITY)
+ *	//		ä¸­ï¼TASK3âTASK1ï¼MTX1ï¼TASK1
+ *	== TASK3ï¼ç¶ãï¼==
+ *	91:	loc_mtx(MTX1) -> E_DLT
+ *	//		ä¸­ï¼TASK1ï¼MTX1ï¼TASK1âTASK3
+ *	== TASK1ï¼ç¶ãï¼==
+ *	92:	wup_tsk(TASK5)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK1ï¼MTX1ï¼TASK1âTASK3
+ *	== TASK5ï¼ç¶ãï¼==
+ *	93:	wup_tsk(TASK4)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK1âTASK4ï¼MTX1ï¼TASK1âTASK3
+ *	94:	ini_mtx(MTX1)			... (C-1)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK4âTASK3ï¼ä½ï¼TASK1
+ *	95:	ext_tsk() -> noreturn
+ *	//		ä¸­ï¼TASK4âTASK3ï¼ä½ï¼TASK1
+ *	== TASK4ï¼ç¶ãï¼==
+ *	96:	ext_tsk() -> noreturn
+ *	//		ä¸­ï¼TASK3ï¼ä½ï¼TASK1
+ *	== TASK3ï¼ç¶ãï¼==
+ *	97:	slp_tsk()
+ *	//		ä½ï¼TASK1
+ *
+ *	== TASK1ï¼ç¶ãï¼==
+ *	98:	loc_mtx(MTX1)
+ *	//		ä¸­ï¼TASK1ï¼MTX1ï¼TASK1
+ *	99:	wup_tsk(TASK3)
+ *	//		ä¸­ï¼TASK1âTASK3ï¼MTX1ï¼TASK1
+ * 100:	rot_rdq(MID_PRIORITY)
+ *	//		ä¸­ï¼TASK3âTASK1ï¼MTX1ï¼TASK1
+ *	== TASK3ï¼ç¶ãï¼==
+ * 101:	loc_mtx(MTX1) -> E_DLT
+ *	//		ä¸­ï¼TASK1ï¼MTX1ï¼TASK1âTASK3
+ *	== TASK1ï¼ç¶ãï¼==
+ * 102:	rsm_tsk(TASK2)
+ *	//		ä¸­ï¼TASK1ï¼ä½ï¼TASK2ï¼MTX1ï¼TASK1âTASK3
+ * 103:	slp_tsk()
+ *	//		ä½ï¼TASK2ï¼MTX1ï¼TASK1âTASK3
+ *	== TASK2ï¼ç¶ãï¼==
+ * 104:	ini_mtx(MTX1)			... (C-2)
+ *	//		ä¸­ï¼TASK3ï¼ä½ï¼TASK2
+ *	== TASK3ï¼ç¶ãï¼==
+ * 105:	ext_tsk() -> noreturn
+ *	//		ä½ï¼TASK2
+ *	== TASK2ï¼ç¶ãï¼==
+ * 106:	ter_tsk(TASK1)
+ * 107:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_mutex5.h"
+
+extern ER	bit_mutex(void);
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	set_bit_func(bit_mutex);
+
+	check_point(1);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(3);
+	ercd = act_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(6);
+	ercd = sus_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(7);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(9);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(10);
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(12);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(17);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(20);
+	ercd = loc_mtx(MTX3);
+	check_ercd(ercd, E_OK);
+
+	check_point(21);
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(22);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(23);
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(24);
+	ercd = wup_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(26);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(30);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(33);
+	ercd = rsm_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(34);
+	ercd = ini_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(37);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(40);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(41);
+	ercd = loc_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(47);
+	ercd = unl_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(48);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(51);
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(53);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(54);
+	ercd = loc_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(62);
+	ercd = unl_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(65);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(73);
+	ercd = loc_mtx(MTX3);
+	check_ercd(ercd, E_OK);
+
+	check_point(74);
+	ercd = loc_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(82);
+	ercd = unl_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(85);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(87);
+	ercd = sus_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(88);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(89);
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(90);
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(92);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(98);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(99);
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(100);
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(102);
+	ercd = rsm_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(103);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(42);
+	ercd = loc_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(46);
+	ercd = unl_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(55);
+	ercd = wup_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(57);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(67);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(70);
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(72);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(75);
+	ercd = wup_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(77);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(104);
+	ercd = ini_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(106);
+	ercd = ter_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_finish(107);
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(16);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(29);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(52);
+	ercd = loc_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(61);
+	ercd = unl_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(66);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(71);
+	ercd = loc_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(81);
+	ercd = unl_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(86);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(91);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_DLT);
+
+	check_point(97);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(101);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_DLT);
+
+	check_point(105);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task4(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	PRI		tskpri;
+
+	check_point(18);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(19);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(31);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(32);
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(35);
+	ercd = get_pri(TASK1, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == LOW_PRIORITY);
+
+	check_point(36);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(56);
+	ercd = loc_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(63);
+	ercd = unl_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(64);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(76);
+	ercd = loc_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(83);
+	ercd = unl_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(84);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(96);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task5(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	PRI		tskpri;
+
+	check_point(4);
+	ercd = ini_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TASK1, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == LOW_PRIORITY);
+
+	check_point(5);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = ini_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TASK1, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	check_point(15);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(27);
+	ercd = ini_mtx(MTX3);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TASK1, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	check_point(28);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(38);
+	ercd = loc_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(39);
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(43);
+	ercd = ini_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TASK1, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == LOW_PRIORITY);
+
+	check_point(44);
+	ercd = unl_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(45);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(49);
+	ercd = loc_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(50);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(58);
+	ercd = ini_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TASK1, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	check_point(59);
+	ercd = unl_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(60);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(68);
+	ercd = loc_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(69);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(78);
+	ercd = ini_mtx(MTX3);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TASK1, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	check_point(79);
+	ercd = unl_mtx(MTX4);
+	check_ercd(ercd, E_OK);
+
+	check_point(80);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(93);
+	ercd = wup_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(94);
+	ercd = ini_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(95);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_mutex5.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex5.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex5.cfg	(revision 302)
@@ -0,0 +1,21 @@
+/*
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(5)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_mutex5.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK4, { TA_NULL, 4, task4, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK5, { TA_NULL, 5, task5, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_MTX(MTX1, { TA_CEILING, MID_PRIORITY });
+CRE_MTX(MTX2, { TA_CEILING, MID_PRIORITY });
+CRE_MTX(MTX3, { TA_CEILING, LOW_PRIORITY });
+CRE_MTX(MTX4, { TA_CEILING, HIGH_PRIORITY });
Index: asp3_wo_tecs/trunk/test/test_mutex5.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex5.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex5.h	(revision 302)
@@ -0,0 +1,95 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: test_mutex5.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(5)
+ */
+
+#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	task4(intptr_t exinf);
+extern void	task5(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_mutex6.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex6.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex6.c	(revision 302)
@@ -0,0 +1,548 @@
+/*
+ *  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: test_mutex6.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(6)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã«å¯¾ãã¦ï¼ã¿ã¹ã¯ã®çµäºæï¼ã¿ã¹ã¯ã®åªå
+é ä½
+ *  ã®åè»¢æã®ãã¥ã¼ããã¯ã¹é¢é£ã®å¦çãç¶²ç¾
+çã«ãã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ã¿ã¹ã¯ã®çµäºæï¼ext_tskï¼
+ *		(A-1) ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ï¼1ã¤ï¼ãã­ãã¯è§£é¤ããããã¨ï¼
+ *		(A-2) ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ï¼1ã¤ï¼ãã­ãã¯è§£é¤ããï¼ã­ã
+ *			  ã¯ãå¾
+ã£ã¦ããã¿ã¹ã¯ããããã­ãã¯ãï¼åªå
+åº¦ãå¤åãï¼å¾
+
+ *			  ã¡è§£é¤ããããã¨ï¼
+ *		(A-3) ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ï¼è¤æ°ï¼ããã¹ã¦ã­ãã¯è§£é¤ã
+ *			  ãããã¨ï¼
+ *		(A-4) ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ï¼è¤æ°ï¼ãã­ãã¯è§£é¤ããï¼ã­ã
+ *			  ã¯ãå¾
+ã£ã¦ããã¿ã¹ã¯ï¼è¤æ°ï¼ããããã­ãã¯ãï¼åªå
+åº¦ãå¤
+ *			  åãï¼å¾
+ã¡è§£é¤ããããã¨ï¼ãã®æã«ï¼å¾ã§ãã¥ã¼ããã¯ã¹ã
+ *			  ã­ãã¯ããã¿ã¹ã¯ï¼å
+ã«ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ãå¾
+ã£
+ *			  ã¦ããã¿ã¹ã¯ï¼ã®æ¹ãï¼åªå
+é ä½ãé«ããªããã¨ï¼
+ *	(B) ã¿ã¹ã¯ã®åªå
+é ä½ã®åè»¢ï¼rot_rdqï¼
+ *		(B-1) TPRI_SELFãæå®ããæã«ï¼ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ã®åªå
+é ä½ã
+ *		ãããåè»¢ãããã¨ï¼
+ *		(B-2) TPRI_SELFãæå®ããæã«ï¼ã¿ã¹ã¯ã®ç¾å¨åªå
+åº¦ã®åªå
+é ä½ãå
+ *		ãããè»¢ããªããã¨ï¼
+ *
+ * ããã¹ãé 
+ç®ã®å®ç¾æ¹æ³ã
+ *
+ *	(A-1)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ã«ãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ãã¯ããï¼
+ *		ext_tskããã¨ï¼ã­ãã¯ãè§£é¤ããããã¨ãç¢ºèªããï¼
+ *	(A-2)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ã«é«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ã
+ *		ã¯ããï¼å¥ã®ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK3ï¼ã«MTX1ãå¾
+ãããç¶æ
+ã§ï¼
+ *		TASK2 ãext_tskããã¨ï¼TASK3ãé«åªå
+åº¦ã«ãªã£ã¦å¾
+ã¡è§£é¤ãããã
+ *		ã¨ãç¢ºèªããï¼
+ *	(A-3)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ã«ãã¥ã¼ããã¯ã¹ã2ã¤ï¼MTX1ï¼MTX2ï¼ã­ã
+ *		ã¯ããï¼ext_tskããã¨ï¼ä¸¡æ¹ã®ã­ãã¯ãè§£é¤ããããã¨ãç¢ºèªããï¼
+ *	(A-4)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ã«é«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹2ã¤ï¼MTX1ï¼
+ *		MTX2ï¼ããã®é ã§ã­ãã¯ããï¼å¥ã®ä½åªå
+åº¦ã¿ã¹ã¯2ã¤ï¼TASK3ï¼
+ *		TASK4ï¼ã«ããããã®ã­ãã¯ãå¾
+ãããç¶æ
+ã§ï¼TASK2ãext_tskããã¨ï¼
+ *		TASK3ã¨TASK4ãé«åªå
+åº¦ã«ãªã£ã¦å¾
+ã¡è§£é¤ããããã¨ãç¢ºèªããï¼ã¾
+ *		ãï¼å
+ã«ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãå¾
+ã£ã¦ããã¿ã¹ã¯
+ *		ï¼TASK3ï¼ãï¼TASK4ãããåªå
+é ä½ãé«ããªããã¨ãç¢ºèªããï¼
+ *	(B-1)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ã3ã¤ï¼TASK2ï¼TASK3ï¼TASK4ï¼ãå®è¡ã§ããç¶æ
+ã®æ
+ *		ã«ï¼1ã¤ã®ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ã«é«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã
+ *		ã­ãã¯ããï¼rot_rdq(TPRI_SELF)ããã¨ï¼æ®ãã®2ã¤ã®ä½åªå
+åº¦ã¿ã¹ã¯
+ *		ã®åªå
+é ä½ãåè»¢ãããã¨ãç¢ºèªããï¼
+ *	(B-2)
+ *		ä¸ã¨åãç¶æ³ã§ï¼é«åªå
+åº¦ã¿ã¹ã¯ã®åªå
+é ä½ãåè»¢ããªããã¨ãç¢ºèª
+ *		ããï¼
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä½åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	TASK4: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	MTX1: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯é«åªå
+åº¦ï¼
+ *	MTX2: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯é«åªå
+åº¦ï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä½ï¼==
+ *		call(set_bit_func(bit_mutex))
+ *	1:	act_tsk(TASK2)
+ *	2:	rot_rdq(TPRI_SELF)
+ *	//		ä½ï¼TASK2âTASK1
+ *	== TASK2-1ï¼åªå
+åº¦ï¼ä½ï¼1åã ==
+ *	3:	loc_mtx(MTX1)
+ *	//		é«ï¼TASK2ï¼ä½ï¼TASK1ï¼MTX1ï¼TASK2
+ *	4:	ext_tsk() -> noreturn			... (A-1)
+ *	//		ä½ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	5:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TSK_NONE)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *
+ *	6:	act_tsk(TASK2)
+ *		act_tsk(TASK3)
+ *	7:	rot_rdq(TPRI_SELF)
+ *	//		ä½ï¼TASK2âTASK3âTASK1
+ *	== TASK2-2ï¼åªå
+åº¦ï¼ä½ï¼2åã ==
+ *	8:	loc_mtx(MTX1)
+ *	//		é«ï¼TASK2ï¼ä½ï¼TASK3âTASK1ï¼MTX1ï¼TASK2
+ *	9:	slp_tsk()
+ *	//		ä½ï¼TASK3âTASK1ï¼MTX1ï¼TASK2
+ *	== TASK3ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	10:	loc_mtx(MTX1)
+ *	//		ä½ï¼TASK1ï¼MTX1ï¼TASK2âTASK3
+ *	== TASK1ï¼ç¶ãï¼==
+ *	11:	wup_tsk(TASK2)
+ *	//		é«ï¼TASK2ï¼ä½ï¼TASK1ï¼MTX1ï¼TASK2âTASK3
+ *	== TASK2-2ï¼ç¶ãï¼==
+ *	12:	ext_tsk() -> noreturn			... (A-2)
+ *	//		é«ï¼TASK3ï¼ä½ï¼TASK1ï¼MTX1ï¼TASK3
+ *	== TASK3ï¼ç¶ãï¼==
+ *	13:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK3)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		get_pri(TPRI_SELF, &tskpri)
+ *		assert(tskpri == HIGH_PRIORITY)
+ *		unl_mtx(MTX1)
+ *		slp_tsk()
+ *	//		ä½ï¼TASK1
+ *
+ *	== TASK1ï¼ç¶ãï¼==
+ *	14:	act_tsk(TASK2)
+ *	15:	rot_rdq(TPRI_SELF)
+ *	//		ä½ï¼TASK2âTASK1
+ *	== TASK2-3ï¼åªå
+åº¦ï¼ä½ï¼3åã ==
+ *	16:	loc_mtx(MTX1)
+ *		loc_mtx(MTX2)
+ *	//		é«ï¼TASK2ï¼ä½ï¼TASK1ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2
+ *	17:	ext_tsk() -> noreturn			... (A-3)
+ *	//		ä½ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	18:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TSK_NONE)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		ref_mtx(MTX2, &rmtx)
+ *		assert(rmtx.htskid == TSK_NONE)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *
+ *	19:	act_tsk(TASK2)
+ *		wup_tsk(TASK3)
+ *		act_tsk(TASK4)
+ *	20:	rot_rdq(TPRI_SELF)
+ *	//		ä½ï¼TASK2âTASK3âTASK4âTASK1
+ *	== TASK2-4ï¼åªå
+åº¦ï¼ä½ï¼4åã ==
+ *	21:	loc_mtx(MTX1)
+ *		loc_mtx(MTX2)
+ *	//		é«ï¼TASK2ï¼ä½ï¼TASK3âTASK4âTASK1ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2
+ *	22:	chg_pri(TASK1, HIGH_PRIORITY)
+ *	//		é«ï¼TASK2âTASK1ï¼ä½ï¼TASK3âTASK4ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2
+ *	23:	rot_rdq(TPRI_SELF)				... (B-1)(B-2)
+ *	//		é«ï¼TASK2âTASK1ï¼ä½ï¼TASK4âTASK3ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2
+ *	24:	slp_tsk()
+ *	//		é«ï¼TASK1ï¼ä½ï¼TASK4âTASK3ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2
+ *	== TASK1ï¼ç¶ãï¼==
+ *	25:	chg_pri(TSK_SELF, TPRI_INI)
+ *	//		ä½ï¼TASK4âTASK3âTASK1ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2
+ *	== TASK4ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	26:	loc_mtx(MTX2)
+ *	//		ä½ï¼TASK3âTASK1ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2âTASK4
+ *	== TASK3ï¼ç¶ãï¼==
+ *	27:	loc_mtx(MTX1)
+ *	//		ä½ï¼TASK1ï¼MTX1ï¼TASK2âTASK3ï¼MTX2ï¼TASK2âTASK4
+ *	== TASK1ï¼ç¶ãï¼==
+ *	28:	wup_tsk(TASK2)
+ *	//		é«ï¼TASK2ï¼ä½ï¼TASK1ï¼MTX1ï¼TASK2âTASK3ï¼MTX2ï¼TASK2âTASK4
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	29:	ext_tsk() -> noreturn			... (A-4)
+ *	//		é«ï¼TASK4âTASK3ï¼ä½ï¼TASK1ï¼MTX1ï¼TASK3ï¼MTX2ï¼TASK4
+ *	== TASK4ï¼ç¶ãï¼==
+ *	30:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK3)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		ref_mtx(MTX2, &rmtx)
+ *		assert(rmtx.htskid == TASK4)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		get_pri(TPRI_SELF, &tskpri)
+ *		assert(tskpri == HIGH_PRIORITY)
+ *		ext_tsk() -> noreturn
+ *	//		é«ï¼TASK3ï¼ä½ï¼TASK1ï¼MTX2ï¼TASK4
+ *	== TASK3ï¼ç¶ãï¼==
+ *	31:	get_pri(TPRI_SELF, &tskpri)
+ *		assert(tskpri == HIGH_PRIORITY)
+ *		ext_tsk() -> noreturn
+ *	//		ä½ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	32:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_mutex6.h"
+
+extern ER	bit_mutex(void);
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RMTX	rmtx;
+
+	test_start(__FILE__);
+
+	set_bit_func(bit_mutex);
+
+	check_point(1);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	ercd = rot_rdq(TPRI_SELF);
+	check_ercd(ercd, E_OK);
+
+	check_point(5);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TSK_NONE);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	check_point(6);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(7);
+	ercd = rot_rdq(TPRI_SELF);
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(15);
+	ercd = rot_rdq(TPRI_SELF);
+	check_ercd(ercd, E_OK);
+
+	check_point(18);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TSK_NONE);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = ref_mtx(MTX2, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TSK_NONE);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	check_point(19);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(20);
+	ercd = rot_rdq(TPRI_SELF);
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	ercd = chg_pri(TSK_SELF, TPRI_INI);
+	check_ercd(ercd, E_OK);
+
+	check_point(28);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_finish(32);
+	check_point(0);
+}
+
+static uint_t	task2_count = 0;
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++task2_count) {
+	case 1:
+		check_point(3);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		check_point(4);
+		ercd = ext_tsk();
+
+		check_point(0);
+
+	case 2:
+		check_point(8);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		check_point(9);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(12);
+		ercd = ext_tsk();
+
+		check_point(0);
+
+	case 3:
+		check_point(16);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		ercd = loc_mtx(MTX2);
+		check_ercd(ercd, E_OK);
+
+		check_point(17);
+		ercd = ext_tsk();
+
+		check_point(0);
+
+	case 4:
+		check_point(21);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		ercd = loc_mtx(MTX2);
+		check_ercd(ercd, E_OK);
+
+		check_point(22);
+		ercd = chg_pri(TASK1, HIGH_PRIORITY);
+		check_ercd(ercd, E_OK);
+
+		check_point(23);
+		ercd = rot_rdq(TPRI_SELF);
+		check_ercd(ercd, E_OK);
+
+		check_point(24);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(29);
+		ercd = ext_tsk();
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	PRI		tskpri;
+	T_RMTX	rmtx;
+
+	check_point(10);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK3);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = get_pri(TPRI_SELF, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == HIGH_PRIORITY);
+
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(27);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(31);
+	ercd = get_pri(TPRI_SELF, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == HIGH_PRIORITY);
+
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task4(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	PRI		tskpri;
+	T_RMTX	rmtx;
+
+	check_point(26);
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(30);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK3);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = ref_mtx(MTX2, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK4);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = get_pri(TPRI_SELF, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == HIGH_PRIORITY);
+
+	ercd = ext_tsk();
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_mutex6.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex6.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex6.cfg	(revision 302)
@@ -0,0 +1,18 @@
+/*
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(6)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_mutex6.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK4, { TA_NULL, 4, task4, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_MTX(MTX1, { TA_CEILING, HIGH_PRIORITY });
+CRE_MTX(MTX2, { TA_CEILING, HIGH_PRIORITY });
Index: asp3_wo_tecs/trunk/test/test_mutex6.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex6.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex6.h	(revision 302)
@@ -0,0 +1,94 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: test_mutex6.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(6)
+ */
+
+#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	task4(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_mutex7.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex7.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex7.c	(revision 302)
@@ -0,0 +1,781 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: test_mutex7.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(7)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã«å¯¾ãã¦ï¼ã¿ã¹ã¯ã®å¼·å¶çµäºæã®ãã¥ã¼ããã¯
+ *  ã¹é¢é£ã®å¦çãç¶²ç¾
+çã«ãã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ã¿ã¹ã¯ã®å¼·å¶çµäºæï¼ter_tskï¼
+ *		(A-1) ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ï¼1ã¤ï¼ãã­ãã¯è§£é¤ããããã¨ï¼
+ *		(A-2) ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ï¼1ã¤ï¼ãã­ãã¯è§£é¤ããï¼ã­ã
+ *			  ã¯ãå¾
+ã£ã¦ããã¿ã¹ã¯ããããã­ãã¯ãï¼åªå
+åº¦ãå¤åãï¼å¾
+
+ *			  ã¡è§£é¤ããããã¨ï¼
+ *		(A-3) (A-2)ã®çµæï¼ã¿ã¹ã¯ãã£ã¹ããããèµ·ãããã¨ï¼
+ *		(A-4) ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ï¼è¤æ°ï¼ããã¹ã¦ã­ãã¯è§£é¤ã
+ *			  ãããã¨ï¼
+ *		(A-5) ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ï¼è¤æ°ï¼ãã­ãã¯è§£é¤ããï¼ã­ã
+ *			  ã¯ãå¾
+ã£ã¦ããã¿ã¹ã¯ï¼è¤æ°ï¼ããããã­ãã¯ãï¼åªå
+åº¦ãå¤
+ *			  åãï¼å¾
+ã¡è§£é¤ããããã¨ï¼ãã®æã«ï¼å¾ã§ãã¥ã¼ããã¯ã¹ã
+ *			  ã­ãã¯ããã¿ã¹ã¯ï¼å
+ã«ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ãå¾
+ã£
+ *			  ã¦ããã¿ã¹ã¯ï¼ã®æ¹ãï¼åªå
+é ä½ãé«ããªããã¨ï¼
+ *		(A-6) (A-5)ã®çµæï¼ã¿ã¹ã¯ãã£ã¹ããããèµ·ãããã¨ï¼
+ *
+ * ããã¹ãé 
+ç®ã®å®ç¾æ¹æ³ã
+ *
+ *	(A-1)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ã«ãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ãã¯ããï¼å¥
+ *		ã®ã¿ã¹ã¯ï¼TASK1ï¼ããTASK2ãter_tskããã¨ï¼ã­ãã¯ãè§£é¤ãããã
+ *		ã¨ãç¢ºèªããï¼
+ *	(A-2)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ã«ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ã
+ *		ã¯ããï¼å¥ã®ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK3ï¼ã«MTX1ãå¾
+ãããç¶æ
+ã§ï¼é«åª
+ *		å
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ããTASK2ãter_tskããã¨ï¼TASK3ãä¸­åªå
+åº¦ã«
+ *		ãªã£ã¦å¾
+ã¡è§£é¤ããããã¨ãç¢ºèªããï¼
+ *	(A-3)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ã«ä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ã
+ *		ã¯ããï¼å¥ã®ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK3ï¼ã«MTX1ãå¾
+ãããç¶æ
+ã§ï¼å¥ã®
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ããTASK2ãter_tskããã¨ï¼TASK3ãä¸­åªå
+
+ *		åº¦ã«ãªã£ã¦å¾
+ã¡è§£é¤ããï¼TASK3ã«åãæãããã¨ãç¢ºèªããï¼
+ *	(A-4)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ã«ãã¥ã¼ããã¯ã¹ã2ã¤ï¼MTX1ï¼MTX2ï¼ã­ã
+ *		ã¯ããï¼å¥ã®ã¿ã¹ã¯ï¼TASK1ï¼ããTASK2ãter_tskããã¨ï¼ä¸¡æ¹ã®ã­ã
+ *		ã¯ãè§£é¤ããããã¨ãç¢ºèªããï¼
+ *	(A-5)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ã«é«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹2ã¤ï¼MTX1ï¼
+ *		MTX2ï¼ããã®é ã§ã­ãã¯ããï¼å¥ã®ä½åªå
+åº¦ã¿ã¹ã¯2ã¤ï¼TASK3ï¼
+ *		TASK4ï¼ã«ããããã®ã­ãã¯ãå¾
+ãããç¶æ
+ã§ï¼é«åªå
+åº¦ã¿ã¹ã¯
+ *		ï¼TASK1ï¼ããTASK2ãter_tskããã¨ï¼TASK3ã¨TASK4ãä¸­åªå
+åº¦ã«ãªã£
+ *		ã¦å¾
+ã¡è§£é¤ããããã¨ãç¢ºèªããï¼ã¾ãï¼å
+ã«ã­ãã¯ãã¦ãããã¥ã¼
+ *		ããã¯ã¹ï¼MTX1ï¼ãå¾
+ã£ã¦ããã¿ã¹ã¯ï¼TASK3ï¼ãï¼TASK4ãããåªå
+
+ *		é ä½ãé«ããªããã¨ãç¢ºèªããï¼
+ *	(A-6)
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ã«é«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹2ã¤ï¼MTX1ï¼
+ *		MTX2ï¼ããã®é ã§ã­ãã¯ããï¼å¥ã®ä½åªå
+åº¦ã¿ã¹ã¯2ã¤ï¼TASK3ï¼
+ *		TASK4ï¼ã«ããããã®ã­ãã¯ãå¾
+ãããç¶æ
+ã§ï¼å¥ã®ä½åªå
+åº¦ã¿ã¹ã¯
+ *		ï¼TASK1ï¼ããTASK2 ãter_tskããã¨ï¼TASK3ã¨TASK4ãä¸­åªå
+åº¦ã«ãªã£
+ *		ã¦å¾
+ã¡è§£é¤ããï¼TASK3ã«åãæãããã¨ãç¢ºèªããï¼
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: é«åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	TASK4: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	MTX1: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯ä¸­åªå
+åº¦ï¼
+ *	MTX2: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯ä¸­åªå
+åº¦ï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼é«ï¼==
+ *		call(set_bit_func(bit_mutex))
+ *	1:	act_tsk(TASK2)
+ *	2:	slp_tsk()
+ *	//		ä½ï¼TASK2
+ *	== TASK2-1ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	3:	loc_mtx(MTX1)
+ *	//		ä¸­ï¼TASK2ï¼MTX1ï¼TASK2
+ *	4:	wup_tsk(TASK1)
+ *	//		é«ï¼TASK1ï¼ä¸­ï¼TASK2ï¼MTX1ï¼TASK2
+ *	== TASK1ï¼ç¶ãï¼==
+ *	5:	ter_tsk(TASK2)			... (A-1)
+ *	//		é«ï¼TASK1
+ *	6:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TSK_NONE)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *
+ *	7:	act_tsk(TASK2)
+ *		act_tsk(TASK3)
+ *	8:	slp_tsk()
+ *	//		ä½ï¼TASK2âTASK3
+ *	== TASK2-2ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	9:	loc_mtx(MTX1)
+ *	//		ä¸­ï¼TASK2ï¼ä½ï¼TASK3ï¼MTX1ï¼TASK2
+ *	10:	tslp_tsk(10000U) -> E_TMOUT
+ *	//		ä½ï¼TASK3ï¼MTX1ï¼TASK2
+ *	== TASK3-1ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	11:	loc_mtx(MTX1)
+ *	//		MTX1ï¼TASK2âTASK3
+ *	//		ã¿ã¤ã ã¢ã¦ãå¾
+ *	//		ä¸­ï¼TASK2ï¼MTX1ï¼TASK2âTASK3
+ *	== TASK2-2ï¼ç¶ãï¼==
+ *	12:	wup_tsk(TASK1)
+ *	//		é«ï¼TASK1ï¼ä¸­ï¼TASK2ï¼MTX1ï¼TASK2âTASK3
+ *	== TASK1ï¼ç¶ãï¼==
+ *	13:	ter_tsk(TASK2)			... (A-2)
+ *	//		é«ï¼TASK1ï¼ä¸­ï¼TASK3ï¼MTX1ï¼TASK3
+ *	14:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK3)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		get_pri(TASK3, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	15:	ter_tsk(TASK3)
+ *	//		é«ï¼TASK1
+ *
+ *	16:	act_tsk(TASK2)
+ *		act_tsk(TASK3)
+ *	17:	chg_pri(TSK_SELF, LOW_PRIORITY)
+ *	//		ä½ï¼TASK2âTASK3âTASK1
+ *	== TASK2-3ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	18:	loc_mtx(MTX1)
+ *	//		ä¸­ï¼TASK2ï¼ä½ï¼TASK3âTASK1ï¼MTX1ï¼TASK2
+ *	19:	slp_tsk()
+ *	//		ä½ï¼TASK3âTASK1ï¼MTX1ï¼TASK2
+ *	== TASK3-2ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	20:	loc_mtx(MTX1)
+ *	//		ä½ï¼TASK1ï¼MTX1ï¼TASK2âTASK3
+ *	== TASK1ï¼ç¶ãï¼==
+ *	21:	ter_tsk(TASK2)			... (A-3)
+ *	//		ä¸­ï¼TASK3ï¼ä½ï¼TASK1ï¼MTX1ï¼TASK3
+ *	== TASK3-2ï¼ç¶ãï¼==
+ *	22:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK3)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		get_pri(TASK3, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	23:	ext_tsk() -> noreturn
+ *	//		ä½ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	24:	chg_pri(TSK_SELF, HIGH_PRIORITY)
+ *	//		é«ï¼TASK1
+ *
+ *	25:	act_tsk(TASK2)
+ *	26:	slp_tsk()
+ *	//		ä½ï¼TASK2
+ *	== TASK2-4ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	27:	loc_mtx(MTX1)
+ *		loc_mtx(MTX2)
+ *	//		ä¸­ï¼TASK2ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2
+ *	28:	wup_tsk(TASK1)
+ *	//		é«ï¼TASK1ï¼ä¸­ï¼TASK2ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2
+ *	== TASK1ï¼ç¶ãï¼==
+ *	29:	ter_tsk(TASK2)			... (A-4)
+ *	//		é«ï¼TASK1
+ *	30:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TSK_NONE)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		ref_mtx(MTX2, &rmtx)
+ *		assert(rmtx.htskid == TSK_NONE)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *
+ *	31:	act_tsk(TASK2)
+ *		act_tsk(TASK3)
+ *		act_tsk(TASK4)
+ *	32:	slp_tsk()
+ *	//		ä½ï¼TASK2âTASK3âTASK4
+ *	== TASK2-5ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	33:	loc_mtx(MTX1)
+ *		loc_mtx(MTX2)
+ *	//		ä¸­ï¼TASK2ï¼ä½ï¼TASK3âTASK4ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2
+ *	34:	tslp_tsk(10000U) -> E_TMOUT
+ *	//		ä½ï¼TASK3âTASK4ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2
+ *	== TASK3-3ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	35:	loc_mtx(MTX1)
+ *	//		ä½ï¼TASK4ï¼MTX1ï¼TASK2âTASK3ï¼MTX2ï¼TASK2
+ *	== TASK4-1ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	36:	loc_mtx(MTX2)
+ *	//		MTX1ï¼TASK2âTASK3ï¼MTX2ï¼TASK2âTASK4
+ *	//		ã¿ã¤ã ã¢ã¦ãå¾
+ *	//		ä¸­ï¼TASK2ï¼MTX1ï¼TASK2âTASK3ï¼MTX2ï¼TASK2âTASK4
+ *	== TASK2-5ï¼ç¶ãï¼==
+ *	37:	wup_tsk(TASK1)
+ *	//		é«ï¼TASK1ï¼ä¸­ï¼TASK2ï¼MTX1ï¼TASK2âTASK3ï¼MTX2ï¼TASK2âTASK4
+ *	== TASK1ï¼ç¶ãï¼==
+ *	38:	ter_tsk(TASK2)			... (A-5)
+ *	//		é«ï¼TASK1ï¼ä¸­ï¼TASK4âTASK3ï¼MTX1ï¼TASK3ï¼MTX2ï¼TASK4
+ *	39:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK3)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		ref_mtx(MTX2, &rmtx)
+ *		assert(rmtx.htskid == TASK4)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		get_pri(TASK3, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *		get_pri(TASK4, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	40:	chg_pri(TSK_SELF, LOW_PRIORITY)
+ *	//		ä¸­ï¼TASK4âTASK3ï¼ä½ï¼TASK1ï¼MTX1ï¼TASK3ï¼MTX2ï¼TASK4
+ *	== TASK4-1ï¼ç¶ãï¼==
+ *	41:	ext_tsk() -> noreturn
+ *	//		ä¸­ï¼TASK3ï¼ä½ï¼TASK1ï¼MTX1ï¼TASK3
+ *	== TASK3-3ï¼ç¶ãï¼==
+ *	42:	ext_tsk() -> noreturn
+ *	//		ä½ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	43:	act_tsk(TASK2)
+ *		act_tsk(TASK3)
+ *		act_tsk(TASK4)
+ *	//		ä½ï¼TASK1âTASK2âTASK3âTASK4
+ *	44:	chg_pri(TSK_SELF, LOW_PRIORITY)
+ *	//		ä½ï¼TASK2âTASK3âTASK4âTASK1
+ *	== TASK2-6ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	45:	loc_mtx(MTX1)
+ *		loc_mtx(MTX2)
+ *	//		ä¸­ï¼TASK2ï¼ä½ï¼TASK3âTASK4âTASK1ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2
+ *	46:	slp_tsk()
+ *	//		ä½ï¼TASK3âTASK4âTASK1ï¼MTX1ï¼TASK2ï¼MTX2ï¼TASK2
+ *	== TASK3-4ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	47:	loc_mtx(MTX1)
+ *	//		ä½ï¼TASK4âTASK1ï¼MTX1ï¼TASK2âTASK3ï¼MTX2ï¼TASK2
+ *	== TASK4-2ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	48:	loc_mtx(MTX2)
+ *	//		ä½ï¼TASK1ï¼MTX1ï¼TASK2âTASK3ï¼MTX2ï¼TASK2âTASK4
+ *	== TASK1ï¼ç¶ãï¼==
+ *	49:	ter_tsk(TASK2)			... (A-6)
+ *	//		ä¸­ï¼TASK4âTASK3ï¼ä½ï¼TASK1ï¼MTX1ï¼TASK3ï¼MTX2ï¼TASK4
+ *	== TASK4-2ï¼ç¶ãï¼==
+ *	50:	ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK3)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		ref_mtx(MTX2, &rmtx)
+ *		assert(rmtx.htskid == TASK4)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *		get_pri(TASK3, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *		get_pri(TASK4, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	51:	ext_tsk() -> noreturn
+ *	//		ä¸­ï¼TASK3ï¼ä½ï¼TASK1ï¼MTX1ï¼TASK3
+ *	== TASK3-4ï¼ç¶ãï¼==
+ *	52:	ext_tsk() -> noreturn
+ *	//		ä½ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	53:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_mutex7.h"
+
+extern ER	bit_mutex(void);
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	PRI		tskpri;
+	T_RMTX	rmtx;
+
+	test_start(__FILE__);
+
+	set_bit_func(bit_mutex);
+
+	check_point(1);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(5);
+	ercd = ter_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(6);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TSK_NONE);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	check_point(7);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	ercd = ter_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK3);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = get_pri(TASK3, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	check_point(15);
+	ercd = ter_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(16);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(17);
+	ercd = chg_pri(TSK_SELF, LOW_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(21);
+	ercd = ter_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(24);
+	ercd = chg_pri(TSK_SELF, HIGH_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(26);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(29);
+	ercd = ter_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(30);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TSK_NONE);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = ref_mtx(MTX2, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TSK_NONE);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	check_point(31);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(32);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(38);
+	ercd = ter_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(39);
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK3);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = ref_mtx(MTX2, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK4);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	ercd = get_pri(TASK3, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	ercd = get_pri(TASK4, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	check_point(40);
+	ercd = chg_pri(TSK_SELF, LOW_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(43);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(44);
+	ercd = chg_pri(TSK_SELF, LOW_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(49);
+	ercd = ter_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_finish(53);
+	check_point(0);
+}
+
+static uint_t	task2_count = 0;
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++task2_count) {
+	case 1:
+		check_point(3);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		check_point(4);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 2:
+		check_point(9);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		check_point(10);
+		ercd = tslp_tsk(10000U);
+		check_ercd(ercd, E_TMOUT);
+
+		check_point(12);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 3:
+		check_point(18);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		check_point(19);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 4:
+		check_point(27);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		ercd = loc_mtx(MTX2);
+		check_ercd(ercd, E_OK);
+
+		check_point(28);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 5:
+		check_point(33);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		ercd = loc_mtx(MTX2);
+		check_ercd(ercd, E_OK);
+
+		check_point(34);
+		ercd = tslp_tsk(10000U);
+		check_ercd(ercd, E_TMOUT);
+
+		check_point(37);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 6:
+		check_point(45);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		ercd = loc_mtx(MTX2);
+		check_ercd(ercd, E_OK);
+
+		check_point(46);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	task3_count = 0;
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	PRI		tskpri;
+	T_RMTX	rmtx;
+
+	switch (++task3_count) {
+	case 1:
+		check_point(11);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 2:
+		check_point(20);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		check_point(22);
+		ercd = ref_mtx(MTX1, &rmtx);
+		check_ercd(ercd, E_OK);
+
+		check_assert(rmtx.htskid == TASK3);
+
+		check_assert(rmtx.wtskid == TSK_NONE);
+
+		ercd = get_pri(TASK3, &tskpri);
+		check_ercd(ercd, E_OK);
+
+		check_assert(tskpri == MID_PRIORITY);
+
+		check_point(23);
+		ercd = ext_tsk();
+
+		check_point(0);
+
+	case 3:
+		check_point(35);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		check_point(42);
+		ercd = ext_tsk();
+
+		check_point(0);
+
+	case 4:
+		check_point(47);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		check_point(52);
+		ercd = ext_tsk();
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	task4_count = 0;
+
+void
+task4(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	PRI		tskpri;
+	T_RMTX	rmtx;
+
+	switch (++task4_count) {
+	case 1:
+		check_point(36);
+		ercd = loc_mtx(MTX2);
+		check_ercd(ercd, E_OK);
+
+		check_point(41);
+		ercd = ext_tsk();
+
+		check_point(0);
+
+	case 2:
+		check_point(48);
+		ercd = loc_mtx(MTX2);
+		check_ercd(ercd, E_OK);
+
+		check_point(50);
+		ercd = ref_mtx(MTX1, &rmtx);
+		check_ercd(ercd, E_OK);
+
+		check_assert(rmtx.htskid == TASK3);
+
+		check_assert(rmtx.wtskid == TSK_NONE);
+
+		ercd = ref_mtx(MTX2, &rmtx);
+		check_ercd(ercd, E_OK);
+
+		check_assert(rmtx.htskid == TASK4);
+
+		check_assert(rmtx.wtskid == TSK_NONE);
+
+		ercd = get_pri(TASK3, &tskpri);
+		check_ercd(ercd, E_OK);
+
+		check_assert(tskpri == MID_PRIORITY);
+
+		ercd = get_pri(TASK4, &tskpri);
+		check_ercd(ercd, E_OK);
+
+		check_assert(tskpri == MID_PRIORITY);
+
+		check_point(51);
+		ercd = ext_tsk();
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_mutex7.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex7.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex7.cfg	(revision 302)
@@ -0,0 +1,18 @@
+/*
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(7)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_mutex7.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK4, { TA_NULL, 4, task4, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_MTX(MTX1, { TA_CEILING, MID_PRIORITY });
+CRE_MTX(MTX2, { TA_CEILING, MID_PRIORITY });
Index: asp3_wo_tecs/trunk/test/test_mutex7.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex7.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex7.h	(revision 302)
@@ -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_mutex7.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(7)
+ */
+
+#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	task4(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_mutex8.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex8.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex8.c	(revision 302)
@@ -0,0 +1,858 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2009-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: test_mutex8.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(8)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã«å¯¾ãã¦ï¼chg_priã«ä¼´ããã¥ã¼ããã¯ã¹é¢é£ã®
+ *  åªå
+åº¦å¤æ´å¦çãç¶²ç¾
+çã«ãã¹ãããï¼ãã ãï¼change_priorityã¨
+ *  mutex_calc_priorityã®å
+å®¹ã«ã¯è¸ã¿è¾¼ã¾ãªãï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ã®å¤æ´å¦çï¼chg_priï¼
+ *		(A-1) å¯¾è±¡ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ï¼ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦
+ *			  ããªãå ´åã«ï¼åãåªå
+åº¦å
+ã§ã®åªå
+é ä½ãæä½ã«ãªããã¨
+ *		(A-2) å¯¾è±¡ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ï¼åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ä»¥
+ *			  å¤ã®ãã¥ã¼ããã¯ã¹ã®ã¿ãã­ãã¯ãã¦ããå ´åã«ï¼åãåªå
+åº¦
+ *			  å
+ã§ã®åªå
+é ä½ãæä½ã«ãªããã¨
+ *		(A-3) å¯¾è±¡ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ï¼åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ã
+ *			  ã­ãã¯ãã¦ããå ´åã«ï¼åãåªå
+åº¦å
+ã§ã®åªå
+é ä½ãå¤ãããª
+ *			  ããã¨
+ *		(A-4) å¯¾è±¡ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã§ï¼åªå
+åº¦é ã®å¾
+ã¡è¡åã«ã¤ãªããã¦ã
+ *			  ãï¼ãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããªãå ´åã«ï¼åªå
+åº¦ãæ­£ã
+ *			  ãå¤æ´ããï¼åãåªå
+åº¦å
+ã§ã®é åºãæå¾ã«ãªããã¨
+ *		(A-5) å¯¾è±¡ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã§ï¼åªå
+åº¦é ã®å¾
+ã¡è¡åã«ã¤ãªããã¦ã
+ *			  ãï¼åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ä»¥å¤ã®ãã¥ã¼ããã¯ã¹ã®ã¿ãã­ã
+ *			  ã¯ãã¦ããå ´åã«ï¼åªå
+åº¦ãæ­£ããå¤æ´ããï¼åãåªå
+åº¦å
+ã§
+ *			  ã®é åºãæå¾ã«ãªããã¨
+ *		(A-6) å¯¾è±¡ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã§ï¼åªå
+åº¦é ã®å¾
+ã¡è¡åã«ã¤ãªããã¦ã
+ *			  ãï¼åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ããå ´åã«ï¼åã
+ *			  åªå
+åº¦å
+ã§ã®é åºãå¤ãããªããã¨
+ *	(B) ã¿ã¹ã¯ã®ãã¼ã¹åªå
+åº¦ã®å¤æ´å¦çï¼chg_priï¼ã®E_ILUSEã¨ã©ã¼
+ *		(B-1) å¯¾è±¡ã¿ã¹ã¯ãã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ãã
+ *			  ãï¼ãã¼ã¹åªå
+åº¦ãé«ããããã¨ããæï¼E_ILUSEã¨ã©ã¼ã«ãªã
+ *			  ãã¨
+ *		(B-2) å¯¾è±¡ã¿ã¹ã¯ãåªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ãã¦ãï¼
+ *			  ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ãããï¼ãã¼ã¹åª
+ *			  å
+åº¦ãé«ããããã¨ããªãå ´åã«ã¯ï¼E_ILUSEã¨ã©ã¼ã«ãªããªã
+ *			  ãã¨
+ *		(B-3) å¯¾è±¡ã¿ã¹ã¯ãã­ãã¯ãå¾
+ã£ã¦ãããã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦
+ *			  ãããï¼ãã¼ã¹åªå
+åº¦ãé«ããããã¨ããæï¼E_ILUSEã¨ã©ã¼ã«
+ *			  ãªããã¨
+ *		(B-4) å¯¾è±¡ã¿ã¹ã¯ãåªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹å¾
+ã¡ã§ãã£ã¦ãï¼ã­ã
+ *			  ã¯ãå¾
+ã£ã¦ãããã¥ã¼ããã¯ã¹ã®ä¸éåªå
+åº¦ãããï¼ãã¼ã¹åª
+ *			  å
+åº¦ãé«ããããã¨ããªãå ´åã«ã¯ï¼E_ILUSEã¨ã©ã¼ã«ãªããªã
+ *			  ãã¨
+ *
+ * ããã¹ãé 
+ç®ã®å®ç¾æ¹æ³ã
+ *
+ *	(A-1)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãå®è¡å¯è½ç¶æ
+ã®æã«ï¼é«åªå
+åº¦ã¿ã¹ã¯
+ *		ï¼TASK5ï¼ããTASK1ãä½åªå
+åº¦ã«chg_priããã¨ï¼å®è¡å¯è½ç¶æ
+ã®ä»ã®
+ *		ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK4ï¼ãããï¼åªå
+é ä½ãä½ããªããã¨ãç¢ºèªããï¼
+ *	(A-2)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãåªå
+åº¦é ãã¥ã¼ããã¯ã¹ï¼MTX3ï¼ãã­ãã¯
+ *		ãï¼å®è¡å¯è½ç¶æ
+ã®æã«ï¼é«åªå
+åº¦ã¿ã¹ã¯ï¼TASK5ï¼ããTASK1ãä½åª
+ *		å
+åº¦ã«chg_priããã¨ï¼å®è¡å¯è½ç¶æ
+ã®ä»ã®ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK4ï¼
+ *		ãããï¼åªå
+é ä½ãä½ããªããã¨ãç¢ºèªããï¼
+ *	(A-3)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ã
+ *		ã¯ãï¼å®è¡å¯è½ç¶æ
+ã®æã«ï¼é«åªå
+åº¦ã¿ã¹ã¯ï¼TASK5ï¼ããTASK1ãä½
+ *		åªå
+åº¦ã«chg_priããã¨ï¼TASK1ã®åªå
+åº¦ãå¤åããªããã¨ãç¢ºèªããï¼
+ *		ã¾ãï¼å®è¡å¯è½ç¶æ
+ã®ä¸­åªå
+åº¦ã¿ã¹ã¯ã2ã¤ï¼TASK2ï¼TASK3ï¼ãç¨æã
+ *		ã¦ããï¼åªå
+é ä½ãå¤ãããªããã¨ãç¢ºèªããï¼
+ *	(A-4)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãé«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX2ï¼ãå¾
+ã£
+ *		ã¦ããæã«ï¼é«åªå
+åº¦ã¿ã¹ã¯ï¼TASK5ï¼ããTASK1ãä½åªå
+åº¦ã«
+ *		chg_priããã¨ï¼MTX2ãå¾
+ã£ã¦ããä»ã®ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK4ï¼ãã
+ *		ãï¼å¾
+ã¡è¡åä¸­ã§ã®é åºãå¾ã«ãªããã¨ãç¢ºèªããï¼
+ *	(A-5)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãåªå
+åº¦é ãã¥ã¼ããã¯ã¹ï¼MTX3ï¼ãã­ãã¯
+ *		ãï¼é«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX2ï¼ãå¾
+ã£ã¦ããæã«ï¼é«åªå
+åº¦ã¿
+ *		ã¹ã¯ï¼TASK5ï¼ããTASK1ãä½åªå
+åº¦ã«chg_priããã¨ï¼MTX2ãå¾
+ã£ã¦ã
+ *		ãä»ã®ä½åªå
+åº¦ã¿ã¹ã¯ï¼TASK4ï¼ãããï¼å¾
+ã¡è¡åä¸­ã§ã®é åºãå¤ãã
+ *		ãªããã¨ãç¢ºèªããï¼
+ *	(A-6)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ã
+ *		ã¯ãï¼é«åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX2ï¼ãå¾
+ã£ã¦ããæã«ï¼é«åª
+ *		å
+åº¦ã¿ã¹ã¯ï¼TASK5ï¼ããTASK1ãä½åªå
+åº¦ã«chg_priããã¨ï¼TASK1ã®
+ *		åªå
+åº¦ãå¤åããªããã¨ãç¢ºèªããï¼ã¾ãï¼MTX2ãå¾
+ã£ã¦ããä¸­åªå
+
+ *		åº¦ã¿ã¹ã¯ã2ã¤ï¼TASK2ï¼TASK3ï¼ãç¨æãã¦ããï¼å¾
+ã¡è¡åä¸­ã§ã®é åº
+ *		ãå¤ãããªããã¨ãç¢ºèªããï¼
+ *	(B-1)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK1ï¼ãä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ãã­ã
+ *		ã¯ãï¼å®è¡å¯è½ç¶æ
+ã®æã«ï¼é«åªå
+åº¦ã¿ã¹ã¯ï¼TASK5ï¼ããTASK1ãé«
+ *		åªå
+åº¦ã«chg_priããã¨ï¼E_ILUSEã¨ã©ã¼ã«ãªããã¨ãç¢ºèªããï¼
+ *	(B-2)
+ *		(A-3)ã®ãã¹ãé 
+ç®ã§ï¼chg_priãE_ILUSEã¨ã©ã¼ã«ãªããªããã¨ã§ç¢ºèª
+ *		ã§ãã¦ããï¼
+ *	(B-3)
+ *		ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TASK2ï¼ãä¸­åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ï¼MTX1ï¼ã®ã­ã
+ *		ã¯ãå¾
+ã£ã¦ããæã«ï¼é«åªå
+åº¦ã¿ã¹ã¯ï¼TASK5ï¼ããTASK2ãé«åªå
+åº¦
+ *		ã«chg_priããã¨ï¼E_ILUSEã¨ã©ã¼ã«ãªããã¨ãç¢ºèªããï¼
+ *	(B-4)
+ *		(A-6)ã®ãã¹ãé 
+ç®ã§ï¼chg_priãE_ILUSEã¨ã©ã¼ã«ãªããªããã¨ã§ç¢ºèª
+ *		ã§ãã¦ããï¼
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK4: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	TASK5: é«åªå
+åº¦ã¿ã¹ã¯
+ *	MTX1: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯ä¸­åªå
+åº¦ï¼
+ *	MTX2: ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯é«åªå
+åº¦ï¼
+ *	MTX3: ãã¥ã¼ããã¯ã¹ï¼TA_TPRIå±æ§ï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *		call(set_bit_func(bit_mutex))
+ *	1:	act_tsk(TASK4)
+ *	2:	act_tsk(TASK5)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK1ï¼ä½ï¼TASK4
+ *	== TASK5ï¼åªå
+åº¦ï¼é«ï¼==
+ *	3:	chg_pri(TASK1, LOW_PRIORITY)		... (A-1)
+ *	//		é«ï¼TASK5ï¼ä½ï¼TASK4âTASK1
+ *	4:	slp_tsk()
+ *	== TASK4ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	5:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	6:	chg_pri(TSK_SELF, TPRI_INI)
+ *
+ *	7:	loc_mtx(MTX3)
+ *	8:	wup_tsk(TASK4)
+ *	9:	wup_tsk(TASK5)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK1ï¼ä½ï¼TASK4ï¼MTX3ï¼TASK1
+ *	== TASK5ï¼ç¶ãï¼==
+ *	10:	chg_pri(TASK1, LOW_PRIORITY)		... (A-2)
+ *	//		é«ï¼TASK5ï¼ä½ï¼TASK4âTASK1ï¼MTX3ï¼TASK1
+ *	11:	slp_tsk()
+ *	== TASK4ï¼ç¶ãï¼==
+ *	12:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	13:	unl_mtx(MTX3)
+ *		chg_pri(TSK_SELF, TPRI_INI)
+ *
+ *	14:	loc_mtx(MTX1)
+ *	15:	act_tsk(TASK2)
+ *	16:	dis_dsp()
+ *	17:	rot_rdq(MID_PRIORITY)
+ *	18:	act_tsk(TASK3)
+ *	//		ä¸­ï¼TASK2âTASK1âTASK3ï¼MTX1ï¼TASK1
+ *	19:	wup_tsk(TASK5)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK2âTASK1âTASK3ï¼MTX1ï¼TASK1
+ *	20:	ena_dsp()
+ *	== TASK5ï¼ç¶ãï¼==
+ *	21:	chg_pri(TASK1, LOW_PRIORITY)		... (A-3)(B-2)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK2âTASK1âTASK3ï¼MTX1ï¼TASK1
+ *		get_pri(TASK1, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	22:	slp_tsk()
+ *	//		ä¸­ï¼TASK2âTASK1âTASK3ï¼MTX1ï¼TASK1
+ *	== TASK2ï¼ç¶ãï¼==
+ *	23:	slp_tsk()
+ *	//		ä¸­ï¼TASK1âTASK3ï¼MTX1ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	24:	unl_mtx(MTX1)
+ *	//		ä¸­ï¼TASK3ï¼ä½ï¼TASK1
+ *	== TASK3ï¼ç¶ãï¼==
+ *	25:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	26:	chg_pri(TSK_SELF, TPRI_INI)
+ *
+ *	27:	wup_tsk(TASK5)
+ *	== TASK5ï¼ç¶ãï¼==
+ *	28:	loc_mtx(MTX2)
+ *	29:	tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK1ï¼ç¶ãï¼==
+ *	30:	wup_tsk(TASK4)
+ *	31:	loc_mtx(MTX2)
+ *	== TASK4ï¼ç¶ãï¼==
+ *	32:	loc_mtx(MTX2)
+ *	//		MTX2ï¼TASK5âTASK1âTASK4
+ *	//		ã¿ã¤ã ã¢ã¦ãå¾
+ã¡
+ *	//		é«ï¼TASK5ï¼MTX2ï¼TASK5âTASK1âTASK4
+ *	== TASK5ï¼ç¶ãï¼==
+ *	33:	chg_pri(TASK1, LOW_PRIORITY)		... (A-4)
+ *	//		é«ï¼TASK5ï¼MTX2ï¼TASK5âTASK4âTASK1
+ *	34:	unl_mtx(MTX2)
+ *	//		é«ï¼TASK5âTASK4ï¼MTX2ï¼TASK4âTASK1
+ *	35:	slp_tsk()
+ *	//		é«ï¼TASK4ï¼MTX2ï¼TASK4âTASK1
+ *	== TASK4ï¼ç¶ãï¼==
+ *	36:	unl_mtx(MTX2)
+ *	//		é«ï¼TASK1ï¼ä½ï¼TASK4ï¼MTX2ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	37:	unl_mtx(MTX2)
+ *	//		ä½ï¼TASK1âTASK4
+ *	38:	chg_pri(TSK_SELF, TPRI_INI)
+ *
+ *	39:	loc_mtx(MTX3)
+ *	40:	wup_tsk(TASK5)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK1ï¼ä½ï¼TASK4ï¼MTX3ï¼TASK1
+ *	== TASK5ï¼ç¶ãï¼==
+ *	41:	loc_mtx(MTX2)
+ *	42:	tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK1ï¼ç¶ãï¼==
+ *	43:	loc_mtx(MTX2)
+ *	== TASK4ï¼ç¶ãï¼==
+ *	44:	loc_mtx(MTX2)
+ *	//		MTX2ï¼TASK5âTASK1âTASK4ï¼MTX3ï¼TASK1
+ *	//		ã¿ã¤ã ã¢ã¦ãå¾
+ã¡
+ *	//		é«ï¼TASK5ï¼MTX2ï¼TASK5âTASK1âTASK4ï¼MTX3ï¼TASK1
+ *	== TASK5ï¼ç¶ãï¼==
+ *	45:	chg_pri(TASK1, LOW_PRIORITY)		... (A-5)
+ *	//		é«ï¼TASK5ï¼MTX2ï¼TASK5âTASK4âTASK1ï¼MTX3ï¼TASK1
+ *	46:	unl_mtx(MTX2)
+ *	//		é«ï¼TASK5âTASK4ï¼MTX2ï¼TASK4âTASK1ï¼MTX3ï¼TASK1
+ *	47:	slp_tsk()
+ *	//		é«ï¼TASK4ï¼MTX2ï¼TASK4âTASK1ï¼MTX3ï¼TASK1
+ *	== TASK4ï¼ç¶ãï¼==
+ *	48:	unl_mtx(MTX2)
+ *	//		é«ï¼TASK1ï¼ä½ï¼TASK4ï¼MTX2ï¼TASK1ï¼MTX3ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	49:	unl_mtx(MTX2)
+ *	//		ä½ï¼TASK1âTASK4ï¼MTX3ï¼TASK1
+ *	50:	unl_mtx(MTX3)
+ *	//		ä½ï¼TASK1âTASK4
+ *	51:	ter_tsk(TASK4)
+ *	52:	chg_pri(TSK_SELF, TPRI_INI)
+ *
+ *	53:	loc_mtx(MTX1)
+ *	54:	wup_tsk(TASK5)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK1ï¼MTX1ï¼TASK1
+ *	== TASK5ï¼ç¶ãï¼==
+ *	55:	loc_mtx(MTX2)
+ *	56:	tslp_tsk(10000U) -> E_TMOUT
+ *	//		ä¸­ï¼TASK1ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK5
+ *	== TASK1ï¼ç¶ãï¼==
+ *	57:	wup_tsk(TASK2)
+ *	58:	rot_rdq(MID_PRIORITY)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	59:	loc_mtx(MTX2)
+ *	//		ä¸­ï¼TASK1ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK5âTASK2
+ *	== TASK1ï¼ç¶ãï¼==
+ *	60:	wup_tsk(TASK3)
+ *	61:	loc_mtx(MTX2)
+ *	//		ä¸­ï¼TASK3ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK5âTASK2âTASK1
+ *	== TASK3ï¼ç¶ãï¼==
+ *	62:	loc_mtx(MTX2)
+ *	//		MTX1ï¼TASK1ï¼MTX2ï¼TASK5âTASK2âTASK1âTASK3
+ *	//		ã¿ã¤ã ã¢ã¦ãå¾
+ã¡
+ *	//		é«ï¼TASK5ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK5âTASK2âTASK1âTASK3
+ *	== TASK5ï¼ç¶ãï¼==
+ *	63:	chg_pri(TASK1, LOW_PRIORITY)		... (A-6)(B-4)
+ *	//		é«ï¼TASK5ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK5âTASK2âTASK1âTASK3
+ *		get_pri(TASK1, &tskpri)
+ *		assert(tskpri == MID_PRIORITY)
+ *	64:	unl_mtx(MTX2)
+ *	//		é«ï¼TASK5âTASK2ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK2âTASK1âTASK3
+ *	65:	slp_tsk()
+ *	//		é«ï¼TASK2ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK2âTASK1âTASK3
+ *	== TASK2ï¼ç¶ãï¼==
+ *	66:	unl_mtx(MTX2)
+ *	//		é«ï¼TASK1ï¼ä¸­ï¼TASK2ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK1âTASK3
+ *	== TASK1ï¼ç¶ãï¼==
+ *	67:	unl_mtx(MTX2)
+ *	//		é«ï¼TASK3ï¼ä¸­ï¼TASK1âTASK2ï¼MTX1ï¼TASK1ï¼MTX2ï¼TASK3
+ *	== TASK3ï¼ç¶ãï¼==
+ *	68:	unl_mtx(MTX2)
+ *	//		ä¸­ï¼TASK3âTASK1âTASK2ï¼MTX1ï¼TASK1
+ *	69:	ext_tsk() -> noreturn
+ *	//		ä¸­ï¼TASK1âTASK2ï¼MTX1ï¼TASK1
+ *	== TASK1ï¼ç¶ãï¼==
+ *	70:	chg_pri(TSK_SELF, TPRI_INI)
+ *	//		ä¸­ï¼TASK1âTASK2ï¼MTX1ï¼TASK1
+ *
+ *	71:	rot_rdq(MID_PRIORITY)
+ *	//		ä¸­ï¼TASK2âTASK1ï¼MTX1ï¼TASK1
+ *	== TASK2ï¼ç¶ãï¼==
+ *	72:	loc_mtx(MTX1)
+ *	//		ä¸­ï¼TASK1ï¼MTX1ï¼TASK1âTASK2
+ *	== TASK1ï¼ç¶ãï¼==
+ *	73:	wup_tsk(TASK5)
+ *	//		é«ï¼TASK5ï¼ä¸­ï¼TASK1ï¼MTX1ï¼TASK1âTASK2
+ *	== TASK5ï¼ç¶ãï¼==
+ *	74:	chg_pri(TASK1, HIGH_PRIORITY) -> E_ILUSE	... (B-1)
+ *	75:	chg_pri(TASK2, HIGH_PRIORITY) -> E_ILUSE	... (B-3)
+ *	76:	ext_tsk() -> noreturn
+ *	//		ä¸­ï¼TASK1ï¼MTX1ï¼TASK1âTASK2
+ *	== TASK1ï¼ç¶ãï¼==
+ *	77:	unl_mtx(MTX1)
+ *	//		ä¸­ï¼TASK1âTASK2ï¼MTX1ï¼TASK2
+ *	78:	ext_tsk() -> noreturn
+ *	== TASK2ï¼ç¶ãï¼==
+ *	79:	unl_mtx(MTX1)
+ *	80:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_mutex8.h"
+
+extern ER	bit_mutex(void);
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	set_bit_func(bit_mutex);
+
+	check_point(1);
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	ercd = act_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(6);
+	ercd = chg_pri(TSK_SELF, TPRI_INI);
+	check_ercd(ercd, E_OK);
+
+	check_point(7);
+	ercd = loc_mtx(MTX3);
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	ercd = wup_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(9);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	ercd = unl_mtx(MTX3);
+	check_ercd(ercd, E_OK);
+
+	ercd = chg_pri(TSK_SELF, TPRI_INI);
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(15);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(16);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(17);
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(18);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(19);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(20);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(24);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(26);
+	ercd = chg_pri(TSK_SELF, TPRI_INI);
+	check_ercd(ercd, E_OK);
+
+	check_point(27);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(30);
+	ercd = wup_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(31);
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(37);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(38);
+	ercd = chg_pri(TSK_SELF, TPRI_INI);
+	check_ercd(ercd, E_OK);
+
+	check_point(39);
+	ercd = loc_mtx(MTX3);
+	check_ercd(ercd, E_OK);
+
+	check_point(40);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(43);
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(49);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(50);
+	ercd = unl_mtx(MTX3);
+	check_ercd(ercd, E_OK);
+
+	check_point(51);
+	ercd = ter_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(52);
+	ercd = chg_pri(TSK_SELF, TPRI_INI);
+	check_ercd(ercd, E_OK);
+
+	check_point(53);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(54);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(57);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(58);
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(60);
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(61);
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(67);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(70);
+	ercd = chg_pri(TSK_SELF, TPRI_INI);
+	check_ercd(ercd, E_OK);
+
+	check_point(71);
+	ercd = rot_rdq(MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(73);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(77);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(78);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(23);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(59);
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(66);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(72);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(79);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_finish(80);
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(25);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(62);
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(68);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(69);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task4(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(5);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(12);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(32);
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(36);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(44);
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(48);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task5(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	PRI		tskpri;
+
+	check_point(3);
+	ercd = chg_pri(TASK1, LOW_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(4);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(10);
+	ercd = chg_pri(TASK1, LOW_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(21);
+	ercd = chg_pri(TASK1, LOW_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TASK1, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	check_point(22);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(28);
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(29);
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(33);
+	ercd = chg_pri(TASK1, LOW_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(34);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(35);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(41);
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(42);
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(45);
+	ercd = chg_pri(TASK1, LOW_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(46);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(47);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(55);
+	ercd = loc_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(56);
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(63);
+	ercd = chg_pri(TASK1, LOW_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_pri(TASK1, &tskpri);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskpri == MID_PRIORITY);
+
+	check_point(64);
+	ercd = unl_mtx(MTX2);
+	check_ercd(ercd, E_OK);
+
+	check_point(65);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(74);
+	ercd = chg_pri(TASK1, HIGH_PRIORITY);
+	check_ercd(ercd, E_ILUSE);
+
+	check_point(75);
+	ercd = chg_pri(TASK2, HIGH_PRIORITY);
+	check_ercd(ercd, E_ILUSE);
+
+	check_point(76);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_mutex8.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex8.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex8.cfg	(revision 302)
@@ -0,0 +1,20 @@
+/*
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(8)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_mutex8.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK4, { TA_NULL, 4, task4, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK5, { TA_NULL, 5, task5, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_MTX(MTX1, { TA_CEILING, MID_PRIORITY });
+CRE_MTX(MTX2, { TA_CEILING, HIGH_PRIORITY });
+CRE_MTX(MTX3, { TA_TPRI });
Index: asp3_wo_tecs/trunk/test/test_mutex8.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_mutex8.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_mutex8.h	(revision 302)
@@ -0,0 +1,95 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2009-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_mutex8.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ãã¥ã¼ããã¯ã¹ã®ãã¹ã(8)
+ */
+
+#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	task4(intptr_t exinf);
+extern void	task5(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_notify1.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_notify1.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_notify1.c	(revision 302)
@@ -0,0 +1,658 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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: test_notify1.c 463 2015-10-18 14:25:55Z ertl-hiro $
+ */
+
+/* 
+ *		éç¥å¦çã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *	ã¿ã¤ã ã¤ãã³ãã¨ã¨ã©ã¼ã®éç¥å¦çãæ­£ããåä½ãããã¨ãï¼ã¢ã©ã¼ã é
+ *	ç¥æ©è½ãç¨ãã¦ç¢ºèªããï¼ãã ãï¼ä»¥ä¸ã¯ãã®ãã¹ãã®ç¯å²å¤ã¨ããï¼
+ *	ã»ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºãã«ããéç¥ï¼ä»ã®ãã¹ãã§ã«ãã¼ãã
+ *	ãã¦ããããï¼
+ *	ã»éç¥ã®ã¿ã¤ãã³ã°ã®å¦¥å½æ§ï¼ä»ã®ãã¹ãã§ã«ãã¼ããã¦ããããï¼
+ *	ã»ä»éæ
+å ±ã®ã¨ã©ã¼ãã§ãã¯ï¼ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã§å®æ½ãã¦ããããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ã¿ã¤ã ã¤ãã³ãã®éç¥
+ *		(A-1) å¤æ°ã®è¨­å®
+ *		(A-2) å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã
+ *		(A-3) ã¿ã¹ã¯ã®èµ·å
+ *		(A-4) ã¿ã¹ã¯ã®èµ·åº
+ *		(A-5) ã»ããã©ã®è³æºã®è¿å´
+ *		(A-6) ã¤ãã³ããã©ã°ã®ã»ãã
+ *		(A-7) ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡
+ *	(B) ã¨ã©ã¼ã®éç¥
+ *		(B-1) å¤æ°ã®è¨­å®
+ *		(B-2) å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã
+ *		(B-3) ã¿ã¹ã¯ã®èµ·å
+ *		(B-4) ã¿ã¹ã¯ã®èµ·åº
+ *		(B-5) ã»ããã©ã®è³æºã®è¿å´
+ *		(B-6) ã¤ãã³ããã©ã°ã®ã»ãã
+ *		(B-7) ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	SEM1: ã»ããã©
+ *	FLG1: ã¤ãã³ããã©ã°
+ *	DTQ1: ãã¼ã¿ã­ã¥ã¼
+ *	ALM1:  ã¢ã©ã¼ã éç¥ï¼å¤æ°ã®è¨­å®ã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
+ *	ALM2:  ã¢ã©ã¼ã éç¥ï¼ã¿ã¹ã¯ã®èµ·åã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
+ *	ALM3:  ã¢ã©ã¼ã éç¥ï¼ã¿ã¹ã¯ã®èµ·åºã«ããã¿ã¤ã ã¤ãã³ãã®éç¥ï¼
+ *						 å¤æ°ã®è¨­å®ã«ããã¨ã©ã¼ã®éç¥
+ *	ALM4:  ã¢ã©ã¼ã éç¥ï¼ã»ããã©ã®è³æºã®è¿å´ã«ããã¿ã¤ã ã¤ãã³ãã®éç¥ï¼
+ *						 ã¿ã¹ã¯ã®èµ·åã«ããã¨ã©ã¼ã®éç¥
+ *	ALM5:  ã¢ã©ã¼ã éç¥ï¼ã¤ãã³ããã©ã°ã®ã»ããã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
+ *					   â»ASP3ã«ã¼ãã«ã§ã¯ï¼ã¤ãã³ããã©ã°ã®ã»ããã§ã¨ã©ã¼
+ *						 ã«ãªããã¨ã¯ãªã
+ *	ALM6:  ã¢ã©ã¼ã éç¥ï¼ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ã«ããã¿ã¤ã ã¤ãã³ãã®éç¥ï¼
+ *						 ã¿ã¹ã¯ã®èµ·åºã«ããã¨ã©ã¼ã®éç¥
+ *	ALM7:  ã¢ã©ã¼ã éç¥ï¼ã¿ã¹ã¯ã®èµ·åã«ããã¿ã¤ã ã¤ãã³ãã®éç¥ï¼
+ *						 ã»ããã©ã®è³æºã®è¿å´ã«ããã¨ã©ã¼ã®éç¥
+ *	ALM8:  ã¢ã©ã¼ã éç¥ï¼ã¿ã¹ã¯ã®èµ·åã«ããã¿ã¤ã ã¤ãã³ãã®éç¥ï¼
+ *						 ã¤ãã³ããã©ã°ã®ã»ããã«ããã¨ã©ã¼ã®éç¥
+ *	ALM9:  ã¢ã©ã¼ã éç¥ï¼ã¿ã¹ã¯ã®èµ·åã«ããã¿ã¤ã ã¤ãã³ãã®éç¥ï¼
+ *						 ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡ã«ããã¨ã©ã¼ã®éç¥
+ *	ALM10:  ã¢ã©ã¼ã éç¥ï¼å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ãã«ããã¿ã¤ã ã¤ãã³ãã®éç¥
+ *	ALM11:  ã¢ã©ã¼ã éç¥ï¼ã¿ã¹ã¯ã®èµ·åã«ããã¿ã¤ã ã¤ãã³ãã®éç¥ï¼
+ *						  å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ãã«ããã¨ã©ã¼ã®éç¥
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1 ==
+ *	1:	sta_alm(ALM1, ALM_RELTIM)
+ *		assert(event_variable == false)
+ *		ref_alm(ALM1, &ralm)
+ *		assert((ralm.almstat & TALM_STA) != 0U)
+ *		DO(wait_event())								... (A-1)
+ *	2:	ref_alm(ALM1, &ralm)
+ *		assert((ralm.almstat & TALM_STP) != 0U)
+ *	3:	sta_alm(ALM2, ALM_RELTIM)
+ *		ref_tsk(TASK2, &rtsk)
+ *		assert((rtsk.tskstat & TTS_DMT) != 0U)
+ *		ref_alm(ALM2, &ralm)
+ *		assert((ralm.almstat & TALM_STA) != 0U)
+ *	4:	slp_tsk()
+ *	== TASK2-1ï¼1åç®ï¼==
+ *	5:	ref_alm(ALM2, &ralm)							... (A-3)
+ *		assert((ralm.almstat & TALM_STP) != 0U)
+ *	6:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	7:	sta_alm(ALM3, ALM_RELTIM)
+ *		ref_tsk(TASK2, &rtsk)
+ *		assert((rtsk.tskstat & TTS_RDY) != 0U)
+ *		ref_alm(ALM3, &ralm)
+ *		assert((ralm.almstat & TALM_STA) != 0U)
+ *	8:	slp_tsk()
+ *	== TASK2-1ï¼ç¶ãï¼==
+ *	9:	slp_tsk()										... (A-4)
+ *	10:	ref_alm(ALM3, &ralm)
+ *		assert((ralm.almstat & TALM_STP) != 0U)
+ *	11:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	12:	dly_tsk(1000U)
+ *	== TASK2-1ï¼ç¶ãï¼==
+ *	13:	ext_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	14:	sta_alm(ALM3, ALM_RELTIM)
+ *		DO(wait_error())								... (B-1)
+ *		assert(error_variable == E_OBJ)
+ *	15:	sta_alm(ALM4, ALM_RELTIM)
+ *		ref_sem(SEM1, &rsem)
+ *		assert(rsem.semcnt == 0U)
+ *		ref_alm(ALM4, &ralm)
+ *		assert((ralm.almstat & TALM_STA) != 0U)
+ *	16:	dly_tsk(ALM_RELTIM * 2)
+ *	17:	ref_sem(SEM1, &rsem)							... (A-5)
+ *		assert(rsem.semcnt == 1U)
+ *		ref_alm(ALM4, &ralm)
+ *		assert((ralm.almstat & TALM_STP) != 0U)
+ *	18:	sta_alm(ALM4, ALM_RELTIM)
+ *	19:	slp_tsk()
+ *	== TASK2-2ï¼2åç®ï¼==
+ *	20:	wup_tsk(TASK1)									... (B-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	21:	pol_sem(SEM1)
+ *	22:	sta_alm(ALM5, ALM_RELTIM)
+ *		ref_flg(FLG1, &rflg)
+ *		assert(rflg.flgptn == 0x00U)
+ *		ref_alm(ALM5, &ralm)
+ *		assert((ralm.almstat & TALM_STA) != 0U)
+ *	23:	wai_flg(FLG1, 0x01U, TWF_ORW, &flgptn)			... (A-6)
+ *	== TASK2-2ï¼ç¶ãï¼==
+ *	24:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	25:	assert(flgptn == 0x01U)
+ *		ref_alm(ALM5, &ralm)
+ *		assert((ralm.almstat & TALM_STP) != 0U)
+ *	26:	sta_alm(ALM6, ALM_RELTIM)
+ *		ref_dtq(DTQ1, &rdtq)
+ *		assert(rdtq.sdtqcnt == 0U)
+ *		ref_alm(ALM6, &ralm)
+ *		assert((ralm.almstat & TALM_STA) != 0U)
+ *	27:	dly_tsk(ALM_RELTIM * 2)
+ *	28:	ref_dtq(DTQ1, &rdtq)							... (A-7)
+ *		assert(rdtq.sdtqcnt == 1U)
+ *		ref_alm(ALM6, &ralm)
+ *		assert((ralm.almstat & TALM_STP) != 0U)
+ *	29:	sta_alm(ALM6, ALM_RELTIM)
+ *	30:	slp_tsk()
+ *	== TASK2-2ï¼ç¶ãï¼==
+ *	31:	wup_tsk(TASK1)									... (B-4)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	32:	prcv_dtq(DTQ1, &data)
+ *		assert(data == 0x01)
+ *	33:	act_tsk(TASK2)
+ *		sta_alm(ALM7, ALM_RELTIM)
+ *		ref_sem(SEM1, &rsem)
+ *		assert(rsem.semcnt == 0U)
+ *		ref_alm(ALM7, &ralm)
+ *		assert((ralm.almstat & TALM_STA) != 0U)
+ *	34:	wai_sem(SEM1)									... (B-5)
+ *	== TASK2-2ï¼ç¶ãï¼==
+ *	35:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	36:	ref_alm(ALM7, &ralm)
+ *		assert((ralm.almstat & TALM_STP) != 0U)
+ *	37:	sta_alm(ALM8, ALM_RELTIM)
+ *		ref_flg(FLG1, &rflg)
+ *		assert(rflg.flgptn == 0x01U)
+ *		ref_alm(ALM8, &ralm)
+ *		assert((ralm.almstat & TALM_STA) != 0U)
+ *	38:	wai_flg(FLG1, 0x02U, TWF_ORW, &flgptn)			... (B-6)
+ *	39:	assert(flgptn == 0x03U)
+ *		ref_alm(ALM8, &ralm)
+ *		assert((ralm.almstat & TALM_STP) != 0U)
+ *	40:	sta_alm(ALM9, ALM_RELTIM)
+ *	41:	ref_dtq(DTQ1, &rdtq)
+ *		assert(rdtq.sdtqcnt == 0U)
+ *		ref_alm(ALM9, &ralm)
+ *		assert((ralm.almstat & TALM_STA) != 0U)
+ *	42:	rcv_dtq(DTQ1, &data)							... (B-7)
+ *	43:	assert(data == E_QOVR)
+ *		ref_alm(ALM9, &ralm)
+ *		assert((ralm.almstat & TALM_STP) != 0U)
+ *	44:	sta_alm(ALM10, ALM_RELTIM)
+ *	45:	assert(count_variable == 1)
+ *		ref_alm(ALM10, &ralm)
+ *		assert((ralm.almstat & TALM_STA) != 0U)
+ *		DO(wait_count(1))								... (A-2)
+ *	46:	ref_alm(ALM10, &ralm)
+ *		assert((ralm.almstat & TALM_STP) != 0U)
+ *	47:	sta_alm(ALM11, ALM_RELTIM)
+ *	48:	assert(count_variable == 2)
+ *		ref_alm(ALM11, &ralm)
+ *		assert((ralm.almstat & TALM_STA) != 0U)
+ *		DO(wait_count(2))								... (B-2)
+ *	49:	ref_alm(ALM9, &ralm)
+ *		assert((ralm.almstat & TALM_STP) != 0U)
+ *	50:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_notify1.h"
+
+volatile bool_t	event_variable = false;
+volatile int_t	count_variable = 1;
+volatile ER		error_variable = E_INVALID;
+
+void
+wait_event(void)
+{
+	while (event_variable == false);
+}
+
+void
+wait_count(int_t current)
+{
+	while (count_variable == current);
+}
+
+void
+wait_error(void)
+{
+	while (error_variable == E_INVALID);
+}
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	T_RTSK	rtsk;
+	T_RDTQ	rdtq;
+	T_RFLG	rflg;
+	intptr_t	data;
+	FLGPTN	flgptn;
+	ER_UINT	ercd;
+	T_RALM	ralm;
+	T_RSEM	rsem;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	ercd = sta_alm(ALM1, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	check_assert(event_variable == false);
+
+	ercd = ref_alm(ALM1, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STA) != 0U);
+
+	wait_event();
+
+	check_point(2);
+	ercd = ref_alm(ALM1, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STP) != 0U);
+
+	check_point(3);
+	ercd = sta_alm(ALM2, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert((rtsk.tskstat & TTS_DMT) != 0U);
+
+	ercd = ref_alm(ALM2, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STA) != 0U);
+
+	check_point(4);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(7);
+	ercd = sta_alm(ALM3, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert((rtsk.tskstat & TTS_RDY) != 0U);
+
+	ercd = ref_alm(ALM3, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STA) != 0U);
+
+	check_point(8);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(12);
+	ercd = dly_tsk(1000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = sta_alm(ALM3, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	wait_error();
+
+	check_assert(error_variable == E_OBJ);
+
+	check_point(15);
+	ercd = sta_alm(ALM4, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_sem(SEM1, &rsem);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rsem.semcnt == 0U);
+
+	ercd = ref_alm(ALM4, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STA) != 0U);
+
+	check_point(16);
+	ercd = dly_tsk(ALM_RELTIM * 2);
+	check_ercd(ercd, E_OK);
+
+	check_point(17);
+	ercd = ref_sem(SEM1, &rsem);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rsem.semcnt == 1U);
+
+	ercd = ref_alm(ALM4, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STP) != 0U);
+
+	check_point(18);
+	ercd = sta_alm(ALM4, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	check_point(19);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(21);
+	ercd = pol_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(22);
+	ercd = sta_alm(ALM5, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_flg(FLG1, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.flgptn == 0x00U);
+
+	ercd = ref_alm(ALM5, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STA) != 0U);
+
+	check_point(23);
+	ercd = wai_flg(FLG1, 0x01U, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	check_assert(flgptn == 0x01U);
+
+	ercd = ref_alm(ALM5, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STP) != 0U);
+
+	check_point(26);
+	ercd = sta_alm(ALM6, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_dtq(DTQ1, &rdtq);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rdtq.sdtqcnt == 0U);
+
+	ercd = ref_alm(ALM6, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STA) != 0U);
+
+	check_point(27);
+	ercd = dly_tsk(ALM_RELTIM * 2);
+	check_ercd(ercd, E_OK);
+
+	check_point(28);
+	ercd = ref_dtq(DTQ1, &rdtq);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rdtq.sdtqcnt == 1U);
+
+	ercd = ref_alm(ALM6, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STP) != 0U);
+
+	check_point(29);
+	ercd = sta_alm(ALM6, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	check_point(30);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(32);
+	ercd = prcv_dtq(DTQ1, &data);
+	check_ercd(ercd, E_OK);
+
+	check_assert(data == 0x01);
+
+	check_point(33);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = sta_alm(ALM7, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_sem(SEM1, &rsem);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rsem.semcnt == 0U);
+
+	ercd = ref_alm(ALM7, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STA) != 0U);
+
+	check_point(34);
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(36);
+	ercd = ref_alm(ALM7, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STP) != 0U);
+
+	check_point(37);
+	ercd = sta_alm(ALM8, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_flg(FLG1, &rflg);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rflg.flgptn == 0x01U);
+
+	ercd = ref_alm(ALM8, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STA) != 0U);
+
+	check_point(38);
+	ercd = wai_flg(FLG1, 0x02U, TWF_ORW, &flgptn);
+	check_ercd(ercd, E_OK);
+
+	check_point(39);
+	check_assert(flgptn == 0x03U);
+
+	ercd = ref_alm(ALM8, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STP) != 0U);
+
+	check_point(40);
+	ercd = sta_alm(ALM9, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	check_point(41);
+	ercd = ref_dtq(DTQ1, &rdtq);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rdtq.sdtqcnt == 0U);
+
+	ercd = ref_alm(ALM9, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STA) != 0U);
+
+	check_point(42);
+	ercd = rcv_dtq(DTQ1, &data);
+	check_ercd(ercd, E_OK);
+
+	check_point(43);
+	check_assert(data == E_QOVR);
+
+	ercd = ref_alm(ALM9, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STP) != 0U);
+
+	check_point(44);
+	ercd = sta_alm(ALM10, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	check_point(45);
+	check_assert(count_variable == 1);
+
+	ercd = ref_alm(ALM10, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STA) != 0U);
+
+	wait_count(1);
+
+	check_point(46);
+	ercd = ref_alm(ALM10, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STP) != 0U);
+
+	check_point(47);
+	ercd = sta_alm(ALM11, ALM_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	check_point(48);
+	check_assert(count_variable == 2);
+
+	ercd = ref_alm(ALM11, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STA) != 0U);
+
+	wait_count(2);
+
+	check_point(49);
+	ercd = ref_alm(ALM9, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STP) != 0U);
+
+	check_finish(50);
+	check_point(0);
+}
+
+static uint_t	task2_count = 0;
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RALM	ralm;
+
+	switch (++task2_count) {
+	case 1:
+		check_point(5);
+		ercd = ref_alm(ALM2, &ralm);
+		check_ercd(ercd, E_OK);
+
+		check_assert((ralm.almstat & TALM_STP) != 0U);
+
+		check_point(6);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(9);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(10);
+		ercd = ref_alm(ALM3, &ralm);
+		check_ercd(ercd, E_OK);
+
+		check_assert((ralm.almstat & TALM_STP) != 0U);
+
+		check_point(11);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(13);
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 2:
+		check_point(20);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(24);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(31);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(35);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_notify1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_notify1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_notify1.cfg	(revision 302)
@@ -0,0 +1,28 @@
+/*
+ *		éç¥å¦çã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_notify1.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_SEM(SEM1, { TA_NULL, 0, 1 });
+CRE_FLG(FLG1, { TA_NULL, 0x00 });
+CRE_DTQ(DTQ1, { TA_NULL, 1, NULL });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_SETVAR, &event_variable, true }});
+CRE_ALM(ALM2, { TA_NULL, { TNFY_ACTTSK, TASK2 }});
+CRE_ALM(ALM3, { TA_NULL, { TNFY_WUPTSK|TENFY_SETVAR, TASK2, &error_variable }});
+CRE_ALM(ALM4, { TA_NULL, { TNFY_SIGSEM|TENFY_ACTTSK, SEM1, TASK2 }});
+CRE_ALM(ALM5, { TA_NULL, { TNFY_SETFLG, FLG1, 0x01 }});
+CRE_ALM(ALM6, { TA_NULL, { TNFY_SNDDTQ|TENFY_WUPTSK, DTQ1, 0x01, TASK2 }});
+CRE_ALM(ALM7, { TA_NULL, { TNFY_ACTTSK|TENFY_SIGSEM, TASK2, SEM1 }});
+CRE_ALM(ALM8, { TA_NULL, { TNFY_ACTTSK|TENFY_SETFLG, TASK2, FLG1, 0x02 }});
+CRE_ALM(ALM9, { TA_NULL, { TNFY_ACTTSK|TENFY_SNDDTQ, TASK2, DTQ1 }});
+CRE_ALM(ALM10, { TA_NULL, { TNFY_INCVAR, &count_variable }});
+CRE_ALM(ALM11, { TA_NULL, { TNFY_ACTTSK|TENFY_INCVAR, TASK2, &count_variable }});
Index: asp3_wo_tecs/trunk/test/test_notify1.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_notify1.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_notify1.h	(revision 302)
@@ -0,0 +1,105 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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: test_notify1.h 463 2015-10-18 14:25:55Z 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 ALM_RELTIM
+#define ALM_RELTIM		5000U		/* ã¢ã©ã¼ã ãã³ãã©ã«ä»æããç¸å¯¾æé */
+#endif /* ALM_RELTIM */
+
+#define E_INVALID		(-1)		/* ã¨ã©ã¼ã³ã¼ãã¨ãã¦ç¡å¹ãªå¤ */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+extern void	task1(intptr_t exinf);
+extern void	task2(intptr_t exinf);
+
+/*
+ *  å¤æ°ã®å®£è¨
+ */
+extern volatile bool_t event_variable;
+extern volatile int_t count_variable;
+extern volatile ER error_variable;
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_raster1.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_raster1.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_raster1.c	(revision 302)
@@ -0,0 +1,827 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: test_raster1.c 453 2015-08-15 23:05:31Z ertl-hiro $
+ */
+
+/* 
+ *		ã¿ã¹ã¯çµäºè¦æ±æ©è½ã«é¢ãããã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *	ras_terã®æ¯èãã®ãã¹ãï¼»NGKI3469ï¼½
+ *	  ã»ras_terã«é¢ãããã¹ã¦ã®è¦æ±ããã¹ãããï¼
+ *	  ã»ras_teré¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
+ *	ã¿ã¹ã¯çµäºæã«è¡ãã¹ãå¦çã«é¢ãããã¹ã
+ *	  ã»ã¿ã¹ã¯çµäºæã«è¡ãã¹ãå¦çã«é¢ãããã¹ã¦ã®è¦æ±ããã¹ãããï¼
+ *	  ã»task_terminateé¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼ras_terããå¼ã³åºã
+ *		ãå ´åã«å®è¡ããããã¨ããªããã¹ãé¤ãï¼ï¼
+ *	ã¿ã¹ã¯çµäºè¦æ±æ©è½ã«é¢é£ãã¦ã¿ã¹ã¯ãæã¤æ
+å ±ã«é¢ãããã¹ã
+ *	ref_tskã®ã¿ã¹ã¯çµäºè¦æ±æ©è½ã«é¢ãããã¹ã
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) ras_terã®ã¨ã©ã¼æ¤åº
+ *		(A-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãï¼»NGKI3470ï¼½
+ *		(A-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºãï¼»NGKI3471ï¼½
+ *		(A-3) tskidãæå¹ç¯å²å¤ï¼å°ããããï¼ï¼»NGKI3472ï¼½
+ *		(A-4) tskidãæå¹ç¯å²å¤ï¼å¤§ããããï¼ï¼»NGKI3472ï¼½
+ *		(A-5) å¯¾è±¡ã¿ã¹ã¯ãèªã¿ã¹ã¯ï¼»NGKI3475ï¼½
+ *		(A-6) å¯¾è±¡ã¿ã¹ã¯ãä¼æ­¢ç¶æ
+ï¼»NGKI3476ï¼½
+ *	(B) ras_terã«ããã¿ã¹ã¯çµäºï¼»NGKI3477ï¼½
+ *		(B-1) å¯¾è±¡ã¿ã¹ã¯ãå®è¡å¯è½ç¶æ
+ããä¼æ­¢ç¶æ
+ã«ï¼»NGKI1178ï¼½
+ *		(B-2) å¯¾è±¡ã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ããä¼æ­¢ç¶æ
+ã«ï¼»NGKI1178ï¼½
+ *		(B-3) ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤ï¼»NGKI2019ï¼½
+ *		(B-4) (B-3)ã®å¦çã«ããå¾
+ã¡è§£é¤ãããã¿ã¹ã¯ã«åæã
+ *	(C) ras_terã«ããã¿ã¹ã¯çµäºã¨åèµ·åï¼»NGKI1179ï¼½
+ *		(C-1) å¯¾è±¡ã¿ã¹ã¯ãå®è¡å¯è½ç¶æ
+ã«
+ *		(C-2) (C-1)ã®æã«èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã1æ¸å°ï¼»NGKI1180ï¼½
+ *		(C-3) å¯¾è±¡ã¿ã¹ã¯ãå®è¡ç¶æ
+ã«
+ *	(D) ras_terã«ããã¿ã¹ã¯çµäºè¦æ±
+ *		(D-1) ã¿ã¹ã¯çµäºè¦æ±ãã»ãããããï¼»NGKI3478ï¼½
+ *		(D-2) å¯¾è±¡ã¿ã¹ã¯ãå¾
+ã¡è§£é¤ããå®è¡å¯è½ç¶æ
+ã«ï¼»NGKI3479ï¼½
+ *		(D-3) å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ããE_RASTERãè¿ãï¼»NGKI3480ï¼½
+ *		(D-4) å¯¾è±¡ã¿ã¹ã¯ãå¾
+ã¡è§£é¤ããå®è¡ç¶æ
+ã«ï¼»NGKI3479ï¼½
+ *		(D-5) å¯¾è±¡ã¿ã¹ã¯ãå¼·å¶å¾
+ã¡ããåéããå®è¡ç¶æ
+ã«ï¼»NGKI3606ï¼½
+ *	(E) ã¿ã¹ã¯èµ·åæã®åæåã«é¢é£ãããã¹ã
+ *		(E-1) ã¿ã¹ã¯çµäºè¦æ±ãã©ã°ãã¯ãªã¢ããããã¨ï¼»NGKI3451ï¼½
+ *		(E-2) ã¿ã¹ã¯çµäºç¦æ­¢ãã©ã°ãã¯ãªã¢ããããã¨ï¼»NGKI3454ï¼½
+ *	(F) ã¿ã¹ã¯çµäºè¦æ±ãã©ã°ãã»ãããããæã®æ¯èãï¼ç¶²ç¾
+ã¯ããªãï¼
+ *		(F-1) ã»ãããããå ´åã«ã¿ã¹ã¯ãå¾
+ã¡è§£é¤ããããã¨ï¼»NGKI3452ï¼½
+ *		(F-2) ã»ãããããã¿ã¹ã¯ãå¾
+ã¡ç¶æ
+ã«é·ç§»ãããã¨ããã¨E_RASTERã¨
+ *			  ã©ã¼ã¨ãªããã¨ï¼»NGKI3453ï¼½
+ *		(F-3) ã»ãããããå ´åã«ã¿ã¹ã¯ãå¼·å¶å¾
+ã¡ããåéããããã¨ï¼»NGKI3452ï¼½
+ *		(F-4) ã»ãããããã¿ã¹ã¯ãå¼·å¶å¾
+ã¡ç¶æ
+ã«é·ç§»ãããã¨ããã¨
+ *			  E_RASTERã¨ã©ã¼ã¨ãªããã¨ï¼»NGKI3607ï¼½
+ *	(G) ref_tskã®ã¿ã¹ã¯çµäºè¦æ±æ©è½ã«é¢é£ãããã¹ã
+ *		(G-1) ã¿ã¹ã¯çµäºè¦æ±ãã©ã°ãã»ããããã¦ããå ´åã«rasterã«trueã
+ *			  è¿ããã¨ï¼»NGKI3467ï¼½
+ *		(G-2) ã¿ã¹ã¯çµäºè¦æ±ãã©ã°ãã¯ãªã¢ããã¦ããå ´åã«rasterã«falseã
+ *			  è¿ããã¨ï¼»NGKI3467ï¼½
+ *		(G-3) ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã®å ´åã«disterã«trueãè¿ããã¨ï¼»NGKI3468ï¼½
+ *		(G-4) ã¿ã¹ã¯çµäºè¨±å¯ç¶æ
+ã®å ´åã«disterã«falseãè¿ããã¨ï¼»NGKI3468ï¼½
+ *	ASPã«ã¼ãã«ã«é©ç¨ãããªãè¦æ±ï¼
+ *		ï¼»NGKI3473ï¼½ï¼»NGKI3474ï¼½ï¼»NGKI3481ï¼½
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	TASK2: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: é«åªå
+åº¦ã¿ã¹ã¯
+ *	TASK4: é«åªå
+åº¦ã¿ã¹ã¯
+ *	ALM1: ã¢ã©ã¼ã ãã³ãã©
+ *	MTX1: ãã¥ã¼ããã¯ã¹
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1 ==
+ *		call(set_bit_func(bit_kernel))
+ *	1:	act_tsk(TASK2)
+ *		sta_alm(ALM1, 10000U)
+ *		slp_tsk()
+ *	== TASK2-1ï¼1åç®ï¼==
+ *	2:	DO(while(true))
+ *	== ALM1 ==
+ *	3:	ras_ter(TASK2) -> E_CTX						... (A-1)
+ *		wup_tsk(TASK1)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	4:	loc_cpu()
+ *		ras_ter(TASK2) -> E_CTX						... (A-2)
+ *		unl_cpu()
+ *	5:	ras_ter(0U) -> E_ID							... (A-3)
+ *		ras_ter(TNUM_TSKID + 1) -> E_ID				... (A-4)
+ *		ras_ter(TASK1) -> E_ILUSE					... (A-5)
+ *		ras_ter(TASK3) -> E_OBJ						... (A-6)
+ *	6:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RDY)
+ *	7:	ras_ter(TASK2)								... (B-1)
+ *	8:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_DMT)
+ *	9:	act_tsk(TASK3)
+ *	== TASK3-1ï¼1åç®ï¼==
+ *	10:	tloc_mtx(MTX1, 10000U)
+ *	11:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	12:	ref_tsk(TASK3, &rtsk)
+ *		assert(rtsk.tskstat == TTS_WAI)
+ *		ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK3)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *	13:	ras_ter(TASK3)								... (B-2)
+ *	14:	ref_tsk(TASK3, &rtsk)
+ *		assert(rtsk.tskstat == TTS_DMT)
+ *		ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TSK_NONE)				... (B-3)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *	15:	act_tsk(TASK3)
+ *	== TASK3-2ï¼2åç®ï¼==
+ *	16:	loc_mtx(MTX1)
+ *	17:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	18:	act_tsk(TASK4)
+ *	== TASK4 ==
+ *	19:	loc_mtx(MTX1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	20:	ref_tsk(TASK3, &rtsk)
+ *		assert(rtsk.tskstat == TTS_WAI)
+ *		ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK3)
+ *		assert(rmtx.wtskid == TASK4)
+ *	21:	ras_ter(TASK3)								... (B-4)
+ *	== TASK4ï¼ç¶ãï¼==
+ *	22:	ref_tsk(TASK3, &rtsk)
+ *		assert(rtsk.tskstat == TTS_DMT)
+ *		ref_mtx(MTX1, &rmtx)
+ *		assert(rmtx.htskid == TASK4)
+ *		assert(rmtx.wtskid == TSK_NONE)
+ *	23:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	24:	act_tsk(TASK2)
+ *		act_tsk(TASK2)
+ *	25:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RDY)
+ *		assert(rtsk.actcnt == 1U)
+ *	26:	ras_ter(TASK2)								... (C-1)
+ *	27:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RDY)
+ *		assert(rtsk.actcnt == 0U)					... (C-2)
+ *	28:	act_tsk(TASK3)
+ *	== TASK3-3ï¼3åç®ï¼==
+ *	29:	slp_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	30:	act_tsk(TASK3)
+ *	31:	ref_tsk(TASK3, &rtsk)
+ *		assert(rtsk.tskstat == TTS_WAI)
+ *		assert(rtsk.actcnt == 1U)
+ *	32:	ras_ter(TASK3)								... (C-3)
+ *	== TASK3-4ï¼4åç®ï¼==
+ *	33:	ref_tsk(TASK3, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RUN)
+ *		assert(rtsk.actcnt == 0U)
+ *		ext_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	34:	act_tsk(TASK2)
+ *		slp_tsk()
+ *	== TASK2-2ï¼2åç®ï¼==
+ *	35:	dis_ter()
+ *		wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	36:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RDY)
+ *		assert(rtsk.raster == false)				... (G-2)
+ *		assert(rtsk.dister == true)					... (G-3)
+ *	37:	ras_ter(TASK2)								... (D-1)
+ *	38:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RDY)
+ *		assert(rtsk.raster == true)					... (G-1)
+ *		assert(rtsk.dister == true)
+ *	39:	ter_tsk(TASK2)
+ *		act_tsk(TASK2)
+ *	40:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RDY)
+ *		assert(rtsk.raster == false)				... (E-1)
+ *		assert(rtsk.dister == false)				... (E-2)(G-4)
+ *		tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK2-3ï¼3åç®ï¼==
+ *	41:	dis_ter()
+ *		slp_tsk() -> E_RASTER						... (D-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	42:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_WAI)
+ *		assert(rtsk.raster == false)
+ *		assert(rtsk.dister == true)
+ *	43:	ras_ter(TASK2)								... (D-2)(F-1)
+ *	44:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RDY)
+ *		assert(rtsk.raster == true)
+ *		assert(rtsk.dister == true)
+ *		slp_tsk()
+ *	== TASK2-3ï¼ç¶ãï¼==
+ *	45:	wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	46:	act_tsk(TASK3)
+ *	== TASK3-5ï¼5åç®ï¼==
+ *	47:	dis_ter()
+ *		slp_tsk() -> E_RASTER
+ *	== TASK1ï¼ç¶ãï¼==
+ *	48:	ref_tsk(TASK3, &rtsk)
+ *		assert(rtsk.tskstat == TTS_WAI)
+ *		assert(rtsk.raster == false)
+ *		assert(rtsk.dister == true)
+ *	49:	ras_ter(TASK3)								... (D-4)
+ *	== TASK3-5ï¼ç¶ãï¼==
+ *	50:	ref_tsk(TASK3, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RUN)
+ *		assert(rtsk.raster == true)
+ *		assert(rtsk.dister == true)
+ *	51:	slp_tsk() -> E_RASTER						... (F-2)
+ *		ena_ter()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	52:	ref_tsk(TASK3, &rtsk)
+ *		assert(rtsk.tskstat == TTS_DMT)
+ *	53:	act_tsk(TASK3)
+ *	== TASK3-6ï¼6åç®ï¼==
+ *	54:	dis_ter()
+ *		sus_tsk(TSK_SELF)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	55:	ref_tsk(TASK3, &rtsk)
+ *		assert(rtsk.tskstat == TTS_SUS)
+ *	56:	ras_ter(TASK3)								... (D-5)(F-3)
+ *	== TASK3-6ï¼ç¶ãï¼==
+ *	57:	ref_tsk(TASK3, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RUN)
+ *		assert(rtsk.raster == true)
+ *		assert(rtsk.dister == true)
+ *		sus_tsk(TSK_SELF) -> E_RASTER				... (F-4)
+ *		ena_ter()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	58:	ref_tsk(TASK3, &rtsk)
+ *		assert(rtsk.tskstat == TTS_DMT)
+ *	59:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_raster1.h"
+
+extern ER	bit_kernel(void);
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(3);
+	ercd = ras_ter(TASK2);
+	check_ercd(ercd, E_CTX);
+
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RTSK	rtsk;
+	T_RMTX	rmtx;
+
+	test_start(__FILE__);
+
+	set_bit_func(bit_kernel);
+
+	check_point(1);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(4);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	ercd = ras_ter(TASK2);
+	check_ercd(ercd, E_CTX);
+
+	ercd = unl_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_point(5);
+	ercd = ras_ter(0U);
+	check_ercd(ercd, E_ID);
+
+	ercd = ras_ter(TNUM_TSKID + 1);
+	check_ercd(ercd, E_ID);
+
+	ercd = ras_ter(TASK1);
+	check_ercd(ercd, E_ILUSE);
+
+	ercd = ras_ter(TASK3);
+	check_ercd(ercd, E_OBJ);
+
+	check_point(6);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_RDY);
+
+	check_point(7);
+	ercd = ras_ter(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_DMT);
+
+	check_point(9);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(12);
+	ercd = ref_tsk(TASK3, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_WAI);
+
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK3);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	check_point(13);
+	ercd = ras_ter(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = ref_tsk(TASK3, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_DMT);
+
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TSK_NONE);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	check_point(15);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(18);
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(20);
+	ercd = ref_tsk(TASK3, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_WAI);
+
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK3);
+
+	check_assert(rmtx.wtskid == TASK4);
+
+	check_point(21);
+	ercd = ras_ter(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(24);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_RDY);
+
+	check_assert(rtsk.actcnt == 1U);
+
+	check_point(26);
+	ercd = ras_ter(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(27);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_RDY);
+
+	check_assert(rtsk.actcnt == 0U);
+
+	check_point(28);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(30);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(31);
+	ercd = ref_tsk(TASK3, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_WAI);
+
+	check_assert(rtsk.actcnt == 1U);
+
+	check_point(32);
+	ercd = ras_ter(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(34);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(36);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_RDY);
+
+	check_assert(rtsk.raster == false);
+
+	check_assert(rtsk.dister == true);
+
+	check_point(37);
+	ercd = ras_ter(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(38);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_RDY);
+
+	check_assert(rtsk.raster == true);
+
+	check_assert(rtsk.dister == true);
+
+	check_point(39);
+	ercd = ter_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(40);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_RDY);
+
+	check_assert(rtsk.raster == false);
+
+	check_assert(rtsk.dister == false);
+
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(42);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_WAI);
+
+	check_assert(rtsk.raster == false);
+
+	check_assert(rtsk.dister == true);
+
+	check_point(43);
+	ercd = ras_ter(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(44);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_RDY);
+
+	check_assert(rtsk.raster == true);
+
+	check_assert(rtsk.dister == true);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(46);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(48);
+	ercd = ref_tsk(TASK3, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_WAI);
+
+	check_assert(rtsk.raster == false);
+
+	check_assert(rtsk.dister == true);
+
+	check_point(49);
+	ercd = ras_ter(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(52);
+	ercd = ref_tsk(TASK3, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_DMT);
+
+	check_point(53);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(55);
+	ercd = ref_tsk(TASK3, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_SUS);
+
+	check_point(56);
+	ercd = ras_ter(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(58);
+	ercd = ref_tsk(TASK3, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_DMT);
+
+	check_finish(59);
+	check_point(0);
+}
+
+static uint_t	task2_count = 0;
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++task2_count) {
+	case 1:
+		check_point(2);
+		while(true);
+
+		check_point(0);
+
+	case 2:
+		check_point(35);
+		ercd = dis_ter();
+		check_ercd(ercd, E_OK);
+
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 3:
+		check_point(41);
+		ercd = dis_ter();
+		check_ercd(ercd, E_OK);
+
+		ercd = slp_tsk();
+		check_ercd(ercd, E_RASTER);
+
+		check_point(45);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	task3_count = 0;
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RTSK	rtsk;
+
+	switch (++task3_count) {
+	case 1:
+		check_point(10);
+		ercd = tloc_mtx(MTX1, 10000U);
+		check_ercd(ercd, E_OK);
+
+		check_point(11);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 2:
+		check_point(16);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		check_point(17);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 3:
+		check_point(29);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 4:
+		check_point(33);
+		ercd = ref_tsk(TASK3, &rtsk);
+		check_ercd(ercd, E_OK);
+
+		check_assert(rtsk.tskstat == TTS_RUN);
+
+		check_assert(rtsk.actcnt == 0U);
+
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 5:
+		check_point(47);
+		ercd = dis_ter();
+		check_ercd(ercd, E_OK);
+
+		ercd = slp_tsk();
+		check_ercd(ercd, E_RASTER);
+
+		check_point(50);
+		ercd = ref_tsk(TASK3, &rtsk);
+		check_ercd(ercd, E_OK);
+
+		check_assert(rtsk.tskstat == TTS_RUN);
+
+		check_assert(rtsk.raster == true);
+
+		check_assert(rtsk.dister == true);
+
+		check_point(51);
+		ercd = slp_tsk();
+		check_ercd(ercd, E_RASTER);
+
+		ercd = ena_ter();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 6:
+		check_point(54);
+		ercd = dis_ter();
+		check_ercd(ercd, E_OK);
+
+		ercd = sus_tsk(TSK_SELF);
+		check_ercd(ercd, E_OK);
+
+		check_point(57);
+		ercd = ref_tsk(TASK3, &rtsk);
+		check_ercd(ercd, E_OK);
+
+		check_assert(rtsk.tskstat == TTS_RUN);
+
+		check_assert(rtsk.raster == true);
+
+		check_assert(rtsk.dister == true);
+
+		ercd = sus_tsk(TSK_SELF);
+		check_ercd(ercd, E_RASTER);
+
+		ercd = ena_ter();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task4(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RTSK	rtsk;
+	T_RMTX	rmtx;
+
+	check_point(19);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(22);
+	ercd = ref_tsk(TASK3, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_DMT);
+
+	ercd = ref_mtx(MTX1, &rmtx);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rmtx.htskid == TASK4);
+
+	check_assert(rmtx.wtskid == TSK_NONE);
+
+	check_point(23);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_raster1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_raster1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_raster1.cfg	(revision 302)
@@ -0,0 +1,19 @@
+/*
+ *		ã¿ã¹ã¯çµäºè¦æ±æ©è½ã«é¢ãããã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§
+ *		ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_raster1.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, TASK1_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, TASK2_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, TASK3_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK4, { TA_NULL, 4, task4, TASK4_PRIORITY, STACK_SIZE, NULL });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
+CRE_MTX(MTX1, { TA_NULL });
Index: asp3_wo_tecs/trunk/test/test_raster1.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_raster1.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_raster1.h	(revision 302)
@@ -0,0 +1,97 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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_raster1.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ã¿ã¹ã¯çµäºè¦æ±æ©è½ã«é¢ãããã¹ã(1)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+#define TASK1_PRIORITY	10		/* ã¿ã¹ã¯1ã®åªå
+åº¦ */
+#define TASK2_PRIORITY	11		/* ã¿ã¹ã¯2ã®åªå
+åº¦ */
+#define TASK3_PRIORITY	9		/* ã¿ã¹ã¯3ã®åªå
+åº¦ */
+#define TASK4_PRIORITY	9		/* ã¿ã¹ã¯4ã®åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#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	task4(intptr_t exinf);
+extern void	alarm1_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_raster2.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_raster2.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_raster2.c	(revision 302)
@@ -0,0 +1,719 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: test_raster2.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ã¿ã¹ã¯çµäºè¦æ±æ©è½ã«é¢ãããã¹ã(2)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *	dis_terã®æ¯èãã®ãã¹ãï¼»NGKI3482ï¼½
+ *	  ã»dis_terã«é¢ãããã¹ã¦ã®è¦æ±ããã¹ãããï¼
+ *	  ã»dis_teré¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
+ *	ena_terã®æ¯èãã®ãã¹ãï¼»NGKI3487ï¼½
+ *	  ã»ena_terã«é¢ãããã¹ã¦ã®è¦æ±ããã¹ãããï¼
+ *	  ã»ena_teré¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
+ *	sns_terã®æ¯èãã®ãã¹ãï¼»NGKI3494ï¼½
+ *	  ã»sns_terã«é¢ãããã¹ã¦ã®è¦æ±ããã¹ãããï¼
+ *	  ã»sns_teré¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼
+ *	ã¿ã¹ã¯çµäºæã«è¡ãã¹ãå¦çã«é¢ãããã¹ã
+ *	  ã»ã¿ã¹ã¯çµäºæã«è¡ãã¹ãå¦çã«é¢ãããã¹ã¦ã®è¦æ±ããã¹ãããï¼
+ *	  ã»task_terminateé¢æ°ã®C1ã«ãã¬ãã¸ãéæããï¼ena_terããå¼ã³åºã
+ *		ãå ´åã«å®è¡ããããã¨ããªããã¹ãé¤ãï¼ï¼
+ *	ãã£ã¹ãããä¿çç¶æ
+ã®è§£é¤ã«ä¼´ãã¿ã¹ã¯çµäºã®ãã¹ã
+ *	  ã»dis_dspã¨chg_ipmã§ã¿ã¹ã¯ãçµäºãããã¨ããã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) dis_terã®ã¨ã©ã¼æ¤åº
+ *		(A-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãï¼»NGKI3483ï¼½
+ *		(A-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºãï¼»NGKI3484ï¼½
+ *	(B) dis_terã«ããã¿ã¹ã¯çµäºç¦æ­¢ãã©ã°ã®ã»ãã
+ *		(B-1) èªã¿ã¹ã¯ã®ã¿ã¹ã¯çµäºç¦æ­¢ãã©ã°ãã»ããï¼»NGKI3486ï¼½
+ *	(C) ena_terã®ã¨ã©ã¼æ¤åº
+ *		(C-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãï¼»NGKI3488ï¼½
+ *		(C-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºãï¼»NGKI3489ï¼½
+ *	(D) ena_terã«ããã¿ã¹ã¯çµäºç¦æ­¢ãã©ã°ã®ã¯ãªã¢
+ *		(D-1) èªã¿ã¹ã¯ã®ã¿ã¹ã¯çµäºç¦æ­¢ãã©ã°ãã¯ãªã¢ï¼»NGKI3491ï¼½
+ *	(E) ena_terã«ããã¿ã¹ã¯çµäºï¼»NGKI3683ï¼½
+ *		(E-1) èªã¿ã¹ã¯ãå®è¡å¯è½ç¶æ
+ããä¼æ­¢ç¶æ
+ã«ï¼»NGKI1178ï¼½
+ *		(E-2) ã­ãã¯ãã¦ãããã¥ã¼ããã¯ã¹ã®ã­ãã¯è§£é¤ï¼»NGKI2019ï¼½
+ *		(E-3) (E-2)ã®å¦çã«ããå¾
+ã¡è§£é¤ãããã¿ã¹ã¯ã«åæã
+ *	(F) ena_terã«ããã¿ã¹ã¯çµäºã¨åèµ·å
+ *		(F-1) èªã¿ã¹ã¯ãå®è¡å¯è½ç¶æ
+ã«
+ *		(F-2) (F-1)ã®æã«èµ·åè¦æ±ã­ã¥ã¼ã¤ã³ã°æ°ã1æ¸å°ï¼»NGKI1180ï¼½
+ *		(F-3) èªã¿ã¹ã¯ãå®è¡ç¶æ
+ã«
+ *	(G) ã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºããsns_terã®æ¯èã
+ *		(G-1) ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã®å ´åã«trueãè¿ãï¼»NGKI3495ï¼½
+ *		(G-2) ã¿ã¹ã¯çµäºè¨±å¯ç¶æ
+ã®å ´åã«falseãè¿ãï¼»NGKI3495ï¼½
+ *	(H) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããå¼ã³åºããsns_terã®æ¯èã
+ *		(H-1) ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã®å ´åã«trueãè¿ãï¼»NGKI3495ï¼½
+ *		(H-2) ã¿ã¹ã¯çµäºè¨±å¯ç¶æ
+ã®å ´åã«falseãè¿ãï¼»NGKI3495ï¼½
+ *		(H-3) å®è¡ç¶æ
+ã®ã¿ã¹ã¯ããªãå ´åã«trueãè¿ãï¼»NGKI3496ï¼½
+ *	(I) ena_dspã«ããã¿ã¹ã¯çµäºï¼»NGKI3683ï¼½
+ *		(I-1) èªã¿ã¹ã¯ãå®è¡å¯è½ç¶æ
+ããä¼æ­¢ç¶æ
+ã«ï¼»NGKI1178ï¼½
+ *	(J) chg_ipmã«ããã¿ã¹ã¯çµäºï¼»NGKI3683ï¼½
+ *		(J-1) èªã¿ã¹ã¯ãå®è¡å¯è½ç¶æ
+ããä¼æ­¢ç¶æ
+ã«ï¼»NGKI1178ï¼½
+ *	ASPã«ã¼ãã«ã«é©ç¨ãããªãè¦æ±ï¼
+ *		ï¼»NGKI3485ï¼½ï¼»NGKI3490ï¼½ï¼»NGKI3497ï¼½
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	TASK2: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: é«åªå
+åº¦ã¿ã¹ã¯
+ *	ALM1: ã¢ã©ã¼ã ãã³ãã©
+ *	MTX1: ãã¥ã¼ããã¯ã¹
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1 ==
+ *	1:	sta_alm(ALM1, 10000U)
+ *		slp_tsk()
+ *	== ALM1-1ï¼1åç®ï¼==
+ *	2:	dis_ter() -> E_CTX							... (A-1)
+ *		ena_ter() -> E_CTX							... (C-1)
+ *		assert(sns_ter() == true)					... (H-3)
+ *		wup_tsk(TASK1)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	3:	loc_cpu()
+ *		dis_ter() -> E_CTX							... (A-2)
+ *		ena_ter() -> E_CTX							... (C-2)
+ *		unl_cpu()
+ *		assert(sns_ter() == false)
+ *	4:	dis_ter()									... (B-1)
+ *		assert(sns_ter() == true)					... (G-1)
+ *		ref_tsk(TSK_SELF, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RUN)
+ *		assert(rtsk.raster == false)
+ *		assert(rtsk.dister == true)
+ *	5:	ena_ter()									... (D-1)
+ *		assert(sns_ter() == false)					... (G-2)
+ *		ref_tsk(TSK_SELF, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RUN)
+ *		assert(rtsk.raster == false)
+ *		assert(rtsk.dister == false)
+ *	6:	act_tsk(TASK2)
+ *		slp_tsk()
+ *	== TASK2-1ï¼1åç®ï¼==
+ *	7:	dis_ter()
+ *		wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	8:	ras_ter(TASK2)
+ *		tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK2-1ï¼ç¶ãï¼==
+ *	9:	ena_ter()									... (E-1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	10:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_DMT)
+ *	11:	act_tsk(TASK2)
+ *		slp_tsk()
+ *	== TASK2-2ï¼2åç®ï¼==
+ *	12:	dis_ter()
+ *		loc_mtx(MTX1)
+ *		wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	13:	act_tsk(TASK3)
+ *	== TASK3-1ï¼1åç®ï¼==
+ *	14:	loc_mtx(MTX1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	15:	ras_ter(TASK2)
+ *		slp_tsk()
+ *	== TASK2-2ï¼ç¶ãï¼==
+ *	16:	ena_ter()									... (E-2)(E-3)
+ *	== TASK3-1ï¼ç¶ãï¼==
+ *	17:	wup_tsk(TASK1)
+ *		ext_tsk()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	18:	act_tsk(TASK2)
+ *		act_tsk(TASK2)
+ *		ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RDY)
+ *		assert(rtsk.actcnt == 1U)
+ *		slp_tsk()
+ *	== TASK2-3ï¼3åç®ï¼==
+ *	19:	dis_ter()
+ *		wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	20:	ras_ter(TASK2)
+ *		chg_pri(TASK2, TASK3_PRIORITY)
+ *	== TASK2-3ï¼ç¶ãï¼==
+ *	21:	ena_ter()									... (F-1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	22:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_RDY)
+ *		assert(rtsk.actcnt == 0U)					... (F-2)
+ *		act_tsk(TASK2)
+ *		slp_tsk()
+ *	== TASK2-4ï¼4åç®ï¼==
+ *	23:	dis_ter()
+ *		wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	24:	ras_ter(TASK2)
+ *		tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK2-4ï¼ç¶ãï¼==
+ *	25:	ena_ter()									... (F-3)
+ *	== TASK2-5ï¼5åç®ï¼==
+ *	26:	dis_ter()
+ *		DO(while(true))
+ *	== TASK1ï¼ç¶ãï¼==
+ *	27:	sta_alm(ALM1, 10000U)
+ *		slp_tsk()
+ *	== ALM1-2ï¼2åç®ï¼==
+ *	28:	assert(sns_ter() == true)					... (H-1)
+ *		wup_tsk(TASK1)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	29:	ter_tsk(TASK2)
+ *		act_tsk(TASK2)
+ *		tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK2-6ï¼6åç®ï¼==
+ *	30:	ena_ter()
+ *		DO(while(true))
+ *	== TASK1ï¼ç¶ãï¼==
+ *	31:	sta_alm(ALM1, 10000U)
+ *		slp_tsk()
+ *	== ALM1-3ï¼3åç®ï¼==
+ *	32:	assert(sns_ter() == false)					... (H-2)
+ *		wup_tsk(TASK1)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	33:	ter_tsk(TASK2)
+ *		act_tsk(TASK2)
+ *		slp_tsk()
+ *	== TASK2-7ï¼7åç®ï¼==
+ *	34:	dis_ter()
+ *		wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	35:	ras_ter(TASK2)
+ *		tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK2-7ï¼ç¶ãï¼==
+ *	36:	dis_dsp()
+ *		ena_ter()
+ *		ena_dsp()									... (I-1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	37:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_DMT)
+ *	38:	act_tsk(TASK2)
+ *		slp_tsk()
+ *	== TASK2-8ï¼8åç®ï¼==
+ *	39:	dis_ter()
+ *		wup_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	40:	ras_ter(TASK2)
+ *		tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK2-8ï¼ç¶ãï¼==
+ *	41:	chg_ipm(TMAX_INTPRI)
+ *		ena_ter()
+ *		chg_ipm(TIPM_ENAALL)						... (I-1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	42:	ref_tsk(TASK2, &rtsk)
+ *		assert(rtsk.tskstat == TTS_DMT)
+ *	43:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_raster2.h"
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+static uint_t	alarm1_count = 0;
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++alarm1_count) {
+	case 1:
+		check_point(2);
+		ercd = dis_ter();
+		check_ercd(ercd, E_CTX);
+
+		ercd = ena_ter();
+		check_ercd(ercd, E_CTX);
+
+		check_assert(sns_ter() == true);
+
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(28);
+		check_assert(sns_ter() == true);
+
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(32);
+		check_assert(sns_ter() == false);
+
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RTSK	rtsk;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(3);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	ercd = dis_ter();
+	check_ercd(ercd, E_CTX);
+
+	ercd = ena_ter();
+	check_ercd(ercd, E_CTX);
+
+	ercd = unl_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_assert(sns_ter() == false);
+
+	check_point(4);
+	ercd = dis_ter();
+	check_ercd(ercd, E_OK);
+
+	check_assert(sns_ter() == true);
+
+	ercd = ref_tsk(TSK_SELF, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_RUN);
+
+	check_assert(rtsk.raster == false);
+
+	check_assert(rtsk.dister == true);
+
+	check_point(5);
+	ercd = ena_ter();
+	check_ercd(ercd, E_OK);
+
+	check_assert(sns_ter() == false);
+
+	ercd = ref_tsk(TSK_SELF, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_RUN);
+
+	check_assert(rtsk.raster == false);
+
+	check_assert(rtsk.dister == false);
+
+	check_point(6);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	ercd = ras_ter(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(10);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_DMT);
+
+	check_point(11);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(15);
+	ercd = ras_ter(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(18);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_RDY);
+
+	check_assert(rtsk.actcnt == 1U);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(20);
+	ercd = ras_ter(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = chg_pri(TASK2, TASK3_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	check_point(22);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_RDY);
+
+	check_assert(rtsk.actcnt == 0U);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(24);
+	ercd = ras_ter(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(27);
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(29);
+	ercd = ter_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(31);
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(33);
+	ercd = ter_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(35);
+	ercd = ras_ter(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(37);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_DMT);
+
+	check_point(38);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(40);
+	ercd = ras_ter(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(42);
+	ercd = ref_tsk(TASK2, &rtsk);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rtsk.tskstat == TTS_DMT);
+
+	check_finish(43);
+	check_point(0);
+}
+
+static uint_t	task2_count = 0;
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++task2_count) {
+	case 1:
+		check_point(7);
+		ercd = dis_ter();
+		check_ercd(ercd, E_OK);
+
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(9);
+		ercd = ena_ter();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 2:
+		check_point(12);
+		ercd = dis_ter();
+		check_ercd(ercd, E_OK);
+
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(16);
+		ercd = ena_ter();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 3:
+		check_point(19);
+		ercd = dis_ter();
+		check_ercd(ercd, E_OK);
+
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(21);
+		ercd = ena_ter();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 4:
+		check_point(23);
+		ercd = dis_ter();
+		check_ercd(ercd, E_OK);
+
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(25);
+		ercd = ena_ter();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 5:
+		check_point(26);
+		ercd = dis_ter();
+		check_ercd(ercd, E_OK);
+
+		while(true);
+
+		check_point(0);
+
+	case 6:
+		check_point(30);
+		ercd = ena_ter();
+		check_ercd(ercd, E_OK);
+
+		while(true);
+
+		check_point(0);
+
+	case 7:
+		check_point(34);
+		ercd = dis_ter();
+		check_ercd(ercd, E_OK);
+
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(36);
+		ercd = dis_dsp();
+		check_ercd(ercd, E_OK);
+
+		ercd = ena_ter();
+		check_ercd(ercd, E_OK);
+
+		ercd = ena_dsp();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 8:
+		check_point(39);
+		ercd = dis_ter();
+		check_ercd(ercd, E_OK);
+
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		check_point(41);
+		ercd = chg_ipm(TMAX_INTPRI);
+		check_ercd(ercd, E_OK);
+
+		ercd = ena_ter();
+		check_ercd(ercd, E_OK);
+
+		ercd = chg_ipm(TIPM_ENAALL);
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	task3_count = 0;
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++task3_count) {
+	case 1:
+		check_point(14);
+		ercd = loc_mtx(MTX1);
+		check_ercd(ercd, E_OK);
+
+		check_point(17);
+		ercd = wup_tsk(TASK1);
+		check_ercd(ercd, E_OK);
+
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_raster2.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_raster2.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_raster2.cfg	(revision 302)
@@ -0,0 +1,18 @@
+/*
+ *		ã¿ã¹ã¯çµäºè¦æ±æ©è½ã«é¢ãããã¹ã(2)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§
+ *		ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_raster2.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, TASK1_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, TASK2_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, TASK3_PRIORITY, STACK_SIZE, NULL });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
+CRE_MTX(MTX1, { TA_NULL });
Index: asp3_wo_tecs/trunk/test/test_raster2.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_raster2.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_raster2.h	(revision 302)
@@ -0,0 +1,94 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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_raster2.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ã¿ã¹ã¯çµäºè¦æ±æ©è½ã«é¢ãããã¹ã(2)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+#define TASK1_PRIORITY	10		/* ã¿ã¹ã¯1ã®åªå
+åº¦ */
+#define TASK2_PRIORITY	11		/* ã¿ã¹ã¯2ã®åªå
+åº¦ */
+#define TASK3_PRIORITY	9		/* ã¿ã¹ã¯3ã®åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#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_sem1.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_sem1.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_sem1.c	(revision 302)
@@ -0,0 +1,668 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: test_sem1.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ã»ããã©æ©è½ã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  sig_semï¼ã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãï¼ï¼wai_semï¼CRE_SEMãç¶²ç¾
+ç
+ *  ã«ãã¹ãããï¼ãã ãï¼CRE_SEMã®ã¨ã©ã¼ã®ãã¹ãã¯é¤ãï¼ï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) sig_semã®éçã¨ã©ã¼ã®ãã¹ã
+ *		(A-1) CPUã­ãã¯ç¶æ
+ããã®å¼åºã
+ *		(A-2) semidãä¸æ­£ï¼å°ããããï¼
+ *		(A-3) semidãä¸æ­£ï¼å¤§ããããï¼
+ *	(B) sig_semã«ããã»ããã©å¾
+ã¡ç¶æ
+ã®ã¿ã¹ã¯ãå¾
+ã¡è§£é¤ããã
+ *		(B-1) å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ã«åãæãã
+ *		(B-2) ãã£ã¹ãããä¿çç¶æ
+ã§ï¼åãæãããªã
+ *		(B-3) å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ãå¼·å¶å¾
+ã¡ç¶æ
+ã§ï¼åãæãããªã
+ *		(B-4) å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ãåªå
+åº¦ãä½ãï¼åãæãããªã
+ *	(C) sig_semã«ããã»ããã©ã®è³æºæ°ã1å¢ãã
+ *		(C-1) ã»ããã©ã®è³æºæ°ã0ãã1ã«ãªã
+ *		(C-2) ã»ããã©ã®è³æºæ°ã1ãã2ã«ãªã
+ *	(D) sig_semãE_QOVRã¨ã©ã¼ã¨ãªã
+ *		(D-1) ã»ããã©ã®æå¤§è³æºæ°ã1ã®æ
+ *		(D-2) ã»ããã©ã®æå¤§è³æºæ°ã2ã®æ
+ *	(E) wai_semã®éçã¨ã©ã¼ã®ãã¹ã
+ *		(E-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºã
+ *		(E-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºã
+ *		(E-3) ãã£ã¹ãããç¦æ­¢ç¶æ
+ããã®å¼åºã
+ *		(E-4) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªãç¶æ
+ããã®å¼åºã
+ *		(E-5) semidãä¸æ­£ï¼å°ããããï¼
+ *		(E-6) semidãä¸æ­£ï¼å¤§ããããï¼
+ *	(F) wai_semã«ããã»ããã©ã®è³æºæ°ã1æ¸ã
+ *		(F-1) ã»ããã©ã®è³æºæ°ã1ãã0ã«ãªã
+ *		(F-2) ã»ããã©ã®è³æºæ°ã2ãã1ã«ãªã
+ *	(G) wai_semã«ããã»ããã©å¾
+ã¡ç¶æ
+ã«ãªã
+ *		(G-1) TA_TNULLå±æ§ã®ã»ããã©ã§ï¼å¾
+ã£ã¦ããã¿ã¹ã¯ããªãã£ãå ´å
+ *		(G-2) TA_TNULLå±æ§ã®ã»ããã©ã§ï¼å¾
+ã£ã¦ããã¿ã¹ã¯ããã£ãå ´å
+ *		(G-3) TA_TPRIå±æ§ã®ã»ããã©ã§ï¼å¾
+ã£ã¦ããã¿ã¹ã¯ããªãã£ãå ´å
+ *		(G-4) TA_TPRIå±æ§ã®ã»ããã©ã§ï¼åªå
+åº¦ãé«ãã¿ã¹ã¯ãå¾
+ã£ã¦ããå ´å
+ *		(G-5) TA_TPRIå±æ§ã®ã»ããã©ã§ï¼åªå
+åº¦ãåãã¿ã¹ã¯ãå¾
+ã£ã¦ããå ´å
+ *		(G-6) TA_TPRIå±æ§ã®ã»ããã©ã§ï¼åªå
+åº¦ãä½ãã¿ã¹ã¯ãå¾
+ã£ã¦ããå ´å
+ *	(H) ã»ããã©å¾
+ã¡ç¶æ
+ãå¼·å¶è§£é¤ããã
+ *	(I) ã»ããã©å¾
+ã¡ç¶æ
+ã®éã«ã»ããã©ãåæåããã
+ *	(J) ã»ããã©ã®è³æºæ°ã®åæå¤ãæ­£ããè¨­å®ããã
+ *		(J-1) ã»ããã©ã®è³æºæ°ã®åæå¤ã0
+ *		(J-2) ã»ããã©ã®è³æºæ°ã®åæå¤ã1
+ *		(J-3) ã»ããã©ã®è³æºæ°ã®åæå¤ã2
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	TASK2: é«åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	TASK4: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK5: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *  SEM1:  TA_NULLå±æ§ï¼åæè³æºæ°1ï¼æå¤§è³æºæ°1
+ *  SEM2:  TA_NULLå±æ§ï¼åæè³æºæ°2ï¼æå¤§è³æºæ°2
+ *  SEM3:  TA_TPRIå±æ§ï¼åæè³æºæ°0ï¼æå¤§è³æºæ°1
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *  1:	ref_sem(SEM1, &rsem)
+ *		assert(rsem.wtskid == TSK_NONE)
+ *		assert(rsem.semcnt == 1)			... (J-2)
+ *  	ref_sem(SEM2, &rsem)
+ *		assert(rsem.wtskid == TSK_NONE)
+ *		assert(rsem.semcnt == 2)			... (J-3)
+ *  	ref_sem(SEM3, &rsem)
+ *		assert(rsem.wtskid == TSK_NONE)
+ *		assert(rsem.semcnt == 0)			... (J-1)
+ *	2:	loc_cpu()
+ *		sig_sem(SEM1) -> E_CTX				... (A-1)
+ *		wai_sem(SEM1) -> E_CTX				... (E-2)
+ *		unl_cpu()
+ *		dis_dsp()
+ *		wai_sem(SEM1) -> E_CTX				... (E-3)
+ *		ena_dsp()
+ *		chg_ipm(TMAX_INTPRI)
+ *		wai_sem(SEM1) -> E_CTX				... (E-4)
+ *		chg_ipm(TIPM_ENAALL)
+ *		sig_sem(0) -> E_ID					... (A-2)
+ *		wai_sem(0) -> E_ID					... (E-5)
+ *		sig_sem(TNUM_SEMID+1) -> E_ID		... (A-3)
+ *		wai_sem(TNUM_SEMID+1) -> E_ID		... (E-6)
+ *	3:	act_tsk(TASK3)
+ *	4:	slp_tsk()
+ *	== TASK3ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	5:	wai_sem(SEM1)						... (F-1)
+ *  6:	ref_sem(SEM1, &rsem)
+ *		assert(rsem.wtskid == TSK_NONE)
+ *		assert(rsem.semcnt == 0)
+ *	7:	sta_alm(ALM1, 10000U)
+ *	8:	wai_sem(SEM1)						... (G-1)
+ *	== ALM1 ==
+ *	9:	wai_sem(SEM1) -> E_CTX				... (E-1)
+ *	10:	wup_tsk(TASK1)
+ *	11:	RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	12:	act_tsk(TASK2)
+ *	== TASK2ï¼åªå
+åº¦ï¼é«ï¼==
+ *	13:	wai_sem(SEM1)						... (G-2)
+ *	== TASK1ï¼ç¶ãï¼==
+ *  14:	ref_sem(SEM1, &rsem)
+ *		assert(rsem.wtskid == TASK3)
+ *		assert(rsem.semcnt == 0)
+ *	15:	sig_sem(SEM1)						... (B-4)
+ *	16:	sig_sem(SEM1)						... (B-1)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	17:	wai_sem(SEM1)						... (G-1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	18: dis_dsp()
+ *	19:	sig_sem(SEM1)						... (B-2)
+ *	20:	ena_dsp()
+ *	== TASK2ï¼ç¶ãï¼==
+ *	21:	wai_sem(SEM1)						... (G-1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	22: sus_tsk(TASK2)
+ *	23:	sig_sem(SEM1)						... (B-3)
+ *	24: sig_sem(SEM1)						... (C-1)
+ *	25: sig_sem(SEM1) -> E_QOVR				... (D-1)
+ *  26:	ref_sem(SEM1, &rsem)
+ *		assert(rsem.wtskid == TSK_NONE)
+ *		assert(rsem.semcnt == 1)
+ *	27:	rsm_tsk(TASK2)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	28:	wai_sem(SEM2)						... (F-2)
+ *  29:	ref_sem(SEM2, &rsem)
+ *		assert(rsem.wtskid == TSK_NONE)
+ *		assert(rsem.semcnt == 1)
+ *	30:	wai_sem(SEM2)						... (F-1)
+ *	31: wai_sem(SEM2)						... (G-1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	32:	sig_sem(SEM2)						... (B-1)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	33:	wai_sem(SEM3)						... (G-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	34:	sig_sem(SEM2)						... (C-1)
+ *	35:	sig_sem(SEM2)						... (C-2)
+ *  36:	ref_sem(SEM2, &rsem)
+ *		assert(rsem.wtskid == TSK_NONE)
+ *		assert(rsem.semcnt == 2)
+ *	37:	sig_sem(SEM2) -> E_QOVR				... (D-2)
+ *  38:	ref_sem(SEM2, &rsem)
+ *		assert(rsem.wtskid == TSK_NONE)
+ *		assert(rsem.semcnt == 2)
+ *	39:	tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK3ï¼ç¶ãï¼==
+ *	40:	wai_sem(SEM3)						... (G-4)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	41:	act_tsk(TASK4)
+ *	42:	act_tsk(TASK5)
+ *	43:	rot_rdq(TPRI_SELF)
+ *	== TASK4ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	44:	wai_sem(SEM3)						... (G-6)
+ *	== TASK5ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	45:	wai_sem(SEM3)						... (G-5)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	46:	sig_sem(SEM3)						... (B-1)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	47:	wai_sem(SEM1)
+ *		wai_sem(SEM1) -> E_RLWAI
+ *	== TASK1ï¼ç¶ãï¼==
+ *	48:	sig_sem(SEM3)						... (B-4)
+ *	49:	tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK4ï¼ç¶ãï¼==
+ *	50:	ext_tsk() -> noreturn
+ *	== TASK1ï¼ç¶ãï¼==
+ *	51:	sig_sem(SEM3)						... (B-4)
+ *	52:	tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK5ï¼ç¶ãï¼==
+ *	53:	ext_tsk() -> noreturn
+ *	== TASK1ï¼ç¶ãï¼==
+ *	54:	sig_sem(SEM3)						... (B-4)
+ *	55:	tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK3ï¼ç¶ãï¼==
+ *	56:	ext_tsk() -> noreturn
+ *	== TASK1ï¼ç¶ãï¼==
+ *	57: rel_wai(TASK2)						... (H)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	58:	wai_sem(SEM1) -> E_DLT
+ *	== TASK1ï¼ç¶ãï¼==
+ *	59: ini_sem(SEM1)						... (I)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	60: ext_tsk() -> noreturn
+ *	== TASK1ï¼ç¶ãï¼==
+ *	61: 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;
+
+	check_point(9);
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_CTX);
+
+	check_point(10);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RSEM	rsem;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	ercd = ref_sem(SEM1, &rsem);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rsem.wtskid == TSK_NONE);
+
+	check_assert(rsem.semcnt == 1);
+
+	ercd = ref_sem(SEM2, &rsem);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rsem.wtskid == TSK_NONE);
+
+	check_assert(rsem.semcnt == 2);
+
+	ercd = ref_sem(SEM3, &rsem);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rsem.wtskid == TSK_NONE);
+
+	check_assert(rsem.semcnt == 0);
+
+	check_point(2);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	ercd = sig_sem(SEM1);
+	check_ercd(ercd, E_CTX);
+
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_CTX);
+
+	ercd = unl_cpu();
+	check_ercd(ercd, E_OK);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	ercd = wai_sem(SEM1);
+	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_sem(SEM1);
+	check_ercd(ercd, E_CTX);
+
+	ercd = chg_ipm(TIPM_ENAALL);
+	check_ercd(ercd, E_OK);
+
+	ercd = sig_sem(0);
+	check_ercd(ercd, E_ID);
+
+	ercd = wai_sem(0);
+	check_ercd(ercd, E_ID);
+
+	ercd = sig_sem(TNUM_SEMID+1);
+	check_ercd(ercd, E_ID);
+
+	ercd = wai_sem(TNUM_SEMID+1);
+	check_ercd(ercd, E_ID);
+
+	check_point(3);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(4);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(12);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = ref_sem(SEM1, &rsem);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rsem.wtskid == TASK3);
+
+	check_assert(rsem.semcnt == 0);
+
+	check_point(15);
+	ercd = sig_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(16);
+	ercd = sig_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(18);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(19);
+	ercd = sig_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(20);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(22);
+	ercd = sus_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(23);
+	ercd = sig_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(24);
+	ercd = sig_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	ercd = sig_sem(SEM1);
+	check_ercd(ercd, E_QOVR);
+
+	check_point(26);
+	ercd = ref_sem(SEM1, &rsem);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rsem.wtskid == TSK_NONE);
+
+	check_assert(rsem.semcnt == 1);
+
+	check_point(27);
+	ercd = rsm_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(32);
+	ercd = sig_sem(SEM2);
+	check_ercd(ercd, E_OK);
+
+	check_point(34);
+	ercd = sig_sem(SEM2);
+	check_ercd(ercd, E_OK);
+
+	check_point(35);
+	ercd = sig_sem(SEM2);
+	check_ercd(ercd, E_OK);
+
+	check_point(36);
+	ercd = ref_sem(SEM2, &rsem);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rsem.wtskid == TSK_NONE);
+
+	check_assert(rsem.semcnt == 2);
+
+	check_point(37);
+	ercd = sig_sem(SEM2);
+	check_ercd(ercd, E_QOVR);
+
+	check_point(38);
+	ercd = ref_sem(SEM2, &rsem);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rsem.wtskid == TSK_NONE);
+
+	check_assert(rsem.semcnt == 2);
+
+	check_point(39);
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(41);
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(42);
+	ercd = act_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(43);
+	ercd = rot_rdq(TPRI_SELF);
+	check_ercd(ercd, E_OK);
+
+	check_point(46);
+	ercd = sig_sem(SEM3);
+	check_ercd(ercd, E_OK);
+
+	check_point(48);
+	ercd = sig_sem(SEM3);
+	check_ercd(ercd, E_OK);
+
+	check_point(49);
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(51);
+	ercd = sig_sem(SEM3);
+	check_ercd(ercd, E_OK);
+
+	check_point(52);
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(54);
+	ercd = sig_sem(SEM3);
+	check_ercd(ercd, E_OK);
+
+	check_point(55);
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(57);
+	ercd = rel_wai(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(59);
+	ercd = ini_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_finish(61);
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RSEM	rsem;
+
+	check_point(13);
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(17);
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(21);
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(28);
+	ercd = wai_sem(SEM2);
+	check_ercd(ercd, E_OK);
+
+	check_point(29);
+	ercd = ref_sem(SEM2, &rsem);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rsem.wtskid == TSK_NONE);
+
+	check_assert(rsem.semcnt == 1);
+
+	check_point(30);
+	ercd = wai_sem(SEM2);
+	check_ercd(ercd, E_OK);
+
+	check_point(31);
+	ercd = wai_sem(SEM2);
+	check_ercd(ercd, E_OK);
+
+	check_point(33);
+	ercd = wai_sem(SEM3);
+	check_ercd(ercd, E_OK);
+
+	check_point(47);
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_RLWAI);
+
+	check_point(58);
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_DLT);
+
+	check_point(60);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RSEM	rsem;
+
+	check_point(5);
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(6);
+	ercd = ref_sem(SEM1, &rsem);
+	check_ercd(ercd, E_OK);
+
+	check_assert(rsem.wtskid == TSK_NONE);
+
+	check_assert(rsem.semcnt == 0);
+
+	check_point(7);
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(40);
+	ercd = wai_sem(SEM3);
+	check_ercd(ercd, E_OK);
+
+	check_point(56);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task4(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(44);
+	ercd = wai_sem(SEM3);
+	check_ercd(ercd, E_OK);
+
+	check_point(50);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task5(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(45);
+	ercd = wai_sem(SEM3);
+	check_ercd(ercd, E_OK);
+
+	check_point(53);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_sem1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_sem1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_sem1.cfg	(revision 302)
@@ -0,0 +1,21 @@
+/*
+ *		ã»ããã©æ©è½ã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_sem1.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_TSK(TASK4, { TA_NULL, 4, task4, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK5, { TA_NULL, 5, task5, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
+CRE_SEM(SEM1, { TA_NULL, 1, 1 });
+CRE_SEM(SEM2, { TA_NULL, 2, 2 });
+CRE_SEM(SEM3, { TA_TPRI, 0, 1 });
Index: asp3_wo_tecs/trunk/test/test_sem1.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_sem1.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_sem1.h	(revision 302)
@@ -0,0 +1,96 @@
+/*
+ *  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_sem1.h 286 2014-11-29 07:51: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	task4(intptr_t exinf);
+extern void	task5(intptr_t exinf);
+extern void	alarm1_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_sem2.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_sem2.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_sem2.c	(revision 302)
@@ -0,0 +1,518 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: test_sem2.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ã»ããã©æ©è½ã®ãã¹ã(2)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  sig_semãï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼ã³åºããå ´åã«ã¤ãã¦ï¼ã¿ã¹ã¯
+ *  ã³ã³ãã­ã¹ãããã®å¼ã³åºããå ´åã¨ã®éããä¸­å¿ã«ãã¹ãããï¼
+ *  pol_semï¼twai_semãï¼wai_semã¨ã®éããä¸­å¿ã«ãã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) sig_semï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãï¼ã®éçã¨ã©ã¼ã®ãã¹ã
+ *		(A-1) CPUã­ãã¯ç¶æ
+ããã®å¼åºã
+ *	(B) sig_semï¼éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºãï¼ã«ããã»ããã©å¾
+ã¡ç¶
+ *		æ
+ã®ã¿ã¹ã¯ãå¾
+ã¡è§£é¤ãããå ´åã®ãã¹ã
+ *		(B-1) ã¢ã¤ãã«ç¶æ
+ããï¼å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ã«åãæãã
+ *		(B-2) å®è¡ç¶æ
+ã®ã¿ã¹ã¯ããï¼å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ã«åãæãã
+ *		(B-3) ãã£ã¹ãããä¿çç¶æ
+ã§ï¼åãæãããªã
+ *		(B-4) å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ãå¼·å¶å¾
+ã¡ç¶æ
+ã§ï¼åãæãããªã
+ *		(B-5) å¾
+ã¡è§£é¤ãããã¿ã¹ã¯ãåªå
+åº¦ãä½ãï¼åãæãããªã
+ *	(C) pol_semã®éçã¨ã©ã¼ã®ãã¹ã
+ *		(C-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºã
+ *		(C-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºã
+ *		(C-3) ãã£ã¹ãããç¦æ­¢ç¶æ
+ããã®å¼åºãï¼E_CTXã¨ã©ã¼ã«ãªããªãï¼
+ *		(C-4) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªãç¶æ
+ããã®å¼åºãï¼E_CTXã¨ã©ã¼
+ *		      ã«ãªããªãï¼
+ *	(D) pol_semã§ãã¼ãªã³ã°å¤±æãã
+ *	(E) twai_semã®éçã¨ã©ã¼ã®ãã¹ã
+ *		(E-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºã
+ *		(E-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºã
+ *		(E-3) ãã£ã¹ãããç¦æ­¢ç¶æ
+ããã®å¼åºã
+ *		(E-4) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªãç¶æ
+ããã®å¼åºã
+ *		(E-5) tmoutãä¸æ­£
+ *	(F) twai_semã§tmout=TMO_POLã®æã«ãã¼ãªã³ã°å¤±æãã
+ *	(G) twai_semã§tmout=TMO_FEVRã®æã«ã»ããã©å¾
+ã¡ç¶æ
+ã«ãªã
+ *	(H) twai_semã§tmoutã«ã¿ã¤ã ã¢ã¦ããè¨­å®ããæã«ï¼ã¿ã¤ã ã¢ã¦ãä»ãã®
+ *		ã»ããã©å¾
+ã¡ç¶æ
+ã«ãªã
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	TASK2: é«åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	TASK4: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK5: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *  SEM1:  TA_NULLå±æ§ï¼åæè³æºæ°1ï¼æå¤§è³æºæ°1
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	1:	loc_cpu()
+ *		pol_sem(SEM1) -> E_CTX				... (C-2)
+ *		twai_sem(SEM1, TMO_POL) -> E_CTX	... (E-2)
+ *		unl_cpu()
+ *	2:	dis_dsp()
+ *		pol_sem(SEM1)						... (C-3)
+ *		twai_sem(SEM1, TMO_POL) -> E_CTX	... (E-3)
+ *		ena_dsp()
+ *	3:	chg_ipm(TMAX_INTPRI)
+ *		pol_sem(SEM1) -> E_TMOUT			... (C-4)(D)
+ *		twai_sem(SEM1, TMO_POL) -> E_CTX	... (E-4)
+ *		chg_ipm(TIPM_ENAALL)
+ *	4:	twai_sem(SEM1, TMO_NBLK) -> E_PAR	... (E-5)
+ *		twai_sem(SEM1, TMO_POL) -> E_TMOUT	... (F)
+ *	5:	sta_alm(ALM1, 10000U)
+ *	6:	twai_sem(SEM1, TMO_FEVR)			... (G)
+ *	== ALM1-1 ==
+ *	7:	pol_sem(SEM1) -> E_CTX				... (C-1)
+ *		twai_sem(SEM1, TMO_POL) -> E_CTX	... (E-1)
+ *	8:	loc_cpu()
+ *		sig_sem(SEM1) -> E_CTX				... (A-1)
+ *		unl_cpu()
+ *	9:	sig_sem(SEM1)						... (B-1)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	10:	act_tsk(TASK3)
+ *	11:	wai_sem(SEM1)
+ *	== TASK3ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	12:	sta_alm(ALM1, 10000U)
+ *		call(wait_var())
+ *	== ALM1-2 ==
+ *	13:	sig_sem(SEM1)						... (B-2)
+ *		call(signal_var())
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	14:	wai_sem(SEM1)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	15:	sta_alm(ALM1, 10000U)
+ *		dis_dsp()
+ *		call(wait_var())
+ *	== ALM1-3 ==
+ *	16:	sig_sem(SEM1)						... (B-3)
+ *		call(signal_var())
+ *		RETURN
+ *	== TASK3ï¼ç¶ãï¼==
+ *	17:	ena_dsp()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	18:	wai_sem(SEM1)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	19:	sta_alm(ALM1, 10000U)
+ *		sus_tsk(TASK1)
+ *		call(wait_var())
+ *	== ALM1-4 ==
+ *	20:	sig_sem(SEM1)						... (B-4)
+ *		call(signal_var())
+ *		RETURN
+ *	== TASK3ï¼ç¶ãï¼==
+ *	21:	rsm_tsk(TASK1)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	22:	act_tsk(TASK2)
+ *	== TASK2ï¼åªå
+åº¦ï¼é«ï¼==
+ *	23:	tslp_tsk(10000U) -> E_TMOUT
+ *	== TASK1ï¼ç¶ãï¼==
+ *	24:	wai_sem(SEM1)
+ *	== TASK3ï¼ç¶ãï¼==
+ *	25:	ext_tsk() -> noreturn
+ *	== TASK2ï¼ç¶ãï¼==
+ *	26:	sta_alm(ALM1, 10000U)
+ *		call(wait_var())
+ *	== ALM1-5 ==
+ *	27:	sig_sem(SEM1)						... (B-5)
+ *		call(signal_var())
+ *		RETURN
+ *	== TASK2ï¼ç¶ãï¼==
+ *	28:	ext_tsk() -> noreturn
+ *	== TASK1ï¼ç¶ãï¼==
+ *	29:	sta_alm(ALM1, 10000U)
+ *	30:	twai_sem(SEM1, 100000U) -> E_RLWAI
+ *	== ALM1-6 ==
+ *	31:	rel_wai(TASK1)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	32:	sta_alm(ALM1, 100000U)
+ *	33:	twai_sem(SEM1, 10000U) -> E_TMOUT		... (H)
+ *	34:	stp_alm(ALM1)
+ *	35:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_sem2.h"
+
+static volatile bool_t	flagvar;
+
+static void
+wait_var(void)
+{
+	flagvar = false;
+	while (!flagvar);
+}
+
+static void
+signal_var(void)
+{
+	flagvar = true;
+}
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+static uint_t	alarm1_count = 0;
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++alarm1_count) {
+	case 1:
+		check_point(7);
+		ercd = pol_sem(SEM1);
+		check_ercd(ercd, E_CTX);
+
+		ercd = twai_sem(SEM1, TMO_POL);
+		check_ercd(ercd, E_CTX);
+
+		check_point(8);
+		ercd = loc_cpu();
+		check_ercd(ercd, E_OK);
+
+		ercd = sig_sem(SEM1);
+		check_ercd(ercd, E_CTX);
+
+		ercd = unl_cpu();
+		check_ercd(ercd, E_OK);
+
+		check_point(9);
+		ercd = sig_sem(SEM1);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(13);
+		ercd = sig_sem(SEM1);
+		check_ercd(ercd, E_OK);
+
+		signal_var();
+
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(16);
+		ercd = sig_sem(SEM1);
+		check_ercd(ercd, E_OK);
+
+		signal_var();
+
+		return;
+
+		check_point(0);
+
+	case 4:
+		check_point(20);
+		ercd = sig_sem(SEM1);
+		check_ercd(ercd, E_OK);
+
+		signal_var();
+
+		return;
+
+		check_point(0);
+
+	case 5:
+		check_point(27);
+		ercd = sig_sem(SEM1);
+		check_ercd(ercd, E_OK);
+
+		signal_var();
+
+		return;
+
+		check_point(0);
+
+	case 6:
+		check_point(31);
+		ercd = rel_wai(TASK1);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	ercd = pol_sem(SEM1);
+	check_ercd(ercd, E_CTX);
+
+	ercd = twai_sem(SEM1, TMO_POL);
+	check_ercd(ercd, E_CTX);
+
+	ercd = unl_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_point(2);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	ercd = pol_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	ercd = twai_sem(SEM1, TMO_POL);
+	check_ercd(ercd, E_CTX);
+
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(3);
+	ercd = chg_ipm(TMAX_INTPRI);
+	check_ercd(ercd, E_OK);
+
+	ercd = pol_sem(SEM1);
+	check_ercd(ercd, E_TMOUT);
+
+	ercd = twai_sem(SEM1, TMO_POL);
+	check_ercd(ercd, E_CTX);
+
+	ercd = chg_ipm(TIPM_ENAALL);
+	check_ercd(ercd, E_OK);
+
+	check_point(4);
+	ercd = twai_sem(SEM1, TMO_NBLK);
+	check_ercd(ercd, E_PAR);
+
+	ercd = twai_sem(SEM1, TMO_POL);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(5);
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(6);
+	ercd = twai_sem(SEM1, TMO_FEVR);
+	check_ercd(ercd, E_OK);
+
+	check_point(10);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(18);
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(22);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(24);
+	ercd = wai_sem(SEM1);
+	check_ercd(ercd, E_OK);
+
+	check_point(29);
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(30);
+	ercd = twai_sem(SEM1, 100000U);
+	check_ercd(ercd, E_RLWAI);
+
+	check_point(32);
+	ercd = sta_alm(ALM1, 100000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(33);
+	ercd = twai_sem(SEM1, 10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(34);
+	ercd = stp_alm(ALM1);
+	check_ercd(ercd, E_OK);
+
+	check_finish(35);
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(23);
+	ercd = tslp_tsk(10000U);
+	check_ercd(ercd, E_TMOUT);
+
+	check_point(26);
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	wait_var();
+
+	check_point(28);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(12);
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	wait_var();
+
+	check_point(15);
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	wait_var();
+
+	check_point(17);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(19);
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	ercd = sus_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	wait_var();
+
+	check_point(21);
+	ercd = rsm_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	ercd = ext_tsk();
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_sem2.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_sem2.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_sem2.cfg	(revision 302)
@@ -0,0 +1,18 @@
+/*
+ *		ã»ããã©æ©è½ã®ãã¹ã(2)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_sem2.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_SEM(SEM1, { TA_NULL, 1, 1 });
+CRE_SEM(SEM2, { TA_TPRI, 0, 1 });
Index: asp3_wo_tecs/trunk/test/test_sem2.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_sem2.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_sem2.h	(revision 302)
@@ -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_sem2.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ã»ããã©æ©è½ã®ãã¹ã(2)
+ */
+
+#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_sysman1.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_sysman1.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_sysman1.c	(revision 302)
@@ -0,0 +1,494 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: test_sysman1.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ã·ã¹ãã ç¶æ
+ç®¡çæ©è½ã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  get_lodã¨get_nthãç¶²ç¾
+çã«ãã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) get_lodã®éçã¨ã©ã¼ã®ãã¹ã
+ *		(A-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºã â¦ æªå®æ½
+ *		(A-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºã â¦ æªå®æ½
+ *		(A-3) tskpriãä¸æ­£ï¼å°ããããï¼
+ *		(A-4) tskpriãä¸æ­£ï¼å¤§ããããï¼
+ *	(B) get_lodã«å
+·ä½çãªåªå
+åº¦ãæå®ãï¼ã¿ã¹ã¯æ°ãè¿ããã
+ *		(B-1) ã¿ã¹ã¯æ°ã0ã®å ´å
+ *		(B-2) ã¿ã¹ã¯æ°ã1ã®å ´å
+ *		(B-3) ã¿ã¹ã¯æ°ã3ã®å ´å
+ *	(C) get_lodã«TSK_SELFãæå®ãï¼ã¿ã¹ã¯æ°ãè¿ããã
+ *		(C-1) åªå
+åº¦ãå¤æ´ããã¦ããªãã¿ã¹ã¯ããã®çºè¡
+ *		(C-2) åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ï¼ç¾å¨åªå
+åº¦ãä¸ãã£
+ *		      ãã¿ã¹ã¯ããã®çºè¡
+ *		(C-3) chg_priã«ããï¼ãã¼ã¹åªå
+åº¦ãä¸ãã£ãã¿ã¹ã¯ããã®çºè¡
+ *	(D) get_nthã®éçã¨ã©ã¼ã®ãã¹ã
+ *		(D-1) éã¿ã¹ã¯ã³ã³ãã­ã¹ãããã®å¼åºã â¦ æªå®æ½
+ *		(D-2) CPUã­ãã¯ç¶æ
+ããã®å¼åºã â¦ æªå®æ½
+ *		(D-3) tskpriãä¸æ­£ï¼å°ããããï¼
+ *		(D-4) tskpriãä¸æ­£ï¼å¤§ããããï¼
+ *	(E) get_nthã«å
+·ä½çãªåªå
+åº¦ãæå®ãï¼ã¿ã¹ã¯IDã¾ãã¯TSK_NONEãè¿ããã
+ *		(E-1) ã¿ã¹ã¯æ°ã0ã§ï¼0çªç®ã«å¯¾ãã¦ï¼TSK_NONEãè¿ãå ´å
+ *		(E-2) ã¿ã¹ã¯æ°ã1ã§ï¼0çªç®ã«å¯¾ãã¦ï¼ã¿ã¹ã¯IDãè¿ãå ´å
+ *		(E-3) ã¿ã¹ã¯æ°ã1ã§ï¼1çªç®ã«å¯¾ãã¦ï¼TSK_NONEãè¿ãå ´å
+ *		(E-4) ã¿ã¹ã¯æ°ã3ã§ï¼0çªç®ã«å¯¾ãã¦ï¼ã¿ã¹ã¯IDãè¿ãå ´å
+ *		(E-5) ã¿ã¹ã¯æ°ã3ã§ï¼2çªç®ã«å¯¾ãã¦ï¼ã¿ã¹ã¯IDãè¿ãå ´å
+ *		(E-6) ã¿ã¹ã¯æ°ã3ã§ï¼3çªç®ã«å¯¾ãã¦ï¼TSK_NONEãè¿ãå ´å
+ *	(F) get_nthã«TSK_SELFãæå®ãï¼ã¿ã¹ã¯IDã¾ãã¯TSK_NONEãè¿ããã
+ *		(F-1) åªå
+åº¦ãå¤æ´ããã¦ããªãã¿ã¹ã¯ããã®çºè¡
+ *		(F-2) åªå
+åº¦ä¸éãã¥ã¼ããã¯ã¹ãã­ãã¯ãã¦ï¼ç¾å¨åªå
+åº¦ãä¸ãã£
+ *		      ãã¿ã¹ã¯ããã®çºè¡
+ *		(F-3) chg_priã«ããï¼ãã¼ã¹åªå
+åº¦ãä¸ãã£ãã¿ã¹ã¯ããã®çºè¡
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: é«åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK4: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK5: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	MTX1:  ãã¥ã¼ããã¯ã¹ï¼TA_CEILINGå±æ§ï¼ä¸éã¯ä¸­åªå
+åº¦ï¼
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼é«ï¼==
+ *	1:	get_lod(TMIN_TPRI-2, &load) -> E_PAR			... (A-3)
+ *		get_lod(TMAX_TPRI+1, &load) -> E_PAR			... (A-4)
+ *		get_nth(TMIN_TPRI-2, 0U, &tskid) -> E_PAR		... (D-3)
+ *		get_nth(TMAX_TPRI+1, 0U, &tskid) -> E_PAR		... (D-4)
+ *	2:	get_lod(MID_PRIORITY, &load)					... (B-1)
+ *		assert(load == 0U)
+ *		get_nth(MID_PRIORITY, 0U, &tskid)				... (E-1)
+ *		assert(tskid == TSK_NONE)
+ *	3:	act_tsk(TASK2)
+ *		get_lod(MID_PRIORITY, &load)					... (B-2)
+ *		assert(load == 1U)
+ *		get_nth(MID_PRIORITY, 0U, &tskid)				... (E-2)
+ *		assert(tskid == TASK2)
+ *		get_nth(MID_PRIORITY, 1U, &tskid)				... (E-3)
+ *		assert(tskid == TSK_NONE)
+ *	4:	act_tsk(TASK3)
+ *		act_tsk(TASK4)
+ *		get_lod(MID_PRIORITY, &load)					... (B-3)
+ *		assert(load == 3U)
+ *		get_nth(MID_PRIORITY, 0U, &tskid)				... (E-4)
+ *		assert(tskid == TASK2)
+ *		get_nth(MID_PRIORITY, 1U, &tskid)
+ *		assert(tskid == TASK3)
+ *		get_nth(MID_PRIORITY, 2U, &tskid)				... (E-5)
+ *		assert(tskid == TASK4)
+ *		get_nth(MID_PRIORITY, 3U, &tskid)				... (E-6)
+ *		assert(tskid == TSK_NONE)
+ *	5:	act_tsk(TASK5)
+ *		get_lod(MID_PRIORITY, &load)
+ *		assert(load == 3U)
+ *	6:	slp_tsk()
+ *	== TASK2ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	7:	get_lod(TPRI_SELF, &load)
+ *		assert(load == 3U)
+ *		get_nth(TPRI_SELF, 0U, &tskid)
+ *		assert(tskid == TASK2)
+ *	8:	slp_tsk()
+ *	== TASK3ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	9:	get_lod(TPRI_SELF, &load)
+ *		assert(load == 2U)
+ *		get_nth(TPRI_SELF, 0U, &tskid)
+ *		assert(tskid == TASK3)
+ *	10:	slp_tsk()
+ *	== TASK4ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	11:	get_lod(TPRI_SELF, &load)
+ *		assert(load == 1U)
+ *		get_nth(TPRI_SELF, 0U, &tskid)
+ *		assert(tskid == TASK4)
+ *	12:	slp_tsk()
+ *	== TASK5ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	13:	get_lod(TPRI_SELF, &load)						... (C-1)
+ *		assert(load == 1U)
+ *		get_nth(TPRI_SELF, 0U, &tskid)					... (F-1)
+ *		assert(tskid == TASK5)
+ *	14:	loc_mtx(MTX1)
+ *		get_lod(TPRI_SELF, &load)						... (C-2)
+ *		assert(load == 0U)
+ *		get_nth(TPRI_SELF, 0U, &tskid)					... (F-2)
+ *		assert(tskid == TSK_NONE)
+ *		get_lod(MID_PRIORITY, &load)
+ *		assert(load == 1U)
+ *		get_nth(MID_PRIORITY, 0U, &tskid)
+ *		assert(tskid == TASK5)
+ *	15:	wup_tsk(TASK2)
+ *		get_lod(TPRI_SELF, &load)
+ *		assert(load == 0U)
+ *		get_lod(MID_PRIORITY, &load)
+ *		assert(load == 2U)
+ *	16:	unl_mtx(MTX1)
+ *	== TASK2ï¼ç¶ãï¼==
+ *	17:	get_lod(TPRI_SELF, &load)
+ *		assert(load == 1U)
+ *	18:	chg_pri(TASK5, MID_PRIORITY)
+ *		get_lod(TPRI_SELF, &load)
+ *		assert(load == 2U)
+ *		rot_rdq(TPRI_SELF)
+ *	== TASK5ï¼ç¶ãï¼==
+ *	19:	get_lod(TPRI_SELF, &load)						... (C-3)
+ *		assert(load == 2U)
+ *		get_nth(TPRI_SELF, 0U, &tskid)					... (F-3)
+ *		assert(tskid == TASK5)
+ *	20: END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_sysman1.h"
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	ID		tskid;
+	ER_UINT	ercd;
+	uint_t	load;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	ercd = get_lod(TMIN_TPRI-2, &load);
+	check_ercd(ercd, E_PAR);
+
+	ercd = get_lod(TMAX_TPRI+1, &load);
+	check_ercd(ercd, E_PAR);
+
+	ercd = get_nth(TMIN_TPRI-2, 0U, &tskid);
+	check_ercd(ercd, E_PAR);
+
+	ercd = get_nth(TMAX_TPRI+1, 0U, &tskid);
+	check_ercd(ercd, E_PAR);
+
+	check_point(2);
+	ercd = get_lod(MID_PRIORITY, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 0U);
+
+	ercd = get_nth(MID_PRIORITY, 0U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TSK_NONE);
+
+	check_point(3);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_lod(MID_PRIORITY, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 1U);
+
+	ercd = get_nth(MID_PRIORITY, 0U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TASK2);
+
+	ercd = get_nth(MID_PRIORITY, 1U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TSK_NONE);
+
+	check_point(4);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_lod(MID_PRIORITY, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 3U);
+
+	ercd = get_nth(MID_PRIORITY, 0U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TASK2);
+
+	ercd = get_nth(MID_PRIORITY, 1U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TASK3);
+
+	ercd = get_nth(MID_PRIORITY, 2U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TASK4);
+
+	ercd = get_nth(MID_PRIORITY, 3U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TSK_NONE);
+
+	check_point(5);
+	ercd = act_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_lod(MID_PRIORITY, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 3U);
+
+	check_point(6);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ID		tskid;
+	ER_UINT	ercd;
+	uint_t	load;
+
+	check_point(7);
+	ercd = get_lod(TPRI_SELF, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 3U);
+
+	ercd = get_nth(TPRI_SELF, 0U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TASK2);
+
+	check_point(8);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(17);
+	ercd = get_lod(TPRI_SELF, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 1U);
+
+	check_point(18);
+	ercd = chg_pri(TASK5, MID_PRIORITY);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_lod(TPRI_SELF, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 2U);
+
+	ercd = rot_rdq(TPRI_SELF);
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ID		tskid;
+	ER_UINT	ercd;
+	uint_t	load;
+
+	check_point(9);
+	ercd = get_lod(TPRI_SELF, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 2U);
+
+	ercd = get_nth(TPRI_SELF, 0U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TASK3);
+
+	check_point(10);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task4(intptr_t exinf)
+{
+	ID		tskid;
+	ER_UINT	ercd;
+	uint_t	load;
+
+	check_point(11);
+	ercd = get_lod(TPRI_SELF, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 1U);
+
+	ercd = get_nth(TPRI_SELF, 0U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TASK4);
+
+	check_point(12);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task5(intptr_t exinf)
+{
+	ID		tskid;
+	ER_UINT	ercd;
+	uint_t	load;
+
+	check_point(13);
+	ercd = get_lod(TPRI_SELF, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 1U);
+
+	ercd = get_nth(TPRI_SELF, 0U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TASK5);
+
+	check_point(14);
+	ercd = loc_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_lod(TPRI_SELF, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 0U);
+
+	ercd = get_nth(TPRI_SELF, 0U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TSK_NONE);
+
+	ercd = get_lod(MID_PRIORITY, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 1U);
+
+	ercd = get_nth(MID_PRIORITY, 0U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TASK5);
+
+	check_point(15);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = get_lod(TPRI_SELF, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 0U);
+
+	ercd = get_lod(MID_PRIORITY, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 2U);
+
+	check_point(16);
+	ercd = unl_mtx(MTX1);
+	check_ercd(ercd, E_OK);
+
+	check_point(19);
+	ercd = get_lod(TPRI_SELF, &load);
+	check_ercd(ercd, E_OK);
+
+	check_assert(load == 2U);
+
+	ercd = get_nth(TPRI_SELF, 0U, &tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TASK5);
+
+	check_finish(20);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_sysman1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_sysman1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_sysman1.cfg	(revision 302)
@@ -0,0 +1,20 @@
+/*
+ *		ã·ã¹ãã ç¶æ
+ç®¡çæ©è½ã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³
+ *		ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_sysman1.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, HIGH_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK3, { TA_NULL, 3, task3, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK4, { TA_NULL, 4, task4, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK5, { TA_NULL, 5, task5, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_MTX(MTX1, { TA_CEILING, MID_PRIORITY });
Index: asp3_wo_tecs/trunk/test/test_sysman1.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_sysman1.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_sysman1.h	(revision 302)
@@ -0,0 +1,97 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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_sysman1.h 286 2014-11-29 07:51: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	task4(intptr_t exinf);
+extern void	task5(intptr_t exinf);
+extern void	task6(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_sysstat1.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_sysstat1.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_sysstat1.c	(revision 302)
@@ -0,0 +1,598 @@
+/*
+ *  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: test_sysstat1.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ã·ã¹ãã ç¶æ
+ã«é¢ãããã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  CPUã­ãã¯ç¶æ
+ã¨CPUã­ãã¯è§£é¤ç¶æ
+ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã¨ã
+ *  ãã§ãªãç¶æ
+ï¼ãã£ã¹ãããç¦æ­¢ç¶æ
+ã¨ãã£ã¹ãããè¨±å¯ç¶æ
+ï¼ã¿ã¹ã¯çµ
+ *  äºç¦æ­¢ç¶æ
+ã¨ã¿ã¹ã¯çµäºè¨±å¯ç¶æ
+ã®éã®ç¶æ
+é·ç§»ããã¹ãããï¼ã¾ãï¼ã¿
+ *  ã¹ã¯ã®å®è¡éå§æã¨çµäºæã®ã·ã¹ãã ç¶æ
+ã®å¤åã«ã¤ãã¦ããã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) éå¸¸ç¶æ
+ï¼CPUã­ãã¯è§£é¤ç¶æ
+ï¼å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ï¼ãã£
+ *		ã¹ãããè¨±å¯ç¶æ
+ï¼ã¿ã¹ã¯çµäºè¨±å¯ç¶æ
+ï¼ããã®ç¶æ
+é·ç§»ã®ãã¹ã
+ *		(A-1) CPUã­ãã¯ç¶æ
+ã¸ã®é·ç§»
+ *		(A-2) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªãç¶æ
+ã¸ã®é·ç§»
+ *		(A-3) ãã£ã¹ãããç¦æ­¢ç¶æ
+ã¸ã®é·ç§»
+ *		(A-4) ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã¸ã®é·ç§»
+ *	(B) CPUã­ãã¯ç¶æ
+ããã®ç¶æ
+é·ç§»ã®ãã¹ã
+ *		(B-1) CPUã­ãã¯ç¶æ
+ã¸ã®é·ç§» â¦ ä½ãèµ·ãããªã
+ *		(B-2) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªãç¶æ
+ã¸ã®é·ç§» â¦ ã¨ã©ã¼ã«
+ *		(B-3) ãã£ã¹ãããç¦æ­¢ç¶æ
+ã¸ã®é·ç§» â¦ ã¨ã©ã¼ã«
+ *		(B-4) ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã¸ã®é·ç§» â¦ ã¨ã©ã¼ã«
+ *		(B-5) CPUã­ãã¯è§£é¤ç¶æ
+ã¸ã®é·ç§»
+ *	(C) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªãç¶æ
+ããã®ç¶æ
+é·ç§»ã®ãã¹ã
+ *		(C-1) CPUã­ãã¯ç¶æ
+ã¸ã®é·ç§»
+ *		(C-2) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªãç¶æ
+ã¸ã®é·ç§» â¦ ä½ãèµ·ãããªã
+ *		(C-3) ãã£ã¹ãããç¦æ­¢ç¶æ
+ã¸ã®é·ç§»
+ *		(C-4) ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã¸ã®é·ç§»
+ *		(C-5) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ç¶æ
+ã¸ã®é·ç§»
+ *	(D) ãã£ã¹ãããç¦æ­¢ç¶æ
+ããã®ç¶æ
+é·ç§»ã®ãã¹ã
+ *		(D-1) CPUã­ãã¯ç¶æ
+ã¸ã®é·ç§»
+ *		(D-2) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªãç¶æ
+ã¸ã®é·ç§»
+ *		(D-3) ãã£ã¹ãããç¦æ­¢ç¶æ
+ã¸ã®é·ç§» â¦ ä½ãèµ·ãããªã
+ *		(D-4) ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã¸ã®é·ç§»
+ *		(D-5) ãã£ã¹ãããè¨±å¯ç¶æ
+ã¸ã®é·ç§»
+ *	(E) ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ããã®ç¶æ
+é·ç§»ã®ãã¹ã
+ *		(E-1) CPUã­ãã¯ç¶æ
+ã¸ã®é·ç§»
+ *		(E-2) å²è¾¼ã¿åªå
+åº¦ãã¹ã¯å
+¨è§£é¤ã§ãªãç¶æ
+ã¸ã®é·ç§»
+ *		(E-3) ãã£ã¹ãããç¦æ­¢ç¶æ
+ã¸ã®é·ç§»
+ *		(E-4) ã¿ã¹ã¯çµäºç¦æ­¢ç¶æ
+ã¸ã®é·ç§» â¦ ä½ãèµ·ãããªã
+ *		(E-5) ã¿ã¹ã¯çµäºè¨±å¯ç¶æ
+ã¸ã®é·ç§»
+ *	(F) ã¿ã¹ã¯ã®çµäºã»èµ·åã«ããéå¸¸ç¶æ
+ã«æ»ããã¨ã®ãã¹ã
+ *		(F-1) å¥ã®ã¿ã¹ã¯ã®èµ·å
+ *		(F-2) åãã¿ã¹ã¯ã®èµ·å
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼TA_ACTå±æ§
+ *	TASK2: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1 ==
+ *	1:	state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *	2:	loc_cpu()												... (A-1)
+ *		state(false, true, false, true, false)
+ *	3:	loc_cpu()												... (B-1)
+ *		state(false, true, false, true, false)
+ *	4:	chg_ipm(TMAX_INTPRI) -> E_CTX							... (B-2)
+ *		dis_dsp() -> E_CTX										... (B-3)
+ *		dis_ter() -> E_CTX										... (B-4)
+ *		state(false, true, false, true, false)
+ *	5:	unl_cpu()												... (B-5)
+ *		state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *	6:	chg_ipm(TMAX_INTPRI)									... (A-2)
+ *		state(false, false, false, true, false)
+ *		ipm(TMAX_INTPRI)
+ *	7:	loc_cpu()												... (C-1)
+ *		state(false, true, false, true, false)
+ *		chg_ipm(TIPM_ENAALL) -> E_CTX
+ *		dis_dsp() -> E_CTX
+ *		dis_ter() -> E_CTX
+ *		unl_cpu()
+ *		state(false, false, false, true, false)
+ *		ipm(TMAX_INTPRI)
+ *	8:	chg_ipm(TMAX_INTPRI)									... (C-2)
+ *		state(false, false, false, true, false)
+ *		ipm(TMAX_INTPRI)
+ *	9:	dis_dsp()												... (C-3)
+ *		state(false, false, true, true, false)
+ *		ipm(TMAX_INTPRI)
+ *	10:	dis_ter()												... (C-4)
+ *		state(false, false, true, true, true)
+ *		ipm(TMAX_INTPRI)
+ *	11:	chg_ipm(TIPM_ENAALL)									... (C-5)
+ *		state(false, false, true, true, true)
+ *		ipm(TIPM_ENAALL)
+ *	12:	ena_dsp()
+ *		state(false, false, false, false, true)
+ *		ipm(TIPM_ENAALL)
+ *	13:	ena_ter()
+ *		state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *	14:	dis_dsp()												... (A-3)
+ *		state(false, false, true, true, false)
+ *		ipm(TIPM_ENAALL)
+ *	15:	loc_cpu()												... (D-1)
+ *		state(false, true, true, true, false)
+ *		unl_cpu()
+ *		state(false, false, true, true, false)
+ *		ipm(TIPM_ENAALL)
+ *	16:	chg_ipm(TMAX_INTPRI)									... (D-2)
+ *		state(false, false, true, true, false)
+ *		ipm(TMAX_INTPRI)
+ *	17:	dis_dsp()												... (D-3)
+ *		state(false, false, true, true, false)
+ *		ipm(TMAX_INTPRI)
+ *	18:	dis_ter()												... (D-4)
+ *		state(false, false, true, true, true)
+ *		ipm(TMAX_INTPRI)
+ *	19:	ena_dsp()												... (D-5)
+ *		state(false, false, false, true, true)
+ *		ipm(TMAX_INTPRI)
+ *	20:	chg_ipm(TIPM_ENAALL)
+ *		state(false, false, false, false, true)
+ *		ipm(TIPM_ENAALL)
+ *	21:	ena_ter()												... (E-5)
+ *		state(false, false, false, false, false)
+ *		ipm(TIPM_ENAALL)
+ *	22:	dis_ter()												... (A-4)
+ *		state(false, false, false, false, true)
+ *		ipm(TIPM_ENAALL)
+ *	23:	loc_cpu()												... (E-1)
+ *		state(false, true, false, true, true)
+ *		unl_cpu()
+ *		state(false, false, false, false, true)
+ *		ipm(TIPM_ENAALL)
+ *	24:	chg_ipm(TMAX_INTPRI)									... (E-2)
+ *		state(false, false, false, true, true)
+ *		ipm(TMAX_INTPRI)
+ *	25:	dis_dsp()												... (E-3)
+ *		state(false, false, true, true, true)
+ *		ipm(TMAX_INTPRI)
+ *	26:	dis_ter()												... (E-4)
+ *		state(false, false, true, true, true)
+ *		ipm(TMAX_INTPRI)
+ *	27:	act_tsk(TASK2)
+ *		dis_ter()
+ *		loc_cpu()
+ *		state(false, true, true, true, true)
+ *		ext_tsk()
+ *	== TASK2-1ï¼1åç®ï¼==
+ *	28:	state(false, false, false, false, false)				... (F-1)
+ *		ipm(TIPM_ENAALL)
+ *	29:	act_tsk(TASK2)
+ *		chg_ipm(TMAX_INTPRI)
+ *		dis_dsp()
+ *		dis_ter()
+ *		loc_cpu()
+ *		state(false, true, true, true, true)
+ *		ext_tsk()
+ *	== TASK2-2ï¼2åç®ï¼==
+ *	30:	state(false, false, false, false, false)				... (F-2)
+ *		ipm(TIPM_ENAALL)
+ *	31:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_sysstat1.h"
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_point(2);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, true, false, true, false);
+
+	check_point(3);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, true, false, true, false);
+
+	check_point(4);
+	ercd = chg_ipm(TMAX_INTPRI);
+	check_ercd(ercd, E_CTX);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_CTX);
+
+	ercd = dis_ter();
+	check_ercd(ercd, E_CTX);
+
+	check_state(false, true, false, true, false);
+
+	check_point(5);
+	ercd = unl_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_point(6);
+	ercd = chg_ipm(TMAX_INTPRI);
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, false, true, false);
+
+	check_ipm(TMAX_INTPRI);
+
+	check_point(7);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, true, false, true, false);
+
+	ercd = chg_ipm(TIPM_ENAALL);
+	check_ercd(ercd, E_CTX);
+
+	ercd = dis_dsp();
+	check_ercd(ercd, E_CTX);
+
+	ercd = dis_ter();
+	check_ercd(ercd, E_CTX);
+
+	ercd = unl_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, false, true, false);
+
+	check_ipm(TMAX_INTPRI);
+
+	check_point(8);
+	ercd = chg_ipm(TMAX_INTPRI);
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, false, true, false);
+
+	check_ipm(TMAX_INTPRI);
+
+	check_point(9);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, true, true, false);
+
+	check_ipm(TMAX_INTPRI);
+
+	check_point(10);
+	ercd = dis_ter();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, true, true, true);
+
+	check_ipm(TMAX_INTPRI);
+
+	check_point(11);
+	ercd = chg_ipm(TIPM_ENAALL);
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, true, true, true);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_point(12);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, false, false, true);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_point(13);
+	ercd = ena_ter();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_point(14);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, true, true, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_point(15);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, true, true, true, false);
+
+	ercd = unl_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, true, true, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_point(16);
+	ercd = chg_ipm(TMAX_INTPRI);
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, true, true, false);
+
+	check_ipm(TMAX_INTPRI);
+
+	check_point(17);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, true, true, false);
+
+	check_ipm(TMAX_INTPRI);
+
+	check_point(18);
+	ercd = dis_ter();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, true, true, true);
+
+	check_ipm(TMAX_INTPRI);
+
+	check_point(19);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, false, true, true);
+
+	check_ipm(TMAX_INTPRI);
+
+	check_point(20);
+	ercd = chg_ipm(TIPM_ENAALL);
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, false, false, true);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_point(21);
+	ercd = ena_ter();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, false, false, false);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_point(22);
+	ercd = dis_ter();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, false, false, true);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_point(23);
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, true, false, true, true);
+
+	ercd = unl_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, false, false, true);
+
+	check_ipm(TIPM_ENAALL);
+
+	check_point(24);
+	ercd = chg_ipm(TMAX_INTPRI);
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, false, true, true);
+
+	check_ipm(TMAX_INTPRI);
+
+	check_point(25);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, true, true, true);
+
+	check_ipm(TMAX_INTPRI);
+
+	check_point(26);
+	ercd = dis_ter();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, false, true, true, true);
+
+	check_ipm(TMAX_INTPRI);
+
+	check_point(27);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	ercd = dis_ter();
+	check_ercd(ercd, E_OK);
+
+	ercd = loc_cpu();
+	check_ercd(ercd, E_OK);
+
+	check_state(false, true, true, true, true);
+
+	ercd = ext_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+static uint_t	task2_count = 0;
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++task2_count) {
+	case 1:
+		check_point(28);
+		check_state(false, false, false, false, false);
+
+		check_ipm(TIPM_ENAALL);
+
+		check_point(29);
+		ercd = act_tsk(TASK2);
+		check_ercd(ercd, E_OK);
+
+		ercd = chg_ipm(TMAX_INTPRI);
+		check_ercd(ercd, E_OK);
+
+		ercd = dis_dsp();
+		check_ercd(ercd, E_OK);
+
+		ercd = dis_ter();
+		check_ercd(ercd, E_OK);
+
+		ercd = loc_cpu();
+		check_ercd(ercd, E_OK);
+
+		check_state(false, true, true, true, true);
+
+		ercd = ext_tsk();
+		check_ercd(ercd, E_OK);
+
+		check_point(0);
+
+	case 2:
+		check_point(30);
+		check_state(false, false, false, false, false);
+
+		check_ipm(TIPM_ENAALL);
+
+		check_finish(31);
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_sysstat1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_sysstat1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_sysstat1.cfg	(revision 302)
@@ -0,0 +1,15 @@
+/*
+ *		ã·ã¹ãã ç¶æ
+ã«é¢ãããã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_sysstat1.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, TASK1_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK2, { TA_NULL, 2, task2, TASK2_PRIORITY, STACK_SIZE, NULL });
Index: asp3_wo_tecs/trunk/test/test_sysstat1.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_sysstat1.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_sysstat1.h	(revision 302)
@@ -0,0 +1,91 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2006-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_sysstat1.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ã·ã¹ãã ç¶æ
+ã«é¢ãããã¹ã(1)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åã¿ã¹ã¯ã®åªå
+åº¦ã®å®ç¾©
+ */
+#define TASK1_PRIORITY	10		/* ã¿ã¹ã¯1ã®åªå
+åº¦ */
+#define TASK2_PRIORITY	10		/* ã¿ã¹ã¯2ã®åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#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);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_task1.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_task1.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_task1.c	(revision 302)
@@ -0,0 +1,453 @@
+/*
+ *  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: test_task1.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *  make_runnableã¨make_non_runnableãç¶²ç¾
+çã«ãã¹ãããï¼
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *	(A) å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãããé«ãåªå
+åº¦ã®ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã«ãã
+ *		(A-1) ãã£ã¹ãããä¿çç¶æ
+ã§ã¯ãªãå ´å
+ *		(A-2) ãã£ã¹ãããä¿çç¶æ
+ã®å ´å
+ *	(B) å®è¡ç¶æ
+ã®ã¿ã¹ã¯ã¨åãåªå
+åº¦ã®ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã«ãã
+ *		ï¼åãåªå
+åº¦ã®ã¿ã¹ã¯ã®ä¸­ã®æ«å°¾ã«å
+¥ããã¨ãç¢ºèªãã
+ *	(C) å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãããä½ãåªå
+åº¦ã®ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã«ãã
+ *		ï¼åãåªå
+åº¦ã®ã¿ã¹ã¯ã®ä¸­ã®æ«å°¾ã«å
+¥ããã¨ãç¢ºèªãã
+ *	(D) å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ããªãç¶æ
+ã§ï¼ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã«ãã
+ *		ï¼ãã®å ´åã¯ï¼ãã£ã¹ãããä¿çç¶æ
+ã§ã¯ãªã
+ *	(E) ãã£ã¹ãããä¿çç¶æ
+ã§ï¼å®è¡ç¶æ
+ã«ãªãã¹ãã ãå®è¡å¯è½ç¶æ
+ã¿ã¹
+ *		ã¯ãããé«ãåªå
+åº¦ã®ã¿ã¹ã¯ãï¼å®è¡ã§ããç¶æ
+ã«ãã
+ *	(F) ãã£ã¹ãããä¿çç¶æ
+ã§ï¼å®è¡ç¶æ
+ã«ãªãã¹ãã ãå®è¡å¯è½ç¶æ
+ã¿ã¹
+ *		ã¯ã¨åãåªå
+åº¦ã®ã¿ã¹ã¯ãï¼å®è¡ã§ããç¶æ
+ã«ãã
+ *	(G) ãã£ã¹ãããä¿çç¶æ
+ã§ï¼å®è¡ç¶æ
+ã«ãªãã¹ãã ãå®è¡å¯è½ç¶æ
+ã¿ã¹
+ *		ã¯ãããä½ãåªå
+åº¦ã®ã¿ã¹ã¯ãï¼å®è¡ã§ããç¶æ
+ã«ãã
+ *	(H) å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãï¼å®è¡ã§ããç¶æ
+ã§ãªãã
+ *		(H-1) å®è¡ã§ããç¶æ
+ã®ã¿ã¹ã¯ããªããªãå ´å
+ *		(H-2) åä¸åªå
+åº¦ã®ã¿ã¹ã¯ããªããªãå ´å
+ *		(H-3) åä¸åªå
+åº¦ã®ã¿ã¹ã¯ããªããªããªãå ´å
+ *	(I) å®è¡å¯è½ç¶æ
+ã®ã¿ã¹ã¯ãï¼å®è¡ã§ããç¶æ
+ã§ãªãã
+ *		(I-1) åä¸åªå
+åº¦ã®ã¿ã¹ã¯ããªããªãå ´å
+ *		(I-2) åä¸åªå
+åº¦ã®ã¿ã¹ã¯ããªããªããªãå ´å
+ *	(J) ãã£ã¹ãããä¿çç¶æ
+ã§ï¼å®è¡ç¶æ
+ã«ãªãã¹ãã ãå®è¡å¯è½ç¶æ
+ã¨ãªã£
+ *		ã¦ããã¿ã¹ã¯ãï¼å®è¡ã§ããç¶æ
+ã§ãªãã
+ *		(J-1) åä¸åªå
+åº¦ã®ã¿ã¹ã¯ããªããªãå ´å
+ *		(J-2) åä¸åªå
+åº¦ã®ã¿ã¹ã¯ããªããªããªãå ´å
+ *	(K) ãã£ã¹ãããä¿çç¶æ
+ã§ï¼å®è¡å¯è½ç¶æ
+ã«ãªãã¹ãã ãå®è¡ç¶æ
+ã®ã¿
+ *		ã¹ã¯ãï¼å®è¡ã§ããç¶æ
+ã§ãªãã
+ *		ï¼ãã£ã¹ãããä¿çã§ã¯ï¼å®è¡ç¶æ
+ã®ã¿ã¹ã¯ãå®è¡ã§ããç¶æ
+ã§ãªã
+ *		ãªããããªé·ç§»ãèµ·ãããã¨ãã§ããªãããï¼ãã®ç¶æ³ã¯èµ·ãããªãï¼
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	TASK2: é«åªå
+åº¦ã¿ã¹ã¯
+ *	TASK3: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK4: ä¸­åªå
+åº¦ã¿ã¹ã¯
+ *	TASK5: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	TASK6: ä½åªå
+åº¦ã¿ã¹ã¯
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *		call(set_bit_func(bit_kernel))
+ *	1:	act_tsk(TASK2)					... (A-1)
+ *	== TASK2ï¼åªå
+åº¦ï¼é«ï¼==
+ *	2:	slp_tsk()						... (H-2)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	3:	act_tsk(TASK3)					... (B)
+ *	4:	act_tsk(TASK4)					... (B)
+ *	5:	slp_tsk()						... (H-3)
+ *	== TASK3ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	6:	slp_tsk()						... (H-3)
+ *	== TASK4ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	7:	wup_tsk(TASK1)
+ *	8:	slp_tsk()						... (H-3)
+ *	== TASK1ï¼ç¶ãï¼==
+ *	9:	act_tsk(TASK5)					... (C)
+ *	10:	act_tsk(TASK6)					... (C)
+ *	11:	sus_tsk(TASK6)					... (I-2)
+ *	12:	sus_tsk(TASK5)					... (I-1)
+ *	13:	rsm_tsk(TASK5)					... (C)
+ *	14:	rsm_tsk(TASK6)					... (C)
+ *	15:	slp_tsk()						... (H-2)
+ *	== TASK5ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	16:	slp_tsk()						... (H-3)
+ *	== TASK6ï¼åªå
+åº¦ï¼ä½ï¼==
+ *	17:	dis_dsp()
+ *	18:	wup_tsk(TASK1)					... (A-2)
+ *	19:	wup_tsk(TASK2)					... (E)
+ *	20:	sus_tsk(TASK2)					... (J-1)
+ *	21:	wup_tsk(TASK3)					... (F)
+ *	22:	wup_tsk(TASK4)					... (F)
+ *	23:	sus_tsk(TASK1)					... (J-2)
+ *	24:	ena_dsp()
+ *	== TASK3ï¼ç¶ãï¼==
+ *	25:	slp_tsk()						... (H-3)
+ *	== TASK4ï¼ç¶ãï¼==
+ *	26:	slp_tsk()						... (H-2)
+ *	== TASK6ï¼ç¶ãï¼==
+ *	27:	dis_dsp()
+ *	28:	rsm_tsk(TASK1)					... (A-2)
+ *	29:	wup_tsk(TASK5)					... (G)
+ *	30:	ena_dsp()
+ *	== TASK1ï¼ç¶ãï¼==
+ *	31:	slp_tsk()						... (H-2)
+ *	== TASK6ï¼ç¶ãï¼==
+ *	32:	slp_tsk()						... (H-3)
+ *	== TASK5ï¼ç¶ãï¼==
+ *	33:	sta_alm(ALM1, 10000U)
+ *	34:	slp_tsk()						... (H-1)
+ *	== ALM1 ==
+ *	35:	get_tid(&tskid)
+ *		assert(tskid == TSK_NONE)
+ *	36:	wup_tsk(TASK1)					... (D)
+ *	37:	RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	38: END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_task1.h"
+
+extern ER	bit_kernel(void);
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ID		tskid;
+	ER_UINT	ercd;
+
+	check_point(35);
+	ercd = get_tid(&tskid);
+	check_ercd(ercd, E_OK);
+
+	check_assert(tskid == TSK_NONE);
+
+	check_point(36);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(37);
+	return;
+
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	test_start(__FILE__);
+
+	set_bit_func(bit_kernel);
+
+	check_point(1);
+	ercd = act_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(3);
+	ercd = act_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(4);
+	ercd = act_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(5);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(9);
+	ercd = act_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(10);
+	ercd = act_tsk(TASK6);
+	check_ercd(ercd, E_OK);
+
+	check_point(11);
+	ercd = sus_tsk(TASK6);
+	check_ercd(ercd, E_OK);
+
+	check_point(12);
+	ercd = sus_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(13);
+	ercd = rsm_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(14);
+	ercd = rsm_tsk(TASK6);
+	check_ercd(ercd, E_OK);
+
+	check_point(15);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(31);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_finish(38);
+	check_point(0);
+}
+
+void
+task2(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(2);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task3(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(6);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(25);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task4(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(7);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(8);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(26);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task5(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(16);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(33);
+	ercd = sta_alm(ALM1, 10000U);
+	check_ercd(ercd, E_OK);
+
+	check_point(34);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
+
+void
+task6(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	check_point(17);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(18);
+	ercd = wup_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(19);
+	ercd = wup_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(20);
+	ercd = sus_tsk(TASK2);
+	check_ercd(ercd, E_OK);
+
+	check_point(21);
+	ercd = wup_tsk(TASK3);
+	check_ercd(ercd, E_OK);
+
+	check_point(22);
+	ercd = wup_tsk(TASK4);
+	check_ercd(ercd, E_OK);
+
+	check_point(23);
+	ercd = sus_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(24);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(27);
+	ercd = dis_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(28);
+	ercd = rsm_tsk(TASK1);
+	check_ercd(ercd, E_OK);
+
+	check_point(29);
+	ercd = wup_tsk(TASK5);
+	check_ercd(ercd, E_OK);
+
+	check_point(30);
+	ercd = ena_dsp();
+	check_ercd(ercd, E_OK);
+
+	check_point(32);
+	ercd = slp_tsk();
+	check_ercd(ercd, E_OK);
+
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_task1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_task1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_task1.cfg	(revision 302)
@@ -0,0 +1,19 @@
+/*
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_task1.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, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK4, { TA_NULL, 4, task4, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK5, { TA_NULL, 5, task5, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_TSK(TASK6, { TA_NULL, 6, task6, LOW_PRIORITY, STACK_SIZE, NULL });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
Index: asp3_wo_tecs/trunk/test/test_task1.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_task1.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_task1.h	(revision 302)
@@ -0,0 +1,97 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  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: test_task1.h 286 2014-11-29 07:51:11Z ertl-hiro $
+ */
+
+/* 
+ *		ã¿ã¹ã¯ç®¡çã¢ã¸ã¥ã¼ã«ã®ãã¹ã(1)
+ */
+
+#include <kernel.h>
+
+/*
+ *  ã¿ã¼ã²ããä¾å­ã®å®ç¾©
+ */
+#include "target_test.h"
+
+/*
+ *  åªå
+åº¦ã®å®ç¾©
+ */
+#define HIGH_PRIORITY	4		/* é«åªå
+åº¦ */
+#define MID_PRIORITY	9		/* ä¸­åªå
+åº¦ */
+#define LOW_PRIORITY	14		/* ä½åªå
+åº¦ */
+
+/*
+ *  ã¿ã¼ã²ããã«ä¾å­ããå¯è½æ§ã®ããå®æ°ã®å®ç¾©
+ */
+#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	task4(intptr_t exinf);
+extern void	task5(intptr_t exinf);
+extern void	task6(intptr_t exinf);
+extern void	alarm1_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/test/test_tmevt1.c
===================================================================
--- asp3_wo_tecs/trunk/test/test_tmevt1.c	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_tmevt1.c	(revision 302)
@@ -0,0 +1,473 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 2014-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: test_tmevt1.c 310 2015-02-08 13:46:46Z ertl-hiro $
+ */
+
+/* 
+ *		ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«ã®ãã¹ã(1)
+ *
+ * ããã¹ãã®ç®çã
+ *
+ *	ã»ã·ã¹ãã æå»ãåèª¿å¢å ãããã¨
+ *	ã»ã¢ã©ã¼ã ãã³ãã©ã®å®è¡éå§ã¾ã§ã®æéãåèª¿æ¸å°ãããã¨
+ *	ã»adj_timã«ããã·ã¹ãã æå»ãé²ããå ´åã®åä½ã®ç¢ºèª
+ *	ã»adj_timã«ããã·ã¹ãã æå»ãé
+ãããå ´åã®åä½ã®ç¢ºèª
+ *
+ * ããã¹ãé 
+ç®ã
+ *
+ *  
+ *
+ * ãä½¿ç¨ãªã½ã¼ã¹ã
+ *
+ *	TASK1: ä¸­åªå
+åº¦ã¿ã¹ã¯ï¼ã¡ã¤ã³ã¿ã¹ã¯ï¼æåããèµ·å
+ *	ALM1:  ã¢ã©ã¼ã ãã³ãã©
+ *	ALM2:  ã¢ã©ã¼ã ãã³ãã©
+ *	ALM3:  ã¢ã©ã¼ã ãã³ãã©
+ *
+ * ããã¹ãã·ã¼ã±ã³ã¹ã
+ *
+ *	== TASK1ï¼åªå
+åº¦ï¼ä¸­ï¼==
+ *	1:	sta_alm(ALM1, ALM1_RELTIM)
+ *		DO(prev_lefttim = UINT32_MAX)
+ *		DO(wait_alarm1(&alarm1_flag1))
+ *	== ALM1-1ï¼1åç®ï¼==
+ *	2:	DO(alarm1_flag1 = true)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	3:	sta_alm(ALM1, ALM1_RELTIM)
+ *		DO(prev_lefttim = UINT32_MAX)
+ *		DO(wait_alarm1(&alarm1_flag2))
+ *	== ALM1-2ï¼2åç®ï¼==
+ *	4:	DO(alarm1_flag2 = true)
+ *	5:	sta_alm(ALM1, ALM1_RELTIM)
+ *		DO(prev_lefttim = UINT32_MAX)
+ *		DO(skip_check = true)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	6:	DO(wait_alarm1(&alarm1_flag3))
+ *	== ALM1-3ï¼3åç®ï¼==
+ *	7:	DO(alarm1_flag3 = true)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	8:	sta_alm(ALM1, ALM1_RELTIM * 4)
+ *		DO(prev_lefttim = UINT32_MAX)
+ *		DO(refer_alarm1())
+ *  9:	dly_tsk(ALM1_RELTIM)
+ *		DO(prev_lefttim -= ALM1_RELTIM)
+ *		DO(refer_alarm1())
+ *  10:	adj_tim(ALM1_RELTIM)
+ *		DO(wait_alarm1(&alarm1_flag4))
+ *	== ALM1-4ï¼4åç®ï¼==
+ *	11:	DO(alarm1_flag4 = true)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	12:	sta_alm(ALM1, ALM1_RELTIM * 4)
+ *		DO(prev_lefttim = UINT32_MAX)
+ *		DO(refer_alarm1())
+ *  13:	dly_tsk(ALM1_RELTIM)
+ *		DO(prev_lefttim -= ALM1_RELTIM)
+ *		DO(refer_alarm1())
+ *  14:	adj_tim(-ALM1_RELTIM)
+ *		DO(prev_lefttim += ALM1_RELTIM)
+ *	15:	DO(wait_alarm1(&alarm1_flag5))
+ *	== ALM1-5ï¼5åç®ï¼==
+ *	16:	DO(alarm1_flag5 = true)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	17:	sta_alm(ALM1, ALM1_RELTIM * 6)
+ *		sta_alm(ALM2, ALM1_RELTIM * 4)
+ *		DO(prev_lefttim = UINT32_MAX)
+ *		DO(refer_alarm1())
+ *  18:	dly_tsk(ALM1_RELTIM)
+ *		DO(prev_lefttim -= ALM1_RELTIM)
+ *		DO(refer_alarm1())
+ *	19:	stp_alm(ALM2)
+ *		ref_alm(ALM2, &ralm)
+ *		assert((ralm.almstat & TALM_STP) != 0U)
+ *		DO(refer_alarm1())
+ *	20:	DO(wait_alarm1(&alarm1_flag6))
+ *	== ALM1-6ï¼6åç®ï¼==
+ *	21:	DO(alarm1_flag6 = true)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	22:	sta_alm(ALM1, ALM1_RELTIM * 6)
+ *		sta_alm(ALM2, ALM1_RELTIM * 4)
+ *		sta_alm(ALM3, ALM1_RELTIM)
+ *		DO(prev_lefttim = UINT32_MAX)
+ *	23:	DO(wait_alarm1(&alarm1_flag7))
+ *	== ALM3-1ï¼1åç®ï¼==
+ *	24:	stp_alm(ALM2)
+ *		RETURN
+ *	== ALM1-7ï¼7åç®ï¼==
+ *	25:	DO(alarm1_flag7 = true)
+ *		RETURN
+ *	== TASK1ï¼ç¶ãï¼==
+ *	26:	ref_alm(ALM2, &ralm)
+ *		assert((ralm.almstat & TALM_STP) != 0U)
+ *	27:	END
+ */
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include "syssvc/test_svc.h"
+#include "kernel_cfg.h"
+#include "test_tmevt1.h"
+
+volatile bool_t		alarm1_flag1 = false;
+volatile bool_t		alarm1_flag2 = false;
+volatile bool_t		alarm1_flag3 = false;
+volatile bool_t		alarm1_flag4 = false;
+volatile bool_t		alarm1_flag5 = false;
+volatile bool_t		alarm1_flag6 = false;
+volatile bool_t		alarm1_flag7 = false;
+
+RELTIM		prev_lefttim;			/* lefttimã®å¢å ãã§ãã¯ç¨ã®å¤æ° */
+bool_t		skip_check = false;		/* å¢å ãã§ãã¯ã1åã¹ã­ãããã */
+
+SYSTIM		prev_systim;			/* systimã®å¢å ãã§ãã¯ç¨ã®å¤æ° */
+
+void
+refer_alarm1(void)
+{
+	T_RALM	ralm;
+	bool_t	skip_check_bak;
+	ER		ercd;
+
+	skip_check_bak = skip_check;
+	skip_check = false;
+
+	ercd = ref_alm(ALM1, &ralm);
+	check_ercd(ercd, E_OK);
+
+	if ((ralm.almstat & TALM_STA) != 0U) {
+//		syslog(LOG_NOTICE, "lefttim = %tu", ralm.lefttim);
+		if (ralm.lefttim > prev_lefttim && !skip_check_bak) {
+			syslog(LOG_ERROR, "lefttim increases (%tu -> %tu)",
+										prev_lefttim, ralm.lefttim);
+		}
+		prev_lefttim = ralm.lefttim;
+	}
+	else {
+//		syslog(LOG_NOTICE, "ALM1 is stopped.");
+		prev_lefttim = 0U;
+	}
+}
+
+void
+refer_systim(void)
+{
+	SYSTIM	systim;
+	ER		ercd;
+
+	ercd = get_tim(&systim);
+	check_ercd(ercd, E_OK);
+
+//	syslog(LOG_NOTICE, "systim = %Tu", systim);
+	if (systim < prev_systim) {
+		syslog(LOG_ERROR, "systim decreases (%tu -> %tu)",
+								(uint_t) prev_systim, (uint_t) systim);
+	}
+	prev_systim = systim;
+}
+
+void
+wait_alarm1(volatile bool_t *p_flag)
+{
+	do {
+		refer_systim();
+		refer_alarm1();
+	} while (!(*p_flag));
+}
+
+void
+alarm2_handler(intptr_t exinf)
+{
+}
+
+/* DO NOT DELETE THIS LINE -- gentest depends on it. */
+
+static uint_t	alarm1_count = 0;
+
+void
+alarm1_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++alarm1_count) {
+	case 1:
+		check_point(2);
+		alarm1_flag1 = true;
+
+		return;
+
+		check_point(0);
+
+	case 2:
+		check_point(4);
+		alarm1_flag2 = true;
+
+		check_point(5);
+		ercd = sta_alm(ALM1, ALM1_RELTIM);
+		check_ercd(ercd, E_OK);
+
+		prev_lefttim = UINT32_MAX;
+
+		skip_check = true;
+
+		return;
+
+		check_point(0);
+
+	case 3:
+		check_point(7);
+		alarm1_flag3 = true;
+
+		return;
+
+		check_point(0);
+
+	case 4:
+		check_point(11);
+		alarm1_flag4 = true;
+
+		return;
+
+		check_point(0);
+
+	case 5:
+		check_point(16);
+		alarm1_flag5 = true;
+
+		return;
+
+		check_point(0);
+
+	case 6:
+		check_point(21);
+		alarm1_flag6 = true;
+
+		return;
+
+		check_point(0);
+
+	case 7:
+		check_point(25);
+		alarm1_flag7 = true;
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+static uint_t	alarm3_count = 0;
+
+void
+alarm3_handler(intptr_t exinf)
+{
+	ER_UINT	ercd;
+
+	switch (++alarm3_count) {
+	case 1:
+		check_point(24);
+		ercd = stp_alm(ALM2);
+		check_ercd(ercd, E_OK);
+
+		return;
+
+		check_point(0);
+
+	default:
+		check_point(0);
+	}
+	check_point(0);
+}
+
+void
+task1(intptr_t exinf)
+{
+	ER_UINT	ercd;
+	T_RALM	ralm;
+
+	test_start(__FILE__);
+
+	check_point(1);
+	ercd = sta_alm(ALM1, ALM1_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	prev_lefttim = UINT32_MAX;
+
+	wait_alarm1(&alarm1_flag1);
+
+	check_point(3);
+	ercd = sta_alm(ALM1, ALM1_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	prev_lefttim = UINT32_MAX;
+
+	wait_alarm1(&alarm1_flag2);
+
+	check_point(6);
+	wait_alarm1(&alarm1_flag3);
+
+	check_point(8);
+	ercd = sta_alm(ALM1, ALM1_RELTIM * 4);
+	check_ercd(ercd, E_OK);
+
+	prev_lefttim = UINT32_MAX;
+
+	refer_alarm1();
+
+	check_point(9);
+	ercd = dly_tsk(ALM1_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	prev_lefttim -= ALM1_RELTIM;
+
+	refer_alarm1();
+
+	check_point(10);
+	ercd = adj_tim(ALM1_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	wait_alarm1(&alarm1_flag4);
+
+	check_point(12);
+	ercd = sta_alm(ALM1, ALM1_RELTIM * 4);
+	check_ercd(ercd, E_OK);
+
+	prev_lefttim = UINT32_MAX;
+
+	refer_alarm1();
+
+	check_point(13);
+	ercd = dly_tsk(ALM1_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	prev_lefttim -= ALM1_RELTIM;
+
+	refer_alarm1();
+
+	check_point(14);
+	ercd = adj_tim(-ALM1_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	prev_lefttim += ALM1_RELTIM;
+
+	check_point(15);
+	wait_alarm1(&alarm1_flag5);
+
+	check_point(17);
+	ercd = sta_alm(ALM1, ALM1_RELTIM * 6);
+	check_ercd(ercd, E_OK);
+
+	ercd = sta_alm(ALM2, ALM1_RELTIM * 4);
+	check_ercd(ercd, E_OK);
+
+	prev_lefttim = UINT32_MAX;
+
+	refer_alarm1();
+
+	check_point(18);
+	ercd = dly_tsk(ALM1_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	prev_lefttim -= ALM1_RELTIM;
+
+	refer_alarm1();
+
+	check_point(19);
+	ercd = stp_alm(ALM2);
+	check_ercd(ercd, E_OK);
+
+	ercd = ref_alm(ALM2, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STP) != 0U);
+
+	refer_alarm1();
+
+	check_point(20);
+	wait_alarm1(&alarm1_flag6);
+
+	check_point(22);
+	ercd = sta_alm(ALM1, ALM1_RELTIM * 6);
+	check_ercd(ercd, E_OK);
+
+	ercd = sta_alm(ALM2, ALM1_RELTIM * 4);
+	check_ercd(ercd, E_OK);
+
+	ercd = sta_alm(ALM3, ALM1_RELTIM);
+	check_ercd(ercd, E_OK);
+
+	prev_lefttim = UINT32_MAX;
+
+	check_point(23);
+	wait_alarm1(&alarm1_flag7);
+
+	check_point(26);
+	ercd = ref_alm(ALM2, &ralm);
+	check_ercd(ercd, E_OK);
+
+	check_assert((ralm.almstat & TALM_STP) != 0U);
+
+	check_finish(27);
+	check_point(0);
+}
Index: asp3_wo_tecs/trunk/test/test_tmevt1.cfg
===================================================================
--- asp3_wo_tecs/trunk/test/test_tmevt1.cfg	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_tmevt1.cfg	(revision 302)
@@ -0,0 +1,17 @@
+/*
+ *		ã¿ã¤ã ã¤ãã³ãç®¡çã¢ã¸ã¥ã¼ã«ã®ãã¹ã(1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼
+ *		ã·ã§ã³ãã¡ã¤ã«
+ *
+ *  $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");
+INCLUDE("syssvc/serial.cfg");
+
+#include "test_tmevt1.h"
+
+CRE_TSK(TASK1, { TA_ACT, 1, task1, MID_PRIORITY, STACK_SIZE, NULL });
+CRE_ALM(ALM1, { TA_NULL, { TNFY_HANDLER, 1, alarm1_handler }});
+CRE_ALM(ALM2, { TA_NULL, { TNFY_HANDLER, 1, alarm2_handler }});
+CRE_ALM(ALM3, { TA_NULL, { TNFY_HANDLER, 1, alarm3_handler }});
Index: asp3_wo_tecs/trunk/test/test_tmevt1.h
===================================================================
--- asp3_wo_tecs/trunk/test/test_tmevt1.h	(revision 302)
+++ asp3_wo_tecs/trunk/test/test_tmevt1.h	(revision 302)
@@ -0,0 +1,98 @@
+/*
+ *  TOPPERS Software
+ *      Toyohashi Open Platform for Embedded Real-Time Systems
+ * 
+ *  Copyright (C) 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_tmevt1.h 286 2014-11-29 07:51: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 ALM1_RELTIM
+#define ALM1_RELTIM		200U		/* ã¢ã©ã¼ã ãã³ãã©1ã«ä»æããç¸å¯¾æé */
+#endif /* ALM1_RELTIM */
+
+/*
+ *  é¢æ°ã®ãã­ãã¿ã¤ãå®£è¨
+ */
+#ifndef TOPPERS_MACRO_ONLY
+
+extern void	task1(intptr_t exinf);
+extern void	alarm1_handler(intptr_t exinf);
+extern void	alarm2_handler(intptr_t exinf);
+extern void	alarm3_handler(intptr_t exinf);
+
+#endif /* TOPPERS_MACRO_ONLY */
Index: asp3_wo_tecs/trunk/utils/applyrename
===================================================================
--- asp3_wo_tecs/trunk/utils/applyrename	(revision 302)
+++ asp3_wo_tecs/trunk/utils/applyrename	(revision 302)
@@ -0,0 +1,134 @@
+#! /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/genrename
===================================================================
--- asp3_wo_tecs/trunk/utils/genrename	(revision 302)
+++ asp3_wo_tecs/trunk/utils/genrename	(revision 302)
@@ -0,0 +1,265 @@
+#! /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/gentest
===================================================================
--- asp3_wo_tecs/trunk/utils/gentest	(revision 302)
+++ asp3_wo_tecs/trunk/utils/gentest	(revision 302)
@@ -0,0 +1,494 @@
+#! /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/makerelease
===================================================================
--- asp3_wo_tecs/trunk/utils/makerelease	(revision 302)
+++ asp3_wo_tecs/trunk/utils/makerelease	(revision 302)
@@ -0,0 +1,174 @@
+#! /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/move-if-change
===================================================================
--- asp3_wo_tecs/trunk/utils/move-if-change	(revision 302)
+++ asp3_wo_tecs/trunk/utils/move-if-change	(revision 302)
@@ -0,0 +1,13 @@
+#! /bin/sh
+if test -r $2
+  then
+  if cmp -s $1 $2
+  then
+    echo $2 is unchanged
+    rm -f $1
+  else
+    mv -f $1 $2
+  fi
+else
+  mv -f $1 $2
+fi
