1 |
/* |
/* |
2 |
* Copyright (C) 2004-2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2004-2007 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_ahc.c,v 1.2 2005/11/13 00:14:08 debug Exp $ |
* $Id: dev_ahc.c,v 1.8 2007/06/15 18:44:18 debug Exp $ |
29 |
* |
* |
30 |
* Adaptec AHC SCSI controller. |
* COMMENT: Adaptec AHC SCSI controller |
31 |
* |
* |
32 |
* NetBSD should say something like this, on SGI-IP32: |
* NetBSD should say something like this, on SGI-IP32: |
33 |
* ahc0 at pci0 dev 1 function 0 |
* ahc0 at pci0 dev 1 function 0 |
62 |
}; |
}; |
63 |
|
|
64 |
|
|
65 |
/* |
DEVICE_ACCESS(ahc) |
|
* dev_ahc_access(): |
|
|
*/ |
|
|
int dev_ahc_access(struct cpu *cpu, struct memory *mem, |
|
|
uint64_t relative_addr, unsigned char *data, size_t len, |
|
|
int writeflag, void *extra) |
|
66 |
{ |
{ |
67 |
struct ahc_data *d = extra; |
struct ahc_data *d = extra; |
68 |
uint64_t idata, odata = 0; |
uint64_t idata, odata = 0; |
164 |
(int)relative_addr); |
(int)relative_addr); |
165 |
} |
} |
166 |
|
|
|
#if 0 |
|
|
cpu_interrupt(cpu, 0x200); |
|
|
#endif |
|
|
|
|
167 |
#ifdef AHC_DEBUG |
#ifdef AHC_DEBUG |
168 |
if (ok) { |
if (ok) { |
169 |
if (name == NULL) { |
if (name == NULL) { |
191 |
} |
} |
192 |
|
|
193 |
|
|
194 |
/* |
DEVINIT(ahc) |
|
* devinit_ahc(): |
|
|
*/ |
|
|
int devinit_ahc(struct devinit *devinit) |
|
195 |
{ |
{ |
196 |
struct ahc_data *d = malloc(sizeof(struct ahc_data)); |
struct ahc_data *d; |
197 |
if (d == NULL) { |
|
198 |
fprintf(stderr, "out of memory\n"); |
CHECK_ALLOCATION(d = malloc(sizeof(struct ahc_data))); |
|
exit(1); |
|
|
} |
|
199 |
memset(d, 0, sizeof(struct ahc_data)); |
memset(d, 0, sizeof(struct ahc_data)); |
200 |
|
|
201 |
memory_device_register(devinit->machine->memory, devinit->name, |
memory_device_register(devinit->machine->memory, devinit->name, |