~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/net/bpf_jit.h

Version: ~ [ linux-4.18 ] ~ [ linux-4.17.14 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.62 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.119 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.147 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.118 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.57 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.27.62 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~ [ linux-next-20180810 ] ~ [ linux-next-20180813 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Just-In-Time compiler for BPF filters on MIPS
  3  *
  4  * Copyright (c) 2014 Imagination Technologies Ltd.
  5  * Author: Markos Chandras <markos.chandras@imgtec.com>
  6  *
  7  * This program is free software; you can redistribute it and/or modify it
  8  * under the terms of the GNU General Public License as published by the
  9  * Free Software Foundation; version 2 of the License.
 10  */
 11 
 12 #ifndef BPF_JIT_MIPS_OP_H
 13 #define BPF_JIT_MIPS_OP_H
 14 
 15 /* Registers used by JIT */
 16 #define MIPS_R_ZERO     0
 17 #define MIPS_R_V0       2
 18 #define MIPS_R_A0       4
 19 #define MIPS_R_A1       5
 20 #define MIPS_R_T4       12
 21 #define MIPS_R_T5       13
 22 #define MIPS_R_T6       14
 23 #define MIPS_R_T7       15
 24 #define MIPS_R_S0       16
 25 #define MIPS_R_S1       17
 26 #define MIPS_R_S2       18
 27 #define MIPS_R_S3       19
 28 #define MIPS_R_S4       20
 29 #define MIPS_R_S5       21
 30 #define MIPS_R_S6       22
 31 #define MIPS_R_S7       23
 32 #define MIPS_R_SP       29
 33 #define MIPS_R_RA       31
 34 
 35 /* Conditional codes */
 36 #define MIPS_COND_EQ    0x1
 37 #define MIPS_COND_GE    (0x1 << 1)
 38 #define MIPS_COND_GT    (0x1 << 2)
 39 #define MIPS_COND_NE    (0x1 << 3)
 40 #define MIPS_COND_ALL   (0x1 << 4)
 41 /* Conditionals on X register or K immediate */
 42 #define MIPS_COND_X     (0x1 << 5)
 43 #define MIPS_COND_K     (0x1 << 6)
 44 
 45 #define r_ret   MIPS_R_V0
 46 
 47 /*
 48  * Use 2 scratch registers to avoid pipeline interlocks.
 49  * There is no overhead during epilogue and prologue since
 50  * any of the $s0-$s6 registers will only be preserved if
 51  * they are going to actually be used.
 52  */
 53 #define r_skb_hl        MIPS_R_S0 /* skb header length */
 54 #define r_skb_data      MIPS_R_S1 /* skb actual data */
 55 #define r_off           MIPS_R_S2
 56 #define r_A             MIPS_R_S3
 57 #define r_X             MIPS_R_S4
 58 #define r_skb           MIPS_R_S5
 59 #define r_M             MIPS_R_S6
 60 #define r_skb_len       MIPS_R_S7
 61 #define r_s0            MIPS_R_T4 /* scratch reg 1 */
 62 #define r_s1            MIPS_R_T5 /* scratch reg 2 */
 63 #define r_tmp_imm       MIPS_R_T6 /* No need to preserve this */
 64 #define r_tmp           MIPS_R_T7 /* No need to preserve this */
 65 #define r_zero          MIPS_R_ZERO
 66 #define r_sp            MIPS_R_SP
 67 #define r_ra            MIPS_R_RA
 68 
 69 #ifndef __ASSEMBLY__
 70 
 71 /* Declare ASM helpers */
 72 
 73 #define DECLARE_LOAD_FUNC(func) \
 74         extern u8 func(unsigned long *skb, int offset); \
 75         extern u8 func##_negative(unsigned long *skb, int offset); \
 76         extern u8 func##_positive(unsigned long *skb, int offset)
 77 
 78 DECLARE_LOAD_FUNC(sk_load_word);
 79 DECLARE_LOAD_FUNC(sk_load_half);
 80 DECLARE_LOAD_FUNC(sk_load_byte);
 81 
 82 #endif
 83 
 84 #endif /* BPF_JIT_MIPS_OP_H */
 85 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp