diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2011-06-20 01:43:18 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2011-06-20 01:43:18 +0000 |
commit | fc5d487bb5c5279ab0cc9231116319dd1aae1819 (patch) | |
tree | 5b0ec828a481bbbec3f6cf0bb98e0466d709dffe | |
parent | 9621b9b120a83c44bf5c0c8ee105861d1178ae6a (diff) | |
download | FreeBSD-src-fc5d487bb5c5279ab0cc9231116319dd1aae1819.zip FreeBSD-src-fc5d487bb5c5279ab0cc9231116319dd1aae1819.tar.gz |
Make this slightly less yelly about regions that the hypervisor protects
from us by not registering them as disks.
-rw-r--r-- | sys/powerpc/ps3/ps3disk.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/powerpc/ps3/ps3disk.c b/sys/powerpc/ps3/ps3disk.c index e8f342b..5390f50 100644 --- a/sys/powerpc/ps3/ps3disk.c +++ b/sys/powerpc/ps3/ps3disk.c @@ -274,6 +274,8 @@ ps3disk_attach(device_t dev) } for (i = 0; i < sc->sc_nregs; i++) { + struct ps3disk_region *rp = &sc->sc_reg[i]; + d = sc->sc_disk[i] = disk_alloc(); d->d_open = ps3disk_open; d->d_close = ps3disk_close; @@ -293,10 +295,16 @@ ps3disk_attach(device_t dev) mb /= 1024; } - device_printf(dev, "region %d %ju%cB\n", i, mb, unit); + /* Test to see if we can read this region */ + err = lv1_storage_read(ps3bus_get_device(dev), d->d_unit, + 0, 1, rp->r_flags, sc->sc_bounce_lpar, &sc->sc_bounce_tag); + device_printf(dev, "region %d %ju%cB%s\n", i, mb, unit, + (err == 0) ? "" : " (hypervisor protected)"); - disk_create(d, DISK_VERSION); + if (err == 0) + disk_create(d, DISK_VERSION); } + err = 0; bioq_init(&sc->sc_bioq); |