Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/i386 initialize i386_alldisks



details:   https://anonhg.NetBSD.org/src/rev/b938459c4fd4
branches:  trunk
changeset: 515234:b938459c4fd4
user:      petrov <petrov%NetBSD.org@localhost>
date:      Wed Sep 19 20:25:48 2001 +0000

description:
initialize i386_alldisks

diffstat:

 sys/arch/i386/i386/autoconf.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r d73a6d29ba52 -r b938459c4fd4 sys/arch/i386/i386/autoconf.c
--- a/sys/arch/i386/i386/autoconf.c     Wed Sep 19 19:04:16 2001 +0000
+++ b/sys/arch/i386/i386/autoconf.c     Wed Sep 19 20:25:48 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.56 2001/05/05 17:53:59 jdolecek Exp $   */
+/*     $NetBSD: autoconf.c,v 1.57 2001/09/19 20:25:48 petrov Exp $     */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -148,6 +148,7 @@
        int i, ck, error, m, n;
        struct vnode *tv;
        char mbr[DEV_BSIZE];
+       int  dklist_size;
 
        big = lookup_bootinfo(BTINFO_BIOSGEOM);
 
@@ -168,13 +169,16 @@
        if (i386_ndisks == 0)
                return;
 
+       dklist_size = sizeof (struct disklist) + (i386_ndisks - 1) *
+           sizeof (struct nativedisk_info);
+
        /* XXX M_TEMP is wrong */
-       i386_alldisks = malloc(sizeof (struct disklist) + (i386_ndisks - 1) *
-                               sizeof (struct nativedisk_info),
-                               M_TEMP, M_NOWAIT);
+       i386_alldisks = malloc(dklist_size, M_TEMP, M_NOWAIT);
        if (i386_alldisks == NULL)
                return;
 
+       memset(i386_alldisks, 0, dklist_size);
+
        i386_alldisks->dl_nnativedisks = i386_ndisks;
        i386_alldisks->dl_nbiosdisks = big->num;
        for (i = 0; i < big->num; i++) {



Home | Main Index | Thread Index | Old Index