1.1 --- a/src/cpu.h Mon Jul 14 07:44:42 2008 +0000
1.2 +++ b/src/cpu.h Thu Jun 25 01:09:42 2009 +0000
1.4 typedef uint32_t (*disasm_func_t)(uint32_t pc, char *buffer, int buflen, char *opcode );
1.8 -#define REG_SPECIAL 2
1.10 +#define REG_DOUBLE 2
1.11 +#define REG_NONE 3 /* Used for empty/separator field */
1.14 * Structure that defines a single register in a CPU for display purposes.
1.19 - * CPU definition structure - basic information and support functions.
1.20 + * CPU definition structure - basic information and support functions. Most
1.21 + * of this is for debugger use.
1.23 typedef struct cpu_desc_struct {
1.24 char *name; /* CPU Name */
1.25 - disasm_func_t disasm_func; /* Disassembly function */
1.27 + * Single instruction disassembly
1.29 + disasm_func_t disasm_func;
1.32 + * Return a pointer to a register (indexed per the reg_desc table)
1.34 + void * (*get_register)( int reg );
1.35 + gboolean (*is_valid_page_func)(uint32_t); /* Test for valid memory page */
1.36 + /* Access to memory addressed by the CPU - physical and virtual versions.
1.37 + * Virtual access should account for the current CPU mode, privilege level,
1.39 + * All functions return the number of bytes copied, which may be 0 if the
1.40 + * address is unmapped.
1.42 + size_t (*read_mem_phys)(unsigned char *buf, uint32_t addr, size_t length);
1.43 + size_t (*write_mem_phys)(uint32_t addr, unsigned char *buf, size_t length);
1.44 + size_t (*read_mem_vma)(unsigned char *buf, uint32_t addr, size_t length);
1.45 + size_t (*write_mem_vma)(uint32_t addr, unsigned char *buf, size_t length);
1.46 gboolean (*step_func)(); /* Single step function */
1.47 - int (*is_valid_page_func)(uint32_t); /* Test for valid memory page */
1.48 void (*set_breakpoint)(uint32_t, breakpoint_type_t);
1.49 gboolean (*clear_breakpoint)(uint32_t, breakpoint_type_t);
1.50 int (*get_breakpoint)(uint32_t);
1.52 char *regs; /* Pointer to start of registers */
1.53 size_t regs_size; /* Size of register structure in bytes */
1.54 const struct reg_desc_struct *regs_info; /* Description of all registers */
1.55 + unsigned int num_gpr_regs; /* Number of general purpose registers */
1.56 + unsigned int num_gdb_regs; /* Total number of registers visible to gdb */
1.57 uint32_t *pc; /* Pointer to PC register */
1.58 } const *cpu_desc_t;
1.64 +gboolean gdb_init_server( const char *interface, int port, cpu_desc_t cpu, gboolean mmu );
1.66 #endif /* !lxdream_cpu_H */