Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/dev/isa Pull up revisions 1.68-1.69 (requested by f...



details:   https://anonhg.NetBSD.org/src/rev/faa6c51e978a
branches:  netbsd-1-5
changeset: 491529:faa6c51e978a
user:      he <he%NetBSD.org@localhost>
date:      Tue May 01 12:27:18 2001 +0000

description:
Pull up revisions 1.68-1.69 (requested by fvdl):
  Increase the number of BSD disklabel partitions on i386 to 16.

diffstat:

 sys/dev/isa/mcd.c |  41 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 39 insertions(+), 2 deletions(-)

diffs (91 lines):

diff -r 03242ab2b3c7 -r faa6c51e978a sys/dev/isa/mcd.c
--- a/sys/dev/isa/mcd.c Tue May 01 12:27:14 2001 +0000
+++ b/sys/dev/isa/mcd.c Tue May 01 12:27:18 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcd.c,v 1.66 2000/03/23 07:01:35 thorpej Exp $ */
+/*     $NetBSD: mcd.c,v 1.66.4.1 2001/05/01 12:27:18 he Exp $  */
 
 /*
  * Copyright (c) 1993, 1994, 1995 Charles M. Hannum.  All rights reserved.
@@ -604,6 +604,9 @@
        struct mcd_softc *sc = mcd_cd.cd_devs[MCDUNIT(dev)];
        int error;
        int part;
+#ifdef __HAVE_OLD_DISKLABEL
+       struct disklabel newlabel;
+#endif
        
        MCD_TRACE("ioctl: cmd=0x%x\n", cmd, 0, 0, 0);
 
@@ -615,6 +618,14 @@
        case DIOCGDINFO:
                *(struct disklabel *)addr = *(sc->sc_dk.dk_label);
                return 0;
+ifdef __HAVE_OLD_DISKLABEL
+       case ODIOCGDINFO:
+               newlabel = *(sc->sc_dk.dk_label);
+               if (newlabel.d_npartitions > OLDMAXPARTITIONS)
+                       return ENOTTY;
+               memcpy(addr, &newlabel, sizeof (struct olddisklabel));
+               return 0;
+#endif
 
        case DIOCGPART:
                ((struct partinfo *)addr)->disklab = sc->sc_dk.dk_label;
@@ -624,15 +635,31 @@
 
        case DIOCWDINFO:
        case DIOCSDINFO:
+#ifdef __HAVE_OLD_DISKLABEL
+       case ODIOCWDINFO:
+       case ODIOCSDINFO:
+#endif
+       {
+               struct disklabel *lp;
+
                if ((flag & FWRITE) == 0)
                        return EBADF;
 
+#ifdef __HAVE_OLD_DISKLABEL
+               if (cmd == ODIOCSDINFO || cmd == ODIOCWDINFO) {
+                       memset(&newlabel, 0, sizeof newlabel);
+                       memcpy(&newlabel, addr, sizeof (struct olddisklabel));
+                       lp = &newlabel;
+               } else
+#endif
+               lp = (struct disklabel *)addr;
+
                if ((error = mcdlock(sc)) != 0)
                        return error;
                sc->flags |= MCDF_LABELLING;
 
                error = setdisklabel(sc->sc_dk.dk_label,
-                   (struct disklabel *)addr, /*sc->sc_dk.dk_openmask : */0,
+                   lp, /*sc->sc_dk.dk_openmask : */0,
                    sc->sc_dk.dk_cpulabel);
                if (error == 0) {
                }
@@ -640,6 +667,7 @@
                sc->flags &= ~MCDF_LABELLING;
                mcdunlock(sc);
                return error;
+       }
 
        case DIOCWLABEL:
                return EBADF;
@@ -648,6 +676,15 @@
                mcdgetdefaultlabel(sc, (struct disklabel *)addr);
                return 0;
 
+#ifdef __HAVE_OLD_DISKLABEL
+       case ODIOCGDEFLABEL:
+               mcdgetdefaultlabel(sc, &newlabel);
+               if (newlabel.d_npartitions > OLDMAXPARTITIONS)
+                       return ENOTTY;
+               memcpy(addr, &newlabel, sizeof (struct olddisklabel));
+               return 0;
+#endif
+
        case CDIOCPLAYTRACKS:
                return mcd_playtracks(sc, (struct ioc_play_track *)addr);
        case CDIOCPLAYMSF:



Home | Main Index | Thread Index | Old Index