summaryrefslogtreecommitdiffstats
path: root/sys/dev/ida
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2003-02-07 06:58:32 +0000
committerps <ps@FreeBSD.org>2003-02-07 06:58:32 +0000
commitf29e29c451ea20f4671a6f597277eca8f31f14e5 (patch)
tree4ae69d9766ea35c585a8d2960abdb7e391574b1f /sys/dev/ida
parent583bf78cf87ea89d45dbc01d0b7cb2ab5a7c25de (diff)
downloadFreeBSD-src-f29e29c451ea20f4671a6f597277eca8f31f14e5.zip
FreeBSD-src-f29e29c451ea20f4671a6f597277eca8f31f14e5.tar.gz
Update to new crashdump API
Diffstat (limited to 'sys/dev/ida')
-rw-r--r--sys/dev/ida/ida_disk.c47
1 files changed, 9 insertions, 38 deletions
diff --git a/sys/dev/ida/ida_disk.c b/sys/dev/ida/ida_disk.c
index 33f87c5..e93dce8 100644
--- a/sys/dev/ida/ida_disk.c
+++ b/sys/dev/ida/ida_disk.c
@@ -183,53 +183,24 @@ static int
idad_dump(dev_t dev, void *virtual, vm_offset_t physical, off_t offset, size_t length)
{
- /* This needs modified to the new dump API */
- return (ENXIO);
-#if 0
struct idad_softc *drv;
- u_int count, blkno, secsize;
- long blkcnt;
- int i, error, dumppages;
- caddr_t va;
- vm_offset_t addr, a;
-
- if ((error = disk_dumpcheck(dev, &count, &blkno, &secsize)))
- return (error);
+ int error = 0;
drv = idad_getsoftc(dev);
if (drv == NULL)
return (ENXIO);
- addr = 0;
- blkcnt = howmany(PAGE_SIZE, secsize);
-
- while (count > 0) {
- va = NULL;
-
- dumppages = imin(count / blkcnt, MAXDUMPPGS);
-
- for (i = 0; i < dumppages; i++) {
- a = addr + (i * PAGE_SIZE);
- if (is_physical_memory(a))
- va = pmap_kenter_temporary(trunc_page(a), i);
- else
- va = pmap_kenter_temporary(trunc_page(0), i);
- }
+ drv->controller->flags &= ~IDA_INTERRUPTS;
- error = ida_command(drv->controller, CMD_WRITE, va,
- PAGE_SIZE * dumppages, drv->drive, blkno, DMA_DATA_OUT);
+ if (length > 0) {
+ error = ida_command(drv->controller, CMD_WRITE, virtual,
+ length, drv->drive, offset / DEV_BSIZE, DMA_DATA_OUT);
if (error)
- return (error);
-
- if (dumpstatus(addr, (off_t)count * DEV_BSIZE) < 0)
- return (EINTR);
-
- blkno += blkcnt * dumppages;
- count -= blkcnt * dumppages;
- addr += PAGE_SIZE * dumppages;
+ goto out;
}
- return (0);
-#endif
+out:
+ drv->controller->flags |= IDA_INTERRUPTS;
+ return (error);
}
void
OpenPOWER on IntegriCloud