sys: make callout.h self-contained

Avoid including sys/types.h from sys/_callout.h (as we try to avoid having
headers starting with underscores depending on non-underscore headers)
by introducing __sbintime_t in sys/_types.h and including that header
instead.

Reviewed by:	imp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33500
This commit is contained in:
Kristof Provost 2021-12-15 20:22:41 +01:00
parent c658610b92
commit 959af5a89b
3 changed files with 5 additions and 3 deletions

View File

@ -40,6 +40,7 @@
#ifndef _SYS__CALLOUT_H
#define _SYS__CALLOUT_H
#include <sys/_types.h>
#include <sys/queue.h>
struct lock_object;
@ -56,8 +57,8 @@ struct callout {
SLIST_ENTRY(callout) sle;
TAILQ_ENTRY(callout) tqe;
} c_links;
sbintime_t c_time; /* ticks to the event */
sbintime_t c_precision; /* delta allowed wrt opt */
__sbintime_t c_time; /* ticks to the event */
__sbintime_t c_precision; /* delta allowed wrt opt */
void *c_arg; /* function argument */
callout_func_t *c_func; /* function to call */
struct lock_object *c_lock; /* lock to handle */

View File

@ -133,6 +133,7 @@ typedef __uint64_t __nlink_t; /* link count */
typedef __int64_t __off_t; /* file offset */
typedef __int64_t __off64_t; /* file offset (alias) */
typedef __int32_t __pid_t; /* process [group] */
typedef __int64_t __sbintime_t;
typedef __int64_t __rlim_t; /* resource limit - intentionally */
/* signed, because of legacy code */
/* that uses -1 for RLIM_INFINITY */

View File

@ -193,7 +193,7 @@ typedef __rlim_t rlim_t; /* resource limit */
#define _RLIM_T_DECLARED
#endif
typedef __int64_t sbintime_t;
typedef __sbintime_t sbintime_t;
typedef __segsz_t segsz_t; /* segment size (in pages) */