123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- #ifndef _BPF_JIT64_H
- #define _BPF_JIT64_H
- #include "bpf_jit.h"
- #define BPF_PPC_STACK_SAVE (8*8)
- #define BPF_PPC_STACK_LOCALS 16
- #define BPF_PPC_STACKFRAME (STACK_FRAME_MIN_SIZE + MAX_BPF_STACK + \
- BPF_PPC_STACK_LOCALS + BPF_PPC_STACK_SAVE)
- #ifndef __ASSEMBLY__
- #define SKB_HLEN_REG (MAX_BPF_JIT_REG + 0)
- #define SKB_DATA_REG (MAX_BPF_JIT_REG + 1)
- #define TMP_REG_1 (MAX_BPF_JIT_REG + 2)
- #define TMP_REG_2 (MAX_BPF_JIT_REG + 3)
- static const int b2p[] = {
-
- [BPF_REG_0] = 8,
-
- [BPF_REG_1] = 3,
- [BPF_REG_2] = 4,
- [BPF_REG_3] = 5,
- [BPF_REG_4] = 6,
- [BPF_REG_5] = 7,
-
- [BPF_REG_6] = 27,
- [BPF_REG_7] = 28,
- [BPF_REG_8] = 29,
- [BPF_REG_9] = 30,
-
- [BPF_REG_FP] = 31,
-
- [BPF_REG_AX] = 2,
- [SKB_HLEN_REG] = 25,
- [SKB_DATA_REG] = 26,
- [TMP_REG_1] = 9,
- [TMP_REG_2] = 10
- }
- #define BPF_PPC_NVR_MIN 24
- #define DECLARE_LOAD_FUNC(func) u64 func(u64 r3, u64 r4); \
- u64 func##_negative_offset(u64 r3, u64 r4); \
- u64 func##_positive_offset(u64 r3, u64 r4);
- DECLARE_LOAD_FUNC(sk_load_word)
- DECLARE_LOAD_FUNC(sk_load_half)
- DECLARE_LOAD_FUNC(sk_load_byte)
- #define CHOOSE_LOAD_FUNC(imm, func) \
- (imm < 0 ? \
- (imm >= SKF_LL_OFF ? func##_negative_offset : func) : \
- func##_positive_offset)
- #define SEEN_FUNC 0x1000
- #define SEEN_STACK 0x2000
- #define SEEN_SKB 0x4000
- #define SEEN_TAILCALL 0x8000
- struct codegen_context {
-
- unsigned int seen
- unsigned int idx
- }
- #endif
- #endif
|