Index: /trunk/softs/tsar_boot/include/io.h
===================================================================
--- /trunk/softs/tsar_boot/include/io.h	(revision 654)
+++ /trunk/softs/tsar_boot/include/io.h	(revision 655)
@@ -60,5 +60,3 @@
 }
 
-#undef in_reset
-
 #endif
Index: /trunk/softs/tsar_boot/include/reset_utils.h
===================================================================
--- /trunk/softs/tsar_boot/include/reset_utils.h	(revision 654)
+++ /trunk/softs/tsar_boot/include/reset_utils.h	(revision 655)
@@ -10,4 +10,7 @@
 #include <elf-types.h>
 #include <reset_tty.h>
+#include <defs_platform.h>
+#include <mcc.h>
+#include <io.h>
 
 extern unsigned int proctime();
Index: /trunk/softs/tsar_boot/src/reset_utils.c
===================================================================
--- /trunk/softs/tsar_boot/src/reset_utils.c	(revision 654)
+++ /trunk/softs/tsar_boot/src/reset_utils.c	(revision 655)
@@ -35,5 +35,6 @@
     unsigned int *dst = _dst;
     const unsigned int *src = _src;
-    if ( ! ((unsigned int)dst & 3) && ! ((unsigned int)src & 3) )
+    if ( !((unsigned int)dst & 3) && !((unsigned int)src & 3) )
+    {
         while (size > 3) 
         {
@@ -41,4 +42,5 @@
             size -= 4;
         }
+    }
 
     unsigned char *cdst = (unsigned char*) dst;
@@ -64,7 +66,31 @@
 void * memset(void *_dst, const int value, unsigned int size)
 {
-    char * dst = (char *) _dst;
+    unsigned char val = (unsigned char) value;
+    int word = (val << 24) || (val << 16) ||
+               (val << 8 ) || (val      );
 
-    while(size--) *dst++ = (char) value;
+    /*
+     * Write 4 bytes when destination buffer is aligned to 4 bytes
+     * and size is greater or equal to 4 
+     */
+    unsigned int *dst = _dst;
+    if ( !((unsigned int)dst & 3) )
+    {
+        while (size > 3) 
+        {
+            *dst++ = word;
+            size -= 4;
+        }
+    }
+
+    /*
+     * Write 1 byte when destination buffer is not aligned to 4 bytes
+     * or size is smaller than 4 
+     */
+    char* cdst = (char*) _dst;
+    while(size--)
+    {
+        *cdst++ = (char) value;
+    }
 
     return _dst;
@@ -158,6 +184,6 @@
     }
 
-#if USE_IOB 
-    reset_mcc_invalidate(buffer, count * 512);
+#if USE_IOB
+    reset_mcc_invalidate(buffer, size);
 #endif
 }
