1 // SPDX-License-Identifier: GPL-2.0 2 3 #include <linux/bpf.h> 4 #include <bpf/bpf_helpers.h> 5 #include "bpf_misc.h" 6 7 __u64 cpu_nr_result; 8 9 SEC("raw_tp") call_bpf_get_smp_processor_id(void)10void call_bpf_get_smp_processor_id(void) 11 { 12 register __u64 r0 asm("r0") = -1; 13 asm volatile ("call %[bpf_get_smp_processor_id];" 14 : "+r"(r0) 15 : __imm(bpf_get_smp_processor_id) 16 : "r1", "r2", "r3", "r4", "r5", "memory"); 17 cpu_nr_result = r0; 18 } 19 20 char _license[] SEC("license") = "GPL"; 21