FreeBSD kernel kern code
ksched.c File Reference
#include <sys/cdefs.h>
#include "opt_posix.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/lock.h>
#include <sys/sysctl.h>
#include <sys/kernel.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/posix4.h>
#include <sys/resource.h>
#include <sys/sched.h>
Include dependency graph for ksched.c:

Go to the source code of this file.

Data Structures

struct  ksched
 

Macros

#define p4prio_to_rtpprio(P)   (RTP_PRIO_MAX - (P))
 
#define rtpprio_to_p4prio(P)   (RTP_PRIO_MAX - (P))
 
#define p4prio_to_tsprio(P)   ((PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE) - (P))
 
#define tsprio_to_p4prio(P)   ((PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE) - (P))
 
#define P1B_PRIO_MIN   rtpprio_to_p4prio(RTP_PRIO_MAX)
 
#define P1B_PRIO_MAX   rtpprio_to_p4prio(RTP_PRIO_MIN)
 

Functions

 __FBSDID ("$BSDSUniX$")
 
 FEATURE (kposix_priority_scheduling,"POSIX P1003.1B realtime extensions")
 
int ksched_attach (struct ksched **p)
 
int ksched_detach (struct ksched *ks)
 
static __inline int getscheduler (struct ksched *ksched, struct thread *td, int *policy)
 
int ksched_setparam (struct ksched *ksched, struct thread *td, const struct sched_param *param)
 
int ksched_getparam (struct ksched *ksched, struct thread *td, struct sched_param *param)
 
int ksched_setscheduler (struct ksched *ksched, struct thread *td, int policy, const struct sched_param *param)
 
int ksched_getscheduler (struct ksched *ksched, struct thread *td, int *policy)
 
int ksched_yield (struct ksched *ksched)
 
int ksched_get_priority_max (struct ksched *ksched, int policy, int *prio)
 
int ksched_get_priority_min (struct ksched *ksched, int policy, int *prio)
 
int ksched_rr_get_interval (struct ksched *ksched, struct thread *td, struct timespec *timespec)
 

Macro Definition Documentation

#define P1B_PRIO_MAX   rtpprio_to_p4prio(RTP_PRIO_MIN)

Definition at line 105 of file ksched.c.

Referenced by ksched_setscheduler().

#define P1B_PRIO_MIN   rtpprio_to_p4prio(RTP_PRIO_MAX)

Definition at line 104 of file ksched.c.

Referenced by ksched_get_priority_min(), and ksched_setscheduler().

#define p4prio_to_rtpprio (   P)    (RTP_PRIO_MAX - (P))

Definition at line 96 of file ksched.c.

Referenced by ksched_setscheduler().

#define p4prio_to_tsprio (   P)    ((PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE) - (P))

Definition at line 99 of file ksched.c.

Referenced by ksched_setscheduler().

#define rtpprio_to_p4prio (   P)    (RTP_PRIO_MAX - (P))

Definition at line 97 of file ksched.c.

Referenced by ksched_getparam().

#define tsprio_to_p4prio (   P)    ((PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE) - (P))

Definition at line 100 of file ksched.c.

Referenced by ksched_getparam().

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
FEATURE ( kposix_priority_scheduling  ,
"POSIX P1003.1B realtime extensions"   
)
static __inline int getscheduler ( struct ksched ksched,
struct thread *  td,
int *  policy 
)
static

Definition at line 108 of file ksched.c.

References pri_to_rtp().

Referenced by ksched_getscheduler(), and ksched_setparam().

Here is the call graph for this function:

Here is the caller graph for this function:

int ksched_attach ( struct ksched **  p)

Definition at line 62 of file ksched.c.

References ksched::rr_interval, and sched_rr_interval().

Here is the call graph for this function:

int ksched_detach ( struct ksched ks)

Definition at line 74 of file ksched.c.

int ksched_get_priority_max ( struct ksched ksched,
int  policy,
int *  prio 
)

Definition at line 240 of file ksched.c.

int ksched_get_priority_min ( struct ksched ksched,
int  policy,
int *  prio 
)

Definition at line 263 of file ksched.c.

References P1B_PRIO_MIN.

int ksched_getparam ( struct ksched ksched,
struct thread *  td,
struct sched_param *  param 
)

Definition at line 150 of file ksched.c.

References pri_to_rtp(), rtpprio_to_p4prio, and tsprio_to_p4prio.

Here is the call graph for this function:

int ksched_getscheduler ( struct ksched ksched,
struct thread *  td,
int *  policy 
)

Definition at line 225 of file ksched.c.

References getscheduler().

Here is the call graph for this function:

int ksched_rr_get_interval ( struct ksched ksched,
struct thread *  td,
struct timespec *  timespec 
)

Definition at line 286 of file ksched.c.

References ksched::rr_interval.

int ksched_setparam ( struct ksched ksched,
struct thread *  td,
const struct sched_param *  param 
)

Definition at line 133 of file ksched.c.

References getscheduler(), and ksched_setscheduler().

Here is the call graph for this function:

int ksched_setscheduler ( struct ksched ksched,
struct thread *  td,
int  policy,
const struct sched_param *  param 
)

Definition at line 179 of file ksched.c.

References P1B_PRIO_MAX, P1B_PRIO_MIN, p4prio_to_rtpprio, p4prio_to_tsprio, and rtp_to_pri().

Referenced by ksched_setparam().

Here is the call graph for this function:

Here is the caller graph for this function:

int ksched_yield ( struct ksched ksched)

Definition at line 233 of file ksched.c.

References sched_relinquish().

Here is the call graph for this function: