There appear to be 330 uses of SYSCTL and QUAD on the same line in
CURRENT.  This seems reasonable to change them to S64, U64 and X64 so
they correctly reflect the size they operate upon.

What do y'all think?

Thanks,
matthew

On Thu, Jan 13, 2011 at 10:20 AM, Matthew D Fleming <m...@freebsd.org> wrote:
> Author: mdf
> Date: Thu Jan 13 18:20:33 2011
> New Revision: 217369
> URL: http://svn.freebsd.org/changeset/base/217369
>
> Log:
>  Add a 64-bit hex-printed sysctl(9) since there is at least one place in
>  the code that wanted it.  It is named X64 rather than XQUAD since the
>  quad name is a historical abomination that should not be perpetuated.
>
> Modified:
>  head/sys/cam/scsi/scsi_da.c
>  head/sys/sys/sysctl.h
>
> Modified: head/sys/cam/scsi/scsi_da.c
> ==============================================================================
> --- head/sys/cam/scsi/scsi_da.c Thu Jan 13 18:20:27 2011        (r217368)
> +++ head/sys/cam/scsi/scsi_da.c Thu Jan 13 18:20:33 2011        (r217369)
> @@ -1127,9 +1127,9 @@ dasysctlinit(void *context, int pending)
>                struct ccb_trans_settings_fc *fc = &cts.xport_specific.fc;
>                if (fc->valid & CTS_FC_VALID_WWPN) {
>                        softc->wwpn = fc->wwpn;
> -                       SYSCTL_ADD_XLONG(&softc->sysctl_ctx,
> +                       SYSCTL_ADD_X64(&softc->sysctl_ctx,
>                            SYSCTL_CHILDREN(softc->sysctl_tree),
> -                           OID_AUTO, "wwpn", CTLTYPE_QUAD | CTLFLAG_RD,
> +                           OID_AUTO, "wwpn", CTLFLAG_RD,
>                            &softc->wwpn, "World Wide Port Name");
>                }
>        }
>
> Modified: head/sys/sys/sysctl.h
> ==============================================================================
> --- head/sys/sys/sysctl.h       Thu Jan 13 18:20:27 2011        (r217368)
> +++ head/sys/sys/sysctl.h       Thu Jan 13 18:20:33 2011        (r217369)
> @@ -245,6 +245,8 @@ SYSCTL_ALLOWED_TYPES(ULONG, unsigned lon
>  SYSCTL_ALLOWED_TYPES(XLONG, unsigned long *a; long *b; );
>  SYSCTL_ALLOWED_TYPES(INT64, int64_t *a; long long *b; );
>  SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
> +SYSCTL_ALLOWED_TYPES(XINT64, uint64_t *a; int64_t *b;
> +    unsigned long long *c; long long *d; );
>
>  #ifdef notyet
>  #define        SYSCTL_ADD_ASSERT_TYPE(type, ptr)       \
> @@ -389,7 +391,6 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a
>            SYSCTL_ADD_ASSERT_TYPE(INT64, ptr), 0,                      \
>            sysctl_handle_quad, "Q", __DESCR(descr))
>
> -/* Oid for a quad.  The pointer must be non NULL. */
>  #define        SYSCTL_UQUAD(parent, nbr, name, access, ptr, val, descr)      
>   \
>        SYSCTL_ASSERT_TYPE(UINT64, ptr, parent, name);                  \
>        SYSCTL_OID(parent, nbr, name,                                   \
> @@ -402,6 +403,18 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a
>            SYSCTL_ADD_ASSERT_TYPE(UINT64, ptr), 0,                     \
>            sysctl_handle_quad, "QU", __DESCR(descr))
>
> +#define        SYSCTL_X64(parent, nbr, name, access, ptr, val, descr)  \
> +       SYSCTL_ASSERT_TYPE(XINT64, ptr, parent, name);                  \
> +       SYSCTL_OID(parent, nbr, name,                                   \
> +           CTLTYPE_QUAD | CTLFLAG_MPSAFE | (access),   \
> +           ptr, val, sysctl_handle_quad, "QX", descr)
> +
> +#define        SYSCTL_ADD_X64(ctx, parent, nbr, name, access, ptr, descr)    
>   \
> +       sysctl_add_oid(ctx, parent, nbr, name,                          \
> +           CTLTYPE_QUAD | CTLFLAG_MPSAFE | (access),                   \
> +           SYSCTL_ADD_ASSERT_TYPE(XINT64, ptr), 0,                     \
> +           sysctl_handle_quad, "QX", __DESCR(descr))
> +
>  /* Oid for an opaque object.  Specified by a pointer and a length. */
>  #define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
>        SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
>
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to