diff options
author | Andriy Gapon <avg@FreeBSD.org> | 2012-05-12 20:27:33 +0000 |
---|---|---|
committer | Andriy Gapon <avg@FreeBSD.org> | 2012-05-12 20:27:33 +0000 |
commit | 32df8664346cc90acfa6882945a526fe2d186278 (patch) | |
tree | 9bd0cc8d4dee80f534d8942657f2f4fd2a5a37f0 /sys/boot/ofw | |
parent | 790752beb420c5f2faf25182fb66268fdf41d0c6 (diff) | |
download | src-32df8664346cc90acfa6882945a526fe2d186278.tar.gz src-32df8664346cc90acfa6882945a526fe2d186278.zip |
sparc64/zfs boot: take advantage of new libzfsboot capabilities
Also drop the now unneeded compatibility shims.
Tested by: marius
MFC after: 1 month
Notes
Notes:
svn path=/head/; revision=235364
Diffstat (limited to 'sys/boot/ofw')
-rw-r--r-- | sys/boot/ofw/libofw/Makefile | 2 | ||||
-rw-r--r-- | sys/boot/ofw/libofw/devicename.c | 15 | ||||
-rw-r--r-- | sys/boot/ofw/libofw/libofw.h | 8 |
3 files changed, 16 insertions, 9 deletions
diff --git a/sys/boot/ofw/libofw/Makefile b/sys/boot/ofw/libofw/Makefile index 945d6508988a..751ebfda75bf 100644 --- a/sys/boot/ofw/libofw/Makefile +++ b/sys/boot/ofw/libofw/Makefile @@ -6,6 +6,8 @@ INTERNALLIB= SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \ ofw_memory.c ofw_module.c ofw_net.c ofw_reboot.c \ ofw_time.c openfirm.c +.PATH: ${.CURDIR}/../../zfs +SRCS+= devicename_stubs.c CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ diff --git a/sys/boot/ofw/libofw/devicename.c b/sys/boot/ofw/libofw/devicename.c index c2d9ef11af1b..bbacb84c454e 100644 --- a/sys/boot/ofw/libofw/devicename.c +++ b/sys/boot/ofw/libofw/devicename.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libofw.h" +#include "../zfs/libzfs.h" static int ofw_parsedev(struct ofw_devdesc **, const char *, const char **); @@ -81,6 +82,7 @@ ofw_parsedev(struct ofw_devdesc **dev, const char *devspec, const char **path) char *ep; char name[256]; char type[64]; + int err; int len; int i; @@ -114,14 +116,11 @@ found: idev->d_dev = dv; idev->d_type = dv->dv_type; if (idev->d_type == DEVT_ZFS) { - idev->d_unit = 0; - p = name + strlen(dv->dv_name); - if (*p && (*p != ':')) { - idev->d_unit = strtol(p, &ep, 0); - if (ep == p) { - free(idev); - return (EUNIT); - } + p = devspec + strlen(dv->dv_name); + err = zfs_parsedev((struct zfs_devdesc *)idev, p, path); + if (err != 0) { + free(idev); + return (err); } } diff --git a/sys/boot/ofw/libofw/libofw.h b/sys/boot/ofw/libofw/libofw.h index 5f6d7ad5e6bd..87e90959c9e6 100644 --- a/sys/boot/ofw/libofw/libofw.h +++ b/sys/boot/ofw/libofw/libofw.h @@ -33,7 +33,13 @@ struct ofw_devdesc { int d_type; int d_unit; ihandle_t d_handle; - char d_path[256]; + union { + char d_path[256]; + struct { + uint64_t pool_guid; + uint64_t root_guid; + }; + }; }; extern int ofw_getdev(void **vdev, const char *devspec, const char **path); |