25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_dec_ioasic.c,v 1.17 2007/01/28 14:15:30 debug Exp $ |
* $Id: dev_dec_ioasic.c,v 1.18 2007/06/15 18:44:19 debug Exp $ |
29 |
* |
* |
30 |
* DECstation "3MIN" and "3MAX" IOASIC device. |
* COMMENT: IOASIC device used in the DECstation "3MIN" and "3MAX" machines |
31 |
* |
* |
32 |
* TODO: Lots of stuff, such as DMA and all bits in the control registers. |
* TODO: Lots of stuff, such as DMA and all bits in the control registers. |
33 |
*/ |
*/ |
47 |
#define IOASIC_DEBUG |
#define IOASIC_DEBUG |
48 |
/* #define debug fatal */ |
/* #define debug fatal */ |
49 |
|
|
50 |
/* |
|
|
* dev_dec_ioasic_access(): |
|
|
*/ |
|
51 |
DEVICE_ACCESS(dec_ioasic) |
DEVICE_ACCESS(dec_ioasic) |
52 |
{ |
{ |
53 |
struct dec_ioasic_data *d = (struct dec_ioasic_data *) extra; |
struct dec_ioasic_data *d = extra; |
54 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
55 |
uint64_t curptr; |
uint64_t curptr; |
|
int dma_len, dma_res; |
|
56 |
uint32_t csr; |
uint32_t csr; |
57 |
int regnr; |
int dma_len, dma_res, regnr; |
58 |
|
|
59 |
if (writeflag == MEM_WRITE) |
if (writeflag == MEM_WRITE) |
60 |
idata = memory_readmax64(cpu, data, len); |
idata = memory_readmax64(cpu, data, len); |
251 |
struct dec_ioasic_data *dev_dec_ioasic_init(struct cpu *cpu, |
struct dec_ioasic_data *dev_dec_ioasic_init(struct cpu *cpu, |
252 |
struct memory *mem, uint64_t baseaddr, int rackmount_flag) |
struct memory *mem, uint64_t baseaddr, int rackmount_flag) |
253 |
{ |
{ |
254 |
struct dec_ioasic_data *d = malloc(sizeof(struct dec_ioasic_data)); |
struct dec_ioasic_data *d; |
255 |
if (d == NULL) { |
|
256 |
fprintf(stderr, "out of memory\n"); |
CHECK_ALLOCATION(d = malloc(sizeof(struct dec_ioasic_data))); |
|
exit(1); |
|
|
} |
|
257 |
memset(d, 0, sizeof(struct dec_ioasic_data)); |
memset(d, 0, sizeof(struct dec_ioasic_data)); |
258 |
|
|
259 |
d->rackmount_flag = rackmount_flag; |
d->rackmount_flag = rackmount_flag; |
261 |
memory_device_register(mem, "dec_ioasic", baseaddr, |
memory_device_register(mem, "dec_ioasic", baseaddr, |
262 |
DEV_DEC_IOASIC_LENGTH, dev_dec_ioasic_access, (void *)d, |
DEV_DEC_IOASIC_LENGTH, dev_dec_ioasic_access, (void *)d, |
263 |
DM_DEFAULT, NULL); |
DM_DEFAULT, NULL); |
264 |
|
|
265 |
return d; |
return d; |
266 |
} |
} |
267 |
|
|