Author: kib
Date: Fri Apr  1 13:20:39 2011
New Revision: 220243
URL: http://svn.freebsd.org/changeset/base/220243

Log:
  MFC r219988:
  Fully emulate MDIOCLIST for compat32.

Modified:
  stable/8/sys/compat/freebsd32/freebsd32_ioctl.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/freebsd32/freebsd32_ioctl.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_ioctl.c     Fri Apr  1 12:52:55 
2011        (r220242)
+++ stable/8/sys/compat/freebsd32/freebsd32_ioctl.c     Fri Apr  1 13:20:39 
2011        (r220243)
@@ -64,7 +64,7 @@ freebsd32_ioctl_md(struct thread *td, st
        struct md_ioctl mdv;
        struct md_ioctl32 md32;
        u_long com = 0;
-       int error;
+       int i, error;
 
        if (uap->com & IOC_IN) {
                if ((error = copyin(uap->data, &md32, sizeof(md32)))) {
@@ -116,6 +116,14 @@ freebsd32_ioctl_md(struct thread *td, st
                CP(mdv, md32, md_base);
                CP(mdv, md32, md_fwheads);
                CP(mdv, md32, md_fwsectors);
+               if (com == MDIOCLIST) {
+                       /*
+                        * Use MDNPAD, and not MDNPAD32.  Padding is
+                        * allocated and used by compat32 ABI.
+                        */
+                       for (i = 0; i < MDNPAD; i++)
+                               CP(mdv, md32, md_pad[i]);
+               }
                error = copyout(&md32, uap->data, sizeof(md32));
        }
        return error;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to