Files
android/lib/lz4/lz4armv8/lz4accel.c
T
threeeye bc1d038eac REVVL 6 Pro kernel bring-up: full working tree snapshot (2026-09-12)
Squashed backup commit (no shallow-clone history issues) of
xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream
commit 9eece662e) plus all fixes applied to get everpal_defconfig building
clean against a modern (GCC 15.2.0) toolchain -- see the previous commit
message on the lineage-23.2 branch (also in this repo history is not
available here since this is a squashed snapshot; full incremental history
lives in the local DL380 checkout and the upstream GitHub remote).

Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
2026-09-12 13:36:46 +00:00

49 lines
1.5 KiB
C

#include "lz4accel.h"
#include <asm/cputype.h>
#ifdef CONFIG_CFI_CLANG
static inline int
__cfi_lz4_decompress_asm(uint8_t **dst_ptr, uint8_t *dst_begin,
uint8_t *dst_end, const uint8_t **src_ptr,
const uint8_t *src_end, bool dip)
{
return _lz4_decompress_asm(dst_ptr, dst_begin, dst_end,
src_ptr, src_end, dip);
}
static inline int
__cfi_lz4_decompress_asm_noprfm(uint8_t **dst_ptr, uint8_t *dst_begin,
uint8_t *dst_end, const uint8_t **src_ptr,
const uint8_t *src_end, bool dip)
{
return _lz4_decompress_asm_noprfm(dst_ptr, dst_begin, dst_end,
src_ptr, src_end, dip);
}
#define _lz4_decompress_asm __cfi_lz4_decompress_asm
#define _lz4_decompress_asm_noprfm __cfi_lz4_decompress_asm_noprfm
#endif
int lz4_decompress_asm_select(uint8_t **dst_ptr, uint8_t *dst_begin,
uint8_t *dst_end, const uint8_t **src_ptr,
const uint8_t *src_end, bool dip) {
const unsigned i = smp_processor_id();
switch(read_cpuid_part_number()) {
case ARM_CPU_PART_CORTEX_A53:
lz4_decompress_asm_fn[i] = _lz4_decompress_asm_noprfm;
return _lz4_decompress_asm_noprfm(dst_ptr, dst_begin, dst_end,
src_ptr, src_end, dip);
}
lz4_decompress_asm_fn[i] = _lz4_decompress_asm;
return _lz4_decompress_asm(dst_ptr, dst_begin, dst_end,
src_ptr, src_end, dip);
}
int (*lz4_decompress_asm_fn[NR_CPUS])(uint8_t **dst_ptr, uint8_t *dst_begin,
uint8_t *dst_end, const uint8_t **src_ptr,
const uint8_t *src_end, bool dip)
__read_mostly = {
[0 ... NR_CPUS-1] = lz4_decompress_asm_select,
};