Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys/arch/i386/include Pull up revision 1.9 (requested b...
details: https://anonhg.NetBSD.org/src/rev/4155b8535d24
branches: netbsd-1-5
changeset: 491523:4155b8535d24
user: he <he%NetBSD.org@localhost>
date: Tue May 01 12:26:52 2001 +0000
description:
Pull up revision 1.9 (requested by fvdl):
Increase the number of BSD disklabel partitions on i386 to 16.
diffstat:
sys/arch/i386/include/disklabel.h | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
diffs (38 lines):
diff -r 167e4303573c -r 4155b8535d24 sys/arch/i386/include/disklabel.h
--- a/sys/arch/i386/include/disklabel.h Tue May 01 12:26:48 2001 +0000
+++ b/sys/arch/i386/include/disklabel.h Tue May 01 12:26:52 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disklabel.h,v 1.8 1999/01/27 20:54:57 thorpej Exp $ */
+/* $NetBSD: disklabel.h,v 1.8.20.1 2001/05/01 12:26:52 he Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -33,10 +33,24 @@
#ifndef _MACHINE_DISKLABEL_H_
#define _MACHINE_DISKLABEL_H_
-#define LABELSECTOR 1 /* sector containing label */
-#define LABELOFFSET 0 /* offset of label in sector */
-#define MAXPARTITIONS 8 /* number of partitions */
-#define RAW_PART 3 /* raw partition: XX?d (XXX) */
+#define LABELSECTOR 1 /* sector containing label */
+#define LABELOFFSET 0 /* offset of label in sector */
+#define MAXPARTITIONS 16 /* number of partitions */
+#define OLDMAXPARTITIONS 8 /* number of partitions before 1.6 */
+#define RAW_PART 3 /* raw partition: XX?d (XXX) */
+
+/*
+ * We use the highest bit of the minor number for the partition number.
+ * This maintains backward compatibility with device nodes created before
+ * MAXPARTITIONS was increased.
+ */
+#define __I386_MAXDISKS ((1 << 20) / MAXPARTITIONS)
+#define DISKUNIT(dev) ((minor(dev) / OLDMAXPARTITIONS) % __I386_MAXDISKS)
+#define DISKPART(dev) ((minor(dev) % OLDMAXPARTITIONS) + \
+ ((minor(dev) / (__I386_MAXDISKS * OLDMAXPARTITIONS)) * OLDMAXPARTITIONS))
+#define DISKMINOR(unit, part) \
+ (((unit) * OLDMAXPARTITIONS) + ((part) % OLDMAXPARTITIONS) + \
+ ((part) / OLDMAXPARTITIONS) * (__I386_MAXDISKS * OLDMAXPARTITIONS))
/* Pull in MBR partition definitions. */
#include <sys/disklabel_mbr.h>
Home |
Main Index |
Thread Index |
Old Index