Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/dev/dkwedge Pull up following revision(s) (requested ...
details: https://anonhg.NetBSD.org/src/rev/089cb67b9630
branches: netbsd-7
changeset: 799196:089cb67b9630
user: snj <snj%NetBSD.org@localhost>
date: Tue Apr 14 05:06:34 2015 +0000
description:
Pull up following revision(s) (requested by christos in ticket #683):
sys/dev/dkwedge/dkwedge_apple.c: revision 1.2
Look at the bzb flags to mark partition as swap. Requested by John D. Baker.
XXX: Pullup-7
diffstat:
sys/dev/dkwedge/dkwedge_apple.c | 28 +++++++++++++++++++++++++---
1 files changed, 25 insertions(+), 3 deletions(-)
diffs (65 lines):
diff -r 2b6483368995 -r 089cb67b9630 sys/dev/dkwedge/dkwedge_apple.c
--- a/sys/dev/dkwedge/dkwedge_apple.c Tue Apr 14 05:00:15 2015 +0000
+++ b/sys/dev/dkwedge/dkwedge_apple.c Tue Apr 14 05:06:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dkwedge_apple.c,v 1.1 2012/04/07 05:36:10 christos Exp $ */
+/* $NetBSD: dkwedge_apple.c,v 1.1.18.1 2015/04/14 05:06:34 snj Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dkwedge_apple.c,v 1.1 2012/04/07 05:36:10 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dkwedge_apple.c,v 1.1.18.1 2015/04/14 05:06:34 snj Exp $");
#include <sys/param.h>
#ifdef _KERNEL
@@ -106,6 +106,18 @@
SWAP32(pmBootCksum);
}
+static void
+swap_apple_blockzeroblock(struct apple_blockzeroblock *ap)
+{
+ SWAP32(bzbMagic);
+ SWAP16(bzbBadBlockInode);
+ SWAP16(bzbFlags);
+ SWAP16(bzbReserved);
+ SWAP32(bzbCreationTime);
+ SWAP32(bzbMountTime);
+ SWAP32(bzbUMountTime);
+}
+
#undef SWAP16
#undef SWAP32
@@ -137,6 +149,8 @@
uint32_t blocksize, offset, rsize;
struct apple_drvr_map *am;
struct apple_part_map_entry *ae;
+ struct apple_blockzeroblock ab;
+ const char *ptype;
buf = DKW_MALLOC(ASIZE);
if ((error = dkwedge_read(pdk, vp, 0, buf, ASIZE)) != 0) {
@@ -193,9 +207,17 @@
if (i == __arraycount(map))
continue;
+ ptype = map[i].type;
+ memcpy(&ab, ae->pmBootArgs, sizeof(ab));
+ swap_apple_blockzeroblock(&ab);
+ if (ab.bzbMagic == APPLE_BZB_MAGIC) {
+ if (ab.bzbType == APPLE_BZB_TYPESWAP)
+ ptype = DKW_PTYPE_SWAP;
+ }
+
struct dkwedge_info dkw;
- strcpy(dkw.dkw_ptype, map[i].type);
+ strcpy(dkw.dkw_ptype, ptype);
strcpy(dkw.dkw_parent, pdk->dk_name);
dkw.dkw_offset = ae->pmPyPartStart;
dkw.dkw_size = ae->pmPartBlkCnt;
Home |
Main Index |
Thread Index |
Old Index