From c9c4555f8d38053ed2da4b0f81fd86301a14d8cb Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 12 Nov 2010 13:11:18 +0100 Subject: Implement more instructions --- instruction.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'instruction.h') diff --git a/instruction.h b/instruction.h index f53c995..1053936 100644 --- a/instruction.h +++ b/instruction.h @@ -37,7 +37,7 @@ struct r_type { union { uint16_t opx11:11; struct { - uint8_t n:5; + uint8_t imm5:5; uint8_t opx6:6; } __packed; } opx; @@ -196,9 +196,13 @@ enum { }; #define R_TYPE_COUNT 0x40 -#define INSTR_ERR -1 -#define PC_INC_NORMAL 0 -#define PC_INC_BY_INSTR 1 +/* + * Return values for instruction handlers + */ +#define INSTR_ERR -1 /* Error in instruction */ +#define PC_INC_NORMAL 0 /* Normal PC increment after instruction */ +#define PC_INC_BY_INSTR 1 /* PC got incremented by instruction */ +#define INSTR_EXECPTION 2 /* Instruction generated an exception */ /* Forward declaration */ struct nios2; @@ -206,5 +210,6 @@ struct nios2; typedef int (*instruction_handler)(struct nios2 *cpu, uint32_t opcode); extern instruction_handler instruction_get_handler(uint32_t code); +extern const char *instruction_get_string(uint32_t code); #endif /* _INSTRUCTION_H_ */ -- cgit v1.2.3-54-g00ecf