Changeset 271 for soft/giet_vm/giet_libs
- Timestamp:
- Jan 17, 2014, 11:49:27 PM (11 years ago)
- Location:
- soft/giet_vm/giet_libs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/srl.h
r258 r271 10 10 #include "mapping_info.h" 11 11 #include "stdio.h" 12 #include " utils.h"12 #include "stdlib.h" 13 13 14 14 #include "libsrl/srl_public_types.h" -
soft/giet_vm/giet_libs/stdio.c
r267 r271 13 13 #include <stdio.h> 14 14 #include <giet_config.h> 15 16 15 17 16 //////////////////////////////////////////////////////////////////////////////////// … … 823 822 } 824 823 } 825 ///////////////////////////////////////////////////////////////////////////////////826 // memcpy()827 ///////////////////////////////////////////////////////////////////////////////////828 inline void* memcpy( void* dest,829 const void* source,830 unsigned int size )831 {832 unsigned int* dst = dest;833 const unsigned int* src = source;834 835 // word-by-word copy836 if (!((unsigned int) dst & 3) && !((unsigned int) src & 3))837 {838 while (size > 3)839 {840 *dst++ = *src++;841 size -= 4;842 }843 }844 845 unsigned char * cdst = (unsigned char *) dst;846 unsigned char * csrc = (unsigned char *) src;847 848 /* byte-by-byte copy */849 while (size--)850 {851 *cdst++ = *csrc++;852 }853 return dest;854 }855 824 856 825 // Local Variables: -
soft/giet_vm/giet_libs/stdlib.c
r259 r271 5 5 // Copyright (c) UPMC-LIP6 6 6 /////////////////////////////////////////////////////////////////////////////////// 7 8 #include <stdlib.h> 7 9 8 10 /////////////////////////////////////////////////////////////////////////////////// … … 31 33 } 32 34 35 //////////////////////////////////////////////////////////////////////////////////////// 36 // mempcy() 37 // GCC requires this function. Taken from MutekH. 38 //////////////////////////////////////////////////////////////////////////////////////// 39 void * memcpy(void *_dst, const void * _src, unsigned int size) { 40 unsigned int * dst = _dst; 41 const unsigned int * src = _src; 42 if (!((unsigned int) dst & 3) && !((unsigned int) src & 3) ) 43 while (size > 3) { 44 *dst++ = *src++; 45 size -= 4; 46 } 47 48 unsigned char *cdst = (unsigned char*)dst; 49 unsigned char *csrc = (unsigned char*)src; 50 51 while (size--) { 52 *cdst++ = *csrc++; 53 } 54 return _dst; 55 } 56 57 58 //////////////////////////////////////////////////////////////////////////////////////// 59 // mempcy() 60 // GCC requires this function. Taken from MutekH. 61 //////////////////////////////////////////////////////////////////////////////////////// 62 inline void * memset(void * dst, int s, unsigned int count) { 63 char * a = (char *) dst; 64 while (count--){ 65 *a++ = (char)s; 66 } 67 return dst; 68 } 69 33 70 // Local Variables: 34 71 // tab-width: 4 -
soft/giet_vm/giet_libs/stdlib.h
r259 r271 10 10 11 11 int atoi (char * str); 12 13 //////////////////////////////////////////////////////////////////////////////////////// 14 // mempcy() 15 // GCC requires this function. Taken from MutekH. 16 //////////////////////////////////////////////////////////////////////////////////////// 17 void * memcpy(void *_dst, const void * _src, unsigned int size); 18 19 //////////////////////////////////////////////////////////////////////////////////////// 20 // mempcy() 21 // GCC requires this function. Taken from MutekH. 22 //////////////////////////////////////////////////////////////////////////////////////// 23 inline void * memset(void * dst, int s, unsigned int count); 12 24 #endif 13 25
Note: See TracChangeset
for help on using the changeset viewer.