#ifndef __KERNEL_UTIL_DISASM_H__ # define __KERNEL_UTIL_DISASM_H__ #include #include #include #include // Define the number max of arguments // for intrustions. #define ARGUMENTS_MAX 3 /* sysname - syscall name */ struct sysname_s { uint32_t syscall; const char *name; }; /* addrname - address peripherals name */ struct addrpername_s { uint32_t address; const char *name; }; /* opcode - instruction data part. */ struct opcode_s { const char *name; uint16_t mask; uint16_t code; struct { uint16_t mask; uint32_t (*special)(struct cpu_context *context, uint32_t argument); } arg[ARGUMENTS_MAX]; }; typedef struct ubc_session_s { // Menu part struct { struct { uint32_t cursor; } context; struct { struct { off_t vertical; off_t horizontal; } print_offset; uint16_t *memory; uint32_t next_break; uint32_t next_instruction; } disassembly; } menu; // Common part struct cpu_context *context; int channel; // Common keyboard abstractions struct { uint16_t entry : 1; uint16_t shift : 1; uint16_t alpha : 1; uint16_t optn : 1; uint16_t left : 1; uint16_t right : 1; uint16_t up : 1; uint16_t down : 1; uint16_t plus : 1; uint16_t minus : 1; } key; } ubc_session_t; // Opcode list. extern const struct opcode_s opcode_list[]; extern const struct addrpername_s sh7305_peripherals[]; // Functions extern void disasm_menu_disassembly(ubc_session_t *session); extern void disasm_menu_show_context(ubc_session_t *session); extern const char *disasm_check_peripheral(uint32_t argument); extern const char *disasm_check_syscalls(uint32_t argument); #endif /*__KERNEL_UTIL_DISASM_H__*/