changeset 18848:a4ba2e055c1d

loader: remove devdesc comments and assertions illumos issue #9583
author Toomas Soome <tsoome@me.com>
date Wed, 06 Jun 2018 15:34:48 +0300
parents bb3a0d1d2b0e
children 0213e821a0cd
files usr/src/boot/sys/boot/common/disk.h usr/src/boot/sys/boot/i386/libi386/biosdisk.c usr/src/boot/sys/boot/i386/libi386/libi386.h usr/src/boot/sys/boot/uboot/lib/libuboot.h usr/src/boot/sys/boot/userboot/userboot/main.c usr/src/boot/sys/boot/zfs/libzfs.h
diffstat 6 files changed, 24 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/boot/sys/boot/common/disk.h	Thu Jun 14 10:11:47 2018 +0300
+++ b/usr/src/boot/sys/boot/common/disk.h	Wed Jun 06 15:34:48 2018 +0300
@@ -1,4 +1,4 @@
-/*-
+/*
  * Copyright (c) 2011 Google, Inc.
  * All rights reserved.
  *
@@ -30,44 +30,44 @@
  *
  * Whole disk access:
  *
- * 	d_slice = -1
- * 	d_partition = -1
+ *	d_slice = -1
+ *	d_partition = -1
  *
  * Whole MBR slice:
  *
- * 	d_slice = MBR slice number (typically 1..4)
- * 	d_partition = -1
+ *	d_slice = MBR slice number (typically 1..4)
+ *	d_partition = -1
  *
  * VTOC disklabel partition within an MBR slice:
  *
- * 	d_slice = MBR slice number (typically 1..4)
- * 	d_partition = disklabel partition (typically 0..19)
+ *	d_slice = MBR slice number (typically 1..4)
+ *	d_partition = disklabel partition (typically 0..19)
  *
  * BSD disklabel partition within an MBR slice:
  *
- * 	d_slice = MBR slice number (typically 1..4)
- * 	d_partition = disklabel partition (typically 0..19)
+ *	d_slice = MBR slice number (typically 1..4)
+ *	d_partition = disklabel partition (typically 0..19)
  *
  * BSD disklabel partition on the true dedicated disk:
  *
- * 	d_slice = -1
- * 	d_partition = disklabel partition (typically 0..19)
+ *	d_slice = -1
+ *	d_partition = disklabel partition (typically 0..19)
  *
  * GPT partition:
  *
- * 	d_slice = GPT partition number (typically 1..N)
- * 	d_partition = 255
+ *	d_slice = GPT partition number (typically 1..N)
+ *	d_partition = 255
  *
  * For both MBR and GPT, to automatically find the 'best' slice or partition,
  * set d_slice to zero. This uses the partition type to decide which partition
  * to use according to the following list of preferences:
  *
- * 	Solaris2 (active)
- * 	Solaris2 (inactive)
- * 	Linux (active)
- * 	Linux (inactive)
- * 	DOS/Windows (active)
- * 	DOS/Windows (inactive)
+ *	Solaris2 (active)
+ *	Solaris2 (inactive)
+ *	Linux (active)
+ *	Linux (inactive)
+ *	DOS/Windows (active)
+ *	DOS/Windows (inactive)
  *
  * Active MBR slices (marked as bootable) are preferred over inactive. GPT
  * doesn't have the concept of active/inactive partitions. In both MBR and GPT,
@@ -84,9 +84,8 @@
 #ifndef	_DISK_H
 #define	_DISK_H
 
-/* Note: Must match the 'struct devdesc' in stand.h */
 struct disk_devdesc {
-	struct devdesc	dd;
+	struct devdesc	dd;		/* Must be first. */
 	int		d_slice;
 	int		d_partition;
 	uint64_t	d_offset;
--- a/usr/src/boot/sys/boot/i386/libi386/biosdisk.c	Thu Jun 14 10:11:47 2018 +0300
+++ b/usr/src/boot/sys/boot/i386/libi386/biosdisk.c	Wed Jun 06 15:34:48 2018 +0300
@@ -49,8 +49,6 @@
 #include "disk.h"
 #include "libi386.h"
 
-CTASSERT(sizeof (struct i386_devdesc) >= sizeof (struct disk_devdesc));
-
 #define	BIOS_NUMDRIVES		0x475
 #define	BIOSDISK_SECSIZE	512
 #define	BUFSIZE			(1 * BIOSDISK_SECSIZE)
--- a/usr/src/boot/sys/boot/i386/libi386/libi386.h	Thu Jun 14 10:11:47 2018 +0300
+++ b/usr/src/boot/sys/boot/i386/libi386/libi386.h	Wed Jun 06 15:34:48 2018 +0300
@@ -30,11 +30,9 @@
 
 /*
  * i386 fully-qualified device descriptor.
- * Note, this must match struct zfs_devdesc for zfs support.
  */
-/* Note: Must match the 'struct devdesc' in stand.h */
 struct i386_devdesc {
-    struct devdesc	dd;
+    struct devdesc	dd;	/* Must be first. */
     union {
 	struct {
 	    int		slice;
--- a/usr/src/boot/sys/boot/uboot/lib/libuboot.h	Thu Jun 14 10:11:47 2018 +0300
+++ b/usr/src/boot/sys/boot/uboot/lib/libuboot.h	Wed Jun 06 15:34:48 2018 +0300
@@ -23,13 +23,10 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD$
  */
 
-/* Note: Must match the 'struct devdesc' in stand.h */
 struct uboot_devdesc {
-	struct devdesc	dd;
+	struct devdesc	dd;	/* Must be first. */
 	union {
 		struct {
 			int	slice;
--- a/usr/src/boot/sys/boot/userboot/userboot/main.c	Thu Jun 14 10:11:47 2018 +0300
+++ b/usr/src/boot/sys/boot/userboot/userboot/main.c	Wed Jun 06 15:34:48 2018 +0300
@@ -152,7 +152,6 @@
 	//bzero(&dev, sizeof(dev));
 
 #if defined(USERBOOT_ZFS_SUPPORT)
-	CTASSERT(sizeof(struct disk_devdesc) >= sizeof(struct zfs_devdesc));
 	if (userboot_zfs_found) {
 		struct zfs_devdesc zdev;
 
--- a/usr/src/boot/sys/boot/zfs/libzfs.h	Thu Jun 14 10:11:47 2018 +0300
+++ b/usr/src/boot/sys/boot/zfs/libzfs.h	Wed Jun 06 15:34:48 2018 +0300
@@ -1,4 +1,4 @@
-/*-
+/*
  * Copyright (c) 2012 Andriy Gapon <avg@FreeBSD.org>
  * All rights reserved.
  *
@@ -22,8 +22,6 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD$
  */
 
 #ifndef _BOOT_LIBZFS_H_
@@ -33,12 +31,9 @@
 
 /*
  * ZFS fully-qualified device descriptor.
- * Arch-specific device descriptors should be binary compatible with this
- * structure if they are to support ZFS.
  */
-/* Note: Must match the 'struct devdesc' in stand.h */
 struct zfs_devdesc {
-    struct devdesc	dd;
+    struct devdesc	dd;		/* Must be first. */
     uint64_t		pool_guid;
     uint64_t		root_guid;
 };