Search
lxdream.org :: lxdream/src/cpu.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/cpu.h
changeset 13:28aea89fb9c6
prev11:0a82ef380c45
next14:fc481a638848
author nkeynes
date Mon Dec 12 10:09:24 2005 +0000 (15 years ago)
permissions -rw-r--r--
last change Fix a few minor arm dasm issues
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 uint32_t (*disasm_func_t)(uint32_t pc, char *buffer, int buflen, char *opcode );
    21 typedef int (*is_valid_page_t)(uint32_t pc);
    23 #define REG_INT 0
    24 #define REG_FLT 1
    25 #define REG_SPECIAL 2
    27 /**
    28  * Structure that defines a single register in a CPU for display purposes.
    29  */
    30 typedef struct reg_desc_struct {
    31     char *name;
    32     int type;
    33     void *value;
    34 } reg_desc_t;
    36 typedef struct cpu_desc_struct {
    37   char *name; /* CPU Name */
    38   disasm_func_t disasm_func; /* Disassembly function */
    39   size_t instr_size; /* Size of instruction */
    40   char *regs; /* Pointer to start of registers */
    41   size_t regs_size; /* Size of register structure in bytes */
    42   const struct reg_desc_struct *regs_info; /* Description of all registers */
    43   uint32_t *pc; /* Pointer to PC register */
    44   uint32_t *icount; /* Pointer to instruction counter */
    45   /* Memory map? */
    46     is_valid_page_t valid_page_func; /* Test for valid memory page */
    47 } *cpu_desc_t;
    49 #ifdef __cplusplus
    50 }
    51 #endif
    53 #endif /* !dream_disasm_H */
.