56 #define DEV_AHC_LENGTH 0x100 66 uint64_t idata, odata = 0;
68 const char *name = NULL;
74 relative_addr = (relative_addr & ~0x3)
75 | (3 - (relative_addr & 3));
80 fatal(
"[ ahc: ERROR! Unimplemented len %i ]\n", len);
83 odata = d->
reg[relative_addr];
85 switch (relative_addr) {
89 ok = 1; name =
"SCSIID";
92 fatal(
"[ ahc: write to SCSIOFFSET, data = 0x" 93 "%02x: TODO ]\n", (
int)idata);
107 ok = 1; name =
"SEECTL";
109 d->
reg[relative_addr] = idata;
114 ok = 1; name =
"SCSICONF";
118 fatal(
"[ ahc: write to SCSICONF, data = 0x%02x:" 119 " TODO ]\n", (
int)idata);
130 ok = 1; name =
"HCNTRL";
132 d->
reg[relative_addr] = idata;
136 ok = 1; name =
"INTSTAT";
138 fatal(
"[ ahc: write to INTSTAT? data = 0x%02x ]\n",
144 ok = 1; name =
"ERROR";
147 ok = 1; name =
"CLRINT";
149 fatal(
"[ ahc: write to CLRINT: 0x%02x " 150 "(TODO) ]\n", (
int)idata);
158 fatal(
"[ ahc: UNIMPLEMENTED write to address 0x%x, " 159 "data=0x%02x ]\n", (
int)relative_addr, (
int)idata);
161 fatal(
"[ ahc: UNIMPLEMENTED read from address 0x%x ]\n",
169 debug(
"[ ahc: write to address 0x%x: 0x" 170 "%02x ]\n", (
int)relative_addr, (
int)idata);
172 debug(
"[ ahc: read from address 0x%x: 0x" 173 "%02x ]\n", (
int)relative_addr, (
int)odata);
176 debug(
"[ ahc: write to %s: 0x%02x ]\n",
179 debug(
"[ ahc: read from %s: 0x%02x ]\n",
197 memset(d, 0,
sizeof(
struct ahc_data));
uint64_t memory_readmax64(struct cpu *cpu, unsigned char *buf, int len)
void fatal(const char *fmt,...)
#define CHECK_ALLOCATION(ptr)
void memory_writemax64(struct cpu *cpu, unsigned char *buf, int len, uint64_t data)
void memory_device_register(struct memory *mem, const char *, uint64_t baseaddr, uint64_t len, int(*f)(struct cpu *, struct memory *, uint64_t, unsigned char *, size_t, int, void *), void *extra, int flags, unsigned char *dyntrans_data)
unsigned char reg[DEV_AHC_LENGTH]