kal_sched.h File Reference

Abstraction of a task within the kernel abstraction layer (KAL). More...

#include <linux/aquosa/qos_debug.h>
#include <sys/types.h>
#include <linux/types.h>
#include "kal_generic.h"
#include "qos_list.h"

Go to the source code of this file.

Defines

#define TASK_RUNNING   0
#define set_tsk_need_resched(x)   do { need_resched = 1; } while (0)
#define for_each_task(t, pos)

Typedefs

typedef struct task_struct kal_task_t
typedef uid_t kal_uid_t
 the type of uid is uid_t in linux
typedef gid_t kal_gid_t
 the type of gid is gid_t in linux

Functions

static uid_t kal_get_current_uid (void)
 return the user id of the process currently executing
static gid_t kal_get_current_gid (void)
 return the group id of the process currently executing
void set_task_rr_prio (kal_task_t *p, int priority)
void kal_task_link_data (kal_task_t *task, void *data)
void kal_task_unlink_data (kal_task_t *task)
void * kal_task_get_data (kal_task_t *task)
int kal_task_get_id (kal_task_t *task)
int kal_task_ready (kal_task_t *task)

Variables

void * current
void * idle
int need_resched
struct list_head kernel_task_list
void(* block_hook )(struct task_struct *tsk)
void(* unblock_hook )(struct task_struct *tsk, long old_state)
void(* stop_hook )(struct task_struct *tsk)
void(* continue_hook )(struct task_struct *tsk, long old_state)
void(* fork_hook )(struct task_struct *tsk)
void(* cleanup_hook )(struct task_struct *tsk)
rwlock_t hook_lock

Detailed Description

Abstraction of a task within the kernel abstraction layer (KAL).

This module abstracts the concept of task/thread from the scheduler perspective. It allows to associate generic "opaque" data to a thread, to retrieve the numeric unique identifier of a thread, to retrieve the effective user and group identifier, to check if a task is ready to run, and to change a task scheduling policy so to force the kernel to schedule it.

Definition in file kal_sched.h.


Define Documentation

#define for_each_task ( t,
pos   ) 
Value:
for ((pos) = kernel_task_list.next, prefetch((pos)->next); \
        (t) = (list_entry((pos), struct task_struct, task_list)), (pos) != &kernel_task_list; \
                (pos) = (pos)->next, prefetch((pos)->next))

Definition at line 187 of file kal_sched.h.

Referenced by my_init_module(), and rres_attach_all_tasks_nosched().

#define set_tsk_need_resched (  )     do { need_resched = 1; } while (0)

Definition at line 167 of file kal_sched.h.

Referenced by kal_force_reschedule(), and rres_idle_cpu().

#define TASK_RUNNING   0

Definition at line 155 of file kal_sched.h.

Referenced by task_ready().


Typedef Documentation

typedef gid_t kal_gid_t

the type of gid is gid_t in linux

Definition at line 173 of file kal_sched.h.

typedef struct task_struct kal_task_t

Definition at line 159 of file kal_sched.h.

typedef uid_t kal_uid_t

the type of uid is uid_t in linux

Definition at line 170 of file kal_sched.h.


Function Documentation

static gid_t kal_get_current_gid ( void   )  [inline, static]

return the group id of the process currently executing

Definition at line 182 of file kal_sched.h.

static uid_t kal_get_current_uid ( void   )  [inline, static]

return the user id of the process currently executing

Definition at line 176 of file kal_sched.h.

Referenced by qsup_authorize_op().

void* kal_task_get_data ( kal_task_t task  ) 

Referenced by rres_fork_hook().

int kal_task_get_id ( kal_task_t task  ) 
void kal_task_link_data ( kal_task_t task,
void *  data 
)

Referenced by tasklist_init().

int kal_task_ready ( kal_task_t task  ) 
void kal_task_unlink_data ( kal_task_t task  ) 

Referenced by tasklist_cleanup().

void set_task_rr_prio ( kal_task_t p,
int  priority 
)

Definition at line 10 of file kal_sched.c.

Referenced by rres_init_sched_param(), and rres_task_sched_default().


Variable Documentation

void(* block_hook)(struct task_struct *tsk)
void(* cleanup_hook)(struct task_struct *tsk)

Definition at line 9 of file kal_sched.c.

Referenced by check_gensched_hooks(), set_gensched_hooks(), and unset_gensched_hooks().

void(* continue_hook)(struct task_struct *tsk, long old_state)
void* current

Definition at line 13 of file kal_sched.c.

Referenced by dispatch_task(), find_task(), stop_task(), test_rres_init_module(), and timer_thread().

void(* fork_hook)(struct task_struct *tsk)

Definition at line 8 of file kal_sched.c.

Referenced by check_gensched_hooks(), set_gensched_hooks(), and unset_gensched_hooks().

rwlock_t hook_lock
void* idle

Definition at line 14 of file kal_sched.c.

Referenced by stop_task().

struct list_head kernel_task_list

Definition at line 12 of file kal_sched.c.

Referenced by kal_init().

Definition at line 15 of file kal_sched.c.

void(* stop_hook)(struct task_struct *tsk)
void(* unblock_hook)(struct task_struct *tsk, long old_state)
Generated on Mon Aug 2 22:39:17 2010 for qosres by  doxygen 1.6.3