25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_kn220.c,v 1.7 2006/12/30 13:30:58 debug Exp $ |
* $Id: dev_kn220.c,v 1.8 2007/06/15 19:11:15 debug Exp $ |
29 |
* |
* |
30 |
* DEC KN220 (DECsystem 5500) devices. |
* COMMENT: DEC KN220 (DECsystem 5500) devices |
31 |
* |
* |
32 |
* o) I/O board |
* o) I/O board |
33 |
* o) SGEC (ethernet) (Called "ne" in Ultrix.) |
* o) SGEC (ethernet) (Called "ne" in Ultrix.) |
152 |
*/ |
*/ |
153 |
void dev_sgec_init(struct memory *mem, uint64_t baseaddr, int irq_nr) |
void dev_sgec_init(struct memory *mem, uint64_t baseaddr, int irq_nr) |
154 |
{ |
{ |
155 |
struct sgec_data *d = malloc(sizeof(struct sgec_data)); |
struct sgec_data *d; |
156 |
if (d == NULL) { |
|
157 |
fprintf(stderr, "out of memory\n"); |
CHECK_ALLOCATION(d = malloc(sizeof(struct sgec_data))); |
|
exit(1); |
|
|
} |
|
158 |
memset(d, 0, sizeof(struct sgec_data)); |
memset(d, 0, sizeof(struct sgec_data)); |
159 |
|
|
160 |
d->irq_nr = irq_nr; |
d->irq_nr = irq_nr; |
161 |
|
|
162 |
memory_device_register(mem, "sgec", baseaddr, DEV_SGEC_LENGTH, |
memory_device_register(mem, "sgec", baseaddr, DEV_SGEC_LENGTH, |
170 |
struct dec5500_ioboard_data *dev_dec5500_ioboard_init(struct cpu *cpu, |
struct dec5500_ioboard_data *dev_dec5500_ioboard_init(struct cpu *cpu, |
171 |
struct memory *mem, uint64_t baseaddr) |
struct memory *mem, uint64_t baseaddr) |
172 |
{ |
{ |
173 |
struct dec5500_ioboard_data *d = |
struct dec5500_ioboard_data *d; |
174 |
malloc(sizeof(struct dec5500_ioboard_data)); |
|
175 |
if (d == NULL) { |
CHECK_ALLOCATION(d = malloc(sizeof(struct dec5500_ioboard_data))); |
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
176 |
memset(d, 0, sizeof(struct dec5500_ioboard_data)); |
memset(d, 0, sizeof(struct dec5500_ioboard_data)); |
177 |
|
|
178 |
memory_device_register(mem, "dec5500_ioboard", baseaddr, |
memory_device_register(mem, "dec5500_ioboard", baseaddr, |