From c514000605ad0560fd0aa0b43f8723664b477906 Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Fri, 22 Nov 2024 16:55:27 -0800 Subject: [PATCH] Checking bpf2c generated files using Clang 18.1.8 (#4038) Signed-off-by: Alan Jowett Co-authored-by: Alan Jowett --- tests/bpf2c_tests/expected/bindmonitor_dll.c | 222 ++++--- tests/bpf2c_tests/expected/bindmonitor_raw.c | 222 ++++--- tests/bpf2c_tests/expected/bindmonitor_sys.c | 222 ++++--- .../expected/bindmonitor_tailcall_dll.c | 206 +++---- .../expected/bindmonitor_tailcall_raw.c | 206 +++---- .../expected/bindmonitor_tailcall_sys.c | 206 +++---- .../expected/cgroup_count_connect4_dll.c | 47 +- .../expected/cgroup_count_connect4_raw.c | 47 +- .../expected/cgroup_count_connect4_sys.c | 47 +- .../expected/cgroup_count_connect6_dll.c | 47 +- .../expected/cgroup_count_connect6_raw.c | 47 +- .../expected/cgroup_count_connect6_sys.c | 47 +- .../expected/decap_permit_packet_dll.c | 160 ++--- .../expected/decap_permit_packet_raw.c | 160 ++--- .../expected/decap_permit_packet_sys.c | 160 ++--- tests/bpf2c_tests/expected/droppacket_dll.c | 18 +- tests/bpf2c_tests/expected/droppacket_raw.c | 18 +- tests/bpf2c_tests/expected/droppacket_sys.c | 18 +- .../expected/encap_reflect_packet_dll.c | 434 ++++++------- .../expected/encap_reflect_packet_raw.c | 434 ++++++------- .../expected/encap_reflect_packet_sys.c | 434 ++++++------- tests/bpf2c_tests/expected/inner_map_dll.c | 84 +-- tests/bpf2c_tests/expected/inner_map_raw.c | 84 +-- tests/bpf2c_tests/expected/inner_map_sys.c | 84 +-- tests/bpf2c_tests/expected/map_dll.c | 356 +++++------ tests/bpf2c_tests/expected/map_raw.c | 356 +++++------ tests/bpf2c_tests/expected/map_reuse_2_dll.c | 38 +- tests/bpf2c_tests/expected/map_reuse_2_raw.c | 38 +- tests/bpf2c_tests/expected/map_reuse_2_sys.c | 38 +- tests/bpf2c_tests/expected/map_reuse_dll.c | 38 +- tests/bpf2c_tests/expected/map_reuse_raw.c | 38 +- tests/bpf2c_tests/expected/map_reuse_sys.c | 38 +- tests/bpf2c_tests/expected/map_sys.c | 356 +++++------ tests/bpf2c_tests/expected/pidtgid_dll.c | 54 +- tests/bpf2c_tests/expected/pidtgid_raw.c | 54 +- tests/bpf2c_tests/expected/pidtgid_sys.c | 54 +- tests/bpf2c_tests/expected/sockops_dll.c | 574 +++++++++--------- tests/bpf2c_tests/expected/sockops_raw.c | 574 +++++++++--------- tests/bpf2c_tests/expected/sockops_sys.c | 574 +++++++++--------- .../expected/tail_call_recursive_dll.c | 50 +- .../expected/tail_call_recursive_raw.c | 50 +- .../expected/tail_call_recursive_sys.c | 50 +- tests/bpf2c_tests/expected/utility_dll.c | 247 ++++---- tests/bpf2c_tests/expected/utility_raw.c | 247 ++++---- tests/bpf2c_tests/expected/utility_sys.c | 247 ++++---- 45 files changed, 3819 insertions(+), 3906 deletions(-) diff --git a/tests/bpf2c_tests/expected/bindmonitor_dll.c b/tests/bpf2c_tests/expected/bindmonitor_dll.c index 358778b758..289ce35f61 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_dll.c +++ b/tests/bpf2c_tests/expected/bindmonitor_dll.c @@ -134,8 +134,6 @@ BindMonitor(void* context) register uint64_t r7 = 0; #line 112 "sample/bindmonitor.c" register uint64_t r8 = 0; -#line 112 "sample/bindmonitor.c" - register uint64_t r9 = 0; #line 112 "sample/bindmonitor.c" register uint64_t r10 = 0; @@ -147,12 +145,12 @@ BindMonitor(void* context) // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 #line 112 "sample/bindmonitor.c" r6 = r1; - // EBPF_OP_MOV64_IMM pc=1 dst=r8 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=1 dst=r7 src=r0 offset=0 imm=0 #line 112 "sample/bindmonitor.c" - r8 = IMMEDIATE(0); - // EBPF_OP_STXW pc=2 dst=r10 src=r8 offset=-84 imm=0 + r7 = IMMEDIATE(0); + // EBPF_OP_STXW pc=2 dst=r10 src=r7 offset=-84 imm=0 #line 114 "sample/bindmonitor.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-84)) = (uint32_t)r8; + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-84)) = (uint32_t)r7; // EBPF_OP_CALL pc=3 dst=r0 src=r0 offset=0 imm=19 #line 61 "sample/bindmonitor.c" r0 = BindMonitor_helpers[0].address(r1, r2, r3, r4, r5, context); @@ -165,9 +163,9 @@ BindMonitor(void* context) // EBPF_OP_STXDW pc=4 dst=r10 src=r0 offset=-8 imm=0 #line 61 "sample/bindmonitor.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r0; - // EBPF_OP_STXDW pc=5 dst=r10 src=r8 offset=-72 imm=0 + // EBPF_OP_STXDW pc=5 dst=r10 src=r7 offset=-72 imm=0 #line 62 "sample/bindmonitor.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r8; + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r7; // EBPF_OP_MOV64_REG pc=6 dst=r1 src=r6 offset=0 imm=0 #line 64 "sample/bindmonitor.c" r1 = r6; @@ -243,26 +241,26 @@ BindMonitor(void* context) return 0; #line 119 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_REG pc=25 dst=r7 src=r0 offset=0 imm=0 -#line 119 "sample/bindmonitor.c" - r7 = r0; - // EBPF_OP_JEQ_IMM pc=26 dst=r7 src=r0 offset=77 imm=0 + // EBPF_OP_JEQ_IMM pc=25 dst=r0 src=r0 offset=75 imm=0 #line 120 "sample/bindmonitor.c" - if (r7 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 120 "sample/bindmonitor.c" - goto label_7; + goto label_6; #line 120 "sample/bindmonitor.c" } - // EBPF_OP_LDXW pc=27 dst=r1 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=26 dst=r1 src=r0 offset=0 imm=0 #line 120 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=28 dst=r1 src=r0 offset=75 imm=0 + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_JEQ_IMM pc=27 dst=r1 src=r0 offset=73 imm=0 #line 120 "sample/bindmonitor.c" if (r1 == IMMEDIATE(0)) { #line 120 "sample/bindmonitor.c" - goto label_7; + goto label_6; #line 120 "sample/bindmonitor.c" } + // EBPF_OP_MOV64_REG pc=28 dst=r8 src=r0 offset=0 imm=0 +#line 120 "sample/bindmonitor.c" + r8 = r0; // EBPF_OP_LDXDW pc=29 dst=r1 src=r6 offset=16 imm=0 #line 73 "sample/bindmonitor.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(16)); @@ -317,68 +315,65 @@ BindMonitor(void* context) return 0; #line 78 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_REG pc=46 dst=r9 src=r0 offset=0 imm=0 -#line 78 "sample/bindmonitor.c" - r9 = r0; - // EBPF_OP_JNE_IMM pc=47 dst=r9 src=r0 offset=28 imm=0 + // EBPF_OP_JNE_IMM pc=46 dst=r0 src=r0 offset=29 imm=0 #line 79 "sample/bindmonitor.c" - if (r9 != IMMEDIATE(0)) { + if (r0 != IMMEDIATE(0)) { #line 79 "sample/bindmonitor.c" goto label_1; #line 79 "sample/bindmonitor.c" } - // EBPF_OP_LDXW pc=48 dst=r1 src=r6 offset=44 imm=0 + // EBPF_OP_LDXW pc=47 dst=r1 src=r6 offset=44 imm=0 #line 83 "sample/bindmonitor.c" r1 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); - // EBPF_OP_JNE_IMM pc=49 dst=r1 src=r0 offset=53 imm=0 + // EBPF_OP_JNE_IMM pc=48 dst=r1 src=r0 offset=51 imm=0 #line 83 "sample/bindmonitor.c" if (r1 != IMMEDIATE(0)) { #line 83 "sample/bindmonitor.c" - goto label_6; + goto label_5; #line 83 "sample/bindmonitor.c" } - // EBPF_OP_LDXDW pc=50 dst=r1 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=49 dst=r1 src=r6 offset=0 imm=0 #line 87 "sample/bindmonitor.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=51 dst=r1 src=r0 offset=51 imm=0 + // EBPF_OP_JEQ_IMM pc=50 dst=r1 src=r0 offset=49 imm=0 #line 87 "sample/bindmonitor.c" if (r1 == IMMEDIATE(0)) { #line 87 "sample/bindmonitor.c" - goto label_6; + goto label_5; #line 87 "sample/bindmonitor.c" } - // EBPF_OP_LDXDW pc=52 dst=r1 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=51 dst=r1 src=r6 offset=8 imm=0 #line 87 "sample/bindmonitor.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_JEQ_IMM pc=53 dst=r1 src=r0 offset=49 imm=0 + // EBPF_OP_JEQ_IMM pc=52 dst=r1 src=r0 offset=47 imm=0 #line 87 "sample/bindmonitor.c" if (r1 == IMMEDIATE(0)) { #line 87 "sample/bindmonitor.c" - goto label_6; + goto label_5; #line 87 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_REG pc=54 dst=r8 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=53 dst=r7 src=r10 offset=0 imm=0 #line 87 "sample/bindmonitor.c" - r8 = r10; - // EBPF_OP_ADD64_IMM pc=55 dst=r8 src=r0 offset=0 imm=-8 + r7 = r10; + // EBPF_OP_ADD64_IMM pc=54 dst=r7 src=r0 offset=0 imm=-8 #line 91 "sample/bindmonitor.c" - r8 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=56 dst=r3 src=r10 offset=0 imm=0 + r7 += IMMEDIATE(-8); + // EBPF_OP_MOV64_REG pc=55 dst=r3 src=r10 offset=0 imm=0 #line 91 "sample/bindmonitor.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=57 dst=r3 src=r0 offset=0 imm=-80 + // EBPF_OP_ADD64_IMM pc=56 dst=r3 src=r0 offset=0 imm=-80 #line 91 "sample/bindmonitor.c" r3 += IMMEDIATE(-80); - // EBPF_OP_LDDW pc=58 dst=r1 src=r1 offset=0 imm=2 + // EBPF_OP_LDDW pc=57 dst=r1 src=r1 offset=0 imm=2 #line 91 "sample/bindmonitor.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_REG pc=60 dst=r2 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=59 dst=r2 src=r7 offset=0 imm=0 #line 91 "sample/bindmonitor.c" - r2 = r8; - // EBPF_OP_MOV64_IMM pc=61 dst=r4 src=r0 offset=0 imm=0 + r2 = r7; + // EBPF_OP_MOV64_IMM pc=60 dst=r4 src=r0 offset=0 imm=0 #line 91 "sample/bindmonitor.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=62 dst=r0 src=r0 offset=0 imm=2 + // EBPF_OP_CALL pc=61 dst=r0 src=r0 offset=0 imm=2 #line 91 "sample/bindmonitor.c" r0 = BindMonitor_helpers[3].address(r1, r2, r3, r4, r5, context); #line 91 "sample/bindmonitor.c" @@ -387,13 +382,13 @@ BindMonitor(void* context) return 0; #line 91 "sample/bindmonitor.c" } - // EBPF_OP_LDDW pc=63 dst=r1 src=r1 offset=0 imm=2 + // EBPF_OP_LDDW pc=62 dst=r1 src=r1 offset=0 imm=2 #line 92 "sample/bindmonitor.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_REG pc=65 dst=r2 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=64 dst=r2 src=r7 offset=0 imm=0 #line 92 "sample/bindmonitor.c" - r2 = r8; - // EBPF_OP_CALL pc=66 dst=r0 src=r0 offset=0 imm=1 + r2 = r7; + // EBPF_OP_CALL pc=65 dst=r0 src=r0 offset=0 imm=1 #line 92 "sample/bindmonitor.c" r0 = BindMonitor_helpers[4].address(r1, r2, r3, r4, r5, context); #line 92 "sample/bindmonitor.c" @@ -402,35 +397,35 @@ BindMonitor(void* context) return 0; #line 92 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_REG pc=67 dst=r9 src=r0 offset=0 imm=0 -#line 92 "sample/bindmonitor.c" - r9 = r0; - // EBPF_OP_JEQ_IMM pc=68 dst=r9 src=r0 offset=34 imm=0 + // EBPF_OP_JEQ_IMM pc=66 dst=r0 src=r0 offset=33 imm=0 #line 93 "sample/bindmonitor.c" - if (r9 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 93 "sample/bindmonitor.c" - goto label_6; + goto label_5; #line 93 "sample/bindmonitor.c" } - // EBPF_OP_LDXDW pc=69 dst=r3 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=67 dst=r3 src=r6 offset=0 imm=0 #line 97 "sample/bindmonitor.c" r3 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_LDXDW pc=70 dst=r4 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=68 dst=r4 src=r6 offset=8 imm=0 #line 97 "sample/bindmonitor.c" r4 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_SUB64_REG pc=71 dst=r4 src=r3 offset=0 imm=0 + // EBPF_OP_SUB64_REG pc=69 dst=r4 src=r3 offset=0 imm=0 #line 97 "sample/bindmonitor.c" r4 -= r3; - // EBPF_OP_MOV64_REG pc=72 dst=r1 src=r9 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=70 dst=r1 src=r0 offset=0 imm=0 #line 97 "sample/bindmonitor.c" - r1 = r9; - // EBPF_OP_ADD64_IMM pc=73 dst=r1 src=r0 offset=0 imm=4 + r1 = r0; + // EBPF_OP_ADD64_IMM pc=71 dst=r1 src=r0 offset=0 imm=4 #line 97 "sample/bindmonitor.c" r1 += IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=74 dst=r2 src=r0 offset=0 imm=64 + // EBPF_OP_MOV64_IMM pc=72 dst=r2 src=r0 offset=0 imm=64 #line 97 "sample/bindmonitor.c" r2 = IMMEDIATE(64); - // EBPF_OP_CALL pc=75 dst=r0 src=r0 offset=0 imm=22 + // EBPF_OP_MOV64_REG pc=73 dst=r7 src=r0 offset=0 imm=0 +#line 97 "sample/bindmonitor.c" + r7 = r0; + // EBPF_OP_CALL pc=74 dst=r0 src=r0 offset=0 imm=22 #line 97 "sample/bindmonitor.c" r0 = BindMonitor_helpers[5].address(r1, r2, r3, r4, r5, context); #line 97 "sample/bindmonitor.c" @@ -439,107 +434,100 @@ BindMonitor(void* context) return 0; #line 97 "sample/bindmonitor.c" } + // EBPF_OP_MOV64_REG pc=75 dst=r0 src=r7 offset=0 imm=0 +#line 97 "sample/bindmonitor.c" + r0 = r7; label_1: - // EBPF_OP_LDXW pc=76 dst=r1 src=r6 offset=44 imm=0 + // EBPF_OP_LDXW pc=76 dst=r1 src=r0 offset=0 imm=0 +#line 97 "sample/bindmonitor.c" + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_LDXW pc=77 dst=r2 src=r6 offset=44 imm=0 #line 130 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); - // EBPF_OP_JEQ_IMM pc=77 dst=r1 src=r0 offset=8 imm=2 + r2 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); + // EBPF_OP_JEQ_IMM pc=78 dst=r2 src=r0 offset=7 imm=2 #line 130 "sample/bindmonitor.c" - if (r1 == IMMEDIATE(2)) { + if (r2 == IMMEDIATE(2)) { #line 130 "sample/bindmonitor.c" goto label_2; #line 130 "sample/bindmonitor.c" } - // EBPF_OP_JNE_IMM pc=78 dst=r1 src=r0 offset=12 imm=0 + // EBPF_OP_JNE_IMM pc=79 dst=r2 src=r0 offset=9 imm=0 #line 130 "sample/bindmonitor.c" - if (r1 != IMMEDIATE(0)) { + if (r2 != IMMEDIATE(0)) { #line 130 "sample/bindmonitor.c" goto label_3; #line 130 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_IMM pc=79 dst=r8 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=80 dst=r7 src=r0 offset=0 imm=1 #line 130 "sample/bindmonitor.c" - r8 = IMMEDIATE(1); - // EBPF_OP_LDXW pc=80 dst=r1 src=r9 offset=0 imm=0 + r7 = IMMEDIATE(1); + // EBPF_OP_LDXW pc=81 dst=r2 src=r8 offset=0 imm=0 #line 132 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)); - // EBPF_OP_LDXW pc=81 dst=r2 src=r7 offset=0 imm=0 -#line 132 "sample/bindmonitor.c" - r2 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_JGE_REG pc=82 dst=r1 src=r2 offset=21 imm=0 + r2 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); + // EBPF_OP_JGE_REG pc=82 dst=r1 src=r2 offset=18 imm=0 #line 132 "sample/bindmonitor.c" if (r1 >= r2) { #line 132 "sample/bindmonitor.c" - goto label_7; + goto label_6; #line 132 "sample/bindmonitor.c" } // EBPF_OP_ADD64_IMM pc=83 dst=r1 src=r0 offset=0 imm=1 #line 136 "sample/bindmonitor.c" r1 += IMMEDIATE(1); - // EBPF_OP_STXW pc=84 dst=r9 src=r1 offset=0 imm=0 + // EBPF_OP_STXW pc=84 dst=r0 src=r1 offset=0 imm=0 #line 136 "sample/bindmonitor.c" - *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_JA pc=85 dst=r0 src=r0 offset=17 imm=0 + *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; + // EBPF_OP_JA pc=85 dst=r0 src=r0 offset=14 imm=0 #line 136 "sample/bindmonitor.c" - goto label_6; + goto label_5; label_2: - // EBPF_OP_LDXW pc=86 dst=r1 src=r9 offset=0 imm=0 -#line 139 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=87 dst=r1 src=r0 offset=8 imm=0 + // EBPF_OP_JEQ_IMM pc=86 dst=r1 src=r0 offset=6 imm=0 #line 139 "sample/bindmonitor.c" if (r1 == IMMEDIATE(0)) { #line 139 "sample/bindmonitor.c" - goto label_5; + goto label_4; #line 139 "sample/bindmonitor.c" } - // EBPF_OP_ADD64_IMM pc=88 dst=r1 src=r0 offset=0 imm=-1 + // EBPF_OP_ADD64_IMM pc=87 dst=r1 src=r0 offset=0 imm=-1 #line 140 "sample/bindmonitor.c" r1 += IMMEDIATE(-1); - // EBPF_OP_STXW pc=89 dst=r9 src=r1 offset=0 imm=0 + // EBPF_OP_STXW pc=88 dst=r0 src=r1 offset=0 imm=0 #line 140 "sample/bindmonitor.c" - *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_JA pc=90 dst=r0 src=r0 offset=1 imm=0 -#line 140 "sample/bindmonitor.c" - goto label_4; + *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; label_3: - // EBPF_OP_LDXW pc=91 dst=r1 src=r9 offset=0 imm=0 -#line 147 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)); -label_4: - // EBPF_OP_MOV64_IMM pc=92 dst=r8 src=r0 offset=0 imm=0 -#line 147 "sample/bindmonitor.c" - r8 = IMMEDIATE(0); - // EBPF_OP_LSH64_IMM pc=93 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_MOV64_IMM pc=89 dst=r7 src=r0 offset=0 imm=0 +#line 140 "sample/bindmonitor.c" + r7 = IMMEDIATE(0); + // EBPF_OP_LSH64_IMM pc=90 dst=r1 src=r0 offset=0 imm=32 #line 147 "sample/bindmonitor.c" r1 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_RSH64_IMM pc=94 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=91 dst=r1 src=r0 offset=0 imm=32 #line 147 "sample/bindmonitor.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JNE_IMM pc=95 dst=r1 src=r0 offset=8 imm=0 + // EBPF_OP_JNE_IMM pc=92 dst=r1 src=r0 offset=8 imm=0 #line 147 "sample/bindmonitor.c" if (r1 != IMMEDIATE(0)) { #line 147 "sample/bindmonitor.c" - goto label_7; + goto label_6; #line 147 "sample/bindmonitor.c" } -label_5: - // EBPF_OP_LDXDW pc=96 dst=r1 src=r6 offset=16 imm=0 +label_4: + // EBPF_OP_LDXDW pc=93 dst=r1 src=r6 offset=16 imm=0 #line 148 "sample/bindmonitor.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(16)); - // EBPF_OP_STXDW pc=97 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=94 dst=r10 src=r1 offset=-80 imm=0 #line 148 "sample/bindmonitor.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_MOV64_REG pc=98 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=95 dst=r2 src=r10 offset=0 imm=0 #line 148 "sample/bindmonitor.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=99 dst=r2 src=r0 offset=0 imm=-80 + // EBPF_OP_ADD64_IMM pc=96 dst=r2 src=r0 offset=0 imm=-80 #line 148 "sample/bindmonitor.c" r2 += IMMEDIATE(-80); - // EBPF_OP_LDDW pc=100 dst=r1 src=r1 offset=0 imm=2 + // EBPF_OP_LDDW pc=97 dst=r1 src=r1 offset=0 imm=2 #line 149 "sample/bindmonitor.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_CALL pc=102 dst=r0 src=r0 offset=0 imm=3 + // EBPF_OP_CALL pc=99 dst=r0 src=r0 offset=0 imm=3 #line 149 "sample/bindmonitor.c" r0 = BindMonitor_helpers[6].address(r1, r2, r3, r4, r5, context); #line 149 "sample/bindmonitor.c" @@ -548,15 +536,15 @@ BindMonitor(void* context) return 0; #line 149 "sample/bindmonitor.c" } -label_6: - // EBPF_OP_MOV64_IMM pc=103 dst=r8 src=r0 offset=0 imm=0 +label_5: + // EBPF_OP_MOV64_IMM pc=100 dst=r7 src=r0 offset=0 imm=0 #line 149 "sample/bindmonitor.c" - r8 = IMMEDIATE(0); -label_7: - // EBPF_OP_MOV64_REG pc=104 dst=r0 src=r8 offset=0 imm=0 + r7 = IMMEDIATE(0); +label_6: + // EBPF_OP_MOV64_REG pc=101 dst=r0 src=r7 offset=0 imm=0 #line 153 "sample/bindmonitor.c" - r0 = r8; - // EBPF_OP_EXIT pc=105 dst=r0 src=r0 offset=0 imm=0 + r0 = r7; + // EBPF_OP_EXIT pc=102 dst=r0 src=r0 offset=0 imm=0 #line 153 "sample/bindmonitor.c" return r0; #line 112 "sample/bindmonitor.c" @@ -576,7 +564,7 @@ static program_entry_t _programs[] = { 3, BindMonitor_helpers, 7, - 106, + 103, &BindMonitor_program_type_guid, &BindMonitor_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/bindmonitor_raw.c b/tests/bpf2c_tests/expected/bindmonitor_raw.c index 226346fbe9..50f0d9f118 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_raw.c +++ b/tests/bpf2c_tests/expected/bindmonitor_raw.c @@ -108,8 +108,6 @@ BindMonitor(void* context) register uint64_t r7 = 0; #line 112 "sample/bindmonitor.c" register uint64_t r8 = 0; -#line 112 "sample/bindmonitor.c" - register uint64_t r9 = 0; #line 112 "sample/bindmonitor.c" register uint64_t r10 = 0; @@ -121,12 +119,12 @@ BindMonitor(void* context) // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 #line 112 "sample/bindmonitor.c" r6 = r1; - // EBPF_OP_MOV64_IMM pc=1 dst=r8 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=1 dst=r7 src=r0 offset=0 imm=0 #line 112 "sample/bindmonitor.c" - r8 = IMMEDIATE(0); - // EBPF_OP_STXW pc=2 dst=r10 src=r8 offset=-84 imm=0 + r7 = IMMEDIATE(0); + // EBPF_OP_STXW pc=2 dst=r10 src=r7 offset=-84 imm=0 #line 114 "sample/bindmonitor.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-84)) = (uint32_t)r8; + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-84)) = (uint32_t)r7; // EBPF_OP_CALL pc=3 dst=r0 src=r0 offset=0 imm=19 #line 61 "sample/bindmonitor.c" r0 = BindMonitor_helpers[0].address(r1, r2, r3, r4, r5, context); @@ -139,9 +137,9 @@ BindMonitor(void* context) // EBPF_OP_STXDW pc=4 dst=r10 src=r0 offset=-8 imm=0 #line 61 "sample/bindmonitor.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r0; - // EBPF_OP_STXDW pc=5 dst=r10 src=r8 offset=-72 imm=0 + // EBPF_OP_STXDW pc=5 dst=r10 src=r7 offset=-72 imm=0 #line 62 "sample/bindmonitor.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r8; + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r7; // EBPF_OP_MOV64_REG pc=6 dst=r1 src=r6 offset=0 imm=0 #line 64 "sample/bindmonitor.c" r1 = r6; @@ -217,26 +215,26 @@ BindMonitor(void* context) return 0; #line 119 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_REG pc=25 dst=r7 src=r0 offset=0 imm=0 -#line 119 "sample/bindmonitor.c" - r7 = r0; - // EBPF_OP_JEQ_IMM pc=26 dst=r7 src=r0 offset=77 imm=0 + // EBPF_OP_JEQ_IMM pc=25 dst=r0 src=r0 offset=75 imm=0 #line 120 "sample/bindmonitor.c" - if (r7 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 120 "sample/bindmonitor.c" - goto label_7; + goto label_6; #line 120 "sample/bindmonitor.c" } - // EBPF_OP_LDXW pc=27 dst=r1 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=26 dst=r1 src=r0 offset=0 imm=0 #line 120 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=28 dst=r1 src=r0 offset=75 imm=0 + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_JEQ_IMM pc=27 dst=r1 src=r0 offset=73 imm=0 #line 120 "sample/bindmonitor.c" if (r1 == IMMEDIATE(0)) { #line 120 "sample/bindmonitor.c" - goto label_7; + goto label_6; #line 120 "sample/bindmonitor.c" } + // EBPF_OP_MOV64_REG pc=28 dst=r8 src=r0 offset=0 imm=0 +#line 120 "sample/bindmonitor.c" + r8 = r0; // EBPF_OP_LDXDW pc=29 dst=r1 src=r6 offset=16 imm=0 #line 73 "sample/bindmonitor.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(16)); @@ -291,68 +289,65 @@ BindMonitor(void* context) return 0; #line 78 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_REG pc=46 dst=r9 src=r0 offset=0 imm=0 -#line 78 "sample/bindmonitor.c" - r9 = r0; - // EBPF_OP_JNE_IMM pc=47 dst=r9 src=r0 offset=28 imm=0 + // EBPF_OP_JNE_IMM pc=46 dst=r0 src=r0 offset=29 imm=0 #line 79 "sample/bindmonitor.c" - if (r9 != IMMEDIATE(0)) { + if (r0 != IMMEDIATE(0)) { #line 79 "sample/bindmonitor.c" goto label_1; #line 79 "sample/bindmonitor.c" } - // EBPF_OP_LDXW pc=48 dst=r1 src=r6 offset=44 imm=0 + // EBPF_OP_LDXW pc=47 dst=r1 src=r6 offset=44 imm=0 #line 83 "sample/bindmonitor.c" r1 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); - // EBPF_OP_JNE_IMM pc=49 dst=r1 src=r0 offset=53 imm=0 + // EBPF_OP_JNE_IMM pc=48 dst=r1 src=r0 offset=51 imm=0 #line 83 "sample/bindmonitor.c" if (r1 != IMMEDIATE(0)) { #line 83 "sample/bindmonitor.c" - goto label_6; + goto label_5; #line 83 "sample/bindmonitor.c" } - // EBPF_OP_LDXDW pc=50 dst=r1 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=49 dst=r1 src=r6 offset=0 imm=0 #line 87 "sample/bindmonitor.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=51 dst=r1 src=r0 offset=51 imm=0 + // EBPF_OP_JEQ_IMM pc=50 dst=r1 src=r0 offset=49 imm=0 #line 87 "sample/bindmonitor.c" if (r1 == IMMEDIATE(0)) { #line 87 "sample/bindmonitor.c" - goto label_6; + goto label_5; #line 87 "sample/bindmonitor.c" } - // EBPF_OP_LDXDW pc=52 dst=r1 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=51 dst=r1 src=r6 offset=8 imm=0 #line 87 "sample/bindmonitor.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_JEQ_IMM pc=53 dst=r1 src=r0 offset=49 imm=0 + // EBPF_OP_JEQ_IMM pc=52 dst=r1 src=r0 offset=47 imm=0 #line 87 "sample/bindmonitor.c" if (r1 == IMMEDIATE(0)) { #line 87 "sample/bindmonitor.c" - goto label_6; + goto label_5; #line 87 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_REG pc=54 dst=r8 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=53 dst=r7 src=r10 offset=0 imm=0 #line 87 "sample/bindmonitor.c" - r8 = r10; - // EBPF_OP_ADD64_IMM pc=55 dst=r8 src=r0 offset=0 imm=-8 + r7 = r10; + // EBPF_OP_ADD64_IMM pc=54 dst=r7 src=r0 offset=0 imm=-8 #line 91 "sample/bindmonitor.c" - r8 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=56 dst=r3 src=r10 offset=0 imm=0 + r7 += IMMEDIATE(-8); + // EBPF_OP_MOV64_REG pc=55 dst=r3 src=r10 offset=0 imm=0 #line 91 "sample/bindmonitor.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=57 dst=r3 src=r0 offset=0 imm=-80 + // EBPF_OP_ADD64_IMM pc=56 dst=r3 src=r0 offset=0 imm=-80 #line 91 "sample/bindmonitor.c" r3 += IMMEDIATE(-80); - // EBPF_OP_LDDW pc=58 dst=r1 src=r1 offset=0 imm=2 + // EBPF_OP_LDDW pc=57 dst=r1 src=r1 offset=0 imm=2 #line 91 "sample/bindmonitor.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_REG pc=60 dst=r2 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=59 dst=r2 src=r7 offset=0 imm=0 #line 91 "sample/bindmonitor.c" - r2 = r8; - // EBPF_OP_MOV64_IMM pc=61 dst=r4 src=r0 offset=0 imm=0 + r2 = r7; + // EBPF_OP_MOV64_IMM pc=60 dst=r4 src=r0 offset=0 imm=0 #line 91 "sample/bindmonitor.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=62 dst=r0 src=r0 offset=0 imm=2 + // EBPF_OP_CALL pc=61 dst=r0 src=r0 offset=0 imm=2 #line 91 "sample/bindmonitor.c" r0 = BindMonitor_helpers[3].address(r1, r2, r3, r4, r5, context); #line 91 "sample/bindmonitor.c" @@ -361,13 +356,13 @@ BindMonitor(void* context) return 0; #line 91 "sample/bindmonitor.c" } - // EBPF_OP_LDDW pc=63 dst=r1 src=r1 offset=0 imm=2 + // EBPF_OP_LDDW pc=62 dst=r1 src=r1 offset=0 imm=2 #line 92 "sample/bindmonitor.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_REG pc=65 dst=r2 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=64 dst=r2 src=r7 offset=0 imm=0 #line 92 "sample/bindmonitor.c" - r2 = r8; - // EBPF_OP_CALL pc=66 dst=r0 src=r0 offset=0 imm=1 + r2 = r7; + // EBPF_OP_CALL pc=65 dst=r0 src=r0 offset=0 imm=1 #line 92 "sample/bindmonitor.c" r0 = BindMonitor_helpers[4].address(r1, r2, r3, r4, r5, context); #line 92 "sample/bindmonitor.c" @@ -376,35 +371,35 @@ BindMonitor(void* context) return 0; #line 92 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_REG pc=67 dst=r9 src=r0 offset=0 imm=0 -#line 92 "sample/bindmonitor.c" - r9 = r0; - // EBPF_OP_JEQ_IMM pc=68 dst=r9 src=r0 offset=34 imm=0 + // EBPF_OP_JEQ_IMM pc=66 dst=r0 src=r0 offset=33 imm=0 #line 93 "sample/bindmonitor.c" - if (r9 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 93 "sample/bindmonitor.c" - goto label_6; + goto label_5; #line 93 "sample/bindmonitor.c" } - // EBPF_OP_LDXDW pc=69 dst=r3 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=67 dst=r3 src=r6 offset=0 imm=0 #line 97 "sample/bindmonitor.c" r3 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_LDXDW pc=70 dst=r4 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=68 dst=r4 src=r6 offset=8 imm=0 #line 97 "sample/bindmonitor.c" r4 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_SUB64_REG pc=71 dst=r4 src=r3 offset=0 imm=0 + // EBPF_OP_SUB64_REG pc=69 dst=r4 src=r3 offset=0 imm=0 #line 97 "sample/bindmonitor.c" r4 -= r3; - // EBPF_OP_MOV64_REG pc=72 dst=r1 src=r9 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=70 dst=r1 src=r0 offset=0 imm=0 #line 97 "sample/bindmonitor.c" - r1 = r9; - // EBPF_OP_ADD64_IMM pc=73 dst=r1 src=r0 offset=0 imm=4 + r1 = r0; + // EBPF_OP_ADD64_IMM pc=71 dst=r1 src=r0 offset=0 imm=4 #line 97 "sample/bindmonitor.c" r1 += IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=74 dst=r2 src=r0 offset=0 imm=64 + // EBPF_OP_MOV64_IMM pc=72 dst=r2 src=r0 offset=0 imm=64 #line 97 "sample/bindmonitor.c" r2 = IMMEDIATE(64); - // EBPF_OP_CALL pc=75 dst=r0 src=r0 offset=0 imm=22 + // EBPF_OP_MOV64_REG pc=73 dst=r7 src=r0 offset=0 imm=0 +#line 97 "sample/bindmonitor.c" + r7 = r0; + // EBPF_OP_CALL pc=74 dst=r0 src=r0 offset=0 imm=22 #line 97 "sample/bindmonitor.c" r0 = BindMonitor_helpers[5].address(r1, r2, r3, r4, r5, context); #line 97 "sample/bindmonitor.c" @@ -413,107 +408,100 @@ BindMonitor(void* context) return 0; #line 97 "sample/bindmonitor.c" } + // EBPF_OP_MOV64_REG pc=75 dst=r0 src=r7 offset=0 imm=0 +#line 97 "sample/bindmonitor.c" + r0 = r7; label_1: - // EBPF_OP_LDXW pc=76 dst=r1 src=r6 offset=44 imm=0 + // EBPF_OP_LDXW pc=76 dst=r1 src=r0 offset=0 imm=0 +#line 97 "sample/bindmonitor.c" + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_LDXW pc=77 dst=r2 src=r6 offset=44 imm=0 #line 130 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); - // EBPF_OP_JEQ_IMM pc=77 dst=r1 src=r0 offset=8 imm=2 + r2 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); + // EBPF_OP_JEQ_IMM pc=78 dst=r2 src=r0 offset=7 imm=2 #line 130 "sample/bindmonitor.c" - if (r1 == IMMEDIATE(2)) { + if (r2 == IMMEDIATE(2)) { #line 130 "sample/bindmonitor.c" goto label_2; #line 130 "sample/bindmonitor.c" } - // EBPF_OP_JNE_IMM pc=78 dst=r1 src=r0 offset=12 imm=0 + // EBPF_OP_JNE_IMM pc=79 dst=r2 src=r0 offset=9 imm=0 #line 130 "sample/bindmonitor.c" - if (r1 != IMMEDIATE(0)) { + if (r2 != IMMEDIATE(0)) { #line 130 "sample/bindmonitor.c" goto label_3; #line 130 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_IMM pc=79 dst=r8 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=80 dst=r7 src=r0 offset=0 imm=1 #line 130 "sample/bindmonitor.c" - r8 = IMMEDIATE(1); - // EBPF_OP_LDXW pc=80 dst=r1 src=r9 offset=0 imm=0 + r7 = IMMEDIATE(1); + // EBPF_OP_LDXW pc=81 dst=r2 src=r8 offset=0 imm=0 #line 132 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)); - // EBPF_OP_LDXW pc=81 dst=r2 src=r7 offset=0 imm=0 -#line 132 "sample/bindmonitor.c" - r2 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_JGE_REG pc=82 dst=r1 src=r2 offset=21 imm=0 + r2 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); + // EBPF_OP_JGE_REG pc=82 dst=r1 src=r2 offset=18 imm=0 #line 132 "sample/bindmonitor.c" if (r1 >= r2) { #line 132 "sample/bindmonitor.c" - goto label_7; + goto label_6; #line 132 "sample/bindmonitor.c" } // EBPF_OP_ADD64_IMM pc=83 dst=r1 src=r0 offset=0 imm=1 #line 136 "sample/bindmonitor.c" r1 += IMMEDIATE(1); - // EBPF_OP_STXW pc=84 dst=r9 src=r1 offset=0 imm=0 + // EBPF_OP_STXW pc=84 dst=r0 src=r1 offset=0 imm=0 #line 136 "sample/bindmonitor.c" - *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_JA pc=85 dst=r0 src=r0 offset=17 imm=0 + *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; + // EBPF_OP_JA pc=85 dst=r0 src=r0 offset=14 imm=0 #line 136 "sample/bindmonitor.c" - goto label_6; + goto label_5; label_2: - // EBPF_OP_LDXW pc=86 dst=r1 src=r9 offset=0 imm=0 -#line 139 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=87 dst=r1 src=r0 offset=8 imm=0 + // EBPF_OP_JEQ_IMM pc=86 dst=r1 src=r0 offset=6 imm=0 #line 139 "sample/bindmonitor.c" if (r1 == IMMEDIATE(0)) { #line 139 "sample/bindmonitor.c" - goto label_5; + goto label_4; #line 139 "sample/bindmonitor.c" } - // EBPF_OP_ADD64_IMM pc=88 dst=r1 src=r0 offset=0 imm=-1 + // EBPF_OP_ADD64_IMM pc=87 dst=r1 src=r0 offset=0 imm=-1 #line 140 "sample/bindmonitor.c" r1 += IMMEDIATE(-1); - // EBPF_OP_STXW pc=89 dst=r9 src=r1 offset=0 imm=0 + // EBPF_OP_STXW pc=88 dst=r0 src=r1 offset=0 imm=0 #line 140 "sample/bindmonitor.c" - *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_JA pc=90 dst=r0 src=r0 offset=1 imm=0 -#line 140 "sample/bindmonitor.c" - goto label_4; + *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; label_3: - // EBPF_OP_LDXW pc=91 dst=r1 src=r9 offset=0 imm=0 -#line 147 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)); -label_4: - // EBPF_OP_MOV64_IMM pc=92 dst=r8 src=r0 offset=0 imm=0 -#line 147 "sample/bindmonitor.c" - r8 = IMMEDIATE(0); - // EBPF_OP_LSH64_IMM pc=93 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_MOV64_IMM pc=89 dst=r7 src=r0 offset=0 imm=0 +#line 140 "sample/bindmonitor.c" + r7 = IMMEDIATE(0); + // EBPF_OP_LSH64_IMM pc=90 dst=r1 src=r0 offset=0 imm=32 #line 147 "sample/bindmonitor.c" r1 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_RSH64_IMM pc=94 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=91 dst=r1 src=r0 offset=0 imm=32 #line 147 "sample/bindmonitor.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JNE_IMM pc=95 dst=r1 src=r0 offset=8 imm=0 + // EBPF_OP_JNE_IMM pc=92 dst=r1 src=r0 offset=8 imm=0 #line 147 "sample/bindmonitor.c" if (r1 != IMMEDIATE(0)) { #line 147 "sample/bindmonitor.c" - goto label_7; + goto label_6; #line 147 "sample/bindmonitor.c" } -label_5: - // EBPF_OP_LDXDW pc=96 dst=r1 src=r6 offset=16 imm=0 +label_4: + // EBPF_OP_LDXDW pc=93 dst=r1 src=r6 offset=16 imm=0 #line 148 "sample/bindmonitor.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(16)); - // EBPF_OP_STXDW pc=97 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=94 dst=r10 src=r1 offset=-80 imm=0 #line 148 "sample/bindmonitor.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_MOV64_REG pc=98 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=95 dst=r2 src=r10 offset=0 imm=0 #line 148 "sample/bindmonitor.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=99 dst=r2 src=r0 offset=0 imm=-80 + // EBPF_OP_ADD64_IMM pc=96 dst=r2 src=r0 offset=0 imm=-80 #line 148 "sample/bindmonitor.c" r2 += IMMEDIATE(-80); - // EBPF_OP_LDDW pc=100 dst=r1 src=r1 offset=0 imm=2 + // EBPF_OP_LDDW pc=97 dst=r1 src=r1 offset=0 imm=2 #line 149 "sample/bindmonitor.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_CALL pc=102 dst=r0 src=r0 offset=0 imm=3 + // EBPF_OP_CALL pc=99 dst=r0 src=r0 offset=0 imm=3 #line 149 "sample/bindmonitor.c" r0 = BindMonitor_helpers[6].address(r1, r2, r3, r4, r5, context); #line 149 "sample/bindmonitor.c" @@ -522,15 +510,15 @@ BindMonitor(void* context) return 0; #line 149 "sample/bindmonitor.c" } -label_6: - // EBPF_OP_MOV64_IMM pc=103 dst=r8 src=r0 offset=0 imm=0 +label_5: + // EBPF_OP_MOV64_IMM pc=100 dst=r7 src=r0 offset=0 imm=0 #line 149 "sample/bindmonitor.c" - r8 = IMMEDIATE(0); -label_7: - // EBPF_OP_MOV64_REG pc=104 dst=r0 src=r8 offset=0 imm=0 + r7 = IMMEDIATE(0); +label_6: + // EBPF_OP_MOV64_REG pc=101 dst=r0 src=r7 offset=0 imm=0 #line 153 "sample/bindmonitor.c" - r0 = r8; - // EBPF_OP_EXIT pc=105 dst=r0 src=r0 offset=0 imm=0 + r0 = r7; + // EBPF_OP_EXIT pc=102 dst=r0 src=r0 offset=0 imm=0 #line 153 "sample/bindmonitor.c" return r0; #line 112 "sample/bindmonitor.c" @@ -550,7 +538,7 @@ static program_entry_t _programs[] = { 3, BindMonitor_helpers, 7, - 106, + 103, &BindMonitor_program_type_guid, &BindMonitor_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/bindmonitor_sys.c b/tests/bpf2c_tests/expected/bindmonitor_sys.c index 804e263ff1..4b623238b2 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_sys.c +++ b/tests/bpf2c_tests/expected/bindmonitor_sys.c @@ -269,8 +269,6 @@ BindMonitor(void* context) register uint64_t r7 = 0; #line 112 "sample/bindmonitor.c" register uint64_t r8 = 0; -#line 112 "sample/bindmonitor.c" - register uint64_t r9 = 0; #line 112 "sample/bindmonitor.c" register uint64_t r10 = 0; @@ -282,12 +280,12 @@ BindMonitor(void* context) // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 #line 112 "sample/bindmonitor.c" r6 = r1; - // EBPF_OP_MOV64_IMM pc=1 dst=r8 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=1 dst=r7 src=r0 offset=0 imm=0 #line 112 "sample/bindmonitor.c" - r8 = IMMEDIATE(0); - // EBPF_OP_STXW pc=2 dst=r10 src=r8 offset=-84 imm=0 + r7 = IMMEDIATE(0); + // EBPF_OP_STXW pc=2 dst=r10 src=r7 offset=-84 imm=0 #line 114 "sample/bindmonitor.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-84)) = (uint32_t)r8; + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-84)) = (uint32_t)r7; // EBPF_OP_CALL pc=3 dst=r0 src=r0 offset=0 imm=19 #line 61 "sample/bindmonitor.c" r0 = BindMonitor_helpers[0].address(r1, r2, r3, r4, r5, context); @@ -300,9 +298,9 @@ BindMonitor(void* context) // EBPF_OP_STXDW pc=4 dst=r10 src=r0 offset=-8 imm=0 #line 61 "sample/bindmonitor.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r0; - // EBPF_OP_STXDW pc=5 dst=r10 src=r8 offset=-72 imm=0 + // EBPF_OP_STXDW pc=5 dst=r10 src=r7 offset=-72 imm=0 #line 62 "sample/bindmonitor.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r8; + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r7; // EBPF_OP_MOV64_REG pc=6 dst=r1 src=r6 offset=0 imm=0 #line 64 "sample/bindmonitor.c" r1 = r6; @@ -378,26 +376,26 @@ BindMonitor(void* context) return 0; #line 119 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_REG pc=25 dst=r7 src=r0 offset=0 imm=0 -#line 119 "sample/bindmonitor.c" - r7 = r0; - // EBPF_OP_JEQ_IMM pc=26 dst=r7 src=r0 offset=77 imm=0 + // EBPF_OP_JEQ_IMM pc=25 dst=r0 src=r0 offset=75 imm=0 #line 120 "sample/bindmonitor.c" - if (r7 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 120 "sample/bindmonitor.c" - goto label_7; + goto label_6; #line 120 "sample/bindmonitor.c" } - // EBPF_OP_LDXW pc=27 dst=r1 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=26 dst=r1 src=r0 offset=0 imm=0 #line 120 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=28 dst=r1 src=r0 offset=75 imm=0 + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_JEQ_IMM pc=27 dst=r1 src=r0 offset=73 imm=0 #line 120 "sample/bindmonitor.c" if (r1 == IMMEDIATE(0)) { #line 120 "sample/bindmonitor.c" - goto label_7; + goto label_6; #line 120 "sample/bindmonitor.c" } + // EBPF_OP_MOV64_REG pc=28 dst=r8 src=r0 offset=0 imm=0 +#line 120 "sample/bindmonitor.c" + r8 = r0; // EBPF_OP_LDXDW pc=29 dst=r1 src=r6 offset=16 imm=0 #line 73 "sample/bindmonitor.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(16)); @@ -452,68 +450,65 @@ BindMonitor(void* context) return 0; #line 78 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_REG pc=46 dst=r9 src=r0 offset=0 imm=0 -#line 78 "sample/bindmonitor.c" - r9 = r0; - // EBPF_OP_JNE_IMM pc=47 dst=r9 src=r0 offset=28 imm=0 + // EBPF_OP_JNE_IMM pc=46 dst=r0 src=r0 offset=29 imm=0 #line 79 "sample/bindmonitor.c" - if (r9 != IMMEDIATE(0)) { + if (r0 != IMMEDIATE(0)) { #line 79 "sample/bindmonitor.c" goto label_1; #line 79 "sample/bindmonitor.c" } - // EBPF_OP_LDXW pc=48 dst=r1 src=r6 offset=44 imm=0 + // EBPF_OP_LDXW pc=47 dst=r1 src=r6 offset=44 imm=0 #line 83 "sample/bindmonitor.c" r1 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); - // EBPF_OP_JNE_IMM pc=49 dst=r1 src=r0 offset=53 imm=0 + // EBPF_OP_JNE_IMM pc=48 dst=r1 src=r0 offset=51 imm=0 #line 83 "sample/bindmonitor.c" if (r1 != IMMEDIATE(0)) { #line 83 "sample/bindmonitor.c" - goto label_6; + goto label_5; #line 83 "sample/bindmonitor.c" } - // EBPF_OP_LDXDW pc=50 dst=r1 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=49 dst=r1 src=r6 offset=0 imm=0 #line 87 "sample/bindmonitor.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=51 dst=r1 src=r0 offset=51 imm=0 + // EBPF_OP_JEQ_IMM pc=50 dst=r1 src=r0 offset=49 imm=0 #line 87 "sample/bindmonitor.c" if (r1 == IMMEDIATE(0)) { #line 87 "sample/bindmonitor.c" - goto label_6; + goto label_5; #line 87 "sample/bindmonitor.c" } - // EBPF_OP_LDXDW pc=52 dst=r1 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=51 dst=r1 src=r6 offset=8 imm=0 #line 87 "sample/bindmonitor.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_JEQ_IMM pc=53 dst=r1 src=r0 offset=49 imm=0 + // EBPF_OP_JEQ_IMM pc=52 dst=r1 src=r0 offset=47 imm=0 #line 87 "sample/bindmonitor.c" if (r1 == IMMEDIATE(0)) { #line 87 "sample/bindmonitor.c" - goto label_6; + goto label_5; #line 87 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_REG pc=54 dst=r8 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=53 dst=r7 src=r10 offset=0 imm=0 #line 87 "sample/bindmonitor.c" - r8 = r10; - // EBPF_OP_ADD64_IMM pc=55 dst=r8 src=r0 offset=0 imm=-8 + r7 = r10; + // EBPF_OP_ADD64_IMM pc=54 dst=r7 src=r0 offset=0 imm=-8 #line 91 "sample/bindmonitor.c" - r8 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=56 dst=r3 src=r10 offset=0 imm=0 + r7 += IMMEDIATE(-8); + // EBPF_OP_MOV64_REG pc=55 dst=r3 src=r10 offset=0 imm=0 #line 91 "sample/bindmonitor.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=57 dst=r3 src=r0 offset=0 imm=-80 + // EBPF_OP_ADD64_IMM pc=56 dst=r3 src=r0 offset=0 imm=-80 #line 91 "sample/bindmonitor.c" r3 += IMMEDIATE(-80); - // EBPF_OP_LDDW pc=58 dst=r1 src=r1 offset=0 imm=2 + // EBPF_OP_LDDW pc=57 dst=r1 src=r1 offset=0 imm=2 #line 91 "sample/bindmonitor.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_REG pc=60 dst=r2 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=59 dst=r2 src=r7 offset=0 imm=0 #line 91 "sample/bindmonitor.c" - r2 = r8; - // EBPF_OP_MOV64_IMM pc=61 dst=r4 src=r0 offset=0 imm=0 + r2 = r7; + // EBPF_OP_MOV64_IMM pc=60 dst=r4 src=r0 offset=0 imm=0 #line 91 "sample/bindmonitor.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=62 dst=r0 src=r0 offset=0 imm=2 + // EBPF_OP_CALL pc=61 dst=r0 src=r0 offset=0 imm=2 #line 91 "sample/bindmonitor.c" r0 = BindMonitor_helpers[3].address(r1, r2, r3, r4, r5, context); #line 91 "sample/bindmonitor.c" @@ -522,13 +517,13 @@ BindMonitor(void* context) return 0; #line 91 "sample/bindmonitor.c" } - // EBPF_OP_LDDW pc=63 dst=r1 src=r1 offset=0 imm=2 + // EBPF_OP_LDDW pc=62 dst=r1 src=r1 offset=0 imm=2 #line 92 "sample/bindmonitor.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_REG pc=65 dst=r2 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=64 dst=r2 src=r7 offset=0 imm=0 #line 92 "sample/bindmonitor.c" - r2 = r8; - // EBPF_OP_CALL pc=66 dst=r0 src=r0 offset=0 imm=1 + r2 = r7; + // EBPF_OP_CALL pc=65 dst=r0 src=r0 offset=0 imm=1 #line 92 "sample/bindmonitor.c" r0 = BindMonitor_helpers[4].address(r1, r2, r3, r4, r5, context); #line 92 "sample/bindmonitor.c" @@ -537,35 +532,35 @@ BindMonitor(void* context) return 0; #line 92 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_REG pc=67 dst=r9 src=r0 offset=0 imm=0 -#line 92 "sample/bindmonitor.c" - r9 = r0; - // EBPF_OP_JEQ_IMM pc=68 dst=r9 src=r0 offset=34 imm=0 + // EBPF_OP_JEQ_IMM pc=66 dst=r0 src=r0 offset=33 imm=0 #line 93 "sample/bindmonitor.c" - if (r9 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 93 "sample/bindmonitor.c" - goto label_6; + goto label_5; #line 93 "sample/bindmonitor.c" } - // EBPF_OP_LDXDW pc=69 dst=r3 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=67 dst=r3 src=r6 offset=0 imm=0 #line 97 "sample/bindmonitor.c" r3 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_LDXDW pc=70 dst=r4 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=68 dst=r4 src=r6 offset=8 imm=0 #line 97 "sample/bindmonitor.c" r4 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_SUB64_REG pc=71 dst=r4 src=r3 offset=0 imm=0 + // EBPF_OP_SUB64_REG pc=69 dst=r4 src=r3 offset=0 imm=0 #line 97 "sample/bindmonitor.c" r4 -= r3; - // EBPF_OP_MOV64_REG pc=72 dst=r1 src=r9 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=70 dst=r1 src=r0 offset=0 imm=0 #line 97 "sample/bindmonitor.c" - r1 = r9; - // EBPF_OP_ADD64_IMM pc=73 dst=r1 src=r0 offset=0 imm=4 + r1 = r0; + // EBPF_OP_ADD64_IMM pc=71 dst=r1 src=r0 offset=0 imm=4 #line 97 "sample/bindmonitor.c" r1 += IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=74 dst=r2 src=r0 offset=0 imm=64 + // EBPF_OP_MOV64_IMM pc=72 dst=r2 src=r0 offset=0 imm=64 #line 97 "sample/bindmonitor.c" r2 = IMMEDIATE(64); - // EBPF_OP_CALL pc=75 dst=r0 src=r0 offset=0 imm=22 + // EBPF_OP_MOV64_REG pc=73 dst=r7 src=r0 offset=0 imm=0 +#line 97 "sample/bindmonitor.c" + r7 = r0; + // EBPF_OP_CALL pc=74 dst=r0 src=r0 offset=0 imm=22 #line 97 "sample/bindmonitor.c" r0 = BindMonitor_helpers[5].address(r1, r2, r3, r4, r5, context); #line 97 "sample/bindmonitor.c" @@ -574,107 +569,100 @@ BindMonitor(void* context) return 0; #line 97 "sample/bindmonitor.c" } + // EBPF_OP_MOV64_REG pc=75 dst=r0 src=r7 offset=0 imm=0 +#line 97 "sample/bindmonitor.c" + r0 = r7; label_1: - // EBPF_OP_LDXW pc=76 dst=r1 src=r6 offset=44 imm=0 + // EBPF_OP_LDXW pc=76 dst=r1 src=r0 offset=0 imm=0 +#line 97 "sample/bindmonitor.c" + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_LDXW pc=77 dst=r2 src=r6 offset=44 imm=0 #line 130 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); - // EBPF_OP_JEQ_IMM pc=77 dst=r1 src=r0 offset=8 imm=2 + r2 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); + // EBPF_OP_JEQ_IMM pc=78 dst=r2 src=r0 offset=7 imm=2 #line 130 "sample/bindmonitor.c" - if (r1 == IMMEDIATE(2)) { + if (r2 == IMMEDIATE(2)) { #line 130 "sample/bindmonitor.c" goto label_2; #line 130 "sample/bindmonitor.c" } - // EBPF_OP_JNE_IMM pc=78 dst=r1 src=r0 offset=12 imm=0 + // EBPF_OP_JNE_IMM pc=79 dst=r2 src=r0 offset=9 imm=0 #line 130 "sample/bindmonitor.c" - if (r1 != IMMEDIATE(0)) { + if (r2 != IMMEDIATE(0)) { #line 130 "sample/bindmonitor.c" goto label_3; #line 130 "sample/bindmonitor.c" } - // EBPF_OP_MOV64_IMM pc=79 dst=r8 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=80 dst=r7 src=r0 offset=0 imm=1 #line 130 "sample/bindmonitor.c" - r8 = IMMEDIATE(1); - // EBPF_OP_LDXW pc=80 dst=r1 src=r9 offset=0 imm=0 + r7 = IMMEDIATE(1); + // EBPF_OP_LDXW pc=81 dst=r2 src=r8 offset=0 imm=0 #line 132 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)); - // EBPF_OP_LDXW pc=81 dst=r2 src=r7 offset=0 imm=0 -#line 132 "sample/bindmonitor.c" - r2 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_JGE_REG pc=82 dst=r1 src=r2 offset=21 imm=0 + r2 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); + // EBPF_OP_JGE_REG pc=82 dst=r1 src=r2 offset=18 imm=0 #line 132 "sample/bindmonitor.c" if (r1 >= r2) { #line 132 "sample/bindmonitor.c" - goto label_7; + goto label_6; #line 132 "sample/bindmonitor.c" } // EBPF_OP_ADD64_IMM pc=83 dst=r1 src=r0 offset=0 imm=1 #line 136 "sample/bindmonitor.c" r1 += IMMEDIATE(1); - // EBPF_OP_STXW pc=84 dst=r9 src=r1 offset=0 imm=0 + // EBPF_OP_STXW pc=84 dst=r0 src=r1 offset=0 imm=0 #line 136 "sample/bindmonitor.c" - *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_JA pc=85 dst=r0 src=r0 offset=17 imm=0 + *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; + // EBPF_OP_JA pc=85 dst=r0 src=r0 offset=14 imm=0 #line 136 "sample/bindmonitor.c" - goto label_6; + goto label_5; label_2: - // EBPF_OP_LDXW pc=86 dst=r1 src=r9 offset=0 imm=0 -#line 139 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=87 dst=r1 src=r0 offset=8 imm=0 + // EBPF_OP_JEQ_IMM pc=86 dst=r1 src=r0 offset=6 imm=0 #line 139 "sample/bindmonitor.c" if (r1 == IMMEDIATE(0)) { #line 139 "sample/bindmonitor.c" - goto label_5; + goto label_4; #line 139 "sample/bindmonitor.c" } - // EBPF_OP_ADD64_IMM pc=88 dst=r1 src=r0 offset=0 imm=-1 + // EBPF_OP_ADD64_IMM pc=87 dst=r1 src=r0 offset=0 imm=-1 #line 140 "sample/bindmonitor.c" r1 += IMMEDIATE(-1); - // EBPF_OP_STXW pc=89 dst=r9 src=r1 offset=0 imm=0 + // EBPF_OP_STXW pc=88 dst=r0 src=r1 offset=0 imm=0 #line 140 "sample/bindmonitor.c" - *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_JA pc=90 dst=r0 src=r0 offset=1 imm=0 -#line 140 "sample/bindmonitor.c" - goto label_4; + *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; label_3: - // EBPF_OP_LDXW pc=91 dst=r1 src=r9 offset=0 imm=0 -#line 147 "sample/bindmonitor.c" - r1 = *(uint32_t*)(uintptr_t)(r9 + OFFSET(0)); -label_4: - // EBPF_OP_MOV64_IMM pc=92 dst=r8 src=r0 offset=0 imm=0 -#line 147 "sample/bindmonitor.c" - r8 = IMMEDIATE(0); - // EBPF_OP_LSH64_IMM pc=93 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_MOV64_IMM pc=89 dst=r7 src=r0 offset=0 imm=0 +#line 140 "sample/bindmonitor.c" + r7 = IMMEDIATE(0); + // EBPF_OP_LSH64_IMM pc=90 dst=r1 src=r0 offset=0 imm=32 #line 147 "sample/bindmonitor.c" r1 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_RSH64_IMM pc=94 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=91 dst=r1 src=r0 offset=0 imm=32 #line 147 "sample/bindmonitor.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JNE_IMM pc=95 dst=r1 src=r0 offset=8 imm=0 + // EBPF_OP_JNE_IMM pc=92 dst=r1 src=r0 offset=8 imm=0 #line 147 "sample/bindmonitor.c" if (r1 != IMMEDIATE(0)) { #line 147 "sample/bindmonitor.c" - goto label_7; + goto label_6; #line 147 "sample/bindmonitor.c" } -label_5: - // EBPF_OP_LDXDW pc=96 dst=r1 src=r6 offset=16 imm=0 +label_4: + // EBPF_OP_LDXDW pc=93 dst=r1 src=r6 offset=16 imm=0 #line 148 "sample/bindmonitor.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(16)); - // EBPF_OP_STXDW pc=97 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=94 dst=r10 src=r1 offset=-80 imm=0 #line 148 "sample/bindmonitor.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_MOV64_REG pc=98 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=95 dst=r2 src=r10 offset=0 imm=0 #line 148 "sample/bindmonitor.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=99 dst=r2 src=r0 offset=0 imm=-80 + // EBPF_OP_ADD64_IMM pc=96 dst=r2 src=r0 offset=0 imm=-80 #line 148 "sample/bindmonitor.c" r2 += IMMEDIATE(-80); - // EBPF_OP_LDDW pc=100 dst=r1 src=r1 offset=0 imm=2 + // EBPF_OP_LDDW pc=97 dst=r1 src=r1 offset=0 imm=2 #line 149 "sample/bindmonitor.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_CALL pc=102 dst=r0 src=r0 offset=0 imm=3 + // EBPF_OP_CALL pc=99 dst=r0 src=r0 offset=0 imm=3 #line 149 "sample/bindmonitor.c" r0 = BindMonitor_helpers[6].address(r1, r2, r3, r4, r5, context); #line 149 "sample/bindmonitor.c" @@ -683,15 +671,15 @@ BindMonitor(void* context) return 0; #line 149 "sample/bindmonitor.c" } -label_6: - // EBPF_OP_MOV64_IMM pc=103 dst=r8 src=r0 offset=0 imm=0 +label_5: + // EBPF_OP_MOV64_IMM pc=100 dst=r7 src=r0 offset=0 imm=0 #line 149 "sample/bindmonitor.c" - r8 = IMMEDIATE(0); -label_7: - // EBPF_OP_MOV64_REG pc=104 dst=r0 src=r8 offset=0 imm=0 + r7 = IMMEDIATE(0); +label_6: + // EBPF_OP_MOV64_REG pc=101 dst=r0 src=r7 offset=0 imm=0 #line 153 "sample/bindmonitor.c" - r0 = r8; - // EBPF_OP_EXIT pc=105 dst=r0 src=r0 offset=0 imm=0 + r0 = r7; + // EBPF_OP_EXIT pc=102 dst=r0 src=r0 offset=0 imm=0 #line 153 "sample/bindmonitor.c" return r0; #line 112 "sample/bindmonitor.c" @@ -711,7 +699,7 @@ static program_entry_t _programs[] = { 3, BindMonitor_helpers, 7, - 106, + 103, &BindMonitor_program_type_guid, &BindMonitor_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/bindmonitor_tailcall_dll.c b/tests/bpf2c_tests/expected/bindmonitor_tailcall_dll.c index c3f16c33ff..07db56bec6 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_tailcall_dll.c +++ b/tests/bpf2c_tests/expected/bindmonitor_tailcall_dll.c @@ -396,8 +396,6 @@ BindMonitor_Callee1(void* context) register uint64_t r7 = 0; #line 152 "sample/bindmonitor_tailcall.c" register uint64_t r8 = 0; -#line 152 "sample/bindmonitor_tailcall.c" - register uint64_t r9 = 0; #line 152 "sample/bindmonitor_tailcall.c" register uint64_t r10 = 0; @@ -409,12 +407,12 @@ BindMonitor_Callee1(void* context) // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 #line 152 "sample/bindmonitor_tailcall.c" r6 = r1; - // EBPF_OP_MOV64_IMM pc=1 dst=r9 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=1 dst=r7 src=r0 offset=0 imm=0 #line 152 "sample/bindmonitor_tailcall.c" - r9 = IMMEDIATE(0); - // EBPF_OP_STXW pc=2 dst=r10 src=r9 offset=-84 imm=0 + r7 = IMMEDIATE(0); + // EBPF_OP_STXW pc=2 dst=r10 src=r7 offset=-84 imm=0 #line 154 "sample/bindmonitor_tailcall.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-84)) = (uint32_t)r9; + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-84)) = (uint32_t)r7; // EBPF_OP_MOV64_REG pc=3 dst=r2 src=r10 offset=0 imm=0 #line 154 "sample/bindmonitor_tailcall.c" r2 = r10; @@ -433,26 +431,26 @@ BindMonitor_Callee1(void* context) return 0; #line 156 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_REG pc=8 dst=r7 src=r0 offset=0 imm=0 -#line 156 "sample/bindmonitor_tailcall.c" - r7 = r0; - // EBPF_OP_JEQ_IMM pc=9 dst=r7 src=r0 offset=76 imm=0 + // EBPF_OP_JEQ_IMM pc=8 dst=r0 src=r0 offset=75 imm=0 #line 157 "sample/bindmonitor_tailcall.c" - if (r7 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 157 "sample/bindmonitor_tailcall.c" goto label_6; #line 157 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXW pc=10 dst=r1 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=9 dst=r1 src=r0 offset=0 imm=0 #line 157 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=11 dst=r1 src=r0 offset=74 imm=0 + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_JEQ_IMM pc=10 dst=r1 src=r0 offset=73 imm=0 #line 157 "sample/bindmonitor_tailcall.c" if (r1 == IMMEDIATE(0)) { #line 157 "sample/bindmonitor_tailcall.c" goto label_6; #line 157 "sample/bindmonitor_tailcall.c" } + // EBPF_OP_MOV64_REG pc=11 dst=r8 src=r0 offset=0 imm=0 +#line 157 "sample/bindmonitor_tailcall.c" + r8 = r0; // EBPF_OP_LDXDW pc=12 dst=r1 src=r6 offset=16 imm=0 #line 81 "sample/bindmonitor_tailcall.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(16)); @@ -507,68 +505,65 @@ BindMonitor_Callee1(void* context) return 0; #line 86 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_REG pc=29 dst=r8 src=r0 offset=0 imm=0 -#line 86 "sample/bindmonitor_tailcall.c" - r8 = r0; - // EBPF_OP_JNE_IMM pc=30 dst=r8 src=r0 offset=28 imm=0 + // EBPF_OP_JNE_IMM pc=29 dst=r0 src=r0 offset=29 imm=0 #line 87 "sample/bindmonitor_tailcall.c" - if (r8 != IMMEDIATE(0)) { + if (r0 != IMMEDIATE(0)) { #line 87 "sample/bindmonitor_tailcall.c" goto label_1; #line 87 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXW pc=31 dst=r1 src=r6 offset=44 imm=0 + // EBPF_OP_LDXW pc=30 dst=r1 src=r6 offset=44 imm=0 #line 91 "sample/bindmonitor_tailcall.c" r1 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); - // EBPF_OP_JNE_IMM pc=32 dst=r1 src=r0 offset=53 imm=0 + // EBPF_OP_JNE_IMM pc=31 dst=r1 src=r0 offset=51 imm=0 #line 91 "sample/bindmonitor_tailcall.c" if (r1 != IMMEDIATE(0)) { #line 91 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; #line 91 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXDW pc=33 dst=r1 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=32 dst=r1 src=r6 offset=0 imm=0 #line 95 "sample/bindmonitor_tailcall.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=34 dst=r1 src=r0 offset=51 imm=0 + // EBPF_OP_JEQ_IMM pc=33 dst=r1 src=r0 offset=49 imm=0 #line 95 "sample/bindmonitor_tailcall.c" if (r1 == IMMEDIATE(0)) { #line 95 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; #line 95 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXDW pc=35 dst=r1 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=34 dst=r1 src=r6 offset=8 imm=0 #line 95 "sample/bindmonitor_tailcall.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_JEQ_IMM pc=36 dst=r1 src=r0 offset=49 imm=0 + // EBPF_OP_JEQ_IMM pc=35 dst=r1 src=r0 offset=47 imm=0 #line 95 "sample/bindmonitor_tailcall.c" if (r1 == IMMEDIATE(0)) { #line 95 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; #line 95 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_REG pc=37 dst=r8 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=36 dst=r7 src=r10 offset=0 imm=0 #line 95 "sample/bindmonitor_tailcall.c" - r8 = r10; - // EBPF_OP_ADD64_IMM pc=38 dst=r8 src=r0 offset=0 imm=-8 + r7 = r10; + // EBPF_OP_ADD64_IMM pc=37 dst=r7 src=r0 offset=0 imm=-8 #line 99 "sample/bindmonitor_tailcall.c" - r8 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=39 dst=r3 src=r10 offset=0 imm=0 + r7 += IMMEDIATE(-8); + // EBPF_OP_MOV64_REG pc=38 dst=r3 src=r10 offset=0 imm=0 #line 99 "sample/bindmonitor_tailcall.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=40 dst=r3 src=r0 offset=0 imm=-80 + // EBPF_OP_ADD64_IMM pc=39 dst=r3 src=r0 offset=0 imm=-80 #line 99 "sample/bindmonitor_tailcall.c" r3 += IMMEDIATE(-80); - // EBPF_OP_LDDW pc=41 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=40 dst=r1 src=r1 offset=0 imm=1 #line 99 "sample/bindmonitor_tailcall.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_MOV64_REG pc=43 dst=r2 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=42 dst=r2 src=r7 offset=0 imm=0 #line 99 "sample/bindmonitor_tailcall.c" - r2 = r8; - // EBPF_OP_MOV64_IMM pc=44 dst=r4 src=r0 offset=0 imm=0 + r2 = r7; + // EBPF_OP_MOV64_IMM pc=43 dst=r4 src=r0 offset=0 imm=0 #line 99 "sample/bindmonitor_tailcall.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=45 dst=r0 src=r0 offset=0 imm=2 + // EBPF_OP_CALL pc=44 dst=r0 src=r0 offset=0 imm=2 #line 99 "sample/bindmonitor_tailcall.c" r0 = BindMonitor_Callee1_helpers[1].address(r1, r2, r3, r4, r5, context); #line 99 "sample/bindmonitor_tailcall.c" @@ -577,13 +572,13 @@ BindMonitor_Callee1(void* context) return 0; #line 99 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDDW pc=46 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=45 dst=r1 src=r1 offset=0 imm=1 #line 100 "sample/bindmonitor_tailcall.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_MOV64_REG pc=48 dst=r2 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=47 dst=r2 src=r7 offset=0 imm=0 #line 100 "sample/bindmonitor_tailcall.c" - r2 = r8; - // EBPF_OP_CALL pc=49 dst=r0 src=r0 offset=0 imm=1 + r2 = r7; + // EBPF_OP_CALL pc=48 dst=r0 src=r0 offset=0 imm=1 #line 100 "sample/bindmonitor_tailcall.c" r0 = BindMonitor_Callee1_helpers[0].address(r1, r2, r3, r4, r5, context); #line 100 "sample/bindmonitor_tailcall.c" @@ -592,35 +587,35 @@ BindMonitor_Callee1(void* context) return 0; #line 100 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_REG pc=50 dst=r8 src=r0 offset=0 imm=0 -#line 100 "sample/bindmonitor_tailcall.c" - r8 = r0; - // EBPF_OP_JEQ_IMM pc=51 dst=r8 src=r0 offset=34 imm=0 + // EBPF_OP_JEQ_IMM pc=49 dst=r0 src=r0 offset=33 imm=0 #line 101 "sample/bindmonitor_tailcall.c" - if (r8 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 101 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; #line 101 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXDW pc=52 dst=r3 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=50 dst=r3 src=r6 offset=0 imm=0 #line 105 "sample/bindmonitor_tailcall.c" r3 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_LDXDW pc=53 dst=r4 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=51 dst=r4 src=r6 offset=8 imm=0 #line 105 "sample/bindmonitor_tailcall.c" r4 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_SUB64_REG pc=54 dst=r4 src=r3 offset=0 imm=0 + // EBPF_OP_SUB64_REG pc=52 dst=r4 src=r3 offset=0 imm=0 #line 105 "sample/bindmonitor_tailcall.c" r4 -= r3; - // EBPF_OP_MOV64_REG pc=55 dst=r1 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=53 dst=r1 src=r0 offset=0 imm=0 #line 105 "sample/bindmonitor_tailcall.c" - r1 = r8; - // EBPF_OP_ADD64_IMM pc=56 dst=r1 src=r0 offset=0 imm=4 + r1 = r0; + // EBPF_OP_ADD64_IMM pc=54 dst=r1 src=r0 offset=0 imm=4 #line 105 "sample/bindmonitor_tailcall.c" r1 += IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=57 dst=r2 src=r0 offset=0 imm=64 + // EBPF_OP_MOV64_IMM pc=55 dst=r2 src=r0 offset=0 imm=64 #line 105 "sample/bindmonitor_tailcall.c" r2 = IMMEDIATE(64); - // EBPF_OP_CALL pc=58 dst=r0 src=r0 offset=0 imm=22 + // EBPF_OP_MOV64_REG pc=56 dst=r7 src=r0 offset=0 imm=0 +#line 105 "sample/bindmonitor_tailcall.c" + r7 = r0; + // EBPF_OP_CALL pc=57 dst=r0 src=r0 offset=0 imm=22 #line 105 "sample/bindmonitor_tailcall.c" r0 = BindMonitor_Callee1_helpers[2].address(r1, r2, r3, r4, r5, context); #line 105 "sample/bindmonitor_tailcall.c" @@ -629,34 +624,37 @@ BindMonitor_Callee1(void* context) return 0; #line 105 "sample/bindmonitor_tailcall.c" } + // EBPF_OP_MOV64_REG pc=58 dst=r0 src=r7 offset=0 imm=0 +#line 105 "sample/bindmonitor_tailcall.c" + r0 = r7; label_1: - // EBPF_OP_LDXW pc=59 dst=r1 src=r6 offset=44 imm=0 + // EBPF_OP_LDXW pc=59 dst=r1 src=r0 offset=0 imm=0 +#line 105 "sample/bindmonitor_tailcall.c" + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_LDXW pc=60 dst=r2 src=r6 offset=44 imm=0 #line 167 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); - // EBPF_OP_JEQ_IMM pc=60 dst=r1 src=r0 offset=9 imm=2 + r2 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); + // EBPF_OP_JEQ_IMM pc=61 dst=r2 src=r0 offset=7 imm=2 #line 167 "sample/bindmonitor_tailcall.c" - if (r1 == IMMEDIATE(2)) { + if (r2 == IMMEDIATE(2)) { #line 167 "sample/bindmonitor_tailcall.c" goto label_2; #line 167 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_JNE_IMM pc=61 dst=r1 src=r0 offset=13 imm=0 + // EBPF_OP_JNE_IMM pc=62 dst=r2 src=r0 offset=9 imm=0 #line 167 "sample/bindmonitor_tailcall.c" - if (r1 != IMMEDIATE(0)) { + if (r2 != IMMEDIATE(0)) { #line 167 "sample/bindmonitor_tailcall.c" goto label_3; #line 167 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_IMM pc=62 dst=r9 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=63 dst=r7 src=r0 offset=0 imm=1 #line 167 "sample/bindmonitor_tailcall.c" - r9 = IMMEDIATE(1); - // EBPF_OP_LDXW pc=63 dst=r1 src=r8 offset=0 imm=0 -#line 169 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); - // EBPF_OP_LDXW pc=64 dst=r2 src=r7 offset=0 imm=0 + r7 = IMMEDIATE(1); + // EBPF_OP_LDXW pc=64 dst=r2 src=r8 offset=0 imm=0 #line 169 "sample/bindmonitor_tailcall.c" - r2 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_JGE_REG pc=65 dst=r1 src=r2 offset=20 imm=0 + r2 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); + // EBPF_OP_JGE_REG pc=65 dst=r1 src=r2 offset=18 imm=0 #line 169 "sample/bindmonitor_tailcall.c" if (r1 >= r2) { #line 169 "sample/bindmonitor_tailcall.c" @@ -666,70 +664,60 @@ BindMonitor_Callee1(void* context) // EBPF_OP_ADD64_IMM pc=66 dst=r1 src=r0 offset=0 imm=1 #line 173 "sample/bindmonitor_tailcall.c" r1 += IMMEDIATE(1); - // EBPF_OP_STXW pc=67 dst=r8 src=r1 offset=0 imm=0 + // EBPF_OP_STXW pc=67 dst=r0 src=r1 offset=0 imm=0 #line 173 "sample/bindmonitor_tailcall.c" - *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_MOV64_IMM pc=68 dst=r9 src=r0 offset=0 imm=0 + *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; + // EBPF_OP_JA pc=68 dst=r0 src=r0 offset=14 imm=0 #line 173 "sample/bindmonitor_tailcall.c" - r9 = IMMEDIATE(0); - // EBPF_OP_JA pc=69 dst=r0 src=r0 offset=16 imm=0 -#line 173 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; label_2: - // EBPF_OP_LDXW pc=70 dst=r1 src=r8 offset=0 imm=0 -#line 176 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=71 dst=r1 src=r0 offset=7 imm=0 + // EBPF_OP_JEQ_IMM pc=69 dst=r1 src=r0 offset=6 imm=0 #line 176 "sample/bindmonitor_tailcall.c" if (r1 == IMMEDIATE(0)) { #line 176 "sample/bindmonitor_tailcall.c" - goto label_5; + goto label_4; #line 176 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_ADD64_IMM pc=72 dst=r1 src=r0 offset=0 imm=-1 + // EBPF_OP_ADD64_IMM pc=70 dst=r1 src=r0 offset=0 imm=-1 #line 177 "sample/bindmonitor_tailcall.c" r1 += IMMEDIATE(-1); - // EBPF_OP_STXW pc=73 dst=r8 src=r1 offset=0 imm=0 -#line 177 "sample/bindmonitor_tailcall.c" - *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_JA pc=74 dst=r0 src=r0 offset=1 imm=0 + // EBPF_OP_STXW pc=71 dst=r0 src=r1 offset=0 imm=0 #line 177 "sample/bindmonitor_tailcall.c" - goto label_4; + *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; label_3: - // EBPF_OP_LDXW pc=75 dst=r1 src=r8 offset=0 imm=0 -#line 184 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); -label_4: - // EBPF_OP_LSH64_IMM pc=76 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_MOV64_IMM pc=72 dst=r7 src=r0 offset=0 imm=0 +#line 177 "sample/bindmonitor_tailcall.c" + r7 = IMMEDIATE(0); + // EBPF_OP_LSH64_IMM pc=73 dst=r1 src=r0 offset=0 imm=32 #line 184 "sample/bindmonitor_tailcall.c" r1 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_RSH64_IMM pc=77 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=74 dst=r1 src=r0 offset=0 imm=32 #line 184 "sample/bindmonitor_tailcall.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JNE_IMM pc=78 dst=r1 src=r0 offset=7 imm=0 + // EBPF_OP_JNE_IMM pc=75 dst=r1 src=r0 offset=8 imm=0 #line 184 "sample/bindmonitor_tailcall.c" if (r1 != IMMEDIATE(0)) { #line 184 "sample/bindmonitor_tailcall.c" goto label_6; #line 184 "sample/bindmonitor_tailcall.c" } -label_5: - // EBPF_OP_LDXDW pc=79 dst=r1 src=r6 offset=16 imm=0 +label_4: + // EBPF_OP_LDXDW pc=76 dst=r1 src=r6 offset=16 imm=0 #line 185 "sample/bindmonitor_tailcall.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(16)); - // EBPF_OP_STXDW pc=80 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=77 dst=r10 src=r1 offset=-80 imm=0 #line 185 "sample/bindmonitor_tailcall.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_MOV64_REG pc=81 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=78 dst=r2 src=r10 offset=0 imm=0 #line 185 "sample/bindmonitor_tailcall.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=82 dst=r2 src=r0 offset=0 imm=-80 + // EBPF_OP_ADD64_IMM pc=79 dst=r2 src=r0 offset=0 imm=-80 #line 185 "sample/bindmonitor_tailcall.c" r2 += IMMEDIATE(-80); - // EBPF_OP_LDDW pc=83 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=80 dst=r1 src=r1 offset=0 imm=1 #line 186 "sample/bindmonitor_tailcall.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_CALL pc=85 dst=r0 src=r0 offset=0 imm=3 + // EBPF_OP_CALL pc=82 dst=r0 src=r0 offset=0 imm=3 #line 186 "sample/bindmonitor_tailcall.c" r0 = BindMonitor_Callee1_helpers[3].address(r1, r2, r3, r4, r5, context); #line 186 "sample/bindmonitor_tailcall.c" @@ -738,11 +726,15 @@ BindMonitor_Callee1(void* context) return 0; #line 186 "sample/bindmonitor_tailcall.c" } +label_5: + // EBPF_OP_MOV64_IMM pc=83 dst=r7 src=r0 offset=0 imm=0 +#line 186 "sample/bindmonitor_tailcall.c" + r7 = IMMEDIATE(0); label_6: - // EBPF_OP_MOV64_REG pc=86 dst=r0 src=r9 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=84 dst=r0 src=r7 offset=0 imm=0 #line 190 "sample/bindmonitor_tailcall.c" - r0 = r9; - // EBPF_OP_EXIT pc=87 dst=r0 src=r0 offset=0 imm=0 + r0 = r7; + // EBPF_OP_EXIT pc=85 dst=r0 src=r0 offset=0 imm=0 #line 190 "sample/bindmonitor_tailcall.c" return r0; #line 152 "sample/bindmonitor_tailcall.c" @@ -790,7 +782,7 @@ static program_entry_t _programs[] = { 2, BindMonitor_Callee1_helpers, 4, - 88, + 86, &BindMonitor_Callee1_program_type_guid, &BindMonitor_Callee1_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/bindmonitor_tailcall_raw.c b/tests/bpf2c_tests/expected/bindmonitor_tailcall_raw.c index 01de491a4a..41eface68a 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_tailcall_raw.c +++ b/tests/bpf2c_tests/expected/bindmonitor_tailcall_raw.c @@ -370,8 +370,6 @@ BindMonitor_Callee1(void* context) register uint64_t r7 = 0; #line 152 "sample/bindmonitor_tailcall.c" register uint64_t r8 = 0; -#line 152 "sample/bindmonitor_tailcall.c" - register uint64_t r9 = 0; #line 152 "sample/bindmonitor_tailcall.c" register uint64_t r10 = 0; @@ -383,12 +381,12 @@ BindMonitor_Callee1(void* context) // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 #line 152 "sample/bindmonitor_tailcall.c" r6 = r1; - // EBPF_OP_MOV64_IMM pc=1 dst=r9 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=1 dst=r7 src=r0 offset=0 imm=0 #line 152 "sample/bindmonitor_tailcall.c" - r9 = IMMEDIATE(0); - // EBPF_OP_STXW pc=2 dst=r10 src=r9 offset=-84 imm=0 + r7 = IMMEDIATE(0); + // EBPF_OP_STXW pc=2 dst=r10 src=r7 offset=-84 imm=0 #line 154 "sample/bindmonitor_tailcall.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-84)) = (uint32_t)r9; + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-84)) = (uint32_t)r7; // EBPF_OP_MOV64_REG pc=3 dst=r2 src=r10 offset=0 imm=0 #line 154 "sample/bindmonitor_tailcall.c" r2 = r10; @@ -407,26 +405,26 @@ BindMonitor_Callee1(void* context) return 0; #line 156 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_REG pc=8 dst=r7 src=r0 offset=0 imm=0 -#line 156 "sample/bindmonitor_tailcall.c" - r7 = r0; - // EBPF_OP_JEQ_IMM pc=9 dst=r7 src=r0 offset=76 imm=0 + // EBPF_OP_JEQ_IMM pc=8 dst=r0 src=r0 offset=75 imm=0 #line 157 "sample/bindmonitor_tailcall.c" - if (r7 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 157 "sample/bindmonitor_tailcall.c" goto label_6; #line 157 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXW pc=10 dst=r1 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=9 dst=r1 src=r0 offset=0 imm=0 #line 157 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=11 dst=r1 src=r0 offset=74 imm=0 + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_JEQ_IMM pc=10 dst=r1 src=r0 offset=73 imm=0 #line 157 "sample/bindmonitor_tailcall.c" if (r1 == IMMEDIATE(0)) { #line 157 "sample/bindmonitor_tailcall.c" goto label_6; #line 157 "sample/bindmonitor_tailcall.c" } + // EBPF_OP_MOV64_REG pc=11 dst=r8 src=r0 offset=0 imm=0 +#line 157 "sample/bindmonitor_tailcall.c" + r8 = r0; // EBPF_OP_LDXDW pc=12 dst=r1 src=r6 offset=16 imm=0 #line 81 "sample/bindmonitor_tailcall.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(16)); @@ -481,68 +479,65 @@ BindMonitor_Callee1(void* context) return 0; #line 86 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_REG pc=29 dst=r8 src=r0 offset=0 imm=0 -#line 86 "sample/bindmonitor_tailcall.c" - r8 = r0; - // EBPF_OP_JNE_IMM pc=30 dst=r8 src=r0 offset=28 imm=0 + // EBPF_OP_JNE_IMM pc=29 dst=r0 src=r0 offset=29 imm=0 #line 87 "sample/bindmonitor_tailcall.c" - if (r8 != IMMEDIATE(0)) { + if (r0 != IMMEDIATE(0)) { #line 87 "sample/bindmonitor_tailcall.c" goto label_1; #line 87 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXW pc=31 dst=r1 src=r6 offset=44 imm=0 + // EBPF_OP_LDXW pc=30 dst=r1 src=r6 offset=44 imm=0 #line 91 "sample/bindmonitor_tailcall.c" r1 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); - // EBPF_OP_JNE_IMM pc=32 dst=r1 src=r0 offset=53 imm=0 + // EBPF_OP_JNE_IMM pc=31 dst=r1 src=r0 offset=51 imm=0 #line 91 "sample/bindmonitor_tailcall.c" if (r1 != IMMEDIATE(0)) { #line 91 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; #line 91 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXDW pc=33 dst=r1 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=32 dst=r1 src=r6 offset=0 imm=0 #line 95 "sample/bindmonitor_tailcall.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=34 dst=r1 src=r0 offset=51 imm=0 + // EBPF_OP_JEQ_IMM pc=33 dst=r1 src=r0 offset=49 imm=0 #line 95 "sample/bindmonitor_tailcall.c" if (r1 == IMMEDIATE(0)) { #line 95 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; #line 95 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXDW pc=35 dst=r1 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=34 dst=r1 src=r6 offset=8 imm=0 #line 95 "sample/bindmonitor_tailcall.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_JEQ_IMM pc=36 dst=r1 src=r0 offset=49 imm=0 + // EBPF_OP_JEQ_IMM pc=35 dst=r1 src=r0 offset=47 imm=0 #line 95 "sample/bindmonitor_tailcall.c" if (r1 == IMMEDIATE(0)) { #line 95 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; #line 95 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_REG pc=37 dst=r8 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=36 dst=r7 src=r10 offset=0 imm=0 #line 95 "sample/bindmonitor_tailcall.c" - r8 = r10; - // EBPF_OP_ADD64_IMM pc=38 dst=r8 src=r0 offset=0 imm=-8 + r7 = r10; + // EBPF_OP_ADD64_IMM pc=37 dst=r7 src=r0 offset=0 imm=-8 #line 99 "sample/bindmonitor_tailcall.c" - r8 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=39 dst=r3 src=r10 offset=0 imm=0 + r7 += IMMEDIATE(-8); + // EBPF_OP_MOV64_REG pc=38 dst=r3 src=r10 offset=0 imm=0 #line 99 "sample/bindmonitor_tailcall.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=40 dst=r3 src=r0 offset=0 imm=-80 + // EBPF_OP_ADD64_IMM pc=39 dst=r3 src=r0 offset=0 imm=-80 #line 99 "sample/bindmonitor_tailcall.c" r3 += IMMEDIATE(-80); - // EBPF_OP_LDDW pc=41 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=40 dst=r1 src=r1 offset=0 imm=1 #line 99 "sample/bindmonitor_tailcall.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_MOV64_REG pc=43 dst=r2 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=42 dst=r2 src=r7 offset=0 imm=0 #line 99 "sample/bindmonitor_tailcall.c" - r2 = r8; - // EBPF_OP_MOV64_IMM pc=44 dst=r4 src=r0 offset=0 imm=0 + r2 = r7; + // EBPF_OP_MOV64_IMM pc=43 dst=r4 src=r0 offset=0 imm=0 #line 99 "sample/bindmonitor_tailcall.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=45 dst=r0 src=r0 offset=0 imm=2 + // EBPF_OP_CALL pc=44 dst=r0 src=r0 offset=0 imm=2 #line 99 "sample/bindmonitor_tailcall.c" r0 = BindMonitor_Callee1_helpers[1].address(r1, r2, r3, r4, r5, context); #line 99 "sample/bindmonitor_tailcall.c" @@ -551,13 +546,13 @@ BindMonitor_Callee1(void* context) return 0; #line 99 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDDW pc=46 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=45 dst=r1 src=r1 offset=0 imm=1 #line 100 "sample/bindmonitor_tailcall.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_MOV64_REG pc=48 dst=r2 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=47 dst=r2 src=r7 offset=0 imm=0 #line 100 "sample/bindmonitor_tailcall.c" - r2 = r8; - // EBPF_OP_CALL pc=49 dst=r0 src=r0 offset=0 imm=1 + r2 = r7; + // EBPF_OP_CALL pc=48 dst=r0 src=r0 offset=0 imm=1 #line 100 "sample/bindmonitor_tailcall.c" r0 = BindMonitor_Callee1_helpers[0].address(r1, r2, r3, r4, r5, context); #line 100 "sample/bindmonitor_tailcall.c" @@ -566,35 +561,35 @@ BindMonitor_Callee1(void* context) return 0; #line 100 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_REG pc=50 dst=r8 src=r0 offset=0 imm=0 -#line 100 "sample/bindmonitor_tailcall.c" - r8 = r0; - // EBPF_OP_JEQ_IMM pc=51 dst=r8 src=r0 offset=34 imm=0 + // EBPF_OP_JEQ_IMM pc=49 dst=r0 src=r0 offset=33 imm=0 #line 101 "sample/bindmonitor_tailcall.c" - if (r8 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 101 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; #line 101 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXDW pc=52 dst=r3 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=50 dst=r3 src=r6 offset=0 imm=0 #line 105 "sample/bindmonitor_tailcall.c" r3 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_LDXDW pc=53 dst=r4 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=51 dst=r4 src=r6 offset=8 imm=0 #line 105 "sample/bindmonitor_tailcall.c" r4 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_SUB64_REG pc=54 dst=r4 src=r3 offset=0 imm=0 + // EBPF_OP_SUB64_REG pc=52 dst=r4 src=r3 offset=0 imm=0 #line 105 "sample/bindmonitor_tailcall.c" r4 -= r3; - // EBPF_OP_MOV64_REG pc=55 dst=r1 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=53 dst=r1 src=r0 offset=0 imm=0 #line 105 "sample/bindmonitor_tailcall.c" - r1 = r8; - // EBPF_OP_ADD64_IMM pc=56 dst=r1 src=r0 offset=0 imm=4 + r1 = r0; + // EBPF_OP_ADD64_IMM pc=54 dst=r1 src=r0 offset=0 imm=4 #line 105 "sample/bindmonitor_tailcall.c" r1 += IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=57 dst=r2 src=r0 offset=0 imm=64 + // EBPF_OP_MOV64_IMM pc=55 dst=r2 src=r0 offset=0 imm=64 #line 105 "sample/bindmonitor_tailcall.c" r2 = IMMEDIATE(64); - // EBPF_OP_CALL pc=58 dst=r0 src=r0 offset=0 imm=22 + // EBPF_OP_MOV64_REG pc=56 dst=r7 src=r0 offset=0 imm=0 +#line 105 "sample/bindmonitor_tailcall.c" + r7 = r0; + // EBPF_OP_CALL pc=57 dst=r0 src=r0 offset=0 imm=22 #line 105 "sample/bindmonitor_tailcall.c" r0 = BindMonitor_Callee1_helpers[2].address(r1, r2, r3, r4, r5, context); #line 105 "sample/bindmonitor_tailcall.c" @@ -603,34 +598,37 @@ BindMonitor_Callee1(void* context) return 0; #line 105 "sample/bindmonitor_tailcall.c" } + // EBPF_OP_MOV64_REG pc=58 dst=r0 src=r7 offset=0 imm=0 +#line 105 "sample/bindmonitor_tailcall.c" + r0 = r7; label_1: - // EBPF_OP_LDXW pc=59 dst=r1 src=r6 offset=44 imm=0 + // EBPF_OP_LDXW pc=59 dst=r1 src=r0 offset=0 imm=0 +#line 105 "sample/bindmonitor_tailcall.c" + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_LDXW pc=60 dst=r2 src=r6 offset=44 imm=0 #line 167 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); - // EBPF_OP_JEQ_IMM pc=60 dst=r1 src=r0 offset=9 imm=2 + r2 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); + // EBPF_OP_JEQ_IMM pc=61 dst=r2 src=r0 offset=7 imm=2 #line 167 "sample/bindmonitor_tailcall.c" - if (r1 == IMMEDIATE(2)) { + if (r2 == IMMEDIATE(2)) { #line 167 "sample/bindmonitor_tailcall.c" goto label_2; #line 167 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_JNE_IMM pc=61 dst=r1 src=r0 offset=13 imm=0 + // EBPF_OP_JNE_IMM pc=62 dst=r2 src=r0 offset=9 imm=0 #line 167 "sample/bindmonitor_tailcall.c" - if (r1 != IMMEDIATE(0)) { + if (r2 != IMMEDIATE(0)) { #line 167 "sample/bindmonitor_tailcall.c" goto label_3; #line 167 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_IMM pc=62 dst=r9 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=63 dst=r7 src=r0 offset=0 imm=1 #line 167 "sample/bindmonitor_tailcall.c" - r9 = IMMEDIATE(1); - // EBPF_OP_LDXW pc=63 dst=r1 src=r8 offset=0 imm=0 -#line 169 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); - // EBPF_OP_LDXW pc=64 dst=r2 src=r7 offset=0 imm=0 + r7 = IMMEDIATE(1); + // EBPF_OP_LDXW pc=64 dst=r2 src=r8 offset=0 imm=0 #line 169 "sample/bindmonitor_tailcall.c" - r2 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_JGE_REG pc=65 dst=r1 src=r2 offset=20 imm=0 + r2 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); + // EBPF_OP_JGE_REG pc=65 dst=r1 src=r2 offset=18 imm=0 #line 169 "sample/bindmonitor_tailcall.c" if (r1 >= r2) { #line 169 "sample/bindmonitor_tailcall.c" @@ -640,70 +638,60 @@ BindMonitor_Callee1(void* context) // EBPF_OP_ADD64_IMM pc=66 dst=r1 src=r0 offset=0 imm=1 #line 173 "sample/bindmonitor_tailcall.c" r1 += IMMEDIATE(1); - // EBPF_OP_STXW pc=67 dst=r8 src=r1 offset=0 imm=0 + // EBPF_OP_STXW pc=67 dst=r0 src=r1 offset=0 imm=0 #line 173 "sample/bindmonitor_tailcall.c" - *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_MOV64_IMM pc=68 dst=r9 src=r0 offset=0 imm=0 + *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; + // EBPF_OP_JA pc=68 dst=r0 src=r0 offset=14 imm=0 #line 173 "sample/bindmonitor_tailcall.c" - r9 = IMMEDIATE(0); - // EBPF_OP_JA pc=69 dst=r0 src=r0 offset=16 imm=0 -#line 173 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; label_2: - // EBPF_OP_LDXW pc=70 dst=r1 src=r8 offset=0 imm=0 -#line 176 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=71 dst=r1 src=r0 offset=7 imm=0 + // EBPF_OP_JEQ_IMM pc=69 dst=r1 src=r0 offset=6 imm=0 #line 176 "sample/bindmonitor_tailcall.c" if (r1 == IMMEDIATE(0)) { #line 176 "sample/bindmonitor_tailcall.c" - goto label_5; + goto label_4; #line 176 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_ADD64_IMM pc=72 dst=r1 src=r0 offset=0 imm=-1 + // EBPF_OP_ADD64_IMM pc=70 dst=r1 src=r0 offset=0 imm=-1 #line 177 "sample/bindmonitor_tailcall.c" r1 += IMMEDIATE(-1); - // EBPF_OP_STXW pc=73 dst=r8 src=r1 offset=0 imm=0 -#line 177 "sample/bindmonitor_tailcall.c" - *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_JA pc=74 dst=r0 src=r0 offset=1 imm=0 + // EBPF_OP_STXW pc=71 dst=r0 src=r1 offset=0 imm=0 #line 177 "sample/bindmonitor_tailcall.c" - goto label_4; + *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; label_3: - // EBPF_OP_LDXW pc=75 dst=r1 src=r8 offset=0 imm=0 -#line 184 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); -label_4: - // EBPF_OP_LSH64_IMM pc=76 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_MOV64_IMM pc=72 dst=r7 src=r0 offset=0 imm=0 +#line 177 "sample/bindmonitor_tailcall.c" + r7 = IMMEDIATE(0); + // EBPF_OP_LSH64_IMM pc=73 dst=r1 src=r0 offset=0 imm=32 #line 184 "sample/bindmonitor_tailcall.c" r1 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_RSH64_IMM pc=77 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=74 dst=r1 src=r0 offset=0 imm=32 #line 184 "sample/bindmonitor_tailcall.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JNE_IMM pc=78 dst=r1 src=r0 offset=7 imm=0 + // EBPF_OP_JNE_IMM pc=75 dst=r1 src=r0 offset=8 imm=0 #line 184 "sample/bindmonitor_tailcall.c" if (r1 != IMMEDIATE(0)) { #line 184 "sample/bindmonitor_tailcall.c" goto label_6; #line 184 "sample/bindmonitor_tailcall.c" } -label_5: - // EBPF_OP_LDXDW pc=79 dst=r1 src=r6 offset=16 imm=0 +label_4: + // EBPF_OP_LDXDW pc=76 dst=r1 src=r6 offset=16 imm=0 #line 185 "sample/bindmonitor_tailcall.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(16)); - // EBPF_OP_STXDW pc=80 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=77 dst=r10 src=r1 offset=-80 imm=0 #line 185 "sample/bindmonitor_tailcall.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_MOV64_REG pc=81 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=78 dst=r2 src=r10 offset=0 imm=0 #line 185 "sample/bindmonitor_tailcall.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=82 dst=r2 src=r0 offset=0 imm=-80 + // EBPF_OP_ADD64_IMM pc=79 dst=r2 src=r0 offset=0 imm=-80 #line 185 "sample/bindmonitor_tailcall.c" r2 += IMMEDIATE(-80); - // EBPF_OP_LDDW pc=83 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=80 dst=r1 src=r1 offset=0 imm=1 #line 186 "sample/bindmonitor_tailcall.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_CALL pc=85 dst=r0 src=r0 offset=0 imm=3 + // EBPF_OP_CALL pc=82 dst=r0 src=r0 offset=0 imm=3 #line 186 "sample/bindmonitor_tailcall.c" r0 = BindMonitor_Callee1_helpers[3].address(r1, r2, r3, r4, r5, context); #line 186 "sample/bindmonitor_tailcall.c" @@ -712,11 +700,15 @@ BindMonitor_Callee1(void* context) return 0; #line 186 "sample/bindmonitor_tailcall.c" } +label_5: + // EBPF_OP_MOV64_IMM pc=83 dst=r7 src=r0 offset=0 imm=0 +#line 186 "sample/bindmonitor_tailcall.c" + r7 = IMMEDIATE(0); label_6: - // EBPF_OP_MOV64_REG pc=86 dst=r0 src=r9 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=84 dst=r0 src=r7 offset=0 imm=0 #line 190 "sample/bindmonitor_tailcall.c" - r0 = r9; - // EBPF_OP_EXIT pc=87 dst=r0 src=r0 offset=0 imm=0 + r0 = r7; + // EBPF_OP_EXIT pc=85 dst=r0 src=r0 offset=0 imm=0 #line 190 "sample/bindmonitor_tailcall.c" return r0; #line 152 "sample/bindmonitor_tailcall.c" @@ -764,7 +756,7 @@ static program_entry_t _programs[] = { 2, BindMonitor_Callee1_helpers, 4, - 88, + 86, &BindMonitor_Callee1_program_type_guid, &BindMonitor_Callee1_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/bindmonitor_tailcall_sys.c b/tests/bpf2c_tests/expected/bindmonitor_tailcall_sys.c index 1fcf6e870d..201844b1a3 100644 --- a/tests/bpf2c_tests/expected/bindmonitor_tailcall_sys.c +++ b/tests/bpf2c_tests/expected/bindmonitor_tailcall_sys.c @@ -531,8 +531,6 @@ BindMonitor_Callee1(void* context) register uint64_t r7 = 0; #line 152 "sample/bindmonitor_tailcall.c" register uint64_t r8 = 0; -#line 152 "sample/bindmonitor_tailcall.c" - register uint64_t r9 = 0; #line 152 "sample/bindmonitor_tailcall.c" register uint64_t r10 = 0; @@ -544,12 +542,12 @@ BindMonitor_Callee1(void* context) // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 #line 152 "sample/bindmonitor_tailcall.c" r6 = r1; - // EBPF_OP_MOV64_IMM pc=1 dst=r9 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=1 dst=r7 src=r0 offset=0 imm=0 #line 152 "sample/bindmonitor_tailcall.c" - r9 = IMMEDIATE(0); - // EBPF_OP_STXW pc=2 dst=r10 src=r9 offset=-84 imm=0 + r7 = IMMEDIATE(0); + // EBPF_OP_STXW pc=2 dst=r10 src=r7 offset=-84 imm=0 #line 154 "sample/bindmonitor_tailcall.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-84)) = (uint32_t)r9; + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-84)) = (uint32_t)r7; // EBPF_OP_MOV64_REG pc=3 dst=r2 src=r10 offset=0 imm=0 #line 154 "sample/bindmonitor_tailcall.c" r2 = r10; @@ -568,26 +566,26 @@ BindMonitor_Callee1(void* context) return 0; #line 156 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_REG pc=8 dst=r7 src=r0 offset=0 imm=0 -#line 156 "sample/bindmonitor_tailcall.c" - r7 = r0; - // EBPF_OP_JEQ_IMM pc=9 dst=r7 src=r0 offset=76 imm=0 + // EBPF_OP_JEQ_IMM pc=8 dst=r0 src=r0 offset=75 imm=0 #line 157 "sample/bindmonitor_tailcall.c" - if (r7 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 157 "sample/bindmonitor_tailcall.c" goto label_6; #line 157 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXW pc=10 dst=r1 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=9 dst=r1 src=r0 offset=0 imm=0 #line 157 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=11 dst=r1 src=r0 offset=74 imm=0 + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_JEQ_IMM pc=10 dst=r1 src=r0 offset=73 imm=0 #line 157 "sample/bindmonitor_tailcall.c" if (r1 == IMMEDIATE(0)) { #line 157 "sample/bindmonitor_tailcall.c" goto label_6; #line 157 "sample/bindmonitor_tailcall.c" } + // EBPF_OP_MOV64_REG pc=11 dst=r8 src=r0 offset=0 imm=0 +#line 157 "sample/bindmonitor_tailcall.c" + r8 = r0; // EBPF_OP_LDXDW pc=12 dst=r1 src=r6 offset=16 imm=0 #line 81 "sample/bindmonitor_tailcall.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(16)); @@ -642,68 +640,65 @@ BindMonitor_Callee1(void* context) return 0; #line 86 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_REG pc=29 dst=r8 src=r0 offset=0 imm=0 -#line 86 "sample/bindmonitor_tailcall.c" - r8 = r0; - // EBPF_OP_JNE_IMM pc=30 dst=r8 src=r0 offset=28 imm=0 + // EBPF_OP_JNE_IMM pc=29 dst=r0 src=r0 offset=29 imm=0 #line 87 "sample/bindmonitor_tailcall.c" - if (r8 != IMMEDIATE(0)) { + if (r0 != IMMEDIATE(0)) { #line 87 "sample/bindmonitor_tailcall.c" goto label_1; #line 87 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXW pc=31 dst=r1 src=r6 offset=44 imm=0 + // EBPF_OP_LDXW pc=30 dst=r1 src=r6 offset=44 imm=0 #line 91 "sample/bindmonitor_tailcall.c" r1 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); - // EBPF_OP_JNE_IMM pc=32 dst=r1 src=r0 offset=53 imm=0 + // EBPF_OP_JNE_IMM pc=31 dst=r1 src=r0 offset=51 imm=0 #line 91 "sample/bindmonitor_tailcall.c" if (r1 != IMMEDIATE(0)) { #line 91 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; #line 91 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXDW pc=33 dst=r1 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=32 dst=r1 src=r6 offset=0 imm=0 #line 95 "sample/bindmonitor_tailcall.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=34 dst=r1 src=r0 offset=51 imm=0 + // EBPF_OP_JEQ_IMM pc=33 dst=r1 src=r0 offset=49 imm=0 #line 95 "sample/bindmonitor_tailcall.c" if (r1 == IMMEDIATE(0)) { #line 95 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; #line 95 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXDW pc=35 dst=r1 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=34 dst=r1 src=r6 offset=8 imm=0 #line 95 "sample/bindmonitor_tailcall.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_JEQ_IMM pc=36 dst=r1 src=r0 offset=49 imm=0 + // EBPF_OP_JEQ_IMM pc=35 dst=r1 src=r0 offset=47 imm=0 #line 95 "sample/bindmonitor_tailcall.c" if (r1 == IMMEDIATE(0)) { #line 95 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; #line 95 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_REG pc=37 dst=r8 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=36 dst=r7 src=r10 offset=0 imm=0 #line 95 "sample/bindmonitor_tailcall.c" - r8 = r10; - // EBPF_OP_ADD64_IMM pc=38 dst=r8 src=r0 offset=0 imm=-8 + r7 = r10; + // EBPF_OP_ADD64_IMM pc=37 dst=r7 src=r0 offset=0 imm=-8 #line 99 "sample/bindmonitor_tailcall.c" - r8 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=39 dst=r3 src=r10 offset=0 imm=0 + r7 += IMMEDIATE(-8); + // EBPF_OP_MOV64_REG pc=38 dst=r3 src=r10 offset=0 imm=0 #line 99 "sample/bindmonitor_tailcall.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=40 dst=r3 src=r0 offset=0 imm=-80 + // EBPF_OP_ADD64_IMM pc=39 dst=r3 src=r0 offset=0 imm=-80 #line 99 "sample/bindmonitor_tailcall.c" r3 += IMMEDIATE(-80); - // EBPF_OP_LDDW pc=41 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=40 dst=r1 src=r1 offset=0 imm=1 #line 99 "sample/bindmonitor_tailcall.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_MOV64_REG pc=43 dst=r2 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=42 dst=r2 src=r7 offset=0 imm=0 #line 99 "sample/bindmonitor_tailcall.c" - r2 = r8; - // EBPF_OP_MOV64_IMM pc=44 dst=r4 src=r0 offset=0 imm=0 + r2 = r7; + // EBPF_OP_MOV64_IMM pc=43 dst=r4 src=r0 offset=0 imm=0 #line 99 "sample/bindmonitor_tailcall.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=45 dst=r0 src=r0 offset=0 imm=2 + // EBPF_OP_CALL pc=44 dst=r0 src=r0 offset=0 imm=2 #line 99 "sample/bindmonitor_tailcall.c" r0 = BindMonitor_Callee1_helpers[1].address(r1, r2, r3, r4, r5, context); #line 99 "sample/bindmonitor_tailcall.c" @@ -712,13 +707,13 @@ BindMonitor_Callee1(void* context) return 0; #line 99 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDDW pc=46 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=45 dst=r1 src=r1 offset=0 imm=1 #line 100 "sample/bindmonitor_tailcall.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_MOV64_REG pc=48 dst=r2 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=47 dst=r2 src=r7 offset=0 imm=0 #line 100 "sample/bindmonitor_tailcall.c" - r2 = r8; - // EBPF_OP_CALL pc=49 dst=r0 src=r0 offset=0 imm=1 + r2 = r7; + // EBPF_OP_CALL pc=48 dst=r0 src=r0 offset=0 imm=1 #line 100 "sample/bindmonitor_tailcall.c" r0 = BindMonitor_Callee1_helpers[0].address(r1, r2, r3, r4, r5, context); #line 100 "sample/bindmonitor_tailcall.c" @@ -727,35 +722,35 @@ BindMonitor_Callee1(void* context) return 0; #line 100 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_REG pc=50 dst=r8 src=r0 offset=0 imm=0 -#line 100 "sample/bindmonitor_tailcall.c" - r8 = r0; - // EBPF_OP_JEQ_IMM pc=51 dst=r8 src=r0 offset=34 imm=0 + // EBPF_OP_JEQ_IMM pc=49 dst=r0 src=r0 offset=33 imm=0 #line 101 "sample/bindmonitor_tailcall.c" - if (r8 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 101 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; #line 101 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_LDXDW pc=52 dst=r3 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=50 dst=r3 src=r6 offset=0 imm=0 #line 105 "sample/bindmonitor_tailcall.c" r3 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_LDXDW pc=53 dst=r4 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=51 dst=r4 src=r6 offset=8 imm=0 #line 105 "sample/bindmonitor_tailcall.c" r4 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_SUB64_REG pc=54 dst=r4 src=r3 offset=0 imm=0 + // EBPF_OP_SUB64_REG pc=52 dst=r4 src=r3 offset=0 imm=0 #line 105 "sample/bindmonitor_tailcall.c" r4 -= r3; - // EBPF_OP_MOV64_REG pc=55 dst=r1 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=53 dst=r1 src=r0 offset=0 imm=0 #line 105 "sample/bindmonitor_tailcall.c" - r1 = r8; - // EBPF_OP_ADD64_IMM pc=56 dst=r1 src=r0 offset=0 imm=4 + r1 = r0; + // EBPF_OP_ADD64_IMM pc=54 dst=r1 src=r0 offset=0 imm=4 #line 105 "sample/bindmonitor_tailcall.c" r1 += IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=57 dst=r2 src=r0 offset=0 imm=64 + // EBPF_OP_MOV64_IMM pc=55 dst=r2 src=r0 offset=0 imm=64 #line 105 "sample/bindmonitor_tailcall.c" r2 = IMMEDIATE(64); - // EBPF_OP_CALL pc=58 dst=r0 src=r0 offset=0 imm=22 + // EBPF_OP_MOV64_REG pc=56 dst=r7 src=r0 offset=0 imm=0 +#line 105 "sample/bindmonitor_tailcall.c" + r7 = r0; + // EBPF_OP_CALL pc=57 dst=r0 src=r0 offset=0 imm=22 #line 105 "sample/bindmonitor_tailcall.c" r0 = BindMonitor_Callee1_helpers[2].address(r1, r2, r3, r4, r5, context); #line 105 "sample/bindmonitor_tailcall.c" @@ -764,34 +759,37 @@ BindMonitor_Callee1(void* context) return 0; #line 105 "sample/bindmonitor_tailcall.c" } + // EBPF_OP_MOV64_REG pc=58 dst=r0 src=r7 offset=0 imm=0 +#line 105 "sample/bindmonitor_tailcall.c" + r0 = r7; label_1: - // EBPF_OP_LDXW pc=59 dst=r1 src=r6 offset=44 imm=0 + // EBPF_OP_LDXW pc=59 dst=r1 src=r0 offset=0 imm=0 +#line 105 "sample/bindmonitor_tailcall.c" + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_LDXW pc=60 dst=r2 src=r6 offset=44 imm=0 #line 167 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); - // EBPF_OP_JEQ_IMM pc=60 dst=r1 src=r0 offset=9 imm=2 + r2 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(44)); + // EBPF_OP_JEQ_IMM pc=61 dst=r2 src=r0 offset=7 imm=2 #line 167 "sample/bindmonitor_tailcall.c" - if (r1 == IMMEDIATE(2)) { + if (r2 == IMMEDIATE(2)) { #line 167 "sample/bindmonitor_tailcall.c" goto label_2; #line 167 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_JNE_IMM pc=61 dst=r1 src=r0 offset=13 imm=0 + // EBPF_OP_JNE_IMM pc=62 dst=r2 src=r0 offset=9 imm=0 #line 167 "sample/bindmonitor_tailcall.c" - if (r1 != IMMEDIATE(0)) { + if (r2 != IMMEDIATE(0)) { #line 167 "sample/bindmonitor_tailcall.c" goto label_3; #line 167 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_MOV64_IMM pc=62 dst=r9 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=63 dst=r7 src=r0 offset=0 imm=1 #line 167 "sample/bindmonitor_tailcall.c" - r9 = IMMEDIATE(1); - // EBPF_OP_LDXW pc=63 dst=r1 src=r8 offset=0 imm=0 -#line 169 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); - // EBPF_OP_LDXW pc=64 dst=r2 src=r7 offset=0 imm=0 + r7 = IMMEDIATE(1); + // EBPF_OP_LDXW pc=64 dst=r2 src=r8 offset=0 imm=0 #line 169 "sample/bindmonitor_tailcall.c" - r2 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_JGE_REG pc=65 dst=r1 src=r2 offset=20 imm=0 + r2 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); + // EBPF_OP_JGE_REG pc=65 dst=r1 src=r2 offset=18 imm=0 #line 169 "sample/bindmonitor_tailcall.c" if (r1 >= r2) { #line 169 "sample/bindmonitor_tailcall.c" @@ -801,70 +799,60 @@ BindMonitor_Callee1(void* context) // EBPF_OP_ADD64_IMM pc=66 dst=r1 src=r0 offset=0 imm=1 #line 173 "sample/bindmonitor_tailcall.c" r1 += IMMEDIATE(1); - // EBPF_OP_STXW pc=67 dst=r8 src=r1 offset=0 imm=0 + // EBPF_OP_STXW pc=67 dst=r0 src=r1 offset=0 imm=0 #line 173 "sample/bindmonitor_tailcall.c" - *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_MOV64_IMM pc=68 dst=r9 src=r0 offset=0 imm=0 + *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; + // EBPF_OP_JA pc=68 dst=r0 src=r0 offset=14 imm=0 #line 173 "sample/bindmonitor_tailcall.c" - r9 = IMMEDIATE(0); - // EBPF_OP_JA pc=69 dst=r0 src=r0 offset=16 imm=0 -#line 173 "sample/bindmonitor_tailcall.c" - goto label_6; + goto label_5; label_2: - // EBPF_OP_LDXW pc=70 dst=r1 src=r8 offset=0 imm=0 -#line 176 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=71 dst=r1 src=r0 offset=7 imm=0 + // EBPF_OP_JEQ_IMM pc=69 dst=r1 src=r0 offset=6 imm=0 #line 176 "sample/bindmonitor_tailcall.c" if (r1 == IMMEDIATE(0)) { #line 176 "sample/bindmonitor_tailcall.c" - goto label_5; + goto label_4; #line 176 "sample/bindmonitor_tailcall.c" } - // EBPF_OP_ADD64_IMM pc=72 dst=r1 src=r0 offset=0 imm=-1 + // EBPF_OP_ADD64_IMM pc=70 dst=r1 src=r0 offset=0 imm=-1 #line 177 "sample/bindmonitor_tailcall.c" r1 += IMMEDIATE(-1); - // EBPF_OP_STXW pc=73 dst=r8 src=r1 offset=0 imm=0 -#line 177 "sample/bindmonitor_tailcall.c" - *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_JA pc=74 dst=r0 src=r0 offset=1 imm=0 + // EBPF_OP_STXW pc=71 dst=r0 src=r1 offset=0 imm=0 #line 177 "sample/bindmonitor_tailcall.c" - goto label_4; + *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; label_3: - // EBPF_OP_LDXW pc=75 dst=r1 src=r8 offset=0 imm=0 -#line 184 "sample/bindmonitor_tailcall.c" - r1 = *(uint32_t*)(uintptr_t)(r8 + OFFSET(0)); -label_4: - // EBPF_OP_LSH64_IMM pc=76 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_MOV64_IMM pc=72 dst=r7 src=r0 offset=0 imm=0 +#line 177 "sample/bindmonitor_tailcall.c" + r7 = IMMEDIATE(0); + // EBPF_OP_LSH64_IMM pc=73 dst=r1 src=r0 offset=0 imm=32 #line 184 "sample/bindmonitor_tailcall.c" r1 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_RSH64_IMM pc=77 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=74 dst=r1 src=r0 offset=0 imm=32 #line 184 "sample/bindmonitor_tailcall.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JNE_IMM pc=78 dst=r1 src=r0 offset=7 imm=0 + // EBPF_OP_JNE_IMM pc=75 dst=r1 src=r0 offset=8 imm=0 #line 184 "sample/bindmonitor_tailcall.c" if (r1 != IMMEDIATE(0)) { #line 184 "sample/bindmonitor_tailcall.c" goto label_6; #line 184 "sample/bindmonitor_tailcall.c" } -label_5: - // EBPF_OP_LDXDW pc=79 dst=r1 src=r6 offset=16 imm=0 +label_4: + // EBPF_OP_LDXDW pc=76 dst=r1 src=r6 offset=16 imm=0 #line 185 "sample/bindmonitor_tailcall.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(16)); - // EBPF_OP_STXDW pc=80 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=77 dst=r10 src=r1 offset=-80 imm=0 #line 185 "sample/bindmonitor_tailcall.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_MOV64_REG pc=81 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=78 dst=r2 src=r10 offset=0 imm=0 #line 185 "sample/bindmonitor_tailcall.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=82 dst=r2 src=r0 offset=0 imm=-80 + // EBPF_OP_ADD64_IMM pc=79 dst=r2 src=r0 offset=0 imm=-80 #line 185 "sample/bindmonitor_tailcall.c" r2 += IMMEDIATE(-80); - // EBPF_OP_LDDW pc=83 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=80 dst=r1 src=r1 offset=0 imm=1 #line 186 "sample/bindmonitor_tailcall.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_CALL pc=85 dst=r0 src=r0 offset=0 imm=3 + // EBPF_OP_CALL pc=82 dst=r0 src=r0 offset=0 imm=3 #line 186 "sample/bindmonitor_tailcall.c" r0 = BindMonitor_Callee1_helpers[3].address(r1, r2, r3, r4, r5, context); #line 186 "sample/bindmonitor_tailcall.c" @@ -873,11 +861,15 @@ BindMonitor_Callee1(void* context) return 0; #line 186 "sample/bindmonitor_tailcall.c" } +label_5: + // EBPF_OP_MOV64_IMM pc=83 dst=r7 src=r0 offset=0 imm=0 +#line 186 "sample/bindmonitor_tailcall.c" + r7 = IMMEDIATE(0); label_6: - // EBPF_OP_MOV64_REG pc=86 dst=r0 src=r9 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=84 dst=r0 src=r7 offset=0 imm=0 #line 190 "sample/bindmonitor_tailcall.c" - r0 = r9; - // EBPF_OP_EXIT pc=87 dst=r0 src=r0 offset=0 imm=0 + r0 = r7; + // EBPF_OP_EXIT pc=85 dst=r0 src=r0 offset=0 imm=0 #line 190 "sample/bindmonitor_tailcall.c" return r0; #line 152 "sample/bindmonitor_tailcall.c" @@ -925,7 +917,7 @@ static program_entry_t _programs[] = { 2, BindMonitor_Callee1_helpers, 4, - 88, + 86, &BindMonitor_Callee1_program_type_guid, &BindMonitor_Callee1_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/cgroup_count_connect4_dll.c b/tests/bpf2c_tests/expected/cgroup_count_connect4_dll.c index 491f1a780c..9d87eba53b 100644 --- a/tests/bpf2c_tests/expected/cgroup_count_connect4_dll.c +++ b/tests/bpf2c_tests/expected/cgroup_count_connect4_dll.c @@ -97,8 +97,6 @@ count_tcp_connect4(void* context) register uint64_t r4 = 0; #line 31 "sample/cgroup_count_connect4.c" register uint64_t r5 = 0; -#line 31 "sample/cgroup_count_connect4.c" - register uint64_t r6 = 0; #line 31 "sample/cgroup_count_connect4.c" register uint64_t r10 = 0; @@ -107,27 +105,27 @@ count_tcp_connect4(void* context) #line 31 "sample/cgroup_count_connect4.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); - // EBPF_OP_MOV64_IMM pc=0 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=0 dst=r0 src=r0 offset=0 imm=1 #line 31 "sample/cgroup_count_connect4.c" - r6 = IMMEDIATE(1); + r0 = IMMEDIATE(1); // EBPF_OP_LDXW pc=1 dst=r2 src=r1 offset=44 imm=0 #line 34 "sample/cgroup_count_connect4.c" r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44)); - // EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=26 imm=6 + // EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=25 imm=6 #line 34 "sample/cgroup_count_connect4.c" if (r2 != IMMEDIATE(6)) { #line 34 "sample/cgroup_count_connect4.c" - goto label_2; + goto label_3; #line 34 "sample/cgroup_count_connect4.c" } // EBPF_OP_LDXH pc=3 dst=r1 src=r1 offset=40 imm=0 #line 40 "sample/cgroup_count_connect4.c" r1 = *(uint16_t*)(uintptr_t)(r1 + OFFSET(40)); - // EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=24 imm=7459 + // EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=23 imm=7459 #line 40 "sample/cgroup_count_connect4.c" if (r1 != IMMEDIATE(7459)) { #line 40 "sample/cgroup_count_connect4.c" - goto label_2; + goto label_3; #line 40 "sample/cgroup_count_connect4.c" } // EBPF_OP_MOV64_IMM pc=5 dst=r1 src=r0 offset=0 imm=8989 @@ -154,7 +152,7 @@ count_tcp_connect4(void* context) return 0; #line 48 "sample/cgroup_count_connect4.c" } - // EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=12 imm=0 + // EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=11 imm=0 #line 49 "sample/cgroup_count_connect4.c" if (r0 != IMMEDIATE(0)) { #line 49 "sample/cgroup_count_connect4.c" @@ -179,16 +177,13 @@ count_tcp_connect4(void* context) // EBPF_OP_ADD64_IMM pc=18 dst=r3 src=r0 offset=0 imm=-16 #line 50 "sample/cgroup_count_connect4.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=19 dst=r6 src=r0 offset=0 imm=0 -#line 50 "sample/cgroup_count_connect4.c" - r6 = IMMEDIATE(0); - // EBPF_OP_LDDW pc=20 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=19 dst=r1 src=r1 offset=0 imm=1 #line 51 "sample/cgroup_count_connect4.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_MOV64_IMM pc=22 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=21 dst=r4 src=r0 offset=0 imm=0 #line 51 "sample/cgroup_count_connect4.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=23 dst=r0 src=r0 offset=0 imm=2 + // EBPF_OP_CALL pc=22 dst=r0 src=r0 offset=0 imm=2 #line 51 "sample/cgroup_count_connect4.c" r0 = count_tcp_connect4_helpers[1].address(r1, r2, r3, r4, r5, context); #line 51 "sample/cgroup_count_connect4.c" @@ -197,27 +192,25 @@ count_tcp_connect4(void* context) return 0; #line 51 "sample/cgroup_count_connect4.c" } - // EBPF_OP_JA pc=24 dst=r0 src=r0 offset=4 imm=0 + // EBPF_OP_JA pc=23 dst=r0 src=r0 offset=3 imm=0 #line 51 "sample/cgroup_count_connect4.c" goto label_2; label_1: - // EBPF_OP_LDXDW pc=25 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_LDXDW pc=24 dst=r1 src=r0 offset=0 imm=0 #line 53 "sample/cgroup_count_connect4.c" r1 = *(uint64_t*)(uintptr_t)(r0 + OFFSET(0)); - // EBPF_OP_ADD64_IMM pc=26 dst=r1 src=r0 offset=0 imm=1 + // EBPF_OP_ADD64_IMM pc=25 dst=r1 src=r0 offset=0 imm=1 #line 53 "sample/cgroup_count_connect4.c" r1 += IMMEDIATE(1); - // EBPF_OP_STXDW pc=27 dst=r0 src=r1 offset=0 imm=0 + // EBPF_OP_STXDW pc=26 dst=r0 src=r1 offset=0 imm=0 #line 53 "sample/cgroup_count_connect4.c" *(uint64_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint64_t)r1; - // EBPF_OP_MOV64_IMM pc=28 dst=r6 src=r0 offset=0 imm=0 -#line 53 "sample/cgroup_count_connect4.c" - r6 = IMMEDIATE(0); label_2: - // EBPF_OP_MOV64_REG pc=29 dst=r0 src=r6 offset=0 imm=0 -#line 62 "sample/cgroup_count_connect4.c" - r0 = r6; - // EBPF_OP_EXIT pc=30 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=27 dst=r0 src=r0 offset=0 imm=0 +#line 53 "sample/cgroup_count_connect4.c" + r0 = IMMEDIATE(0); +label_3: + // EBPF_OP_EXIT pc=28 dst=r0 src=r0 offset=0 imm=0 #line 62 "sample/cgroup_count_connect4.c" return r0; #line 31 "sample/cgroup_count_connect4.c" @@ -237,7 +230,7 @@ static program_entry_t _programs[] = { 1, count_tcp_connect4_helpers, 2, - 31, + 29, &count_tcp_connect4_program_type_guid, &count_tcp_connect4_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/cgroup_count_connect4_raw.c b/tests/bpf2c_tests/expected/cgroup_count_connect4_raw.c index 397c64dde9..b3754f878c 100644 --- a/tests/bpf2c_tests/expected/cgroup_count_connect4_raw.c +++ b/tests/bpf2c_tests/expected/cgroup_count_connect4_raw.c @@ -71,8 +71,6 @@ count_tcp_connect4(void* context) register uint64_t r4 = 0; #line 31 "sample/cgroup_count_connect4.c" register uint64_t r5 = 0; -#line 31 "sample/cgroup_count_connect4.c" - register uint64_t r6 = 0; #line 31 "sample/cgroup_count_connect4.c" register uint64_t r10 = 0; @@ -81,27 +79,27 @@ count_tcp_connect4(void* context) #line 31 "sample/cgroup_count_connect4.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); - // EBPF_OP_MOV64_IMM pc=0 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=0 dst=r0 src=r0 offset=0 imm=1 #line 31 "sample/cgroup_count_connect4.c" - r6 = IMMEDIATE(1); + r0 = IMMEDIATE(1); // EBPF_OP_LDXW pc=1 dst=r2 src=r1 offset=44 imm=0 #line 34 "sample/cgroup_count_connect4.c" r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44)); - // EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=26 imm=6 + // EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=25 imm=6 #line 34 "sample/cgroup_count_connect4.c" if (r2 != IMMEDIATE(6)) { #line 34 "sample/cgroup_count_connect4.c" - goto label_2; + goto label_3; #line 34 "sample/cgroup_count_connect4.c" } // EBPF_OP_LDXH pc=3 dst=r1 src=r1 offset=40 imm=0 #line 40 "sample/cgroup_count_connect4.c" r1 = *(uint16_t*)(uintptr_t)(r1 + OFFSET(40)); - // EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=24 imm=7459 + // EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=23 imm=7459 #line 40 "sample/cgroup_count_connect4.c" if (r1 != IMMEDIATE(7459)) { #line 40 "sample/cgroup_count_connect4.c" - goto label_2; + goto label_3; #line 40 "sample/cgroup_count_connect4.c" } // EBPF_OP_MOV64_IMM pc=5 dst=r1 src=r0 offset=0 imm=8989 @@ -128,7 +126,7 @@ count_tcp_connect4(void* context) return 0; #line 48 "sample/cgroup_count_connect4.c" } - // EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=12 imm=0 + // EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=11 imm=0 #line 49 "sample/cgroup_count_connect4.c" if (r0 != IMMEDIATE(0)) { #line 49 "sample/cgroup_count_connect4.c" @@ -153,16 +151,13 @@ count_tcp_connect4(void* context) // EBPF_OP_ADD64_IMM pc=18 dst=r3 src=r0 offset=0 imm=-16 #line 50 "sample/cgroup_count_connect4.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=19 dst=r6 src=r0 offset=0 imm=0 -#line 50 "sample/cgroup_count_connect4.c" - r6 = IMMEDIATE(0); - // EBPF_OP_LDDW pc=20 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=19 dst=r1 src=r1 offset=0 imm=1 #line 51 "sample/cgroup_count_connect4.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_MOV64_IMM pc=22 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=21 dst=r4 src=r0 offset=0 imm=0 #line 51 "sample/cgroup_count_connect4.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=23 dst=r0 src=r0 offset=0 imm=2 + // EBPF_OP_CALL pc=22 dst=r0 src=r0 offset=0 imm=2 #line 51 "sample/cgroup_count_connect4.c" r0 = count_tcp_connect4_helpers[1].address(r1, r2, r3, r4, r5, context); #line 51 "sample/cgroup_count_connect4.c" @@ -171,27 +166,25 @@ count_tcp_connect4(void* context) return 0; #line 51 "sample/cgroup_count_connect4.c" } - // EBPF_OP_JA pc=24 dst=r0 src=r0 offset=4 imm=0 + // EBPF_OP_JA pc=23 dst=r0 src=r0 offset=3 imm=0 #line 51 "sample/cgroup_count_connect4.c" goto label_2; label_1: - // EBPF_OP_LDXDW pc=25 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_LDXDW pc=24 dst=r1 src=r0 offset=0 imm=0 #line 53 "sample/cgroup_count_connect4.c" r1 = *(uint64_t*)(uintptr_t)(r0 + OFFSET(0)); - // EBPF_OP_ADD64_IMM pc=26 dst=r1 src=r0 offset=0 imm=1 + // EBPF_OP_ADD64_IMM pc=25 dst=r1 src=r0 offset=0 imm=1 #line 53 "sample/cgroup_count_connect4.c" r1 += IMMEDIATE(1); - // EBPF_OP_STXDW pc=27 dst=r0 src=r1 offset=0 imm=0 + // EBPF_OP_STXDW pc=26 dst=r0 src=r1 offset=0 imm=0 #line 53 "sample/cgroup_count_connect4.c" *(uint64_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint64_t)r1; - // EBPF_OP_MOV64_IMM pc=28 dst=r6 src=r0 offset=0 imm=0 -#line 53 "sample/cgroup_count_connect4.c" - r6 = IMMEDIATE(0); label_2: - // EBPF_OP_MOV64_REG pc=29 dst=r0 src=r6 offset=0 imm=0 -#line 62 "sample/cgroup_count_connect4.c" - r0 = r6; - // EBPF_OP_EXIT pc=30 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=27 dst=r0 src=r0 offset=0 imm=0 +#line 53 "sample/cgroup_count_connect4.c" + r0 = IMMEDIATE(0); +label_3: + // EBPF_OP_EXIT pc=28 dst=r0 src=r0 offset=0 imm=0 #line 62 "sample/cgroup_count_connect4.c" return r0; #line 31 "sample/cgroup_count_connect4.c" @@ -211,7 +204,7 @@ static program_entry_t _programs[] = { 1, count_tcp_connect4_helpers, 2, - 31, + 29, &count_tcp_connect4_program_type_guid, &count_tcp_connect4_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/cgroup_count_connect4_sys.c b/tests/bpf2c_tests/expected/cgroup_count_connect4_sys.c index 3416c7cca5..3c5800e7a8 100644 --- a/tests/bpf2c_tests/expected/cgroup_count_connect4_sys.c +++ b/tests/bpf2c_tests/expected/cgroup_count_connect4_sys.c @@ -232,8 +232,6 @@ count_tcp_connect4(void* context) register uint64_t r4 = 0; #line 31 "sample/cgroup_count_connect4.c" register uint64_t r5 = 0; -#line 31 "sample/cgroup_count_connect4.c" - register uint64_t r6 = 0; #line 31 "sample/cgroup_count_connect4.c" register uint64_t r10 = 0; @@ -242,27 +240,27 @@ count_tcp_connect4(void* context) #line 31 "sample/cgroup_count_connect4.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); - // EBPF_OP_MOV64_IMM pc=0 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=0 dst=r0 src=r0 offset=0 imm=1 #line 31 "sample/cgroup_count_connect4.c" - r6 = IMMEDIATE(1); + r0 = IMMEDIATE(1); // EBPF_OP_LDXW pc=1 dst=r2 src=r1 offset=44 imm=0 #line 34 "sample/cgroup_count_connect4.c" r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44)); - // EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=26 imm=6 + // EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=25 imm=6 #line 34 "sample/cgroup_count_connect4.c" if (r2 != IMMEDIATE(6)) { #line 34 "sample/cgroup_count_connect4.c" - goto label_2; + goto label_3; #line 34 "sample/cgroup_count_connect4.c" } // EBPF_OP_LDXH pc=3 dst=r1 src=r1 offset=40 imm=0 #line 40 "sample/cgroup_count_connect4.c" r1 = *(uint16_t*)(uintptr_t)(r1 + OFFSET(40)); - // EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=24 imm=7459 + // EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=23 imm=7459 #line 40 "sample/cgroup_count_connect4.c" if (r1 != IMMEDIATE(7459)) { #line 40 "sample/cgroup_count_connect4.c" - goto label_2; + goto label_3; #line 40 "sample/cgroup_count_connect4.c" } // EBPF_OP_MOV64_IMM pc=5 dst=r1 src=r0 offset=0 imm=8989 @@ -289,7 +287,7 @@ count_tcp_connect4(void* context) return 0; #line 48 "sample/cgroup_count_connect4.c" } - // EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=12 imm=0 + // EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=11 imm=0 #line 49 "sample/cgroup_count_connect4.c" if (r0 != IMMEDIATE(0)) { #line 49 "sample/cgroup_count_connect4.c" @@ -314,16 +312,13 @@ count_tcp_connect4(void* context) // EBPF_OP_ADD64_IMM pc=18 dst=r3 src=r0 offset=0 imm=-16 #line 50 "sample/cgroup_count_connect4.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=19 dst=r6 src=r0 offset=0 imm=0 -#line 50 "sample/cgroup_count_connect4.c" - r6 = IMMEDIATE(0); - // EBPF_OP_LDDW pc=20 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=19 dst=r1 src=r1 offset=0 imm=1 #line 51 "sample/cgroup_count_connect4.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_MOV64_IMM pc=22 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=21 dst=r4 src=r0 offset=0 imm=0 #line 51 "sample/cgroup_count_connect4.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=23 dst=r0 src=r0 offset=0 imm=2 + // EBPF_OP_CALL pc=22 dst=r0 src=r0 offset=0 imm=2 #line 51 "sample/cgroup_count_connect4.c" r0 = count_tcp_connect4_helpers[1].address(r1, r2, r3, r4, r5, context); #line 51 "sample/cgroup_count_connect4.c" @@ -332,27 +327,25 @@ count_tcp_connect4(void* context) return 0; #line 51 "sample/cgroup_count_connect4.c" } - // EBPF_OP_JA pc=24 dst=r0 src=r0 offset=4 imm=0 + // EBPF_OP_JA pc=23 dst=r0 src=r0 offset=3 imm=0 #line 51 "sample/cgroup_count_connect4.c" goto label_2; label_1: - // EBPF_OP_LDXDW pc=25 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_LDXDW pc=24 dst=r1 src=r0 offset=0 imm=0 #line 53 "sample/cgroup_count_connect4.c" r1 = *(uint64_t*)(uintptr_t)(r0 + OFFSET(0)); - // EBPF_OP_ADD64_IMM pc=26 dst=r1 src=r0 offset=0 imm=1 + // EBPF_OP_ADD64_IMM pc=25 dst=r1 src=r0 offset=0 imm=1 #line 53 "sample/cgroup_count_connect4.c" r1 += IMMEDIATE(1); - // EBPF_OP_STXDW pc=27 dst=r0 src=r1 offset=0 imm=0 + // EBPF_OP_STXDW pc=26 dst=r0 src=r1 offset=0 imm=0 #line 53 "sample/cgroup_count_connect4.c" *(uint64_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint64_t)r1; - // EBPF_OP_MOV64_IMM pc=28 dst=r6 src=r0 offset=0 imm=0 -#line 53 "sample/cgroup_count_connect4.c" - r6 = IMMEDIATE(0); label_2: - // EBPF_OP_MOV64_REG pc=29 dst=r0 src=r6 offset=0 imm=0 -#line 62 "sample/cgroup_count_connect4.c" - r0 = r6; - // EBPF_OP_EXIT pc=30 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=27 dst=r0 src=r0 offset=0 imm=0 +#line 53 "sample/cgroup_count_connect4.c" + r0 = IMMEDIATE(0); +label_3: + // EBPF_OP_EXIT pc=28 dst=r0 src=r0 offset=0 imm=0 #line 62 "sample/cgroup_count_connect4.c" return r0; #line 31 "sample/cgroup_count_connect4.c" @@ -372,7 +365,7 @@ static program_entry_t _programs[] = { 1, count_tcp_connect4_helpers, 2, - 31, + 29, &count_tcp_connect4_program_type_guid, &count_tcp_connect4_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/cgroup_count_connect6_dll.c b/tests/bpf2c_tests/expected/cgroup_count_connect6_dll.c index 47dd041237..460bfcbfd0 100644 --- a/tests/bpf2c_tests/expected/cgroup_count_connect6_dll.c +++ b/tests/bpf2c_tests/expected/cgroup_count_connect6_dll.c @@ -97,8 +97,6 @@ count_tcp_connect6(void* context) register uint64_t r4 = 0; #line 31 "sample/cgroup_count_connect6.c" register uint64_t r5 = 0; -#line 31 "sample/cgroup_count_connect6.c" - register uint64_t r6 = 0; #line 31 "sample/cgroup_count_connect6.c" register uint64_t r10 = 0; @@ -107,27 +105,27 @@ count_tcp_connect6(void* context) #line 31 "sample/cgroup_count_connect6.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); - // EBPF_OP_MOV64_IMM pc=0 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=0 dst=r0 src=r0 offset=0 imm=1 #line 31 "sample/cgroup_count_connect6.c" - r6 = IMMEDIATE(1); + r0 = IMMEDIATE(1); // EBPF_OP_LDXW pc=1 dst=r2 src=r1 offset=44 imm=0 #line 34 "sample/cgroup_count_connect6.c" r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44)); - // EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=26 imm=6 + // EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=25 imm=6 #line 34 "sample/cgroup_count_connect6.c" if (r2 != IMMEDIATE(6)) { #line 34 "sample/cgroup_count_connect6.c" - goto label_2; + goto label_3; #line 34 "sample/cgroup_count_connect6.c" } // EBPF_OP_LDXH pc=3 dst=r1 src=r1 offset=40 imm=0 #line 40 "sample/cgroup_count_connect6.c" r1 = *(uint16_t*)(uintptr_t)(r1 + OFFSET(40)); - // EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=24 imm=7459 + // EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=23 imm=7459 #line 40 "sample/cgroup_count_connect6.c" if (r1 != IMMEDIATE(7459)) { #line 40 "sample/cgroup_count_connect6.c" - goto label_2; + goto label_3; #line 40 "sample/cgroup_count_connect6.c" } // EBPF_OP_MOV64_IMM pc=5 dst=r1 src=r0 offset=0 imm=8989 @@ -154,7 +152,7 @@ count_tcp_connect6(void* context) return 0; #line 48 "sample/cgroup_count_connect6.c" } - // EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=12 imm=0 + // EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=11 imm=0 #line 49 "sample/cgroup_count_connect6.c" if (r0 != IMMEDIATE(0)) { #line 49 "sample/cgroup_count_connect6.c" @@ -179,16 +177,13 @@ count_tcp_connect6(void* context) // EBPF_OP_ADD64_IMM pc=18 dst=r3 src=r0 offset=0 imm=-16 #line 50 "sample/cgroup_count_connect6.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=19 dst=r6 src=r0 offset=0 imm=0 -#line 50 "sample/cgroup_count_connect6.c" - r6 = IMMEDIATE(0); - // EBPF_OP_LDDW pc=20 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=19 dst=r1 src=r1 offset=0 imm=1 #line 51 "sample/cgroup_count_connect6.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_MOV64_IMM pc=22 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=21 dst=r4 src=r0 offset=0 imm=0 #line 51 "sample/cgroup_count_connect6.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=23 dst=r0 src=r0 offset=0 imm=2 + // EBPF_OP_CALL pc=22 dst=r0 src=r0 offset=0 imm=2 #line 51 "sample/cgroup_count_connect6.c" r0 = count_tcp_connect6_helpers[1].address(r1, r2, r3, r4, r5, context); #line 51 "sample/cgroup_count_connect6.c" @@ -197,27 +192,25 @@ count_tcp_connect6(void* context) return 0; #line 51 "sample/cgroup_count_connect6.c" } - // EBPF_OP_JA pc=24 dst=r0 src=r0 offset=4 imm=0 + // EBPF_OP_JA pc=23 dst=r0 src=r0 offset=3 imm=0 #line 51 "sample/cgroup_count_connect6.c" goto label_2; label_1: - // EBPF_OP_LDXDW pc=25 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_LDXDW pc=24 dst=r1 src=r0 offset=0 imm=0 #line 53 "sample/cgroup_count_connect6.c" r1 = *(uint64_t*)(uintptr_t)(r0 + OFFSET(0)); - // EBPF_OP_ADD64_IMM pc=26 dst=r1 src=r0 offset=0 imm=1 + // EBPF_OP_ADD64_IMM pc=25 dst=r1 src=r0 offset=0 imm=1 #line 53 "sample/cgroup_count_connect6.c" r1 += IMMEDIATE(1); - // EBPF_OP_STXDW pc=27 dst=r0 src=r1 offset=0 imm=0 + // EBPF_OP_STXDW pc=26 dst=r0 src=r1 offset=0 imm=0 #line 53 "sample/cgroup_count_connect6.c" *(uint64_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint64_t)r1; - // EBPF_OP_MOV64_IMM pc=28 dst=r6 src=r0 offset=0 imm=0 -#line 53 "sample/cgroup_count_connect6.c" - r6 = IMMEDIATE(0); label_2: - // EBPF_OP_MOV64_REG pc=29 dst=r0 src=r6 offset=0 imm=0 -#line 62 "sample/cgroup_count_connect6.c" - r0 = r6; - // EBPF_OP_EXIT pc=30 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=27 dst=r0 src=r0 offset=0 imm=0 +#line 53 "sample/cgroup_count_connect6.c" + r0 = IMMEDIATE(0); +label_3: + // EBPF_OP_EXIT pc=28 dst=r0 src=r0 offset=0 imm=0 #line 62 "sample/cgroup_count_connect6.c" return r0; #line 31 "sample/cgroup_count_connect6.c" @@ -237,7 +230,7 @@ static program_entry_t _programs[] = { 1, count_tcp_connect6_helpers, 2, - 31, + 29, &count_tcp_connect6_program_type_guid, &count_tcp_connect6_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/cgroup_count_connect6_raw.c b/tests/bpf2c_tests/expected/cgroup_count_connect6_raw.c index 1bc50219a8..7a742e0838 100644 --- a/tests/bpf2c_tests/expected/cgroup_count_connect6_raw.c +++ b/tests/bpf2c_tests/expected/cgroup_count_connect6_raw.c @@ -71,8 +71,6 @@ count_tcp_connect6(void* context) register uint64_t r4 = 0; #line 31 "sample/cgroup_count_connect6.c" register uint64_t r5 = 0; -#line 31 "sample/cgroup_count_connect6.c" - register uint64_t r6 = 0; #line 31 "sample/cgroup_count_connect6.c" register uint64_t r10 = 0; @@ -81,27 +79,27 @@ count_tcp_connect6(void* context) #line 31 "sample/cgroup_count_connect6.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); - // EBPF_OP_MOV64_IMM pc=0 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=0 dst=r0 src=r0 offset=0 imm=1 #line 31 "sample/cgroup_count_connect6.c" - r6 = IMMEDIATE(1); + r0 = IMMEDIATE(1); // EBPF_OP_LDXW pc=1 dst=r2 src=r1 offset=44 imm=0 #line 34 "sample/cgroup_count_connect6.c" r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44)); - // EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=26 imm=6 + // EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=25 imm=6 #line 34 "sample/cgroup_count_connect6.c" if (r2 != IMMEDIATE(6)) { #line 34 "sample/cgroup_count_connect6.c" - goto label_2; + goto label_3; #line 34 "sample/cgroup_count_connect6.c" } // EBPF_OP_LDXH pc=3 dst=r1 src=r1 offset=40 imm=0 #line 40 "sample/cgroup_count_connect6.c" r1 = *(uint16_t*)(uintptr_t)(r1 + OFFSET(40)); - // EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=24 imm=7459 + // EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=23 imm=7459 #line 40 "sample/cgroup_count_connect6.c" if (r1 != IMMEDIATE(7459)) { #line 40 "sample/cgroup_count_connect6.c" - goto label_2; + goto label_3; #line 40 "sample/cgroup_count_connect6.c" } // EBPF_OP_MOV64_IMM pc=5 dst=r1 src=r0 offset=0 imm=8989 @@ -128,7 +126,7 @@ count_tcp_connect6(void* context) return 0; #line 48 "sample/cgroup_count_connect6.c" } - // EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=12 imm=0 + // EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=11 imm=0 #line 49 "sample/cgroup_count_connect6.c" if (r0 != IMMEDIATE(0)) { #line 49 "sample/cgroup_count_connect6.c" @@ -153,16 +151,13 @@ count_tcp_connect6(void* context) // EBPF_OP_ADD64_IMM pc=18 dst=r3 src=r0 offset=0 imm=-16 #line 50 "sample/cgroup_count_connect6.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=19 dst=r6 src=r0 offset=0 imm=0 -#line 50 "sample/cgroup_count_connect6.c" - r6 = IMMEDIATE(0); - // EBPF_OP_LDDW pc=20 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=19 dst=r1 src=r1 offset=0 imm=1 #line 51 "sample/cgroup_count_connect6.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_MOV64_IMM pc=22 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=21 dst=r4 src=r0 offset=0 imm=0 #line 51 "sample/cgroup_count_connect6.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=23 dst=r0 src=r0 offset=0 imm=2 + // EBPF_OP_CALL pc=22 dst=r0 src=r0 offset=0 imm=2 #line 51 "sample/cgroup_count_connect6.c" r0 = count_tcp_connect6_helpers[1].address(r1, r2, r3, r4, r5, context); #line 51 "sample/cgroup_count_connect6.c" @@ -171,27 +166,25 @@ count_tcp_connect6(void* context) return 0; #line 51 "sample/cgroup_count_connect6.c" } - // EBPF_OP_JA pc=24 dst=r0 src=r0 offset=4 imm=0 + // EBPF_OP_JA pc=23 dst=r0 src=r0 offset=3 imm=0 #line 51 "sample/cgroup_count_connect6.c" goto label_2; label_1: - // EBPF_OP_LDXDW pc=25 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_LDXDW pc=24 dst=r1 src=r0 offset=0 imm=0 #line 53 "sample/cgroup_count_connect6.c" r1 = *(uint64_t*)(uintptr_t)(r0 + OFFSET(0)); - // EBPF_OP_ADD64_IMM pc=26 dst=r1 src=r0 offset=0 imm=1 + // EBPF_OP_ADD64_IMM pc=25 dst=r1 src=r0 offset=0 imm=1 #line 53 "sample/cgroup_count_connect6.c" r1 += IMMEDIATE(1); - // EBPF_OP_STXDW pc=27 dst=r0 src=r1 offset=0 imm=0 + // EBPF_OP_STXDW pc=26 dst=r0 src=r1 offset=0 imm=0 #line 53 "sample/cgroup_count_connect6.c" *(uint64_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint64_t)r1; - // EBPF_OP_MOV64_IMM pc=28 dst=r6 src=r0 offset=0 imm=0 -#line 53 "sample/cgroup_count_connect6.c" - r6 = IMMEDIATE(0); label_2: - // EBPF_OP_MOV64_REG pc=29 dst=r0 src=r6 offset=0 imm=0 -#line 62 "sample/cgroup_count_connect6.c" - r0 = r6; - // EBPF_OP_EXIT pc=30 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=27 dst=r0 src=r0 offset=0 imm=0 +#line 53 "sample/cgroup_count_connect6.c" + r0 = IMMEDIATE(0); +label_3: + // EBPF_OP_EXIT pc=28 dst=r0 src=r0 offset=0 imm=0 #line 62 "sample/cgroup_count_connect6.c" return r0; #line 31 "sample/cgroup_count_connect6.c" @@ -211,7 +204,7 @@ static program_entry_t _programs[] = { 1, count_tcp_connect6_helpers, 2, - 31, + 29, &count_tcp_connect6_program_type_guid, &count_tcp_connect6_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/cgroup_count_connect6_sys.c b/tests/bpf2c_tests/expected/cgroup_count_connect6_sys.c index 19f4703111..d5536ee532 100644 --- a/tests/bpf2c_tests/expected/cgroup_count_connect6_sys.c +++ b/tests/bpf2c_tests/expected/cgroup_count_connect6_sys.c @@ -232,8 +232,6 @@ count_tcp_connect6(void* context) register uint64_t r4 = 0; #line 31 "sample/cgroup_count_connect6.c" register uint64_t r5 = 0; -#line 31 "sample/cgroup_count_connect6.c" - register uint64_t r6 = 0; #line 31 "sample/cgroup_count_connect6.c" register uint64_t r10 = 0; @@ -242,27 +240,27 @@ count_tcp_connect6(void* context) #line 31 "sample/cgroup_count_connect6.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); - // EBPF_OP_MOV64_IMM pc=0 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=0 dst=r0 src=r0 offset=0 imm=1 #line 31 "sample/cgroup_count_connect6.c" - r6 = IMMEDIATE(1); + r0 = IMMEDIATE(1); // EBPF_OP_LDXW pc=1 dst=r2 src=r1 offset=44 imm=0 #line 34 "sample/cgroup_count_connect6.c" r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44)); - // EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=26 imm=6 + // EBPF_OP_JNE_IMM pc=2 dst=r2 src=r0 offset=25 imm=6 #line 34 "sample/cgroup_count_connect6.c" if (r2 != IMMEDIATE(6)) { #line 34 "sample/cgroup_count_connect6.c" - goto label_2; + goto label_3; #line 34 "sample/cgroup_count_connect6.c" } // EBPF_OP_LDXH pc=3 dst=r1 src=r1 offset=40 imm=0 #line 40 "sample/cgroup_count_connect6.c" r1 = *(uint16_t*)(uintptr_t)(r1 + OFFSET(40)); - // EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=24 imm=7459 + // EBPF_OP_JNE_IMM pc=4 dst=r1 src=r0 offset=23 imm=7459 #line 40 "sample/cgroup_count_connect6.c" if (r1 != IMMEDIATE(7459)) { #line 40 "sample/cgroup_count_connect6.c" - goto label_2; + goto label_3; #line 40 "sample/cgroup_count_connect6.c" } // EBPF_OP_MOV64_IMM pc=5 dst=r1 src=r0 offset=0 imm=8989 @@ -289,7 +287,7 @@ count_tcp_connect6(void* context) return 0; #line 48 "sample/cgroup_count_connect6.c" } - // EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=12 imm=0 + // EBPF_OP_JNE_IMM pc=12 dst=r0 src=r0 offset=11 imm=0 #line 49 "sample/cgroup_count_connect6.c" if (r0 != IMMEDIATE(0)) { #line 49 "sample/cgroup_count_connect6.c" @@ -314,16 +312,13 @@ count_tcp_connect6(void* context) // EBPF_OP_ADD64_IMM pc=18 dst=r3 src=r0 offset=0 imm=-16 #line 50 "sample/cgroup_count_connect6.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=19 dst=r6 src=r0 offset=0 imm=0 -#line 50 "sample/cgroup_count_connect6.c" - r6 = IMMEDIATE(0); - // EBPF_OP_LDDW pc=20 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=19 dst=r1 src=r1 offset=0 imm=1 #line 51 "sample/cgroup_count_connect6.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_MOV64_IMM pc=22 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=21 dst=r4 src=r0 offset=0 imm=0 #line 51 "sample/cgroup_count_connect6.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=23 dst=r0 src=r0 offset=0 imm=2 + // EBPF_OP_CALL pc=22 dst=r0 src=r0 offset=0 imm=2 #line 51 "sample/cgroup_count_connect6.c" r0 = count_tcp_connect6_helpers[1].address(r1, r2, r3, r4, r5, context); #line 51 "sample/cgroup_count_connect6.c" @@ -332,27 +327,25 @@ count_tcp_connect6(void* context) return 0; #line 51 "sample/cgroup_count_connect6.c" } - // EBPF_OP_JA pc=24 dst=r0 src=r0 offset=4 imm=0 + // EBPF_OP_JA pc=23 dst=r0 src=r0 offset=3 imm=0 #line 51 "sample/cgroup_count_connect6.c" goto label_2; label_1: - // EBPF_OP_LDXDW pc=25 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_LDXDW pc=24 dst=r1 src=r0 offset=0 imm=0 #line 53 "sample/cgroup_count_connect6.c" r1 = *(uint64_t*)(uintptr_t)(r0 + OFFSET(0)); - // EBPF_OP_ADD64_IMM pc=26 dst=r1 src=r0 offset=0 imm=1 + // EBPF_OP_ADD64_IMM pc=25 dst=r1 src=r0 offset=0 imm=1 #line 53 "sample/cgroup_count_connect6.c" r1 += IMMEDIATE(1); - // EBPF_OP_STXDW pc=27 dst=r0 src=r1 offset=0 imm=0 + // EBPF_OP_STXDW pc=26 dst=r0 src=r1 offset=0 imm=0 #line 53 "sample/cgroup_count_connect6.c" *(uint64_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint64_t)r1; - // EBPF_OP_MOV64_IMM pc=28 dst=r6 src=r0 offset=0 imm=0 -#line 53 "sample/cgroup_count_connect6.c" - r6 = IMMEDIATE(0); label_2: - // EBPF_OP_MOV64_REG pc=29 dst=r0 src=r6 offset=0 imm=0 -#line 62 "sample/cgroup_count_connect6.c" - r0 = r6; - // EBPF_OP_EXIT pc=30 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=27 dst=r0 src=r0 offset=0 imm=0 +#line 53 "sample/cgroup_count_connect6.c" + r0 = IMMEDIATE(0); +label_3: + // EBPF_OP_EXIT pc=28 dst=r0 src=r0 offset=0 imm=0 #line 62 "sample/cgroup_count_connect6.c" return r0; #line 31 "sample/cgroup_count_connect6.c" @@ -372,7 +365,7 @@ static program_entry_t _programs[] = { 1, count_tcp_connect6_helpers, 2, - 31, + 29, &count_tcp_connect6_program_type_guid, &count_tcp_connect6_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/decap_permit_packet_dll.c b/tests/bpf2c_tests/expected/decap_permit_packet_dll.c index b2cf79dbdb..6a0ab4a631 100644 --- a/tests/bpf2c_tests/expected/decap_permit_packet_dll.c +++ b/tests/bpf2c_tests/expected/decap_permit_packet_dll.c @@ -75,8 +75,6 @@ decapsulate_permit_packet(void* context) register uint64_t r4 = 0; #line 94 "sample/decap_permit_packet.c" register uint64_t r5 = 0; -#line 94 "sample/decap_permit_packet.c" - register uint64_t r6 = 0; #line 94 "sample/decap_permit_packet.c" register uint64_t r10 = 0; @@ -97,10 +95,10 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_IMM pc=3 dst=r4 src=r0 offset=0 imm=14 #line 94 "sample/decap_permit_packet.c" r4 += IMMEDIATE(14); - // EBPF_OP_MOV64_IMM pc=4 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=4 dst=r0 src=r0 offset=0 imm=1 #line 94 "sample/decap_permit_packet.c" - r6 = IMMEDIATE(1); - // EBPF_OP_JGT_REG pc=5 dst=r4 src=r3 offset=100 imm=0 + r0 = IMMEDIATE(1); + // EBPF_OP_JGT_REG pc=5 dst=r4 src=r3 offset=103 imm=0 #line 94 "sample/decap_permit_packet.c" if (r4 > r3) { #line 94 "sample/decap_permit_packet.c" @@ -110,14 +108,14 @@ decapsulate_permit_packet(void* context) // EBPF_OP_LDXH pc=6 dst=r5 src=r2 offset=12 imm=0 #line 99 "sample/decap_permit_packet.c" r5 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_JEQ_IMM pc=7 dst=r5 src=r0 offset=54 imm=56710 + // EBPF_OP_JEQ_IMM pc=7 dst=r5 src=r0 offset=56 imm=56710 #line 99 "sample/decap_permit_packet.c" if (r5 == IMMEDIATE(56710)) { #line 99 "sample/decap_permit_packet.c" goto label_1; #line 99 "sample/decap_permit_packet.c" } - // EBPF_OP_JNE_IMM pc=8 dst=r5 src=r0 offset=97 imm=8 + // EBPF_OP_JNE_IMM pc=8 dst=r5 src=r0 offset=100 imm=8 #line 99 "sample/decap_permit_packet.c" if (r5 != IMMEDIATE(8)) { #line 99 "sample/decap_permit_packet.c" @@ -130,7 +128,7 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_IMM pc=10 dst=r5 src=r0 offset=0 imm=34 #line 100 "sample/decap_permit_packet.c" r5 += IMMEDIATE(34); - // EBPF_OP_JGT_REG pc=11 dst=r5 src=r3 offset=94 imm=0 + // EBPF_OP_JGT_REG pc=11 dst=r5 src=r3 offset=97 imm=0 #line 100 "sample/decap_permit_packet.c" if (r5 > r3) { #line 100 "sample/decap_permit_packet.c" @@ -140,7 +138,7 @@ decapsulate_permit_packet(void* context) // EBPF_OP_LDXB pc=12 dst=r5 src=r2 offset=23 imm=0 #line 106 "sample/decap_permit_packet.c" r5 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(23)); - // EBPF_OP_JNE_IMM pc=13 dst=r5 src=r0 offset=92 imm=4 + // EBPF_OP_JNE_IMM pc=13 dst=r5 src=r0 offset=95 imm=4 #line 106 "sample/decap_permit_packet.c" if (r5 != IMMEDIATE(4)) { #line 106 "sample/decap_permit_packet.c" @@ -162,7 +160,7 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_IMM pc=18 dst=r4 src=r0 offset=0 imm=20 #line 107 "sample/decap_permit_packet.c" r4 += IMMEDIATE(20); - // EBPF_OP_JGT_REG pc=19 dst=r4 src=r3 offset=86 imm=0 + // EBPF_OP_JGT_REG pc=19 dst=r4 src=r3 offset=89 imm=0 #line 107 "sample/decap_permit_packet.c" if (r4 > r3) { #line 107 "sample/decap_permit_packet.c" @@ -175,10 +173,10 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_REG pc=21 dst=r4 src=r5 offset=0 imm=0 #line 29 "sample/decap_permit_packet.c" r4 += r5; - // EBPF_OP_MOV64_IMM pc=22 dst=r6 src=r0 offset=0 imm=2 + // EBPF_OP_MOV64_IMM pc=22 dst=r0 src=r0 offset=0 imm=2 #line 29 "sample/decap_permit_packet.c" - r6 = IMMEDIATE(2); - // EBPF_OP_JGT_REG pc=23 dst=r4 src=r3 offset=82 imm=0 + r0 = IMMEDIATE(2); + // EBPF_OP_JGT_REG pc=23 dst=r4 src=r3 offset=85 imm=0 #line 29 "sample/decap_permit_packet.c" if (r4 > r3) { #line 29 "sample/decap_permit_packet.c" @@ -191,7 +189,7 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_IMM pc=25 dst=r5 src=r0 offset=0 imm=14 #line 29 "sample/decap_permit_packet.c" r5 += IMMEDIATE(14); - // EBPF_OP_JGT_REG pc=26 dst=r5 src=r3 offset=79 imm=0 + // EBPF_OP_JGT_REG pc=26 dst=r5 src=r3 offset=82 imm=0 #line 29 "sample/decap_permit_packet.c" if (r5 > r3) { #line 29 "sample/decap_permit_packet.c" @@ -294,150 +292,156 @@ decapsulate_permit_packet(void* context) return 0; #line 41 "sample/decap_permit_packet.c" } - // EBPF_OP_LSH64_IMM pc=57 dst=r0 src=r0 offset=0 imm=32 + // EBPF_OP_MOV64_REG pc=57 dst=r1 src=r0 offset=0 imm=0 +#line 41 "sample/decap_permit_packet.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=58 dst=r0 src=r0 offset=0 imm=2 +#line 41 "sample/decap_permit_packet.c" + r0 = IMMEDIATE(2); + // EBPF_OP_LSH64_IMM pc=59 dst=r1 src=r0 offset=0 imm=32 #line 41 "sample/decap_permit_packet.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_ARSH64_IMM pc=58 dst=r0 src=r0 offset=0 imm=32 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_ARSH64_IMM pc=60 dst=r1 src=r0 offset=0 imm=32 #line 41 "sample/decap_permit_packet.c" - r0 = (int64_t)r0 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_IMM pc=59 dst=r1 src=r0 offset=0 imm=0 + r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); + // EBPF_OP_MOV64_IMM pc=61 dst=r2 src=r0 offset=0 imm=0 #line 41 "sample/decap_permit_packet.c" - r1 = IMMEDIATE(0); - // EBPF_OP_JSGT_REG pc=60 dst=r1 src=r0 offset=45 imm=0 + r2 = IMMEDIATE(0); + // EBPF_OP_JSGT_REG pc=62 dst=r2 src=r1 offset=46 imm=0 #line 41 "sample/decap_permit_packet.c" - if ((int64_t)r1 > (int64_t)r0) { + if ((int64_t)r2 > (int64_t)r1) { #line 41 "sample/decap_permit_packet.c" goto label_3; #line 41 "sample/decap_permit_packet.c" } - // EBPF_OP_JA pc=61 dst=r0 src=r0 offset=43 imm=0 + // EBPF_OP_JA pc=63 dst=r0 src=r0 offset=44 imm=0 #line 41 "sample/decap_permit_packet.c" goto label_2; label_1: - // EBPF_OP_MOV64_REG pc=62 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=64 dst=r4 src=r2 offset=0 imm=0 #line 114 "sample/decap_permit_packet.c" r4 = r2; - // EBPF_OP_ADD64_IMM pc=63 dst=r4 src=r0 offset=0 imm=54 + // EBPF_OP_ADD64_IMM pc=65 dst=r4 src=r0 offset=0 imm=54 #line 114 "sample/decap_permit_packet.c" r4 += IMMEDIATE(54); - // EBPF_OP_JGT_REG pc=64 dst=r4 src=r3 offset=41 imm=0 + // EBPF_OP_JGT_REG pc=66 dst=r4 src=r3 offset=42 imm=0 #line 114 "sample/decap_permit_packet.c" if (r4 > r3) { #line 114 "sample/decap_permit_packet.c" goto label_3; #line 114 "sample/decap_permit_packet.c" } - // EBPF_OP_LDXB pc=65 dst=r4 src=r2 offset=20 imm=0 + // EBPF_OP_LDXB pc=67 dst=r4 src=r2 offset=20 imm=0 #line 120 "sample/decap_permit_packet.c" r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(20)); - // EBPF_OP_JNE_IMM pc=66 dst=r4 src=r0 offset=39 imm=41 + // EBPF_OP_JNE_IMM pc=68 dst=r4 src=r0 offset=40 imm=41 #line 120 "sample/decap_permit_packet.c" if (r4 != IMMEDIATE(41)) { #line 120 "sample/decap_permit_packet.c" goto label_3; #line 120 "sample/decap_permit_packet.c" } - // EBPF_OP_MOV64_REG pc=67 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=69 dst=r4 src=r2 offset=0 imm=0 #line 120 "sample/decap_permit_packet.c" r4 = r2; - // EBPF_OP_ADD64_IMM pc=68 dst=r4 src=r0 offset=0 imm=94 + // EBPF_OP_ADD64_IMM pc=70 dst=r4 src=r0 offset=0 imm=94 #line 120 "sample/decap_permit_packet.c" r4 += IMMEDIATE(94); - // EBPF_OP_JGT_REG pc=69 dst=r4 src=r3 offset=36 imm=0 + // EBPF_OP_JGT_REG pc=71 dst=r4 src=r3 offset=37 imm=0 #line 120 "sample/decap_permit_packet.c" if (r4 > r3) { #line 120 "sample/decap_permit_packet.c" goto label_3; #line 120 "sample/decap_permit_packet.c" } - // EBPF_OP_LDXB pc=70 dst=r3 src=r2 offset=13 imm=0 + // EBPF_OP_LDXB pc=72 dst=r3 src=r2 offset=13 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(13)); - // EBPF_OP_STXB pc=71 dst=r2 src=r3 offset=53 imm=0 + // EBPF_OP_STXB pc=73 dst=r2 src=r3 offset=53 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(53)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=72 dst=r3 src=r2 offset=12 imm=0 + // EBPF_OP_LDXB pc=74 dst=r3 src=r2 offset=12 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_STXB pc=73 dst=r2 src=r3 offset=52 imm=0 + // EBPF_OP_STXB pc=75 dst=r2 src=r3 offset=52 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(52)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=74 dst=r3 src=r2 offset=11 imm=0 + // EBPF_OP_LDXB pc=76 dst=r3 src=r2 offset=11 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(11)); - // EBPF_OP_STXB pc=75 dst=r2 src=r3 offset=51 imm=0 + // EBPF_OP_STXB pc=77 dst=r2 src=r3 offset=51 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(51)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=76 dst=r3 src=r2 offset=10 imm=0 + // EBPF_OP_LDXB pc=78 dst=r3 src=r2 offset=10 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(10)); - // EBPF_OP_STXB pc=77 dst=r2 src=r3 offset=50 imm=0 + // EBPF_OP_STXB pc=79 dst=r2 src=r3 offset=50 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(50)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=78 dst=r3 src=r2 offset=9 imm=0 + // EBPF_OP_LDXB pc=80 dst=r3 src=r2 offset=9 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(9)); - // EBPF_OP_STXB pc=79 dst=r2 src=r3 offset=49 imm=0 + // EBPF_OP_STXB pc=81 dst=r2 src=r3 offset=49 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(49)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=80 dst=r3 src=r2 offset=8 imm=0 + // EBPF_OP_LDXB pc=82 dst=r3 src=r2 offset=8 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(8)); - // EBPF_OP_STXB pc=81 dst=r2 src=r3 offset=48 imm=0 + // EBPF_OP_STXB pc=83 dst=r2 src=r3 offset=48 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(48)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=82 dst=r3 src=r2 offset=7 imm=0 + // EBPF_OP_LDXB pc=84 dst=r3 src=r2 offset=7 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(7)); - // EBPF_OP_STXB pc=83 dst=r2 src=r3 offset=47 imm=0 + // EBPF_OP_STXB pc=85 dst=r2 src=r3 offset=47 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(47)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=84 dst=r3 src=r2 offset=6 imm=0 + // EBPF_OP_LDXB pc=86 dst=r3 src=r2 offset=6 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(6)); - // EBPF_OP_STXB pc=85 dst=r2 src=r3 offset=46 imm=0 + // EBPF_OP_STXB pc=87 dst=r2 src=r3 offset=46 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(46)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=86 dst=r3 src=r2 offset=5 imm=0 + // EBPF_OP_LDXB pc=88 dst=r3 src=r2 offset=5 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(5)); - // EBPF_OP_STXB pc=87 dst=r2 src=r3 offset=45 imm=0 + // EBPF_OP_STXB pc=89 dst=r2 src=r3 offset=45 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(45)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=88 dst=r3 src=r2 offset=4 imm=0 + // EBPF_OP_LDXB pc=90 dst=r3 src=r2 offset=4 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(4)); - // EBPF_OP_STXB pc=89 dst=r2 src=r3 offset=44 imm=0 + // EBPF_OP_STXB pc=91 dst=r2 src=r3 offset=44 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(44)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=90 dst=r3 src=r2 offset=3 imm=0 + // EBPF_OP_LDXB pc=92 dst=r3 src=r2 offset=3 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(3)); - // EBPF_OP_STXB pc=91 dst=r2 src=r3 offset=43 imm=0 + // EBPF_OP_STXB pc=93 dst=r2 src=r3 offset=43 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(43)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=92 dst=r3 src=r2 offset=2 imm=0 + // EBPF_OP_LDXB pc=94 dst=r3 src=r2 offset=2 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_STXB pc=93 dst=r2 src=r3 offset=42 imm=0 + // EBPF_OP_STXB pc=95 dst=r2 src=r3 offset=42 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(42)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=94 dst=r3 src=r2 offset=1 imm=0 + // EBPF_OP_LDXB pc=96 dst=r3 src=r2 offset=1 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(1)); - // EBPF_OP_STXB pc=95 dst=r2 src=r3 offset=41 imm=0 + // EBPF_OP_STXB pc=97 dst=r2 src=r3 offset=41 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(41)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=96 dst=r3 src=r2 offset=0 imm=0 + // EBPF_OP_LDXB pc=98 dst=r3 src=r2 offset=0 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_STXB pc=97 dst=r2 src=r3 offset=40 imm=0 + // EBPF_OP_STXB pc=99 dst=r2 src=r3 offset=40 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(40)) = (uint8_t)r3; - // EBPF_OP_MOV64_IMM pc=98 dst=r2 src=r0 offset=0 imm=40 + // EBPF_OP_MOV64_IMM pc=100 dst=r2 src=r0 offset=0 imm=40 #line 70 "sample/decap_permit_packet.c" r2 = IMMEDIATE(40); - // EBPF_OP_CALL pc=99 dst=r0 src=r0 offset=0 imm=65536 + // EBPF_OP_CALL pc=101 dst=r0 src=r0 offset=0 imm=65536 #line 70 "sample/decap_permit_packet.c" r0 = decapsulate_permit_packet_helpers[0].address(r1, r2, r3, r4, r5, context); #line 70 "sample/decap_permit_packet.c" @@ -446,34 +450,34 @@ decapsulate_permit_packet(void* context) return 0; #line 70 "sample/decap_permit_packet.c" } - // EBPF_OP_MOV64_IMM pc=100 dst=r6 src=r0 offset=0 imm=2 + // EBPF_OP_MOV64_REG pc=102 dst=r1 src=r0 offset=0 imm=0 #line 70 "sample/decap_permit_packet.c" - r6 = IMMEDIATE(2); - // EBPF_OP_LSH64_IMM pc=101 dst=r0 src=r0 offset=0 imm=32 + r1 = r0; + // EBPF_OP_MOV64_IMM pc=103 dst=r0 src=r0 offset=0 imm=2 #line 70 "sample/decap_permit_packet.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_ARSH64_IMM pc=102 dst=r0 src=r0 offset=0 imm=32 + r0 = IMMEDIATE(2); + // EBPF_OP_LSH64_IMM pc=104 dst=r1 src=r0 offset=0 imm=32 #line 70 "sample/decap_permit_packet.c" - r0 = (int64_t)r0 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_IMM pc=103 dst=r1 src=r0 offset=0 imm=0 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_ARSH64_IMM pc=105 dst=r1 src=r0 offset=0 imm=32 #line 70 "sample/decap_permit_packet.c" - r1 = IMMEDIATE(0); - // EBPF_OP_JSGT_REG pc=104 dst=r1 src=r0 offset=1 imm=0 + r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); + // EBPF_OP_MOV64_IMM pc=106 dst=r2 src=r0 offset=0 imm=0 #line 70 "sample/decap_permit_packet.c" - if ((int64_t)r1 > (int64_t)r0) { + r2 = IMMEDIATE(0); + // EBPF_OP_JSGT_REG pc=107 dst=r2 src=r1 offset=1 imm=0 +#line 70 "sample/decap_permit_packet.c" + if ((int64_t)r2 > (int64_t)r1) { #line 70 "sample/decap_permit_packet.c" goto label_3; #line 70 "sample/decap_permit_packet.c" } label_2: - // EBPF_OP_MOV64_IMM pc=105 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=108 dst=r0 src=r0 offset=0 imm=1 #line 70 "sample/decap_permit_packet.c" - r6 = IMMEDIATE(1); + r0 = IMMEDIATE(1); label_3: - // EBPF_OP_MOV64_REG pc=106 dst=r0 src=r6 offset=0 imm=0 -#line 131 "sample/decap_permit_packet.c" - r0 = r6; - // EBPF_OP_EXIT pc=107 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_EXIT pc=109 dst=r0 src=r0 offset=0 imm=0 #line 131 "sample/decap_permit_packet.c" return r0; #line 94 "sample/decap_permit_packet.c" @@ -493,7 +497,7 @@ static program_entry_t _programs[] = { 0, decapsulate_permit_packet_helpers, 1, - 108, + 110, &decapsulate_permit_packet_program_type_guid, &decapsulate_permit_packet_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/decap_permit_packet_raw.c b/tests/bpf2c_tests/expected/decap_permit_packet_raw.c index 5e9af3e36c..eb2e867071 100644 --- a/tests/bpf2c_tests/expected/decap_permit_packet_raw.c +++ b/tests/bpf2c_tests/expected/decap_permit_packet_raw.c @@ -49,8 +49,6 @@ decapsulate_permit_packet(void* context) register uint64_t r4 = 0; #line 94 "sample/decap_permit_packet.c" register uint64_t r5 = 0; -#line 94 "sample/decap_permit_packet.c" - register uint64_t r6 = 0; #line 94 "sample/decap_permit_packet.c" register uint64_t r10 = 0; @@ -71,10 +69,10 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_IMM pc=3 dst=r4 src=r0 offset=0 imm=14 #line 94 "sample/decap_permit_packet.c" r4 += IMMEDIATE(14); - // EBPF_OP_MOV64_IMM pc=4 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=4 dst=r0 src=r0 offset=0 imm=1 #line 94 "sample/decap_permit_packet.c" - r6 = IMMEDIATE(1); - // EBPF_OP_JGT_REG pc=5 dst=r4 src=r3 offset=100 imm=0 + r0 = IMMEDIATE(1); + // EBPF_OP_JGT_REG pc=5 dst=r4 src=r3 offset=103 imm=0 #line 94 "sample/decap_permit_packet.c" if (r4 > r3) { #line 94 "sample/decap_permit_packet.c" @@ -84,14 +82,14 @@ decapsulate_permit_packet(void* context) // EBPF_OP_LDXH pc=6 dst=r5 src=r2 offset=12 imm=0 #line 99 "sample/decap_permit_packet.c" r5 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_JEQ_IMM pc=7 dst=r5 src=r0 offset=54 imm=56710 + // EBPF_OP_JEQ_IMM pc=7 dst=r5 src=r0 offset=56 imm=56710 #line 99 "sample/decap_permit_packet.c" if (r5 == IMMEDIATE(56710)) { #line 99 "sample/decap_permit_packet.c" goto label_1; #line 99 "sample/decap_permit_packet.c" } - // EBPF_OP_JNE_IMM pc=8 dst=r5 src=r0 offset=97 imm=8 + // EBPF_OP_JNE_IMM pc=8 dst=r5 src=r0 offset=100 imm=8 #line 99 "sample/decap_permit_packet.c" if (r5 != IMMEDIATE(8)) { #line 99 "sample/decap_permit_packet.c" @@ -104,7 +102,7 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_IMM pc=10 dst=r5 src=r0 offset=0 imm=34 #line 100 "sample/decap_permit_packet.c" r5 += IMMEDIATE(34); - // EBPF_OP_JGT_REG pc=11 dst=r5 src=r3 offset=94 imm=0 + // EBPF_OP_JGT_REG pc=11 dst=r5 src=r3 offset=97 imm=0 #line 100 "sample/decap_permit_packet.c" if (r5 > r3) { #line 100 "sample/decap_permit_packet.c" @@ -114,7 +112,7 @@ decapsulate_permit_packet(void* context) // EBPF_OP_LDXB pc=12 dst=r5 src=r2 offset=23 imm=0 #line 106 "sample/decap_permit_packet.c" r5 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(23)); - // EBPF_OP_JNE_IMM pc=13 dst=r5 src=r0 offset=92 imm=4 + // EBPF_OP_JNE_IMM pc=13 dst=r5 src=r0 offset=95 imm=4 #line 106 "sample/decap_permit_packet.c" if (r5 != IMMEDIATE(4)) { #line 106 "sample/decap_permit_packet.c" @@ -136,7 +134,7 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_IMM pc=18 dst=r4 src=r0 offset=0 imm=20 #line 107 "sample/decap_permit_packet.c" r4 += IMMEDIATE(20); - // EBPF_OP_JGT_REG pc=19 dst=r4 src=r3 offset=86 imm=0 + // EBPF_OP_JGT_REG pc=19 dst=r4 src=r3 offset=89 imm=0 #line 107 "sample/decap_permit_packet.c" if (r4 > r3) { #line 107 "sample/decap_permit_packet.c" @@ -149,10 +147,10 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_REG pc=21 dst=r4 src=r5 offset=0 imm=0 #line 29 "sample/decap_permit_packet.c" r4 += r5; - // EBPF_OP_MOV64_IMM pc=22 dst=r6 src=r0 offset=0 imm=2 + // EBPF_OP_MOV64_IMM pc=22 dst=r0 src=r0 offset=0 imm=2 #line 29 "sample/decap_permit_packet.c" - r6 = IMMEDIATE(2); - // EBPF_OP_JGT_REG pc=23 dst=r4 src=r3 offset=82 imm=0 + r0 = IMMEDIATE(2); + // EBPF_OP_JGT_REG pc=23 dst=r4 src=r3 offset=85 imm=0 #line 29 "sample/decap_permit_packet.c" if (r4 > r3) { #line 29 "sample/decap_permit_packet.c" @@ -165,7 +163,7 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_IMM pc=25 dst=r5 src=r0 offset=0 imm=14 #line 29 "sample/decap_permit_packet.c" r5 += IMMEDIATE(14); - // EBPF_OP_JGT_REG pc=26 dst=r5 src=r3 offset=79 imm=0 + // EBPF_OP_JGT_REG pc=26 dst=r5 src=r3 offset=82 imm=0 #line 29 "sample/decap_permit_packet.c" if (r5 > r3) { #line 29 "sample/decap_permit_packet.c" @@ -268,150 +266,156 @@ decapsulate_permit_packet(void* context) return 0; #line 41 "sample/decap_permit_packet.c" } - // EBPF_OP_LSH64_IMM pc=57 dst=r0 src=r0 offset=0 imm=32 + // EBPF_OP_MOV64_REG pc=57 dst=r1 src=r0 offset=0 imm=0 +#line 41 "sample/decap_permit_packet.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=58 dst=r0 src=r0 offset=0 imm=2 +#line 41 "sample/decap_permit_packet.c" + r0 = IMMEDIATE(2); + // EBPF_OP_LSH64_IMM pc=59 dst=r1 src=r0 offset=0 imm=32 #line 41 "sample/decap_permit_packet.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_ARSH64_IMM pc=58 dst=r0 src=r0 offset=0 imm=32 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_ARSH64_IMM pc=60 dst=r1 src=r0 offset=0 imm=32 #line 41 "sample/decap_permit_packet.c" - r0 = (int64_t)r0 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_IMM pc=59 dst=r1 src=r0 offset=0 imm=0 + r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); + // EBPF_OP_MOV64_IMM pc=61 dst=r2 src=r0 offset=0 imm=0 #line 41 "sample/decap_permit_packet.c" - r1 = IMMEDIATE(0); - // EBPF_OP_JSGT_REG pc=60 dst=r1 src=r0 offset=45 imm=0 + r2 = IMMEDIATE(0); + // EBPF_OP_JSGT_REG pc=62 dst=r2 src=r1 offset=46 imm=0 #line 41 "sample/decap_permit_packet.c" - if ((int64_t)r1 > (int64_t)r0) { + if ((int64_t)r2 > (int64_t)r1) { #line 41 "sample/decap_permit_packet.c" goto label_3; #line 41 "sample/decap_permit_packet.c" } - // EBPF_OP_JA pc=61 dst=r0 src=r0 offset=43 imm=0 + // EBPF_OP_JA pc=63 dst=r0 src=r0 offset=44 imm=0 #line 41 "sample/decap_permit_packet.c" goto label_2; label_1: - // EBPF_OP_MOV64_REG pc=62 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=64 dst=r4 src=r2 offset=0 imm=0 #line 114 "sample/decap_permit_packet.c" r4 = r2; - // EBPF_OP_ADD64_IMM pc=63 dst=r4 src=r0 offset=0 imm=54 + // EBPF_OP_ADD64_IMM pc=65 dst=r4 src=r0 offset=0 imm=54 #line 114 "sample/decap_permit_packet.c" r4 += IMMEDIATE(54); - // EBPF_OP_JGT_REG pc=64 dst=r4 src=r3 offset=41 imm=0 + // EBPF_OP_JGT_REG pc=66 dst=r4 src=r3 offset=42 imm=0 #line 114 "sample/decap_permit_packet.c" if (r4 > r3) { #line 114 "sample/decap_permit_packet.c" goto label_3; #line 114 "sample/decap_permit_packet.c" } - // EBPF_OP_LDXB pc=65 dst=r4 src=r2 offset=20 imm=0 + // EBPF_OP_LDXB pc=67 dst=r4 src=r2 offset=20 imm=0 #line 120 "sample/decap_permit_packet.c" r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(20)); - // EBPF_OP_JNE_IMM pc=66 dst=r4 src=r0 offset=39 imm=41 + // EBPF_OP_JNE_IMM pc=68 dst=r4 src=r0 offset=40 imm=41 #line 120 "sample/decap_permit_packet.c" if (r4 != IMMEDIATE(41)) { #line 120 "sample/decap_permit_packet.c" goto label_3; #line 120 "sample/decap_permit_packet.c" } - // EBPF_OP_MOV64_REG pc=67 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=69 dst=r4 src=r2 offset=0 imm=0 #line 120 "sample/decap_permit_packet.c" r4 = r2; - // EBPF_OP_ADD64_IMM pc=68 dst=r4 src=r0 offset=0 imm=94 + // EBPF_OP_ADD64_IMM pc=70 dst=r4 src=r0 offset=0 imm=94 #line 120 "sample/decap_permit_packet.c" r4 += IMMEDIATE(94); - // EBPF_OP_JGT_REG pc=69 dst=r4 src=r3 offset=36 imm=0 + // EBPF_OP_JGT_REG pc=71 dst=r4 src=r3 offset=37 imm=0 #line 120 "sample/decap_permit_packet.c" if (r4 > r3) { #line 120 "sample/decap_permit_packet.c" goto label_3; #line 120 "sample/decap_permit_packet.c" } - // EBPF_OP_LDXB pc=70 dst=r3 src=r2 offset=13 imm=0 + // EBPF_OP_LDXB pc=72 dst=r3 src=r2 offset=13 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(13)); - // EBPF_OP_STXB pc=71 dst=r2 src=r3 offset=53 imm=0 + // EBPF_OP_STXB pc=73 dst=r2 src=r3 offset=53 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(53)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=72 dst=r3 src=r2 offset=12 imm=0 + // EBPF_OP_LDXB pc=74 dst=r3 src=r2 offset=12 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_STXB pc=73 dst=r2 src=r3 offset=52 imm=0 + // EBPF_OP_STXB pc=75 dst=r2 src=r3 offset=52 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(52)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=74 dst=r3 src=r2 offset=11 imm=0 + // EBPF_OP_LDXB pc=76 dst=r3 src=r2 offset=11 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(11)); - // EBPF_OP_STXB pc=75 dst=r2 src=r3 offset=51 imm=0 + // EBPF_OP_STXB pc=77 dst=r2 src=r3 offset=51 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(51)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=76 dst=r3 src=r2 offset=10 imm=0 + // EBPF_OP_LDXB pc=78 dst=r3 src=r2 offset=10 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(10)); - // EBPF_OP_STXB pc=77 dst=r2 src=r3 offset=50 imm=0 + // EBPF_OP_STXB pc=79 dst=r2 src=r3 offset=50 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(50)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=78 dst=r3 src=r2 offset=9 imm=0 + // EBPF_OP_LDXB pc=80 dst=r3 src=r2 offset=9 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(9)); - // EBPF_OP_STXB pc=79 dst=r2 src=r3 offset=49 imm=0 + // EBPF_OP_STXB pc=81 dst=r2 src=r3 offset=49 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(49)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=80 dst=r3 src=r2 offset=8 imm=0 + // EBPF_OP_LDXB pc=82 dst=r3 src=r2 offset=8 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(8)); - // EBPF_OP_STXB pc=81 dst=r2 src=r3 offset=48 imm=0 + // EBPF_OP_STXB pc=83 dst=r2 src=r3 offset=48 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(48)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=82 dst=r3 src=r2 offset=7 imm=0 + // EBPF_OP_LDXB pc=84 dst=r3 src=r2 offset=7 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(7)); - // EBPF_OP_STXB pc=83 dst=r2 src=r3 offset=47 imm=0 + // EBPF_OP_STXB pc=85 dst=r2 src=r3 offset=47 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(47)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=84 dst=r3 src=r2 offset=6 imm=0 + // EBPF_OP_LDXB pc=86 dst=r3 src=r2 offset=6 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(6)); - // EBPF_OP_STXB pc=85 dst=r2 src=r3 offset=46 imm=0 + // EBPF_OP_STXB pc=87 dst=r2 src=r3 offset=46 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(46)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=86 dst=r3 src=r2 offset=5 imm=0 + // EBPF_OP_LDXB pc=88 dst=r3 src=r2 offset=5 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(5)); - // EBPF_OP_STXB pc=87 dst=r2 src=r3 offset=45 imm=0 + // EBPF_OP_STXB pc=89 dst=r2 src=r3 offset=45 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(45)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=88 dst=r3 src=r2 offset=4 imm=0 + // EBPF_OP_LDXB pc=90 dst=r3 src=r2 offset=4 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(4)); - // EBPF_OP_STXB pc=89 dst=r2 src=r3 offset=44 imm=0 + // EBPF_OP_STXB pc=91 dst=r2 src=r3 offset=44 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(44)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=90 dst=r3 src=r2 offset=3 imm=0 + // EBPF_OP_LDXB pc=92 dst=r3 src=r2 offset=3 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(3)); - // EBPF_OP_STXB pc=91 dst=r2 src=r3 offset=43 imm=0 + // EBPF_OP_STXB pc=93 dst=r2 src=r3 offset=43 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(43)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=92 dst=r3 src=r2 offset=2 imm=0 + // EBPF_OP_LDXB pc=94 dst=r3 src=r2 offset=2 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_STXB pc=93 dst=r2 src=r3 offset=42 imm=0 + // EBPF_OP_STXB pc=95 dst=r2 src=r3 offset=42 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(42)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=94 dst=r3 src=r2 offset=1 imm=0 + // EBPF_OP_LDXB pc=96 dst=r3 src=r2 offset=1 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(1)); - // EBPF_OP_STXB pc=95 dst=r2 src=r3 offset=41 imm=0 + // EBPF_OP_STXB pc=97 dst=r2 src=r3 offset=41 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(41)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=96 dst=r3 src=r2 offset=0 imm=0 + // EBPF_OP_LDXB pc=98 dst=r3 src=r2 offset=0 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_STXB pc=97 dst=r2 src=r3 offset=40 imm=0 + // EBPF_OP_STXB pc=99 dst=r2 src=r3 offset=40 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(40)) = (uint8_t)r3; - // EBPF_OP_MOV64_IMM pc=98 dst=r2 src=r0 offset=0 imm=40 + // EBPF_OP_MOV64_IMM pc=100 dst=r2 src=r0 offset=0 imm=40 #line 70 "sample/decap_permit_packet.c" r2 = IMMEDIATE(40); - // EBPF_OP_CALL pc=99 dst=r0 src=r0 offset=0 imm=65536 + // EBPF_OP_CALL pc=101 dst=r0 src=r0 offset=0 imm=65536 #line 70 "sample/decap_permit_packet.c" r0 = decapsulate_permit_packet_helpers[0].address(r1, r2, r3, r4, r5, context); #line 70 "sample/decap_permit_packet.c" @@ -420,34 +424,34 @@ decapsulate_permit_packet(void* context) return 0; #line 70 "sample/decap_permit_packet.c" } - // EBPF_OP_MOV64_IMM pc=100 dst=r6 src=r0 offset=0 imm=2 + // EBPF_OP_MOV64_REG pc=102 dst=r1 src=r0 offset=0 imm=0 #line 70 "sample/decap_permit_packet.c" - r6 = IMMEDIATE(2); - // EBPF_OP_LSH64_IMM pc=101 dst=r0 src=r0 offset=0 imm=32 + r1 = r0; + // EBPF_OP_MOV64_IMM pc=103 dst=r0 src=r0 offset=0 imm=2 #line 70 "sample/decap_permit_packet.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_ARSH64_IMM pc=102 dst=r0 src=r0 offset=0 imm=32 + r0 = IMMEDIATE(2); + // EBPF_OP_LSH64_IMM pc=104 dst=r1 src=r0 offset=0 imm=32 #line 70 "sample/decap_permit_packet.c" - r0 = (int64_t)r0 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_IMM pc=103 dst=r1 src=r0 offset=0 imm=0 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_ARSH64_IMM pc=105 dst=r1 src=r0 offset=0 imm=32 #line 70 "sample/decap_permit_packet.c" - r1 = IMMEDIATE(0); - // EBPF_OP_JSGT_REG pc=104 dst=r1 src=r0 offset=1 imm=0 + r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); + // EBPF_OP_MOV64_IMM pc=106 dst=r2 src=r0 offset=0 imm=0 #line 70 "sample/decap_permit_packet.c" - if ((int64_t)r1 > (int64_t)r0) { + r2 = IMMEDIATE(0); + // EBPF_OP_JSGT_REG pc=107 dst=r2 src=r1 offset=1 imm=0 +#line 70 "sample/decap_permit_packet.c" + if ((int64_t)r2 > (int64_t)r1) { #line 70 "sample/decap_permit_packet.c" goto label_3; #line 70 "sample/decap_permit_packet.c" } label_2: - // EBPF_OP_MOV64_IMM pc=105 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=108 dst=r0 src=r0 offset=0 imm=1 #line 70 "sample/decap_permit_packet.c" - r6 = IMMEDIATE(1); + r0 = IMMEDIATE(1); label_3: - // EBPF_OP_MOV64_REG pc=106 dst=r0 src=r6 offset=0 imm=0 -#line 131 "sample/decap_permit_packet.c" - r0 = r6; - // EBPF_OP_EXIT pc=107 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_EXIT pc=109 dst=r0 src=r0 offset=0 imm=0 #line 131 "sample/decap_permit_packet.c" return r0; #line 94 "sample/decap_permit_packet.c" @@ -467,7 +471,7 @@ static program_entry_t _programs[] = { 0, decapsulate_permit_packet_helpers, 1, - 108, + 110, &decapsulate_permit_packet_program_type_guid, &decapsulate_permit_packet_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/decap_permit_packet_sys.c b/tests/bpf2c_tests/expected/decap_permit_packet_sys.c index 6820c2386f..f89e52c046 100644 --- a/tests/bpf2c_tests/expected/decap_permit_packet_sys.c +++ b/tests/bpf2c_tests/expected/decap_permit_packet_sys.c @@ -210,8 +210,6 @@ decapsulate_permit_packet(void* context) register uint64_t r4 = 0; #line 94 "sample/decap_permit_packet.c" register uint64_t r5 = 0; -#line 94 "sample/decap_permit_packet.c" - register uint64_t r6 = 0; #line 94 "sample/decap_permit_packet.c" register uint64_t r10 = 0; @@ -232,10 +230,10 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_IMM pc=3 dst=r4 src=r0 offset=0 imm=14 #line 94 "sample/decap_permit_packet.c" r4 += IMMEDIATE(14); - // EBPF_OP_MOV64_IMM pc=4 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=4 dst=r0 src=r0 offset=0 imm=1 #line 94 "sample/decap_permit_packet.c" - r6 = IMMEDIATE(1); - // EBPF_OP_JGT_REG pc=5 dst=r4 src=r3 offset=100 imm=0 + r0 = IMMEDIATE(1); + // EBPF_OP_JGT_REG pc=5 dst=r4 src=r3 offset=103 imm=0 #line 94 "sample/decap_permit_packet.c" if (r4 > r3) { #line 94 "sample/decap_permit_packet.c" @@ -245,14 +243,14 @@ decapsulate_permit_packet(void* context) // EBPF_OP_LDXH pc=6 dst=r5 src=r2 offset=12 imm=0 #line 99 "sample/decap_permit_packet.c" r5 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_JEQ_IMM pc=7 dst=r5 src=r0 offset=54 imm=56710 + // EBPF_OP_JEQ_IMM pc=7 dst=r5 src=r0 offset=56 imm=56710 #line 99 "sample/decap_permit_packet.c" if (r5 == IMMEDIATE(56710)) { #line 99 "sample/decap_permit_packet.c" goto label_1; #line 99 "sample/decap_permit_packet.c" } - // EBPF_OP_JNE_IMM pc=8 dst=r5 src=r0 offset=97 imm=8 + // EBPF_OP_JNE_IMM pc=8 dst=r5 src=r0 offset=100 imm=8 #line 99 "sample/decap_permit_packet.c" if (r5 != IMMEDIATE(8)) { #line 99 "sample/decap_permit_packet.c" @@ -265,7 +263,7 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_IMM pc=10 dst=r5 src=r0 offset=0 imm=34 #line 100 "sample/decap_permit_packet.c" r5 += IMMEDIATE(34); - // EBPF_OP_JGT_REG pc=11 dst=r5 src=r3 offset=94 imm=0 + // EBPF_OP_JGT_REG pc=11 dst=r5 src=r3 offset=97 imm=0 #line 100 "sample/decap_permit_packet.c" if (r5 > r3) { #line 100 "sample/decap_permit_packet.c" @@ -275,7 +273,7 @@ decapsulate_permit_packet(void* context) // EBPF_OP_LDXB pc=12 dst=r5 src=r2 offset=23 imm=0 #line 106 "sample/decap_permit_packet.c" r5 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(23)); - // EBPF_OP_JNE_IMM pc=13 dst=r5 src=r0 offset=92 imm=4 + // EBPF_OP_JNE_IMM pc=13 dst=r5 src=r0 offset=95 imm=4 #line 106 "sample/decap_permit_packet.c" if (r5 != IMMEDIATE(4)) { #line 106 "sample/decap_permit_packet.c" @@ -297,7 +295,7 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_IMM pc=18 dst=r4 src=r0 offset=0 imm=20 #line 107 "sample/decap_permit_packet.c" r4 += IMMEDIATE(20); - // EBPF_OP_JGT_REG pc=19 dst=r4 src=r3 offset=86 imm=0 + // EBPF_OP_JGT_REG pc=19 dst=r4 src=r3 offset=89 imm=0 #line 107 "sample/decap_permit_packet.c" if (r4 > r3) { #line 107 "sample/decap_permit_packet.c" @@ -310,10 +308,10 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_REG pc=21 dst=r4 src=r5 offset=0 imm=0 #line 29 "sample/decap_permit_packet.c" r4 += r5; - // EBPF_OP_MOV64_IMM pc=22 dst=r6 src=r0 offset=0 imm=2 + // EBPF_OP_MOV64_IMM pc=22 dst=r0 src=r0 offset=0 imm=2 #line 29 "sample/decap_permit_packet.c" - r6 = IMMEDIATE(2); - // EBPF_OP_JGT_REG pc=23 dst=r4 src=r3 offset=82 imm=0 + r0 = IMMEDIATE(2); + // EBPF_OP_JGT_REG pc=23 dst=r4 src=r3 offset=85 imm=0 #line 29 "sample/decap_permit_packet.c" if (r4 > r3) { #line 29 "sample/decap_permit_packet.c" @@ -326,7 +324,7 @@ decapsulate_permit_packet(void* context) // EBPF_OP_ADD64_IMM pc=25 dst=r5 src=r0 offset=0 imm=14 #line 29 "sample/decap_permit_packet.c" r5 += IMMEDIATE(14); - // EBPF_OP_JGT_REG pc=26 dst=r5 src=r3 offset=79 imm=0 + // EBPF_OP_JGT_REG pc=26 dst=r5 src=r3 offset=82 imm=0 #line 29 "sample/decap_permit_packet.c" if (r5 > r3) { #line 29 "sample/decap_permit_packet.c" @@ -429,150 +427,156 @@ decapsulate_permit_packet(void* context) return 0; #line 41 "sample/decap_permit_packet.c" } - // EBPF_OP_LSH64_IMM pc=57 dst=r0 src=r0 offset=0 imm=32 + // EBPF_OP_MOV64_REG pc=57 dst=r1 src=r0 offset=0 imm=0 +#line 41 "sample/decap_permit_packet.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=58 dst=r0 src=r0 offset=0 imm=2 +#line 41 "sample/decap_permit_packet.c" + r0 = IMMEDIATE(2); + // EBPF_OP_LSH64_IMM pc=59 dst=r1 src=r0 offset=0 imm=32 #line 41 "sample/decap_permit_packet.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_ARSH64_IMM pc=58 dst=r0 src=r0 offset=0 imm=32 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_ARSH64_IMM pc=60 dst=r1 src=r0 offset=0 imm=32 #line 41 "sample/decap_permit_packet.c" - r0 = (int64_t)r0 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_IMM pc=59 dst=r1 src=r0 offset=0 imm=0 + r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); + // EBPF_OP_MOV64_IMM pc=61 dst=r2 src=r0 offset=0 imm=0 #line 41 "sample/decap_permit_packet.c" - r1 = IMMEDIATE(0); - // EBPF_OP_JSGT_REG pc=60 dst=r1 src=r0 offset=45 imm=0 + r2 = IMMEDIATE(0); + // EBPF_OP_JSGT_REG pc=62 dst=r2 src=r1 offset=46 imm=0 #line 41 "sample/decap_permit_packet.c" - if ((int64_t)r1 > (int64_t)r0) { + if ((int64_t)r2 > (int64_t)r1) { #line 41 "sample/decap_permit_packet.c" goto label_3; #line 41 "sample/decap_permit_packet.c" } - // EBPF_OP_JA pc=61 dst=r0 src=r0 offset=43 imm=0 + // EBPF_OP_JA pc=63 dst=r0 src=r0 offset=44 imm=0 #line 41 "sample/decap_permit_packet.c" goto label_2; label_1: - // EBPF_OP_MOV64_REG pc=62 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=64 dst=r4 src=r2 offset=0 imm=0 #line 114 "sample/decap_permit_packet.c" r4 = r2; - // EBPF_OP_ADD64_IMM pc=63 dst=r4 src=r0 offset=0 imm=54 + // EBPF_OP_ADD64_IMM pc=65 dst=r4 src=r0 offset=0 imm=54 #line 114 "sample/decap_permit_packet.c" r4 += IMMEDIATE(54); - // EBPF_OP_JGT_REG pc=64 dst=r4 src=r3 offset=41 imm=0 + // EBPF_OP_JGT_REG pc=66 dst=r4 src=r3 offset=42 imm=0 #line 114 "sample/decap_permit_packet.c" if (r4 > r3) { #line 114 "sample/decap_permit_packet.c" goto label_3; #line 114 "sample/decap_permit_packet.c" } - // EBPF_OP_LDXB pc=65 dst=r4 src=r2 offset=20 imm=0 + // EBPF_OP_LDXB pc=67 dst=r4 src=r2 offset=20 imm=0 #line 120 "sample/decap_permit_packet.c" r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(20)); - // EBPF_OP_JNE_IMM pc=66 dst=r4 src=r0 offset=39 imm=41 + // EBPF_OP_JNE_IMM pc=68 dst=r4 src=r0 offset=40 imm=41 #line 120 "sample/decap_permit_packet.c" if (r4 != IMMEDIATE(41)) { #line 120 "sample/decap_permit_packet.c" goto label_3; #line 120 "sample/decap_permit_packet.c" } - // EBPF_OP_MOV64_REG pc=67 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=69 dst=r4 src=r2 offset=0 imm=0 #line 120 "sample/decap_permit_packet.c" r4 = r2; - // EBPF_OP_ADD64_IMM pc=68 dst=r4 src=r0 offset=0 imm=94 + // EBPF_OP_ADD64_IMM pc=70 dst=r4 src=r0 offset=0 imm=94 #line 120 "sample/decap_permit_packet.c" r4 += IMMEDIATE(94); - // EBPF_OP_JGT_REG pc=69 dst=r4 src=r3 offset=36 imm=0 + // EBPF_OP_JGT_REG pc=71 dst=r4 src=r3 offset=37 imm=0 #line 120 "sample/decap_permit_packet.c" if (r4 > r3) { #line 120 "sample/decap_permit_packet.c" goto label_3; #line 120 "sample/decap_permit_packet.c" } - // EBPF_OP_LDXB pc=70 dst=r3 src=r2 offset=13 imm=0 + // EBPF_OP_LDXB pc=72 dst=r3 src=r2 offset=13 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(13)); - // EBPF_OP_STXB pc=71 dst=r2 src=r3 offset=53 imm=0 + // EBPF_OP_STXB pc=73 dst=r2 src=r3 offset=53 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(53)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=72 dst=r3 src=r2 offset=12 imm=0 + // EBPF_OP_LDXB pc=74 dst=r3 src=r2 offset=12 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_STXB pc=73 dst=r2 src=r3 offset=52 imm=0 + // EBPF_OP_STXB pc=75 dst=r2 src=r3 offset=52 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(52)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=74 dst=r3 src=r2 offset=11 imm=0 + // EBPF_OP_LDXB pc=76 dst=r3 src=r2 offset=11 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(11)); - // EBPF_OP_STXB pc=75 dst=r2 src=r3 offset=51 imm=0 + // EBPF_OP_STXB pc=77 dst=r2 src=r3 offset=51 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(51)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=76 dst=r3 src=r2 offset=10 imm=0 + // EBPF_OP_LDXB pc=78 dst=r3 src=r2 offset=10 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(10)); - // EBPF_OP_STXB pc=77 dst=r2 src=r3 offset=50 imm=0 + // EBPF_OP_STXB pc=79 dst=r2 src=r3 offset=50 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(50)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=78 dst=r3 src=r2 offset=9 imm=0 + // EBPF_OP_LDXB pc=80 dst=r3 src=r2 offset=9 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(9)); - // EBPF_OP_STXB pc=79 dst=r2 src=r3 offset=49 imm=0 + // EBPF_OP_STXB pc=81 dst=r2 src=r3 offset=49 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(49)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=80 dst=r3 src=r2 offset=8 imm=0 + // EBPF_OP_LDXB pc=82 dst=r3 src=r2 offset=8 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(8)); - // EBPF_OP_STXB pc=81 dst=r2 src=r3 offset=48 imm=0 + // EBPF_OP_STXB pc=83 dst=r2 src=r3 offset=48 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(48)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=82 dst=r3 src=r2 offset=7 imm=0 + // EBPF_OP_LDXB pc=84 dst=r3 src=r2 offset=7 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(7)); - // EBPF_OP_STXB pc=83 dst=r2 src=r3 offset=47 imm=0 + // EBPF_OP_STXB pc=85 dst=r2 src=r3 offset=47 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(47)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=84 dst=r3 src=r2 offset=6 imm=0 + // EBPF_OP_LDXB pc=86 dst=r3 src=r2 offset=6 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(6)); - // EBPF_OP_STXB pc=85 dst=r2 src=r3 offset=46 imm=0 + // EBPF_OP_STXB pc=87 dst=r2 src=r3 offset=46 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(46)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=86 dst=r3 src=r2 offset=5 imm=0 + // EBPF_OP_LDXB pc=88 dst=r3 src=r2 offset=5 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(5)); - // EBPF_OP_STXB pc=87 dst=r2 src=r3 offset=45 imm=0 + // EBPF_OP_STXB pc=89 dst=r2 src=r3 offset=45 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(45)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=88 dst=r3 src=r2 offset=4 imm=0 + // EBPF_OP_LDXB pc=90 dst=r3 src=r2 offset=4 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(4)); - // EBPF_OP_STXB pc=89 dst=r2 src=r3 offset=44 imm=0 + // EBPF_OP_STXB pc=91 dst=r2 src=r3 offset=44 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(44)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=90 dst=r3 src=r2 offset=3 imm=0 + // EBPF_OP_LDXB pc=92 dst=r3 src=r2 offset=3 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(3)); - // EBPF_OP_STXB pc=91 dst=r2 src=r3 offset=43 imm=0 + // EBPF_OP_STXB pc=93 dst=r2 src=r3 offset=43 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(43)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=92 dst=r3 src=r2 offset=2 imm=0 + // EBPF_OP_LDXB pc=94 dst=r3 src=r2 offset=2 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_STXB pc=93 dst=r2 src=r3 offset=42 imm=0 + // EBPF_OP_STXB pc=95 dst=r2 src=r3 offset=42 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(42)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=94 dst=r3 src=r2 offset=1 imm=0 + // EBPF_OP_LDXB pc=96 dst=r3 src=r2 offset=1 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(1)); - // EBPF_OP_STXB pc=95 dst=r2 src=r3 offset=41 imm=0 + // EBPF_OP_STXB pc=97 dst=r2 src=r3 offset=41 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(41)) = (uint8_t)r3; - // EBPF_OP_LDXB pc=96 dst=r3 src=r2 offset=0 imm=0 + // EBPF_OP_LDXB pc=98 dst=r3 src=r2 offset=0 imm=0 #line 67 "sample/decap_permit_packet.c" r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_STXB pc=97 dst=r2 src=r3 offset=40 imm=0 + // EBPF_OP_STXB pc=99 dst=r2 src=r3 offset=40 imm=0 #line 67 "sample/decap_permit_packet.c" *(uint8_t*)(uintptr_t)(r2 + OFFSET(40)) = (uint8_t)r3; - // EBPF_OP_MOV64_IMM pc=98 dst=r2 src=r0 offset=0 imm=40 + // EBPF_OP_MOV64_IMM pc=100 dst=r2 src=r0 offset=0 imm=40 #line 70 "sample/decap_permit_packet.c" r2 = IMMEDIATE(40); - // EBPF_OP_CALL pc=99 dst=r0 src=r0 offset=0 imm=65536 + // EBPF_OP_CALL pc=101 dst=r0 src=r0 offset=0 imm=65536 #line 70 "sample/decap_permit_packet.c" r0 = decapsulate_permit_packet_helpers[0].address(r1, r2, r3, r4, r5, context); #line 70 "sample/decap_permit_packet.c" @@ -581,34 +585,34 @@ decapsulate_permit_packet(void* context) return 0; #line 70 "sample/decap_permit_packet.c" } - // EBPF_OP_MOV64_IMM pc=100 dst=r6 src=r0 offset=0 imm=2 + // EBPF_OP_MOV64_REG pc=102 dst=r1 src=r0 offset=0 imm=0 #line 70 "sample/decap_permit_packet.c" - r6 = IMMEDIATE(2); - // EBPF_OP_LSH64_IMM pc=101 dst=r0 src=r0 offset=0 imm=32 + r1 = r0; + // EBPF_OP_MOV64_IMM pc=103 dst=r0 src=r0 offset=0 imm=2 #line 70 "sample/decap_permit_packet.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_ARSH64_IMM pc=102 dst=r0 src=r0 offset=0 imm=32 + r0 = IMMEDIATE(2); + // EBPF_OP_LSH64_IMM pc=104 dst=r1 src=r0 offset=0 imm=32 #line 70 "sample/decap_permit_packet.c" - r0 = (int64_t)r0 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_IMM pc=103 dst=r1 src=r0 offset=0 imm=0 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_ARSH64_IMM pc=105 dst=r1 src=r0 offset=0 imm=32 #line 70 "sample/decap_permit_packet.c" - r1 = IMMEDIATE(0); - // EBPF_OP_JSGT_REG pc=104 dst=r1 src=r0 offset=1 imm=0 + r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); + // EBPF_OP_MOV64_IMM pc=106 dst=r2 src=r0 offset=0 imm=0 #line 70 "sample/decap_permit_packet.c" - if ((int64_t)r1 > (int64_t)r0) { + r2 = IMMEDIATE(0); + // EBPF_OP_JSGT_REG pc=107 dst=r2 src=r1 offset=1 imm=0 +#line 70 "sample/decap_permit_packet.c" + if ((int64_t)r2 > (int64_t)r1) { #line 70 "sample/decap_permit_packet.c" goto label_3; #line 70 "sample/decap_permit_packet.c" } label_2: - // EBPF_OP_MOV64_IMM pc=105 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=108 dst=r0 src=r0 offset=0 imm=1 #line 70 "sample/decap_permit_packet.c" - r6 = IMMEDIATE(1); + r0 = IMMEDIATE(1); label_3: - // EBPF_OP_MOV64_REG pc=106 dst=r0 src=r6 offset=0 imm=0 -#line 131 "sample/decap_permit_packet.c" - r0 = r6; - // EBPF_OP_EXIT pc=107 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_EXIT pc=109 dst=r0 src=r0 offset=0 imm=0 #line 131 "sample/decap_permit_packet.c" return r0; #line 94 "sample/decap_permit_packet.c" @@ -628,7 +632,7 @@ static program_entry_t _programs[] = { 0, decapsulate_permit_packet_helpers, 1, - 108, + 110, &decapsulate_permit_packet_program_type_guid, &decapsulate_permit_packet_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/droppacket_dll.c b/tests/bpf2c_tests/expected/droppacket_dll.c index 5e6be58516..859422ff9d 100644 --- a/tests/bpf2c_tests/expected/droppacket_dll.c +++ b/tests/bpf2c_tests/expected/droppacket_dll.c @@ -176,12 +176,12 @@ DropPacket(void* context) // EBPF_OP_MOV64_IMM pc=14 dst=r0 src=r0 offset=0 imm=1 #line 59 "sample/droppacket.c" r0 = IMMEDIATE(1); - // EBPF_OP_LDXDW pc=15 dst=r2 src=r6 offset=8 imm=0 -#line 65 "sample/droppacket.c" - r2 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_LDXDW pc=16 dst=r1 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=15 dst=r1 src=r6 offset=0 imm=0 #line 65 "sample/droppacket.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); + // EBPF_OP_LDXDW pc=16 dst=r2 src=r6 offset=8 imm=0 +#line 65 "sample/droppacket.c" + r2 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); // EBPF_OP_MOV64_REG pc=17 dst=r3 src=r1 offset=0 imm=0 #line 65 "sample/droppacket.c" r3 = r1; @@ -215,12 +215,12 @@ DropPacket(void* context) goto label_2; #line 73 "sample/droppacket.c" } - // EBPF_OP_LDXB pc=24 dst=r3 src=r1 offset=14 imm=0 -#line 75 "sample/droppacket.c" - r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(14)); - // EBPF_OP_ADD64_IMM pc=25 dst=r1 src=r0 offset=0 imm=14 -#line 72 "sample/droppacket.c" + // EBPF_OP_ADD64_IMM pc=24 dst=r1 src=r0 offset=0 imm=14 +#line 73 "sample/droppacket.c" r1 += IMMEDIATE(14); + // EBPF_OP_LDXB pc=25 dst=r3 src=r1 offset=0 imm=0 +#line 75 "sample/droppacket.c" + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(0)); // EBPF_OP_LSH64_IMM pc=26 dst=r3 src=r0 offset=0 imm=2 #line 75 "sample/droppacket.c" r3 <<= (IMMEDIATE(2) & 63); diff --git a/tests/bpf2c_tests/expected/droppacket_raw.c b/tests/bpf2c_tests/expected/droppacket_raw.c index 95f8ef8344..8fa947f257 100644 --- a/tests/bpf2c_tests/expected/droppacket_raw.c +++ b/tests/bpf2c_tests/expected/droppacket_raw.c @@ -150,12 +150,12 @@ DropPacket(void* context) // EBPF_OP_MOV64_IMM pc=14 dst=r0 src=r0 offset=0 imm=1 #line 59 "sample/droppacket.c" r0 = IMMEDIATE(1); - // EBPF_OP_LDXDW pc=15 dst=r2 src=r6 offset=8 imm=0 -#line 65 "sample/droppacket.c" - r2 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_LDXDW pc=16 dst=r1 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=15 dst=r1 src=r6 offset=0 imm=0 #line 65 "sample/droppacket.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); + // EBPF_OP_LDXDW pc=16 dst=r2 src=r6 offset=8 imm=0 +#line 65 "sample/droppacket.c" + r2 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); // EBPF_OP_MOV64_REG pc=17 dst=r3 src=r1 offset=0 imm=0 #line 65 "sample/droppacket.c" r3 = r1; @@ -189,12 +189,12 @@ DropPacket(void* context) goto label_2; #line 73 "sample/droppacket.c" } - // EBPF_OP_LDXB pc=24 dst=r3 src=r1 offset=14 imm=0 -#line 75 "sample/droppacket.c" - r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(14)); - // EBPF_OP_ADD64_IMM pc=25 dst=r1 src=r0 offset=0 imm=14 -#line 72 "sample/droppacket.c" + // EBPF_OP_ADD64_IMM pc=24 dst=r1 src=r0 offset=0 imm=14 +#line 73 "sample/droppacket.c" r1 += IMMEDIATE(14); + // EBPF_OP_LDXB pc=25 dst=r3 src=r1 offset=0 imm=0 +#line 75 "sample/droppacket.c" + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(0)); // EBPF_OP_LSH64_IMM pc=26 dst=r3 src=r0 offset=0 imm=2 #line 75 "sample/droppacket.c" r3 <<= (IMMEDIATE(2) & 63); diff --git a/tests/bpf2c_tests/expected/droppacket_sys.c b/tests/bpf2c_tests/expected/droppacket_sys.c index 270f9525a4..79b3196bbf 100644 --- a/tests/bpf2c_tests/expected/droppacket_sys.c +++ b/tests/bpf2c_tests/expected/droppacket_sys.c @@ -311,12 +311,12 @@ DropPacket(void* context) // EBPF_OP_MOV64_IMM pc=14 dst=r0 src=r0 offset=0 imm=1 #line 59 "sample/droppacket.c" r0 = IMMEDIATE(1); - // EBPF_OP_LDXDW pc=15 dst=r2 src=r6 offset=8 imm=0 -#line 65 "sample/droppacket.c" - r2 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_LDXDW pc=16 dst=r1 src=r6 offset=0 imm=0 + // EBPF_OP_LDXDW pc=15 dst=r1 src=r6 offset=0 imm=0 #line 65 "sample/droppacket.c" r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); + // EBPF_OP_LDXDW pc=16 dst=r2 src=r6 offset=8 imm=0 +#line 65 "sample/droppacket.c" + r2 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); // EBPF_OP_MOV64_REG pc=17 dst=r3 src=r1 offset=0 imm=0 #line 65 "sample/droppacket.c" r3 = r1; @@ -350,12 +350,12 @@ DropPacket(void* context) goto label_2; #line 73 "sample/droppacket.c" } - // EBPF_OP_LDXB pc=24 dst=r3 src=r1 offset=14 imm=0 -#line 75 "sample/droppacket.c" - r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(14)); - // EBPF_OP_ADD64_IMM pc=25 dst=r1 src=r0 offset=0 imm=14 -#line 72 "sample/droppacket.c" + // EBPF_OP_ADD64_IMM pc=24 dst=r1 src=r0 offset=0 imm=14 +#line 73 "sample/droppacket.c" r1 += IMMEDIATE(14); + // EBPF_OP_LDXB pc=25 dst=r3 src=r1 offset=0 imm=0 +#line 75 "sample/droppacket.c" + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(0)); // EBPF_OP_LSH64_IMM pc=26 dst=r3 src=r0 offset=0 imm=2 #line 75 "sample/droppacket.c" r3 <<= (IMMEDIATE(2) & 63); diff --git a/tests/bpf2c_tests/expected/encap_reflect_packet_dll.c b/tests/bpf2c_tests/expected/encap_reflect_packet_dll.c index a19ba9f06e..f477dff3d9 100644 --- a/tests/bpf2c_tests/expected/encap_reflect_packet_dll.c +++ b/tests/bpf2c_tests/expected/encap_reflect_packet_dll.c @@ -90,113 +90,110 @@ encap_reflect_packet(void* context) #line 167 "sample/encap_reflect_packet.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); - // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 -#line 167 "sample/encap_reflect_packet.c" - r6 = r1; - // EBPF_OP_MOV64_IMM pc=1 dst=r0 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=0 dst=r0 src=r0 offset=0 imm=1 #line 167 "sample/encap_reflect_packet.c" r0 = IMMEDIATE(1); - // EBPF_OP_LDXDW pc=2 dst=r1 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=1 dst=r2 src=r1 offset=8 imm=0 #line 173 "sample/encap_reflect_packet.c" - r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_LDXDW pc=3 dst=r2 src=r6 offset=0 imm=0 + r2 = *(uint64_t*)(uintptr_t)(r1 + OFFSET(8)); + // EBPF_OP_LDXDW pc=2 dst=r3 src=r1 offset=0 imm=0 #line 172 "sample/encap_reflect_packet.c" - r2 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_MOV64_REG pc=4 dst=r3 src=r2 offset=0 imm=0 + r3 = *(uint64_t*)(uintptr_t)(r1 + OFFSET(0)); + // EBPF_OP_MOV64_REG pc=3 dst=r4 src=r3 offset=0 imm=0 #line 173 "sample/encap_reflect_packet.c" - r3 = r2; - // EBPF_OP_ADD64_IMM pc=5 dst=r3 src=r0 offset=0 imm=14 + r4 = r3; + // EBPF_OP_ADD64_IMM pc=4 dst=r4 src=r0 offset=0 imm=14 #line 173 "sample/encap_reflect_packet.c" - r3 += IMMEDIATE(14); - // EBPF_OP_JGT_REG pc=6 dst=r3 src=r1 offset=314 imm=0 + r4 += IMMEDIATE(14); + // EBPF_OP_JGT_REG pc=5 dst=r4 src=r2 offset=315 imm=0 #line 173 "sample/encap_reflect_packet.c" - if (r3 > r1) { + if (r4 > r2) { #line 173 "sample/encap_reflect_packet.c" goto label_5; #line 173 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=7 dst=r4 src=r2 offset=12 imm=0 + // EBPF_OP_LDXH pc=6 dst=r5 src=r3 offset=12 imm=0 #line 178 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_JEQ_IMM pc=8 dst=r4 src=r0 offset=119 imm=56710 + r5 = *(uint16_t*)(uintptr_t)(r3 + OFFSET(12)); + // EBPF_OP_JEQ_IMM pc=7 dst=r5 src=r0 offset=120 imm=56710 #line 178 "sample/encap_reflect_packet.c" - if (r4 == IMMEDIATE(56710)) { + if (r5 == IMMEDIATE(56710)) { #line 178 "sample/encap_reflect_packet.c" goto label_2; #line 178 "sample/encap_reflect_packet.c" } - // EBPF_OP_JNE_IMM pc=9 dst=r4 src=r0 offset=311 imm=8 + // EBPF_OP_JNE_IMM pc=8 dst=r5 src=r0 offset=312 imm=8 #line 178 "sample/encap_reflect_packet.c" - if (r4 != IMMEDIATE(8)) { + if (r5 != IMMEDIATE(8)) { #line 178 "sample/encap_reflect_packet.c" goto label_5; #line 178 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=10 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=9 dst=r5 src=r3 offset=0 imm=0 #line 179 "sample/encap_reflect_packet.c" - r4 = r2; - // EBPF_OP_ADD64_IMM pc=11 dst=r4 src=r0 offset=0 imm=34 + r5 = r3; + // EBPF_OP_ADD64_IMM pc=10 dst=r5 src=r0 offset=0 imm=34 #line 179 "sample/encap_reflect_packet.c" - r4 += IMMEDIATE(34); - // EBPF_OP_JGT_REG pc=12 dst=r4 src=r1 offset=308 imm=0 + r5 += IMMEDIATE(34); + // EBPF_OP_JGT_REG pc=11 dst=r5 src=r2 offset=309 imm=0 #line 179 "sample/encap_reflect_packet.c" - if (r4 > r1) { + if (r5 > r2) { #line 179 "sample/encap_reflect_packet.c" goto label_5; #line 179 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXB pc=13 dst=r4 src=r2 offset=23 imm=0 + // EBPF_OP_LDXB pc=12 dst=r5 src=r3 offset=23 imm=0 #line 185 "sample/encap_reflect_packet.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(23)); - // EBPF_OP_JNE_IMM pc=14 dst=r4 src=r0 offset=306 imm=17 + r5 = *(uint8_t*)(uintptr_t)(r3 + OFFSET(23)); + // EBPF_OP_JNE_IMM pc=13 dst=r5 src=r0 offset=307 imm=17 #line 185 "sample/encap_reflect_packet.c" - if (r4 != IMMEDIATE(17)) { + if (r5 != IMMEDIATE(17)) { #line 185 "sample/encap_reflect_packet.c" goto label_5; #line 185 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXB pc=15 dst=r2 src=r2 offset=14 imm=0 + // EBPF_OP_LDXB pc=14 dst=r3 src=r3 offset=14 imm=0 #line 185 "sample/encap_reflect_packet.c" - r2 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(14)); - // EBPF_OP_LSH64_IMM pc=16 dst=r2 src=r0 offset=0 imm=2 + r3 = *(uint8_t*)(uintptr_t)(r3 + OFFSET(14)); + // EBPF_OP_LSH64_IMM pc=15 dst=r3 src=r0 offset=0 imm=2 #line 185 "sample/encap_reflect_packet.c" - r2 <<= (IMMEDIATE(2) & 63); - // EBPF_OP_AND64_IMM pc=17 dst=r2 src=r0 offset=0 imm=60 + r3 <<= (IMMEDIATE(2) & 63); + // EBPF_OP_AND64_IMM pc=16 dst=r3 src=r0 offset=0 imm=60 #line 185 "sample/encap_reflect_packet.c" - r2 &= IMMEDIATE(60); - // EBPF_OP_ADD64_REG pc=18 dst=r3 src=r2 offset=0 imm=0 + r3 &= IMMEDIATE(60); + // EBPF_OP_ADD64_REG pc=17 dst=r4 src=r3 offset=0 imm=0 #line 185 "sample/encap_reflect_packet.c" - r3 += r2; - // EBPF_OP_MOV64_REG pc=19 dst=r2 src=r3 offset=0 imm=0 + r4 += r3; + // EBPF_OP_MOV64_REG pc=18 dst=r3 src=r4 offset=0 imm=0 #line 185 "sample/encap_reflect_packet.c" - r2 = r3; - // EBPF_OP_ADD64_IMM pc=20 dst=r2 src=r0 offset=0 imm=8 + r3 = r4; + // EBPF_OP_ADD64_IMM pc=19 dst=r3 src=r0 offset=0 imm=8 #line 185 "sample/encap_reflect_packet.c" - r2 += IMMEDIATE(8); - // EBPF_OP_JGT_REG pc=21 dst=r2 src=r1 offset=299 imm=0 + r3 += IMMEDIATE(8); + // EBPF_OP_JGT_REG pc=20 dst=r3 src=r2 offset=300 imm=0 #line 185 "sample/encap_reflect_packet.c" - if (r2 > r1) { + if (r3 > r2) { #line 185 "sample/encap_reflect_packet.c" goto label_5; #line 185 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=22 dst=r1 src=r3 offset=2 imm=0 + // EBPF_OP_LDXH pc=21 dst=r2 src=r4 offset=2 imm=0 #line 191 "sample/encap_reflect_packet.c" - r1 = *(uint16_t*)(uintptr_t)(r3 + OFFSET(2)); - // EBPF_OP_JNE_IMM pc=23 dst=r1 src=r0 offset=297 imm=7459 + r2 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)); + // EBPF_OP_JNE_IMM pc=22 dst=r2 src=r0 offset=298 imm=7459 #line 191 "sample/encap_reflect_packet.c" - if (r1 != IMMEDIATE(7459)) { + if (r2 != IMMEDIATE(7459)) { #line 191 "sample/encap_reflect_packet.c" goto label_5; #line 191 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=24 dst=r1 src=r6 offset=0 imm=0 -#line 22 "sample/encap_reflect_packet.c" - r1 = r6; - // EBPF_OP_LDDW pc=25 dst=r2 src=r0 offset=0 imm=-20 + // EBPF_OP_MOV64_REG pc=23 dst=r6 src=r1 offset=0 imm=0 +#line 191 "sample/encap_reflect_packet.c" + r6 = r1; + // EBPF_OP_LDDW pc=24 dst=r2 src=r0 offset=0 imm=-20 #line 22 "sample/encap_reflect_packet.c" r2 = (uint64_t)4294967276; - // EBPF_OP_CALL pc=27 dst=r0 src=r0 offset=0 imm=65536 + // EBPF_OP_CALL pc=26 dst=r0 src=r0 offset=0 imm=65536 #line 22 "sample/encap_reflect_packet.c" r0 = encap_reflect_packet_helpers[0].address(r1, r2, r3, r4, r5, context); #line 22 "sample/encap_reflect_packet.c" @@ -205,6 +202,9 @@ encap_reflect_packet(void* context) return 0; #line 22 "sample/encap_reflect_packet.c" } + // EBPF_OP_MOV64_REG pc=27 dst=r2 src=r6 offset=0 imm=0 +#line 22 "sample/encap_reflect_packet.c" + r2 = r6; // EBPF_OP_MOV64_REG pc=28 dst=r1 src=r0 offset=0 imm=0 #line 22 "sample/encap_reflect_packet.c" r1 = r0; @@ -217,208 +217,208 @@ encap_reflect_packet(void* context) // EBPF_OP_ARSH64_IMM pc=31 dst=r1 src=r0 offset=0 imm=32 #line 22 "sample/encap_reflect_packet.c" r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_IMM pc=32 dst=r2 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=32 dst=r3 src=r0 offset=0 imm=0 #line 22 "sample/encap_reflect_packet.c" - r2 = IMMEDIATE(0); - // EBPF_OP_JSGT_REG pc=33 dst=r2 src=r1 offset=287 imm=0 + r3 = IMMEDIATE(0); + // EBPF_OP_JSGT_REG pc=33 dst=r3 src=r1 offset=287 imm=0 #line 22 "sample/encap_reflect_packet.c" - if ((int64_t)r2 > (int64_t)r1) { + if ((int64_t)r3 > (int64_t)r1) { #line 22 "sample/encap_reflect_packet.c" goto label_5; #line 22 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXDW pc=34 dst=r4 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=34 dst=r5 src=r2 offset=8 imm=0 #line 28 "sample/encap_reflect_packet.c" - r4 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_LDXDW pc=35 dst=r7 src=r6 offset=0 imm=0 + r5 = *(uint64_t*)(uintptr_t)(r2 + OFFSET(8)); + // EBPF_OP_LDXDW pc=35 dst=r6 src=r2 offset=0 imm=0 #line 27 "sample/encap_reflect_packet.c" - r7 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_MOV64_REG pc=36 dst=r3 src=r7 offset=0 imm=0 + r6 = *(uint64_t*)(uintptr_t)(r2 + OFFSET(0)); + // EBPF_OP_MOV64_REG pc=36 dst=r3 src=r6 offset=0 imm=0 #line 28 "sample/encap_reflect_packet.c" - r3 = r7; + r3 = r6; // EBPF_OP_ADD64_IMM pc=37 dst=r3 src=r0 offset=0 imm=14 #line 28 "sample/encap_reflect_packet.c" r3 += IMMEDIATE(14); - // EBPF_OP_JGT_REG pc=38 dst=r3 src=r4 offset=282 imm=0 + // EBPF_OP_JGT_REG pc=38 dst=r3 src=r5 offset=282 imm=0 #line 28 "sample/encap_reflect_packet.c" - if (r3 > r4) { + if (r3 > r5) { #line 28 "sample/encap_reflect_packet.c" goto label_5; #line 28 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=39 dst=r2 src=r7 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=39 dst=r4 src=r6 offset=0 imm=0 #line 35 "sample/encap_reflect_packet.c" - r2 = r7; - // EBPF_OP_ADD64_IMM pc=40 dst=r2 src=r0 offset=0 imm=20 + r4 = r6; + // EBPF_OP_ADD64_IMM pc=40 dst=r4 src=r0 offset=0 imm=20 #line 35 "sample/encap_reflect_packet.c" - r2 += IMMEDIATE(20); - // EBPF_OP_JGT_REG pc=41 dst=r2 src=r4 offset=279 imm=0 + r4 += IMMEDIATE(20); + // EBPF_OP_JGT_REG pc=41 dst=r4 src=r5 offset=279 imm=0 #line 35 "sample/encap_reflect_packet.c" - if (r2 > r4) { + if (r4 > r5) { #line 35 "sample/encap_reflect_packet.c" goto label_5; #line 35 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=42 dst=r1 src=r7 offset=0 imm=0 -#line 43 "sample/encap_reflect_packet.c" - r1 = r7; + // EBPF_OP_MOV64_REG pc=42 dst=r1 src=r6 offset=0 imm=0 +#line 35 "sample/encap_reflect_packet.c" + r1 = r6; // EBPF_OP_ADD64_IMM pc=43 dst=r1 src=r0 offset=0 imm=34 -#line 43 "sample/encap_reflect_packet.c" +#line 35 "sample/encap_reflect_packet.c" r1 += IMMEDIATE(34); - // EBPF_OP_JGT_REG pc=44 dst=r1 src=r4 offset=276 imm=0 -#line 43 "sample/encap_reflect_packet.c" - if (r1 > r4) { -#line 43 "sample/encap_reflect_packet.c" + // EBPF_OP_JGT_REG pc=44 dst=r1 src=r5 offset=276 imm=0 +#line 35 "sample/encap_reflect_packet.c" + if (r1 > r5) { +#line 35 "sample/encap_reflect_packet.c" goto label_5; -#line 43 "sample/encap_reflect_packet.c" +#line 35 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=45 dst=r5 src=r7 offset=0 imm=0 -#line 43 "sample/encap_reflect_packet.c" - r5 = r7; - // EBPF_OP_ADD64_IMM pc=46 dst=r5 src=r0 offset=0 imm=54 -#line 43 "sample/encap_reflect_packet.c" - r5 += IMMEDIATE(54); - // EBPF_OP_JGT_REG pc=47 dst=r5 src=r4 offset=273 imm=0 -#line 43 "sample/encap_reflect_packet.c" - if (r5 > r4) { -#line 43 "sample/encap_reflect_packet.c" + // EBPF_OP_MOV64_REG pc=45 dst=r7 src=r6 offset=0 imm=0 +#line 35 "sample/encap_reflect_packet.c" + r7 = r6; + // EBPF_OP_ADD64_IMM pc=46 dst=r7 src=r0 offset=0 imm=54 +#line 35 "sample/encap_reflect_packet.c" + r7 += IMMEDIATE(54); + // EBPF_OP_JGT_REG pc=47 dst=r7 src=r5 offset=273 imm=0 +#line 35 "sample/encap_reflect_packet.c" + if (r7 > r5) { +#line 35 "sample/encap_reflect_packet.c" goto label_5; -#line 43 "sample/encap_reflect_packet.c" +#line 35 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=48 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_LDXH pc=48 dst=r5 src=r4 offset=0 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_STXH pc=49 dst=r7 src=r4 offset=0 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(0)); + // EBPF_OP_STXH pc=49 dst=r6 src=r5 offset=0 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(0)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=50 dst=r4 src=r2 offset=2 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(0)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=50 dst=r5 src=r4 offset=2 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_STXH pc=51 dst=r7 src=r4 offset=2 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)); + // EBPF_OP_STXH pc=51 dst=r6 src=r5 offset=2 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(2)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=52 dst=r4 src=r2 offset=4 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(2)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=52 dst=r5 src=r4 offset=4 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(4)); - // EBPF_OP_STXH pc=53 dst=r7 src=r4 offset=4 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(4)); + // EBPF_OP_STXH pc=53 dst=r6 src=r5 offset=4 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(4)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=54 dst=r4 src=r2 offset=12 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(4)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=54 dst=r5 src=r4 offset=12 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_STXH pc=55 dst=r7 src=r4 offset=12 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(12)); + // EBPF_OP_STXH pc=55 dst=r6 src=r5 offset=12 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(12)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=56 dst=r4 src=r2 offset=6 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(12)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=56 dst=r5 src=r4 offset=6 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(6)); - // EBPF_OP_STXH pc=57 dst=r7 src=r4 offset=6 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(6)); + // EBPF_OP_STXH pc=57 dst=r6 src=r5 offset=6 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(6)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=58 dst=r5 src=r2 offset=10 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(6)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=58 dst=r7 src=r4 offset=10 imm=0 #line 56 "sample/encap_reflect_packet.c" - r5 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(10)); - // EBPF_OP_LDXH pc=59 dst=r8 src=r2 offset=8 imm=0 + r7 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(10)); + // EBPF_OP_LDXH pc=59 dst=r8 src=r4 offset=8 imm=0 #line 56 "sample/encap_reflect_packet.c" - r8 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(8)); - // EBPF_OP_STXH pc=60 dst=r7 src=r4 offset=0 imm=0 + r8 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(8)); + // EBPF_OP_STXH pc=60 dst=r6 src=r5 offset=0 imm=0 #line 17 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(0)) = (uint16_t)r4; - // EBPF_OP_STXH pc=61 dst=r7 src=r8 offset=8 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(0)) = (uint16_t)r5; + // EBPF_OP_STXH pc=61 dst=r6 src=r8 offset=8 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(8)) = (uint16_t)r8; - // EBPF_OP_STXH pc=62 dst=r7 src=r8 offset=2 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(8)) = (uint16_t)r8; + // EBPF_OP_STXH pc=62 dst=r6 src=r8 offset=2 imm=0 #line 17 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(2)) = (uint16_t)r8; - // EBPF_OP_STXH pc=63 dst=r7 src=r5 offset=10 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(2)) = (uint16_t)r8; + // EBPF_OP_STXH pc=63 dst=r6 src=r7 offset=10 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(10)) = (uint16_t)r5; - // EBPF_OP_STXH pc=64 dst=r7 src=r5 offset=4 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(10)) = (uint16_t)r7; + // EBPF_OP_STXH pc=64 dst=r6 src=r7 offset=4 imm=0 #line 17 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(4)) = (uint16_t)r5; - // EBPF_OP_LDXH pc=65 dst=r4 src=r2 offset=4 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(4)) = (uint16_t)r7; + // EBPF_OP_LDXH pc=65 dst=r5 src=r4 offset=4 imm=0 #line 18 "sample/./xdp_common.h" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(4)); - // EBPF_OP_STXH pc=66 dst=r7 src=r4 offset=10 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(4)); + // EBPF_OP_STXH pc=66 dst=r6 src=r5 offset=10 imm=0 #line 18 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(10)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=67 dst=r4 src=r2 offset=0 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(10)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=67 dst=r5 src=r4 offset=0 imm=0 #line 18 "sample/./xdp_common.h" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_STXH pc=68 dst=r7 src=r4 offset=6 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(0)); + // EBPF_OP_STXH pc=68 dst=r6 src=r5 offset=6 imm=0 #line 18 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(6)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=69 dst=r2 src=r2 offset=2 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(6)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=69 dst=r4 src=r4 offset=2 imm=0 #line 18 "sample/./xdp_common.h" - r2 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_STXH pc=70 dst=r7 src=r2 offset=8 imm=0 + r4 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)); + // EBPF_OP_STXH pc=70 dst=r6 src=r4 offset=8 imm=0 #line 18 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(8)) = (uint16_t)r2; - // EBPF_OP_LDXW pc=71 dst=r2 src=r7 offset=50 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(8)) = (uint16_t)r4; + // EBPF_OP_LDXW pc=71 dst=r4 src=r6 offset=50 imm=0 #line 24 "sample/./xdp_common.h" - r2 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(50)); - // EBPF_OP_LDXW pc=72 dst=r4 src=r7 offset=46 imm=0 + r4 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(50)); + // EBPF_OP_LDXW pc=72 dst=r5 src=r6 offset=46 imm=0 #line 25 "sample/./xdp_common.h" - r4 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(46)); - // EBPF_OP_STXW pc=73 dst=r7 src=r4 offset=50 imm=0 + r5 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(46)); + // EBPF_OP_STXW pc=73 dst=r6 src=r5 offset=50 imm=0 #line 25 "sample/./xdp_common.h" - *(uint32_t*)(uintptr_t)(r7 + OFFSET(50)) = (uint32_t)r4; - // EBPF_OP_STXW pc=74 dst=r7 src=r2 offset=46 imm=0 + *(uint32_t*)(uintptr_t)(r6 + OFFSET(50)) = (uint32_t)r5; + // EBPF_OP_STXW pc=74 dst=r6 src=r4 offset=46 imm=0 #line 26 "sample/./xdp_common.h" - *(uint32_t*)(uintptr_t)(r7 + OFFSET(46)) = (uint32_t)r2; - // EBPF_OP_LDXB pc=75 dst=r4 src=r7 offset=34 imm=0 + *(uint32_t*)(uintptr_t)(r6 + OFFSET(46)) = (uint32_t)r4; + // EBPF_OP_LDXB pc=75 dst=r5 src=r6 offset=34 imm=0 #line 63 "sample/encap_reflect_packet.c" - r4 = *(uint8_t*)(uintptr_t)(r7 + OFFSET(34)); - // EBPF_OP_LSH64_IMM pc=76 dst=r4 src=r0 offset=0 imm=2 + r5 = *(uint8_t*)(uintptr_t)(r6 + OFFSET(34)); + // EBPF_OP_LSH64_IMM pc=76 dst=r5 src=r0 offset=0 imm=2 #line 63 "sample/encap_reflect_packet.c" - r4 <<= (IMMEDIATE(2) & 63); - // EBPF_OP_AND64_IMM pc=77 dst=r4 src=r0 offset=0 imm=60 + r5 <<= (IMMEDIATE(2) & 63); + // EBPF_OP_AND64_IMM pc=77 dst=r5 src=r0 offset=0 imm=60 #line 63 "sample/encap_reflect_packet.c" - r4 &= IMMEDIATE(60); - // EBPF_OP_MOV64_REG pc=78 dst=r2 src=r1 offset=0 imm=0 + r5 &= IMMEDIATE(60); + // EBPF_OP_MOV64_REG pc=78 dst=r4 src=r1 offset=0 imm=0 #line 63 "sample/encap_reflect_packet.c" - r2 = r1; - // EBPF_OP_ADD64_REG pc=79 dst=r2 src=r4 offset=0 imm=0 + r4 = r1; + // EBPF_OP_ADD64_REG pc=79 dst=r4 src=r5 offset=0 imm=0 #line 63 "sample/encap_reflect_packet.c" - r2 += r4; - // EBPF_OP_MOV64_REG pc=80 dst=r4 src=r2 offset=0 imm=0 + r4 += r5; + // EBPF_OP_MOV64_REG pc=80 dst=r5 src=r4 offset=0 imm=0 #line 64 "sample/encap_reflect_packet.c" - r4 = r2; - // EBPF_OP_ADD64_IMM pc=81 dst=r4 src=r0 offset=0 imm=8 + r5 = r4; + // EBPF_OP_ADD64_IMM pc=81 dst=r5 src=r0 offset=0 imm=8 #line 64 "sample/encap_reflect_packet.c" - r4 += IMMEDIATE(8); - // EBPF_OP_LDXDW pc=82 dst=r5 src=r6 offset=8 imm=0 + r5 += IMMEDIATE(8); + // EBPF_OP_LDXDW pc=82 dst=r2 src=r2 offset=8 imm=0 #line 64 "sample/encap_reflect_packet.c" - r5 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_JGT_REG pc=83 dst=r4 src=r5 offset=237 imm=0 + r2 = *(uint64_t*)(uintptr_t)(r2 + OFFSET(8)); + // EBPF_OP_JGT_REG pc=83 dst=r5 src=r2 offset=237 imm=0 #line 64 "sample/encap_reflect_packet.c" - if (r4 > r5) { + if (r5 > r2) { #line 64 "sample/encap_reflect_packet.c" goto label_5; #line 64 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=84 dst=r4 src=r2 offset=2 imm=0 + // EBPF_OP_LDXH pc=84 dst=r2 src=r4 offset=2 imm=0 #line 68 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_JNE_IMM pc=85 dst=r4 src=r0 offset=4 imm=7459 + r2 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)); + // EBPF_OP_JNE_IMM pc=85 dst=r2 src=r0 offset=4 imm=7459 #line 68 "sample/encap_reflect_packet.c" - if (r4 != IMMEDIATE(7459)) { + if (r2 != IMMEDIATE(7459)) { #line 68 "sample/encap_reflect_packet.c" goto label_1; #line 68 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=86 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_LDXH pc=86 dst=r2 src=r4 offset=0 imm=0 #line 41 "sample/./xdp_common.h" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_STXH pc=87 dst=r2 src=r4 offset=2 imm=0 + r2 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(0)); + // EBPF_OP_STXH pc=87 dst=r4 src=r2 offset=2 imm=0 #line 43 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r2 + OFFSET(2)) = (uint16_t)r4; - // EBPF_OP_MOV64_IMM pc=88 dst=r4 src=r0 offset=0 imm=7459 + *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)) = (uint16_t)r2; + // EBPF_OP_MOV64_IMM pc=88 dst=r2 src=r0 offset=0 imm=7459 #line 43 "sample/./xdp_common.h" - r4 = IMMEDIATE(7459); - // EBPF_OP_STXH pc=89 dst=r2 src=r4 offset=0 imm=0 + r2 = IMMEDIATE(7459); + // EBPF_OP_STXH pc=89 dst=r4 src=r2 offset=0 imm=0 #line 42 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r2 + OFFSET(0)) = (uint16_t)r4; + *(uint16_t*)(uintptr_t)(r4 + OFFSET(0)) = (uint16_t)r2; label_1: // EBPF_OP_LDXW pc=90 dst=r2 src=r1 offset=16 imm=0 #line 73 "sample/encap_reflect_packet.c" @@ -453,24 +453,24 @@ encap_reflect_packet(void* context) // EBPF_OP_MOV64_IMM pc=100 dst=r1 src=r0 offset=0 imm=4 #line 73 "sample/encap_reflect_packet.c" r1 = IMMEDIATE(4); - // EBPF_OP_STXB pc=101 dst=r7 src=r1 offset=23 imm=0 + // EBPF_OP_STXB pc=101 dst=r6 src=r1 offset=23 imm=0 #line 76 "sample/encap_reflect_packet.c" - *(uint8_t*)(uintptr_t)(r7 + OFFSET(23)) = (uint8_t)r1; - // EBPF_OP_LDXB pc=102 dst=r1 src=r7 offset=14 imm=0 + *(uint8_t*)(uintptr_t)(r6 + OFFSET(23)) = (uint8_t)r1; + // EBPF_OP_LDXB pc=102 dst=r1 src=r6 offset=14 imm=0 #line 77 "sample/encap_reflect_packet.c" - r1 = *(uint8_t*)(uintptr_t)(r7 + OFFSET(14)); + r1 = *(uint8_t*)(uintptr_t)(r6 + OFFSET(14)); // EBPF_OP_AND64_IMM pc=103 dst=r1 src=r0 offset=0 imm=240 #line 77 "sample/encap_reflect_packet.c" r1 &= IMMEDIATE(240); // EBPF_OP_OR64_IMM pc=104 dst=r1 src=r0 offset=0 imm=5 #line 77 "sample/encap_reflect_packet.c" r1 |= IMMEDIATE(5); - // EBPF_OP_STXB pc=105 dst=r7 src=r1 offset=14 imm=0 + // EBPF_OP_STXB pc=105 dst=r6 src=r1 offset=14 imm=0 #line 77 "sample/encap_reflect_packet.c" - *(uint8_t*)(uintptr_t)(r7 + OFFSET(14)) = (uint8_t)r1; - // EBPF_OP_LDXH pc=106 dst=r1 src=r7 offset=36 imm=0 + *(uint8_t*)(uintptr_t)(r6 + OFFSET(14)) = (uint8_t)r1; + // EBPF_OP_LDXH pc=106 dst=r1 src=r6 offset=36 imm=0 #line 78 "sample/encap_reflect_packet.c" - r1 = *(uint16_t*)(uintptr_t)(r7 + OFFSET(36)); + r1 = *(uint16_t*)(uintptr_t)(r6 + OFFSET(36)); // EBPF_OP_BE pc=107 dst=r1 src=r0 offset=0 imm=16 #line 78 "sample/encap_reflect_packet.c" r1 = htobe16((uint16_t)r1); @@ -484,15 +484,15 @@ encap_reflect_packet(void* context) r1 = htobe16((uint16_t)r1); #line 78 "sample/encap_reflect_packet.c" r1 &= UINT32_MAX; - // EBPF_OP_STXH pc=110 dst=r7 src=r1 offset=16 imm=0 + // EBPF_OP_STXH pc=110 dst=r6 src=r1 offset=16 imm=0 #line 78 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(16)) = (uint16_t)r1; + *(uint16_t*)(uintptr_t)(r6 + OFFSET(16)) = (uint16_t)r1; // EBPF_OP_MOV64_IMM pc=111 dst=r1 src=r0 offset=0 imm=0 #line 78 "sample/encap_reflect_packet.c" r1 = IMMEDIATE(0); - // EBPF_OP_STXH pc=112 dst=r7 src=r1 offset=24 imm=0 + // EBPF_OP_STXH pc=112 dst=r6 src=r1 offset=24 imm=0 #line 80 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(24)) = (uint16_t)r1; + *(uint16_t*)(uintptr_t)(r6 + OFFSET(24)) = (uint16_t)r1; // EBPF_OP_MOV64_IMM pc=113 dst=r2 src=r0 offset=0 imm=0 #line 82 "sample/encap_reflect_packet.c" r2 = IMMEDIATE(0); @@ -538,62 +538,62 @@ encap_reflect_packet(void* context) // EBPF_OP_XOR64_IMM pc=125 dst=r1 src=r0 offset=0 imm=-1 #line 82 "sample/encap_reflect_packet.c" r1 ^= IMMEDIATE(-1); - // EBPF_OP_STXH pc=126 dst=r7 src=r1 offset=24 imm=0 + // EBPF_OP_STXH pc=126 dst=r6 src=r1 offset=24 imm=0 #line 81 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(24)) = (uint16_t)r1; + *(uint16_t*)(uintptr_t)(r6 + OFFSET(24)) = (uint16_t)r1; // EBPF_OP_JA pc=127 dst=r0 src=r0 offset=192 imm=0 #line 81 "sample/encap_reflect_packet.c" goto label_4; label_2: - // EBPF_OP_MOV64_REG pc=128 dst=r3 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=128 dst=r4 src=r3 offset=0 imm=0 #line 196 "sample/encap_reflect_packet.c" - r3 = r2; - // EBPF_OP_ADD64_IMM pc=129 dst=r3 src=r0 offset=0 imm=54 + r4 = r3; + // EBPF_OP_ADD64_IMM pc=129 dst=r4 src=r0 offset=0 imm=54 #line 196 "sample/encap_reflect_packet.c" - r3 += IMMEDIATE(54); - // EBPF_OP_JGT_REG pc=130 dst=r3 src=r1 offset=190 imm=0 + r4 += IMMEDIATE(54); + // EBPF_OP_JGT_REG pc=130 dst=r4 src=r2 offset=190 imm=0 #line 196 "sample/encap_reflect_packet.c" - if (r3 > r1) { + if (r4 > r2) { #line 196 "sample/encap_reflect_packet.c" goto label_5; #line 196 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXB pc=131 dst=r3 src=r2 offset=20 imm=0 + // EBPF_OP_LDXB pc=131 dst=r4 src=r3 offset=20 imm=0 #line 202 "sample/encap_reflect_packet.c" - r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(20)); - // EBPF_OP_JNE_IMM pc=132 dst=r3 src=r0 offset=188 imm=17 + r4 = *(uint8_t*)(uintptr_t)(r3 + OFFSET(20)); + // EBPF_OP_JNE_IMM pc=132 dst=r4 src=r0 offset=188 imm=17 #line 202 "sample/encap_reflect_packet.c" - if (r3 != IMMEDIATE(17)) { + if (r4 != IMMEDIATE(17)) { #line 202 "sample/encap_reflect_packet.c" goto label_5; #line 202 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=133 dst=r3 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=133 dst=r4 src=r3 offset=0 imm=0 #line 202 "sample/encap_reflect_packet.c" - r3 = r2; - // EBPF_OP_ADD64_IMM pc=134 dst=r3 src=r0 offset=0 imm=62 + r4 = r3; + // EBPF_OP_ADD64_IMM pc=134 dst=r4 src=r0 offset=0 imm=62 #line 202 "sample/encap_reflect_packet.c" - r3 += IMMEDIATE(62); - // EBPF_OP_JGT_REG pc=135 dst=r3 src=r1 offset=185 imm=0 + r4 += IMMEDIATE(62); + // EBPF_OP_JGT_REG pc=135 dst=r4 src=r2 offset=185 imm=0 #line 202 "sample/encap_reflect_packet.c" - if (r3 > r1) { + if (r4 > r2) { #line 202 "sample/encap_reflect_packet.c" goto label_5; #line 202 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=136 dst=r1 src=r2 offset=56 imm=0 + // EBPF_OP_LDXH pc=136 dst=r2 src=r3 offset=56 imm=0 #line 208 "sample/encap_reflect_packet.c" - r1 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(56)); - // EBPF_OP_JNE_IMM pc=137 dst=r1 src=r0 offset=183 imm=7459 + r2 = *(uint16_t*)(uintptr_t)(r3 + OFFSET(56)); + // EBPF_OP_JNE_IMM pc=137 dst=r2 src=r0 offset=183 imm=7459 #line 208 "sample/encap_reflect_packet.c" - if (r1 != IMMEDIATE(7459)) { + if (r2 != IMMEDIATE(7459)) { #line 208 "sample/encap_reflect_packet.c" goto label_5; #line 208 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=138 dst=r1 src=r6 offset=0 imm=0 -#line 96 "sample/encap_reflect_packet.c" - r1 = r6; + // EBPF_OP_MOV64_REG pc=138 dst=r6 src=r1 offset=0 imm=0 +#line 208 "sample/encap_reflect_packet.c" + r6 = r1; // EBPF_OP_LDDW pc=139 dst=r2 src=r0 offset=0 imm=-40 #line 96 "sample/encap_reflect_packet.c" r2 = (uint64_t)4294967256; @@ -661,17 +661,17 @@ encap_reflect_packet(void* context) #line 109 "sample/encap_reflect_packet.c" } // EBPF_OP_MOV64_REG pc=156 dst=r3 src=r1 offset=0 imm=0 -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" r3 = r1; // EBPF_OP_ADD64_IMM pc=157 dst=r3 src=r0 offset=0 imm=54 -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" r3 += IMMEDIATE(54); // EBPF_OP_JGT_REG pc=158 dst=r3 src=r5 offset=162 imm=0 -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" if (r3 > r5) { -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" goto label_5; -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" } // EBPF_OP_MOV64_REG pc=159 dst=r7 src=r1 offset=0 imm=0 #line 124 "sample/encap_reflect_packet.c" diff --git a/tests/bpf2c_tests/expected/encap_reflect_packet_raw.c b/tests/bpf2c_tests/expected/encap_reflect_packet_raw.c index 4c1eca7b21..05b200d585 100644 --- a/tests/bpf2c_tests/expected/encap_reflect_packet_raw.c +++ b/tests/bpf2c_tests/expected/encap_reflect_packet_raw.c @@ -64,113 +64,110 @@ encap_reflect_packet(void* context) #line 167 "sample/encap_reflect_packet.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); - // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 -#line 167 "sample/encap_reflect_packet.c" - r6 = r1; - // EBPF_OP_MOV64_IMM pc=1 dst=r0 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=0 dst=r0 src=r0 offset=0 imm=1 #line 167 "sample/encap_reflect_packet.c" r0 = IMMEDIATE(1); - // EBPF_OP_LDXDW pc=2 dst=r1 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=1 dst=r2 src=r1 offset=8 imm=0 #line 173 "sample/encap_reflect_packet.c" - r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_LDXDW pc=3 dst=r2 src=r6 offset=0 imm=0 + r2 = *(uint64_t*)(uintptr_t)(r1 + OFFSET(8)); + // EBPF_OP_LDXDW pc=2 dst=r3 src=r1 offset=0 imm=0 #line 172 "sample/encap_reflect_packet.c" - r2 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_MOV64_REG pc=4 dst=r3 src=r2 offset=0 imm=0 + r3 = *(uint64_t*)(uintptr_t)(r1 + OFFSET(0)); + // EBPF_OP_MOV64_REG pc=3 dst=r4 src=r3 offset=0 imm=0 #line 173 "sample/encap_reflect_packet.c" - r3 = r2; - // EBPF_OP_ADD64_IMM pc=5 dst=r3 src=r0 offset=0 imm=14 + r4 = r3; + // EBPF_OP_ADD64_IMM pc=4 dst=r4 src=r0 offset=0 imm=14 #line 173 "sample/encap_reflect_packet.c" - r3 += IMMEDIATE(14); - // EBPF_OP_JGT_REG pc=6 dst=r3 src=r1 offset=314 imm=0 + r4 += IMMEDIATE(14); + // EBPF_OP_JGT_REG pc=5 dst=r4 src=r2 offset=315 imm=0 #line 173 "sample/encap_reflect_packet.c" - if (r3 > r1) { + if (r4 > r2) { #line 173 "sample/encap_reflect_packet.c" goto label_5; #line 173 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=7 dst=r4 src=r2 offset=12 imm=0 + // EBPF_OP_LDXH pc=6 dst=r5 src=r3 offset=12 imm=0 #line 178 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_JEQ_IMM pc=8 dst=r4 src=r0 offset=119 imm=56710 + r5 = *(uint16_t*)(uintptr_t)(r3 + OFFSET(12)); + // EBPF_OP_JEQ_IMM pc=7 dst=r5 src=r0 offset=120 imm=56710 #line 178 "sample/encap_reflect_packet.c" - if (r4 == IMMEDIATE(56710)) { + if (r5 == IMMEDIATE(56710)) { #line 178 "sample/encap_reflect_packet.c" goto label_2; #line 178 "sample/encap_reflect_packet.c" } - // EBPF_OP_JNE_IMM pc=9 dst=r4 src=r0 offset=311 imm=8 + // EBPF_OP_JNE_IMM pc=8 dst=r5 src=r0 offset=312 imm=8 #line 178 "sample/encap_reflect_packet.c" - if (r4 != IMMEDIATE(8)) { + if (r5 != IMMEDIATE(8)) { #line 178 "sample/encap_reflect_packet.c" goto label_5; #line 178 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=10 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=9 dst=r5 src=r3 offset=0 imm=0 #line 179 "sample/encap_reflect_packet.c" - r4 = r2; - // EBPF_OP_ADD64_IMM pc=11 dst=r4 src=r0 offset=0 imm=34 + r5 = r3; + // EBPF_OP_ADD64_IMM pc=10 dst=r5 src=r0 offset=0 imm=34 #line 179 "sample/encap_reflect_packet.c" - r4 += IMMEDIATE(34); - // EBPF_OP_JGT_REG pc=12 dst=r4 src=r1 offset=308 imm=0 + r5 += IMMEDIATE(34); + // EBPF_OP_JGT_REG pc=11 dst=r5 src=r2 offset=309 imm=0 #line 179 "sample/encap_reflect_packet.c" - if (r4 > r1) { + if (r5 > r2) { #line 179 "sample/encap_reflect_packet.c" goto label_5; #line 179 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXB pc=13 dst=r4 src=r2 offset=23 imm=0 + // EBPF_OP_LDXB pc=12 dst=r5 src=r3 offset=23 imm=0 #line 185 "sample/encap_reflect_packet.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(23)); - // EBPF_OP_JNE_IMM pc=14 dst=r4 src=r0 offset=306 imm=17 + r5 = *(uint8_t*)(uintptr_t)(r3 + OFFSET(23)); + // EBPF_OP_JNE_IMM pc=13 dst=r5 src=r0 offset=307 imm=17 #line 185 "sample/encap_reflect_packet.c" - if (r4 != IMMEDIATE(17)) { + if (r5 != IMMEDIATE(17)) { #line 185 "sample/encap_reflect_packet.c" goto label_5; #line 185 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXB pc=15 dst=r2 src=r2 offset=14 imm=0 + // EBPF_OP_LDXB pc=14 dst=r3 src=r3 offset=14 imm=0 #line 185 "sample/encap_reflect_packet.c" - r2 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(14)); - // EBPF_OP_LSH64_IMM pc=16 dst=r2 src=r0 offset=0 imm=2 + r3 = *(uint8_t*)(uintptr_t)(r3 + OFFSET(14)); + // EBPF_OP_LSH64_IMM pc=15 dst=r3 src=r0 offset=0 imm=2 #line 185 "sample/encap_reflect_packet.c" - r2 <<= (IMMEDIATE(2) & 63); - // EBPF_OP_AND64_IMM pc=17 dst=r2 src=r0 offset=0 imm=60 + r3 <<= (IMMEDIATE(2) & 63); + // EBPF_OP_AND64_IMM pc=16 dst=r3 src=r0 offset=0 imm=60 #line 185 "sample/encap_reflect_packet.c" - r2 &= IMMEDIATE(60); - // EBPF_OP_ADD64_REG pc=18 dst=r3 src=r2 offset=0 imm=0 + r3 &= IMMEDIATE(60); + // EBPF_OP_ADD64_REG pc=17 dst=r4 src=r3 offset=0 imm=0 #line 185 "sample/encap_reflect_packet.c" - r3 += r2; - // EBPF_OP_MOV64_REG pc=19 dst=r2 src=r3 offset=0 imm=0 + r4 += r3; + // EBPF_OP_MOV64_REG pc=18 dst=r3 src=r4 offset=0 imm=0 #line 185 "sample/encap_reflect_packet.c" - r2 = r3; - // EBPF_OP_ADD64_IMM pc=20 dst=r2 src=r0 offset=0 imm=8 + r3 = r4; + // EBPF_OP_ADD64_IMM pc=19 dst=r3 src=r0 offset=0 imm=8 #line 185 "sample/encap_reflect_packet.c" - r2 += IMMEDIATE(8); - // EBPF_OP_JGT_REG pc=21 dst=r2 src=r1 offset=299 imm=0 + r3 += IMMEDIATE(8); + // EBPF_OP_JGT_REG pc=20 dst=r3 src=r2 offset=300 imm=0 #line 185 "sample/encap_reflect_packet.c" - if (r2 > r1) { + if (r3 > r2) { #line 185 "sample/encap_reflect_packet.c" goto label_5; #line 185 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=22 dst=r1 src=r3 offset=2 imm=0 + // EBPF_OP_LDXH pc=21 dst=r2 src=r4 offset=2 imm=0 #line 191 "sample/encap_reflect_packet.c" - r1 = *(uint16_t*)(uintptr_t)(r3 + OFFSET(2)); - // EBPF_OP_JNE_IMM pc=23 dst=r1 src=r0 offset=297 imm=7459 + r2 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)); + // EBPF_OP_JNE_IMM pc=22 dst=r2 src=r0 offset=298 imm=7459 #line 191 "sample/encap_reflect_packet.c" - if (r1 != IMMEDIATE(7459)) { + if (r2 != IMMEDIATE(7459)) { #line 191 "sample/encap_reflect_packet.c" goto label_5; #line 191 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=24 dst=r1 src=r6 offset=0 imm=0 -#line 22 "sample/encap_reflect_packet.c" - r1 = r6; - // EBPF_OP_LDDW pc=25 dst=r2 src=r0 offset=0 imm=-20 + // EBPF_OP_MOV64_REG pc=23 dst=r6 src=r1 offset=0 imm=0 +#line 191 "sample/encap_reflect_packet.c" + r6 = r1; + // EBPF_OP_LDDW pc=24 dst=r2 src=r0 offset=0 imm=-20 #line 22 "sample/encap_reflect_packet.c" r2 = (uint64_t)4294967276; - // EBPF_OP_CALL pc=27 dst=r0 src=r0 offset=0 imm=65536 + // EBPF_OP_CALL pc=26 dst=r0 src=r0 offset=0 imm=65536 #line 22 "sample/encap_reflect_packet.c" r0 = encap_reflect_packet_helpers[0].address(r1, r2, r3, r4, r5, context); #line 22 "sample/encap_reflect_packet.c" @@ -179,6 +176,9 @@ encap_reflect_packet(void* context) return 0; #line 22 "sample/encap_reflect_packet.c" } + // EBPF_OP_MOV64_REG pc=27 dst=r2 src=r6 offset=0 imm=0 +#line 22 "sample/encap_reflect_packet.c" + r2 = r6; // EBPF_OP_MOV64_REG pc=28 dst=r1 src=r0 offset=0 imm=0 #line 22 "sample/encap_reflect_packet.c" r1 = r0; @@ -191,208 +191,208 @@ encap_reflect_packet(void* context) // EBPF_OP_ARSH64_IMM pc=31 dst=r1 src=r0 offset=0 imm=32 #line 22 "sample/encap_reflect_packet.c" r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_IMM pc=32 dst=r2 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=32 dst=r3 src=r0 offset=0 imm=0 #line 22 "sample/encap_reflect_packet.c" - r2 = IMMEDIATE(0); - // EBPF_OP_JSGT_REG pc=33 dst=r2 src=r1 offset=287 imm=0 + r3 = IMMEDIATE(0); + // EBPF_OP_JSGT_REG pc=33 dst=r3 src=r1 offset=287 imm=0 #line 22 "sample/encap_reflect_packet.c" - if ((int64_t)r2 > (int64_t)r1) { + if ((int64_t)r3 > (int64_t)r1) { #line 22 "sample/encap_reflect_packet.c" goto label_5; #line 22 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXDW pc=34 dst=r4 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=34 dst=r5 src=r2 offset=8 imm=0 #line 28 "sample/encap_reflect_packet.c" - r4 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_LDXDW pc=35 dst=r7 src=r6 offset=0 imm=0 + r5 = *(uint64_t*)(uintptr_t)(r2 + OFFSET(8)); + // EBPF_OP_LDXDW pc=35 dst=r6 src=r2 offset=0 imm=0 #line 27 "sample/encap_reflect_packet.c" - r7 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_MOV64_REG pc=36 dst=r3 src=r7 offset=0 imm=0 + r6 = *(uint64_t*)(uintptr_t)(r2 + OFFSET(0)); + // EBPF_OP_MOV64_REG pc=36 dst=r3 src=r6 offset=0 imm=0 #line 28 "sample/encap_reflect_packet.c" - r3 = r7; + r3 = r6; // EBPF_OP_ADD64_IMM pc=37 dst=r3 src=r0 offset=0 imm=14 #line 28 "sample/encap_reflect_packet.c" r3 += IMMEDIATE(14); - // EBPF_OP_JGT_REG pc=38 dst=r3 src=r4 offset=282 imm=0 + // EBPF_OP_JGT_REG pc=38 dst=r3 src=r5 offset=282 imm=0 #line 28 "sample/encap_reflect_packet.c" - if (r3 > r4) { + if (r3 > r5) { #line 28 "sample/encap_reflect_packet.c" goto label_5; #line 28 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=39 dst=r2 src=r7 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=39 dst=r4 src=r6 offset=0 imm=0 #line 35 "sample/encap_reflect_packet.c" - r2 = r7; - // EBPF_OP_ADD64_IMM pc=40 dst=r2 src=r0 offset=0 imm=20 + r4 = r6; + // EBPF_OP_ADD64_IMM pc=40 dst=r4 src=r0 offset=0 imm=20 #line 35 "sample/encap_reflect_packet.c" - r2 += IMMEDIATE(20); - // EBPF_OP_JGT_REG pc=41 dst=r2 src=r4 offset=279 imm=0 + r4 += IMMEDIATE(20); + // EBPF_OP_JGT_REG pc=41 dst=r4 src=r5 offset=279 imm=0 #line 35 "sample/encap_reflect_packet.c" - if (r2 > r4) { + if (r4 > r5) { #line 35 "sample/encap_reflect_packet.c" goto label_5; #line 35 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=42 dst=r1 src=r7 offset=0 imm=0 -#line 43 "sample/encap_reflect_packet.c" - r1 = r7; + // EBPF_OP_MOV64_REG pc=42 dst=r1 src=r6 offset=0 imm=0 +#line 35 "sample/encap_reflect_packet.c" + r1 = r6; // EBPF_OP_ADD64_IMM pc=43 dst=r1 src=r0 offset=0 imm=34 -#line 43 "sample/encap_reflect_packet.c" +#line 35 "sample/encap_reflect_packet.c" r1 += IMMEDIATE(34); - // EBPF_OP_JGT_REG pc=44 dst=r1 src=r4 offset=276 imm=0 -#line 43 "sample/encap_reflect_packet.c" - if (r1 > r4) { -#line 43 "sample/encap_reflect_packet.c" + // EBPF_OP_JGT_REG pc=44 dst=r1 src=r5 offset=276 imm=0 +#line 35 "sample/encap_reflect_packet.c" + if (r1 > r5) { +#line 35 "sample/encap_reflect_packet.c" goto label_5; -#line 43 "sample/encap_reflect_packet.c" +#line 35 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=45 dst=r5 src=r7 offset=0 imm=0 -#line 43 "sample/encap_reflect_packet.c" - r5 = r7; - // EBPF_OP_ADD64_IMM pc=46 dst=r5 src=r0 offset=0 imm=54 -#line 43 "sample/encap_reflect_packet.c" - r5 += IMMEDIATE(54); - // EBPF_OP_JGT_REG pc=47 dst=r5 src=r4 offset=273 imm=0 -#line 43 "sample/encap_reflect_packet.c" - if (r5 > r4) { -#line 43 "sample/encap_reflect_packet.c" + // EBPF_OP_MOV64_REG pc=45 dst=r7 src=r6 offset=0 imm=0 +#line 35 "sample/encap_reflect_packet.c" + r7 = r6; + // EBPF_OP_ADD64_IMM pc=46 dst=r7 src=r0 offset=0 imm=54 +#line 35 "sample/encap_reflect_packet.c" + r7 += IMMEDIATE(54); + // EBPF_OP_JGT_REG pc=47 dst=r7 src=r5 offset=273 imm=0 +#line 35 "sample/encap_reflect_packet.c" + if (r7 > r5) { +#line 35 "sample/encap_reflect_packet.c" goto label_5; -#line 43 "sample/encap_reflect_packet.c" +#line 35 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=48 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_LDXH pc=48 dst=r5 src=r4 offset=0 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_STXH pc=49 dst=r7 src=r4 offset=0 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(0)); + // EBPF_OP_STXH pc=49 dst=r6 src=r5 offset=0 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(0)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=50 dst=r4 src=r2 offset=2 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(0)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=50 dst=r5 src=r4 offset=2 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_STXH pc=51 dst=r7 src=r4 offset=2 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)); + // EBPF_OP_STXH pc=51 dst=r6 src=r5 offset=2 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(2)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=52 dst=r4 src=r2 offset=4 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(2)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=52 dst=r5 src=r4 offset=4 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(4)); - // EBPF_OP_STXH pc=53 dst=r7 src=r4 offset=4 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(4)); + // EBPF_OP_STXH pc=53 dst=r6 src=r5 offset=4 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(4)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=54 dst=r4 src=r2 offset=12 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(4)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=54 dst=r5 src=r4 offset=12 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_STXH pc=55 dst=r7 src=r4 offset=12 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(12)); + // EBPF_OP_STXH pc=55 dst=r6 src=r5 offset=12 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(12)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=56 dst=r4 src=r2 offset=6 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(12)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=56 dst=r5 src=r4 offset=6 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(6)); - // EBPF_OP_STXH pc=57 dst=r7 src=r4 offset=6 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(6)); + // EBPF_OP_STXH pc=57 dst=r6 src=r5 offset=6 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(6)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=58 dst=r5 src=r2 offset=10 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(6)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=58 dst=r7 src=r4 offset=10 imm=0 #line 56 "sample/encap_reflect_packet.c" - r5 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(10)); - // EBPF_OP_LDXH pc=59 dst=r8 src=r2 offset=8 imm=0 + r7 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(10)); + // EBPF_OP_LDXH pc=59 dst=r8 src=r4 offset=8 imm=0 #line 56 "sample/encap_reflect_packet.c" - r8 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(8)); - // EBPF_OP_STXH pc=60 dst=r7 src=r4 offset=0 imm=0 + r8 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(8)); + // EBPF_OP_STXH pc=60 dst=r6 src=r5 offset=0 imm=0 #line 17 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(0)) = (uint16_t)r4; - // EBPF_OP_STXH pc=61 dst=r7 src=r8 offset=8 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(0)) = (uint16_t)r5; + // EBPF_OP_STXH pc=61 dst=r6 src=r8 offset=8 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(8)) = (uint16_t)r8; - // EBPF_OP_STXH pc=62 dst=r7 src=r8 offset=2 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(8)) = (uint16_t)r8; + // EBPF_OP_STXH pc=62 dst=r6 src=r8 offset=2 imm=0 #line 17 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(2)) = (uint16_t)r8; - // EBPF_OP_STXH pc=63 dst=r7 src=r5 offset=10 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(2)) = (uint16_t)r8; + // EBPF_OP_STXH pc=63 dst=r6 src=r7 offset=10 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(10)) = (uint16_t)r5; - // EBPF_OP_STXH pc=64 dst=r7 src=r5 offset=4 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(10)) = (uint16_t)r7; + // EBPF_OP_STXH pc=64 dst=r6 src=r7 offset=4 imm=0 #line 17 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(4)) = (uint16_t)r5; - // EBPF_OP_LDXH pc=65 dst=r4 src=r2 offset=4 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(4)) = (uint16_t)r7; + // EBPF_OP_LDXH pc=65 dst=r5 src=r4 offset=4 imm=0 #line 18 "sample/./xdp_common.h" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(4)); - // EBPF_OP_STXH pc=66 dst=r7 src=r4 offset=10 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(4)); + // EBPF_OP_STXH pc=66 dst=r6 src=r5 offset=10 imm=0 #line 18 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(10)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=67 dst=r4 src=r2 offset=0 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(10)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=67 dst=r5 src=r4 offset=0 imm=0 #line 18 "sample/./xdp_common.h" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_STXH pc=68 dst=r7 src=r4 offset=6 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(0)); + // EBPF_OP_STXH pc=68 dst=r6 src=r5 offset=6 imm=0 #line 18 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(6)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=69 dst=r2 src=r2 offset=2 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(6)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=69 dst=r4 src=r4 offset=2 imm=0 #line 18 "sample/./xdp_common.h" - r2 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_STXH pc=70 dst=r7 src=r2 offset=8 imm=0 + r4 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)); + // EBPF_OP_STXH pc=70 dst=r6 src=r4 offset=8 imm=0 #line 18 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(8)) = (uint16_t)r2; - // EBPF_OP_LDXW pc=71 dst=r2 src=r7 offset=50 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(8)) = (uint16_t)r4; + // EBPF_OP_LDXW pc=71 dst=r4 src=r6 offset=50 imm=0 #line 24 "sample/./xdp_common.h" - r2 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(50)); - // EBPF_OP_LDXW pc=72 dst=r4 src=r7 offset=46 imm=0 + r4 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(50)); + // EBPF_OP_LDXW pc=72 dst=r5 src=r6 offset=46 imm=0 #line 25 "sample/./xdp_common.h" - r4 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(46)); - // EBPF_OP_STXW pc=73 dst=r7 src=r4 offset=50 imm=0 + r5 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(46)); + // EBPF_OP_STXW pc=73 dst=r6 src=r5 offset=50 imm=0 #line 25 "sample/./xdp_common.h" - *(uint32_t*)(uintptr_t)(r7 + OFFSET(50)) = (uint32_t)r4; - // EBPF_OP_STXW pc=74 dst=r7 src=r2 offset=46 imm=0 + *(uint32_t*)(uintptr_t)(r6 + OFFSET(50)) = (uint32_t)r5; + // EBPF_OP_STXW pc=74 dst=r6 src=r4 offset=46 imm=0 #line 26 "sample/./xdp_common.h" - *(uint32_t*)(uintptr_t)(r7 + OFFSET(46)) = (uint32_t)r2; - // EBPF_OP_LDXB pc=75 dst=r4 src=r7 offset=34 imm=0 + *(uint32_t*)(uintptr_t)(r6 + OFFSET(46)) = (uint32_t)r4; + // EBPF_OP_LDXB pc=75 dst=r5 src=r6 offset=34 imm=0 #line 63 "sample/encap_reflect_packet.c" - r4 = *(uint8_t*)(uintptr_t)(r7 + OFFSET(34)); - // EBPF_OP_LSH64_IMM pc=76 dst=r4 src=r0 offset=0 imm=2 + r5 = *(uint8_t*)(uintptr_t)(r6 + OFFSET(34)); + // EBPF_OP_LSH64_IMM pc=76 dst=r5 src=r0 offset=0 imm=2 #line 63 "sample/encap_reflect_packet.c" - r4 <<= (IMMEDIATE(2) & 63); - // EBPF_OP_AND64_IMM pc=77 dst=r4 src=r0 offset=0 imm=60 + r5 <<= (IMMEDIATE(2) & 63); + // EBPF_OP_AND64_IMM pc=77 dst=r5 src=r0 offset=0 imm=60 #line 63 "sample/encap_reflect_packet.c" - r4 &= IMMEDIATE(60); - // EBPF_OP_MOV64_REG pc=78 dst=r2 src=r1 offset=0 imm=0 + r5 &= IMMEDIATE(60); + // EBPF_OP_MOV64_REG pc=78 dst=r4 src=r1 offset=0 imm=0 #line 63 "sample/encap_reflect_packet.c" - r2 = r1; - // EBPF_OP_ADD64_REG pc=79 dst=r2 src=r4 offset=0 imm=0 + r4 = r1; + // EBPF_OP_ADD64_REG pc=79 dst=r4 src=r5 offset=0 imm=0 #line 63 "sample/encap_reflect_packet.c" - r2 += r4; - // EBPF_OP_MOV64_REG pc=80 dst=r4 src=r2 offset=0 imm=0 + r4 += r5; + // EBPF_OP_MOV64_REG pc=80 dst=r5 src=r4 offset=0 imm=0 #line 64 "sample/encap_reflect_packet.c" - r4 = r2; - // EBPF_OP_ADD64_IMM pc=81 dst=r4 src=r0 offset=0 imm=8 + r5 = r4; + // EBPF_OP_ADD64_IMM pc=81 dst=r5 src=r0 offset=0 imm=8 #line 64 "sample/encap_reflect_packet.c" - r4 += IMMEDIATE(8); - // EBPF_OP_LDXDW pc=82 dst=r5 src=r6 offset=8 imm=0 + r5 += IMMEDIATE(8); + // EBPF_OP_LDXDW pc=82 dst=r2 src=r2 offset=8 imm=0 #line 64 "sample/encap_reflect_packet.c" - r5 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_JGT_REG pc=83 dst=r4 src=r5 offset=237 imm=0 + r2 = *(uint64_t*)(uintptr_t)(r2 + OFFSET(8)); + // EBPF_OP_JGT_REG pc=83 dst=r5 src=r2 offset=237 imm=0 #line 64 "sample/encap_reflect_packet.c" - if (r4 > r5) { + if (r5 > r2) { #line 64 "sample/encap_reflect_packet.c" goto label_5; #line 64 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=84 dst=r4 src=r2 offset=2 imm=0 + // EBPF_OP_LDXH pc=84 dst=r2 src=r4 offset=2 imm=0 #line 68 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_JNE_IMM pc=85 dst=r4 src=r0 offset=4 imm=7459 + r2 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)); + // EBPF_OP_JNE_IMM pc=85 dst=r2 src=r0 offset=4 imm=7459 #line 68 "sample/encap_reflect_packet.c" - if (r4 != IMMEDIATE(7459)) { + if (r2 != IMMEDIATE(7459)) { #line 68 "sample/encap_reflect_packet.c" goto label_1; #line 68 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=86 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_LDXH pc=86 dst=r2 src=r4 offset=0 imm=0 #line 41 "sample/./xdp_common.h" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_STXH pc=87 dst=r2 src=r4 offset=2 imm=0 + r2 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(0)); + // EBPF_OP_STXH pc=87 dst=r4 src=r2 offset=2 imm=0 #line 43 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r2 + OFFSET(2)) = (uint16_t)r4; - // EBPF_OP_MOV64_IMM pc=88 dst=r4 src=r0 offset=0 imm=7459 + *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)) = (uint16_t)r2; + // EBPF_OP_MOV64_IMM pc=88 dst=r2 src=r0 offset=0 imm=7459 #line 43 "sample/./xdp_common.h" - r4 = IMMEDIATE(7459); - // EBPF_OP_STXH pc=89 dst=r2 src=r4 offset=0 imm=0 + r2 = IMMEDIATE(7459); + // EBPF_OP_STXH pc=89 dst=r4 src=r2 offset=0 imm=0 #line 42 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r2 + OFFSET(0)) = (uint16_t)r4; + *(uint16_t*)(uintptr_t)(r4 + OFFSET(0)) = (uint16_t)r2; label_1: // EBPF_OP_LDXW pc=90 dst=r2 src=r1 offset=16 imm=0 #line 73 "sample/encap_reflect_packet.c" @@ -427,24 +427,24 @@ encap_reflect_packet(void* context) // EBPF_OP_MOV64_IMM pc=100 dst=r1 src=r0 offset=0 imm=4 #line 73 "sample/encap_reflect_packet.c" r1 = IMMEDIATE(4); - // EBPF_OP_STXB pc=101 dst=r7 src=r1 offset=23 imm=0 + // EBPF_OP_STXB pc=101 dst=r6 src=r1 offset=23 imm=0 #line 76 "sample/encap_reflect_packet.c" - *(uint8_t*)(uintptr_t)(r7 + OFFSET(23)) = (uint8_t)r1; - // EBPF_OP_LDXB pc=102 dst=r1 src=r7 offset=14 imm=0 + *(uint8_t*)(uintptr_t)(r6 + OFFSET(23)) = (uint8_t)r1; + // EBPF_OP_LDXB pc=102 dst=r1 src=r6 offset=14 imm=0 #line 77 "sample/encap_reflect_packet.c" - r1 = *(uint8_t*)(uintptr_t)(r7 + OFFSET(14)); + r1 = *(uint8_t*)(uintptr_t)(r6 + OFFSET(14)); // EBPF_OP_AND64_IMM pc=103 dst=r1 src=r0 offset=0 imm=240 #line 77 "sample/encap_reflect_packet.c" r1 &= IMMEDIATE(240); // EBPF_OP_OR64_IMM pc=104 dst=r1 src=r0 offset=0 imm=5 #line 77 "sample/encap_reflect_packet.c" r1 |= IMMEDIATE(5); - // EBPF_OP_STXB pc=105 dst=r7 src=r1 offset=14 imm=0 + // EBPF_OP_STXB pc=105 dst=r6 src=r1 offset=14 imm=0 #line 77 "sample/encap_reflect_packet.c" - *(uint8_t*)(uintptr_t)(r7 + OFFSET(14)) = (uint8_t)r1; - // EBPF_OP_LDXH pc=106 dst=r1 src=r7 offset=36 imm=0 + *(uint8_t*)(uintptr_t)(r6 + OFFSET(14)) = (uint8_t)r1; + // EBPF_OP_LDXH pc=106 dst=r1 src=r6 offset=36 imm=0 #line 78 "sample/encap_reflect_packet.c" - r1 = *(uint16_t*)(uintptr_t)(r7 + OFFSET(36)); + r1 = *(uint16_t*)(uintptr_t)(r6 + OFFSET(36)); // EBPF_OP_BE pc=107 dst=r1 src=r0 offset=0 imm=16 #line 78 "sample/encap_reflect_packet.c" r1 = htobe16((uint16_t)r1); @@ -458,15 +458,15 @@ encap_reflect_packet(void* context) r1 = htobe16((uint16_t)r1); #line 78 "sample/encap_reflect_packet.c" r1 &= UINT32_MAX; - // EBPF_OP_STXH pc=110 dst=r7 src=r1 offset=16 imm=0 + // EBPF_OP_STXH pc=110 dst=r6 src=r1 offset=16 imm=0 #line 78 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(16)) = (uint16_t)r1; + *(uint16_t*)(uintptr_t)(r6 + OFFSET(16)) = (uint16_t)r1; // EBPF_OP_MOV64_IMM pc=111 dst=r1 src=r0 offset=0 imm=0 #line 78 "sample/encap_reflect_packet.c" r1 = IMMEDIATE(0); - // EBPF_OP_STXH pc=112 dst=r7 src=r1 offset=24 imm=0 + // EBPF_OP_STXH pc=112 dst=r6 src=r1 offset=24 imm=0 #line 80 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(24)) = (uint16_t)r1; + *(uint16_t*)(uintptr_t)(r6 + OFFSET(24)) = (uint16_t)r1; // EBPF_OP_MOV64_IMM pc=113 dst=r2 src=r0 offset=0 imm=0 #line 82 "sample/encap_reflect_packet.c" r2 = IMMEDIATE(0); @@ -512,62 +512,62 @@ encap_reflect_packet(void* context) // EBPF_OP_XOR64_IMM pc=125 dst=r1 src=r0 offset=0 imm=-1 #line 82 "sample/encap_reflect_packet.c" r1 ^= IMMEDIATE(-1); - // EBPF_OP_STXH pc=126 dst=r7 src=r1 offset=24 imm=0 + // EBPF_OP_STXH pc=126 dst=r6 src=r1 offset=24 imm=0 #line 81 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(24)) = (uint16_t)r1; + *(uint16_t*)(uintptr_t)(r6 + OFFSET(24)) = (uint16_t)r1; // EBPF_OP_JA pc=127 dst=r0 src=r0 offset=192 imm=0 #line 81 "sample/encap_reflect_packet.c" goto label_4; label_2: - // EBPF_OP_MOV64_REG pc=128 dst=r3 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=128 dst=r4 src=r3 offset=0 imm=0 #line 196 "sample/encap_reflect_packet.c" - r3 = r2; - // EBPF_OP_ADD64_IMM pc=129 dst=r3 src=r0 offset=0 imm=54 + r4 = r3; + // EBPF_OP_ADD64_IMM pc=129 dst=r4 src=r0 offset=0 imm=54 #line 196 "sample/encap_reflect_packet.c" - r3 += IMMEDIATE(54); - // EBPF_OP_JGT_REG pc=130 dst=r3 src=r1 offset=190 imm=0 + r4 += IMMEDIATE(54); + // EBPF_OP_JGT_REG pc=130 dst=r4 src=r2 offset=190 imm=0 #line 196 "sample/encap_reflect_packet.c" - if (r3 > r1) { + if (r4 > r2) { #line 196 "sample/encap_reflect_packet.c" goto label_5; #line 196 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXB pc=131 dst=r3 src=r2 offset=20 imm=0 + // EBPF_OP_LDXB pc=131 dst=r4 src=r3 offset=20 imm=0 #line 202 "sample/encap_reflect_packet.c" - r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(20)); - // EBPF_OP_JNE_IMM pc=132 dst=r3 src=r0 offset=188 imm=17 + r4 = *(uint8_t*)(uintptr_t)(r3 + OFFSET(20)); + // EBPF_OP_JNE_IMM pc=132 dst=r4 src=r0 offset=188 imm=17 #line 202 "sample/encap_reflect_packet.c" - if (r3 != IMMEDIATE(17)) { + if (r4 != IMMEDIATE(17)) { #line 202 "sample/encap_reflect_packet.c" goto label_5; #line 202 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=133 dst=r3 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=133 dst=r4 src=r3 offset=0 imm=0 #line 202 "sample/encap_reflect_packet.c" - r3 = r2; - // EBPF_OP_ADD64_IMM pc=134 dst=r3 src=r0 offset=0 imm=62 + r4 = r3; + // EBPF_OP_ADD64_IMM pc=134 dst=r4 src=r0 offset=0 imm=62 #line 202 "sample/encap_reflect_packet.c" - r3 += IMMEDIATE(62); - // EBPF_OP_JGT_REG pc=135 dst=r3 src=r1 offset=185 imm=0 + r4 += IMMEDIATE(62); + // EBPF_OP_JGT_REG pc=135 dst=r4 src=r2 offset=185 imm=0 #line 202 "sample/encap_reflect_packet.c" - if (r3 > r1) { + if (r4 > r2) { #line 202 "sample/encap_reflect_packet.c" goto label_5; #line 202 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=136 dst=r1 src=r2 offset=56 imm=0 + // EBPF_OP_LDXH pc=136 dst=r2 src=r3 offset=56 imm=0 #line 208 "sample/encap_reflect_packet.c" - r1 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(56)); - // EBPF_OP_JNE_IMM pc=137 dst=r1 src=r0 offset=183 imm=7459 + r2 = *(uint16_t*)(uintptr_t)(r3 + OFFSET(56)); + // EBPF_OP_JNE_IMM pc=137 dst=r2 src=r0 offset=183 imm=7459 #line 208 "sample/encap_reflect_packet.c" - if (r1 != IMMEDIATE(7459)) { + if (r2 != IMMEDIATE(7459)) { #line 208 "sample/encap_reflect_packet.c" goto label_5; #line 208 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=138 dst=r1 src=r6 offset=0 imm=0 -#line 96 "sample/encap_reflect_packet.c" - r1 = r6; + // EBPF_OP_MOV64_REG pc=138 dst=r6 src=r1 offset=0 imm=0 +#line 208 "sample/encap_reflect_packet.c" + r6 = r1; // EBPF_OP_LDDW pc=139 dst=r2 src=r0 offset=0 imm=-40 #line 96 "sample/encap_reflect_packet.c" r2 = (uint64_t)4294967256; @@ -635,17 +635,17 @@ encap_reflect_packet(void* context) #line 109 "sample/encap_reflect_packet.c" } // EBPF_OP_MOV64_REG pc=156 dst=r3 src=r1 offset=0 imm=0 -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" r3 = r1; // EBPF_OP_ADD64_IMM pc=157 dst=r3 src=r0 offset=0 imm=54 -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" r3 += IMMEDIATE(54); // EBPF_OP_JGT_REG pc=158 dst=r3 src=r5 offset=162 imm=0 -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" if (r3 > r5) { -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" goto label_5; -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" } // EBPF_OP_MOV64_REG pc=159 dst=r7 src=r1 offset=0 imm=0 #line 124 "sample/encap_reflect_packet.c" diff --git a/tests/bpf2c_tests/expected/encap_reflect_packet_sys.c b/tests/bpf2c_tests/expected/encap_reflect_packet_sys.c index b6350a1bcb..ffce8c3a2f 100644 --- a/tests/bpf2c_tests/expected/encap_reflect_packet_sys.c +++ b/tests/bpf2c_tests/expected/encap_reflect_packet_sys.c @@ -225,113 +225,110 @@ encap_reflect_packet(void* context) #line 167 "sample/encap_reflect_packet.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); - // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 -#line 167 "sample/encap_reflect_packet.c" - r6 = r1; - // EBPF_OP_MOV64_IMM pc=1 dst=r0 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=0 dst=r0 src=r0 offset=0 imm=1 #line 167 "sample/encap_reflect_packet.c" r0 = IMMEDIATE(1); - // EBPF_OP_LDXDW pc=2 dst=r1 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=1 dst=r2 src=r1 offset=8 imm=0 #line 173 "sample/encap_reflect_packet.c" - r1 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_LDXDW pc=3 dst=r2 src=r6 offset=0 imm=0 + r2 = *(uint64_t*)(uintptr_t)(r1 + OFFSET(8)); + // EBPF_OP_LDXDW pc=2 dst=r3 src=r1 offset=0 imm=0 #line 172 "sample/encap_reflect_packet.c" - r2 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_MOV64_REG pc=4 dst=r3 src=r2 offset=0 imm=0 + r3 = *(uint64_t*)(uintptr_t)(r1 + OFFSET(0)); + // EBPF_OP_MOV64_REG pc=3 dst=r4 src=r3 offset=0 imm=0 #line 173 "sample/encap_reflect_packet.c" - r3 = r2; - // EBPF_OP_ADD64_IMM pc=5 dst=r3 src=r0 offset=0 imm=14 + r4 = r3; + // EBPF_OP_ADD64_IMM pc=4 dst=r4 src=r0 offset=0 imm=14 #line 173 "sample/encap_reflect_packet.c" - r3 += IMMEDIATE(14); - // EBPF_OP_JGT_REG pc=6 dst=r3 src=r1 offset=314 imm=0 + r4 += IMMEDIATE(14); + // EBPF_OP_JGT_REG pc=5 dst=r4 src=r2 offset=315 imm=0 #line 173 "sample/encap_reflect_packet.c" - if (r3 > r1) { + if (r4 > r2) { #line 173 "sample/encap_reflect_packet.c" goto label_5; #line 173 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=7 dst=r4 src=r2 offset=12 imm=0 + // EBPF_OP_LDXH pc=6 dst=r5 src=r3 offset=12 imm=0 #line 178 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_JEQ_IMM pc=8 dst=r4 src=r0 offset=119 imm=56710 + r5 = *(uint16_t*)(uintptr_t)(r3 + OFFSET(12)); + // EBPF_OP_JEQ_IMM pc=7 dst=r5 src=r0 offset=120 imm=56710 #line 178 "sample/encap_reflect_packet.c" - if (r4 == IMMEDIATE(56710)) { + if (r5 == IMMEDIATE(56710)) { #line 178 "sample/encap_reflect_packet.c" goto label_2; #line 178 "sample/encap_reflect_packet.c" } - // EBPF_OP_JNE_IMM pc=9 dst=r4 src=r0 offset=311 imm=8 + // EBPF_OP_JNE_IMM pc=8 dst=r5 src=r0 offset=312 imm=8 #line 178 "sample/encap_reflect_packet.c" - if (r4 != IMMEDIATE(8)) { + if (r5 != IMMEDIATE(8)) { #line 178 "sample/encap_reflect_packet.c" goto label_5; #line 178 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=10 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=9 dst=r5 src=r3 offset=0 imm=0 #line 179 "sample/encap_reflect_packet.c" - r4 = r2; - // EBPF_OP_ADD64_IMM pc=11 dst=r4 src=r0 offset=0 imm=34 + r5 = r3; + // EBPF_OP_ADD64_IMM pc=10 dst=r5 src=r0 offset=0 imm=34 #line 179 "sample/encap_reflect_packet.c" - r4 += IMMEDIATE(34); - // EBPF_OP_JGT_REG pc=12 dst=r4 src=r1 offset=308 imm=0 + r5 += IMMEDIATE(34); + // EBPF_OP_JGT_REG pc=11 dst=r5 src=r2 offset=309 imm=0 #line 179 "sample/encap_reflect_packet.c" - if (r4 > r1) { + if (r5 > r2) { #line 179 "sample/encap_reflect_packet.c" goto label_5; #line 179 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXB pc=13 dst=r4 src=r2 offset=23 imm=0 + // EBPF_OP_LDXB pc=12 dst=r5 src=r3 offset=23 imm=0 #line 185 "sample/encap_reflect_packet.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(23)); - // EBPF_OP_JNE_IMM pc=14 dst=r4 src=r0 offset=306 imm=17 + r5 = *(uint8_t*)(uintptr_t)(r3 + OFFSET(23)); + // EBPF_OP_JNE_IMM pc=13 dst=r5 src=r0 offset=307 imm=17 #line 185 "sample/encap_reflect_packet.c" - if (r4 != IMMEDIATE(17)) { + if (r5 != IMMEDIATE(17)) { #line 185 "sample/encap_reflect_packet.c" goto label_5; #line 185 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXB pc=15 dst=r2 src=r2 offset=14 imm=0 + // EBPF_OP_LDXB pc=14 dst=r3 src=r3 offset=14 imm=0 #line 185 "sample/encap_reflect_packet.c" - r2 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(14)); - // EBPF_OP_LSH64_IMM pc=16 dst=r2 src=r0 offset=0 imm=2 + r3 = *(uint8_t*)(uintptr_t)(r3 + OFFSET(14)); + // EBPF_OP_LSH64_IMM pc=15 dst=r3 src=r0 offset=0 imm=2 #line 185 "sample/encap_reflect_packet.c" - r2 <<= (IMMEDIATE(2) & 63); - // EBPF_OP_AND64_IMM pc=17 dst=r2 src=r0 offset=0 imm=60 + r3 <<= (IMMEDIATE(2) & 63); + // EBPF_OP_AND64_IMM pc=16 dst=r3 src=r0 offset=0 imm=60 #line 185 "sample/encap_reflect_packet.c" - r2 &= IMMEDIATE(60); - // EBPF_OP_ADD64_REG pc=18 dst=r3 src=r2 offset=0 imm=0 + r3 &= IMMEDIATE(60); + // EBPF_OP_ADD64_REG pc=17 dst=r4 src=r3 offset=0 imm=0 #line 185 "sample/encap_reflect_packet.c" - r3 += r2; - // EBPF_OP_MOV64_REG pc=19 dst=r2 src=r3 offset=0 imm=0 + r4 += r3; + // EBPF_OP_MOV64_REG pc=18 dst=r3 src=r4 offset=0 imm=0 #line 185 "sample/encap_reflect_packet.c" - r2 = r3; - // EBPF_OP_ADD64_IMM pc=20 dst=r2 src=r0 offset=0 imm=8 + r3 = r4; + // EBPF_OP_ADD64_IMM pc=19 dst=r3 src=r0 offset=0 imm=8 #line 185 "sample/encap_reflect_packet.c" - r2 += IMMEDIATE(8); - // EBPF_OP_JGT_REG pc=21 dst=r2 src=r1 offset=299 imm=0 + r3 += IMMEDIATE(8); + // EBPF_OP_JGT_REG pc=20 dst=r3 src=r2 offset=300 imm=0 #line 185 "sample/encap_reflect_packet.c" - if (r2 > r1) { + if (r3 > r2) { #line 185 "sample/encap_reflect_packet.c" goto label_5; #line 185 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=22 dst=r1 src=r3 offset=2 imm=0 + // EBPF_OP_LDXH pc=21 dst=r2 src=r4 offset=2 imm=0 #line 191 "sample/encap_reflect_packet.c" - r1 = *(uint16_t*)(uintptr_t)(r3 + OFFSET(2)); - // EBPF_OP_JNE_IMM pc=23 dst=r1 src=r0 offset=297 imm=7459 + r2 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)); + // EBPF_OP_JNE_IMM pc=22 dst=r2 src=r0 offset=298 imm=7459 #line 191 "sample/encap_reflect_packet.c" - if (r1 != IMMEDIATE(7459)) { + if (r2 != IMMEDIATE(7459)) { #line 191 "sample/encap_reflect_packet.c" goto label_5; #line 191 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=24 dst=r1 src=r6 offset=0 imm=0 -#line 22 "sample/encap_reflect_packet.c" - r1 = r6; - // EBPF_OP_LDDW pc=25 dst=r2 src=r0 offset=0 imm=-20 + // EBPF_OP_MOV64_REG pc=23 dst=r6 src=r1 offset=0 imm=0 +#line 191 "sample/encap_reflect_packet.c" + r6 = r1; + // EBPF_OP_LDDW pc=24 dst=r2 src=r0 offset=0 imm=-20 #line 22 "sample/encap_reflect_packet.c" r2 = (uint64_t)4294967276; - // EBPF_OP_CALL pc=27 dst=r0 src=r0 offset=0 imm=65536 + // EBPF_OP_CALL pc=26 dst=r0 src=r0 offset=0 imm=65536 #line 22 "sample/encap_reflect_packet.c" r0 = encap_reflect_packet_helpers[0].address(r1, r2, r3, r4, r5, context); #line 22 "sample/encap_reflect_packet.c" @@ -340,6 +337,9 @@ encap_reflect_packet(void* context) return 0; #line 22 "sample/encap_reflect_packet.c" } + // EBPF_OP_MOV64_REG pc=27 dst=r2 src=r6 offset=0 imm=0 +#line 22 "sample/encap_reflect_packet.c" + r2 = r6; // EBPF_OP_MOV64_REG pc=28 dst=r1 src=r0 offset=0 imm=0 #line 22 "sample/encap_reflect_packet.c" r1 = r0; @@ -352,208 +352,208 @@ encap_reflect_packet(void* context) // EBPF_OP_ARSH64_IMM pc=31 dst=r1 src=r0 offset=0 imm=32 #line 22 "sample/encap_reflect_packet.c" r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_IMM pc=32 dst=r2 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=32 dst=r3 src=r0 offset=0 imm=0 #line 22 "sample/encap_reflect_packet.c" - r2 = IMMEDIATE(0); - // EBPF_OP_JSGT_REG pc=33 dst=r2 src=r1 offset=287 imm=0 + r3 = IMMEDIATE(0); + // EBPF_OP_JSGT_REG pc=33 dst=r3 src=r1 offset=287 imm=0 #line 22 "sample/encap_reflect_packet.c" - if ((int64_t)r2 > (int64_t)r1) { + if ((int64_t)r3 > (int64_t)r1) { #line 22 "sample/encap_reflect_packet.c" goto label_5; #line 22 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXDW pc=34 dst=r4 src=r6 offset=8 imm=0 + // EBPF_OP_LDXDW pc=34 dst=r5 src=r2 offset=8 imm=0 #line 28 "sample/encap_reflect_packet.c" - r4 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_LDXDW pc=35 dst=r7 src=r6 offset=0 imm=0 + r5 = *(uint64_t*)(uintptr_t)(r2 + OFFSET(8)); + // EBPF_OP_LDXDW pc=35 dst=r6 src=r2 offset=0 imm=0 #line 27 "sample/encap_reflect_packet.c" - r7 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(0)); - // EBPF_OP_MOV64_REG pc=36 dst=r3 src=r7 offset=0 imm=0 + r6 = *(uint64_t*)(uintptr_t)(r2 + OFFSET(0)); + // EBPF_OP_MOV64_REG pc=36 dst=r3 src=r6 offset=0 imm=0 #line 28 "sample/encap_reflect_packet.c" - r3 = r7; + r3 = r6; // EBPF_OP_ADD64_IMM pc=37 dst=r3 src=r0 offset=0 imm=14 #line 28 "sample/encap_reflect_packet.c" r3 += IMMEDIATE(14); - // EBPF_OP_JGT_REG pc=38 dst=r3 src=r4 offset=282 imm=0 + // EBPF_OP_JGT_REG pc=38 dst=r3 src=r5 offset=282 imm=0 #line 28 "sample/encap_reflect_packet.c" - if (r3 > r4) { + if (r3 > r5) { #line 28 "sample/encap_reflect_packet.c" goto label_5; #line 28 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=39 dst=r2 src=r7 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=39 dst=r4 src=r6 offset=0 imm=0 #line 35 "sample/encap_reflect_packet.c" - r2 = r7; - // EBPF_OP_ADD64_IMM pc=40 dst=r2 src=r0 offset=0 imm=20 + r4 = r6; + // EBPF_OP_ADD64_IMM pc=40 dst=r4 src=r0 offset=0 imm=20 #line 35 "sample/encap_reflect_packet.c" - r2 += IMMEDIATE(20); - // EBPF_OP_JGT_REG pc=41 dst=r2 src=r4 offset=279 imm=0 + r4 += IMMEDIATE(20); + // EBPF_OP_JGT_REG pc=41 dst=r4 src=r5 offset=279 imm=0 #line 35 "sample/encap_reflect_packet.c" - if (r2 > r4) { + if (r4 > r5) { #line 35 "sample/encap_reflect_packet.c" goto label_5; #line 35 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=42 dst=r1 src=r7 offset=0 imm=0 -#line 43 "sample/encap_reflect_packet.c" - r1 = r7; + // EBPF_OP_MOV64_REG pc=42 dst=r1 src=r6 offset=0 imm=0 +#line 35 "sample/encap_reflect_packet.c" + r1 = r6; // EBPF_OP_ADD64_IMM pc=43 dst=r1 src=r0 offset=0 imm=34 -#line 43 "sample/encap_reflect_packet.c" +#line 35 "sample/encap_reflect_packet.c" r1 += IMMEDIATE(34); - // EBPF_OP_JGT_REG pc=44 dst=r1 src=r4 offset=276 imm=0 -#line 43 "sample/encap_reflect_packet.c" - if (r1 > r4) { -#line 43 "sample/encap_reflect_packet.c" + // EBPF_OP_JGT_REG pc=44 dst=r1 src=r5 offset=276 imm=0 +#line 35 "sample/encap_reflect_packet.c" + if (r1 > r5) { +#line 35 "sample/encap_reflect_packet.c" goto label_5; -#line 43 "sample/encap_reflect_packet.c" +#line 35 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=45 dst=r5 src=r7 offset=0 imm=0 -#line 43 "sample/encap_reflect_packet.c" - r5 = r7; - // EBPF_OP_ADD64_IMM pc=46 dst=r5 src=r0 offset=0 imm=54 -#line 43 "sample/encap_reflect_packet.c" - r5 += IMMEDIATE(54); - // EBPF_OP_JGT_REG pc=47 dst=r5 src=r4 offset=273 imm=0 -#line 43 "sample/encap_reflect_packet.c" - if (r5 > r4) { -#line 43 "sample/encap_reflect_packet.c" + // EBPF_OP_MOV64_REG pc=45 dst=r7 src=r6 offset=0 imm=0 +#line 35 "sample/encap_reflect_packet.c" + r7 = r6; + // EBPF_OP_ADD64_IMM pc=46 dst=r7 src=r0 offset=0 imm=54 +#line 35 "sample/encap_reflect_packet.c" + r7 += IMMEDIATE(54); + // EBPF_OP_JGT_REG pc=47 dst=r7 src=r5 offset=273 imm=0 +#line 35 "sample/encap_reflect_packet.c" + if (r7 > r5) { +#line 35 "sample/encap_reflect_packet.c" goto label_5; -#line 43 "sample/encap_reflect_packet.c" +#line 35 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=48 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_LDXH pc=48 dst=r5 src=r4 offset=0 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_STXH pc=49 dst=r7 src=r4 offset=0 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(0)); + // EBPF_OP_STXH pc=49 dst=r6 src=r5 offset=0 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(0)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=50 dst=r4 src=r2 offset=2 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(0)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=50 dst=r5 src=r4 offset=2 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_STXH pc=51 dst=r7 src=r4 offset=2 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)); + // EBPF_OP_STXH pc=51 dst=r6 src=r5 offset=2 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(2)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=52 dst=r4 src=r2 offset=4 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(2)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=52 dst=r5 src=r4 offset=4 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(4)); - // EBPF_OP_STXH pc=53 dst=r7 src=r4 offset=4 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(4)); + // EBPF_OP_STXH pc=53 dst=r6 src=r5 offset=4 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(4)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=54 dst=r4 src=r2 offset=12 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(4)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=54 dst=r5 src=r4 offset=12 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_STXH pc=55 dst=r7 src=r4 offset=12 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(12)); + // EBPF_OP_STXH pc=55 dst=r6 src=r5 offset=12 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(12)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=56 dst=r4 src=r2 offset=6 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(12)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=56 dst=r5 src=r4 offset=6 imm=0 #line 56 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(6)); - // EBPF_OP_STXH pc=57 dst=r7 src=r4 offset=6 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(6)); + // EBPF_OP_STXH pc=57 dst=r6 src=r5 offset=6 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(6)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=58 dst=r5 src=r2 offset=10 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(6)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=58 dst=r7 src=r4 offset=10 imm=0 #line 56 "sample/encap_reflect_packet.c" - r5 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(10)); - // EBPF_OP_LDXH pc=59 dst=r8 src=r2 offset=8 imm=0 + r7 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(10)); + // EBPF_OP_LDXH pc=59 dst=r8 src=r4 offset=8 imm=0 #line 56 "sample/encap_reflect_packet.c" - r8 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(8)); - // EBPF_OP_STXH pc=60 dst=r7 src=r4 offset=0 imm=0 + r8 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(8)); + // EBPF_OP_STXH pc=60 dst=r6 src=r5 offset=0 imm=0 #line 17 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(0)) = (uint16_t)r4; - // EBPF_OP_STXH pc=61 dst=r7 src=r8 offset=8 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(0)) = (uint16_t)r5; + // EBPF_OP_STXH pc=61 dst=r6 src=r8 offset=8 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(8)) = (uint16_t)r8; - // EBPF_OP_STXH pc=62 dst=r7 src=r8 offset=2 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(8)) = (uint16_t)r8; + // EBPF_OP_STXH pc=62 dst=r6 src=r8 offset=2 imm=0 #line 17 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(2)) = (uint16_t)r8; - // EBPF_OP_STXH pc=63 dst=r7 src=r5 offset=10 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(2)) = (uint16_t)r8; + // EBPF_OP_STXH pc=63 dst=r6 src=r7 offset=10 imm=0 #line 56 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(10)) = (uint16_t)r5; - // EBPF_OP_STXH pc=64 dst=r7 src=r5 offset=4 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(10)) = (uint16_t)r7; + // EBPF_OP_STXH pc=64 dst=r6 src=r7 offset=4 imm=0 #line 17 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(4)) = (uint16_t)r5; - // EBPF_OP_LDXH pc=65 dst=r4 src=r2 offset=4 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(4)) = (uint16_t)r7; + // EBPF_OP_LDXH pc=65 dst=r5 src=r4 offset=4 imm=0 #line 18 "sample/./xdp_common.h" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(4)); - // EBPF_OP_STXH pc=66 dst=r7 src=r4 offset=10 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(4)); + // EBPF_OP_STXH pc=66 dst=r6 src=r5 offset=10 imm=0 #line 18 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(10)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=67 dst=r4 src=r2 offset=0 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(10)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=67 dst=r5 src=r4 offset=0 imm=0 #line 18 "sample/./xdp_common.h" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_STXH pc=68 dst=r7 src=r4 offset=6 imm=0 + r5 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(0)); + // EBPF_OP_STXH pc=68 dst=r6 src=r5 offset=6 imm=0 #line 18 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(6)) = (uint16_t)r4; - // EBPF_OP_LDXH pc=69 dst=r2 src=r2 offset=2 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(6)) = (uint16_t)r5; + // EBPF_OP_LDXH pc=69 dst=r4 src=r4 offset=2 imm=0 #line 18 "sample/./xdp_common.h" - r2 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_STXH pc=70 dst=r7 src=r2 offset=8 imm=0 + r4 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)); + // EBPF_OP_STXH pc=70 dst=r6 src=r4 offset=8 imm=0 #line 18 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(8)) = (uint16_t)r2; - // EBPF_OP_LDXW pc=71 dst=r2 src=r7 offset=50 imm=0 + *(uint16_t*)(uintptr_t)(r6 + OFFSET(8)) = (uint16_t)r4; + // EBPF_OP_LDXW pc=71 dst=r4 src=r6 offset=50 imm=0 #line 24 "sample/./xdp_common.h" - r2 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(50)); - // EBPF_OP_LDXW pc=72 dst=r4 src=r7 offset=46 imm=0 + r4 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(50)); + // EBPF_OP_LDXW pc=72 dst=r5 src=r6 offset=46 imm=0 #line 25 "sample/./xdp_common.h" - r4 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(46)); - // EBPF_OP_STXW pc=73 dst=r7 src=r4 offset=50 imm=0 + r5 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(46)); + // EBPF_OP_STXW pc=73 dst=r6 src=r5 offset=50 imm=0 #line 25 "sample/./xdp_common.h" - *(uint32_t*)(uintptr_t)(r7 + OFFSET(50)) = (uint32_t)r4; - // EBPF_OP_STXW pc=74 dst=r7 src=r2 offset=46 imm=0 + *(uint32_t*)(uintptr_t)(r6 + OFFSET(50)) = (uint32_t)r5; + // EBPF_OP_STXW pc=74 dst=r6 src=r4 offset=46 imm=0 #line 26 "sample/./xdp_common.h" - *(uint32_t*)(uintptr_t)(r7 + OFFSET(46)) = (uint32_t)r2; - // EBPF_OP_LDXB pc=75 dst=r4 src=r7 offset=34 imm=0 + *(uint32_t*)(uintptr_t)(r6 + OFFSET(46)) = (uint32_t)r4; + // EBPF_OP_LDXB pc=75 dst=r5 src=r6 offset=34 imm=0 #line 63 "sample/encap_reflect_packet.c" - r4 = *(uint8_t*)(uintptr_t)(r7 + OFFSET(34)); - // EBPF_OP_LSH64_IMM pc=76 dst=r4 src=r0 offset=0 imm=2 + r5 = *(uint8_t*)(uintptr_t)(r6 + OFFSET(34)); + // EBPF_OP_LSH64_IMM pc=76 dst=r5 src=r0 offset=0 imm=2 #line 63 "sample/encap_reflect_packet.c" - r4 <<= (IMMEDIATE(2) & 63); - // EBPF_OP_AND64_IMM pc=77 dst=r4 src=r0 offset=0 imm=60 + r5 <<= (IMMEDIATE(2) & 63); + // EBPF_OP_AND64_IMM pc=77 dst=r5 src=r0 offset=0 imm=60 #line 63 "sample/encap_reflect_packet.c" - r4 &= IMMEDIATE(60); - // EBPF_OP_MOV64_REG pc=78 dst=r2 src=r1 offset=0 imm=0 + r5 &= IMMEDIATE(60); + // EBPF_OP_MOV64_REG pc=78 dst=r4 src=r1 offset=0 imm=0 #line 63 "sample/encap_reflect_packet.c" - r2 = r1; - // EBPF_OP_ADD64_REG pc=79 dst=r2 src=r4 offset=0 imm=0 + r4 = r1; + // EBPF_OP_ADD64_REG pc=79 dst=r4 src=r5 offset=0 imm=0 #line 63 "sample/encap_reflect_packet.c" - r2 += r4; - // EBPF_OP_MOV64_REG pc=80 dst=r4 src=r2 offset=0 imm=0 + r4 += r5; + // EBPF_OP_MOV64_REG pc=80 dst=r5 src=r4 offset=0 imm=0 #line 64 "sample/encap_reflect_packet.c" - r4 = r2; - // EBPF_OP_ADD64_IMM pc=81 dst=r4 src=r0 offset=0 imm=8 + r5 = r4; + // EBPF_OP_ADD64_IMM pc=81 dst=r5 src=r0 offset=0 imm=8 #line 64 "sample/encap_reflect_packet.c" - r4 += IMMEDIATE(8); - // EBPF_OP_LDXDW pc=82 dst=r5 src=r6 offset=8 imm=0 + r5 += IMMEDIATE(8); + // EBPF_OP_LDXDW pc=82 dst=r2 src=r2 offset=8 imm=0 #line 64 "sample/encap_reflect_packet.c" - r5 = *(uint64_t*)(uintptr_t)(r6 + OFFSET(8)); - // EBPF_OP_JGT_REG pc=83 dst=r4 src=r5 offset=237 imm=0 + r2 = *(uint64_t*)(uintptr_t)(r2 + OFFSET(8)); + // EBPF_OP_JGT_REG pc=83 dst=r5 src=r2 offset=237 imm=0 #line 64 "sample/encap_reflect_packet.c" - if (r4 > r5) { + if (r5 > r2) { #line 64 "sample/encap_reflect_packet.c" goto label_5; #line 64 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=84 dst=r4 src=r2 offset=2 imm=0 + // EBPF_OP_LDXH pc=84 dst=r2 src=r4 offset=2 imm=0 #line 68 "sample/encap_reflect_packet.c" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_JNE_IMM pc=85 dst=r4 src=r0 offset=4 imm=7459 + r2 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)); + // EBPF_OP_JNE_IMM pc=85 dst=r2 src=r0 offset=4 imm=7459 #line 68 "sample/encap_reflect_packet.c" - if (r4 != IMMEDIATE(7459)) { + if (r2 != IMMEDIATE(7459)) { #line 68 "sample/encap_reflect_packet.c" goto label_1; #line 68 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=86 dst=r4 src=r2 offset=0 imm=0 + // EBPF_OP_LDXH pc=86 dst=r2 src=r4 offset=0 imm=0 #line 41 "sample/./xdp_common.h" - r4 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_STXH pc=87 dst=r2 src=r4 offset=2 imm=0 + r2 = *(uint16_t*)(uintptr_t)(r4 + OFFSET(0)); + // EBPF_OP_STXH pc=87 dst=r4 src=r2 offset=2 imm=0 #line 43 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r2 + OFFSET(2)) = (uint16_t)r4; - // EBPF_OP_MOV64_IMM pc=88 dst=r4 src=r0 offset=0 imm=7459 + *(uint16_t*)(uintptr_t)(r4 + OFFSET(2)) = (uint16_t)r2; + // EBPF_OP_MOV64_IMM pc=88 dst=r2 src=r0 offset=0 imm=7459 #line 43 "sample/./xdp_common.h" - r4 = IMMEDIATE(7459); - // EBPF_OP_STXH pc=89 dst=r2 src=r4 offset=0 imm=0 + r2 = IMMEDIATE(7459); + // EBPF_OP_STXH pc=89 dst=r4 src=r2 offset=0 imm=0 #line 42 "sample/./xdp_common.h" - *(uint16_t*)(uintptr_t)(r2 + OFFSET(0)) = (uint16_t)r4; + *(uint16_t*)(uintptr_t)(r4 + OFFSET(0)) = (uint16_t)r2; label_1: // EBPF_OP_LDXW pc=90 dst=r2 src=r1 offset=16 imm=0 #line 73 "sample/encap_reflect_packet.c" @@ -588,24 +588,24 @@ encap_reflect_packet(void* context) // EBPF_OP_MOV64_IMM pc=100 dst=r1 src=r0 offset=0 imm=4 #line 73 "sample/encap_reflect_packet.c" r1 = IMMEDIATE(4); - // EBPF_OP_STXB pc=101 dst=r7 src=r1 offset=23 imm=0 + // EBPF_OP_STXB pc=101 dst=r6 src=r1 offset=23 imm=0 #line 76 "sample/encap_reflect_packet.c" - *(uint8_t*)(uintptr_t)(r7 + OFFSET(23)) = (uint8_t)r1; - // EBPF_OP_LDXB pc=102 dst=r1 src=r7 offset=14 imm=0 + *(uint8_t*)(uintptr_t)(r6 + OFFSET(23)) = (uint8_t)r1; + // EBPF_OP_LDXB pc=102 dst=r1 src=r6 offset=14 imm=0 #line 77 "sample/encap_reflect_packet.c" - r1 = *(uint8_t*)(uintptr_t)(r7 + OFFSET(14)); + r1 = *(uint8_t*)(uintptr_t)(r6 + OFFSET(14)); // EBPF_OP_AND64_IMM pc=103 dst=r1 src=r0 offset=0 imm=240 #line 77 "sample/encap_reflect_packet.c" r1 &= IMMEDIATE(240); // EBPF_OP_OR64_IMM pc=104 dst=r1 src=r0 offset=0 imm=5 #line 77 "sample/encap_reflect_packet.c" r1 |= IMMEDIATE(5); - // EBPF_OP_STXB pc=105 dst=r7 src=r1 offset=14 imm=0 + // EBPF_OP_STXB pc=105 dst=r6 src=r1 offset=14 imm=0 #line 77 "sample/encap_reflect_packet.c" - *(uint8_t*)(uintptr_t)(r7 + OFFSET(14)) = (uint8_t)r1; - // EBPF_OP_LDXH pc=106 dst=r1 src=r7 offset=36 imm=0 + *(uint8_t*)(uintptr_t)(r6 + OFFSET(14)) = (uint8_t)r1; + // EBPF_OP_LDXH pc=106 dst=r1 src=r6 offset=36 imm=0 #line 78 "sample/encap_reflect_packet.c" - r1 = *(uint16_t*)(uintptr_t)(r7 + OFFSET(36)); + r1 = *(uint16_t*)(uintptr_t)(r6 + OFFSET(36)); // EBPF_OP_BE pc=107 dst=r1 src=r0 offset=0 imm=16 #line 78 "sample/encap_reflect_packet.c" r1 = htobe16((uint16_t)r1); @@ -619,15 +619,15 @@ encap_reflect_packet(void* context) r1 = htobe16((uint16_t)r1); #line 78 "sample/encap_reflect_packet.c" r1 &= UINT32_MAX; - // EBPF_OP_STXH pc=110 dst=r7 src=r1 offset=16 imm=0 + // EBPF_OP_STXH pc=110 dst=r6 src=r1 offset=16 imm=0 #line 78 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(16)) = (uint16_t)r1; + *(uint16_t*)(uintptr_t)(r6 + OFFSET(16)) = (uint16_t)r1; // EBPF_OP_MOV64_IMM pc=111 dst=r1 src=r0 offset=0 imm=0 #line 78 "sample/encap_reflect_packet.c" r1 = IMMEDIATE(0); - // EBPF_OP_STXH pc=112 dst=r7 src=r1 offset=24 imm=0 + // EBPF_OP_STXH pc=112 dst=r6 src=r1 offset=24 imm=0 #line 80 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(24)) = (uint16_t)r1; + *(uint16_t*)(uintptr_t)(r6 + OFFSET(24)) = (uint16_t)r1; // EBPF_OP_MOV64_IMM pc=113 dst=r2 src=r0 offset=0 imm=0 #line 82 "sample/encap_reflect_packet.c" r2 = IMMEDIATE(0); @@ -673,62 +673,62 @@ encap_reflect_packet(void* context) // EBPF_OP_XOR64_IMM pc=125 dst=r1 src=r0 offset=0 imm=-1 #line 82 "sample/encap_reflect_packet.c" r1 ^= IMMEDIATE(-1); - // EBPF_OP_STXH pc=126 dst=r7 src=r1 offset=24 imm=0 + // EBPF_OP_STXH pc=126 dst=r6 src=r1 offset=24 imm=0 #line 81 "sample/encap_reflect_packet.c" - *(uint16_t*)(uintptr_t)(r7 + OFFSET(24)) = (uint16_t)r1; + *(uint16_t*)(uintptr_t)(r6 + OFFSET(24)) = (uint16_t)r1; // EBPF_OP_JA pc=127 dst=r0 src=r0 offset=192 imm=0 #line 81 "sample/encap_reflect_packet.c" goto label_4; label_2: - // EBPF_OP_MOV64_REG pc=128 dst=r3 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=128 dst=r4 src=r3 offset=0 imm=0 #line 196 "sample/encap_reflect_packet.c" - r3 = r2; - // EBPF_OP_ADD64_IMM pc=129 dst=r3 src=r0 offset=0 imm=54 + r4 = r3; + // EBPF_OP_ADD64_IMM pc=129 dst=r4 src=r0 offset=0 imm=54 #line 196 "sample/encap_reflect_packet.c" - r3 += IMMEDIATE(54); - // EBPF_OP_JGT_REG pc=130 dst=r3 src=r1 offset=190 imm=0 + r4 += IMMEDIATE(54); + // EBPF_OP_JGT_REG pc=130 dst=r4 src=r2 offset=190 imm=0 #line 196 "sample/encap_reflect_packet.c" - if (r3 > r1) { + if (r4 > r2) { #line 196 "sample/encap_reflect_packet.c" goto label_5; #line 196 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXB pc=131 dst=r3 src=r2 offset=20 imm=0 + // EBPF_OP_LDXB pc=131 dst=r4 src=r3 offset=20 imm=0 #line 202 "sample/encap_reflect_packet.c" - r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(20)); - // EBPF_OP_JNE_IMM pc=132 dst=r3 src=r0 offset=188 imm=17 + r4 = *(uint8_t*)(uintptr_t)(r3 + OFFSET(20)); + // EBPF_OP_JNE_IMM pc=132 dst=r4 src=r0 offset=188 imm=17 #line 202 "sample/encap_reflect_packet.c" - if (r3 != IMMEDIATE(17)) { + if (r4 != IMMEDIATE(17)) { #line 202 "sample/encap_reflect_packet.c" goto label_5; #line 202 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=133 dst=r3 src=r2 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=133 dst=r4 src=r3 offset=0 imm=0 #line 202 "sample/encap_reflect_packet.c" - r3 = r2; - // EBPF_OP_ADD64_IMM pc=134 dst=r3 src=r0 offset=0 imm=62 + r4 = r3; + // EBPF_OP_ADD64_IMM pc=134 dst=r4 src=r0 offset=0 imm=62 #line 202 "sample/encap_reflect_packet.c" - r3 += IMMEDIATE(62); - // EBPF_OP_JGT_REG pc=135 dst=r3 src=r1 offset=185 imm=0 + r4 += IMMEDIATE(62); + // EBPF_OP_JGT_REG pc=135 dst=r4 src=r2 offset=185 imm=0 #line 202 "sample/encap_reflect_packet.c" - if (r3 > r1) { + if (r4 > r2) { #line 202 "sample/encap_reflect_packet.c" goto label_5; #line 202 "sample/encap_reflect_packet.c" } - // EBPF_OP_LDXH pc=136 dst=r1 src=r2 offset=56 imm=0 + // EBPF_OP_LDXH pc=136 dst=r2 src=r3 offset=56 imm=0 #line 208 "sample/encap_reflect_packet.c" - r1 = *(uint16_t*)(uintptr_t)(r2 + OFFSET(56)); - // EBPF_OP_JNE_IMM pc=137 dst=r1 src=r0 offset=183 imm=7459 + r2 = *(uint16_t*)(uintptr_t)(r3 + OFFSET(56)); + // EBPF_OP_JNE_IMM pc=137 dst=r2 src=r0 offset=183 imm=7459 #line 208 "sample/encap_reflect_packet.c" - if (r1 != IMMEDIATE(7459)) { + if (r2 != IMMEDIATE(7459)) { #line 208 "sample/encap_reflect_packet.c" goto label_5; #line 208 "sample/encap_reflect_packet.c" } - // EBPF_OP_MOV64_REG pc=138 dst=r1 src=r6 offset=0 imm=0 -#line 96 "sample/encap_reflect_packet.c" - r1 = r6; + // EBPF_OP_MOV64_REG pc=138 dst=r6 src=r1 offset=0 imm=0 +#line 208 "sample/encap_reflect_packet.c" + r6 = r1; // EBPF_OP_LDDW pc=139 dst=r2 src=r0 offset=0 imm=-40 #line 96 "sample/encap_reflect_packet.c" r2 = (uint64_t)4294967256; @@ -796,17 +796,17 @@ encap_reflect_packet(void* context) #line 109 "sample/encap_reflect_packet.c" } // EBPF_OP_MOV64_REG pc=156 dst=r3 src=r1 offset=0 imm=0 -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" r3 = r1; // EBPF_OP_ADD64_IMM pc=157 dst=r3 src=r0 offset=0 imm=54 -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" r3 += IMMEDIATE(54); // EBPF_OP_JGT_REG pc=158 dst=r3 src=r5 offset=162 imm=0 -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" if (r3 > r5) { -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" goto label_5; -#line 117 "sample/encap_reflect_packet.c" +#line 109 "sample/encap_reflect_packet.c" } // EBPF_OP_MOV64_REG pc=159 dst=r7 src=r1 offset=0 imm=0 #line 124 "sample/encap_reflect_packet.c" diff --git a/tests/bpf2c_tests/expected/inner_map_dll.c b/tests/bpf2c_tests/expected/inner_map_dll.c index 0165196747..b4af5404e7 100644 --- a/tests/bpf2c_tests/expected/inner_map_dll.c +++ b/tests/bpf2c_tests/expected/inner_map_dll.c @@ -175,11 +175,11 @@ lookup_update(void* context) // EBPF_OP_MOV64_REG pc=8 dst=r6 src=r0 offset=0 imm=0 #line 60 "sample/undocked/inner_map.c" r6 = r0; - // EBPF_OP_JEQ_IMM pc=9 dst=r6 src=r0 offset=9 imm=0 + // EBPF_OP_JEQ_IMM pc=9 dst=r6 src=r0 offset=10 imm=0 #line 61 "sample/undocked/inner_map.c" if (r6 == IMMEDIATE(0)) { #line 61 "sample/undocked/inner_map.c" - goto label_1; + goto label_3; #line 61 "sample/undocked/inner_map.c" } // EBPF_OP_STXW pc=10 dst=r10 src=r7 offset=-12 imm=0 @@ -203,33 +203,38 @@ lookup_update(void* context) return 0; #line 63 "sample/undocked/inner_map.c" } - // EBPF_OP_JEQ_IMM pc=15 dst=r0 src=r0 offset=3 imm=0 + // EBPF_OP_JEQ_IMM pc=15 dst=r0 src=r0 offset=4 imm=0 #line 64 "sample/undocked/inner_map.c" if (r0 == IMMEDIATE(0)) { #line 64 "sample/undocked/inner_map.c" - goto label_1; + goto label_3; #line 64 "sample/undocked/inner_map.c" } +label_1: // EBPF_OP_MOV64_IMM pc=16 dst=r1 src=r0 offset=0 imm=1 #line 64 "sample/undocked/inner_map.c" r1 = IMMEDIATE(1); // EBPF_OP_STXW pc=17 dst=r0 src=r1 offset=0 imm=0 -#line 66 "sample/undocked/inner_map.c" +#line 64 "sample/undocked/inner_map.c" *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_JA pc=18 dst=r0 src=r0 offset=17 imm=0 -#line 66 "sample/undocked/inner_map.c" - goto label_2; -label_1: - // EBPF_OP_MOV64_REG pc=19 dst=r2 src=r10 offset=0 imm=0 -#line 66 "sample/undocked/inner_map.c" + // EBPF_OP_MOV64_IMM pc=18 dst=r0 src=r0 offset=0 imm=0 +#line 64 "sample/undocked/inner_map.c" + r0 = IMMEDIATE(0); +label_2: + // EBPF_OP_EXIT pc=19 dst=r0 src=r0 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" + return r0; +label_3: + // EBPF_OP_MOV64_REG pc=20 dst=r2 src=r10 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=20 dst=r2 src=r0 offset=0 imm=-6 + // EBPF_OP_ADD64_IMM pc=21 dst=r2 src=r0 offset=0 imm=-6 #line 72 "sample/undocked/inner_map.c" r2 += IMMEDIATE(-6); - // EBPF_OP_LDDW pc=21 dst=r1 src=r1 offset=0 imm=4 + // EBPF_OP_LDDW pc=22 dst=r1 src=r1 offset=0 imm=4 #line 72 "sample/undocked/inner_map.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_CALL pc=23 dst=r0 src=r0 offset=0 imm=1 + // EBPF_OP_CALL pc=24 dst=r0 src=r0 offset=0 imm=1 #line 72 "sample/undocked/inner_map.c" r0 = lookup_update_helpers[0].address(r1, r2, r3, r4, r5, context); #line 72 "sample/undocked/inner_map.c" @@ -238,32 +243,35 @@ lookup_update(void* context) return 0; #line 72 "sample/undocked/inner_map.c" } - // EBPF_OP_MOV64_IMM pc=24 dst=r7 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_REG pc=25 dst=r1 src=r0 offset=0 imm=0 #line 72 "sample/undocked/inner_map.c" - r7 = IMMEDIATE(1); - // EBPF_OP_JEQ_IMM pc=25 dst=r0 src=r0 offset=10 imm=0 + r1 = r0; + // EBPF_OP_MOV64_IMM pc=26 dst=r0 src=r0 offset=0 imm=1 +#line 72 "sample/undocked/inner_map.c" + r0 = IMMEDIATE(1); + // EBPF_OP_JEQ_IMM pc=27 dst=r1 src=r0 offset=-9 imm=0 #line 73 "sample/undocked/inner_map.c" - if (r0 == IMMEDIATE(0)) { + if (r1 == IMMEDIATE(0)) { #line 73 "sample/undocked/inner_map.c" goto label_2; #line 73 "sample/undocked/inner_map.c" } - // EBPF_OP_MOV64_IMM pc=26 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=28 dst=r1 src=r0 offset=0 imm=0 #line 73 "sample/undocked/inner_map.c" r1 = IMMEDIATE(0); - // EBPF_OP_STXW pc=27 dst=r10 src=r1 offset=-16 imm=0 + // EBPF_OP_STXW pc=29 dst=r10 src=r1 offset=-16 imm=0 #line 74 "sample/undocked/inner_map.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint32_t)r1; - // EBPF_OP_MOV64_REG pc=28 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=30 dst=r2 src=r10 offset=0 imm=0 #line 74 "sample/undocked/inner_map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=29 dst=r2 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=31 dst=r2 src=r0 offset=0 imm=-16 #line 74 "sample/undocked/inner_map.c" r2 += IMMEDIATE(-16); - // EBPF_OP_MOV64_REG pc=30 dst=r1 src=r6 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=32 dst=r1 src=r6 offset=0 imm=0 #line 75 "sample/undocked/inner_map.c" r1 = r6; - // EBPF_OP_CALL pc=31 dst=r0 src=r0 offset=0 imm=1 + // EBPF_OP_CALL pc=33 dst=r0 src=r0 offset=0 imm=1 #line 75 "sample/undocked/inner_map.c" r0 = lookup_update_helpers[0].address(r1, r2, r3, r4, r5, context); #line 75 "sample/undocked/inner_map.c" @@ -272,29 +280,23 @@ lookup_update(void* context) return 0; #line 75 "sample/undocked/inner_map.c" } - // EBPF_OP_JEQ_IMM pc=32 dst=r0 src=r0 offset=3 imm=0 + // EBPF_OP_JEQ_IMM pc=34 dst=r0 src=r0 offset=1 imm=0 #line 76 "sample/undocked/inner_map.c" if (r0 == IMMEDIATE(0)) { #line 76 "sample/undocked/inner_map.c" - goto label_2; + goto label_4; #line 76 "sample/undocked/inner_map.c" } - // EBPF_OP_MOV64_IMM pc=33 dst=r1 src=r0 offset=0 imm=1 + // EBPF_OP_JA pc=35 dst=r0 src=r0 offset=-20 imm=0 #line 76 "sample/undocked/inner_map.c" - r1 = IMMEDIATE(1); - // EBPF_OP_STXW pc=34 dst=r0 src=r1 offset=0 imm=0 -#line 78 "sample/undocked/inner_map.c" - *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_MOV64_IMM pc=35 dst=r7 src=r0 offset=0 imm=0 -#line 78 "sample/undocked/inner_map.c" - r7 = IMMEDIATE(0); -label_2: - // EBPF_OP_MOV64_REG pc=36 dst=r0 src=r7 offset=0 imm=0 -#line 84 "sample/undocked/inner_map.c" - r0 = r7; - // EBPF_OP_EXIT pc=37 dst=r0 src=r0 offset=0 imm=0 -#line 84 "sample/undocked/inner_map.c" - return r0; + goto label_1; +label_4: + // EBPF_OP_MOV64_IMM pc=36 dst=r0 src=r0 offset=0 imm=1 +#line 76 "sample/undocked/inner_map.c" + r0 = IMMEDIATE(1); + // EBPF_OP_JA pc=37 dst=r0 src=r0 offset=-19 imm=0 +#line 76 "sample/undocked/inner_map.c" + goto label_2; #line 52 "sample/undocked/inner_map.c" } #pragma code_seg(pop) diff --git a/tests/bpf2c_tests/expected/inner_map_raw.c b/tests/bpf2c_tests/expected/inner_map_raw.c index 7c28366af9..a2f19497d6 100644 --- a/tests/bpf2c_tests/expected/inner_map_raw.c +++ b/tests/bpf2c_tests/expected/inner_map_raw.c @@ -149,11 +149,11 @@ lookup_update(void* context) // EBPF_OP_MOV64_REG pc=8 dst=r6 src=r0 offset=0 imm=0 #line 60 "sample/undocked/inner_map.c" r6 = r0; - // EBPF_OP_JEQ_IMM pc=9 dst=r6 src=r0 offset=9 imm=0 + // EBPF_OP_JEQ_IMM pc=9 dst=r6 src=r0 offset=10 imm=0 #line 61 "sample/undocked/inner_map.c" if (r6 == IMMEDIATE(0)) { #line 61 "sample/undocked/inner_map.c" - goto label_1; + goto label_3; #line 61 "sample/undocked/inner_map.c" } // EBPF_OP_STXW pc=10 dst=r10 src=r7 offset=-12 imm=0 @@ -177,33 +177,38 @@ lookup_update(void* context) return 0; #line 63 "sample/undocked/inner_map.c" } - // EBPF_OP_JEQ_IMM pc=15 dst=r0 src=r0 offset=3 imm=0 + // EBPF_OP_JEQ_IMM pc=15 dst=r0 src=r0 offset=4 imm=0 #line 64 "sample/undocked/inner_map.c" if (r0 == IMMEDIATE(0)) { #line 64 "sample/undocked/inner_map.c" - goto label_1; + goto label_3; #line 64 "sample/undocked/inner_map.c" } +label_1: // EBPF_OP_MOV64_IMM pc=16 dst=r1 src=r0 offset=0 imm=1 #line 64 "sample/undocked/inner_map.c" r1 = IMMEDIATE(1); // EBPF_OP_STXW pc=17 dst=r0 src=r1 offset=0 imm=0 -#line 66 "sample/undocked/inner_map.c" +#line 64 "sample/undocked/inner_map.c" *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_JA pc=18 dst=r0 src=r0 offset=17 imm=0 -#line 66 "sample/undocked/inner_map.c" - goto label_2; -label_1: - // EBPF_OP_MOV64_REG pc=19 dst=r2 src=r10 offset=0 imm=0 -#line 66 "sample/undocked/inner_map.c" + // EBPF_OP_MOV64_IMM pc=18 dst=r0 src=r0 offset=0 imm=0 +#line 64 "sample/undocked/inner_map.c" + r0 = IMMEDIATE(0); +label_2: + // EBPF_OP_EXIT pc=19 dst=r0 src=r0 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" + return r0; +label_3: + // EBPF_OP_MOV64_REG pc=20 dst=r2 src=r10 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=20 dst=r2 src=r0 offset=0 imm=-6 + // EBPF_OP_ADD64_IMM pc=21 dst=r2 src=r0 offset=0 imm=-6 #line 72 "sample/undocked/inner_map.c" r2 += IMMEDIATE(-6); - // EBPF_OP_LDDW pc=21 dst=r1 src=r1 offset=0 imm=4 + // EBPF_OP_LDDW pc=22 dst=r1 src=r1 offset=0 imm=4 #line 72 "sample/undocked/inner_map.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_CALL pc=23 dst=r0 src=r0 offset=0 imm=1 + // EBPF_OP_CALL pc=24 dst=r0 src=r0 offset=0 imm=1 #line 72 "sample/undocked/inner_map.c" r0 = lookup_update_helpers[0].address(r1, r2, r3, r4, r5, context); #line 72 "sample/undocked/inner_map.c" @@ -212,32 +217,35 @@ lookup_update(void* context) return 0; #line 72 "sample/undocked/inner_map.c" } - // EBPF_OP_MOV64_IMM pc=24 dst=r7 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_REG pc=25 dst=r1 src=r0 offset=0 imm=0 #line 72 "sample/undocked/inner_map.c" - r7 = IMMEDIATE(1); - // EBPF_OP_JEQ_IMM pc=25 dst=r0 src=r0 offset=10 imm=0 + r1 = r0; + // EBPF_OP_MOV64_IMM pc=26 dst=r0 src=r0 offset=0 imm=1 +#line 72 "sample/undocked/inner_map.c" + r0 = IMMEDIATE(1); + // EBPF_OP_JEQ_IMM pc=27 dst=r1 src=r0 offset=-9 imm=0 #line 73 "sample/undocked/inner_map.c" - if (r0 == IMMEDIATE(0)) { + if (r1 == IMMEDIATE(0)) { #line 73 "sample/undocked/inner_map.c" goto label_2; #line 73 "sample/undocked/inner_map.c" } - // EBPF_OP_MOV64_IMM pc=26 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=28 dst=r1 src=r0 offset=0 imm=0 #line 73 "sample/undocked/inner_map.c" r1 = IMMEDIATE(0); - // EBPF_OP_STXW pc=27 dst=r10 src=r1 offset=-16 imm=0 + // EBPF_OP_STXW pc=29 dst=r10 src=r1 offset=-16 imm=0 #line 74 "sample/undocked/inner_map.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint32_t)r1; - // EBPF_OP_MOV64_REG pc=28 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=30 dst=r2 src=r10 offset=0 imm=0 #line 74 "sample/undocked/inner_map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=29 dst=r2 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=31 dst=r2 src=r0 offset=0 imm=-16 #line 74 "sample/undocked/inner_map.c" r2 += IMMEDIATE(-16); - // EBPF_OP_MOV64_REG pc=30 dst=r1 src=r6 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=32 dst=r1 src=r6 offset=0 imm=0 #line 75 "sample/undocked/inner_map.c" r1 = r6; - // EBPF_OP_CALL pc=31 dst=r0 src=r0 offset=0 imm=1 + // EBPF_OP_CALL pc=33 dst=r0 src=r0 offset=0 imm=1 #line 75 "sample/undocked/inner_map.c" r0 = lookup_update_helpers[0].address(r1, r2, r3, r4, r5, context); #line 75 "sample/undocked/inner_map.c" @@ -246,29 +254,23 @@ lookup_update(void* context) return 0; #line 75 "sample/undocked/inner_map.c" } - // EBPF_OP_JEQ_IMM pc=32 dst=r0 src=r0 offset=3 imm=0 + // EBPF_OP_JEQ_IMM pc=34 dst=r0 src=r0 offset=1 imm=0 #line 76 "sample/undocked/inner_map.c" if (r0 == IMMEDIATE(0)) { #line 76 "sample/undocked/inner_map.c" - goto label_2; + goto label_4; #line 76 "sample/undocked/inner_map.c" } - // EBPF_OP_MOV64_IMM pc=33 dst=r1 src=r0 offset=0 imm=1 + // EBPF_OP_JA pc=35 dst=r0 src=r0 offset=-20 imm=0 #line 76 "sample/undocked/inner_map.c" - r1 = IMMEDIATE(1); - // EBPF_OP_STXW pc=34 dst=r0 src=r1 offset=0 imm=0 -#line 78 "sample/undocked/inner_map.c" - *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_MOV64_IMM pc=35 dst=r7 src=r0 offset=0 imm=0 -#line 78 "sample/undocked/inner_map.c" - r7 = IMMEDIATE(0); -label_2: - // EBPF_OP_MOV64_REG pc=36 dst=r0 src=r7 offset=0 imm=0 -#line 84 "sample/undocked/inner_map.c" - r0 = r7; - // EBPF_OP_EXIT pc=37 dst=r0 src=r0 offset=0 imm=0 -#line 84 "sample/undocked/inner_map.c" - return r0; + goto label_1; +label_4: + // EBPF_OP_MOV64_IMM pc=36 dst=r0 src=r0 offset=0 imm=1 +#line 76 "sample/undocked/inner_map.c" + r0 = IMMEDIATE(1); + // EBPF_OP_JA pc=37 dst=r0 src=r0 offset=-19 imm=0 +#line 76 "sample/undocked/inner_map.c" + goto label_2; #line 52 "sample/undocked/inner_map.c" } #pragma code_seg(pop) diff --git a/tests/bpf2c_tests/expected/inner_map_sys.c b/tests/bpf2c_tests/expected/inner_map_sys.c index 352388bd92..6378cf34c6 100644 --- a/tests/bpf2c_tests/expected/inner_map_sys.c +++ b/tests/bpf2c_tests/expected/inner_map_sys.c @@ -310,11 +310,11 @@ lookup_update(void* context) // EBPF_OP_MOV64_REG pc=8 dst=r6 src=r0 offset=0 imm=0 #line 60 "sample/undocked/inner_map.c" r6 = r0; - // EBPF_OP_JEQ_IMM pc=9 dst=r6 src=r0 offset=9 imm=0 + // EBPF_OP_JEQ_IMM pc=9 dst=r6 src=r0 offset=10 imm=0 #line 61 "sample/undocked/inner_map.c" if (r6 == IMMEDIATE(0)) { #line 61 "sample/undocked/inner_map.c" - goto label_1; + goto label_3; #line 61 "sample/undocked/inner_map.c" } // EBPF_OP_STXW pc=10 dst=r10 src=r7 offset=-12 imm=0 @@ -338,33 +338,38 @@ lookup_update(void* context) return 0; #line 63 "sample/undocked/inner_map.c" } - // EBPF_OP_JEQ_IMM pc=15 dst=r0 src=r0 offset=3 imm=0 + // EBPF_OP_JEQ_IMM pc=15 dst=r0 src=r0 offset=4 imm=0 #line 64 "sample/undocked/inner_map.c" if (r0 == IMMEDIATE(0)) { #line 64 "sample/undocked/inner_map.c" - goto label_1; + goto label_3; #line 64 "sample/undocked/inner_map.c" } +label_1: // EBPF_OP_MOV64_IMM pc=16 dst=r1 src=r0 offset=0 imm=1 #line 64 "sample/undocked/inner_map.c" r1 = IMMEDIATE(1); // EBPF_OP_STXW pc=17 dst=r0 src=r1 offset=0 imm=0 -#line 66 "sample/undocked/inner_map.c" +#line 64 "sample/undocked/inner_map.c" *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_JA pc=18 dst=r0 src=r0 offset=17 imm=0 -#line 66 "sample/undocked/inner_map.c" - goto label_2; -label_1: - // EBPF_OP_MOV64_REG pc=19 dst=r2 src=r10 offset=0 imm=0 -#line 66 "sample/undocked/inner_map.c" + // EBPF_OP_MOV64_IMM pc=18 dst=r0 src=r0 offset=0 imm=0 +#line 64 "sample/undocked/inner_map.c" + r0 = IMMEDIATE(0); +label_2: + // EBPF_OP_EXIT pc=19 dst=r0 src=r0 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" + return r0; +label_3: + // EBPF_OP_MOV64_REG pc=20 dst=r2 src=r10 offset=0 imm=0 +#line 84 "sample/undocked/inner_map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=20 dst=r2 src=r0 offset=0 imm=-6 + // EBPF_OP_ADD64_IMM pc=21 dst=r2 src=r0 offset=0 imm=-6 #line 72 "sample/undocked/inner_map.c" r2 += IMMEDIATE(-6); - // EBPF_OP_LDDW pc=21 dst=r1 src=r1 offset=0 imm=4 + // EBPF_OP_LDDW pc=22 dst=r1 src=r1 offset=0 imm=4 #line 72 "sample/undocked/inner_map.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_CALL pc=23 dst=r0 src=r0 offset=0 imm=1 + // EBPF_OP_CALL pc=24 dst=r0 src=r0 offset=0 imm=1 #line 72 "sample/undocked/inner_map.c" r0 = lookup_update_helpers[0].address(r1, r2, r3, r4, r5, context); #line 72 "sample/undocked/inner_map.c" @@ -373,32 +378,35 @@ lookup_update(void* context) return 0; #line 72 "sample/undocked/inner_map.c" } - // EBPF_OP_MOV64_IMM pc=24 dst=r7 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_REG pc=25 dst=r1 src=r0 offset=0 imm=0 #line 72 "sample/undocked/inner_map.c" - r7 = IMMEDIATE(1); - // EBPF_OP_JEQ_IMM pc=25 dst=r0 src=r0 offset=10 imm=0 + r1 = r0; + // EBPF_OP_MOV64_IMM pc=26 dst=r0 src=r0 offset=0 imm=1 +#line 72 "sample/undocked/inner_map.c" + r0 = IMMEDIATE(1); + // EBPF_OP_JEQ_IMM pc=27 dst=r1 src=r0 offset=-9 imm=0 #line 73 "sample/undocked/inner_map.c" - if (r0 == IMMEDIATE(0)) { + if (r1 == IMMEDIATE(0)) { #line 73 "sample/undocked/inner_map.c" goto label_2; #line 73 "sample/undocked/inner_map.c" } - // EBPF_OP_MOV64_IMM pc=26 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=28 dst=r1 src=r0 offset=0 imm=0 #line 73 "sample/undocked/inner_map.c" r1 = IMMEDIATE(0); - // EBPF_OP_STXW pc=27 dst=r10 src=r1 offset=-16 imm=0 + // EBPF_OP_STXW pc=29 dst=r10 src=r1 offset=-16 imm=0 #line 74 "sample/undocked/inner_map.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint32_t)r1; - // EBPF_OP_MOV64_REG pc=28 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=30 dst=r2 src=r10 offset=0 imm=0 #line 74 "sample/undocked/inner_map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=29 dst=r2 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=31 dst=r2 src=r0 offset=0 imm=-16 #line 74 "sample/undocked/inner_map.c" r2 += IMMEDIATE(-16); - // EBPF_OP_MOV64_REG pc=30 dst=r1 src=r6 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=32 dst=r1 src=r6 offset=0 imm=0 #line 75 "sample/undocked/inner_map.c" r1 = r6; - // EBPF_OP_CALL pc=31 dst=r0 src=r0 offset=0 imm=1 + // EBPF_OP_CALL pc=33 dst=r0 src=r0 offset=0 imm=1 #line 75 "sample/undocked/inner_map.c" r0 = lookup_update_helpers[0].address(r1, r2, r3, r4, r5, context); #line 75 "sample/undocked/inner_map.c" @@ -407,29 +415,23 @@ lookup_update(void* context) return 0; #line 75 "sample/undocked/inner_map.c" } - // EBPF_OP_JEQ_IMM pc=32 dst=r0 src=r0 offset=3 imm=0 + // EBPF_OP_JEQ_IMM pc=34 dst=r0 src=r0 offset=1 imm=0 #line 76 "sample/undocked/inner_map.c" if (r0 == IMMEDIATE(0)) { #line 76 "sample/undocked/inner_map.c" - goto label_2; + goto label_4; #line 76 "sample/undocked/inner_map.c" } - // EBPF_OP_MOV64_IMM pc=33 dst=r1 src=r0 offset=0 imm=1 + // EBPF_OP_JA pc=35 dst=r0 src=r0 offset=-20 imm=0 #line 76 "sample/undocked/inner_map.c" - r1 = IMMEDIATE(1); - // EBPF_OP_STXW pc=34 dst=r0 src=r1 offset=0 imm=0 -#line 78 "sample/undocked/inner_map.c" - *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)) = (uint32_t)r1; - // EBPF_OP_MOV64_IMM pc=35 dst=r7 src=r0 offset=0 imm=0 -#line 78 "sample/undocked/inner_map.c" - r7 = IMMEDIATE(0); -label_2: - // EBPF_OP_MOV64_REG pc=36 dst=r0 src=r7 offset=0 imm=0 -#line 84 "sample/undocked/inner_map.c" - r0 = r7; - // EBPF_OP_EXIT pc=37 dst=r0 src=r0 offset=0 imm=0 -#line 84 "sample/undocked/inner_map.c" - return r0; + goto label_1; +label_4: + // EBPF_OP_MOV64_IMM pc=36 dst=r0 src=r0 offset=0 imm=1 +#line 76 "sample/undocked/inner_map.c" + r0 = IMMEDIATE(1); + // EBPF_OP_JA pc=37 dst=r0 src=r0 offset=-19 imm=0 +#line 76 "sample/undocked/inner_map.c" + goto label_2; #line 52 "sample/undocked/inner_map.c" } #pragma code_seg(pop) diff --git a/tests/bpf2c_tests/expected/map_dll.c b/tests/bpf2c_tests/expected/map_dll.c index cd049de8d6..dbd8626014 100644 --- a/tests/bpf2c_tests/expected/map_dll.c +++ b/tests/bpf2c_tests/expected/map_dll.c @@ -5459,11 +5459,11 @@ test_maps(void* context) // EBPF_OP_RSH64_IMM pc=1712 dst=r1 src=r0 offset=0 imm=32 #line 264 "sample/undocked/map.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JEQ_IMM pc=1713 dst=r1 src=r0 offset=27 imm=0 + // EBPF_OP_JEQ_IMM pc=1713 dst=r1 src=r0 offset=25 imm=0 #line 264 "sample/undocked/map.c" if (r1 == IMMEDIATE(0)) { #line 264 "sample/undocked/map.c" - goto label_110; + goto label_109; #line 264 "sample/undocked/map.c" } // EBPF_OP_MOV64_IMM pc=1714 dst=r1 src=r0 offset=0 imm=100 @@ -5520,101 +5520,88 @@ test_maps(void* context) // EBPF_OP_MOV64_IMM pc=1737 dst=r2 src=r0 offset=0 imm=50 #line 264 "sample/undocked/map.c" r2 = IMMEDIATE(50); -label_109: - // EBPF_OP_MOV64_IMM pc=1738 dst=r3 src=r0 offset=0 imm=0 -#line 264 "sample/undocked/map.c" - r3 = IMMEDIATE(0); - // EBPF_OP_CALL pc=1739 dst=r0 src=r0 offset=0 imm=14 -#line 264 "sample/undocked/map.c" - r0 = test_maps_helpers[7].address(r1, r2, r3, r4, r5, context); + // EBPF_OP_JA pc=1738 dst=r0 src=r0 offset=60 imm=0 #line 264 "sample/undocked/map.c" - if ((test_maps_helpers[7].tail_call) && (r0 == 0)) { -#line 264 "sample/undocked/map.c" - return 0; -#line 264 "sample/undocked/map.c" - } - // EBPF_OP_JA pc=1740 dst=r0 src=r0 offset=-429 imm=0 -#line 264 "sample/undocked/map.c" - goto label_84; -label_110: - // EBPF_OP_LDXW pc=1741 dst=r3 src=r10 offset=-4 imm=0 + goto label_112; +label_109: + // EBPF_OP_LDXW pc=1739 dst=r3 src=r10 offset=-4 imm=0 #line 264 "sample/undocked/map.c" r3 = *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)); - // EBPF_OP_JEQ_IMM pc=1742 dst=r3 src=r0 offset=22 imm=1 + // EBPF_OP_JEQ_IMM pc=1740 dst=r3 src=r0 offset=22 imm=1 #line 264 "sample/undocked/map.c" if (r3 == IMMEDIATE(1)) { #line 264 "sample/undocked/map.c" - goto label_111; + goto label_110; #line 264 "sample/undocked/map.c" } - // EBPF_OP_MOV64_IMM pc=1743 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=1741 dst=r1 src=r0 offset=0 imm=0 #line 264 "sample/undocked/map.c" r1 = IMMEDIATE(0); - // EBPF_OP_STXB pc=1744 dst=r10 src=r1 offset=-72 imm=0 + // EBPF_OP_STXB pc=1742 dst=r10 src=r1 offset=-72 imm=0 #line 264 "sample/undocked/map.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint8_t)r1; - // EBPF_OP_LDDW pc=1745 dst=r1 src=r0 offset=0 imm=1852404835 + // EBPF_OP_LDDW pc=1743 dst=r1 src=r0 offset=0 imm=1852404835 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7216209606537213027; - // EBPF_OP_STXDW pc=1747 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=1745 dst=r10 src=r1 offset=-80 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1748 dst=r1 src=r0 offset=0 imm=543434016 + // EBPF_OP_LDDW pc=1746 dst=r1 src=r0 offset=0 imm=543434016 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7309474570952779040; - // EBPF_OP_STXDW pc=1750 dst=r10 src=r1 offset=-88 imm=0 + // EBPF_OP_STXDW pc=1748 dst=r10 src=r1 offset=-88 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-88)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1751 dst=r1 src=r0 offset=0 imm=1701978221 + // EBPF_OP_LDDW pc=1749 dst=r1 src=r0 offset=0 imm=1701978221 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7958552634295722093; - // EBPF_OP_STXDW pc=1753 dst=r10 src=r1 offset=-96 imm=0 + // EBPF_OP_STXDW pc=1751 dst=r10 src=r1 offset=-96 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-96)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1754 dst=r1 src=r0 offset=0 imm=1801807216 + // EBPF_OP_LDDW pc=1752 dst=r1 src=r0 offset=0 imm=1801807216 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7308327755813578096; - // EBPF_OP_STXDW pc=1756 dst=r10 src=r1 offset=-104 imm=0 + // EBPF_OP_STXDW pc=1754 dst=r10 src=r1 offset=-104 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-104)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1757 dst=r1 src=r0 offset=0 imm=1600548962 + // EBPF_OP_LDDW pc=1755 dst=r1 src=r0 offset=0 imm=1600548962 #line 264 "sample/undocked/map.c" r1 = (uint64_t)6877103753374625890; - // EBPF_OP_STXDW pc=1759 dst=r10 src=r1 offset=-112 imm=0 + // EBPF_OP_STXDW pc=1757 dst=r10 src=r1 offset=-112 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-112)) = (uint64_t)r1; - // EBPF_OP_MOV64_REG pc=1760 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1758 dst=r1 src=r10 offset=0 imm=0 #line 264 "sample/undocked/map.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=1761 dst=r1 src=r0 offset=0 imm=-112 + // EBPF_OP_ADD64_IMM pc=1759 dst=r1 src=r0 offset=0 imm=-112 #line 264 "sample/undocked/map.c" r1 += IMMEDIATE(-112); - // EBPF_OP_MOV64_IMM pc=1762 dst=r2 src=r0 offset=0 imm=41 + // EBPF_OP_MOV64_IMM pc=1760 dst=r2 src=r0 offset=0 imm=41 #line 264 "sample/undocked/map.c" r2 = IMMEDIATE(41); - // EBPF_OP_MOV64_IMM pc=1763 dst=r4 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=1761 dst=r4 src=r0 offset=0 imm=1 #line 264 "sample/undocked/map.c" r4 = IMMEDIATE(1); - // EBPF_OP_JA pc=1764 dst=r0 src=r0 offset=-456 imm=0 + // EBPF_OP_JA pc=1762 dst=r0 src=r0 offset=-454 imm=0 #line 264 "sample/undocked/map.c" goto label_83; -label_111: - // EBPF_OP_MOV64_IMM pc=1765 dst=r7 src=r0 offset=0 imm=0 +label_110: + // EBPF_OP_MOV64_IMM pc=1763 dst=r7 src=r0 offset=0 imm=0 #line 264 "sample/undocked/map.c" r7 = IMMEDIATE(0); - // EBPF_OP_STXW pc=1766 dst=r10 src=r7 offset=-4 imm=0 + // EBPF_OP_STXW pc=1764 dst=r10 src=r7 offset=-4 imm=0 #line 272 "sample/undocked/map.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r7; - // EBPF_OP_MOV64_REG pc=1767 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1765 dst=r2 src=r10 offset=0 imm=0 #line 272 "sample/undocked/map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=1768 dst=r2 src=r0 offset=0 imm=-4 + // EBPF_OP_ADD64_IMM pc=1766 dst=r2 src=r0 offset=0 imm=-4 #line 272 "sample/undocked/map.c" r2 += IMMEDIATE(-4); - // EBPF_OP_LDDW pc=1769 dst=r1 src=r1 offset=0 imm=7 + // EBPF_OP_LDDW pc=1767 dst=r1 src=r1 offset=0 imm=7 #line 272 "sample/undocked/map.c" r1 = POINTER(_maps[6].address); - // EBPF_OP_CALL pc=1771 dst=r0 src=r0 offset=0 imm=17 + // EBPF_OP_CALL pc=1769 dst=r0 src=r0 offset=0 imm=17 #line 272 "sample/undocked/map.c" r0 = test_maps_helpers[8].address(r1, r2, r3, r4, r5, context); #line 272 "sample/undocked/map.c" @@ -5623,83 +5610,96 @@ test_maps(void* context) return 0; #line 272 "sample/undocked/map.c" } - // EBPF_OP_MOV64_REG pc=1772 dst=r6 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1770 dst=r6 src=r0 offset=0 imm=0 #line 272 "sample/undocked/map.c" r6 = r0; - // EBPF_OP_MOV64_REG pc=1773 dst=r4 src=r6 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1771 dst=r4 src=r6 offset=0 imm=0 #line 272 "sample/undocked/map.c" r4 = r6; - // EBPF_OP_LSH64_IMM pc=1774 dst=r4 src=r0 offset=0 imm=32 + // EBPF_OP_LSH64_IMM pc=1772 dst=r4 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r4 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_REG pc=1775 dst=r1 src=r4 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1773 dst=r1 src=r4 offset=0 imm=0 #line 272 "sample/undocked/map.c" r1 = r4; - // EBPF_OP_RSH64_IMM pc=1776 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=1774 dst=r1 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JEQ_IMM pc=1777 dst=r1 src=r0 offset=24 imm=0 + // EBPF_OP_JEQ_IMM pc=1775 dst=r1 src=r0 offset=26 imm=0 #line 272 "sample/undocked/map.c" if (r1 == IMMEDIATE(0)) { #line 272 "sample/undocked/map.c" goto label_113; #line 272 "sample/undocked/map.c" } -label_112: - // EBPF_OP_LDDW pc=1778 dst=r1 src=r0 offset=0 imm=1701737077 +label_111: + // EBPF_OP_LDDW pc=1776 dst=r1 src=r0 offset=0 imm=1701737077 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7216209593501643381; - // EBPF_OP_STXDW pc=1780 dst=r10 src=r1 offset=-72 imm=0 + // EBPF_OP_STXDW pc=1778 dst=r10 src=r1 offset=-72 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1781 dst=r1 src=r0 offset=0 imm=1680154740 + // EBPF_OP_LDDW pc=1779 dst=r1 src=r0 offset=0 imm=1680154740 #line 272 "sample/undocked/map.c" r1 = (uint64_t)8387235364492091508; - // EBPF_OP_STXDW pc=1783 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=1781 dst=r10 src=r1 offset=-80 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1784 dst=r1 src=r0 offset=0 imm=1914726254 + // EBPF_OP_LDDW pc=1782 dst=r1 src=r0 offset=0 imm=1914726254 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7815279607914981230; - // EBPF_OP_STXDW pc=1786 dst=r10 src=r1 offset=-88 imm=0 + // EBPF_OP_STXDW pc=1784 dst=r10 src=r1 offset=-88 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-88)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1787 dst=r1 src=r0 offset=0 imm=1886938400 + // EBPF_OP_LDDW pc=1785 dst=r1 src=r0 offset=0 imm=1886938400 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7598807758610654496; - // EBPF_OP_STXDW pc=1789 dst=r10 src=r1 offset=-96 imm=0 + // EBPF_OP_STXDW pc=1787 dst=r10 src=r1 offset=-96 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-96)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1790 dst=r1 src=r0 offset=0 imm=1601204080 + // EBPF_OP_LDDW pc=1788 dst=r1 src=r0 offset=0 imm=1601204080 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7882825905430622064; - // EBPF_OP_STXDW pc=1792 dst=r10 src=r1 offset=-104 imm=0 + // EBPF_OP_STXDW pc=1790 dst=r10 src=r1 offset=-104 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-104)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1793 dst=r1 src=r0 offset=0 imm=1600548962 + // EBPF_OP_LDDW pc=1791 dst=r1 src=r0 offset=0 imm=1600548962 #line 272 "sample/undocked/map.c" r1 = (uint64_t)6877103753374625890; - // EBPF_OP_STXDW pc=1795 dst=r10 src=r1 offset=-112 imm=0 + // EBPF_OP_STXDW pc=1793 dst=r10 src=r1 offset=-112 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-112)) = (uint64_t)r1; - // EBPF_OP_STXB pc=1796 dst=r10 src=r7 offset=-64 imm=0 + // EBPF_OP_STXB pc=1794 dst=r10 src=r7 offset=-64 imm=0 #line 272 "sample/undocked/map.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint8_t)r7; - // EBPF_OP_ARSH64_IMM pc=1797 dst=r4 src=r0 offset=0 imm=32 + // EBPF_OP_ARSH64_IMM pc=1795 dst=r4 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r4 = (int64_t)r4 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_REG pc=1798 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1796 dst=r1 src=r10 offset=0 imm=0 #line 272 "sample/undocked/map.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=1799 dst=r1 src=r0 offset=0 imm=-112 + // EBPF_OP_ADD64_IMM pc=1797 dst=r1 src=r0 offset=0 imm=-112 #line 272 "sample/undocked/map.c" r1 += IMMEDIATE(-112); - // EBPF_OP_MOV64_IMM pc=1800 dst=r2 src=r0 offset=0 imm=49 + // EBPF_OP_MOV64_IMM pc=1798 dst=r2 src=r0 offset=0 imm=49 #line 272 "sample/undocked/map.c" r2 = IMMEDIATE(49); - // EBPF_OP_JA pc=1801 dst=r0 src=r0 offset=-64 imm=0 +label_112: + // EBPF_OP_MOV64_IMM pc=1799 dst=r3 src=r0 offset=0 imm=0 +#line 272 "sample/undocked/map.c" + r3 = IMMEDIATE(0); + // EBPF_OP_CALL pc=1800 dst=r0 src=r0 offset=0 imm=14 +#line 272 "sample/undocked/map.c" + r0 = test_maps_helpers[7].address(r1, r2, r3, r4, r5, context); +#line 272 "sample/undocked/map.c" + if ((test_maps_helpers[7].tail_call) && (r0 == 0)) { +#line 272 "sample/undocked/map.c" + return 0; +#line 272 "sample/undocked/map.c" + } + // EBPF_OP_JA pc=1801 dst=r0 src=r0 offset=-490 imm=0 #line 272 "sample/undocked/map.c" - goto label_109; + goto label_84; label_113: // EBPF_OP_LDXW pc=1802 dst=r3 src=r10 offset=-4 imm=0 #line 272 "sample/undocked/map.c" @@ -5800,9 +5800,9 @@ test_maps(void* context) goto label_115; #line 273 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1836 dst=r0 src=r0 offset=-59 imm=0 + // EBPF_OP_JA pc=1836 dst=r0 src=r0 offset=-61 imm=0 #line 273 "sample/undocked/map.c" - goto label_112; + goto label_111; label_115: // EBPF_OP_LDXW pc=1837 dst=r3 src=r10 offset=-4 imm=0 #line 273 "sample/undocked/map.c" @@ -5903,9 +5903,9 @@ test_maps(void* context) goto label_117; #line 274 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1871 dst=r0 src=r0 offset=-94 imm=0 + // EBPF_OP_JA pc=1871 dst=r0 src=r0 offset=-96 imm=0 #line 274 "sample/undocked/map.c" - goto label_112; + goto label_111; label_117: // EBPF_OP_LDXW pc=1872 dst=r3 src=r10 offset=-4 imm=0 #line 274 "sample/undocked/map.c" @@ -6006,9 +6006,9 @@ test_maps(void* context) goto label_119; #line 275 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1906 dst=r0 src=r0 offset=-129 imm=0 + // EBPF_OP_JA pc=1906 dst=r0 src=r0 offset=-131 imm=0 #line 275 "sample/undocked/map.c" - goto label_112; + goto label_111; label_119: // EBPF_OP_LDXW pc=1907 dst=r3 src=r10 offset=-4 imm=0 #line 275 "sample/undocked/map.c" @@ -6109,9 +6109,9 @@ test_maps(void* context) goto label_121; #line 276 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1941 dst=r0 src=r0 offset=-164 imm=0 + // EBPF_OP_JA pc=1941 dst=r0 src=r0 offset=-166 imm=0 #line 276 "sample/undocked/map.c" - goto label_112; + goto label_111; label_121: // EBPF_OP_LDXW pc=1942 dst=r3 src=r10 offset=-4 imm=0 #line 276 "sample/undocked/map.c" @@ -6212,9 +6212,9 @@ test_maps(void* context) goto label_123; #line 277 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1976 dst=r0 src=r0 offset=-199 imm=0 + // EBPF_OP_JA pc=1976 dst=r0 src=r0 offset=-201 imm=0 #line 277 "sample/undocked/map.c" - goto label_112; + goto label_111; label_123: // EBPF_OP_LDXW pc=1977 dst=r3 src=r10 offset=-4 imm=0 #line 277 "sample/undocked/map.c" @@ -6315,9 +6315,9 @@ test_maps(void* context) goto label_125; #line 278 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2011 dst=r0 src=r0 offset=-234 imm=0 + // EBPF_OP_JA pc=2011 dst=r0 src=r0 offset=-236 imm=0 #line 278 "sample/undocked/map.c" - goto label_112; + goto label_111; label_125: // EBPF_OP_LDXW pc=2012 dst=r3 src=r10 offset=-4 imm=0 #line 278 "sample/undocked/map.c" @@ -6418,9 +6418,9 @@ test_maps(void* context) goto label_127; #line 279 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2046 dst=r0 src=r0 offset=-269 imm=0 + // EBPF_OP_JA pc=2046 dst=r0 src=r0 offset=-271 imm=0 #line 279 "sample/undocked/map.c" - goto label_112; + goto label_111; label_127: // EBPF_OP_LDXW pc=2047 dst=r3 src=r10 offset=-4 imm=0 #line 279 "sample/undocked/map.c" @@ -6521,9 +6521,9 @@ test_maps(void* context) goto label_129; #line 280 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2081 dst=r0 src=r0 offset=-304 imm=0 + // EBPF_OP_JA pc=2081 dst=r0 src=r0 offset=-306 imm=0 #line 280 "sample/undocked/map.c" - goto label_112; + goto label_111; label_129: // EBPF_OP_LDXW pc=2082 dst=r3 src=r10 offset=-4 imm=0 #line 280 "sample/undocked/map.c" @@ -6624,9 +6624,9 @@ test_maps(void* context) goto label_131; #line 281 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2116 dst=r0 src=r0 offset=-339 imm=0 + // EBPF_OP_JA pc=2116 dst=r0 src=r0 offset=-341 imm=0 #line 281 "sample/undocked/map.c" - goto label_112; + goto label_111; label_131: // EBPF_OP_LDXW pc=2117 dst=r3 src=r10 offset=-4 imm=0 #line 281 "sample/undocked/map.c" @@ -8001,11 +8001,11 @@ test_maps(void* context) // EBPF_OP_RSH64_IMM pc=2563 dst=r1 src=r0 offset=0 imm=32 #line 264 "sample/undocked/map.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JEQ_IMM pc=2564 dst=r1 src=r0 offset=27 imm=0 + // EBPF_OP_JEQ_IMM pc=2564 dst=r1 src=r0 offset=25 imm=0 #line 264 "sample/undocked/map.c" if (r1 == IMMEDIATE(0)) { #line 264 "sample/undocked/map.c" - goto label_162; + goto label_161; #line 264 "sample/undocked/map.c" } // EBPF_OP_MOV64_IMM pc=2565 dst=r1 src=r0 offset=0 imm=100 @@ -8062,101 +8062,88 @@ test_maps(void* context) // EBPF_OP_MOV64_IMM pc=2588 dst=r2 src=r0 offset=0 imm=50 #line 264 "sample/undocked/map.c" r2 = IMMEDIATE(50); -label_161: - // EBPF_OP_MOV64_IMM pc=2589 dst=r3 src=r0 offset=0 imm=0 -#line 264 "sample/undocked/map.c" - r3 = IMMEDIATE(0); - // EBPF_OP_CALL pc=2590 dst=r0 src=r0 offset=0 imm=14 -#line 264 "sample/undocked/map.c" - r0 = test_maps_helpers[7].address(r1, r2, r3, r4, r5, context); + // EBPF_OP_JA pc=2589 dst=r0 src=r0 offset=60 imm=0 #line 264 "sample/undocked/map.c" - if ((test_maps_helpers[7].tail_call) && (r0 == 0)) { -#line 264 "sample/undocked/map.c" - return 0; -#line 264 "sample/undocked/map.c" - } - // EBPF_OP_JA pc=2591 dst=r0 src=r0 offset=-390 imm=0 -#line 264 "sample/undocked/map.c" - goto label_140; -label_162: - // EBPF_OP_LDXW pc=2592 dst=r3 src=r10 offset=-4 imm=0 + goto label_164; +label_161: + // EBPF_OP_LDXW pc=2590 dst=r3 src=r10 offset=-4 imm=0 #line 264 "sample/undocked/map.c" r3 = *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)); - // EBPF_OP_JEQ_IMM pc=2593 dst=r3 src=r0 offset=22 imm=10 + // EBPF_OP_JEQ_IMM pc=2591 dst=r3 src=r0 offset=22 imm=10 #line 264 "sample/undocked/map.c" if (r3 == IMMEDIATE(10)) { #line 264 "sample/undocked/map.c" - goto label_163; + goto label_162; #line 264 "sample/undocked/map.c" } - // EBPF_OP_MOV64_IMM pc=2594 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=2592 dst=r1 src=r0 offset=0 imm=0 #line 264 "sample/undocked/map.c" r1 = IMMEDIATE(0); - // EBPF_OP_STXB pc=2595 dst=r10 src=r1 offset=-72 imm=0 + // EBPF_OP_STXB pc=2593 dst=r10 src=r1 offset=-72 imm=0 #line 264 "sample/undocked/map.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint8_t)r1; - // EBPF_OP_LDDW pc=2596 dst=r1 src=r0 offset=0 imm=1852404835 + // EBPF_OP_LDDW pc=2594 dst=r1 src=r0 offset=0 imm=1852404835 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7216209606537213027; - // EBPF_OP_STXDW pc=2598 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=2596 dst=r10 src=r1 offset=-80 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2599 dst=r1 src=r0 offset=0 imm=543434016 + // EBPF_OP_LDDW pc=2597 dst=r1 src=r0 offset=0 imm=543434016 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7309474570952779040; - // EBPF_OP_STXDW pc=2601 dst=r10 src=r1 offset=-88 imm=0 + // EBPF_OP_STXDW pc=2599 dst=r10 src=r1 offset=-88 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-88)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2602 dst=r1 src=r0 offset=0 imm=1701978221 + // EBPF_OP_LDDW pc=2600 dst=r1 src=r0 offset=0 imm=1701978221 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7958552634295722093; - // EBPF_OP_STXDW pc=2604 dst=r10 src=r1 offset=-96 imm=0 + // EBPF_OP_STXDW pc=2602 dst=r10 src=r1 offset=-96 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-96)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2605 dst=r1 src=r0 offset=0 imm=1801807216 + // EBPF_OP_LDDW pc=2603 dst=r1 src=r0 offset=0 imm=1801807216 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7308327755813578096; - // EBPF_OP_STXDW pc=2607 dst=r10 src=r1 offset=-104 imm=0 + // EBPF_OP_STXDW pc=2605 dst=r10 src=r1 offset=-104 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-104)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2608 dst=r1 src=r0 offset=0 imm=1600548962 + // EBPF_OP_LDDW pc=2606 dst=r1 src=r0 offset=0 imm=1600548962 #line 264 "sample/undocked/map.c" r1 = (uint64_t)6877103753374625890; - // EBPF_OP_STXDW pc=2610 dst=r10 src=r1 offset=-112 imm=0 + // EBPF_OP_STXDW pc=2608 dst=r10 src=r1 offset=-112 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-112)) = (uint64_t)r1; - // EBPF_OP_MOV64_REG pc=2611 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2609 dst=r1 src=r10 offset=0 imm=0 #line 264 "sample/undocked/map.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=2612 dst=r1 src=r0 offset=0 imm=-112 + // EBPF_OP_ADD64_IMM pc=2610 dst=r1 src=r0 offset=0 imm=-112 #line 264 "sample/undocked/map.c" r1 += IMMEDIATE(-112); - // EBPF_OP_MOV64_IMM pc=2613 dst=r2 src=r0 offset=0 imm=41 + // EBPF_OP_MOV64_IMM pc=2611 dst=r2 src=r0 offset=0 imm=41 #line 264 "sample/undocked/map.c" r2 = IMMEDIATE(41); - // EBPF_OP_MOV64_IMM pc=2614 dst=r4 src=r0 offset=0 imm=10 + // EBPF_OP_MOV64_IMM pc=2612 dst=r4 src=r0 offset=0 imm=10 #line 264 "sample/undocked/map.c" r4 = IMMEDIATE(10); - // EBPF_OP_JA pc=2615 dst=r0 src=r0 offset=-417 imm=0 + // EBPF_OP_JA pc=2613 dst=r0 src=r0 offset=-415 imm=0 #line 264 "sample/undocked/map.c" goto label_139; -label_163: - // EBPF_OP_MOV64_IMM pc=2616 dst=r6 src=r0 offset=0 imm=0 +label_162: + // EBPF_OP_MOV64_IMM pc=2614 dst=r6 src=r0 offset=0 imm=0 #line 264 "sample/undocked/map.c" r6 = IMMEDIATE(0); - // EBPF_OP_STXW pc=2617 dst=r10 src=r6 offset=-4 imm=0 + // EBPF_OP_STXW pc=2615 dst=r10 src=r6 offset=-4 imm=0 #line 272 "sample/undocked/map.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r6; - // EBPF_OP_MOV64_REG pc=2618 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2616 dst=r2 src=r10 offset=0 imm=0 #line 272 "sample/undocked/map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=2619 dst=r2 src=r0 offset=0 imm=-4 + // EBPF_OP_ADD64_IMM pc=2617 dst=r2 src=r0 offset=0 imm=-4 #line 272 "sample/undocked/map.c" r2 += IMMEDIATE(-4); - // EBPF_OP_LDDW pc=2620 dst=r1 src=r1 offset=0 imm=8 + // EBPF_OP_LDDW pc=2618 dst=r1 src=r1 offset=0 imm=8 #line 272 "sample/undocked/map.c" r1 = POINTER(_maps[7].address); - // EBPF_OP_CALL pc=2622 dst=r0 src=r0 offset=0 imm=17 + // EBPF_OP_CALL pc=2620 dst=r0 src=r0 offset=0 imm=17 #line 272 "sample/undocked/map.c" r0 = test_maps_helpers[8].address(r1, r2, r3, r4, r5, context); #line 272 "sample/undocked/map.c" @@ -8165,83 +8152,96 @@ test_maps(void* context) return 0; #line 272 "sample/undocked/map.c" } - // EBPF_OP_MOV64_REG pc=2623 dst=r7 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2621 dst=r7 src=r0 offset=0 imm=0 #line 272 "sample/undocked/map.c" r7 = r0; - // EBPF_OP_MOV64_REG pc=2624 dst=r4 src=r7 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2622 dst=r4 src=r7 offset=0 imm=0 #line 272 "sample/undocked/map.c" r4 = r7; - // EBPF_OP_LSH64_IMM pc=2625 dst=r4 src=r0 offset=0 imm=32 + // EBPF_OP_LSH64_IMM pc=2623 dst=r4 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r4 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_REG pc=2626 dst=r1 src=r4 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2624 dst=r1 src=r4 offset=0 imm=0 #line 272 "sample/undocked/map.c" r1 = r4; - // EBPF_OP_RSH64_IMM pc=2627 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=2625 dst=r1 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JEQ_IMM pc=2628 dst=r1 src=r0 offset=24 imm=0 + // EBPF_OP_JEQ_IMM pc=2626 dst=r1 src=r0 offset=26 imm=0 #line 272 "sample/undocked/map.c" if (r1 == IMMEDIATE(0)) { #line 272 "sample/undocked/map.c" goto label_165; #line 272 "sample/undocked/map.c" } -label_164: - // EBPF_OP_LDDW pc=2629 dst=r1 src=r0 offset=0 imm=1701737077 +label_163: + // EBPF_OP_LDDW pc=2627 dst=r1 src=r0 offset=0 imm=1701737077 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7216209593501643381; - // EBPF_OP_STXDW pc=2631 dst=r10 src=r1 offset=-72 imm=0 + // EBPF_OP_STXDW pc=2629 dst=r10 src=r1 offset=-72 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2632 dst=r1 src=r0 offset=0 imm=1680154740 + // EBPF_OP_LDDW pc=2630 dst=r1 src=r0 offset=0 imm=1680154740 #line 272 "sample/undocked/map.c" r1 = (uint64_t)8387235364492091508; - // EBPF_OP_STXDW pc=2634 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=2632 dst=r10 src=r1 offset=-80 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2635 dst=r1 src=r0 offset=0 imm=1914726254 + // EBPF_OP_LDDW pc=2633 dst=r1 src=r0 offset=0 imm=1914726254 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7815279607914981230; - // EBPF_OP_STXDW pc=2637 dst=r10 src=r1 offset=-88 imm=0 + // EBPF_OP_STXDW pc=2635 dst=r10 src=r1 offset=-88 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-88)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2638 dst=r1 src=r0 offset=0 imm=1886938400 + // EBPF_OP_LDDW pc=2636 dst=r1 src=r0 offset=0 imm=1886938400 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7598807758610654496; - // EBPF_OP_STXDW pc=2640 dst=r10 src=r1 offset=-96 imm=0 + // EBPF_OP_STXDW pc=2638 dst=r10 src=r1 offset=-96 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-96)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2641 dst=r1 src=r0 offset=0 imm=1601204080 + // EBPF_OP_LDDW pc=2639 dst=r1 src=r0 offset=0 imm=1601204080 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7882825905430622064; - // EBPF_OP_STXDW pc=2643 dst=r10 src=r1 offset=-104 imm=0 + // EBPF_OP_STXDW pc=2641 dst=r10 src=r1 offset=-104 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-104)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2644 dst=r1 src=r0 offset=0 imm=1600548962 + // EBPF_OP_LDDW pc=2642 dst=r1 src=r0 offset=0 imm=1600548962 #line 272 "sample/undocked/map.c" r1 = (uint64_t)6877103753374625890; - // EBPF_OP_STXDW pc=2646 dst=r10 src=r1 offset=-112 imm=0 + // EBPF_OP_STXDW pc=2644 dst=r10 src=r1 offset=-112 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-112)) = (uint64_t)r1; - // EBPF_OP_STXB pc=2647 dst=r10 src=r6 offset=-64 imm=0 + // EBPF_OP_STXB pc=2645 dst=r10 src=r6 offset=-64 imm=0 #line 272 "sample/undocked/map.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint8_t)r6; - // EBPF_OP_ARSH64_IMM pc=2648 dst=r4 src=r0 offset=0 imm=32 + // EBPF_OP_ARSH64_IMM pc=2646 dst=r4 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r4 = (int64_t)r4 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_REG pc=2649 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2647 dst=r1 src=r10 offset=0 imm=0 #line 272 "sample/undocked/map.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=2650 dst=r1 src=r0 offset=0 imm=-112 + // EBPF_OP_ADD64_IMM pc=2648 dst=r1 src=r0 offset=0 imm=-112 #line 272 "sample/undocked/map.c" r1 += IMMEDIATE(-112); - // EBPF_OP_MOV64_IMM pc=2651 dst=r2 src=r0 offset=0 imm=49 + // EBPF_OP_MOV64_IMM pc=2649 dst=r2 src=r0 offset=0 imm=49 #line 272 "sample/undocked/map.c" r2 = IMMEDIATE(49); - // EBPF_OP_JA pc=2652 dst=r0 src=r0 offset=-64 imm=0 +label_164: + // EBPF_OP_MOV64_IMM pc=2650 dst=r3 src=r0 offset=0 imm=0 +#line 272 "sample/undocked/map.c" + r3 = IMMEDIATE(0); + // EBPF_OP_CALL pc=2651 dst=r0 src=r0 offset=0 imm=14 +#line 272 "sample/undocked/map.c" + r0 = test_maps_helpers[7].address(r1, r2, r3, r4, r5, context); +#line 272 "sample/undocked/map.c" + if ((test_maps_helpers[7].tail_call) && (r0 == 0)) { +#line 272 "sample/undocked/map.c" + return 0; +#line 272 "sample/undocked/map.c" + } + // EBPF_OP_JA pc=2652 dst=r0 src=r0 offset=-451 imm=0 #line 272 "sample/undocked/map.c" - goto label_161; + goto label_140; label_165: // EBPF_OP_LDXW pc=2653 dst=r3 src=r10 offset=-4 imm=0 #line 272 "sample/undocked/map.c" @@ -8342,9 +8342,9 @@ test_maps(void* context) goto label_167; #line 273 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2687 dst=r0 src=r0 offset=-59 imm=0 + // EBPF_OP_JA pc=2687 dst=r0 src=r0 offset=-61 imm=0 #line 273 "sample/undocked/map.c" - goto label_164; + goto label_163; label_167: // EBPF_OP_LDXW pc=2688 dst=r3 src=r10 offset=-4 imm=0 #line 273 "sample/undocked/map.c" @@ -8445,9 +8445,9 @@ test_maps(void* context) goto label_169; #line 274 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2722 dst=r0 src=r0 offset=-94 imm=0 + // EBPF_OP_JA pc=2722 dst=r0 src=r0 offset=-96 imm=0 #line 274 "sample/undocked/map.c" - goto label_164; + goto label_163; label_169: // EBPF_OP_LDXW pc=2723 dst=r3 src=r10 offset=-4 imm=0 #line 274 "sample/undocked/map.c" @@ -8548,9 +8548,9 @@ test_maps(void* context) goto label_171; #line 275 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2757 dst=r0 src=r0 offset=-129 imm=0 + // EBPF_OP_JA pc=2757 dst=r0 src=r0 offset=-131 imm=0 #line 275 "sample/undocked/map.c" - goto label_164; + goto label_163; label_171: // EBPF_OP_LDXW pc=2758 dst=r3 src=r10 offset=-4 imm=0 #line 275 "sample/undocked/map.c" @@ -8651,9 +8651,9 @@ test_maps(void* context) goto label_173; #line 276 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2792 dst=r0 src=r0 offset=-164 imm=0 + // EBPF_OP_JA pc=2792 dst=r0 src=r0 offset=-166 imm=0 #line 276 "sample/undocked/map.c" - goto label_164; + goto label_163; label_173: // EBPF_OP_LDXW pc=2793 dst=r3 src=r10 offset=-4 imm=0 #line 276 "sample/undocked/map.c" @@ -8754,9 +8754,9 @@ test_maps(void* context) goto label_175; #line 277 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2827 dst=r0 src=r0 offset=-199 imm=0 + // EBPF_OP_JA pc=2827 dst=r0 src=r0 offset=-201 imm=0 #line 277 "sample/undocked/map.c" - goto label_164; + goto label_163; label_175: // EBPF_OP_LDXW pc=2828 dst=r3 src=r10 offset=-4 imm=0 #line 277 "sample/undocked/map.c" @@ -8857,9 +8857,9 @@ test_maps(void* context) goto label_177; #line 278 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2862 dst=r0 src=r0 offset=-234 imm=0 + // EBPF_OP_JA pc=2862 dst=r0 src=r0 offset=-236 imm=0 #line 278 "sample/undocked/map.c" - goto label_164; + goto label_163; label_177: // EBPF_OP_LDXW pc=2863 dst=r3 src=r10 offset=-4 imm=0 #line 278 "sample/undocked/map.c" @@ -8960,9 +8960,9 @@ test_maps(void* context) goto label_179; #line 279 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2897 dst=r0 src=r0 offset=-269 imm=0 + // EBPF_OP_JA pc=2897 dst=r0 src=r0 offset=-271 imm=0 #line 279 "sample/undocked/map.c" - goto label_164; + goto label_163; label_179: // EBPF_OP_LDXW pc=2898 dst=r3 src=r10 offset=-4 imm=0 #line 279 "sample/undocked/map.c" @@ -9063,9 +9063,9 @@ test_maps(void* context) goto label_181; #line 280 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2932 dst=r0 src=r0 offset=-304 imm=0 + // EBPF_OP_JA pc=2932 dst=r0 src=r0 offset=-306 imm=0 #line 280 "sample/undocked/map.c" - goto label_164; + goto label_163; label_181: // EBPF_OP_LDXW pc=2933 dst=r3 src=r10 offset=-4 imm=0 #line 280 "sample/undocked/map.c" @@ -9166,9 +9166,9 @@ test_maps(void* context) goto label_183; #line 281 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2967 dst=r0 src=r0 offset=-339 imm=0 + // EBPF_OP_JA pc=2967 dst=r0 src=r0 offset=-341 imm=0 #line 281 "sample/undocked/map.c" - goto label_164; + goto label_163; label_183: // EBPF_OP_LDXW pc=2968 dst=r3 src=r10 offset=-4 imm=0 #line 281 "sample/undocked/map.c" diff --git a/tests/bpf2c_tests/expected/map_raw.c b/tests/bpf2c_tests/expected/map_raw.c index 9811005537..175b62b7ad 100644 --- a/tests/bpf2c_tests/expected/map_raw.c +++ b/tests/bpf2c_tests/expected/map_raw.c @@ -5433,11 +5433,11 @@ test_maps(void* context) // EBPF_OP_RSH64_IMM pc=1712 dst=r1 src=r0 offset=0 imm=32 #line 264 "sample/undocked/map.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JEQ_IMM pc=1713 dst=r1 src=r0 offset=27 imm=0 + // EBPF_OP_JEQ_IMM pc=1713 dst=r1 src=r0 offset=25 imm=0 #line 264 "sample/undocked/map.c" if (r1 == IMMEDIATE(0)) { #line 264 "sample/undocked/map.c" - goto label_110; + goto label_109; #line 264 "sample/undocked/map.c" } // EBPF_OP_MOV64_IMM pc=1714 dst=r1 src=r0 offset=0 imm=100 @@ -5494,101 +5494,88 @@ test_maps(void* context) // EBPF_OP_MOV64_IMM pc=1737 dst=r2 src=r0 offset=0 imm=50 #line 264 "sample/undocked/map.c" r2 = IMMEDIATE(50); -label_109: - // EBPF_OP_MOV64_IMM pc=1738 dst=r3 src=r0 offset=0 imm=0 -#line 264 "sample/undocked/map.c" - r3 = IMMEDIATE(0); - // EBPF_OP_CALL pc=1739 dst=r0 src=r0 offset=0 imm=14 -#line 264 "sample/undocked/map.c" - r0 = test_maps_helpers[7].address(r1, r2, r3, r4, r5, context); + // EBPF_OP_JA pc=1738 dst=r0 src=r0 offset=60 imm=0 #line 264 "sample/undocked/map.c" - if ((test_maps_helpers[7].tail_call) && (r0 == 0)) { -#line 264 "sample/undocked/map.c" - return 0; -#line 264 "sample/undocked/map.c" - } - // EBPF_OP_JA pc=1740 dst=r0 src=r0 offset=-429 imm=0 -#line 264 "sample/undocked/map.c" - goto label_84; -label_110: - // EBPF_OP_LDXW pc=1741 dst=r3 src=r10 offset=-4 imm=0 + goto label_112; +label_109: + // EBPF_OP_LDXW pc=1739 dst=r3 src=r10 offset=-4 imm=0 #line 264 "sample/undocked/map.c" r3 = *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)); - // EBPF_OP_JEQ_IMM pc=1742 dst=r3 src=r0 offset=22 imm=1 + // EBPF_OP_JEQ_IMM pc=1740 dst=r3 src=r0 offset=22 imm=1 #line 264 "sample/undocked/map.c" if (r3 == IMMEDIATE(1)) { #line 264 "sample/undocked/map.c" - goto label_111; + goto label_110; #line 264 "sample/undocked/map.c" } - // EBPF_OP_MOV64_IMM pc=1743 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=1741 dst=r1 src=r0 offset=0 imm=0 #line 264 "sample/undocked/map.c" r1 = IMMEDIATE(0); - // EBPF_OP_STXB pc=1744 dst=r10 src=r1 offset=-72 imm=0 + // EBPF_OP_STXB pc=1742 dst=r10 src=r1 offset=-72 imm=0 #line 264 "sample/undocked/map.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint8_t)r1; - // EBPF_OP_LDDW pc=1745 dst=r1 src=r0 offset=0 imm=1852404835 + // EBPF_OP_LDDW pc=1743 dst=r1 src=r0 offset=0 imm=1852404835 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7216209606537213027; - // EBPF_OP_STXDW pc=1747 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=1745 dst=r10 src=r1 offset=-80 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1748 dst=r1 src=r0 offset=0 imm=543434016 + // EBPF_OP_LDDW pc=1746 dst=r1 src=r0 offset=0 imm=543434016 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7309474570952779040; - // EBPF_OP_STXDW pc=1750 dst=r10 src=r1 offset=-88 imm=0 + // EBPF_OP_STXDW pc=1748 dst=r10 src=r1 offset=-88 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-88)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1751 dst=r1 src=r0 offset=0 imm=1701978221 + // EBPF_OP_LDDW pc=1749 dst=r1 src=r0 offset=0 imm=1701978221 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7958552634295722093; - // EBPF_OP_STXDW pc=1753 dst=r10 src=r1 offset=-96 imm=0 + // EBPF_OP_STXDW pc=1751 dst=r10 src=r1 offset=-96 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-96)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1754 dst=r1 src=r0 offset=0 imm=1801807216 + // EBPF_OP_LDDW pc=1752 dst=r1 src=r0 offset=0 imm=1801807216 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7308327755813578096; - // EBPF_OP_STXDW pc=1756 dst=r10 src=r1 offset=-104 imm=0 + // EBPF_OP_STXDW pc=1754 dst=r10 src=r1 offset=-104 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-104)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1757 dst=r1 src=r0 offset=0 imm=1600548962 + // EBPF_OP_LDDW pc=1755 dst=r1 src=r0 offset=0 imm=1600548962 #line 264 "sample/undocked/map.c" r1 = (uint64_t)6877103753374625890; - // EBPF_OP_STXDW pc=1759 dst=r10 src=r1 offset=-112 imm=0 + // EBPF_OP_STXDW pc=1757 dst=r10 src=r1 offset=-112 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-112)) = (uint64_t)r1; - // EBPF_OP_MOV64_REG pc=1760 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1758 dst=r1 src=r10 offset=0 imm=0 #line 264 "sample/undocked/map.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=1761 dst=r1 src=r0 offset=0 imm=-112 + // EBPF_OP_ADD64_IMM pc=1759 dst=r1 src=r0 offset=0 imm=-112 #line 264 "sample/undocked/map.c" r1 += IMMEDIATE(-112); - // EBPF_OP_MOV64_IMM pc=1762 dst=r2 src=r0 offset=0 imm=41 + // EBPF_OP_MOV64_IMM pc=1760 dst=r2 src=r0 offset=0 imm=41 #line 264 "sample/undocked/map.c" r2 = IMMEDIATE(41); - // EBPF_OP_MOV64_IMM pc=1763 dst=r4 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=1761 dst=r4 src=r0 offset=0 imm=1 #line 264 "sample/undocked/map.c" r4 = IMMEDIATE(1); - // EBPF_OP_JA pc=1764 dst=r0 src=r0 offset=-456 imm=0 + // EBPF_OP_JA pc=1762 dst=r0 src=r0 offset=-454 imm=0 #line 264 "sample/undocked/map.c" goto label_83; -label_111: - // EBPF_OP_MOV64_IMM pc=1765 dst=r7 src=r0 offset=0 imm=0 +label_110: + // EBPF_OP_MOV64_IMM pc=1763 dst=r7 src=r0 offset=0 imm=0 #line 264 "sample/undocked/map.c" r7 = IMMEDIATE(0); - // EBPF_OP_STXW pc=1766 dst=r10 src=r7 offset=-4 imm=0 + // EBPF_OP_STXW pc=1764 dst=r10 src=r7 offset=-4 imm=0 #line 272 "sample/undocked/map.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r7; - // EBPF_OP_MOV64_REG pc=1767 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1765 dst=r2 src=r10 offset=0 imm=0 #line 272 "sample/undocked/map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=1768 dst=r2 src=r0 offset=0 imm=-4 + // EBPF_OP_ADD64_IMM pc=1766 dst=r2 src=r0 offset=0 imm=-4 #line 272 "sample/undocked/map.c" r2 += IMMEDIATE(-4); - // EBPF_OP_LDDW pc=1769 dst=r1 src=r1 offset=0 imm=7 + // EBPF_OP_LDDW pc=1767 dst=r1 src=r1 offset=0 imm=7 #line 272 "sample/undocked/map.c" r1 = POINTER(_maps[6].address); - // EBPF_OP_CALL pc=1771 dst=r0 src=r0 offset=0 imm=17 + // EBPF_OP_CALL pc=1769 dst=r0 src=r0 offset=0 imm=17 #line 272 "sample/undocked/map.c" r0 = test_maps_helpers[8].address(r1, r2, r3, r4, r5, context); #line 272 "sample/undocked/map.c" @@ -5597,83 +5584,96 @@ test_maps(void* context) return 0; #line 272 "sample/undocked/map.c" } - // EBPF_OP_MOV64_REG pc=1772 dst=r6 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1770 dst=r6 src=r0 offset=0 imm=0 #line 272 "sample/undocked/map.c" r6 = r0; - // EBPF_OP_MOV64_REG pc=1773 dst=r4 src=r6 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1771 dst=r4 src=r6 offset=0 imm=0 #line 272 "sample/undocked/map.c" r4 = r6; - // EBPF_OP_LSH64_IMM pc=1774 dst=r4 src=r0 offset=0 imm=32 + // EBPF_OP_LSH64_IMM pc=1772 dst=r4 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r4 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_REG pc=1775 dst=r1 src=r4 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1773 dst=r1 src=r4 offset=0 imm=0 #line 272 "sample/undocked/map.c" r1 = r4; - // EBPF_OP_RSH64_IMM pc=1776 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=1774 dst=r1 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JEQ_IMM pc=1777 dst=r1 src=r0 offset=24 imm=0 + // EBPF_OP_JEQ_IMM pc=1775 dst=r1 src=r0 offset=26 imm=0 #line 272 "sample/undocked/map.c" if (r1 == IMMEDIATE(0)) { #line 272 "sample/undocked/map.c" goto label_113; #line 272 "sample/undocked/map.c" } -label_112: - // EBPF_OP_LDDW pc=1778 dst=r1 src=r0 offset=0 imm=1701737077 +label_111: + // EBPF_OP_LDDW pc=1776 dst=r1 src=r0 offset=0 imm=1701737077 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7216209593501643381; - // EBPF_OP_STXDW pc=1780 dst=r10 src=r1 offset=-72 imm=0 + // EBPF_OP_STXDW pc=1778 dst=r10 src=r1 offset=-72 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1781 dst=r1 src=r0 offset=0 imm=1680154740 + // EBPF_OP_LDDW pc=1779 dst=r1 src=r0 offset=0 imm=1680154740 #line 272 "sample/undocked/map.c" r1 = (uint64_t)8387235364492091508; - // EBPF_OP_STXDW pc=1783 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=1781 dst=r10 src=r1 offset=-80 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1784 dst=r1 src=r0 offset=0 imm=1914726254 + // EBPF_OP_LDDW pc=1782 dst=r1 src=r0 offset=0 imm=1914726254 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7815279607914981230; - // EBPF_OP_STXDW pc=1786 dst=r10 src=r1 offset=-88 imm=0 + // EBPF_OP_STXDW pc=1784 dst=r10 src=r1 offset=-88 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-88)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1787 dst=r1 src=r0 offset=0 imm=1886938400 + // EBPF_OP_LDDW pc=1785 dst=r1 src=r0 offset=0 imm=1886938400 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7598807758610654496; - // EBPF_OP_STXDW pc=1789 dst=r10 src=r1 offset=-96 imm=0 + // EBPF_OP_STXDW pc=1787 dst=r10 src=r1 offset=-96 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-96)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1790 dst=r1 src=r0 offset=0 imm=1601204080 + // EBPF_OP_LDDW pc=1788 dst=r1 src=r0 offset=0 imm=1601204080 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7882825905430622064; - // EBPF_OP_STXDW pc=1792 dst=r10 src=r1 offset=-104 imm=0 + // EBPF_OP_STXDW pc=1790 dst=r10 src=r1 offset=-104 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-104)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1793 dst=r1 src=r0 offset=0 imm=1600548962 + // EBPF_OP_LDDW pc=1791 dst=r1 src=r0 offset=0 imm=1600548962 #line 272 "sample/undocked/map.c" r1 = (uint64_t)6877103753374625890; - // EBPF_OP_STXDW pc=1795 dst=r10 src=r1 offset=-112 imm=0 + // EBPF_OP_STXDW pc=1793 dst=r10 src=r1 offset=-112 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-112)) = (uint64_t)r1; - // EBPF_OP_STXB pc=1796 dst=r10 src=r7 offset=-64 imm=0 + // EBPF_OP_STXB pc=1794 dst=r10 src=r7 offset=-64 imm=0 #line 272 "sample/undocked/map.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint8_t)r7; - // EBPF_OP_ARSH64_IMM pc=1797 dst=r4 src=r0 offset=0 imm=32 + // EBPF_OP_ARSH64_IMM pc=1795 dst=r4 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r4 = (int64_t)r4 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_REG pc=1798 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1796 dst=r1 src=r10 offset=0 imm=0 #line 272 "sample/undocked/map.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=1799 dst=r1 src=r0 offset=0 imm=-112 + // EBPF_OP_ADD64_IMM pc=1797 dst=r1 src=r0 offset=0 imm=-112 #line 272 "sample/undocked/map.c" r1 += IMMEDIATE(-112); - // EBPF_OP_MOV64_IMM pc=1800 dst=r2 src=r0 offset=0 imm=49 + // EBPF_OP_MOV64_IMM pc=1798 dst=r2 src=r0 offset=0 imm=49 #line 272 "sample/undocked/map.c" r2 = IMMEDIATE(49); - // EBPF_OP_JA pc=1801 dst=r0 src=r0 offset=-64 imm=0 +label_112: + // EBPF_OP_MOV64_IMM pc=1799 dst=r3 src=r0 offset=0 imm=0 +#line 272 "sample/undocked/map.c" + r3 = IMMEDIATE(0); + // EBPF_OP_CALL pc=1800 dst=r0 src=r0 offset=0 imm=14 +#line 272 "sample/undocked/map.c" + r0 = test_maps_helpers[7].address(r1, r2, r3, r4, r5, context); +#line 272 "sample/undocked/map.c" + if ((test_maps_helpers[7].tail_call) && (r0 == 0)) { +#line 272 "sample/undocked/map.c" + return 0; +#line 272 "sample/undocked/map.c" + } + // EBPF_OP_JA pc=1801 dst=r0 src=r0 offset=-490 imm=0 #line 272 "sample/undocked/map.c" - goto label_109; + goto label_84; label_113: // EBPF_OP_LDXW pc=1802 dst=r3 src=r10 offset=-4 imm=0 #line 272 "sample/undocked/map.c" @@ -5774,9 +5774,9 @@ test_maps(void* context) goto label_115; #line 273 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1836 dst=r0 src=r0 offset=-59 imm=0 + // EBPF_OP_JA pc=1836 dst=r0 src=r0 offset=-61 imm=0 #line 273 "sample/undocked/map.c" - goto label_112; + goto label_111; label_115: // EBPF_OP_LDXW pc=1837 dst=r3 src=r10 offset=-4 imm=0 #line 273 "sample/undocked/map.c" @@ -5877,9 +5877,9 @@ test_maps(void* context) goto label_117; #line 274 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1871 dst=r0 src=r0 offset=-94 imm=0 + // EBPF_OP_JA pc=1871 dst=r0 src=r0 offset=-96 imm=0 #line 274 "sample/undocked/map.c" - goto label_112; + goto label_111; label_117: // EBPF_OP_LDXW pc=1872 dst=r3 src=r10 offset=-4 imm=0 #line 274 "sample/undocked/map.c" @@ -5980,9 +5980,9 @@ test_maps(void* context) goto label_119; #line 275 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1906 dst=r0 src=r0 offset=-129 imm=0 + // EBPF_OP_JA pc=1906 dst=r0 src=r0 offset=-131 imm=0 #line 275 "sample/undocked/map.c" - goto label_112; + goto label_111; label_119: // EBPF_OP_LDXW pc=1907 dst=r3 src=r10 offset=-4 imm=0 #line 275 "sample/undocked/map.c" @@ -6083,9 +6083,9 @@ test_maps(void* context) goto label_121; #line 276 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1941 dst=r0 src=r0 offset=-164 imm=0 + // EBPF_OP_JA pc=1941 dst=r0 src=r0 offset=-166 imm=0 #line 276 "sample/undocked/map.c" - goto label_112; + goto label_111; label_121: // EBPF_OP_LDXW pc=1942 dst=r3 src=r10 offset=-4 imm=0 #line 276 "sample/undocked/map.c" @@ -6186,9 +6186,9 @@ test_maps(void* context) goto label_123; #line 277 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1976 dst=r0 src=r0 offset=-199 imm=0 + // EBPF_OP_JA pc=1976 dst=r0 src=r0 offset=-201 imm=0 #line 277 "sample/undocked/map.c" - goto label_112; + goto label_111; label_123: // EBPF_OP_LDXW pc=1977 dst=r3 src=r10 offset=-4 imm=0 #line 277 "sample/undocked/map.c" @@ -6289,9 +6289,9 @@ test_maps(void* context) goto label_125; #line 278 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2011 dst=r0 src=r0 offset=-234 imm=0 + // EBPF_OP_JA pc=2011 dst=r0 src=r0 offset=-236 imm=0 #line 278 "sample/undocked/map.c" - goto label_112; + goto label_111; label_125: // EBPF_OP_LDXW pc=2012 dst=r3 src=r10 offset=-4 imm=0 #line 278 "sample/undocked/map.c" @@ -6392,9 +6392,9 @@ test_maps(void* context) goto label_127; #line 279 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2046 dst=r0 src=r0 offset=-269 imm=0 + // EBPF_OP_JA pc=2046 dst=r0 src=r0 offset=-271 imm=0 #line 279 "sample/undocked/map.c" - goto label_112; + goto label_111; label_127: // EBPF_OP_LDXW pc=2047 dst=r3 src=r10 offset=-4 imm=0 #line 279 "sample/undocked/map.c" @@ -6495,9 +6495,9 @@ test_maps(void* context) goto label_129; #line 280 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2081 dst=r0 src=r0 offset=-304 imm=0 + // EBPF_OP_JA pc=2081 dst=r0 src=r0 offset=-306 imm=0 #line 280 "sample/undocked/map.c" - goto label_112; + goto label_111; label_129: // EBPF_OP_LDXW pc=2082 dst=r3 src=r10 offset=-4 imm=0 #line 280 "sample/undocked/map.c" @@ -6598,9 +6598,9 @@ test_maps(void* context) goto label_131; #line 281 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2116 dst=r0 src=r0 offset=-339 imm=0 + // EBPF_OP_JA pc=2116 dst=r0 src=r0 offset=-341 imm=0 #line 281 "sample/undocked/map.c" - goto label_112; + goto label_111; label_131: // EBPF_OP_LDXW pc=2117 dst=r3 src=r10 offset=-4 imm=0 #line 281 "sample/undocked/map.c" @@ -7975,11 +7975,11 @@ test_maps(void* context) // EBPF_OP_RSH64_IMM pc=2563 dst=r1 src=r0 offset=0 imm=32 #line 264 "sample/undocked/map.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JEQ_IMM pc=2564 dst=r1 src=r0 offset=27 imm=0 + // EBPF_OP_JEQ_IMM pc=2564 dst=r1 src=r0 offset=25 imm=0 #line 264 "sample/undocked/map.c" if (r1 == IMMEDIATE(0)) { #line 264 "sample/undocked/map.c" - goto label_162; + goto label_161; #line 264 "sample/undocked/map.c" } // EBPF_OP_MOV64_IMM pc=2565 dst=r1 src=r0 offset=0 imm=100 @@ -8036,101 +8036,88 @@ test_maps(void* context) // EBPF_OP_MOV64_IMM pc=2588 dst=r2 src=r0 offset=0 imm=50 #line 264 "sample/undocked/map.c" r2 = IMMEDIATE(50); -label_161: - // EBPF_OP_MOV64_IMM pc=2589 dst=r3 src=r0 offset=0 imm=0 -#line 264 "sample/undocked/map.c" - r3 = IMMEDIATE(0); - // EBPF_OP_CALL pc=2590 dst=r0 src=r0 offset=0 imm=14 -#line 264 "sample/undocked/map.c" - r0 = test_maps_helpers[7].address(r1, r2, r3, r4, r5, context); + // EBPF_OP_JA pc=2589 dst=r0 src=r0 offset=60 imm=0 #line 264 "sample/undocked/map.c" - if ((test_maps_helpers[7].tail_call) && (r0 == 0)) { -#line 264 "sample/undocked/map.c" - return 0; -#line 264 "sample/undocked/map.c" - } - // EBPF_OP_JA pc=2591 dst=r0 src=r0 offset=-390 imm=0 -#line 264 "sample/undocked/map.c" - goto label_140; -label_162: - // EBPF_OP_LDXW pc=2592 dst=r3 src=r10 offset=-4 imm=0 + goto label_164; +label_161: + // EBPF_OP_LDXW pc=2590 dst=r3 src=r10 offset=-4 imm=0 #line 264 "sample/undocked/map.c" r3 = *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)); - // EBPF_OP_JEQ_IMM pc=2593 dst=r3 src=r0 offset=22 imm=10 + // EBPF_OP_JEQ_IMM pc=2591 dst=r3 src=r0 offset=22 imm=10 #line 264 "sample/undocked/map.c" if (r3 == IMMEDIATE(10)) { #line 264 "sample/undocked/map.c" - goto label_163; + goto label_162; #line 264 "sample/undocked/map.c" } - // EBPF_OP_MOV64_IMM pc=2594 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=2592 dst=r1 src=r0 offset=0 imm=0 #line 264 "sample/undocked/map.c" r1 = IMMEDIATE(0); - // EBPF_OP_STXB pc=2595 dst=r10 src=r1 offset=-72 imm=0 + // EBPF_OP_STXB pc=2593 dst=r10 src=r1 offset=-72 imm=0 #line 264 "sample/undocked/map.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint8_t)r1; - // EBPF_OP_LDDW pc=2596 dst=r1 src=r0 offset=0 imm=1852404835 + // EBPF_OP_LDDW pc=2594 dst=r1 src=r0 offset=0 imm=1852404835 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7216209606537213027; - // EBPF_OP_STXDW pc=2598 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=2596 dst=r10 src=r1 offset=-80 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2599 dst=r1 src=r0 offset=0 imm=543434016 + // EBPF_OP_LDDW pc=2597 dst=r1 src=r0 offset=0 imm=543434016 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7309474570952779040; - // EBPF_OP_STXDW pc=2601 dst=r10 src=r1 offset=-88 imm=0 + // EBPF_OP_STXDW pc=2599 dst=r10 src=r1 offset=-88 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-88)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2602 dst=r1 src=r0 offset=0 imm=1701978221 + // EBPF_OP_LDDW pc=2600 dst=r1 src=r0 offset=0 imm=1701978221 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7958552634295722093; - // EBPF_OP_STXDW pc=2604 dst=r10 src=r1 offset=-96 imm=0 + // EBPF_OP_STXDW pc=2602 dst=r10 src=r1 offset=-96 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-96)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2605 dst=r1 src=r0 offset=0 imm=1801807216 + // EBPF_OP_LDDW pc=2603 dst=r1 src=r0 offset=0 imm=1801807216 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7308327755813578096; - // EBPF_OP_STXDW pc=2607 dst=r10 src=r1 offset=-104 imm=0 + // EBPF_OP_STXDW pc=2605 dst=r10 src=r1 offset=-104 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-104)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2608 dst=r1 src=r0 offset=0 imm=1600548962 + // EBPF_OP_LDDW pc=2606 dst=r1 src=r0 offset=0 imm=1600548962 #line 264 "sample/undocked/map.c" r1 = (uint64_t)6877103753374625890; - // EBPF_OP_STXDW pc=2610 dst=r10 src=r1 offset=-112 imm=0 + // EBPF_OP_STXDW pc=2608 dst=r10 src=r1 offset=-112 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-112)) = (uint64_t)r1; - // EBPF_OP_MOV64_REG pc=2611 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2609 dst=r1 src=r10 offset=0 imm=0 #line 264 "sample/undocked/map.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=2612 dst=r1 src=r0 offset=0 imm=-112 + // EBPF_OP_ADD64_IMM pc=2610 dst=r1 src=r0 offset=0 imm=-112 #line 264 "sample/undocked/map.c" r1 += IMMEDIATE(-112); - // EBPF_OP_MOV64_IMM pc=2613 dst=r2 src=r0 offset=0 imm=41 + // EBPF_OP_MOV64_IMM pc=2611 dst=r2 src=r0 offset=0 imm=41 #line 264 "sample/undocked/map.c" r2 = IMMEDIATE(41); - // EBPF_OP_MOV64_IMM pc=2614 dst=r4 src=r0 offset=0 imm=10 + // EBPF_OP_MOV64_IMM pc=2612 dst=r4 src=r0 offset=0 imm=10 #line 264 "sample/undocked/map.c" r4 = IMMEDIATE(10); - // EBPF_OP_JA pc=2615 dst=r0 src=r0 offset=-417 imm=0 + // EBPF_OP_JA pc=2613 dst=r0 src=r0 offset=-415 imm=0 #line 264 "sample/undocked/map.c" goto label_139; -label_163: - // EBPF_OP_MOV64_IMM pc=2616 dst=r6 src=r0 offset=0 imm=0 +label_162: + // EBPF_OP_MOV64_IMM pc=2614 dst=r6 src=r0 offset=0 imm=0 #line 264 "sample/undocked/map.c" r6 = IMMEDIATE(0); - // EBPF_OP_STXW pc=2617 dst=r10 src=r6 offset=-4 imm=0 + // EBPF_OP_STXW pc=2615 dst=r10 src=r6 offset=-4 imm=0 #line 272 "sample/undocked/map.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r6; - // EBPF_OP_MOV64_REG pc=2618 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2616 dst=r2 src=r10 offset=0 imm=0 #line 272 "sample/undocked/map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=2619 dst=r2 src=r0 offset=0 imm=-4 + // EBPF_OP_ADD64_IMM pc=2617 dst=r2 src=r0 offset=0 imm=-4 #line 272 "sample/undocked/map.c" r2 += IMMEDIATE(-4); - // EBPF_OP_LDDW pc=2620 dst=r1 src=r1 offset=0 imm=8 + // EBPF_OP_LDDW pc=2618 dst=r1 src=r1 offset=0 imm=8 #line 272 "sample/undocked/map.c" r1 = POINTER(_maps[7].address); - // EBPF_OP_CALL pc=2622 dst=r0 src=r0 offset=0 imm=17 + // EBPF_OP_CALL pc=2620 dst=r0 src=r0 offset=0 imm=17 #line 272 "sample/undocked/map.c" r0 = test_maps_helpers[8].address(r1, r2, r3, r4, r5, context); #line 272 "sample/undocked/map.c" @@ -8139,83 +8126,96 @@ test_maps(void* context) return 0; #line 272 "sample/undocked/map.c" } - // EBPF_OP_MOV64_REG pc=2623 dst=r7 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2621 dst=r7 src=r0 offset=0 imm=0 #line 272 "sample/undocked/map.c" r7 = r0; - // EBPF_OP_MOV64_REG pc=2624 dst=r4 src=r7 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2622 dst=r4 src=r7 offset=0 imm=0 #line 272 "sample/undocked/map.c" r4 = r7; - // EBPF_OP_LSH64_IMM pc=2625 dst=r4 src=r0 offset=0 imm=32 + // EBPF_OP_LSH64_IMM pc=2623 dst=r4 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r4 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_REG pc=2626 dst=r1 src=r4 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2624 dst=r1 src=r4 offset=0 imm=0 #line 272 "sample/undocked/map.c" r1 = r4; - // EBPF_OP_RSH64_IMM pc=2627 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=2625 dst=r1 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JEQ_IMM pc=2628 dst=r1 src=r0 offset=24 imm=0 + // EBPF_OP_JEQ_IMM pc=2626 dst=r1 src=r0 offset=26 imm=0 #line 272 "sample/undocked/map.c" if (r1 == IMMEDIATE(0)) { #line 272 "sample/undocked/map.c" goto label_165; #line 272 "sample/undocked/map.c" } -label_164: - // EBPF_OP_LDDW pc=2629 dst=r1 src=r0 offset=0 imm=1701737077 +label_163: + // EBPF_OP_LDDW pc=2627 dst=r1 src=r0 offset=0 imm=1701737077 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7216209593501643381; - // EBPF_OP_STXDW pc=2631 dst=r10 src=r1 offset=-72 imm=0 + // EBPF_OP_STXDW pc=2629 dst=r10 src=r1 offset=-72 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2632 dst=r1 src=r0 offset=0 imm=1680154740 + // EBPF_OP_LDDW pc=2630 dst=r1 src=r0 offset=0 imm=1680154740 #line 272 "sample/undocked/map.c" r1 = (uint64_t)8387235364492091508; - // EBPF_OP_STXDW pc=2634 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=2632 dst=r10 src=r1 offset=-80 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2635 dst=r1 src=r0 offset=0 imm=1914726254 + // EBPF_OP_LDDW pc=2633 dst=r1 src=r0 offset=0 imm=1914726254 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7815279607914981230; - // EBPF_OP_STXDW pc=2637 dst=r10 src=r1 offset=-88 imm=0 + // EBPF_OP_STXDW pc=2635 dst=r10 src=r1 offset=-88 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-88)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2638 dst=r1 src=r0 offset=0 imm=1886938400 + // EBPF_OP_LDDW pc=2636 dst=r1 src=r0 offset=0 imm=1886938400 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7598807758610654496; - // EBPF_OP_STXDW pc=2640 dst=r10 src=r1 offset=-96 imm=0 + // EBPF_OP_STXDW pc=2638 dst=r10 src=r1 offset=-96 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-96)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2641 dst=r1 src=r0 offset=0 imm=1601204080 + // EBPF_OP_LDDW pc=2639 dst=r1 src=r0 offset=0 imm=1601204080 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7882825905430622064; - // EBPF_OP_STXDW pc=2643 dst=r10 src=r1 offset=-104 imm=0 + // EBPF_OP_STXDW pc=2641 dst=r10 src=r1 offset=-104 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-104)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2644 dst=r1 src=r0 offset=0 imm=1600548962 + // EBPF_OP_LDDW pc=2642 dst=r1 src=r0 offset=0 imm=1600548962 #line 272 "sample/undocked/map.c" r1 = (uint64_t)6877103753374625890; - // EBPF_OP_STXDW pc=2646 dst=r10 src=r1 offset=-112 imm=0 + // EBPF_OP_STXDW pc=2644 dst=r10 src=r1 offset=-112 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-112)) = (uint64_t)r1; - // EBPF_OP_STXB pc=2647 dst=r10 src=r6 offset=-64 imm=0 + // EBPF_OP_STXB pc=2645 dst=r10 src=r6 offset=-64 imm=0 #line 272 "sample/undocked/map.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint8_t)r6; - // EBPF_OP_ARSH64_IMM pc=2648 dst=r4 src=r0 offset=0 imm=32 + // EBPF_OP_ARSH64_IMM pc=2646 dst=r4 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r4 = (int64_t)r4 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_REG pc=2649 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2647 dst=r1 src=r10 offset=0 imm=0 #line 272 "sample/undocked/map.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=2650 dst=r1 src=r0 offset=0 imm=-112 + // EBPF_OP_ADD64_IMM pc=2648 dst=r1 src=r0 offset=0 imm=-112 #line 272 "sample/undocked/map.c" r1 += IMMEDIATE(-112); - // EBPF_OP_MOV64_IMM pc=2651 dst=r2 src=r0 offset=0 imm=49 + // EBPF_OP_MOV64_IMM pc=2649 dst=r2 src=r0 offset=0 imm=49 #line 272 "sample/undocked/map.c" r2 = IMMEDIATE(49); - // EBPF_OP_JA pc=2652 dst=r0 src=r0 offset=-64 imm=0 +label_164: + // EBPF_OP_MOV64_IMM pc=2650 dst=r3 src=r0 offset=0 imm=0 +#line 272 "sample/undocked/map.c" + r3 = IMMEDIATE(0); + // EBPF_OP_CALL pc=2651 dst=r0 src=r0 offset=0 imm=14 +#line 272 "sample/undocked/map.c" + r0 = test_maps_helpers[7].address(r1, r2, r3, r4, r5, context); +#line 272 "sample/undocked/map.c" + if ((test_maps_helpers[7].tail_call) && (r0 == 0)) { +#line 272 "sample/undocked/map.c" + return 0; +#line 272 "sample/undocked/map.c" + } + // EBPF_OP_JA pc=2652 dst=r0 src=r0 offset=-451 imm=0 #line 272 "sample/undocked/map.c" - goto label_161; + goto label_140; label_165: // EBPF_OP_LDXW pc=2653 dst=r3 src=r10 offset=-4 imm=0 #line 272 "sample/undocked/map.c" @@ -8316,9 +8316,9 @@ test_maps(void* context) goto label_167; #line 273 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2687 dst=r0 src=r0 offset=-59 imm=0 + // EBPF_OP_JA pc=2687 dst=r0 src=r0 offset=-61 imm=0 #line 273 "sample/undocked/map.c" - goto label_164; + goto label_163; label_167: // EBPF_OP_LDXW pc=2688 dst=r3 src=r10 offset=-4 imm=0 #line 273 "sample/undocked/map.c" @@ -8419,9 +8419,9 @@ test_maps(void* context) goto label_169; #line 274 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2722 dst=r0 src=r0 offset=-94 imm=0 + // EBPF_OP_JA pc=2722 dst=r0 src=r0 offset=-96 imm=0 #line 274 "sample/undocked/map.c" - goto label_164; + goto label_163; label_169: // EBPF_OP_LDXW pc=2723 dst=r3 src=r10 offset=-4 imm=0 #line 274 "sample/undocked/map.c" @@ -8522,9 +8522,9 @@ test_maps(void* context) goto label_171; #line 275 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2757 dst=r0 src=r0 offset=-129 imm=0 + // EBPF_OP_JA pc=2757 dst=r0 src=r0 offset=-131 imm=0 #line 275 "sample/undocked/map.c" - goto label_164; + goto label_163; label_171: // EBPF_OP_LDXW pc=2758 dst=r3 src=r10 offset=-4 imm=0 #line 275 "sample/undocked/map.c" @@ -8625,9 +8625,9 @@ test_maps(void* context) goto label_173; #line 276 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2792 dst=r0 src=r0 offset=-164 imm=0 + // EBPF_OP_JA pc=2792 dst=r0 src=r0 offset=-166 imm=0 #line 276 "sample/undocked/map.c" - goto label_164; + goto label_163; label_173: // EBPF_OP_LDXW pc=2793 dst=r3 src=r10 offset=-4 imm=0 #line 276 "sample/undocked/map.c" @@ -8728,9 +8728,9 @@ test_maps(void* context) goto label_175; #line 277 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2827 dst=r0 src=r0 offset=-199 imm=0 + // EBPF_OP_JA pc=2827 dst=r0 src=r0 offset=-201 imm=0 #line 277 "sample/undocked/map.c" - goto label_164; + goto label_163; label_175: // EBPF_OP_LDXW pc=2828 dst=r3 src=r10 offset=-4 imm=0 #line 277 "sample/undocked/map.c" @@ -8831,9 +8831,9 @@ test_maps(void* context) goto label_177; #line 278 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2862 dst=r0 src=r0 offset=-234 imm=0 + // EBPF_OP_JA pc=2862 dst=r0 src=r0 offset=-236 imm=0 #line 278 "sample/undocked/map.c" - goto label_164; + goto label_163; label_177: // EBPF_OP_LDXW pc=2863 dst=r3 src=r10 offset=-4 imm=0 #line 278 "sample/undocked/map.c" @@ -8934,9 +8934,9 @@ test_maps(void* context) goto label_179; #line 279 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2897 dst=r0 src=r0 offset=-269 imm=0 + // EBPF_OP_JA pc=2897 dst=r0 src=r0 offset=-271 imm=0 #line 279 "sample/undocked/map.c" - goto label_164; + goto label_163; label_179: // EBPF_OP_LDXW pc=2898 dst=r3 src=r10 offset=-4 imm=0 #line 279 "sample/undocked/map.c" @@ -9037,9 +9037,9 @@ test_maps(void* context) goto label_181; #line 280 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2932 dst=r0 src=r0 offset=-304 imm=0 + // EBPF_OP_JA pc=2932 dst=r0 src=r0 offset=-306 imm=0 #line 280 "sample/undocked/map.c" - goto label_164; + goto label_163; label_181: // EBPF_OP_LDXW pc=2933 dst=r3 src=r10 offset=-4 imm=0 #line 280 "sample/undocked/map.c" @@ -9140,9 +9140,9 @@ test_maps(void* context) goto label_183; #line 281 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2967 dst=r0 src=r0 offset=-339 imm=0 + // EBPF_OP_JA pc=2967 dst=r0 src=r0 offset=-341 imm=0 #line 281 "sample/undocked/map.c" - goto label_164; + goto label_163; label_183: // EBPF_OP_LDXW pc=2968 dst=r3 src=r10 offset=-4 imm=0 #line 281 "sample/undocked/map.c" diff --git a/tests/bpf2c_tests/expected/map_reuse_2_dll.c b/tests/bpf2c_tests/expected/map_reuse_2_dll.c index a93ccd27ab..68a891e9ce 100644 --- a/tests/bpf2c_tests/expected/map_reuse_2_dll.c +++ b/tests/bpf2c_tests/expected/map_reuse_2_dll.c @@ -124,8 +124,6 @@ lookup_update(void* context) register uint64_t r5 = 0; #line 50 "sample/undocked/map_reuse_2.c" register uint64_t r6 = 0; -#line 50 "sample/undocked/map_reuse_2.c" - register uint64_t r7 = 0; #line 50 "sample/undocked/map_reuse_2.c" register uint64_t r10 = 0; @@ -186,47 +184,47 @@ lookup_update(void* context) return 0; #line 58 "sample/undocked/map_reuse_2.c" } - // EBPF_OP_MOV64_REG pc=13 dst=r7 src=r0 offset=0 imm=0 -#line 58 "sample/undocked/map_reuse_2.c" - r7 = r0; - // EBPF_OP_JNE_IMM pc=14 dst=r7 src=r0 offset=1 imm=0 + // EBPF_OP_JNE_IMM pc=13 dst=r0 src=r0 offset=1 imm=0 #line 59 "sample/undocked/map_reuse_2.c" - if (r7 != IMMEDIATE(0)) { + if (r0 != IMMEDIATE(0)) { #line 59 "sample/undocked/map_reuse_2.c" goto label_1; #line 59 "sample/undocked/map_reuse_2.c" } - // EBPF_OP_JA pc=15 dst=r0 src=r0 offset=12 imm=0 + // EBPF_OP_JA pc=14 dst=r0 src=r0 offset=13 imm=0 #line 59 "sample/undocked/map_reuse_2.c" goto label_2; label_1: - // EBPF_OP_STXW pc=16 dst=r10 src=r6 offset=-12 imm=0 + // EBPF_OP_STXW pc=15 dst=r10 src=r6 offset=-12 imm=0 #line 61 "sample/undocked/map_reuse_2.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-12)) = (uint32_t)r6; - // EBPF_OP_LDXW pc=17 dst=r1 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=16 dst=r1 src=r0 offset=0 imm=0 #line 62 "sample/undocked/map_reuse_2.c" - r1 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_STXW pc=18 dst=r10 src=r1 offset=-16 imm=0 + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_STXW pc=17 dst=r10 src=r1 offset=-16 imm=0 #line 62 "sample/undocked/map_reuse_2.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint32_t)r1; - // EBPF_OP_MOV64_REG pc=19 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=18 dst=r2 src=r10 offset=0 imm=0 #line 62 "sample/undocked/map_reuse_2.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=20 dst=r2 src=r0 offset=0 imm=-12 + // EBPF_OP_ADD64_IMM pc=19 dst=r2 src=r0 offset=0 imm=-12 #line 61 "sample/undocked/map_reuse_2.c" r2 += IMMEDIATE(-12); - // EBPF_OP_MOV64_REG pc=21 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=20 dst=r3 src=r10 offset=0 imm=0 #line 61 "sample/undocked/map_reuse_2.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=22 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=21 dst=r3 src=r0 offset=0 imm=-16 #line 61 "sample/undocked/map_reuse_2.c" r3 += IMMEDIATE(-16); - // EBPF_OP_LDDW pc=23 dst=r1 src=r1 offset=0 imm=3 + // EBPF_OP_LDDW pc=22 dst=r1 src=r1 offset=0 imm=3 #line 63 "sample/undocked/map_reuse_2.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_IMM pc=25 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=24 dst=r4 src=r0 offset=0 imm=0 #line 63 "sample/undocked/map_reuse_2.c" r4 = IMMEDIATE(0); + // EBPF_OP_MOV64_REG pc=25 dst=r6 src=r0 offset=0 imm=0 +#line 63 "sample/undocked/map_reuse_2.c" + r6 = r0; // EBPF_OP_CALL pc=26 dst=r0 src=r0 offset=0 imm=2 #line 63 "sample/undocked/map_reuse_2.c" r0 = lookup_update_helpers[1].address(r1, r2, r3, r4, r5, context); @@ -236,9 +234,9 @@ lookup_update(void* context) return 0; #line 63 "sample/undocked/map_reuse_2.c" } - // EBPF_OP_LDXW pc=27 dst=r6 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=27 dst=r6 src=r6 offset=0 imm=0 #line 65 "sample/undocked/map_reuse_2.c" - r6 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); + r6 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(0)); label_2: // EBPF_OP_MOV64_REG pc=28 dst=r0 src=r6 offset=0 imm=0 #line 69 "sample/undocked/map_reuse_2.c" diff --git a/tests/bpf2c_tests/expected/map_reuse_2_raw.c b/tests/bpf2c_tests/expected/map_reuse_2_raw.c index d18f0e6ee2..3d16e96100 100644 --- a/tests/bpf2c_tests/expected/map_reuse_2_raw.c +++ b/tests/bpf2c_tests/expected/map_reuse_2_raw.c @@ -98,8 +98,6 @@ lookup_update(void* context) register uint64_t r5 = 0; #line 50 "sample/undocked/map_reuse_2.c" register uint64_t r6 = 0; -#line 50 "sample/undocked/map_reuse_2.c" - register uint64_t r7 = 0; #line 50 "sample/undocked/map_reuse_2.c" register uint64_t r10 = 0; @@ -160,47 +158,47 @@ lookup_update(void* context) return 0; #line 58 "sample/undocked/map_reuse_2.c" } - // EBPF_OP_MOV64_REG pc=13 dst=r7 src=r0 offset=0 imm=0 -#line 58 "sample/undocked/map_reuse_2.c" - r7 = r0; - // EBPF_OP_JNE_IMM pc=14 dst=r7 src=r0 offset=1 imm=0 + // EBPF_OP_JNE_IMM pc=13 dst=r0 src=r0 offset=1 imm=0 #line 59 "sample/undocked/map_reuse_2.c" - if (r7 != IMMEDIATE(0)) { + if (r0 != IMMEDIATE(0)) { #line 59 "sample/undocked/map_reuse_2.c" goto label_1; #line 59 "sample/undocked/map_reuse_2.c" } - // EBPF_OP_JA pc=15 dst=r0 src=r0 offset=12 imm=0 + // EBPF_OP_JA pc=14 dst=r0 src=r0 offset=13 imm=0 #line 59 "sample/undocked/map_reuse_2.c" goto label_2; label_1: - // EBPF_OP_STXW pc=16 dst=r10 src=r6 offset=-12 imm=0 + // EBPF_OP_STXW pc=15 dst=r10 src=r6 offset=-12 imm=0 #line 61 "sample/undocked/map_reuse_2.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-12)) = (uint32_t)r6; - // EBPF_OP_LDXW pc=17 dst=r1 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=16 dst=r1 src=r0 offset=0 imm=0 #line 62 "sample/undocked/map_reuse_2.c" - r1 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_STXW pc=18 dst=r10 src=r1 offset=-16 imm=0 + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_STXW pc=17 dst=r10 src=r1 offset=-16 imm=0 #line 62 "sample/undocked/map_reuse_2.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint32_t)r1; - // EBPF_OP_MOV64_REG pc=19 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=18 dst=r2 src=r10 offset=0 imm=0 #line 62 "sample/undocked/map_reuse_2.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=20 dst=r2 src=r0 offset=0 imm=-12 + // EBPF_OP_ADD64_IMM pc=19 dst=r2 src=r0 offset=0 imm=-12 #line 61 "sample/undocked/map_reuse_2.c" r2 += IMMEDIATE(-12); - // EBPF_OP_MOV64_REG pc=21 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=20 dst=r3 src=r10 offset=0 imm=0 #line 61 "sample/undocked/map_reuse_2.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=22 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=21 dst=r3 src=r0 offset=0 imm=-16 #line 61 "sample/undocked/map_reuse_2.c" r3 += IMMEDIATE(-16); - // EBPF_OP_LDDW pc=23 dst=r1 src=r1 offset=0 imm=3 + // EBPF_OP_LDDW pc=22 dst=r1 src=r1 offset=0 imm=3 #line 63 "sample/undocked/map_reuse_2.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_IMM pc=25 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=24 dst=r4 src=r0 offset=0 imm=0 #line 63 "sample/undocked/map_reuse_2.c" r4 = IMMEDIATE(0); + // EBPF_OP_MOV64_REG pc=25 dst=r6 src=r0 offset=0 imm=0 +#line 63 "sample/undocked/map_reuse_2.c" + r6 = r0; // EBPF_OP_CALL pc=26 dst=r0 src=r0 offset=0 imm=2 #line 63 "sample/undocked/map_reuse_2.c" r0 = lookup_update_helpers[1].address(r1, r2, r3, r4, r5, context); @@ -210,9 +208,9 @@ lookup_update(void* context) return 0; #line 63 "sample/undocked/map_reuse_2.c" } - // EBPF_OP_LDXW pc=27 dst=r6 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=27 dst=r6 src=r6 offset=0 imm=0 #line 65 "sample/undocked/map_reuse_2.c" - r6 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); + r6 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(0)); label_2: // EBPF_OP_MOV64_REG pc=28 dst=r0 src=r6 offset=0 imm=0 #line 69 "sample/undocked/map_reuse_2.c" diff --git a/tests/bpf2c_tests/expected/map_reuse_2_sys.c b/tests/bpf2c_tests/expected/map_reuse_2_sys.c index fe7ebd13f7..2388398a36 100644 --- a/tests/bpf2c_tests/expected/map_reuse_2_sys.c +++ b/tests/bpf2c_tests/expected/map_reuse_2_sys.c @@ -259,8 +259,6 @@ lookup_update(void* context) register uint64_t r5 = 0; #line 50 "sample/undocked/map_reuse_2.c" register uint64_t r6 = 0; -#line 50 "sample/undocked/map_reuse_2.c" - register uint64_t r7 = 0; #line 50 "sample/undocked/map_reuse_2.c" register uint64_t r10 = 0; @@ -321,47 +319,47 @@ lookup_update(void* context) return 0; #line 58 "sample/undocked/map_reuse_2.c" } - // EBPF_OP_MOV64_REG pc=13 dst=r7 src=r0 offset=0 imm=0 -#line 58 "sample/undocked/map_reuse_2.c" - r7 = r0; - // EBPF_OP_JNE_IMM pc=14 dst=r7 src=r0 offset=1 imm=0 + // EBPF_OP_JNE_IMM pc=13 dst=r0 src=r0 offset=1 imm=0 #line 59 "sample/undocked/map_reuse_2.c" - if (r7 != IMMEDIATE(0)) { + if (r0 != IMMEDIATE(0)) { #line 59 "sample/undocked/map_reuse_2.c" goto label_1; #line 59 "sample/undocked/map_reuse_2.c" } - // EBPF_OP_JA pc=15 dst=r0 src=r0 offset=12 imm=0 + // EBPF_OP_JA pc=14 dst=r0 src=r0 offset=13 imm=0 #line 59 "sample/undocked/map_reuse_2.c" goto label_2; label_1: - // EBPF_OP_STXW pc=16 dst=r10 src=r6 offset=-12 imm=0 + // EBPF_OP_STXW pc=15 dst=r10 src=r6 offset=-12 imm=0 #line 61 "sample/undocked/map_reuse_2.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-12)) = (uint32_t)r6; - // EBPF_OP_LDXW pc=17 dst=r1 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=16 dst=r1 src=r0 offset=0 imm=0 #line 62 "sample/undocked/map_reuse_2.c" - r1 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_STXW pc=18 dst=r10 src=r1 offset=-16 imm=0 + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_STXW pc=17 dst=r10 src=r1 offset=-16 imm=0 #line 62 "sample/undocked/map_reuse_2.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint32_t)r1; - // EBPF_OP_MOV64_REG pc=19 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=18 dst=r2 src=r10 offset=0 imm=0 #line 62 "sample/undocked/map_reuse_2.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=20 dst=r2 src=r0 offset=0 imm=-12 + // EBPF_OP_ADD64_IMM pc=19 dst=r2 src=r0 offset=0 imm=-12 #line 61 "sample/undocked/map_reuse_2.c" r2 += IMMEDIATE(-12); - // EBPF_OP_MOV64_REG pc=21 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=20 dst=r3 src=r10 offset=0 imm=0 #line 61 "sample/undocked/map_reuse_2.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=22 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=21 dst=r3 src=r0 offset=0 imm=-16 #line 61 "sample/undocked/map_reuse_2.c" r3 += IMMEDIATE(-16); - // EBPF_OP_LDDW pc=23 dst=r1 src=r1 offset=0 imm=3 + // EBPF_OP_LDDW pc=22 dst=r1 src=r1 offset=0 imm=3 #line 63 "sample/undocked/map_reuse_2.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_IMM pc=25 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=24 dst=r4 src=r0 offset=0 imm=0 #line 63 "sample/undocked/map_reuse_2.c" r4 = IMMEDIATE(0); + // EBPF_OP_MOV64_REG pc=25 dst=r6 src=r0 offset=0 imm=0 +#line 63 "sample/undocked/map_reuse_2.c" + r6 = r0; // EBPF_OP_CALL pc=26 dst=r0 src=r0 offset=0 imm=2 #line 63 "sample/undocked/map_reuse_2.c" r0 = lookup_update_helpers[1].address(r1, r2, r3, r4, r5, context); @@ -371,9 +369,9 @@ lookup_update(void* context) return 0; #line 63 "sample/undocked/map_reuse_2.c" } - // EBPF_OP_LDXW pc=27 dst=r6 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=27 dst=r6 src=r6 offset=0 imm=0 #line 65 "sample/undocked/map_reuse_2.c" - r6 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); + r6 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(0)); label_2: // EBPF_OP_MOV64_REG pc=28 dst=r0 src=r6 offset=0 imm=0 #line 69 "sample/undocked/map_reuse_2.c" diff --git a/tests/bpf2c_tests/expected/map_reuse_dll.c b/tests/bpf2c_tests/expected/map_reuse_dll.c index ef43b4fd6f..695455edf2 100644 --- a/tests/bpf2c_tests/expected/map_reuse_dll.c +++ b/tests/bpf2c_tests/expected/map_reuse_dll.c @@ -124,8 +124,6 @@ lookup_update(void* context) register uint64_t r5 = 0; #line 49 "sample/undocked/map_reuse.c" register uint64_t r6 = 0; -#line 49 "sample/undocked/map_reuse.c" - register uint64_t r7 = 0; #line 49 "sample/undocked/map_reuse.c" register uint64_t r10 = 0; @@ -186,47 +184,47 @@ lookup_update(void* context) return 0; #line 57 "sample/undocked/map_reuse.c" } - // EBPF_OP_MOV64_REG pc=13 dst=r7 src=r0 offset=0 imm=0 -#line 57 "sample/undocked/map_reuse.c" - r7 = r0; - // EBPF_OP_JNE_IMM pc=14 dst=r7 src=r0 offset=1 imm=0 + // EBPF_OP_JNE_IMM pc=13 dst=r0 src=r0 offset=1 imm=0 #line 58 "sample/undocked/map_reuse.c" - if (r7 != IMMEDIATE(0)) { + if (r0 != IMMEDIATE(0)) { #line 58 "sample/undocked/map_reuse.c" goto label_1; #line 58 "sample/undocked/map_reuse.c" } - // EBPF_OP_JA pc=15 dst=r0 src=r0 offset=12 imm=0 + // EBPF_OP_JA pc=14 dst=r0 src=r0 offset=13 imm=0 #line 58 "sample/undocked/map_reuse.c" goto label_2; label_1: - // EBPF_OP_STXW pc=16 dst=r10 src=r6 offset=-12 imm=0 + // EBPF_OP_STXW pc=15 dst=r10 src=r6 offset=-12 imm=0 #line 60 "sample/undocked/map_reuse.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-12)) = (uint32_t)r6; - // EBPF_OP_LDXW pc=17 dst=r1 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=16 dst=r1 src=r0 offset=0 imm=0 #line 61 "sample/undocked/map_reuse.c" - r1 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_STXW pc=18 dst=r10 src=r1 offset=-16 imm=0 + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_STXW pc=17 dst=r10 src=r1 offset=-16 imm=0 #line 61 "sample/undocked/map_reuse.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint32_t)r1; - // EBPF_OP_MOV64_REG pc=19 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=18 dst=r2 src=r10 offset=0 imm=0 #line 61 "sample/undocked/map_reuse.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=20 dst=r2 src=r0 offset=0 imm=-12 + // EBPF_OP_ADD64_IMM pc=19 dst=r2 src=r0 offset=0 imm=-12 #line 60 "sample/undocked/map_reuse.c" r2 += IMMEDIATE(-12); - // EBPF_OP_MOV64_REG pc=21 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=20 dst=r3 src=r10 offset=0 imm=0 #line 60 "sample/undocked/map_reuse.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=22 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=21 dst=r3 src=r0 offset=0 imm=-16 #line 60 "sample/undocked/map_reuse.c" r3 += IMMEDIATE(-16); - // EBPF_OP_LDDW pc=23 dst=r1 src=r1 offset=0 imm=3 + // EBPF_OP_LDDW pc=22 dst=r1 src=r1 offset=0 imm=3 #line 62 "sample/undocked/map_reuse.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_IMM pc=25 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=24 dst=r4 src=r0 offset=0 imm=0 #line 62 "sample/undocked/map_reuse.c" r4 = IMMEDIATE(0); + // EBPF_OP_MOV64_REG pc=25 dst=r6 src=r0 offset=0 imm=0 +#line 62 "sample/undocked/map_reuse.c" + r6 = r0; // EBPF_OP_CALL pc=26 dst=r0 src=r0 offset=0 imm=2 #line 62 "sample/undocked/map_reuse.c" r0 = lookup_update_helpers[1].address(r1, r2, r3, r4, r5, context); @@ -236,9 +234,9 @@ lookup_update(void* context) return 0; #line 62 "sample/undocked/map_reuse.c" } - // EBPF_OP_LDXW pc=27 dst=r6 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=27 dst=r6 src=r6 offset=0 imm=0 #line 64 "sample/undocked/map_reuse.c" - r6 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); + r6 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(0)); label_2: // EBPF_OP_MOV64_REG pc=28 dst=r0 src=r6 offset=0 imm=0 #line 68 "sample/undocked/map_reuse.c" diff --git a/tests/bpf2c_tests/expected/map_reuse_raw.c b/tests/bpf2c_tests/expected/map_reuse_raw.c index 0d22792ecb..c169ab0167 100644 --- a/tests/bpf2c_tests/expected/map_reuse_raw.c +++ b/tests/bpf2c_tests/expected/map_reuse_raw.c @@ -98,8 +98,6 @@ lookup_update(void* context) register uint64_t r5 = 0; #line 49 "sample/undocked/map_reuse.c" register uint64_t r6 = 0; -#line 49 "sample/undocked/map_reuse.c" - register uint64_t r7 = 0; #line 49 "sample/undocked/map_reuse.c" register uint64_t r10 = 0; @@ -160,47 +158,47 @@ lookup_update(void* context) return 0; #line 57 "sample/undocked/map_reuse.c" } - // EBPF_OP_MOV64_REG pc=13 dst=r7 src=r0 offset=0 imm=0 -#line 57 "sample/undocked/map_reuse.c" - r7 = r0; - // EBPF_OP_JNE_IMM pc=14 dst=r7 src=r0 offset=1 imm=0 + // EBPF_OP_JNE_IMM pc=13 dst=r0 src=r0 offset=1 imm=0 #line 58 "sample/undocked/map_reuse.c" - if (r7 != IMMEDIATE(0)) { + if (r0 != IMMEDIATE(0)) { #line 58 "sample/undocked/map_reuse.c" goto label_1; #line 58 "sample/undocked/map_reuse.c" } - // EBPF_OP_JA pc=15 dst=r0 src=r0 offset=12 imm=0 + // EBPF_OP_JA pc=14 dst=r0 src=r0 offset=13 imm=0 #line 58 "sample/undocked/map_reuse.c" goto label_2; label_1: - // EBPF_OP_STXW pc=16 dst=r10 src=r6 offset=-12 imm=0 + // EBPF_OP_STXW pc=15 dst=r10 src=r6 offset=-12 imm=0 #line 60 "sample/undocked/map_reuse.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-12)) = (uint32_t)r6; - // EBPF_OP_LDXW pc=17 dst=r1 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=16 dst=r1 src=r0 offset=0 imm=0 #line 61 "sample/undocked/map_reuse.c" - r1 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_STXW pc=18 dst=r10 src=r1 offset=-16 imm=0 + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_STXW pc=17 dst=r10 src=r1 offset=-16 imm=0 #line 61 "sample/undocked/map_reuse.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint32_t)r1; - // EBPF_OP_MOV64_REG pc=19 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=18 dst=r2 src=r10 offset=0 imm=0 #line 61 "sample/undocked/map_reuse.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=20 dst=r2 src=r0 offset=0 imm=-12 + // EBPF_OP_ADD64_IMM pc=19 dst=r2 src=r0 offset=0 imm=-12 #line 60 "sample/undocked/map_reuse.c" r2 += IMMEDIATE(-12); - // EBPF_OP_MOV64_REG pc=21 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=20 dst=r3 src=r10 offset=0 imm=0 #line 60 "sample/undocked/map_reuse.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=22 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=21 dst=r3 src=r0 offset=0 imm=-16 #line 60 "sample/undocked/map_reuse.c" r3 += IMMEDIATE(-16); - // EBPF_OP_LDDW pc=23 dst=r1 src=r1 offset=0 imm=3 + // EBPF_OP_LDDW pc=22 dst=r1 src=r1 offset=0 imm=3 #line 62 "sample/undocked/map_reuse.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_IMM pc=25 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=24 dst=r4 src=r0 offset=0 imm=0 #line 62 "sample/undocked/map_reuse.c" r4 = IMMEDIATE(0); + // EBPF_OP_MOV64_REG pc=25 dst=r6 src=r0 offset=0 imm=0 +#line 62 "sample/undocked/map_reuse.c" + r6 = r0; // EBPF_OP_CALL pc=26 dst=r0 src=r0 offset=0 imm=2 #line 62 "sample/undocked/map_reuse.c" r0 = lookup_update_helpers[1].address(r1, r2, r3, r4, r5, context); @@ -210,9 +208,9 @@ lookup_update(void* context) return 0; #line 62 "sample/undocked/map_reuse.c" } - // EBPF_OP_LDXW pc=27 dst=r6 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=27 dst=r6 src=r6 offset=0 imm=0 #line 64 "sample/undocked/map_reuse.c" - r6 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); + r6 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(0)); label_2: // EBPF_OP_MOV64_REG pc=28 dst=r0 src=r6 offset=0 imm=0 #line 68 "sample/undocked/map_reuse.c" diff --git a/tests/bpf2c_tests/expected/map_reuse_sys.c b/tests/bpf2c_tests/expected/map_reuse_sys.c index 2b3b80438d..25aca95507 100644 --- a/tests/bpf2c_tests/expected/map_reuse_sys.c +++ b/tests/bpf2c_tests/expected/map_reuse_sys.c @@ -259,8 +259,6 @@ lookup_update(void* context) register uint64_t r5 = 0; #line 49 "sample/undocked/map_reuse.c" register uint64_t r6 = 0; -#line 49 "sample/undocked/map_reuse.c" - register uint64_t r7 = 0; #line 49 "sample/undocked/map_reuse.c" register uint64_t r10 = 0; @@ -321,47 +319,47 @@ lookup_update(void* context) return 0; #line 57 "sample/undocked/map_reuse.c" } - // EBPF_OP_MOV64_REG pc=13 dst=r7 src=r0 offset=0 imm=0 -#line 57 "sample/undocked/map_reuse.c" - r7 = r0; - // EBPF_OP_JNE_IMM pc=14 dst=r7 src=r0 offset=1 imm=0 + // EBPF_OP_JNE_IMM pc=13 dst=r0 src=r0 offset=1 imm=0 #line 58 "sample/undocked/map_reuse.c" - if (r7 != IMMEDIATE(0)) { + if (r0 != IMMEDIATE(0)) { #line 58 "sample/undocked/map_reuse.c" goto label_1; #line 58 "sample/undocked/map_reuse.c" } - // EBPF_OP_JA pc=15 dst=r0 src=r0 offset=12 imm=0 + // EBPF_OP_JA pc=14 dst=r0 src=r0 offset=13 imm=0 #line 58 "sample/undocked/map_reuse.c" goto label_2; label_1: - // EBPF_OP_STXW pc=16 dst=r10 src=r6 offset=-12 imm=0 + // EBPF_OP_STXW pc=15 dst=r10 src=r6 offset=-12 imm=0 #line 60 "sample/undocked/map_reuse.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-12)) = (uint32_t)r6; - // EBPF_OP_LDXW pc=17 dst=r1 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=16 dst=r1 src=r0 offset=0 imm=0 #line 61 "sample/undocked/map_reuse.c" - r1 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_STXW pc=18 dst=r10 src=r1 offset=-16 imm=0 + r1 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_STXW pc=17 dst=r10 src=r1 offset=-16 imm=0 #line 61 "sample/undocked/map_reuse.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint32_t)r1; - // EBPF_OP_MOV64_REG pc=19 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=18 dst=r2 src=r10 offset=0 imm=0 #line 61 "sample/undocked/map_reuse.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=20 dst=r2 src=r0 offset=0 imm=-12 + // EBPF_OP_ADD64_IMM pc=19 dst=r2 src=r0 offset=0 imm=-12 #line 60 "sample/undocked/map_reuse.c" r2 += IMMEDIATE(-12); - // EBPF_OP_MOV64_REG pc=21 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=20 dst=r3 src=r10 offset=0 imm=0 #line 60 "sample/undocked/map_reuse.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=22 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=21 dst=r3 src=r0 offset=0 imm=-16 #line 60 "sample/undocked/map_reuse.c" r3 += IMMEDIATE(-16); - // EBPF_OP_LDDW pc=23 dst=r1 src=r1 offset=0 imm=3 + // EBPF_OP_LDDW pc=22 dst=r1 src=r1 offset=0 imm=3 #line 62 "sample/undocked/map_reuse.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_IMM pc=25 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=24 dst=r4 src=r0 offset=0 imm=0 #line 62 "sample/undocked/map_reuse.c" r4 = IMMEDIATE(0); + // EBPF_OP_MOV64_REG pc=25 dst=r6 src=r0 offset=0 imm=0 +#line 62 "sample/undocked/map_reuse.c" + r6 = r0; // EBPF_OP_CALL pc=26 dst=r0 src=r0 offset=0 imm=2 #line 62 "sample/undocked/map_reuse.c" r0 = lookup_update_helpers[1].address(r1, r2, r3, r4, r5, context); @@ -371,9 +369,9 @@ lookup_update(void* context) return 0; #line 62 "sample/undocked/map_reuse.c" } - // EBPF_OP_LDXW pc=27 dst=r6 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=27 dst=r6 src=r6 offset=0 imm=0 #line 64 "sample/undocked/map_reuse.c" - r6 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); + r6 = *(uint32_t*)(uintptr_t)(r6 + OFFSET(0)); label_2: // EBPF_OP_MOV64_REG pc=28 dst=r0 src=r6 offset=0 imm=0 #line 68 "sample/undocked/map_reuse.c" diff --git a/tests/bpf2c_tests/expected/map_sys.c b/tests/bpf2c_tests/expected/map_sys.c index 1e6f51d08a..7fff62360c 100644 --- a/tests/bpf2c_tests/expected/map_sys.c +++ b/tests/bpf2c_tests/expected/map_sys.c @@ -5594,11 +5594,11 @@ test_maps(void* context) // EBPF_OP_RSH64_IMM pc=1712 dst=r1 src=r0 offset=0 imm=32 #line 264 "sample/undocked/map.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JEQ_IMM pc=1713 dst=r1 src=r0 offset=27 imm=0 + // EBPF_OP_JEQ_IMM pc=1713 dst=r1 src=r0 offset=25 imm=0 #line 264 "sample/undocked/map.c" if (r1 == IMMEDIATE(0)) { #line 264 "sample/undocked/map.c" - goto label_110; + goto label_109; #line 264 "sample/undocked/map.c" } // EBPF_OP_MOV64_IMM pc=1714 dst=r1 src=r0 offset=0 imm=100 @@ -5655,101 +5655,88 @@ test_maps(void* context) // EBPF_OP_MOV64_IMM pc=1737 dst=r2 src=r0 offset=0 imm=50 #line 264 "sample/undocked/map.c" r2 = IMMEDIATE(50); -label_109: - // EBPF_OP_MOV64_IMM pc=1738 dst=r3 src=r0 offset=0 imm=0 -#line 264 "sample/undocked/map.c" - r3 = IMMEDIATE(0); - // EBPF_OP_CALL pc=1739 dst=r0 src=r0 offset=0 imm=14 -#line 264 "sample/undocked/map.c" - r0 = test_maps_helpers[7].address(r1, r2, r3, r4, r5, context); + // EBPF_OP_JA pc=1738 dst=r0 src=r0 offset=60 imm=0 #line 264 "sample/undocked/map.c" - if ((test_maps_helpers[7].tail_call) && (r0 == 0)) { -#line 264 "sample/undocked/map.c" - return 0; -#line 264 "sample/undocked/map.c" - } - // EBPF_OP_JA pc=1740 dst=r0 src=r0 offset=-429 imm=0 -#line 264 "sample/undocked/map.c" - goto label_84; -label_110: - // EBPF_OP_LDXW pc=1741 dst=r3 src=r10 offset=-4 imm=0 + goto label_112; +label_109: + // EBPF_OP_LDXW pc=1739 dst=r3 src=r10 offset=-4 imm=0 #line 264 "sample/undocked/map.c" r3 = *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)); - // EBPF_OP_JEQ_IMM pc=1742 dst=r3 src=r0 offset=22 imm=1 + // EBPF_OP_JEQ_IMM pc=1740 dst=r3 src=r0 offset=22 imm=1 #line 264 "sample/undocked/map.c" if (r3 == IMMEDIATE(1)) { #line 264 "sample/undocked/map.c" - goto label_111; + goto label_110; #line 264 "sample/undocked/map.c" } - // EBPF_OP_MOV64_IMM pc=1743 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=1741 dst=r1 src=r0 offset=0 imm=0 #line 264 "sample/undocked/map.c" r1 = IMMEDIATE(0); - // EBPF_OP_STXB pc=1744 dst=r10 src=r1 offset=-72 imm=0 + // EBPF_OP_STXB pc=1742 dst=r10 src=r1 offset=-72 imm=0 #line 264 "sample/undocked/map.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint8_t)r1; - // EBPF_OP_LDDW pc=1745 dst=r1 src=r0 offset=0 imm=1852404835 + // EBPF_OP_LDDW pc=1743 dst=r1 src=r0 offset=0 imm=1852404835 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7216209606537213027; - // EBPF_OP_STXDW pc=1747 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=1745 dst=r10 src=r1 offset=-80 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1748 dst=r1 src=r0 offset=0 imm=543434016 + // EBPF_OP_LDDW pc=1746 dst=r1 src=r0 offset=0 imm=543434016 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7309474570952779040; - // EBPF_OP_STXDW pc=1750 dst=r10 src=r1 offset=-88 imm=0 + // EBPF_OP_STXDW pc=1748 dst=r10 src=r1 offset=-88 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-88)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1751 dst=r1 src=r0 offset=0 imm=1701978221 + // EBPF_OP_LDDW pc=1749 dst=r1 src=r0 offset=0 imm=1701978221 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7958552634295722093; - // EBPF_OP_STXDW pc=1753 dst=r10 src=r1 offset=-96 imm=0 + // EBPF_OP_STXDW pc=1751 dst=r10 src=r1 offset=-96 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-96)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1754 dst=r1 src=r0 offset=0 imm=1801807216 + // EBPF_OP_LDDW pc=1752 dst=r1 src=r0 offset=0 imm=1801807216 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7308327755813578096; - // EBPF_OP_STXDW pc=1756 dst=r10 src=r1 offset=-104 imm=0 + // EBPF_OP_STXDW pc=1754 dst=r10 src=r1 offset=-104 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-104)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1757 dst=r1 src=r0 offset=0 imm=1600548962 + // EBPF_OP_LDDW pc=1755 dst=r1 src=r0 offset=0 imm=1600548962 #line 264 "sample/undocked/map.c" r1 = (uint64_t)6877103753374625890; - // EBPF_OP_STXDW pc=1759 dst=r10 src=r1 offset=-112 imm=0 + // EBPF_OP_STXDW pc=1757 dst=r10 src=r1 offset=-112 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-112)) = (uint64_t)r1; - // EBPF_OP_MOV64_REG pc=1760 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1758 dst=r1 src=r10 offset=0 imm=0 #line 264 "sample/undocked/map.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=1761 dst=r1 src=r0 offset=0 imm=-112 + // EBPF_OP_ADD64_IMM pc=1759 dst=r1 src=r0 offset=0 imm=-112 #line 264 "sample/undocked/map.c" r1 += IMMEDIATE(-112); - // EBPF_OP_MOV64_IMM pc=1762 dst=r2 src=r0 offset=0 imm=41 + // EBPF_OP_MOV64_IMM pc=1760 dst=r2 src=r0 offset=0 imm=41 #line 264 "sample/undocked/map.c" r2 = IMMEDIATE(41); - // EBPF_OP_MOV64_IMM pc=1763 dst=r4 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=1761 dst=r4 src=r0 offset=0 imm=1 #line 264 "sample/undocked/map.c" r4 = IMMEDIATE(1); - // EBPF_OP_JA pc=1764 dst=r0 src=r0 offset=-456 imm=0 + // EBPF_OP_JA pc=1762 dst=r0 src=r0 offset=-454 imm=0 #line 264 "sample/undocked/map.c" goto label_83; -label_111: - // EBPF_OP_MOV64_IMM pc=1765 dst=r7 src=r0 offset=0 imm=0 +label_110: + // EBPF_OP_MOV64_IMM pc=1763 dst=r7 src=r0 offset=0 imm=0 #line 264 "sample/undocked/map.c" r7 = IMMEDIATE(0); - // EBPF_OP_STXW pc=1766 dst=r10 src=r7 offset=-4 imm=0 + // EBPF_OP_STXW pc=1764 dst=r10 src=r7 offset=-4 imm=0 #line 272 "sample/undocked/map.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r7; - // EBPF_OP_MOV64_REG pc=1767 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1765 dst=r2 src=r10 offset=0 imm=0 #line 272 "sample/undocked/map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=1768 dst=r2 src=r0 offset=0 imm=-4 + // EBPF_OP_ADD64_IMM pc=1766 dst=r2 src=r0 offset=0 imm=-4 #line 272 "sample/undocked/map.c" r2 += IMMEDIATE(-4); - // EBPF_OP_LDDW pc=1769 dst=r1 src=r1 offset=0 imm=7 + // EBPF_OP_LDDW pc=1767 dst=r1 src=r1 offset=0 imm=7 #line 272 "sample/undocked/map.c" r1 = POINTER(_maps[6].address); - // EBPF_OP_CALL pc=1771 dst=r0 src=r0 offset=0 imm=17 + // EBPF_OP_CALL pc=1769 dst=r0 src=r0 offset=0 imm=17 #line 272 "sample/undocked/map.c" r0 = test_maps_helpers[8].address(r1, r2, r3, r4, r5, context); #line 272 "sample/undocked/map.c" @@ -5758,83 +5745,96 @@ test_maps(void* context) return 0; #line 272 "sample/undocked/map.c" } - // EBPF_OP_MOV64_REG pc=1772 dst=r6 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1770 dst=r6 src=r0 offset=0 imm=0 #line 272 "sample/undocked/map.c" r6 = r0; - // EBPF_OP_MOV64_REG pc=1773 dst=r4 src=r6 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1771 dst=r4 src=r6 offset=0 imm=0 #line 272 "sample/undocked/map.c" r4 = r6; - // EBPF_OP_LSH64_IMM pc=1774 dst=r4 src=r0 offset=0 imm=32 + // EBPF_OP_LSH64_IMM pc=1772 dst=r4 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r4 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_REG pc=1775 dst=r1 src=r4 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1773 dst=r1 src=r4 offset=0 imm=0 #line 272 "sample/undocked/map.c" r1 = r4; - // EBPF_OP_RSH64_IMM pc=1776 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=1774 dst=r1 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JEQ_IMM pc=1777 dst=r1 src=r0 offset=24 imm=0 + // EBPF_OP_JEQ_IMM pc=1775 dst=r1 src=r0 offset=26 imm=0 #line 272 "sample/undocked/map.c" if (r1 == IMMEDIATE(0)) { #line 272 "sample/undocked/map.c" goto label_113; #line 272 "sample/undocked/map.c" } -label_112: - // EBPF_OP_LDDW pc=1778 dst=r1 src=r0 offset=0 imm=1701737077 +label_111: + // EBPF_OP_LDDW pc=1776 dst=r1 src=r0 offset=0 imm=1701737077 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7216209593501643381; - // EBPF_OP_STXDW pc=1780 dst=r10 src=r1 offset=-72 imm=0 + // EBPF_OP_STXDW pc=1778 dst=r10 src=r1 offset=-72 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1781 dst=r1 src=r0 offset=0 imm=1680154740 + // EBPF_OP_LDDW pc=1779 dst=r1 src=r0 offset=0 imm=1680154740 #line 272 "sample/undocked/map.c" r1 = (uint64_t)8387235364492091508; - // EBPF_OP_STXDW pc=1783 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=1781 dst=r10 src=r1 offset=-80 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1784 dst=r1 src=r0 offset=0 imm=1914726254 + // EBPF_OP_LDDW pc=1782 dst=r1 src=r0 offset=0 imm=1914726254 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7815279607914981230; - // EBPF_OP_STXDW pc=1786 dst=r10 src=r1 offset=-88 imm=0 + // EBPF_OP_STXDW pc=1784 dst=r10 src=r1 offset=-88 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-88)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1787 dst=r1 src=r0 offset=0 imm=1886938400 + // EBPF_OP_LDDW pc=1785 dst=r1 src=r0 offset=0 imm=1886938400 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7598807758610654496; - // EBPF_OP_STXDW pc=1789 dst=r10 src=r1 offset=-96 imm=0 + // EBPF_OP_STXDW pc=1787 dst=r10 src=r1 offset=-96 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-96)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1790 dst=r1 src=r0 offset=0 imm=1601204080 + // EBPF_OP_LDDW pc=1788 dst=r1 src=r0 offset=0 imm=1601204080 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7882825905430622064; - // EBPF_OP_STXDW pc=1792 dst=r10 src=r1 offset=-104 imm=0 + // EBPF_OP_STXDW pc=1790 dst=r10 src=r1 offset=-104 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-104)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=1793 dst=r1 src=r0 offset=0 imm=1600548962 + // EBPF_OP_LDDW pc=1791 dst=r1 src=r0 offset=0 imm=1600548962 #line 272 "sample/undocked/map.c" r1 = (uint64_t)6877103753374625890; - // EBPF_OP_STXDW pc=1795 dst=r10 src=r1 offset=-112 imm=0 + // EBPF_OP_STXDW pc=1793 dst=r10 src=r1 offset=-112 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-112)) = (uint64_t)r1; - // EBPF_OP_STXB pc=1796 dst=r10 src=r7 offset=-64 imm=0 + // EBPF_OP_STXB pc=1794 dst=r10 src=r7 offset=-64 imm=0 #line 272 "sample/undocked/map.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint8_t)r7; - // EBPF_OP_ARSH64_IMM pc=1797 dst=r4 src=r0 offset=0 imm=32 + // EBPF_OP_ARSH64_IMM pc=1795 dst=r4 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r4 = (int64_t)r4 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_REG pc=1798 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=1796 dst=r1 src=r10 offset=0 imm=0 #line 272 "sample/undocked/map.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=1799 dst=r1 src=r0 offset=0 imm=-112 + // EBPF_OP_ADD64_IMM pc=1797 dst=r1 src=r0 offset=0 imm=-112 #line 272 "sample/undocked/map.c" r1 += IMMEDIATE(-112); - // EBPF_OP_MOV64_IMM pc=1800 dst=r2 src=r0 offset=0 imm=49 + // EBPF_OP_MOV64_IMM pc=1798 dst=r2 src=r0 offset=0 imm=49 #line 272 "sample/undocked/map.c" r2 = IMMEDIATE(49); - // EBPF_OP_JA pc=1801 dst=r0 src=r0 offset=-64 imm=0 +label_112: + // EBPF_OP_MOV64_IMM pc=1799 dst=r3 src=r0 offset=0 imm=0 +#line 272 "sample/undocked/map.c" + r3 = IMMEDIATE(0); + // EBPF_OP_CALL pc=1800 dst=r0 src=r0 offset=0 imm=14 +#line 272 "sample/undocked/map.c" + r0 = test_maps_helpers[7].address(r1, r2, r3, r4, r5, context); +#line 272 "sample/undocked/map.c" + if ((test_maps_helpers[7].tail_call) && (r0 == 0)) { +#line 272 "sample/undocked/map.c" + return 0; +#line 272 "sample/undocked/map.c" + } + // EBPF_OP_JA pc=1801 dst=r0 src=r0 offset=-490 imm=0 #line 272 "sample/undocked/map.c" - goto label_109; + goto label_84; label_113: // EBPF_OP_LDXW pc=1802 dst=r3 src=r10 offset=-4 imm=0 #line 272 "sample/undocked/map.c" @@ -5935,9 +5935,9 @@ test_maps(void* context) goto label_115; #line 273 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1836 dst=r0 src=r0 offset=-59 imm=0 + // EBPF_OP_JA pc=1836 dst=r0 src=r0 offset=-61 imm=0 #line 273 "sample/undocked/map.c" - goto label_112; + goto label_111; label_115: // EBPF_OP_LDXW pc=1837 dst=r3 src=r10 offset=-4 imm=0 #line 273 "sample/undocked/map.c" @@ -6038,9 +6038,9 @@ test_maps(void* context) goto label_117; #line 274 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1871 dst=r0 src=r0 offset=-94 imm=0 + // EBPF_OP_JA pc=1871 dst=r0 src=r0 offset=-96 imm=0 #line 274 "sample/undocked/map.c" - goto label_112; + goto label_111; label_117: // EBPF_OP_LDXW pc=1872 dst=r3 src=r10 offset=-4 imm=0 #line 274 "sample/undocked/map.c" @@ -6141,9 +6141,9 @@ test_maps(void* context) goto label_119; #line 275 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1906 dst=r0 src=r0 offset=-129 imm=0 + // EBPF_OP_JA pc=1906 dst=r0 src=r0 offset=-131 imm=0 #line 275 "sample/undocked/map.c" - goto label_112; + goto label_111; label_119: // EBPF_OP_LDXW pc=1907 dst=r3 src=r10 offset=-4 imm=0 #line 275 "sample/undocked/map.c" @@ -6244,9 +6244,9 @@ test_maps(void* context) goto label_121; #line 276 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1941 dst=r0 src=r0 offset=-164 imm=0 + // EBPF_OP_JA pc=1941 dst=r0 src=r0 offset=-166 imm=0 #line 276 "sample/undocked/map.c" - goto label_112; + goto label_111; label_121: // EBPF_OP_LDXW pc=1942 dst=r3 src=r10 offset=-4 imm=0 #line 276 "sample/undocked/map.c" @@ -6347,9 +6347,9 @@ test_maps(void* context) goto label_123; #line 277 "sample/undocked/map.c" } - // EBPF_OP_JA pc=1976 dst=r0 src=r0 offset=-199 imm=0 + // EBPF_OP_JA pc=1976 dst=r0 src=r0 offset=-201 imm=0 #line 277 "sample/undocked/map.c" - goto label_112; + goto label_111; label_123: // EBPF_OP_LDXW pc=1977 dst=r3 src=r10 offset=-4 imm=0 #line 277 "sample/undocked/map.c" @@ -6450,9 +6450,9 @@ test_maps(void* context) goto label_125; #line 278 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2011 dst=r0 src=r0 offset=-234 imm=0 + // EBPF_OP_JA pc=2011 dst=r0 src=r0 offset=-236 imm=0 #line 278 "sample/undocked/map.c" - goto label_112; + goto label_111; label_125: // EBPF_OP_LDXW pc=2012 dst=r3 src=r10 offset=-4 imm=0 #line 278 "sample/undocked/map.c" @@ -6553,9 +6553,9 @@ test_maps(void* context) goto label_127; #line 279 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2046 dst=r0 src=r0 offset=-269 imm=0 + // EBPF_OP_JA pc=2046 dst=r0 src=r0 offset=-271 imm=0 #line 279 "sample/undocked/map.c" - goto label_112; + goto label_111; label_127: // EBPF_OP_LDXW pc=2047 dst=r3 src=r10 offset=-4 imm=0 #line 279 "sample/undocked/map.c" @@ -6656,9 +6656,9 @@ test_maps(void* context) goto label_129; #line 280 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2081 dst=r0 src=r0 offset=-304 imm=0 + // EBPF_OP_JA pc=2081 dst=r0 src=r0 offset=-306 imm=0 #line 280 "sample/undocked/map.c" - goto label_112; + goto label_111; label_129: // EBPF_OP_LDXW pc=2082 dst=r3 src=r10 offset=-4 imm=0 #line 280 "sample/undocked/map.c" @@ -6759,9 +6759,9 @@ test_maps(void* context) goto label_131; #line 281 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2116 dst=r0 src=r0 offset=-339 imm=0 + // EBPF_OP_JA pc=2116 dst=r0 src=r0 offset=-341 imm=0 #line 281 "sample/undocked/map.c" - goto label_112; + goto label_111; label_131: // EBPF_OP_LDXW pc=2117 dst=r3 src=r10 offset=-4 imm=0 #line 281 "sample/undocked/map.c" @@ -8136,11 +8136,11 @@ test_maps(void* context) // EBPF_OP_RSH64_IMM pc=2563 dst=r1 src=r0 offset=0 imm=32 #line 264 "sample/undocked/map.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JEQ_IMM pc=2564 dst=r1 src=r0 offset=27 imm=0 + // EBPF_OP_JEQ_IMM pc=2564 dst=r1 src=r0 offset=25 imm=0 #line 264 "sample/undocked/map.c" if (r1 == IMMEDIATE(0)) { #line 264 "sample/undocked/map.c" - goto label_162; + goto label_161; #line 264 "sample/undocked/map.c" } // EBPF_OP_MOV64_IMM pc=2565 dst=r1 src=r0 offset=0 imm=100 @@ -8197,101 +8197,88 @@ test_maps(void* context) // EBPF_OP_MOV64_IMM pc=2588 dst=r2 src=r0 offset=0 imm=50 #line 264 "sample/undocked/map.c" r2 = IMMEDIATE(50); -label_161: - // EBPF_OP_MOV64_IMM pc=2589 dst=r3 src=r0 offset=0 imm=0 -#line 264 "sample/undocked/map.c" - r3 = IMMEDIATE(0); - // EBPF_OP_CALL pc=2590 dst=r0 src=r0 offset=0 imm=14 -#line 264 "sample/undocked/map.c" - r0 = test_maps_helpers[7].address(r1, r2, r3, r4, r5, context); + // EBPF_OP_JA pc=2589 dst=r0 src=r0 offset=60 imm=0 #line 264 "sample/undocked/map.c" - if ((test_maps_helpers[7].tail_call) && (r0 == 0)) { -#line 264 "sample/undocked/map.c" - return 0; -#line 264 "sample/undocked/map.c" - } - // EBPF_OP_JA pc=2591 dst=r0 src=r0 offset=-390 imm=0 -#line 264 "sample/undocked/map.c" - goto label_140; -label_162: - // EBPF_OP_LDXW pc=2592 dst=r3 src=r10 offset=-4 imm=0 + goto label_164; +label_161: + // EBPF_OP_LDXW pc=2590 dst=r3 src=r10 offset=-4 imm=0 #line 264 "sample/undocked/map.c" r3 = *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)); - // EBPF_OP_JEQ_IMM pc=2593 dst=r3 src=r0 offset=22 imm=10 + // EBPF_OP_JEQ_IMM pc=2591 dst=r3 src=r0 offset=22 imm=10 #line 264 "sample/undocked/map.c" if (r3 == IMMEDIATE(10)) { #line 264 "sample/undocked/map.c" - goto label_163; + goto label_162; #line 264 "sample/undocked/map.c" } - // EBPF_OP_MOV64_IMM pc=2594 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=2592 dst=r1 src=r0 offset=0 imm=0 #line 264 "sample/undocked/map.c" r1 = IMMEDIATE(0); - // EBPF_OP_STXB pc=2595 dst=r10 src=r1 offset=-72 imm=0 + // EBPF_OP_STXB pc=2593 dst=r10 src=r1 offset=-72 imm=0 #line 264 "sample/undocked/map.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint8_t)r1; - // EBPF_OP_LDDW pc=2596 dst=r1 src=r0 offset=0 imm=1852404835 + // EBPF_OP_LDDW pc=2594 dst=r1 src=r0 offset=0 imm=1852404835 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7216209606537213027; - // EBPF_OP_STXDW pc=2598 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=2596 dst=r10 src=r1 offset=-80 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2599 dst=r1 src=r0 offset=0 imm=543434016 + // EBPF_OP_LDDW pc=2597 dst=r1 src=r0 offset=0 imm=543434016 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7309474570952779040; - // EBPF_OP_STXDW pc=2601 dst=r10 src=r1 offset=-88 imm=0 + // EBPF_OP_STXDW pc=2599 dst=r10 src=r1 offset=-88 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-88)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2602 dst=r1 src=r0 offset=0 imm=1701978221 + // EBPF_OP_LDDW pc=2600 dst=r1 src=r0 offset=0 imm=1701978221 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7958552634295722093; - // EBPF_OP_STXDW pc=2604 dst=r10 src=r1 offset=-96 imm=0 + // EBPF_OP_STXDW pc=2602 dst=r10 src=r1 offset=-96 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-96)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2605 dst=r1 src=r0 offset=0 imm=1801807216 + // EBPF_OP_LDDW pc=2603 dst=r1 src=r0 offset=0 imm=1801807216 #line 264 "sample/undocked/map.c" r1 = (uint64_t)7308327755813578096; - // EBPF_OP_STXDW pc=2607 dst=r10 src=r1 offset=-104 imm=0 + // EBPF_OP_STXDW pc=2605 dst=r10 src=r1 offset=-104 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-104)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2608 dst=r1 src=r0 offset=0 imm=1600548962 + // EBPF_OP_LDDW pc=2606 dst=r1 src=r0 offset=0 imm=1600548962 #line 264 "sample/undocked/map.c" r1 = (uint64_t)6877103753374625890; - // EBPF_OP_STXDW pc=2610 dst=r10 src=r1 offset=-112 imm=0 + // EBPF_OP_STXDW pc=2608 dst=r10 src=r1 offset=-112 imm=0 #line 264 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-112)) = (uint64_t)r1; - // EBPF_OP_MOV64_REG pc=2611 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2609 dst=r1 src=r10 offset=0 imm=0 #line 264 "sample/undocked/map.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=2612 dst=r1 src=r0 offset=0 imm=-112 + // EBPF_OP_ADD64_IMM pc=2610 dst=r1 src=r0 offset=0 imm=-112 #line 264 "sample/undocked/map.c" r1 += IMMEDIATE(-112); - // EBPF_OP_MOV64_IMM pc=2613 dst=r2 src=r0 offset=0 imm=41 + // EBPF_OP_MOV64_IMM pc=2611 dst=r2 src=r0 offset=0 imm=41 #line 264 "sample/undocked/map.c" r2 = IMMEDIATE(41); - // EBPF_OP_MOV64_IMM pc=2614 dst=r4 src=r0 offset=0 imm=10 + // EBPF_OP_MOV64_IMM pc=2612 dst=r4 src=r0 offset=0 imm=10 #line 264 "sample/undocked/map.c" r4 = IMMEDIATE(10); - // EBPF_OP_JA pc=2615 dst=r0 src=r0 offset=-417 imm=0 + // EBPF_OP_JA pc=2613 dst=r0 src=r0 offset=-415 imm=0 #line 264 "sample/undocked/map.c" goto label_139; -label_163: - // EBPF_OP_MOV64_IMM pc=2616 dst=r6 src=r0 offset=0 imm=0 +label_162: + // EBPF_OP_MOV64_IMM pc=2614 dst=r6 src=r0 offset=0 imm=0 #line 264 "sample/undocked/map.c" r6 = IMMEDIATE(0); - // EBPF_OP_STXW pc=2617 dst=r10 src=r6 offset=-4 imm=0 + // EBPF_OP_STXW pc=2615 dst=r10 src=r6 offset=-4 imm=0 #line 272 "sample/undocked/map.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r6; - // EBPF_OP_MOV64_REG pc=2618 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2616 dst=r2 src=r10 offset=0 imm=0 #line 272 "sample/undocked/map.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=2619 dst=r2 src=r0 offset=0 imm=-4 + // EBPF_OP_ADD64_IMM pc=2617 dst=r2 src=r0 offset=0 imm=-4 #line 272 "sample/undocked/map.c" r2 += IMMEDIATE(-4); - // EBPF_OP_LDDW pc=2620 dst=r1 src=r1 offset=0 imm=8 + // EBPF_OP_LDDW pc=2618 dst=r1 src=r1 offset=0 imm=8 #line 272 "sample/undocked/map.c" r1 = POINTER(_maps[7].address); - // EBPF_OP_CALL pc=2622 dst=r0 src=r0 offset=0 imm=17 + // EBPF_OP_CALL pc=2620 dst=r0 src=r0 offset=0 imm=17 #line 272 "sample/undocked/map.c" r0 = test_maps_helpers[8].address(r1, r2, r3, r4, r5, context); #line 272 "sample/undocked/map.c" @@ -8300,83 +8287,96 @@ test_maps(void* context) return 0; #line 272 "sample/undocked/map.c" } - // EBPF_OP_MOV64_REG pc=2623 dst=r7 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2621 dst=r7 src=r0 offset=0 imm=0 #line 272 "sample/undocked/map.c" r7 = r0; - // EBPF_OP_MOV64_REG pc=2624 dst=r4 src=r7 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2622 dst=r4 src=r7 offset=0 imm=0 #line 272 "sample/undocked/map.c" r4 = r7; - // EBPF_OP_LSH64_IMM pc=2625 dst=r4 src=r0 offset=0 imm=32 + // EBPF_OP_LSH64_IMM pc=2623 dst=r4 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r4 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_REG pc=2626 dst=r1 src=r4 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2624 dst=r1 src=r4 offset=0 imm=0 #line 272 "sample/undocked/map.c" r1 = r4; - // EBPF_OP_RSH64_IMM pc=2627 dst=r1 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=2625 dst=r1 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r1 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JEQ_IMM pc=2628 dst=r1 src=r0 offset=24 imm=0 + // EBPF_OP_JEQ_IMM pc=2626 dst=r1 src=r0 offset=26 imm=0 #line 272 "sample/undocked/map.c" if (r1 == IMMEDIATE(0)) { #line 272 "sample/undocked/map.c" goto label_165; #line 272 "sample/undocked/map.c" } -label_164: - // EBPF_OP_LDDW pc=2629 dst=r1 src=r0 offset=0 imm=1701737077 +label_163: + // EBPF_OP_LDDW pc=2627 dst=r1 src=r0 offset=0 imm=1701737077 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7216209593501643381; - // EBPF_OP_STXDW pc=2631 dst=r10 src=r1 offset=-72 imm=0 + // EBPF_OP_STXDW pc=2629 dst=r10 src=r1 offset=-72 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2632 dst=r1 src=r0 offset=0 imm=1680154740 + // EBPF_OP_LDDW pc=2630 dst=r1 src=r0 offset=0 imm=1680154740 #line 272 "sample/undocked/map.c" r1 = (uint64_t)8387235364492091508; - // EBPF_OP_STXDW pc=2634 dst=r10 src=r1 offset=-80 imm=0 + // EBPF_OP_STXDW pc=2632 dst=r10 src=r1 offset=-80 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-80)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2635 dst=r1 src=r0 offset=0 imm=1914726254 + // EBPF_OP_LDDW pc=2633 dst=r1 src=r0 offset=0 imm=1914726254 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7815279607914981230; - // EBPF_OP_STXDW pc=2637 dst=r10 src=r1 offset=-88 imm=0 + // EBPF_OP_STXDW pc=2635 dst=r10 src=r1 offset=-88 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-88)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2638 dst=r1 src=r0 offset=0 imm=1886938400 + // EBPF_OP_LDDW pc=2636 dst=r1 src=r0 offset=0 imm=1886938400 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7598807758610654496; - // EBPF_OP_STXDW pc=2640 dst=r10 src=r1 offset=-96 imm=0 + // EBPF_OP_STXDW pc=2638 dst=r10 src=r1 offset=-96 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-96)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2641 dst=r1 src=r0 offset=0 imm=1601204080 + // EBPF_OP_LDDW pc=2639 dst=r1 src=r0 offset=0 imm=1601204080 #line 272 "sample/undocked/map.c" r1 = (uint64_t)7882825905430622064; - // EBPF_OP_STXDW pc=2643 dst=r10 src=r1 offset=-104 imm=0 + // EBPF_OP_STXDW pc=2641 dst=r10 src=r1 offset=-104 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-104)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=2644 dst=r1 src=r0 offset=0 imm=1600548962 + // EBPF_OP_LDDW pc=2642 dst=r1 src=r0 offset=0 imm=1600548962 #line 272 "sample/undocked/map.c" r1 = (uint64_t)6877103753374625890; - // EBPF_OP_STXDW pc=2646 dst=r10 src=r1 offset=-112 imm=0 + // EBPF_OP_STXDW pc=2644 dst=r10 src=r1 offset=-112 imm=0 #line 272 "sample/undocked/map.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-112)) = (uint64_t)r1; - // EBPF_OP_STXB pc=2647 dst=r10 src=r6 offset=-64 imm=0 + // EBPF_OP_STXB pc=2645 dst=r10 src=r6 offset=-64 imm=0 #line 272 "sample/undocked/map.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint8_t)r6; - // EBPF_OP_ARSH64_IMM pc=2648 dst=r4 src=r0 offset=0 imm=32 + // EBPF_OP_ARSH64_IMM pc=2646 dst=r4 src=r0 offset=0 imm=32 #line 272 "sample/undocked/map.c" r4 = (int64_t)r4 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_MOV64_REG pc=2649 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=2647 dst=r1 src=r10 offset=0 imm=0 #line 272 "sample/undocked/map.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=2650 dst=r1 src=r0 offset=0 imm=-112 + // EBPF_OP_ADD64_IMM pc=2648 dst=r1 src=r0 offset=0 imm=-112 #line 272 "sample/undocked/map.c" r1 += IMMEDIATE(-112); - // EBPF_OP_MOV64_IMM pc=2651 dst=r2 src=r0 offset=0 imm=49 + // EBPF_OP_MOV64_IMM pc=2649 dst=r2 src=r0 offset=0 imm=49 #line 272 "sample/undocked/map.c" r2 = IMMEDIATE(49); - // EBPF_OP_JA pc=2652 dst=r0 src=r0 offset=-64 imm=0 +label_164: + // EBPF_OP_MOV64_IMM pc=2650 dst=r3 src=r0 offset=0 imm=0 +#line 272 "sample/undocked/map.c" + r3 = IMMEDIATE(0); + // EBPF_OP_CALL pc=2651 dst=r0 src=r0 offset=0 imm=14 +#line 272 "sample/undocked/map.c" + r0 = test_maps_helpers[7].address(r1, r2, r3, r4, r5, context); +#line 272 "sample/undocked/map.c" + if ((test_maps_helpers[7].tail_call) && (r0 == 0)) { +#line 272 "sample/undocked/map.c" + return 0; +#line 272 "sample/undocked/map.c" + } + // EBPF_OP_JA pc=2652 dst=r0 src=r0 offset=-451 imm=0 #line 272 "sample/undocked/map.c" - goto label_161; + goto label_140; label_165: // EBPF_OP_LDXW pc=2653 dst=r3 src=r10 offset=-4 imm=0 #line 272 "sample/undocked/map.c" @@ -8477,9 +8477,9 @@ test_maps(void* context) goto label_167; #line 273 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2687 dst=r0 src=r0 offset=-59 imm=0 + // EBPF_OP_JA pc=2687 dst=r0 src=r0 offset=-61 imm=0 #line 273 "sample/undocked/map.c" - goto label_164; + goto label_163; label_167: // EBPF_OP_LDXW pc=2688 dst=r3 src=r10 offset=-4 imm=0 #line 273 "sample/undocked/map.c" @@ -8580,9 +8580,9 @@ test_maps(void* context) goto label_169; #line 274 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2722 dst=r0 src=r0 offset=-94 imm=0 + // EBPF_OP_JA pc=2722 dst=r0 src=r0 offset=-96 imm=0 #line 274 "sample/undocked/map.c" - goto label_164; + goto label_163; label_169: // EBPF_OP_LDXW pc=2723 dst=r3 src=r10 offset=-4 imm=0 #line 274 "sample/undocked/map.c" @@ -8683,9 +8683,9 @@ test_maps(void* context) goto label_171; #line 275 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2757 dst=r0 src=r0 offset=-129 imm=0 + // EBPF_OP_JA pc=2757 dst=r0 src=r0 offset=-131 imm=0 #line 275 "sample/undocked/map.c" - goto label_164; + goto label_163; label_171: // EBPF_OP_LDXW pc=2758 dst=r3 src=r10 offset=-4 imm=0 #line 275 "sample/undocked/map.c" @@ -8786,9 +8786,9 @@ test_maps(void* context) goto label_173; #line 276 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2792 dst=r0 src=r0 offset=-164 imm=0 + // EBPF_OP_JA pc=2792 dst=r0 src=r0 offset=-166 imm=0 #line 276 "sample/undocked/map.c" - goto label_164; + goto label_163; label_173: // EBPF_OP_LDXW pc=2793 dst=r3 src=r10 offset=-4 imm=0 #line 276 "sample/undocked/map.c" @@ -8889,9 +8889,9 @@ test_maps(void* context) goto label_175; #line 277 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2827 dst=r0 src=r0 offset=-199 imm=0 + // EBPF_OP_JA pc=2827 dst=r0 src=r0 offset=-201 imm=0 #line 277 "sample/undocked/map.c" - goto label_164; + goto label_163; label_175: // EBPF_OP_LDXW pc=2828 dst=r3 src=r10 offset=-4 imm=0 #line 277 "sample/undocked/map.c" @@ -8992,9 +8992,9 @@ test_maps(void* context) goto label_177; #line 278 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2862 dst=r0 src=r0 offset=-234 imm=0 + // EBPF_OP_JA pc=2862 dst=r0 src=r0 offset=-236 imm=0 #line 278 "sample/undocked/map.c" - goto label_164; + goto label_163; label_177: // EBPF_OP_LDXW pc=2863 dst=r3 src=r10 offset=-4 imm=0 #line 278 "sample/undocked/map.c" @@ -9095,9 +9095,9 @@ test_maps(void* context) goto label_179; #line 279 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2897 dst=r0 src=r0 offset=-269 imm=0 + // EBPF_OP_JA pc=2897 dst=r0 src=r0 offset=-271 imm=0 #line 279 "sample/undocked/map.c" - goto label_164; + goto label_163; label_179: // EBPF_OP_LDXW pc=2898 dst=r3 src=r10 offset=-4 imm=0 #line 279 "sample/undocked/map.c" @@ -9198,9 +9198,9 @@ test_maps(void* context) goto label_181; #line 280 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2932 dst=r0 src=r0 offset=-304 imm=0 + // EBPF_OP_JA pc=2932 dst=r0 src=r0 offset=-306 imm=0 #line 280 "sample/undocked/map.c" - goto label_164; + goto label_163; label_181: // EBPF_OP_LDXW pc=2933 dst=r3 src=r10 offset=-4 imm=0 #line 280 "sample/undocked/map.c" @@ -9301,9 +9301,9 @@ test_maps(void* context) goto label_183; #line 281 "sample/undocked/map.c" } - // EBPF_OP_JA pc=2967 dst=r0 src=r0 offset=-339 imm=0 + // EBPF_OP_JA pc=2967 dst=r0 src=r0 offset=-341 imm=0 #line 281 "sample/undocked/map.c" - goto label_164; + goto label_163; label_183: // EBPF_OP_LDXW pc=2968 dst=r3 src=r10 offset=-4 imm=0 #line 281 "sample/undocked/map.c" diff --git a/tests/bpf2c_tests/expected/pidtgid_dll.c b/tests/bpf2c_tests/expected/pidtgid_dll.c index ac22565e48..45be339797 100644 --- a/tests/bpf2c_tests/expected/pidtgid_dll.c +++ b/tests/bpf2c_tests/expected/pidtgid_dll.c @@ -77,60 +77,60 @@ static uint16_t func_maps[] = { #pragma code_seg(push, "bind") static uint64_t func(void* context) -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" { -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" // Prologue. -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" uint64_t stack[(UBPF_STACK_SIZE + 7) / 8]; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r0 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r1 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r2 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r3 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r4 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r5 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r6 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r10 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" r1 = (uintptr_t)context; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); - // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 -#line 34 "sample/pidtgid.c" - r6 = r1; - // EBPF_OP_LDXB pc=1 dst=r1 src=r6 offset=40 imm=0 + // EBPF_OP_LDXB pc=0 dst=r2 src=r1 offset=40 imm=0 #line 46 "sample/pidtgid.c" - r1 = *(uint8_t*)(uintptr_t)(r6 + OFFSET(40)); - // EBPF_OP_MOV64_IMM pc=2 dst=r2 src=r0 offset=0 imm=16 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(40)); + // EBPF_OP_MOV64_IMM pc=1 dst=r3 src=r0 offset=0 imm=16 #line 46 "sample/pidtgid.c" - r2 = IMMEDIATE(16); - // EBPF_OP_JGT_REG pc=3 dst=r2 src=r1 offset=18 imm=0 + r3 = IMMEDIATE(16); + // EBPF_OP_JGT_REG pc=2 dst=r3 src=r2 offset=19 imm=0 #line 46 "sample/pidtgid.c" - if (r2 > r1) { + if (r3 > r2) { #line 46 "sample/pidtgid.c" goto label_1; #line 46 "sample/pidtgid.c" } - // EBPF_OP_LDXH pc=4 dst=r1 src=r6 offset=26 imm=0 + // EBPF_OP_LDXH pc=3 dst=r2 src=r1 offset=26 imm=0 #line 46 "sample/pidtgid.c" - r1 = *(uint16_t*)(uintptr_t)(r6 + OFFSET(26)); - // EBPF_OP_JNE_IMM pc=5 dst=r1 src=r0 offset=16 imm=15295 + r2 = *(uint16_t*)(uintptr_t)(r1 + OFFSET(26)); + // EBPF_OP_JNE_IMM pc=4 dst=r2 src=r0 offset=17 imm=15295 #line 46 "sample/pidtgid.c" - if (r1 != IMMEDIATE(15295)) { + if (r2 != IMMEDIATE(15295)) { #line 46 "sample/pidtgid.c" goto label_1; #line 46 "sample/pidtgid.c" } + // EBPF_OP_MOV64_REG pc=5 dst=r6 src=r1 offset=0 imm=0 +#line 46 "sample/pidtgid.c" + r6 = r1; // EBPF_OP_CALL pc=6 dst=r0 src=r0 offset=0 imm=19 #line 47 "sample/pidtgid.c" r0 = func_helpers[0].address(r1, r2, r3, r4, r5, context); @@ -195,7 +195,7 @@ func(void* context) // EBPF_OP_EXIT pc=23 dst=r0 src=r0 offset=0 imm=0 #line 54 "sample/pidtgid.c" return r0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" } #pragma code_seg(pop) #line __LINE__ __FILE__ diff --git a/tests/bpf2c_tests/expected/pidtgid_raw.c b/tests/bpf2c_tests/expected/pidtgid_raw.c index 79c922c1a3..734cb1e7ef 100644 --- a/tests/bpf2c_tests/expected/pidtgid_raw.c +++ b/tests/bpf2c_tests/expected/pidtgid_raw.c @@ -51,60 +51,60 @@ static uint16_t func_maps[] = { #pragma code_seg(push, "bind") static uint64_t func(void* context) -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" { -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" // Prologue. -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" uint64_t stack[(UBPF_STACK_SIZE + 7) / 8]; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r0 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r1 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r2 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r3 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r4 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r5 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r6 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r10 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" r1 = (uintptr_t)context; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); - // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 -#line 34 "sample/pidtgid.c" - r6 = r1; - // EBPF_OP_LDXB pc=1 dst=r1 src=r6 offset=40 imm=0 + // EBPF_OP_LDXB pc=0 dst=r2 src=r1 offset=40 imm=0 #line 46 "sample/pidtgid.c" - r1 = *(uint8_t*)(uintptr_t)(r6 + OFFSET(40)); - // EBPF_OP_MOV64_IMM pc=2 dst=r2 src=r0 offset=0 imm=16 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(40)); + // EBPF_OP_MOV64_IMM pc=1 dst=r3 src=r0 offset=0 imm=16 #line 46 "sample/pidtgid.c" - r2 = IMMEDIATE(16); - // EBPF_OP_JGT_REG pc=3 dst=r2 src=r1 offset=18 imm=0 + r3 = IMMEDIATE(16); + // EBPF_OP_JGT_REG pc=2 dst=r3 src=r2 offset=19 imm=0 #line 46 "sample/pidtgid.c" - if (r2 > r1) { + if (r3 > r2) { #line 46 "sample/pidtgid.c" goto label_1; #line 46 "sample/pidtgid.c" } - // EBPF_OP_LDXH pc=4 dst=r1 src=r6 offset=26 imm=0 + // EBPF_OP_LDXH pc=3 dst=r2 src=r1 offset=26 imm=0 #line 46 "sample/pidtgid.c" - r1 = *(uint16_t*)(uintptr_t)(r6 + OFFSET(26)); - // EBPF_OP_JNE_IMM pc=5 dst=r1 src=r0 offset=16 imm=15295 + r2 = *(uint16_t*)(uintptr_t)(r1 + OFFSET(26)); + // EBPF_OP_JNE_IMM pc=4 dst=r2 src=r0 offset=17 imm=15295 #line 46 "sample/pidtgid.c" - if (r1 != IMMEDIATE(15295)) { + if (r2 != IMMEDIATE(15295)) { #line 46 "sample/pidtgid.c" goto label_1; #line 46 "sample/pidtgid.c" } + // EBPF_OP_MOV64_REG pc=5 dst=r6 src=r1 offset=0 imm=0 +#line 46 "sample/pidtgid.c" + r6 = r1; // EBPF_OP_CALL pc=6 dst=r0 src=r0 offset=0 imm=19 #line 47 "sample/pidtgid.c" r0 = func_helpers[0].address(r1, r2, r3, r4, r5, context); @@ -169,7 +169,7 @@ func(void* context) // EBPF_OP_EXIT pc=23 dst=r0 src=r0 offset=0 imm=0 #line 54 "sample/pidtgid.c" return r0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" } #pragma code_seg(pop) #line __LINE__ __FILE__ diff --git a/tests/bpf2c_tests/expected/pidtgid_sys.c b/tests/bpf2c_tests/expected/pidtgid_sys.c index 37ab8db9ea..215d9cce13 100644 --- a/tests/bpf2c_tests/expected/pidtgid_sys.c +++ b/tests/bpf2c_tests/expected/pidtgid_sys.c @@ -212,60 +212,60 @@ static uint16_t func_maps[] = { #pragma code_seg(push, "bind") static uint64_t func(void* context) -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" { -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" // Prologue. -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" uint64_t stack[(UBPF_STACK_SIZE + 7) / 8]; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r0 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r1 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r2 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r3 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r4 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r5 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r6 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" register uint64_t r10 = 0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" r1 = (uintptr_t)context; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" r10 = (uintptr_t)((uint8_t*)stack + sizeof(stack)); - // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 -#line 34 "sample/pidtgid.c" - r6 = r1; - // EBPF_OP_LDXB pc=1 dst=r1 src=r6 offset=40 imm=0 + // EBPF_OP_LDXB pc=0 dst=r2 src=r1 offset=40 imm=0 #line 46 "sample/pidtgid.c" - r1 = *(uint8_t*)(uintptr_t)(r6 + OFFSET(40)); - // EBPF_OP_MOV64_IMM pc=2 dst=r2 src=r0 offset=0 imm=16 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(40)); + // EBPF_OP_MOV64_IMM pc=1 dst=r3 src=r0 offset=0 imm=16 #line 46 "sample/pidtgid.c" - r2 = IMMEDIATE(16); - // EBPF_OP_JGT_REG pc=3 dst=r2 src=r1 offset=18 imm=0 + r3 = IMMEDIATE(16); + // EBPF_OP_JGT_REG pc=2 dst=r3 src=r2 offset=19 imm=0 #line 46 "sample/pidtgid.c" - if (r2 > r1) { + if (r3 > r2) { #line 46 "sample/pidtgid.c" goto label_1; #line 46 "sample/pidtgid.c" } - // EBPF_OP_LDXH pc=4 dst=r1 src=r6 offset=26 imm=0 + // EBPF_OP_LDXH pc=3 dst=r2 src=r1 offset=26 imm=0 #line 46 "sample/pidtgid.c" - r1 = *(uint16_t*)(uintptr_t)(r6 + OFFSET(26)); - // EBPF_OP_JNE_IMM pc=5 dst=r1 src=r0 offset=16 imm=15295 + r2 = *(uint16_t*)(uintptr_t)(r1 + OFFSET(26)); + // EBPF_OP_JNE_IMM pc=4 dst=r2 src=r0 offset=17 imm=15295 #line 46 "sample/pidtgid.c" - if (r1 != IMMEDIATE(15295)) { + if (r2 != IMMEDIATE(15295)) { #line 46 "sample/pidtgid.c" goto label_1; #line 46 "sample/pidtgid.c" } + // EBPF_OP_MOV64_REG pc=5 dst=r6 src=r1 offset=0 imm=0 +#line 46 "sample/pidtgid.c" + r6 = r1; // EBPF_OP_CALL pc=6 dst=r0 src=r0 offset=0 imm=19 #line 47 "sample/pidtgid.c" r0 = func_helpers[0].address(r1, r2, r3, r4, r5, context); @@ -330,7 +330,7 @@ func(void* context) // EBPF_OP_EXIT pc=23 dst=r0 src=r0 offset=0 imm=0 #line 54 "sample/pidtgid.c" return r0; -#line 34 "sample/pidtgid.c" +#line 46 "sample/pidtgid.c" } #pragma code_seg(pop) #line __LINE__ __FILE__ diff --git a/tests/bpf2c_tests/expected/sockops_dll.c b/tests/bpf2c_tests/expected/sockops_dll.c index edb0397313..9191cc1fed 100644 --- a/tests/bpf2c_tests/expected/sockops_dll.c +++ b/tests/bpf2c_tests/expected/sockops_dll.c @@ -113,8 +113,6 @@ connection_monitor(void* context) register uint64_t r5 = 0; #line 78 "sample/sockops.c" register uint64_t r6 = 0; -#line 78 "sample/sockops.c" - register uint64_t r7 = 0; #line 78 "sample/sockops.c" register uint64_t r10 = 0; @@ -126,22 +124,22 @@ connection_monitor(void* context) // EBPF_OP_MOV64_IMM pc=0 dst=r6 src=r0 offset=0 imm=2 #line 78 "sample/sockops.c" r6 = IMMEDIATE(2); - // EBPF_OP_MOV64_IMM pc=1 dst=r3 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=1 dst=r2 src=r0 offset=0 imm=1 #line 78 "sample/sockops.c" - r3 = IMMEDIATE(1); - // EBPF_OP_LDXW pc=2 dst=r2 src=r1 offset=0 imm=0 + r2 = IMMEDIATE(1); + // EBPF_OP_LDXW pc=2 dst=r3 src=r1 offset=0 imm=0 #line 83 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=3 dst=r2 src=r0 offset=8 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(0)); + // EBPF_OP_JEQ_IMM pc=3 dst=r3 src=r0 offset=8 imm=0 #line 83 "sample/sockops.c" - if (r2 == IMMEDIATE(0)) { + if (r3 == IMMEDIATE(0)) { #line 83 "sample/sockops.c" goto label_2; #line 83 "sample/sockops.c" } - // EBPF_OP_JEQ_IMM pc=4 dst=r2 src=r0 offset=5 imm=2 + // EBPF_OP_JEQ_IMM pc=4 dst=r3 src=r0 offset=5 imm=2 #line 83 "sample/sockops.c" - if (r2 == IMMEDIATE(2)) { + if (r3 == IMMEDIATE(2)) { #line 83 "sample/sockops.c" goto label_1; #line 83 "sample/sockops.c" @@ -149,88 +147,88 @@ connection_monitor(void* context) // EBPF_OP_LDDW pc=5 dst=r0 src=r0 offset=0 imm=-1 #line 83 "sample/sockops.c" r0 = (uint64_t)4294967295; - // EBPF_OP_JNE_IMM pc=7 dst=r2 src=r0 offset=172 imm=1 + // EBPF_OP_JNE_IMM pc=7 dst=r3 src=r0 offset=170 imm=1 #line 83 "sample/sockops.c" - if (r2 != IMMEDIATE(1)) { + if (r3 != IMMEDIATE(1)) { #line 83 "sample/sockops.c" goto label_5; #line 83 "sample/sockops.c" } - // EBPF_OP_MOV64_IMM pc=8 dst=r3 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=8 dst=r2 src=r0 offset=0 imm=0 #line 83 "sample/sockops.c" - r3 = IMMEDIATE(0); + r2 = IMMEDIATE(0); // EBPF_OP_JA pc=9 dst=r0 src=r0 offset=2 imm=0 #line 83 "sample/sockops.c" goto label_2; label_1: - // EBPF_OP_MOV64_IMM pc=10 dst=r3 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=10 dst=r2 src=r0 offset=0 imm=0 #line 83 "sample/sockops.c" - r3 = IMMEDIATE(0); + r2 = IMMEDIATE(0); // EBPF_OP_MOV64_IMM pc=11 dst=r6 src=r0 offset=0 imm=0 #line 83 "sample/sockops.c" r6 = IMMEDIATE(0); label_2: - // EBPF_OP_LDXW pc=12 dst=r2 src=r1 offset=4 imm=0 + // EBPF_OP_LDXW pc=12 dst=r3 src=r1 offset=4 imm=0 #line 100 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(4)); - // EBPF_OP_JNE_IMM pc=13 dst=r2 src=r0 offset=37 imm=2 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(4)); + // EBPF_OP_JNE_IMM pc=13 dst=r3 src=r0 offset=37 imm=2 #line 100 "sample/sockops.c" - if (r2 != IMMEDIATE(2)) { + if (r3 != IMMEDIATE(2)) { #line 100 "sample/sockops.c" goto label_3; #line 100 "sample/sockops.c" } - // EBPF_OP_MOV64_IMM pc=14 dst=r2 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=14 dst=r3 src=r0 offset=0 imm=0 #line 100 "sample/sockops.c" - r2 = IMMEDIATE(0); - // EBPF_OP_STXDW pc=15 dst=r10 src=r2 offset=-8 imm=0 + r3 = IMMEDIATE(0); + // EBPF_OP_STXDW pc=15 dst=r10 src=r3 offset=-8 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=16 dst=r10 src=r2 offset=-16 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=16 dst=r10 src=r3 offset=-16 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=17 dst=r10 src=r2 offset=-24 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=17 dst=r10 src=r3 offset=-24 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=18 dst=r10 src=r2 offset=-32 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=18 dst=r10 src=r3 offset=-32 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=19 dst=r10 src=r2 offset=-40 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=19 dst=r10 src=r3 offset=-40 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=20 dst=r10 src=r2 offset=-48 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=20 dst=r10 src=r3 offset=-48 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=21 dst=r10 src=r2 offset=-56 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=21 dst=r10 src=r3 offset=-56 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=22 dst=r10 src=r2 offset=-64 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=22 dst=r10 src=r3 offset=-64 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=23 dst=r10 src=r2 offset=-72 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=23 dst=r10 src=r3 offset=-72 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r2; - // EBPF_OP_LDXW pc=24 dst=r2 src=r1 offset=8 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r3; + // EBPF_OP_LDXW pc=24 dst=r3 src=r1 offset=8 imm=0 #line 38 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(8)); - // EBPF_OP_STXW pc=25 dst=r10 src=r2 offset=-72 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(8)); + // EBPF_OP_STXW pc=25 dst=r10 src=r3 offset=-72 imm=0 #line 38 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint32_t)r2; - // EBPF_OP_LDXW pc=26 dst=r2 src=r1 offset=24 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint32_t)r3; + // EBPF_OP_LDXW pc=26 dst=r3 src=r1 offset=24 imm=0 #line 39 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(24)); - // EBPF_OP_STXH pc=27 dst=r10 src=r2 offset=-56 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(24)); + // EBPF_OP_STXH pc=27 dst=r10 src=r3 offset=-56 imm=0 #line 39 "sample/sockops.c" - *(uint16_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint16_t)r2; - // EBPF_OP_LDXW pc=28 dst=r2 src=r1 offset=28 imm=0 + *(uint16_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint16_t)r3; + // EBPF_OP_LDXW pc=28 dst=r3 src=r1 offset=28 imm=0 #line 40 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(28)); - // EBPF_OP_STXW pc=29 dst=r10 src=r2 offset=-52 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(28)); + // EBPF_OP_STXW pc=29 dst=r10 src=r3 offset=-52 imm=0 #line 40 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-52)) = (uint32_t)r2; - // EBPF_OP_OR64_REG pc=30 dst=r6 src=r3 offset=0 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-52)) = (uint32_t)r3; + // EBPF_OP_OR64_REG pc=30 dst=r6 src=r2 offset=0 imm=0 #line 47 "sample/sockops.c" - r6 |= r3; + r6 |= r2; // EBPF_OP_LDXW pc=31 dst=r2 src=r1 offset=44 imm=0 #line 41 "sample/sockops.c" r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44)); @@ -291,345 +289,339 @@ connection_monitor(void* context) // EBPF_OP_LDDW pc=47 dst=r0 src=r0 offset=0 imm=-1 #line 26 "sample/sockops.c" r0 = (uint64_t)4294967295; - // EBPF_OP_JEQ_IMM pc=49 dst=r1 src=r0 offset=130 imm=0 + // EBPF_OP_JEQ_IMM pc=49 dst=r1 src=r0 offset=128 imm=0 #line 26 "sample/sockops.c" if (r1 == IMMEDIATE(0)) { #line 26 "sample/sockops.c" goto label_5; #line 26 "sample/sockops.c" } - // EBPF_OP_JA pc=50 dst=r0 src=r0 offset=122 imm=0 + // EBPF_OP_JA pc=50 dst=r0 src=r0 offset=120 imm=0 #line 26 "sample/sockops.c" goto label_4; label_3: - // EBPF_OP_MOV64_REG pc=51 dst=r2 src=r1 offset=0 imm=0 -#line 100 "sample/sockops.c" - r2 = r1; - // EBPF_OP_ADD64_IMM pc=52 dst=r2 src=r0 offset=0 imm=28 -#line 100 "sample/sockops.c" - r2 += IMMEDIATE(28); - // EBPF_OP_MOV64_IMM pc=53 dst=r4 src=r0 offset=0 imm=0 -#line 100 "sample/sockops.c" - r4 = IMMEDIATE(0); - // EBPF_OP_STXDW pc=54 dst=r10 src=r4 offset=-8 imm=0 + // EBPF_OP_MOV64_IMM pc=51 dst=r3 src=r0 offset=0 imm=0 +#line 26 "sample/sockops.c" + r3 = IMMEDIATE(0); + // EBPF_OP_STXDW pc=52 dst=r10 src=r3 offset=-8 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=55 dst=r10 src=r4 offset=-16 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=53 dst=r10 src=r3 offset=-16 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=56 dst=r10 src=r4 offset=-24 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=54 dst=r10 src=r3 offset=-24 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=57 dst=r10 src=r4 offset=-32 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=55 dst=r10 src=r3 offset=-32 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=58 dst=r10 src=r4 offset=-40 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=56 dst=r10 src=r3 offset=-40 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=59 dst=r10 src=r4 offset=-48 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=57 dst=r10 src=r3 offset=-48 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=60 dst=r10 src=r4 offset=-56 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=58 dst=r10 src=r3 offset=-56 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint64_t)r4; - // EBPF_OP_LDXB pc=61 dst=r5 src=r1 offset=17 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint64_t)r3; + // EBPF_OP_LDXB pc=59 dst=r4 src=r1 offset=17 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(17)); - // EBPF_OP_LSH64_IMM pc=62 dst=r5 src=r0 offset=0 imm=8 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(17)); + // EBPF_OP_LSH64_IMM pc=60 dst=r4 src=r0 offset=0 imm=8 #line 60 "sample/sockops.c" - r5 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=63 dst=r4 src=r1 offset=16 imm=0 + r4 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=61 dst=r3 src=r1 offset=16 imm=0 #line 60 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(16)); - // EBPF_OP_OR64_REG pc=64 dst=r5 src=r4 offset=0 imm=0 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(16)); + // EBPF_OP_OR64_REG pc=62 dst=r4 src=r3 offset=0 imm=0 #line 60 "sample/sockops.c" - r5 |= r4; - // EBPF_OP_LDXB pc=65 dst=r0 src=r1 offset=18 imm=0 + r4 |= r3; + // EBPF_OP_LDXB pc=63 dst=r5 src=r1 offset=18 imm=0 #line 60 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(18)); - // EBPF_OP_LSH64_IMM pc=66 dst=r0 src=r0 offset=0 imm=16 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(18)); + // EBPF_OP_LSH64_IMM pc=64 dst=r5 src=r0 offset=0 imm=16 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=67 dst=r4 src=r1 offset=19 imm=0 + r5 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=65 dst=r3 src=r1 offset=19 imm=0 #line 60 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(19)); - // EBPF_OP_LSH64_IMM pc=68 dst=r4 src=r0 offset=0 imm=24 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(19)); + // EBPF_OP_LSH64_IMM pc=66 dst=r3 src=r0 offset=0 imm=24 #line 60 "sample/sockops.c" - r4 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=69 dst=r4 src=r0 offset=0 imm=0 + r3 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=67 dst=r3 src=r5 offset=0 imm=0 #line 60 "sample/sockops.c" - r4 |= r0; - // EBPF_OP_OR64_REG pc=70 dst=r4 src=r5 offset=0 imm=0 + r3 |= r5; + // EBPF_OP_OR64_REG pc=68 dst=r3 src=r4 offset=0 imm=0 #line 60 "sample/sockops.c" - r4 |= r5; - // EBPF_OP_LDXB pc=71 dst=r0 src=r1 offset=21 imm=0 + r3 |= r4; + // EBPF_OP_LDXB pc=69 dst=r5 src=r1 offset=21 imm=0 #line 60 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(21)); - // EBPF_OP_LSH64_IMM pc=72 dst=r0 src=r0 offset=0 imm=8 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(21)); + // EBPF_OP_LSH64_IMM pc=70 dst=r5 src=r0 offset=0 imm=8 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=73 dst=r5 src=r1 offset=20 imm=0 + r5 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=71 dst=r4 src=r1 offset=20 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(20)); - // EBPF_OP_OR64_REG pc=74 dst=r0 src=r5 offset=0 imm=0 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(20)); + // EBPF_OP_OR64_REG pc=72 dst=r5 src=r4 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r5; - // EBPF_OP_LDXB pc=75 dst=r7 src=r1 offset=22 imm=0 + r5 |= r4; + // EBPF_OP_LDXB pc=73 dst=r0 src=r1 offset=22 imm=0 #line 60 "sample/sockops.c" - r7 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(22)); - // EBPF_OP_LSH64_IMM pc=76 dst=r7 src=r0 offset=0 imm=16 + r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(22)); + // EBPF_OP_LSH64_IMM pc=74 dst=r0 src=r0 offset=0 imm=16 #line 60 "sample/sockops.c" - r7 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=77 dst=r5 src=r1 offset=23 imm=0 + r0 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=75 dst=r4 src=r1 offset=23 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(23)); - // EBPF_OP_LSH64_IMM pc=78 dst=r5 src=r0 offset=0 imm=24 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(23)); + // EBPF_OP_LSH64_IMM pc=76 dst=r4 src=r0 offset=0 imm=24 #line 60 "sample/sockops.c" - r5 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=79 dst=r5 src=r7 offset=0 imm=0 + r4 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=77 dst=r4 src=r0 offset=0 imm=0 #line 60 "sample/sockops.c" - r5 |= r7; - // EBPF_OP_OR64_REG pc=80 dst=r5 src=r0 offset=0 imm=0 + r4 |= r0; + // EBPF_OP_OR64_REG pc=78 dst=r4 src=r5 offset=0 imm=0 #line 60 "sample/sockops.c" - r5 |= r0; - // EBPF_OP_LSH64_IMM pc=81 dst=r5 src=r0 offset=0 imm=32 + r4 |= r5; + // EBPF_OP_LSH64_IMM pc=79 dst=r4 src=r0 offset=0 imm=32 #line 60 "sample/sockops.c" - r5 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_OR64_REG pc=82 dst=r5 src=r4 offset=0 imm=0 + r4 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_OR64_REG pc=80 dst=r4 src=r3 offset=0 imm=0 #line 60 "sample/sockops.c" - r5 |= r4; - // EBPF_OP_LDXB pc=83 dst=r0 src=r1 offset=9 imm=0 + r4 |= r3; + // EBPF_OP_LDXB pc=81 dst=r5 src=r1 offset=9 imm=0 #line 60 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(9)); - // EBPF_OP_LSH64_IMM pc=84 dst=r0 src=r0 offset=0 imm=8 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(9)); + // EBPF_OP_LSH64_IMM pc=82 dst=r5 src=r0 offset=0 imm=8 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=85 dst=r4 src=r1 offset=8 imm=0 + r5 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=83 dst=r3 src=r1 offset=8 imm=0 #line 60 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(8)); - // EBPF_OP_OR64_REG pc=86 dst=r0 src=r4 offset=0 imm=0 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(8)); + // EBPF_OP_OR64_REG pc=84 dst=r5 src=r3 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r4; - // EBPF_OP_LDXB pc=87 dst=r7 src=r1 offset=10 imm=0 + r5 |= r3; + // EBPF_OP_LDXB pc=85 dst=r0 src=r1 offset=10 imm=0 #line 60 "sample/sockops.c" - r7 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(10)); - // EBPF_OP_LSH64_IMM pc=88 dst=r7 src=r0 offset=0 imm=16 + r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(10)); + // EBPF_OP_LSH64_IMM pc=86 dst=r0 src=r0 offset=0 imm=16 #line 60 "sample/sockops.c" - r7 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=89 dst=r4 src=r1 offset=11 imm=0 + r0 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=87 dst=r3 src=r1 offset=11 imm=0 #line 60 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(11)); - // EBPF_OP_LSH64_IMM pc=90 dst=r4 src=r0 offset=0 imm=24 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(11)); + // EBPF_OP_LSH64_IMM pc=88 dst=r3 src=r0 offset=0 imm=24 #line 60 "sample/sockops.c" - r4 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=91 dst=r4 src=r7 offset=0 imm=0 + r3 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=89 dst=r3 src=r0 offset=0 imm=0 #line 60 "sample/sockops.c" - r4 |= r7; - // EBPF_OP_OR64_REG pc=92 dst=r6 src=r3 offset=0 imm=0 + r3 |= r0; + // EBPF_OP_OR64_REG pc=90 dst=r6 src=r2 offset=0 imm=0 #line 70 "sample/sockops.c" - r6 |= r3; - // EBPF_OP_STXDW pc=93 dst=r10 src=r5 offset=-64 imm=0 + r6 |= r2; + // EBPF_OP_STXDW pc=91 dst=r10 src=r4 offset=-64 imm=0 #line 60 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint64_t)r5; - // EBPF_OP_OR64_REG pc=94 dst=r4 src=r0 offset=0 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint64_t)r4; + // EBPF_OP_OR64_REG pc=92 dst=r3 src=r5 offset=0 imm=0 #line 60 "sample/sockops.c" - r4 |= r0; - // EBPF_OP_LDXB pc=95 dst=r3 src=r1 offset=13 imm=0 + r3 |= r5; + // EBPF_OP_LDXB pc=93 dst=r2 src=r1 offset=13 imm=0 #line 60 "sample/sockops.c" - r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(13)); - // EBPF_OP_LSH64_IMM pc=96 dst=r3 src=r0 offset=0 imm=8 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(13)); + // EBPF_OP_LSH64_IMM pc=94 dst=r2 src=r0 offset=0 imm=8 #line 60 "sample/sockops.c" - r3 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=97 dst=r5 src=r1 offset=12 imm=0 + r2 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=95 dst=r4 src=r1 offset=12 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(12)); - // EBPF_OP_OR64_REG pc=98 dst=r3 src=r5 offset=0 imm=0 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(12)); + // EBPF_OP_OR64_REG pc=96 dst=r2 src=r4 offset=0 imm=0 #line 60 "sample/sockops.c" - r3 |= r5; - // EBPF_OP_LDXB pc=99 dst=r5 src=r1 offset=14 imm=0 + r2 |= r4; + // EBPF_OP_LDXB pc=97 dst=r4 src=r1 offset=14 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(14)); - // EBPF_OP_LSH64_IMM pc=100 dst=r5 src=r0 offset=0 imm=16 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(14)); + // EBPF_OP_LSH64_IMM pc=98 dst=r4 src=r0 offset=0 imm=16 #line 60 "sample/sockops.c" - r5 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=101 dst=r0 src=r1 offset=15 imm=0 + r4 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=99 dst=r5 src=r1 offset=15 imm=0 #line 60 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(15)); - // EBPF_OP_LSH64_IMM pc=102 dst=r0 src=r0 offset=0 imm=24 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(15)); + // EBPF_OP_LSH64_IMM pc=100 dst=r5 src=r0 offset=0 imm=24 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=103 dst=r0 src=r5 offset=0 imm=0 + r5 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=101 dst=r5 src=r4 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r5; - // EBPF_OP_OR64_REG pc=104 dst=r0 src=r3 offset=0 imm=0 + r5 |= r4; + // EBPF_OP_OR64_REG pc=102 dst=r5 src=r2 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r3; - // EBPF_OP_LSH64_IMM pc=105 dst=r0 src=r0 offset=0 imm=32 + r5 |= r2; + // EBPF_OP_LSH64_IMM pc=103 dst=r5 src=r0 offset=0 imm=32 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_OR64_REG pc=106 dst=r0 src=r4 offset=0 imm=0 + r5 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_OR64_REG pc=104 dst=r5 src=r3 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r4; - // EBPF_OP_STXDW pc=107 dst=r10 src=r0 offset=-72 imm=0 + r5 |= r3; + // EBPF_OP_STXDW pc=105 dst=r10 src=r5 offset=-72 imm=0 #line 60 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r0; - // EBPF_OP_LDXW pc=108 dst=r3 src=r1 offset=24 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r5; + // EBPF_OP_LDXW pc=106 dst=r2 src=r1 offset=24 imm=0 #line 61 "sample/sockops.c" - r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(24)); - // EBPF_OP_STXH pc=109 dst=r10 src=r3 offset=-56 imm=0 + r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(24)); + // EBPF_OP_STXH pc=107 dst=r10 src=r2 offset=-56 imm=0 #line 61 "sample/sockops.c" - *(uint16_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint16_t)r3; - // EBPF_OP_LDXB pc=110 dst=r4 src=r2 offset=13 imm=0 + *(uint16_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint16_t)r2; + // EBPF_OP_LDXB pc=108 dst=r3 src=r1 offset=41 imm=0 #line 63 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(13)); - // EBPF_OP_LSH64_IMM pc=111 dst=r4 src=r0 offset=0 imm=8 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(41)); + // EBPF_OP_LSH64_IMM pc=109 dst=r3 src=r0 offset=0 imm=8 #line 63 "sample/sockops.c" - r4 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=112 dst=r3 src=r2 offset=12 imm=0 + r3 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=110 dst=r2 src=r1 offset=40 imm=0 #line 63 "sample/sockops.c" - r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_OR64_REG pc=113 dst=r4 src=r3 offset=0 imm=0 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(40)); + // EBPF_OP_OR64_REG pc=111 dst=r3 src=r2 offset=0 imm=0 #line 63 "sample/sockops.c" - r4 |= r3; - // EBPF_OP_LDXB pc=114 dst=r5 src=r2 offset=14 imm=0 + r3 |= r2; + // EBPF_OP_LDXB pc=112 dst=r4 src=r1 offset=42 imm=0 #line 63 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(14)); - // EBPF_OP_LSH64_IMM pc=115 dst=r5 src=r0 offset=0 imm=16 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(42)); + // EBPF_OP_LSH64_IMM pc=113 dst=r4 src=r0 offset=0 imm=16 #line 63 "sample/sockops.c" - r5 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=116 dst=r3 src=r2 offset=15 imm=0 + r4 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=114 dst=r2 src=r1 offset=43 imm=0 #line 63 "sample/sockops.c" - r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(15)); - // EBPF_OP_LSH64_IMM pc=117 dst=r3 src=r0 offset=0 imm=24 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(43)); + // EBPF_OP_LSH64_IMM pc=115 dst=r2 src=r0 offset=0 imm=24 #line 63 "sample/sockops.c" - r3 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=118 dst=r3 src=r5 offset=0 imm=0 + r2 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=116 dst=r2 src=r4 offset=0 imm=0 #line 63 "sample/sockops.c" - r3 |= r5; - // EBPF_OP_LDXB pc=119 dst=r0 src=r2 offset=1 imm=0 + r2 |= r4; + // EBPF_OP_LDXB pc=117 dst=r5 src=r1 offset=29 imm=0 #line 63 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(1)); - // EBPF_OP_LSH64_IMM pc=120 dst=r0 src=r0 offset=0 imm=8 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(29)); + // EBPF_OP_LSH64_IMM pc=118 dst=r5 src=r0 offset=0 imm=8 #line 63 "sample/sockops.c" - r0 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=121 dst=r5 src=r2 offset=0 imm=0 + r5 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=119 dst=r4 src=r1 offset=28 imm=0 #line 63 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_OR64_REG pc=122 dst=r0 src=r5 offset=0 imm=0 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(28)); + // EBPF_OP_OR64_REG pc=120 dst=r5 src=r4 offset=0 imm=0 #line 63 "sample/sockops.c" - r0 |= r5; - // EBPF_OP_LDXB pc=123 dst=r7 src=r2 offset=2 imm=0 + r5 |= r4; + // EBPF_OP_LDXB pc=121 dst=r0 src=r1 offset=30 imm=0 #line 63 "sample/sockops.c" - r7 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_LSH64_IMM pc=124 dst=r7 src=r0 offset=0 imm=16 + r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(30)); + // EBPF_OP_LSH64_IMM pc=122 dst=r0 src=r0 offset=0 imm=16 #line 63 "sample/sockops.c" - r7 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=125 dst=r5 src=r2 offset=3 imm=0 + r0 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=123 dst=r4 src=r1 offset=31 imm=0 #line 63 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(3)); - // EBPF_OP_LSH64_IMM pc=126 dst=r5 src=r0 offset=0 imm=24 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(31)); + // EBPF_OP_LSH64_IMM pc=124 dst=r4 src=r0 offset=0 imm=24 #line 63 "sample/sockops.c" - r5 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=127 dst=r5 src=r7 offset=0 imm=0 + r4 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=125 dst=r4 src=r0 offset=0 imm=0 #line 63 "sample/sockops.c" - r5 |= r7; - // EBPF_OP_OR64_REG pc=128 dst=r5 src=r0 offset=0 imm=0 + r4 |= r0; + // EBPF_OP_OR64_REG pc=126 dst=r4 src=r5 offset=0 imm=0 #line 63 "sample/sockops.c" - r5 |= r0; - // EBPF_OP_OR64_REG pc=129 dst=r3 src=r4 offset=0 imm=0 + r4 |= r5; + // EBPF_OP_OR64_REG pc=127 dst=r2 src=r3 offset=0 imm=0 #line 63 "sample/sockops.c" - r3 |= r4; - // EBPF_OP_LDXB pc=130 dst=r4 src=r2 offset=9 imm=0 + r2 |= r3; + // EBPF_OP_LDXB pc=128 dst=r3 src=r1 offset=37 imm=0 #line 63 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(9)); - // EBPF_OP_LSH64_IMM pc=131 dst=r4 src=r0 offset=0 imm=8 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(37)); + // EBPF_OP_LSH64_IMM pc=129 dst=r3 src=r0 offset=0 imm=8 #line 63 "sample/sockops.c" - r4 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=132 dst=r0 src=r2 offset=8 imm=0 + r3 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=130 dst=r5 src=r1 offset=36 imm=0 #line 63 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(8)); - // EBPF_OP_OR64_REG pc=133 dst=r4 src=r0 offset=0 imm=0 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(36)); + // EBPF_OP_OR64_REG pc=131 dst=r3 src=r5 offset=0 imm=0 #line 63 "sample/sockops.c" - r4 |= r0; - // EBPF_OP_LDXB pc=134 dst=r0 src=r2 offset=10 imm=0 + r3 |= r5; + // EBPF_OP_LDXB pc=132 dst=r5 src=r1 offset=38 imm=0 #line 63 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(10)); - // EBPF_OP_LSH64_IMM pc=135 dst=r0 src=r0 offset=0 imm=16 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(38)); + // EBPF_OP_LSH64_IMM pc=133 dst=r5 src=r0 offset=0 imm=16 #line 63 "sample/sockops.c" - r0 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=136 dst=r7 src=r2 offset=11 imm=0 + r5 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=134 dst=r0 src=r1 offset=39 imm=0 #line 63 "sample/sockops.c" - r7 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(11)); - // EBPF_OP_LSH64_IMM pc=137 dst=r7 src=r0 offset=0 imm=24 + r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(39)); + // EBPF_OP_LSH64_IMM pc=135 dst=r0 src=r0 offset=0 imm=24 #line 63 "sample/sockops.c" - r7 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=138 dst=r7 src=r0 offset=0 imm=0 + r0 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=136 dst=r0 src=r5 offset=0 imm=0 #line 63 "sample/sockops.c" - r7 |= r0; - // EBPF_OP_OR64_REG pc=139 dst=r7 src=r4 offset=0 imm=0 + r0 |= r5; + // EBPF_OP_OR64_REG pc=137 dst=r0 src=r3 offset=0 imm=0 #line 63 "sample/sockops.c" - r7 |= r4; - // EBPF_OP_STXW pc=140 dst=r10 src=r7 offset=-44 imm=0 + r0 |= r3; + // EBPF_OP_STXW pc=138 dst=r10 src=r0 offset=-44 imm=0 #line 63 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-44)) = (uint32_t)r7; - // EBPF_OP_STXW pc=141 dst=r10 src=r3 offset=-40 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-44)) = (uint32_t)r0; + // EBPF_OP_STXW pc=139 dst=r10 src=r2 offset=-40 imm=0 #line 63 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint32_t)r3; - // EBPF_OP_STXW pc=142 dst=r10 src=r5 offset=-52 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint32_t)r2; + // EBPF_OP_STXW pc=140 dst=r10 src=r4 offset=-52 imm=0 #line 63 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-52)) = (uint32_t)r5; - // EBPF_OP_LDXB pc=143 dst=r3 src=r2 offset=5 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-52)) = (uint32_t)r4; + // EBPF_OP_LDXB pc=141 dst=r2 src=r1 offset=33 imm=0 #line 63 "sample/sockops.c" - r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(5)); - // EBPF_OP_LSH64_IMM pc=144 dst=r3 src=r0 offset=0 imm=8 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(33)); + // EBPF_OP_LSH64_IMM pc=142 dst=r2 src=r0 offset=0 imm=8 #line 63 "sample/sockops.c" - r3 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=145 dst=r4 src=r2 offset=4 imm=0 + r2 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=143 dst=r3 src=r1 offset=32 imm=0 #line 63 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(4)); - // EBPF_OP_OR64_REG pc=146 dst=r3 src=r4 offset=0 imm=0 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(32)); + // EBPF_OP_OR64_REG pc=144 dst=r2 src=r3 offset=0 imm=0 #line 63 "sample/sockops.c" - r3 |= r4; - // EBPF_OP_LDXB pc=147 dst=r4 src=r2 offset=6 imm=0 + r2 |= r3; + // EBPF_OP_LDXB pc=145 dst=r3 src=r1 offset=34 imm=0 #line 63 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(6)); - // EBPF_OP_LSH64_IMM pc=148 dst=r4 src=r0 offset=0 imm=16 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(34)); + // EBPF_OP_LSH64_IMM pc=146 dst=r3 src=r0 offset=0 imm=16 #line 63 "sample/sockops.c" - r4 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=149 dst=r2 src=r2 offset=7 imm=0 + r3 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=147 dst=r4 src=r1 offset=35 imm=0 #line 63 "sample/sockops.c" - r2 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(7)); - // EBPF_OP_LSH64_IMM pc=150 dst=r2 src=r0 offset=0 imm=24 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(35)); + // EBPF_OP_LSH64_IMM pc=148 dst=r4 src=r0 offset=0 imm=24 #line 63 "sample/sockops.c" - r2 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=151 dst=r2 src=r4 offset=0 imm=0 + r4 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=149 dst=r4 src=r3 offset=0 imm=0 #line 63 "sample/sockops.c" - r2 |= r4; - // EBPF_OP_OR64_REG pc=152 dst=r2 src=r3 offset=0 imm=0 + r4 |= r3; + // EBPF_OP_OR64_REG pc=150 dst=r4 src=r2 offset=0 imm=0 #line 63 "sample/sockops.c" - r2 |= r3; - // EBPF_OP_STXW pc=153 dst=r10 src=r2 offset=-48 imm=0 + r4 |= r2; + // EBPF_OP_STXW pc=151 dst=r10 src=r4 offset=-48 imm=0 #line 63 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint32_t)r2; - // EBPF_OP_LDXW pc=154 dst=r2 src=r1 offset=44 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint32_t)r4; + // EBPF_OP_LDXW pc=152 dst=r2 src=r1 offset=44 imm=0 #line 64 "sample/sockops.c" r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44)); - // EBPF_OP_STXH pc=155 dst=r10 src=r2 offset=-36 imm=0 + // EBPF_OP_STXH pc=153 dst=r10 src=r2 offset=-36 imm=0 #line 64 "sample/sockops.c" *(uint16_t*)(uintptr_t)(r10 + OFFSET(-36)) = (uint16_t)r2; - // EBPF_OP_LDXB pc=156 dst=r2 src=r1 offset=48 imm=0 + // EBPF_OP_LDXB pc=154 dst=r2 src=r1 offset=48 imm=0 #line 65 "sample/sockops.c" r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(48)); - // EBPF_OP_STXW pc=157 dst=r10 src=r2 offset=-32 imm=0 + // EBPF_OP_STXW pc=155 dst=r10 src=r2 offset=-32 imm=0 #line 65 "sample/sockops.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint32_t)r2; - // EBPF_OP_LDXDW pc=158 dst=r1 src=r1 offset=56 imm=0 + // EBPF_OP_LDXDW pc=156 dst=r1 src=r1 offset=56 imm=0 #line 66 "sample/sockops.c" r1 = *(uint64_t*)(uintptr_t)(r1 + OFFSET(56)); - // EBPF_OP_STXDW pc=159 dst=r10 src=r1 offset=-24 imm=0 + // EBPF_OP_STXDW pc=157 dst=r10 src=r1 offset=-24 imm=0 #line 66 "sample/sockops.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r1; - // EBPF_OP_CALL pc=160 dst=r0 src=r0 offset=0 imm=19 + // EBPF_OP_CALL pc=158 dst=r0 src=r0 offset=0 imm=19 #line 67 "sample/sockops.c" r0 = connection_monitor_helpers[0].address(r1, r2, r3, r4, r5, context); #line 67 "sample/sockops.c" @@ -638,25 +630,25 @@ connection_monitor(void* context) return 0; #line 67 "sample/sockops.c" } - // EBPF_OP_STXB pc=161 dst=r10 src=r6 offset=-8 imm=0 + // EBPF_OP_STXB pc=159 dst=r10 src=r6 offset=-8 imm=0 #line 71 "sample/sockops.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint8_t)r6; - // EBPF_OP_RSH64_IMM pc=162 dst=r0 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=160 dst=r0 src=r0 offset=0 imm=32 #line 69 "sample/sockops.c" r0 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_STXDW pc=163 dst=r10 src=r0 offset=-16 imm=0 + // EBPF_OP_STXDW pc=161 dst=r10 src=r0 offset=-16 imm=0 #line 69 "sample/sockops.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r0; - // EBPF_OP_MOV64_REG pc=164 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=162 dst=r2 src=r10 offset=0 imm=0 #line 69 "sample/sockops.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=165 dst=r2 src=r0 offset=0 imm=-72 -#line 100 "sample/sockops.c" + // EBPF_OP_ADD64_IMM pc=163 dst=r2 src=r0 offset=0 imm=-72 +#line 69 "sample/sockops.c" r2 += IMMEDIATE(-72); - // EBPF_OP_LDDW pc=166 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=164 dst=r1 src=r1 offset=0 imm=1 #line 26 "sample/sockops.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_CALL pc=168 dst=r0 src=r0 offset=0 imm=1 + // EBPF_OP_CALL pc=166 dst=r0 src=r0 offset=0 imm=1 #line 26 "sample/sockops.c" r0 = connection_monitor_helpers[1].address(r1, r2, r3, r4, r5, context); #line 26 "sample/sockops.c" @@ -665,13 +657,13 @@ connection_monitor(void* context) return 0; #line 26 "sample/sockops.c" } - // EBPF_OP_MOV64_REG pc=169 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=167 dst=r1 src=r0 offset=0 imm=0 #line 26 "sample/sockops.c" r1 = r0; - // EBPF_OP_LDDW pc=170 dst=r0 src=r0 offset=0 imm=-1 + // EBPF_OP_LDDW pc=168 dst=r0 src=r0 offset=0 imm=-1 #line 26 "sample/sockops.c" r0 = (uint64_t)4294967295; - // EBPF_OP_JEQ_IMM pc=172 dst=r1 src=r0 offset=7 imm=0 + // EBPF_OP_JEQ_IMM pc=170 dst=r1 src=r0 offset=7 imm=0 #line 26 "sample/sockops.c" if (r1 == IMMEDIATE(0)) { #line 26 "sample/sockops.c" @@ -679,22 +671,22 @@ connection_monitor(void* context) #line 26 "sample/sockops.c" } label_4: - // EBPF_OP_MOV64_REG pc=173 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=171 dst=r2 src=r10 offset=0 imm=0 #line 26 "sample/sockops.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=174 dst=r2 src=r0 offset=0 imm=-72 + // EBPF_OP_ADD64_IMM pc=172 dst=r2 src=r0 offset=0 imm=-72 #line 100 "sample/sockops.c" r2 += IMMEDIATE(-72); - // EBPF_OP_LDDW pc=175 dst=r1 src=r1 offset=0 imm=2 + // EBPF_OP_LDDW pc=173 dst=r1 src=r1 offset=0 imm=2 #line 100 "sample/sockops.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_IMM pc=177 dst=r3 src=r0 offset=0 imm=72 + // EBPF_OP_MOV64_IMM pc=175 dst=r3 src=r0 offset=0 imm=72 #line 100 "sample/sockops.c" r3 = IMMEDIATE(72); - // EBPF_OP_MOV64_IMM pc=178 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=176 dst=r4 src=r0 offset=0 imm=0 #line 100 "sample/sockops.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=179 dst=r0 src=r0 offset=0 imm=11 + // EBPF_OP_CALL pc=177 dst=r0 src=r0 offset=0 imm=11 #line 100 "sample/sockops.c" r0 = connection_monitor_helpers[2].address(r1, r2, r3, r4, r5, context); #line 100 "sample/sockops.c" @@ -704,7 +696,7 @@ connection_monitor(void* context) #line 100 "sample/sockops.c" } label_5: - // EBPF_OP_EXIT pc=180 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_EXIT pc=178 dst=r0 src=r0 offset=0 imm=0 #line 103 "sample/sockops.c" return r0; #line 78 "sample/sockops.c" @@ -724,7 +716,7 @@ static program_entry_t _programs[] = { 2, connection_monitor_helpers, 3, - 181, + 179, &connection_monitor_program_type_guid, &connection_monitor_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/sockops_raw.c b/tests/bpf2c_tests/expected/sockops_raw.c index 6dcb16fa7c..ef4056d609 100644 --- a/tests/bpf2c_tests/expected/sockops_raw.c +++ b/tests/bpf2c_tests/expected/sockops_raw.c @@ -87,8 +87,6 @@ connection_monitor(void* context) register uint64_t r5 = 0; #line 78 "sample/sockops.c" register uint64_t r6 = 0; -#line 78 "sample/sockops.c" - register uint64_t r7 = 0; #line 78 "sample/sockops.c" register uint64_t r10 = 0; @@ -100,22 +98,22 @@ connection_monitor(void* context) // EBPF_OP_MOV64_IMM pc=0 dst=r6 src=r0 offset=0 imm=2 #line 78 "sample/sockops.c" r6 = IMMEDIATE(2); - // EBPF_OP_MOV64_IMM pc=1 dst=r3 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=1 dst=r2 src=r0 offset=0 imm=1 #line 78 "sample/sockops.c" - r3 = IMMEDIATE(1); - // EBPF_OP_LDXW pc=2 dst=r2 src=r1 offset=0 imm=0 + r2 = IMMEDIATE(1); + // EBPF_OP_LDXW pc=2 dst=r3 src=r1 offset=0 imm=0 #line 83 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=3 dst=r2 src=r0 offset=8 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(0)); + // EBPF_OP_JEQ_IMM pc=3 dst=r3 src=r0 offset=8 imm=0 #line 83 "sample/sockops.c" - if (r2 == IMMEDIATE(0)) { + if (r3 == IMMEDIATE(0)) { #line 83 "sample/sockops.c" goto label_2; #line 83 "sample/sockops.c" } - // EBPF_OP_JEQ_IMM pc=4 dst=r2 src=r0 offset=5 imm=2 + // EBPF_OP_JEQ_IMM pc=4 dst=r3 src=r0 offset=5 imm=2 #line 83 "sample/sockops.c" - if (r2 == IMMEDIATE(2)) { + if (r3 == IMMEDIATE(2)) { #line 83 "sample/sockops.c" goto label_1; #line 83 "sample/sockops.c" @@ -123,88 +121,88 @@ connection_monitor(void* context) // EBPF_OP_LDDW pc=5 dst=r0 src=r0 offset=0 imm=-1 #line 83 "sample/sockops.c" r0 = (uint64_t)4294967295; - // EBPF_OP_JNE_IMM pc=7 dst=r2 src=r0 offset=172 imm=1 + // EBPF_OP_JNE_IMM pc=7 dst=r3 src=r0 offset=170 imm=1 #line 83 "sample/sockops.c" - if (r2 != IMMEDIATE(1)) { + if (r3 != IMMEDIATE(1)) { #line 83 "sample/sockops.c" goto label_5; #line 83 "sample/sockops.c" } - // EBPF_OP_MOV64_IMM pc=8 dst=r3 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=8 dst=r2 src=r0 offset=0 imm=0 #line 83 "sample/sockops.c" - r3 = IMMEDIATE(0); + r2 = IMMEDIATE(0); // EBPF_OP_JA pc=9 dst=r0 src=r0 offset=2 imm=0 #line 83 "sample/sockops.c" goto label_2; label_1: - // EBPF_OP_MOV64_IMM pc=10 dst=r3 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=10 dst=r2 src=r0 offset=0 imm=0 #line 83 "sample/sockops.c" - r3 = IMMEDIATE(0); + r2 = IMMEDIATE(0); // EBPF_OP_MOV64_IMM pc=11 dst=r6 src=r0 offset=0 imm=0 #line 83 "sample/sockops.c" r6 = IMMEDIATE(0); label_2: - // EBPF_OP_LDXW pc=12 dst=r2 src=r1 offset=4 imm=0 + // EBPF_OP_LDXW pc=12 dst=r3 src=r1 offset=4 imm=0 #line 100 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(4)); - // EBPF_OP_JNE_IMM pc=13 dst=r2 src=r0 offset=37 imm=2 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(4)); + // EBPF_OP_JNE_IMM pc=13 dst=r3 src=r0 offset=37 imm=2 #line 100 "sample/sockops.c" - if (r2 != IMMEDIATE(2)) { + if (r3 != IMMEDIATE(2)) { #line 100 "sample/sockops.c" goto label_3; #line 100 "sample/sockops.c" } - // EBPF_OP_MOV64_IMM pc=14 dst=r2 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=14 dst=r3 src=r0 offset=0 imm=0 #line 100 "sample/sockops.c" - r2 = IMMEDIATE(0); - // EBPF_OP_STXDW pc=15 dst=r10 src=r2 offset=-8 imm=0 + r3 = IMMEDIATE(0); + // EBPF_OP_STXDW pc=15 dst=r10 src=r3 offset=-8 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=16 dst=r10 src=r2 offset=-16 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=16 dst=r10 src=r3 offset=-16 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=17 dst=r10 src=r2 offset=-24 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=17 dst=r10 src=r3 offset=-24 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=18 dst=r10 src=r2 offset=-32 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=18 dst=r10 src=r3 offset=-32 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=19 dst=r10 src=r2 offset=-40 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=19 dst=r10 src=r3 offset=-40 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=20 dst=r10 src=r2 offset=-48 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=20 dst=r10 src=r3 offset=-48 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=21 dst=r10 src=r2 offset=-56 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=21 dst=r10 src=r3 offset=-56 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=22 dst=r10 src=r2 offset=-64 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=22 dst=r10 src=r3 offset=-64 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=23 dst=r10 src=r2 offset=-72 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=23 dst=r10 src=r3 offset=-72 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r2; - // EBPF_OP_LDXW pc=24 dst=r2 src=r1 offset=8 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r3; + // EBPF_OP_LDXW pc=24 dst=r3 src=r1 offset=8 imm=0 #line 38 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(8)); - // EBPF_OP_STXW pc=25 dst=r10 src=r2 offset=-72 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(8)); + // EBPF_OP_STXW pc=25 dst=r10 src=r3 offset=-72 imm=0 #line 38 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint32_t)r2; - // EBPF_OP_LDXW pc=26 dst=r2 src=r1 offset=24 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint32_t)r3; + // EBPF_OP_LDXW pc=26 dst=r3 src=r1 offset=24 imm=0 #line 39 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(24)); - // EBPF_OP_STXH pc=27 dst=r10 src=r2 offset=-56 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(24)); + // EBPF_OP_STXH pc=27 dst=r10 src=r3 offset=-56 imm=0 #line 39 "sample/sockops.c" - *(uint16_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint16_t)r2; - // EBPF_OP_LDXW pc=28 dst=r2 src=r1 offset=28 imm=0 + *(uint16_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint16_t)r3; + // EBPF_OP_LDXW pc=28 dst=r3 src=r1 offset=28 imm=0 #line 40 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(28)); - // EBPF_OP_STXW pc=29 dst=r10 src=r2 offset=-52 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(28)); + // EBPF_OP_STXW pc=29 dst=r10 src=r3 offset=-52 imm=0 #line 40 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-52)) = (uint32_t)r2; - // EBPF_OP_OR64_REG pc=30 dst=r6 src=r3 offset=0 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-52)) = (uint32_t)r3; + // EBPF_OP_OR64_REG pc=30 dst=r6 src=r2 offset=0 imm=0 #line 47 "sample/sockops.c" - r6 |= r3; + r6 |= r2; // EBPF_OP_LDXW pc=31 dst=r2 src=r1 offset=44 imm=0 #line 41 "sample/sockops.c" r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44)); @@ -265,345 +263,339 @@ connection_monitor(void* context) // EBPF_OP_LDDW pc=47 dst=r0 src=r0 offset=0 imm=-1 #line 26 "sample/sockops.c" r0 = (uint64_t)4294967295; - // EBPF_OP_JEQ_IMM pc=49 dst=r1 src=r0 offset=130 imm=0 + // EBPF_OP_JEQ_IMM pc=49 dst=r1 src=r0 offset=128 imm=0 #line 26 "sample/sockops.c" if (r1 == IMMEDIATE(0)) { #line 26 "sample/sockops.c" goto label_5; #line 26 "sample/sockops.c" } - // EBPF_OP_JA pc=50 dst=r0 src=r0 offset=122 imm=0 + // EBPF_OP_JA pc=50 dst=r0 src=r0 offset=120 imm=0 #line 26 "sample/sockops.c" goto label_4; label_3: - // EBPF_OP_MOV64_REG pc=51 dst=r2 src=r1 offset=0 imm=0 -#line 100 "sample/sockops.c" - r2 = r1; - // EBPF_OP_ADD64_IMM pc=52 dst=r2 src=r0 offset=0 imm=28 -#line 100 "sample/sockops.c" - r2 += IMMEDIATE(28); - // EBPF_OP_MOV64_IMM pc=53 dst=r4 src=r0 offset=0 imm=0 -#line 100 "sample/sockops.c" - r4 = IMMEDIATE(0); - // EBPF_OP_STXDW pc=54 dst=r10 src=r4 offset=-8 imm=0 + // EBPF_OP_MOV64_IMM pc=51 dst=r3 src=r0 offset=0 imm=0 +#line 26 "sample/sockops.c" + r3 = IMMEDIATE(0); + // EBPF_OP_STXDW pc=52 dst=r10 src=r3 offset=-8 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=55 dst=r10 src=r4 offset=-16 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=53 dst=r10 src=r3 offset=-16 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=56 dst=r10 src=r4 offset=-24 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=54 dst=r10 src=r3 offset=-24 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=57 dst=r10 src=r4 offset=-32 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=55 dst=r10 src=r3 offset=-32 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=58 dst=r10 src=r4 offset=-40 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=56 dst=r10 src=r3 offset=-40 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=59 dst=r10 src=r4 offset=-48 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=57 dst=r10 src=r3 offset=-48 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=60 dst=r10 src=r4 offset=-56 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=58 dst=r10 src=r3 offset=-56 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint64_t)r4; - // EBPF_OP_LDXB pc=61 dst=r5 src=r1 offset=17 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint64_t)r3; + // EBPF_OP_LDXB pc=59 dst=r4 src=r1 offset=17 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(17)); - // EBPF_OP_LSH64_IMM pc=62 dst=r5 src=r0 offset=0 imm=8 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(17)); + // EBPF_OP_LSH64_IMM pc=60 dst=r4 src=r0 offset=0 imm=8 #line 60 "sample/sockops.c" - r5 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=63 dst=r4 src=r1 offset=16 imm=0 + r4 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=61 dst=r3 src=r1 offset=16 imm=0 #line 60 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(16)); - // EBPF_OP_OR64_REG pc=64 dst=r5 src=r4 offset=0 imm=0 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(16)); + // EBPF_OP_OR64_REG pc=62 dst=r4 src=r3 offset=0 imm=0 #line 60 "sample/sockops.c" - r5 |= r4; - // EBPF_OP_LDXB pc=65 dst=r0 src=r1 offset=18 imm=0 + r4 |= r3; + // EBPF_OP_LDXB pc=63 dst=r5 src=r1 offset=18 imm=0 #line 60 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(18)); - // EBPF_OP_LSH64_IMM pc=66 dst=r0 src=r0 offset=0 imm=16 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(18)); + // EBPF_OP_LSH64_IMM pc=64 dst=r5 src=r0 offset=0 imm=16 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=67 dst=r4 src=r1 offset=19 imm=0 + r5 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=65 dst=r3 src=r1 offset=19 imm=0 #line 60 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(19)); - // EBPF_OP_LSH64_IMM pc=68 dst=r4 src=r0 offset=0 imm=24 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(19)); + // EBPF_OP_LSH64_IMM pc=66 dst=r3 src=r0 offset=0 imm=24 #line 60 "sample/sockops.c" - r4 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=69 dst=r4 src=r0 offset=0 imm=0 + r3 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=67 dst=r3 src=r5 offset=0 imm=0 #line 60 "sample/sockops.c" - r4 |= r0; - // EBPF_OP_OR64_REG pc=70 dst=r4 src=r5 offset=0 imm=0 + r3 |= r5; + // EBPF_OP_OR64_REG pc=68 dst=r3 src=r4 offset=0 imm=0 #line 60 "sample/sockops.c" - r4 |= r5; - // EBPF_OP_LDXB pc=71 dst=r0 src=r1 offset=21 imm=0 + r3 |= r4; + // EBPF_OP_LDXB pc=69 dst=r5 src=r1 offset=21 imm=0 #line 60 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(21)); - // EBPF_OP_LSH64_IMM pc=72 dst=r0 src=r0 offset=0 imm=8 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(21)); + // EBPF_OP_LSH64_IMM pc=70 dst=r5 src=r0 offset=0 imm=8 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=73 dst=r5 src=r1 offset=20 imm=0 + r5 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=71 dst=r4 src=r1 offset=20 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(20)); - // EBPF_OP_OR64_REG pc=74 dst=r0 src=r5 offset=0 imm=0 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(20)); + // EBPF_OP_OR64_REG pc=72 dst=r5 src=r4 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r5; - // EBPF_OP_LDXB pc=75 dst=r7 src=r1 offset=22 imm=0 + r5 |= r4; + // EBPF_OP_LDXB pc=73 dst=r0 src=r1 offset=22 imm=0 #line 60 "sample/sockops.c" - r7 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(22)); - // EBPF_OP_LSH64_IMM pc=76 dst=r7 src=r0 offset=0 imm=16 + r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(22)); + // EBPF_OP_LSH64_IMM pc=74 dst=r0 src=r0 offset=0 imm=16 #line 60 "sample/sockops.c" - r7 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=77 dst=r5 src=r1 offset=23 imm=0 + r0 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=75 dst=r4 src=r1 offset=23 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(23)); - // EBPF_OP_LSH64_IMM pc=78 dst=r5 src=r0 offset=0 imm=24 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(23)); + // EBPF_OP_LSH64_IMM pc=76 dst=r4 src=r0 offset=0 imm=24 #line 60 "sample/sockops.c" - r5 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=79 dst=r5 src=r7 offset=0 imm=0 + r4 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=77 dst=r4 src=r0 offset=0 imm=0 #line 60 "sample/sockops.c" - r5 |= r7; - // EBPF_OP_OR64_REG pc=80 dst=r5 src=r0 offset=0 imm=0 + r4 |= r0; + // EBPF_OP_OR64_REG pc=78 dst=r4 src=r5 offset=0 imm=0 #line 60 "sample/sockops.c" - r5 |= r0; - // EBPF_OP_LSH64_IMM pc=81 dst=r5 src=r0 offset=0 imm=32 + r4 |= r5; + // EBPF_OP_LSH64_IMM pc=79 dst=r4 src=r0 offset=0 imm=32 #line 60 "sample/sockops.c" - r5 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_OR64_REG pc=82 dst=r5 src=r4 offset=0 imm=0 + r4 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_OR64_REG pc=80 dst=r4 src=r3 offset=0 imm=0 #line 60 "sample/sockops.c" - r5 |= r4; - // EBPF_OP_LDXB pc=83 dst=r0 src=r1 offset=9 imm=0 + r4 |= r3; + // EBPF_OP_LDXB pc=81 dst=r5 src=r1 offset=9 imm=0 #line 60 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(9)); - // EBPF_OP_LSH64_IMM pc=84 dst=r0 src=r0 offset=0 imm=8 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(9)); + // EBPF_OP_LSH64_IMM pc=82 dst=r5 src=r0 offset=0 imm=8 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=85 dst=r4 src=r1 offset=8 imm=0 + r5 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=83 dst=r3 src=r1 offset=8 imm=0 #line 60 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(8)); - // EBPF_OP_OR64_REG pc=86 dst=r0 src=r4 offset=0 imm=0 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(8)); + // EBPF_OP_OR64_REG pc=84 dst=r5 src=r3 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r4; - // EBPF_OP_LDXB pc=87 dst=r7 src=r1 offset=10 imm=0 + r5 |= r3; + // EBPF_OP_LDXB pc=85 dst=r0 src=r1 offset=10 imm=0 #line 60 "sample/sockops.c" - r7 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(10)); - // EBPF_OP_LSH64_IMM pc=88 dst=r7 src=r0 offset=0 imm=16 + r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(10)); + // EBPF_OP_LSH64_IMM pc=86 dst=r0 src=r0 offset=0 imm=16 #line 60 "sample/sockops.c" - r7 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=89 dst=r4 src=r1 offset=11 imm=0 + r0 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=87 dst=r3 src=r1 offset=11 imm=0 #line 60 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(11)); - // EBPF_OP_LSH64_IMM pc=90 dst=r4 src=r0 offset=0 imm=24 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(11)); + // EBPF_OP_LSH64_IMM pc=88 dst=r3 src=r0 offset=0 imm=24 #line 60 "sample/sockops.c" - r4 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=91 dst=r4 src=r7 offset=0 imm=0 + r3 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=89 dst=r3 src=r0 offset=0 imm=0 #line 60 "sample/sockops.c" - r4 |= r7; - // EBPF_OP_OR64_REG pc=92 dst=r6 src=r3 offset=0 imm=0 + r3 |= r0; + // EBPF_OP_OR64_REG pc=90 dst=r6 src=r2 offset=0 imm=0 #line 70 "sample/sockops.c" - r6 |= r3; - // EBPF_OP_STXDW pc=93 dst=r10 src=r5 offset=-64 imm=0 + r6 |= r2; + // EBPF_OP_STXDW pc=91 dst=r10 src=r4 offset=-64 imm=0 #line 60 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint64_t)r5; - // EBPF_OP_OR64_REG pc=94 dst=r4 src=r0 offset=0 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint64_t)r4; + // EBPF_OP_OR64_REG pc=92 dst=r3 src=r5 offset=0 imm=0 #line 60 "sample/sockops.c" - r4 |= r0; - // EBPF_OP_LDXB pc=95 dst=r3 src=r1 offset=13 imm=0 + r3 |= r5; + // EBPF_OP_LDXB pc=93 dst=r2 src=r1 offset=13 imm=0 #line 60 "sample/sockops.c" - r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(13)); - // EBPF_OP_LSH64_IMM pc=96 dst=r3 src=r0 offset=0 imm=8 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(13)); + // EBPF_OP_LSH64_IMM pc=94 dst=r2 src=r0 offset=0 imm=8 #line 60 "sample/sockops.c" - r3 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=97 dst=r5 src=r1 offset=12 imm=0 + r2 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=95 dst=r4 src=r1 offset=12 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(12)); - // EBPF_OP_OR64_REG pc=98 dst=r3 src=r5 offset=0 imm=0 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(12)); + // EBPF_OP_OR64_REG pc=96 dst=r2 src=r4 offset=0 imm=0 #line 60 "sample/sockops.c" - r3 |= r5; - // EBPF_OP_LDXB pc=99 dst=r5 src=r1 offset=14 imm=0 + r2 |= r4; + // EBPF_OP_LDXB pc=97 dst=r4 src=r1 offset=14 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(14)); - // EBPF_OP_LSH64_IMM pc=100 dst=r5 src=r0 offset=0 imm=16 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(14)); + // EBPF_OP_LSH64_IMM pc=98 dst=r4 src=r0 offset=0 imm=16 #line 60 "sample/sockops.c" - r5 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=101 dst=r0 src=r1 offset=15 imm=0 + r4 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=99 dst=r5 src=r1 offset=15 imm=0 #line 60 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(15)); - // EBPF_OP_LSH64_IMM pc=102 dst=r0 src=r0 offset=0 imm=24 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(15)); + // EBPF_OP_LSH64_IMM pc=100 dst=r5 src=r0 offset=0 imm=24 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=103 dst=r0 src=r5 offset=0 imm=0 + r5 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=101 dst=r5 src=r4 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r5; - // EBPF_OP_OR64_REG pc=104 dst=r0 src=r3 offset=0 imm=0 + r5 |= r4; + // EBPF_OP_OR64_REG pc=102 dst=r5 src=r2 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r3; - // EBPF_OP_LSH64_IMM pc=105 dst=r0 src=r0 offset=0 imm=32 + r5 |= r2; + // EBPF_OP_LSH64_IMM pc=103 dst=r5 src=r0 offset=0 imm=32 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_OR64_REG pc=106 dst=r0 src=r4 offset=0 imm=0 + r5 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_OR64_REG pc=104 dst=r5 src=r3 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r4; - // EBPF_OP_STXDW pc=107 dst=r10 src=r0 offset=-72 imm=0 + r5 |= r3; + // EBPF_OP_STXDW pc=105 dst=r10 src=r5 offset=-72 imm=0 #line 60 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r0; - // EBPF_OP_LDXW pc=108 dst=r3 src=r1 offset=24 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r5; + // EBPF_OP_LDXW pc=106 dst=r2 src=r1 offset=24 imm=0 #line 61 "sample/sockops.c" - r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(24)); - // EBPF_OP_STXH pc=109 dst=r10 src=r3 offset=-56 imm=0 + r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(24)); + // EBPF_OP_STXH pc=107 dst=r10 src=r2 offset=-56 imm=0 #line 61 "sample/sockops.c" - *(uint16_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint16_t)r3; - // EBPF_OP_LDXB pc=110 dst=r4 src=r2 offset=13 imm=0 + *(uint16_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint16_t)r2; + // EBPF_OP_LDXB pc=108 dst=r3 src=r1 offset=41 imm=0 #line 63 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(13)); - // EBPF_OP_LSH64_IMM pc=111 dst=r4 src=r0 offset=0 imm=8 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(41)); + // EBPF_OP_LSH64_IMM pc=109 dst=r3 src=r0 offset=0 imm=8 #line 63 "sample/sockops.c" - r4 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=112 dst=r3 src=r2 offset=12 imm=0 + r3 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=110 dst=r2 src=r1 offset=40 imm=0 #line 63 "sample/sockops.c" - r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_OR64_REG pc=113 dst=r4 src=r3 offset=0 imm=0 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(40)); + // EBPF_OP_OR64_REG pc=111 dst=r3 src=r2 offset=0 imm=0 #line 63 "sample/sockops.c" - r4 |= r3; - // EBPF_OP_LDXB pc=114 dst=r5 src=r2 offset=14 imm=0 + r3 |= r2; + // EBPF_OP_LDXB pc=112 dst=r4 src=r1 offset=42 imm=0 #line 63 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(14)); - // EBPF_OP_LSH64_IMM pc=115 dst=r5 src=r0 offset=0 imm=16 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(42)); + // EBPF_OP_LSH64_IMM pc=113 dst=r4 src=r0 offset=0 imm=16 #line 63 "sample/sockops.c" - r5 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=116 dst=r3 src=r2 offset=15 imm=0 + r4 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=114 dst=r2 src=r1 offset=43 imm=0 #line 63 "sample/sockops.c" - r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(15)); - // EBPF_OP_LSH64_IMM pc=117 dst=r3 src=r0 offset=0 imm=24 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(43)); + // EBPF_OP_LSH64_IMM pc=115 dst=r2 src=r0 offset=0 imm=24 #line 63 "sample/sockops.c" - r3 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=118 dst=r3 src=r5 offset=0 imm=0 + r2 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=116 dst=r2 src=r4 offset=0 imm=0 #line 63 "sample/sockops.c" - r3 |= r5; - // EBPF_OP_LDXB pc=119 dst=r0 src=r2 offset=1 imm=0 + r2 |= r4; + // EBPF_OP_LDXB pc=117 dst=r5 src=r1 offset=29 imm=0 #line 63 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(1)); - // EBPF_OP_LSH64_IMM pc=120 dst=r0 src=r0 offset=0 imm=8 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(29)); + // EBPF_OP_LSH64_IMM pc=118 dst=r5 src=r0 offset=0 imm=8 #line 63 "sample/sockops.c" - r0 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=121 dst=r5 src=r2 offset=0 imm=0 + r5 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=119 dst=r4 src=r1 offset=28 imm=0 #line 63 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_OR64_REG pc=122 dst=r0 src=r5 offset=0 imm=0 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(28)); + // EBPF_OP_OR64_REG pc=120 dst=r5 src=r4 offset=0 imm=0 #line 63 "sample/sockops.c" - r0 |= r5; - // EBPF_OP_LDXB pc=123 dst=r7 src=r2 offset=2 imm=0 + r5 |= r4; + // EBPF_OP_LDXB pc=121 dst=r0 src=r1 offset=30 imm=0 #line 63 "sample/sockops.c" - r7 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_LSH64_IMM pc=124 dst=r7 src=r0 offset=0 imm=16 + r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(30)); + // EBPF_OP_LSH64_IMM pc=122 dst=r0 src=r0 offset=0 imm=16 #line 63 "sample/sockops.c" - r7 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=125 dst=r5 src=r2 offset=3 imm=0 + r0 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=123 dst=r4 src=r1 offset=31 imm=0 #line 63 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(3)); - // EBPF_OP_LSH64_IMM pc=126 dst=r5 src=r0 offset=0 imm=24 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(31)); + // EBPF_OP_LSH64_IMM pc=124 dst=r4 src=r0 offset=0 imm=24 #line 63 "sample/sockops.c" - r5 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=127 dst=r5 src=r7 offset=0 imm=0 + r4 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=125 dst=r4 src=r0 offset=0 imm=0 #line 63 "sample/sockops.c" - r5 |= r7; - // EBPF_OP_OR64_REG pc=128 dst=r5 src=r0 offset=0 imm=0 + r4 |= r0; + // EBPF_OP_OR64_REG pc=126 dst=r4 src=r5 offset=0 imm=0 #line 63 "sample/sockops.c" - r5 |= r0; - // EBPF_OP_OR64_REG pc=129 dst=r3 src=r4 offset=0 imm=0 + r4 |= r5; + // EBPF_OP_OR64_REG pc=127 dst=r2 src=r3 offset=0 imm=0 #line 63 "sample/sockops.c" - r3 |= r4; - // EBPF_OP_LDXB pc=130 dst=r4 src=r2 offset=9 imm=0 + r2 |= r3; + // EBPF_OP_LDXB pc=128 dst=r3 src=r1 offset=37 imm=0 #line 63 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(9)); - // EBPF_OP_LSH64_IMM pc=131 dst=r4 src=r0 offset=0 imm=8 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(37)); + // EBPF_OP_LSH64_IMM pc=129 dst=r3 src=r0 offset=0 imm=8 #line 63 "sample/sockops.c" - r4 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=132 dst=r0 src=r2 offset=8 imm=0 + r3 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=130 dst=r5 src=r1 offset=36 imm=0 #line 63 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(8)); - // EBPF_OP_OR64_REG pc=133 dst=r4 src=r0 offset=0 imm=0 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(36)); + // EBPF_OP_OR64_REG pc=131 dst=r3 src=r5 offset=0 imm=0 #line 63 "sample/sockops.c" - r4 |= r0; - // EBPF_OP_LDXB pc=134 dst=r0 src=r2 offset=10 imm=0 + r3 |= r5; + // EBPF_OP_LDXB pc=132 dst=r5 src=r1 offset=38 imm=0 #line 63 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(10)); - // EBPF_OP_LSH64_IMM pc=135 dst=r0 src=r0 offset=0 imm=16 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(38)); + // EBPF_OP_LSH64_IMM pc=133 dst=r5 src=r0 offset=0 imm=16 #line 63 "sample/sockops.c" - r0 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=136 dst=r7 src=r2 offset=11 imm=0 + r5 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=134 dst=r0 src=r1 offset=39 imm=0 #line 63 "sample/sockops.c" - r7 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(11)); - // EBPF_OP_LSH64_IMM pc=137 dst=r7 src=r0 offset=0 imm=24 + r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(39)); + // EBPF_OP_LSH64_IMM pc=135 dst=r0 src=r0 offset=0 imm=24 #line 63 "sample/sockops.c" - r7 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=138 dst=r7 src=r0 offset=0 imm=0 + r0 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=136 dst=r0 src=r5 offset=0 imm=0 #line 63 "sample/sockops.c" - r7 |= r0; - // EBPF_OP_OR64_REG pc=139 dst=r7 src=r4 offset=0 imm=0 + r0 |= r5; + // EBPF_OP_OR64_REG pc=137 dst=r0 src=r3 offset=0 imm=0 #line 63 "sample/sockops.c" - r7 |= r4; - // EBPF_OP_STXW pc=140 dst=r10 src=r7 offset=-44 imm=0 + r0 |= r3; + // EBPF_OP_STXW pc=138 dst=r10 src=r0 offset=-44 imm=0 #line 63 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-44)) = (uint32_t)r7; - // EBPF_OP_STXW pc=141 dst=r10 src=r3 offset=-40 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-44)) = (uint32_t)r0; + // EBPF_OP_STXW pc=139 dst=r10 src=r2 offset=-40 imm=0 #line 63 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint32_t)r3; - // EBPF_OP_STXW pc=142 dst=r10 src=r5 offset=-52 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint32_t)r2; + // EBPF_OP_STXW pc=140 dst=r10 src=r4 offset=-52 imm=0 #line 63 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-52)) = (uint32_t)r5; - // EBPF_OP_LDXB pc=143 dst=r3 src=r2 offset=5 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-52)) = (uint32_t)r4; + // EBPF_OP_LDXB pc=141 dst=r2 src=r1 offset=33 imm=0 #line 63 "sample/sockops.c" - r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(5)); - // EBPF_OP_LSH64_IMM pc=144 dst=r3 src=r0 offset=0 imm=8 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(33)); + // EBPF_OP_LSH64_IMM pc=142 dst=r2 src=r0 offset=0 imm=8 #line 63 "sample/sockops.c" - r3 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=145 dst=r4 src=r2 offset=4 imm=0 + r2 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=143 dst=r3 src=r1 offset=32 imm=0 #line 63 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(4)); - // EBPF_OP_OR64_REG pc=146 dst=r3 src=r4 offset=0 imm=0 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(32)); + // EBPF_OP_OR64_REG pc=144 dst=r2 src=r3 offset=0 imm=0 #line 63 "sample/sockops.c" - r3 |= r4; - // EBPF_OP_LDXB pc=147 dst=r4 src=r2 offset=6 imm=0 + r2 |= r3; + // EBPF_OP_LDXB pc=145 dst=r3 src=r1 offset=34 imm=0 #line 63 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(6)); - // EBPF_OP_LSH64_IMM pc=148 dst=r4 src=r0 offset=0 imm=16 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(34)); + // EBPF_OP_LSH64_IMM pc=146 dst=r3 src=r0 offset=0 imm=16 #line 63 "sample/sockops.c" - r4 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=149 dst=r2 src=r2 offset=7 imm=0 + r3 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=147 dst=r4 src=r1 offset=35 imm=0 #line 63 "sample/sockops.c" - r2 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(7)); - // EBPF_OP_LSH64_IMM pc=150 dst=r2 src=r0 offset=0 imm=24 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(35)); + // EBPF_OP_LSH64_IMM pc=148 dst=r4 src=r0 offset=0 imm=24 #line 63 "sample/sockops.c" - r2 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=151 dst=r2 src=r4 offset=0 imm=0 + r4 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=149 dst=r4 src=r3 offset=0 imm=0 #line 63 "sample/sockops.c" - r2 |= r4; - // EBPF_OP_OR64_REG pc=152 dst=r2 src=r3 offset=0 imm=0 + r4 |= r3; + // EBPF_OP_OR64_REG pc=150 dst=r4 src=r2 offset=0 imm=0 #line 63 "sample/sockops.c" - r2 |= r3; - // EBPF_OP_STXW pc=153 dst=r10 src=r2 offset=-48 imm=0 + r4 |= r2; + // EBPF_OP_STXW pc=151 dst=r10 src=r4 offset=-48 imm=0 #line 63 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint32_t)r2; - // EBPF_OP_LDXW pc=154 dst=r2 src=r1 offset=44 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint32_t)r4; + // EBPF_OP_LDXW pc=152 dst=r2 src=r1 offset=44 imm=0 #line 64 "sample/sockops.c" r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44)); - // EBPF_OP_STXH pc=155 dst=r10 src=r2 offset=-36 imm=0 + // EBPF_OP_STXH pc=153 dst=r10 src=r2 offset=-36 imm=0 #line 64 "sample/sockops.c" *(uint16_t*)(uintptr_t)(r10 + OFFSET(-36)) = (uint16_t)r2; - // EBPF_OP_LDXB pc=156 dst=r2 src=r1 offset=48 imm=0 + // EBPF_OP_LDXB pc=154 dst=r2 src=r1 offset=48 imm=0 #line 65 "sample/sockops.c" r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(48)); - // EBPF_OP_STXW pc=157 dst=r10 src=r2 offset=-32 imm=0 + // EBPF_OP_STXW pc=155 dst=r10 src=r2 offset=-32 imm=0 #line 65 "sample/sockops.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint32_t)r2; - // EBPF_OP_LDXDW pc=158 dst=r1 src=r1 offset=56 imm=0 + // EBPF_OP_LDXDW pc=156 dst=r1 src=r1 offset=56 imm=0 #line 66 "sample/sockops.c" r1 = *(uint64_t*)(uintptr_t)(r1 + OFFSET(56)); - // EBPF_OP_STXDW pc=159 dst=r10 src=r1 offset=-24 imm=0 + // EBPF_OP_STXDW pc=157 dst=r10 src=r1 offset=-24 imm=0 #line 66 "sample/sockops.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r1; - // EBPF_OP_CALL pc=160 dst=r0 src=r0 offset=0 imm=19 + // EBPF_OP_CALL pc=158 dst=r0 src=r0 offset=0 imm=19 #line 67 "sample/sockops.c" r0 = connection_monitor_helpers[0].address(r1, r2, r3, r4, r5, context); #line 67 "sample/sockops.c" @@ -612,25 +604,25 @@ connection_monitor(void* context) return 0; #line 67 "sample/sockops.c" } - // EBPF_OP_STXB pc=161 dst=r10 src=r6 offset=-8 imm=0 + // EBPF_OP_STXB pc=159 dst=r10 src=r6 offset=-8 imm=0 #line 71 "sample/sockops.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint8_t)r6; - // EBPF_OP_RSH64_IMM pc=162 dst=r0 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=160 dst=r0 src=r0 offset=0 imm=32 #line 69 "sample/sockops.c" r0 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_STXDW pc=163 dst=r10 src=r0 offset=-16 imm=0 + // EBPF_OP_STXDW pc=161 dst=r10 src=r0 offset=-16 imm=0 #line 69 "sample/sockops.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r0; - // EBPF_OP_MOV64_REG pc=164 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=162 dst=r2 src=r10 offset=0 imm=0 #line 69 "sample/sockops.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=165 dst=r2 src=r0 offset=0 imm=-72 -#line 100 "sample/sockops.c" + // EBPF_OP_ADD64_IMM pc=163 dst=r2 src=r0 offset=0 imm=-72 +#line 69 "sample/sockops.c" r2 += IMMEDIATE(-72); - // EBPF_OP_LDDW pc=166 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=164 dst=r1 src=r1 offset=0 imm=1 #line 26 "sample/sockops.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_CALL pc=168 dst=r0 src=r0 offset=0 imm=1 + // EBPF_OP_CALL pc=166 dst=r0 src=r0 offset=0 imm=1 #line 26 "sample/sockops.c" r0 = connection_monitor_helpers[1].address(r1, r2, r3, r4, r5, context); #line 26 "sample/sockops.c" @@ -639,13 +631,13 @@ connection_monitor(void* context) return 0; #line 26 "sample/sockops.c" } - // EBPF_OP_MOV64_REG pc=169 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=167 dst=r1 src=r0 offset=0 imm=0 #line 26 "sample/sockops.c" r1 = r0; - // EBPF_OP_LDDW pc=170 dst=r0 src=r0 offset=0 imm=-1 + // EBPF_OP_LDDW pc=168 dst=r0 src=r0 offset=0 imm=-1 #line 26 "sample/sockops.c" r0 = (uint64_t)4294967295; - // EBPF_OP_JEQ_IMM pc=172 dst=r1 src=r0 offset=7 imm=0 + // EBPF_OP_JEQ_IMM pc=170 dst=r1 src=r0 offset=7 imm=0 #line 26 "sample/sockops.c" if (r1 == IMMEDIATE(0)) { #line 26 "sample/sockops.c" @@ -653,22 +645,22 @@ connection_monitor(void* context) #line 26 "sample/sockops.c" } label_4: - // EBPF_OP_MOV64_REG pc=173 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=171 dst=r2 src=r10 offset=0 imm=0 #line 26 "sample/sockops.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=174 dst=r2 src=r0 offset=0 imm=-72 + // EBPF_OP_ADD64_IMM pc=172 dst=r2 src=r0 offset=0 imm=-72 #line 100 "sample/sockops.c" r2 += IMMEDIATE(-72); - // EBPF_OP_LDDW pc=175 dst=r1 src=r1 offset=0 imm=2 + // EBPF_OP_LDDW pc=173 dst=r1 src=r1 offset=0 imm=2 #line 100 "sample/sockops.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_IMM pc=177 dst=r3 src=r0 offset=0 imm=72 + // EBPF_OP_MOV64_IMM pc=175 dst=r3 src=r0 offset=0 imm=72 #line 100 "sample/sockops.c" r3 = IMMEDIATE(72); - // EBPF_OP_MOV64_IMM pc=178 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=176 dst=r4 src=r0 offset=0 imm=0 #line 100 "sample/sockops.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=179 dst=r0 src=r0 offset=0 imm=11 + // EBPF_OP_CALL pc=177 dst=r0 src=r0 offset=0 imm=11 #line 100 "sample/sockops.c" r0 = connection_monitor_helpers[2].address(r1, r2, r3, r4, r5, context); #line 100 "sample/sockops.c" @@ -678,7 +670,7 @@ connection_monitor(void* context) #line 100 "sample/sockops.c" } label_5: - // EBPF_OP_EXIT pc=180 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_EXIT pc=178 dst=r0 src=r0 offset=0 imm=0 #line 103 "sample/sockops.c" return r0; #line 78 "sample/sockops.c" @@ -698,7 +690,7 @@ static program_entry_t _programs[] = { 2, connection_monitor_helpers, 3, - 181, + 179, &connection_monitor_program_type_guid, &connection_monitor_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/sockops_sys.c b/tests/bpf2c_tests/expected/sockops_sys.c index 4b3d6c7aba..747bef8681 100644 --- a/tests/bpf2c_tests/expected/sockops_sys.c +++ b/tests/bpf2c_tests/expected/sockops_sys.c @@ -248,8 +248,6 @@ connection_monitor(void* context) register uint64_t r5 = 0; #line 78 "sample/sockops.c" register uint64_t r6 = 0; -#line 78 "sample/sockops.c" - register uint64_t r7 = 0; #line 78 "sample/sockops.c" register uint64_t r10 = 0; @@ -261,22 +259,22 @@ connection_monitor(void* context) // EBPF_OP_MOV64_IMM pc=0 dst=r6 src=r0 offset=0 imm=2 #line 78 "sample/sockops.c" r6 = IMMEDIATE(2); - // EBPF_OP_MOV64_IMM pc=1 dst=r3 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_IMM pc=1 dst=r2 src=r0 offset=0 imm=1 #line 78 "sample/sockops.c" - r3 = IMMEDIATE(1); - // EBPF_OP_LDXW pc=2 dst=r2 src=r1 offset=0 imm=0 + r2 = IMMEDIATE(1); + // EBPF_OP_LDXW pc=2 dst=r3 src=r1 offset=0 imm=0 #line 83 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(0)); - // EBPF_OP_JEQ_IMM pc=3 dst=r2 src=r0 offset=8 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(0)); + // EBPF_OP_JEQ_IMM pc=3 dst=r3 src=r0 offset=8 imm=0 #line 83 "sample/sockops.c" - if (r2 == IMMEDIATE(0)) { + if (r3 == IMMEDIATE(0)) { #line 83 "sample/sockops.c" goto label_2; #line 83 "sample/sockops.c" } - // EBPF_OP_JEQ_IMM pc=4 dst=r2 src=r0 offset=5 imm=2 + // EBPF_OP_JEQ_IMM pc=4 dst=r3 src=r0 offset=5 imm=2 #line 83 "sample/sockops.c" - if (r2 == IMMEDIATE(2)) { + if (r3 == IMMEDIATE(2)) { #line 83 "sample/sockops.c" goto label_1; #line 83 "sample/sockops.c" @@ -284,88 +282,88 @@ connection_monitor(void* context) // EBPF_OP_LDDW pc=5 dst=r0 src=r0 offset=0 imm=-1 #line 83 "sample/sockops.c" r0 = (uint64_t)4294967295; - // EBPF_OP_JNE_IMM pc=7 dst=r2 src=r0 offset=172 imm=1 + // EBPF_OP_JNE_IMM pc=7 dst=r3 src=r0 offset=170 imm=1 #line 83 "sample/sockops.c" - if (r2 != IMMEDIATE(1)) { + if (r3 != IMMEDIATE(1)) { #line 83 "sample/sockops.c" goto label_5; #line 83 "sample/sockops.c" } - // EBPF_OP_MOV64_IMM pc=8 dst=r3 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=8 dst=r2 src=r0 offset=0 imm=0 #line 83 "sample/sockops.c" - r3 = IMMEDIATE(0); + r2 = IMMEDIATE(0); // EBPF_OP_JA pc=9 dst=r0 src=r0 offset=2 imm=0 #line 83 "sample/sockops.c" goto label_2; label_1: - // EBPF_OP_MOV64_IMM pc=10 dst=r3 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=10 dst=r2 src=r0 offset=0 imm=0 #line 83 "sample/sockops.c" - r3 = IMMEDIATE(0); + r2 = IMMEDIATE(0); // EBPF_OP_MOV64_IMM pc=11 dst=r6 src=r0 offset=0 imm=0 #line 83 "sample/sockops.c" r6 = IMMEDIATE(0); label_2: - // EBPF_OP_LDXW pc=12 dst=r2 src=r1 offset=4 imm=0 + // EBPF_OP_LDXW pc=12 dst=r3 src=r1 offset=4 imm=0 #line 100 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(4)); - // EBPF_OP_JNE_IMM pc=13 dst=r2 src=r0 offset=37 imm=2 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(4)); + // EBPF_OP_JNE_IMM pc=13 dst=r3 src=r0 offset=37 imm=2 #line 100 "sample/sockops.c" - if (r2 != IMMEDIATE(2)) { + if (r3 != IMMEDIATE(2)) { #line 100 "sample/sockops.c" goto label_3; #line 100 "sample/sockops.c" } - // EBPF_OP_MOV64_IMM pc=14 dst=r2 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=14 dst=r3 src=r0 offset=0 imm=0 #line 100 "sample/sockops.c" - r2 = IMMEDIATE(0); - // EBPF_OP_STXDW pc=15 dst=r10 src=r2 offset=-8 imm=0 + r3 = IMMEDIATE(0); + // EBPF_OP_STXDW pc=15 dst=r10 src=r3 offset=-8 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=16 dst=r10 src=r2 offset=-16 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=16 dst=r10 src=r3 offset=-16 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=17 dst=r10 src=r2 offset=-24 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=17 dst=r10 src=r3 offset=-24 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=18 dst=r10 src=r2 offset=-32 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=18 dst=r10 src=r3 offset=-32 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=19 dst=r10 src=r2 offset=-40 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=19 dst=r10 src=r3 offset=-40 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=20 dst=r10 src=r2 offset=-48 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=20 dst=r10 src=r3 offset=-48 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=21 dst=r10 src=r2 offset=-56 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=21 dst=r10 src=r3 offset=-56 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=22 dst=r10 src=r2 offset=-64 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=22 dst=r10 src=r3 offset=-64 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint64_t)r2; - // EBPF_OP_STXDW pc=23 dst=r10 src=r2 offset=-72 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=23 dst=r10 src=r3 offset=-72 imm=0 #line 36 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r2; - // EBPF_OP_LDXW pc=24 dst=r2 src=r1 offset=8 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r3; + // EBPF_OP_LDXW pc=24 dst=r3 src=r1 offset=8 imm=0 #line 38 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(8)); - // EBPF_OP_STXW pc=25 dst=r10 src=r2 offset=-72 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(8)); + // EBPF_OP_STXW pc=25 dst=r10 src=r3 offset=-72 imm=0 #line 38 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint32_t)r2; - // EBPF_OP_LDXW pc=26 dst=r2 src=r1 offset=24 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint32_t)r3; + // EBPF_OP_LDXW pc=26 dst=r3 src=r1 offset=24 imm=0 #line 39 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(24)); - // EBPF_OP_STXH pc=27 dst=r10 src=r2 offset=-56 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(24)); + // EBPF_OP_STXH pc=27 dst=r10 src=r3 offset=-56 imm=0 #line 39 "sample/sockops.c" - *(uint16_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint16_t)r2; - // EBPF_OP_LDXW pc=28 dst=r2 src=r1 offset=28 imm=0 + *(uint16_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint16_t)r3; + // EBPF_OP_LDXW pc=28 dst=r3 src=r1 offset=28 imm=0 #line 40 "sample/sockops.c" - r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(28)); - // EBPF_OP_STXW pc=29 dst=r10 src=r2 offset=-52 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(28)); + // EBPF_OP_STXW pc=29 dst=r10 src=r3 offset=-52 imm=0 #line 40 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-52)) = (uint32_t)r2; - // EBPF_OP_OR64_REG pc=30 dst=r6 src=r3 offset=0 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-52)) = (uint32_t)r3; + // EBPF_OP_OR64_REG pc=30 dst=r6 src=r2 offset=0 imm=0 #line 47 "sample/sockops.c" - r6 |= r3; + r6 |= r2; // EBPF_OP_LDXW pc=31 dst=r2 src=r1 offset=44 imm=0 #line 41 "sample/sockops.c" r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44)); @@ -426,345 +424,339 @@ connection_monitor(void* context) // EBPF_OP_LDDW pc=47 dst=r0 src=r0 offset=0 imm=-1 #line 26 "sample/sockops.c" r0 = (uint64_t)4294967295; - // EBPF_OP_JEQ_IMM pc=49 dst=r1 src=r0 offset=130 imm=0 + // EBPF_OP_JEQ_IMM pc=49 dst=r1 src=r0 offset=128 imm=0 #line 26 "sample/sockops.c" if (r1 == IMMEDIATE(0)) { #line 26 "sample/sockops.c" goto label_5; #line 26 "sample/sockops.c" } - // EBPF_OP_JA pc=50 dst=r0 src=r0 offset=122 imm=0 + // EBPF_OP_JA pc=50 dst=r0 src=r0 offset=120 imm=0 #line 26 "sample/sockops.c" goto label_4; label_3: - // EBPF_OP_MOV64_REG pc=51 dst=r2 src=r1 offset=0 imm=0 -#line 100 "sample/sockops.c" - r2 = r1; - // EBPF_OP_ADD64_IMM pc=52 dst=r2 src=r0 offset=0 imm=28 -#line 100 "sample/sockops.c" - r2 += IMMEDIATE(28); - // EBPF_OP_MOV64_IMM pc=53 dst=r4 src=r0 offset=0 imm=0 -#line 100 "sample/sockops.c" - r4 = IMMEDIATE(0); - // EBPF_OP_STXDW pc=54 dst=r10 src=r4 offset=-8 imm=0 + // EBPF_OP_MOV64_IMM pc=51 dst=r3 src=r0 offset=0 imm=0 +#line 26 "sample/sockops.c" + r3 = IMMEDIATE(0); + // EBPF_OP_STXDW pc=52 dst=r10 src=r3 offset=-8 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=55 dst=r10 src=r4 offset=-16 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=53 dst=r10 src=r3 offset=-16 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=56 dst=r10 src=r4 offset=-24 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=54 dst=r10 src=r3 offset=-24 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=57 dst=r10 src=r4 offset=-32 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=55 dst=r10 src=r3 offset=-32 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=58 dst=r10 src=r4 offset=-40 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=56 dst=r10 src=r3 offset=-40 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=59 dst=r10 src=r4 offset=-48 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=57 dst=r10 src=r3 offset=-48 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint64_t)r4; - // EBPF_OP_STXDW pc=60 dst=r10 src=r4 offset=-56 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint64_t)r3; + // EBPF_OP_STXDW pc=58 dst=r10 src=r3 offset=-56 imm=0 #line 56 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint64_t)r4; - // EBPF_OP_LDXB pc=61 dst=r5 src=r1 offset=17 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint64_t)r3; + // EBPF_OP_LDXB pc=59 dst=r4 src=r1 offset=17 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(17)); - // EBPF_OP_LSH64_IMM pc=62 dst=r5 src=r0 offset=0 imm=8 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(17)); + // EBPF_OP_LSH64_IMM pc=60 dst=r4 src=r0 offset=0 imm=8 #line 60 "sample/sockops.c" - r5 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=63 dst=r4 src=r1 offset=16 imm=0 + r4 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=61 dst=r3 src=r1 offset=16 imm=0 #line 60 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(16)); - // EBPF_OP_OR64_REG pc=64 dst=r5 src=r4 offset=0 imm=0 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(16)); + // EBPF_OP_OR64_REG pc=62 dst=r4 src=r3 offset=0 imm=0 #line 60 "sample/sockops.c" - r5 |= r4; - // EBPF_OP_LDXB pc=65 dst=r0 src=r1 offset=18 imm=0 + r4 |= r3; + // EBPF_OP_LDXB pc=63 dst=r5 src=r1 offset=18 imm=0 #line 60 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(18)); - // EBPF_OP_LSH64_IMM pc=66 dst=r0 src=r0 offset=0 imm=16 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(18)); + // EBPF_OP_LSH64_IMM pc=64 dst=r5 src=r0 offset=0 imm=16 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=67 dst=r4 src=r1 offset=19 imm=0 + r5 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=65 dst=r3 src=r1 offset=19 imm=0 #line 60 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(19)); - // EBPF_OP_LSH64_IMM pc=68 dst=r4 src=r0 offset=0 imm=24 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(19)); + // EBPF_OP_LSH64_IMM pc=66 dst=r3 src=r0 offset=0 imm=24 #line 60 "sample/sockops.c" - r4 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=69 dst=r4 src=r0 offset=0 imm=0 + r3 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=67 dst=r3 src=r5 offset=0 imm=0 #line 60 "sample/sockops.c" - r4 |= r0; - // EBPF_OP_OR64_REG pc=70 dst=r4 src=r5 offset=0 imm=0 + r3 |= r5; + // EBPF_OP_OR64_REG pc=68 dst=r3 src=r4 offset=0 imm=0 #line 60 "sample/sockops.c" - r4 |= r5; - // EBPF_OP_LDXB pc=71 dst=r0 src=r1 offset=21 imm=0 + r3 |= r4; + // EBPF_OP_LDXB pc=69 dst=r5 src=r1 offset=21 imm=0 #line 60 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(21)); - // EBPF_OP_LSH64_IMM pc=72 dst=r0 src=r0 offset=0 imm=8 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(21)); + // EBPF_OP_LSH64_IMM pc=70 dst=r5 src=r0 offset=0 imm=8 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=73 dst=r5 src=r1 offset=20 imm=0 + r5 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=71 dst=r4 src=r1 offset=20 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(20)); - // EBPF_OP_OR64_REG pc=74 dst=r0 src=r5 offset=0 imm=0 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(20)); + // EBPF_OP_OR64_REG pc=72 dst=r5 src=r4 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r5; - // EBPF_OP_LDXB pc=75 dst=r7 src=r1 offset=22 imm=0 + r5 |= r4; + // EBPF_OP_LDXB pc=73 dst=r0 src=r1 offset=22 imm=0 #line 60 "sample/sockops.c" - r7 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(22)); - // EBPF_OP_LSH64_IMM pc=76 dst=r7 src=r0 offset=0 imm=16 + r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(22)); + // EBPF_OP_LSH64_IMM pc=74 dst=r0 src=r0 offset=0 imm=16 #line 60 "sample/sockops.c" - r7 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=77 dst=r5 src=r1 offset=23 imm=0 + r0 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=75 dst=r4 src=r1 offset=23 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(23)); - // EBPF_OP_LSH64_IMM pc=78 dst=r5 src=r0 offset=0 imm=24 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(23)); + // EBPF_OP_LSH64_IMM pc=76 dst=r4 src=r0 offset=0 imm=24 #line 60 "sample/sockops.c" - r5 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=79 dst=r5 src=r7 offset=0 imm=0 + r4 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=77 dst=r4 src=r0 offset=0 imm=0 #line 60 "sample/sockops.c" - r5 |= r7; - // EBPF_OP_OR64_REG pc=80 dst=r5 src=r0 offset=0 imm=0 + r4 |= r0; + // EBPF_OP_OR64_REG pc=78 dst=r4 src=r5 offset=0 imm=0 #line 60 "sample/sockops.c" - r5 |= r0; - // EBPF_OP_LSH64_IMM pc=81 dst=r5 src=r0 offset=0 imm=32 + r4 |= r5; + // EBPF_OP_LSH64_IMM pc=79 dst=r4 src=r0 offset=0 imm=32 #line 60 "sample/sockops.c" - r5 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_OR64_REG pc=82 dst=r5 src=r4 offset=0 imm=0 + r4 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_OR64_REG pc=80 dst=r4 src=r3 offset=0 imm=0 #line 60 "sample/sockops.c" - r5 |= r4; - // EBPF_OP_LDXB pc=83 dst=r0 src=r1 offset=9 imm=0 + r4 |= r3; + // EBPF_OP_LDXB pc=81 dst=r5 src=r1 offset=9 imm=0 #line 60 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(9)); - // EBPF_OP_LSH64_IMM pc=84 dst=r0 src=r0 offset=0 imm=8 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(9)); + // EBPF_OP_LSH64_IMM pc=82 dst=r5 src=r0 offset=0 imm=8 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=85 dst=r4 src=r1 offset=8 imm=0 + r5 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=83 dst=r3 src=r1 offset=8 imm=0 #line 60 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(8)); - // EBPF_OP_OR64_REG pc=86 dst=r0 src=r4 offset=0 imm=0 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(8)); + // EBPF_OP_OR64_REG pc=84 dst=r5 src=r3 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r4; - // EBPF_OP_LDXB pc=87 dst=r7 src=r1 offset=10 imm=0 + r5 |= r3; + // EBPF_OP_LDXB pc=85 dst=r0 src=r1 offset=10 imm=0 #line 60 "sample/sockops.c" - r7 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(10)); - // EBPF_OP_LSH64_IMM pc=88 dst=r7 src=r0 offset=0 imm=16 + r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(10)); + // EBPF_OP_LSH64_IMM pc=86 dst=r0 src=r0 offset=0 imm=16 #line 60 "sample/sockops.c" - r7 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=89 dst=r4 src=r1 offset=11 imm=0 + r0 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=87 dst=r3 src=r1 offset=11 imm=0 #line 60 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(11)); - // EBPF_OP_LSH64_IMM pc=90 dst=r4 src=r0 offset=0 imm=24 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(11)); + // EBPF_OP_LSH64_IMM pc=88 dst=r3 src=r0 offset=0 imm=24 #line 60 "sample/sockops.c" - r4 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=91 dst=r4 src=r7 offset=0 imm=0 + r3 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=89 dst=r3 src=r0 offset=0 imm=0 #line 60 "sample/sockops.c" - r4 |= r7; - // EBPF_OP_OR64_REG pc=92 dst=r6 src=r3 offset=0 imm=0 + r3 |= r0; + // EBPF_OP_OR64_REG pc=90 dst=r6 src=r2 offset=0 imm=0 #line 70 "sample/sockops.c" - r6 |= r3; - // EBPF_OP_STXDW pc=93 dst=r10 src=r5 offset=-64 imm=0 + r6 |= r2; + // EBPF_OP_STXDW pc=91 dst=r10 src=r4 offset=-64 imm=0 #line 60 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint64_t)r5; - // EBPF_OP_OR64_REG pc=94 dst=r4 src=r0 offset=0 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-64)) = (uint64_t)r4; + // EBPF_OP_OR64_REG pc=92 dst=r3 src=r5 offset=0 imm=0 #line 60 "sample/sockops.c" - r4 |= r0; - // EBPF_OP_LDXB pc=95 dst=r3 src=r1 offset=13 imm=0 + r3 |= r5; + // EBPF_OP_LDXB pc=93 dst=r2 src=r1 offset=13 imm=0 #line 60 "sample/sockops.c" - r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(13)); - // EBPF_OP_LSH64_IMM pc=96 dst=r3 src=r0 offset=0 imm=8 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(13)); + // EBPF_OP_LSH64_IMM pc=94 dst=r2 src=r0 offset=0 imm=8 #line 60 "sample/sockops.c" - r3 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=97 dst=r5 src=r1 offset=12 imm=0 + r2 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=95 dst=r4 src=r1 offset=12 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(12)); - // EBPF_OP_OR64_REG pc=98 dst=r3 src=r5 offset=0 imm=0 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(12)); + // EBPF_OP_OR64_REG pc=96 dst=r2 src=r4 offset=0 imm=0 #line 60 "sample/sockops.c" - r3 |= r5; - // EBPF_OP_LDXB pc=99 dst=r5 src=r1 offset=14 imm=0 + r2 |= r4; + // EBPF_OP_LDXB pc=97 dst=r4 src=r1 offset=14 imm=0 #line 60 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(14)); - // EBPF_OP_LSH64_IMM pc=100 dst=r5 src=r0 offset=0 imm=16 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(14)); + // EBPF_OP_LSH64_IMM pc=98 dst=r4 src=r0 offset=0 imm=16 #line 60 "sample/sockops.c" - r5 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=101 dst=r0 src=r1 offset=15 imm=0 + r4 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=99 dst=r5 src=r1 offset=15 imm=0 #line 60 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(15)); - // EBPF_OP_LSH64_IMM pc=102 dst=r0 src=r0 offset=0 imm=24 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(15)); + // EBPF_OP_LSH64_IMM pc=100 dst=r5 src=r0 offset=0 imm=24 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=103 dst=r0 src=r5 offset=0 imm=0 + r5 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=101 dst=r5 src=r4 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r5; - // EBPF_OP_OR64_REG pc=104 dst=r0 src=r3 offset=0 imm=0 + r5 |= r4; + // EBPF_OP_OR64_REG pc=102 dst=r5 src=r2 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r3; - // EBPF_OP_LSH64_IMM pc=105 dst=r0 src=r0 offset=0 imm=32 + r5 |= r2; + // EBPF_OP_LSH64_IMM pc=103 dst=r5 src=r0 offset=0 imm=32 #line 60 "sample/sockops.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_OR64_REG pc=106 dst=r0 src=r4 offset=0 imm=0 + r5 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_OR64_REG pc=104 dst=r5 src=r3 offset=0 imm=0 #line 60 "sample/sockops.c" - r0 |= r4; - // EBPF_OP_STXDW pc=107 dst=r10 src=r0 offset=-72 imm=0 + r5 |= r3; + // EBPF_OP_STXDW pc=105 dst=r10 src=r5 offset=-72 imm=0 #line 60 "sample/sockops.c" - *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r0; - // EBPF_OP_LDXW pc=108 dst=r3 src=r1 offset=24 imm=0 + *(uint64_t*)(uintptr_t)(r10 + OFFSET(-72)) = (uint64_t)r5; + // EBPF_OP_LDXW pc=106 dst=r2 src=r1 offset=24 imm=0 #line 61 "sample/sockops.c" - r3 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(24)); - // EBPF_OP_STXH pc=109 dst=r10 src=r3 offset=-56 imm=0 + r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(24)); + // EBPF_OP_STXH pc=107 dst=r10 src=r2 offset=-56 imm=0 #line 61 "sample/sockops.c" - *(uint16_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint16_t)r3; - // EBPF_OP_LDXB pc=110 dst=r4 src=r2 offset=13 imm=0 + *(uint16_t*)(uintptr_t)(r10 + OFFSET(-56)) = (uint16_t)r2; + // EBPF_OP_LDXB pc=108 dst=r3 src=r1 offset=41 imm=0 #line 63 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(13)); - // EBPF_OP_LSH64_IMM pc=111 dst=r4 src=r0 offset=0 imm=8 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(41)); + // EBPF_OP_LSH64_IMM pc=109 dst=r3 src=r0 offset=0 imm=8 #line 63 "sample/sockops.c" - r4 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=112 dst=r3 src=r2 offset=12 imm=0 + r3 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=110 dst=r2 src=r1 offset=40 imm=0 #line 63 "sample/sockops.c" - r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(12)); - // EBPF_OP_OR64_REG pc=113 dst=r4 src=r3 offset=0 imm=0 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(40)); + // EBPF_OP_OR64_REG pc=111 dst=r3 src=r2 offset=0 imm=0 #line 63 "sample/sockops.c" - r4 |= r3; - // EBPF_OP_LDXB pc=114 dst=r5 src=r2 offset=14 imm=0 + r3 |= r2; + // EBPF_OP_LDXB pc=112 dst=r4 src=r1 offset=42 imm=0 #line 63 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(14)); - // EBPF_OP_LSH64_IMM pc=115 dst=r5 src=r0 offset=0 imm=16 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(42)); + // EBPF_OP_LSH64_IMM pc=113 dst=r4 src=r0 offset=0 imm=16 #line 63 "sample/sockops.c" - r5 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=116 dst=r3 src=r2 offset=15 imm=0 + r4 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=114 dst=r2 src=r1 offset=43 imm=0 #line 63 "sample/sockops.c" - r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(15)); - // EBPF_OP_LSH64_IMM pc=117 dst=r3 src=r0 offset=0 imm=24 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(43)); + // EBPF_OP_LSH64_IMM pc=115 dst=r2 src=r0 offset=0 imm=24 #line 63 "sample/sockops.c" - r3 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=118 dst=r3 src=r5 offset=0 imm=0 + r2 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=116 dst=r2 src=r4 offset=0 imm=0 #line 63 "sample/sockops.c" - r3 |= r5; - // EBPF_OP_LDXB pc=119 dst=r0 src=r2 offset=1 imm=0 + r2 |= r4; + // EBPF_OP_LDXB pc=117 dst=r5 src=r1 offset=29 imm=0 #line 63 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(1)); - // EBPF_OP_LSH64_IMM pc=120 dst=r0 src=r0 offset=0 imm=8 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(29)); + // EBPF_OP_LSH64_IMM pc=118 dst=r5 src=r0 offset=0 imm=8 #line 63 "sample/sockops.c" - r0 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=121 dst=r5 src=r2 offset=0 imm=0 + r5 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=119 dst=r4 src=r1 offset=28 imm=0 #line 63 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(0)); - // EBPF_OP_OR64_REG pc=122 dst=r0 src=r5 offset=0 imm=0 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(28)); + // EBPF_OP_OR64_REG pc=120 dst=r5 src=r4 offset=0 imm=0 #line 63 "sample/sockops.c" - r0 |= r5; - // EBPF_OP_LDXB pc=123 dst=r7 src=r2 offset=2 imm=0 + r5 |= r4; + // EBPF_OP_LDXB pc=121 dst=r0 src=r1 offset=30 imm=0 #line 63 "sample/sockops.c" - r7 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(2)); - // EBPF_OP_LSH64_IMM pc=124 dst=r7 src=r0 offset=0 imm=16 + r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(30)); + // EBPF_OP_LSH64_IMM pc=122 dst=r0 src=r0 offset=0 imm=16 #line 63 "sample/sockops.c" - r7 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=125 dst=r5 src=r2 offset=3 imm=0 + r0 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=123 dst=r4 src=r1 offset=31 imm=0 #line 63 "sample/sockops.c" - r5 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(3)); - // EBPF_OP_LSH64_IMM pc=126 dst=r5 src=r0 offset=0 imm=24 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(31)); + // EBPF_OP_LSH64_IMM pc=124 dst=r4 src=r0 offset=0 imm=24 #line 63 "sample/sockops.c" - r5 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=127 dst=r5 src=r7 offset=0 imm=0 + r4 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=125 dst=r4 src=r0 offset=0 imm=0 #line 63 "sample/sockops.c" - r5 |= r7; - // EBPF_OP_OR64_REG pc=128 dst=r5 src=r0 offset=0 imm=0 + r4 |= r0; + // EBPF_OP_OR64_REG pc=126 dst=r4 src=r5 offset=0 imm=0 #line 63 "sample/sockops.c" - r5 |= r0; - // EBPF_OP_OR64_REG pc=129 dst=r3 src=r4 offset=0 imm=0 + r4 |= r5; + // EBPF_OP_OR64_REG pc=127 dst=r2 src=r3 offset=0 imm=0 #line 63 "sample/sockops.c" - r3 |= r4; - // EBPF_OP_LDXB pc=130 dst=r4 src=r2 offset=9 imm=0 + r2 |= r3; + // EBPF_OP_LDXB pc=128 dst=r3 src=r1 offset=37 imm=0 #line 63 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(9)); - // EBPF_OP_LSH64_IMM pc=131 dst=r4 src=r0 offset=0 imm=8 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(37)); + // EBPF_OP_LSH64_IMM pc=129 dst=r3 src=r0 offset=0 imm=8 #line 63 "sample/sockops.c" - r4 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=132 dst=r0 src=r2 offset=8 imm=0 + r3 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=130 dst=r5 src=r1 offset=36 imm=0 #line 63 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(8)); - // EBPF_OP_OR64_REG pc=133 dst=r4 src=r0 offset=0 imm=0 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(36)); + // EBPF_OP_OR64_REG pc=131 dst=r3 src=r5 offset=0 imm=0 #line 63 "sample/sockops.c" - r4 |= r0; - // EBPF_OP_LDXB pc=134 dst=r0 src=r2 offset=10 imm=0 + r3 |= r5; + // EBPF_OP_LDXB pc=132 dst=r5 src=r1 offset=38 imm=0 #line 63 "sample/sockops.c" - r0 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(10)); - // EBPF_OP_LSH64_IMM pc=135 dst=r0 src=r0 offset=0 imm=16 + r5 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(38)); + // EBPF_OP_LSH64_IMM pc=133 dst=r5 src=r0 offset=0 imm=16 #line 63 "sample/sockops.c" - r0 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=136 dst=r7 src=r2 offset=11 imm=0 + r5 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=134 dst=r0 src=r1 offset=39 imm=0 #line 63 "sample/sockops.c" - r7 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(11)); - // EBPF_OP_LSH64_IMM pc=137 dst=r7 src=r0 offset=0 imm=24 + r0 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(39)); + // EBPF_OP_LSH64_IMM pc=135 dst=r0 src=r0 offset=0 imm=24 #line 63 "sample/sockops.c" - r7 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=138 dst=r7 src=r0 offset=0 imm=0 + r0 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=136 dst=r0 src=r5 offset=0 imm=0 #line 63 "sample/sockops.c" - r7 |= r0; - // EBPF_OP_OR64_REG pc=139 dst=r7 src=r4 offset=0 imm=0 + r0 |= r5; + // EBPF_OP_OR64_REG pc=137 dst=r0 src=r3 offset=0 imm=0 #line 63 "sample/sockops.c" - r7 |= r4; - // EBPF_OP_STXW pc=140 dst=r10 src=r7 offset=-44 imm=0 + r0 |= r3; + // EBPF_OP_STXW pc=138 dst=r10 src=r0 offset=-44 imm=0 #line 63 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-44)) = (uint32_t)r7; - // EBPF_OP_STXW pc=141 dst=r10 src=r3 offset=-40 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-44)) = (uint32_t)r0; + // EBPF_OP_STXW pc=139 dst=r10 src=r2 offset=-40 imm=0 #line 63 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint32_t)r3; - // EBPF_OP_STXW pc=142 dst=r10 src=r5 offset=-52 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-40)) = (uint32_t)r2; + // EBPF_OP_STXW pc=140 dst=r10 src=r4 offset=-52 imm=0 #line 63 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-52)) = (uint32_t)r5; - // EBPF_OP_LDXB pc=143 dst=r3 src=r2 offset=5 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-52)) = (uint32_t)r4; + // EBPF_OP_LDXB pc=141 dst=r2 src=r1 offset=33 imm=0 #line 63 "sample/sockops.c" - r3 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(5)); - // EBPF_OP_LSH64_IMM pc=144 dst=r3 src=r0 offset=0 imm=8 + r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(33)); + // EBPF_OP_LSH64_IMM pc=142 dst=r2 src=r0 offset=0 imm=8 #line 63 "sample/sockops.c" - r3 <<= (IMMEDIATE(8) & 63); - // EBPF_OP_LDXB pc=145 dst=r4 src=r2 offset=4 imm=0 + r2 <<= (IMMEDIATE(8) & 63); + // EBPF_OP_LDXB pc=143 dst=r3 src=r1 offset=32 imm=0 #line 63 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(4)); - // EBPF_OP_OR64_REG pc=146 dst=r3 src=r4 offset=0 imm=0 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(32)); + // EBPF_OP_OR64_REG pc=144 dst=r2 src=r3 offset=0 imm=0 #line 63 "sample/sockops.c" - r3 |= r4; - // EBPF_OP_LDXB pc=147 dst=r4 src=r2 offset=6 imm=0 + r2 |= r3; + // EBPF_OP_LDXB pc=145 dst=r3 src=r1 offset=34 imm=0 #line 63 "sample/sockops.c" - r4 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(6)); - // EBPF_OP_LSH64_IMM pc=148 dst=r4 src=r0 offset=0 imm=16 + r3 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(34)); + // EBPF_OP_LSH64_IMM pc=146 dst=r3 src=r0 offset=0 imm=16 #line 63 "sample/sockops.c" - r4 <<= (IMMEDIATE(16) & 63); - // EBPF_OP_LDXB pc=149 dst=r2 src=r2 offset=7 imm=0 + r3 <<= (IMMEDIATE(16) & 63); + // EBPF_OP_LDXB pc=147 dst=r4 src=r1 offset=35 imm=0 #line 63 "sample/sockops.c" - r2 = *(uint8_t*)(uintptr_t)(r2 + OFFSET(7)); - // EBPF_OP_LSH64_IMM pc=150 dst=r2 src=r0 offset=0 imm=24 + r4 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(35)); + // EBPF_OP_LSH64_IMM pc=148 dst=r4 src=r0 offset=0 imm=24 #line 63 "sample/sockops.c" - r2 <<= (IMMEDIATE(24) & 63); - // EBPF_OP_OR64_REG pc=151 dst=r2 src=r4 offset=0 imm=0 + r4 <<= (IMMEDIATE(24) & 63); + // EBPF_OP_OR64_REG pc=149 dst=r4 src=r3 offset=0 imm=0 #line 63 "sample/sockops.c" - r2 |= r4; - // EBPF_OP_OR64_REG pc=152 dst=r2 src=r3 offset=0 imm=0 + r4 |= r3; + // EBPF_OP_OR64_REG pc=150 dst=r4 src=r2 offset=0 imm=0 #line 63 "sample/sockops.c" - r2 |= r3; - // EBPF_OP_STXW pc=153 dst=r10 src=r2 offset=-48 imm=0 + r4 |= r2; + // EBPF_OP_STXW pc=151 dst=r10 src=r4 offset=-48 imm=0 #line 63 "sample/sockops.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint32_t)r2; - // EBPF_OP_LDXW pc=154 dst=r2 src=r1 offset=44 imm=0 + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-48)) = (uint32_t)r4; + // EBPF_OP_LDXW pc=152 dst=r2 src=r1 offset=44 imm=0 #line 64 "sample/sockops.c" r2 = *(uint32_t*)(uintptr_t)(r1 + OFFSET(44)); - // EBPF_OP_STXH pc=155 dst=r10 src=r2 offset=-36 imm=0 + // EBPF_OP_STXH pc=153 dst=r10 src=r2 offset=-36 imm=0 #line 64 "sample/sockops.c" *(uint16_t*)(uintptr_t)(r10 + OFFSET(-36)) = (uint16_t)r2; - // EBPF_OP_LDXB pc=156 dst=r2 src=r1 offset=48 imm=0 + // EBPF_OP_LDXB pc=154 dst=r2 src=r1 offset=48 imm=0 #line 65 "sample/sockops.c" r2 = *(uint8_t*)(uintptr_t)(r1 + OFFSET(48)); - // EBPF_OP_STXW pc=157 dst=r10 src=r2 offset=-32 imm=0 + // EBPF_OP_STXW pc=155 dst=r10 src=r2 offset=-32 imm=0 #line 65 "sample/sockops.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-32)) = (uint32_t)r2; - // EBPF_OP_LDXDW pc=158 dst=r1 src=r1 offset=56 imm=0 + // EBPF_OP_LDXDW pc=156 dst=r1 src=r1 offset=56 imm=0 #line 66 "sample/sockops.c" r1 = *(uint64_t*)(uintptr_t)(r1 + OFFSET(56)); - // EBPF_OP_STXDW pc=159 dst=r10 src=r1 offset=-24 imm=0 + // EBPF_OP_STXDW pc=157 dst=r10 src=r1 offset=-24 imm=0 #line 66 "sample/sockops.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r1; - // EBPF_OP_CALL pc=160 dst=r0 src=r0 offset=0 imm=19 + // EBPF_OP_CALL pc=158 dst=r0 src=r0 offset=0 imm=19 #line 67 "sample/sockops.c" r0 = connection_monitor_helpers[0].address(r1, r2, r3, r4, r5, context); #line 67 "sample/sockops.c" @@ -773,25 +765,25 @@ connection_monitor(void* context) return 0; #line 67 "sample/sockops.c" } - // EBPF_OP_STXB pc=161 dst=r10 src=r6 offset=-8 imm=0 + // EBPF_OP_STXB pc=159 dst=r10 src=r6 offset=-8 imm=0 #line 71 "sample/sockops.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint8_t)r6; - // EBPF_OP_RSH64_IMM pc=162 dst=r0 src=r0 offset=0 imm=32 + // EBPF_OP_RSH64_IMM pc=160 dst=r0 src=r0 offset=0 imm=32 #line 69 "sample/sockops.c" r0 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_STXDW pc=163 dst=r10 src=r0 offset=-16 imm=0 + // EBPF_OP_STXDW pc=161 dst=r10 src=r0 offset=-16 imm=0 #line 69 "sample/sockops.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r0; - // EBPF_OP_MOV64_REG pc=164 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=162 dst=r2 src=r10 offset=0 imm=0 #line 69 "sample/sockops.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=165 dst=r2 src=r0 offset=0 imm=-72 -#line 100 "sample/sockops.c" + // EBPF_OP_ADD64_IMM pc=163 dst=r2 src=r0 offset=0 imm=-72 +#line 69 "sample/sockops.c" r2 += IMMEDIATE(-72); - // EBPF_OP_LDDW pc=166 dst=r1 src=r1 offset=0 imm=1 + // EBPF_OP_LDDW pc=164 dst=r1 src=r1 offset=0 imm=1 #line 26 "sample/sockops.c" r1 = POINTER(_maps[0].address); - // EBPF_OP_CALL pc=168 dst=r0 src=r0 offset=0 imm=1 + // EBPF_OP_CALL pc=166 dst=r0 src=r0 offset=0 imm=1 #line 26 "sample/sockops.c" r0 = connection_monitor_helpers[1].address(r1, r2, r3, r4, r5, context); #line 26 "sample/sockops.c" @@ -800,13 +792,13 @@ connection_monitor(void* context) return 0; #line 26 "sample/sockops.c" } - // EBPF_OP_MOV64_REG pc=169 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=167 dst=r1 src=r0 offset=0 imm=0 #line 26 "sample/sockops.c" r1 = r0; - // EBPF_OP_LDDW pc=170 dst=r0 src=r0 offset=0 imm=-1 + // EBPF_OP_LDDW pc=168 dst=r0 src=r0 offset=0 imm=-1 #line 26 "sample/sockops.c" r0 = (uint64_t)4294967295; - // EBPF_OP_JEQ_IMM pc=172 dst=r1 src=r0 offset=7 imm=0 + // EBPF_OP_JEQ_IMM pc=170 dst=r1 src=r0 offset=7 imm=0 #line 26 "sample/sockops.c" if (r1 == IMMEDIATE(0)) { #line 26 "sample/sockops.c" @@ -814,22 +806,22 @@ connection_monitor(void* context) #line 26 "sample/sockops.c" } label_4: - // EBPF_OP_MOV64_REG pc=173 dst=r2 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=171 dst=r2 src=r10 offset=0 imm=0 #line 26 "sample/sockops.c" r2 = r10; - // EBPF_OP_ADD64_IMM pc=174 dst=r2 src=r0 offset=0 imm=-72 + // EBPF_OP_ADD64_IMM pc=172 dst=r2 src=r0 offset=0 imm=-72 #line 100 "sample/sockops.c" r2 += IMMEDIATE(-72); - // EBPF_OP_LDDW pc=175 dst=r1 src=r1 offset=0 imm=2 + // EBPF_OP_LDDW pc=173 dst=r1 src=r1 offset=0 imm=2 #line 100 "sample/sockops.c" r1 = POINTER(_maps[1].address); - // EBPF_OP_MOV64_IMM pc=177 dst=r3 src=r0 offset=0 imm=72 + // EBPF_OP_MOV64_IMM pc=175 dst=r3 src=r0 offset=0 imm=72 #line 100 "sample/sockops.c" r3 = IMMEDIATE(72); - // EBPF_OP_MOV64_IMM pc=178 dst=r4 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=176 dst=r4 src=r0 offset=0 imm=0 #line 100 "sample/sockops.c" r4 = IMMEDIATE(0); - // EBPF_OP_CALL pc=179 dst=r0 src=r0 offset=0 imm=11 + // EBPF_OP_CALL pc=177 dst=r0 src=r0 offset=0 imm=11 #line 100 "sample/sockops.c" r0 = connection_monitor_helpers[2].address(r1, r2, r3, r4, r5, context); #line 100 "sample/sockops.c" @@ -839,7 +831,7 @@ connection_monitor(void* context) #line 100 "sample/sockops.c" } label_5: - // EBPF_OP_EXIT pc=180 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_EXIT pc=178 dst=r0 src=r0 offset=0 imm=0 #line 103 "sample/sockops.c" return r0; #line 78 "sample/sockops.c" @@ -859,7 +851,7 @@ static program_entry_t _programs[] = { 2, connection_monitor_helpers, 3, - 181, + 179, &connection_monitor_program_type_guid, &connection_monitor_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/tail_call_recursive_dll.c b/tests/bpf2c_tests/expected/tail_call_recursive_dll.c index f21e34b8ad..00478f6d77 100644 --- a/tests/bpf2c_tests/expected/tail_call_recursive_dll.c +++ b/tests/bpf2c_tests/expected/tail_call_recursive_dll.c @@ -113,8 +113,6 @@ recurse(void* context) register uint64_t r6 = 0; #line 45 "sample/undocked/tail_call_recursive.c" register uint64_t r7 = 0; -#line 45 "sample/undocked/tail_call_recursive.c" - register uint64_t r8 = 0; #line 45 "sample/undocked/tail_call_recursive.c" register uint64_t r10 = 0; @@ -126,12 +124,12 @@ recurse(void* context) // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 #line 45 "sample/undocked/tail_call_recursive.c" r6 = r1; - // EBPF_OP_MOV64_IMM pc=1 dst=r8 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=1 dst=r7 src=r0 offset=0 imm=0 #line 45 "sample/undocked/tail_call_recursive.c" - r8 = IMMEDIATE(0); - // EBPF_OP_STXW pc=2 dst=r10 src=r8 offset=-4 imm=0 + r7 = IMMEDIATE(0); + // EBPF_OP_STXW pc=2 dst=r10 src=r7 offset=-4 imm=0 #line 47 "sample/undocked/tail_call_recursive.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r8; + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r7; // EBPF_OP_MOV64_REG pc=3 dst=r2 src=r10 offset=0 imm=0 #line 47 "sample/undocked/tail_call_recursive.c" r2 = r10; @@ -150,46 +148,46 @@ recurse(void* context) return 0; #line 51 "sample/undocked/tail_call_recursive.c" } - // EBPF_OP_MOV64_REG pc=8 dst=r7 src=r0 offset=0 imm=0 -#line 51 "sample/undocked/tail_call_recursive.c" - r7 = r0; - // EBPF_OP_JEQ_IMM pc=9 dst=r7 src=r0 offset=22 imm=0 + // EBPF_OP_JEQ_IMM pc=8 dst=r0 src=r0 offset=23 imm=0 #line 52 "sample/undocked/tail_call_recursive.c" - if (r7 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 52 "sample/undocked/tail_call_recursive.c" goto label_1; #line 52 "sample/undocked/tail_call_recursive.c" } - // EBPF_OP_MOV64_IMM pc=10 dst=r1 src=r0 offset=0 imm=680997 + // EBPF_OP_MOV64_IMM pc=9 dst=r1 src=r0 offset=0 imm=680997 #line 52 "sample/undocked/tail_call_recursive.c" r1 = IMMEDIATE(680997); - // EBPF_OP_STXW pc=11 dst=r10 src=r1 offset=-8 imm=0 + // EBPF_OP_STXW pc=10 dst=r10 src=r1 offset=-8 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint32_t)r1; - // EBPF_OP_LDDW pc=12 dst=r1 src=r0 offset=0 imm=1635133984 + // EBPF_OP_LDDW pc=11 dst=r1 src=r0 offset=0 imm=1635133984 #line 56 "sample/undocked/tail_call_recursive.c" r1 = (uint64_t)4424071317313432096; - // EBPF_OP_STXDW pc=14 dst=r10 src=r1 offset=-16 imm=0 + // EBPF_OP_STXDW pc=13 dst=r10 src=r1 offset=-16 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=15 dst=r1 src=r0 offset=0 imm=1969448306 + // EBPF_OP_LDDW pc=14 dst=r1 src=r0 offset=0 imm=1969448306 #line 56 "sample/undocked/tail_call_recursive.c" r1 = (uint64_t)4207896362280510834; - // EBPF_OP_STXDW pc=17 dst=r10 src=r1 offset=-24 imm=0 + // EBPF_OP_STXDW pc=16 dst=r10 src=r1 offset=-24 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r1; - // EBPF_OP_LDXW pc=18 dst=r3 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=17 dst=r3 src=r0 offset=0 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" - r3 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_MOV64_REG pc=19 dst=r1 src=r10 offset=0 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_MOV64_REG pc=18 dst=r1 src=r10 offset=0 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=20 dst=r1 src=r0 offset=0 imm=-24 + // EBPF_OP_ADD64_IMM pc=19 dst=r1 src=r0 offset=0 imm=-24 #line 56 "sample/undocked/tail_call_recursive.c" r1 += IMMEDIATE(-24); - // EBPF_OP_MOV64_IMM pc=21 dst=r2 src=r0 offset=0 imm=20 + // EBPF_OP_MOV64_IMM pc=20 dst=r2 src=r0 offset=0 imm=20 #line 56 "sample/undocked/tail_call_recursive.c" r2 = IMMEDIATE(20); + // EBPF_OP_MOV64_REG pc=21 dst=r7 src=r0 offset=0 imm=0 +#line 56 "sample/undocked/tail_call_recursive.c" + r7 = r0; // EBPF_OP_CALL pc=22 dst=r0 src=r0 offset=0 imm=13 #line 56 "sample/undocked/tail_call_recursive.c" r0 = recurse_helpers[1].address(r1, r2, r3, r4, r5, context); @@ -226,13 +224,13 @@ recurse(void* context) return 0; #line 62 "sample/undocked/tail_call_recursive.c" } - // EBPF_OP_MOV64_REG pc=31 dst=r8 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=31 dst=r7 src=r0 offset=0 imm=0 #line 62 "sample/undocked/tail_call_recursive.c" - r8 = r0; + r7 = r0; label_1: - // EBPF_OP_MOV64_REG pc=32 dst=r0 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=32 dst=r0 src=r7 offset=0 imm=0 #line 63 "sample/undocked/tail_call_recursive.c" - r0 = r8; + r0 = r7; // EBPF_OP_EXIT pc=33 dst=r0 src=r0 offset=0 imm=0 #line 63 "sample/undocked/tail_call_recursive.c" return r0; diff --git a/tests/bpf2c_tests/expected/tail_call_recursive_raw.c b/tests/bpf2c_tests/expected/tail_call_recursive_raw.c index 18769f583a..bace85430f 100644 --- a/tests/bpf2c_tests/expected/tail_call_recursive_raw.c +++ b/tests/bpf2c_tests/expected/tail_call_recursive_raw.c @@ -87,8 +87,6 @@ recurse(void* context) register uint64_t r6 = 0; #line 45 "sample/undocked/tail_call_recursive.c" register uint64_t r7 = 0; -#line 45 "sample/undocked/tail_call_recursive.c" - register uint64_t r8 = 0; #line 45 "sample/undocked/tail_call_recursive.c" register uint64_t r10 = 0; @@ -100,12 +98,12 @@ recurse(void* context) // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 #line 45 "sample/undocked/tail_call_recursive.c" r6 = r1; - // EBPF_OP_MOV64_IMM pc=1 dst=r8 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=1 dst=r7 src=r0 offset=0 imm=0 #line 45 "sample/undocked/tail_call_recursive.c" - r8 = IMMEDIATE(0); - // EBPF_OP_STXW pc=2 dst=r10 src=r8 offset=-4 imm=0 + r7 = IMMEDIATE(0); + // EBPF_OP_STXW pc=2 dst=r10 src=r7 offset=-4 imm=0 #line 47 "sample/undocked/tail_call_recursive.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r8; + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r7; // EBPF_OP_MOV64_REG pc=3 dst=r2 src=r10 offset=0 imm=0 #line 47 "sample/undocked/tail_call_recursive.c" r2 = r10; @@ -124,46 +122,46 @@ recurse(void* context) return 0; #line 51 "sample/undocked/tail_call_recursive.c" } - // EBPF_OP_MOV64_REG pc=8 dst=r7 src=r0 offset=0 imm=0 -#line 51 "sample/undocked/tail_call_recursive.c" - r7 = r0; - // EBPF_OP_JEQ_IMM pc=9 dst=r7 src=r0 offset=22 imm=0 + // EBPF_OP_JEQ_IMM pc=8 dst=r0 src=r0 offset=23 imm=0 #line 52 "sample/undocked/tail_call_recursive.c" - if (r7 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 52 "sample/undocked/tail_call_recursive.c" goto label_1; #line 52 "sample/undocked/tail_call_recursive.c" } - // EBPF_OP_MOV64_IMM pc=10 dst=r1 src=r0 offset=0 imm=680997 + // EBPF_OP_MOV64_IMM pc=9 dst=r1 src=r0 offset=0 imm=680997 #line 52 "sample/undocked/tail_call_recursive.c" r1 = IMMEDIATE(680997); - // EBPF_OP_STXW pc=11 dst=r10 src=r1 offset=-8 imm=0 + // EBPF_OP_STXW pc=10 dst=r10 src=r1 offset=-8 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint32_t)r1; - // EBPF_OP_LDDW pc=12 dst=r1 src=r0 offset=0 imm=1635133984 + // EBPF_OP_LDDW pc=11 dst=r1 src=r0 offset=0 imm=1635133984 #line 56 "sample/undocked/tail_call_recursive.c" r1 = (uint64_t)4424071317313432096; - // EBPF_OP_STXDW pc=14 dst=r10 src=r1 offset=-16 imm=0 + // EBPF_OP_STXDW pc=13 dst=r10 src=r1 offset=-16 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=15 dst=r1 src=r0 offset=0 imm=1969448306 + // EBPF_OP_LDDW pc=14 dst=r1 src=r0 offset=0 imm=1969448306 #line 56 "sample/undocked/tail_call_recursive.c" r1 = (uint64_t)4207896362280510834; - // EBPF_OP_STXDW pc=17 dst=r10 src=r1 offset=-24 imm=0 + // EBPF_OP_STXDW pc=16 dst=r10 src=r1 offset=-24 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r1; - // EBPF_OP_LDXW pc=18 dst=r3 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=17 dst=r3 src=r0 offset=0 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" - r3 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_MOV64_REG pc=19 dst=r1 src=r10 offset=0 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_MOV64_REG pc=18 dst=r1 src=r10 offset=0 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=20 dst=r1 src=r0 offset=0 imm=-24 + // EBPF_OP_ADD64_IMM pc=19 dst=r1 src=r0 offset=0 imm=-24 #line 56 "sample/undocked/tail_call_recursive.c" r1 += IMMEDIATE(-24); - // EBPF_OP_MOV64_IMM pc=21 dst=r2 src=r0 offset=0 imm=20 + // EBPF_OP_MOV64_IMM pc=20 dst=r2 src=r0 offset=0 imm=20 #line 56 "sample/undocked/tail_call_recursive.c" r2 = IMMEDIATE(20); + // EBPF_OP_MOV64_REG pc=21 dst=r7 src=r0 offset=0 imm=0 +#line 56 "sample/undocked/tail_call_recursive.c" + r7 = r0; // EBPF_OP_CALL pc=22 dst=r0 src=r0 offset=0 imm=13 #line 56 "sample/undocked/tail_call_recursive.c" r0 = recurse_helpers[1].address(r1, r2, r3, r4, r5, context); @@ -200,13 +198,13 @@ recurse(void* context) return 0; #line 62 "sample/undocked/tail_call_recursive.c" } - // EBPF_OP_MOV64_REG pc=31 dst=r8 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=31 dst=r7 src=r0 offset=0 imm=0 #line 62 "sample/undocked/tail_call_recursive.c" - r8 = r0; + r7 = r0; label_1: - // EBPF_OP_MOV64_REG pc=32 dst=r0 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=32 dst=r0 src=r7 offset=0 imm=0 #line 63 "sample/undocked/tail_call_recursive.c" - r0 = r8; + r0 = r7; // EBPF_OP_EXIT pc=33 dst=r0 src=r0 offset=0 imm=0 #line 63 "sample/undocked/tail_call_recursive.c" return r0; diff --git a/tests/bpf2c_tests/expected/tail_call_recursive_sys.c b/tests/bpf2c_tests/expected/tail_call_recursive_sys.c index 3439a2e3b1..d60c5a81f6 100644 --- a/tests/bpf2c_tests/expected/tail_call_recursive_sys.c +++ b/tests/bpf2c_tests/expected/tail_call_recursive_sys.c @@ -248,8 +248,6 @@ recurse(void* context) register uint64_t r6 = 0; #line 45 "sample/undocked/tail_call_recursive.c" register uint64_t r7 = 0; -#line 45 "sample/undocked/tail_call_recursive.c" - register uint64_t r8 = 0; #line 45 "sample/undocked/tail_call_recursive.c" register uint64_t r10 = 0; @@ -261,12 +259,12 @@ recurse(void* context) // EBPF_OP_MOV64_REG pc=0 dst=r6 src=r1 offset=0 imm=0 #line 45 "sample/undocked/tail_call_recursive.c" r6 = r1; - // EBPF_OP_MOV64_IMM pc=1 dst=r8 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=1 dst=r7 src=r0 offset=0 imm=0 #line 45 "sample/undocked/tail_call_recursive.c" - r8 = IMMEDIATE(0); - // EBPF_OP_STXW pc=2 dst=r10 src=r8 offset=-4 imm=0 + r7 = IMMEDIATE(0); + // EBPF_OP_STXW pc=2 dst=r10 src=r7 offset=-4 imm=0 #line 47 "sample/undocked/tail_call_recursive.c" - *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r8; + *(uint32_t*)(uintptr_t)(r10 + OFFSET(-4)) = (uint32_t)r7; // EBPF_OP_MOV64_REG pc=3 dst=r2 src=r10 offset=0 imm=0 #line 47 "sample/undocked/tail_call_recursive.c" r2 = r10; @@ -285,46 +283,46 @@ recurse(void* context) return 0; #line 51 "sample/undocked/tail_call_recursive.c" } - // EBPF_OP_MOV64_REG pc=8 dst=r7 src=r0 offset=0 imm=0 -#line 51 "sample/undocked/tail_call_recursive.c" - r7 = r0; - // EBPF_OP_JEQ_IMM pc=9 dst=r7 src=r0 offset=22 imm=0 + // EBPF_OP_JEQ_IMM pc=8 dst=r0 src=r0 offset=23 imm=0 #line 52 "sample/undocked/tail_call_recursive.c" - if (r7 == IMMEDIATE(0)) { + if (r0 == IMMEDIATE(0)) { #line 52 "sample/undocked/tail_call_recursive.c" goto label_1; #line 52 "sample/undocked/tail_call_recursive.c" } - // EBPF_OP_MOV64_IMM pc=10 dst=r1 src=r0 offset=0 imm=680997 + // EBPF_OP_MOV64_IMM pc=9 dst=r1 src=r0 offset=0 imm=680997 #line 52 "sample/undocked/tail_call_recursive.c" r1 = IMMEDIATE(680997); - // EBPF_OP_STXW pc=11 dst=r10 src=r1 offset=-8 imm=0 + // EBPF_OP_STXW pc=10 dst=r10 src=r1 offset=-8 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint32_t)r1; - // EBPF_OP_LDDW pc=12 dst=r1 src=r0 offset=0 imm=1635133984 + // EBPF_OP_LDDW pc=11 dst=r1 src=r0 offset=0 imm=1635133984 #line 56 "sample/undocked/tail_call_recursive.c" r1 = (uint64_t)4424071317313432096; - // EBPF_OP_STXDW pc=14 dst=r10 src=r1 offset=-16 imm=0 + // EBPF_OP_STXDW pc=13 dst=r10 src=r1 offset=-16 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-16)) = (uint64_t)r1; - // EBPF_OP_LDDW pc=15 dst=r1 src=r0 offset=0 imm=1969448306 + // EBPF_OP_LDDW pc=14 dst=r1 src=r0 offset=0 imm=1969448306 #line 56 "sample/undocked/tail_call_recursive.c" r1 = (uint64_t)4207896362280510834; - // EBPF_OP_STXDW pc=17 dst=r10 src=r1 offset=-24 imm=0 + // EBPF_OP_STXDW pc=16 dst=r10 src=r1 offset=-24 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" *(uint64_t*)(uintptr_t)(r10 + OFFSET(-24)) = (uint64_t)r1; - // EBPF_OP_LDXW pc=18 dst=r3 src=r7 offset=0 imm=0 + // EBPF_OP_LDXW pc=17 dst=r3 src=r0 offset=0 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" - r3 = *(uint32_t*)(uintptr_t)(r7 + OFFSET(0)); - // EBPF_OP_MOV64_REG pc=19 dst=r1 src=r10 offset=0 imm=0 + r3 = *(uint32_t*)(uintptr_t)(r0 + OFFSET(0)); + // EBPF_OP_MOV64_REG pc=18 dst=r1 src=r10 offset=0 imm=0 #line 56 "sample/undocked/tail_call_recursive.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=20 dst=r1 src=r0 offset=0 imm=-24 + // EBPF_OP_ADD64_IMM pc=19 dst=r1 src=r0 offset=0 imm=-24 #line 56 "sample/undocked/tail_call_recursive.c" r1 += IMMEDIATE(-24); - // EBPF_OP_MOV64_IMM pc=21 dst=r2 src=r0 offset=0 imm=20 + // EBPF_OP_MOV64_IMM pc=20 dst=r2 src=r0 offset=0 imm=20 #line 56 "sample/undocked/tail_call_recursive.c" r2 = IMMEDIATE(20); + // EBPF_OP_MOV64_REG pc=21 dst=r7 src=r0 offset=0 imm=0 +#line 56 "sample/undocked/tail_call_recursive.c" + r7 = r0; // EBPF_OP_CALL pc=22 dst=r0 src=r0 offset=0 imm=13 #line 56 "sample/undocked/tail_call_recursive.c" r0 = recurse_helpers[1].address(r1, r2, r3, r4, r5, context); @@ -361,13 +359,13 @@ recurse(void* context) return 0; #line 62 "sample/undocked/tail_call_recursive.c" } - // EBPF_OP_MOV64_REG pc=31 dst=r8 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=31 dst=r7 src=r0 offset=0 imm=0 #line 62 "sample/undocked/tail_call_recursive.c" - r8 = r0; + r7 = r0; label_1: - // EBPF_OP_MOV64_REG pc=32 dst=r0 src=r8 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=32 dst=r0 src=r7 offset=0 imm=0 #line 63 "sample/undocked/tail_call_recursive.c" - r0 = r8; + r0 = r7; // EBPF_OP_EXIT pc=33 dst=r0 src=r0 offset=0 imm=0 #line 63 "sample/undocked/tail_call_recursive.c" return r0; diff --git a/tests/bpf2c_tests/expected/utility_dll.c b/tests/bpf2c_tests/expected/utility_dll.c index 04c3f5d665..8ba894cce2 100644 --- a/tests/bpf2c_tests/expected/utility_dll.c +++ b/tests/bpf2c_tests/expected/utility_dll.c @@ -78,8 +78,6 @@ UtilityTest(void* context) register uint64_t r4 = 0; #line 24 "sample/utility.c" register uint64_t r5 = 0; -#line 24 "sample/utility.c" - register uint64_t r6 = 0; #line 24 "sample/utility.c" register uint64_t r10 = 0; @@ -148,47 +146,50 @@ UtilityTest(void* context) return 0; #line 31 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=19 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_REG pc=19 dst=r1 src=r0 offset=0 imm=0 +#line 31 "sample/utility.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=20 dst=r0 src=r0 offset=0 imm=1 #line 31 "sample/utility.c" - r6 = IMMEDIATE(1); - // EBPF_OP_LSH64_IMM pc=20 dst=r0 src=r0 offset=0 imm=32 + r0 = IMMEDIATE(1); + // EBPF_OP_LSH64_IMM pc=21 dst=r1 src=r0 offset=0 imm=32 #line 31 "sample/utility.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_RSH64_IMM pc=21 dst=r0 src=r0 offset=0 imm=32 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_RSH64_IMM pc=22 dst=r1 src=r0 offset=0 imm=32 #line 31 "sample/utility.c" - r0 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JNE_IMM pc=22 dst=r0 src=r0 offset=81 imm=0 + r1 >>= (IMMEDIATE(32) & 63); + // EBPF_OP_JNE_IMM pc=23 dst=r1 src=r0 offset=86 imm=0 #line 31 "sample/utility.c" - if (r0 != IMMEDIATE(0)) { + if (r1 != IMMEDIATE(0)) { #line 31 "sample/utility.c" goto label_1; #line 31 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=23 dst=r1 src=r0 offset=0 imm=84 + // EBPF_OP_MOV64_IMM pc=24 dst=r1 src=r0 offset=0 imm=84 #line 31 "sample/utility.c" r1 = IMMEDIATE(84); - // EBPF_OP_STXB pc=24 dst=r10 src=r1 offset=-8 imm=0 + // EBPF_OP_STXB pc=25 dst=r10 src=r1 offset=-8 imm=0 #line 35 "sample/utility.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint8_t)r1; - // EBPF_OP_MOV64_REG pc=25 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=26 dst=r1 src=r10 offset=0 imm=0 #line 35 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=26 dst=r1 src=r0 offset=0 imm=-8 + // EBPF_OP_ADD64_IMM pc=27 dst=r1 src=r0 offset=0 imm=-8 #line 35 "sample/utility.c" r1 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=27 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=28 dst=r3 src=r10 offset=0 imm=0 #line 35 "sample/utility.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=28 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=29 dst=r3 src=r0 offset=0 imm=-16 #line 35 "sample/utility.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=29 dst=r2 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=30 dst=r2 src=r0 offset=0 imm=4 #line 37 "sample/utility.c" r2 = IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=30 dst=r4 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=31 dst=r4 src=r0 offset=0 imm=4 #line 37 "sample/utility.c" r4 = IMMEDIATE(4); - // EBPF_OP_CALL pc=31 dst=r0 src=r0 offset=0 imm=23 + // EBPF_OP_CALL pc=32 dst=r0 src=r0 offset=0 imm=23 #line 37 "sample/utility.c" r0 = UtilityTest_helpers[0].address(r1, r2, r3, r4, r5, context); #line 37 "sample/utility.c" @@ -197,44 +198,44 @@ UtilityTest(void* context) return 0; #line 37 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=32 dst=r6 src=r0 offset=0 imm=2 + // EBPF_OP_MOV64_REG pc=33 dst=r1 src=r0 offset=0 imm=0 +#line 37 "sample/utility.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=34 dst=r0 src=r0 offset=0 imm=2 #line 37 "sample/utility.c" - r6 = IMMEDIATE(2); - // EBPF_OP_LSH64_IMM pc=33 dst=r0 src=r0 offset=0 imm=32 + r0 = IMMEDIATE(2); + // EBPF_OP_LSH64_IMM pc=35 dst=r1 src=r0 offset=0 imm=32 #line 37 "sample/utility.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_ARSH64_IMM pc=34 dst=r0 src=r0 offset=0 imm=32 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_ARSH64_IMM pc=36 dst=r1 src=r0 offset=0 imm=32 #line 37 "sample/utility.c" - r0 = (int64_t)r0 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_JSGT_IMM pc=35 dst=r0 src=r0 offset=68 imm=-1 + r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); + // EBPF_OP_JSGT_IMM pc=37 dst=r1 src=r0 offset=72 imm=-1 #line 37 "sample/utility.c" - if ((int64_t)r0 > IMMEDIATE(-1)) { + if ((int64_t)r1 > IMMEDIATE(-1)) { #line 37 "sample/utility.c" goto label_1; #line 37 "sample/utility.c" } - // EBPF_OP_MOV64_REG pc=36 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=38 dst=r1 src=r10 offset=0 imm=0 #line 37 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=37 dst=r1 src=r0 offset=0 imm=-8 + // EBPF_OP_ADD64_IMM pc=39 dst=r1 src=r0 offset=0 imm=-8 #line 43 "sample/utility.c" r1 += IMMEDIATE(-8); - // EBPF_OP_MOV64_IMM pc=38 dst=r6 src=r0 offset=0 imm=3 -#line 43 "sample/utility.c" - r6 = IMMEDIATE(3); - // EBPF_OP_MOV64_REG pc=39 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=40 dst=r3 src=r10 offset=0 imm=0 #line 43 "sample/utility.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=40 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=41 dst=r3 src=r0 offset=0 imm=-16 #line 43 "sample/utility.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=41 dst=r2 src=r0 offset=0 imm=3 + // EBPF_OP_MOV64_IMM pc=42 dst=r2 src=r0 offset=0 imm=3 #line 43 "sample/utility.c" r2 = IMMEDIATE(3); - // EBPF_OP_MOV64_IMM pc=42 dst=r4 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=43 dst=r4 src=r0 offset=0 imm=4 #line 43 "sample/utility.c" r4 = IMMEDIATE(4); - // EBPF_OP_CALL pc=43 dst=r0 src=r0 offset=0 imm=23 + // EBPF_OP_CALL pc=44 dst=r0 src=r0 offset=0 imm=23 #line 43 "sample/utility.c" r0 = UtilityTest_helpers[0].address(r1, r2, r3, r4, r5, context); #line 43 "sample/utility.c" @@ -243,44 +244,50 @@ UtilityTest(void* context) return 0; #line 43 "sample/utility.c" } - // EBPF_OP_LSH64_IMM pc=44 dst=r0 src=r0 offset=0 imm=32 + // EBPF_OP_MOV64_REG pc=45 dst=r1 src=r0 offset=0 imm=0 +#line 43 "sample/utility.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=46 dst=r0 src=r0 offset=0 imm=3 +#line 43 "sample/utility.c" + r0 = IMMEDIATE(3); + // EBPF_OP_LSH64_IMM pc=47 dst=r1 src=r0 offset=0 imm=32 #line 43 "sample/utility.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_ARSH64_IMM pc=45 dst=r0 src=r0 offset=0 imm=32 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_ARSH64_IMM pc=48 dst=r1 src=r0 offset=0 imm=32 #line 43 "sample/utility.c" - r0 = (int64_t)r0 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_JSGT_IMM pc=46 dst=r0 src=r0 offset=57 imm=-1 + r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); + // EBPF_OP_JSGT_IMM pc=49 dst=r1 src=r0 offset=60 imm=-1 #line 43 "sample/utility.c" - if ((int64_t)r0 > IMMEDIATE(-1)) { + if ((int64_t)r1 > IMMEDIATE(-1)) { #line 43 "sample/utility.c" goto label_1; #line 43 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=47 dst=r1 src=r0 offset=0 imm=1414743380 + // EBPF_OP_MOV64_IMM pc=50 dst=r1 src=r0 offset=0 imm=1414743380 #line 43 "sample/utility.c" r1 = IMMEDIATE(1414743380); - // EBPF_OP_STXW pc=48 dst=r10 src=r1 offset=-8 imm=0 + // EBPF_OP_STXW pc=51 dst=r10 src=r1 offset=-8 imm=0 #line 48 "sample/utility.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint32_t)r1; - // EBPF_OP_MOV64_REG pc=49 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=52 dst=r1 src=r10 offset=0 imm=0 #line 48 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=50 dst=r1 src=r0 offset=0 imm=-8 + // EBPF_OP_ADD64_IMM pc=53 dst=r1 src=r0 offset=0 imm=-8 #line 48 "sample/utility.c" r1 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=51 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=54 dst=r3 src=r10 offset=0 imm=0 #line 48 "sample/utility.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=52 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=55 dst=r3 src=r0 offset=0 imm=-16 #line 48 "sample/utility.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=53 dst=r2 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=56 dst=r2 src=r0 offset=0 imm=4 #line 54 "sample/utility.c" r2 = IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=54 dst=r4 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=57 dst=r4 src=r0 offset=0 imm=4 #line 54 "sample/utility.c" r4 = IMMEDIATE(4); - // EBPF_OP_CALL pc=55 dst=r0 src=r0 offset=0 imm=22 + // EBPF_OP_CALL pc=58 dst=r0 src=r0 offset=0 imm=22 #line 54 "sample/utility.c" r0 = UtilityTest_helpers[1].address(r1, r2, r3, r4, r5, context); #line 54 "sample/utility.c" @@ -289,75 +296,78 @@ UtilityTest(void* context) return 0; #line 54 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=56 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=59 dst=r1 src=r0 offset=0 imm=0 #line 54 "sample/utility.c" - r1 = IMMEDIATE(0); - // EBPF_OP_MOV64_IMM pc=57 dst=r6 src=r0 offset=0 imm=4 + r1 = r0; + // EBPF_OP_MOV64_IMM pc=60 dst=r2 src=r0 offset=0 imm=0 +#line 54 "sample/utility.c" + r2 = IMMEDIATE(0); + // EBPF_OP_MOV64_IMM pc=61 dst=r0 src=r0 offset=0 imm=4 #line 54 "sample/utility.c" - r6 = IMMEDIATE(4); - // EBPF_OP_JSGT_REG pc=58 dst=r1 src=r0 offset=45 imm=0 + r0 = IMMEDIATE(4); + // EBPF_OP_JSGT_REG pc=62 dst=r2 src=r1 offset=47 imm=0 #line 54 "sample/utility.c" - if ((int64_t)r1 > (int64_t)r0) { + if ((int64_t)r2 > (int64_t)r1) { #line 54 "sample/utility.c" goto label_1; #line 54 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=59 dst=r6 src=r0 offset=0 imm=5 + // EBPF_OP_MOV64_IMM pc=63 dst=r0 src=r0 offset=0 imm=5 #line 54 "sample/utility.c" - r6 = IMMEDIATE(5); - // EBPF_OP_LDXB pc=60 dst=r1 src=r10 offset=-8 imm=0 + r0 = IMMEDIATE(5); + // EBPF_OP_LDXB pc=64 dst=r1 src=r10 offset=-8 imm=0 #line 59 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-8)); - // EBPF_OP_JNE_IMM pc=61 dst=r1 src=r0 offset=42 imm=116 + // EBPF_OP_JNE_IMM pc=65 dst=r1 src=r0 offset=44 imm=116 #line 59 "sample/utility.c" if (r1 != IMMEDIATE(116)) { #line 59 "sample/utility.c" goto label_1; #line 59 "sample/utility.c" } - // EBPF_OP_LDXB pc=62 dst=r1 src=r10 offset=-7 imm=0 + // EBPF_OP_LDXB pc=66 dst=r1 src=r10 offset=-7 imm=0 #line 59 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-7)); - // EBPF_OP_JNE_IMM pc=63 dst=r1 src=r0 offset=40 imm=101 + // EBPF_OP_JNE_IMM pc=67 dst=r1 src=r0 offset=42 imm=101 #line 59 "sample/utility.c" if (r1 != IMMEDIATE(101)) { #line 59 "sample/utility.c" goto label_1; #line 59 "sample/utility.c" } - // EBPF_OP_LDXB pc=64 dst=r1 src=r10 offset=-6 imm=0 + // EBPF_OP_LDXB pc=68 dst=r1 src=r10 offset=-6 imm=0 #line 59 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-6)); - // EBPF_OP_JNE_IMM pc=65 dst=r1 src=r0 offset=38 imm=115 + // EBPF_OP_JNE_IMM pc=69 dst=r1 src=r0 offset=40 imm=115 #line 59 "sample/utility.c" if (r1 != IMMEDIATE(115)) { #line 59 "sample/utility.c" goto label_1; #line 59 "sample/utility.c" } - // EBPF_OP_LDXB pc=66 dst=r1 src=r10 offset=-5 imm=0 + // EBPF_OP_LDXB pc=70 dst=r1 src=r10 offset=-5 imm=0 #line 59 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-5)); - // EBPF_OP_JNE_IMM pc=67 dst=r1 src=r0 offset=36 imm=116 + // EBPF_OP_JNE_IMM pc=71 dst=r1 src=r0 offset=38 imm=116 #line 59 "sample/utility.c" if (r1 != IMMEDIATE(116)) { #line 59 "sample/utility.c" goto label_1; #line 59 "sample/utility.c" } - // EBPF_OP_MOV64_REG pc=68 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=72 dst=r1 src=r10 offset=0 imm=0 #line 59 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=69 dst=r1 src=r0 offset=0 imm=-8 + // EBPF_OP_ADD64_IMM pc=73 dst=r1 src=r0 offset=0 imm=-8 #line 64 "sample/utility.c" r1 += IMMEDIATE(-8); - // EBPF_OP_MOV64_IMM pc=70 dst=r2 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=74 dst=r2 src=r0 offset=0 imm=4 #line 64 "sample/utility.c" r2 = IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=71 dst=r3 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=75 dst=r3 src=r0 offset=0 imm=0 #line 64 "sample/utility.c" r3 = IMMEDIATE(0); - // EBPF_OP_CALL pc=72 dst=r0 src=r0 offset=0 imm=24 + // EBPF_OP_CALL pc=76 dst=r0 src=r0 offset=0 imm=24 #line 64 "sample/utility.c" r0 = UtilityTest_helpers[2].address(r1, r2, r3, r4, r5, context); #line 64 "sample/utility.c" @@ -366,78 +376,81 @@ UtilityTest(void* context) return 0; #line 64 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=73 dst=r6 src=r0 offset=0 imm=6 + // EBPF_OP_MOV64_REG pc=77 dst=r1 src=r0 offset=0 imm=0 +#line 64 "sample/utility.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=78 dst=r0 src=r0 offset=0 imm=6 #line 64 "sample/utility.c" - r6 = IMMEDIATE(6); - // EBPF_OP_JEQ_IMM pc=74 dst=r0 src=r0 offset=29 imm=0 + r0 = IMMEDIATE(6); + // EBPF_OP_JEQ_IMM pc=79 dst=r1 src=r0 offset=30 imm=0 #line 64 "sample/utility.c" - if (r0 == IMMEDIATE(0)) { + if (r1 == IMMEDIATE(0)) { #line 64 "sample/utility.c" goto label_1; #line 64 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=75 dst=r6 src=r0 offset=0 imm=7 + // EBPF_OP_MOV64_IMM pc=80 dst=r0 src=r0 offset=0 imm=7 #line 64 "sample/utility.c" - r6 = IMMEDIATE(7); - // EBPF_OP_LDXB pc=76 dst=r1 src=r10 offset=-8 imm=0 + r0 = IMMEDIATE(7); + // EBPF_OP_LDXB pc=81 dst=r1 src=r10 offset=-8 imm=0 #line 69 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-8)); - // EBPF_OP_JNE_IMM pc=77 dst=r1 src=r0 offset=26 imm=0 + // EBPF_OP_JNE_IMM pc=82 dst=r1 src=r0 offset=27 imm=0 #line 69 "sample/utility.c" if (r1 != IMMEDIATE(0)) { #line 69 "sample/utility.c" goto label_1; #line 69 "sample/utility.c" } - // EBPF_OP_LDXB pc=78 dst=r1 src=r10 offset=-7 imm=0 + // EBPF_OP_LDXB pc=83 dst=r1 src=r10 offset=-7 imm=0 #line 69 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-7)); - // EBPF_OP_JNE_IMM pc=79 dst=r1 src=r0 offset=24 imm=0 + // EBPF_OP_JNE_IMM pc=84 dst=r1 src=r0 offset=25 imm=0 #line 69 "sample/utility.c" if (r1 != IMMEDIATE(0)) { #line 69 "sample/utility.c" goto label_1; #line 69 "sample/utility.c" } - // EBPF_OP_LDXB pc=80 dst=r1 src=r10 offset=-6 imm=0 + // EBPF_OP_LDXB pc=85 dst=r1 src=r10 offset=-6 imm=0 #line 69 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-6)); - // EBPF_OP_JNE_IMM pc=81 dst=r1 src=r0 offset=22 imm=0 + // EBPF_OP_JNE_IMM pc=86 dst=r1 src=r0 offset=23 imm=0 #line 69 "sample/utility.c" if (r1 != IMMEDIATE(0)) { #line 69 "sample/utility.c" goto label_1; #line 69 "sample/utility.c" } - // EBPF_OP_LDXB pc=82 dst=r1 src=r10 offset=-5 imm=0 + // EBPF_OP_LDXB pc=87 dst=r1 src=r10 offset=-5 imm=0 #line 69 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-5)); - // EBPF_OP_JNE_IMM pc=83 dst=r1 src=r0 offset=20 imm=0 + // EBPF_OP_JNE_IMM pc=88 dst=r1 src=r0 offset=21 imm=0 #line 69 "sample/utility.c" if (r1 != IMMEDIATE(0)) { #line 69 "sample/utility.c" goto label_1; #line 69 "sample/utility.c" } - // EBPF_OP_MOV64_REG pc=84 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=89 dst=r1 src=r10 offset=0 imm=0 #line 74 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=85 dst=r1 src=r0 offset=0 imm=-30 + // EBPF_OP_ADD64_IMM pc=90 dst=r1 src=r0 offset=0 imm=-30 #line 74 "sample/utility.c" r1 += IMMEDIATE(-30); - // EBPF_OP_MOV64_REG pc=86 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=91 dst=r3 src=r10 offset=0 imm=0 #line 74 "sample/utility.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=87 dst=r3 src=r0 offset=0 imm=-32 + // EBPF_OP_ADD64_IMM pc=92 dst=r3 src=r0 offset=0 imm=-32 #line 74 "sample/utility.c" r3 += IMMEDIATE(-32); - // EBPF_OP_MOV64_IMM pc=88 dst=r2 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=93 dst=r2 src=r0 offset=0 imm=4 #line 74 "sample/utility.c" r2 = IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=89 dst=r4 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=94 dst=r4 src=r0 offset=0 imm=4 #line 74 "sample/utility.c" r4 = IMMEDIATE(4); - // EBPF_OP_CALL pc=90 dst=r0 src=r0 offset=0 imm=25 + // EBPF_OP_CALL pc=95 dst=r0 src=r0 offset=0 imm=25 #line 74 "sample/utility.c" r0 = UtilityTest_helpers[3].address(r1, r2, r3, r4, r5, context); #line 74 "sample/utility.c" @@ -446,70 +459,70 @@ UtilityTest(void* context) return 0; #line 74 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=91 dst=r6 src=r0 offset=0 imm=8 + // EBPF_OP_MOV64_REG pc=96 dst=r1 src=r0 offset=0 imm=0 #line 74 "sample/utility.c" - r6 = IMMEDIATE(8); - // EBPF_OP_MOV64_IMM pc=92 dst=r1 src=r0 offset=0 imm=0 + r1 = r0; + // EBPF_OP_MOV64_IMM pc=97 dst=r0 src=r0 offset=0 imm=8 #line 74 "sample/utility.c" - r1 = IMMEDIATE(0); - // EBPF_OP_JSGT_REG pc=93 dst=r1 src=r0 offset=10 imm=0 + r0 = IMMEDIATE(8); + // EBPF_OP_MOV64_IMM pc=98 dst=r2 src=r0 offset=0 imm=0 +#line 74 "sample/utility.c" + r2 = IMMEDIATE(0); + // EBPF_OP_JSGT_REG pc=99 dst=r2 src=r1 offset=10 imm=0 #line 74 "sample/utility.c" - if ((int64_t)r1 > (int64_t)r0) { + if ((int64_t)r2 > (int64_t)r1) { #line 74 "sample/utility.c" goto label_1; #line 74 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=94 dst=r6 src=r0 offset=0 imm=9 + // EBPF_OP_MOV64_IMM pc=100 dst=r0 src=r0 offset=0 imm=9 #line 74 "sample/utility.c" - r6 = IMMEDIATE(9); - // EBPF_OP_LDXB pc=95 dst=r1 src=r10 offset=-30 imm=0 + r0 = IMMEDIATE(9); + // EBPF_OP_LDXB pc=101 dst=r1 src=r10 offset=-30 imm=0 #line 79 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-30)); - // EBPF_OP_JNE_IMM pc=96 dst=r1 src=r0 offset=7 imm=49 + // EBPF_OP_JNE_IMM pc=102 dst=r1 src=r0 offset=7 imm=49 #line 79 "sample/utility.c" if (r1 != IMMEDIATE(49)) { #line 79 "sample/utility.c" goto label_1; #line 79 "sample/utility.c" } - // EBPF_OP_LDXB pc=97 dst=r1 src=r10 offset=-29 imm=0 + // EBPF_OP_LDXB pc=103 dst=r1 src=r10 offset=-29 imm=0 #line 79 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-29)); - // EBPF_OP_JNE_IMM pc=98 dst=r1 src=r0 offset=5 imm=50 + // EBPF_OP_JNE_IMM pc=104 dst=r1 src=r0 offset=5 imm=50 #line 79 "sample/utility.c" if (r1 != IMMEDIATE(50)) { #line 79 "sample/utility.c" goto label_1; #line 79 "sample/utility.c" } - // EBPF_OP_LDXB pc=99 dst=r1 src=r10 offset=-28 imm=0 + // EBPF_OP_LDXB pc=105 dst=r1 src=r10 offset=-28 imm=0 #line 79 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-28)); - // EBPF_OP_JNE_IMM pc=100 dst=r1 src=r0 offset=3 imm=51 + // EBPF_OP_JNE_IMM pc=106 dst=r1 src=r0 offset=3 imm=51 #line 79 "sample/utility.c" if (r1 != IMMEDIATE(51)) { #line 79 "sample/utility.c" goto label_1; #line 79 "sample/utility.c" } - // EBPF_OP_LDXB pc=101 dst=r1 src=r10 offset=-27 imm=0 + // EBPF_OP_LDXB pc=107 dst=r1 src=r10 offset=-27 imm=0 #line 79 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-27)); - // EBPF_OP_JNE_IMM pc=102 dst=r1 src=r0 offset=1 imm=52 + // EBPF_OP_JNE_IMM pc=108 dst=r1 src=r0 offset=1 imm=52 #line 79 "sample/utility.c" if (r1 != IMMEDIATE(52)) { #line 79 "sample/utility.c" goto label_1; #line 79 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=103 dst=r6 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=109 dst=r0 src=r0 offset=0 imm=0 #line 79 "sample/utility.c" - r6 = IMMEDIATE(0); + r0 = IMMEDIATE(0); label_1: - // EBPF_OP_MOV64_REG pc=104 dst=r0 src=r6 offset=0 imm=0 -#line 84 "sample/utility.c" - r0 = r6; - // EBPF_OP_EXIT pc=105 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_EXIT pc=110 dst=r0 src=r0 offset=0 imm=0 #line 84 "sample/utility.c" return r0; #line 24 "sample/utility.c" @@ -529,7 +542,7 @@ static program_entry_t _programs[] = { 0, UtilityTest_helpers, 4, - 106, + 111, &UtilityTest_program_type_guid, &UtilityTest_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/utility_raw.c b/tests/bpf2c_tests/expected/utility_raw.c index 1f1053ce36..a09879bfb7 100644 --- a/tests/bpf2c_tests/expected/utility_raw.c +++ b/tests/bpf2c_tests/expected/utility_raw.c @@ -52,8 +52,6 @@ UtilityTest(void* context) register uint64_t r4 = 0; #line 24 "sample/utility.c" register uint64_t r5 = 0; -#line 24 "sample/utility.c" - register uint64_t r6 = 0; #line 24 "sample/utility.c" register uint64_t r10 = 0; @@ -122,47 +120,50 @@ UtilityTest(void* context) return 0; #line 31 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=19 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_REG pc=19 dst=r1 src=r0 offset=0 imm=0 +#line 31 "sample/utility.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=20 dst=r0 src=r0 offset=0 imm=1 #line 31 "sample/utility.c" - r6 = IMMEDIATE(1); - // EBPF_OP_LSH64_IMM pc=20 dst=r0 src=r0 offset=0 imm=32 + r0 = IMMEDIATE(1); + // EBPF_OP_LSH64_IMM pc=21 dst=r1 src=r0 offset=0 imm=32 #line 31 "sample/utility.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_RSH64_IMM pc=21 dst=r0 src=r0 offset=0 imm=32 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_RSH64_IMM pc=22 dst=r1 src=r0 offset=0 imm=32 #line 31 "sample/utility.c" - r0 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JNE_IMM pc=22 dst=r0 src=r0 offset=81 imm=0 + r1 >>= (IMMEDIATE(32) & 63); + // EBPF_OP_JNE_IMM pc=23 dst=r1 src=r0 offset=86 imm=0 #line 31 "sample/utility.c" - if (r0 != IMMEDIATE(0)) { + if (r1 != IMMEDIATE(0)) { #line 31 "sample/utility.c" goto label_1; #line 31 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=23 dst=r1 src=r0 offset=0 imm=84 + // EBPF_OP_MOV64_IMM pc=24 dst=r1 src=r0 offset=0 imm=84 #line 31 "sample/utility.c" r1 = IMMEDIATE(84); - // EBPF_OP_STXB pc=24 dst=r10 src=r1 offset=-8 imm=0 + // EBPF_OP_STXB pc=25 dst=r10 src=r1 offset=-8 imm=0 #line 35 "sample/utility.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint8_t)r1; - // EBPF_OP_MOV64_REG pc=25 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=26 dst=r1 src=r10 offset=0 imm=0 #line 35 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=26 dst=r1 src=r0 offset=0 imm=-8 + // EBPF_OP_ADD64_IMM pc=27 dst=r1 src=r0 offset=0 imm=-8 #line 35 "sample/utility.c" r1 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=27 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=28 dst=r3 src=r10 offset=0 imm=0 #line 35 "sample/utility.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=28 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=29 dst=r3 src=r0 offset=0 imm=-16 #line 35 "sample/utility.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=29 dst=r2 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=30 dst=r2 src=r0 offset=0 imm=4 #line 37 "sample/utility.c" r2 = IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=30 dst=r4 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=31 dst=r4 src=r0 offset=0 imm=4 #line 37 "sample/utility.c" r4 = IMMEDIATE(4); - // EBPF_OP_CALL pc=31 dst=r0 src=r0 offset=0 imm=23 + // EBPF_OP_CALL pc=32 dst=r0 src=r0 offset=0 imm=23 #line 37 "sample/utility.c" r0 = UtilityTest_helpers[0].address(r1, r2, r3, r4, r5, context); #line 37 "sample/utility.c" @@ -171,44 +172,44 @@ UtilityTest(void* context) return 0; #line 37 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=32 dst=r6 src=r0 offset=0 imm=2 + // EBPF_OP_MOV64_REG pc=33 dst=r1 src=r0 offset=0 imm=0 +#line 37 "sample/utility.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=34 dst=r0 src=r0 offset=0 imm=2 #line 37 "sample/utility.c" - r6 = IMMEDIATE(2); - // EBPF_OP_LSH64_IMM pc=33 dst=r0 src=r0 offset=0 imm=32 + r0 = IMMEDIATE(2); + // EBPF_OP_LSH64_IMM pc=35 dst=r1 src=r0 offset=0 imm=32 #line 37 "sample/utility.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_ARSH64_IMM pc=34 dst=r0 src=r0 offset=0 imm=32 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_ARSH64_IMM pc=36 dst=r1 src=r0 offset=0 imm=32 #line 37 "sample/utility.c" - r0 = (int64_t)r0 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_JSGT_IMM pc=35 dst=r0 src=r0 offset=68 imm=-1 + r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); + // EBPF_OP_JSGT_IMM pc=37 dst=r1 src=r0 offset=72 imm=-1 #line 37 "sample/utility.c" - if ((int64_t)r0 > IMMEDIATE(-1)) { + if ((int64_t)r1 > IMMEDIATE(-1)) { #line 37 "sample/utility.c" goto label_1; #line 37 "sample/utility.c" } - // EBPF_OP_MOV64_REG pc=36 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=38 dst=r1 src=r10 offset=0 imm=0 #line 37 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=37 dst=r1 src=r0 offset=0 imm=-8 + // EBPF_OP_ADD64_IMM pc=39 dst=r1 src=r0 offset=0 imm=-8 #line 43 "sample/utility.c" r1 += IMMEDIATE(-8); - // EBPF_OP_MOV64_IMM pc=38 dst=r6 src=r0 offset=0 imm=3 -#line 43 "sample/utility.c" - r6 = IMMEDIATE(3); - // EBPF_OP_MOV64_REG pc=39 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=40 dst=r3 src=r10 offset=0 imm=0 #line 43 "sample/utility.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=40 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=41 dst=r3 src=r0 offset=0 imm=-16 #line 43 "sample/utility.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=41 dst=r2 src=r0 offset=0 imm=3 + // EBPF_OP_MOV64_IMM pc=42 dst=r2 src=r0 offset=0 imm=3 #line 43 "sample/utility.c" r2 = IMMEDIATE(3); - // EBPF_OP_MOV64_IMM pc=42 dst=r4 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=43 dst=r4 src=r0 offset=0 imm=4 #line 43 "sample/utility.c" r4 = IMMEDIATE(4); - // EBPF_OP_CALL pc=43 dst=r0 src=r0 offset=0 imm=23 + // EBPF_OP_CALL pc=44 dst=r0 src=r0 offset=0 imm=23 #line 43 "sample/utility.c" r0 = UtilityTest_helpers[0].address(r1, r2, r3, r4, r5, context); #line 43 "sample/utility.c" @@ -217,44 +218,50 @@ UtilityTest(void* context) return 0; #line 43 "sample/utility.c" } - // EBPF_OP_LSH64_IMM pc=44 dst=r0 src=r0 offset=0 imm=32 + // EBPF_OP_MOV64_REG pc=45 dst=r1 src=r0 offset=0 imm=0 +#line 43 "sample/utility.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=46 dst=r0 src=r0 offset=0 imm=3 +#line 43 "sample/utility.c" + r0 = IMMEDIATE(3); + // EBPF_OP_LSH64_IMM pc=47 dst=r1 src=r0 offset=0 imm=32 #line 43 "sample/utility.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_ARSH64_IMM pc=45 dst=r0 src=r0 offset=0 imm=32 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_ARSH64_IMM pc=48 dst=r1 src=r0 offset=0 imm=32 #line 43 "sample/utility.c" - r0 = (int64_t)r0 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_JSGT_IMM pc=46 dst=r0 src=r0 offset=57 imm=-1 + r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); + // EBPF_OP_JSGT_IMM pc=49 dst=r1 src=r0 offset=60 imm=-1 #line 43 "sample/utility.c" - if ((int64_t)r0 > IMMEDIATE(-1)) { + if ((int64_t)r1 > IMMEDIATE(-1)) { #line 43 "sample/utility.c" goto label_1; #line 43 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=47 dst=r1 src=r0 offset=0 imm=1414743380 + // EBPF_OP_MOV64_IMM pc=50 dst=r1 src=r0 offset=0 imm=1414743380 #line 43 "sample/utility.c" r1 = IMMEDIATE(1414743380); - // EBPF_OP_STXW pc=48 dst=r10 src=r1 offset=-8 imm=0 + // EBPF_OP_STXW pc=51 dst=r10 src=r1 offset=-8 imm=0 #line 48 "sample/utility.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint32_t)r1; - // EBPF_OP_MOV64_REG pc=49 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=52 dst=r1 src=r10 offset=0 imm=0 #line 48 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=50 dst=r1 src=r0 offset=0 imm=-8 + // EBPF_OP_ADD64_IMM pc=53 dst=r1 src=r0 offset=0 imm=-8 #line 48 "sample/utility.c" r1 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=51 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=54 dst=r3 src=r10 offset=0 imm=0 #line 48 "sample/utility.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=52 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=55 dst=r3 src=r0 offset=0 imm=-16 #line 48 "sample/utility.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=53 dst=r2 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=56 dst=r2 src=r0 offset=0 imm=4 #line 54 "sample/utility.c" r2 = IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=54 dst=r4 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=57 dst=r4 src=r0 offset=0 imm=4 #line 54 "sample/utility.c" r4 = IMMEDIATE(4); - // EBPF_OP_CALL pc=55 dst=r0 src=r0 offset=0 imm=22 + // EBPF_OP_CALL pc=58 dst=r0 src=r0 offset=0 imm=22 #line 54 "sample/utility.c" r0 = UtilityTest_helpers[1].address(r1, r2, r3, r4, r5, context); #line 54 "sample/utility.c" @@ -263,75 +270,78 @@ UtilityTest(void* context) return 0; #line 54 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=56 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=59 dst=r1 src=r0 offset=0 imm=0 #line 54 "sample/utility.c" - r1 = IMMEDIATE(0); - // EBPF_OP_MOV64_IMM pc=57 dst=r6 src=r0 offset=0 imm=4 + r1 = r0; + // EBPF_OP_MOV64_IMM pc=60 dst=r2 src=r0 offset=0 imm=0 +#line 54 "sample/utility.c" + r2 = IMMEDIATE(0); + // EBPF_OP_MOV64_IMM pc=61 dst=r0 src=r0 offset=0 imm=4 #line 54 "sample/utility.c" - r6 = IMMEDIATE(4); - // EBPF_OP_JSGT_REG pc=58 dst=r1 src=r0 offset=45 imm=0 + r0 = IMMEDIATE(4); + // EBPF_OP_JSGT_REG pc=62 dst=r2 src=r1 offset=47 imm=0 #line 54 "sample/utility.c" - if ((int64_t)r1 > (int64_t)r0) { + if ((int64_t)r2 > (int64_t)r1) { #line 54 "sample/utility.c" goto label_1; #line 54 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=59 dst=r6 src=r0 offset=0 imm=5 + // EBPF_OP_MOV64_IMM pc=63 dst=r0 src=r0 offset=0 imm=5 #line 54 "sample/utility.c" - r6 = IMMEDIATE(5); - // EBPF_OP_LDXB pc=60 dst=r1 src=r10 offset=-8 imm=0 + r0 = IMMEDIATE(5); + // EBPF_OP_LDXB pc=64 dst=r1 src=r10 offset=-8 imm=0 #line 59 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-8)); - // EBPF_OP_JNE_IMM pc=61 dst=r1 src=r0 offset=42 imm=116 + // EBPF_OP_JNE_IMM pc=65 dst=r1 src=r0 offset=44 imm=116 #line 59 "sample/utility.c" if (r1 != IMMEDIATE(116)) { #line 59 "sample/utility.c" goto label_1; #line 59 "sample/utility.c" } - // EBPF_OP_LDXB pc=62 dst=r1 src=r10 offset=-7 imm=0 + // EBPF_OP_LDXB pc=66 dst=r1 src=r10 offset=-7 imm=0 #line 59 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-7)); - // EBPF_OP_JNE_IMM pc=63 dst=r1 src=r0 offset=40 imm=101 + // EBPF_OP_JNE_IMM pc=67 dst=r1 src=r0 offset=42 imm=101 #line 59 "sample/utility.c" if (r1 != IMMEDIATE(101)) { #line 59 "sample/utility.c" goto label_1; #line 59 "sample/utility.c" } - // EBPF_OP_LDXB pc=64 dst=r1 src=r10 offset=-6 imm=0 + // EBPF_OP_LDXB pc=68 dst=r1 src=r10 offset=-6 imm=0 #line 59 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-6)); - // EBPF_OP_JNE_IMM pc=65 dst=r1 src=r0 offset=38 imm=115 + // EBPF_OP_JNE_IMM pc=69 dst=r1 src=r0 offset=40 imm=115 #line 59 "sample/utility.c" if (r1 != IMMEDIATE(115)) { #line 59 "sample/utility.c" goto label_1; #line 59 "sample/utility.c" } - // EBPF_OP_LDXB pc=66 dst=r1 src=r10 offset=-5 imm=0 + // EBPF_OP_LDXB pc=70 dst=r1 src=r10 offset=-5 imm=0 #line 59 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-5)); - // EBPF_OP_JNE_IMM pc=67 dst=r1 src=r0 offset=36 imm=116 + // EBPF_OP_JNE_IMM pc=71 dst=r1 src=r0 offset=38 imm=116 #line 59 "sample/utility.c" if (r1 != IMMEDIATE(116)) { #line 59 "sample/utility.c" goto label_1; #line 59 "sample/utility.c" } - // EBPF_OP_MOV64_REG pc=68 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=72 dst=r1 src=r10 offset=0 imm=0 #line 59 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=69 dst=r1 src=r0 offset=0 imm=-8 + // EBPF_OP_ADD64_IMM pc=73 dst=r1 src=r0 offset=0 imm=-8 #line 64 "sample/utility.c" r1 += IMMEDIATE(-8); - // EBPF_OP_MOV64_IMM pc=70 dst=r2 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=74 dst=r2 src=r0 offset=0 imm=4 #line 64 "sample/utility.c" r2 = IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=71 dst=r3 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=75 dst=r3 src=r0 offset=0 imm=0 #line 64 "sample/utility.c" r3 = IMMEDIATE(0); - // EBPF_OP_CALL pc=72 dst=r0 src=r0 offset=0 imm=24 + // EBPF_OP_CALL pc=76 dst=r0 src=r0 offset=0 imm=24 #line 64 "sample/utility.c" r0 = UtilityTest_helpers[2].address(r1, r2, r3, r4, r5, context); #line 64 "sample/utility.c" @@ -340,78 +350,81 @@ UtilityTest(void* context) return 0; #line 64 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=73 dst=r6 src=r0 offset=0 imm=6 + // EBPF_OP_MOV64_REG pc=77 dst=r1 src=r0 offset=0 imm=0 +#line 64 "sample/utility.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=78 dst=r0 src=r0 offset=0 imm=6 #line 64 "sample/utility.c" - r6 = IMMEDIATE(6); - // EBPF_OP_JEQ_IMM pc=74 dst=r0 src=r0 offset=29 imm=0 + r0 = IMMEDIATE(6); + // EBPF_OP_JEQ_IMM pc=79 dst=r1 src=r0 offset=30 imm=0 #line 64 "sample/utility.c" - if (r0 == IMMEDIATE(0)) { + if (r1 == IMMEDIATE(0)) { #line 64 "sample/utility.c" goto label_1; #line 64 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=75 dst=r6 src=r0 offset=0 imm=7 + // EBPF_OP_MOV64_IMM pc=80 dst=r0 src=r0 offset=0 imm=7 #line 64 "sample/utility.c" - r6 = IMMEDIATE(7); - // EBPF_OP_LDXB pc=76 dst=r1 src=r10 offset=-8 imm=0 + r0 = IMMEDIATE(7); + // EBPF_OP_LDXB pc=81 dst=r1 src=r10 offset=-8 imm=0 #line 69 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-8)); - // EBPF_OP_JNE_IMM pc=77 dst=r1 src=r0 offset=26 imm=0 + // EBPF_OP_JNE_IMM pc=82 dst=r1 src=r0 offset=27 imm=0 #line 69 "sample/utility.c" if (r1 != IMMEDIATE(0)) { #line 69 "sample/utility.c" goto label_1; #line 69 "sample/utility.c" } - // EBPF_OP_LDXB pc=78 dst=r1 src=r10 offset=-7 imm=0 + // EBPF_OP_LDXB pc=83 dst=r1 src=r10 offset=-7 imm=0 #line 69 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-7)); - // EBPF_OP_JNE_IMM pc=79 dst=r1 src=r0 offset=24 imm=0 + // EBPF_OP_JNE_IMM pc=84 dst=r1 src=r0 offset=25 imm=0 #line 69 "sample/utility.c" if (r1 != IMMEDIATE(0)) { #line 69 "sample/utility.c" goto label_1; #line 69 "sample/utility.c" } - // EBPF_OP_LDXB pc=80 dst=r1 src=r10 offset=-6 imm=0 + // EBPF_OP_LDXB pc=85 dst=r1 src=r10 offset=-6 imm=0 #line 69 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-6)); - // EBPF_OP_JNE_IMM pc=81 dst=r1 src=r0 offset=22 imm=0 + // EBPF_OP_JNE_IMM pc=86 dst=r1 src=r0 offset=23 imm=0 #line 69 "sample/utility.c" if (r1 != IMMEDIATE(0)) { #line 69 "sample/utility.c" goto label_1; #line 69 "sample/utility.c" } - // EBPF_OP_LDXB pc=82 dst=r1 src=r10 offset=-5 imm=0 + // EBPF_OP_LDXB pc=87 dst=r1 src=r10 offset=-5 imm=0 #line 69 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-5)); - // EBPF_OP_JNE_IMM pc=83 dst=r1 src=r0 offset=20 imm=0 + // EBPF_OP_JNE_IMM pc=88 dst=r1 src=r0 offset=21 imm=0 #line 69 "sample/utility.c" if (r1 != IMMEDIATE(0)) { #line 69 "sample/utility.c" goto label_1; #line 69 "sample/utility.c" } - // EBPF_OP_MOV64_REG pc=84 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=89 dst=r1 src=r10 offset=0 imm=0 #line 74 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=85 dst=r1 src=r0 offset=0 imm=-30 + // EBPF_OP_ADD64_IMM pc=90 dst=r1 src=r0 offset=0 imm=-30 #line 74 "sample/utility.c" r1 += IMMEDIATE(-30); - // EBPF_OP_MOV64_REG pc=86 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=91 dst=r3 src=r10 offset=0 imm=0 #line 74 "sample/utility.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=87 dst=r3 src=r0 offset=0 imm=-32 + // EBPF_OP_ADD64_IMM pc=92 dst=r3 src=r0 offset=0 imm=-32 #line 74 "sample/utility.c" r3 += IMMEDIATE(-32); - // EBPF_OP_MOV64_IMM pc=88 dst=r2 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=93 dst=r2 src=r0 offset=0 imm=4 #line 74 "sample/utility.c" r2 = IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=89 dst=r4 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=94 dst=r4 src=r0 offset=0 imm=4 #line 74 "sample/utility.c" r4 = IMMEDIATE(4); - // EBPF_OP_CALL pc=90 dst=r0 src=r0 offset=0 imm=25 + // EBPF_OP_CALL pc=95 dst=r0 src=r0 offset=0 imm=25 #line 74 "sample/utility.c" r0 = UtilityTest_helpers[3].address(r1, r2, r3, r4, r5, context); #line 74 "sample/utility.c" @@ -420,70 +433,70 @@ UtilityTest(void* context) return 0; #line 74 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=91 dst=r6 src=r0 offset=0 imm=8 + // EBPF_OP_MOV64_REG pc=96 dst=r1 src=r0 offset=0 imm=0 #line 74 "sample/utility.c" - r6 = IMMEDIATE(8); - // EBPF_OP_MOV64_IMM pc=92 dst=r1 src=r0 offset=0 imm=0 + r1 = r0; + // EBPF_OP_MOV64_IMM pc=97 dst=r0 src=r0 offset=0 imm=8 #line 74 "sample/utility.c" - r1 = IMMEDIATE(0); - // EBPF_OP_JSGT_REG pc=93 dst=r1 src=r0 offset=10 imm=0 + r0 = IMMEDIATE(8); + // EBPF_OP_MOV64_IMM pc=98 dst=r2 src=r0 offset=0 imm=0 +#line 74 "sample/utility.c" + r2 = IMMEDIATE(0); + // EBPF_OP_JSGT_REG pc=99 dst=r2 src=r1 offset=10 imm=0 #line 74 "sample/utility.c" - if ((int64_t)r1 > (int64_t)r0) { + if ((int64_t)r2 > (int64_t)r1) { #line 74 "sample/utility.c" goto label_1; #line 74 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=94 dst=r6 src=r0 offset=0 imm=9 + // EBPF_OP_MOV64_IMM pc=100 dst=r0 src=r0 offset=0 imm=9 #line 74 "sample/utility.c" - r6 = IMMEDIATE(9); - // EBPF_OP_LDXB pc=95 dst=r1 src=r10 offset=-30 imm=0 + r0 = IMMEDIATE(9); + // EBPF_OP_LDXB pc=101 dst=r1 src=r10 offset=-30 imm=0 #line 79 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-30)); - // EBPF_OP_JNE_IMM pc=96 dst=r1 src=r0 offset=7 imm=49 + // EBPF_OP_JNE_IMM pc=102 dst=r1 src=r0 offset=7 imm=49 #line 79 "sample/utility.c" if (r1 != IMMEDIATE(49)) { #line 79 "sample/utility.c" goto label_1; #line 79 "sample/utility.c" } - // EBPF_OP_LDXB pc=97 dst=r1 src=r10 offset=-29 imm=0 + // EBPF_OP_LDXB pc=103 dst=r1 src=r10 offset=-29 imm=0 #line 79 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-29)); - // EBPF_OP_JNE_IMM pc=98 dst=r1 src=r0 offset=5 imm=50 + // EBPF_OP_JNE_IMM pc=104 dst=r1 src=r0 offset=5 imm=50 #line 79 "sample/utility.c" if (r1 != IMMEDIATE(50)) { #line 79 "sample/utility.c" goto label_1; #line 79 "sample/utility.c" } - // EBPF_OP_LDXB pc=99 dst=r1 src=r10 offset=-28 imm=0 + // EBPF_OP_LDXB pc=105 dst=r1 src=r10 offset=-28 imm=0 #line 79 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-28)); - // EBPF_OP_JNE_IMM pc=100 dst=r1 src=r0 offset=3 imm=51 + // EBPF_OP_JNE_IMM pc=106 dst=r1 src=r0 offset=3 imm=51 #line 79 "sample/utility.c" if (r1 != IMMEDIATE(51)) { #line 79 "sample/utility.c" goto label_1; #line 79 "sample/utility.c" } - // EBPF_OP_LDXB pc=101 dst=r1 src=r10 offset=-27 imm=0 + // EBPF_OP_LDXB pc=107 dst=r1 src=r10 offset=-27 imm=0 #line 79 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-27)); - // EBPF_OP_JNE_IMM pc=102 dst=r1 src=r0 offset=1 imm=52 + // EBPF_OP_JNE_IMM pc=108 dst=r1 src=r0 offset=1 imm=52 #line 79 "sample/utility.c" if (r1 != IMMEDIATE(52)) { #line 79 "sample/utility.c" goto label_1; #line 79 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=103 dst=r6 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=109 dst=r0 src=r0 offset=0 imm=0 #line 79 "sample/utility.c" - r6 = IMMEDIATE(0); + r0 = IMMEDIATE(0); label_1: - // EBPF_OP_MOV64_REG pc=104 dst=r0 src=r6 offset=0 imm=0 -#line 84 "sample/utility.c" - r0 = r6; - // EBPF_OP_EXIT pc=105 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_EXIT pc=110 dst=r0 src=r0 offset=0 imm=0 #line 84 "sample/utility.c" return r0; #line 24 "sample/utility.c" @@ -503,7 +516,7 @@ static program_entry_t _programs[] = { 0, UtilityTest_helpers, 4, - 106, + 111, &UtilityTest_program_type_guid, &UtilityTest_attach_type_guid, }, diff --git a/tests/bpf2c_tests/expected/utility_sys.c b/tests/bpf2c_tests/expected/utility_sys.c index 0f61b19ff3..a210d2bff0 100644 --- a/tests/bpf2c_tests/expected/utility_sys.c +++ b/tests/bpf2c_tests/expected/utility_sys.c @@ -213,8 +213,6 @@ UtilityTest(void* context) register uint64_t r4 = 0; #line 24 "sample/utility.c" register uint64_t r5 = 0; -#line 24 "sample/utility.c" - register uint64_t r6 = 0; #line 24 "sample/utility.c" register uint64_t r10 = 0; @@ -283,47 +281,50 @@ UtilityTest(void* context) return 0; #line 31 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=19 dst=r6 src=r0 offset=0 imm=1 + // EBPF_OP_MOV64_REG pc=19 dst=r1 src=r0 offset=0 imm=0 +#line 31 "sample/utility.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=20 dst=r0 src=r0 offset=0 imm=1 #line 31 "sample/utility.c" - r6 = IMMEDIATE(1); - // EBPF_OP_LSH64_IMM pc=20 dst=r0 src=r0 offset=0 imm=32 + r0 = IMMEDIATE(1); + // EBPF_OP_LSH64_IMM pc=21 dst=r1 src=r0 offset=0 imm=32 #line 31 "sample/utility.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_RSH64_IMM pc=21 dst=r0 src=r0 offset=0 imm=32 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_RSH64_IMM pc=22 dst=r1 src=r0 offset=0 imm=32 #line 31 "sample/utility.c" - r0 >>= (IMMEDIATE(32) & 63); - // EBPF_OP_JNE_IMM pc=22 dst=r0 src=r0 offset=81 imm=0 + r1 >>= (IMMEDIATE(32) & 63); + // EBPF_OP_JNE_IMM pc=23 dst=r1 src=r0 offset=86 imm=0 #line 31 "sample/utility.c" - if (r0 != IMMEDIATE(0)) { + if (r1 != IMMEDIATE(0)) { #line 31 "sample/utility.c" goto label_1; #line 31 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=23 dst=r1 src=r0 offset=0 imm=84 + // EBPF_OP_MOV64_IMM pc=24 dst=r1 src=r0 offset=0 imm=84 #line 31 "sample/utility.c" r1 = IMMEDIATE(84); - // EBPF_OP_STXB pc=24 dst=r10 src=r1 offset=-8 imm=0 + // EBPF_OP_STXB pc=25 dst=r10 src=r1 offset=-8 imm=0 #line 35 "sample/utility.c" *(uint8_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint8_t)r1; - // EBPF_OP_MOV64_REG pc=25 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=26 dst=r1 src=r10 offset=0 imm=0 #line 35 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=26 dst=r1 src=r0 offset=0 imm=-8 + // EBPF_OP_ADD64_IMM pc=27 dst=r1 src=r0 offset=0 imm=-8 #line 35 "sample/utility.c" r1 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=27 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=28 dst=r3 src=r10 offset=0 imm=0 #line 35 "sample/utility.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=28 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=29 dst=r3 src=r0 offset=0 imm=-16 #line 35 "sample/utility.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=29 dst=r2 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=30 dst=r2 src=r0 offset=0 imm=4 #line 37 "sample/utility.c" r2 = IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=30 dst=r4 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=31 dst=r4 src=r0 offset=0 imm=4 #line 37 "sample/utility.c" r4 = IMMEDIATE(4); - // EBPF_OP_CALL pc=31 dst=r0 src=r0 offset=0 imm=23 + // EBPF_OP_CALL pc=32 dst=r0 src=r0 offset=0 imm=23 #line 37 "sample/utility.c" r0 = UtilityTest_helpers[0].address(r1, r2, r3, r4, r5, context); #line 37 "sample/utility.c" @@ -332,44 +333,44 @@ UtilityTest(void* context) return 0; #line 37 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=32 dst=r6 src=r0 offset=0 imm=2 + // EBPF_OP_MOV64_REG pc=33 dst=r1 src=r0 offset=0 imm=0 +#line 37 "sample/utility.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=34 dst=r0 src=r0 offset=0 imm=2 #line 37 "sample/utility.c" - r6 = IMMEDIATE(2); - // EBPF_OP_LSH64_IMM pc=33 dst=r0 src=r0 offset=0 imm=32 + r0 = IMMEDIATE(2); + // EBPF_OP_LSH64_IMM pc=35 dst=r1 src=r0 offset=0 imm=32 #line 37 "sample/utility.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_ARSH64_IMM pc=34 dst=r0 src=r0 offset=0 imm=32 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_ARSH64_IMM pc=36 dst=r1 src=r0 offset=0 imm=32 #line 37 "sample/utility.c" - r0 = (int64_t)r0 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_JSGT_IMM pc=35 dst=r0 src=r0 offset=68 imm=-1 + r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); + // EBPF_OP_JSGT_IMM pc=37 dst=r1 src=r0 offset=72 imm=-1 #line 37 "sample/utility.c" - if ((int64_t)r0 > IMMEDIATE(-1)) { + if ((int64_t)r1 > IMMEDIATE(-1)) { #line 37 "sample/utility.c" goto label_1; #line 37 "sample/utility.c" } - // EBPF_OP_MOV64_REG pc=36 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=38 dst=r1 src=r10 offset=0 imm=0 #line 37 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=37 dst=r1 src=r0 offset=0 imm=-8 + // EBPF_OP_ADD64_IMM pc=39 dst=r1 src=r0 offset=0 imm=-8 #line 43 "sample/utility.c" r1 += IMMEDIATE(-8); - // EBPF_OP_MOV64_IMM pc=38 dst=r6 src=r0 offset=0 imm=3 -#line 43 "sample/utility.c" - r6 = IMMEDIATE(3); - // EBPF_OP_MOV64_REG pc=39 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=40 dst=r3 src=r10 offset=0 imm=0 #line 43 "sample/utility.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=40 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=41 dst=r3 src=r0 offset=0 imm=-16 #line 43 "sample/utility.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=41 dst=r2 src=r0 offset=0 imm=3 + // EBPF_OP_MOV64_IMM pc=42 dst=r2 src=r0 offset=0 imm=3 #line 43 "sample/utility.c" r2 = IMMEDIATE(3); - // EBPF_OP_MOV64_IMM pc=42 dst=r4 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=43 dst=r4 src=r0 offset=0 imm=4 #line 43 "sample/utility.c" r4 = IMMEDIATE(4); - // EBPF_OP_CALL pc=43 dst=r0 src=r0 offset=0 imm=23 + // EBPF_OP_CALL pc=44 dst=r0 src=r0 offset=0 imm=23 #line 43 "sample/utility.c" r0 = UtilityTest_helpers[0].address(r1, r2, r3, r4, r5, context); #line 43 "sample/utility.c" @@ -378,44 +379,50 @@ UtilityTest(void* context) return 0; #line 43 "sample/utility.c" } - // EBPF_OP_LSH64_IMM pc=44 dst=r0 src=r0 offset=0 imm=32 + // EBPF_OP_MOV64_REG pc=45 dst=r1 src=r0 offset=0 imm=0 +#line 43 "sample/utility.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=46 dst=r0 src=r0 offset=0 imm=3 +#line 43 "sample/utility.c" + r0 = IMMEDIATE(3); + // EBPF_OP_LSH64_IMM pc=47 dst=r1 src=r0 offset=0 imm=32 #line 43 "sample/utility.c" - r0 <<= (IMMEDIATE(32) & 63); - // EBPF_OP_ARSH64_IMM pc=45 dst=r0 src=r0 offset=0 imm=32 + r1 <<= (IMMEDIATE(32) & 63); + // EBPF_OP_ARSH64_IMM pc=48 dst=r1 src=r0 offset=0 imm=32 #line 43 "sample/utility.c" - r0 = (int64_t)r0 >> (uint32_t)(IMMEDIATE(32) & 63); - // EBPF_OP_JSGT_IMM pc=46 dst=r0 src=r0 offset=57 imm=-1 + r1 = (int64_t)r1 >> (uint32_t)(IMMEDIATE(32) & 63); + // EBPF_OP_JSGT_IMM pc=49 dst=r1 src=r0 offset=60 imm=-1 #line 43 "sample/utility.c" - if ((int64_t)r0 > IMMEDIATE(-1)) { + if ((int64_t)r1 > IMMEDIATE(-1)) { #line 43 "sample/utility.c" goto label_1; #line 43 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=47 dst=r1 src=r0 offset=0 imm=1414743380 + // EBPF_OP_MOV64_IMM pc=50 dst=r1 src=r0 offset=0 imm=1414743380 #line 43 "sample/utility.c" r1 = IMMEDIATE(1414743380); - // EBPF_OP_STXW pc=48 dst=r10 src=r1 offset=-8 imm=0 + // EBPF_OP_STXW pc=51 dst=r10 src=r1 offset=-8 imm=0 #line 48 "sample/utility.c" *(uint32_t*)(uintptr_t)(r10 + OFFSET(-8)) = (uint32_t)r1; - // EBPF_OP_MOV64_REG pc=49 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=52 dst=r1 src=r10 offset=0 imm=0 #line 48 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=50 dst=r1 src=r0 offset=0 imm=-8 + // EBPF_OP_ADD64_IMM pc=53 dst=r1 src=r0 offset=0 imm=-8 #line 48 "sample/utility.c" r1 += IMMEDIATE(-8); - // EBPF_OP_MOV64_REG pc=51 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=54 dst=r3 src=r10 offset=0 imm=0 #line 48 "sample/utility.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=52 dst=r3 src=r0 offset=0 imm=-16 + // EBPF_OP_ADD64_IMM pc=55 dst=r3 src=r0 offset=0 imm=-16 #line 48 "sample/utility.c" r3 += IMMEDIATE(-16); - // EBPF_OP_MOV64_IMM pc=53 dst=r2 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=56 dst=r2 src=r0 offset=0 imm=4 #line 54 "sample/utility.c" r2 = IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=54 dst=r4 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=57 dst=r4 src=r0 offset=0 imm=4 #line 54 "sample/utility.c" r4 = IMMEDIATE(4); - // EBPF_OP_CALL pc=55 dst=r0 src=r0 offset=0 imm=22 + // EBPF_OP_CALL pc=58 dst=r0 src=r0 offset=0 imm=22 #line 54 "sample/utility.c" r0 = UtilityTest_helpers[1].address(r1, r2, r3, r4, r5, context); #line 54 "sample/utility.c" @@ -424,75 +431,78 @@ UtilityTest(void* context) return 0; #line 54 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=56 dst=r1 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=59 dst=r1 src=r0 offset=0 imm=0 #line 54 "sample/utility.c" - r1 = IMMEDIATE(0); - // EBPF_OP_MOV64_IMM pc=57 dst=r6 src=r0 offset=0 imm=4 + r1 = r0; + // EBPF_OP_MOV64_IMM pc=60 dst=r2 src=r0 offset=0 imm=0 +#line 54 "sample/utility.c" + r2 = IMMEDIATE(0); + // EBPF_OP_MOV64_IMM pc=61 dst=r0 src=r0 offset=0 imm=4 #line 54 "sample/utility.c" - r6 = IMMEDIATE(4); - // EBPF_OP_JSGT_REG pc=58 dst=r1 src=r0 offset=45 imm=0 + r0 = IMMEDIATE(4); + // EBPF_OP_JSGT_REG pc=62 dst=r2 src=r1 offset=47 imm=0 #line 54 "sample/utility.c" - if ((int64_t)r1 > (int64_t)r0) { + if ((int64_t)r2 > (int64_t)r1) { #line 54 "sample/utility.c" goto label_1; #line 54 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=59 dst=r6 src=r0 offset=0 imm=5 + // EBPF_OP_MOV64_IMM pc=63 dst=r0 src=r0 offset=0 imm=5 #line 54 "sample/utility.c" - r6 = IMMEDIATE(5); - // EBPF_OP_LDXB pc=60 dst=r1 src=r10 offset=-8 imm=0 + r0 = IMMEDIATE(5); + // EBPF_OP_LDXB pc=64 dst=r1 src=r10 offset=-8 imm=0 #line 59 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-8)); - // EBPF_OP_JNE_IMM pc=61 dst=r1 src=r0 offset=42 imm=116 + // EBPF_OP_JNE_IMM pc=65 dst=r1 src=r0 offset=44 imm=116 #line 59 "sample/utility.c" if (r1 != IMMEDIATE(116)) { #line 59 "sample/utility.c" goto label_1; #line 59 "sample/utility.c" } - // EBPF_OP_LDXB pc=62 dst=r1 src=r10 offset=-7 imm=0 + // EBPF_OP_LDXB pc=66 dst=r1 src=r10 offset=-7 imm=0 #line 59 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-7)); - // EBPF_OP_JNE_IMM pc=63 dst=r1 src=r0 offset=40 imm=101 + // EBPF_OP_JNE_IMM pc=67 dst=r1 src=r0 offset=42 imm=101 #line 59 "sample/utility.c" if (r1 != IMMEDIATE(101)) { #line 59 "sample/utility.c" goto label_1; #line 59 "sample/utility.c" } - // EBPF_OP_LDXB pc=64 dst=r1 src=r10 offset=-6 imm=0 + // EBPF_OP_LDXB pc=68 dst=r1 src=r10 offset=-6 imm=0 #line 59 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-6)); - // EBPF_OP_JNE_IMM pc=65 dst=r1 src=r0 offset=38 imm=115 + // EBPF_OP_JNE_IMM pc=69 dst=r1 src=r0 offset=40 imm=115 #line 59 "sample/utility.c" if (r1 != IMMEDIATE(115)) { #line 59 "sample/utility.c" goto label_1; #line 59 "sample/utility.c" } - // EBPF_OP_LDXB pc=66 dst=r1 src=r10 offset=-5 imm=0 + // EBPF_OP_LDXB pc=70 dst=r1 src=r10 offset=-5 imm=0 #line 59 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-5)); - // EBPF_OP_JNE_IMM pc=67 dst=r1 src=r0 offset=36 imm=116 + // EBPF_OP_JNE_IMM pc=71 dst=r1 src=r0 offset=38 imm=116 #line 59 "sample/utility.c" if (r1 != IMMEDIATE(116)) { #line 59 "sample/utility.c" goto label_1; #line 59 "sample/utility.c" } - // EBPF_OP_MOV64_REG pc=68 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=72 dst=r1 src=r10 offset=0 imm=0 #line 59 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=69 dst=r1 src=r0 offset=0 imm=-8 + // EBPF_OP_ADD64_IMM pc=73 dst=r1 src=r0 offset=0 imm=-8 #line 64 "sample/utility.c" r1 += IMMEDIATE(-8); - // EBPF_OP_MOV64_IMM pc=70 dst=r2 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=74 dst=r2 src=r0 offset=0 imm=4 #line 64 "sample/utility.c" r2 = IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=71 dst=r3 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=75 dst=r3 src=r0 offset=0 imm=0 #line 64 "sample/utility.c" r3 = IMMEDIATE(0); - // EBPF_OP_CALL pc=72 dst=r0 src=r0 offset=0 imm=24 + // EBPF_OP_CALL pc=76 dst=r0 src=r0 offset=0 imm=24 #line 64 "sample/utility.c" r0 = UtilityTest_helpers[2].address(r1, r2, r3, r4, r5, context); #line 64 "sample/utility.c" @@ -501,78 +511,81 @@ UtilityTest(void* context) return 0; #line 64 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=73 dst=r6 src=r0 offset=0 imm=6 + // EBPF_OP_MOV64_REG pc=77 dst=r1 src=r0 offset=0 imm=0 +#line 64 "sample/utility.c" + r1 = r0; + // EBPF_OP_MOV64_IMM pc=78 dst=r0 src=r0 offset=0 imm=6 #line 64 "sample/utility.c" - r6 = IMMEDIATE(6); - // EBPF_OP_JEQ_IMM pc=74 dst=r0 src=r0 offset=29 imm=0 + r0 = IMMEDIATE(6); + // EBPF_OP_JEQ_IMM pc=79 dst=r1 src=r0 offset=30 imm=0 #line 64 "sample/utility.c" - if (r0 == IMMEDIATE(0)) { + if (r1 == IMMEDIATE(0)) { #line 64 "sample/utility.c" goto label_1; #line 64 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=75 dst=r6 src=r0 offset=0 imm=7 + // EBPF_OP_MOV64_IMM pc=80 dst=r0 src=r0 offset=0 imm=7 #line 64 "sample/utility.c" - r6 = IMMEDIATE(7); - // EBPF_OP_LDXB pc=76 dst=r1 src=r10 offset=-8 imm=0 + r0 = IMMEDIATE(7); + // EBPF_OP_LDXB pc=81 dst=r1 src=r10 offset=-8 imm=0 #line 69 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-8)); - // EBPF_OP_JNE_IMM pc=77 dst=r1 src=r0 offset=26 imm=0 + // EBPF_OP_JNE_IMM pc=82 dst=r1 src=r0 offset=27 imm=0 #line 69 "sample/utility.c" if (r1 != IMMEDIATE(0)) { #line 69 "sample/utility.c" goto label_1; #line 69 "sample/utility.c" } - // EBPF_OP_LDXB pc=78 dst=r1 src=r10 offset=-7 imm=0 + // EBPF_OP_LDXB pc=83 dst=r1 src=r10 offset=-7 imm=0 #line 69 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-7)); - // EBPF_OP_JNE_IMM pc=79 dst=r1 src=r0 offset=24 imm=0 + // EBPF_OP_JNE_IMM pc=84 dst=r1 src=r0 offset=25 imm=0 #line 69 "sample/utility.c" if (r1 != IMMEDIATE(0)) { #line 69 "sample/utility.c" goto label_1; #line 69 "sample/utility.c" } - // EBPF_OP_LDXB pc=80 dst=r1 src=r10 offset=-6 imm=0 + // EBPF_OP_LDXB pc=85 dst=r1 src=r10 offset=-6 imm=0 #line 69 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-6)); - // EBPF_OP_JNE_IMM pc=81 dst=r1 src=r0 offset=22 imm=0 + // EBPF_OP_JNE_IMM pc=86 dst=r1 src=r0 offset=23 imm=0 #line 69 "sample/utility.c" if (r1 != IMMEDIATE(0)) { #line 69 "sample/utility.c" goto label_1; #line 69 "sample/utility.c" } - // EBPF_OP_LDXB pc=82 dst=r1 src=r10 offset=-5 imm=0 + // EBPF_OP_LDXB pc=87 dst=r1 src=r10 offset=-5 imm=0 #line 69 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-5)); - // EBPF_OP_JNE_IMM pc=83 dst=r1 src=r0 offset=20 imm=0 + // EBPF_OP_JNE_IMM pc=88 dst=r1 src=r0 offset=21 imm=0 #line 69 "sample/utility.c" if (r1 != IMMEDIATE(0)) { #line 69 "sample/utility.c" goto label_1; #line 69 "sample/utility.c" } - // EBPF_OP_MOV64_REG pc=84 dst=r1 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=89 dst=r1 src=r10 offset=0 imm=0 #line 74 "sample/utility.c" r1 = r10; - // EBPF_OP_ADD64_IMM pc=85 dst=r1 src=r0 offset=0 imm=-30 + // EBPF_OP_ADD64_IMM pc=90 dst=r1 src=r0 offset=0 imm=-30 #line 74 "sample/utility.c" r1 += IMMEDIATE(-30); - // EBPF_OP_MOV64_REG pc=86 dst=r3 src=r10 offset=0 imm=0 + // EBPF_OP_MOV64_REG pc=91 dst=r3 src=r10 offset=0 imm=0 #line 74 "sample/utility.c" r3 = r10; - // EBPF_OP_ADD64_IMM pc=87 dst=r3 src=r0 offset=0 imm=-32 + // EBPF_OP_ADD64_IMM pc=92 dst=r3 src=r0 offset=0 imm=-32 #line 74 "sample/utility.c" r3 += IMMEDIATE(-32); - // EBPF_OP_MOV64_IMM pc=88 dst=r2 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=93 dst=r2 src=r0 offset=0 imm=4 #line 74 "sample/utility.c" r2 = IMMEDIATE(4); - // EBPF_OP_MOV64_IMM pc=89 dst=r4 src=r0 offset=0 imm=4 + // EBPF_OP_MOV64_IMM pc=94 dst=r4 src=r0 offset=0 imm=4 #line 74 "sample/utility.c" r4 = IMMEDIATE(4); - // EBPF_OP_CALL pc=90 dst=r0 src=r0 offset=0 imm=25 + // EBPF_OP_CALL pc=95 dst=r0 src=r0 offset=0 imm=25 #line 74 "sample/utility.c" r0 = UtilityTest_helpers[3].address(r1, r2, r3, r4, r5, context); #line 74 "sample/utility.c" @@ -581,70 +594,70 @@ UtilityTest(void* context) return 0; #line 74 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=91 dst=r6 src=r0 offset=0 imm=8 + // EBPF_OP_MOV64_REG pc=96 dst=r1 src=r0 offset=0 imm=0 #line 74 "sample/utility.c" - r6 = IMMEDIATE(8); - // EBPF_OP_MOV64_IMM pc=92 dst=r1 src=r0 offset=0 imm=0 + r1 = r0; + // EBPF_OP_MOV64_IMM pc=97 dst=r0 src=r0 offset=0 imm=8 #line 74 "sample/utility.c" - r1 = IMMEDIATE(0); - // EBPF_OP_JSGT_REG pc=93 dst=r1 src=r0 offset=10 imm=0 + r0 = IMMEDIATE(8); + // EBPF_OP_MOV64_IMM pc=98 dst=r2 src=r0 offset=0 imm=0 +#line 74 "sample/utility.c" + r2 = IMMEDIATE(0); + // EBPF_OP_JSGT_REG pc=99 dst=r2 src=r1 offset=10 imm=0 #line 74 "sample/utility.c" - if ((int64_t)r1 > (int64_t)r0) { + if ((int64_t)r2 > (int64_t)r1) { #line 74 "sample/utility.c" goto label_1; #line 74 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=94 dst=r6 src=r0 offset=0 imm=9 + // EBPF_OP_MOV64_IMM pc=100 dst=r0 src=r0 offset=0 imm=9 #line 74 "sample/utility.c" - r6 = IMMEDIATE(9); - // EBPF_OP_LDXB pc=95 dst=r1 src=r10 offset=-30 imm=0 + r0 = IMMEDIATE(9); + // EBPF_OP_LDXB pc=101 dst=r1 src=r10 offset=-30 imm=0 #line 79 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-30)); - // EBPF_OP_JNE_IMM pc=96 dst=r1 src=r0 offset=7 imm=49 + // EBPF_OP_JNE_IMM pc=102 dst=r1 src=r0 offset=7 imm=49 #line 79 "sample/utility.c" if (r1 != IMMEDIATE(49)) { #line 79 "sample/utility.c" goto label_1; #line 79 "sample/utility.c" } - // EBPF_OP_LDXB pc=97 dst=r1 src=r10 offset=-29 imm=0 + // EBPF_OP_LDXB pc=103 dst=r1 src=r10 offset=-29 imm=0 #line 79 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-29)); - // EBPF_OP_JNE_IMM pc=98 dst=r1 src=r0 offset=5 imm=50 + // EBPF_OP_JNE_IMM pc=104 dst=r1 src=r0 offset=5 imm=50 #line 79 "sample/utility.c" if (r1 != IMMEDIATE(50)) { #line 79 "sample/utility.c" goto label_1; #line 79 "sample/utility.c" } - // EBPF_OP_LDXB pc=99 dst=r1 src=r10 offset=-28 imm=0 + // EBPF_OP_LDXB pc=105 dst=r1 src=r10 offset=-28 imm=0 #line 79 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-28)); - // EBPF_OP_JNE_IMM pc=100 dst=r1 src=r0 offset=3 imm=51 + // EBPF_OP_JNE_IMM pc=106 dst=r1 src=r0 offset=3 imm=51 #line 79 "sample/utility.c" if (r1 != IMMEDIATE(51)) { #line 79 "sample/utility.c" goto label_1; #line 79 "sample/utility.c" } - // EBPF_OP_LDXB pc=101 dst=r1 src=r10 offset=-27 imm=0 + // EBPF_OP_LDXB pc=107 dst=r1 src=r10 offset=-27 imm=0 #line 79 "sample/utility.c" r1 = *(uint8_t*)(uintptr_t)(r10 + OFFSET(-27)); - // EBPF_OP_JNE_IMM pc=102 dst=r1 src=r0 offset=1 imm=52 + // EBPF_OP_JNE_IMM pc=108 dst=r1 src=r0 offset=1 imm=52 #line 79 "sample/utility.c" if (r1 != IMMEDIATE(52)) { #line 79 "sample/utility.c" goto label_1; #line 79 "sample/utility.c" } - // EBPF_OP_MOV64_IMM pc=103 dst=r6 src=r0 offset=0 imm=0 + // EBPF_OP_MOV64_IMM pc=109 dst=r0 src=r0 offset=0 imm=0 #line 79 "sample/utility.c" - r6 = IMMEDIATE(0); + r0 = IMMEDIATE(0); label_1: - // EBPF_OP_MOV64_REG pc=104 dst=r0 src=r6 offset=0 imm=0 -#line 84 "sample/utility.c" - r0 = r6; - // EBPF_OP_EXIT pc=105 dst=r0 src=r0 offset=0 imm=0 + // EBPF_OP_EXIT pc=110 dst=r0 src=r0 offset=0 imm=0 #line 84 "sample/utility.c" return r0; #line 24 "sample/utility.c" @@ -664,7 +677,7 @@ static program_entry_t _programs[] = { 0, UtilityTest_helpers, 4, - 106, + 111, &UtilityTest_program_type_guid, &UtilityTest_attach_type_guid, },