summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-01-20 00:20:39 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-01-20 00:20:39 +0000
commit4a3b1b8a35be0db2915acc346b4a73527b9a2287 (patch)
treec8a6f17861cb769a7690286f8d259672cff2c657 /sys
parent39761e74371aa5f4493460919c8ac3a1c8b63586 (diff)
Use <dev/sun/disklabel.h> instead of similar <machine/sun_disklabel.h> on
sparc and remove unused sun_dkioctl(). No functional change.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc/dev/xd.c4
-rw-r--r--sys/arch/sparc/dev/xy.c4
-rw-r--r--sys/arch/sparc/include/sun_disklabel.h118
-rw-r--r--sys/arch/sparc/sparc/disksubr.c54
4 files changed, 6 insertions, 174 deletions
diff --git a/sys/arch/sparc/dev/xd.c b/sys/arch/sparc/dev/xd.c
index 426bb623fbf..550e3877ebb 100644
--- a/sys/arch/sparc/dev/xd.c
+++ b/sys/arch/sparc/dev/xd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xd.c,v 1.29 2004/09/29 07:35:11 miod Exp $ */
+/* $OpenBSD: xd.c,v 1.30 2006/01/20 00:20:38 miod Exp $ */
/* $NetBSD: xd.c,v 1.37 1997/07/29 09:58:16 fair Exp $ */
/*
@@ -79,7 +79,7 @@
#include <uvm/uvm_extern.h>
#include <machine/autoconf.h>
-#include <machine/sun_disklabel.h>
+#include <dev/sun/disklabel.h>
#include <machine/conf.h>
#include <sparc/dev/xdreg.h>
diff --git a/sys/arch/sparc/dev/xy.c b/sys/arch/sparc/dev/xy.c
index 46791981c0e..824998a4132 100644
--- a/sys/arch/sparc/dev/xy.c
+++ b/sys/arch/sparc/dev/xy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xy.c,v 1.25 2004/09/29 07:35:11 miod Exp $ */
+/* $OpenBSD: xy.c,v 1.26 2006/01/20 00:20:38 miod Exp $ */
/* $NetBSD: xy.c,v 1.26 1997/07/19 21:43:56 pk Exp $ */
/*
@@ -79,7 +79,7 @@
#include <uvm/uvm_extern.h>
#include <machine/autoconf.h>
-#include <machine/sun_disklabel.h>
+#include <dev/sun/disklabel.h>
#include <machine/conf.h>
#include <sparc/dev/xyreg.h>
diff --git a/sys/arch/sparc/include/sun_disklabel.h b/sys/arch/sparc/include/sun_disklabel.h
deleted file mode 100644
index f18705d9cf6..00000000000
--- a/sys/arch/sparc/include/sun_disklabel.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* $OpenBSD: sun_disklabel.h,v 1.9 2003/06/02 23:27:54 millert Exp $ */
-/* $NetBSD: sun_disklabel.h,v 1.6 1996/01/07 22:03:09 thorpej Exp $ */
-
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Lawrence Berkeley Laboratory.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * 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.
- *
- * @(#)sun_disklabel.h 8.1 (Berkeley) 6/11/93
- */
-
-/*
- * SunOS disk label layout (only relevant portions discovered here).
- */
-
-#define SUN_DKMAGIC 55998
-
-/* These are the guys that Sun's dkinfo needs... */
-#define DKIOCGGEOM _IOR('d', 2, struct sun_dkgeom) /* geometry info */
-#define DKIOCINFO _IOR('d', 8, struct sun_dkctlr) /* controller info */
-#define DKIOCGPART _IOR('d', 4, struct sun_dkpart) /* partition info */
-
-/* geometry info */
-struct sun_dkgeom {
- u_short sdkc_ncylinders; /* data cylinders */
- u_short sdkc_acylinders; /* alternate cylinders */
- u_short sdkc_xxx1;
- u_short sdkc_ntracks; /* tracks per cylinder */
- u_short sdkc_xxx2;
- u_short sdkc_nsectors; /* sectors per track */
- u_short sdkc_interleave; /* interleave factor */
- u_short sdkc_xxx3;
- u_short sdkc_xxx4;
- u_short sdkc_sparespercyl; /* spare sectors per cylinder */
- u_short sdkc_rpm; /* rotational speed */
- u_short sdkc_pcylinders; /* physical cylinders */
- u_short sdkc_xxx5[7];
-};
-
-/* controller info */
-struct sun_dkctlr {
- int sdkc_addr; /* controller address */
- short sdkc_unit; /* unit (slave) address */
- short sdkc_type; /* controller type */
- short sdkc_flags; /* flags */
-};
-
-/* partition info */
-struct sun_dkpart {
- long sdkp_cyloffset; /* starting cylinder */
- long sdkp_nsectors; /* number of sectors */
-};
-
-#define SUNXPART 8
-#define SL_XPMAG (0x199d1fe2+SUNXPART)
-
-struct sun_disklabel { /* total size = 512 bytes */
- char sl_text[128];
- u_long sl_xpsum; /* additive cksum, [sl_xpmag,sl_xxx1) */
- u_long sl_xpmag; /* "extended" magic number */
- struct sun_dkpart sl_xpart[SUNXPART]; /* "extended" partitions, i through p */
- char sl_xxx1[292-8-(8*SUNXPART)]; /* [292] including sl_x* */
- u_short sl_rpm; /* rotational speed */
- u_short sl_pcylinders; /* number of physical cyls */
- u_short sl_sparespercyl; /* spare sectors per cylinder */
- char sl_xxx3[4];
- u_short sl_interleave; /* interleave factor */
- u_short sl_ncylinders; /* data cylinders */
- u_short sl_acylinders; /* alternate cylinders */
- u_short sl_ntracks; /* tracks per cylinder */
- u_short sl_nsectors; /* sectors per track */
- char sl_xxx4[4];
- struct sun_dkpart sl_part[8]; /* partition layout */
- u_short sl_magic; /* == SUN_DKMAGIC */
- u_short sl_cksum; /* xor checksum of all shorts */
-};
-
-#define SUN_LABELOFFSET 128
-
-#ifdef _KERNEL
-/* reads sun label in sector at [cp..cp+511] and sets *lp to BSD label */
-int sun_disklabel(caddr_t, struct disklabel *); /* true on success */
-
-/* compatibility dk ioctl's */
-int sun_dkioctl(struct disk *, u_long, caddr_t, int);
-#endif
diff --git a/sys/arch/sparc/sparc/disksubr.c b/sys/arch/sparc/sparc/disksubr.c
index 4d8cc373e1d..b46931f57d2 100644
--- a/sys/arch/sparc/sparc/disksubr.c
+++ b/sys/arch/sparc/sparc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.33 2005/12/22 02:51:25 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.34 2006/01/20 00:20:38 miod Exp $ */
/* $NetBSD: disksubr.c,v 1.16 1996/04/28 20:25:59 thorpej Exp $ */
/*
@@ -36,17 +36,13 @@
#include <sys/disk.h>
#include <sys/dkbad.h>
-#include <scsi/scsi_all.h>
-#include <scsi/scsiconf.h>
-
#include <machine/cpu.h>
#include <machine/autoconf.h>
-#include <machine/sun_disklabel.h>
+#include <dev/sun/disklabel.h>
#if defined(SUN4)
#include <machine/oldmon.h>
#endif
-#include <sparc/dev/sbusvar.h>
#include "cd.h"
#if MAXPARTITIONS != 16
@@ -625,52 +621,6 @@ disklabel_bsd_to_sun(lp, cp)
return (0);
}
-/* move this to compat/sunos */
-int
-sun_dkioctl(dk, cmd, data, partition)
- struct disk *dk;
- u_long cmd;
- caddr_t data;
- int partition;
-{
- register struct partition *p;
-
- switch (cmd) {
- case DKIOCGGEOM:
-#define geom ((struct sun_dkgeom *)data)
- bzero(data, sizeof(*geom));
- geom->sdkc_ncylinders = dk->dk_label->d_ncylinders;
- geom->sdkc_acylinders = dk->dk_label->d_acylinders;
- geom->sdkc_ntracks = dk->dk_label->d_ntracks;
- geom->sdkc_nsectors = dk->dk_label->d_nsectors;
- geom->sdkc_interleave = dk->dk_label->d_interleave;
- geom->sdkc_sparespercyl = dk->dk_label->d_sparespercyl;
- geom->sdkc_rpm = dk->dk_label->d_rpm;
- geom->sdkc_pcylinders =
- dk->dk_label->d_ncylinders + dk->dk_label->d_acylinders;
-#undef geom
- break;
- case DKIOCINFO:
- /* Homey don't do DKIOCINFO */
- bzero(data, sizeof(struct sun_dkctlr));
- break;
- case DKIOCGPART:
- if (dk->dk_label->d_secpercyl == 0)
- return (ERANGE); /* XXX */
- p = &dk->dk_label->d_partitions[partition];
- if (p->p_offset % dk->dk_label->d_secpercyl != 0)
- return (ERANGE); /* XXX */
-#define part ((struct sun_dkpart *)data)
- part->sdkp_cyloffset = p->p_offset / dk->dk_label->d_secpercyl;
- part->sdkp_nsectors = p->p_size;
-#undef part
- break;
- default:
- return (-1);
- }
- return (0);
-}
-
/*
* Search the bad sector table looking for the specified sector.
* Return index if found.