1 /* SPDX-License-Identifier: GPL-2.0 */
3 * BPF Jit compiler defines
5 * Copyright IBM Corp. 2012,2015
7 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
8 * Michael Holzheu <holzheu@linux.vnet.ibm.com>
11 #ifndef __ARCH_S390_NET_BPF_JIT_H
12 #define __ARCH_S390_NET_BPF_JIT_H
16 #include <linux/filter.h>
17 #include <linux/types.h>
19 #endif /* __ASSEMBLY__ */
22 * Stackframe layout (packed stack):
32 * BFP -> +===============+ |
36 * R15+160 -> +---------------+ |
38 * R15+152 -> +---------------+ |
40 * R15 -> +---------------+ + low
42 * We get 160 bytes stack space from calling function, but only use
43 * 12 * 8 byte for old backchain, r15..r6, and tail_call_cnt.
45 * The stack size used by the BPF program ("BPF stack" above) is passed
46 * via "aux->stack_depth".
48 #define STK_SPACE_ADD (160)
49 #define STK_160_UNUSED (160 - 12 * 8)
50 #define STK_OFF (STK_SPACE_ADD - STK_160_UNUSED)
52 #define STK_OFF_R6 (160 - 11 * 8) /* Offset of r6 on stack */
53 #define STK_OFF_TCCNT (160 - 12 * 8) /* Offset of tail_call_cnt on stack */
55 #endif /* __ARCH_S390_NET_BPF_JIT_H */