util.h 562 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef BCM43xx_ASM_UTIL_H_
  2. #define BCM43xx_ASM_UTIL_H_
  3. #include <stdlib.h>
  4. #include <stdint.h>
  5. #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
  6. #undef min
  7. #undef max
  8. #define min(x,y) ((x) < (y) ? (x) : (y))
  9. #define max(x,y) ((x) > (y) ? (x) : (y))
  10. void dump(const char *data,
  11. size_t size,
  12. const char *description);
  13. void * xmalloc(size_t size);
  14. char * xstrdup(const char *str);
  15. typedef _Bool bool;
  16. typedef uint16_t be16_t;
  17. typedef uint32_t be32_t;
  18. be16_t cpu_to_be16(uint16_t x);
  19. be32_t cpu_to_be32(uint32_t x);
  20. #endif /* BCM43xx_ASM_UTIL_H_ */