Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

rt_scheduler_rk.c File Reference


Detailed Description

TimeSys Linux implementation of the rt_scheduler interface.

Definition in file rt_scheduler_rk.c.

Include dependency graph for rt_scheduler_rk.c:

Include dependency graph

Go to the source code of this file.

Classes

struct  rts_schedulable_rk
 The TimeSys implementation of a schedulable. More...

Defines

#define MAX_RK_SETS   128

Typedefs

typedef rts_schedulable_rkrts_schedulable_rk_t
 The TimeSys implementation of a schedulable.

Enumerations

enum  { RSRB_OWNER }
enum  { RSRF_OWNER = (1L << RSRB_OWNER) }

Functions

void rts_repair_resource_sets (void)
 "Repair" the system by deleting any resource sets that have a CPU reserve but no processes.
int rts_query_scheduler (rts_scheduler_data_t rsd)
 Get information about the underlying scheduler.
int rts_grab_schedulable (rts_schedulable_t *rs, pid_t member, const char *name)
 Grab a reference to a schedulable entity.
int rts_release_schedulable (rts_schedulable_t rs)
 Release a reference to a schedulable entity.
int rts_set_schedule (rts_schedulable_t rsa, rts_schedule_t rs)
 Set the real-time schedule for a schedulable.
int rts_get_schedule (rts_schedulable_t rsa, rts_schedule_t rs_out)
 Get the real-time schedule for a schedulable.
int rts_clear_schedule (rts_schedulable_t rsa)
 Clear the real-time schedule for a schedulable and return it to a best-effort scheduler.


Typedef Documentation

typedef struct rts_schedulable_rk * rts_schedulable_rk_t
 

The TimeSys implementation of a schedulable.

rsr_ResourceSet - The resource set this schedulable maps to. rsr_CPUReserve - The CPU reserve connected to the resource set or NULL if one has not yet been attached. rsr_Flags - Field used to store any RSRF_ flags.

Referenced by rts_clear_schedule(), rts_get_schedule(), rts_grab_schedulable(), rts_release_schedulable(), and rts_set_schedule().


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
RSRF_OWNER  The schedulable owns the resource set, it was not discovered.

Definition at line 33 of file rt_scheduler_rk.c.


Function Documentation

int rts_clear_schedule rts_schedulable_t  rsa  ) 
 

Clear the real-time schedule for a schedulable and return it to a best-effort scheduler.

Parameters:
rsa The schedulable to clear.
Returns:
Zero on success, otherwise, an errno code.

Definition at line 334 of file rt_scheduler_rk.c.

References rk_cpu_reserve_delete(), rts_schedulable_rk::rsr_CPUReserve, rts_schedulable_rk::rsr_ResourceSet, and rts_schedulable_rk_t.

Referenced by WeightedPolicyImpl::RedistributeCPU(), StrictPolicyImpl::RedistributeCPU(), WeightedPolicyImpl::RemoveTask(), and StrictPolicyImpl::RemoveTask().

Here is the call graph for this function:

int rts_get_schedule rts_schedulable_t  rsa,
rts_schedule_t  rs_out
 

Get the real-time schedule for a schedulable.

Parameters:
rsa The schedulable to schedule.
rs_out The new schedule.
Returns:
Zero on success, otherwise, an errno code.

Definition at line 283 of file rt_scheduler_rk.c.

References cpu_reserve_attr::compute_time, ensure, cpu_reserve_attr::period, cpu_reserve_attr::reserve_type, rk_cpu_reserve_get_attr(), rts_schedulable_rk::rsr_CPUReserve, rts_schedulable_rk::rsr_ResourceSet, RSV_HARD, RSV_SOFT, rts_schedulable_rk_t, and rk_reserve_param::sch_mode.

Here is the call graph for this function:

int rts_grab_schedulable rts_schedulable_t rs_out,
pid_t  member,
const char *  name
 

Grab a reference to a schedulable entity.

The current semantics of this function are as follows:

  • If necessary, the function must make some effort to "repair" the system state by destroying schedulables that are in a suspicious state.
  • Multiple calls to this function with the same parameters need not return the same pointer, however, their values must be equal. The user must also release the schedulables in the opposite order in which they were grabbed.
  • If the schedulable entity already exists at the OS-level, it should be used instead of creating a new one.
  • If no schedulable entity exists that contains the given process or has the given name, one should be created.
Parameters:
rs_out A pointer that should be filled out with the schedulable value.
member A process that is already a member of the schedulable, one that should be added to a newly created schedulable, or -1 if the schedulable should be created by name.
name The name for the schedulable or NULL if one should be made up.
Returns:
Zero on success, otherwise, an errno code.

Definition at line 94 of file rt_scheduler_rk.c.

References rk_cpu_reserve_delete(), rk_proc_get_rset(), rk_reserve_t, rk_resource_set_attach_process(), rk_resource_set_create(), rk_resource_set_get_by_name(), rk_resource_set_get_cpu_rsv(), rk_resource_set_get_num_procs(), rts_schedulable_rk::rsr_Flags, rts_schedulable_rk::rsr_ResourceSet, rts_release_schedulable(), rts_repair_resource_sets(), and rts_schedulable_rk_t.

Referenced by WeightedPolicyImpl::AddTask(), StrictPolicyImpl::AddTask(), and main().

Here is the call graph for this function:

int rts_query_scheduler rts_scheduler_data_t  rsd_out  ) 
 

Get information about the underlying scheduler.

This function is mostly about making it possible to do run-time adaptation to the scheduler's capabilities.

Parameters:
rsd_out A reference to an #rts_scheduler_data object that should be filled in.

Definition at line 78 of file rt_scheduler_rk.c.

Referenced by main().

int rts_release_schedulable rts_schedulable_t  rs  ) 
 

Release a reference to a schedulable entity.

The current semantics of this function are as follows:

  • If the given schedulable created the OS-level entity, this call should destroy it.
  • If the given schedulable entity was used to set the schedule, this call should clear the schedule.
Parameters:
rs The reference from rts_grab_schedulable to release.
Returns:
Zero on success, otherwise an errno value.

Definition at line 182 of file rt_scheduler_rk.c.

References rk_cpu_reserve_delete(), rk_resource_set_destroy(), rts_schedulable_rk::rsr_CPUReserve, rts_schedulable_rk::rsr_Flags, rts_schedulable_rk::rsr_ResourceSet, and rts_schedulable_rk_t.

Referenced by main(), WeightedPolicyImpl::RemoveTask(), StrictPolicyImpl::RemoveTask(), and rts_grab_schedulable().

Here is the call graph for this function:

int rts_set_schedule rts_schedulable_t  rsa,
rts_schedule_t  rs
 

Set the real-time schedule for a schedulable.

Parameters:
rsa The schedulable to schedule.
rs The new schedule.
Returns:
Zero on success, otherwise, an errno code.

Definition at line 211 of file rt_scheduler_rk.c.

References cpu_reserve_attr::compute_time, cpu_reserve_attr::deadline, rk_reserve_param::enf_mode, ensure, cpu_reserve_attr::period, rk_reserve_param::rep_mode, cpu_reserve_attr::reserve_type, rk_cpu_reserve_create(), rk_cpu_reserve_ctl(), rk_resource_set_get_cpu_rsv(), rts_schedulable_rk::rsr_CPUReserve, rts_schedulable_rk::rsr_ResourceSet, RTS_RSV_HARD, RTS_RSV_SOFT, rts_schedulable_rk_t, and rk_reserve_param::sch_mode.

Referenced by WeightedPolicyImpl::RedistributeCPU(), and StrictPolicyImpl::RedistributeCPU().

Here is the call graph for this function:


Generated on Fri Oct 22 07:50:53 2004 for CPU Broker by  doxygen 1.3.9.1