Line 24... |
Line 24... |
#define INSNAME_LEN 15
|
#define INSNAME_LEN 15
|
#define OPERANDNAME_LEN 50
|
#define OPERANDNAME_LEN 50
|
|
|
#define MAX_OPERANDS (4)
|
#define MAX_OPERANDS (4)
|
|
|
/* Structure for holding several labels of a particular memory location */
|
|
struct label_entry {
|
|
char *name;
|
|
struct label_entry *next;
|
|
};
|
|
|
|
#define OP_MEM_ACCESS 0x80000000
|
#define OP_MEM_ACCESS 0x80000000
|
|
|
/* This is an abstract memory type rather than physical memory type. It holds
|
/* This is an abstract memory type rather than physical memory type. It holds
|
disassembled instructions. */
|
disassembled instructions. */
|
struct mem_entry {
|
struct mem_entry {
|
unsigned char data;
|
unsigned char data;
|
unsigned char brk;
|
|
struct label_entry *label; /* labels */
|
|
};
|
};
|
|
|
enum insn_type { unknown, exception, arith, shift, compare, branch,
|
enum insn_type { unknown, exception, arith, shift, compare, branch,
|
jump, load, store, movimm, move, extend, nop, mac };
|
jump, load, store, movimm, move, extend, nop, mac };
|
|
|
Line 55... |
Line 47... |
};
|
};
|
|
|
/* Memory regions assigned to devices */
|
/* Memory regions assigned to devices */
|
struct dev_memarea {
|
struct dev_memarea {
|
struct dev_memarea *next;
|
struct dev_memarea *next;
|
unsigned long start;
|
/*unsigned long start;
|
unsigned long end;
|
unsigned long end; /* if start + size > end, this block is disabled; to enable it recalculate end addr. */
|
|
unsigned long addr_mask;
|
|
unsigned long addr_compare;
|
unsigned long size;
|
unsigned long size;
|
|
unsigned long size_mask; /* Address mask, calculated out of size */
|
unsigned long granularity; /* how many bytes read/write accepts: 1/2/4 */
|
unsigned long granularity; /* how many bytes read/write accepts: 1/2/4 */
|
|
|
|
int chip_select; /* Needed by memory controller; specifies chip select number for this memory area. */
|
|
|
unsigned long (*readfunc)(unsigned long);
|
unsigned long (*readfunc)(unsigned long);
|
void (*writefunc)(unsigned long, unsigned long);
|
void (*writefunc)(unsigned long, unsigned long);
|
struct mem_entry* (*getentry) (unsigned long);
|
|
/* private data */
|
/* private data */
|
unsigned long misc;
|
unsigned long misc;
|
};
|
};
|
|
|
extern struct iqueue_entry iqueue[20];
|
extern struct iqueue_entry iqueue[20];
|
extern struct iqueue_entry icomplet[20];
|
extern struct iqueue_entry icomplet[20];
|
extern unsigned long pc;
|
extern unsigned long pc;
|
|
|
extern void dumpmemory(unsigned int from, unsigned int to, int disasm);
|
extern void dumpmemory(unsigned int from, unsigned int to, int disasm);
|
extern unsigned long eval_label(char *label);
|
|
extern unsigned long eval_mem32(unsigned long memaddr,int*);
|
extern unsigned long eval_mem32(unsigned long memaddr,int*);
|
extern unsigned short eval_mem16(unsigned long memaddr,int*);
|
extern unsigned short eval_mem16(unsigned long memaddr,int*);
|
extern unsigned char eval_mem8(unsigned long memaddr,int*);
|
extern unsigned char eval_mem8(unsigned long memaddr,int*);
|
extern void set_mem32(unsigned long memaddr, unsigned long value,int*);
|
extern void set_mem32(unsigned long memaddr, unsigned long value,int*);
|
extern void set_mem16(unsigned long memaddr, unsigned short value,int*);
|
extern void set_mem16(unsigned long memaddr, unsigned short value,int*);
|
Line 88... |
Line 84... |
void setsim_mem16(unsigned long,unsigned short);
|
void setsim_mem16(unsigned long,unsigned short);
|
void setsim_mem8(unsigned long,unsigned char);
|
void setsim_mem8(unsigned long,unsigned char);
|
|
|
void sim_read_memory_table (char *filename);
|
void sim_read_memory_table (char *filename);
|
|
|
/* Register read and write function for a memory area (used by peripheral
|
/* Register read and write function for a memory area.
|
devices like 16450 UART etc.) */
|
addr is inside the area, if addr & addr_mask == addr_compare
|
void register_memoryarea(unsigned long start, unsigned long size,
|
(used also by peripheral devices like 16450 UART etc.) */
|
unsigned granularity,
|
void register_memoryarea_mask(unsigned long addr_mask, unsigned long addr_compare,
|
|
unsigned long size, unsigned granularity,
|
unsigned long (readfunc)(unsigned long),
|
unsigned long (readfunc)(unsigned long),
|
void (writefunc)(unsigned long, unsigned long),
|
void (writefunc)(unsigned long, unsigned long));
|
struct mem_entry *(getentry)(unsigned long));
|
|
|
/* Register read and write function for a memory area.
|
|
Memory areas should be aligned. Memory area is rounded up to
|
|
fit the nearest 2^n aligment.
|
|
(used also by peripheral devices like 16450 UART etc.) */
|
|
void register_memoryarea(unsigned long addr,
|
|
unsigned long size, unsigned granularity,
|
|
unsigned long (readfunc)(unsigned long),
|
|
void (writefunc)(unsigned long, unsigned long));
|
|
|
/* Check if access is to registered area of memory. */
|
/* Check if access is to registered area of memory. */
|
struct dev_memarea *verify_memoryarea(unsigned long addr);
|
struct dev_memarea *verify_memoryarea(unsigned long addr);
|
|
|
/* Temporary variable to increase speed. */
|
/* Temporary variable to increase speed. */
|
extern struct dev_memarea *cur_area;
|
extern struct dev_memarea *cur_area;
|
|
|
/* Added by MM */
|
/* Added by MM */
|
#ifndef LONGEST
|
#ifndef LONGEST
|