Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/Makefile.kernel
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/Makefile.kernel	(revision 305)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/Makefile.kernel	(revision 306)
@@ -6,5 +6,5 @@
 #  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
+#  Copyright (C) 2005-2016 by Embedded and Real-Time Systems Laboratory
 #              Graduate School of Information Science, Nagoya Univ., JAPAN
 # 
@@ -53,5 +53,5 @@
 #  ã®è²¬ä»»ãè² ããªãï¼
 # 
-#  $Id: Makefile.kernel 236 2014-09-28 16:24:33Z ertl-hiro $
+#  $Id: Makefile.kernel 554 2016-01-17 13:21:59Z ertl-hiro $
 # 
 
@@ -137,24 +137,24 @@
 #  çæããããªãã¸ã§ã¯ããã¡ã¤ã«ã®ä¾å­é¢ä¿ã®å®ç¾©
 #
-$(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
+$(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
+$(messagebuf) $(messagebuf:.o=.s): messagebuf.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/extension/messagebuf/kernel/kernel.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel.tf	(revision 305)
+++ 	(revision )
@@ -1,430 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2015 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: kernel.tf 480 2016-01-03 07:37:12Z ertl-hiro $
-$ 
-
-$
-$		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹2ã®ãã³ãã¬ã¼ããã¡ã¤ã«
-$
-
-$
-$  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.trb
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel.trb	(revision 306)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel.trb	(revision 306)
@@ -0,0 +1,491 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: kernel.trb 670 2016-03-03 15:08:11Z ertl-hiro $
+# 
+
+#
+#		ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã®ãã¹2ã®çæã¹ã¯ãªãã
+#
+
+#
+#  ã¿ã¤ã ã¹ã¿ã³ããã¡ã¤ã«ã®æå®
+#
+$timeStampFileName = "kernel_cfg.timestamp"
+
+#
+#  kernel_cfg.hã®å
+é ­é¨åã®çæ
+#
+$kernelCfgH = GenFile.new("kernel_cfg.h")
+$kernelCfgH.add(<<EOS)
+/* kernel_cfg.h */
+#ifndef TOPPERS_KERNEL_CFG_H
+#define TOPPERS_KERNEL_CFG_H
+EOS
+
+#
+#  kernel_cfg.cã®å
+é ­é¨åã®çæ
+#
+$kernelCfgC = GenFile.new("kernel_cfg.c")
+$kernelCfgC.add(<<EOS)
+/* kernel_cfg.c */
+#include "kernel/kernel_int.h"
+#include "kernel_cfg.h"
+
+#if !(TKERNEL_PRID == 0x0007U && (TKERNEL_PRVER & 0xf000U) == 0x3000U)
+#error The kernel does not match this configuration file.
+#endif
+EOS
+
+#
+#  ã¤ã³ã¯ã«ã¼ããã£ã¬ã¯ãã£ãï¼#includeï¼
+#
+$kernelCfgC.comment_header("Include Directives")
+$includeFiles.each do |file|
+  $kernelCfgC.add("#include #{file}")
+end
+$kernelCfgC.add()
+
+#
+#  ã¹ã¿ãã¯é åã®ç¢ºä¿é¢æ°
+#
+#  ã¹ã¿ãã¯é åã®å®ç¾©åã¨ï¼ã¹ã¿ãã¯é åã®ãµã¤ãºè¨è¿°ãé
+åã§è¿ãï¼
+#
+unless defined? AllocStack()
+  def AllocStack(stack, size)
+    # å¤§ããæ¹ã«ä¸¸ãããµã¤ãºã§ç¢ºä¿ããï¼»NGKI1050ï¼½ï¼»NGKI3220ï¼½
+    $kernelCfgC.add("static STK_T #{stack}[COUNT_STK_T(#{size})];")
+    return("ROUND_STK_T(#{size})")
+  end
+end
+
+#
+#  ã«ã¼ãã«ãªãã¸ã§ã¯ãã«é¢ããæ
+å ±ã®çæï¼ä»®æ³ã¯ã©ã¹ï¼
+#
+class KernelObject
+  def initialize(obj, object, obj_s = obj)
+    @obj = obj
+    @OBJ = obj.tr("a-z", "A-Z")
+    @object = object
+    @obj_s = obj_s
+    @OBJ_S = obj_s.tr("a-z", "A-Z")
+    @objid = (obj + "id").to_sym
+    @api = "CRE_#{@OBJ}".to_sym
+  end
+
+  def generate()
+    # kernel_cfg.hã®çæ
+    $kernelCfgH.add("#define TNUM_#{@OBJ}ID\t#{$cfgData[@api].size}")
+
+    # ãªãã¸ã§ã¯ãã®IDçªå·ã®ãã¯ã­å®ç¾©ã®çæ
+    $cfgData[@api].sort.each do |key, params|
+      $kernelCfgH.add("#define #{params[@objid]}\t#{params[@objid].val}")
+    end
+    $kernelCfgH.add()
+
+    # ãªãã¸ã§ã¯ãã®IDçªå·ãä¿æããå¤æ°
+    if $USE_EXTERNAL_ID
+      $cfgData[@api].sort.each do |key, params|
+        $kernelCfgC.add("const ID #{params[@objid]}_id" \
+										" = #{params[@objid].val};")
+      end
+      $kernelCfgC.add()
+    end
+
+    # ãªãã¸ã§ã¯ãIDçªå·ã®æå¤§å¤
+    $kernelCfgC.add2("const ID _kernel_tmax_#{@obj}id" \
+							" = (TMIN_#{@OBJ}ID + TNUM_#{@OBJ}ID - 1);")
+
+    # ãã¼ã¿æ§é 
+    if $cfgData[@api].size > 0
+      # äºåæºåï¼ã¨ã©ã¼ãã§ãã¯ï¼ã¡ã¢ãªé åã®çæï¼
+      $cfgData[@api].sort.each do |key, params|
+        prepare(key, params)
+      end
+
+      # ãªãã¸ã§ã¯ãå
+¨ä½ã«å¯¾ãã¦å¿
+è¦ãªã¡ã¢ãªé åã®çæï¼ãªãã·ã§ã³ï¼
+      if respond_to?(:generateData)
+        generateData()
+      end
+
+      # ãªãã¸ã§ã¯ãåæåãã­ãã¯ã®çæ
+      $kernelCfgC.add("const #{@OBJ_S}INIB _kernel_#{@obj_s}inib_table" \
+													"[TNUM_#{@OBJ}ID] = {")
+      $cfgData[@api].sort.each_with_index do |(key, params), index|
+        $kernelCfgC.add(",") if index > 0
+        $kernelCfgC.append("\t{ " + generateInib(key, params) + " }")
+      end
+      $kernelCfgC.add
+      $kernelCfgC.add2("};")
+
+      # ãªãã¸ã§ã¯ãç®¡çãã­ãã¯ã®çæ
+      $kernelCfgC.add2("#{@OBJ_S}CB _kernel_#{@obj_s}cb_table" \
+													"[TNUM_#{@OBJ}ID];")
+
+      # ãªãã¸ã§ã¯ãåæåé¢æ°ã®è¿½å 
+      $initializeFunctions.push("_kernel_initialize_#{@object}();")
+    else
+      # ãªãã¸ã§ã¯ãã1ã¤ããªãå ´å
+      $kernelCfgC.add("TOPPERS_EMPTY_LABEL(const #{@OBJ_S}INIB, " \
+										"_kernel_#{@obj_s}inib_table);")
+      $kernelCfgC.add2("TOPPERS_EMPTY_LABEL(#{@OBJ_S}CB, " \
+										"_kernel_#{@obj_s}cb_table);")
+    end
+  end
+end
+
+#
+#  éç¥ãã³ãã©ã®çæé¢æ°
+#
+def generateNotifyHandler(key, params, objid)
+  # ãã©ã¡ã¼ã¿ãå¤æ°ã«æ ¼ç´
+  nfymode = params[:nfymode]
+  nfymode1 = nfymode & 0x0f
+  nfymode2 = nfymode & ~0x0f
+  par1 = params[:par1]
+  par2 = params[:par2]
+
+  # éç¥å¦çã®ãã©ã¡ã¼ã¿æ°ã«ããè£æ­£å¦ç
+  if nfymode == $TNFY_HANDLER || nfymode1 == $TNFY_SETVAR \
+								|| nfymode1 == $TNFY_SETFLG \
+								|| nfymode1 == $TNFY_SNDDTQ
+    # éç¥å¦çã®ãã©ã¡ã¼ã¿ã2ã¤ã®å ´å
+	numpar = 2
+	epar1 = params[:par3]
+	epar2 = params[:par4]
+  else
+    # éç¥å¦çã®ãã©ã¡ã¼ã¿ã1ã¤ã®å ´å
+    numpar = 1
+    epar1 = params[:par2]
+    epar2 = params[:par3]
+  end
+
+  # ãã©ã¡ã¼ã¿æ°ã®ãã§ãã¯
+  if (numpar == 2 && par2.nil?) || (nfymode2 != 0 && epar1.nil?) \
+								|| (nfymode2 == $TENFY_SETFLG && epar2.nil?)
+    # ãã©ã¡ã¼ã¿ãè¶³ããªãå ´å
+    error_api(params, "too few parameters for nfymode `#{nfymode}' " \
+											"in %apiname of %#{objid}")
+  elsif (nfymode2 == 0 && !epar1.nil?) \
+					|| (nfymode2 != $TENFY_SETFLG && !epar2.nil?)
+    # ãã©ã¡ã¼ã¿ãå¤ãããå ´å
+    error_api(params, "too many parameters for nfymode `#{nfymode}' " \
+											"in %apiname of %#{objid}")
+  elsif nfymode == $TNFY_HANDLER
+    # ã¿ã¤ã ã¤ãã³ããã³ãã©ã®å¼åºã
+    funcname = "(NFYHDR)(#{par2})"
+  else
+    # éç¥ãã³ãã©ã®é¢æ°å
+    funcname = "_kernel_nfyhdr_#{params[objid]}"
+
+    # ã¨ã©ã¼éç¥ã®ããã®å¤æ°ã®ã¢ãã¬ã¹ã¨ãªãã¸ã§ã¯ãIDãæ ¼ç´ãã
+    # å¤æ°ã®çæï¼ã¨ã©ã¼ãã§ãã¯ã®ããã«å¿
+è¦ï¼
+    if nfymode2 == $TENFY_SETVAR || nfymode2 == $TENFY_INCVAR
+      $kernelCfgC.add2("intptr_t *const #{funcname}_p_evar =" \
+											" (intptr_t *)(#{epar1});")
+    elsif nfymode2 == $TENFY_ACTTSK || nfymode2 == $TENFY_WUPTSK
+      $kernelCfgC.add2("const ID #{funcname}_etskid = #{epar1};")
+    elsif nfymode2 == $TENFY_SIGSEM
+      $kernelCfgC.add2("const ID #{funcname}_esemid = #{epar1};")
+    elsif nfymode2 == $TENFY_SETFLG
+      $kernelCfgC.add2("const ID #{funcname}_eflgid = #{epar1};")
+    elsif nfymode2 == $TENFY_SNDDTQ
+      $kernelCfgC.add2("const ID #{funcname}_edtqid = #{epar1};")
+    end
+
+    # é¢æ°ã®å
+é ­é¨åã®çæ
+    $kernelCfgC.add("static void")
+    $kernelCfgC.add("#{funcname}(intptr_t exinf)")
+    $kernelCfgC.add("{")
+
+    if nfymode2 == 0
+      # ã¨ã©ã¼éç¥ããªãå ´å
+      errorCode = "(void) "
+    else
+      # ã¨ã©ã¼éç¥ãããå ´å
+      $kernelCfgC.add2("\tER\tercd;")
+      errorCode = "ercd = "
+    end
+
+    # ã¤ãã³ãéç¥å¦çã®å¦ç
+    if nfymode1 == $TNFY_SETVAR && nfymode2 == 0
+      # å¤æ°ã®è¨­å®
+      $kernelCfgC.add("\t*((intptr_t *) exinf) = (#{par2});")
+    elsif nfymode1 == $TNFY_INCVAR && nfymode2 == 0
+      # å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã
+      $kernelCfgC.add("\t(void) loc_cpu();")
+      $kernelCfgC.add("\t*((intptr_t *) exinf) += 1;")
+      $kernelCfgC.add("\t(void) unl_cpu();")
+    elsif nfymode1 == $TNFY_ACTTSK
+      # ã¿ã¹ã¯ã®èµ·å
+      $kernelCfgC.add("\t#{errorCode}act_tsk((ID) exinf);")
+    elsif nfymode1 == $TNFY_WUPTSK
+      # ã¿ã¹ã¯ã®èµ·åº
+      $kernelCfgC.add("\t#{errorCode}wup_tsk((ID) exinf);")
+    elsif nfymode1 == $TNFY_SIGSEM
+      # ã»ããã©ã®è¿å´
+      $kernelCfgC.add("\t#{errorCode}sig_sem((ID) exinf);")
+    elsif nfymode1 == $TNFY_SETFLG
+      # ã¤ãã³ããã©ã°ã®ã»ãã
+      $kernelCfgC.add("\t#{errorCode}set_flg(((ID) exinf), #{par2});")
+    elsif nfymode1 == $TNFY_SNDDTQ
+      # ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡
+      $kernelCfgC.add("\t#{errorCode}psnd_dtq(((ID) exinf), #{par2});")
+    else
+      error_illegal_id("E_PAR", params, :nfymode, objid)
+    end
+			
+    if nfymode2 != 0
+      # ã¨ã©ã¼éç¥å¦çã®å¦ç
+      $kernelCfgC.add("\tif (ercd != E_OK) {")
+
+
+      if nfymode2 == $TENFY_SETVAR
+        # å¤æ°ã®è¨­å®
+        $kernelCfgC.add("\t\t*#{funcname}_p_evar = (intptr_t) ercd;")
+      elsif nfymode2 == $TENFY_INCVAR
+        # å¤æ°ã®ã¤ã³ã¯ãªã¡ã³ã
+        $kernelCfgC.add("\t\t(void) loc_cpu();")
+        $kernelCfgC.add("\t\t*#{funcname}_p_evar += 1;")
+        $kernelCfgC.add("\t\t(void) unl_cpu();")
+      elsif nfymode2 == $TENFY_ACTTSK
+        # ã¿ã¹ã¯ã®èµ·å
+        $kernelCfgC.add("\t\t(void) act_tsk(#{funcname}_etskid);")
+      elsif nfymode2 == $TENFY_WUPTSK
+        # ã¿ã¹ã¯ã®èµ·åº
+        $kernelCfgC.add("\t\t(void) wup_tsk(#{funcname}_etskid);")
+      elsif nfymode2 == $TENFY_SIGSEM
+        # ã»ããã©ã®è¿å´
+        $kernelCfgC.add("\t\t(void) sig_sem(#{funcname}_esemid);")
+      elsif nfymode2 == $TENFY_SETFLG
+        # ã¤ãã³ããã©ã°ã®ã»ãã
+        $kernelCfgC.add("\t\t(void) set_flg(#{funcname}_eflgid, #{epar2});")
+      elsif nfymode2 == $TENFY_SNDDTQ
+        # ãã¼ã¿ã­ã¥ã¼ã¸ã®éä¿¡
+        $kernelCfgC.add("\t\t(void) psnd_dtq(#{funcname}_edtqid," \
+													" (intptr_t) ercd);")
+      else
+        error_illegal_id("E_PAR", params, :nfymode, objid)
+      end
+      $kernelCfgC.add("\t}")
+    end
+
+    # é¢æ°ã®æ«å°¾é¨åã®çæ
+    $kernelCfgC.add2("}")
+  end
+  return(funcname)
+end
+
+#
+#  åæ©è½ã¢ã¸ã¥ã¼ã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³
+#
+$initializeFunctions = []
+IncludeTrb("kernel/task.trb")
+IncludeTrb("kernel/semaphore.trb")
+IncludeTrb("kernel/eventflag.trb")
+IncludeTrb("kernel/dataqueue.trb")
+IncludeTrb("kernel/pridataq.trb")
+IncludeTrb("kernel/mutex.trb")
+IncludeTrb("kernel/messagebuf.trb")
+IncludeTrb("kernel/mempfix.trb")
+IncludeTrb("kernel/cyclic.trb")
+IncludeTrb("kernel/alarm.trb")
+IncludeTrb("kernel/interrupt.trb")
+IncludeTrb("kernel/exception.trb")
+
+#
+#  éã¿ã¹ã¯ã³ã³ãã­ã¹ãç¨ã®ã¹ã¿ãã¯é å
+#
+$kernelCfgC.comment_header("Stack Area for Non-task Context")
+
+if $cfgData[:DEF_ICS].size == 0
+  # DEF_ICSããªãå ´åã®ããã©ã«ãå¤ã®è¨­å®
+  if $DEFAULT_ISTK.nil?
+    # ã¹ã¿ãã¯é åã®èªåå²ä»ã
+    istksz = AllocStack("_kernel_istack", "DEFAULT_ISTKSZ")
+    istk = "_kernel_istack"
+  else
+    istksz = "DEFAULT_ISTKSZ"
+    istk = "DEFAULT_ISTK"
+  end
+else
+  # éçAPIãDEF_ICSããè¤æ°ããï¼E_OBJï¼ï¼»NGKI3216ï¼½
+  if $cfgData[:DEF_ICS].size > 1
+    error("E_OBJ: too many DEF_ICS")
+  end
+
+  # DEF_ICSãããå ´åã®å¦ç
+  params = $cfgData[:DEF_ICS][1]
+
+  # ãã©ã¡ã¼ã¿ãçç¥ãããæã®ããã©ã«ãå¤ã®è¨­å®
+  params[:istk] ||= "NULL"
+
+  # istkszãã¿ã¼ã²ããå®ç¾©ã®æå°å¤ï¼TARGET_MIN_ISTKSZï¼æªå®ç¾©ã®å ´åã¯1ï¼
+  # ãããå°ããå ´åï¼E_PARï¼ï¼»NGKI3254ï¼½
+  if params[:istksz] < $TARGET_MIN_ISTKSZ
+    error_wrong("E_PAR", params, :istksz, "too small")
+  end
+
+  if params[:istk] == "NULL"
+    # ã¹ã¿ãã¯é åã®èªåå²ä»ã
+    istksz = AllocStack("_kernel_istack", params[:istksz])
+    istk = "_kernel_istack"
+  else
+    # istkszãã¹ã¿ãã¯é åã®ãµã¤ãºã¨ãã¦æ­£ãããªãå ´åï¼E_PARï¼ï¼»NGKI3222ï¼½
+    if (params[:istksz] & ($CHECK_STKSZ_ALIGN - 1)) != 0
+      error_wrong("E_PAR", params, :istksz, "not aligned")
+    end
+
+    istksz = "(#{params[:istksz]})"
+    istk = "(void *)(#{params[:istk]})"
+  end
+end
+
+$kernelCfgC.add(<<EOS)
+const size_t _kernel_istksz = #{istksz};
+STK_T *const _kernel_istk = #{istk};
+
+#ifdef TOPPERS_ISTKPT
+STK_T *const _kernel_istkpt = TOPPERS_ISTKPT(#{istk}, #{istksz});
+#endif /* TOPPERS_ISTKPT */
+EOS
+
+#
+#  ã¿ã¤ã ã¤ãã³ãç®¡ç
+#
+$kernelCfgC.comment_header("Time Event Management")
+$kernelCfgC.add(<<EOS)
+TMEVTN   _kernel_tmevt_heap[1 + TNUM_TSKID + TNUM_CYCID + TNUM_ALMID];
+EOS
+
+#
+#  åã¢ã¸ã¥ã¼ã«ã®åæåé¢æ°
+#
+$kernelCfgC.comment_header("Module Initialization Function")
+$kernelCfgC.append(<<EOS)
+void
+_kernel_initialize_object(void)
+{
+EOS
+$initializeFunctions.each do |func|
+  $kernelCfgC.add("\t#{func}")
+end
+$kernelCfgC.add2("}")
+
+#
+#  åæåã«ã¼ãã³æ©è½
+#
+$kernelCfgC.comment_header("Initialization Routine")
+
+# ã¨ã©ã¼ãã§ãã¯
+$cfgData[:ATT_INI].each do |key, params|
+  # iniatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3241ï¼½
+  #ï¼TA_NULLã§ãªãå ´åï¼
+  if (params[:iniatr] != $TA_NULL)
+    error_illegal_sym("E_RSATR", params, :iniatr, :inirtn)
+  end
+end
+
+# åæåã«ã¼ãã³ã®å®è¡é¢æ°ã®çæ
+$kernelCfgC.append(<<EOS)
+void
+_kernel_call_inirtn(void)
+{
+EOS
+$cfgData[:ATT_INI].each do |key, params|
+  $kernelCfgC.add("\t((INIRTN)(#{params[:inirtn]}))" \
+								"((intptr_t)(#{params[:exinf]}));")
+end
+$kernelCfgC.add2("}")
+
+#
+#  çµäºå¦çã«ã¼ãã³æ©è½
+#
+$kernelCfgC.comment_header("Termination Routine")
+
+# ã¨ã©ã¼ãã§ãã¯
+$cfgData[:ATT_TER].each do |key, params|
+  # teratrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3248ï¼½
+  #ï¼TA_NULLã§ãªãå ´åï¼
+  if (params[:teratr] != $TA_NULL)
+    error_illegal_sym("E_RSATR", params, :teratr, :terrtn)
+  end
+end
+
+# çµäºå¦çã«ã¼ãã³ã®å®è¡é¢æ°ã®çæ
+$kernelCfgC.append(<<EOS)
+void
+_kernel_call_terrtn(void)
+{
+EOS
+$cfgData[:ATT_TER].reverse_each do |key, params|
+  $kernelCfgC.add("\t((TERRTN)(#{params[:terrtn]}))" \
+								"((intptr_t)(#{params[:exinf]}));")
+end
+$kernelCfgC.add2("}")
+
+#
+#  kernel_cfg.hã®æ«å°¾é¨åã®çæ
+#
+$kernelCfgH.append(<<EOS)
+#endif /* TOPPERS_KERNEL_CFG_H */
+EOS
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_api.csv
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_api.csv	(revision 305)
+++ 	(revision )
@@ -1,17 +1,0 @@
-tsk,CRE_TSK,#tskid { .tskatr &exinf &task +itskpri .stksz &stk },,
-sem,CRE_SEM,#semid { .sematr .isemcnt .maxsem },,
-flg,CRE_FLG,#flgid { .flgatr .iflgptn },,
-dtq,CRE_DTQ,#dtqid { .dtqatr .dtqcnt &dtqmb },,
-pdq,CRE_PDQ,#pdqid { .pdqatr .pdqcnt +maxdpri &pdqmb },,
-mtx,CRE_MTX,#mtxid { .mtxatr +ceilpri? },,
-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_api.def
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_api.def	(revision 306)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_api.def	(revision 306)
@@ -0,0 +1,17 @@
+CRE_TSK #tskid* { .tskatr &exinf &task +itskpri .stksz &stk? }
+CRE_SEM #semid* { .sematr .isemcnt .maxsem }
+CRE_FLG #flgid* { .flgatr .iflgptn }
+CRE_DTQ #dtqid* { .dtqatr .dtqcnt &dtqmb? }
+CRE_PDQ #pdqid* { .pdqatr .pdqcnt +maxdpri &pdqmb? }
+CRE_MTX #mtxid* { .mtxatr +ceilpri? }
+CRE_MBF #mbfid* { .mbfatr .maxmsz .mbfsz &mbfmb? }
+CRE_MPF #mpfid* { .mpfatr .blkcnt .blksz &mpf? &mpfmb? }
+CRE_CYC #cycid* { .cycatr { .nfymode &par1 &par2? &par3? &par4? } .cyctim .cycphs }
+CRE_ALM #almid* { .almatr { .nfymode &par1 &par2? &par3? &par4? } }
+CFG_INT .intno* { .intatr +intpri }
+CRE_ISR #isrid* { .isratr &exinf .intno &isr +isrpri }
+DEF_INH .inhno* { .inhatr &inthdr }
+DEF_EXC .excno* { .excatr &exchdr }
+DEF_ICS { .istksz &istk? }
+ATT_INI { .iniatr &exinf &inirtn }
+ATT_TER { .teratr &exinf &terrtn }
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_def.csv
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_def.csv	(revision 305)
+++ 	(revision )
@@ -1,139 +1,0 @@
-SIL_ENDIAN_BIG,#defined(SIL_ENDIAN_BIG)
-SIL_ENDIAN_LITTLE,#defined(SIL_ENDIAN_LITTLE)
-TA_NULL,TA_NULL
-TA_ACT,TA_ACT
-TA_NOACTQUE,TA_NOACTQUE
-TA_TPRI,TA_TPRI
-TA_WMUL,TA_WMUL
-TA_CLR,TA_CLR
-TA_CEILING,TA_CEILING
-TA_STA,TA_STA
-TA_NONKERNEL,TA_NONKERNEL
-TA_ENAINT,TA_ENAINT
-TA_EDGE,TA_EDGE
-TNFY_HANDLER,TNFY_HANDLER
-TNFY_SETVAR,TNFY_SETVAR
-TNFY_INCVAR,TNFY_INCVAR
-TNFY_ACTTSK,TNFY_ACTTSK
-TNFY_WUPTSK,TNFY_WUPTSK
-TNFY_SIGSEM,TNFY_SIGSEM
-TNFY_SETFLG,TNFY_SETFLG
-TNFY_SNDDTQ,TNFY_SNDDTQ
-TENFY_SETVAR,TENFY_SETVAR
-TENFY_INCVAR,TENFY_INCVAR
-TENFY_ACTTSK,TENFY_ACTTSK
-TENFY_WUPTSK,TENFY_WUPTSK
-TENFY_SIGSEM,TENFY_SIGSEM
-TENFY_SETFLG,TENFY_SETFLG
-TENFY_SNDDTQ,TENFY_SNDDTQ
-TMIN_TPRI,TMIN_TPRI,signed
-TMAX_TPRI,TMAX_TPRI,signed
-TMIN_DPRI,TMIN_DPRI,signed
-TMAX_DPRI,TMAX_DPRI,signed
-TMIN_ISRPRI,TMIN_ISRPRI,signed
-TMAX_ISRPRI,TMAX_ISRPRI,signed
-TBIT_FLGPTN,TBIT_FLGPTN
-TMAX_MAXSEM,TMAX_MAXSEM
-TMAX_RELTIM,TMAX_RELTIM
-TMIN_INTPRI,TMIN_INTPRI,signed
-TMAX_INTPRI,TMAX_INTPRI,signed
-TMIN_TSKID,TMIN_TSKID,signed
-TMIN_SEMID,TMIN_SEMID,signed
-TMIN_FLGID,TMIN_FLGID,signed
-TMIN_DTQID,TMIN_DTQID,signed
-TMIN_PDQID,TMIN_PDQID,signed
-TMIN_MTXID,TMIN_MTXID,signed
-TMIN_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 305)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_impl.h	(revision 306)
@@ -6,5 +6,5 @@
  *  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
+ *  Copyright (C) 2004-2016 by Embedded and Real-Time Systems Laboratory
  *              Graduate School of Information Science, Nagoya Univ., JAPAN
  * 
@@ -53,5 +53,5 @@
  *  ã®è²¬ä»»ãè² ããªãï¼
  * 
- *  $Id: kernel_impl.h 332 2015-06-21 13:20:37Z ertl-hiro $
+ *  $Id: kernel_impl.h 748 2016-05-14 14:30:06Z ertl-hiro $
  */
 
@@ -88,11 +88,4 @@
  */
 #include <t_syslog.h>
-
-/*
- *  åã­ã£ã¹ããè¡ããã¯ã­ã®å®ç¾©
- */
-#ifndef CAST
-#define CAST(type, val)		((type)(val))
-#endif /* CAST */
 
 /*
@@ -164,4 +157,9 @@
 
 /*
+ *  TECSã®åæåï¼init_tecs.cï¼
+ */
+extern void initialize_tecs(void);
+
+/*
  *  åã¢ã¸ã¥ã¼ã«ã®åæåï¼kernel_cfg.cï¼
  */
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_rename.def
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_rename.def	(revision 305)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_rename.def	(revision 306)
@@ -88,5 +88,4 @@
 
 # messagebuf.c
-mbfhook_dequeue_wobj
 initialize_messagebuf
 enqueue_message
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_rename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_rename.h	(revision 305)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_rename.h	(revision 306)
@@ -115,5 +115,4 @@
  *  messagebuf.c
  */
-#define mbfhook_dequeue_wobj		_kernel_mbfhook_dequeue_wobj
 #define initialize_messagebuf		_kernel_initialize_messagebuf
 #define enqueue_message				_kernel_enqueue_message
@@ -201,205 +200,4 @@
 
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  startup.c
- */
-#define _kerflg						__kernel_kerflg
-#define _exit_kernel				__kernel_exit_kernel
-
-/*
- *  task.c
- */
-#define _p_runtsk					__kernel_p_runtsk
-#define _p_schedtsk					__kernel_p_schedtsk
-#define _enadsp						__kernel_enadsp
-#define _dspflg						__kernel_dspflg
-#define _ready_queue				__kernel_ready_queue
-#define _ready_primap				__kernel_ready_primap
-#define _initialize_task			__kernel_initialize_task
-#define _search_schedtsk			__kernel_search_schedtsk
-#define _make_runnable				__kernel_make_runnable
-#define _make_non_runnable			__kernel_make_non_runnable
-#define _make_dormant				__kernel_make_dormant
-#define _make_active				__kernel_make_active
-#define _change_priority			__kernel_change_priority
-#define _rotate_ready_queue			__kernel_rotate_ready_queue
-#define _task_terminate				__kernel_task_terminate
-
-/*
- *  taskhook.c
- */
-#define _mtxhook_check_ceilpri		__kernel_mtxhook_check_ceilpri
-#define _mtxhook_scan_ceilmtx		__kernel_mtxhook_scan_ceilmtx
-#define _mtxhook_release_all		__kernel_mtxhook_release_all
-#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"
 
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_sym.def
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_sym.def	(revision 306)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_sym.def	(revision 306)
@@ -0,0 +1,149 @@
+USE_EXTERNAL_ID,true,bool,defined(USE_EXTERNAL_ID)
+SIL_ENDIAN_BIG,true,bool,defined(SIL_ENDIAN_BIG)
+SIL_ENDIAN_LITTLE,true,bool,defined(SIL_ENDIAN_LITTLE)
+TA_NULL
+TA_ACT
+TA_NOACTQUE
+TA_TPRI
+TA_WMUL
+TA_CLR
+TA_CEILING
+TA_STA
+TA_NONKERNEL
+TA_ENAINT
+TA_EDGE
+TNFY_HANDLER
+TNFY_SETVAR
+TNFY_INCVAR
+TNFY_ACTTSK
+TNFY_WUPTSK
+TNFY_SIGSEM
+TNFY_SETFLG
+TNFY_SNDDTQ
+TENFY_SETVAR
+TENFY_INCVAR
+TENFY_ACTTSK
+TENFY_WUPTSK
+TENFY_SIGSEM
+TENFY_SETFLG
+TENFY_SNDDTQ
+TMIN_TPRI,,signed
+TMAX_TPRI,,signed
+TMIN_DPRI,,signed
+TMAX_DPRI,,signed
+TMIN_ISRPRI,,signed
+TMAX_ISRPRI,,signed
+TBIT_FLGPTN
+TMAX_MAXSEM
+TMAX_RELTIM
+TMIN_INTPRI,,signed
+TMAX_INTPRI,,signed
+TMIN_TSKID,,signed
+TMIN_SEMID,,signed
+TMIN_FLGID,,signed
+TMIN_DTQID,,signed
+TMIN_PDQID,,signed
+TMIN_MTXID,,signed
+TMIN_MBFID,,signed
+TMIN_MPFID,,signed
+TMIN_CYCID,,signed
+TMIN_ALMID,,signed
+USE_TSKINICTXB,true,bool,defined(USE_TSKINICTXB)
+OMIT_INITIALIZE_INTERRUPT,true,bool,defined(OMIT_INITIALIZE_INTERRUPT)
+USE_INHINIB_TABLE,true,bool,defined(USE_INHINIB_TABLE)
+USE_INTINIB_TABLE,true,bool,defined(USE_INTINIB_TABLE)
+OMIT_INITIALIZE_EXCEPTION,true,bool,defined(OMIT_INITIALIZE_EXCEPTION)
+DEFAULT_ISTK,,,defined(DEFAULT_ISTK)
+TARGET_TSKATR,,,defined(TARGET_TSKATR),0
+TARGET_INTATR,,,defined(TARGET_INTATR),0
+TARGET_INHATR,,,defined(TARGET_INHATR),0
+TARGET_ISRATR,,,defined(TARGET_ISRATR),0
+TARGET_EXCATR,,,defined(TARGET_EXCATR),0
+TARGET_MIN_STKSZ,,,defined(TARGET_MIN_STKSZ),1
+TARGET_MIN_ISTKSZ,,,defined(TARGET_MIN_ISTKSZ),1
+CHECK_STKSZ_ALIGN,,,defined(CHECK_STKSZ_ALIGN),1
+CHECK_INTPTR_ALIGN,,,defined(CHECK_INTPTR_ALIGN),1
+CHECK_INTPTR_NONNULL,true,bool,defined(CHECK_INTPTR_NONNULL)
+CHECK_FUNC_ALIGN,,,defined(CHECK_FUNC_ALIGN),1
+CHECK_FUNC_NONNULL,true,bool,defined(CHECK_FUNC_NONNULL)
+CHECK_STACK_ALIGN,,,defined(CHECK_STACK_ALIGN),1
+CHECK_STACK_NONNULL,true,bool,defined(CHECK_STACK_NONNULL)
+CHECK_MPF_ALIGN,,,defined(CHECK_MPF_ALIGN),1
+CHECK_MPF_NONNULL,true,bool,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_INTNO,sizeof(INTNO)
+sizeof_INHNO,sizeof(INHNO)
+sizeof_EXCNO,sizeof(EXCNO)
+sizeof_TASK,sizeof(TASK)
+sizeof_TMEHDR,sizeof(TMEHDR)
+sizeof_ISR,sizeof(ISR)
+sizeof_INTHDR,sizeof(INTHDR)
+sizeof_EXCHDR,sizeof(EXCHDR)
+sizeof_INIRTN,sizeof(INIRTN)
+sizeof_TERRTN,sizeof(TERRTN)
+sizeof_NFYHDR,sizeof(NFYHDR)
+sizeof_TINIB,sizeof(TINIB)
+offsetof_TINIB_tskatr,"offsetof(TINIB,tskatr)"
+offsetof_TINIB_exinf,"offsetof(TINIB,exinf)"
+offsetof_TINIB_task,"offsetof(TINIB,task)"
+offsetof_TINIB_ipriority,"offsetof(TINIB,ipriority)"
+offsetof_TINIB_stksz,"offsetof(TINIB,stksz)",,!defined(USE_TSKINICTXB)
+offsetof_TINIB_stk,"offsetof(TINIB,stk)",,!defined(USE_TSKINICTXB)
+sizeof_SEMINIB,sizeof(SEMINIB)
+offsetof_SEMINIB_sematr,"offsetof(SEMINIB,sematr)"
+offsetof_SEMINIB_isemcnt,"offsetof(SEMINIB,isemcnt)"
+offsetof_SEMINIB_maxsem,"offsetof(SEMINIB,maxsem)"
+sizeof_FLGPTN,sizeof(FLGPTN)
+sizeof_FLGINIB,sizeof(FLGINIB)
+offsetof_FLGINIB_flgatr,"offsetof(FLGINIB,flgatr)"
+offsetof_FLGINIB_iflgptn,"offsetof(FLGINIB,iflgptn)"
+sizeof_DTQINIB,sizeof(DTQINIB)
+offsetof_DTQINIB_dtqatr,"offsetof(DTQINIB,dtqatr)"
+offsetof_DTQINIB_dtqcnt,"offsetof(DTQINIB,dtqcnt)"
+offsetof_DTQINIB_p_dtqmb,"offsetof(DTQINIB,p_dtqmb)"
+sizeof_PDQINIB,sizeof(PDQINIB)
+offsetof_PDQINIB_pdqatr,"offsetof(PDQINIB,pdqatr)"
+offsetof_PDQINIB_pdqcnt,"offsetof(PDQINIB,pdqcnt)"
+offsetof_PDQINIB_maxdpri,"offsetof(PDQINIB,maxdpri)"
+offsetof_PDQINIB_p_pdqmb,"offsetof(PDQINIB,p_pdqmb)"
+sizeof_MTXINIB,sizeof(MTXINIB)
+offsetof_MTXINIB_mtxatr,"offsetof(MTXINIB,mtxatr)"
+offsetof_MTXINIB_ceilpri,"offsetof(MTXINIB,ceilpri)"
+sizeof_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,sizeof(INHINIB),,!defined(OMIT_INITIALIZE_INTERRUPT)
+offset_INHINIB_inhno,"offsetof(INHINIB,inhno)",,!defined(OMIT_INITIALIZE_INTERRUPT)
+offset_INHINIB_inhatr,"offsetof(INHINIB,inhatr)",,!defined(OMIT_INITIALIZE_INTERRUPT),,
+offset_INHINIB_int_entry,"offsetof(INHINIB,int_entry)",,!defined(OMIT_INITIALIZE_INTERRUPT),,
+sizeof_INTINIB,sizeof(INTINIB),,!defined(OMIT_INITIALIZE_INTERRUPT)
+offset_INTINIB_intno,"offsetof(INTINIB,intno)",,!defined(OMIT_INITIALIZE_INTERRUPT)
+offset_INTINIB_intatr,"offsetof(INTINIB,intatr)",,!defined(OMIT_INITIALIZE_INTERRUPT)
+offset_INTINIB_intpri,"offsetof(INTINIB,intpri)",,!defined(OMIT_INITIALIZE_INTERRUPT)
+sizeof_EXCINIB,sizeof(EXCINIB),,!defined(OMIT_INITIALIZE_EXCEPTION)
+offset_EXCINIB_excno,"offsetof(EXCINIB,excno)",,!defined(OMIT_INITIALIZE_EXCEPTION)
+offset_EXCINIB_excatr,"offsetof(EXCINIB,excatr)",,!defined(OMIT_INITIALIZE_EXCEPTION)
+offset_EXCINIB_exc_entry,"offsetof(EXCINIB,exc_entry)",,!defined(OMIT_INITIALIZE_EXCEPTION)
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_unrename.h
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_unrename.h	(revision 305)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/kernel_unrename.h	(revision 306)
@@ -116,5 +116,4 @@
  *  messagebuf.c
  */
-#undef mbfhook_dequeue_wobj
 #undef initialize_messagebuf
 #undef enqueue_message
@@ -202,205 +201,4 @@
 
 
-#ifdef TOPPERS_LABEL_ASM
-
-/*
- *  startup.c
- */
-#undef _kerflg
-#undef _exit_kernel
-
-/*
- *  task.c
- */
-#undef _p_runtsk
-#undef _p_schedtsk
-#undef _enadsp
-#undef _dspflg
-#undef _ready_queue
-#undef _ready_primap
-#undef _initialize_task
-#undef _search_schedtsk
-#undef _make_runnable
-#undef _make_non_runnable
-#undef _make_dormant
-#undef _make_active
-#undef _change_priority
-#undef _rotate_ready_queue
-#undef _task_terminate
-
-/*
- *  taskhook.c
- */
-#undef _mtxhook_check_ceilpri
-#undef _mtxhook_scan_ceilmtx
-#undef _mtxhook_release_all
-#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"
 
Index: asp3_wo_tecs/trunk/extension/messagebuf/kernel/messagebuf.tf
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/messagebuf.tf	(revision 305)
+++ 	(revision )
@@ -1,167 +1,0 @@
-$
-$   TOPPERS/ASP Kernel
-$       Toyohashi Open Platform for Embedded Real-Time Systems/
-$       Advanced Standard Profile Kernel
-$ 
-$   Copyright (C) 2007 by TAKAGI Nobuhisa
-$   Copyright (C) 2007-2014 by Embedded and Real-Time Systems Laboratory
-$               Graduate School of Information Science, Nagoya Univ., JAPAN
-$ 
-$   ä¸è¨èä½æ¨©è
-ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
-$   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
-$   å¤ã»åé
-å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
-$   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
-$       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
-$       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
-$   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
-$       è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
-$       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
-$       ç¨ã§ããªãå½¢ã§åé
-å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
-$       ã¨ï¼
-$     (a) åé
-å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
-ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
-$         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
-$     (b) åé
-å¸ã®å½¢æ
-ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
-$         å ±åãããã¨ï¼
-$   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
-$       å®³ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ããå
-è²¬ãããã¨ï¼
-$       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
-$       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
-ããã³TOPPERSãã­ã¸ã§ã¯ãã
-$       å
-è²¬ãããã¨ï¼
-$ 
-$   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
-ã
-$   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
-$   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
-$   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
-$   ã®è²¬ä»»ãè² ããªãï¼
-$ 
-$   $Id: 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/messagebuf.trb
===================================================================
--- asp3_wo_tecs/trunk/extension/messagebuf/kernel/messagebuf.trb	(revision 306)
+++ asp3_wo_tecs/trunk/extension/messagebuf/kernel/messagebuf.trb	(revision 306)
@@ -0,0 +1,110 @@
+# -*- coding: utf-8 -*-
+#
+#   TOPPERS/ASP Kernel
+#       Toyohashi Open Platform for Embedded Real-Time Systems/
+#       Advanced Standard Profile Kernel
+# 
+#   Copyright (C) 2015 by FUJI SOFT INCORPORATED, JAPAN
+#   Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+#               Graduate School of Information Science, Nagoya Univ., JAPAN
+# 
+#   ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+#   ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+#   å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+#   (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+#       æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+#       ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+#   (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+#       è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+#       ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#   (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+#       ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+#       ã¨ï¼
+#     (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+#         ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+#     (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+#         å ±åãããã¨ï¼
+#   (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+#       å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+#       ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+#       ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+#       å
+è²¬ãããã¨ï¼
+# 
+#   æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+#   ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+#   ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+#   ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+#   ã®è²¬ä»»ãè² ããªãï¼
+# 
+#   $Id: messagebuf.trb 672 2016-03-05 15:33:08Z ertl-hiro $
+# 
+
+#
+#		ã¡ãã»ã¼ã¸ãããã¡æ©è½ã®çæã¹ã¯ãªãã
+#
+
+class MessagebufObject < KernelObject
+  def initialize()
+    super("mbf", "messagebuf")
+  end
+
+  def prepare(key, params)
+    # ãã©ã¡ã¼ã¿ãçç¥ãããæã®ããã©ã«ãå¤ã®è¨­å®
+    params[:mbfmb] ||= "NULL"
+
+    # mbfatrãç¡å¹ã®å ´åï¼E_RSATRï¼ï¼»NGKI3303ï¼½
+    #ï¼TA_NULLã§ãªãå ´åï¼
+    if params[:mbfatr] != $TA_NULL
+      error_illegal_id("E_RSATR", params, :mbfatr, :mbfid)
+    end
+
+    # maxmszã0ã®å ´åï¼E_PARï¼ï¼»NGKI3307ï¼½
+    if params[:maxmsz] == 0
+      error_illegal_id("E_PAR", params, :maxmsz, :mbfid)
+    end
+
+    # mbfmbãNULLã§ãªãå ´åï¼E_NOSPTï¼ï¼»ASPS0205ï¼½
+    if params[:mbfmb] != "NULL"
+      error_illegal_id("E_NOSPT", params, :mbfmb, :mbfid)
+    end
+
+    # ã¡ãã»ã¼ã¸ãããã¡ç®¡çé å
+    if params[:mbfsz] > 0
+      mbfmbName = "_kernel_mbfmb_#{params[:mbfid]}"
+      $kernelCfgC.add("static uint_t #{mbfmbName}" \
+				"[TOPPERS_COUNT_SZ(#{params[:mbfsz]}, sizeof(uint_t))];")
+      params[:mbfinib_mbfmb] = mbfmbName
+    else
+      params[:mbfinib_mbfmb] = "NULL"
+    end
+  end
+
+  def generateInib(key, params)
+    return("(#{params[:mbfatr]}), (#{params[:maxmsz]}), " \
+				"TOPPERS_ROUND_SZ(#{params[:mbfsz]}, sizeof(uint_t)), " \
+				"#{params[:mbfinib_mbfmb]}")
+  end
+end
+
+#
+#  ãã¼ã¿ã­ã¥ã¼ã«é¢ããæ
+å ±ã®çæ
+#
+$kernelCfgC.comment_header("Message Buffer Functions")
+MessagebufObject.new.generate()
