xz_config.h 825 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef __XZ_CONFIG_H__
  2. #define __XZ_CONFIG_H__
  3. /*
  4. * most of this is copied from lib/xz/xz_private.h, we can't use their defines
  5. * since the boot wrapper is not built in the same environment as the rest of
  6. * the kernel.
  7. */
  8. #include "types.h"
  9. #include "swab.h"
  10. static inline uint32_t swab32p(void *p)
  11. {
  12. uint32_t *q = p;
  13. return swab32(*q);
  14. }
  15. #ifdef __LITTLE_ENDIAN__
  16. #define get_le32(p) (*((uint32_t *) (p)))
  17. #else
  18. #define get_le32(p) swab32p(p)
  19. #endif
  20. #define memeq(a, b, size) (memcmp(a, b, size) == 0)
  21. #define memzero(buf, size) memset(buf, 0, size)
  22. /* prevent the inclusion of the xz-preboot MM headers */
  23. #define DECOMPR_MM_H
  24. #define memmove memmove
  25. #define XZ_EXTERN static
  26. /* xz.h needs to be included directly since we need enum xz_mode */
  27. #include "../../../include/linux/xz.h"
  28. #undef XZ_EXTERN
  29. #endif