22 #if defined(__COREBOOT_ARM_ARCH__) && __COREBOOT_ARM_ARCH__ < 6
24 for (i = 0; i < 8; i++)
28 __asm__ (
"ldr %[x0], [%[src]]"
30 : [src]
"r"(src),
"m"(*(
const uint32_t *)src));
31 __asm__ (
"ldr %[x1], [%[src], #4]"
33 : [src]
"r"(src),
"m"(*(
const uint32_t *)(src + 4)));
34 __asm__ (
"str %[x0], [%[dst]]"
36 : [x0]
"r"(x0), [dst]
"r"(dst));
37 __asm__ (
"str %[x1], [%[dst], #4]"
39 : [x1]
"r"(x1), [dst]
"r"(dst));
41 #elif defined(__riscv)
44 for (i = 0; i < 8; i++)
57 #define FORCE_INLINE static __always_inline
58 #define likely(expr) __builtin_expect((expr) != 0, 1)
59 #define unlikely(expr) __builtin_expect((expr) != 0, 0)
64 #define LZ4F_MAGICNUMBER 0x184D2204
68 #define RESERVED0 0x03
69 #define HAS_CONTENT_CHECKSUM 0x04
70 #define HAS_CONTENT_SIZE 0x08
71 #define HAS_BLOCK_CHECKSUM 0x10
72 #define INDEPENDENT_BLOCKS 0x20
74 #define VERSION_SHIFT 6
76 #define RESERVED1_2 0x8F
77 #define MAX_BLOCK_SIZE 0x70
87 #define BH_SIZE 0x7FFFFFFF
88 #define NOT_COMPRESSED 0x80000000
96 size_t ulz4fn(
const void *src,
size_t srcn,
void *dst,
size_t dstn)
101 int has_block_checksum;
138 out_size = out - dst;
151 int ret = LZ4_decompress_generic(
in, out, (b.
raw &
BH_SIZE),
152 dst + dstn - out, endOnInputSize,
153 full, 0, noDict, out,
NULL, 0);
160 if (has_block_checksum)
167 size_t ulz4f(
const void *src,
void *dst)
void * memcpy(void *dest, const void *src, size_t n)
static uint16_t le16toh(uint16_t little_endian_16bits)
static uint32_t le32toh(uint32_t little_endian_32bits)
struct lz4_frame_header __packed
static uint16_t LZ4_readLE16(const void *src)
#define HAS_BLOCK_CHECKSUM
size_t ulz4f(const void *src, void *dst)
size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn)
static void LZ4_copy8(void *dst, const void *src)
#define INDEPENDENT_BLOCKS
unsigned long long uint64_t