3
0
mirror of https://github.com/Qortal/Brooklyn.git synced 2025-02-19 05:35:53 +00:00
Brooklyn/arch/arm64/mm/extable.c
Raziel K. Crowe b48c9cc972 Second batch of augmented kernel
Github is super gay like T3Q.
2022-03-15 21:06:03 +05:00

28 lines
581 B
C

// SPDX-License-Identifier: GPL-2.0
/*
* Based on arch/arm/mm/extable.c
*/
#include <linux/extable.h>
#include <linux/uaccess.h>
int fixup_exception(struct pt_regs *regs)
{
const struct exception_table_entry *fixup;
unsigned long addr;
addr = instruction_pointer(regs);
/* Search the BPF tables first, these are formatted differently */
fixup = search_bpf_extables(addr);
if (fixup)
return arm64_bpf_fixup_exception(fixup, regs);
fixup = search_exception_tables(addr);
if (!fixup)
return 0;
regs->pc = (unsigned long)&fixup->fixup + fixup->fixup;
return 1;
}