FreeBSD kernel kern code
kern_kthread.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/cpuset.h>
#include <sys/kthread.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/resourcevar.h>
#include <sys/rwlock.h>
#include <sys/signalvar.h>
#include <sys/sysent.h>
#include <sys/sx.h>
#include <sys/umtxvar.h>
#include <sys/unistd.h>
#include <sys/wait.h>
#include <sys/sched.h>
#include <sys/tslog.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <machine/stdarg.h>
Include dependency graph for kern_kthread.c:

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
void kproc_start (const void *udata)
 
int kproc_create (void(*func)(void *), void *arg, struct proc **newpp, int flags, int pages, const char *fmt,...)
 
void kproc_exit (int ecode)
 
int kproc_suspend (struct proc *p, int timo)
 
int kproc_resume (struct proc *p)
 
void kproc_suspend_check (struct proc *p)
 
void kthread_start (const void *udata)
 
int kthread_add (void(*func)(void *), void *arg, struct proc *p, struct thread **newtdp, int flags, int pages, const char *fmt,...)
 
void kthread_exit (void)
 
int kthread_suspend (struct thread *td, int timo)
 
int kthread_resume (struct thread *td)
 
void kthread_suspend_check (void)
 
int kproc_kthread_add (void(*func)(void *), void *arg, struct proc **procptr, struct thread **tdptr, int flags, int pages, const char *procname, const char *fmt,...)
 

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ kproc_create()

int kproc_create ( void(*)(void *)  func,
void *  arg,
struct proc **  newpp,
int  flags,
int  pages,
const char *  fmt,
  ... 
)

Definition at line 84 of file kern_kthread.c.

References cpuset_kernthread(), flags, fork1(), panic(), proc0, sched_add(), sched_prio(), sched_user_prio(), and vsnprintf().

Referenced by aio_newproc(), kproc_kthread_add(), kproc_start(), soaio_kproc_create(), and sys_acct().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kproc_exit()

void kproc_exit ( int  ecode)

Definition at line 148 of file kern_kthread.c.

References exit1(), initproc, proc_reparent(), proctree_lock, and wakeup().

Referenced by acct_thread(), aio_daemon(), ald_daemon(), and kthread_exit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kproc_kthread_add()

int kproc_kthread_add ( void(*)(void *)  func,
void *  arg,
struct proc **  procptr,
struct thread **  tdptr,
int  flags,
int  pages,
const char *  procname,
const char *  fmt,
  ... 
)

Definition at line 455 of file kern_kthread.c.

References buf, flags, kproc_create(), kthread_add(), and vsnprintf().

Referenced by idle_setup(), ithread_create(), ktls_init(), and start_softclock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kproc_resume()

int kproc_resume ( struct proc *  p)

Definition at line 197 of file kern_kthread.c.

References wakeup().

Referenced by syncer_resume().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kproc_start()

void kproc_start ( const void *  udata)

Definition at line 62 of file kern_kthread.c.

References kproc_create(), and panic().

Here is the call graph for this function:

◆ kproc_suspend()

int kproc_suspend ( struct proc *  p,
int  timo 
)

Definition at line 180 of file kern_kthread.c.

References wakeup().

Referenced by kproc_shutdown().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kproc_suspend_check()

void kproc_suspend_check ( struct proc *  p)

Definition at line 215 of file kern_kthread.c.

References wakeup().

Referenced by sched_sync(), and vnlru_proc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kthread_add()

int kthread_add ( void(*)(void *)  func,
void *  arg,
struct proc *  p,
struct thread **  newtdp,
int  flags,
int  pages,
const char *  fmt,
  ... 
)

Definition at line 255 of file kern_kthread.c.

References cpuset_kernthread(), flags, panic(), proc0, sched_add(), sched_fork_thread(), thread_alloc(), thread_cow_get_proc(), thread_link(), tidhash_add(), and vsnprintf().

Referenced by _gtaskqueue_start_threads(), _taskqueue_start_threads(), buf_daemon(), kproc_kthread_add(), and kthread_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kthread_exit()

void kthread_exit ( void  )

Definition at line 328 of file kern_kthread.c.

References kproc_exit(), tdsigcleanup(), thread_exit(), tidhash_remove(), umtx_thread_exit(), and wakeup().

Referenced by buf_daemon(), bufspace_daemon(), fork_exit(), gtaskqueue_thread_loop(), ithread_loop(), and taskqueue_thread_loop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kthread_resume()

int kthread_resume ( struct thread *  td)

Definition at line 399 of file kern_kthread.c.

References wakeup().

Here is the call graph for this function:

◆ kthread_start()

void kthread_start ( const void *  udata)

Definition at line 233 of file kern_kthread.c.

References kthread_add(), and panic().

Here is the call graph for this function:

◆ kthread_suspend()

int kthread_suspend ( struct thread *  td,
int  timo 
)

Definition at line 368 of file kern_kthread.c.

Referenced by kthread_shutdown().

Here is the caller graph for this function:

◆ kthread_suspend_check()

void kthread_suspend_check ( void  )

Definition at line 427 of file kern_kthread.c.

References panic(), and wakeup().

Here is the call graph for this function: