Index: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/README-mruby.txt
===================================================================
--- asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/README-mruby.txt	(revision 374)
+++ asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/README-mruby.txt	(revision 374)
@@ -0,0 +1,73 @@
+mruby
+                                              2017.4.17  æ°è¦
+                                              2017.11.4  
+                                              å¤§å±± åå¸
+
+â æ¦è¦
+
+mruby ãã£ã¬ã¯ããªã«ã¯ãçµè¾¼ã¿ç¨ mruby VM ã®ã»ã«ã¿ã¤ããããã³
+MrubyBridgePlugin ã«å¯¾å¿ããã¢ã¸ã¥ã¼ã«ãå«ã¾ãã¾ãï¼
+
+mruby V1.2.0 ã«å¯¾å¿ãã¦ãã¾ãï¼V1.1.0 ã§ããã«ããããã¨ã¯å¯è½ã§ãï¼
+
+ããã«ã¯ mruby ã®æ¬ä½ã¯å«ã¾ãã¾ããï¼ä»¥ä¸ãããã¦ã³ã­ã¼ãããå¿
+è¦ãããã¾ãï¼
+   http://forum.mruby.org/
+
+â TECS ã¸ã§ãã¬ã¼ã¿ V1.5 ã§ã®å¤æ´
+
+tMruby.cdl (ãã¹ï¼tecsgen/tecs/mruby/tMruby.cdl) ãæ°è¨­ããï¼
+ä»¥ä¸ãå¯è½ã«ããããã« tMruby ã composite ã«åè§£ããï¼
+ * mruby ã¹ã¯ãªããã®å¨æã¿ã¹ã¯å®è¡
+ * VM ãã¨ã«ç°ãªã TLSF ã¢ã­ã±ã¼ã¿ã³ã³ãã¼ãã³ããä½¿ç¨
+
+tMruby.cdl ã§ã¯ tMruby (ãã¼ã ã¹ãã¼ã¹ãã¹ï¼nMruby::tMruby) ã®å®è£
+ã
+æ°ããããä»ãå¨æã¿ã¹ã¯å®è¡ç¨ã® tMrubyCyclic (åï¼nMruby::tMrubyCyclic)
+ãæ°è¨­ããï¼tMruby ãåè§£ãããtMrubyVM ã»ã«ã¿ã¤ãã¨ããã®ã·ã°ããã£
+sMruby (sMruby.cdlå
+) ãæ°è¨­ããï¼
+
+tMruby.cdl ã«ç½®ãæãå¯è½ã ããä»¥ä¸ã®ç¹ã§ãã«ãç¨ Makefile ã®å¤æ´ãå¿
+è¦ï¼
+ * TLSF ããã tTLSFMalloc_inline.h ã¸ã®ãã¹ãè¿½å 
+ * TLSF ã®ãªãã¸ã§ã¯ãã®è¿½å  (mruby+TECS on EV3 ã«ã¯å®è£
+æ¸ã¿)
+
+ã¾ããä»¥ä¸ã®ç¹ã«çæããå¿
+è¦ãããï¼
+ * TLSF ã¯ãVM ãã¨ã« 1MB ãå²ãä»ãã 
+
+ãã®ãããååãªç©ºãã¡ã¢ãªãå¿
+è¦ã§ããï¼
+ãã®ãµã¤ãºã¯ VM ã»ã«ã®å®ç¾©ã§å¤æ´å¯è½ (å±æ§ memoryPoolSize)ï¼
+
+â  ã³ã³ãã¼ãã³ãæ¦è¦
+
+tMruby.cdl: (TECS ã¸ã§ãã¬ã¼ã¿ V1.5.0 ä»¥é)
+ celltype  tMrubyVM
+    VM ãå®è£
+ããããã®ã»ã«ã¿ã¤ãï¼ã¡ã¢ãªã¢ã­ã±ã¼ã¿ TLSFMalloc ãå«ã¾
+    ãªã. åãå£ eMrubyVM ã®ã·ã°ããã£ã¯ sMrubyï¼
+
+ composite tMruby
+    åãå£ eMrubyBody ã®ã·ã°ããã£ã sTaskBody ã¨ããï¼tTLSFMalloc ã
+    çµã¿å
+¥ã.
+
+ composite tMrubyCyclic
+    åãå£ eMrubyBody ã®ã·ã°ããã£ã sTaskBody ã¨ããï¼tTLSFMalloc ã
+    çµã¿å
+¥ã.
+    å¨æã¿ã¹ã¯èµ·åºãåæã¨ãã¦ããï¼
+    ä¸åç®ã®å¼åºãã§ã¯ mrb_open ããããªãã¸ã»ã«ãç»é²å¾ãmrb_run ãå¼
+    ã³åºãã¦ã¹ã¯ãªããå®è¡ãè¡ãï¼ã¹ã¯ãªããçµäºå¾ã« mrb_close ã¯å¼ã³
+    åºãããªãï¼
+    äºåç®ä»¥éã®å¼åºãã§ã¯ mrb_run ã®ã¿å¼ã³åºãããï¼
+    çµäºå¦ç mrb_close ãå¼ã³ã ãææ®µã¯æä¾ãã¦ããªãï¼çªç¶é»æºãåã
+    ãããã¨ãåæã¨ãã¦ããï¼ (å°ãªãã¨ãæåã®å®è£
+ã§ã¯)ï¼
+
+sMruby.cdlï¼
+ signature sMruby
+   åæåãå®è¡ãçµäºå¦çã«åè§£ããã·ã°ããã£
Index: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/TECSPointer.h
===================================================================
--- asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/TECSPointer.h	(revision 352)
+++ asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/TECSPointer.h	(revision 374)
@@ -102,6 +102,6 @@
 	{																	\
 		if( sizeof( type ) > sizeof( mrb_int ) ){						\
-			if( val >= (((type)1) << (sizeof(mrb_int)*8-1))				\
-				|| val < -(((type)1) << (sizeof(mrb_int)*8-1)) )		\
+			if( val > TYPE ## _MAX				\
+				|| val < TYPE ## _MIN )		\
 				/* '=' unecessary for negative value	*/				\
 				/* ignore warning on int32_t */							\
@@ -126,5 +126,5 @@
 	{																	\
 		if( sizeof( type ) > sizeof( mrb_int ) ){						\
-			if( val >= (((type)1) << (sizeof(mrb_int)*8)))				\
+      if( val > TYPE ## _MAX )                        \
 				/* '=' unecessary for negative value	*/				\
 				/* ignore warning on int32_t */							\
Index: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyBridge.txt
===================================================================
--- asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyBridge.txt	(revision 374)
+++ asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyBridge.txt	(revision 374)
@@ -0,0 +1,394 @@
+MrubyBridgePlugin ã«é¢ããã¡ã¢
+										2012å¹´11æ 7æ¥ãåçä½æ
+										2013å¹´ 5æ26æ¥ãè¦ç´ã
+                                                        å¤§å±±ãåå¸
+
+ãæ¦è¦ã
+
+MrubyBridgePlugin ã¯ãTECS CDL ã® signature è¨è¿°ã«åºã¥ããmruby ã¨ TECS 
+ã³ã³ãã¼ãã³ããããªãã¸ãããmruby ã® C è¨èªå®è£
+ã¯ã©ã¹ã§ãã TECS ã®ã»
+ã«ã¿ã¤ãã¨ãªãã³ã³ãã¼ãã³ããçæãããTECS ã®ã·ã°ããã£ãã©ã°ã¤ã³ã§ã
+ãã
+
+ãæ§é ã
+
+         +--------------------------+              +-------------------+
+         |     (ããªãã¸ã»ã«)         |              |    (ç®çã»ã«)      |
+         |                          |              |                   |
+mruby    | nMruby::tsSignatureBridge|  sSignature  |  tTargetCelltype  |
+ - - - > |       BridgeCell         |--------------|>   TargetCell     |
+         |                          |cTECS    eTest|                   |
+         | mruby ã¯ã©ã¹ï¼            |              |                   |
+         |  TECS::TSignatureBridge  |              |                   |
+         +--------------------------+              +-------------------+
+
+MrubyBridgePlugin ã¯ãmruby ãã TECS ã¸ããªãã¸ãããã»ã«ã¿ã¤ããçæ
+ãããmruby=>TECS ãããªãã¸ããã»ã«ã¯ããã®ã»ã«ã¿ã¤ãã®ã»ã«ã¨ãã¦ãã
+ã©ã°ã¤ã³ã®å©ç¨è
+ã CDL å
+ã«è¨­ç½®ããmruby ããæä½ãããã»ã«ãããªãã¡
+ç®çã»ã«ã«çµåããã
+
+ãã®ã»ã«ã¿ã¤ãã¯ãmruby ã®ã¯ã©ã¹ã®å®ç¾©ãè¡ããããªãã¸ã»ã«ã mruby ã®
+ã¤ã³ã¹ã¿ã³ã¹ã¨ãã¦åãæ±ããããã«ããmruby ã®ã¤ã³ã¹ã¿ã³ã¹ã¡ã½ããã®å¼
+ã³åºãã«å¿ãã¦ãç®çã»ã«ã®åãå£é¢æ°ãå¼ã³åºãåããæã¤ã
+
+ãç°¡åãªä½¿ç¨ä¾ã
+
+ç°¡åãªä½¿ç¨ä¾ã¯ãSimpleSample.cdl ããã³ SimpleSample.rb ã«ããã
+MrubyBrigePlugin ã¯ã·ã°ããã£ãã©ã°ã¤ã³ã§ãããã·ã°ããã£ãã©ã°ã¤ã³ã®
+ä½¿ç¨æ¹æ³ãçè§£ãã¦ããã°ããããã®ã½ã¼ã¹ãã¡ã¤ã«ã®ã³ã¡ã³ããåç
+§ããã
+ã¨ã§ãMrubyBrigePlugin ã®å¤§ããã®ä½¿ãæ¹ã¯çè§£ã§ããã¯ãã§ããã
+ä»¥ä¸ã®æ¹æ³ã§ããã«ãããã³å®è¡ã§ããã
+
+   % make                             # mruby æ¬ä½ã®ãã«ã (.a ãä½æ)
+   % cd MrubyBridge                   # MrubyBridge ã¸ç§»å
+   % make                             # ãã«ã
+   % ./mruby-Sample SimpleSample.rb   # å®è¡
+
+ãMakefile ã®æ§æã
+
+tecsgen ã«ããçæããã gen/Makefile.templ ã«å¯¾ããä»¥ä¸ã®å¤æ´ãå ããå¿
+è¦ãã
+ãã
+
+ã»gen/Makefile.temp ã¯ãä¸ã¤ä¸ã®ãã£ã¬ã¯ããªã¸ Makefile ã¨ããååã§ç½®
+  ãã°ãcygwin ãªã©ã® POSIX ç°å¢ã§è©¦é¨å®è¡ããå ´åã«ã¯ãç¡èª¿æ´ã§ä½¿ç¨ã§
+  ããããã«çæããã(ãã ã gnu make ãä½¿ç¨ãã)
+ã»tSysLog ãä½¿ãå ´åããªã­ã±ã¼ã¿ãã«ãªãã¸ã§ã¯ããè¿½å  (ä¸è¡åç
+§)
+   OTHER_OBJS = $(_TECS_OBJ_DIR)vasyslog.o
+
+ããã¼ã¿åã
+
+MrubyBridgePlugin ã¯ãä»¥ä¸ã® TECS ã®åãæ±ããã¨ãã§ãã (å¶éããã)ã
+ãã®å¶éã¯ãMrubyBridgePlugin ãé©ç¨ãããã¨ããã·ã°ããã£ã«å¯¾ãããã®ã§ããã
+ããä»¥å¤ã¸å¶éãããã¶ãã®ã§ã¯ãªãã
+
+ ã¹ã«ã©ã¼å			bool_t, char_t, intN_t, double64_t, float32_t
+									(N=8,16,32,64)
+					int, short, long, char (TECS éæ¨å¥¨ã®å)
+
+ ãã¤ã³ã¿å			bool_t*, char_t*, intN_t*, double64_t*, float32_t*
+					int*, short*, long*, char*
+					æ§é ä½åã¸ã®ãã¤ã³ã¿ï¼æ§é ä½åã¨åãå¶éããï¼
+
+                    ãããã¯ããã¤ã³ã¿ã®æãã¦ããå
+ã®å¤ãæ±ãããã®ã
+                    ã®ã§ããããã¤ã³ã¿å¤(ã¢ãã¬ã¹)ãæ¸¡ãããå ´åã«ã¯ã
+                    ããããä½¿ç¨ã§ããªããä»£ããã« intptr_t, uintptr_t 
+                    ãä½¿ç¨ããã
+
+ 					size_is, string æå®å­ãã/ãªãã®ããããæ±ããã
+					ãã ãæ§é ä½åã¸ã®ãã¤ã³ã¿ã« size_is æå®ãããã
+					ã®ã¯æ±ããªãã(ä»æ§æ¸ã«æè¨ããã¦ããªããæ§é ä½ã
+					ã¤ã³ã¿ã® string ã¯ãå
+ã
+ãµãã¼ããããªã)
+
+					string ã®é·ãæå®ããªãå ´åãin å¼æ°ã«å¯¾ãã¦ã®ã¿ç¨
+					ãããã¨ãã§ããã
+
+ æ§é ä½å			ã¡ã³ãã¯ãã¹ã«ã©ã¼åã§ãªãã¦ã¯ãªããªã
+
+ typedefå          ä¸è¨ã®ã¹ã«ã©ã¼åãæ§é ä½åããã¤ã³ã¿åã® typedef 
+                    ãããåãæ±ããã¨ãã§ãããå
+ã®åã¨ãã¦æ±ãããã
+					ãã®ãããã¤ã³ã¿åãæ§é ä½åã®å ´åãå
+ã®ååã«ãã
+					ããããæ±ãããã® mruby ã¯ã©ã¹ãæå®ããã
+
+ãå¯¾å¿ãã mruby ã®å(ã¯ã©ã¹)ã
+
+  bool_t			true ã¾ãã¯ falseã
+					mruby ã§ false ã¨è¦ãªããããã®(false ã¾ãã¯ nil) 
+					ã C ã® false ã¨ãã¦æ±ããmruby ã§ false ã¨è¦ãªã
+					ããªããã®ã C ã® true ã¨ãã¦æ±ããæ´æ°å¤ 0 ã¯ã
+					mruby ã§ã¯ false ã¨ã¯è¦ãªãããªãã
+  char_t			FIXNUM  (å¤ã¯ 0..255)		
+  schar_t			FIXNUM  (å¤ã¯ -128..127)		
+  uchar_t			FIXNUM  (å¤ã¯ 0..255)		
+  intN_t			FIXNUM
+  uintN_t			FIXNUM
+  double64_t		FLOAT (mruby ã® FLOAT ã double ã float ãã¯å®è£
+
+                          ã«ãã)
+  float32_t			FLOAT
+  int				FIXNUM
+  short				FIXNUM
+  long				FIXNUM
+  char				FIXNUM  (char_t ã¨åã)
+
+ã»TECS å°ç¨ã®ã¯ã©ã¹ãç¨ãããã®
+
+  bool_t*			TECS::BoolPointer
+  char_t*			TECS::CharPointer
+  uchar_t*			TECS::UCharPointer
+  schar_t*			TECS::SCharPointer
+  intN_t*			TECS::IntNPointer   N:8,16,32,64
+  uintN_t*			TECS::UIntNPointer  N:8,16,32,64
+  float32_t*		TECS::Float32Pointer
+  double64_t*		TECS::Double64Pointer
+  int*				TECS::IntPointer
+  short*			TECS::ShortPointer
+  long*				TECS::LongPointer
+  char*				TECS::CharPointer  (char_t* ã¨åã)
+
+  struct TAG		TECS:TECSStructTAG
+  struct TAG*		TECS:TECSStructTAG
+                    TAG ã®é¨åã¯ãæ§é ä½ã®ã¿ã°åã«ç½®ãæãããé¢æ°ã¸ã®
+                    å¼æ°ã¨ãã¦ãæ§é ä½ãæ¸¡ãããæ§é ä½ã¸ã®ãã¤ã³ã¿ãæ¸¡
+                    ããã¯ããã©ã°ã¤ã³ãèªåã§å¤å®ãããTAG åãä»ãã¦
+                    ããªãæ§é ä½ãæ±ããã¨ã¯ã§ããªããtypedef ããåå
+                    ã§æ§é ä½ãæ±ããã¨ã¯ã§ããªãã
+
+ã»ãã®ä»
+
+  void * ã¯æ±ããªã
+  intptr_t ã¯ãéå¸¸ stdint.h ã§ typedef ããã¦ããããå
+ã®åã¨ãã¦æ±ã
+
+ãã©ã°ã¤ã³å¼æ°ã¨ãã¦ ignoreUnsigned=true ãæå®ããã¨ãç¡ç¬¦å·æ´æ°åã¸
+ã®ãã¤ã³ã¿åãæç¬¦å·æ´æ°åã®ãã¤ã³ã¿åã¨ãã¦æ±ãï¼å¤ã®ç¯å²ãã§ãã¯ãå«
+ãï¼ããã¤ã³ã¿ãæ±ãã¯ã©ã¹ã®ã¡ã¢ãªä½¿ç¨éãæãããã¨ãæç¬¦å·ãç¡ç¬¦å·ã®
+ä½¿ãåããã«ã¼ãºã«ãããã¨ãã§ããã
+
+ãã«ãæã®ãªãã·ã§ã³ (C è¨èªã®ãã¯ã­å®ç¾©) TECS_NO_VAL_CHECK ãæå®ãã
+ãã¨ã§ãå¤ã®ç¯å²ãã§ãã¯ãè¡ããªãããã«ãããã¨ãã§ããã
+
+ãé¢æ°åã
+
+ã»é¢æ°åã«é¢æ°ããå¶é
+
+  é¢æ°å initialize ã¯ ruby ã§æ¢å®ã®ã¡ã½ããåã¨éè¤ãããããinitialize_cell
+ ã«ç½®æãããã
+
+  initialize ã¨ initialize_cell ã®ä¸¡æ¹ã signature å
+ã«å­å¨ããå ´åãã¨ã©ã¼ã¨
+  ãªããã¨ã©ã¼ãè§£æ¶ããã«ã¯ãå°ãªãã¨ãä¸æ¹ã®ååãå¤æ´ããå¿
+è¦ãããã
+
+ãæ»ãå¤ã
+
+æ»ãå¤ã§æ±ããã®ã¯ãä»¥ä¸ã®åã«éãããã
+
+   void, bool_t, char_t, intN_t, float32_t, double64_t
+   int, short, long, char
+   å
+ã®åãããããã§ãã typedef ãããå
+
+ãå¼æ°ã
+
+ã»é åºã®éãå¯¾å¿ãã mruby ã®åï¼ã¯ã©ã¹ï¼ã®å¤ãå¼æ°ã¨ãã¦æ¸¡ã
+ã»æå®å¯è½ãªåºæ¬æå®å­  in, inout, out  (send/receive ã¯ä¸å¯)
+ã»ä¾å¤ã®çºç
+  ã»æ´æ°ã®å¤ããå¼æ°ã®åã®ç¯å²ãè¶
+ãã¦ããå ´åãä¾å¤ãçºçããã
+    ç¡ç¬¦å·åã®å ´åãè² ã®å¤ãåããã¨ã¯ã§ããªãããã ããmrb_int ã¨åã
+    ã¾ãã¯ããä»¥ä¸ã®ãµã¤ãºã®å ´åã«ã¯ãè² ã®å¤ãæå®ããã¦ãä¾å¤ã¨ã¯ããª
+    ãããããªãã¨æä¸ä½ãããã 1 ã®å¤ãå
+¥åã§ããªãããã
+    char_t (char) ã¯ç¡ç¬¦å·ã¨è¦ãªãããã
+    ãªã uintptr_t ã« 0x80000000 ã«ãæ¸¡ãéã« RangeError ä¾å¤ãçºçã
+    ãããããã¯ mruby ã«ãããã®ã§ãããTECS ã«ããå¶éã§ã¯ãªã
+  ã»ãã¤ã³ã¿åãæ§é ä½åã«å¯¾å¿ãã mruby ã®å(ã¯ã©ã¹) ã¨ä¸è´ããªã
+  ã»size_is, string ã®ãµã¤ãºãå°ãã
+
+ãåèã
+
+ TECSPointer.txt
+
+  ä»¥ä¸ã® mruby ã¯ã©ã¹ãããªãã¡ TECS ã®ãã¤ã³ã¿å¤ãæ±ãããã®ã¯ã©ã¹ã«
+  ã¤ãã¦ã®èª¬æã
+ããããã®ã¯ã©ã¹ã¯å¿
+è¦ã«å¿ãã¦çæããããå¼æ°ã¨ãã¦ä½¿ç¨ããã¦ããªãã¯
+  ã©ã¹ã¯çæãããªãã
+
+  TECS::Int8Pointer,   TECS::Int16Pointer,   TECS::Int32Pointer
+  TECS::Int64Pointer,  TECS::UInt64Pointer
+  TECS::UInt8Pointer,  TECS::UInt16Pointer,  TECS::UInt32Pointer
+  TECS::CharPointer,   TECS::SCharPointer,   TECS::UCharPointer
+  TECS::IntPointer,    TECS::ShortPointer,   TECS::LongPointer
+  TECS::UIntPointer,   TECS::UShortPointer,  TECS::ULongPointer
+  TECS::BoolPointer,   TECS::Float32Pointer, TECS::Double64Pointer
+
+ TECSStruct.txt
+
+  ä»¥ä¸ã® mruby ã¯ã©ã¹ãããªãã¡ TECS ã®æ§é ä½ï¼ãã¤ã³ã¿ï¼å¤ãæ±ããã
+  ã®ã¯ã©ã¹ã«ã¤ãã¦ã®èª¬æã
+
+  TECS::StructTAG
+
+ãTECS CDLã«ããè¨è¿°ã
+
+ ããªãã¸ãã©ã°ã¤ã³ã«ãããããªãã¸ã»ã«ã¿ã¤ããèªåçæãããã
+ ããªãã¸ã»ã«ã¯ãCDL ã«è¨è¿°ãã¦è¨­ç½®ããå¿
+è¦ããã
+
+ã»ããªãã¸ãã©ã°ã¤ã³ã®å¼åºã
+
+mruby=>TECS ããªãã¸ãã©ã°ã¤ã³ã¯ãã·ã°ããã£ãã©ã°ã¤ã³ã§ãããCDL ä¸ã®ä»¥ä¸ã®ã
+ããªè¨è¿°ã«ãããmruby=>TECS ããªãã¸ãã©ã°ã¤ã³ãå¼ã³åºãã
+
+  ex)
+    generate( MrubyBridgePlugin, sSignature, "" );
+
+ ã·ã°ããã£ sSignature ã¯ããã®è¨è¿°ãããåã«å®ç¾©ããã¦ããªãã¦ã¯ãªããªãã
+ ãã® generate ã®è¨è¿°ã«ãããæ¬¡ã®ãããªããªãã¸ã»ã«ã¿ã¤ããçæãããã
+
+generate ã®ç¬¬3å¼æ°ã¯ããã©ã°ã¤ã³å¼æ°ï¼ãªãã·ã§ã³ï¼ã§ããã
+
+  ignoreUnsigned   true ãæå®ããã¨ç¡ç¬¦å·æ´æ°ã¸ã®ãã¤ã³ã¿åã«æç¬¦å·ã®ã
+                   ã¤ã³ã¿ã¯ã©ã¹ãä½¿ç¨ããï¼ã¡ã¢ãªãç¯ç´ã§ããï¼
+                   ããã©ã«ãã¯ false ã§ããã
+  include          ããªãã¸ã«å«ããé¢æ°ãæå®ãããexclude ã¨åææå®ä¸å¯ã
+  exclude          ããªãã¸ã«å«ããé¢æ°ãæå®ãããinclude ã¨åææå®ä¸å¯ã
+
+  ex)
+    generate( MrubyBridgePlugin, sSignature, "exclude=fun99" );
+
+å¤ãã®é¢æ°ãæå®ããå ´åãä»¥ä¸ã®ããã«ãåå²ããæå­åã®é£æ¥ã¨ãã¦å¸«å®
+ãããã¨ãã§ãã¾ãã
+
+  ex)
+    generate( MrubyBridgePlugin, sSignature,
+        "ignoreUnsigned=true, "
+        "include='func1,func2', "
+        "include='func3,func4', "
+     );
+
+ã»ããªãã¸ã»ã«ã¿ã¤ã
+
+ ããªãã¸ã»ã«ã¿ã¤ãã¯ããã¼ã ã¹ãã¼ã¹ nMruby ã®ä¸ã«ä½ããããããªãã¸
+ã»ã«ã¿ã¤ãã®ååã¯ãã·ã°ããã£åã« 't' ãåç½®ããããã®ã§ãããä»¥ä¸ã¯ã
+ããªãã¸ãã©ã°ã¤ã³ã«ããèªåçæãããã»ã«ã¿ã¤ãã®ã³ã¼ãã®ä¾ã§ãããã·
+ã°ããã£ sSignature ã«å¯¾ããããªãã¸ã»ã«ã¿ã¤ãåã¯ tsSignature ã§ããã
+å¼ã³å£cTECS ãæã¤ã
+
+  ex) èªåçæããã CDL ã³ã¼ãï¼å
+é¨ã§çæãããè§£éãããï¼
+
+   namespace nMruby {
+     celltype SSignature{
+       call sSignature cTECS;
+     };
+   };
+
+ã»ããªãã¸ã»ã«ã®è¨­ç½®
+
+ ããªãã¸ã»ã«ã¯ãããªãã¸ã»ã«ã¿ã¤ãã®ã»ã«ã¨ãã¦çæãããããªãã¸ã»ã«
+ ã®è¨­ç½®ã¯ CDL ã®è¨è¿°è
+ãè¡ããã®ã§ãããããªãã¸ã»ã«ã®å¼ã³å£ cTECS ã 
+ mRuby ããå¼ã³åºãããã»ã«ã¸çµåããã
+
+  ex) ããªãã¸ã»ã«ãè¨­ç½®ãã CDL è¨è¿°
+
+   cell nMruby::tsSignature BridgeCell {
+     cTECS = Cell.eEnt;
+   };
+
+  ex) ããªãã¸ã»ã«ãè¨­ç½®ãã CDL è¨è¿°(VM åæå®ãã)
+
+   cell nMruby::tsSignature BridgeCell {
+     cTECS = Cell.eEnt;
+	 VMname = "VM2";
+   };
+
+  VMname ã¯ mruby VM ã®ã»ã«ã®ååã®æå®ã§ãããVMname ãæå®ããªãå ´åã
+  "VM" ãä»®å®ããããVMname ã¯ãå®éã«ã¯ãVM_TECSInitializer ãªã©ã®ã
+  ãã«ãããªãã¸ãç»é²ããã»ã«ã®ãã»ã«åã«ç¨ãããããtecsgen å®è¡æã«
+  ä»¥ä¸ã®ãããªã¡ãã»ã¼ã¸ãåºåããããåãå£ 
+  VM_TECSInitializer.eInitialize ã¸ VM ã®åæåç¨å¼ã³å£ããçµåããã
+
+   MrubyBridgePlugin: join your VMs cInitialize to VM_TECSInitializer.eInitialize
+
+ãmruby ã³ã¼ãã
+
+ ããªãã¸ãã©ã°ã¤ã³ãé©ç¨ãããã·ã°ããã£ã«å¯¾å¿ãã mruby ã¯ã©ã¹ãçæ
+ ãããããããããªãã¸ã¯ã©ã¹ã¨å¼ã¶ã
+ ããªãã¸ã¯ã©ã¹ãéãã¦ã»ã«ã®åãå£é¢æ°ãå¼ã³åºããã¨ãã§ããã
+
+ã»ããªãã¸ã¯ã©ã¹
+
+ ããªãã¸ã¯ã©ã¹ã¯ãã¢ã¸ã¥ã¼ã« TECS ã®ä¸ã«ä½æããããããªãã¸ã¯ã©ã¹ã®
+ ååã¯ãã·ã°ããã£åã« 'T' ãåç½®ããããã®ã¨ãªãã
+
+ ex)  TECS::TsSignature
+
+ã»ããªãã¸ã®ã¤ã³ã¹ã¿ã³ã¹
+
+  ããªãã¸ã¯ã©ã¹ã«ã¦ãããªãã¸ã»ã«åãå¼æ°ã¨ãã¦ new ãããã¨ã§ãããªã
+  ã¸ã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ãçæããããããªãã¸ã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ã®ã
+  ã¨ããç­ããããªãã¸ã®ã¤ã³ã¹ã³ã¿ã³ã¹ã¨ãå¼ã¶ãããªãã¸ã®ã¤ã³ã¹ã¿ã³ã¹
+  ã¯ãããªãã¸ã»ã«ã¸ã®ãã¤ã³ã¿æ
+å ±ãä¿æããã ãã§ãããåä¸ã®ããªãã¸
+  ã®ã¤ã³ã¹ã¿ã³ã¹ã¯ä½åº¦ã§ãçæãããã¨ãã§ããã
+
+ ex)  brdige = TECS::TsSignature.new( "CellName" )
+
+ãæ®èª²é¡ã
+
+[æ¸] æ´æ°åã® unsigned ã®æ±ã
+   ã­ã£ã¹ãããã¦ããã®ã§ãã³ã³ãã¤ã«ã¯è­¦åãªãéãã
+   å¤ã®ç¯å²ãã§ãã¯ã¨æ´åãã¦ããªãã
+   ä»¥ä¸ãæ°ãã«è¨­ãããã
+   UInt8Pointer, UInt16Pointer, UInt32Pointer, UInt64Pointer
+   UIntPointer, UShortPointer, ULongPointer, UCharPointer, SCharPointer, 
+
+[æ¸] å¤ã®ç¯å²ã®ãã§ãã¯
+   TECSPointer, TECSStruct ã§ã¯æ´æ°å¤ãè¨­å®ããéã«ãç¯å²ãã§ãã¯ãããã
+   ã¡ã½ããã¸ã®ç´æ¥ã®å¼æ°ã¯ãã§ãã¯ãããªãã
+
+[æ¸] ç¾ç¶ã® so ã¨ãã¦ã®å®è£
+ã¯ãããã
+   éçã« mruby ã®æ¬ä½ãçµåããã¦ããã
+
+[æ¸] ãã¤ã³ã¿åãæ±ãã¯ã©ã¹ãå¤ããã
+   ä½¿ç¨ããã¯ã©ã¹ã ãã­ã¼ããããåæåãããä»çµã¿ãæ¬²ããã
+
+ã»ä»¥ä¸ã®æ¹æ³ã§ããªãã¸ãå²ãä»ãã¦ãããã
+    bridge = TsSample.new( "SimpleBridge" )
+ãä»¥ä¸ã®ããã«ãå®æ°ã¨ãã¦æ±ããã¨ãã§ããæ¹ãã¹ãã¼ãã§ããã
+    bridge = TECS::SimpleBridge
+  (ç¾ç¶ã®æ¹ããããªãã¸ã®ã»ã«ã¿ã¤ãããããç¹ãåªãã¦ãã)
+  â ããå®æ°ã¨ãã¦æ±ãã¨ãã¦ãå²ä»ãã C ã§è¡ãã ruby ã³ã¼ãã§è¡ãã
+     ã®éãã§ãããªããä»¥ä¸ã«ããã©ããã¼ã¯ã©ã¹ã«ããå®æ°ã®åæåãè¡
+     ãã°ããã
+  â å®æ°ã¨ãã¦æ±ãã¨ããªãã¸ã§ã¯ããæåããæå¾ã¾ã§æ¶ããªãã¨ããå
+     é¡ããã(ããã§ãå°éã§ããã)
+
+ã»ä¸è¨ã«é¢é£ãã¦ãVM ãç°ãªãå ´åã«ãä»ã® VM ã«å²ãä»ããããªãã¸åã
+  è¦ãã¦ãã¾ããã¢ã¯ã»ã¹å¶éãååã§ãªãã
+  ããªãã¸åã®ã¢ã¯ã»ã¹å¶éãå®ç¾ããã«ã¯ãVM ãè­å¥ããæ
+å ±ãå¿
+è¦ã«ãª
+  ããmrb_state ã« p_cellcb ãå ããæ¹æ³ãmrb_stateèªèº«ã§åºå¥ããæ¹æ³
+  ãèãããããè¦æ¤è¨ã
+  ãªããã»ã«ã¿ã¤ãåä½ã§ã®ã¢ã¯ã»ã¹å¶ éã¯ã§ãã¦ãã(ã¦ãã¦ããªãã®ã¯ã
+  åãã»ã«ã¿ã¤ãã§è¤æ°ã®ããªãã¸ã»ã«ãããå ´åã«ãããªãã¸åã®ã¢ã¯ã»ã¹
+  å¶é)ã
+
+ã»typedef ãããååã§ã¢ã¯ã»ã¹ã§ããã¨ä¾¿å©ã§ãã
+  TECSPointer ã TECSStruct ã®ã¯ã©ã¹ã«å¯¾ãã alias ã«ãããå¥åã¨ãã¦
+  ã¢ã¯ã»ã¹ã§ããã¨ããã
+   â ã¨ãããããMrubyBridgePlugin ã®ã¡ãã»ã¼ã¸ã¨ãã¦ãããããã«ããã
+
+ã»send/receive ã¸ã®å¯¾å¿
+  mruby ã¨å
+±éã®ã¢ã­ã±ã¼ã¿ãæå®å¯è½ã¨ãã (ã¢ã­ã±ã¼ã¿ã³ã³ãã¼ã¿ãã©ã°ã¤ã³ãæ°è¦ã«è¨­ãã¦ã¯?)
+
+ã»æ§é ä½ã¡ã³ãã¼ã®åå¶éã®ç·©å
+   strign or size_is æå®ããã char* ãªã©
+
+ã»ruby ããããã­ã°ã©ã ãã mruby â TECS ããªãã¸ã®ã¯ã©ã¹ã¸ã®èªåå¤æããã©ããã¼ã¯ã©ã¹ã®çæ
+  (ruby's Array => TECS::Pointer, ruby's Struct => TECS::StructTAG)
+
+[æ¸]ããªãã¸ã¯ã©ã¹ã® new ã§ã»ã«ãè¦ã¤ãããªãã£ãå ´åãruby ä¾å¤ãçºçãããã
+  ããã free ããæ®µéã§ SEGV ãçºçãããã DATA_SET ãæ©ãã«è¡ãããã«å¤æ´ã
+  ãªããåã¡ã½ããã®é¢æ°ã§ DATA_PTR ã null ãã©ããããã§ãã¯ããªããã
+  ä¾å¤ãçºçãããã¨ã«ããä¸å®å
+¨ãªããªãã¸ã¯å¤æ°ã«è¨æ¶ãããªãï¼ã¯ãï¼
+  ãããåé¡ãªãã
+
Index: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyTECSPointer.txt
===================================================================
--- asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyTECSPointer.txt	(revision 374)
+++ asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyTECSPointer.txt	(revision 374)
@@ -0,0 +1,109 @@
+TECS::Int8Pointer       TECS::UInt8Pointer
+TECS::Int16Pointer      TECS::UInt16Pointer
+TECS::Int32Pointer      TECS::UInt32Pointer
+TECS::Int64Pointer      TECS::UInt64Pointer
+TECS::CharPointer       TECS::SCharPointer      TECS::UCharPointer
+TECS::IntPointer	    TECS::UIntPointer
+TECS::ShortPointer	    TECS::UShortPointer
+TECS::LongPointer       TECS::ULongPointer
+TECS::BoolPointer
+TECS::Float32Pointer
+TECS::Double64Pointer
+
+TECS ã®ãã¤ã³ã¿åã®æ´æ°ãã¼ã¿ãæµ®åå°æ°ç¹ãã¼ã¿ãæå­ãã¼ã¿ãæ±ããã
+ã®è¨æ¶åãæ±ãã¾ãããããã®ã¯ã©ã¹ã¯ãã·ã°ããã£ã§ä½¿ç¨ããã¦ãããã®ã 
+MrubyBridgePlugin ãã©ã°ã¤ã³ãèªåå¤å¥ãã¦çæãã¾ãã
+
+ãã¤ã³ã¿å¤ãã®ãã®ãæ¸¡ãã«ã¯ intptr_t åã¨ãã¦æ¸¡ãã®ãå¦¥å½ã§ãã
+
+C è¨èªã®åã¨ã¯ãä»¥ä¸ã®ããã«å¯¾å¿ãã¾ãã
+
+   int8_t                 TECS::Int8Pointer
+   int16_t                TECS::Int16Pointer
+   int32_t                TECS::Int32Pointer
+   int64_t                TECS::Int64Pointer
+   char_t                 TECS::CharPointer
+   schar_t                TECS::SCharPointer
+   uchar_t                TECS::UCharPointer
+   uint8_t                TECS::UInt8Pointer
+   uint16_t               TECS::UInt16Pointer
+   uint32_t               TECS::UInt32Pointer
+   uint64_t               TECS::UInt64Pointer
+   bool_t                 TECS::BoolPointer
+   float32_t              TECS::Float32Pointer
+   double64_t             TECS::Double64Pointer
+
+ éæ¨å¥¨ã®å
+   char                   TECS::CharPointer
+   int                    TECS::IntPointer
+   short                  TECS::ShortPointer
+   long                   TECS::LongPointer
+   signed char            TECS::SCharPointer
+   unsigned char          TECS::UCharPointer
+   unsigned int           TECS::UIntPointer
+   unsigned short         TECS::UShortPointer
+   unsigned long          TECS::ULongPointer
+   float                  TECS::Float32Pointer
+   double                 TECS::Double64Pointer
+
+char, signed char, unsgined char ã¯ char_t, schar_t, uchar_t ã¨è¦ãªããã¾ãã
+
+ãåèã
+ã¿ã¼ã²ããç°å¢ã«ããã¦ char, singed char, unsigned char ã®ãµã¤ãºã 1 ãã¤ãã§ã¯ç¡ãå ´åã«ã¯ãç¸éãçããã
+
+== ã¹ã¼ãã¼ã¯ã©ã¹ ==
+
+Object
+
+== ã¯ã©ã¹ã¡ã½ãã ==
+
+new( size )
+
+  size ã®å¤§ãããæã¤è¨æ¶åãæããã¤ã³ã¿ãçæãã¦è¿ãã¾ãã
+  size ã®åä½ã¯ãè¦ç´ ã®åæ°ã§ãã
+
+== ã¡ã½ãã ==
+
+self[ nth ]
+
+  nth çªç®ã®è¦ç´ ãè¿ãã¾ããnth ã¯ 0..(length-1) ã®æ´æ°ã§ãã
+  '=' ã®å·¦è¾ºã§ã¯ãnth çªç®ã®è¦ç´ ãå³è¾ºã®å¤ã«ç½®ãæãã¾ãã
+
+  nth ã«æ´æ°ã¾ãã¯æµ®åå°æ°ä»¥å¤ãæ¸¡ããå ´åãä¾å¤ãçºçãã¾ãã
+
+self[ nth ] = val
+
+  æ´æ°åã®ãã¤ã³ã¿ã®å ´åãå¤ã®ç¯å²ããã§ãã¯ããã¾ãã
+  val ã®å¤ãç¯å²ãè¶
+ããå ´åãä¾å¤ãçºçãã¾ãã
+
+value
+
+  ãã¤ã³ã¿ã®æãå
+ã®å¤ãåãåºãã¾ãã
+  self[0] ã¨åãã§ãã
+
+value = val
+
+  ãã¤ã³ã¿ã®æãå
+ã«å¤ãè¨­å®ãã¾ãã
+  self[0] = val ã¨åãã§ãã
+
+length
+size
+
+  ãã¤ã³ã¿ãæãè¦ç´ ã®åæ°ãè¿ãã¾ãã
+
+to_s
+
+  CharPointer ã¯ã©ã¹ã§ã®ã¿ä½¿ç¨ã§ãã¾ãã
+  mruby ã® String ã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ã«å¤æãã¦è¿ãã¾ãã
+
+from_s
+
+  CharPointer ã¯ã©ã¹ã§ã®ã¿ä½¿ç¨ã§ãã¾ãã
+  mruby ã®æå­åãã CharPointer ã®æãè¨æ¶åã«æå­åãã³ãã¼ãã¾ãã
+  
+  new ã®éã«ç¢ºä¿ãããè¨æ¶åãç¨ãããã¾ããè¨æ¶åã®å¤§ãããæå­åãããç­ãå ´åã«ã¯ãè¨æ¶åã®å¤§ããã«åã¾ãããã«ã³ãã¼ããã¾ãã
+  è¨æ¶åãããæå­åãé·ãå ´åãè¨æ¶åã®æ«å°¾ã«çµç«¯æå­ '\0' ã¯ç½®ããã¾ããã
+
Index: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyTECSStruct.txt
===================================================================
--- asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyTECSStruct.txt	(revision 374)
+++ asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyTECSStruct.txt	(revision 374)
@@ -0,0 +1,24 @@
+TECS::StructTAG
+
+  C è¨èªã®æ§é ä½ãæ±ãããã®ã¯ã©ã¹ã§ãããsignature ã«ç¾ããæ§é ä½ã«åããã¦ MrubyBridgePlugin ã«ããçæããã¾ãã
+  TAG ã®é¨åã¯ãæ§é ä½ã®ã¿ã°åã«ç½®ãæãã¾ãã
+
+== ã¹ã¼ãã¼ã¯ã©ã¹ ==
+
+Object
+
+== ã¯ã©ã¹ã¡ã½ãã ==
+
+new()
+
+== ã¡ã½ãã ==
+
+MEMBER
+
+  æ§é ä½ã¡ã³ãã®å¤ãèª­ã¿åºãã¾ãã
+  MEMBER ã¯ã¡ã³ãåã«ç½®ãæãã¾ãã
+
+MEMBER = val
+
+  æ§é ä½ã¡ã³ãã®å¤ãæ¸ãè¾¼ã¿ã¾ãã
+  MEMBER ã¯ã¡ã³ãåã«ç½®ãæãã¾ãã
Index: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyVMs.cdl
===================================================================
--- asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyVMs.cdl	(revision 352)
+++ asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/mrubyVMs.cdl	(revision 374)
@@ -37,5 +37,6 @@
 
 /*
- * tools/mruby/mruby.c から cInit_initializeBridge( mrb ) を呼び出すように変更したもの
+ * POSIX 環境用の VM
+ * mrbgems の mrbgems/mruby-bin-mruby/tools/mruby/mruby.c を参考に作成したもの
  */
 namespace nMruby{
Index: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyCyclicTaskBody.c
===================================================================
--- asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyCyclicTaskBody.c	(revision 374)
+++ asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyCyclicTaskBody.c	(revision 374)
@@ -0,0 +1,105 @@
+/*
+ *   Copyright (C) 2008-2017 by TOPPERS Project
+ *
+ *  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ï½(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+ *  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+ *  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+ *  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+ *      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+ *      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+ *  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+ *      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+ *      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+ *      ã¨ï¼
+ *    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+ *        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+ *        å ±åãããã¨ï¼
+ *  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+ *      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+ *      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+ *      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+ *      å
+è²¬ãããã¨ï¼
+ * 
+ *  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+ *  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+ *  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+ *  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+ *  ã®è²¬ä»»ãè² ããªãï¼
+ * 
+ *  @(#) $Id$
+ */
+
+/* #[<PREAMBLE>]#
+ * #[<...>]# ãã #[</...>]# ã§å²ã¾ããã³ã¡ã³ãã¯ç·¨éããªãã§ãã ãã
+ * tecsmerge ã«ãããã¼ã¸ã«ä½¿ç¨ããã¾ã
+ *
+ * å¼ã³å£é¢æ° #_TCPF_#
+ * call port: cMrubyVM signature: nMruby_sMrubyVM context:task
+ *   bool_t         cMrubyVM_initialize( );
+ *   bool_t         cMrubyVM_run( );
+ *   void           cMrubyVM_funcall( const char_t* name );
+ *   void           cMrubyVM_finalize( );
+ *
+ * #[</PREAMBLE>]# */
+
+/* ãã­ãã¿ã¤ãå®£è¨ãå¤æ°ã®å®ç¾©ãããã«æ¸ãã¾ã #_PAC_# */
+#include "nMruby_tMrubyCyclicTaskBody_tecsgen.h"
+
+#ifndef E_OK
+#define	E_OK	0		/* success */
+#define	E_ID	(-18)	/* illegal ID */
+#endif
+
+/* åãå£é¢æ° #_TEPF_# */
+/* #[<ENTRY_PORT>]# eMrubyBody
+ * entry port: eMrubyBody
+ * signature:  sTaskBody
+ * context:    task
+ * #[</ENTRY_PORT>]# */
+
+/* #[<ENTRY_FUNC>]# eMrubyBody_main
+ * name:         eMrubyBody_main
+ * global_name:  nMruby_tMrubyCyclicTaskBody_eMrubyBody_main
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+void
+eMrubyBody_main(CELLIDX idx)
+{
+	CELLCB	*p_cellcb;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+  if( ! VAR_b_init ){
+      cMrubyVM_initialize( );
+      VAR_b_init = true;
+  }
+  cMrubyVM_run( );
+}
+
+/* #[<POSTAMBLE>]#
+ *   ããããä¸ã«éåãå£é¢æ°ãæ¸ãã¾ã
+ * #[</POSTAMBLE>]#*/
Index: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyProc.c
===================================================================
--- asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyProc.c	(revision 374)
+++ asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyProc.c	(revision 374)
@@ -0,0 +1,186 @@
+/*
+ *   Copyright (C) 2008-2017 by TOPPERS Project
+ *
+ *  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ï½(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+ *  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+ *  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+ *  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+ *      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+ *      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+ *  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+ *      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+ *      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+ *      ã¨ï¼
+ *    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+ *        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+ *        å ±åãããã¨ï¼
+ *  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+ *      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+ *      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+ *      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+ *      å
+è²¬ãããã¨ï¼
+ * 
+ *  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+ *  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+ *  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+ *  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+ *  ã®è²¬ä»»ãè² ããªãï¼
+ * 
+ *  @(#) $Id$
+ */
+
+/*
+ * ä»¥åã® nMruby_tMrubyProc.c ã¯ãmruby ã®æ¬ä½ã«å«ã¾ãã¦ãã 
+ *    mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
+ * ããã¼ã¹ã« TECS ã®ã³ã¼ããè¶³ãã¦ããããTOPPERS ã©ã¤ã»ã³ã¹ã¨ç°ãªããã
+ * æ°ãã«æ¸ãä¸ããããï¼å°ããªã³ã¼ãã®ãããæ¦ã­ä¼¼ããããªãã®ã«ãªããã
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mruby.h"
+#include "mruby/string.h"
+#include "mruby/array.h"
+#include "mruby/compile.h"
+#include "mruby/dump.h"
+#include "mruby/variable.h"
+
+/* #[<PREAMBLE>]#
+ * Don't edit the comments between #[<...>]# and #[</...>]#
+ * These comment are used by tecsmerege when merging.
+ *
+ * attr access macro #_CAAM_#
+ * mrb              mrb_state*       VAR_mrb         
+ *
+ * call port function #_TCPF_#
+ * call port: cInit signature: nMruby_sInitializeBridge context:task optional:true
+ *   bool_t     is_cInit_joined()                     check if joined
+ *   void           cInit_initializeBridge( const mrb_state* mrb );
+ *
+ * #[</PREAMBLE>]# */
+
+/* ãã­ãã¿ã¤ãå®£è¨ãå¤æ°ã®å®ç¾©ãããã«æ¸ãã¾ã #_PAC_# */
+#include "nMruby_tMrubyProc_tecsgen.h"
+
+#ifndef E_OK
+#define	E_OK	0		/* success */
+#define	E_ID	(-18)	/* illegal ID */
+#endif
+
+/* åãå£é¢æ° #_TEPF_# */
+/* #[<ENTRY_PORT>]# eMain
+ * entry port: eMain
+ * signature:  nPosix_sMain
+ * context:    task
+ * #[</ENTRY_PORT>]# */
+
+/* #[<ENTRY_FUNC>]# eMain_main
+ * name:         eMain_main
+ * global_name:  nMruby_tMrubyProc_eMain_main
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+int
+eMain_main(CELLIDX idx, int argc, const char** argv)
+{
+	CELLCB	*p_cellcb;
+  mrb_state *mrb;
+  mrbc_context* context;
+  if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+      return -1;
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+  if (argc != 2) {
+      printf("usage: %s script.rb\n", argv[0]);
+      goto error_return;
+  }
+  mrb = mrb_open();
+  if( mrb == 0 ){
+      printf("%s: mrb_open() failed\n", argv[0]);
+      goto error_return;
+  }
+  context = mrbc_context_new(mrb);
+  if (context == 0) {
+      printf("%s: mrbc_context_new() failed\n", argv[0]);
+      goto error_close;
+  }
+
+  /*--------   ARGV   ----------*/
+  {
+      mrb_value ARGV = mrb_ary_new_capa(mrb, argc);
+      int  i;
+      for (i = 0; i < argc; i++) {
+          mrb_ary_push(mrb, ARGV, mrb_str_new_cstr(mrb, argv[i]));
+      }
+      mrb_define_global_const(mrb, "ARGV", ARGV);
+  }
+  /*--------   $0   ----------*/
+  {
+      mrb_sym zero_sym = mrb_intern_lit(mrb, "$0");
+      mrbc_filename(mrb, context, argv[0]);
+      mrb_gv_set(mrb, zero_sym, mrb_str_new_cstr(mrb, argv[0]));
+  }
+
+  /* ------- register TECS bridge classes -------*/
+  if (is_cInit_joined()) {
+      cInit_initializeBridge(mrb);
+  }
+
+  /*--------  load .rb file -------*/
+  {
+      FILE *file = fopen(argv[1], "r");
+      if (file == NULL) {
+          printf("file not found: %s\n", argv[1]);
+          goto error_free;
+      }
+
+      mrb_value val = mrb_load_file_cxt(mrb, file, context);
+      if (mrb->exc) {
+          if(! mrb_undef_p(val)){
+              mrb_print_error(mrb);
+          }
+      }
+  }
+
+  /*---------- success case --------*/
+  mrbc_context_free(mrb, context);
+  mrb_close( mrb );
+  return 0;
+
+  /*---------- error case ----------*/
+error_free:
+  mrbc_context_free(mrb, context);
+error_close:
+  mrb_close( mrb );
+error_return:
+
+  return -1;
+}
+
+/* #[<POSTAMBLE>]#
+ *   Put non-entry functions below.
+ * #[</POSTAMBLE>]#*/
Index: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyProc_1_0.c
===================================================================
--- asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyProc_1_0.c	(revision 374)
+++ asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyProc_1_0.c	(revision 374)
@@ -0,0 +1,306 @@
+/*
+ * This file comes from mruby. (renamed from tools/mruby/mruby.c)
+ * This file is distributed under ruby's license. (not under TOPPERS license)
+ *   see https://github.com/mruby/mruby
+ * A little modification is done to to call initializer registering TECS components.
+ *
+ * ãã®ãã¡ã¤ã«ã¯ãmruby ã®ãã®ã§ãã
+ * mruby ã®ã©ã¤ã»ã³ã¹ã®ãã¨ã§ãé
+å¸ããã¾ãã(TOPPERS ã©ã¤ã»ã³ã¹ã§ã¯ããã¾ãã)
+ *  åç
+§ï¼  https://github.com/mruby/mruby
+ * TECS ã³ã³ãã¼ãã³ããç»é²ããåæåå­ãå¼ã¶ãããå°ãã®ä¿®æ­£ããªããã¦ãã¾ãã
+ */
+
+#include "nMruby_tMrubyProc_tecsgen.h"
+
+#include "mruby.h"
+#include "mruby/proc.h"
+#include "mruby/array.h"
+#include "mruby/string.h"
+#include "mruby/compile.h"
+#include "mruby/dump.h"
+#include "mruby/variable.h"
+#include <stdio.h>
+#include <string.h>
+
+#ifndef ENABLE_STDIO
+static void
+p(mrb_state *mrb, mrb_value obj)
+{
+  obj = mrb_funcall(mrb, obj, "inspect", 0);
+  fwrite(RSTRING_PTR(obj), RSTRING_LEN(obj), 1, stdout);
+  putc('\n', stdout);
+}
+#else
+#define p(mrb,obj) mrb_p(mrb,obj)
+#endif
+
+void mrb_show_version(mrb_state *);
+void mrb_show_copyright(mrb_state *);
+
+struct _args {
+  FILE *rfp;
+  char* cmdline;
+  int fname        : 1;
+  int mrbfile      : 1;
+  int check_syntax : 1;
+  int verbose      : 1;
+  int argc;
+  char** argv;
+};
+
+static void
+usage(const char *name)
+{
+  static const char *const usage_msg[] = {
+  "switches:",
+  "-b           load and execute RiteBinary (mrb) file",
+  "-c           check syntax only",
+  "-e 'command' one line of script",
+  "-v           print version number, then run in verbose mode",
+  "--verbose    run in verbose mode",
+  "--version    print the version",
+  "--copyright  print the copyright",
+  NULL
+  };
+  const char *const *p = usage_msg;
+
+  printf("Usage: %s [switches] programfile\n", name);
+  while(*p)
+  printf("  %s\n", *p++);
+}
+
+static int
+parse_args(mrb_state *mrb, int argc, char **argv, struct _args *args)
+{
+  char **origargv = argv;
+  static const struct _args args_zero = { 0 };
+
+  *args = args_zero;
+
+  for (argc--,argv++; argc > 0; argc--,argv++) {
+    char *item;
+    if (argv[0][0] != '-') break;
+
+    if (strlen(*argv) <= 1) {
+      argc--; argv++;
+      args->rfp = stdin;
+      break;
+    }
+
+    item = argv[0] + 1;
+    switch (*item++) {
+    case 'b':
+      args->mrbfile = 1;
+      break;
+    case 'c':
+      args->check_syntax = 1;
+      break;
+    case 'e':
+      if (item[0]) {
+        goto append_cmdline;
+      }
+      else if (argc > 1) {
+        argc--; argv++;
+        item = argv[0];
+append_cmdline:
+        if (!args->cmdline) {
+          char *buf;
+
+          buf = (char *)mrb_malloc(mrb, strlen(item)+1);
+          strcpy(buf, item);
+          args->cmdline = buf;
+        }
+        else {
+          args->cmdline = (char *)mrb_realloc(mrb, args->cmdline, strlen(args->cmdline)+strlen(item)+2);
+          strcat(args->cmdline, "\n");
+          strcat(args->cmdline, item);
+        }
+      }
+      else {
+        printf("%s: No code specified for -e\n", *origargv);
+        return 0;
+      }
+      break;
+    case 'v':
+      mrb_show_version(mrb);
+      args->verbose = 1;
+      break;
+    case '-':
+      if (strcmp((*argv) + 2, "version") == 0) {
+        mrb_show_version(mrb);
+        exit(0);
+      }
+      else if (strcmp((*argv) + 2, "verbose") == 0) {
+        args->verbose = 1;
+        break;
+      }
+      else if (strcmp((*argv) + 2, "copyright") == 0) {
+        mrb_show_copyright(mrb);
+        exit(0);
+      }
+      else return -3;
+      return 0;
+    default:
+      return -4;
+    }
+  }
+
+  if (args->rfp == NULL && args->cmdline == NULL) {
+    if (*argv == NULL) args->rfp = stdin;
+    else {
+      args->rfp = fopen(argv[0], args->mrbfile ? "rb" : "r");
+      if (args->rfp == NULL) {
+        printf("%s: Cannot open program file. (%s)\n", *origargv, *argv);
+        return 0;
+      }
+      args->fname = 1;
+      args->cmdline = argv[0];
+      argc--; argv++;
+    }
+  }
+  args->argv = (char **)mrb_realloc(mrb, args->argv, sizeof(char*) * (argc + 1));
+  memcpy(args->argv, argv, (argc+1) * sizeof(char*));
+  args->argc = argc;
+
+  return 0;
+}
+
+static void
+cleanup(mrb_state *mrb, struct _args *args)
+{
+  if (args->rfp && args->rfp != stdin)
+    fclose(args->rfp);
+  if (args->cmdline && !args->fname)
+    mrb_free(mrb, args->cmdline);
+  if (args->argv)
+    mrb_free(mrb, args->argv);
+  mrb_close(mrb);
+}
+
+static void
+showcallinfo(mrb_state *mrb)
+{
+  mrb_callinfo *ci;
+  mrb_int ciidx;
+  const char *filename, *method, *sep;
+  int i, line;
+
+  printf("trace:\n");
+  ciidx = mrb_fixnum(mrb_obj_iv_get(mrb, mrb->exc, mrb_intern(mrb, "ciidx")));
+  if (ciidx >= mrb->ciend - mrb->cibase)
+    ciidx = 10; /* ciidx is broken... */
+
+  for (i = ciidx; i >= 0; i--) {
+    ci = &mrb->cibase[i];
+    filename = "(unknown)";
+    line = -1;
+
+    if (MRB_PROC_CFUNC_P(ci->proc)) {
+      continue;
+    }
+    else {
+      mrb_irep *irep = ci->proc->body.irep;
+      if (irep->filename != NULL)
+        filename = irep->filename;
+      if (irep->lines != NULL && i+1 <= ciidx) {
+        mrb_code *pc = mrb->cibase[i+1].pc;
+        if (irep->iseq <= pc && pc < irep->iseq + irep->ilen) {
+          line = irep->lines[pc - irep->iseq - 1];
+        }
+      }
+    }
+    if (ci->target_class == ci->proc->target_class)
+      sep = ".";
+    else
+      sep = "#";
+
+    method = mrb_sym2name(mrb, ci->mid);
+    printf("\t[%d] %s:%d%s%s%s%s\n",
+    	   i, filename, line,
+	   method ? ":in " : "",
+	   method ? mrb_class_name(mrb, ci->proc->target_class) : "",
+	   method ? sep : "",
+	   method ? method : "");
+  }
+}
+
+int
+eMain_main( CELLIDX idx, int argc, const char **argv)
+{
+  CELLCB   *p_cellcb = GET_CELLCB( idx );
+  mrb_state *mrb = mrb_open();
+  int n = -1;
+  int i;
+  struct _args args;
+  mrb_value ARGV;
+
+  cInit_initializeBridge( mrb );
+
+  if (mrb == NULL) {
+    fprintf(stderr, "Invalid mrb_state, exiting mruby\n");
+    return EXIT_FAILURE;
+  }
+
+  n = parse_args(mrb, argc, (char **)argv, &args);
+  if (n < 0 || (args.cmdline == NULL && args.rfp == NULL)) {
+    cleanup(mrb, &args);
+    usage(argv[0]);
+    return n;
+  }
+
+  ARGV = mrb_ary_new_capa(mrb, args.argc);
+  for (i = 0; i < args.argc; i++) {
+    mrb_ary_push(mrb, ARGV, mrb_str_new(mrb, args.argv[i], strlen(args.argv[i])));
+  }
+  mrb_define_global_const(mrb, "ARGV", ARGV);
+
+  if (args.mrbfile) {
+    n = mrb_load_irep(mrb, args.rfp);
+    if (n < 0) {
+      fprintf(stderr, "failed to load mrb file: %s\n", args.cmdline);
+    }
+    else if (!args.check_syntax) {
+      mrb_run(mrb, mrb_proc_new(mrb, mrb->irep[n]), mrb_top_self(mrb));
+      n = 0;
+      if (mrb->exc) {
+        showcallinfo(mrb);
+        p(mrb, mrb_obj_value(mrb->exc));
+        n = -1;
+      }
+    }
+  }
+  else {
+    mrbc_context *c = mrbc_context_new(mrb);
+    mrb_value v;
+
+    if (args.verbose)
+      c->dump_result = 1;
+    if (args.check_syntax)
+      c->no_exec = 1;
+
+    if (args.rfp) {
+      mrbc_filename(mrb, c, args.cmdline ? args.cmdline : "-");
+      v = mrb_load_file_cxt(mrb, args.rfp, c);
+    }
+    else {
+      mrbc_filename(mrb, c, "-e");
+      v = mrb_load_string_cxt(mrb, args.cmdline, c);
+    }
+    mrbc_context_free(mrb, c);
+    if (mrb->exc) {
+      if (!mrb_undef_p(v)) {
+        showcallinfo(mrb);
+        p(mrb, mrb_obj_value(mrb->exc));
+      }
+      n = -1;
+    }
+    else if (args.check_syntax) {
+      printf("Syntax OK\n");
+    }
+  }
+  cleanup(mrb, &args);
+
+  return n == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
+}
Index: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyTaskBody.c
===================================================================
--- asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyTaskBody.c	(revision 374)
+++ asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyTaskBody.c	(revision 374)
@@ -0,0 +1,103 @@
+/*
+ *   Copyright (C) 2008-2017 by TOPPERS Project
+ *
+ *  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ï½(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+ *  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+ *  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+ *  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+ *      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+ *      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+ *  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+ *      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+ *      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+ *      ã¨ï¼
+ *    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+ *        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+ *        å ±åãããã¨ï¼
+ *  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+ *      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+ *      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+ *      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+ *      å
+è²¬ãããã¨ï¼
+ * 
+ *  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+ *  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+ *  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+ *  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+ *  ã®è²¬ä»»ãè² ããªãï¼
+ * 
+ *  @(#) $Id$
+ */
+
+/* #[<PREAMBLE>]#
+ * #[<...>]# ãã #[</...>]# ã§å²ã¾ããã³ã¡ã³ãã¯ç·¨éããªãã§ãã ãã
+ * tecsmerge ã«ãããã¼ã¸ã«ä½¿ç¨ããã¾ã
+ *
+ * å¼ã³å£é¢æ° #_TCPF_#
+ * call port: cMrubyVM signature: nMruby_sMrubyVM context:task
+ *   bool_t         cMrubyVM_initialize( );
+ *   bool_t         cMrubyVM_run( );
+ *   void           cMrubyVM_finalize( );
+ *
+ * #[</PREAMBLE>]# */
+
+/* ãã­ãã¿ã¤ãå®£è¨ãå¤æ°ã®å®ç¾©ãããã«æ¸ãã¾ã #_PAC_# */
+#include "nMruby_tMrubyTaskBody_tecsgen.h"
+
+#ifndef E_OK
+#define	E_OK	0		/* success */
+#define	E_ID	(-18)	/* illegal ID */
+#endif
+
+/* åãå£é¢æ° #_TEPF_# */
+/* #[<ENTRY_PORT>]# eMrubyBody
+ * entry port: eMrubyBody
+ * signature:  sTaskBody
+ * context:    task
+ * #[</ENTRY_PORT>]# */
+
+/* #[<ENTRY_FUNC>]# eMrubyBody_main
+ * name:         eMrubyBody_main
+ * global_name:  nMruby_tMrubyTaskBody_eMrubyBody_main
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+void
+eMrubyBody_main(CELLIDX idx)
+{
+	CELLCB	*p_cellcb;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+  if( cMrubyVM_initialize( ) ){
+    cMrubyVM_run( );
+    cMrubyVM_finalize( );
+  }
+}
+
+/* #[<POSTAMBLE>]#
+ *   ããããä¸ã«éåãå£é¢æ°ãæ¸ãã¾ã
+ * #[</POSTAMBLE>]#*/
Index: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyVM.c
===================================================================
--- asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyVM.c	(revision 374)
+++ asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/nMruby_tMrubyVM.c	(revision 374)
@@ -0,0 +1,252 @@
+/*
+ *  Copyright (C) 2008-2017 by TOPPERS Project
+ *
+ *  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ï½(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+ *  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+ *  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+ *  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+ *      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+ *      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+ *  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+ *      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+ *      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+ *      ã¨ï¼
+ *    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+ *        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+ *        å ±åãããã¨ï¼
+ *  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+ *      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+ *      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+ *      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+ *      å
+è²¬ãããã¨ï¼
+ * 
+ *  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+ *  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+ *  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+ *  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+ *  ã®è²¬ä»»ãè² ããªãï¼
+ * 
+ *  @(#) $Id$
+ */
+
+/* #[<PREAMBLE>]#
+ * #[<...>]# ãã #[</...>]# ã§å²ã¾ããã³ã¡ã³ãã¯ç·¨éããªãã§ãã ãã
+ * tecsmerge ã«ãããã¼ã¸ã«ä½¿ç¨ããã¾ã
+ *
+ * å±æ§ã¢ã¯ã»ã¹ãã¯ã­ #_CAAM_#
+ * irep             uint8_t*         ATTR_irep       
+ * var_irep         mrb_irep*        VAR_var_irep    
+ * mrb              mrb_state*       VAR_mrb         
+ * rproc            struct RProc*    VAR_rproc       
+ *
+ * å¼ã³å£é¢æ° #_TCPF_#
+ * call port: cInit signature: nMruby_sInitializeBridge context:task optional:true
+ *   bool_t     is_cInit_joined()                     check if joined
+ *   void           cInit_initializeBridge( const mrb_state* mrb );
+ * call port: cMalloc signature: sMalloc context:task
+ *   int            cMalloc_initializeMemoryPool( );
+ *   void*          cMalloc_calloc( size_t nelem, size_t elem_size );
+ *   void*          cMalloc_malloc( size_t size );
+ *   void*          cMalloc_realloc( const void* ptr, size_t new_size );
+ *   void           cMalloc_free( const void* ptr );
+ *
+ * #[</PREAMBLE>]# */
+
+/* ãã­ãã¿ã¤ãå®£è¨ãå¤æ°ã®å®ç¾©ãããã«æ¸ãã¾ã #_PAC_# */
+#include "nMruby_tMrubyVM_tecsgen.h"
+#include <string.h>
+
+#include <mruby.h>
+#include <mruby/proc.h>
+#include <mruby/data.h>
+#include <mruby/compile.h>
+#include "t_syslog.h"
+
+MRB_API mrb_state* mrb_open_TECS( CELLCB *p_cellcb);
+
+#ifndef E_OK
+#define	E_OK	0		/* success */
+#define	E_ID	(-18)	/* illegal ID */
+#endif
+
+/* åãå£é¢æ° #_TEPF_# */
+/* #[<ENTRY_PORT>]# eMrubyVM
+ * entry port: eMrubyVM
+ * signature:  nMruby_sMrubyVM
+ * context:    task
+ * #[</ENTRY_PORT>]# */
+
+/* #[<ENTRY_FUNC>]# eMrubyVM_initialize
+ * name:         eMrubyVM_initialize
+ * global_name:  nMruby_tMrubyVM_eMrubyVM_initialize
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+bool_t
+eMrubyVM_initialize(CELLIDX idx)
+{
+	CELLCB	*p_cellcb;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+    return false;
+	} /* end if VALID_IDX(idx) */
+
+  cMalloc_initializeMemoryPool();
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+  /* new interpreter instance */
+  //VAR_mrb = mrb_open();
+  VAR_mrb = mrb_open_TECS(p_cellcb);
+  if (VAR_mrb == NULL) {
+    syslog(LOG_EMERG, "Invalid mrb_state, exiting test driver");
+//    cSerialPort_write("Invalid mrb_state, exiting test driver\n", 39);
+    return false;
+  }
+
+  if(is_cInit_joined()){
+    // TECS Bridge
+    cInit_initializeBridge( VAR_mrb );
+  }
+  VAR_var_irep = mrb_read_irep(VAR_mrb, ATTR_irep);
+  VAR_rproc = mrb_proc_new(VAR_mrb, VAR_var_irep);
+  return true;
+}
+
+/* #[<ENTRY_FUNC>]# eMrubyVM_run
+ * name:         eMrubyVM_run
+ * global_name:  nMruby_tMrubyVM_eMrubyVM_run
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+bool_t
+eMrubyVM_run(CELLIDX idx)
+{
+	CELLCB	*p_cellcb;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+  mrb_run(VAR_mrb, VAR_rproc, mrb_top_self(VAR_mrb));
+  if (VAR_mrb->exc) {
+    mrb_p(VAR_mrb, mrb_obj_value(VAR_mrb->exc));
+    return false;
+  }
+  return true;
+}
+
+/* #[<ENTRY_FUNC>]# eMrubyVM_funcall
+ * name:         eMrubyVM_funcall
+ * global_name:  nMruby_tMrubyVM_eMrubyVM_funcall
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+void
+eMrubyVM_funcall(CELLIDX idx, const char_t* name)
+{
+	CELLCB	*p_cellcb;
+  mrb_int  argc;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+  argc = 0;
+  (void)mrb_funcall(VAR_mrb, mrb_top_self(VAR_mrb), name, argc );
+}
+
+/* #[<ENTRY_FUNC>]# eMrubyVM_finalize
+ * name:         eMrubyVM_finalize
+ * global_name:  nMruby_tMrubyVM_eMrubyVM_finalize
+ * oneway:       false
+ * #[</ENTRY_FUNC>]# */
+void
+eMrubyVM_finalize(CELLIDX idx)
+{
+	CELLCB	*p_cellcb;
+	if (VALID_IDX(idx)) {
+		p_cellcb = GET_CELLCB(idx);
+	}
+	else {
+		/* ã¨ã©ã¼å¦çã³ã¼ããããã«è¨è¿°ãã¾ã */
+	} /* end if VALID_IDX(idx) */
+
+	/* ããã«å¦çæ¬ä½ãè¨è¿°ãã¾ã #_TEFB_# */
+	syslog(LOG_EMERG, "end of mruby program");
+  mrb_close(VAR_mrb);
+}
+
+/* #[<POSTAMBLE>]#
+ *   ããããä¸ã«éåãå£é¢æ°ãæ¸ãã¾ã
+ * #[</POSTAMBLE>]#*/
+
+#include "tlsf.h"
+void*
+mrb_TECS_allocf(mrb_state *mrb, void *p, size_t size, void *ud)
+{
+	CELLCB	*p_cellcb= (CELLCB *)ud;
+  if (size == 0) {
+      cMalloc_free(p);
+      //tlsf_free(p);
+      return NULL;
+  }
+  else if (p){
+      //return tlsf_realloc(p,size);
+      return cMalloc_realloc(p, size);
+  }
+  else {
+      //return tlsf_malloc(size);
+      return cMalloc_malloc(size);
+  }
+}
+
+// p_cellcb ã¯ VM ã®ãã®
+// VM ã»ã«ã¿ã¤ãã«ãå¼ã³å£ call sMalloc cMalloc; ãè¨­ãã
+// mrb_TECS_allocf ãåç
+§
+MRB_API mrb_state*
+mrb_open_TECS( CELLCB *p_cellcb)
+{
+    return mrb_open_allocf(mrb_TECS_allocf, (void *)p_cellcb);
+};
+
+/*** ããã¼é¢æ° ***/
+#ifndef EV3_SOUND
+void _write(){}
+void _close(){}
+void _lseek(){}
+void _read(){}
+//void _fstat(){}
+//void _isatty(){}
+#endif
+
+//void _exit(){}
+//void _getpid(){}
+//void _kill(){}
+void _gettimeofday(){}
+void _fini(){}
+
Index: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/sMruby.cdl
===================================================================
--- asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/sMruby.cdl	(revision 374)
+++ asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/sMruby.cdl	(revision 374)
@@ -0,0 +1,82 @@
+/*
+ *  Copyright (C) 2012 by Ubiquitous Computing and Networking Laboratory
+ *                Ritsumeikan Univ., JAPAN
+ *  ä¸è¨èä½æ¨©è
+ã¯ï¼ä»¥ä¸ã®(1)ï½(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
+ *  ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ãä½¿ç¨ã»è¤è£½ã»æ¹
+ *  å¤ã»åé
+å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
+ *  (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
+ *      æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
+ *      ã¹ã³ã¼ãä¸­ã«å«ã¾ãã¦ãããã¨ï¼
+ *  (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨
+ *      è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
+ *      ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *  (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
+ *      ç¨ã§ããªãå½¢ã§åé
+å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
+ *      ã¨ï¼
+ *    (a) åé
+å¸ã«ä¼´ããã­ã¥ã¡ã³ãï¼å©ç¨è
+ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
+ *        ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
+ *    (b) åé
+å¸ã®å½¢æ
+ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSãã­ã¸ã§ã¯ãã«
+ *        å ±åãããã¨ï¼
+ *  (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
+ *      å®³ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ããå
+è²¬ãããã¨ï¼
+ *      ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
+ *      ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
+ããã³TOPPERSãã­ã¸ã§ã¯ãã
+ *      å
+è²¬ãããã¨ï¼
+ * 
+ *  æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
+ã
+ *  ãã³TOPPERSãã­ã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
+ *  ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
+ *  ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
+ *  ã®è²¬ä»»ãè² ããªãï¼
+ * 
+ *  @(#) $Id$
+ */
+
+namespace nMruby{
+  signature sMrubyVM {
+    /*
+     * åæåãã (ä»¥ä¸ã¾ã§å®äºãã)
+     *   mrb_open
+     *   VM_TECSInitializer  (TECS ããªãã¸ã®åæå)
+     *   mrb_read_irep       (ãã¤ãã³ã¼ãã®ç»é²)
+     */
+    bool_t initialize(void);
+
+    /*
+     * å®è¡ãã
+     * RETURN
+     *   true  æªå¦ç½®ã®ä¾å¤ããªã
+     *   false æªå¦ç½®ã®ä¾å¤ããã
+     *  initialize ã false ãè¿ããå ´åãrun, finalize ãå¼ã³åºãã¦ã¯ãªããªã
+     */
+    bool_t run(void);
+
+    /*
+     * é¢æ°ãå¼ã³ã ã
+     */
+    void funcall( [in,string]const char_t *name );
+
+    /*
+     * çµæåãã
+     *  run ã false ãè¿ããå ´åã§ãå¼ã³ã ããã¨
+     */
+    void finalize(void);
+
+  };
+};
Index: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/tecs_mruby.h
===================================================================
--- asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/tecs_mruby.h	(revision 352)
+++ asp3_tinet_ecnl_arm/trunk/asp3_dcre/tecsgen/tecs/mruby/tecs_mruby.h	(revision 374)
@@ -1,4 +1,4 @@
 /*
- *  Copyright (C) 2008-2017 by TOPPERS Project
+ *  Copyright (C) 2008-2019 by TOPPERS Project
  *
  *  上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -46,30 +46,14 @@
 #include "mruby/irep.h"
 #include "mruby/dump.h"
+#include "mruby/proc.h"
 
 #include "TECSPointer.h"
 #include "TECSStruct.h"
 
-#if  ! defined( MRUBY_RELEASE_MAJOR ) || MRUBY_RELEASE_MAJOR == 1 && MRUBY_RELEASE_MINOR < 2
-#ifndef MRB_ARGS_REQ
-#define MRB_ARGS_REQ(n)     ARGS_REQ(n)
-#define MRB_ARGS_OPT(n)     ARGS_OPT(n)
-#define MRB_ARGS_ARG(n1,n2) ARGS_ARG(n1,n2)
-#define MRB_ARGS_REST()     ARGS_REST()
-#define MRB_ARGS_POST(n)    ARGS_POST(n)
-#define MRB_ARGS_KEY(n1,n2) ARGS_KEY(n1,n2)
-#define MRB_ARGS_BLOCK()    ARGS_BLOCK()
-#define MRB_ARGS_ANY()      ARGS_ANY()
-#define MRB_ARGS_NONE()     ARGS_NONE()
-#endif /* MRB_ARGS_REQ */
-#endif
 
-#if  ! defined( MRUBY_RELEASE_MAJOR )
-#define mrb_float_value( mrb, val )  mrb_float_value( val )
-#endif
-
-#else
+#else /* TECSGEN */
 
 /*
- * fake tecsgen because tecsgen cannot accept actual mruby.h in case of below.
+ * fake definition because tecsgen cannot accept actual mruby.h in case of below.
  *   types:   long long, long long int
  *   special keyword __attribute__(x), __extension__
@@ -78,8 +62,15 @@
 typedef int mrb_irep;
 typedef int mrb_context;
-struct  RClass {int dummy;};
-struct  RProc  {int dummy;};
+struct  RClass {uint32_t gcnext;};  // actual definition: struct RBasic *gcnext
+struct  RProc  {uint32_t gcnext;};  // actual definition: struct RBasic *gcnext
 
 typedef int CELLCB;
+
+#define GET_SET_BOOL( Type, type )
+#define GET_SET_CHAR( Type, type )
+#define GET_SET_INT( Type, type )
+#define GET_SET_FLOAT( Type, type )
+#define POINTER_CLASS( Type, type )
+#define CHECK_AND_GET_POINTER( Type, type )
 
 #endif /* TECSGEN */
