Index: /soft/giet_vm/Makefile
===================================================================
--- /soft/giet_vm/Makefile	(revision 177)
+++ /soft/giet_vm/Makefile	(revision 178)
@@ -43,6 +43,5 @@
 				mwmr_channel.o \
 				barrier.o \
-				spin_lock.o \
-				common.o
+				spin_lock.o 
 
 LIB_OBJS	= $(patsubst %,$(LIB_DIR)/%,$(LIB_OBJS_LIST))
Index: /soft/giet_vm/apps/compile.mk
===================================================================
--- /soft/giet_vm/apps/compile.mk	(revision 177)
+++ /soft/giet_vm/apps/compile.mk	(revision 178)
@@ -10,6 +10,6 @@
 
 %.o: %.c 
-	$(CC)  $(APP_INCLUDE) $(CFLAGS) -c -o  $@ $<
-	$(DU) -D  $@ >  $@.txt
+	$(CC)	$(APP_INCLUDE) $(CFLAGS) -I. -c -o  $@ $<
+	$(DU) 	-D  $@	>  $@.txt
 
 clean:
Index: ft/giet_vm/libs/common.c
===================================================================
--- /soft/giet_vm/libs/common.c	(revision 177)
+++ 	(revision )
@@ -1,28 +1,0 @@
-/////////////////////////////////////////////////////////////
-void *memcpy(void *_dst, const void *_src, unsigned int size)
-{
-    unsigned int *dst = _dst;
-    const unsigned int *src = _src;
-    if ( ! ((unsigned int)dst & 3) && ! ((unsigned int)src & 3) )
-        while (size > 3) {
-            *dst++ = *src++;
-            size -= 4;
-        }
-
-    unsigned char *cdst = (unsigned char*)dst;
-    unsigned char *csrc = (unsigned char*)src;
-
-    while (size--) {
-        *cdst++ = *csrc++;
-    }
-    return _dst;
-}
-
-//////////////////////////////////////////////////////////
-inline void * memset(void *dst, int s, unsigned int count)
-{
-	char *a = (char *) dst;
-	while (count--)
-		*a++ = (char)s;
-	return dst;
-}
Index: /soft/giet_vm/libs/common.h
===================================================================
--- /soft/giet_vm/libs/common.h	(revision 177)
+++ /soft/giet_vm/libs/common.h	(revision 178)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////////
-// File     : common.h         
-// Date     : 20/07/2012
-// Author   : mohamed karaoui
+// File         : common.h         
+// Date         : 20/07/2012
+// Maintener    : mohamed karaoui
 // Copyright (c) UPMC-LIP6
 ///////////////////////////////////////////////////////////////////////////////////
@@ -8,4 +8,43 @@
 #ifndef _COMMON_H_
 #define _COMMON_H_
+
+/*
+ * memcpy, memset function
+ * This function is required because it can be gnerated by GCC 
+ * during compilation so we must provide it.
+ * Code taken from MutekH.
+ */
+//////////////////////////////////////////////////////////////////////////
+static inline void *memcpy(void *_dst, const void *_src, unsigned int size)
+{
+    unsigned int *dst = _dst;
+    const unsigned int *src = _src;
+
+    /* if source and destination buffer are word-aligned,
+     * then copy word-by-word */
+    if (!((unsigned int)dst & 3) && !((unsigned int)src & 3))
+        while (size > 3) {
+            *dst++ = *src++;
+            size -= 4;
+        }
+
+    unsigned char *cdst = (unsigned char*)dst;
+    unsigned char *csrc = (unsigned char*)src;
+
+    /* byte-by-byte copy */
+    while (size--) {
+        *cdst++ = *csrc++;
+    }
+    return _dst;
+}
+
+//////////////////////////////////////////////////////////
+static inline void * memset(void *dst, int s, unsigned int count)
+{
+	char *a = (char *) dst;
+	while (count--)
+		*a++ = (char)s;
+	return dst;
+}
 
 /**
@@ -26,5 +65,4 @@
    Taken from Mutekh(SRL API)
  */
-
 static inline void __abort()
 {
@@ -33,15 +71,3 @@
 }
 
-////////////////////////////////////////////////////////////////////////////////////////
-//  mempcy()
-// GCC may requires this function. Taken from MutekH.
-////////////////////////////////////////////////////////////////////////////////////////
-void *memcpy(void *_dst, const void *_src, unsigned int size);
-
-////////////////////////////////////////////////////////////////////////////////////////
-//  memset()
-// GCC may requires this function. Taken from MutekH.
-////////////////////////////////////////////////////////////////////////////////////////
-inline void * memset(void *dst, int s, unsigned int count);
-
 #endif /* _COMMON_H_ */
Index: /soft/giet_vm/libs/libsrl/srl_args.h
===================================================================
--- /soft/giet_vm/libs/libsrl/srl_args.h	(revision 178)
+++ /soft/giet_vm/libs/libsrl/srl_args.h	(revision 178)
@@ -0,0 +1,31 @@
+#ifndef SRL_ARGS_H
+#define SRL_ARGS_H
+
+
+
+#define SRL_GET_MWMR(port)      APP_GET_ARG(port, VOBJ_TYPE_MWMR)
+#define SRL_GET_BARRIER(port)   APP_GET_ARG(port, VOBJ_TYPE_BARRIER)
+#define SRL_GET_LOCK(port)      APP_GET_ARG(port, VOBJ_TYPE_LOCK)
+#define SRL_GET_BUFFER(port)    APP_GET_ARG(port, VOBJ_TYPE_BUFFER)
+
+
+/* port, APP_NAME, TASK, #task_name, alias */
+# define SRL_GET_ARG(task_name, port, type)                                                         \
+({                                                                                                  \
+    srl_mwmr_t  _mwmr;                                                                              \
+    if( giet_vobj_get_vbase( APP_NAME , alias_##task_name.port, type, (unsigned int*)&_mwmr ) )     \
+    {                                                                                               \
+        srl_log_printf( NONE, "\n[ERROR] in "#task_name" task :\n");                                \
+        srl_log_printf( NONE, "          undefined port <"#port"> for channel(%s): %d\n",           \
+                                                                alias_##task_name.port,_mwmr);      \
+        srl_log_printf( TRACE, "*** &"#port" = %x\n\n", (unsigned int)_mwmr );                      \
+        srl_exit();                                                                                 \
+    }else                                                                                           \
+        srl_log_printf( TRACE, "%s:%d: arg of %s for %s,from %s; &"#port" = %x\n\n",                \
+                            __FILE__, __LINE__, APP_NAME, #task_name,#port, (unsigned int)_mwmr );  \
+    _mwmr;\
+})
+
+
+
+#endif
Index: ft/giet_vm/libs/libsrl/srl_barrier.c
===================================================================
--- /soft/giet_vm/libs/libsrl/srl_barrier.c	(revision 177)
+++ 	(revision )
@@ -1,60 +1,0 @@
-#include "srl_barrier.h"
-/*
-int srl_barrier_init(srl_barrier_t barrier)
-{
-
-    register int* pinit 	= (int*)&barrier->init_val;
-    register int* pcount 	= (int*)&barrier->count;
-
-    // parallel initialisation using atomic instructions LL/SC
-    asm volatile ("_barrier_init_test:          	\n"
-                  "ll   $2,     0(%0)           	\n"	// read initial value
-                  "bnez $2,     _barrier_init_done	\n"
-                  "move $3,     %2			\n"
-                  "sc   $3,     0(%0)    	      	\n"	// try to write initial value
-                  "beqz $3,     _barrier_init_test	\n"
-                  "move $3,	%2			\n"
-                  "sw   $3,	0(%1)			\n"	// write count
-				  "sync"
-                  "_barrier_init_done:			\n"
-                  ::"r"(pinit),"r"(pcount),"r"(value):"$2","$3");
-    return 0 ;
-}
-*/
-
-void srl_barrier_wait( srl_barrier_t barrier)
-{
-    register int* pcount 	= (int*)&barrier->count;
-    register int  maxcount 	= (int)barrier->init_val;
-    register int  count;
-
-    // parallel decrement barrier counter using atomic instructions LL/SC
-    // input : pointer on the barrier counter 
-    // output : counter value 
-    asm volatile ("_barrier_decrement:          		\n"
-                  "ll   %0,     0(%1)           		\n"
-                  "addi $3,     %0,     -1      		\n"
-                  "sc   $3,     0(%1)           		\n"
-                  "beqz $3,     _barrier_decrement		\n"
-                  :"=r"(count):"r"(pcount):"$2","$3");
-
-    // the last task re-initializes the barrier counter 
-    // to the max value, waking up all other waiting tasks
-
-//TODO:check it out
-    if ( count == 0 ) 	 // last task
-    {
-        //*pcount = maxcount;
-		asm volatile( "sw %0,	(%1)\n"
-					  "sync			\n"
-					  ::"r"(maxcount),"r"(pcount));
-        return ;
-    }
-    else 		// other tasks
-    {
-//        while ( *pcount != maxcount ) 	{ }	// busy waiting 
-		srl_sched_wait_eq(pcount, maxcount);	// busy waiting 
-        return ;
-    }
-
-}
Index: /soft/giet_vm/libs/libsrl/srl_barrier.h
===================================================================
--- /soft/giet_vm/libs/libsrl/srl_barrier.h	(revision 177)
+++ /soft/giet_vm/libs/libsrl/srl_barrier.h	(revision 178)
@@ -6,5 +6,4 @@
  * License.
  * 
- * Copyright (c) 2006, Nicolas Pouillon, <nipo@ssji.net>
  *     Laboratoire d'informatique de Paris 6 / ASIM, France
  * 
@@ -21,22 +20,10 @@
  */
 
-#include "stdio.h"
-#include "srl_log.h"
-#include "srl_sched_wait.h"
+#include "barrier.h"
 
 
-typedef struct srl_abstract_barrier_s
-{
-	unsigned int init_val;
-	unsigned int count;
-	
-} srl_barrier_s;
+typedef giet_barrier_t *srl_barrier_t;
 
-# define SRL_BARRIER_INITIALIZER(n){ .init_val=(n) , .count =(n)}
-
-typedef srl_barrier_s *srl_barrier_t;
-
-void srl_barrier_wait( srl_barrier_t barrier );
-
+#define srl_barrier_wait(bar) barrier_wait(bar)
 
 #endif
Index: /soft/giet_vm/libs/libsrl/srl_hw_helpers.h
===================================================================
--- /soft/giet_vm/libs/libsrl/srl_hw_helpers.h	(revision 177)
+++ /soft/giet_vm/libs/libsrl/srl_hw_helpers.h	(revision 178)
@@ -9,12 +9,4 @@
 
 #include "stdio.h"
-
-typedef struct __ldscript_symbol_s __ldscript_symbol_t;
-
-#define BASE_ADDR_OF(id) 									   \
-	({																   \
-		extern __ldscript_symbol_t _dsx_##id##_region_begin;		   \
-		(void*)&_dsx_##id##_region_begin;								   \
-	})
 
 
@@ -62,6 +54,4 @@
    @return Cycles from the initialization of the system
  */
-
-//static: to avoid multiple definition error
 static inline unsigned int srl_cycle_count()
 {
Index: ft/giet_vm/libs/libsrl/srl_lock.c
===================================================================
--- /soft/giet_vm/libs/libsrl/srl_lock.c	(revision 177)
+++ 	(revision )
@@ -1,46 +1,0 @@
-#include "srl_lock.h"
-
-int srl_lock_lock(srl_lock_t slock )
-{
-   register int delay= rand();
-
-    asm volatile ("_locks_llsc:			        \n"
-                  "ll   $2,    0(%0)		    \n"	// $2 <= _locks_lock
-                  "bnez $2,    _locks_delay	    \n" // random delay if busy
-                  "li   $3,    1   			    \n"	// prepare argument for sc  
-                  "sc   $3,    0(%0)       	    \n" // try to set _locks_busy
-                  "bnez $3,    _locks_ok     	\n" // exit if atomic 
-                  "_locks_delay:				\n"
-                  "move $4,    %1			    \n"	// $4 <= delay
-                  "_locks_loop:				    \n"
-                  "addi $4,    $4,    -1	    \n"	// $4 <= $4 - 1
-                  "beqz $4,    _locks_loop	    \n"	// test end delay
-                  "j           _locks_llsc    	\n"	// retry
-                  "_locks_ok:			            \n"
-                  ::"r"(&(slock.lock)),"r"(delay):"$2","$3","$4");
-    return 0;
-}
-
-void srl_lock_unlock( srl_lock_t slock )
-{
-	asm volatile( "sw $0,	(%0)\n"
-				  "sync			  "
-				  ::"r"(&(slock.lock)));
-}
-
-int srl_lock_try_lock( srl_lock_t slock )
-{
-	register int ret = 0;	
-	asm volatile ("ll   $2,    0(%1)		    \n"	// $2 <= _locks_lock
-                  "bnez $2,    _lock_done	    \n" // exitif busy
-                  "li   $3,    1   			    \n"	// prepare argument for sc  
-                  "sc   $3,    0(%1)       	    \n" // try to set _locks_busy
-                  "add  %0, $0, $3       	    \n" // ret(exit) value
-                  "_lock_done:			        \n"
-                  :"=r"(ret)
-                  :"r"(&(slock.lock))
-                  :"$2","$3");
-    return ret;
-}
-
-
Index: /soft/giet_vm/libs/libsrl/srl_lock.h
===================================================================
--- /soft/giet_vm/libs/libsrl/srl_lock.h	(revision 177)
+++ /soft/giet_vm/libs/libsrl/srl_lock.h	(revision 178)
@@ -21,12 +21,7 @@
  */
 
-#include "srl_public_types.h"
-#include "stdio.h"
+#include "spin_lock.h"
 
-typedef struct {
-	unsigned int lock;
-}srl_lock_t;
-
-#define SRL_LOCK_INITIALIZER { 0 }
+typedef giet_lock_t* srl_lock_t;
 
 /**
@@ -35,12 +30,12 @@
    @param lock The lock object
  */
-int srl_lock_lock( srl_lock_t lock );
+#define srl_lock_lock(lock) lock_acquire(lock);
 
 /**
-   @this releases a l-ock.
+   @this releases a lock.
 
    @param lock The lock object
  */
-void srl_lock_unlock( srl_lock_t lock );
+#define srl_lock_unlock( lock ) lock_release(lock);
 
 /**
@@ -51,5 +46,5 @@
    @return 0 if the lock was taken successfully
  */
-int srl_lock_try_lock( srl_lock_t lock );
+#define srl_lock_try_lock( lock ) lock_try_acquire( lock );
 
 #endif
Index: /soft/giet_vm/libs/libsrl/srl_memspace.h
===================================================================
--- /soft/giet_vm/libs/libsrl/srl_memspace.h	(revision 177)
+++ /soft/giet_vm/libs/libsrl/srl_memspace.h	(revision 178)
@@ -8,30 +8,9 @@
  */
 
-/**
-   @internal
- */
-typedef struct srl_memspace_s {
-	void *buffer;
-	uint32_t size;
-} srl_memspace_s;
 
 /**
    The memspace abstract type.
  */
-typedef struct srl_memspace_s *srl_memspace_t;
-
-#define SRL_MEMSPACE_INITIALIZER( b, s ) \
-{\
-	.buffer = b,\
-		 .size = s,\
-		 }
-
-/**
-   @this retrieves the base address of a memspace
-
-   @param memsp The memspace
-   @return the base address of the memspace
- */
-#define SRL_MEMSPACE_ADDR(memsp) ((memsp)->buffer)
+typedef void* srl_memspace_t;
 
 /**
Index: /soft/giet_vm/libs/libsrl/srl_mwmr.h
===================================================================
--- /soft/giet_vm/libs/libsrl/srl_mwmr.h	(revision 177)
+++ /soft/giet_vm/libs/libsrl/srl_mwmr.h	(revision 178)
@@ -6,16 +6,6 @@
 typedef  mwmr_channel_t* srl_mwmr_t;
 
-#define srl_mwmr_write mwmr_write
-#define srl_mwmr_read mwmr_read  
-
-
-
-
-
-
-
-
-
-
+#define srl_mwmr_write(a, b, c) mwmr_write(a, b, c)
+#define srl_mwmr_read(a, b, c) mwmr_read(a, b, c)  
 
 
Index: /soft/giet_vm/libs/libsrl/srl_private_types.h
===================================================================
--- /soft/giet_vm/libs/libsrl/srl_private_types.h	(revision 177)
+++ /soft/giet_vm/libs/libsrl/srl_private_types.h	(revision 178)
@@ -8,87 +8,5 @@
  */
 
-#include "stdio.h"
-#include "srl_barrier.h"
-#include "srl_public_types.h"
 
-#define TTY_INC 16
-
-/**
-   A numeric constant holder
- */
-typedef unsigned int srl_const_t;
-#define SRL_CONST_INITIALIZER(x) x
-
-typedef void srl_task_func_t( void* );
-
-typedef struct srl_abstract_task_s {
-	srl_task_func_t *bootstrap;
-	srl_task_func_t *func;
-	void *args;
-	void *stack;
-	size_t stack_size;
-	const char *name;
-//	uint32_t context[CONTEXT_WSIZE];
-	sint32_t wait_val;
-	void *wait_addr;
-	size_t tty_addr;
-}srl_task_s;
-
-#define SRL_TASK_INITIALIZER(b, f, ss, s, a, n, ttyc, ttyn)	\
-	{														\
-		.bootstrap = (srl_task_func_t *)b,					\
-		.func = (srl_task_func_t *)f,						\
-		.args = (void*)a,									\
-		.stack = (void*)s,									\
-		.stack_size = ss,									\
-		.name = n,											\
-		.tty_addr = (size_t)ttyc + (ttyn * TTY_INC),		\
-	}
-
-
-typedef struct srl_abstract_cpudesc_s srl_cpudesc_s;
-struct srl_abstract_cpudesc_s {
-	const size_t ntasks;
-	const srl_task_s * const *task_list;
-	size_t tty_addr;
-};
-
-#define SRL_CPUDESC_INITIALIZER(nt, tl, ttyc, ttyn)	\
-	{												\
-		.ntasks = nt,								\
-		.task_list = tl,							\
-		.tty_addr = (size_t)ttyc + (ttyn * TTY_INC),\
-	}
-
-typedef struct srl_abstract_appdesc_s srl_appdesc_s;
-struct srl_abstract_appdesc_s {
-	const size_t ntasks;
-	srl_barrier_s *start;
-	const struct srl_mwmr_s * const *mwmr;
-	const srl_cpudesc_s * const *cpu;
-	const srl_task_s * const *task;
-	size_t tty_addr;
-};
-
-#define SRL_APPDESC_INITIALIZER(nt, cl, ml, tl, sb, ttyc, ttyn) \
-	{														   \
-		.ntasks = nt,										   \
-		.cpu = cl,										       \
-		.mwmr = ml,										       \
-		.task = tl,										       \
-		.start = sb,										   \
-		.tty_addr = (size_t)ttyc + (ttyn * TTY_INC),						\
-	}
-
-//needed by gcc
-void *memcpy(void *_dst, const void *_src, unsigned int size);
-void * memset(void *dst, int data, size_t size);
-
-
-/**
- * All function needed by kmain has to be tagged with in_srl_main
- * typically: srl_mwmw_sys
- */
-#define in_srl_main __attribute__((section (".srl_main")))
 
 /**
@@ -97,5 +15,3 @@
 #define cpu_mem_write_32(addr, data) *((volatile uint32_t*)(addr)) = data 
 
-#define uintptr_t unsigned int
-
 #endif
Index: /soft/giet_vm/libs/libsrl/srl_sched_wait.c
===================================================================
--- /soft/giet_vm/libs/libsrl/srl_sched_wait.c	(revision 177)
+++ /soft/giet_vm/libs/libsrl/srl_sched_wait.c	(revision 178)
@@ -17,5 +17,4 @@
  *
  * Copyright (c) UPMC, Lip6, SoC
- *         Nicolas Pouillon <nipo@ssji.net>, 2008
  */
 
@@ -27,15 +26,15 @@
 #define endian_cpu32(x) (x)
 
-#define DECLARE_WAIT(name, cmp)                                              \
-                                                                                         \
-    void srl_sched_wait_##name( void *addr, sint32_t val )				\
-    {			                                                                        \
-		dcache_flush(addr, sizeof(addr));												\
-        if ( ((sint32_t)*((unsigned int *)addr)) cmp val )			\
-        return;                                                                          \
-        do {                                                                             \
-            context_switch();															\
-			dcache_flush(addr, sizeof(addr));											\
-        } while (((sint32_t)*((unsigned int*)addr)) cmp val );		\
+#define DECLARE_WAIT(name, cmp)                                 \
+                                                                \
+    void srl_sched_wait_##name( void *addr, sint32_t val )		\
+    {			                                                \
+		srl_dcache_flush_addr(addr);							\
+        if ( ((sint32_t)*((unsigned int *)addr)) cmp val )		\
+        return;                                                 \
+        do {                                                    \
+            srl_sched_wait_priv(100);??							\
+			srl_dcache_flush_addr(addr);						\
+        } while (((sint32_t)*((unsigned int*)addr)) cmp val );	\
     }
 
@@ -54,4 +53,5 @@
 DECLARE_WAIT(gt, >)
 
+//TODO
 void srl_sched_wait_priv(uint32_t date )
 {
Index: /soft/giet_vm/libs/mwmr_channel.c
===================================================================
--- /soft/giet_vm/libs/mwmr_channel.c	(revision 177)
+++ /soft/giet_vm/libs/mwmr_channel.c	(revision 178)
@@ -74,7 +74,7 @@
 // after a random delay.
 //////////////////////////////////////////////////////////////////////////////
-void mwmr_write( mwmr_channel_t* 	mwmr, 
-                 unsigned int*		buffer,
-                 unsigned int 		nitems )
+void mwmr_write( mwmr_channel_t* 	    mwmr, 
+                 const unsigned int*	buffer,
+                 unsigned int 		    nitems )
 {
     unsigned int	x;
Index: /soft/giet_vm/libs/mwmr_channel.h
===================================================================
--- /soft/giet_vm/libs/mwmr_channel.h	(revision 177)
+++ /soft/giet_vm/libs/mwmr_channel.h	(revision 178)
@@ -29,7 +29,7 @@
 //////////////////////////////////////////////////////////////////////////////
 
-void mwmr_write( mwmr_channel_t* 	mwmr, 
-                 unsigned int*		buffer,
-                 unsigned int 		nitems );
+void mwmr_write( mwmr_channel_t* 	    mwmr, 
+                 const unsigned int*	buffer,
+                 unsigned int 		    nitems );
 
 void mwmr_read( mwmr_channel_t* 	mwmr, 
Index: /soft/giet_vm/libs/spin_lock.c
===================================================================
--- /soft/giet_vm/libs/spin_lock.c	(revision 177)
+++ /soft/giet_vm/libs/spin_lock.c	(revision 178)
@@ -10,12 +10,11 @@
 // It is a simple binary lock, without waiting queue.
 // 
-// The lock_acquire() and lock_release() functions do not require a system call.
-// The barrier itself must have been allocated in a non cacheable segment,
-// if the platform does not provide hardwate cache coherence.
+// The lock_acquire(), lock_try_acquire() and lock_release() functions do 
+// not require a system call.
 //
 // ALL locks must be defined in the mapping_info data structure, 
 // to be initialised by the GIET in the boot phase.
 // The vobj_get_vbase() system call (defined in stdio.c and stdio.h files)
-// can be used to get the virtual base address of the lock fro it's name.
+// can be used to get the virtual base address of the lock from it's name.
 ///////////////////////////////////////////////////////////////////////////////////
 
@@ -65,2 +64,21 @@
 }
 
+//////////////////////////////////////////////////////////////////////////////
+// lock_try_acquire()
+//////////////////////////////////////////////////////////////////////////////
+int lock_try_acquire( giet_lock_t* lock )
+{
+	register int ret = 0;	
+    register unsigned int*	plock = &lock->value;
+
+	asm volatile ("ll   $2,    0(%1)		    \n"	// $2 <= _locks_lock
+                  "bnez $2,    _lock_done	    \n" // exitif busy
+                  "li   $3,    1   			    \n"	// prepare argument for sc  
+                  "sc   $3,    0(%1)       	    \n" // try to set _locks_busy
+                  "xori %0, $3, 1       	    \n" // ret = !$3
+                  "_lock_done:			        \n"
+                  :"=r"(ret)
+                  :"r"(plock)
+                  :"$2","$3");
+    return ret;
+}
Index: /soft/giet_vm/libs/spin_lock.h
===================================================================
--- /soft/giet_vm/libs/spin_lock.h	(revision 177)
+++ /soft/giet_vm/libs/spin_lock.h	(revision 178)
@@ -27,4 +27,7 @@
 void lock_release( giet_lock_t* lock );
 
+// return 0 if success
+int lock_try_acquire( giet_lock_t* lock );
+
 #endif
 
Index: /soft/giet_vm/libs/srl.h
===================================================================
--- /soft/giet_vm/libs/srl.h	(revision 177)
+++ /soft/giet_vm/libs/srl.h	(revision 178)
@@ -19,24 +19,8 @@
 #include "libsrl/srl_hw_helpers.h"
 
+#include "libsrl/srl_args.h"
+
 //kernel use!
 //#include "libsrl/srl_mwmr_sys.h"
-
-#define GET_MWMR(port) GET_ARG(port, VOBJ_TYPE_MWMR)
-/* port, APP_NAME, TASK, #task_name, alias */
-# define SRL_GET_ARG(task_name, port, type)                                                                       \
-({                                                                                            \
-    srl_mwmr_t  _mwmr;                                                                      \
-    if( giet_vobj_get_vbase( APP_NAME , alias_##task_name.port, type, (unsigned int*)&_mwmr ) )                   \
-    {                                                                                         \
-        srl_log_printf( NONE, "\n[ERROR] in "#task_name" task :\n");                              \
-        srl_log_printf( NONE, "          undefined port <"#port"> for channel(%s): %d\n", alias_##task_name.port,_mwmr);           \
-        srl_log_printf( TRACE, "*** &"#port" = %x\n\n", (unsigned int)_mwmr );                 \
-        srl_exit();                                                                     \
-    }else                                                                                         \
-        srl_log_printf( TRACE, "%s:%d: arg of %s for %s,from %s; &"#port" = %x\n\n", __FILE__, __LINE__, APP_NAME, #task_name,#port, (unsigned int)_mwmr ); \
-    _mwmr;\
-})
-
-
 
 
Index: /soft/giet_vm/libs/stdio.h
===================================================================
--- /soft/giet_vm/libs/stdio.h	(revision 177)
+++ /soft/giet_vm/libs/stdio.h	(revision 178)
@@ -10,4 +10,5 @@
 
 #include <mapping_info.h>
+#include <common.h>
 
 /* MIPS32 related functions */
@@ -66,33 +67,4 @@
 unsigned int giet_procnumber();
 
-/*
- * memcpy function
- * This function is required because it can be gnerated by GCC 
- * during compilation so we must provide it.
- * Code taken from MutekH.
- */
-static inline void *memcpy(void *_dst, const void *_src, unsigned int size)
-{
-    unsigned int *dst = _dst;
-    const unsigned int *src = _src;
-
-    /* if source and destination buffer are word-aligned,
-     * then copy word-by-word */
-    if (!((unsigned int)dst & 3) && !((unsigned int)src & 3))
-        while (size > 3) {
-            *dst++ = *src++;
-            size -= 4;
-        }
-
-    unsigned char *cdst = (unsigned char*)dst;
-    unsigned char *csrc = (unsigned char*)src;
-
-    /* byte-by-byte copy */
-    while (size--) {
-        *cdst++ = *csrc++;
-    }
-    return _dst;
-}
 
 #endif
-
