summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/sys_generic.c14
-rw-r--r--sys/sys/disklabel.h37
-rw-r--r--sys/sys/diskmbr.h37
-rw-r--r--sys/sys/diskpc98.h37
4 files changed, 71 insertions, 54 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index 77cb46d..196be5a 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -62,6 +62,9 @@
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/condvar.h>
+#ifdef __alpha__
+#include <sys/disklabel.h>
+#endif
#ifdef KTRACE
#include <sys/ktrace.h>
#endif
@@ -648,6 +651,17 @@ ioctl(td, uap)
*(caddr_t *)data = uap->data;
}
+#ifdef __alpha__
+ if (com == DIOCGDINFO_ALPHAHACK)
+ com = DIOCGDINFO;
+ if (com == DIOCSDINFO_ALPHAHACK)
+ com = DIOCSDINFO;
+ if (com == DIOCWDINFO_ALPHAHACK)
+ com = DIOCWDINFO;
+ if (com == DIOCGDVIRGIN_ALPHAHACK)
+ com = DIOCGDVIRGIN;
+#endif
+
switch (com) {
case FIONBIO:
diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h
index d709eed..6a52669 100644
--- a/sys/sys/disklabel.h
+++ b/sys/sys/disklabel.h
@@ -98,24 +98,7 @@ struct disklabel {
u_int16_t d_subtype; /* controller/d_type specific */
char d_typename[16]; /* type name, e.g. "eagle" */
- /*
- * d_packname contains the pack identifier and is returned when
- * the disklabel is read off the disk or in-core copy.
- * d_boot0 and d_boot1 are the (optional) names of the
- * primary (block 0) and secondary (block 1-15) bootstraps
- * as found in /boot. These are returned when using
- * getdiskbyname(3) to retrieve the values from /etc/disktab.
- */
- union {
- char un_d_packname[16]; /* pack identifier */
- struct {
- char *un_d_boot0; /* primary bootstrap name */
- char *un_d_boot1; /* secondary bootstrap name */
- } un_b;
- } d_un;
-#define d_packname d_un.un_d_packname
-#define d_boot0 d_un.un_b.un_d_boot0
-#define d_boot1 d_un.un_b.un_d_boot1
+ char d_packname[16]; /* pack identifier */
/* disk geometry: */
u_int32_t d_secsize; /* # of bytes per sector */
@@ -184,6 +167,10 @@ struct disklabel {
} d_partitions[MAXPARTITIONS]; /* actually may be more */
};
+#ifdef CTASSERT
+CTASSERT(sizeof(struct disklabel) == 276);
+#endif
+
static __inline u_int16_t dkcksum(struct disklabel *lp);
static __inline u_int16_t
dkcksum(lp)
@@ -374,6 +361,20 @@ CTASSERT(sizeof (struct dos_partition) == 16);
#define DIOCGFWCYLINDERS _IOR('d', 132, u_int) /* Get firmware cyl'scount */
#define DIOCGKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */
+#ifdef __alpha__
+struct disklabel_alphahack {
+ struct disklabel dl;
+ char pad[4];
+};
+#define DIOCGDINFO_ALPHAHACK _IOR('d', 101, struct disklabel_alphahack)/* get */
+#define DIOCSDINFO_ALPHAHACK _IOW('d', 102, struct disklabel_alphahack)/* set */
+#define DIOCWDINFO_ALPHAHACK _IOW('d', 103, struct disklabel_alphahack)/* set, update disk */
+#define DIOCGDVIRGIN_ALPHAHACK _IOR('d', 105, struct disklabel_alphahack)/* get virgin label */
+#ifdef CTASSERT
+CTASSERT(sizeof(struct disklabel_alphahack) == 280);
+#endif
+#endif
+
#ifdef _KERNEL
/*
diff --git a/sys/sys/diskmbr.h b/sys/sys/diskmbr.h
index d709eed..6a52669 100644
--- a/sys/sys/diskmbr.h
+++ b/sys/sys/diskmbr.h
@@ -98,24 +98,7 @@ struct disklabel {
u_int16_t d_subtype; /* controller/d_type specific */
char d_typename[16]; /* type name, e.g. "eagle" */
- /*
- * d_packname contains the pack identifier and is returned when
- * the disklabel is read off the disk or in-core copy.
- * d_boot0 and d_boot1 are the (optional) names of the
- * primary (block 0) and secondary (block 1-15) bootstraps
- * as found in /boot. These are returned when using
- * getdiskbyname(3) to retrieve the values from /etc/disktab.
- */
- union {
- char un_d_packname[16]; /* pack identifier */
- struct {
- char *un_d_boot0; /* primary bootstrap name */
- char *un_d_boot1; /* secondary bootstrap name */
- } un_b;
- } d_un;
-#define d_packname d_un.un_d_packname
-#define d_boot0 d_un.un_b.un_d_boot0
-#define d_boot1 d_un.un_b.un_d_boot1
+ char d_packname[16]; /* pack identifier */
/* disk geometry: */
u_int32_t d_secsize; /* # of bytes per sector */
@@ -184,6 +167,10 @@ struct disklabel {
} d_partitions[MAXPARTITIONS]; /* actually may be more */
};
+#ifdef CTASSERT
+CTASSERT(sizeof(struct disklabel) == 276);
+#endif
+
static __inline u_int16_t dkcksum(struct disklabel *lp);
static __inline u_int16_t
dkcksum(lp)
@@ -374,6 +361,20 @@ CTASSERT(sizeof (struct dos_partition) == 16);
#define DIOCGFWCYLINDERS _IOR('d', 132, u_int) /* Get firmware cyl'scount */
#define DIOCGKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */
+#ifdef __alpha__
+struct disklabel_alphahack {
+ struct disklabel dl;
+ char pad[4];
+};
+#define DIOCGDINFO_ALPHAHACK _IOR('d', 101, struct disklabel_alphahack)/* get */
+#define DIOCSDINFO_ALPHAHACK _IOW('d', 102, struct disklabel_alphahack)/* set */
+#define DIOCWDINFO_ALPHAHACK _IOW('d', 103, struct disklabel_alphahack)/* set, update disk */
+#define DIOCGDVIRGIN_ALPHAHACK _IOR('d', 105, struct disklabel_alphahack)/* get virgin label */
+#ifdef CTASSERT
+CTASSERT(sizeof(struct disklabel_alphahack) == 280);
+#endif
+#endif
+
#ifdef _KERNEL
/*
diff --git a/sys/sys/diskpc98.h b/sys/sys/diskpc98.h
index d709eed..6a52669 100644
--- a/sys/sys/diskpc98.h
+++ b/sys/sys/diskpc98.h
@@ -98,24 +98,7 @@ struct disklabel {
u_int16_t d_subtype; /* controller/d_type specific */
char d_typename[16]; /* type name, e.g. "eagle" */
- /*
- * d_packname contains the pack identifier and is returned when
- * the disklabel is read off the disk or in-core copy.
- * d_boot0 and d_boot1 are the (optional) names of the
- * primary (block 0) and secondary (block 1-15) bootstraps
- * as found in /boot. These are returned when using
- * getdiskbyname(3) to retrieve the values from /etc/disktab.
- */
- union {
- char un_d_packname[16]; /* pack identifier */
- struct {
- char *un_d_boot0; /* primary bootstrap name */
- char *un_d_boot1; /* secondary bootstrap name */
- } un_b;
- } d_un;
-#define d_packname d_un.un_d_packname
-#define d_boot0 d_un.un_b.un_d_boot0
-#define d_boot1 d_un.un_b.un_d_boot1
+ char d_packname[16]; /* pack identifier */
/* disk geometry: */
u_int32_t d_secsize; /* # of bytes per sector */
@@ -184,6 +167,10 @@ struct disklabel {
} d_partitions[MAXPARTITIONS]; /* actually may be more */
};
+#ifdef CTASSERT
+CTASSERT(sizeof(struct disklabel) == 276);
+#endif
+
static __inline u_int16_t dkcksum(struct disklabel *lp);
static __inline u_int16_t
dkcksum(lp)
@@ -374,6 +361,20 @@ CTASSERT(sizeof (struct dos_partition) == 16);
#define DIOCGFWCYLINDERS _IOR('d', 132, u_int) /* Get firmware cyl'scount */
#define DIOCGKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */
+#ifdef __alpha__
+struct disklabel_alphahack {
+ struct disklabel dl;
+ char pad[4];
+};
+#define DIOCGDINFO_ALPHAHACK _IOR('d', 101, struct disklabel_alphahack)/* get */
+#define DIOCSDINFO_ALPHAHACK _IOW('d', 102, struct disklabel_alphahack)/* set */
+#define DIOCWDINFO_ALPHAHACK _IOW('d', 103, struct disklabel_alphahack)/* set, update disk */
+#define DIOCGDVIRGIN_ALPHAHACK _IOR('d', 105, struct disklabel_alphahack)/* get virgin label */
+#ifdef CTASSERT
+CTASSERT(sizeof(struct disklabel_alphahack) == 280);
+#endif
+#endif
+
#ifdef _KERNEL
/*
OpenPOWER on IntegriCloud