2 * $Id: cpu.h,v 1.8 2007-01-17 21:28:43 nkeynes Exp $
4 * Generic CPU definitions, primarily for providing information to the GUI.
6 * Copyright (c) 2005 Nathan Keynes.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
24 #include <glib/gtypes.h>
31 * Disassembly function pointer typedef.
33 * @param pc Address to disassemble
34 * @param buffer String buffer to write disassembly into
35 * @param buflen Maximum length of buffer
36 * @return next address to disassemble
38 typedef uint32_t (*disasm_func_t)(uint32_t pc, char *buffer, int buflen, char *opcode );
45 * Structure that defines a single register in a CPU for display purposes.
47 typedef struct reg_desc_struct {
54 * CPU definition structure - basic information and support functions.
56 typedef struct cpu_desc_struct {
57 char *name; /* CPU Name */
58 disasm_func_t disasm_func; /* Disassembly function */
59 gboolean (*step_func)(); /* Single step function */
60 int (*is_valid_page_func)(uint32_t); /* Test for valid memory page */
61 void (*set_breakpoint)(uint32_t, int);
62 gboolean (*clear_breakpoint)(uint32_t, int);
63 int (*get_breakpoint)(uint32_t);
64 size_t instr_size; /* Size of instruction */
65 char *regs; /* Pointer to start of registers */
66 size_t regs_size; /* Size of register structure in bytes */
67 const struct reg_desc_struct *regs_info; /* Description of all registers */
68 uint32_t *pc; /* Pointer to PC register */
75 #endif /* !dream_cpu_H */
.