- Timestamp:
- Mar 5, 2014, 1:13:22 AM (11 years ago)
- Location:
- trunk/softs/tsar_boot
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/tsar_boot/include/io.h
r653 r655 60 60 } 61 61 62 #undef in_reset63 64 62 #endif -
trunk/softs/tsar_boot/include/reset_utils.h
r653 r655 10 10 #include <elf-types.h> 11 11 #include <reset_tty.h> 12 #include <defs_platform.h> 13 #include <mcc.h> 14 #include <io.h> 12 15 13 16 extern unsigned int proctime(); -
trunk/softs/tsar_boot/src/reset_utils.c
r653 r655 35 35 unsigned int *dst = _dst; 36 36 const unsigned int *src = _src; 37 if ( ! ((unsigned int)dst & 3) && ! ((unsigned int)src & 3) ) 37 if ( !((unsigned int)dst & 3) && !((unsigned int)src & 3) ) 38 { 38 39 while (size > 3) 39 40 { … … 41 42 size -= 4; 42 43 } 44 } 43 45 44 46 unsigned char *cdst = (unsigned char*) dst; … … 64 66 void * memset(void *_dst, const int value, unsigned int size) 65 67 { 66 char * dst = (char *) _dst; 68 unsigned char val = (unsigned char) value; 69 int word = (val << 24) || (val << 16) || 70 (val << 8 ) || (val ); 67 71 68 while(size--) *dst++ = (char) value; 72 /* 73 * Write 4 bytes when destination buffer is aligned to 4 bytes 74 * and size is greater or equal to 4 75 */ 76 unsigned int *dst = _dst; 77 if ( !((unsigned int)dst & 3) ) 78 { 79 while (size > 3) 80 { 81 *dst++ = word; 82 size -= 4; 83 } 84 } 85 86 /* 87 * Write 1 byte when destination buffer is not aligned to 4 bytes 88 * or size is smaller than 4 89 */ 90 char* cdst = (char*) _dst; 91 while(size--) 92 { 93 *cdst++ = (char) value; 94 } 69 95 70 96 return _dst; … … 158 184 } 159 185 160 #if USE_IOB 161 reset_mcc_invalidate(buffer, count * 512);186 #if USE_IOB 187 reset_mcc_invalidate(buffer, size); 162 188 #endif 163 189 }
Note: See TracChangeset
for help on using the changeset viewer.