diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -254,7 +255,7 @@ * module. Finally, it allows for optional "kernel threads". */ void -mi_startup(void) +mi_startup(void) __NOCFI { struct sysinit *sip; int last; diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,7 @@ #include #include + #ifdef KDTRACE_HOOKS #include dtrace_fork_func_t dtrace_fasttrap_fork; @@ -1113,8 +1115,8 @@ * is called from the MD fork_trampoline() entry point. */ void -fork_exit(void (*callout)(void *, struct trapframe *), void *arg, - struct trapframe *frame) +fork_exit(void (*callout)(struct thread *, struct trapframe *), void *arg, + struct trapframe *frame) __NOCFI { struct proc *p; struct thread *td; diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -1187,7 +1188,7 @@ } static void -ithread_execute_handlers(struct proc *p, struct intr_event *ie) +ithread_execute_handlers(struct proc *p, struct intr_event *ie) __NOCFI { /* Interrupt handlers should not sleep. */ @@ -1334,7 +1335,7 @@ * o EINVAL: stray interrupt. */ int -intr_event_handle(struct intr_event *ie, struct trapframe *frame) +intr_event_handle(struct intr_event *ie, struct trapframe *frame) __NOCFI { struct intr_handler *ih; struct trapframe *oldframe; diff --git a/sys/kern/subr_epoch.c b/sys/kern/subr_epoch.c --- a/sys/kern/subr_epoch.c +++ b/sys/kern/subr_epoch.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -801,7 +802,7 @@ } static void -epoch_call_task(void *arg __unused) +epoch_call_task(void *arg __unused) __NOCFI { ck_stack_entry_t *cursor, *head, *next; ck_epoch_record_t *record; diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -1159,7 +1160,7 @@ */ static __always_inline struct pctrie_node * pctrie_reclaim_prune(struct pctrie_node **pnode, struct pctrie_node *parent, - pctrie_cb_t callback, int keyoff, void *arg) + pctrie_cb_t callback, int keyoff, void *arg) __NOCFI { struct pctrie_node *child, *node; int slot; @@ -1191,8 +1192,8 @@ * Recover the node parent from its first child and continue pruning. */ static __always_inline struct pctrie_node * -pctrie_reclaim_resume_compound(struct pctrie_node **pnode, - pctrie_cb_t callback, int keyoff, void *arg) +pctrie_reclaim_resume_compound(struct pctrie_node **pnode, pctrie_cb_t callback, + int keyoff, void *arg) __NOCFI { struct pctrie_node *parent, *node; @@ -1210,9 +1211,8 @@ * Find the trie root, and start pruning with a NULL parent. */ static __always_inline struct pctrie_node * -pctrie_reclaim_begin_compound(struct pctrie_node **pnode, - struct pctrie *ptree, - pctrie_cb_t callback, int keyoff, void *arg) +pctrie_reclaim_begin_compound(struct pctrie_node **pnode, struct pctrie *ptree, + pctrie_cb_t callback, int keyoff, void *arg) __NOCFI { struct pctrie_node *node; diff --git a/sys/kern/subr_scanf.c b/sys/kern/subr_scanf.c --- a/sys/kern/subr_scanf.c +++ b/sys/kern/subr_scanf.c @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -100,7 +101,7 @@ } int -vsscanf(const char *inp, char const *fmt0, va_list ap) +vsscanf(const char *inp, char const *fmt0, va_list ap) __NOCFI { int inr; const u_char *fmt = (const u_char *)fmt0; diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c --- a/sys/kern/subr_syscall.c +++ b/sys/kern/subr_syscall.c @@ -40,7 +40,9 @@ #include "opt_capsicum.h" #include "opt_ktrace.h" + #include +#include #include #include #ifdef KTRACE @@ -50,7 +52,7 @@ #include static inline void -syscallenter(struct thread *td) +syscallenter(struct thread *td) __NOCFI { struct proc *p; struct syscall_args *sa; diff --git a/sys/net/radix.c b/sys/net/radix.c --- a/sys/net/radix.c +++ b/sys/net/radix.c @@ -34,6 +34,7 @@ */ #include #ifdef _KERNEL +#include #include #include #include @@ -1055,7 +1056,7 @@ } int -rn_walktree(struct radix_head *h, walktree_f_t *f, void *w) +rn_walktree(struct radix_head *h, walktree_f_t *f, void *w) __NOCFI { int error; struct radix_node *base, *next; diff --git a/sys/net/vnet.c b/sys/net/vnet.c --- a/sys/net/vnet.c +++ b/sys/net/vnet.c @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include @@ -511,7 +511,7 @@ * and VNET_SYSUNINIT(). */ void -vnet_register_sysinit(void *arg) +vnet_register_sysinit(void *arg) __NOCFI { struct vnet_sysinit *vs, *vs2; struct vnet *vnet; diff --git a/sys/sys/proc.h b/sys/sys/proc.h --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1154,7 +1154,7 @@ struct session *sess); int enterthispgrp(struct proc *p, struct pgrp *pgrp); int fork1(struct thread *, struct fork_req *); -void fork_exit(void (*)(void *, struct trapframe *), void *, +void fork_exit(void (*)(struct thread *, struct trapframe *), void *, struct trapframe *); void fork_return(struct thread *, struct trapframe *); int inferior(struct proc *p); diff --git a/sys/sys/systm.h b/sys/sys/systm.h --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -144,7 +144,6 @@ int setjmp(struct _jmp_buf *) __returns_twice; void longjmp(struct _jmp_buf *, int) __dead2; int dumpstatus(vm_offset_t addr, off_t count); -int nullop(void); int eopnotsupp(void); int ureadc(int, struct uio *); void hashdestroy(void *, struct malloc_type *, u_long); diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk --- a/sys/tools/vnode_if.awk +++ b/sys/tools/vnode_if.awk @@ -199,6 +199,7 @@ "#include \n" \ "#include \n" \ "#include \n" \ + "#include \n" \ "\n" \ "SDT_PROVIDER_DECLARE(vfs);\n" \ "\n" \ @@ -389,7 +390,7 @@ printc(""); printc("\treturn(" uname "_APV(a->a_" args[0] "->v_op, a));"); printc("}"); - printc("\nint\n" uname "_APV(const struct vop_vector *vop, struct " name "_args *a)"); + printc("\nint\n" uname "_APV(const struct vop_vector *vop, struct " name "_args *a) __NOCFI"); printc("{"); printc("\tint rc;"); printc("");