Search
lxdream.org :: lxdream/src/cpu.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/cpu.h
changeset 9:2784c7660165
next10:c898b37506e0
author nkeynes
date Thu Dec 08 13:38:00 2005 +0000 (16 years ago)
permissions -rw-r--r--
last change Generalise the core debug window to allow multiple instances.
Add cpu description structure to define different cpus for use by the
debug window, in preparation for ARM implementation
view annotate diff log raw
     2 #ifndef dream_disasm_H
     3 #define dream_disasm_H 1
     5 #include <stdlib.h>
     7 #ifdef __cplusplus
     8 extern "C" {
     9 #endif
    11 /**
    12  * Disassembly function pointer typedef.
    13  *
    14  * @param pc Address to disassemble
    15  * @param buffer String buffer to write disassembly into
    16  * @param buflen Maximum length of buffer
    17  * @return next address to disassemble
    18  */
    19 typedef int (*disasm_func_t)(uint32_t pc, char *buffer, int buflen );
    21 #define REG_INT 0
    22 #define REG_FLT 1
    23 #define REG_SPECIAL 2
    25 /**
    26  * Structure that defines a single register in a CPU for display purposes.
    27  */
    28 typedef struct reg_desc_struct {
    29     char *name;
    30     int type;
    31     void *value;
    32 } reg_desc_t;
    34 typedef struct cpu_desc_struct {
    35   char *name; /* CPU Name */
    36   disasm_func_t disasm_func; /* Disassembly function */
    37   size_t instr_size; /* Size of instruction */
    38   char *regs; /* Pointer to start of registers */
    39   size_t regs_size; /* Size of register structure in bytes */
    40   struct reg_desc_struct *regs_info; /* Description of all registers */
    41   uint32_t *pc; /* Pointer to PC register */
    42   uint32_t *icount; /* Pointer to instruction counter */
    43   /* Memory map? */
    44 } *cpu_desc_t;
    46 #ifdef __cplusplus
    47 }
    48 #endif
    50 #endif /* !dream_disasm_H */
.