diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ed/if_ed.c | 22 | ||||
-rw-r--r-- | sys/dev/ed/if_edvar.h | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 9f17bfa..22f9704 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -3463,3 +3463,25 @@ ed_ds_getmcaf(struct ed_softc *sc, uint32_t *mcaf) af[index >> 3] |= 1 << (index & 7); } } + +int +ed_clear_memory(device_t dev) +{ + struct ed_softc *sc = device_get_softc(dev); + int i; + + /* + * Now zero memory and verify that it is clear + */ + bzero(sc->mem_start, sc->mem_size); + + for (i = 0; i < sc->mem_size; ++i) { + if (sc->mem_start[i]) { + device_printf(dev, "failed to clear shared memory at " + "0x%jx - check configuration\n", + (uintmax_t)rman_get_start(sc->mem_res) + i); + return (ENXIO); + } + } + return (0); +} diff --git a/sys/dev/ed/if_edvar.h b/sys/dev/ed/if_edvar.h index 0abc95e..5020858 100644 --- a/sys/dev/ed/if_edvar.h +++ b/sys/dev/ed/if_edvar.h @@ -206,6 +206,7 @@ int ed_probe_HP_pclanp(device_t, int, int); int ed_attach(device_t); int ed_detach(device_t); +int ed_clear_memory(device_t); void ed_stop(struct ed_softc *); void ed_pio_readmem(struct ed_softc *, long, uint8_t *, uint16_t); void ed_pio_writemem(struct ed_softc *, uint8_t *, uint16_t, uint16_t); |