Borislav Petkov | b70ef01 | 2009-06-25 19:32:38 +0200 | [diff] [blame] | 1 | #define ERROR_CODE(x) ((x) & 0xffff) |
| 2 | #define EXT_ERROR_CODE(x) (((x) >> 16) & 0x1f) |
Borislav Petkov | 5110dbd | 2009-06-25 19:51:04 +0200 | [diff] [blame^] | 3 | #define EXT_ERR_MSG(x) ext_msgs[EXT_ERROR_CODE(x)] |
| 4 | |
Borislav Petkov | b70ef01 | 2009-06-25 19:32:38 +0200 | [diff] [blame] | 5 | #define LOW_SYNDROME(x) (((x) >> 15) & 0xff) |
| 6 | #define HIGH_SYNDROME(x) (((x) >> 24) & 0xff) |
| 7 | |
| 8 | #define TLB_ERROR(x) (((x) & 0xFFF0) == 0x0010) |
| 9 | #define MEM_ERROR(x) (((x) & 0xFF00) == 0x0100) |
| 10 | #define BUS_ERROR(x) (((x) & 0xF800) == 0x0800) |
| 11 | |
| 12 | #define TT(x) (((x) >> 2) & 0x3) |
| 13 | #define TT_MSG(x) tt_msgs[TT(x)] |
| 14 | #define II(x) (((x) >> 2) & 0x3) |
| 15 | #define II_MSG(x) ii_msgs[II(x)] |
| 16 | #define LL(x) (((x) >> 0) & 0x3) |
| 17 | #define LL_MSG(x) ll_msgs[LL(x)] |
| 18 | #define RRRR(x) (((x) >> 4) & 0xf) |
| 19 | #define RRRR_MSG(x) rrrr_msgs[RRRR(x)] |
| 20 | #define TO(x) (((x) >> 8) & 0x1) |
| 21 | #define TO_MSG(x) to_msgs[TO(x)] |
| 22 | #define PP(x) (((x) >> 9) & 0x3) |
| 23 | #define PP_MSG(x) pp_msgs[PP(x)] |
| 24 | |
| 25 | extern const char *tt_msgs[]; |
| 26 | extern const char *ll_msgs[]; |
| 27 | extern const char *rrrr_msgs[]; |
| 28 | extern const char *pp_msgs[]; |
| 29 | extern const char *to_msgs[]; |
| 30 | extern const char *ii_msgs[]; |
| 31 | extern const char *ext_msgs[]; |