bcj.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /**
  2. * \file lzma/bcj.h
  3. * \brief Branch/Call/Jump conversion filters
  4. */
  5. /*
  6. * Author: Lasse Collin
  7. *
  8. * This file has been put into the public domain.
  9. * You can do whatever you want with this file.
  10. *
  11. * See ../lzma.h for information about liblzma as a whole.
  12. */
  13. #ifndef LZMA_H_INTERNAL
  14. # error Never include this file directly. Use <lzma.h> instead.
  15. #endif
  16. /* Filter IDs for lzma_filter.id */
  17. #define LZMA_FILTER_X86 LZMA_VLI_C(0x04)
  18. /**<
  19. * Filter for x86 binaries
  20. */
  21. #define LZMA_FILTER_POWERPC LZMA_VLI_C(0x05)
  22. /**<
  23. * Filter for Big endian PowerPC binaries
  24. */
  25. #define LZMA_FILTER_IA64 LZMA_VLI_C(0x06)
  26. /**<
  27. * Filter for IA-64 (Itanium) binaries.
  28. */
  29. #define LZMA_FILTER_ARM LZMA_VLI_C(0x07)
  30. /**<
  31. * Filter for ARM binaries.
  32. */
  33. #define LZMA_FILTER_ARMTHUMB LZMA_VLI_C(0x08)
  34. /**<
  35. * Filter for ARM-Thumb binaries.
  36. */
  37. #define LZMA_FILTER_SPARC LZMA_VLI_C(0x09)
  38. /**<
  39. * Filter for SPARC binaries.
  40. */
  41. /**
  42. * \brief Options for BCJ filters
  43. *
  44. * The BCJ filters never change the size of the data. Specifying options
  45. * for them is optional: if pointer to options is NULL, default value is
  46. * used. You probably never need to specify options to BCJ filters, so just
  47. * set the options pointer to NULL and be happy.
  48. *
  49. * If options with non-default values have been specified when encoding,
  50. * the same options must also be specified when decoding.
  51. *
  52. * \note At the moment, none of the BCJ filters support
  53. * LZMA_SYNC_FLUSH. If LZMA_SYNC_FLUSH is specified,
  54. * LZMA_OPTIONS_ERROR will be returned. If there is need,
  55. * partial support for LZMA_SYNC_FLUSH can be added in future.
  56. * Partial means that flushing would be possible only at
  57. * offsets that are multiple of 2, 4, or 16 depending on
  58. * the filter, except x86 which cannot be made to support
  59. * LZMA_SYNC_FLUSH predictably.
  60. */
  61. typedef struct {
  62. /**
  63. * \brief Start offset for conversions
  64. *
  65. * This setting is useful only when the same filter is used
  66. * _separately_ for multiple sections of the same executable file,
  67. * and the sections contain cross-section branch/call/jump
  68. * instructions. In that case it is beneficial to set the start
  69. * offset of the non-first sections so that the relative addresses
  70. * of the cross-section branch/call/jump instructions will use the
  71. * same absolute addresses as in the first section.
  72. *
  73. * When the pointer to options is NULL, the default value (zero)
  74. * is used.
  75. */
  76. uint32_t start_offset;
  77. } lzma_options_bcj;