diff options
| author | Warner Losh <imp@FreeBSD.org> | 2005-02-08 23:57:43 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2005-02-08 23:57:43 +0000 |
| commit | 851a243f68f052db1fe90bc006bbc2d6d81e022d (patch) | |
| tree | 702b41dbfd5a5d893e9b7efe883ae356bcdaaae8 /sys/dev/ed | |
| parent | 68f2274d97f3c7ebfc4ec8bf61ff1436eea3875c (diff) | |
Notes
Diffstat (limited to 'sys/dev/ed')
| -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 9f17bfae5795..22f970428446 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 0abc95e1f4b3..5020858bf8e7 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); |
