summaryrefslogtreecommitdiffstats
path: root/sys/boot/efi
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2006-11-02 01:23:18 +0000
committermarcel <marcel@FreeBSD.org>2006-11-02 01:23:18 +0000
commitdc91b1990af7dcb6d36cfccc9756c830cf400108 (patch)
treef6d4e8e00f43cedf707309d12500b41a38fcaaf0 /sys/boot/efi
parent19b599de4af959c5287bac69d61c3810ae390dfe (diff)
downloadFreeBSD-src-dc91b1990af7dcb6d36cfccc9756c830cf400108.zip
FreeBSD-src-dc91b1990af7dcb6d36cfccc9756c830cf400108.tar.gz
Extend struct devdesc with a unit field, called d_unit. Promote the
device (kind) specific unit field to the common field. This change allows a future version of libefi to work without requiring anything more than what is defined in struct devdesc and as such makes it possible to compile said version of libefi for different platforms without requiring that those platforms have identical derivatives of struct devdesc.
Diffstat (limited to 'sys/boot/efi')
-rw-r--r--sys/boot/efi/libefi/devicename.c8
-rw-r--r--sys/boot/efi/libefi/efiboot.h5
-rw-r--r--sys/boot/efi/libefi/efifs.c2
3 files changed, 6 insertions, 9 deletions
diff --git a/sys/boot/efi/libefi/devicename.c b/sys/boot/efi/libefi/devicename.c
index d9f5275..62c943a 100644
--- a/sys/boot/efi/libefi/devicename.c
+++ b/sys/boot/efi/libefi/devicename.c
@@ -146,7 +146,7 @@ efi_parsedev(struct efi_devdesc **dev, const char *devspec, const char **path)
goto fail;
}
- idev->d_kind.efidisk.unit = unit;
+ idev->d_unit = unit;
idev->d_kind.efidisk.slice = slice;
idev->d_kind.efidisk.partition = partition;
@@ -169,7 +169,7 @@ efi_parsedev(struct efi_devdesc **dev, const char *devspec, const char **path)
goto fail;
}
- idev->d_kind.netif.unit = unit;
+ idev->d_unit = unit;
if (path != NULL)
*path = (*cp == 0) ? cp : cp + 1;
break;
@@ -207,7 +207,7 @@ efi_fmtdev(void *vdev)
case DEVT_DISK:
cp = buf;
- cp += sprintf(cp, "%s%d", dev->d_dev->dv_name, dev->d_kind.efidisk.unit);
+ cp += sprintf(cp, "%s%d", dev->d_dev->dv_name, dev->d_unit);
if (dev->d_kind.efidisk.slice > 0)
cp += sprintf(cp, "s%d", dev->d_kind.efidisk.slice);
if (dev->d_kind.efidisk.partition >= 0)
@@ -216,7 +216,7 @@ efi_fmtdev(void *vdev)
break;
case DEVT_NET:
- sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_kind.netif.unit);
+ sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit);
break;
}
return(buf);
diff --git a/sys/boot/efi/libefi/efiboot.h b/sys/boot/efi/libefi/efiboot.h
index d93213b..74e659a 100644
--- a/sys/boot/efi/libefi/efiboot.h
+++ b/sys/boot/efi/libefi/efiboot.h
@@ -40,16 +40,13 @@ struct efi_devdesc {
#define DEVT_NONE 0
#define DEVT_DISK 1
#define DEVT_NET 2
+ int d_unit;
EFI_HANDLE d_handle;
union {
struct {
- int unit;
int slice;
int partition;
} efidisk;
- struct {
- int unit; /* XXX net layer lives over these? */
- } netif;
} d_kind;
};
diff --git a/sys/boot/efi/libefi/efifs.c b/sys/boot/efi/libefi/efifs.c
index cf89a9d..ce20a6e 100644
--- a/sys/boot/efi/libefi/efifs.c
+++ b/sys/boot/efi/libefi/efifs.c
@@ -365,7 +365,7 @@ efifs_dev_open(struct open_file *f, ...)
dev = va_arg(args, struct efi_devdesc*);
va_end(args);
- unit = dev->d_kind.efidisk.unit;
+ unit = dev->d_unit;
if (unit < 0 || unit >= fs_handle_count) {
printf("attempt to open nonexistent EFI filesystem\n");
return(ENXIO);
OpenPOWER on IntegriCloud