File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -514,6 +514,29 @@ def bpf_probe_read_emitter(
514514 return result , ir .IntType (64 )
515515
516516
517+ @HelperHandlerRegistry .register ("smp_processor_id" )
518+ def bpf_get_smp_processor_id_emitter (
519+ call ,
520+ map_ptr ,
521+ module ,
522+ builder ,
523+ func ,
524+ local_sym_tab = None ,
525+ struct_sym_tab = None ,
526+ map_sym_tab = None ,
527+ ):
528+ """
529+ Emit LLVM IR for bpf_get_smp_processor_id helper function call.
530+ """
531+ helper_id = ir .Constant (ir .IntType (64 ), BPFHelperID .BPF_GET_SMP_PROCESSOR_ID .value )
532+ fn_type = ir .FunctionType (ir .IntType (32 ), [], var_arg = False )
533+ fn_ptr_type = ir .PointerType (fn_type )
534+ fn_ptr = builder .inttoptr (helper_id , fn_ptr_type )
535+ result = builder .call (fn_ptr , [], tail = False )
536+ logger .info ("Emitted bpf_get_smp_processor_id call" )
537+ return result , ir .IntType (32 )
538+
539+
517540def handle_helper_call (
518541 call ,
519542 module ,
You can’t perform that action at this time.
0 commit comments