summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/sys
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-08 15:37:49 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-20 09:58:21 +0200
commit165dd8ea1256d71d6a4f52c0a66dcc2799ef8f99 (patch)
treec42072a99573d4d7cc03b2263e2c0c6d53f9c691 /freebsd/sys/sys
parentrtems-bsd-chunk: Include missing header file (diff)
downloadrtems-libbsd-165dd8ea1256d71d6a4f52c0a66dcc2799ef8f99.tar.bz2
Update to FreeBSD Stable/9 2015-04-08
Diffstat (limited to 'freebsd/sys/sys')
-rw-r--r--freebsd/sys/sys/conf.h1
-rw-r--r--freebsd/sys/sys/mman.h1
-rw-r--r--freebsd/sys/sys/rman.h4
-rw-r--r--freebsd/sys/sys/sleepqueue.h7
-rw-r--r--freebsd/sys/sys/sockbuf.h2
-rw-r--r--freebsd/sys/sys/socket.h6
-rw-r--r--freebsd/sys/sys/sysctl.h302
-rw-r--r--freebsd/sys/sys/sysproto.h4
-rw-r--r--freebsd/sys/sys/systm.h16
-rw-r--r--freebsd/sys/sys/timetc.h2
10 files changed, 209 insertions, 136 deletions
diff --git a/freebsd/sys/sys/conf.h b/freebsd/sys/sys/conf.h
index a0a73522..b4f270f4 100644
--- a/freebsd/sys/sys/conf.h
+++ b/freebsd/sys/sys/conf.h
@@ -253,6 +253,7 @@ void clone_cleanup(struct clonedevs **);
int clone_create(struct clonedevs **, struct cdevsw *, int *unit, struct cdev **dev, int extra);
int count_dev(struct cdev *_dev);
+void delist_dev(struct cdev *_dev);
void destroy_dev(struct cdev *_dev);
int destroy_dev_sched(struct cdev *dev);
int destroy_dev_sched_cb(struct cdev *dev, void (*cb)(void *), void *arg);
diff --git a/freebsd/sys/sys/mman.h b/freebsd/sys/sys/mman.h
index c79ad86d..c96fedc2 100644
--- a/freebsd/sys/sys/mman.h
+++ b/freebsd/sys/sys/mman.h
@@ -211,6 +211,7 @@ struct shmfd {
struct timespec shm_mtime;
struct timespec shm_ctime;
struct timespec shm_birthtime;
+ ino_t shm_ino;
struct label *shm_label; /* MAC label */
const char *shm_path;
diff --git a/freebsd/sys/sys/rman.h b/freebsd/sys/sys/rman.h
index b34ef37d..547ff843 100644
--- a/freebsd/sys/sys/rman.h
+++ b/freebsd/sys/sys/rman.h
@@ -42,8 +42,8 @@
#define RF_ALLOCATED 0x0001 /* resource has been reserved */
#define RF_ACTIVE 0x0002 /* resource allocation has been activated */
#define RF_SHAREABLE 0x0004 /* resource permits contemporaneous sharing */
-#define RF_TIMESHARE 0x0008 /* resource permits time-division sharing */
-#define RF_WANTED 0x0010 /* somebody is waiting for this resource */
+#define RF_SPARE1 0x0008
+#define RF_SPARE2 0x0010
#define RF_FIRSTSHARE 0x0020 /* first in sharing list */
#define RF_PREFETCHABLE 0x0040 /* resource is prefetchable */
#define RF_OPTIONAL 0x0080 /* for bus_alloc_resources() */
diff --git a/freebsd/sys/sys/sleepqueue.h b/freebsd/sys/sys/sleepqueue.h
index ddec1478..4c4ea651 100644
--- a/freebsd/sys/sys/sleepqueue.h
+++ b/freebsd/sys/sys/sleepqueue.h
@@ -46,13 +46,6 @@
* call sleepq_set_timeout() after sleepq_add() to setup a timeout. It
* should then use one of the sleepq_timedwait() functions to block.
*
- * If the thread wants the sleep to be interruptible by signals, it can
- * call sleepq_catch_signals() after sleepq_add(). It should then use
- * one of the sleepq_wait_sig() functions to block. After the thread has
- * been resumed, it should call sleepq_calc_signal_retval() to determine
- * if it should return EINTR or ERESTART passing in the value returned from
- * the earlier call to sleepq_catch_signals().
- *
* A thread is normally resumed from a sleep queue by either the
* sleepq_signal() or sleepq_broadcast() functions. Sleepq_signal() wakes
* the thread with the highest priority that is sleeping on the specified
diff --git a/freebsd/sys/sys/sockbuf.h b/freebsd/sys/sys/sockbuf.h
index 84fd1aa1..76197aea 100644
--- a/freebsd/sys/sys/sockbuf.h
+++ b/freebsd/sys/sys/sockbuf.h
@@ -155,6 +155,8 @@ int sbreserve_locked(struct sockbuf *sb, u_long cc, struct socket *so,
struct thread *td);
struct mbuf *
sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff);
+struct mbuf *
+ sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff);
void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb);
int sbwait(struct sockbuf *sb);
int sblock(struct sockbuf *sb, int flags);
diff --git a/freebsd/sys/sys/socket.h b/freebsd/sys/sys/socket.h
index fee7f1fd..ff592cc0 100644
--- a/freebsd/sys/sys/socket.h
+++ b/freebsd/sys/sys/socket.h
@@ -222,7 +222,9 @@ struct accept_filter_arg {
#define AF_ARP 35
#define AF_BLUETOOTH 36 /* Bluetooth sockets */
#define AF_IEEE80211 37 /* IEEE 802.11 protocol */
-#define AF_MAX 38
+#define AF_INET_SDP 40 /* OFED Socket Direct Protocol ipv4 */
+#define AF_INET6_SDP 42 /* OFED Socket Direct Protocol ipv6 */
+#define AF_MAX 42
/*
* When allocating a new AF_ constant, please only allocate
* even numbered constants for FreeBSD until 134 as odd numbered AF_
@@ -344,6 +346,8 @@ struct sockproto {
#define PF_SCLUSTER AF_SCLUSTER
#define PF_ARP AF_ARP
#define PF_BLUETOOTH AF_BLUETOOTH
+#define PF_INET_SDP AF_INET_SDP
+#define PF_INET6_SDP AF_INET6_SDP
#define PF_MAX AF_MAX
diff --git a/freebsd/sys/sys/sysctl.h b/freebsd/sys/sys/sysctl.h
index 1fca343c..cfbbc7f3 100644
--- a/freebsd/sys/sys/sysctl.h
+++ b/freebsd/sys/sys/sysctl.h
@@ -121,7 +121,14 @@ struct ctlname {
#ifdef _KERNEL
#include <sys/linker_set.h>
-#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, \
+#ifdef KLD_MODULE
+/* XXX allow overspecification of type in external kernel modules */
+#define SYSCTL_CT_ASSERT_MASK CTLTYPE
+#else
+#define SYSCTL_CT_ASSERT_MASK 0
+#endif
+
+#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, \
intptr_t arg2, struct sysctl_req *req
/* definitions for sysctl_req 'lock' member */
@@ -237,53 +244,6 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
_bsd_sysctl_##parent##_##name##_children
#endif /* __rtems__ */
-/*
- * These macros provide type safety for sysctls. SYSCTL_ALLOWED_TYPES()
- * defines a transparent union of the allowed types. SYSCTL_ASSERT_TYPE()
- * and SYSCTL_ADD_ASSERT_TYPE() use the transparent union to assert that
- * the pointer matches the allowed types.
- *
- * The allow_0 member allows a literal 0 to be passed for ptr.
- */
-#define SYSCTL_ALLOWED_TYPES(type, decls) \
- union sysctl_##type { \
- long allow_0; \
- decls \
- } __attribute__((__transparent_union__)); \
- \
- static inline void * \
- __sysctl_assert_##type(union sysctl_##type ptr) \
- { \
- return (ptr.a); \
- } \
- struct __hack
-
-SYSCTL_ALLOWED_TYPES(INT, int *a; );
-SYSCTL_ALLOWED_TYPES(UINT, unsigned int *a; );
-SYSCTL_ALLOWED_TYPES(LONG, long *a; );
-SYSCTL_ALLOWED_TYPES(ULONG, unsigned long *a; );
-SYSCTL_ALLOWED_TYPES(INT64, int64_t *a; long long *b; );
-SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
-
-#ifdef notyet
-#define SYSCTL_ADD_ASSERT_TYPE(type, ptr) \
- __sysctl_assert_ ## type (ptr)
-#define SYSCTL_ASSERT_TYPE(type, ptr, parent, name) \
- _SYSCTL_ASSERT_TYPE(type, ptr, __LINE__, parent##_##name)
-#else
-#define SYSCTL_ADD_ASSERT_TYPE(type, ptr) ptr
-#define SYSCTL_ASSERT_TYPE(type, ptr, parent, name)
-#endif
-#define _SYSCTL_ASSERT_TYPE(t, p, l, id) \
- __SYSCTL_ASSERT_TYPE(t, p, l, id)
-#define __SYSCTL_ASSERT_TYPE(type, ptr, line, id) \
- static inline void \
- sysctl_assert_##line##_##id(void) \
- { \
- (void)__sysctl_assert_##type(ptr); \
- } \
- struct __hack
-
#ifndef NO_SYSCTL_DESCR
#define __DESCR(d) d
#else
@@ -308,130 +268,242 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
#define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, __DESCR(descr))
+/* This constructs a root node from which other nodes can hang. */
+#define SYSCTL_ROOT_NODE(nbr, name, access, handler, descr) \
+ SYSCTL_NODE(, nbr, name, access, handler, descr)
+
/* This constructs a node from which other oids can hang. */
#define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \
struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name); \
SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|(access), \
- (void*)&SYSCTL_NODE_CHILDREN(parent, name), 0, handler, "N", descr)
+ (void*)&SYSCTL_NODE_CHILDREN(parent, name), 0, handler, "N", descr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE)
-#define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access), \
- NULL, 0, handler, "N", __DESCR(descr))
-
-/* Oid for a string. len can be 0 to indicate '\0' termination. */
-#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|(access), \
- arg, len, sysctl_handle_string, "A", descr)
+#define SYSCTL_ADD_ROOT_NODE(ctx, nbr, name, access, handler, descr) \
+ SYSCTL_ADD_NODE(ctx, SYSCTL_STATIC_CHILDREN(), nbr, name, access, handler, descr)
-#define SYSCTL_ADD_STRING(ctx, parent, nbr, name, access, arg, len, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|(access), \
- arg, len, sysctl_handle_string, "A", __DESCR(descr))
+#define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \
+({ \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE); \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access), \
+ NULL, 0, handler, "N", __DESCR(descr)); \
+})
-/* Oid for an int. If ptr is NULL, val is returned. */
-#define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_ASSERT_TYPE(INT, ptr, parent, name); \
- SYSCTL_OID(parent, nbr, name, \
- CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \
- ptr, val, sysctl_handle_int, "I", descr)
+/* Oid for a string. len can be 0 to indicate '\0' termination. */
+#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|(access), \
+ arg, len, sysctl_handle_string, "A", descr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_STRING)
+
+#define SYSCTL_ADD_STRING(ctx, parent, nbr, name, access, arg, len, descr) \
+({ \
+ char *__arg = (arg); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_STRING); \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|(access), \
+ __arg, len, sysctl_handle_string, "A", __DESCR(descr)); \
+})
+
+/* Oid for an int. If ptr is SYSCTL_NULL_INT_PTR, val is returned. */
+#define SYSCTL_NULL_INT_PTR ((int *)NULL)
+#define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID(parent, nbr, name, \
+ CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \
+ ptr, val, sysctl_handle_int, "I", descr); \
+ CTASSERT((((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT) && \
+ sizeof(int) == sizeof(*(ptr)))
#define SYSCTL_ADD_INT(ctx, parent, nbr, name, access, ptr, val, descr) \
+({ \
+ int *__ptr = (ptr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \
- SYSCTL_ADD_ASSERT_TYPE(INT, ptr), val, \
- sysctl_handle_int, "I", __DESCR(descr))
+ __ptr, val, sysctl_handle_int, "I", __DESCR(descr)); \
+})
/* Oid for an unsigned int. If ptr is NULL, val is returned. */
-#define SYSCTL_UINT(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_ASSERT_TYPE(UINT, ptr, parent, name); \
- SYSCTL_OID(parent, nbr, name, \
- CTLTYPE_UINT | CTLFLAG_MPSAFE | (access), \
- ptr, val, sysctl_handle_int, "IU", descr)
+#define SYSCTL_NULL_UINT_PTR ((unsigned *)NULL)
+#define SYSCTL_UINT(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID(parent, nbr, name, \
+ CTLTYPE_UINT | CTLFLAG_MPSAFE | (access), \
+ ptr, val, sysctl_handle_int, "IU", descr); \
+ CTASSERT((((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_UINT) && \
+ sizeof(unsigned) == sizeof(*(ptr)))
#define SYSCTL_ADD_UINT(ctx, parent, nbr, name, access, ptr, val, descr) \
+({ \
+ unsigned *__ptr = (ptr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_UINT); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_UINT | CTLFLAG_MPSAFE | (access), \
- SYSCTL_ADD_ASSERT_TYPE(UINT, ptr), val, \
- sysctl_handle_int, "IU", __DESCR(descr))
+ __ptr, val, sysctl_handle_int, "IU", __DESCR(descr)); \
+})
/* Oid for a long. The pointer must be non NULL. */
-#define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_ASSERT_TYPE(LONG, ptr, parent, name); \
- SYSCTL_OID(parent, nbr, name, \
- CTLTYPE_LONG | CTLFLAG_MPSAFE | (access), \
- ptr, val, sysctl_handle_long, "L", descr)
+#define SYSCTL_NULL_LONG_PTR ((long *)NULL)
+#define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID(parent, nbr, name, \
+ CTLTYPE_LONG | CTLFLAG_MPSAFE | (access), \
+ ptr, val, sysctl_handle_long, "L", descr); \
+ CTASSERT((((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_LONG) && \
+ sizeof(long) == sizeof(*(ptr)))
#define SYSCTL_ADD_LONG(ctx, parent, nbr, name, access, ptr, descr) \
+({ \
+ long *__ptr = (ptr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_LONG); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_LONG | CTLFLAG_MPSAFE | (access), \
- SYSCTL_ADD_ASSERT_TYPE(LONG, ptr), 0, \
- sysctl_handle_long, "L", __DESCR(descr))
+ __ptr, 0, sysctl_handle_long, "L", __DESCR(descr)); \
+})
/* Oid for an unsigned long. The pointer must be non NULL. */
+#define SYSCTL_NULL_ULONG_PTR ((unsigned long *)NULL)
#define SYSCTL_ULONG(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_ASSERT_TYPE(ULONG, ptr, parent, name); \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_ULONG | CTLFLAG_MPSAFE | (access), \
- ptr, val, sysctl_handle_long, "LU", descr)
+ ptr, val, sysctl_handle_long, "LU", descr); \
+ CTASSERT((((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_ULONG) && \
+ sizeof(unsigned long) == sizeof(*(ptr)))
#define SYSCTL_ADD_ULONG(ctx, parent, nbr, name, access, ptr, descr) \
+({ \
+ unsigned long *__ptr = (ptr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_ULONG); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_ULONG | CTLFLAG_MPSAFE | (access), \
- SYSCTL_ADD_ASSERT_TYPE(ULONG, ptr), 0, \
- sysctl_handle_long, "LU", __DESCR(descr))
+ __ptr, 0, sysctl_handle_long, "LU", __DESCR(descr)); \
+})
/* Oid for a quad. The pointer must be non NULL. */
-#define SYSCTL_QUAD(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_ASSERT_TYPE(INT64, ptr, parent, name); \
- SYSCTL_OID(parent, nbr, name, \
- CTLTYPE_S64 | CTLFLAG_MPSAFE | (access), \
- ptr, val, sysctl_handle_64, "Q", descr)
+#define SYSCTL_NULL_QUAD_PTR ((int64_t *)NULL)
+#define SYSCTL_QUAD(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID(parent, nbr, name, \
+ CTLTYPE_S64 | CTLFLAG_MPSAFE | (access), \
+ ptr, val, sysctl_handle_64, "Q", descr); \
+ CTASSERT((((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64) && \
+ sizeof(int64_t) == sizeof(*(ptr)))
#define SYSCTL_ADD_QUAD(ctx, parent, nbr, name, access, ptr, descr) \
+({ \
+ int64_t *__ptr = (ptr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_S64 | CTLFLAG_MPSAFE | (access), \
- SYSCTL_ADD_ASSERT_TYPE(INT64, ptr), 0, \
- sysctl_handle_64, "Q", __DESCR(descr))
+ __ptr, 0, sysctl_handle_64, "Q", __DESCR(descr)); \
+})
+#define SYSCTL_NULL_UQUAD_PTR ((uint64_t *)NULL)
#define SYSCTL_UQUAD(parent, nbr, name, access, ptr, val, descr) \
- SYSCTL_ASSERT_TYPE(UINT64, ptr, parent, name); \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \
- ptr, val, sysctl_handle_64, "QU", descr)
+ ptr, val, sysctl_handle_64, "QU", descr); \
+ CTASSERT((((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64) && \
+ sizeof(uint64_t) == sizeof(*(ptr)))
#define SYSCTL_ADD_UQUAD(ctx, parent, nbr, name, access, ptr, descr) \
+({ \
+ uint64_t *__ptr = (ptr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \
+ sysctl_add_oid(ctx, parent, nbr, name, \
+ CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \
+ __ptr, 0, sysctl_handle_64, "QU", __DESCR(descr)); \
+})
+
+/* Oid for a 64-bit unsigned counter(9). The pointer must be non NULL. */
+#define SYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, descr) \
+ SYSCTL_ASSERT_TYPE(UINT64, ptr, parent, name); \
+ SYSCTL_OID(parent, nbr, name, \
+ CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \
+ ptr, 0, sysctl_handle_counter_u64, "QU", descr)
+
+#define SYSCTL_ADD_COUNTER_U64(ctx, parent, nbr, name, access, ptr, descr)\
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \
SYSCTL_ADD_ASSERT_TYPE(UINT64, ptr), 0, \
- sysctl_handle_64, "QU", __DESCR(descr))
+ sysctl_handle_counter_u64, "QU", __DESCR(descr))
+
+/* Oid for a CPU dependant variable */
+#define SYSCTL_ADD_UAUTO(ctx, parent, nbr, name, access, ptr, descr) \
+({ \
+ struct sysctl_oid *__ret; \
+ CTASSERT((sizeof(uint64_t) == sizeof(*(ptr)) || \
+ sizeof(unsigned) == sizeof(*(ptr))) && \
+ ((access) & CTLTYPE) == 0); \
+ if (sizeof(uint64_t) == sizeof(*(ptr))) { \
+ __ret = sysctl_add_oid(ctx, parent, nbr, name, \
+ CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \
+ (ptr), 0, sysctl_handle_64, "QU", \
+ __DESCR(descr)); \
+ } else { \
+ __ret = sysctl_add_oid(ctx, parent, nbr, name, \
+ CTLTYPE_UINT | CTLFLAG_MPSAFE | (access), \
+ (ptr), 0, sysctl_handle_int, "IU", \
+ __DESCR(descr)); \
+ } \
+ __ret; \
+})
/* 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), \
- ptr, len, sysctl_handle_opaque, fmt, descr)
-
-#define SYSCTL_ADD_OPAQUE(ctx, parent, nbr, name, access, ptr, len, fmt, descr)\
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
- ptr, len, sysctl_handle_opaque, fmt, __DESCR(descr))
+#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
+ ptr, len, sysctl_handle_opaque, fmt, descr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE)
+
+#define SYSCTL_ADD_OPAQUE(ctx, parent, nbr, name, access, ptr, len, fmt, descr) \
+({ \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
+ ptr, len, sysctl_handle_opaque, fmt, __DESCR(descr)); \
+})
/* Oid for a struct. Specified by a pointer and a type. */
-#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) \
- SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
- ptr, sizeof(struct type), sysctl_handle_opaque, \
- "S," #type, descr)
+#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
+ ptr, sizeof(struct type), sysctl_handle_opaque, \
+ "S," #type, descr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE)
#define SYSCTL_ADD_STRUCT(ctx, parent, nbr, name, access, ptr, type, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
- ptr, sizeof(struct type), sysctl_handle_opaque, "S," #type, __DESCR(descr))
+({ \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \
+ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
+ (ptr), sizeof(struct type), \
+ sysctl_handle_opaque, "S," #type, __DESCR(descr)); \
+})
/* Oid for a procedure. Specified by a pointer and an arg. */
#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
- CTASSERT(((access) & CTLTYPE) != 0); \
- SYSCTL_OID(parent, nbr, name, (access), \
- ptr, arg, handler, fmt, descr)
+ SYSCTL_OID(parent, nbr, name, (access), \
+ ptr, arg, handler, fmt, descr); \
+ CTASSERT(((access) & CTLTYPE) != 0)
#define SYSCTL_ADD_PROC(ctx, parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, (access), \
- ptr, arg, handler, fmt, __DESCR(descr))
+({ \
+ CTASSERT(((access) & CTLTYPE) != 0); \
+ sysctl_add_oid(ctx, parent, nbr, name, (access), \
+ (ptr), (arg), (handler), (fmt), __DESCR(descr)); \
+})
/*
* A macro to generate a read-only sysctl to indicate the presense of optional
@@ -439,7 +511,7 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
*/
#define FEATURE(name, desc) \
SYSCTL_INT(_kern_features, OID_AUTO, name, CTLFLAG_RD | CTLFLAG_CAPRD, \
- 0, 1, desc)
+ SYSCTL_NULL_INT_PTR, 1, desc)
#endif /* _KERNEL */
diff --git a/freebsd/sys/sys/sysproto.h b/freebsd/sys/sys/sysproto.h
index ed58a487..5af3b62c 100644
--- a/freebsd/sys/sys/sysproto.h
+++ b/freebsd/sys/sys/sysproto.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/9/sys/kern/syscalls.master 260208 2014-01-02 21:57:03Z jhb
+ * created from FreeBSD: stable/9/sys/kern/syscalls.master 276957 2015-01-11 07:10:43Z dchagin
*/
#ifndef _SYS_SYSPROTO_H_
@@ -934,7 +934,7 @@ struct munlockall_args {
register_t dummy;
};
struct __getcwd_args {
- char buf_l_[PADL_(u_char *)]; u_char * buf; char buf_r_[PADR_(u_char *)];
+ char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
char buflen_l_[PADL_(u_int)]; u_int buflen; char buflen_r_[PADR_(u_int)];
};
struct sched_setparam_args {
diff --git a/freebsd/sys/sys/systm.h b/freebsd/sys/sys/systm.h
index f0a3fc63..c761555e 100644
--- a/freebsd/sys/sys/systm.h
+++ b/freebsd/sys/sys/systm.h
@@ -47,11 +47,12 @@
#ifndef __rtems__
extern int cold; /* nonzero if we are doing a cold boot */
+extern int rebooting; /* kern_reboot() has been called. */
#else /* __rtems__ */
-/* In RTEMS there is no cold boot */
+/* In RTEMS there is no cold boot and reboot */
#define cold 0
+#define rebooting 0
#endif /* __rtems__ */
-extern int rebooting; /* kern_reboot() has been called. */
#ifndef __rtems__
extern const char *panicstr; /* panic message */
#else /* __rtems__ */
@@ -110,10 +111,8 @@ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN };
} while (0)
#endif
-#ifndef CTASSERT /* Allow lint to override */
-#define CTASSERT(x) _CTASSERT(x, __LINE__)
-#define _CTASSERT(x, y) __CTASSERT(x, y)
-#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1]
+#ifndef CTASSERT /* Allow lint to override */
+#define CTASSERT(x) _Static_assert(x, "compile-time assertion failed")
#endif
/*
@@ -372,8 +371,9 @@ void cpu_startprofclock(void);
void cpu_stopprofclock(void);
void cpu_idleclock(void);
void cpu_activeclock(void);
-extern int cpu_can_deep_sleep;
-extern int cpu_disable_deep_sleep;
+extern int cpu_deepest_sleep;
+extern int cpu_disable_c2_sleep;
+extern int cpu_disable_c3_sleep;
#ifndef __rtems__
int cr_cansee(struct ucred *u1, struct ucred *u2);
diff --git a/freebsd/sys/sys/timetc.h b/freebsd/sys/sys/timetc.h
index 4f75c3de..7e00ffc8 100644
--- a/freebsd/sys/sys/timetc.h
+++ b/freebsd/sys/sys/timetc.h
@@ -58,7 +58,7 @@ struct timecounter {
* means "only use at explicit request".
*/
u_int tc_flags;
-#define TC_FLAGS_C3STOP 1 /* Timer dies in C3. */
+#define TC_FLAGS_C2STOP 1 /* Timer dies in C2+. */
void *tc_priv;
/* Pointer to the timecounter's private parts. */