diff -ru pdisk-tivo-a2.orig/RCS/ATA_media.c,v pdisk-tivo-a2/RCS/ATA_media.c,v
--- pdisk-tivo-a2.orig/RCS/ATA_media.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/ATA_media.c,v	2007-03-29 00:24:20.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/ATA_media.h,v pdisk-tivo-a2/RCS/ATA_media.h,v
--- pdisk-tivo-a2.orig/RCS/ATA_media.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/ATA_media.h,v	2007-03-29 00:24:20.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/DoSCSICommand.c,v pdisk-tivo-a2/RCS/DoSCSICommand.c,v
--- pdisk-tivo-a2.orig/RCS/DoSCSICommand.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/DoSCSICommand.c,v	2007-03-29 00:24:21.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/DoSCSICommand.h,v pdisk-tivo-a2/RCS/DoSCSICommand.h,v
--- pdisk-tivo-a2.orig/RCS/DoSCSICommand.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/DoSCSICommand.h,v	2007-03-29 00:24:21.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/HISTORY,v pdisk-tivo-a2/RCS/HISTORY,v
--- pdisk-tivo-a2.orig/RCS/HISTORY,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/HISTORY,v	2007-03-29 00:24:21.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@# @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/MacSCSICommand.h,v pdisk-tivo-a2/RCS/MacSCSICommand.h,v
--- pdisk-tivo-a2.orig/RCS/MacSCSICommand.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/MacSCSICommand.h,v	2007-03-29 00:24:21.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/README,v pdisk-tivo-a2/RCS/README,v
--- pdisk-tivo-a2.orig/RCS/README,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/README,v	2007-03-29 00:24:21.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@# @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/SCSI_media.c,v pdisk-tivo-a2/RCS/SCSI_media.c,v
--- pdisk-tivo-a2.orig/RCS/SCSI_media.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/SCSI_media.c,v	2007-03-29 00:24:21.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/SCSI_media.h,v pdisk-tivo-a2/RCS/SCSI_media.h,v
--- pdisk-tivo-a2.orig/RCS/SCSI_media.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/SCSI_media.h,v	2007-03-29 00:24:21.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/bitfield.c,v pdisk-tivo-a2/RCS/bitfield.c,v
--- pdisk-tivo-a2.orig/RCS/bitfield.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/bitfield.c,v	2007-03-29 00:24:21.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/bitfield.h,v pdisk-tivo-a2/RCS/bitfield.h,v
--- pdisk-tivo-a2.orig/RCS/bitfield.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/bitfield.h,v	2007-03-29 00:24:21.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/convert.c,v pdisk-tivo-a2/RCS/convert.c,v
--- pdisk-tivo-a2.orig/RCS/convert.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/convert.c,v	2007-03-29 00:24:21.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.3;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.3; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/convert.h,v pdisk-tivo-a2/RCS/convert.h,v
--- pdisk-tivo-a2.orig/RCS/convert.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/convert.h,v	2007-03-29 00:24:21.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/deblock_media.c,v pdisk-tivo-a2/RCS/deblock_media.c,v
--- pdisk-tivo-a2.orig/RCS/deblock_media.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/deblock_media.c,v	2007-03-29 00:24:21.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/deblock_media.h,v pdisk-tivo-a2/RCS/deblock_media.h,v
--- pdisk-tivo-a2.orig/RCS/deblock_media.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/deblock_media.h,v	2007-03-29 00:24:21.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/dpme.h,v pdisk-tivo-a2/RCS/dpme.h,v
--- pdisk-tivo-a2.orig/RCS/dpme.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/dpme.h,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/dump.c,v pdisk-tivo-a2/RCS/dump.c,v
--- pdisk-tivo-a2.orig/RCS/dump.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/dump.c,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.2;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.2; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/dump.h,v pdisk-tivo-a2/RCS/dump.h,v
--- pdisk-tivo-a2.orig/RCS/dump.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/dump.h,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/errors.c,v pdisk-tivo-a2/RCS/errors.c,v
--- pdisk-tivo-a2.orig/RCS/errors.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/errors.c,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/errors.h,v pdisk-tivo-a2/RCS/errors.h,v
--- pdisk-tivo-a2.orig/RCS/errors.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/errors.h,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/file_media.c,v pdisk-tivo-a2/RCS/file_media.c,v
--- pdisk-tivo-a2.orig/RCS/file_media.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/file_media.c,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.2;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.2; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/file_media.h,v pdisk-tivo-a2/RCS/file_media.h,v
--- pdisk-tivo-a2.orig/RCS/file_media.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/file_media.h,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/io.c,v pdisk-tivo-a2/RCS/io.c,v
--- pdisk-tivo-a2.orig/RCS/io.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/io.c,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/io.h,v pdisk-tivo-a2/RCS/io.h,v
--- pdisk-tivo-a2.orig/RCS/io.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/io.h,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/layout_dump.c,v pdisk-tivo-a2/RCS/layout_dump.c,v
--- pdisk-tivo-a2.orig/RCS/layout_dump.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/layout_dump.c,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/layout_dump.h,v pdisk-tivo-a2/RCS/layout_dump.h,v
--- pdisk-tivo-a2.orig/RCS/layout_dump.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/layout_dump.h,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/makefile,v pdisk-tivo-a2/RCS/makefile,v
--- pdisk-tivo-a2.orig/RCS/makefile,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/makefile,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.4;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.4; strict;
 comment	@# @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/media.c,v pdisk-tivo-a2/RCS/media.c,v
--- pdisk-tivo-a2.orig/RCS/media.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/media.c,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.2;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.2; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/media.h,v pdisk-tivo-a2/RCS/media.h,v
--- pdisk-tivo-a2.orig/RCS/media.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/media.h,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/partition_map.c,v pdisk-tivo-a2/RCS/partition_map.c,v
--- pdisk-tivo-a2.orig/RCS/partition_map.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/partition_map.c,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.4;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.4; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/partition_map.h,v pdisk-tivo-a2/RCS/partition_map.h,v
--- pdisk-tivo-a2.orig/RCS/partition_map.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/partition_map.h,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/pathname.c,v pdisk-tivo-a2/RCS/pathname.c,v
--- pdisk-tivo-a2.orig/RCS/pathname.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/pathname.c,v	2007-03-29 00:24:22.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/pathname.h,v pdisk-tivo-a2/RCS/pathname.h,v
--- pdisk-tivo-a2.orig/RCS/pathname.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/pathname.h,v	2007-03-29 00:24:23.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/pdisk.8,v pdisk-tivo-a2/RCS/pdisk.8,v
--- pdisk-tivo-a2.orig/RCS/pdisk.8,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/pdisk.8,v	2007-03-29 00:24:23.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@# @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/pdisk.c,v pdisk-tivo-a2/RCS/pdisk.c,v
--- pdisk-tivo-a2.orig/RCS/pdisk.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/pdisk.c,v	2007-03-29 00:24:23.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.3;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.3; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/pdisk.h,v pdisk-tivo-a2/RCS/pdisk.h,v
--- pdisk-tivo-a2.orig/RCS/pdisk.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/pdisk.h,v	2007-03-29 00:24:23.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/pdisk.html,v pdisk-tivo-a2/RCS/pdisk.html,v
--- pdisk-tivo-a2.orig/RCS/pdisk.html,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/pdisk.html,v	2007-03-29 00:24:23.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@# @;
 
 
Binary files pdisk-tivo-a2.orig/RCS/pdisk.mac.bin,v and pdisk-tivo-a2/RCS/pdisk.mac.bin,v differ
diff -ru pdisk-tivo-a2.orig/RCS/pdisk.r,v pdisk-tivo-a2/RCS/pdisk.r,v
--- pdisk-tivo-a2.orig/RCS/pdisk.r,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/pdisk.r,v	2007-03-29 00:24:23.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@# @;
 
 
Binary files pdisk-tivo-a2.orig/RCS/pdisk.tdt.bin,v and pdisk-tivo-a2/RCS/pdisk.tdt.bin,v differ
diff -ru pdisk-tivo-a2.orig/RCS/tivo.c,v pdisk-tivo-a2/RCS/tivo.c,v
--- pdisk-tivo-a2.orig/RCS/tivo.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/tivo.c,v	2007-03-29 00:24:23.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/tivo.h,v pdisk-tivo-a2/RCS/tivo.h,v
--- pdisk-tivo-a2.orig/RCS/tivo.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/tivo.h,v	2007-03-29 00:24:23.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/util.c,v pdisk-tivo-a2/RCS/util.c,v
--- pdisk-tivo-a2.orig/RCS/util.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/util.c,v	2007-03-29 00:24:23.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/util.h,v pdisk-tivo-a2/RCS/util.h,v
--- pdisk-tivo-a2.orig/RCS/util.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/util.h,v	2007-03-29 00:24:23.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/validate.c,v pdisk-tivo-a2/RCS/validate.c,v
--- pdisk-tivo-a2.orig/RCS/validate.c,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/validate.c,v	2007-03-29 00:24:23.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/validate.h,v pdisk-tivo-a2/RCS/validate.h,v
--- pdisk-tivo-a2.orig/RCS/validate.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/validate.h,v	2007-03-29 00:24:23.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.1;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.1; strict;
 comment	@ * @;
 
 
diff -ru pdisk-tivo-a2.orig/RCS/version.h,v pdisk-tivo-a2/RCS/version.h,v
--- pdisk-tivo-a2.orig/RCS/version.h,v	2000-06-17 08:14:53.000000000 -0700
+++ pdisk-tivo-a2/RCS/version.h,v	2007-03-29 00:24:24.000000000 -0700
@@ -1,7 +1,8 @@
 head	1.3;
 access;
 symbols;
-locks; strict;
+locks
+	dg:1.3; strict;
 comment	@ * @;
 
 
Only in pdisk-tivo-a2.orig/: README.tivo
Only in pdisk-tivo-a2: bitfield.h
Only in pdisk-tivo-a2: dpme.h
Only in pdisk-tivo-a2: dump.h
Only in pdisk-tivo-a2: errors.h
Only in pdisk-tivo-a2: io.h
Only in pdisk-tivo-a2: makefile
Only in pdisk-tivo-a2: media.h
Only in pdisk-tivo-a2: partition_map.h
Only in pdisk-tivo-a2: pathname.h
Binary files pdisk-tivo-a2.orig/pdisk and pdisk-tivo-a2/pdisk differ
Only in pdisk-tivo-a2: pdisk.c
Only in pdisk-tivo-a2: pdisk.h
Only in pdisk-tivo-a2.orig/src: CW Settings.stg.bin
Only in pdisk-tivo-a2/src: Makefile
Only in pdisk-tivo-a2/src: MyResults.txt
Only in pdisk-tivo-a2/src: README.tivo
Only in pdisk-tivo-a2/src: RealResults.txt
Only in pdisk-tivo-a2/src: bitfield.o
diff -ru pdisk-tivo-a2.orig/src/convert.c pdisk-tivo-a2/src/convert.c
--- pdisk-tivo-a2.orig/src/convert.c	2007-03-31 12:23:33.000000000 -0700
+++ pdisk-tivo-a2/src/convert.c	2007-03-30 00:33:51.000000000 -0700
@@ -27,13 +27,13 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 
  */
 
-#ifdef __linux__
-#include <endian.h>
-#else
+// #ifdef __linux__
+// #include <endian.h>
+// #else
 #define LITTLE_ENDIAN 1234
 #define BIG_ENDIAN 4321
 #define BYTE_ORDER 4321
-#endif
+// #endif
 
 #include "convert.h"
 
@@ -64,6 +64,13 @@
 void reverse2(u8 *bytes);
 void reverse4(u8 *bytes);
 
+void convert_field(char *field, int maxlen)
+{
+    int i;
+    for (i=0; i<maxlen; i=i+2) {
+	reverse2(&field[i]);
+    }
+}
 
 //
 // Routines
@@ -90,15 +97,36 @@
     reverse4((u8 *)&data->dpme_goto_addr_2);
     reverse4((u8 *)&data->dpme_checksum);
     convert_bzb((BZB *)data->dpme_bzb, to_cpu_form);
+#else
+    // Since we will toss the block if the signature doesn't match
+    // we don't need to check the signature down here.
+    reverse2((u8 *)&data->dpme_signature);
+    reverse2((u8 *)&data->dpme_reserved_1);
+    reverse4((u8 *)&data->dpme_map_entries);
+    reverse4((u8 *)&data->dpme_pblock_start);
+    reverse4((u8 *)&data->dpme_pblocks);
+    reverse4((u8 *)&data->dpme_lblock_start);
+    reverse4((u8 *)&data->dpme_lblocks);
+    reverse4((u8 *)&data->dpme_flags);
+    reverse4((u8 *)&data->dpme_boot_block);
+    reverse4((u8 *)&data->dpme_boot_bytes);
+    reverse4((u8 *)&data->dpme_load_addr);
+    reverse4((u8 *)&data->dpme_load_addr_2);
+    reverse4((u8 *)&data->dpme_goto_addr);
+    reverse4((u8 *)&data->dpme_goto_addr_2);
+    reverse4((u8 *)&data->dpme_checksum);
+    convert_bzb((BZB *)data->dpme_bzb, to_cpu_form);
+    convert_field(&data->dpme_name, DPISTRLEN);
+    convert_field(&data->dpme_type, DPISTRLEN);
 #endif
     return 0;
 }
 
 
-#if BYTE_ORDER == LITTLE_ENDIAN
 int
 convert_bzb(BZB *data, int to_cpu_form)
 {
+#if BYTE_ORDER == LITTLE_ENDIAN
     // Since the data here varies according to the type of partition we
     // do not want to convert willy-nilly. We use the flag to determine
     // whether to check for the signature before or after we flip the bytes.
@@ -122,8 +150,33 @@
     reverse4((u8 *)&data->bzb_tmount);
     reverse4((u8 *)&data->bzb_tumount);
     return 0;
-}
+#else
+    // Since the data here varies according to the type of partition we
+    // do not want to convert willy-nilly. We use the flag to determine
+    // whether to check for the signature before or after we flip the bytes.
+printf("0x%x cmp 0x%x\n", data->bzb_magic, BZBMAGIC);
+    if (to_cpu_form) {
+	reverse4((u8 *)&data->bzb_magic);
+	if (data->bzb_magic != BZBMAGIC) {
+	    reverse4((u8 *)&data->bzb_magic);
+	    if (data->bzb_magic != BZBMAGIC) {
+		return 0;
+	    }
+	}
+    } else {
+	if (data->bzb_magic != BZBMAGIC) {
+	    return 0;
+	}
+	reverse4((u8 *)&data->bzb_magic);
+    }
+    reverse2((u8 *)&data->bzb_inode);
+    reverse4((u8 *)&data->bzb_flags);
+    reverse4((u8 *)&data->bzb_tmade);
+    reverse4((u8 *)&data->bzb_tmount);
+    reverse4((u8 *)&data->bzb_tumount);
+    return 0;
 #endif
+}
 
 
 int
@@ -186,6 +239,53 @@
 	    reverse2((u8 *)&m[i].ddType);
 	}
     }
+#else
+#ifdef TIVO_PATCHES
+    DDMap *m;
+    u16 count;
+    int i;
+
+    if (to_cpu_form) {
+	if (data->sbSig == BLOCK0_SIGNATURE ) return 0; // Mac block 0.
+	if (data->sbSig != 0x9214) return 0; // Not a TiVo block 0.
+    } else {
+	if (data->sbSig == BLOCK0_SIGNATURE ) return 0; // Not a Mac block 0
+	if (data->sbSig == 0x9214) return 0; // Already swapped TiVo block 0.
+    }
+    printf("SBSIG NOW 0x%x\n", data->sbSig);
+
+    // Since this data is optional we do not want to convert willy-nilly.
+    // We use the flag to determine whether to check for the signature
+    // before or after we flip the bytes and to determine which form of
+    // the count to use.
+    reverse2((u8 *)&data->sbBlkSize);
+    reverse4((u8 *)&data->sbBlkCount);
+    reverse2((u8 *)&data->sbDevType);
+    reverse2((u8 *)&data->sbDevId);
+    reverse4((u8 *)&data->sbData);
+    if (to_cpu_form) {
+	reverse2((u8 *)&data->sbDrvrCount);
+	count = data->sbDrvrCount;
+    } else {
+	count = data->sbDrvrCount;
+	reverse2((u8 *)&data->sbDrvrCount);
+    }
+printf("Count: 0x%x\n", count);
+
+    if (count > 247) {
+	printf("Warning: count way out of range.  Count %d, 0x%x should be <= 247.\n", count, count);
+	count = 247;
+    }
+    if (count > 0) {
+	m = (DDMap *) data->sbMap;
+	for (i = 0; i < count; i++) {
+	    reverse4((u8 *)&m[i].ddBlock);
+	    reverse2((u8 *)&m[i].ddSize);
+	    reverse2((u8 *)&m[i].ddType);
+	}
+    }
+
+#endif
 #endif
     return 0;
 }
@@ -205,6 +305,7 @@
 void
 reverse4(u8 *bytes)
 {
+#if BYTE_ORDER == LITTLE_ENDIAN
     u8 t;
 
     t = *bytes;
@@ -213,4 +314,9 @@
     t = bytes[1];
     bytes[1] = bytes[2];
     bytes[2] = t;
+#else
+    /* Swap in pairs. */
+    reverse2(bytes);
+    reverse2(bytes+2);
+#endif
 }
Only in pdisk-tivo-a2/src: convert.o
Only in pdisk-tivo-a2/src: deblock_media.o
diff -ru pdisk-tivo-a2.orig/src/dump.c pdisk-tivo-a2/src/dump.c
--- pdisk-tivo-a2.orig/src/dump.c	2007-03-31 12:23:33.000000000 -0700
+++ pdisk-tivo-a2/src/dump.c	2007-03-29 00:28:29.000000000 -0700
@@ -33,7 +33,7 @@
 #include <stdlib.h>
 //#include <unistd.h>
 #else
-#include <malloc.h>
+#include <sys/malloc.h>
 #endif
 
 // for strcmp()
Only in pdisk-tivo-a2/src: dump.o
Only in pdisk-tivo-a2/src: errors.o
diff -ru pdisk-tivo-a2.orig/src/file_media.c pdisk-tivo-a2/src/file_media.c
--- pdisk-tivo-a2.orig/src/file_media.c	2007-03-31 12:23:33.000000000 -0700
+++ pdisk-tivo-a2/src/file_media.c	2007-03-29 00:30:54.000000000 -0700
@@ -40,8 +40,8 @@
 
 #ifdef __linux__
 #include <sys/ioctl.h>
-#include <linux/fs.h>
-#include <linux/hdreg.h>
+// #include <linux/fs.h>
+// #include <linux/hdreg.h>
 #include <sys/stat.h>
 #endif
 
@@ -52,12 +52,12 @@
 /*
  * Defines
  */
-#ifdef __linux__
-extern __loff_t llseek __P ((int __fd, __loff_t __offset, int __whence));
-#else
-#define loff_t long
+// #ifdef __linux__
+// extern __loff_t llseek __P ((int __fd, __loff_t __offset, int __whence));
+// #else
+#define loff_t off_t
 #define llseek lseek
-#endif
+// #endif
 
 
 /*
@@ -361,6 +361,7 @@
 	/* okay - nothing to do */
 	rtn_value = 1;
     } else {
+#if 0
 #ifdef __linux__
 	sync();
 	sleep(2);
@@ -387,6 +388,7 @@
 		    "partition table is updated.\n");
 	}
 #endif
+#endif
 	rtn_value = 1;
     }
     return rtn_value;
Only in pdisk-tivo-a2/src: file_media.o
diff -ru pdisk-tivo-a2.orig/src/io.c pdisk-tivo-a2/src/io.c
--- pdisk-tivo-a2.orig/src/io.c	2007-03-31 12:23:33.000000000 -0700
+++ pdisk-tivo-a2/src/io.c	2007-03-29 00:29:03.000000000 -0700
@@ -32,7 +32,7 @@
 #if !defined(__linux__) && !defined(__unix__)
 #include <stdlib.h>
 #else
-#include <malloc.h>
+#include <sys/malloc.h>
 #endif
 // for strncpy()
 #include <string.h>
Only in pdisk-tivo-a2/src: io.o
Only in pdisk-tivo-a2.orig/src: makefile
Only in pdisk-tivo-a2/src: media.o
diff -ru pdisk-tivo-a2.orig/src/partition_map.c pdisk-tivo-a2/src/partition_map.c
--- pdisk-tivo-a2.orig/src/partition_map.c	2007-03-31 12:23:34.000000000 -0700
+++ pdisk-tivo-a2/src/partition_map.c	2007-03-30 00:17:30.000000000 -0700
@@ -32,7 +32,7 @@
 #ifndef __linux__
 #include <stdlib.h>
 #else
-#include <malloc.h>
+#include <sys/malloc.h>
 #endif
 
 // for strncpy() & strcmp()
@@ -265,6 +265,7 @@
 	    map->logical_block *= 2;
 	}
 	if (map->logical_block > map->physical_block) {
+		printf("0x%x > 0x%x\n", map->logical_block, map->physical_block);
 	    error(-1, "No valid block 1 on '%s'", map->name);
 	    free(data);
 	    return -1;
@@ -300,8 +301,10 @@
 		|| (data->dpme_signature != DPME_SIGNATURE && dflag == 0)
 		|| (data->dpme_map_entries != limit && dflag == 0)) {
 	    error(-1, "Bad data in block %u from '%s'", index, map->name);
-	    free(data);
-	    return -1;
+	printf("SIG: 0x%x != 0x%x\n", data->dpme_signature, DPME_SIGNATURE);
+	return 0;
+	    // free(data);
+	    // return -1;
 	}
     }
     return 0;
@@ -602,6 +605,8 @@
 #ifdef TIVO_PATCHES
     if (p->sbSig == 0x1492) {
 	return 0;
+    } else {
+	printf("TIVO SBSIG: 0x%x\n", p->sbSig);
     }
 #endif
     if (p->sbSig != BLOCK0_SIGNATURE) {
Only in pdisk-tivo-a2/src: partition_map.o
Only in pdisk-tivo-a2/src: pathname.o
Only in pdisk-tivo-a2/src: pdisk
Only in pdisk-tivo-a2.orig/src: pdisk 68k.tdt.bin
diff -ru pdisk-tivo-a2.orig/src/pdisk.c pdisk-tivo-a2/src/pdisk.c
--- pdisk-tivo-a2.orig/src/pdisk.c	2007-03-31 12:23:34.000000000 -0700
+++ pdisk-tivo-a2/src/pdisk.c	2007-03-29 00:28:13.000000000 -0700
@@ -32,7 +32,7 @@
 
 #ifdef __linux__
 #include <getopt.h>
-#include <malloc.h>
+#include <sys/malloc.h>
 #else
 // for malloc() & free()
 #include <stdlib.h>
@@ -49,8 +49,8 @@
 
 #ifdef __linux__
 #include <sys/ioctl.h>
-#include <linux/fs.h>
-#include <linux/hdreg.h>
+// #include <linux/fs.h>
+// #include <linux/hdreg.h>
 #endif
 
 #include "pdisk.h"
Only in pdisk-tivo-a2/src: pdisk.o
Only in pdisk-tivo-a2/src: tivo.o
Only in pdisk-tivo-a2/src: util.o
diff -ru pdisk-tivo-a2.orig/src/validate.c pdisk-tivo-a2/src/validate.c
--- pdisk-tivo-a2.orig/src/validate.c	2007-03-31 12:23:35.000000000 -0700
+++ pdisk-tivo-a2/src/validate.c	2007-03-29 00:29:07.000000000 -0700
@@ -32,7 +32,7 @@
 #ifndef __linux__
 #include <stdlib.h>
 #else
-#include <malloc.h>
+#include <sys/malloc.h>
 #endif
 // for O_RDONLY
 #include <fcntl.h>
Only in pdisk-tivo-a2/src: validate.o
Only in pdisk-tivo-a2: util.h
Only in pdisk-tivo-a2: validate.h
Only in pdisk-tivo-a2: version.h
