On 10/21/14 18:16, Konstantin Belousov wrote:
On Tue, Oct 21, 2014 at 07:31:22AM +0000, Hans Petter Selasky wrote:
Author: hselasky
Date: Tue Oct 21 07:31:21 2014
New Revision: 273377
URL: https://svnweb.freebsd.org/changeset/base/273377

Log:
   Fix multiple incorrect SYSCTL arguments in the kernel:

   - Wrong integer type was specified.

   - Wrong or missing "access" specifier. The "access" specifier
   sometimes included the SYSCTL type, which it should not, except for
   procedural SYSCTL nodes.

   - Logical OR where binary OR was expected.

   - Properly assert the "access" argument passed to all SYSCTL macros,
   using the CTASSERT macro. This applies to both static- and dynamically
   created SYSCTLs.

   - Properly assert the the data type for both static and dynamic
   SYSCTLs. In the case of static SYSCTLs we only assert that the data
   pointed to by the SYSCTL data pointer has the correct size, hence
   there is no easy way to assert types in the C language outside a
   C-function.

   - Rewrote some code which doesn't pass a constant "access" specifier
   when creating dynamic SYSCTL nodes, which is now a requirement.

   - Updated "EXAMPLES" section in SYSCTL manual page.

   MFC after:   3 days
   Sponsored by:        Mellanox Technologies

Modified:
   head/share/man/man9/Makefile
   head/share/man/man9/sysctl.9
   head/sys/amd64/amd64/fpu.c
   head/sys/arm/arm/busdma_machdep-v6.c
   head/sys/arm/arm/busdma_machdep.c
   head/sys/cam/scsi/scsi_sa.c
   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
   head/sys/cddl/dev/dtrace/dtrace_sysctl.c
   head/sys/compat/ndis/kern_ndis.c
   head/sys/dev/acpi_support/acpi_asus.c
   head/sys/dev/acpi_support/acpi_asus_wmi.c
   head/sys/dev/acpi_support/acpi_hp.c
   head/sys/dev/acpi_support/acpi_ibm.c
   head/sys/dev/acpi_support/acpi_rapidstart.c
   head/sys/dev/acpi_support/acpi_sony.c
   head/sys/dev/bxe/bxe.c
   head/sys/dev/cxgb/cxgb_sge.c
   head/sys/dev/cxgbe/t4_main.c
   head/sys/dev/e1000/if_em.c
   head/sys/dev/e1000/if_igb.c
   head/sys/dev/e1000/if_lem.c
   head/sys/dev/hatm/if_hatm.c
   head/sys/dev/ixgbe/ixgbe.c
   head/sys/dev/ixgbe/ixv.c
   head/sys/dev/ixl/if_ixl.c
   head/sys/dev/mpr/mpr.c
   head/sys/dev/mps/mps.c
   head/sys/dev/mrsas/mrsas.c
   head/sys/dev/mrsas/mrsas.h
   head/sys/dev/mxge/if_mxge.c
   head/sys/dev/oce/oce_sysctl.c
   head/sys/dev/qlxgb/qla_os.c
   head/sys/dev/qlxgbe/ql_os.c
   head/sys/dev/rt/if_rt.c
   head/sys/dev/sound/pci/hda/hdaa.c
   head/sys/dev/vxge/vxge.c
   head/sys/dev/xen/netfront/netfront.c
   head/sys/fs/devfs/devfs_devs.c
   head/sys/fs/fuse/fuse_main.c
   head/sys/fs/fuse/fuse_vfsops.c
   head/sys/geom/geom_kern.c
   head/sys/kern/kern_cpuset.c
   head/sys/kern/kern_descrip.c
   head/sys/kern/kern_mib.c
   head/sys/kern/kern_synch.c
   head/sys/kern/subr_devstat.c
   head/sys/kern/subr_kdb.c
   head/sys/kern/subr_uio.c
   head/sys/kern/vfs_cache.c
   head/sys/mips/mips/busdma_machdep.c
   head/sys/net80211/ieee80211_ht.c
   head/sys/net80211/ieee80211_hwmp.c
   head/sys/net80211/ieee80211_mesh.c
   head/sys/net80211/ieee80211_superg.c
   head/sys/netgraph/bluetooth/common/ng_bluetooth.c
   head/sys/netgraph/ng_base.c
   head/sys/netgraph/ng_socket.c
   head/sys/netinet/cc/cc_chd.c
   head/sys/netinet/tcp_timer.c
   head/sys/netipsec/ipsec.h
   head/sys/netpfil/pf/pf.c
   head/sys/ofed/drivers/net/mlx4/mlx4_en.h
   head/sys/powerpc/powermac/fcu.c
   head/sys/powerpc/powermac/smu.c
   head/sys/powerpc/powerpc/cpu.c
   head/sys/sys/sysctl.h
   head/sys/vm/memguard.c
   head/sys/vm/vm_kern.c
   head/sys/x86/x86/busdma_bounce.c

This seems to break at least PowerPC 64bit, or some bits were not
committed.  I have to add the following change to compile GENERIC64
kernel, otherwise I get

cc1: warnings being treated as errors
/usr/home/kostik/work/build/bsd/DEV/src/sys/powerpc/powerpc/busdma_machdep.c: 
In function 'alloc_bounce_zone':
/usr/home/kostik/work/build/bsd/DEV/src/sys/powerpc/powerpc/busdma_machdep.c:1030:
 warning: initialization from incompatible pointer type
*** [busdma_machdep.o] Error code 1

OTOH, I did not verified that 32bit PowerPC kernel is compilable with
the change applied.

diff --git a/sys/powerpc/powerpc/busdma_machdep.c 
b/sys/powerpc/powerpc/busdma_machdep.c
index e35ecec..b58a91b 100644
--- a/sys/powerpc/powerpc/busdma_machdep.c
+++ b/sys/powerpc/powerpc/busdma_machdep.c
@@ -1027,9 +1027,9 @@ alloc_bounce_zone(bus_dma_tag_t dmat)
        SYSCTL_ADD_STRING(busdma_sysctl_tree(bz),
            SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO,
            "lowaddr", CTLFLAG_RD, bz->lowaddrid, 0, "");
-       SYSCTL_ADD_INT(busdma_sysctl_tree(bz),
+       SYSCTL_ADD_ULONG(busdma_sysctl_tree(bz),
            SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO,
-           "alignment", CTLFLAG_RD, &bz->alignment, 0, "");
+           "alignment", CTLFLAG_RD, &bz->alignment, "");

        return (0);
  }



It think it is better to have it UAUTO, so that the macro will choose 32-bit or 64-bit.

Sorry for the breakage. Thought that universe had passed. Will fix it shortly.

--HPS
_______________________________________________
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