summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/bootinfo.h
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-04-04 16:35:16 +0000
committerphk <phk@FreeBSD.org>2003-04-04 16:35:16 +0000
commit84d6b36e309c74d75565793688f01807fb1340f6 (patch)
treea6b84bed6839656a8003f724b1f2eec04ec03e0f /sys/i386/include/bootinfo.h
parent4ea6a23f8df49350892e9ec146853181cbce31bb (diff)
downloadFreeBSD-src-84d6b36e309c74d75565793688f01807fb1340f6.zip
FreeBSD-src-84d6b36e309c74d75565793688f01807fb1340f6.tar.gz
Libdisk does not need to include <sys/diskslice.h> any more.
Move the remaining bits of <sys/diskslice.h> to <i386/include/bootinfo.h> Move i386/pc98 specific bits from <sys/reboot.h> to <i386/include/bootinfo.h> as well. Adjust includes in sys/boot accordingly.
Diffstat (limited to 'sys/i386/include/bootinfo.h')
-rw-r--r--sys/i386/include/bootinfo.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/sys/i386/include/bootinfo.h b/sys/i386/include/bootinfo.h
index 620b313..475a09e 100644
--- a/sys/i386/include/bootinfo.h
+++ b/sys/i386/include/bootinfo.h
@@ -71,4 +71,48 @@ struct bootinfo {
extern struct bootinfo bootinfo;
#endif
+/*
+ * Constants for converting boot-style device number to type,
+ * adaptor (uba, mba, etc), unit number and partition number.
+ * Type (== major device number) is in the low byte
+ * for backward compatibility. Except for that of the "magic
+ * number", each mask applies to the shifted value.
+ * Format:
+ * (4) (4) (4) (4) (8) (8)
+ * --------------------------------
+ * |MA | AD| CT| UN| PART | TYPE |
+ * --------------------------------
+ */
+#define B_ADAPTORSHIFT 24
+#define B_ADAPTORMASK 0x0f
+#define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
+#define B_CONTROLLERSHIFT 20
+#define B_CONTROLLERMASK 0xf
+#define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
+#define B_SLICESHIFT 20
+#define B_SLICEMASK 0xff
+#define B_SLICE(val) (((val)>>B_SLICESHIFT) & B_SLICEMASK)
+#define B_UNITSHIFT 16
+#define B_UNITMASK 0xf
+#define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK)
+#define B_PARTITIONSHIFT 8
+#define B_PARTITIONMASK 0xff
+#define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
+#define B_TYPESHIFT 0
+#define B_TYPEMASK 0xff
+#define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)
+
+#define B_MAGICMASK 0xf0000000
+#define B_DEVMAGIC 0xa0000000
+
+#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
+ (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
+ ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
+ ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
+
+#define BASE_SLICE 2
+#define COMPATIBILITY_SLICE 0
+#define MAX_SLICES 32
+#define WHOLE_DISK_SLICE 1
+
#endif /* !_MACHINE_BOOTINFO_H_ */
OpenPOWER on IntegriCloud