summaryrefslogtreecommitdiff
path: root/arch/powerpc/net/bpf_jit_comp32.c
diff options
context:
space:
mode:
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>2022-02-14 13:41:49 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2022-03-07 16:04:59 +0300
commit036d559c0bdea75bf4840ba6780790d08572480c (patch)
tree7ca071512aa9125c04cdad7628a527a0bf581ec0 /arch/powerpc/net/bpf_jit_comp32.c
parent576a6c3a00c1a2a3645e039b126b52f6c7755e54 (diff)
downloadlinux-036d559c0bdea75bf4840ba6780790d08572480c.tar.xz
powerpc/bpf: Use _Rn macros for GPRs
Use _Rn macros to specify register names to make their usage clear. Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/7df626b8cdc6141d4295ac16137c82ad570b6637.1644834730.git.naveen.n.rao@linux.vnet.ibm.com
Diffstat (limited to 'arch/powerpc/net/bpf_jit_comp32.c')
-rw-r--r--arch/powerpc/net/bpf_jit_comp32.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/arch/powerpc/net/bpf_jit_comp32.c b/arch/powerpc/net/bpf_jit_comp32.c
index 1dda7e3a3e9b..1c86b489232a 100644
--- a/arch/powerpc/net/bpf_jit_comp32.c
+++ b/arch/powerpc/net/bpf_jit_comp32.c
@@ -41,23 +41,23 @@
/* BPF to ppc register mappings */
const int b2p[MAX_BPF_JIT_REG + 1] = {
/* function return value */
- [BPF_REG_0] = 12,
+ [BPF_REG_0] = _R12,
/* function arguments */
- [BPF_REG_1] = 4,
- [BPF_REG_2] = 6,
- [BPF_REG_3] = 8,
- [BPF_REG_4] = 10,
- [BPF_REG_5] = 22,
+ [BPF_REG_1] = _R4,
+ [BPF_REG_2] = _R6,
+ [BPF_REG_3] = _R8,
+ [BPF_REG_4] = _R10,
+ [BPF_REG_5] = _R22,
/* non volatile registers */
- [BPF_REG_6] = 24,
- [BPF_REG_7] = 26,
- [BPF_REG_8] = 28,
- [BPF_REG_9] = 30,
+ [BPF_REG_6] = _R24,
+ [BPF_REG_7] = _R26,
+ [BPF_REG_8] = _R28,
+ [BPF_REG_9] = _R30,
/* frame pointer aka BPF_REG_10 */
- [BPF_REG_FP] = 18,
+ [BPF_REG_FP] = _R18,
/* eBPF jit internal registers */
- [BPF_REG_AX] = 20,
- [TMP_REG] = 31, /* 32 bits */
+ [BPF_REG_AX] = _R20,
+ [TMP_REG] = _R31, /* 32 bits */
};
static int bpf_to_ppc(struct codegen_context *ctx, int reg)
@@ -66,8 +66,8 @@ static int bpf_to_ppc(struct codegen_context *ctx, int reg)
}
/* PPC NVR range -- update this if we ever use NVRs below r17 */
-#define BPF_PPC_NVR_MIN 17
-#define BPF_PPC_TC 16
+#define BPF_PPC_NVR_MIN _R17
+#define BPF_PPC_TC _R16
static int bpf_jit_stack_offsetof(struct codegen_context *ctx, int reg)
{