summaryrefslogtreecommitdiffstats
path: root/sys/boot/ia64
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/ia64
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/ia64')
-rw-r--r--sys/boot/ia64/common/devicename.c8
-rw-r--r--sys/boot/ia64/efi/main.c4
-rw-r--r--sys/boot/ia64/ski/devicename.c8
-rw-r--r--sys/boot/ia64/ski/libski.h5
-rw-r--r--sys/boot/ia64/ski/main.c2
5 files changed, 12 insertions, 15 deletions
diff --git a/sys/boot/ia64/common/devicename.c b/sys/boot/ia64/common/devicename.c
index d9f5275..62c943a 100644
--- a/sys/boot/ia64/common/devicename.c
+++ b/sys/boot/ia64/common/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/ia64/efi/main.c b/sys/boot/ia64/efi/main.c
index 8cc0a04..2d11bed 100644
--- a/sys/boot/ia64/efi/main.c
+++ b/sys/boot/ia64/efi/main.c
@@ -135,13 +135,13 @@ main(int argc, CHAR16 *argv[])
i = efifs_get_unit(img->DeviceHandle);
if (i >= 0) {
currdev.d_dev = devsw[0]; /* XXX disk */
- currdev.d_kind.efidisk.unit = i;
+ currdev.d_unit = i;
/* XXX should be able to detect this, default to autoprobe */
currdev.d_kind.efidisk.slice = -1;
currdev.d_kind.efidisk.partition = 0;
} else {
currdev.d_dev = devsw[1]; /* XXX net */
- currdev.d_kind.netif.unit = 0; /* XXX */
+ currdev.d_unit = 0; /* XXX */
}
currdev.d_type = currdev.d_dev->dv_type;
diff --git a/sys/boot/ia64/ski/devicename.c b/sys/boot/ia64/ski/devicename.c
index b01bf18..1a3a75d 100644
--- a/sys/boot/ia64/ski/devicename.c
+++ b/sys/boot/ia64/ski/devicename.c
@@ -143,7 +143,7 @@ ski_parsedev(struct ski_devdesc **dev, const char *devspec, const char **path)
goto fail;
}
- idev->d_kind.skidisk.unit = unit;
+ idev->d_unit = unit;
idev->d_kind.skidisk.slice = slice;
idev->d_kind.skidisk.partition = partition;
@@ -166,7 +166,7 @@ ski_parsedev(struct ski_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;
@@ -204,7 +204,7 @@ ski_fmtdev(void *vdev)
case DEVT_DISK:
cp = buf;
- cp += sprintf(cp, "%s%d", dev->d_dev->dv_name, dev->d_kind.skidisk.unit);
+ cp += sprintf(cp, "%s%d", dev->d_dev->dv_name, dev->d_unit);
if (dev->d_kind.skidisk.slice > 0)
cp += sprintf(cp, "s%d", dev->d_kind.skidisk.slice);
if (dev->d_kind.skidisk.partition >= 0)
@@ -213,7 +213,7 @@ ski_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/ia64/ski/libski.h b/sys/boot/ia64/ski/libski.h
index 6fe8034..595e59a 100644
--- a/sys/boot/ia64/ski/libski.h
+++ b/sys/boot/ia64/ski/libski.h
@@ -35,15 +35,12 @@ struct ski_devdesc {
#define DEVT_NONE 0
#define DEVT_DISK 1
#define DEVT_NET 2
+ int d_unit;
union {
struct {
- int unit;
int slice;
int partition;
} skidisk;
- struct {
- int unit; /* XXX net layer lives over these? */
- } netif;
} d_kind;
};
diff --git a/sys/boot/ia64/ski/main.c b/sys/boot/ia64/ski/main.c
index f27d166..604553c 100644
--- a/sys/boot/ia64/ski/main.c
+++ b/sys/boot/ia64/ski/main.c
@@ -89,7 +89,7 @@ ski_main(void)
/* XXX presumes that biosdisk is first in devsw */
currdev.d_dev = devsw[0];
currdev.d_type = currdev.d_dev->dv_type;
- currdev.d_kind.skidisk.unit = 0;
+ currdev.d_unit = 0;
/* XXX should be able to detect this, default to autoprobe */
currdev.d_kind.skidisk.slice = -1;
/* default to 'a' */
OpenPOWER on IntegriCloud