forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/arch/powerpc/net/bpf_jit64.h
....@@ -1,13 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * bpf_jit64.h: BPF JIT compiler for PPC64
34 *
45 * Copyright 2016 Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
56 * IBM Corporation
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * as published by the Free Software Foundation; version 2
10
- * of the License.
117 */
128 #ifndef _BPF_JIT64_H
139 #define _BPF_JIT64_H
....@@ -74,19 +70,21 @@
7470 */
7571 #define PPC_BPF_LL(r, base, i) do { \
7672 if ((i) % 4) { \
77
- PPC_LI(b2p[TMP_REG_2], (i)); \
78
- PPC_LDX(r, base, b2p[TMP_REG_2]); \
73
+ EMIT(PPC_RAW_LI(b2p[TMP_REG_2], (i)));\
74
+ EMIT(PPC_RAW_LDX(r, base, \
75
+ b2p[TMP_REG_2])); \
7976 } else \
80
- PPC_LD(r, base, i); \
77
+ EMIT(PPC_RAW_LD(r, base, i)); \
8178 } while(0)
8279 #define PPC_BPF_STL(r, base, i) do { \
8380 if ((i) % 4) { \
84
- PPC_LI(b2p[TMP_REG_2], (i)); \
85
- PPC_STDX(r, base, b2p[TMP_REG_2]); \
81
+ EMIT(PPC_RAW_LI(b2p[TMP_REG_2], (i)));\
82
+ EMIT(PPC_RAW_STDX(r, base, \
83
+ b2p[TMP_REG_2])); \
8684 } else \
87
- PPC_STD(r, base, i); \
85
+ EMIT(PPC_RAW_STD(r, base, i)); \
8886 } while(0)
89
-#define PPC_BPF_STLU(r, base, i) do { PPC_STDU(r, base, i); } while(0)
87
+#define PPC_BPF_STLU(r, base, i) do { EMIT(PPC_RAW_STDU(r, base, i)); } while(0)
9088
9189 #define SEEN_FUNC 0x1000 /* might call external helpers */
9290 #define SEEN_STACK 0x2000 /* uses BPF stack */