diff options
Diffstat (limited to 'sys/dev/amr/amr_disk.c')
-rw-r--r-- | sys/dev/amr/amr_disk.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/dev/amr/amr_disk.c b/sys/dev/amr/amr_disk.c index 96d1c44..42d09a2 100644 --- a/sys/dev/amr/amr_disk.c +++ b/sys/dev/amr/amr_disk.c @@ -142,6 +142,33 @@ amrd_open(struct disk *dp) return (0); } +/******************************************************************************** + * System crashdump support + */ + +static int +amrd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length) +{ + + struct amrd_softc *amrd_sc; + struct amr_softc *amr_sc; + int error; + struct disk *dp; + + dp = arg; + amrd_sc = (struct amrd_softc *)dp->d_drv1; + amr_sc = (struct amr_softc *)amrd_sc->amrd_controller; + if (!amrd_sc || !amr_sc) + return(ENXIO); + + if (length > 0) { + int driveno = amrd_sc->amrd_drive - amr_sc->amr_drive; + if ((error = amr_dump_blocks(amr_sc,driveno,offset / AMR_BLKSIZE ,(void *)virtual,(int) length / AMR_BLKSIZE )) != 0) + return(error); + + } + return(0); +} /* * Read/write routine for a buffer. Finds the proper unit, range checks @@ -225,6 +252,7 @@ amrd_attach(device_t dev) sc->amrd_disk.d_open = amrd_open; sc->amrd_disk.d_strategy = amrd_strategy; sc->amrd_disk.d_name = "amrd"; + sc->amrd_disk.d_dump = (dumper_t *)amrd_dump; disk_create(sc->amrd_unit, &sc->amrd_disk, 0, NULL, NULL); #ifdef FREEBSD_4 disks_registered++; |