Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-3]: src/sys/arch/sgimips/sgimips Pull up following revision(s) (r...
details: https://anonhg.NetBSD.org/src/rev/9afcf8dbf643
branches: netbsd-3
changeset: 577320:9afcf8dbf643
user: tron <tron%NetBSD.org@localhost>
date: Thu Oct 06 11:51:21 2005 +0000
description:
Pull up following revision(s) (requested by tsutsui in ticket #864):
sys/arch/sgimips/sgimips/disksubr.c: revision 1.16
On converting sgimips disklabel into BSD disklabel, don't take
dp_secbytes in the SGI volume header because the ARCS firmware ignores it.
Instead, leave the hardware default value set by each driver and
adjust offset values in the SGI volhdr according to the real sector size.
Fixes "resource shortage" messages on mounting a bootable CD-ROM image
which has the SGI volhdr. See posts on port-sgimips for details:
http://mail-index.netbsd.org/port-sgimips/2005/09/12/0000.html
http://mail-index.netbsd.org/port-sgimips/2005/09/12/0001.html
http://mail-index.netbsd.org/port-sgimips/2005/09/14/0000.html
diffstat:
sys/arch/sgimips/sgimips/disksubr.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diffs (61 lines):
diff -r 4f025220fb89 -r 9afcf8dbf643 sys/arch/sgimips/sgimips/disksubr.c
--- a/sys/arch/sgimips/sgimips/disksubr.c Thu Oct 06 11:48:49 2005 +0000
+++ b/sys/arch/sgimips/sgimips/disksubr.c Thu Oct 06 11:51:21 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disksubr.c,v 1.14 2004/11/24 21:59:32 jmc Exp $ */
+/* $NetBSD: disksubr.c,v 1.14.10.1 2005/10/06 11:51:21 tron Exp $ */
/*
* Copyright (c) 2001 Christopher Sekiya
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.14 2004/11/24 21:59:32 jmc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.14.10.1 2005/10/06 11:51:21 tron Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -311,7 +311,9 @@
if (mipsvh_cksum(vh))
return ("sgimips disk label corrupted");
+#if 0 /* ARCS ignores dp_secbytes and it may be wrong; use default instead */
lp->d_secsize = vh->dp.dp_secbytes;
+#endif
lp->d_nsectors = vh->dp.dp_secs;
lp->d_ntracks = vh->dp.dp_trks0;
lp->d_ncylinders = vh->dp.dp_cyls;
@@ -331,6 +333,9 @@
lpp = &lp->d_partitions[bp];
lpp->p_offset = vh->partitions[mp].first;
+ /* XXX ARCS ignores dp_secbytes on calculating offsets */
+ if (lp->d_secsize > DEV_BSIZE)
+ lpp->p_offset /= lp->d_secsize / DEV_BSIZE;
lpp->p_size = vh->partitions[mp].blocks;
lpp->p_fstype = partition_map[i].bsd_type;
if (lpp->p_fstype == FS_BSDFFS) {
@@ -369,7 +374,11 @@
vh->dp.dp_shd0 = 0;
vh->dp.dp_trks0 = lp->d_ntracks;
vh->dp.dp_secs = lp->d_nsectors;
+#if 0 /* ARCS ignores dp_secbytes; leave it default */
vh->dp.dp_secbytes = lp->d_secsize;
+#else
+ vh->dp.dp_secbytes = SGI_BOOT_BLOCK_BLOCKSIZE;
+#endif
vh->dp.dp_interleave = lp->d_interleave;
vh->dp.dp_nretries = 22;
@@ -379,6 +388,10 @@
lpp = &lp->d_partitions[bp];
vh->partitions[mp].first = lpp->p_offset;
+ /* XXX ARCS ignores dp_secbytes on calculating offsets */
+ if (lp->d_secsize > SGI_BOOT_BLOCK_BLOCKSIZE)
+ vh->partitions[mp].first *=
+ lp->d_secsize / SGI_BOOT_BLOCK_BLOCKSIZE;
vh->partitions[mp].blocks = lpp->p_size;
vh->partitions[mp].type = partition_map[i].mips_type;
}
Home |
Main Index |
Thread Index |
Old Index