1 |
/* |
/* |
2 |
* Copyright (C) 2003-2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2003-2006 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_dec5800.c,v 1.16 2005/10/26 14:37:03 debug Exp $ |
* $Id: dev_dec5800.c,v 1.19 2006/03/04 12:38:47 debug Exp $ |
29 |
* |
* |
30 |
* Emulation of devices found in a DECsystem 58x0, where x is the number |
* Emulation of devices found in a DECsystem 58x0, where x is the number |
31 |
* of CPUs in the system. (The CPU board is called KN5800 by Ultrix.) |
* of CPUs in the system. (The CPU board is called KN5800 by Ultrix.) |
73 |
/* |
/* |
74 |
* dev_dec5800_vectors_access(): |
* dev_dec5800_vectors_access(): |
75 |
*/ |
*/ |
76 |
int dev_dec5800_vectors_access(struct cpu *cpu, struct memory *mem, |
DEVICE_ACCESS(dec5800_vectors) |
|
uint64_t relative_addr, unsigned char *data, size_t len, |
|
|
int writeflag, void *extra) |
|
77 |
{ |
{ |
78 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
79 |
struct dec5800_data *d = extra; |
struct dec5800_data *d = extra; |
105 |
/* |
/* |
106 |
* dev_dec5800_access(): |
* dev_dec5800_access(): |
107 |
*/ |
*/ |
108 |
int dev_dec5800_access(struct cpu *cpu, struct memory *mem, |
DEVICE_ACCESS(dec5800) |
|
uint64_t relative_addr, unsigned char *data, size_t len, |
|
|
int writeflag, void *extra) |
|
109 |
{ |
{ |
110 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
111 |
struct dec5800_data *d = extra; |
struct dec5800_data *d = extra; |
167 |
memset(d, 0, sizeof(struct dec5800_data)); |
memset(d, 0, sizeof(struct dec5800_data)); |
168 |
|
|
169 |
memory_device_register(mem, "dec5800", baseaddr, |
memory_device_register(mem, "dec5800", baseaddr, |
170 |
DEV_DEC5800_LENGTH, dev_dec5800_access, d, MEM_DEFAULT, NULL); |
DEV_DEC5800_LENGTH, dev_dec5800_access, d, DM_DEFAULT, NULL); |
171 |
memory_device_register(mem, "dec5800_vectors", |
memory_device_register(mem, "dec5800_vectors", |
172 |
baseaddr + 0x30000000, 0x100, dev_dec5800_vectors_access, |
baseaddr + 0x30000000, 0x100, dev_dec5800_vectors_access, |
173 |
d, MEM_DEFAULT, NULL); |
d, DM_DEFAULT, NULL); |
174 |
machine_add_tickfunction(machine, dev_dec5800_tick, d, 14); |
machine_add_tickfunction(machine, dev_dec5800_tick, d, 14, 0.0); |
175 |
|
|
176 |
return d; |
return d; |
177 |
} |
} |
190 |
/* |
/* |
191 |
* dev_decbi_access(): |
* dev_decbi_access(): |
192 |
*/ |
*/ |
193 |
int dev_decbi_access(struct cpu *cpu, struct memory *mem, |
DEVICE_ACCESS(decbi) |
|
uint64_t relative_addr, unsigned char *data, size_t len, |
|
|
int writeflag, void *extra) |
|
194 |
{ |
{ |
195 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
196 |
int node_nr; |
int node_nr; |
287 |
memset(d, 0, sizeof(struct decbi_data)); |
memset(d, 0, sizeof(struct decbi_data)); |
288 |
|
|
289 |
memory_device_register(mem, "decbi", baseaddr + 0x2000, |
memory_device_register(mem, "decbi", baseaddr + 0x2000, |
290 |
DEV_DECBI_LENGTH - 0x2000, dev_decbi_access, d, MEM_DEFAULT, NULL); |
DEV_DECBI_LENGTH - 0x2000, dev_decbi_access, d, DM_DEFAULT, NULL); |
291 |
} |
} |
292 |
|
|
293 |
|
|
306 |
/* |
/* |
307 |
* dev_deccca_access(): |
* dev_deccca_access(): |
308 |
*/ |
*/ |
309 |
int dev_deccca_access(struct cpu *cpu, struct memory *mem, |
DEVICE_ACCESS(deccca) |
|
uint64_t relative_addr, unsigned char *data, size_t len, |
|
|
int writeflag, void *extra) |
|
310 |
{ |
{ |
311 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
312 |
/* struct deccca_data *d = extra; */ |
/* struct deccca_data *d = extra; */ |
367 |
memset(d, 0, sizeof(struct deccca_data)); |
memset(d, 0, sizeof(struct deccca_data)); |
368 |
|
|
369 |
memory_device_register(mem, "deccca", baseaddr, DEV_DECCCA_LENGTH, |
memory_device_register(mem, "deccca", baseaddr, DEV_DECCCA_LENGTH, |
370 |
dev_deccca_access, d, MEM_DEFAULT, NULL); |
dev_deccca_access, d, DM_DEFAULT, NULL); |
371 |
} |
} |
372 |
|
|
373 |
|
|
388 |
/* |
/* |
389 |
* dev_decxmi_access(): |
* dev_decxmi_access(): |
390 |
*/ |
*/ |
391 |
int dev_decxmi_access(struct cpu *cpu, struct memory *mem, |
DEVICE_ACCESS(decxmi) |
|
uint64_t relative_addr, unsigned char *data, size_t len, |
|
|
int writeflag, void *extra) |
|
392 |
{ |
{ |
393 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
394 |
int node_nr; |
int node_nr; |
483 |
memset(d, 0, sizeof(struct decxmi_data)); |
memset(d, 0, sizeof(struct decxmi_data)); |
484 |
|
|
485 |
memory_device_register(mem, "decxmi", baseaddr, DEV_DECXMI_LENGTH, |
memory_device_register(mem, "decxmi", baseaddr, DEV_DECXMI_LENGTH, |
486 |
dev_decxmi_access, d, MEM_DEFAULT, NULL); |
dev_decxmi_access, d, DM_DEFAULT, NULL); |
487 |
} |
} |
488 |
|
|