You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

string.h 820B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef ETHERBOOT_BITS_STRING_H
  2. #define ETHERBOOT_BITS_STRING_H
  3. /* define inline optimized string functions here */
  4. #define __HAVE_ARCH_MEMCPY
  5. //extern void * memcpy(const void *d, const void *s, size_t count);
  6. #define __HAVE_ARCH_MEMCMP
  7. //extern int memcmp(const void * s ,const void * d ,size_t );
  8. #define __HAVE_ARCH_MEMSET
  9. //extern void * memset(const void * s, int c, size_t count);
  10. #define __HAVE_ARCH_MEMMOVE
  11. static inline void *memmove(void *s1, const void *s2, size_t n) {
  12. unsigned int i;
  13. char *tmp = s1;
  14. char *cs2 = (char *) s2;
  15. if (tmp < cs2) {
  16. for(i=0; i<n; ++i, ++tmp, ++cs2)
  17. *tmp = *cs2;
  18. }
  19. else {
  20. tmp += n - 1;
  21. cs2 += n - 1;
  22. for(i=0; i<n; ++i, --tmp, --cs2)
  23. *tmp = *cs2;
  24. }
  25. return(s1);
  26. }
  27. #endif /* ETHERBOOT_BITS_STRING_H */