From c6121061dca348489bf5f45ce0cd136f6aca9abb Mon Sep 17 00:00:00 2001 From: mdf Date: Thu, 13 Jan 2011 18:20:33 +0000 Subject: [PATCH] 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. --- sys/cam/scsi/scsi_da.c | 4 ++-- sys/sys/sysctl.h | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index b3b968cc8324..ad58ac458b47 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -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"); } } diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 94b5204b5e7d..aeb41fd88f32 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -245,6 +245,8 @@ SYSCTL_ALLOWED_TYPES(ULONG, unsigned long *a; ); 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; unsigned long long *b; ); 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; unsigned long long *b; ); 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), \