Merge branches 'arm/rockchip', 'arm/exynos', 'arm/smmu', 'x86/vt-d', 'x86/amd', ...
[sfrench/cifs-2.6.git] / arch / s390 / net / bpf_jit.h
1 /*
2  * BPF Jit compiler defines
3  *
4  * Copyright IBM Corp. 2012,2015
5  *
6  * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
7  *            Michael Holzheu <holzheu@linux.vnet.ibm.com>
8  */
9
10 #ifndef __ARCH_S390_NET_BPF_JIT_H
11 #define __ARCH_S390_NET_BPF_JIT_H
12
13 #ifndef __ASSEMBLY__
14
15 #include <linux/filter.h>
16 #include <linux/types.h>
17
18 extern u8 sk_load_word_pos[], sk_load_half_pos[], sk_load_byte_pos[];
19 extern u8 sk_load_word[], sk_load_half[], sk_load_byte[];
20
21 #endif /* __ASSEMBLY__ */
22
23 /*
24  * Stackframe layout (packed stack):
25  *
26  *                                  ^ high
27  *            +---------------+     |
28  *            | old backchain |     |
29  *            +---------------+     |
30  *            |   r15 - r6    |     |
31  * BFP     -> +===============+     |
32  *            |               |     |
33  *            |   BPF stack   |     |
34  *            |               |     |
35  *            +---------------+     |
36  *            | 8 byte hlen   |     |
37  * R15+168 -> +---------------+     |
38  *            | 4 byte align  |     |
39  *            +---------------+     |
40  *            | 4 byte temp   |     |
41  *            | for bpf_jit.S |     |
42  * R15+160 -> +---------------+     |
43  *            | new backchain |     |
44  * R15+152 -> +---------------+     |
45  *            | + 152 byte SA |     |
46  * R15     -> +---------------+     + low
47  *
48  * We get 160 bytes stack space from calling function, but only use
49  * 11 * 8 byte (old backchain + r15 - r6) for storing registers.
50  */
51 #define STK_SPACE       (MAX_BPF_STACK + 8 + 4 + 4 + 160)
52 #define STK_160_UNUSED  (160 - 11 * 8)
53 #define STK_OFF         (STK_SPACE - STK_160_UNUSED)
54 #define STK_OFF_TMP     160     /* Offset of tmp buffer on stack */
55 #define STK_OFF_HLEN    168     /* Offset of SKB header length on stack */
56
57 /* Offset to skip condition code check */
58 #define OFF_OK          4
59
60 #endif /* __ARCH_S390_NET_BPF_JIT_H */