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_kn02.c,v 1.19 2005/10/26 14:37:04 debug Exp $ |
* $Id: dev_kn02.c,v 1.21 2006/01/01 13:17:16 debug Exp $ |
29 |
* |
* |
30 |
* KN02 stuff ("3MAX", DECstation type 2). See include/dec_kn02.h for more |
* KN02 stuff ("3MAX", DECstation type 2). See include/dec_kn02.h for more |
31 |
* details. |
* details. |
46 |
/* |
/* |
47 |
* dev_kn02_access(): |
* dev_kn02_access(): |
48 |
*/ |
*/ |
49 |
int dev_kn02_access(struct cpu *cpu, struct memory *mem, |
DEVICE_ACCESS(kn02) |
|
uint64_t relative_addr, unsigned char *data, size_t len, |
|
|
int writeflag, void *extra) |
|
50 |
{ |
{ |
51 |
struct kn02_csr *d = extra; |
struct kn02_csr *d = extra; |
52 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
111 |
memset(d, 0, sizeof(struct kn02_csr)); |
memset(d, 0, sizeof(struct kn02_csr)); |
112 |
|
|
113 |
memory_device_register(mem, "kn02", baseaddr, DEV_KN02_LENGTH, |
memory_device_register(mem, "kn02", baseaddr, DEV_KN02_LENGTH, |
114 |
dev_kn02_access, d, MEM_DYNTRANS_OK, &d->csr[0]); |
dev_kn02_access, d, DM_DYNTRANS_OK, &d->csr[0]); |
115 |
|
|
116 |
return d; |
return d; |
117 |
} |
} |