1
2 #ifndef _BPF_JIT_H
3 #define _BPF_JIT_H
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #ifndef __ASSEMBLER__
19 #define G0 0x00
20 #define G1 0x01
21 #define G3 0x03
22 #define G6 0x06
23 #define O0 0x08
24 #define O1 0x09
25 #define O2 0x0a
26 #define O3 0x0b
27 #define O4 0x0c
28 #define O5 0x0d
29 #define SP 0x0e
30 #define O7 0x0f
31 #define FP 0x1e
32
33 #define r_SKB O0
34 #define r_A O1
35 #define r_X O2
36 #define r_saved_O7 O3
37 #define r_HEADLEN O4
38 #define r_SKB_DATA O5
39 #define r_TMP G1
40 #define r_TMP2 G2
41 #define r_OFF G3
42
43
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_SKB %o0
59 #define r_A %o1
60 #define r_X %o2
61 #define r_saved_O7 %o3
62 #define r_HEADLEN %o4
63 #define r_SKB_DATA %o5
64 #define r_TMP %g1
65 #define r_TMP2 %g2
66 #define r_OFF %g3
67 #endif
68
69 #endif