Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/disklabel Rather than making FileCore boot block suppor...



details:   https://anonhg.NetBSD.org/src/rev/eb32189a2028
branches:  trunk
changeset: 518413:eb32189a2028
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Thu Nov 29 23:08:53 2001 +0000

description:
Rather than making FileCore boot block support conditional on __arm32__, make
it conditional on USE_ACORN, and define that if MACHINE is arm26 or acorn32.
This is less than optimal, and maybe we should define it for all ARM systems,
but then disklabel handling across architectures is generally a mess at the
moment.

diffstat:

 sbin/disklabel/Makefile    |   7 ++++++-
 sbin/disklabel/disklabel.c |  34 +++++++++++++++++-----------------
 2 files changed, 23 insertions(+), 18 deletions(-)

diffs (148 lines):

diff -r 95007ad7a608 -r eb32189a2028 sbin/disklabel/Makefile
--- a/sbin/disklabel/Makefile   Thu Nov 29 23:06:14 2001 +0000
+++ b/sbin/disklabel/Makefile   Thu Nov 29 23:08:53 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.40 2001/11/19 13:55:06 minoura Exp $
+#      $NetBSD: Makefile,v 1.41 2001/11/29 23:08:53 bjh21 Exp $
 #      @(#)Makefile    8.2 (Berkeley) 3/17/94
 
 PROG=  disklabel
@@ -42,4 +42,9 @@
 CPPFLAGS+= -DSAVEBOOTAREA
 .endif
 
+.if (${MACHINE} == "acorn32" || ${MACHINE} == "arm26")
+# Support FileCore boot block
+CPPFLAGS+= -DUSE_ACORN
+.endif
+
 .include <bsd.prog.mk>
diff -r 95007ad7a608 -r eb32189a2028 sbin/disklabel/disklabel.c
--- a/sbin/disklabel/disklabel.c        Thu Nov 29 23:06:14 2001 +0000
+++ b/sbin/disklabel/disklabel.c        Thu Nov 29 23:08:53 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disklabel.c,v 1.99 2001/10/19 01:16:37 lukem Exp $     */
+/*     $NetBSD: disklabel.c,v 1.100 2001/11/29 23:08:53 bjh21 Exp $    */
 
 /*
  * Copyright (c) 1987, 1993
@@ -47,7 +47,7 @@
 static char sccsid[] = "@(#)disklabel.c        8.4 (Berkeley) 5/4/95";
 /* from static char sccsid[] = "@(#)disklabel.c        1.2 (Symmetric) 11/28/85"; */
 #else
-__RCSID("$NetBSD: disklabel.c,v 1.99 2001/10/19 01:16:37 lukem Exp $");
+__RCSID("$NetBSD: disklabel.c,v 1.100 2001/11/29 23:08:53 bjh21 Exp $");
 #endif
 #endif /* not lint */
 
@@ -146,13 +146,13 @@
 static struct mbr_partition    *readmbr(int);
 #endif /* USE_MBR */
 
-#ifdef __arm32__
+#ifdef USE_ACORN
 static u_int            filecore_partition_offset;
 static u_int            get_filecore_partition(int);
 static int              filecore_checksum(u_char *);
-#endif /* __arm32__ */
+#endif /* USE_ACORN */
 
-#if defined(USE_MBR) || (defined(__arm32__) && defined(notyet))
+#if defined(USE_MBR) || (defined(USE_ACORN) && defined(notyet))
 static void             confirm(const char *);
 #endif
 
@@ -297,7 +297,7 @@
        }
 #endif /* USE_MBR */
 
-#ifdef __arm32__
+#ifdef USE_ACORN
        /*
         * Check for the presence of a RiscOS filecore boot block
         * indicating an ADFS file system on the disc.
@@ -307,7 +307,7 @@
         * is found to be ADFS only.
         */
        filecore_partition_offset = get_filecore_partition(f);
-#endif /* __arm32__ */
+#endif /* USE_ACORN */
 
        switch (op) {
 
@@ -452,7 +452,7 @@
                (void)strncpy(lp->d_packname, name, sizeof(lp->d_packname));
 }
 
-#if defined(USE_MBR) || (defined(__arm32__) && defined(notyet))
+#if defined(USE_MBR) || (defined(USE_ACORN) && defined(notyet))
 static void
 confirm(const char *txt)
 {
@@ -466,7 +466,7 @@
        if (first != 'y' && first != 'Y')
                exit(0);
 }
-#endif /* USE_MBR || __arm32__ && notyet */
+#endif /* USE_MBR || USE_ACORN && notyet */
 
 int
 writelabel(int f, const char *boot, struct disklabel *lp)
@@ -515,10 +515,10 @@
                }
 #endif /* USE_MBR */
 
-#ifdef __arm32__
+#ifdef USE_ACORN
                /* XXX */
                sectoffset = (off_t)filecore_partition_offset * DEV_BSIZE;
-#endif /* __arm32__ */
+#endif /* USE_ACORN */
 
                /*
                 * First set the kernel disk label,
@@ -689,7 +689,7 @@
 }
 #endif /* USE_MBR */
 
-#ifdef __arm32__
+#ifdef USE_ACORN
 /*
  * static int filecore_checksum(u_char *bootblock)
  *
@@ -835,7 +835,7 @@
        }
        return (0);
 }
-#endif /* __arm32__ */
+#endif /* USE_ACORN */
 
 /*
  * Fetch disklabel for disk.
@@ -858,10 +858,10 @@
                        sectoffset = (off_t)dosdp->mbrp_start * DEV_BSIZE;
 #endif /* USE_MBR */
 
-#ifdef __arm32__
+#ifdef USE_ACORN
                /* XXX */
                sectoffset = (off_t)filecore_partition_offset * DEV_BSIZE;
-#endif /* __arm32__ */
+#endif /* USE_ACORN */
 
                if (lseek(f, sectoffset, SEEK_SET) < 0 ||
                    read(f, bootarea, BBSIZE) != BBSIZE)
@@ -955,11 +955,11 @@
                                sectoffset = (off_t)dosdp->mbrp_start * DEV_BSIZE;
 #endif /* USE_MBR */
 
-#ifdef __arm32__
+#ifdef USE_ACORN
                        /* XXX */
                        sectoffset = (off_t)filecore_partition_offset
                            * DEV_BSIZE;
-#endif /* __arm32__ */
+#endif /* USE_ACORN */
 
                        if (lseek(f, sectoffset, SEEK_SET) < 0 ||
                            read(f, boot, BBSIZE) != BBSIZE)



Home | Main Index | Thread Index | Old Index