25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_sgi_ip20.c,v 1.14 2006/12/30 13:30:59 debug Exp $ |
* $Id: dev_sgi_ip20.c,v 1.15 2007/06/15 19:57:34 debug Exp $ |
29 |
* |
* |
30 |
* SGI IP20 stuff. |
* COMMENT: SGI IP20 stuff |
31 |
|
* |
32 |
|
* TODO. |
33 |
*/ |
*/ |
34 |
|
|
35 |
#include <stdio.h> |
#include <stdio.h> |
44 |
extern int quiet_mode; |
extern int quiet_mode; |
45 |
|
|
46 |
|
|
|
/* |
|
|
* dev_sgi_ip20_access(): |
|
|
*/ |
|
47 |
DEVICE_ACCESS(sgi_ip20) |
DEVICE_ACCESS(sgi_ip20) |
48 |
{ |
{ |
49 |
/* struct sgi_ip20_data *d = (struct sgi_ip20_data *) extra; */ |
/* struct sgi_ip20_data *d = extra; */ |
50 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
51 |
|
|
52 |
if (writeflag == MEM_WRITE) |
if (writeflag == MEM_WRITE) |
53 |
idata = memory_readmax64(cpu, data, len); |
idata = memory_readmax64(cpu, data, len); |
54 |
|
|
55 |
switch (relative_addr) { |
switch (relative_addr) { |
56 |
|
|
57 |
case 0x38: |
case 0x38: |
58 |
if (writeflag == MEM_WRITE) { |
if (writeflag == MEM_WRITE) { |
59 |
debug("[ sgi_ip20: write to address 0x%x, " |
debug("[ sgi_ip20: write to address 0x%x, " |
75 |
(int)relative_addr, (int)odata); |
(int)relative_addr, (int)odata); |
76 |
} |
} |
77 |
break; |
break; |
78 |
|
|
79 |
default: |
default: |
80 |
if (writeflag == MEM_WRITE) { |
if (writeflag == MEM_WRITE) { |
81 |
debug("[ sgi_ip20: unimplemented write to address " |
debug("[ sgi_ip20: unimplemented write to address " |
94 |
} |
} |
95 |
|
|
96 |
|
|
|
/* |
|
|
* dev_sgi_ip20_init(): |
|
|
*/ |
|
97 |
struct sgi_ip20_data *dev_sgi_ip20_init(struct cpu *cpu, struct memory *mem, |
struct sgi_ip20_data *dev_sgi_ip20_init(struct cpu *cpu, struct memory *mem, |
98 |
uint64_t baseaddr) |
uint64_t baseaddr) |
99 |
{ |
{ |
100 |
struct sgi_ip20_data *d = malloc(sizeof(struct sgi_ip20_data)); |
struct sgi_ip20_data *d; |
101 |
if (d == NULL) { |
|
102 |
fprintf(stderr, "out of memory\n"); |
CHECK_ALLOCATION(d = malloc(sizeof(struct sgi_ip20_data))); |
|
exit(1); |
|
|
} |
|
103 |
memset(d, 0, sizeof(struct sgi_ip20_data)); |
memset(d, 0, sizeof(struct sgi_ip20_data)); |
104 |
|
|
105 |
/* |
/* |