diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2010-11-12 13:11:18 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2010-11-12 13:11:18 +0100 |
commit | c9c4555f8d38053ed2da4b0f81fd86301a14d8cb (patch) | |
tree | 59a32bee8ef753da2399650200473a93645bedbd /nios2.h | |
parent | e0330d9534d8cfeffff81f426df1d3277702b835 (diff) |
Implement more instructions
Diffstat (limited to 'nios2.h')
-rw-r--r-- | nios2.h | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -25,9 +25,18 @@ struct nios2 { uint32_t ctrl_regs[NIOS2_CTRL_REG_COUNT]; /* Program counter */ uint32_t pc; + /* User or Supervisor mode */ + int mode; + + /* Configurable processor features */ + bool has_mul; /* mul, muli */ + bool has_mulx; /* mulxss, mulxsu, mulxuu */ + bool has_div; /* div, divu */ + + bool has_mmu; /* Memory Management Unit */ }; -/* Aliases for general-purpors registers */ +/* Aliases for general-purpose registers */ enum { zero = 0, at, @@ -59,9 +68,17 @@ enum { config, mpubase, mpuacc, +}; +enum { + NIOS2_SUPERVISOR_MODE, + NIOS2_USER_MODE, }; extern void nios2_cpu_reset(struct nios2 *cpu); +extern bool nios2_in_user_mode(struct nios2 *cpu); +extern bool nios2_in_supervisor_mode(struct nios2 *cpu); +extern uint32_t nios2_cpu_fetch_instr(struct nios2 *cpu, uint32_t *mem_base); +extern int nios2_cpu_execute_instr(struct nios2 *cpu, uint32_t instr); #endif /* _NIOS2_H_ */ |