Commit af3c24e0 authored by Ilya Leoshkevich's avatar Ilya Leoshkevich Committed by Daniel Borkmann

selftests/bpf: fix compiling loop{1, 2, 3}.c on s390

Use PT_REGS_RC(ctx) instead of ctx->rax, which is not present on s390.
Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: default avatarStanislav Fomichev <sdf@google.com>
Tested-by: default avatarStanislav Fomichev <sdf@google.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 7cd04535
......@@ -18,7 +18,7 @@ int nested_loops(volatile struct pt_regs* ctx)
for (j = 0; j < 300; j++)
for (i = 0; i < j; i++) {
if (j & 1)
m = ctx->rax;
m = PT_REGS_RC(ctx);
else
m = j;
sum += i * m;
......
......@@ -16,7 +16,7 @@ int while_true(volatile struct pt_regs* ctx)
int i = 0;
while (true) {
if (ctx->rax & 1)
if (PT_REGS_RC(ctx) & 1)
i += 3;
else
i += 7;
......
......@@ -16,7 +16,7 @@ int while_true(volatile struct pt_regs* ctx)
__u64 i = 0, sum = 0;
do {
i++;
sum += ctx->rax;
sum += PT_REGS_RC(ctx);
} while (i < 0x100000000ULL);
return sum;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment