// SPDX-License-Identifier: GPL-2.01/* Copyright (c) 2025 Meta Platforms, Inc. and affiliates. */23#include <linux/export.h>4#include <linux/linkage.h>5#include <asm/nospec-branch.h>67.code648.section .text, "ax"910SYM_FUNC_START(arch_bpf_timed_may_goto)11ANNOTATE_NOENDBR1213/*14* r10 passes us stack depth, load the pointer to count and timestamp15* into r10 by adding it to BPF frame pointer.16*/17leaq (%rbp, %r10, 1), %r101819/* Setup frame. */20pushq %rbp21movq %rsp, %rbp2223/* Save r0-r5. */24pushq %rax25pushq %rdi26pushq %rsi27pushq %rdx28pushq %rcx29pushq %r83031/*32* r10 has the pointer to count and timestamp, pass it as first33* argument.34*/35movq %r10, %rdi3637/* Emit call depth accounting for call below. */38CALL_DEPTH_ACCOUNT39call bpf_check_timed_may_goto4041/* BPF_REG_AX=r10 will be stored into count, so move return value to it. */42movq %rax, %r104344/* Restore r5-r0. */45popq %r846popq %rcx47popq %rdx48popq %rsi49popq %rdi50popq %rax5152leave53RET54SYM_FUNC_END(arch_bpf_timed_may_goto)555657