Search
lxdream.org :: lxdream/src/cpu.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/cpu.h
changeset 998:1754a8c6a9cf
prev736:a02d1475ccfd
next1065:bc1cc0c54917
author nkeynes
date Sun Jun 28 12:07:21 2009 +0000 (14 years ago)
permissions -rw-r--r--
last change Fix handling of rename failure
Fix boneheadedness in get_filename_at
file annotate diff log raw
1.1 --- a/src/cpu.h Mon Jul 14 07:44:42 2008 +0000
1.2 +++ b/src/cpu.h Sun Jun 28 12:07:21 2009 +0000
1.3 @@ -37,8 +37,9 @@
1.4 typedef uint32_t (*disasm_func_t)(uint32_t pc, char *buffer, int buflen, char *opcode );
1.5
1.6 #define REG_INT 0
1.7 -#define REG_FLT 1
1.8 -#define REG_SPECIAL 2
1.9 +#define REG_FLOAT 1
1.10 +#define REG_DOUBLE 2
1.11 +#define REG_NONE 3 /* Used for empty/separator field */
1.12
1.13 /**
1.14 * Structure that defines a single register in a CPU for display purposes.
1.15 @@ -50,13 +51,32 @@
1.16 } reg_desc_t;
1.17
1.18 /**
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.22 */
1.23 typedef struct cpu_desc_struct {
1.24 char *name; /* CPU Name */
1.25 - disasm_func_t disasm_func; /* Disassembly function */
1.26 + /**
1.27 + * Single instruction disassembly
1.28 + **/
1.29 + disasm_func_t disasm_func;
1.30 +
1.31 + /**
1.32 + * Return a pointer to a register (indexed per the reg_desc table)
1.33 + */
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.38 + * etc.
1.39 + * All functions return the number of bytes copied, which may be 0 if the
1.40 + * address is unmapped.
1.41 + */
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.51 @@ -64,6 +84,8 @@
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.59
1.60 @@ -71,4 +93,6 @@
1.61 }
1.62 #endif
1.63
1.64 +gboolean gdb_init_server( const char *interface, int port, cpu_desc_t cpu, gboolean mmu );
1.65 +
1.66 #endif /* !lxdream_cpu_H */
.