summaryrefslogtreecommitdiffstats
path: root/sys/boot/ofw
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2012-05-12 20:27:33 +0000
committeravg <avg@FreeBSD.org>2012-05-12 20:27:33 +0000
commit5a967fbfcc6f8df911a59020f191a5953d53c3a3 (patch)
tree9bd0cc8d4dee80f534d8942657f2f4fd2a5a37f0 /sys/boot/ofw
parentee127d5890a3679e20c7cd055ab00cc78d4cb5e8 (diff)
downloadFreeBSD-src-5a967fbfcc6f8df911a59020f191a5953d53c3a3.zip
FreeBSD-src-5a967fbfcc6f8df911a59020f191a5953d53c3a3.tar.gz
sparc64/zfs boot: take advantage of new libzfsboot capabilities
Also drop the now unneeded compatibility shims. Tested by: marius MFC after: 1 month
Diffstat (limited to 'sys/boot/ofw')
-rw-r--r--sys/boot/ofw/libofw/Makefile2
-rw-r--r--sys/boot/ofw/libofw/devicename.c15
-rw-r--r--sys/boot/ofw/libofw/libofw.h8
3 files changed, 16 insertions, 9 deletions
diff --git a/sys/boot/ofw/libofw/Makefile b/sys/boot/ofw/libofw/Makefile
index 945d650..751ebfd 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 c2d9ef1..bbacb84 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 5f6d7ad..87e9095 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);
OpenPOWER on IntegriCloud