Markos Chandras | c6610de | 2014-04-08 12:47:14 +0100 | [diff] [blame^] | 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_V1 3 |
| 19 | #define MIPS_R_A0 4 |
| 20 | #define MIPS_R_A1 5 |
| 21 | #define MIPS_R_T6 14 |
| 22 | #define MIPS_R_T7 15 |
| 23 | #define MIPS_R_S0 16 |
| 24 | #define MIPS_R_S1 17 |
| 25 | #define MIPS_R_S2 18 |
| 26 | #define MIPS_R_S3 19 |
| 27 | #define MIPS_R_S4 20 |
| 28 | #define MIPS_R_S5 21 |
| 29 | #define MIPS_R_S6 22 |
| 30 | #define MIPS_R_S7 23 |
| 31 | #define MIPS_R_SP 29 |
| 32 | #define MIPS_R_RA 31 |
| 33 | |
| 34 | /* Conditional codes */ |
| 35 | #define MIPS_COND_EQ 0x1 |
| 36 | #define MIPS_COND_GE (0x1 << 1) |
| 37 | #define MIPS_COND_GT (0x1 << 2) |
| 38 | #define MIPS_COND_NE (0x1 << 3) |
| 39 | #define MIPS_COND_ALL (0x1 << 4) |
| 40 | /* Conditionals on X register or K immediate */ |
| 41 | #define MIPS_COND_X (0x1 << 5) |
| 42 | #define MIPS_COND_K (0x1 << 6) |
| 43 | |
| 44 | #endif /* BPF_JIT_MIPS_OP_H */ |