mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-27 12:32:50 +00:00
The text_poke API is used to implement functions like memcpy() and memset() for instruction memory (RO+X). The implementation is similar to the x86 version. This will be used by the BPF JIT to write and modify BPF programs. There could be more users of this in the future. Signed-off-by: Puranjay Mohan <puranjay12@gmail.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Link: https://lore.kernel.org/r/20240228141824.119877-2-puranjay12@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
18 lines
544 B
C
18 lines
544 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
#ifndef __ASM_PATCHING_H
|
|
#define __ASM_PATCHING_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
int aarch64_insn_read(void *addr, u32 *insnp);
|
|
int aarch64_insn_write(void *addr, u32 insn);
|
|
|
|
int aarch64_insn_write_literal_u64(void *addr, u64 val);
|
|
void *aarch64_insn_set(void *dst, u32 insn, size_t len);
|
|
void *aarch64_insn_copy(void *dst, void *src, size_t len);
|
|
|
|
int aarch64_insn_patch_text_nosync(void *addr, u32 insn);
|
|
int aarch64_insn_patch_text(void *addrs[], u32 insns[], int cnt);
|
|
|
|
#endif /* __ASM_PATCHING_H */
|