Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/stand Don't LOAD_BACKWARDS for floppies.



details:   https://anonhg.NetBSD.org/src/rev/2f050f6f883f
branches:  trunk
changeset: 757339:2f050f6f883f
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Aug 25 18:11:54 2010 +0000

description:
Don't LOAD_BACKWARDS for floppies.

diffstat:

 sys/arch/sparc/stand/boot/boot.c      |   8 ++++++--
 sys/arch/sparc/stand/common/promdev.c |  14 ++++++++++----
 sys/arch/sparc/stand/common/promdev.h |   5 ++++-
 3 files changed, 20 insertions(+), 7 deletions(-)

diffs (84 lines):

diff -r a1b7fbc31099 -r 2f050f6f883f sys/arch/sparc/stand/boot/boot.c
--- a/sys/arch/sparc/stand/boot/boot.c  Wed Aug 25 18:11:20 2010 +0000
+++ b/sys/arch/sparc/stand/boot/boot.c  Wed Aug 25 18:11:54 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.24 2007/03/04 06:00:47 christos Exp $ */
+/*     $NetBSD: boot.c,v 1.25 2010/08/25 18:11:54 christos Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -170,6 +170,7 @@
        vaddr_t va;
        paddr_t pa;
        u_long size;
+       int flags = LOAD_KERNEL;
 
        if ((fd = open(kernel, 0)) < 0)
                return (errno ? errno : ENOENT);
@@ -224,8 +225,11 @@
                loadaddrmask = 0x07ffffffUL;
        }
 
+       if (promdev_isfloppy())
+               flags &= ~LOAD_BACKWARDS;
+
        marks[MARK_START] = 0;
-       error = fdloadfile(fd, marks, LOAD_KERNEL);
+       error = fdloadfile(fd, marks, flags);
 out:
        close(fd);
        return (error);
diff -r a1b7fbc31099 -r 2f050f6f883f sys/arch/sparc/stand/common/promdev.c
--- a/sys/arch/sparc/stand/common/promdev.c     Wed Aug 25 18:11:20 2010 +0000
+++ b/sys/arch/sparc/stand/common/promdev.c     Wed Aug 25 18:11:54 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: promdev.c,v 1.23 2009/10/18 06:24:21 tsutsui Exp $ */
+/*     $NetBSD: promdev.c,v 1.24 2010/08/25 18:11:54 christos Exp $ */
 
 /*
  * Copyright (c) 1993 Paul Kranenburg
@@ -106,6 +106,14 @@
 #endif
 
 
+int
+bootdev_isfloppy(void)
+{
+       return strncmp(prom_bootdevice, "fd", 2) == 0 ||
+               strstr(prom_bootdevice, "SUNW,fdtwo") != NULL ||
+               strstr(prom_bootdevice, "fdthree") != NULL;
+}
+
 void
 putchar(int c)
 {
@@ -219,9 +227,7 @@
                 * Don't check disklabel on floppy boot since
                 * reopening it could cause Data Access Exception later.
                 */
-               if (strncmp(prom_bootdevice, "fd", 2) == 0 ||
-                   strstr(prom_bootdevice, "SUNW,fdtwo") != NULL ||
-                   strstr(prom_bootdevice, "fdthree") != NULL)
+               if (bootdev_isfloppy())
                        return 0;
 
                /*
diff -r a1b7fbc31099 -r 2f050f6f883f sys/arch/sparc/stand/common/promdev.h
--- a/sys/arch/sparc/stand/common/promdev.h     Wed Aug 25 18:11:20 2010 +0000
+++ b/sys/arch/sparc/stand/common/promdev.h     Wed Aug 25 18:11:54 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: promdev.h,v 1.14 2009/01/12 11:32:44 tsutsui Exp $ */
+/*     $NetBSD: promdev.h,v 1.15 2010/08/25 18:11:54 christos Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -70,6 +70,9 @@
 extern int     (*pmap_map)(vaddr_t, paddr_t, psize_t);
 extern int     (*pmap_extract)(vaddr_t, paddr_t *);
 
+/* In promdev.c */
+extern int     bootdev_isfloppy(void);
+
 /* In str0.S: */
 extern void    sparc_noop(void);
 extern void    *romp;



Home | Main Index | Thread Index | Old Index