jpayne@69: /* SPDX-License-Identifier: 0BSD */ jpayne@69: jpayne@69: /** jpayne@69: * \file lzma/bcj.h jpayne@69: * \brief Branch/Call/Jump conversion filters jpayne@69: * \note Never include this file directly. Use instead. jpayne@69: */ jpayne@69: jpayne@69: /* jpayne@69: * Author: Lasse Collin jpayne@69: */ jpayne@69: jpayne@69: #ifndef LZMA_H_INTERNAL jpayne@69: # error Never include this file directly. Use instead. jpayne@69: #endif jpayne@69: jpayne@69: jpayne@69: /* Filter IDs for lzma_filter.id */ jpayne@69: jpayne@69: /** jpayne@69: * \brief Filter for x86 binaries jpayne@69: */ jpayne@69: #define LZMA_FILTER_X86 LZMA_VLI_C(0x04) jpayne@69: jpayne@69: /** jpayne@69: * \brief Filter for Big endian PowerPC binaries jpayne@69: */ jpayne@69: #define LZMA_FILTER_POWERPC LZMA_VLI_C(0x05) jpayne@69: jpayne@69: /** jpayne@69: * \brief Filter for IA-64 (Itanium) binaries jpayne@69: */ jpayne@69: #define LZMA_FILTER_IA64 LZMA_VLI_C(0x06) jpayne@69: jpayne@69: /** jpayne@69: * \brief Filter for ARM binaries jpayne@69: */ jpayne@69: #define LZMA_FILTER_ARM LZMA_VLI_C(0x07) jpayne@69: jpayne@69: /** jpayne@69: * \brief Filter for ARM-Thumb binaries jpayne@69: */ jpayne@69: #define LZMA_FILTER_ARMTHUMB LZMA_VLI_C(0x08) jpayne@69: jpayne@69: /** jpayne@69: * \brief Filter for SPARC binaries jpayne@69: */ jpayne@69: #define LZMA_FILTER_SPARC LZMA_VLI_C(0x09) jpayne@69: jpayne@69: /** jpayne@69: * \brief Filter for ARM64 binaries jpayne@69: */ jpayne@69: #define LZMA_FILTER_ARM64 LZMA_VLI_C(0x0A) jpayne@69: jpayne@69: /** jpayne@69: * \brief Filter for RISC-V binaries jpayne@69: */ jpayne@69: #define LZMA_FILTER_RISCV LZMA_VLI_C(0x0B) jpayne@69: jpayne@69: jpayne@69: /** jpayne@69: * \brief Options for BCJ filters jpayne@69: * jpayne@69: * The BCJ filters never change the size of the data. Specifying options jpayne@69: * for them is optional: if pointer to options is NULL, default value is jpayne@69: * used. You probably never need to specify options to BCJ filters, so just jpayne@69: * set the options pointer to NULL and be happy. jpayne@69: * jpayne@69: * If options with non-default values have been specified when encoding, jpayne@69: * the same options must also be specified when decoding. jpayne@69: * jpayne@69: * \note At the moment, none of the BCJ filters support jpayne@69: * LZMA_SYNC_FLUSH. If LZMA_SYNC_FLUSH is specified, jpayne@69: * LZMA_OPTIONS_ERROR will be returned. If there is need, jpayne@69: * partial support for LZMA_SYNC_FLUSH can be added in future. jpayne@69: * Partial means that flushing would be possible only at jpayne@69: * offsets that are multiple of 2, 4, or 16 depending on jpayne@69: * the filter, except x86 which cannot be made to support jpayne@69: * LZMA_SYNC_FLUSH predictably. jpayne@69: */ jpayne@69: typedef struct { jpayne@69: /** jpayne@69: * \brief Start offset for conversions jpayne@69: * jpayne@69: * This setting is useful only when the same filter is used jpayne@69: * _separately_ for multiple sections of the same executable file, jpayne@69: * and the sections contain cross-section branch/call/jump jpayne@69: * instructions. In that case it is beneficial to set the start jpayne@69: * offset of the non-first sections so that the relative addresses jpayne@69: * of the cross-section branch/call/jump instructions will use the jpayne@69: * same absolute addresses as in the first section. jpayne@69: * jpayne@69: * When the pointer to options is NULL, the default value (zero) jpayne@69: * is used. jpayne@69: */ jpayne@69: uint32_t start_offset; jpayne@69: jpayne@69: } lzma_options_bcj;