string.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. /* MN10300 Optimised string functions
  2. *
  3. * Copyright (C) 2007 Matsushita Electric Industrial Co., Ltd.
  4. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  5. * Modified by David Howells (dhowells@redhat.com)
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public Licence
  9. * as published by the Free Software Foundation; either version
  10. * 2 of the Licence, or (at your option) any later version.
  11. */
  12. #ifndef _ASM_STRING_H
  13. #define _ASM_STRING_H
  14. #define __HAVE_ARCH_MEMSET
  15. #define __HAVE_ARCH_MEMCPY
  16. #define __HAVE_ARCH_MEMMOVE
  17. extern void *memset(void *dest, int ch, size_t count);
  18. extern void *memcpy(void *dest, const void *src, size_t count);
  19. extern void *memmove(void *dest, const void *src, size_t count);
  20. extern void __struct_cpy_bug(void);
  21. #define struct_cpy(x, y) \
  22. ({ \
  23. if (sizeof(*(x)) != sizeof(*(y))) \
  24. __struct_cpy_bug; \
  25. memcpy(x, y, sizeof(*(x))); \
  26. })
  27. #endif /* _ASM_STRING_H */