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: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Stanislav Fomichev <sdf@google.com> Tested-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
parent
7cd04535ab
commit
af3c24e0e2
|
@ -18,7 +18,7 @@ int nested_loops(volatile struct pt_regs* ctx)
|
||||||
for (j = 0; j < 300; j++)
|
for (j = 0; j < 300; j++)
|
||||||
for (i = 0; i < j; i++) {
|
for (i = 0; i < j; i++) {
|
||||||
if (j & 1)
|
if (j & 1)
|
||||||
m = ctx->rax;
|
m = PT_REGS_RC(ctx);
|
||||||
else
|
else
|
||||||
m = j;
|
m = j;
|
||||||
sum += i * m;
|
sum += i * m;
|
||||||
|
|
|
@ -16,7 +16,7 @@ int while_true(volatile struct pt_regs* ctx)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if (ctx->rax & 1)
|
if (PT_REGS_RC(ctx) & 1)
|
||||||
i += 3;
|
i += 3;
|
||||||
else
|
else
|
||||||
i += 7;
|
i += 7;
|
||||||
|
|
|
@ -16,7 +16,7 @@ int while_true(volatile struct pt_regs* ctx)
|
||||||
__u64 i = 0, sum = 0;
|
__u64 i = 0, sum = 0;
|
||||||
do {
|
do {
|
||||||
i++;
|
i++;
|
||||||
sum += ctx->rax;
|
sum += PT_REGS_RC(ctx);
|
||||||
} while (i < 0x100000000ULL);
|
} while (i < 0x100000000ULL);
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue