Index: EcnlProtoTool/trunk/asp3_dcre/tecs_kernel/kernel.cdl
===================================================================
--- EcnlProtoTool/trunk/asp3_dcre/tecs_kernel/kernel.cdl	(revision 321)
+++ EcnlProtoTool/trunk/asp3_dcre/tecs_kernel/kernel.cdl	(revision 429)
@@ -6,5 +6,5 @@
  *  Copyright (C) 2015,2016 by Ushio Laboratory
  *              Graduate School of Engineering Science, Osaka Univ., JAPAN
- *  Copyright (C) 2015,2016 by Embedded and Real-Time Systems Laboratory
+ *  Copyright (C) 2015-2018 by Embedded and Real-Time Systems Laboratory
  *              Graduate School of Information Science, Nagoya Univ., JAPAN
  * 
@@ -299,5 +299,5 @@
 	ER 		sendForce([in] intptr_t data);
 	ER 		receive([out] intptr_t *p_data);
-	ER 		receivePolling([out] intptr_t *p_Data);
+	ER 		receivePolling([out] intptr_t *p_data);
 	ER 		receiveTimeout([out] intptr_t *p_data, [in] TMO timeout);
 	ER 		initialize(void);
@@ -397,5 +397,5 @@
 	ER		unlock(void);
 	ER		initialize(void);
-	ER		refer([out] T_RSEM *pk_mutexStatus);
+	ER		refer([out] T_RMTX *pk_mutexStatus);
 };
 
@@ -501,5 +501,5 @@
 
 	attr {
-		ID				id = C_EXP("ALMID_$id$");
+		ID				id = C_EXP("CYCID_$id$");
 		[omit] ATR		attribute = C_EXP("TA_NULL");
 		[omit] bool_t	ignoreErrors = false;
@@ -536,5 +536,5 @@
 
 /*
- *  周期通知にユーザーハンドラを指定するための複合セルタイプ
+ *  周期通知にタイムイベントハンドラを指定するための複合セルタイプ
  */
 [active]
@@ -544,5 +544,5 @@
 
 	attr {
-		ID				id = C_EXP("ALMID_$id$");
+		ID				id = C_EXP("CYCID_$id$");
 		[omit] ATR		attribute = C_EXP("TA_NULL");
 		[omit] RELTIM	cycleTime;
@@ -630,5 +630,5 @@
 
 /*
- *  アラーム通知にユーザーハンドラを指定するための複合セルタイプ
+ *  アラーム通知にタイムイベントハンドラを指定するための複合セルタイプ
  */
 [active]
@@ -663,4 +663,7 @@
 	ER		disable(void);
 	ER		enable(void);
+	ER		clear(void);
+	ER		raise(void);
+	ER_BOOL	probe(void);
 };
 
@@ -715,15 +718,34 @@
 
 	attr {
-		INHNO			interruptHandlerNumber;
-		[omit] ATR		attribute = C_EXP("TA_NULL");
-	};
-
-	factory {
-		write("tecsgen.cfg",
-				"DEF_INH(%s, { %s, tInterruptHandler_start });", attribute);
+		[omit] INHNO	interruptHandlerNumber;
+		[omit] ATR		attribute = C_EXP("TA_NULL");
+	};
+
+	factory {
+		write("tecsgen.cfg", "DEF_INH(%s, { %s, $id$_start });",
+									interruptHandlerNumber, attribute);
+		write("$ct$_tecsgen.h",
+				"#ifndef TOPPERS_MACRO_ONLY\n"
+				"extern void $id$_start(void);\n"
+				"#endif /* TOPPERS_MACRO_ONLY */\n");
+		write("$ct$.c",
+				"void $id$_start()\n"
+				"{\n"
+				"    CELLCB *p_cellcb = $cbp$;\n"
+				"    ciInterruptHandlerBody_main();\n"
+				"}\n");
 	};
 	FACTORY {
 		write("tecsgen.cfg", "#include \"$ct$_tecsgen.h\"");
-	};
+		write("$ct$.c", "#include \"$ct$_tecsgen.h\"");
+	};
+};
+
+/*
+ *  CPU例外ハンドラ本体のシグニチャ
+ */
+[context("non-task")]
+signature siCpuExceptionHandlerBody {
+	void	main([in] const void *p_excinf);
 };
 
@@ -733,17 +755,28 @@
 [active]
 celltype tCpuExceptionHandler {
-	call	siHandlerBody	ciCpuExceptionHandlerBody;
-
-	attr {
-		EXCNO			cpuExceptionHandlerNumber;
-		[omit] ATR		attribute = C_EXP("TA_NULL");
-	};
-
-	factory {
-		write("tecsgen.cfg",
-				"DEF_EXC(%s, { %s, tCpuExceptionHandler_start });", attribute);
+	call	siCpuExceptionHandlerBody	ciCpuExceptionHandlerBody;
+
+	attr {
+		[omit] EXCNO	cpuExceptionHandlerNumber;
+		[omit] ATR		attribute = C_EXP("TA_NULL");
+	};
+
+	factory {
+		write("tecsgen.cfg", "DEF_EXC(%s, { %s, $id$_start });",
+									cpuExceptionHandlerNumber, attribute);
+		write("$ct$_tecsgen.h",
+				"#ifndef TOPPERS_MACRO_ONLY\n"
+				"extern void $id$_start(void *p_excinf);\n"
+				"#endif /* TOPPERS_MACRO_ONLY */\n");
+		write("$ct$.c",
+				"void $id$_start(void *p_excinf)\n"
+				"{\n"
+				"    CELLCB *p_cellcb = $cbp$;\n"
+				"    ciCpuExceptionHandlerBody_main(p_excinf);\n"
+				"}\n");
 	};
 	FACTORY {
 		write("tecsgen.cfg", "#include \"$ct$_tecsgen.h\"");
+		write("$ct$.c", "#include \"$ct$_tecsgen.h\"");
 	};
 };
