summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormdf <mdf@FreeBSD.org>2011-01-13 18:20:33 +0000
committermdf <mdf@FreeBSD.org>2011-01-13 18:20:33 +0000
commitc6121061dca348489bf5f45ce0cd136f6aca9abb (patch)
treecec0409da51735c0ef00a56cdb53790b37ce6d9f
parent306bf0c0556146f31a267cdfb61f5a21546d9693 (diff)
downloadFreeBSD-src-c6121061dca348489bf5f45ce0cd136f6aca9abb.zip
FreeBSD-src-c6121061dca348489bf5f45ce0cd136f6aca9abb.tar.gz
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.
-rw-r--r--sys/cam/scsi/scsi_da.c4
-rw-r--r--sys/sys/sysctl.h15
2 files changed, 16 insertions, 3 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index b3b968c..ad58ac4 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 94b5204..aeb41fd 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), \
OpenPOWER on IntegriCloud