summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amiga/amiga/disksubr.c5
-rw-r--r--sys/arch/amiga/dev/fd.c5
-rw-r--r--sys/arch/arc/arc/disksubr.c7
-rw-r--r--sys/arch/arc/include/disklabel.h9
-rw-r--r--sys/arch/arm32/arm32/disksubr.c3
-rw-r--r--sys/arch/arm32/include/disklabel.h7
-rw-r--r--sys/arch/arm32/mainbus/wd.c3
-rw-r--r--sys/arch/atari/atari/disksubr.c9
-rw-r--r--sys/arch/atari/dev/fd.c2
-rw-r--r--sys/arch/hp300/hp300/disksubr.c5
-rw-r--r--sys/arch/hp300/include/disklabel.h7
-rw-r--r--sys/arch/i386/i386/disksubr.c7
-rw-r--r--sys/arch/i386/include/disklabel.h9
-rw-r--r--sys/arch/mac68k/mac68k/disksubr.c5
-rw-r--r--sys/arch/mvme68k/mvme68k/disksubr.c5
-rw-r--r--sys/arch/mvme88k/mvme88k/disksubr.c3
-rw-r--r--sys/arch/pc532/pc532/disksubr.c6
-rw-r--r--sys/arch/pmax/pmax/disksubr.c3
-rw-r--r--sys/arch/powerpc/include/disklabel.h7
-rw-r--r--sys/arch/powerpc/powerpc/disksubr.c5
-rw-r--r--sys/arch/sparc/dev/xd.c4
-rw-r--r--sys/arch/sparc/dev/xy.c4
-rw-r--r--sys/arch/sparc/sparc/disksubr.c5
-rw-r--r--sys/arch/sun3/dev/xd.c4
-rw-r--r--sys/arch/sun3/dev/xy.c4
-rw-r--r--sys/arch/sun3/sun3/disksubr.c8
-rw-r--r--sys/arch/vax/mba/hp.c6
-rw-r--r--sys/arch/vax/mscp/mscp_disk.c4
-rw-r--r--sys/arch/vax/vax/disksubr.c5
-rw-r--r--sys/arch/wgrisc/include/disklabel.h9
-rw-r--r--sys/arch/wgrisc/wgrisc/disksubr.c7
31 files changed, 87 insertions, 85 deletions
diff --git a/sys/arch/amiga/amiga/disksubr.c b/sys/arch/amiga/amiga/disksubr.c
index 80739dc94bf..261b41ee638 100644
--- a/sys/arch/amiga/amiga/disksubr.c
+++ b/sys/arch/amiga/amiga/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.13 1997/05/29 01:18:18 niklas Exp $ */
+/* $OpenBSD: disksubr.c,v 1.14 1997/08/08 21:46:34 niklas Exp $ */
/* $NetBSD: disksubr.c,v 1.27 1996/10/13 03:06:34 christos Exp $ */
/*
@@ -502,9 +502,10 @@ writedisklabel(dev, strat, lp, clp)
}
int
-bounds_check_with_label(bp, lp, wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
struct buf *bp;
struct disklabel *lp;
+ struct cpu_disklabel *osdep;
int wlabel;
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
diff --git a/sys/arch/amiga/dev/fd.c b/sys/arch/amiga/dev/fd.c
index 46f0d15589f..5f8088057ec 100644
--- a/sys/arch/amiga/dev/fd.c
+++ b/sys/arch/amiga/dev/fd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fd.c,v 1.11 1997/01/16 09:24:03 niklas Exp $ */
+/* $OpenBSD: fd.c,v 1.12 1997/08/08 21:46:35 niklas Exp $ */
/* $NetBSD: fd.c,v 1.36 1996/12/23 09:09:59 veego Exp $ */
/*
@@ -705,7 +705,8 @@ fdstrategy(bp)
bp->b_error = EIO;
goto bad;
}
- if (bounds_check_with_label(bp, lp, sc->wlabel) <= 0)
+ if (bounds_check_with_label(bp, lp, sc->dkdev.dk_cpulabel, sc->wlabel)
+ <= 0)
goto done;
/*
diff --git a/sys/arch/arc/arc/disksubr.c b/sys/arch/arc/arc/disksubr.c
index d63fba7ae2c..b85a15e73a1 100644
--- a/sys/arch/arc/arc/disksubr.c
+++ b/sys/arch/arc/arc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.14 1997/05/08 00:14:29 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.15 1997/08/08 21:46:36 niklas Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -84,7 +84,7 @@ readdisklabel(dev, strat, lp, osdep)
struct cpu_disklabel *osdep;
{
struct dos_partition *dp = osdep->dosparts, *dp2;
- struct dkbad *bdp = &osdep->bad;
+ struct dkbad *bdp = &DKBAD(osdep);
struct buf *bp;
struct disklabel *dlp;
char *msg = NULL, *cp;
@@ -462,9 +462,10 @@ done:
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(bp, lp, wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
struct buf *bp;
struct disklabel *lp;
+ struct cpu_disklabel *osdep;
int wlabel;
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
diff --git a/sys/arch/arc/include/disklabel.h b/sys/arch/arc/include/disklabel.h
index 4e8c7c14161..5e46f7005b9 100644
--- a/sys/arch/arc/include/disklabel.h
+++ b/sys/arch/arc/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.6 1997/04/10 13:06:25 deraadt Exp $ */
+/* $OpenBSD: disklabel.h,v 1.7 1997/08/08 21:46:37 niklas Exp $ */
/* $NetBSD: disklabel.h,v 1.3 1996/03/09 20:52:54 ghudson Exp $ */
/*
@@ -76,13 +76,10 @@ struct cpu_disklabel {
struct dkbad bad;
};
+#define DKBAD(x) ((x)->bad)
+
/* Isolate the relevant bits to get sector and cylinder. */
#define DPSECT(s) ((s) & 0x3f)
#define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2))
-#ifdef _KERNEL
-struct disklabel;
-int bounds_check_with_label __P((struct buf *, struct disklabel *, int));
-#endif
-
#endif /* _MACHINE_DISKLABEL_H_ */
diff --git a/sys/arch/arm32/arm32/disksubr.c b/sys/arch/arm32/arm32/disksubr.c
index d35dd1d69c5..ff8c676993e 100644
--- a/sys/arch/arm32/arm32/disksubr.c
+++ b/sys/arch/arm32/arm32/disksubr.c
@@ -512,9 +512,10 @@ done:
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(bp, lp, wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
struct buf *bp;
struct disklabel *lp;
+ struct cpu_disklabel *osdep;
int wlabel;
{
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
diff --git a/sys/arch/arm32/include/disklabel.h b/sys/arch/arm32/include/disklabel.h
index 51789255abc..cdf8e09bb3f 100644
--- a/sys/arch/arm32/include/disklabel.h
+++ b/sys/arch/arm32/include/disklabel.h
@@ -97,6 +97,8 @@ struct cpu_disklabel {
struct dkbad bad;
};
+#define DKBAD(x) ((x)->bad)
+
struct filecore_bootblock {
u_char padding0[0x1c0];
u_char log2secsize;
@@ -124,11 +126,6 @@ struct filecore_bootblock {
u_char checksum;
};
-#ifdef _KERNEL
-struct disklabel;
-int bounds_check_with_label __P((struct buf *, struct disklabel *, int));
-#endif /* _KERNEL */
-
#endif /* _ARM32_DISKLABEL_H_ */
/* End of disklabel.h */
diff --git a/sys/arch/arm32/mainbus/wd.c b/sys/arch/arm32/mainbus/wd.c
index d41c35f0c85..00613810f1f 100644
--- a/sys/arch/arm32/mainbus/wd.c
+++ b/sys/arch/arm32/mainbus/wd.c
@@ -394,6 +394,7 @@ wdstrategy(bp)
*/
if (WDPART(bp->b_dev) != RAW_PART &&
bounds_check_with_label(bp, wd->sc_dk.dk_label,
+ wd->sc_dk.dk_cpulabel,
(wd->sc_flags & (WDF_WLABEL|WDF_LABELLING)) != 0) <= 0)
goto done;
@@ -1606,7 +1607,7 @@ void
bad144intern(wd)
struct wd_softc *wd;
{
- struct dkbad *bt = &wd->sc_dk.dk_cpulabel->bad;
+ struct dkbad *bt = &DKBAD(wd->sc_dk.dk_cpulabel);
struct disklabel *lp = wd->sc_dk.dk_label;
int i = 0;
diff --git a/sys/arch/atari/atari/disksubr.c b/sys/arch/atari/atari/disksubr.c
index f7f3cc9c4f9..7afad017ede 100644
--- a/sys/arch/atari/atari/disksubr.c
+++ b/sys/arch/atari/atari/disksubr.c
@@ -74,10 +74,11 @@ dk_establish()
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(bp, lp, wlabel)
-struct buf *bp;
-struct disklabel *lp;
-int wlabel;
+bounds_check_with_label(bp, lp, osdep, wlabel)
+ struct buf *bp;
+ struct disklabel *lp;
+ struct cpu_disklabel *osdep;
+ int wlabel;
{
struct partition *pp;
u_int32_t maxsz, sz;
diff --git a/sys/arch/atari/dev/fd.c b/sys/arch/atari/dev/fd.c
index 6a9c56b68cb..04b303239c2 100644
--- a/sys/arch/atari/dev/fd.c
+++ b/sys/arch/atari/dev/fd.c
@@ -508,7 +508,7 @@ struct buf *bp;
bp->b_error = EIO;
goto bad;
}
- if (bounds_check_with_label(bp, lp, 0) <= 0)
+ if (bounds_check_with_label(bp, lp, sc->dkdev.dk_cpulabel, 0) <= 0)
goto done;
if (bp->b_bcount == 0)
diff --git a/sys/arch/hp300/hp300/disksubr.c b/sys/arch/hp300/hp300/disksubr.c
index 928f908c500..b133efa4368 100644
--- a/sys/arch/hp300/hp300/disksubr.c
+++ b/sys/arch/hp300/hp300/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.5 1997/04/16 11:56:22 downsj Exp $ */
+/* $OpenBSD: disksubr.c,v 1.6 1997/08/08 21:46:42 niklas Exp $ */
/* $NetBSD: disksubr.c,v 1.9 1997/04/01 03:12:13 scottr Exp $ */
/*
@@ -211,9 +211,10 @@ done:
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(bp, lp, wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
struct buf *bp;
struct disklabel *lp;
+ struct cpu_disklabel *osdep;
int wlabel;
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
diff --git a/sys/arch/hp300/include/disklabel.h b/sys/arch/hp300/include/disklabel.h
index 98c0a7ce943..da4e2edfbdc 100644
--- a/sys/arch/hp300/include/disklabel.h
+++ b/sys/arch/hp300/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.3 1997/02/10 01:33:58 downsj Exp $ */
+/* $OpenBSD: disklabel.h,v 1.4 1997/08/08 21:46:42 niklas Exp $ */
/* $NetBSD: disklabel.h,v 1.1 1994/10/14 18:26:39 cgd Exp $ */
/*
@@ -44,9 +44,4 @@ struct cpu_disklabel {
int cd_dummy; /* must have one element. */
};
-#ifdef _KERNEL
-struct disklabel;
-int bounds_check_with_label __P((struct buf *, struct disklabel *, int));
-#endif
-
#endif /* _MACHINE_DISKLABEL_H_ */
diff --git a/sys/arch/i386/i386/disksubr.c b/sys/arch/i386/i386/disksubr.c
index 04195fc0ffc..436f7b05fbe 100644
--- a/sys/arch/i386/i386/disksubr.c
+++ b/sys/arch/i386/i386/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.24 1997/05/08 00:05:51 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.25 1997/08/08 21:46:43 niklas Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -84,7 +84,7 @@ readdisklabel(dev, strat, lp, osdep)
struct cpu_disklabel *osdep;
{
struct dos_partition *dp = osdep->dosparts, *dp2;
- struct dkbad *bdp = &osdep->bad;
+ struct dkbad *bdp = &DKBAD(osdep);
struct buf *bp;
struct disklabel *dlp;
char *msg = NULL, *cp;
@@ -462,9 +462,10 @@ done:
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(bp, lp, wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
struct buf *bp;
struct disklabel *lp;
+ struct cpu_disklabel *osdep;
int wlabel;
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
diff --git a/sys/arch/i386/include/disklabel.h b/sys/arch/i386/include/disklabel.h
index 4868e912f53..146e81c7d8e 100644
--- a/sys/arch/i386/include/disklabel.h
+++ b/sys/arch/i386/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.9 1997/04/10 13:06:24 deraadt Exp $ */
+/* $OpenBSD: disklabel.h,v 1.10 1997/08/08 21:46:44 niklas Exp $ */
/* $NetBSD: disklabel.h,v 1.3 1996/03/09 20:52:54 ghudson Exp $ */
/*
@@ -76,13 +76,10 @@ struct cpu_disklabel {
struct dkbad bad;
};
+#define DKBAD(x) ((x)->bad)
+
/* Isolate the relevant bits to get sector and cylinder. */
#define DPSECT(s) ((s) & 0x3f)
#define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2))
-#ifdef _KERNEL
-struct disklabel;
-int bounds_check_with_label __P((struct buf *, struct disklabel *, int));
-#endif
-
#endif /* _MACHINE_DISKLABEL_H_ */
diff --git a/sys/arch/mac68k/mac68k/disksubr.c b/sys/arch/mac68k/mac68k/disksubr.c
index c65e595ce5a..0949d0f5e2e 100644
--- a/sys/arch/mac68k/mac68k/disksubr.c
+++ b/sys/arch/mac68k/mac68k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.4 1996/05/26 18:36:16 briggs Exp $ */
+/* $OpenBSD: disksubr.c,v 1.5 1997/08/08 21:46:45 niklas Exp $ */
/* $NetBSD: disksubr.c,v 1.14 1996/05/05 06:18:22 briggs Exp $ */
/*
@@ -620,9 +620,10 @@ done:
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(bp, lp, wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
struct buf *bp;
struct disklabel *lp;
+ struct cpu_disklabel *osdep;
int wlabel;
{
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
diff --git a/sys/arch/mvme68k/mvme68k/disksubr.c b/sys/arch/mvme68k/mvme68k/disksubr.c
index 9b8e937a0ba..06bc439958b 100644
--- a/sys/arch/mvme68k/mvme68k/disksubr.c
+++ b/sys/arch/mvme68k/mvme68k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.13 1997/04/07 11:21:25 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.14 1997/08/08 21:46:46 niklas Exp $ */
/*
* Copyright (c) 1995 Dale Rahn.
@@ -296,9 +296,10 @@ writedisklabel(dev, strat, lp, clp)
int
-bounds_check_with_label(bp, lp, wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
struct buf *bp;
struct disklabel *lp;
+ struct cpu_disklabel *osdep;
int wlabel;
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
diff --git a/sys/arch/mvme88k/mvme88k/disksubr.c b/sys/arch/mvme88k/mvme88k/disksubr.c
index 2aebdc8bd46..2f25fbf3e16 100644
--- a/sys/arch/mvme88k/mvme88k/disksubr.c
+++ b/sys/arch/mvme88k/mvme88k/disksubr.c
@@ -255,9 +255,10 @@ writedisklabel(dev, strat, lp, clp)
int
-bounds_check_with_label(bp, lp, wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
struct buf *bp;
struct disklabel *lp;
+ struct cpu_disklabel *osdep;
int wlabel;
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
diff --git a/sys/arch/pc532/pc532/disksubr.c b/sys/arch/pc532/pc532/disksubr.c
index 397a7fc9dd3..b133d15a577 100644
--- a/sys/arch/pc532/pc532/disksubr.c
+++ b/sys/arch/pc532/pc532/disksubr.c
@@ -198,7 +198,11 @@ done:
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
+ struct buf *bp;
+ struct disklabel *lp;
+ struct cpu_disklabel *osdep;
+ int wlabel;
{
struct partition *p = lp->d_partitions + dkpart(bp->b_dev);
int maxsz = p->p_size,
diff --git a/sys/arch/pmax/pmax/disksubr.c b/sys/arch/pmax/pmax/disksubr.c
index 92ab45160a1..c9c4026425d 100644
--- a/sys/arch/pmax/pmax/disksubr.c
+++ b/sys/arch/pmax/pmax/disksubr.c
@@ -306,9 +306,10 @@ dk_establish(dk, dev)
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(bp, lp, wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
struct buf *bp;
struct disklabel *lp;
+ struct cpu_disklabel *osdep;
int wlabel;
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
diff --git a/sys/arch/powerpc/include/disklabel.h b/sys/arch/powerpc/include/disklabel.h
index c2eeefc746d..14c41f8766f 100644
--- a/sys/arch/powerpc/include/disklabel.h
+++ b/sys/arch/powerpc/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.3 1997/05/05 16:43:58 rahnds Exp $ */
+/* $OpenBSD: disklabel.h,v 1.4 1997/08/08 21:46:49 niklas Exp $ */
/* $NetBSD: disklabel.h,v 1.1 1996/09/30 16:34:22 ws Exp $ */
/*-
@@ -94,9 +94,4 @@ struct cpu_disklabel {
#define DPSECT(s) ((s) & 0x3f)
#define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2))
-#ifdef _KERNEL
-struct disklabel;
-int bounds_check_with_label __P((struct buf *bp, struct disklabel *lp, int wlabel));
-#endif /* _KERNEL */
-
#endif /* _MACHINE_DISKLABEL_H_ */
diff --git a/sys/arch/powerpc/powerpc/disksubr.c b/sys/arch/powerpc/powerpc/disksubr.c
index 31443bc7579..cb061328c26 100644
--- a/sys/arch/powerpc/powerpc/disksubr.c
+++ b/sys/arch/powerpc/powerpc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.3 1997/04/07 12:00:17 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.4 1997/08/08 21:46:50 niklas Exp $ */
/* $NetBSD: disksubr.c,v 1.1 1996/09/30 16:34:43 ws Exp $ */
/*
@@ -329,9 +329,10 @@ writedisklabel(dev, strat, lp, osdep)
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(bp, lp, wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
struct buf *bp;
struct disklabel *lp;
+ struct cpu_disklabel *osdep;
int wlabel;
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
diff --git a/sys/arch/sparc/dev/xd.c b/sys/arch/sparc/dev/xd.c
index 5bf36fe6db2..10ac25a1764 100644
--- a/sys/arch/sparc/dev/xd.c
+++ b/sys/arch/sparc/dev/xd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xd.c,v 1.10 1997/08/08 08:25:35 downsj Exp $ */
+/* $OpenBSD: xd.c,v 1.11 1997/08/08 21:46:50 niklas Exp $ */
/* $NetBSD: xd.c,v 1.37 1997/07/29 09:58:16 fair Exp $ */
/*
@@ -1071,7 +1071,7 @@ xdstrategy(bp)
* completion. */
if (bounds_check_with_label(bp, xd->sc_dk.dk_label,
- (xd->flags & XD_WLABEL) != 0) <= 0)
+ xd->sc_dk.dk_cpulabel, (xd->flags & XD_WLABEL) != 0) <= 0)
goto done;
/*
diff --git a/sys/arch/sparc/dev/xy.c b/sys/arch/sparc/dev/xy.c
index 2dc3413f2fe..50d250b5c32 100644
--- a/sys/arch/sparc/dev/xy.c
+++ b/sys/arch/sparc/dev/xy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xy.c,v 1.9 1997/08/08 08:25:39 downsj Exp $ */
+/* $OpenBSD: xy.c,v 1.10 1997/08/08 21:46:51 niklas Exp $ */
/* $NetBSD: xy.c,v 1.26 1997/07/19 21:43:56 pk Exp $ */
/*
@@ -1033,7 +1033,7 @@ xystrategy(bp)
* completion. */
if (bounds_check_with_label(bp, xy->sc_dk.dk_label,
- (xy->flags & XY_WLABEL) != 0) <= 0)
+ xy->sc_dk.dk_cpulabel, (xy->flags & XY_WLABEL) != 0) <= 0)
goto done;
/*
diff --git a/sys/arch/sparc/sparc/disksubr.c b/sys/arch/sparc/sparc/disksubr.c
index 5558fda3914..0933777b285 100644
--- a/sys/arch/sparc/sparc/disksubr.c
+++ b/sys/arch/sparc/sparc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.16 1997/06/25 14:43:27 downsj Exp $ */
+/* $OpenBSD: disksubr.c,v 1.17 1997/08/08 21:46:52 niklas Exp $ */
/* $NetBSD: disksubr.c,v 1.16 1996/04/28 20:25:59 thorpej Exp $ */
/*
@@ -293,9 +293,10 @@ writedisklabel(dev, strat, lp, clp)
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(bp, lp, wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
struct buf *bp;
struct disklabel *lp;
+ struct cpu_disklabel *osdep;
int wlabel;
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
diff --git a/sys/arch/sun3/dev/xd.c b/sys/arch/sun3/dev/xd.c
index a581866f049..48c6160d22b 100644
--- a/sys/arch/sun3/dev/xd.c
+++ b/sys/arch/sun3/dev/xd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xd.c,v 1.10 1997/01/16 04:03:55 kstailey Exp $ */
+/* $OpenBSD: xd.c,v 1.11 1997/08/08 21:46:53 niklas Exp $ */
/* $NetBSD: xd.c,v 1.10 1996/10/13 03:47:39 christos Exp $ */
/*
@@ -1036,7 +1036,7 @@ xdstrategy(bp)
* completion. */
if (bounds_check_with_label(bp, xd->sc_dk.dk_label,
- (xd->flags & XD_WLABEL) != 0) <= 0)
+ xd->sc_dk.dk_cpulabel, (xd->flags & XD_WLABEL) != 0) <= 0)
goto done;
/*
diff --git a/sys/arch/sun3/dev/xy.c b/sys/arch/sun3/dev/xy.c
index a7df9924e20..c09c3deb1c6 100644
--- a/sys/arch/sun3/dev/xy.c
+++ b/sys/arch/sun3/dev/xy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xy.c,v 1.9 1997/01/16 04:03:58 kstailey Exp $ */
+/* $OpenBSD: xy.c,v 1.10 1997/08/08 21:46:54 niklas Exp $ */
/* $NetBSD: xy.c,v 1.11 1996/10/13 03:47:40 christos Exp $ */
/*
@@ -999,7 +999,7 @@ xystrategy(bp)
* completion. */
if (bounds_check_with_label(bp, xy->sc_dk.dk_label,
- (xy->flags & XY_WLABEL) != 0) <= 0)
+ xy->sc_dk.dk_cpulabel, (xy->flags & XY_WLABEL) != 0) <= 0)
goto done;
/*
diff --git a/sys/arch/sun3/sun3/disksubr.c b/sys/arch/sun3/sun3/disksubr.c
index 40dd1a150f8..275339eb447 100644
--- a/sys/arch/sun3/sun3/disksubr.c
+++ b/sys/arch/sun3/sun3/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.10 1997/04/07 12:01:19 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.11 1997/08/08 21:46:55 niklas Exp $ */
/* $NetBSD: disksubr.c,v 1.14 1996/09/26 18:10:21 gwr Exp $ */
/*
@@ -239,7 +239,11 @@ writedisklabel(dev, strat, lp, clp)
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
+ struct buf *bp;
+ struct disklabel *lp;
+ struct cpu_disklabel *osdep;
+ int wlabel;
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
struct partition *p = lp->d_partitions + dkpart(bp->b_dev);
diff --git a/sys/arch/vax/mba/hp.c b/sys/arch/vax/mba/hp.c
index 15dfe30a331..3195f48f71c 100644
--- a/sys/arch/vax/mba/hp.c
+++ b/sys/arch/vax/mba/hp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hp.c,v 1.5 1997/05/29 00:04:58 niklas Exp $ */
+/* $OpenBSD: hp.c,v 1.6 1997/08/08 21:46:56 niklas Exp $ */
/* $NetBSD: hp.c,v 1.12 1996/10/13 03:34:58 christos Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -178,8 +178,8 @@ hpstrategy(bp)
unit = DISKUNIT(bp->b_dev);
sc = hp_cd.cd_devs[unit];
- if (bounds_check_with_label(bp, sc->sc_disk.dk_label, sc->sc_wlabel)
- <= 0)
+ if (bounds_check_with_label(bp, sc->sc_disk.dk_label,
+ sc->sc_disk.dk_cpulabel, sc->sc_wlabel) <= 0)
goto done;
s = splbio();
diff --git a/sys/arch/vax/mscp/mscp_disk.c b/sys/arch/vax/mscp/mscp_disk.c
index f49d8a412f3..54c3f01484b 100644
--- a/sys/arch/vax/mscp/mscp_disk.c
+++ b/sys/arch/vax/mscp/mscp_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mscp_disk.c,v 1.2 1997/05/29 00:05:02 niklas Exp $ */
+/* $OpenBSD: mscp_disk.c,v 1.3 1997/08/08 21:46:56 niklas Exp $ */
/* $NetBSD: mscp_disk.c,v 1.7 1997/01/11 11:20:32 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -382,7 +382,7 @@ rastrategy(bp)
}
} else
if (bounds_check_with_label(bp, ra->ra_disk.dk_label,
- ra->ra_wlabel) <= 0) {
+ ra->ra_disk.dk_cpulabel, ra->ra_wlabel) <= 0) {
bp->b_error = ENXIO;
goto bad;
}
diff --git a/sys/arch/vax/vax/disksubr.c b/sys/arch/vax/vax/disksubr.c
index bb24cef3c4a..6861cbf435d 100644
--- a/sys/arch/vax/vax/disksubr.c
+++ b/sys/arch/vax/vax/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.7 1997/05/29 00:05:16 niklas Exp $ */
+/* $OpenBSD: disksubr.c,v 1.8 1997/08/08 21:46:57 niklas Exp $ */
/* $NetBSD: disksubr.c,v 1.11 1997/01/11 11:24:51 ragge Exp $ */
/*
@@ -66,9 +66,10 @@ int cpu_writedisklabel __P((dev_t, void (*)(struct buf *),
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(bp, lp, wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
struct buf *bp;
struct disklabel *lp;
+ struct cpu_disklabel *osdep;
int wlabel;
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
diff --git a/sys/arch/wgrisc/include/disklabel.h b/sys/arch/wgrisc/include/disklabel.h
index 9b7f44b9f9c..6512f34c0f8 100644
--- a/sys/arch/wgrisc/include/disklabel.h
+++ b/sys/arch/wgrisc/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.3 1997/08/01 21:58:37 pefo Exp $ */
+/* $OpenBSD: disklabel.h,v 1.4 1997/08/08 21:46:58 niklas Exp $ */
/* $NetBSD: disklabel.h,v 1.3 1996/03/09 20:52:54 ghudson Exp $ */
/*
@@ -76,13 +76,10 @@ struct cpu_disklabel {
struct dkbad bad;
};
+#define DKBAD(x) ((x)->bad)
+
/* Isolate the relevant bits to get sector and cylinder. */
#define DPSECT(s) ((s) & 0x3f)
#define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2))
-#ifdef _KERNEL
-struct disklabel;
-int bounds_check_with_label __P((struct buf *, struct disklabel *, int));
-#endif
-
#endif /* _MACHINE_DISKLABEL_H_ */
diff --git a/sys/arch/wgrisc/wgrisc/disksubr.c b/sys/arch/wgrisc/wgrisc/disksubr.c
index 9205c18ca32..40cf5dc6a5a 100644
--- a/sys/arch/wgrisc/wgrisc/disksubr.c
+++ b/sys/arch/wgrisc/wgrisc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.4 1997/08/01 21:58:38 pefo Exp $ */
+/* $OpenBSD: disksubr.c,v 1.5 1997/08/08 21:46:59 niklas Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -84,7 +84,7 @@ readdisklabel(dev, strat, lp, osdep)
struct cpu_disklabel *osdep;
{
struct dos_partition *dp = osdep->dosparts, *dp2;
- struct dkbad *bdp = &osdep->bad;
+ struct dkbad *bdp = &DKBAD(osdep);
struct buf *bp;
struct disklabel *dlp;
char *msg = NULL, *cp;
@@ -462,9 +462,10 @@ done:
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(bp, lp, wlabel)
+bounds_check_with_label(bp, lp, osdep, wlabel)
struct buf *bp;
struct disklabel *lp;
+ struct cpu_disklabel *osdep;
int wlabel;
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))