xref: /openbmc/linux/arch/sparc/net/bpf_jit_64.h (revision 2359ccdd)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BPF_JIT_H
3 #define _BPF_JIT_H
4 
5 #ifndef __ASSEMBLER__
6 #define G0		0x00
7 #define G1		0x01
8 #define G2		0x02
9 #define G3		0x03
10 #define G6		0x06
11 #define G7		0x07
12 #define O0		0x08
13 #define O1		0x09
14 #define O2		0x0a
15 #define O3		0x0b
16 #define O4		0x0c
17 #define O5		0x0d
18 #define SP		0x0e
19 #define O7		0x0f
20 #define L0		0x10
21 #define L1		0x11
22 #define L2		0x12
23 #define L3		0x13
24 #define L4		0x14
25 #define L5		0x15
26 #define L6		0x16
27 #define L7		0x17
28 #define I0		0x18
29 #define I1		0x19
30 #define I2		0x1a
31 #define I3		0x1b
32 #define I4		0x1c
33 #define I5		0x1d
34 #define FP		0x1e
35 #define I7		0x1f
36 
37 #define r_SKB		L0
38 #define r_HEADLEN	L4
39 #define r_SKB_DATA	L5
40 #define r_TMP		G1
41 #define r_TMP2		G3
42 
43 /* assembly code in arch/sparc/net/bpf_jit_asm_64.S */
44 extern u32 bpf_jit_load_word[];
45 extern u32 bpf_jit_load_half[];
46 extern u32 bpf_jit_load_byte[];
47 extern u32 bpf_jit_load_byte_msh[];
48 extern u32 bpf_jit_load_word_positive_offset[];
49 extern u32 bpf_jit_load_half_positive_offset[];
50 extern u32 bpf_jit_load_byte_positive_offset[];
51 extern u32 bpf_jit_load_byte_msh_positive_offset[];
52 extern u32 bpf_jit_load_word_negative_offset[];
53 extern u32 bpf_jit_load_half_negative_offset[];
54 extern u32 bpf_jit_load_byte_negative_offset[];
55 extern u32 bpf_jit_load_byte_msh_negative_offset[];
56 
57 #else
58 #define r_RESULT	%o0
59 #define r_SKB		%o0
60 #define r_OFF		%o1
61 #define r_HEADLEN	%l4
62 #define r_SKB_DATA	%l5
63 #define r_TMP		%g1
64 #define r_TMP2		%g3
65 #endif
66 
67 #endif /* _BPF_JIT_H */
68