Tizen RT Libs&Environment  v1.0 D5
sched.h File Reference
#include <tinyara/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <queue.h>
#include <signal.h>
#include <semaphore.h>
#include <pthread.h>
#include <mqueue.h>
#include <time.h>
#include <tinyara/irq.h>
#include <tinyara/mm/shm.h>
#include <tinyara/fs/fs.h>
#include <tinyara/net/net.h>
#include <arch/arch.h>
Include dependency graph for sched.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  entry_u
 This is the entry point into the main thread of the task or into a created pthread within the task. More...
 
struct  child_status_s
 This structure is used to maintin information about child tasks. pthreads work differently, they have join information. This is only for child tasks. More...
 
struct  dspace_s
 This structure describes a reference counted D-Space region. This must be a separately allocated "break-away" structure that can be owned by a task and any pthreads created by the task. More...
 
struct  task_group_s
 Structure for Task Group Information. More...
 
struct  tcb_s
 This is the common part of the task control block (TCB). The TCB is the heart of the TinyAra task-control logic. Each task or thread is represented by a TCB that includes these common definitions. More...
 
struct  task_tcb_s
 This is the particular form of the task control block (TCB) structure used by tasks (and kernel threads). There are two TCB forms: one for pthreads and one for tasks. Both share the common TCB fields (which must appear at the top of the structure) plus additional fields unique to tasks and threads. Having separate structures for tasks and pthreads adds some complexity, but saves memory in that it prevents pthreads from being burdened with the overhead required for tasks (and vice versa). More...
 
struct  pthread_tcb_s
 This is the particular form of the task control block (TCB) structure used by pthreads. There are two TCB forms: one for pthreads and one for tasks. Both share the common TCB fields (which must appear at the top of the structure) plus additional fields unique to tasks and threads. Having separate structures for tasks and pthreads adds some complexity, but saves memory in that it prevents pthreads from being burdened with the overhead required for tasks (and vice versa). More...
 

Macros

#define HAVE_TASK_GROUP   1
 
#define HAVE_GROUP_MEMBERS   1
 
#define NULL_TASK_PROCESS_ID   (pid_t)0
 
#define INVALID_PROCESS_ID   (pid_t)-1
 
#define MAX_LOCK_COUNT   127
 
#define TCB_FLAG_TTYPE_SHIFT   (0) /* Bits 0-1: thread type */
 
#define TCB_FLAG_TTYPE_MASK   (3 << TCB_FLAG_TTYPE_SHIFT)
 
#define TCB_FLAG_TTYPE_TASK   (0 << TCB_FLAG_TTYPE_SHIFT) /* Normal user task */
 
#define TCB_FLAG_TTYPE_PTHREAD   (1 << TCB_FLAG_TTYPE_SHIFT) /* User pthread */
 
#define TCB_FLAG_TTYPE_KERNEL   (2 << TCB_FLAG_TTYPE_SHIFT) /* Kernel thread */
 
#define TCB_FLAG_NONCANCELABLE   (1 << 2) /* Bit 2: Pthread is non-cancelable */
 
#define TCB_FLAG_CANCEL_PENDING   (1 << 3) /* Bit 3: Pthread cancel is pending */
 
#define TCB_FLAG_ROUND_ROBIN   (1 << 4) /* Bit 4: Round robin sched enabled */
 
#define TCB_FLAG_EXIT_PROCESSING   (1 << 5) /* Bit 5: Exitting */
 
#define GROUP_FLAG_NOCLDWAIT   (1 << 0) /* Bit 0: Do not retain child exit status */
 
#define GROUP_FLAG_ADDRENV   (1 << 1) /* Bit 1: Group has an address environment */
 
#define GROUP_FLAG_PRIVILEGED   (1 << 2) /* Bit 2: Group is privileged */
 
#define CHILD_FLAG_TTYPE_SHIFT   (0) /* Bits 0-1: child thread type */
 
#define CHILD_FLAG_TTYPE_MASK   (3 << CHILD_FLAG_TTYPE_SHIFT)
 
#define CHILD_FLAG_TTYPE_TASK   (0 << CHILD_FLAG_TTYPE_SHIFT) /* Normal user task */
 
#define CHILD_FLAG_TTYPE_PTHREAD   (1 << CHILD_FLAG_TTYPE_SHIFT) /* User pthread */
 
#define CHILD_FLAG_TTYPE_KERNEL   (2 << CHILD_FLAG_TTYPE_SHIFT) /* Kernel thread */
 
#define CHILD_FLAG_EXITED   (1 << 0) /* Bit 2: The child thread has exit'ed */
 
#define FIRST_READY_TO_RUN_STATE   TSTATE_TASK_READYTORUN
 
#define LAST_READY_TO_RUN_STATE   TSTATE_TASK_RUNNING
 
#define FIRST_BLOCKED_STATE   TSTATE_TASK_INACTIVE
 
#define LAST_BLOCKED_STATE   (NUM_TASK_STATES-1)
 
#define EXTERN   extern
 

Typedefs

typedef enum tstate_e tstate_t
 
typedef CODE void(* start_t) (void)
 
typedef union entry_u entry_t
 
typedef CODE void(* starthook_t) (FAR void *arg)
 
typedef CODE void(* atexitfunc_t) (void)
 
typedef CODE void(* onexitfunc_t) (int exitcode, FAR void *arg)
 
typedef void(* sched_foreach_t) (FAR struct tcb_s *tcb, FAR void *arg)
 

Enumerations

Functions

FAR struct tcb_ssched_self (void)
 returns the TCB of the currently running task (i.e., the caller) More...
 
void sched_foreach (sched_foreach_t handler, FAR void *arg)
 enumerate over each task and provide the TCB of each task or thread to a callback function. Interrupts will be disabled throughout this enumeration! More...
 
FAR struct tcb_ssched_gettcb (pid_t pid)
 Give a task ID, look up the corresponding TCB. More...
 

Macro Definition Documentation

#define CHILD_FLAG_EXITED   (1 << 0) /* Bit 2: The child thread has exit'ed */

Definition at line 171 of file sched.h.

#define CHILD_FLAG_TTYPE_KERNEL   (2 << CHILD_FLAG_TTYPE_SHIFT) /* Kernel thread */

Definition at line 170 of file sched.h.

#define CHILD_FLAG_TTYPE_MASK   (3 << CHILD_FLAG_TTYPE_SHIFT)

Definition at line 167 of file sched.h.

#define CHILD_FLAG_TTYPE_PTHREAD   (1 << CHILD_FLAG_TTYPE_SHIFT) /* User pthread */

Definition at line 169 of file sched.h.

#define CHILD_FLAG_TTYPE_SHIFT   (0) /* Bits 0-1: child thread type */

Definition at line 166 of file sched.h.

#define CHILD_FLAG_TTYPE_TASK   (0 << CHILD_FLAG_TTYPE_SHIFT) /* Normal user task */

Definition at line 168 of file sched.h.

#define EXTERN   extern

Definition at line 634 of file sched.h.

#define FIRST_BLOCKED_STATE   TSTATE_TASK_INACTIVE

Definition at line 213 of file sched.h.

#define FIRST_READY_TO_RUN_STATE   TSTATE_TASK_READYTORUN

Definition at line 211 of file sched.h.

#define GROUP_FLAG_ADDRENV   (1 << 1) /* Bit 1: Group has an address environment */

Definition at line 161 of file sched.h.

#define GROUP_FLAG_NOCLDWAIT   (1 << 0) /* Bit 0: Do not retain child exit status */

Definition at line 160 of file sched.h.

#define GROUP_FLAG_PRIVILEGED   (1 << 2) /* Bit 2: Group is privileged */

Definition at line 162 of file sched.h.

#define HAVE_GROUP_MEMBERS   1

Definition at line 94 of file sched.h.

#define HAVE_TASK_GROUP   1

Definition at line 93 of file sched.h.

#define INVALID_PROCESS_ID   (pid_t)-1

Definition at line 140 of file sched.h.

#define LAST_BLOCKED_STATE   (NUM_TASK_STATES-1)

Definition at line 214 of file sched.h.

#define LAST_READY_TO_RUN_STATE   TSTATE_TASK_RUNNING

Definition at line 212 of file sched.h.

#define MAX_LOCK_COUNT   127

Definition at line 144 of file sched.h.

#define NULL_TASK_PROCESS_ID   (pid_t)0

Definition at line 139 of file sched.h.

#define TCB_FLAG_CANCEL_PENDING   (1 << 3) /* Bit 3: Pthread cancel is pending */

Definition at line 154 of file sched.h.

#define TCB_FLAG_EXIT_PROCESSING   (1 << 5) /* Bit 5: Exitting */

Definition at line 156 of file sched.h.

#define TCB_FLAG_NONCANCELABLE   (1 << 2) /* Bit 2: Pthread is non-cancelable */

Definition at line 153 of file sched.h.

#define TCB_FLAG_ROUND_ROBIN   (1 << 4) /* Bit 4: Round robin sched enabled */

Definition at line 155 of file sched.h.

#define TCB_FLAG_TTYPE_KERNEL   (2 << TCB_FLAG_TTYPE_SHIFT) /* Kernel thread */

Definition at line 152 of file sched.h.

#define TCB_FLAG_TTYPE_MASK   (3 << TCB_FLAG_TTYPE_SHIFT)

Definition at line 149 of file sched.h.

#define TCB_FLAG_TTYPE_PTHREAD   (1 << TCB_FLAG_TTYPE_SHIFT) /* User pthread */

Definition at line 151 of file sched.h.

#define TCB_FLAG_TTYPE_SHIFT   (0) /* Bits 0-1: thread type */

Definition at line 148 of file sched.h.

#define TCB_FLAG_TTYPE_TASK   (0 << TCB_FLAG_TTYPE_SHIFT) /* Normal user task */

Definition at line 150 of file sched.h.

Typedef Documentation

typedef CODE void(* atexitfunc_t) (void)

Definition at line 240 of file sched.h.

typedef union entry_u entry_t

Definition at line 227 of file sched.h.

typedef CODE void(* onexitfunc_t) (int exitcode, FAR void *arg)

Definition at line 244 of file sched.h.

typedef void(* sched_foreach_t) (FAR struct tcb_s *tcb, FAR void *arg)

Definition at line 620 of file sched.h.

typedef CODE void(* start_t) (void)

Definition at line 218 of file sched.h.

typedef CODE void(* starthook_t) (FAR void *arg)

Definition at line 232 of file sched.h.

typedef enum tstate_e tstate_t

Definition at line 207 of file sched.h.

Enumeration Type Documentation

enum tstate_e

This is the type of the task_state field of the TCB. NOTE: the order and content of this enumeration is critical since there are some OS tables indexed by these values. The range of values is assumed to fit into a uint8_t in struct tcb_s.

Enumerator
TSTATE_TASK_INVALID 
TSTATE_TASK_PENDING 
TSTATE_TASK_READYTORUN 
TSTATE_TASK_RUNNING 
TSTATE_TASK_INACTIVE 
TSTATE_WAIT_SEM 
TSTATE_WAIT_SIG 
TSTATE_WAIT_MQNOTEMPTY 
TSTATE_WAIT_MQNOTFULL 
NUM_TASK_STATES 

Definition at line 187 of file sched.h.