image.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_IMAGE_H
  3. #define __ASM_IMAGE_H
  4. #define ARM64_IMAGE_MAGIC "ARM\x64"
  5. #define ARM64_IMAGE_FLAG_BE_SHIFT 0
  6. #define ARM64_IMAGE_FLAG_PAGE_SIZE_SHIFT (ARM64_IMAGE_FLAG_BE_SHIFT + 1)
  7. #define ARM64_IMAGE_FLAG_PHYS_BASE_SHIFT \
  8. (ARM64_IMAGE_FLAG_PAGE_SIZE_SHIFT + 2)
  9. #define ARM64_IMAGE_FLAG_BE_MASK 0x1
  10. #define ARM64_IMAGE_FLAG_PAGE_SIZE_MASK 0x3
  11. #define ARM64_IMAGE_FLAG_PHYS_BASE_MASK 0x1
  12. #define ARM64_IMAGE_FLAG_LE 0
  13. #define ARM64_IMAGE_FLAG_BE 1
  14. #define ARM64_IMAGE_FLAG_PAGE_SIZE_4K 1
  15. #define ARM64_IMAGE_FLAG_PAGE_SIZE_16K 2
  16. #define ARM64_IMAGE_FLAG_PAGE_SIZE_64K 3
  17. #define ARM64_IMAGE_FLAG_PHYS_BASE 1
  18. #ifndef __ASSEMBLY__
  19. #define arm64_image_flag_field(flags, field) \
  20. (((flags) >> field##_SHIFT) & field##_MASK)
  21. /*
  22. * struct arm64_image_header - arm64 kernel image header
  23. * See Documentation/arm64/booting.rst for details
  24. *
  25. * @code0: Executable code, or
  26. * @mz_header alternatively used for part of MZ header
  27. * @code1: Executable code
  28. * @text_offset: Image load offset
  29. * @image_size: Effective Image size
  30. * @flags: kernel flags
  31. * @reserved: reserved
  32. * @magic: Magic number
  33. * @reserved5: reserved, or
  34. * @pe_header: alternatively used for PE COFF offset
  35. */
  36. struct arm64_image_header {
  37. __le32 code0;
  38. __le32 code1;
  39. __le64 text_offset;
  40. __le64 image_size;
  41. __le64 flags;
  42. __le64 res2;
  43. __le64 res3;
  44. __le64 res4;
  45. __le32 magic;
  46. __le32 res5;
  47. };
  48. #endif /* __ASSEMBLY__ */
  49. #endif /* __ASM_IMAGE_H */