Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions contrib/ntp/sntp/libopts/enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
* 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
*/

#include <stddef.h>

static void
enum_err(tOptions * pOpts, tOptDesc * pOD,
char const * const * paz_names, int name_ct)
Expand Down
1 change: 1 addition & 0 deletions contrib/ntp/sntp/libopts/proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#ifndef AUTOOPTS_PROTO_H_GUARD
#define AUTOOPTS_PROTO_H_GUARD 1

#include <stddef.h>

/*
* Static declarations from alias.c
Expand Down
1 change: 1 addition & 0 deletions contrib/subrepo-cheri-libunwind/src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define LIBUNWIND_CONFIG_H

#include <assert.h>
#include <stddef.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
Expand Down
1 change: 1 addition & 0 deletions crypto/heimdal/base/baselocl.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include <sys/select.h>
#endif

#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 2 additions & 0 deletions lib/libcheribsdtest_dynamic/cheribsdtest_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#ifndef _CHERIBSDTEST_DYNAMIC_H_
#define _CHERIBSDTEST_DYNAMIC_H_

#include <stddef.h>

void cheribsdtest_dynamic_dummy_func(void);
void (*cheribsdtest_dynamic_get_dummy_fptr(void))(void);
ptraddr_t cheribsdtest_dynamic_get_dummy_fptr_addr(void);
Expand Down
1 change: 1 addition & 0 deletions lib/libpmcstat/libpmcstat.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <sys/_cpuset.h>
#include <sys/queue.h>

#include <stddef.h>
#include <stdio.h>
#include <gelf.h>

Expand Down
1 change: 1 addition & 0 deletions lib/librt/sigev_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include <ucontext.h>
#include <sys/thr.h>
#include <stdatomic.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
1 change: 1 addition & 0 deletions sbin/kldstat/kldstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

#include <err.h>
#include <libutil.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
Expand Down
1 change: 1 addition & 0 deletions sys/cheri/cheri_cap_relocs.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*/

#include <sys/types.h>
#include <sys/stddef.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't sys/types.h include this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, include or define ptraddr_t itself

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Which would remove the need for a large chunk of this diff)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not strictly opposed (at least for internal source), but that's not the case for ptrdiff_t.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I was looking at (s)size_t, but indeed (u)intptr_t and ptrdiff_t are not. I guess the set of types in sys/types.h is the set that ye olde Unix systems defined, and then all these new-fangled types are only used by new code that knows about ISO C headers.

#include <cheri_init_globals.h>

/* Invoked from locore. */
Expand Down
1 change: 1 addition & 0 deletions sys/cheri/cheric.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#define _SYS_CHERIC_H_

#include <sys/cdefs.h>
#include <sys/stddef.h>
#include <sys/types.h>
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <stdbool.h>
Expand Down
2 changes: 2 additions & 0 deletions sys/cheri/revoke.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#ifndef __SYS_CHERI_REVOKE_H__
#define __SYS_CHERI_REVOKE_H__

#include <sys/stddef.h>

#if __has_feature(capabilities)
#include <cheri/cherireg.h> /* For CHERI_OTYPE_BITS */
#endif
Expand Down
11 changes: 11 additions & 0 deletions sys/compat/freebsd64/freebsd64_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ convert_sigevent64(const struct sigevent64 *sig64, struct sigevent *sig)
return (0);
}

static inline bool
is_magic_sighandler_constant(ptraddr_t handler) {
/*
* Instead of enumerating all the SIG_* constants, just check if
* it is a small (positive or negative) integer so that this doesn't
* break if someone adds a new SIG_* constant. The manual checks that
* we were using before weren't handling SIG_HOLD.
*/
return (handler < 64);
}

int
freebsd64_sigaction(struct thread *td, struct freebsd64_sigaction_args *uap)
{
Expand Down
1 change: 1 addition & 0 deletions sys/contrib/ck/include/ck_pr.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <ck_cc.h>
#include <ck_limits.h>
#include <ck_md.h>
#include <ck_stddef.h>
#include <ck_stdint.h>
#include <ck_stdbool.h>

Expand Down
7 changes: 1 addition & 6 deletions sys/contrib/subrepo-openzfs/include/sys/types.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
#include_next <sys/types.h>

#ifndef _PTRADDR_T_DECLARED
#ifdef __PTRADDR_TYPE__
typedef __PTRADDR_TYPE__ __ptraddr_t;
#else
typedef size_t __ptraddr_t;
#endif
typedef __ptraddr_t ptraddr_t;
typedef size_t ptraddr_t;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If our sys/types.h doesn't define it then OpenZFS's shouldn't really either...

#define _PTRADDR_T_DECLARED
#endif

Expand Down
11 changes: 0 additions & 11 deletions sys/sys/_stdint.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,9 @@ typedef kuintcap_t kuint64cap_t;
#define _KUINT64CAP_T_DECLARED
#endif

#ifndef _PTRADDR_T_DECLARED
typedef __ptraddr_t ptraddr_t;
#define _PTRADDR_T_DECLARED
#endif

/* Limits of ptraddr_t. */
#define PTRADDR_MAX SIZE_MAX

#ifndef _VADDR_T_DECLARED
__attribute__((__deprecated__("use ptraddr_t instead")))
typedef ptraddr_t vaddr_t;
#define _VADDR_T_DECLARED
#endif

#endif /* !_SYS__STDINT_H_ */
// CHERI CHANGES START
// {
Expand Down
1 change: 1 addition & 0 deletions sys/sys/atomic_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#error do not include this header, use machine/atomic.h
#endif

#include <sys/stddef.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this one for? The header doesn't use ptraddr_t AFAICT.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{arm64,riscv}/include/atomic.h use ptraddr_t and get sys/types.h from here.

#include <sys/types.h>

#define __atomic_load_bool_relaxed(p) (*(const volatile _Bool *)(p))
Expand Down
1 change: 1 addition & 0 deletions sys/sys/linker.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

#include <machine/elf.h>
#include <sys/kobj.h>
#include <sys/stddef.h>

#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_LINKER);
Expand Down
1 change: 1 addition & 0 deletions sys/sys/memrange.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#ifndef _SYS_MEMRANGE_H_
#define _SYS_MEMRANGE_H_

#include <sys/stddef.h>
#include <sys/ioccom.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetise


/* Memory range attributes */
Expand Down
1 change: 1 addition & 0 deletions sys/sys/pcpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <sys/queue.h>
#include <sys/_rmlock.h>
#include <sys/resource.h>
#include <sys/stddef.h>
#include <machine/pcpu.h>

#define DPCPU_SETNAME "set_pcpu"
Expand Down
1 change: 1 addition & 0 deletions sys/sys/pmclog.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#define _SYS_PMCLOG_H_

#include <sys/pmc.h>
#include <sys/stddef.h>

enum pmclog_type {
/* V1 ABI */
Expand Down
13 changes: 0 additions & 13 deletions sys/sys/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -540,19 +540,6 @@ __BEGIN_DECLS
__sighandler_t *signal(int, __sighandler_t *);
__END_DECLS

#if defined(_KERNEL) && defined(COMPAT_FREEBSD64)
static inline bool
is_magic_sighandler_constant(ptraddr_t handler) {
/*
* Instead of enumerating all the SIG_* constants, just check if
* it is a small (positive or negative) integer so that this doesn't
* break if someone adds a new SIG_* constant. The manual checks that
* we were using before weren't handling SIG_HOLD.
*/
return (handler < 64);
}
#endif

#endif /* !_SYS_SIGNAL_H_ */
// CHERI CHANGES START
// {
Expand Down
2 changes: 2 additions & 0 deletions sys/sys/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@

#include <sys/cdefs.h>
#ifdef _KERNEL
#include <sys/stddef.h>
#include <sys/stdint.h>
#else
#include <stddef.h>
#include <stdint.h>
#endif

Expand Down
1 change: 1 addition & 0 deletions sys/sys/user.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <sys/ucred.h>
#include <sys/uio.h>
#include <sys/queue.h>
#include <sys/stddef.h>
#include <sys/_lock.h>
#include <sys/_mutex.h>
#include <sys/proc.h>
Expand Down
1 change: 1 addition & 0 deletions sys/vm/uma_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

#include <sys/counter.h>
#include <sys/stddef.h>
#include <sys/_bitset.h>
#include <sys/_domainset.h>
#include <sys/_task.h>
Expand Down
1 change: 1 addition & 0 deletions usr.bin/truss/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@
#include <errno.h>
#include <signal.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

Check warning on line 53 in usr.bin/truss/setup.c

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
#include <string.h>
#include <sysdecode.h>
#include <time.h>
Expand Down
Loading