summaryrefslogtreecommitdiff
path: root/sys/arch/sparc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-06-20 18:15:48 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-06-20 18:15:48 +0000
commit873db335f698dc92ad5bb1724185b94b78cadc90 (patch)
tree5d88760d74825983a6db073cbf8f2208063bb6cc /sys/arch/sparc
parentfca02c516c82caf63d1f863db7e8b1b418f4cb66 (diff)
b_cylinder does not need to be set on the callpath down into drivers.
cpu_disklabel can go away, since nothing anymore needs to use it; ok miod
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r--sys/arch/sparc/dev/fd.c12
-rw-r--r--sys/arch/sparc/dev/presto.c18
-rw-r--r--sys/arch/sparc/include/disklabel.h6
-rw-r--r--sys/arch/sparc/sparc/disksubr.c13
4 files changed, 17 insertions, 32 deletions
diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c
index c36b5b439fc..a25708f3bfb 100644
--- a/sys/arch/sparc/dev/fd.c
+++ b/sys/arch/sparc/dev/fd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fd.c,v 1.53 2007/06/08 05:27:58 deraadt Exp $ */
+/* $OpenBSD: fd.c,v 1.54 2007/06/20 18:15:47 deraadt Exp $ */
/* $NetBSD: fd.c,v 1.51 1997/05/24 20:16:19 pk Exp $ */
/*-
@@ -1786,14 +1786,12 @@ fdioctl(dev, cmd, addr, flag, p)
return (EBADF);
error = setdisklabel(fd->sc_dk.dk_label,
- (struct disklabel *)addr, 0,
- fd->sc_dk.dk_cpulabel);
+ (struct disklabel *)addr, 0);
if (error)
return (error);
error = writedisklabel(DISKLABELDEV(dev), fdstrategy,
- fd->sc_dk.dk_label,
- fd->sc_dk.dk_cpulabel);
+ fd->sc_dk.dk_label);
return (error);
case DIOCLOCK:
@@ -1952,11 +1950,9 @@ fdgetdisklabel(dev)
int unit = FDUNIT(dev);
struct fd_softc *fd = fd_cd.cd_devs[unit];
struct disklabel *lp = fd->sc_dk.dk_label;
- struct cpu_disklabel *clp = fd->sc_dk.dk_cpulabel;
char *errstring;
bzero(lp, sizeof(struct disklabel));
- bzero(clp, sizeof(struct cpu_disklabel));
lp->d_type = DTYPE_FLOPPY;
lp->d_secsize = FD_BSIZE(fd);
@@ -1979,7 +1975,7 @@ fdgetdisklabel(dev)
/*
* Call the generic disklabel extraction routine.
*/
- errstring = readdisklabel(DISKLABELDEV(dev), fdstrategy, lp, clp, 0);
+ errstring = readdisklabel(DISKLABELDEV(dev), fdstrategy, lp, 0);
if (errstring) {
/*printf("%s: %s\n", fd->sc_dv.dv_xname, errstring);*/
}
diff --git a/sys/arch/sparc/dev/presto.c b/sys/arch/sparc/dev/presto.c
index 65eb065472e..2311511d627 100644
--- a/sys/arch/sparc/dev/presto.c
+++ b/sys/arch/sparc/dev/presto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: presto.c,v 1.12 2007/06/15 02:28:49 todd Exp $ */
+/* $OpenBSD: presto.c,v 1.13 2007/06/20 18:15:47 deraadt Exp $ */
/*
* Copyright (c) 2003, Miodrag Vallat.
* All rights reserved.
@@ -294,8 +294,7 @@ prestostrategy(struct buf *bp)
/* Do not write on "no trespassing" areas... */
part = DISKPART(bp->b_dev);
if (part != RAW_PART &&
- bounds_check_with_label(bp, sc->sc_dk.dk_label,
- sc->sc_dk.dk_cpulabel, 1) <= 0)
+ bounds_check_with_label(bp, sc->sc_dk.dk_label, 1) <= 0)
goto bad;
/* Bound the request size, then move data between buf and nvram */
@@ -341,8 +340,7 @@ prestoioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *proc)
return (EBADF);
error = setdisklabel(sc->sc_dk.dk_label,
- (struct disklabel *)data, /*sd->sc_dk.dk_openmask : */0,
- sc->sc_dk.dk_cpulabel);
+ (struct disklabel *)data, /*sd->sc_dk.dk_openmask : */0);
return (error);
case DIOCWDINFO:
@@ -350,12 +348,10 @@ prestoioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *proc)
return (EBADF);
error = setdisklabel(sc->sc_dk.dk_label,
- (struct disklabel *)data, /*sd->sc_dk.dk_openmask : */0,
- sc->sc_dk.dk_cpulabel);
+ (struct disklabel *)data, /*sd->sc_dk.dk_openmask : */0);
if (error == 0) {
error = writedisklabel(DISKLABELDEV(dev),
- prestostrategy, sc->sc_dk.dk_label,
- sc->sc_dk.dk_cpulabel);
+ prestostrategy, sc->sc_dk.dk_label);
}
return (error);
@@ -372,7 +368,6 @@ presto_getdisklabel(dev_t dev, struct presto_softc *sc)
{
struct disklabel *lp = sc->sc_dk.dk_label;
- bzero(sc->sc_dk.dk_cpulabel, sizeof(struct cpu_disklabel));
bzero(sc->sc_dk.dk_label, sizeof(struct disklabel));
lp->d_secsize = DEV_BSIZE;
@@ -393,6 +388,5 @@ presto_getdisklabel(dev_t dev, struct presto_softc *sc)
lp->d_magic2 = DISKMAGIC;
lp->d_checksum = dkcksum(lp);
- readdisklabel(DISKLABELDEV(dev), prestostrategy, sc->sc_dk.dk_label,
- sc->sc_dk.dk_cpulabel, 0);
+ readdisklabel(DISKLABELDEV(dev), prestostrategy, sc->sc_dk.dk_label, 0);
}
diff --git a/sys/arch/sparc/include/disklabel.h b/sys/arch/sparc/include/disklabel.h
index d7021e04b65..9811c473579 100644
--- a/sys/arch/sparc/include/disklabel.h
+++ b/sys/arch/sparc/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.3 2007/06/17 00:27:28 deraadt Exp $ */
+/* $OpenBSD: disklabel.h,v 1.4 2007/06/20 18:15:45 deraadt Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -37,8 +37,4 @@
#define LABELOFFSET 64 /* offset of label in sector */
#define MAXPARTITIONS 16 /* number of partitions */
-struct cpu_disklabel {
- char cd_block[512];
-};
-
#endif /* _MACHINE_DISKLABEL_H_ */
diff --git a/sys/arch/sparc/sparc/disksubr.c b/sys/arch/sparc/sparc/disksubr.c
index d458a9c1c76..f94ea05b9c5 100644
--- a/sys/arch/sparc/sparc/disksubr.c
+++ b/sys/arch/sparc/sparc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.67 2007/06/18 05:30:54 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.68 2007/06/20 18:15:46 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.16 1996/04/28 20:25:59 thorpej Exp $ */
/*
@@ -68,7 +68,7 @@ extern void cdstrategy(struct buf *);
*/
char *
readdisklabel(dev_t dev, void (*strat)(struct buf *),
- struct disklabel *lp, struct cpu_disklabel *osdep, int spoofonly)
+ struct disklabel *lp, int spoofonly)
{
struct sun_disklabel *slp;
struct buf *bp = NULL;
@@ -104,7 +104,6 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
goto doslabel;
bp->b_blkno = LABELSECTOR;
- bp->b_cylinder = 0;
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_BUSY | B_READ;
(*strat)(bp);
@@ -113,8 +112,10 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
goto done;
}
+#if NOTANYMORE
/* XXX because xd(4) & xy(4) still need it */
bcopy(bp->b_data, osdep->cd_block, sizeof(osdep->cd_block));
+#endif
slp = (struct sun_disklabel *)bp->b_data;
if (slp->sl_magic == SUN_DKMAGIC) {
@@ -127,7 +128,7 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
goto done;
doslabel:
- msg = readdoslabel(bp, strat, lp, osdep, NULL, NULL, spoofonly);
+ msg = readdoslabel(bp, strat, lp, NULL, spoofonly);
if (msg == NULL)
goto done;
@@ -157,8 +158,7 @@ done:
* Write disk label back to device after modification.
*/
int
-writedisklabel(dev_t dev, void (*strat)(struct buf *),
- struct disklabel *lp, struct cpu_disklabel *osdep)
+writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp)
{
struct buf *bp = NULL;
int error;
@@ -173,7 +173,6 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *),
/* Write out the updated label. */
bp->b_blkno = LABELSECTOR;
- bp->b_cylinder = 0;
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_BUSY | B_WRITE;
(*strat)(bp);