/* SPDX-License-Identifier: GPL-2.0 */1/* Copyright (c) 2025 Puranjay Mohan <[email protected]> */23#include <linux/linkage.h>45SYM_FUNC_START(arch_bpf_timed_may_goto)6/* Allocate stack space and emit frame record */7stp x29, x30, [sp, #-64]!8mov x29, sp910/* Save BPF registers R0 - R5 (x7, x0-x4)*/11stp x7, x0, [sp, #16]12stp x1, x2, [sp, #32]13stp x3, x4, [sp, #48]1415/*16* Stack depth was passed in BPF_REG_AX (x9), add it to the BPF_FP17* (x25) to get the pointer to count and timestamp and pass it as the18* first argument in x0.19*20* Before generating the call to arch_bpf_timed_may_goto, the verifier21* generates a load instruction using FP, i.e. REG_AX = *(u64 *)(FP -22* stack_off_cnt), so BPF_REG_FP (x25) is always set up by the arm6423* jit in this case.24*/25add x0, x9, x2526bl bpf_check_timed_may_goto27/* BPF_REG_AX(x9) will be stored into count, so move return value to it. */28mov x9, x02930/* Restore BPF registers R0 - R5 (x7, x0-x4) */31ldp x7, x0, [sp, #16]32ldp x1, x2, [sp, #32]33ldp x3, x4, [sp, #48]3435/* Restore FP and LR */36ldp x29, x30, [sp], #643738ret39SYM_FUNC_END(arch_bpf_timed_may_goto)404142